Git Product home page Git Product logo

iniread's Introduction

C Library for reading .ini-style configuration files

The public interface is easy, it reads the config file into an structure that
makes for fast searching for sections and keys.  Just free it when done,
it's as simple as that. 

Why? This is something everyone seems to implement themselves -- and a few
times I've wished to be able use a backslash to to line-continuation of a
particular value if it were to be a paragraph.  Speaking of...

Values can be continued using a backslash -- any line ending with a trailing
'\' will cause the line below it to be joined to the value.  Even numbers of
backslashes are considered escaped and result in n/2 real backslashes ending
the line -- odd numbers are (n - 1) / 2 real backslashes with a continuation.

-----------------------------------------------------------------------------

The format is simple and ubiquitous -- 
# Comments start with hash or semi-colon;
[section]
key = value

[another_section]
alpha = beta
gamma = delta epsilon

The key/value separator can be a colon as well -- whichever is seen first
scanning the line is considered as the right separator. Whitespace is stripped
around section-names, keys, and values.

Examples (quotes added to delineate the entire value):

key = this sentence will continue on to the next \
line right here.
==>
key = "this sentence will continue on to the next line right here."

key = this ends with two real backslashes \\\\
==>
key = "this ends with two real backslashes \\"

key = this continues with a trailing backslash \\\
onto the next line
==>
key = "this continues with a trailing backslash \onto the next line"

iniread's People

Stargazers

William Strecker-Kellogg avatar alen avatar

Watchers

William Strecker-Kellogg avatar James Cloos avatar

Forkers

l0vekobe0824

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.