The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/include/configfile.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*      configfile.h - Generic configuration file format.
    2  *                                                      Author: Kees J. Bot
    3  *                                                              5 Jun 1999
    4  */
    5 #ifndef _CONFIGFILE_H
    6 #define _CONFIGFILE_H
    7 
    8 /* Data can only be modified inside the library. */
    9 #ifndef _c
   10 #define _c      const
   11 #endif
   12 
   13 typedef _c struct config {      /* Contents of a generic configuration file. */
   14 _c      struct config   *next;          /* Next configuration file thing. */
   15 _c      struct config   *list;          /* For a { sublist }. */
   16         const char      *file;          /* File and line where this is found. */
   17         unsigned        line;
   18         int             flags;          /* Special flags. */
   19         char            word[1];        /* Payload. */
   20 } config_t;
   21 
   22 #define CFG_CLONG       0x0001          /* strtol(word, &end, 0) is valid. */
   23 #define CFG_OLONG       0x0002          /* strtol(word, &end, 010). */
   24 #define CFG_DLONG       0x0004          /* strtol(word, &end, 10). */
   25 #define CFG_XLONG       0x0008          /* strtol(word, &end, 0x10). */
   26 #define CFG_CULONG      0x0010          /* strtoul(word, &end, 0). */
   27 #define CFG_OULONG      0x0020          /* strtoul(word, &end, 010). */
   28 #define CFG_DULONG      0x0040          /* strtoul(word, &end, 10). */
   29 #define CFG_XULONG      0x0080          /* strtoul(word, &end, 0x10). */
   30 #define CFG_STRING      0x0100          /* The word is enclosed in quotes. */
   31 #define CFG_SUBLIST     0x0200          /* This is a sublist, so no word. */
   32 #define CFG_ESCAPED     0x0400          /* Escapes are still marked with \. */
   33 
   34 config_t *config_read(const char *_file, int flags, config_t *_cfg);
   35 void config_delete(config_t *_cfg);
   36 int config_renewed(config_t *_cfg);
   37 size_t config_length(config_t *_cfg);
   38 #define config_issub(cfg)       (!!((cfg)->flags & CFG_SUBLIST))
   39 #define config_isatom(cfg)      (!config_issub(cfg))
   40 #define config_isstring(cfg)    (!!((cfg)->flags & CFG_STRING))
   41 
   42 #undef _c
   43 
   44 #endif /* _CONFIGFILE_H */

Cache object: bb1f2aa2b654283798a7d85d50b3fab1


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.