Short: Config.library: Easy access to cfg files Author: Adam Dawes (Adam@Beachyhd.demon.co.uk) Uploader: Adam Dawes (Adam Beachyhd demon co uk) Type: dev/misc Architecture: m68k-amigaos This archive contains config.library, a system to make accessing config files particularly easy, and all necessary documentation, includes, etc. to use the library with C and assembly language. This is a revision of my Config system, previously available as sourcecode in dev/c/Config101.lha. Config.library is completely compatible with the Config system; existing config files will still work, and the function names are identical. If anyone is interested in converting the includes and examples to work in any other languages (Amiga E, BASIC, etc.) then please contact me. 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.