Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > 1981b34f021c1f7237fce57ba36850a9 > files > 27

libini_config-devel-0.6.2-5.fc14.x86_64.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>libini_config: The INI configuration interface</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">libini_config&#160;<span id="projectnumber">0.1.3</span></div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li class="current"><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">The INI configuration interface </div>  </div>
</div>
<div class="contents">
<div class="textblock"><p>The goal of the this interface is to allow applications to read configuration from the INI file.</p>
<p>So why yet another library to read data from INI file? As we started the SSSD project we looked around for a open source library that would meet the following requirements:</p>
<ul>
<li>Is written in C (not C++)</li>
<li>Is lightweight.</li>
<li>Has an live community.</li>
<li>Supported on multiple platforms .</li>
<li>Can evolve as we build SSSD solution.</li>
<li>Can deal with different types of values including arrays.</li>
<li>Can deal with sections that are related to each other and can form a hierarchy of sections.</li>
<li>Has a compatible license we can use.</li>
</ul>
<p>We have seen several solutions but none was able to address our requirements fully. As a result we started developing our own INI parsing library. It is currently stable, however there is a list of the enhancements that we eventually plan to implement. One of the most interesting future features is the grammar validation utility. It is targeted at helping to diagnose a misconfiguration.</p>
<p>Currently INI parser allows reading and merging INI files and getting a resulting configuration in one object.</p>
<p>One of the main differences of this interface is that the library is created with the idea of reading the configuration data not managing it. Thus currently you will not find any function that alters the configuration data read from the files. There is a set of proposed enhancements to be able to manipulate the configuration data and save it back but there have been no real driver for it. This API is focused on letting applications read data from a file (or files) and interpret it, not to generate configuration files. There are all sorts of different tools that already do that.</p>
<p>The INI configuration interface uses COLLECTION (see libcollection interface) to store data internally.</p>
<p>Concepts:</p>
<ul>
<li>The INI file consists of the key value pairs.</li>
<li>The keys and values are separated by the equal sign. The spaces around equal sign are trimmed. Everything before the equal sign is the key, everything after is the value.</li>
<li>Comments are the lines that start with ";" or "#" in the first position of the line.</li>
<li>Library currently does not support multi-line values.</li>
<li>The keys and values are read and stored in the internal collection.</li>
<li>More than one file can constitute the configuration for the application. For example there can be a generic file in the /etc that contains configuration for all the applications of this class running on the box and then there might be a special file with parameters specific for the application in the /etc/whatever.d directory. Interface allows reading both files in one call. The specific configuration for application will overwrite the generic one.</li>
<li>If there is no section in the file or there are key value pairs declared before the first section those pairs will be placed into the default section.</li>
<li>The values are treated as strings. Spaces are trimmed at the beginning and the end of the value. The value ends at the end of the line. If values is too long an error will be returned.</li>
<li>Parsing of the values happens when the caller tries to interpret the value. The caller can use different functions to do this. The value can be treated as numeric, logical, string, binary, array of strings or array of numbers. In case of arrays the functions accept separators that will be used to slice the value into the array elements.</li>
<li>If there is any error parsing the section and key values it can be intercepted by the caller. There are different modes that the library supports regarding error handling. See details in the description of the individual functions. </li>
</ul>
</div></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address class="footer"><small>Generated on Thu Sep 15 2011 for libini_config by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>