Type Alias riot_sys::shell_command_handler_t

source ·
pub type shell_command_handler_t = Option<unsafe extern "C" fn(argc: c_int, argv: *mut *mut c_char) -> c_int>;
Expand description

@brief Prototype of a shell callback handler. @details The functions supplied to shell_run() must use this signature. It is designed to mimic the function signature of main(). For this reason, the argument list is terminated with a NULL, i.e argv[argc] == NULL (which is an ANSI-C requirement, and a detail that newlib’s getopt() implementation relies on). The function name is passed in argv[0].

             Escape sequences are removed before the function is called.

             The called function may edit `argv` and the contained strings,
             but it must be taken care of not to leave the boundaries of the array.
             This functionality is another property that many `getopt()`
             implementations rely on to provide their so-called "permute"
             feature extension.

@param[in] argc Number of arguments supplied to the function invocation. @param[in] argv The supplied argument list.

@return 0 on success @return Anything else on failure

Aliased Type§

enum shell_command_handler_t {
    None,
    Some(unsafe extern "C" fn(_: i32, _: *mut *mut u8) -> i32),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(_: i32, _: *mut *mut u8) -> i32)

Some value of type T.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 4 bytes

Size for each variant:

  • None: 0 bytes
  • Some: 4 bytes