"Fossies" - the Fresh Open Source Software Archive

Member "quotactl-1.00/giraffe/include/cmdline_parser.h" (14 Aug 2005, 1639 Bytes) of package /linux/privat/old/quotactl-1.00.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "cmdline_parser.h" see the Fossies "Dox" file reference documentation.

    1 #ifndef CMDLINE_PARSER_H
    2 #define CMDLINE_PARSER_H
    3 
    4 #include <features.h> // for __BEGIN_DECLS
    5 __BEGIN_DECLS
    6 
    7 /*
    8 
    9    NOTE NOTE NOTE: cmd_getOptionValueString() and
   10    cmd_getArgument() return malloc'ed memory (and abort the program if
   11    out of memory).  You must free it.
   12 
   13 */
   14 
   15 enum optiontype {
   16     OPTTYPE_FLAG,
   17     OPTTYPE_INT,
   18     OPTTYPE_UINT,
   19     OPTTYPE_STRING,
   20     OPTTYPE_BINUINT
   21 };
   22 
   23 struct cmdlineParserCtl;
   24 
   25 typedef struct cmdlineParserCtl * cmdlineParser;
   26 
   27 void
   28 cmd_processOptions(cmdlineParser const cpP,
   29                    int           const argc,
   30                    char **       const argv, 
   31                    const char ** const errorP);
   32 
   33 cmdlineParser
   34 cmd_createOptionParser(void);
   35 
   36 void
   37 cmd_destroyOptionParser(cmdlineParser const cpP);
   38 
   39 void
   40 cmd_defineOption(cmdlineParser   const cpP,
   41                  const char *    const name, 
   42                  enum optiontype const type);
   43     
   44 int
   45 cmd_optionIsPresent(cmdlineParser const cpP,
   46                     const char *  const name);
   47 
   48 unsigned int
   49 cmd_getOptionValueUint(cmdlineParser const cpP,
   50                        const char *  const name);
   51 
   52 int
   53 cmd_getOptionValueInt(cmdlineParser const cpP,
   54                       const char *  const name);
   55 
   56 unsigned long long
   57 cmd_getOptionValueBinUint(cmdlineParser const cpP,
   58                           const char *  const name);
   59 
   60 const char *
   61 cmd_getOptionValueString(cmdlineParser const cpP,
   62                          const char *  const name);
   63 
   64 unsigned int 
   65 cmd_argumentCount(cmdlineParser const cpP);
   66 
   67 const char * 
   68 cmd_getArgument(cmdlineParser const cpP, 
   69                 unsigned int  const argNumber); 
   70 
   71 __END_DECLS
   72 
   73 #endif