www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/03/06/04:36:47.1

Message-ID: <3AA4ACE5.C42D1C23@home.com>
From: Tom Fjellstrom <tfjellstrom AT home DOT com>
X-Mailer: Mozilla 4.75 [en] (X11; U; Linux 2.4.2 i686)
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: [ANN] CFG 1.8
Lines: 112
Date: Tue, 06 Mar 2001 09:24:42 GMT
NNTP-Posting-Host: 24.70.88.73
X-Complaints-To: abuse AT home DOT net
X-Trace: news1.rdc1.ab.home.com 983870682 24.70.88.73 (Tue, 06 Mar 2001 01:24:42 PST)
NNTP-Posting-Date: Tue, 06 Mar 2001 01:24:42 PST
Organization: Excite AT Home - The Leader in Broadband http://home.com/faster
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hello all!

CFG 1.8 has just been uploaded.


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 deep as you feel like.


1.1. New...
     ------
     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.


-- 
"Computer programmers don't byte, they nybble a bit."
Tom Fjellstrom
tfjellstrom AT home DOT com
http://strangesoft.net/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019