ccl is customizable because it allows the comment, key/value, and string literal delimiters to be programatically specified at runtime.
ccl is designed to be simple and portable; it has a small interface consisting of five functions and is written in ANSI/ISO C. ccl uses avl's implemenation of binary search trees for backend storage.
example.conf might contain:
## Sample configuration file Desktop-Picture = /usr/images/earth.jpg Position = Centered "Background Color" = Black
The following code demonstrates how to parse and access this file using ccl:
#include "ccl/ccl.h" struct ccl_t config; const struct ccl_pair_t *iter; /* Set configuration file details */ config.comment_char = '#'; config.sep_char = '='; config.str_char = '"'; /* Parse the file */ ccl_parse(&config, "example.conf"); /* Iterate through all key/value pairs */ while((iter = ccl_iterate(&config)) != 0) { printf("(%s,%s)\n", iter->key, iter->value); } /* Clean up */ ccl_release(&config);
When compiled, the snippet above produces the output
(Background Color,Black) (Desktop-Picture,/usr/images/earth.jpg) (Position,Centered)
config.guess and the text you see when you run configure.
If you think you have tracked down the source of the bug, please also send a patch made with diff -U 5 which fixes the problem.
Please send bug reports, questions, comments and suggestions to Stephen F. Booth.
Permission to use, copy, modify, and distribute this software and its documentation under the terms of the GNU General Public License is hereby granted. No representations are made about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. See the GNU General Public License for more details.
1.4.1