Main Page | Data Structures | File List | Data Fields | Globals

popts.c File Reference

#include "popts.h"

Functions

void popts_init (void)
void popts_description_add (unsigned int letterid, unsigned int wordid, char *desc)
unsigned int popts_letter_add (char sl, OType ot, void *var)
unsigned int popts_word_add (char *sw, OType ot, void *var)
void popts_help_add (void)
void popts_descriptions_print (void)
int popts_parse (int argc, char **argv)
void popts_done (void)

Detailed Description

Command line options parser, v0.3

Function Documentation

void popts_description_add unsigned int  letterid,
unsigned int  wordid,
char *  desc
 

Parameters:
letterid The ID of the letter option.
wordid The ID of the word option.
desc The description to print.
Description:
Adds a description to the list of current descriptions. Descriptions can only span a single letter or word. Though a letter and a word can share a description.

void popts_descriptions_print void   ) 
 

Description:
Prints out the desriptions in alphabetical order of the letter options.

void popts_done void   ) 
 

Description:
Frees the letter, word and description lists.

void popts_help_add void   ) 
 

Description:
Adds the -h and --help options to display the descriptions. Trys to be sane about it.
Note:
if -h or --help is allready assigned this function will not reasign them. If both -h and --help are assigned then nothing is done.

void popts_init void   ) 
 

Description:
Deprecated, do not call this function in new programs.

unsigned int popts_letter_add char  sl,
OType  ot,
void *  var
 

Parameters:
sl The search letter.
ot The expected data type.
var The variable to manipulate.
Return values:
int The ID of the added letter option.
0 On error.
Description:
Appends a letter to the list of letters to search for.

int popts_parse int  argc,
char **  argv
 

Parameters:
argc The number of arguments.
argv The string array of the arguments.
Return values:
#TRUE On successful parse.
#FALSE On failure to parse.
Description:
Parses arguments given from the commad line and maps to the options specified by the letter add word search lists.

unsigned int popts_word_add char *  sw,
OType  ot,
void *  var
 

Parameters:
sw The search word.
ot The expected data type.
var The variable to manipulate.
Return values:
int The ID of the added word option.
0 On error.
Description:
Appends a word to the list of words to search for.


Generated on Fri Jun 4 18:35:20 2004 for cuf by doxygen 1.3.6