|
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) ![]() |
#include "cfg.h"#include <stdio.h>#include <string.h>#include <stdlib.h>#include <ctype.h>#include <stdarg.h>
Go to the source code of this file.
Macros | |
| #define | MAXTOKENLEN 1024 |
Functions | |
| char * | cfgfind (const char *name, struct Cfg *cfg, int offset) |
| int | writecfg (const char *name, struct Cfg *cfg) |
| void | freecfg (struct Cfg *cfg) |
| struct Cfg * | readcfg (const char *name) |
| void | sortcfg (struct Cfg *cfg) |
| void | cfg_add_entry (struct Cfg *cfg, struct Dict *d) |
| 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) |
| struct Cfg * | newcfg () |
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.
| 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 * | name, |
| struct Cfg * | cfg, | ||
| int | offset | ||
| ) |
Definition at line 44 of file cfg.c.
References Cfg::dict, Cfg::nelements, and Dict::value.
| void freecfg | ( | struct Cfg * | cfg) |
Definition at line 91 of file cfg.c.
References Cfg::dict, Cfg::dict, Cfg::dict, Cfg::dict, Cfg::dict, Cfg::dict, Cfg::dict, Cfg::dict, Dict::name, Dict::name, Cfg::nelements, Dict::nvalues, Dict::value, Dict::value, Dict::value, and Dict::value.
| struct Cfg* newcfg | ( | ) |
Definition at line 368 of file cfg.c.
References Cfg::nelements.
| struct Cfg* readcfg | ( | const char * | name) |
Definition at line 116 of file cfg.c.
References cfg_add_entry(), Cfg::dict, freecfg(), freecfg(), freecfg(), MAXTOKENLEN, Dict::name, Cfg::nelements, Cfg::nelements, Dict::nvalues, Dict::nvalues, Dict::nvalues, Dict::nvalues, Dict::nvalues, sortcfg(), Dict::value, Dict::value, Dict::value, Dict::value, and Dict::value.
| 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 * | name, |
| struct Cfg * | cfg | ||
| ) |
Definition at line 65 of file cfg.c.
References Cfg::dict, Cfg::dict, Cfg::dict, Cfg::dict, Cfg::dict, Dict::name, Dict::name, Cfg::nelements, Dict::nvalues, Dict::value, and Dict::value.