Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 537b4767ca71616a4bccbb57df0c2eb6 > files > 736

openscap-devel-0.7.4-1.fc16.i686.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>Open SCAP Library: /home/pvrabec/project/openscap/openscap-0.7.4/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.7.4 -->
<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">Open SCAP Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</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 class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">/home/pvrabec/project/openscap/openscap-0.7.4/src/common/util.h</div>  </div>
</div>
<div class="contents">
<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 &lt;lkuklinek@redhat.com&gt;</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 &lt;stdbool.h&gt;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include &lt;assert.h&gt;</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include &quot;<a class="code" href="oscap_8h.html" title="General OpenScap functions and types.">public/oscap.h</a>&quot;</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include &quot;<a class="code" href="alloc_8h.html" title="OpenScap allocation helpers.">public/alloc.h</a>&quot;</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="comment">/*</span>
<a name="l00035"></a>00035 <span class="comment"> * Start a list of declarations that should not be available from outside the</span>
<a name="l00036"></a>00036 <span class="comment"> * library.  Must be matched with OSCAP_HIDDEN_END.</span>
<a name="l00037"></a>00037 <span class="comment"> */</span>
<a name="l00038"></a>00038 <span class="preprocessor">#define OSCAP_HIDDEN_START _Pragma(&quot;GCC visibility push(hidden)&quot;)</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span>
<a name="l00040"></a>00040 <span class="comment">/*</span>
<a name="l00041"></a>00041 <span class="comment"> * Start a list of declarations that should not be available from outside the</span>
<a name="l00042"></a>00042 <span class="comment"> * library started by OSCAP_HIDDEN_END.</span>
<a name="l00043"></a>00043 <span class="comment"> */</span>
<a name="l00044"></a>00044 <span class="preprocessor">#define OSCAP_HIDDEN_END _Pragma(&quot;GCC visibility pop&quot;)</span>
<a name="l00045"></a>00045 <span class="preprocessor"></span>
<a name="l00046"></a>00046 OSCAP_HIDDEN_START
<a name="l00047"></a>00047 
<a name="l00051"></a>00051 <span class="keyword">typedef</span> void (*oscap_destruct_func) (<span class="keywordtype">void</span> *);
<a name="l00052"></a>00052 
<a name="l00056"></a>00056 <span class="keyword">typedef</span> <span class="keywordtype">void</span>* (*oscap_clone_func) (<span class="keywordtype">void</span> *);
<a name="l00057"></a>00057 
<a name="l00061"></a>00061 <span class="keyword">typedef</span> void (*oscap_consumer_func) (<span class="keywordtype">void</span> *, <span class="keywordtype">void</span> *);
<a name="l00062"></a>00062 
<a name="l00073"></a>00073 <span class="preprocessor">#define OSCAP_GENERIC_GETTER_CONV(RTYPE,CONV,SNAME,MNAME,MEXP) \</span>
<a name="l00074"></a>00074 <span class="preprocessor">        RTYPE SNAME##_get_##MNAME(const struct SNAME* item) { return (CONV(item-&gt;MEXP)); }</span>
<a name="l00075"></a>00075 <span class="preprocessor"></span>
<a name="l00084"></a>00084 <span class="preprocessor">#define OSCAP_GENERIC_GETTER(RTYPE,SNAME,MNAME,MEXP) \</span>
<a name="l00085"></a>00085 <span class="preprocessor">        OSCAP_GENERIC_GETTER_CONV(RTYPE,,SNAME,MNAME,MEXP)</span>
<a name="l00086"></a>00086 <span class="preprocessor"></span>
<a name="l00095"></a>00095 <span class="preprocessor">#define OSCAP_GENERIC_GETTER_FORCE(RTYPE,SNAME,MNAME,MEXP) \</span>
<a name="l00096"></a>00096 <span class="preprocessor">        OSCAP_GENERIC_GETTER_CONV(RTYPE,(RTYPE),SNAME,MNAME,MEXP)</span>
<a name="l00097"></a>00097 <span class="preprocessor"></span>
<a name="l00106"></a>00106 <span class="preprocessor">#define OSCAP_GETTER_FORCE(RTYPE,SNAME,MNAME) \</span>
<a name="l00107"></a>00107 <span class="preprocessor">        OSCAP_GENERIC_GETTER_FORCE(RTYPE,SNAME,MNAME,MNAME)</span>
<a name="l00108"></a>00108 <span class="preprocessor"></span>
<a name="l00117"></a>00117 <span class="preprocessor">#define OSCAP_GETTER(RTYPE,SNAME,MNAME) \</span>
<a name="l00118"></a>00118 <span class="preprocessor">        OSCAP_GENERIC_GETTER(RTYPE,SNAME,MNAME,MNAME)</span>
<a name="l00119"></a>00119 <span class="preprocessor"></span>
<a name="l00120"></a>00120 <span class="preprocessor">#define ITERATOR_CAST(x) ((struct oscap_iterator*)(x))</span>
<a name="l00121"></a>00121 <span class="preprocessor"></span><span class="preprocessor">#define OSCAP_ITERATOR(n) struct n##_iterator*</span>
<a name="l00122"></a>00122 <span class="preprocessor"></span><span class="preprocessor">#define OSCAP_ITERATOR_FWD(n) struct n##_iterator;</span>
<a name="l00123"></a>00123 <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="l00124"></a>00124 <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="l00125"></a>00125 <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="l00126"></a>00126 <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="l00127"></a>00127 <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="l00128"></a>00128 <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_RESET(n) OSCAP_ITERATOR_NEXT(t,n) OSCAP_ITERATOR_FREE(n)</span>
<a name="l00129"></a>00129 <span class="preprocessor"></span><span class="preprocessor">#define OSCAP_ITERATOR_GEN(n) OSCAP_ITERATOR_GEN_T(struct n*,n)</span>
<a name="l00130"></a>00130 <span class="preprocessor"></span>
<a name="l00131"></a>00131 <span class="preprocessor">#define OSCAP_ITERATOR_REMOVE_T(t,n,destructor) \</span>
<a name="l00132"></a>00132 <span class="preprocessor">                void n##_iterator_remove(OSCAP_ITERATOR(n) it) { destructor(oscap_iterator_detach(ITERATOR_CAST(it))); }</span>
<a name="l00133"></a>00133 <span class="preprocessor"></span><span class="preprocessor">#define OSCAP_ITERATOR_REMOVE(n,destructor) OSCAP_ITERATOR_REMOVE_T(struct n*,n,destructor)</span>
<a name="l00134"></a>00134 <span class="preprocessor"></span><span class="preprocessor">#define OSCAP_ITERATOR_REMOVE_F(n) OSCAP_ITERATOR_REMOVE(n, n##_free)</span>
<a name="l00135"></a>00135 <span class="preprocessor"></span>
<a name="l00136"></a>00136 
<a name="l00146"></a>00146 <span class="preprocessor">#define OSCAP_IGETTER_CONV(ITYPE,SNAME,MNAME,CONV) \</span>
<a name="l00147"></a>00147 <span class="preprocessor">        struct ITYPE##_iterator* SNAME##_get_##MNAME(const struct SNAME* item) \</span>
<a name="l00148"></a>00148 <span class="preprocessor">        { return oscap_iterator_new((CONV(item))-&gt;MNAME); }</span>
<a name="l00149"></a>00149 <span class="preprocessor"></span>
<a name="l00158"></a>00158 <span class="preprocessor">#define OSCAP_IGETTER(ITYPE,SNAME,MNAME) OSCAP_IGETTER_CONV(ITYPE,SNAME,MNAME,)</span>
<a name="l00159"></a>00159 <span class="preprocessor"></span>
<a name="l00165"></a>00165 <span class="preprocessor">#define OSCAP_IGETTER_GEN(ITYPE,SNAME,MNAME) OSCAP_IGETTER(ITYPE,SNAME,MNAME) OSCAP_ITERATOR_GEN(ITYPE)</span>
<a name="l00166"></a>00166 <span class="preprocessor"></span>
<a name="l00176"></a>00176 <span class="preprocessor">#define OSCAP_HGETTER_EXP(RTYPE,SNAME,MNAME,MEXP) \</span>
<a name="l00177"></a>00177 <span class="preprocessor">        RTYPE SNAME##_get_##MNAME(const struct SNAME* item, const char* key) \</span>
<a name="l00178"></a>00178 <span class="preprocessor">        { return oscap_htable_get(item-&gt;MEXP, key); }</span>
<a name="l00179"></a>00179 <span class="preprocessor"></span>
<a name="l00188"></a>00188 <span class="preprocessor">#define OSCAP_HGETTER(RTYPE,SNAME,MNAME) OSCAP_HGETTER_EXP(RTYPE,SNAME,MNAME,MNAME)</span>
<a name="l00189"></a>00189 <span class="preprocessor"></span>
<a name="l00198"></a>00198 <span class="preprocessor">#define OSCAP_HGETTER_STRUCT(RTYPE,SNAME,MNAME) OSCAP_HGETTER_EXP(struct RTYPE*,SNAME,MNAME,MNAME)</span>
<a name="l00199"></a>00199 <span class="preprocessor"></span>
<a name="l00200"></a>00200 <span class="preprocessor">#define OSCAP_SETTER_HEADER(SNAME, MTYPE, MNAME) bool SNAME##_set_##MNAME(struct SNAME *obj, MTYPE newval)</span>
<a name="l00201"></a>00201 <span class="preprocessor"></span>
<a name="l00213"></a>00213 <span class="preprocessor">#define OSCAP_SETTER_GENERIC_CHECK(SNAME, MTYPE, MNAME, CHECK, DELETER, ASSIGNER) \</span>
<a name="l00214"></a>00214 <span class="preprocessor">        OSCAP_SETTER_HEADER(SNAME, MTYPE, MNAME) \</span>
<a name="l00215"></a>00215 <span class="preprocessor">        { if (!(CHECK)) return false; DELETER(obj-&gt;MNAME); obj-&gt;MNAME = ASSIGNER(newval); return true; }</span>
<a name="l00216"></a>00216 <span class="preprocessor"></span>
<a name="l00221"></a>00221 <span class="preprocessor">#define OSCAP_SETTER_GENERIC(SNAME, MTYPE, MNAME, DELETER, ASSIGNER) \</span>
<a name="l00222"></a>00222 <span class="preprocessor">        OSCAP_SETTER_HEADER(SNAME, MTYPE, MNAME) \</span>
<a name="l00223"></a>00223 <span class="preprocessor">        { DELETER(obj-&gt;MNAME); obj-&gt;MNAME = ASSIGNER(newval); return true; }</span>
<a name="l00224"></a>00224 <span class="preprocessor"></span>
<a name="l00229"></a>00229 <span class="preprocessor">#define OSCAP_SETTER_GENERIC_NODELETE(SNAME, MTYPE, MNAME, ASSIGNER) \</span>
<a name="l00230"></a>00230 <span class="preprocessor">        OSCAP_SETTER_HEADER(SNAME, MTYPE, MNAME) \</span>
<a name="l00231"></a>00231 <span class="preprocessor">        { obj-&gt;MNAME = ASSIGNER(newval); return true; }</span>
<a name="l00232"></a>00232 <span class="preprocessor"></span>
<a name="l00237"></a>00237 <span class="preprocessor">#define OSCAP_SETTER_SIMPLE(SNAME, MTYPE, MNAME) \</span>
<a name="l00238"></a>00238 <span class="preprocessor">        OSCAP_SETTER_GENERIC_NODELETE(SNAME, MTYPE, MNAME, )</span>
<a name="l00239"></a>00239 <span class="preprocessor"></span>
<a name="l00245"></a>00245 <span class="preprocessor">#define OSCAP_SETTER_STRING(SNAME, MNAME) \</span>
<a name="l00246"></a>00246 <span class="preprocessor">        OSCAP_SETTER_GENERIC(SNAME, const char *, MNAME, free, oscap_strdup)</span>
<a name="l00247"></a>00247 <span class="preprocessor"></span>
<a name="l00251"></a>00251 <span class="preprocessor">#define OSCAP_ACCESSOR_STRING(SNAME, MNAME) \</span>
<a name="l00252"></a>00252 <span class="preprocessor">        OSCAP_GETTER(const char*, SNAME, MNAME) OSCAP_SETTER_STRING(SNAME, MNAME)</span>
<a name="l00253"></a>00253 <span class="preprocessor"></span>
<a name="l00257"></a>00257 <span class="preprocessor">#define OSCAP_ACCESSOR_TEXT(SNAME, MNAME) \</span>
<a name="l00258"></a>00258 <span class="preprocessor">        OSCAP_GETTER(struct oscap_text *, SNAME, MNAME) \</span>
<a name="l00259"></a>00259 <span class="preprocessor">    OSCAP_SETTER_GENERIC(SNAME, struct oscap_text*, MNAME, oscap_text_free, )</span>
<a name="l00260"></a>00260 <span class="preprocessor"></span>
<a name="l00264"></a>00264 <span class="preprocessor">#define OSCAP_ACCESSOR_SIMPLE(MTYPE, SNAME, MNAME) \</span>
<a name="l00265"></a>00265 <span class="preprocessor">        OSCAP_GETTER(MTYPE, SNAME, MNAME) OSCAP_SETTER_SIMPLE(SNAME, MTYPE, MNAME)</span>
<a name="l00266"></a>00266 <span class="preprocessor"></span>
<a name="l00271"></a>00271 <span class="preprocessor">#define OSCAP_ACCESSOR_EXP(MTYPE, SNAME, MNAME, MEXP) \</span>
<a name="l00272"></a>00272 <span class="preprocessor">    OSCAP_GENERIC_GETTER(MTYPE, SNAME, MNAME, MEXP) \</span>
<a name="l00273"></a>00273 <span class="preprocessor">    OSCAP_SETTER_HEADER(SNAME, MTYPE, MNAME) { obj-&gt;MEXP = newval; return true; }</span>
<a name="l00274"></a>00274 <span class="preprocessor"></span>
<a name="l00284"></a>00284 <span class="preprocessor">#define OSCAP_INSERTER(SNAME, FNAME, MTYPE, MNAME) \</span>
<a name="l00285"></a>00285 <span class="preprocessor">        bool SNAME##_add_##FNAME(struct SNAME *obj, struct MTYPE *item) \</span>
<a name="l00286"></a>00286 <span class="preprocessor">        { oscap_list_add(obj-&gt;MNAME, item); return true; }</span>
<a name="l00287"></a>00287 <span class="preprocessor"></span>
<a name="l00288"></a>00288 <span class="comment">/* Generate iterator getter and list inserter */</span>
<a name="l00289"></a>00289 <span class="preprocessor">#define OSCAP_IGETINS(ITYPE, SNAME, MNAME, FNAME) \</span>
<a name="l00290"></a>00290 <span class="preprocessor">        OSCAP_IGETTER(ITYPE, SNAME, MNAME) OSCAP_INSERTER(SNAME, FNAME, ITYPE, MNAME)</span>
<a name="l00291"></a>00291 <span class="preprocessor"></span><span class="comment">/* Generate iterator getter, list inserter, and iterator manipulation functions. */</span>
<a name="l00292"></a>00292 <span class="preprocessor">#define OSCAP_IGETINS_GEN(ITYPE, SNAME, MNAME, FNAME) \</span>
<a name="l00293"></a>00293 <span class="preprocessor">        OSCAP_IGETTER_GEN(ITYPE, SNAME, MNAME) OSCAP_INSERTER(SNAME, FNAME, ITYPE, MNAME)</span>
<a name="l00294"></a>00294 <span class="preprocessor"></span>
<a name="l00302"></a><a class="code" href="structoscap__string__map.html">00302</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="l00303"></a>00303         <span class="keywordtype">int</span> value;              <span class="comment">/* integer/enum value */</span>
<a name="l00304"></a>00304         <span class="keyword">const</span> <span class="keywordtype">char</span> *string;     <span class="comment">/* string representation of the value */</span>
<a name="l00305"></a>00305 };
<a name="l00306"></a>00306 
<a name="l00313"></a>00313 <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="l00314"></a>00314 
<a name="l00321"></a>00321 <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="l00322"></a>00322 
<a name="l00327"></a>00327 <span class="keywordtype">char</span> *oscap_strdup(<span class="keyword">const</span> <span class="keywordtype">char</span> *str);
<a name="l00328"></a>00328 
<a name="l00335"></a>00335 <span class="keywordtype">float</span> oscap_strtol(<span class="keyword">const</span> <span class="keywordtype">char</span> *str, <span class="keywordtype">char</span> **endptr, <span class="keywordtype">int</span> base);
<a name="l00336"></a>00336 
<a name="l00345"></a>00345 <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="l00346"></a>00346 
<a name="l00347"></a>00347 
<a name="l00349"></a>00349 <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="l00351"></a>00351 <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="l00353"></a>00353 <span class="keywordtype">char</span> *oscap_trim(<span class="keywordtype">char</span> *str);
<a name="l00355"></a>00355 <span class="keywordtype">char</span> *oscap_vsprintf(<span class="keyword">const</span> <span class="keywordtype">char</span> *fmt, va_list ap);
<a name="l00357"></a>00357 <span class="keywordtype">char</span> *oscap_sprintf(<span class="keyword">const</span> <span class="keywordtype">char</span> *fmt, ...);
<a name="l00359"></a>00359 <span class="keyword">const</span> <span class="keywordtype">char</span> *oscap_strlist_find_value(<span class="keywordtype">char</span> ** <span class="keyword">const</span> kvalues, <span class="keyword">const</span> <span class="keywordtype">char</span> *key);
<a name="l00361"></a>00361 <span class="keywordtype">char</span> *oscap_rtrim(<span class="keywordtype">char</span> *str, <span class="keywordtype">char</span> ch);
<a name="l00362"></a>00362 
<a name="l00363"></a>00363 <span class="comment">// check pointer equality</span>
<a name="l00364"></a>00364 <span class="keywordtype">bool</span> oscap_ptr_cmp(<span class="keywordtype">void</span> *node1, <span class="keywordtype">void</span> *node2);
<a name="l00365"></a>00365 
<a name="l00366"></a>00366 <span class="comment">// validate given XML file</span>
<a name="l00367"></a>00367 <span class="keywordtype">bool</span> oscap_validate_xml(<span class="keyword">const</span> <span class="keywordtype">char</span> *xmlfile, <span class="keyword">const</span> <span class="keywordtype">char</span> *schemafile, <a class="code" href="group__Reporters.html#gada96dbbbb54a7659c3acf1c00a7d7ad3" title="Reporter prototype.">oscap_reporter</a> reporter, <span class="keywordtype">void</span> *arg);
<a name="l00368"></a>00368 <span class="comment">// check file existence</span>
<a name="l00369"></a>00369 <span class="keywordtype">bool</span> oscap_file_exists(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keywordtype">int</span> mode);
<a name="l00370"></a>00370 
<a name="l00378"></a>00378 <span class="keywordtype">char</span> *oscap_find_file(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keywordtype">int</span> mode, <span class="keyword">const</span> <span class="keywordtype">char</span> *pathvar, <span class="keyword">const</span> <span class="keywordtype">char</span> *path);
<a name="l00379"></a>00379 
<a name="l00380"></a>00380 
<a name="l00381"></a>00381 <span class="preprocessor">#ifndef OSCAP_CONCAT</span>
<a name="l00382"></a>00382 <span class="preprocessor"></span><span class="preprocessor"># define OSCAP_CONCAT1(a,b) a ## b</span>
<a name="l00383"></a>00383 <span class="preprocessor"></span><span class="preprocessor"># define OSCAP_CONCAT(a,b) OSCAP_CONCAT1(a,b)</span>
<a name="l00384"></a>00384 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00385"></a>00385 <span class="preprocessor"></span>
<a name="l00386"></a>00386 <span class="preprocessor">#define OSCAP_GSYM(s) OSCAP_CONCAT(___G_, s)</span>
<a name="l00387"></a>00387 <span class="preprocessor"></span>
<a name="l00388"></a>00388 <span class="preprocessor">#define protect_errno                                                   \</span>
<a name="l00389"></a>00389 <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="l00390"></a>00390 <span class="preprocessor"></span>
<a name="l00391"></a>00391 OSCAP_HIDDEN_END;
<a name="l00392"></a>00392 
<a name="l00393"></a>00393 <span class="preprocessor">#endif                          </span><span class="comment">/* OSCAP_UTIL_H_ */</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Mon Jul 25 2011 for Open SCAP Library 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>