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

options.c File Reference


Detailed Description

Options parsing.

Author:
Raphael Manfredi
Date:
2007

#include "common.h"
#include "options.h"
#include "glib-missing.h"
#include "misc.h"
#include "override.h"

Enumerations

enum  { OPTION_F_VALID = 1 << 0, OPTION_F_VALUE = 1 << 1 }

Functions

option_toption_lookup (gchar letter, option_t *ovec, gint osize)
 Locate the option letter in the vector array, returning the pointer to the entry if found, or NULL if it wasn't.
const gchar * options_parse_last_error (void)
 Returns error string resulting from the last call to options_parse().
gint options_parse (const gchar *argv[], option_t *ovec, gint osize)
 Parse the arguments, looking for specific single-letter options.

Variables

gchar error_string [80]


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
OPTION_F_VALID 
OPTION_F_VALUE 


Function Documentation

option_t* option_lookup gchar  letter,
option_t ovec,
gint  osize
[static]
 

Locate the option letter in the vector array, returning the pointer to the entry if found, or NULL if it wasn't.

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().


Variable Documentation

gchar error_string[80] [static]
 


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