Skip to main content

Bela_getopt_long

Function Bela_getopt_long 

Source
pub unsafe extern "C" fn Bela_getopt_long(
    argc: c_int,
    argv: *const *mut c_char,
    customShortOptions: *const c_char,
    customLongOptions: *const option,
    settings: *mut BelaInitSettings,
) -> c_int
Expand description

\brief Get long options from command line argument list, including Bela standard options

This function should be used in main() to process command line options, in place of the standard library getopt_long(). Internally, it parses standard Bela command-line options, storing the results in the settings data structure. Any options which are not part of the Bela standard options will be returned, as they would normally be in getopt_long().

\param argc Number of command line options, as passed to main(). \param argv Array of command line options, as passed to main(). \param customShortOptions List of short options to be parsed, analogous to getopt_long(). This list should not include any characters already parsed as part of the Bela standard options. \param customLongOptions List of long options to parsed, analogous to getopt_long(). This list should not include any long options already parsed as part of the Bela standard options. \param settings Data structure holding initialisation settings for Bela. Any standard options parsed will automatically update this data structure.

\return Value of the next option parsed which is not a Bela standard option, or -1 when the argument list has been exhausted. Similar to the return value of getopt_long() except that Bela standard options are handled internally and not returned.