1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262
|
<!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>pam_pkcs11: scconf.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li><a href="dirs.html"><span>Directories</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
<div class="navpath"><a class="el" href="dir_55f9682142a78e45196901be32452b47.html">src</a> » <a class="el" href="dir_cc481a42a914fe65d2d9fe5e9954ddb4.html">scconf</a>
</div>
</div>
<div class="contents">
<h1>scconf.h</h1><a href="scconf_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * $Id: scconf.h 233 2007-04-04 09:52:54Z ludovic.rousseau $</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2002</span>
<a name="l00005"></a>00005 <span class="comment"> * Antti Tapaninen <aet@cc.hut.fi></span>
<a name="l00006"></a>00006 <span class="comment"> *</span>
<a name="l00007"></a>00007 <span class="comment"> * Originally based on source by Timo Sirainen <tss@iki.fi></span>
<a name="l00008"></a>00008 <span class="comment"> *</span>
<a name="l00009"></a>00009 <span class="comment"> * This library is free software; you can redistribute it and/or</span>
<a name="l00010"></a>00010 <span class="comment"> * modify it under the terms of the GNU Lesser General Public</span>
<a name="l00011"></a>00011 <span class="comment"> * License as published by the Free Software Foundation; either</span>
<a name="l00012"></a>00012 <span class="comment"> * version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00013"></a>00013 <span class="comment"> *</span>
<a name="l00014"></a>00014 <span class="comment"> * This library is distributed in the hope that it will be useful,</span>
<a name="l00015"></a>00015 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00016"></a>00016 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span>
<a name="l00017"></a>00017 <span class="comment"> * Lesser General Public License for more details.</span>
<a name="l00018"></a>00018 <span class="comment"> *</span>
<a name="l00019"></a>00019 <span class="comment"> * You should have received a copy of the GNU Lesser General Public</span>
<a name="l00020"></a>00020 <span class="comment"> * License along with this library; if not, write to the Free Software</span>
<a name="l00021"></a>00021 <span class="comment"> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span>
<a name="l00022"></a>00022 <span class="comment"> */</span>
<a name="l00023"></a>00023
<a name="l00024"></a>00024 <span class="preprocessor">#ifndef _SC_CONF_H</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#define _SC_CONF_H</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span>
<a name="l00027"></a>00027 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
<a name="l00029"></a>00029 <span class="preprocessor">#endif</span>
<a name="l00030"></a>00030 <span class="preprocessor"></span>
<a name="l00031"></a><a class="code" href="struct__scconf__entry.html">00031</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__scconf__entry.html">_scconf_entry</a> {
<a name="l00032"></a><a class="code" href="struct__scconf__entry.html#a8f8f80d37794cde9472343e4487ba3eb">00032</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="struct__scconf__entry.html#a8f8f80d37794cde9472343e4487ba3eb">name</a>;
<a name="l00033"></a><a class="code" href="struct__scconf__entry.html#a4bfea42429249a1f65204f0c0f34704a">00033</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="struct__scconf__entry.html#a4bfea42429249a1f65204f0c0f34704a">type</a>;
<a name="l00034"></a><a class="code" href="struct__scconf__entry.html#ac92588540e8c1d014a08cd8a45462b19">00034</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="struct__scconf__entry.html#ac92588540e8c1d014a08cd8a45462b19">flags</a>;
<a name="l00035"></a><a class="code" href="struct__scconf__entry.html#a14c65b9f2783c6f6dafdaaa372329e4d">00035</a> <span class="keywordtype">void</span> *<a class="code" href="struct__scconf__entry.html#a14c65b9f2783c6f6dafdaaa372329e4d">parm</a>;
<a name="l00036"></a><a class="code" href="struct__scconf__entry.html#a9ce2ec4812a92cb6ab39f6e81e9173a9">00036</a> <span class="keywordtype">void</span> *<a class="code" href="struct__scconf__entry.html#a9ce2ec4812a92cb6ab39f6e81e9173a9">arg</a>;
<a name="l00037"></a>00037 } <a class="code" href="struct__scconf__entry.html">scconf_entry</a>;
<a name="l00038"></a>00038
<a name="l00039"></a>00039 <span class="comment">/* Entry flags */</span>
<a name="l00040"></a><a class="code" href="scconf_8h.html#aa3d7a853fc4de1da92b869b434444cfb">00040</a> <span class="preprocessor">#define SCCONF_PRESENT 0x00000001</span>
<a name="l00041"></a><a class="code" href="scconf_8h.html#a227fca1be5ffbe20f3e7115a00e8c7d4">00041</a> <span class="preprocessor"></span><span class="preprocessor">#define SCCONF_MANDATORY 0x00000002</span>
<a name="l00042"></a><a class="code" href="scconf_8h.html#a4e278abdf4e6219b004223e3d786577e">00042</a> <span class="preprocessor"></span><span class="preprocessor">#define SCCONF_ALLOC 0x00000004</span>
<a name="l00043"></a><a class="code" href="scconf_8h.html#ae9f05b0ea1beed4b79994d5f2ea027a3">00043</a> <span class="preprocessor"></span><span class="preprocessor">#define SCCONF_ALL_BLOCKS 0x00000008</span>
<a name="l00044"></a><a class="code" href="scconf_8h.html#a6013183490843fdd8623853175a19468">00044</a> <span class="preprocessor"></span><span class="preprocessor">#define SCCONF_VERBOSE 0x00000010 </span><span class="comment">/* For debugging purposes only */</span>
<a name="l00045"></a>00045
<a name="l00046"></a>00046 <span class="comment">/* Entry types */</span>
<a name="l00047"></a><a class="code" href="scconf_8h.html#a82e14b5ece963515a1b83c855c0e23c1">00047</a> <span class="preprocessor">#define SCCONF_CALLBACK 1</span>
<a name="l00048"></a><a class="code" href="scconf_8h.html#a6133521cf1a9e13c39bb3d70dec5f9b3">00048</a> <span class="preprocessor"></span><span class="preprocessor">#define SCCONF_BLOCK 2</span>
<a name="l00049"></a><a class="code" href="scconf_8h.html#a73301309d4e2fae647e0cacad10f305f">00049</a> <span class="preprocessor"></span><span class="preprocessor">#define SCCONF_LIST 3</span>
<a name="l00050"></a>00050 <span class="preprocessor"></span>
<a name="l00051"></a><a class="code" href="scconf_8h.html#abe880248960e5680c63e3a4ecdc3ea6a">00051</a> <span class="preprocessor">#define SCCONF_BOOLEAN 11</span>
<a name="l00052"></a><a class="code" href="scconf_8h.html#a43d3572cfb467a8d41a4bfccfe091d90">00052</a> <span class="preprocessor"></span><span class="preprocessor">#define SCCONF_INTEGER 12</span>
<a name="l00053"></a><a class="code" href="scconf_8h.html#a090e094f84487e89755dbe82c6b12057">00053</a> <span class="preprocessor"></span><span class="preprocessor">#define SCCONF_STRING 13</span>
<a name="l00054"></a>00054 <span class="preprocessor"></span>
<a name="l00055"></a><a class="code" href="scconf_8h.html#aa1a6aa691197930df0da465dabadbc7d">00055</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__scconf__block.html">_scconf_block</a> <a class="code" href="struct__scconf__block.html">scconf_block</a>;
<a name="l00056"></a>00056
<a name="l00057"></a><a class="code" href="struct__scconf__list.html">00057</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__scconf__list.html">_scconf_list</a> {
<a name="l00058"></a><a class="code" href="struct__scconf__list.html#a3afd6a91ed4d8bdffcaa8e57e1557970">00058</a> <span class="keyword">struct </span><a class="code" href="struct__scconf__list.html">_scconf_list</a> *<a class="code" href="struct__scconf__list.html#a3afd6a91ed4d8bdffcaa8e57e1557970">next</a>;
<a name="l00059"></a><a class="code" href="struct__scconf__list.html#a91a70b77df95bd8b0830b49a094c2acb">00059</a> <span class="keywordtype">char</span> *<a class="code" href="struct__scconf__list.html#a91a70b77df95bd8b0830b49a094c2acb">data</a>;
<a name="l00060"></a>00060 } <a class="code" href="struct__scconf__list.html">scconf_list</a>;
<a name="l00061"></a>00061
<a name="l00062"></a><a class="code" href="scconf_8h.html#a18c56299c4b5189ed5c0ce24757c4a79">00062</a> <span class="preprocessor">#define SCCONF_ITEM_TYPE_COMMENT 0 </span><span class="comment">/* key = NULL, comment */</span>
<a name="l00063"></a><a class="code" href="scconf_8h.html#a0950c0ad81139510dfc4a1c9e711b866">00063</a> <span class="preprocessor">#define SCCONF_ITEM_TYPE_BLOCK 1 </span><span class="comment">/* key = key, block */</span>
<a name="l00064"></a><a class="code" href="scconf_8h.html#afec03a8f44af732ffe0e992bb62cfce0">00064</a> <span class="preprocessor">#define SCCONF_ITEM_TYPE_VALUE 2 </span><span class="comment">/* key = key, list */</span>
<a name="l00065"></a>00065
<a name="l00066"></a><a class="code" href="struct__scconf__item.html">00066</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__scconf__item.html">_scconf_item</a> {
<a name="l00067"></a><a class="code" href="struct__scconf__item.html#af8affd003f82b7208a580ee5cb56da0c">00067</a> <span class="keyword">struct </span><a class="code" href="struct__scconf__item.html">_scconf_item</a> *<a class="code" href="struct__scconf__item.html#af8affd003f82b7208a580ee5cb56da0c">next</a>;
<a name="l00068"></a><a class="code" href="struct__scconf__item.html#ac765329451135abec74c45e1897abf26">00068</a> <span class="keywordtype">int</span> <a class="code" href="struct__scconf__item.html#ac765329451135abec74c45e1897abf26">type</a>;
<a name="l00069"></a><a class="code" href="struct__scconf__item.html#a5892a9181e6a332f84d27aecd41dcd12">00069</a> <span class="keywordtype">char</span> *<a class="code" href="struct__scconf__item.html#a5892a9181e6a332f84d27aecd41dcd12">key</a>;
<a name="l00070"></a>00070 <span class="keyword">union </span>{
<a name="l00071"></a><a class="code" href="struct__scconf__item.html#a25dae25c3bf9b28d54eb4df7afb2a491">00071</a> <span class="keywordtype">char</span> *<a class="code" href="struct__scconf__item.html#a25dae25c3bf9b28d54eb4df7afb2a491">comment</a>;
<a name="l00072"></a><a class="code" href="struct__scconf__item.html#abba81c977d8901de66b169a60d8481e1">00072</a> <a class="code" href="struct__scconf__block.html">scconf_block</a> *<a class="code" href="struct__scconf__item.html#abba81c977d8901de66b169a60d8481e1">block</a>;
<a name="l00073"></a><a class="code" href="struct__scconf__item.html#aaa2544dbadef96351e62c5a00e20646b">00073</a> <a class="code" href="struct__scconf__list.html">scconf_list</a> *<a class="code" href="struct__scconf__item.html#aaa2544dbadef96351e62c5a00e20646b">list</a>;
<a name="l00074"></a>00074 } <a class="code" href="struct__scconf__item.html#a5051e470111f9c0a5fbf09152fe7b7fb">value</a>;
<a name="l00075"></a>00075 } <a class="code" href="struct__scconf__item.html">scconf_item</a>;
<a name="l00076"></a>00076
<a name="l00077"></a><a class="code" href="struct__scconf__block.html">00077</a> <span class="keyword">struct </span><a class="code" href="struct__scconf__block.html">_scconf_block</a> {
<a name="l00078"></a><a class="code" href="struct__scconf__block.html#a175c4cc967d747c1d07c892a1b0514d2">00078</a> <a class="code" href="struct__scconf__block.html">scconf_block</a> *<a class="code" href="struct__scconf__block.html#a175c4cc967d747c1d07c892a1b0514d2">parent</a>;
<a name="l00079"></a><a class="code" href="struct__scconf__block.html#a0c0f0d9b82294b198e07f8385904e1c2">00079</a> <a class="code" href="struct__scconf__list.html">scconf_list</a> *<a class="code" href="struct__scconf__block.html#a0c0f0d9b82294b198e07f8385904e1c2">name</a>;
<a name="l00080"></a><a class="code" href="struct__scconf__block.html#a54ab50335fc84a5327891453161d2a5a">00080</a> <a class="code" href="struct__scconf__item.html">scconf_item</a> *<a class="code" href="struct__scconf__block.html#a54ab50335fc84a5327891453161d2a5a">items</a>;
<a name="l00081"></a>00081 };
<a name="l00082"></a>00082
<a name="l00083"></a><a class="code" href="structscconf__context.html">00083</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{
<a name="l00084"></a><a class="code" href="structscconf__context.html#aeac90097f29f7529968697163cea5c18">00084</a> <span class="keywordtype">char</span> *filename;
<a name="l00085"></a><a class="code" href="structscconf__context.html#ac3e1795766a80ec63b157951b4b9a7d4">00085</a> <span class="keywordtype">int</span> debug;
<a name="l00086"></a><a class="code" href="structscconf__context.html#a76f2e40a18edacf6582156a75296278a">00086</a> <a class="code" href="struct__scconf__block.html">scconf_block</a> *root;
<a name="l00087"></a><a class="code" href="structscconf__context.html#a39aebac8fca50ea12a14719c9a36a645">00087</a> <span class="keywordtype">char</span> *errmsg;
<a name="l00088"></a>00088 } <a class="code" href="structscconf__context.html">scconf_context</a>;
<a name="l00089"></a>00089
<a name="l00090"></a>00090 <span class="comment">/* Allocate scconf_context</span>
<a name="l00091"></a>00091 <span class="comment"> * The filename can be NULL</span>
<a name="l00092"></a>00092 <span class="comment"> */</span>
<a name="l00093"></a>00093 <span class="keyword">extern</span> <a class="code" href="structscconf__context.html">scconf_context</a> *<a class="code" href="scconf_8h.html#aa6af95185d97705bd16b2352a7085dd5">scconf_new</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename);
<a name="l00094"></a>00094
<a name="l00095"></a>00095 <span class="comment">/* Free scconf_context</span>
<a name="l00096"></a>00096 <span class="comment"> */</span>
<a name="l00097"></a>00097 <span class="keyword">extern</span> <span class="keywordtype">void</span> <a class="code" href="scconf_8h.html#a7eec7e86ab0151ef1be5718ec01088f8">scconf_free</a>(<a class="code" href="structscconf__context.html">scconf_context</a> * config);
<a name="l00098"></a>00098
<a name="l00099"></a>00099 <span class="comment">/* Parse configuration</span>
<a name="l00100"></a>00100 <span class="comment"> * Returns 1 = ok, 0 = error, -1 = error opening config file</span>
<a name="l00101"></a>00101 <span class="comment"> */</span>
<a name="l00102"></a>00102 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="scconf_8h.html#af464702b43c5ff303ebbde427a6f66ba">scconf_parse</a>(<a class="code" href="structscconf__context.html">scconf_context</a> * config);
<a name="l00103"></a>00103
<a name="l00104"></a>00104 <span class="comment">/* Parse a static configuration string</span>
<a name="l00105"></a>00105 <span class="comment"> * Returns 1 = ok, 0 = error</span>
<a name="l00106"></a>00106 <span class="comment"> */</span>
<a name="l00107"></a>00107 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="scconf_8h.html#a871df157bcfd14791814d8a2f373598d">scconf_parse_string</a>(<a class="code" href="structscconf__context.html">scconf_context</a> * config, <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keywordtype">string</span>);
<a name="l00108"></a>00108
<a name="l00109"></a>00109 <span class="comment">/* Parse entries</span>
<a name="l00110"></a>00110 <span class="comment"> */</span>
<a name="l00111"></a>00111 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="scconf_8h.html#af43e08f4b56609d353887b3bc3e1181b">scconf_parse_entries</a>(<span class="keyword">const</span> <a class="code" href="structscconf__context.html">scconf_context</a> * config, <span class="keyword">const</span> <a class="code" href="struct__scconf__block.html">scconf_block</a> * block, <a class="code" href="struct__scconf__entry.html">scconf_entry</a> * entry);
<a name="l00112"></a>00112
<a name="l00113"></a>00113 <span class="comment">/* Write config to a file</span>
<a name="l00114"></a>00114 <span class="comment"> * If the filename is NULL, use the config->filename</span>
<a name="l00115"></a>00115 <span class="comment"> * Returns 0 = ok, else = errno</span>
<a name="l00116"></a>00116 <span class="comment"> */</span>
<a name="l00117"></a>00117 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="scconf_8h.html#a1227ae9b24743629b9996b2f4af30083">scconf_write</a>(<a class="code" href="structscconf__context.html">scconf_context</a> * config, <span class="keyword">const</span> <span class="keywordtype">char</span> *filename);
<a name="l00118"></a>00118
<a name="l00119"></a>00119 <span class="comment">/* Write configuration entries to block</span>
<a name="l00120"></a>00120 <span class="comment"> */</span>
<a name="l00121"></a>00121 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="scconf_8h.html#a1122f8661ba0177249d248188ba25c18">scconf_write_entries</a>(<a class="code" href="structscconf__context.html">scconf_context</a> * config, <a class="code" href="struct__scconf__block.html">scconf_block</a> * block, <a class="code" href="struct__scconf__entry.html">scconf_entry</a> * entry);
<a name="l00122"></a>00122
<a name="l00123"></a>00123 <span class="comment">/* Find a block by the item_name</span>
<a name="l00124"></a>00124 <span class="comment"> * If the block is NULL, the root block is used</span>
<a name="l00125"></a>00125 <span class="comment"> */</span>
<a name="l00126"></a>00126 <span class="keyword">extern</span> <span class="keyword">const</span> <a class="code" href="struct__scconf__block.html">scconf_block</a> *<a class="code" href="scconf_8h.html#a44356f410df33b5d4566cd7748014402">scconf_find_block</a>(<span class="keyword">const</span> <a class="code" href="structscconf__context.html">scconf_context</a> * config, <span class="keyword">const</span> <a class="code" href="struct__scconf__block.html">scconf_block</a> * block, <span class="keyword">const</span> <span class="keywordtype">char</span> *item_name);
<a name="l00127"></a>00127
<a name="l00128"></a>00128 <span class="comment">/* Find blocks by the item_name</span>
<a name="l00129"></a>00129 <span class="comment"> * If the block is NULL, the root block is used</span>
<a name="l00130"></a>00130 <span class="comment"> * The key can be used to specify what the blocks first name should be</span>
<a name="l00131"></a>00131 <span class="comment"> */</span>
<a name="l00132"></a>00132 <span class="keyword">extern</span> <a class="code" href="struct__scconf__block.html">scconf_block</a> **<a class="code" href="scconf_8h.html#aea883f7131774fcff6ea1dbabd74c963">scconf_find_blocks</a>(<span class="keyword">const</span> <a class="code" href="structscconf__context.html">scconf_context</a> * config, <span class="keyword">const</span> <a class="code" href="struct__scconf__block.html">scconf_block</a> * block, <span class="keyword">const</span> <span class="keywordtype">char</span> *item_name, <span class="keyword">const</span> <span class="keywordtype">char</span> *key);
<a name="l00133"></a>00133
<a name="l00134"></a>00134 <span class="comment">/* Get a list of values for option</span>
<a name="l00135"></a>00135 <span class="comment"> */</span>
<a name="l00136"></a>00136 <span class="keyword">extern</span> <span class="keyword">const</span> <a class="code" href="struct__scconf__list.html">scconf_list</a> *<a class="code" href="scconf_8h.html#a03e68e156734f70e0c8d100f47825d98">scconf_find_list</a>(<span class="keyword">const</span> <a class="code" href="struct__scconf__block.html">scconf_block</a> * block, <span class="keyword">const</span> <span class="keywordtype">char</span> *option);
<a name="l00137"></a>00137
<a name="l00138"></a>00138 <span class="comment">/* Return the first string of the option</span>
<a name="l00139"></a>00139 <span class="comment"> * If no option found, return def</span>
<a name="l00140"></a>00140 <span class="comment"> */</span>
<a name="l00141"></a>00141 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="scconf_8h.html#ab915bae0be5ebaca910513630c5d6e81">scconf_get_str</a>(<span class="keyword">const</span> <a class="code" href="struct__scconf__block.html">scconf_block</a> * block, <span class="keyword">const</span> <span class="keywordtype">char</span> *option, <span class="keyword">const</span> <span class="keywordtype">char</span> *def);
<a name="l00142"></a>00142
<a name="l00143"></a>00143 <span class="comment">/* Return the first value of the option as integer</span>
<a name="l00144"></a>00144 <span class="comment"> * If no option found, return def</span>
<a name="l00145"></a>00145 <span class="comment"> */</span>
<a name="l00146"></a>00146 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="scconf_8h.html#aeb62022f2fff253f39f1078dacf42f32">scconf_get_int</a>(<span class="keyword">const</span> <a class="code" href="struct__scconf__block.html">scconf_block</a> * block, <span class="keyword">const</span> <span class="keywordtype">char</span> *option, <span class="keywordtype">int</span> def);
<a name="l00147"></a>00147
<a name="l00148"></a>00148 <span class="comment">/* Return the first value of the option as boolean</span>
<a name="l00149"></a>00149 <span class="comment"> * If no option found, return def</span>
<a name="l00150"></a>00150 <span class="comment"> */</span>
<a name="l00151"></a>00151 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="scconf_8h.html#ac2d4577c50dd488789375a15c8bb189d">scconf_get_bool</a>(<span class="keyword">const</span> <a class="code" href="struct__scconf__block.html">scconf_block</a> * block, <span class="keyword">const</span> <span class="keywordtype">char</span> *option, <span class="keywordtype">int</span> def);
<a name="l00152"></a>00152
<a name="l00153"></a>00153 <span class="comment">/* Write value to a block as a string</span>
<a name="l00154"></a>00154 <span class="comment"> */</span>
<a name="l00155"></a>00155 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="scconf_8h.html#a7704845802ec646d79a1e1975d69483f">scconf_put_str</a>(<a class="code" href="struct__scconf__block.html">scconf_block</a> * block, <span class="keyword">const</span> <span class="keywordtype">char</span> *option, <span class="keyword">const</span> <span class="keywordtype">char</span> *value);
<a name="l00156"></a>00156
<a name="l00157"></a>00157 <span class="comment">/* Write value to a block as an integer</span>
<a name="l00158"></a>00158 <span class="comment"> */</span>
<a name="l00159"></a>00159 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="scconf_8h.html#ab1965c4a7adddaf1672a98d880bd6c21">scconf_put_int</a>(<a class="code" href="struct__scconf__block.html">scconf_block</a> * block, <span class="keyword">const</span> <span class="keywordtype">char</span> *option, <span class="keywordtype">int</span> value);
<a name="l00160"></a>00160
<a name="l00161"></a>00161 <span class="comment">/* Write value to a block as a boolean</span>
<a name="l00162"></a>00162 <span class="comment"> */</span>
<a name="l00163"></a>00163 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="scconf_8h.html#a86a492b8747e032923064cc23de2f1b1">scconf_put_bool</a>(<a class="code" href="struct__scconf__block.html">scconf_block</a> * block, <span class="keyword">const</span> <span class="keywordtype">char</span> *option, <span class="keywordtype">int</span> value);
<a name="l00164"></a>00164
<a name="l00165"></a>00165 <span class="comment">/* Add block structure</span>
<a name="l00166"></a>00166 <span class="comment"> * If the block is NULL, the root block is used</span>
<a name="l00167"></a>00167 <span class="comment"> */</span>
<a name="l00168"></a>00168 <span class="keyword">extern</span> <a class="code" href="struct__scconf__block.html">scconf_block</a> *<a class="code" href="scconf_8h.html#ac67f138d996c47a8385dd6b0d6cc72a9">scconf_block_add</a>(<a class="code" href="structscconf__context.html">scconf_context</a> * config, <a class="code" href="struct__scconf__block.html">scconf_block</a> * block, <span class="keyword">const</span> <span class="keywordtype">char</span> *key, <span class="keyword">const</span> <a class="code" href="struct__scconf__list.html">scconf_list</a> *name);
<a name="l00169"></a>00169
<a name="l00170"></a>00170 <span class="comment">/* Copy block structure (recursive)</span>
<a name="l00171"></a>00171 <span class="comment"> */</span>
<a name="l00172"></a>00172 <span class="keyword">extern</span> <a class="code" href="struct__scconf__block.html">scconf_block</a> *<a class="code" href="scconf_8h.html#a3725160579285f52c16db9658e668979">scconf_block_copy</a>(<span class="keyword">const</span> <a class="code" href="struct__scconf__block.html">scconf_block</a> * src, <a class="code" href="struct__scconf__block.html">scconf_block</a> ** dst);
<a name="l00173"></a>00173
<a name="l00174"></a>00174 <span class="comment">/* Free block structure (recursive)</span>
<a name="l00175"></a>00175 <span class="comment"> */</span>
<a name="l00176"></a>00176 <span class="keyword">extern</span> <span class="keywordtype">void</span> <a class="code" href="scconf_8h.html#a4da19211d35bbe397777b33d4f83137a">scconf_block_destroy</a>(<a class="code" href="struct__scconf__block.html">scconf_block</a> * block);
<a name="l00177"></a>00177
<a name="l00178"></a>00178 <span class="comment">/* Add item to block structure</span>
<a name="l00179"></a>00179 <span class="comment"> * If the block is NULL, the root block is used</span>
<a name="l00180"></a>00180 <span class="comment"> */</span>
<a name="l00181"></a>00181 <span class="keyword">extern</span> <a class="code" href="struct__scconf__item.html">scconf_item</a> *<a class="code" href="scconf_8h.html#ad91ebfa84fe6f6e20a513c6a8fc35de5">scconf_item_add</a>(<a class="code" href="structscconf__context.html">scconf_context</a> * config, <a class="code" href="struct__scconf__block.html">scconf_block</a> * block, <a class="code" href="struct__scconf__item.html">scconf_item</a> * item, <span class="keywordtype">int</span> type, <span class="keyword">const</span> <span class="keywordtype">char</span> *key, <span class="keyword">const</span> <span class="keywordtype">void</span> *data);
<a name="l00182"></a>00182
<a name="l00183"></a>00183 <span class="comment">/* Copy item structure (recursive)</span>
<a name="l00184"></a>00184 <span class="comment"> */</span>
<a name="l00185"></a>00185 <span class="keyword">extern</span> <a class="code" href="struct__scconf__item.html">scconf_item</a> *<a class="code" href="scconf_8h.html#a0a2f9633f667675f98dfb2fc220dfc10">scconf_item_copy</a>(<span class="keyword">const</span> <a class="code" href="struct__scconf__item.html">scconf_item</a> * src, <a class="code" href="struct__scconf__item.html">scconf_item</a> ** dst);
<a name="l00186"></a>00186
<a name="l00187"></a>00187 <span class="comment">/* Free item structure (recursive)</span>
<a name="l00188"></a>00188 <span class="comment"> */</span>
<a name="l00189"></a>00189 <span class="keyword">extern</span> <span class="keywordtype">void</span> <a class="code" href="scconf_8h.html#a3f0f7912d88f836e7553ff489e80892d">scconf_item_destroy</a>(<a class="code" href="struct__scconf__item.html">scconf_item</a> * item);
<a name="l00190"></a>00190
<a name="l00191"></a>00191 <span class="comment">/* Add a new value to the list</span>
<a name="l00192"></a>00192 <span class="comment"> */</span>
<a name="l00193"></a>00193 <span class="keyword">extern</span> <a class="code" href="struct__scconf__list.html">scconf_list</a> *<a class="code" href="scconf_8h.html#a1067cec0efd2bbaa3a66016bbc342d72">scconf_list_add</a>(<a class="code" href="struct__scconf__list.html">scconf_list</a> ** list, <span class="keyword">const</span> <span class="keywordtype">char</span> *value);
<a name="l00194"></a>00194
<a name="l00195"></a>00195 <span class="comment">/* Copy list structure</span>
<a name="l00196"></a>00196 <span class="comment"> */</span>
<a name="l00197"></a>00197 <span class="keyword">extern</span> <a class="code" href="struct__scconf__list.html">scconf_list</a> *<a class="code" href="scconf_8h.html#a7fb8e0bc1859a8545ce57d99c9c4087b">scconf_list_copy</a>(<span class="keyword">const</span> <a class="code" href="struct__scconf__list.html">scconf_list</a> * src, <a class="code" href="struct__scconf__list.html">scconf_list</a> ** dst);
<a name="l00198"></a>00198
<a name="l00199"></a>00199 <span class="comment">/* Free list structure</span>
<a name="l00200"></a>00200 <span class="comment"> */</span>
<a name="l00201"></a>00201 <span class="keyword">extern</span> <span class="keywordtype">void</span> <a class="code" href="scconf_8h.html#abed028d5efec452b8c2a66ed574e13c5">scconf_list_destroy</a>(<a class="code" href="struct__scconf__list.html">scconf_list</a> * list);
<a name="l00202"></a>00202
<a name="l00203"></a>00203 <span class="comment">/* Return the length of an list array</span>
<a name="l00204"></a>00204 <span class="comment"> */</span>
<a name="l00205"></a>00205 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="scconf_8h.html#a7ba3f9b01650f48f7f663054f55e3aa1">scconf_list_array_length</a>(<span class="keyword">const</span> <a class="code" href="struct__scconf__list.html">scconf_list</a> * list);
<a name="l00206"></a>00206
<a name="l00207"></a>00207 <span class="comment">/* Return the combined length of the strings on all arrays</span>
<a name="l00208"></a>00208 <span class="comment"> */</span>
<a name="l00209"></a>00209 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="scconf_8h.html#adc8908fbac17d11da159c5d1f9345dde">scconf_list_strings_length</a>(<span class="keyword">const</span> <a class="code" href="struct__scconf__list.html">scconf_list</a> * list);
<a name="l00210"></a>00210
<a name="l00211"></a>00211 <span class="comment">/* Return an allocated string that contains all</span>
<a name="l00212"></a>00212 <span class="comment"> * the strings in a list separated by the filler</span>
<a name="l00213"></a>00213 <span class="comment"> * The filler can be NULL</span>
<a name="l00214"></a>00214 <span class="comment"> */</span>
<a name="l00215"></a>00215 <span class="keyword">extern</span> <span class="keywordtype">char</span> *<a class="code" href="scconf_8h.html#afe1c8e7c60852a3446e631fd4eeb4644">scconf_list_strdup</a>(<span class="keyword">const</span> <a class="code" href="struct__scconf__list.html">scconf_list</a> * list, <span class="keyword">const</span> <span class="keywordtype">char</span> *filler);
<a name="l00216"></a>00216
<a name="l00217"></a>00217 <span class="comment">/* Returns an allocated array of const char *pointers to</span>
<a name="l00218"></a>00218 <span class="comment"> * list elements.</span>
<a name="l00219"></a>00219 <span class="comment"> * Last pointer is NULL</span>
<a name="l00220"></a>00220 <span class="comment"> * Array must be freed, but pointers to strings belong to scconf_list</span>
<a name="l00221"></a>00221 <span class="comment"> */</span>
<a name="l00222"></a>00222 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> **<a class="code" href="scconf_8h.html#a6bf939fee559def4804f767a571c0002">scconf_list_toarray</a>(<span class="keyword">const</span> <a class="code" href="struct__scconf__list.html">scconf_list</a> * list);
<a name="l00223"></a>00223
<a name="l00224"></a>00224 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00225"></a>00225 <span class="preprocessor"></span>}
<a name="l00226"></a>00226 <span class="preprocessor">#endif</span>
<a name="l00227"></a>00227 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
</pre></div></div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Sat Jun 12 17:28:16 2010 for pam_pkcs11 by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>
|