icmpmonitor  1.2
About: Multiple host monitoring tool (using the InterNet Control Message Protocol "ECHO" facility)
  Fossies Dox: icmpmonitor-1.2.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

 All Data Structures Files Functions Variables Typedefs Macros
cfg.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Dict
 
struct  Cfg
 

Functions

struct Cfgreadcfg (const char *filename)
 
int writecfg (const char *filename, struct Cfg *)
 
char * cfgfind (const char *, struct Cfg *, int offset)
 
void freecfg (struct Cfg *)
 
struct Cfgnewcfg ()
 
void sortcfg (struct Cfg *)
 
void cfg_add_entry (struct Cfg *, struct Dict *)
 
void cfg_new_entry (struct Cfg *cfg, const char *name,...)
 
void cfg_new_ulong_entry (struct Cfg *cfg, const char *name, unsigned long v)
 
void cfg_new_fmt_ulong_entry (struct Cfg *cfg, const char *name, unsigned long v, int w)
 

Function Documentation

void cfg_add_entry ( struct Cfg cfg,
struct Dict d 
)

Adds new cfg entry to the end of the dictionary. you need to call sortcfg() before it could be really used.

Definition at line 292 of file cfg.c.

References Cfg::dict, Cfg::dict, Cfg::dict, Cfg::dict, Cfg::dict, Cfg::dict, Cfg::nelements, Cfg::nelements, Cfg::nelements, Cfg::nelements, Cfg::nelements, and Cfg::nelements.

Referenced by cfg_new_entry(), and readcfg().

void cfg_new_entry ( struct Cfg cfg,
const char *  name,
  ... 
)

Adds entry with given name and list of values. list should be terminated with NULL and contain only const char pointers.

Definition at line 317 of file cfg.c.

References cfg_add_entry(), Dict::name, Dict::nvalues, Dict::value, Dict::value, and Dict::value.

Referenced by cfg_new_fmt_ulong_entry(), and cfg_new_ulong_entry().

void cfg_new_fmt_ulong_entry ( struct Cfg cfg,
const char *  name,
unsigned long  v,
int  w 
)

add long extended to 'w' chars, with added trailing zeros.

Parameters
v- field value
w- field width

Definition at line 361 of file cfg.c.

References cfg_new_entry().

void cfg_new_ulong_entry ( struct Cfg cfg,
const char *  name,
unsigned long  v 
)

Definition at line 348 of file cfg.c.

References cfg_new_entry().

char* cfgfind ( const char *  ,
struct Cfg ,
int  offset 
)

Definition at line 44 of file cfg.c.

References Cfg::dict, Cfg::nelements, and Dict::value.

struct Cfg* newcfg ( )

Definition at line 368 of file cfg.c.

References Cfg::nelements.

void sortcfg ( struct Cfg cfg)

Sorts cfg. Should be called after each modification before attempting to retrieve any data.

Definition at line 278 of file cfg.c.

References Cfg::dict, and Cfg::nelements.

Referenced by readcfg().

int writecfg ( const char *  filename,
struct Cfg  
)