Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
getopt.h File Reference

Go to the source code of this file.

Data Structures

struct  ncp_option


#define OPT_NOPARAM   1
#define OPT_INT   2
#define OPT_STRING   4


int ncp_getopt (const char *caller, char **options, const struct ncp_option *opts, char **optopt, char **optarg, unsigned long *value)

Macro Definition Documentation

#define OPT_INT   2

Definition at line 5 of file getopt.h.

#define OPT_NOPARAM   1

Definition at line 4 of file getopt.h.

#define OPT_STRING   4

Definition at line 6 of file getopt.h.

Function Documentation

int ncp_getopt ( const char caller,
char **  options,
const struct ncp_option opts,
char **  optopt,
char **  optarg,
unsigned long value 

ncp_getopt - option parser : name of the caller, for error messages : the options string : an array of &struct option entries controlling parser operations : output; will contain the current option : output; will contain the value (if one exists) : output; may be NULL; will be overwritten with the integer value of the current argument.

Helper to parse options on the format used by mount ("a=b,c=d,e,f"). Returns opts->val if a matching entry in the 'opts' array is found, 0 when no more tokens are found, -1 if an error is encountered.

Definition at line 26 of file getopt.c.