"Fossies" - the Fresh Open Source Software Archive

Member "vnstat-2.9/src/cfg.h" (22 Jul 2021, 835 Bytes) of package /linux/misc/vnstat-2.9.tar.gz:

As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "cfg.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 2.7_vs_2.8.

    1 #ifndef CFG_H
    2 #define CFG_H
    4 struct cfgsetting {
    5     const char *name;
    6     char *locc;
    7     int32_t *loci;
    8     short namelen;
    9     short found;
   10 };
   12 typedef enum ConfigType {
   13     CT_All = 0,
   14     CT_CLI,
   15     CT_Daemon,
   16     CT_Image
   17 } ConfigType;
   19 int loadcfg(const char *cfgfile, const ConfigType type);
   20 void validatebool(const char *cfgname, int32_t *cfgptr, const int32_t defaultvalue);
   21 void validateint(const char *cfgname, int32_t *cfgptr, const int32_t defaultvalue, const int32_t minvalue, const int32_t maxvalue);
   22 void validatecfg(const ConfigType type);
   23 void defaultcfg(void);
   24 int opencfgfile(const char *cfgfile, FILE **fd);
   25 int extractcfgvalue(char *value, const unsigned int valuelen, const char *cfgline, const unsigned int cfglen);
   26 int setcfgvalue(const struct cfgsetting *cset, const char *value, const char *cfgline);
   27 void configlocale(void);
   29 #endif