home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1998 #6
/
amigamamagazinepolishissue1998.iso
/
coders
/
config
/
config.readme
< prev
next >
Wrap
Text File
|
1977-12-31
|
2KB
|
49 lines
Short: Very easy access to config files
Author: Adam@beachyhd.demon.co.uk (Adam Dawes)
Uploader: Adam@beachyhd.demon.co.uk (Adam Dawes)
Type: dev/c
Introduction
~~~~~~~~~~~~
Well, I hate Windows as much as the next man, but occasionally I stumble
across a good idea hidden away within the operating system.
There are a couple of functions buried in there for reading and writing
configuration files, and they actually make things very easy. I decided I'd
had enough of messing around with config files on my Amiga, so I've ported
the functions to Amiga C.
The idea is that the configuration files take a definitive structure which
the Config functions can understand. Each config file is split in to a
number of "Sections" (which are stored in the config file as a keyword
inside square brackets). In each of these sections are a number of "Items",
each of which contains an actual data item. The items are local to the
section that contains them, so it's perfectly legal to use one item name in
several sections, they'll all be treated separately.
The beauty behind the functions is you don't have to worry about creating
files or scanning through them. Even when it comes to reading data, you
don't have to care if the config file exists or not as you provide a
default value to use if the file/section/item cannot be located.
Everything is automated within the Config functions.
Full documentation is included within the archive.
============================= Archive contents =============================
Original Packed Ratio Date Time Name
-------- ------- ----- --------- -------- -------------
6087 1835 69.8% 25-May-96 15:50:32 Config.c
8250 3016 63.4% 25-May-96 16:09:48 Config.guide
756 324 57.1% 25-May-96 15:28:28 Config.h
7286 2757 62.1% 25-May-96 16:09:54 Config.txt
2747 625 77.2% 25-May-96 15:28:26 ConfigTest.c
202 74 63.3% 25-May-96 15:29:36 DMakeFile
-------- ------- ----- --------- --------
25328 8631 65.9% 25-May-96 23:33:00 6 files