goinfre/libs/libcfgfile/core.h

goinfre/libs/libcfgfile/core.h

  _____________________________________________________________________________ 
 /   / Index / Goinfre / Resume / Links / Contact / Sitemap /    .: v0.6.1.0 |^|
|\__/-------+         +--------+-------+---------+---------+-----------------+#|
|  1| /goinfre/libs/libcfgfile/core.h                                        |#|
|  2| ==========================================                             |#|
|  3|                                                                        |#|
|  4|                                                   [ raw ] [ download ] |#|
|  5|                                             ` `` ````````````````````` |#|
|  6|                                                                        |#|
|  7| /**                                                                    |#|
|  8|  * libcfgfile/libcfgfile.h                                             |#|
|  9|  *                                                                     |#|
| 10|  * Copyright (c) Manfred Touron 2008                                   |#|
| 11|  */                                                                    |#|
| 12|                                                                        |#|
| 13| #ifndef LIBCFGFILE_CORE_H                                              |#|
| 14| # define LIBCFGFILE_CORE_H                                             |#|
| 15|                                                                        |#|
| 16| # include <stddef.h>                                                   |#|
| 17|                                                                        |#|
| 18| # include <librbuf/librbuf.h>                                          |#|
| 19|                                                                        |#|
| 20| # include "libcfgfile.h"                                               |#|
| 21|                                                                        |#|
| 22| # define ALLOC(X)            malloc(sizeof(X))                         |#|
| 23| # define ALLOC_N(X, N)            malloc(sizeof(X) * N)                |#|
| 24|                                                                        |#|
| 25| # define BUF_SIZE            1024                                      |#|
| 26|                                                                        |#|
| 27| typedef struct                                                         |#|
| 28| {                                                                      |#|
| 29|   const char                  *filename;                               |#|
| 30|   int                        fd;                                       | |
| 31|   rbuf                        rbuf;                                    | |
| 32| }                        *cfgfile;                                     | |
| 33|                                                                        | |
| 34| void      cfgfile_init(void);                                          | |
| 35| cfgfile      cfgfile_new(const char *);                                | |
| 36| cfgfile      cfgfile_find(const char *);                               | |
| 37| int      cfgfile_cmpfn(void *, void *);                                | |
| 38| int      _cfgfile_cat_exists(cfgfile, char *);                         | |
| 39| int      _cfgfile_key_exists(cfgfile, char *, const char *);           | |
| 40| char      *_cfgfile_getopt(cfgfile, char *, const char *);             | |
| 41|                                                                        | |
| 42| #endif /* !LIBCFGFILE_CORE_H */                                        | |
| 43|                                                                        | |
+---+                                                                        | |
\_   \______ mo5.so - normal - 1337.so - rev.so - video_r.so +---------------+ |
  |__       \_____   plain.so - color.so - comment.so       /  moul 2008 (c) |V|
     \-----\______\________________________________________/-----------------+-+