home *** CD-ROM | disk | FTP | other *** search
-
- TABLE OF CONTENTS
-
- config.library/WriteConfig
- config.library/WriteConfigNumber
- config.library/ReadConfig
- config.library/ReadConfigNumber
-
- config.library/WriteConfig
-
- NAME
- WriteConfig -- write an item of data to a configuration file
-
- SYNOPSIS
- int r = WriteConfig(filename, section, item, data);
- D0 D1 D2 D3
-
- char *filename;
- char *section;
- char *item;
- char *data;
-
- FUNCTION
- Writes the data to the specified config file, in the specified
- section, using the specified item keyword.
-
- If the config file does not exist, WriteConfig() will create it.
- If the section doesn't exist, it'll be created. If the item
- doesn't exist, it'll be added to the appropriate section; otherwise
- the existing data for the item will be overwritten with the new
- data.
-
- EXAMPLE
- r = WriteConfig("Test.cfg","RecentFiles","File1","SYS:Data");
-
- INPUTS
- filename - Name of the file to write config data to
- section - Name of the section within the file
- item - Name of the item within the section
- data - Data to be written to the config file
-
- RESULTS
- If everything works, returns CFG_WRITE_SUCCESS. In the event of
- problems, returns CFG_WRITE_FAIL.
-
- SEE ALSO
- WriteConfigNumber()
-
- config.library/WriteConfigNumber
-
- NAME
- WriteConfigNumber -- writes a long integer to a configuration file
-
- SYNOPSIS
- int r = WriteConfigNumber(filename, section, item, data);
- D0 D1 D2 D3
-
- char *filename;
- char *section;
- char *item;
- long data;
-
- FUNCTION
- Writes the long integer to the specified config file, in the
- specified section, using the specified item keyword.
-
- If the config file does not exist, WriteConfig() will create it.
- If the section doesn't exist, it'll be created. If the item
- doesn't exist, it'll be added to the appropriate section; otherwise
- the existing data for the item will be overwritten with the new
- data.
-
- EXAMPLE
- r = WriteConfigNumber("Test.cfg","RecentFiles","RecentCnt",4);
-
- INPUTS
- filename - Name of the file to write config data to
- section - Name of the section within the file
- item - Name of the item within the section
- data - Long integer to be written to the config file
-
- RESULTS
- If everything works, returns CFG_WRITE_SUCCESS. In the event of
- problems, returns CFG_WRITE_FAIL.
-
- SEE ALSO
- WriteConfig()
-
-
- config.library/ReadConfig
-
- NAME
- ReadConfig -- read an item of data from a configuration file
-
- SYNOPSIS
- int r = ReadConfig(filename, section, item, buffer, bufsize, default);
- D0 D1 D2 D3 D4 D5
-
- char *filename;
- char *section;
- char *item;
- char *buffer;
- int bufsize;
- char *default;
-
- FUNCTION
- Reads data from a configuration file, placing it in to your buffer.
-
- If for any reason the data cannot be read (config file doesn't
- exist, specified section doesn't exist, specified item can't be
- found within the section), the default value will be copied to your
- buffer, and CFG_READ_SUCCESS will be returned. You don't need to
- worry about whether config files/sections/items actually exist.
-
- EXAMPLE
- r = ReadConfig("Test.cfg","RecentFiles","File1",buf,BUFSIZE,"RAM:Test");
-
- INPUTS
- filename - Name of the file to read config data from
- section - Name of the section within the file
- item - Name of the item within the section
- buffer - A string buffer to receive the config data
- bufsize - The maximum size of your buffer
- default - A string to be returned if the config data cannot
- be found
-
- RESULTS
- If everything works, returns CFG_READ_SUCCESS. In the event of
- problems (usually, your buffer is not large enough to receive the
- configuration data), returns CFG_READ_FAIL.
-
- SEE ALSO
- ReadConfigNumber()
-
- config.library/ReadConfigNumber
-
- NAME
- ReadConfigNumber -- read a long integer from a configuration file
-
- SYNOPSIS
- long v = ReadConfigNumber(filename, section, item, default);
- D0 D1 D2 D3
-
- char *filename;
- char *section;
- char *item;
- long default;
-
- FUNCTION
- Reads a long integer from a configuration file.
-
- If for any reason the data cannot be read (config file doesn't
- exist, specified section doesn't exist, specified item can't be
- found within the section), the default value will be returned,
- and CFG_READ_SUCCESS will be returned. You don't need to worry
- about whether config files/sections/items actually exist.
-
- EXAMPLE
- v = ReadConfigNumber("Test.cfg","RecentFiles","RecentCnt",4);
-
- INPUTS
- filename - Name of the file to read config data from
- section - Name of the section within the file
- item - Name of the item within the section
- default - A long value to be returned if the config data
- cannot be found
-
- RESULTS
- Returns the long integer read from the config file. This function
- is assumed never to fail. If the config item specified is not
- numerical, 0 will be returned.
-
- SEE ALSO
- ReadConfig()
-