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
|
<!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>Open SCAP Library: /home/pvrabec/project/openscap/openscap-0.5.12/src/common/util.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.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</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>
</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>
<h1>/home/pvrabec/project/openscap/openscap-0.5.12/src/common/util.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright 2009 Red Hat Inc., Durham, North Carolina.</span>
<a name="l00003"></a>00003 <span class="comment"> * All Rights Reserved.</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> * This library is free software; you can redistribute it and/or</span>
<a name="l00006"></a>00006 <span class="comment"> * modify it under the terms of the GNU Lesser General Public</span>
<a name="l00007"></a>00007 <span class="comment"> * License as published by the Free Software Foundation; either</span>
<a name="l00008"></a>00008 <span class="comment"> * version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * This library is distributed in the hope that it will be useful,</span>
<a name="l00011"></a>00011 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span>
<a name="l00013"></a>00013 <span class="comment"> * Lesser General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment"> *</span>
<a name="l00015"></a>00015 <span class="comment"> * You should have received a copy of the GNU Lesser General Public</span>
<a name="l00016"></a>00016 <span class="comment"> * License along with this library; if not, write to the Free Software</span>
<a name="l00017"></a>00017 <span class="comment"> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span>
<a name="l00018"></a>00018 <span class="comment"> *</span>
<a name="l00019"></a>00019 <span class="comment"> * Authors:</span>
<a name="l00020"></a>00020 <span class="comment"> * Lukas Kuklinek <lkuklinek@redhat.com></span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023
<a name="l00024"></a>00024 <span class="preprocessor">#ifndef OSCAP_UTIL_H_</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#define OSCAP_UTIL_H_</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span>
<a name="l00027"></a>00027 <span class="preprocessor">#include <stdbool.h></span>
<a name="l00028"></a>00028 <span class="preprocessor">#include <assert.h></span>
<a name="l00029"></a>00029 <span class="preprocessor">#include "<a class="code" href="oscap_8h.html" title="General OpenScap functions and types.">public/oscap.h</a>"</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include "<a class="code" href="alloc_8h.html" title="OpenScap allocation helpers.">public/alloc.h</a>"</span>
<a name="l00031"></a>00031
<a name="l00032"></a>00032 <span class="preprocessor">#define __attribute__nonnull__(x) assert((x) != NULL)</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span>
<a name="l00034"></a>00034 <span class="keyword">struct </span>oscap_import_source;
<a name="l00035"></a>00035 <span class="keyword">struct </span>oscap_export_target;
<a name="l00036"></a>00036
<a name="l00037"></a>00037 <span class="comment">/*</span>
<a name="l00038"></a>00038 <span class="comment"> * Start a list of declarations that should not be available from outside the</span>
<a name="l00039"></a>00039 <span class="comment"> * library. Must be matched with OSCAP_HIDDEN_END.</span>
<a name="l00040"></a>00040 <span class="comment"> */</span>
<a name="l00041"></a>00041 <span class="preprocessor">#define OSCAP_HIDDEN_START _Pragma("GCC visibility push(hidden)")</span>
<a name="l00042"></a>00042 <span class="preprocessor"></span>
<a name="l00043"></a>00043 <span class="comment">/*</span>
<a name="l00044"></a>00044 <span class="comment"> * Start a list of declarations that should not be available from outside the</span>
<a name="l00045"></a>00045 <span class="comment"> * library started by OSCAP_HIDDEN_END.</span>
<a name="l00046"></a>00046 <span class="comment"> */</span>
<a name="l00047"></a>00047 <span class="preprocessor">#define OSCAP_HIDDEN_END _Pragma("GCC visibility pop")</span>
<a name="l00048"></a>00048 <span class="preprocessor"></span>
<a name="l00049"></a>00049 OSCAP_HIDDEN_START
<a name="l00050"></a>00050
<a name="l00054"></a>00054 <span class="keyword">typedef</span> void (*oscap_destruct_func) (<span class="keywordtype">void</span> *);
<a name="l00055"></a>00055
<a name="l00059"></a>00059 <span class="keyword">typedef</span> <span class="keywordtype">void</span>* (*oscap_clone_func) (<span class="keywordtype">void</span> *);
<a name="l00060"></a>00060
<a name="l00064"></a>00064 <span class="keyword">typedef</span> void (*oscap_consumer_func) (<span class="keywordtype">void</span> *, <span class="keywordtype">void</span> *);
<a name="l00065"></a>00065
<a name="l00076"></a>00076 <span class="preprocessor">#define OSCAP_GENERIC_GETTER_CONV(RTYPE,CONV,SNAME,MNAME,MEXP) \</span>
<a name="l00077"></a>00077 <span class="preprocessor"> RTYPE SNAME##_get_##MNAME(const struct SNAME* item) { return (CONV(item->MEXP)); }</span>
<a name="l00078"></a>00078 <span class="preprocessor"></span>
<a name="l00087"></a>00087 <span class="preprocessor">#define OSCAP_GENERIC_GETTER(RTYPE,SNAME,MNAME,MEXP) \</span>
<a name="l00088"></a>00088 <span class="preprocessor"> OSCAP_GENERIC_GETTER_CONV(RTYPE,,SNAME,MNAME,MEXP)</span>
<a name="l00089"></a>00089 <span class="preprocessor"></span>
<a name="l00098"></a>00098 <span class="preprocessor">#define OSCAP_GENERIC_GETTER_FORCE(RTYPE,SNAME,MNAME,MEXP) \</span>
<a name="l00099"></a>00099 <span class="preprocessor"> OSCAP_GENERIC_GETTER_CONV(RTYPE,(RTYPE),SNAME,MNAME,MEXP)</span>
<a name="l00100"></a>00100 <span class="preprocessor"></span>
<a name="l00109"></a>00109 <span class="preprocessor">#define OSCAP_GETTER_FORCE(RTYPE,SNAME,MNAME) \</span>
<a name="l00110"></a>00110 <span class="preprocessor"> OSCAP_GENERIC_GETTER_FORCE(RTYPE,SNAME,MNAME,MNAME)</span>
<a name="l00111"></a>00111 <span class="preprocessor"></span>
<a name="l00120"></a>00120 <span class="preprocessor">#define OSCAP_GETTER(RTYPE,SNAME,MNAME) \</span>
<a name="l00121"></a>00121 <span class="preprocessor"> OSCAP_GENERIC_GETTER(RTYPE,SNAME,MNAME,MNAME)</span>
<a name="l00122"></a>00122 <span class="preprocessor"></span>
<a name="l00123"></a>00123 <span class="preprocessor">#define ITERATOR_CAST(x) ((struct oscap_iterator*)(x))</span>
<a name="l00124"></a>00124 <span class="preprocessor"></span><span class="preprocessor">#define OSCAP_ITERATOR(n) struct n##_iterator*</span>
<a name="l00125"></a>00125 <span class="preprocessor"></span><span class="preprocessor">#define OSCAP_ITERATOR_FWD(n) struct n##_iterator;</span>
<a name="l00126"></a>00126 <span class="preprocessor"></span><span class="preprocessor">#define OSCAP_ITERATOR_HAS_MORE(n) bool n##_iterator_has_more(OSCAP_ITERATOR(n) it) { return oscap_iterator_has_more(ITERATOR_CAST(it)); }</span>
<a name="l00127"></a>00127 <span class="preprocessor"></span><span class="preprocessor">#define OSCAP_ITERATOR_NEXT(t,n) t n##_iterator_next(OSCAP_ITERATOR(n) it) { return oscap_iterator_next(ITERATOR_CAST(it)); }</span>
<a name="l00128"></a>00128 <span class="preprocessor"></span><span class="preprocessor">#define OSCAP_ITERATOR_FREE(n) void n##_iterator_free(OSCAP_ITERATOR(n) it) { oscap_iterator_free(ITERATOR_CAST(it)); }</span>
<a name="l00129"></a>00129 <span class="preprocessor"></span><span class="preprocessor">#define OSCAP_ITERATOR_RESET(n) void n##_iterator_reset(OSCAP_ITERATOR(n) it) { oscap_iterator_reset(ITERATOR_CAST(it)); }</span>
<a name="l00130"></a>00130 <span class="preprocessor"></span><span class="preprocessor">#define OSCAP_ITERATOR_DETACH(t,n) t n##_iterator_detach(OSCAP_ITERATOR(n) it) { return oscap_iterator_detach(ITERATOR_CAST(it)); }</span>
<a name="l00131"></a>00131 <span class="preprocessor"></span><span class="preprocessor">#define OSCAP_ITERATOR_GEN_T(t,n) OSCAP_ITERATOR_FWD(n) OSCAP_ITERATOR_HAS_MORE(n) OSCAP_ITERATOR_NEXT(t,n) OSCAP_ITERATOR_FREE(n)</span>
<a name="l00132"></a>00132 <span class="preprocessor"></span><span class="preprocessor">#define OSCAP_ITERATOR_GEN(n) OSCAP_ITERATOR_GEN_T(struct n*,n)</span>
<a name="l00133"></a>00133 <span class="preprocessor"></span>
<a name="l00134"></a>00134 <span class="preprocessor">#define OSCAP_ITERATOR_REMOVE_T(t,n,destructor) \</span>
<a name="l00135"></a>00135 <span class="preprocessor"> void n##_iterator_remove(OSCAP_ITERATOR(n) it) { destructor(oscap_iterator_detach(ITERATOR_CAST(it))); }</span>
<a name="l00136"></a>00136 <span class="preprocessor"></span><span class="preprocessor">#define OSCAP_ITERATOR_REMOVE(n,destructor) OSCAP_ITERATOR_REMOVE_T(struct n*,n,destructor)</span>
<a name="l00137"></a>00137 <span class="preprocessor"></span><span class="preprocessor">#define OSCAP_ITERATOR_REMOVE_F(n) OSCAP_ITERATOR_REMOVE(n, n##_free)</span>
<a name="l00138"></a>00138 <span class="preprocessor"></span>
<a name="l00139"></a>00139
<a name="l00149"></a>00149 <span class="preprocessor">#define OSCAP_IGETTER_CONV(ITYPE,SNAME,MNAME,CONV) \</span>
<a name="l00150"></a>00150 <span class="preprocessor"> struct ITYPE##_iterator* SNAME##_get_##MNAME(const struct SNAME* item) \</span>
<a name="l00151"></a>00151 <span class="preprocessor"> { return oscap_iterator_new((CONV(item))->MNAME); }</span>
<a name="l00152"></a>00152 <span class="preprocessor"></span>
<a name="l00161"></a>00161 <span class="preprocessor">#define OSCAP_IGETTER(ITYPE,SNAME,MNAME) OSCAP_IGETTER_CONV(ITYPE,SNAME,MNAME,)</span>
<a name="l00162"></a>00162 <span class="preprocessor"></span>
<a name="l00168"></a>00168 <span class="preprocessor">#define OSCAP_IGETTER_GEN(ITYPE,SNAME,MNAME) OSCAP_IGETTER(ITYPE,SNAME,MNAME) OSCAP_ITERATOR_GEN(ITYPE)</span>
<a name="l00169"></a>00169 <span class="preprocessor"></span>
<a name="l00179"></a>00179 <span class="preprocessor">#define OSCAP_HGETTER_EXP(RTYPE,SNAME,MNAME,MEXP) \</span>
<a name="l00180"></a>00180 <span class="preprocessor"> RTYPE SNAME##_get_##MNAME(const struct SNAME* item, const char* key) \</span>
<a name="l00181"></a>00181 <span class="preprocessor"> { return oscap_htable_get(item->MEXP, key); }</span>
<a name="l00182"></a>00182 <span class="preprocessor"></span>
<a name="l00191"></a>00191 <span class="preprocessor">#define OSCAP_HGETTER(RTYPE,SNAME,MNAME) OSCAP_HGETTER_EXP(RTYPE,SNAME,MNAME,MNAME)</span>
<a name="l00192"></a>00192 <span class="preprocessor"></span>
<a name="l00201"></a>00201 <span class="preprocessor">#define OSCAP_HGETTER_STRUCT(RTYPE,SNAME,MNAME) OSCAP_HGETTER_EXP(struct RTYPE*,SNAME,MNAME,MNAME)</span>
<a name="l00202"></a>00202 <span class="preprocessor"></span>
<a name="l00203"></a>00203 <span class="preprocessor">#define OSCAP_SETTER_HEADER(SNAME, MTYPE, MNAME) bool SNAME##_set_##MNAME(struct SNAME *obj, MTYPE newval)</span>
<a name="l00204"></a>00204 <span class="preprocessor"></span>
<a name="l00216"></a>00216 <span class="preprocessor">#define OSCAP_SETTER_GENERIC_CHECK(SNAME, MTYPE, MNAME, CHECK, DELETER, ASSIGNER) \</span>
<a name="l00217"></a>00217 <span class="preprocessor"> OSCAP_SETTER_HEADER(SNAME, MTYPE, MNAME) \</span>
<a name="l00218"></a>00218 <span class="preprocessor"> { if (!(CHECK)) return false; DELETER(obj->MNAME); obj->MNAME = ASSIGNER(newval); return true; }</span>
<a name="l00219"></a>00219 <span class="preprocessor"></span>
<a name="l00224"></a>00224 <span class="preprocessor">#define OSCAP_SETTER_GENERIC(SNAME, MTYPE, MNAME, DELETER, ASSIGNER) \</span>
<a name="l00225"></a>00225 <span class="preprocessor"> OSCAP_SETTER_HEADER(SNAME, MTYPE, MNAME) \</span>
<a name="l00226"></a>00226 <span class="preprocessor"> { DELETER(obj->MNAME); obj->MNAME = ASSIGNER(newval); return true; }</span>
<a name="l00227"></a>00227 <span class="preprocessor"></span>
<a name="l00232"></a>00232 <span class="preprocessor">#define OSCAP_SETTER_GENERIC_NODELETE(SNAME, MTYPE, MNAME, ASSIGNER) \</span>
<a name="l00233"></a>00233 <span class="preprocessor"> OSCAP_SETTER_HEADER(SNAME, MTYPE, MNAME) \</span>
<a name="l00234"></a>00234 <span class="preprocessor"> { obj->MNAME = ASSIGNER(newval); return true; }</span>
<a name="l00235"></a>00235 <span class="preprocessor"></span>
<a name="l00240"></a>00240 <span class="preprocessor">#define OSCAP_SETTER_SIMPLE(SNAME, MTYPE, MNAME) \</span>
<a name="l00241"></a>00241 <span class="preprocessor"> OSCAP_SETTER_GENERIC_NODELETE(SNAME, MTYPE, MNAME, )</span>
<a name="l00242"></a>00242 <span class="preprocessor"></span>
<a name="l00248"></a>00248 <span class="preprocessor">#define OSCAP_SETTER_STRING(SNAME, MNAME) \</span>
<a name="l00249"></a>00249 <span class="preprocessor"> OSCAP_SETTER_GENERIC(SNAME, const char *, MNAME, free, oscap_strdup)</span>
<a name="l00250"></a>00250 <span class="preprocessor"></span>
<a name="l00254"></a>00254 <span class="preprocessor">#define OSCAP_ACCESSOR_STRING(SNAME, MNAME) \</span>
<a name="l00255"></a>00255 <span class="preprocessor"> OSCAP_GETTER(const char*, SNAME, MNAME) OSCAP_SETTER_STRING(SNAME, MNAME)</span>
<a name="l00256"></a>00256 <span class="preprocessor"></span>
<a name="l00260"></a>00260 <span class="preprocessor">#define OSCAP_ACCESSOR_TEXT(SNAME, MNAME) \</span>
<a name="l00261"></a>00261 <span class="preprocessor"> OSCAP_GETTER(struct oscap_text *, SNAME, MNAME) \</span>
<a name="l00262"></a>00262 <span class="preprocessor"> OSCAP_SETTER_GENERIC(SNAME, struct oscap_text*, MNAME, oscap_text_free, )</span>
<a name="l00263"></a>00263 <span class="preprocessor"></span>
<a name="l00267"></a>00267 <span class="preprocessor">#define OSCAP_ACCESSOR_SIMPLE(MTYPE, SNAME, MNAME) \</span>
<a name="l00268"></a>00268 <span class="preprocessor"> OSCAP_GETTER(MTYPE, SNAME, MNAME) OSCAP_SETTER_SIMPLE(SNAME, MTYPE, MNAME)</span>
<a name="l00269"></a>00269 <span class="preprocessor"></span>
<a name="l00274"></a>00274 <span class="preprocessor">#define OSCAP_ACCESSOR_EXP(MTYPE, SNAME, MNAME, MEXP) \</span>
<a name="l00275"></a>00275 <span class="preprocessor"> OSCAP_GENERIC_GETTER(MTYPE, SNAME, MNAME, MEXP) \</span>
<a name="l00276"></a>00276 <span class="preprocessor"> OSCAP_SETTER_HEADER(SNAME, MTYPE, MNAME) { obj->MEXP = newval; return true; }</span>
<a name="l00277"></a>00277 <span class="preprocessor"></span>
<a name="l00287"></a>00287 <span class="preprocessor">#define OSCAP_INSERTER(SNAME, FNAME, MTYPE, MNAME) \</span>
<a name="l00288"></a>00288 <span class="preprocessor"> bool SNAME##_add_##FNAME(struct SNAME *obj, struct MTYPE *item) \</span>
<a name="l00289"></a>00289 <span class="preprocessor"> { oscap_list_add(obj->MNAME, item); return true; }</span>
<a name="l00290"></a>00290 <span class="preprocessor"></span>
<a name="l00291"></a>00291 <span class="comment">/* Generate iterator getter and list inserter */</span>
<a name="l00292"></a>00292 <span class="preprocessor">#define OSCAP_IGETINS(ITYPE, SNAME, MNAME, FNAME) \</span>
<a name="l00293"></a>00293 <span class="preprocessor"> OSCAP_IGETTER(ITYPE, SNAME, MNAME) OSCAP_INSERTER(SNAME, FNAME, ITYPE, MNAME)</span>
<a name="l00294"></a>00294 <span class="preprocessor"></span><span class="comment">/* Generate iterator getter, list inserter, and iterator manipulation functions. */</span>
<a name="l00295"></a>00295 <span class="preprocessor">#define OSCAP_IGETINS_GEN(ITYPE, SNAME, MNAME, FNAME) \</span>
<a name="l00296"></a>00296 <span class="preprocessor"> OSCAP_IGETTER_GEN(ITYPE, SNAME, MNAME) OSCAP_INSERTER(SNAME, FNAME, ITYPE, MNAME)</span>
<a name="l00297"></a>00297 <span class="preprocessor"></span>
<a name="l00305"></a><a class="code" href="structoscap__string__map.html">00305</a> <span class="keyword">struct </span><a class="code" href="structoscap__string__map.html" title="Define mapping between symbolic constant and its string representation.">oscap_string_map</a> {
<a name="l00306"></a>00306 <span class="keywordtype">int</span> value; <span class="comment">/* integer/enum value */</span>
<a name="l00307"></a>00307 <span class="keyword">const</span> <span class="keywordtype">char</span> *string; <span class="comment">/* string representation of the value */</span>
<a name="l00308"></a>00308 };
<a name="l00309"></a>00309
<a name="l00316"></a>00316 <span class="keywordtype">int</span> <a class="code" href="structoscap__string__map.html#a6bda0f46c76ca15d381bbc08d932dfaa" title="Convert a string to an enumeration constant.">oscap_string_to_enum</a>(<span class="keyword">const</span> <span class="keyword">struct</span> <a class="code" href="structoscap__string__map.html" title="Define mapping between symbolic constant and its string representation.">oscap_string_map</a> *map, <span class="keyword">const</span> <span class="keywordtype">char</span> *str);
<a name="l00317"></a>00317
<a name="l00324"></a>00324 <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="structoscap__string__map.html#aa1d9de0387526ec8dbb26b494ef1703d" title="Convert an enumeration constant to its corresponding string representation.">oscap_enum_to_string</a>(<span class="keyword">const</span> <span class="keyword">struct</span> <a class="code" href="structoscap__string__map.html" title="Define mapping between symbolic constant and its string representation.">oscap_string_map</a> *map, <span class="keywordtype">int</span> val);
<a name="l00325"></a>00325
<a name="l00330"></a>00330 <span class="keywordtype">char</span> *oscap_strdup(<span class="keyword">const</span> <span class="keywordtype">char</span> *str);
<a name="l00331"></a>00331
<a name="l00338"></a>00338 <span class="keywordtype">char</span> *oscap_strsep(<span class="keywordtype">char</span> **str, <span class="keyword">const</span> <span class="keywordtype">char</span> *delim);
<a name="l00339"></a>00339
<a name="l00348"></a>00348 <span class="keywordtype">char</span> **oscap_split(<span class="keywordtype">char</span> *str, <span class="keyword">const</span> <span class="keywordtype">char</span> *delim);
<a name="l00349"></a>00349
<a name="l00350"></a>00350
<a name="l00352"></a>00352 <span class="keywordtype">int</span> oscap_strcmp(<span class="keyword">const</span> <span class="keywordtype">char</span> *s1, <span class="keyword">const</span> <span class="keywordtype">char</span> *s2);
<a name="l00354"></a>00354 <span class="keywordtype">bool</span> oscap_streq(<span class="keyword">const</span> <span class="keywordtype">char</span> *s1, <span class="keyword">const</span> <span class="keywordtype">char</span> *s2);
<a name="l00356"></a>00356 <span class="keywordtype">char</span> *oscap_trim(<span class="keywordtype">char</span> *str);
<a name="l00358"></a>00358 <span class="keywordtype">char</span> *oscap_vsprintf(<span class="keyword">const</span> <span class="keywordtype">char</span> *fmt, va_list ap);
<a name="l00360"></a>00360 <span class="keywordtype">char</span> *oscap_sprintf(<span class="keyword">const</span> <span class="keywordtype">char</span> *fmt, ...);
<a name="l00361"></a>00361
<a name="l00362"></a>00362 <span class="comment">// check pointer equality</span>
<a name="l00363"></a>00363 <span class="keywordtype">bool</span> oscap_ptr_cmp(<span class="keywordtype">void</span> *node1, <span class="keywordtype">void</span> *node2);
<a name="l00364"></a>00364
<a name="l00365"></a>00365 <span class="preprocessor">#ifndef OSCAP_CONCAT</span>
<a name="l00366"></a>00366 <span class="preprocessor"></span><span class="preprocessor"># define OSCAP_CONCAT1(a,b) a ## b</span>
<a name="l00367"></a>00367 <span class="preprocessor"></span><span class="preprocessor"># define OSCAP_CONCAT(a,b) OSCAP_CONCAT1(a,b)</span>
<a name="l00368"></a>00368 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00369"></a>00369 <span class="preprocessor"></span>
<a name="l00370"></a>00370 <span class="preprocessor">#define OSCAP_GSYM(s) OSCAP_CONCAT(___G_, s)</span>
<a name="l00371"></a>00371 <span class="preprocessor"></span>
<a name="l00372"></a>00372 <span class="preprocessor">#define protect_errno \</span>
<a name="l00373"></a>00373 <span class="preprocessor"> for (int OSCAP_CONCAT(__e,__LINE__)=errno, OSCAP_CONCAT(__s,__LINE__)=1; OSCAP_CONCAT(__s,__LINE__)--; errno=OSCAP_CONCAT(__e,__LINE__))</span>
<a name="l00374"></a>00374 <span class="preprocessor"></span>
<a name="l00375"></a>00375 OSCAP_HIDDEN_END;
<a name="l00376"></a>00376
<a name="l00377"></a>00377 <span class="preprocessor">#endif </span><span class="comment">/* OSCAP_UTIL_H_ */</span>
</pre></div></div>
<hr size="1"/><address style="text-align: right;"><small>Generated on 30 Jun 2010 for Open SCAP Library by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>
|