_____ ____ _____ | ___| __| ___| | | | |__| | | | | __| | _ | |___| | | |_| | |_____|_| |_____| Copyright (C) 2000 Tom Fjellstrom CFG v1.8 -------- 1. What is it? 1.1. New... 1.2. Examples 2. Where can I get it? 3. How do I compile it? 4. Known Bugs... 1. What is CFG??? -------------- CFG is another config library that loads .ini 'like' files. But CFG has one major difference from all the others... Sections can be nested as much as you damn well feel like. 1.1. New... ------ 1.82 ---- o fixed a few bugs. 1.8 --- o version jump. ;) o reading and saving cfg files is much faster now. o there is now no limit on nesting sections o added support for 'simple' .ini type config files (no nesting). o added support for 'include'ing other cfg files even from inside nested sections. o fixed many many many memory leaks. o All thanks to Bernd Becker! :) 1.4 --- o *MAJOR* bug fixed in the 'split' function. o added the 'set_section' function. o added the 'set_cfg_var_type' function. o added *some* documentation. :) 1.2 --- o The parser now handles text using the default local.. o It is way more sane when handling different types of vars, ie: numbers are saved as a bare string (no quotes), single quoted strings are saved as single quoted strings. :) o Blank CFG_FILE structures may now be created via the new_cfg(void) func. o CFG_FILE's can be saved under a different name using the save_cfg(CFG_FILE *, char *) function. o Multiline options are alloud.. (kinda like the line continuation for the c preprocessor) check the test.cfg file to se exactly what they look like. o Redefined vars arn't a memory leak anymore and if the concat option is set before a cfg file is parsed it will join them together. 1.2. Examples. --------- example 1: CFG_FILE *cfg = load_cfg("somefile.cfg"); // load a .cfg file. char *get_cfg_string(cfg,"some.section","somevar","default value"); ... set_cfg_int(cfg,"some.section","somevar",123); close_cfg(cfg); exampe 2: CFG_FILE *cfg = new_cfg(); // create new blank cfgfile set_cfg_option(cfg, concat); // tell the parser that // you want strcat() redefined cfg vars together. set_section(cfg, "some"); set_cfg_int(cfg,"section","somevar",123); // sets 'some.section.somevar' save_cfg(cfg, "somefile.cfg"); 2. Where can I get it? ------------------- http://www.strangesoft.net/cfg.html 3. How do I compile it? -------------------- To compile CFG you must have DJGPP (http://www.delorie.com/djgpp/) or linux. Type 'make' into a command prompt to compile, and 'make install' to install. (It should work under any GCC compiler but it has only been tested under DJGPP and Linux on an Intel processor) 4. Known Bugs... ------------- o none (known) at the moment.