vnstat  2.9
About: vnStat is a console-based network traffic monitor (using the /proc filesystem).
  Fossies Dox: vnstat-2.9.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

cfg.h
Go to the documentation of this file.
1#ifndef CFG_H
2#define CFG_H
3
4struct cfgsetting {
5 const char *name;
6 char *locc;
7 int32_t *loci;
8 short namelen;
9 short found;
10};
11
12typedef enum ConfigType {
13 CT_All = 0,
18
19int loadcfg(const char *cfgfile, const ConfigType type);
20void validatebool(const char *cfgname, int32_t *cfgptr, const int32_t defaultvalue);
21void validateint(const char *cfgname, int32_t *cfgptr, const int32_t defaultvalue, const int32_t minvalue, const int32_t maxvalue);
22void validatecfg(const ConfigType type);
23void defaultcfg(void);
24int opencfgfile(const char *cfgfile, FILE **fd);
25int extractcfgvalue(char *value, const unsigned int valuelen, const char *cfgline, const unsigned int cfglen);
26int setcfgvalue(const struct cfgsetting *cset, const char *value, const char *cfgline);
27void configlocale(void);
28
29#endif
void validateint(const char *cfgname, int32_t *cfgptr, const int32_t defaultvalue, const int32_t minvalue, const int32_t maxvalue)
Definition: cfg.c:167
int extractcfgvalue(char *value, const unsigned int valuelen, const char *cfgline, const unsigned int cfglen)
Definition: cfg.c:498
void validatecfg(const ConfigType type)
Definition: cfg.c:184
void validatebool(const char *cfgname, int32_t *cfgptr, const int32_t defaultvalue)
Definition: cfg.c:162
void configlocale(void)
Definition: cfg.c:549
int opencfgfile(const char *cfgfile, FILE **fd)
Definition: cfg.c:443
void defaultcfg(void)
Definition: cfg.c:341
ConfigType
Definition: cfg.h:12
@ CT_CLI
Definition: cfg.h:14
@ CT_Image
Definition: cfg.h:16
@ CT_Daemon
Definition: cfg.h:15
@ CT_All
Definition: cfg.h:13
int loadcfg(const char *cfgfile, const ConfigType type)
Definition: cfg.c:4
int setcfgvalue(const struct cfgsetting *cset, const char *value, const char *cfgline)
Definition: cfg.c:532
Definition: cfg.h:4
char * locc
Definition: cfg.h:6
int32_t * loci
Definition: cfg.h:7
const char * name
Definition: cfg.h:5
short found
Definition: cfg.h:9
short namelen
Definition: cfg.h:8