Contents | < Browse | Browse >
Version 1.01 (Released 28th June, 96)
Config is a piece of C sourcecode designed to make access to configuration
files as easy as possible.
All the hard work is taken away, and replaced with just 4 functions:
The config files are in a standard format: they are divided into "sections"
(each of which has a unique name). In each section is any number of
keywords, each of which has an associated data item.
To write data to a config file, a single call to WriteConfig() is required,
telling it the name of the config file, the section and keyword the data is
to be added with, and the data itself. Config will then create the config
file (if necessary), create the section (if necessary) and add or modify
(as appropriate) the entry in the config file.
Reading from the config file is just as easy. You specify the filename,
section and keyword and Config returns you the data. However, when calling
the ReadConfig() function, you also supply a default value. If the data
cannot be returned for any reason (config file doesn't exist, section or
keyword doesn't exist), you will be returned your default value. This
means that absolutely no extra handling is necessary for new config files,
WriteConfigNumber() and ReadConfigNumber() work in exactly the same way,
but with numbers instead of strings.
Full documentation and examples are included within the archive.
Fixed a nasty memory allocation bug. Any programs compiled with Config
v1.0 should be recompiled with v1.01 (which *is* stable).
I would ideally like to make Config in to a shared library. This would
mean it could be accessed from any language, not just C. I currently have
no idea how to do this, though, so that may not happen just yet.
I also have plans to add full caching to Config to speed things up a
little, aswell as adding a few more functions.
Any Amiga running a C compiler (tested with DICE and SAS/C). Whilst the
code is potentially ANSI-compliant, it currently uses several functions
from exec.library for linked-list manipulation. I will consider making the
code fully ANSI compatible if there is any demand for it.
From Aminet, for example:
Config is freely distributable as long as it is not modified in any way.
You are perfectly welcome to use it in your own programs (that's why I've
written it, after all) without any permission; I won't complain if you feel
like giving me a mention in the documentation, but that's by no means