#include <stdio.h>
Go to the source code of this file.
Classes | |
struct | option |
struct | option_alternative |
Macros | |
#define | OPTIONS_NAME_MAXSIZE 32 |
#define | OPTIONS_VALUE_MAXSIZE 256 |
Enumerations | |
enum | option_type { OPTION_STRING =0, OPTION_INT =1, OPTION_DOUBLE =2, OPTION_ALTERNATIVE =3 } |
Functions | |
int | get_double (double *p, const char *s) |
int | get_int (int *p, const char *s) |
struct option * | options_allocate (int n) |
void | options_alternative (struct option *, const char *name, struct option_alternative *alt, int *value, const char *desc) |
void | options_banner (const char *message) |
void | options_double (struct option *, const char *name, double *p, double def_value, const char *desc) |
void | options_dump (struct option *options, FILE *f, int write_desc) |
struct option * | options_find (struct option *ops, const char *name) |
void | options_int (struct option *, const char *name, int *p, int def_value, const char *desc) |
struct option * | options_next_empty (struct option *ops) |
int | options_parse_args (struct option *ops, int argc, const char *argv[]) |
int | options_parse_file (struct option *ops, const char *pwd, const char *file) |
int | options_parse_stream (struct option *ops, const char *pwd, FILE *file) |
void | options_print_help (struct option *ops, FILE *where) |
int | options_requires_argument (struct option *o) |
int | options_set (struct option *op, const char *value) |
void | options_set_passed (struct option *o) |
void | options_string (struct option *, const char *name, const char **p, const char *def_balue, const char *desc) |
int | options_try_pair (struct option *ops, const char *name, const char *value) |
int | options_valid (struct option *op) |
char * | strdup_ (const char *s) |
enum option_type |
int get_double | ( | double * | p, |
const char * | s | ||
) |
struct option* options_allocate | ( | int | n | ) |
User-friendly interface
Definition at line 16 of file options_interface.c.
void options_alternative | ( | struct option * | , |
const char * | name, | ||
struct option_alternative * | alt, | ||
int * | value, | ||
const char * | desc | ||
) |
Definition at line 49 of file options_interface.c.
void options_banner | ( | const char * | message | ) |
void options_double | ( | struct option * | , |
const char * | name, | ||
double * | p, | ||
double | def_value, | ||
const char * | desc | ||
) |
Definition at line 62 of file options_interface.c.
void options_dump | ( | struct option * | options, |
FILE * | f, | ||
int | write_desc | ||
) |
void options_int | ( | struct option * | , |
const char * | name, | ||
int * | p, | ||
int | def_value, | ||
const char * | desc | ||
) |
Definition at line 39 of file options_interface.c.
Definition at line 30 of file options_interface.c.
int options_parse_args | ( | struct option * | ops, |
int | argc, | ||
const char * | argv[] | ||
) |
int options_parse_file | ( | struct option * | ops, |
const char * | pwd, | ||
const char * | file | ||
) |
int options_parse_stream | ( | struct option * | ops, |
const char * | pwd, | ||
FILE * | file | ||
) |
void options_print_help | ( | struct option * | ops, |
FILE * | where | ||
) |
int options_requires_argument | ( | struct option * | o | ) |
int options_set | ( | struct option * | op, |
const char * | value | ||
) |
void options_set_passed | ( | struct option * | o | ) |
void options_string | ( | struct option * | , |
const char * | name, | ||
const char ** | p, | ||
const char * | def_balue, | ||
const char * | desc | ||
) |
Definition at line 72 of file options_interface.c.
int options_try_pair | ( | struct option * | ops, |
const char * | name, | ||
const char * | value | ||
) |