cnfparse.c

Small library to make config parsing easier
git clone git://git.finwo.net/lib/cnfparse.c
Log | Files | Refs | README | LICENSE

README.md (1082B)


      1 finwo/cnfparse
      2 ==============
      3 
      4 > Small library to make config parsing easier
      5 
      6 This library makes use of [dep](https://github.com/finwo/dep) to manage it's
      7 dependencies and exports.
      8 
      9 Installation
     10 ------------
     11 
     12 ```sh
     13 dep add finwo/cnfparse
     14 dep install
     15 ```
     16 
     17 After that, simply add `include lib/.dep/config.mk` in your makefile and include
     18 the header file by adding `#include "finwo/cnfparse.h`.
     19 
     20 API
     21 ---
     22 
     23 ### Structures
     24 
     25 <details>
     26   <summary>struct cnf_directive</summary>
     27 
     28   The main handle of the cnfparse library
     29 
     30 ```C
     31 struct cnf_directive {
     32  char   *name;
     33  size_t argc;
     34  char   **argv;
     35 };
     36 ```
     37 
     38 </details>
     39 
     40 ### Methods
     41 
     42 <details>
     43   <summary>cnf_directive_free(subject)</summary>
     44 
     45   Frees the memory used by a directive
     46 
     47 ```C
     48 void cnf_directive_free(struct cnf_directive *subject);
     49 ```
     50 
     51 </details>
     52 <details>
     53   <summary>cnf_directive_read(fd)</summary>
     54 
     55   Returns a single directive (or NULL) from the file descriptor
     56 
     57 ```C
     58 struct cnf_directive * cnf_directive_read(FILE *fd);
     59 ```
     60 
     61 </details>
     62 
     63 License
     64 -------
     65 
     66 cnfparse.c source code is available under the [FGPL License](LICENSE.md)