Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

options.h File Reference


Detailed Description

Options parsing.

Author:
Raphael Manfredi
Date:
2007

#include "common.h"

Go to the source code of this file.

Data Structures

struct  option
 Option description structure for single-letter options. More...

Typedefs

typedef option option_t
 Option description structure for single-letter options.

Functions

gint options_parse (const gchar *argv[], option_t *ovec, gint osize)
 Parse the arguments, looking for specific single-letter options.
const gchar * options_parse_last_error (void)
 Returns error string resulting from the last call to options_parse().


Typedef Documentation

typedef struct option option_t
 

Option description structure for single-letter options.

An option letter consists of an initial letter, followed by ":" if it takes an argument.

The value is a pointer to a variable that will get filled with NULL if the option is not present, with a pointer to a static empty string if the option is found and does not have any argument, or with the actual value.


Function Documentation

gint options_parse const gchar *  argv[],
option_t ovec,
gint  osize
 

Parse the arguments, looking for specific single-letter options.

Whenever an option is found, the value in the option_t vector is set.

Options start with a "-" and option parsing stops when "--" is encountered. Several argumentless options can be concatenated together after the initial "-". The value of the option can immediately follow the option letter, or be given by the next argument.

Unrecognized options or missing arguments stop processing.

Parameters:
argv the initial argument vector
ovec the single-letter option description vector
osize the amount of entries in ovec
Returns:
The number of options processed and validated, -1 on error.

const gchar* options_parse_last_error void   ) 
 

Returns error string resulting from the last call to options_parse().


Generated on Sat Jun 30 17:53:29 2007 for gtk-gnutella by  doxygen 1.3.9.1