Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Commit

Permalink
Wednesday, May 21 2002, Michael Koch (man-di)
Browse files Browse the repository at this point in the history
        * Updated AUTHORS file
	* Made some text files more readable
	* removed generated file from CVS
  • Loading branch information
Michael Koch committed May 22, 2002
1 parent 47aa6cc commit 0a86b91
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 90 deletions.
8 changes: 7 additions & 1 deletion AUTHORS
@@ -1,3 +1,9 @@
Joseph A. Zupko <jaz147@psu.edu>
Current Maintainers:
====================
James Turner <james@worldforge.org>
Michael Koch <konqueror@gmx.de>

Original authors:
=================
Joseph A. Zupko <jaz147@psu.edu>
Stefanus Du Toit <sdt@gmx.net>
5 changes: 5 additions & 0 deletions ChangeLog
@@ -1,5 +1,10 @@
ChangeLog for varconf

Wednesday, May 21 2002, Michael Koch (man-di)
* Updated AUTHORS file
* Made some text files more readable
* removed generated file from CVS

Saturday, May 11 2002, Joel Schander (nullstar)
* Added comments after member functions in Config.h. Wasn't clear
on purpose of setParameterLookup() so didn't add anything.
Expand Down
101 changes: 71 additions & 30 deletions README
Expand Up @@ -3,17 +3,28 @@ Varconf - STAGE Configuration System (c)1999-2001

1. Overview
-----------
Varconf is a configuration system designed for the STAGE server. Varconf can parse configuration files, command-line arguments and environment variables. It supports callbacks and can store its configuration information in separate Config objects or in one global configuration instance.
Varconf is a configuration system designed for the STAGE server.
Varconf can parse configuration files, command-line arguments and environment
variables. It supports callbacks and can store its configuration information
in separate Config objects or in one global configuration instance.


2. Disclaimer
-------------
None of the authors of this package nor anyone involved with the World Forge project is liable for any damages caused by the use of varconf. If your computer, you, or anyone around you self-combusts as a result of running this program, locate the nearest fire-extinguisher and don't call us. :)
None of the authors of this package nor anyone involved with the World Forge
project is liable for any damages caused by the use of varconf. If your
computer, you, or anyone around you self-combusts as a result of running this
program, locate the nearest fire-extinguisher and don't call us. :)


3. Installation
---------------
The libsigc++ callback library needs to be compiled and installed before compiling varconf. The library can be aquired at http://sourceforge.net/projects/libsigc/. Varconf requires version 1.0.0 or greater of libsigc++.
The libsigc++ callback library needs to be compiled and installed before
compiling varconf. The library can be aquired at

http://sourceforge.net/projects/libsigc/.

Varconf requires version 1.0.0 or greater of libsigc++.


3.1 Basic Installation
Expand All @@ -24,12 +35,17 @@ sh autogen.sh
make
make install

This will place the libraries in /usr/local/lib/varconf and the header files in /usr/local/include/varconf
This will place the libraries in /usr/local/lib/varconf
and the header files in /usr/local/include/varconf


4. Definitions
--------------
Configuration data refers to varconf's internal handling of section names, item names and item values. Each of these components has the same meaning as they would in any standard configuration file. Each of these components comes from configuration files, environment variables or command-line arguments.
Configuration data refers to varconf's internal handling of section names,
item names and item values. Each of these components has the same meaning
as they would in any standard configuration file. Each of these components
comes from configuration files, environment variables or command-line
arguments.


4.1 Configuration Data
Expand Down Expand Up @@ -94,7 +110,8 @@ ignored.

4.3 - Command-Line Arguments
----------------------------
A single command-line argument can be a short-form argument or short-form argument value, a long-form argument or ignored data.
A single command-line argument can be a short-form argument or short-form
argument value, a long-form argument or ignored data.

{sn} denotes a short-name of one of either 'a'-'z', 'A'-'Z' or '0'-'9'.
{nm} denotes a name consisting of 'a'-'z', 'A'-'Z', '0'-'9', '_' or '-'.
Expand All @@ -119,31 +136,41 @@ Syntax for long-form argument:

4.4 - Environment Variables
---------------------------
To allow varconf to input an environmental variable as configuration data, precede its name with a prefix and then specify that prefix when calling the function. ie:
To allow varconf to input an environmental variable as configuration data,
precede its name with a prefix and then specify that prefix when calling
the function. ie:

Variables:
WF_ONE=Oh
WF_TWO=Happy
WF_THREE=Day

Use prefix 'WF_' to retrieve the three variables as configuration data. They will be stored as items 'one', 'two' and 'three' respectively.
Use prefix 'WF_' to retrieve the three variables as configuration data.
They will be stored as items 'one', 'two' and 'three' respectively.


5. Library Usage
----------------
Varconf is not very verbose about errors. Typically, malformed config data is either completely ignored or converted into a compatible form. A typo won't crash the library but it might lead to some very odd configuration items. ie:
Varconf is not very verbose about errors. Typically, malformed config data
is either completely ignored or converted into a compatible form.
A typo won't crash the library but it might lead to some very odd
configuration items. ie:

Command-line argument:
--section_name:: second colon treated as item name and converted to
'_'; item '_' would be created without value under
section "section_name"

While this makes reporting typos to the user difficult, it makes parsing of configuration data more efficient in the library. A future solution to this might be the addition of warnings when the configuration data set method receives erroneous data.
While this makes reporting typos to the user difficult, it makes parsing
of configuration data more efficient in the library. A future solution to
this might be the addition of warnings when the configuration data set method
receives erroneous data.


5.1 Configuration Instance
--------------------------
Configuration data can be stored in separate configuration objects or in a single global instance.
Configuration data can be stored in separate configuration objects or in a
single global instance.

Separate Objects:

Expand All @@ -153,26 +180,37 @@ Global Instance:

*Config::inst()

Note that the method Config::inst() will automatically initialize the global data if not already created.
Note that the method Config::inst() will automatically initialize the
global data if not already created.


5.2 libsigc++
-------------
Varconf uses libsigc++ for its callback routines and error reporting. Please see the libsigc++ documentation for specific details on interacting with libsigc++ signals.
Varconf uses libsigc++ for its callback routines and error reporting.
Please see the libsigc++ documentation for specific details on interacting
with libsigc++ signals.

Four libsigc++ signals are provided by varconf.
.sig - callback method with no details. Indicates that configuration data has been changed but does not specify what has been changed.
.sigv - callback method that reports section and item name that has been changed. Only useful when working with a single configuration
instance.A
.sigsv - callback method that reports section, item name and the address of the configuration object under which the change was made.
Useful when using multiple configuration instances.

.sig - callback method with no details. Indicates that configuration data
has been changed but does not specify what has been changed.

.sigv - callback method that reports section and item name that
has been changed. Only useful when working with a single
configuration instance.A

.sigsv - callback method that reports section, item name and the address of
the configuration object under which the change was made. Useful
when using multiple configuration instances.

.sige - reports error messages in a single string.


5.3 Configuration Files
-----------------------
Varconf can read file-formed config data either directly from a file or from any input stream. It can also write configuration data directly to a file or to an output stream.
Varconf can read file-formed config data either directly from a file or from
any input stream. It can also write configuration data directly to a file
or to an output stream.

To read from a file:

Expand All @@ -182,7 +220,8 @@ To read from an input stream:

config_object.parseStream( istream&);

Note that this method may throw an error of type ParseError. See the ParseError.cc file or the ParseError.h file for more information.
Note that this method may throw an error of type ParseError.
See the ParseError.cc file or the ParseError.h file for more information.


To write to a file:
Expand All @@ -196,29 +235,31 @@ To write to a stream:

5.4 Command-line Arguments
--------------------------
To parse a set of command-line arguments call the following method with the number of arguments and multi-dimension array of command-line arguments.
To parse a set of command-line arguments call the following method with the
number of arguments and multi-dimension array of command-line arguments.

config_object.getCmdline( int argc, char** argv);

Note that before shortname arguments ('-a') can be used, each must be registered with a long name using the setParameterLookup method. ie:
Note that before shortname arguments ('-a') can be used, each must be
registered with a long name using the setParameterLookup method. ie:

config_object.setParameterLookup( 'f', "foo", true);

The last argument is a bool specifying whether the argument requires a value or not. If true, varconf will look at the command-line argument directly following the shortform argument to see if there is a value there. If false, varconf will store the argument with no value.
The last argument is a bool specifying whether the argument requires a value
or not. If true, varconf will look at the command-line argument directly
following the shortform argument to see if there is a value there. If false,
varconf will store the argument with no value.

Note that if a shortform argument is found but does not exist in the table, it will be ignored without warning.
Note that if a shortform argument is found but does not exist in the table,
it will be ignored without warning.


5.5 Environment Variables
-------------------------
To read in all environment variables with a specific prefix, call the following function with that prefix:
To read in all environment variables with a specific prefix, call the
following function with that prefix:

config_object.getEnv( prefix);

ie: config_object.getEnv( "WF_"); reads in all environment variables
starting with "WF_"





5 changes: 0 additions & 5 deletions TODO
Expand Up @@ -5,8 +5,3 @@ TODO for varconf
* Make ParseError useful.
* Add Observer class back in.
* Revise documentation.





54 changes: 0 additions & 54 deletions varconf.spec

This file was deleted.

0 comments on commit 0a86b91

Please sign in to comment.