MiniCFG v0.1

Description

MiniCFG is a small utility for reading configuration files consisting of name/value pairs. There are no restrictions on the format for names or values except that the cannot contain hash '#' characters. Comments are indicated by a hash '#' at the beginning of the line or after the value on a line. Names may contain spaces. Quoted values are not parsed so a hash contained within a quoted string will be interpreted as a comment.

Example

# this is an example configuration file
# name/value pairs are delimited by a '=' character
name = value

# the '=' character can exist within a value
line = y = mx + b

# names can contain spaces
foo bar = what's in a name

# comments begin with a hash '#' character
another name = another value # comments can follow a value

# name/value pairs can override previous definitions
name = yet another value

   # comments and settings may be preceeded by white space
   something = else

# a hash cannot be contained within a name or value, even quoted strings
quote = "this is not # what you'd expect"

# a name without a value is legal and will return null
with equal sign =
without

License

MiniCFG is free under the MIT license.

Download

minicfg.h
minicfg.c

Contact

Send any comments/suggestions/bugs to djrager@fourthDWALINwoods.com. (Remember to remove the dwarf!)