Macros | Functions | Variables
options.c File Reference
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/param.h>
#include <ctype.h>
#include <sys/stat.h>
#include <unistd.h>
#include <libgen.h>
#include <string.h>
#include "options.h"
Include dependency graph for options.c:

Go to the source code of this file.

Macros

#define MAX_LINE_LENGTH   10000
 

Functions

void display_table (FILE *f, char **table, int rows, int columns, int padding)
 
int get_double (double *p, const char *s)
 
int get_int (int *p, const char *s)
 
void options_banner (const char *message)
 
void options_dump (struct option *options, FILE *f, int write_desc)
 
struct optionoptions_find (struct option *ops, const char *name)
 
int options_parse_args (struct option *ops, int argc, const char *argv[])
 
int options_parse_file (struct option *ops, const char *pwd, const char *filename)
 
int options_parse_stream (struct option *ops, const char *pwd, FILE *file)
 
void options_print_help (struct option *options, FILE *f)
 
int options_requires_argument (struct option *o)
 
int options_set (struct option *o, const char *value)
 
void options_set_passed (struct option *o)
 
int options_try_pair (struct option *ops, const char *name, const char *value)
 
int options_valid (struct option *o)
 
const char * options_value_as_string (struct option *o)
 
char * strdup_ (const char *s)
 

Variables

const char * options_banner_string = ""
 
int options_tolerant = 0
 
static char options_value_as_string_buf [1000]
 

Macro Definition Documentation

#define MAX_LINE_LENGTH   10000

Function Documentation

void display_table ( FILE *  f,
char **  table,
int  rows,
int  columns,
int  padding 
)

Definition at line 306 of file options.c.

int get_double ( double *  p,
const char *  s 
)

Return 1 if ok.

Definition at line 58 of file options.c.

int get_int ( int *  p,
const char *  s 
)

Return 1 if ok.

Definition at line 47 of file options.c.

void options_banner ( const char *  message)

User-friendly interface

Definition at line 33 of file options.c.

void options_dump ( struct option options,
FILE *  f,
int  write_desc 
)

Definition at line 332 of file options.c.

struct option* options_find ( struct option ops,
const char *  name 
)

Finds an option in the array. Returns 0 if not found.

Definition at line 219 of file options.c.

int options_parse_args ( struct option ops,
int  argc,
const char *  argv[] 
)

Returns 0 on error

Definition at line 66 of file options.c.

int options_parse_file ( struct option ops,
const char *  pwd,
const char *  file 
)

Returns 0 on error

Definition at line 180 of file options.c.

int options_parse_stream ( struct option ops,
const char *  pwd,
FILE *  file 
)

Definition at line 131 of file options.c.

void options_print_help ( struct option options,
FILE *  f 
)

Definition at line 398 of file options.c.

int options_requires_argument ( struct option o)

Returns true if the option needs an argument

Definition at line 126 of file options.c.

int options_set ( struct option op,
const char *  value 
)

Returns 0 on error.

Definition at line 242 of file options.c.

void options_set_passed ( struct option o)

Flags the option as passed

Definition at line 120 of file options.c.

int options_try_pair ( struct option ops,
const char *  name,
const char *  value 
)

Returns 0 on error

Definition at line 228 of file options.c.

int options_valid ( struct option o)

Definition at line 238 of file options.c.

const char * options_value_as_string ( struct option o)

Definition at line 411 of file options.c.

char* strdup_ ( const char *  s)

Our version of strdup.

Definition at line 38 of file options.c.

Variable Documentation

const char* options_banner_string = ""

Definition at line 31 of file options.c.

int options_tolerant = 0

Definition at line 64 of file options.c.

char options_value_as_string_buf[1000]
static

Definition at line 410 of file options.c.



csm
Author(s): Andrea Censi
autogenerated on Tue May 11 2021 02:18:23