summaryrefslogtreecommitdiff
path: root/doc/librpm/html/system_8h_source.html
blob: 1cce0275aa9d24a5aa5aa799d76c38dc1ccddeec (plain)
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
<!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>rpm: system.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">rpm&#160;<span id="projectnumber">4.9.1</span></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">system.h</div>  </div>
</div>
<div class="contents">
<a href="system_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00005"></a>00005 <span class="preprocessor">#ifndef H_SYSTEM</span>
<a name="l00006"></a>00006 <span class="preprocessor"></span><span class="preprocessor">#define H_SYSTEM</span>
<a name="l00007"></a>00007 <span class="preprocessor"></span>
<a name="l00008"></a>00008 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
<a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#include &quot;<a class="code" href="config_8h.html">config.h</a>&quot;</span>
<a name="l00010"></a>00010 <span class="preprocessor">#endif</span>
<a name="l00011"></a>00011 <span class="preprocessor"></span>
<a name="l00012"></a>00012 <span class="preprocessor">#ifdef HAVE_SYS_PARAM_H</span>
<a name="l00013"></a>00013 <span class="preprocessor"></span><span class="preprocessor">#include &lt;sys/param.h&gt;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#endif</span>
<a name="l00015"></a>00015 <span class="preprocessor"></span>
<a name="l00016"></a>00016 <span class="comment">/* &lt;unistd.h&gt; should be included before any preprocessor test</span>
<a name="l00017"></a>00017 <span class="comment">   of _POSIX_VERSION.  */</span>
<a name="l00018"></a>00018 <span class="preprocessor">#ifdef HAVE_UNISTD_H</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#include &lt;unistd.h&gt;</span>
<a name="l00020"></a>00020 <span class="preprocessor">#if !defined(__GLIBC__)</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#ifdef __APPLE__</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#include &lt;crt_externs.h&gt;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#define environ (*_NSGetEnviron())</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="keywordtype">char</span> ** <a class="code" href="rpmdb_8c.html#aa006daaf11f1e2e45a6ababaf463212b">environ</a>;
<a name="l00026"></a>00026 <span class="preprocessor">#endif </span><span class="comment">/* __APPLE__ */</span>
<a name="l00027"></a>00027 <span class="preprocessor">#endif</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span>
<a name="l00030"></a>00030 <span class="preprocessor">#if !defined(HAVE_STPCPY)</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span><span class="keywordtype">char</span> * <a class="code" href="system_8h.html#a890dbcd7c456828c1b6ff714e405fcc1">stpcpy</a>(<span class="keywordtype">char</span> * dest, <span class="keyword">const</span> <span class="keywordtype">char</span> * src);
<a name="l00032"></a>00032 <span class="preprocessor">#endif</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span>
<a name="l00034"></a>00034 <span class="preprocessor">#if !defined(HAVE_STPNCPY)</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span><span class="keywordtype">char</span> * <a class="code" href="system_8h.html#a217a70a69e2fc7727278516b7ad2fc26">stpncpy</a>(<span class="keywordtype">char</span> * dest, <span class="keyword">const</span> <span class="keywordtype">char</span> * src, <span class="keywordtype">size_t</span> n);
<a name="l00036"></a>00036 <span class="preprocessor">#endif</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span>
<a name="l00038"></a>00038 <span class="preprocessor">#if HAVE___SECURE_GETENV</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor">#define getenv(_s)      __secure_getenv(_s)</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00041"></a>00041 <span class="preprocessor"></span>
<a name="l00042"></a>00042 <span class="preprocessor">#ifdef HAVE_FCNTL_H</span>
<a name="l00043"></a>00043 <span class="preprocessor"></span><span class="preprocessor">#include &lt;fcntl.h&gt;</span>
<a name="l00044"></a>00044 <span class="preprocessor">#else</span>
<a name="l00045"></a>00045 <span class="preprocessor"></span><span class="preprocessor">#include &lt;sys/file.h&gt;</span>
<a name="l00046"></a>00046 <span class="preprocessor">#endif</span>
<a name="l00047"></a>00047 <span class="preprocessor"></span>
<a name="l00048"></a>00048 <span class="preprocessor">#ifdef HAVE_DIRENT_H</span>
<a name="l00049"></a>00049 <span class="preprocessor"></span><span class="preprocessor"># include &lt;dirent.h&gt;</span>
<a name="l00050"></a>00050 <span class="preprocessor"># define NLENGTH(direct) (strlen((direct)-&gt;d_name))</span>
<a name="l00051"></a>00051 <span class="preprocessor"></span><span class="preprocessor">#else </span><span class="comment">/* not HAVE_DIRENT_H */</span>
<a name="l00052"></a><a class="code" href="system_8h.html#a89957e9be80ef12a50eb4eca72ecd888">00052</a> <span class="preprocessor"># define dirent direct</span>
<a name="l00053"></a><a class="code" href="system_8h.html#aedb4f2167b2af2f06f34fe1a5031e217">00053</a> <span class="preprocessor"></span><span class="preprocessor"># define NLENGTH(direct) ((direct)-&gt;d_namlen)</span>
<a name="l00054"></a>00054 <span class="preprocessor"></span><span class="preprocessor"># ifdef HAVE_SYS_NDIR_H</span>
<a name="l00055"></a>00055 <span class="preprocessor"></span><span class="preprocessor">#  include &lt;sys/ndir.h&gt;</span>
<a name="l00056"></a>00056 <span class="preprocessor"># endif </span><span class="comment">/* HAVE_SYS_NDIR_H */</span>
<a name="l00057"></a>00057 <span class="preprocessor"># ifdef HAVE_SYS_DIR_H</span>
<a name="l00058"></a>00058 <span class="preprocessor"></span><span class="preprocessor">#  include &lt;sys/dir.h&gt;</span>
<a name="l00059"></a>00059 <span class="preprocessor"># endif </span><span class="comment">/* HAVE_SYS_DIR_H */</span>
<a name="l00060"></a>00060 <span class="preprocessor"># ifdef HAVE_NDIR_H</span>
<a name="l00061"></a>00061 <span class="preprocessor"></span><span class="preprocessor">#  include &lt;ndir.h&gt;</span>
<a name="l00062"></a>00062 <span class="preprocessor"># endif </span><span class="comment">/* HAVE_NDIR_H */</span>
<a name="l00063"></a>00063 <span class="preprocessor">#endif </span><span class="comment">/* HAVE_DIRENT_H */</span>
<a name="l00064"></a>00064 
<a name="l00065"></a>00065 <span class="preprocessor">#if HAVE_LIMITS_H</span>
<a name="l00066"></a>00066 <span class="preprocessor"></span><span class="preprocessor">#include &lt;limits.h&gt;</span>
<a name="l00067"></a>00067 <span class="preprocessor">#endif</span>
<a name="l00068"></a>00068 <span class="preprocessor"></span>
<a name="l00069"></a>00069 <span class="preprocessor">#ifndef PATH_MAX</span>
<a name="l00070"></a>00070 <span class="preprocessor"></span><span class="preprocessor">#ifdef _POSIX_PATH_MAX</span>
<a name="l00071"></a>00071 <span class="preprocessor"></span><span class="preprocessor">#define PATH_MAX _POSIX_PATH_MAX</span>
<a name="l00072"></a>00072 <span class="preprocessor"></span><span class="preprocessor">#elif defined MAXPATHLEN</span>
<a name="l00073"></a>00073 <span class="preprocessor"></span><span class="preprocessor">#define PATH_MAX MAXPATHLEN</span>
<a name="l00074"></a>00074 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00075"></a><a class="code" href="system_8h.html#ae688d728e1acdfe5988c7db45d6f0166">00075</a> <span class="preprocessor"></span><span class="preprocessor">#define PATH_MAX 256</span>
<a name="l00076"></a>00076 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00077"></a>00077 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00078"></a>00078 <span class="preprocessor"></span>
<a name="l00079"></a>00079 <span class="preprocessor">#if WITH_SELINUX</span>
<a name="l00080"></a>00080 <span class="preprocessor"></span><span class="preprocessor">#include &lt;selinux/selinux.h&gt;</span>
<a name="l00081"></a>00081 <span class="preprocessor">#include &lt;selinux/label.h&gt;</span>
<a name="l00082"></a>00082 <span class="preprocessor">#else</span>
<a name="l00083"></a><a class="code" href="system_8h.html#a647738b0bfa7922b9a114414112237d1">00083</a> <span class="preprocessor"></span><span class="keyword">typedef</span> <span class="keywordtype">char</span> * <a class="code" href="system_8h.html#a647738b0bfa7922b9a114414112237d1">security_context_t</a>;
<a name="l00084"></a>00084 
<a name="l00085"></a><a class="code" href="system_8h.html#a579557463dca40bc27551ed71fc463b9">00085</a> <span class="preprocessor">#define freecon(_c)</span>
<a name="l00086"></a>00086 <span class="preprocessor"></span>
<a name="l00087"></a><a class="code" href="system_8h.html#a11a1d804d7937a7b19e9b0def270ad68">00087</a> <span class="preprocessor">#define setfilecon(_fn, _c)     (-1)</span>
<a name="l00088"></a><a class="code" href="system_8h.html#a71351fe35c9fa672526a0572d59c8b29">00088</a> <span class="preprocessor"></span><span class="preprocessor">#define lsetfilecon(_fn, _c)    (-1)</span>
<a name="l00089"></a>00089 <span class="preprocessor"></span>
<a name="l00090"></a><a class="code" href="system_8h.html#a39b9168c88bf6145056a39e9176a6267">00090</a> <span class="preprocessor">#define is_selinux_enabled()    (0)</span>
<a name="l00091"></a>00091 <span class="preprocessor"></span>
<a name="l00092"></a><a class="code" href="system_8h.html#a944a50161a6106c7340eab260eeff7d2">00092</a> <span class="preprocessor">#define matchpathcon_init(_fn)                  (-1)</span>
<a name="l00093"></a><a class="code" href="system_8h.html#a6a6f7c4d1f5db4206573db90afa8d3b9">00093</a> <span class="preprocessor"></span><span class="preprocessor">#define matchpathcon_fini()                     (0)</span>
<a name="l00094"></a><a class="code" href="system_8h.html#a94838411127c9f8370d2cfb9fa591d91">00094</a> <span class="preprocessor"></span><span class="preprocessor">#define matchpathcon(_fn, _fm, _c)              (-1)</span>
<a name="l00095"></a>00095 <span class="preprocessor"></span>
<a name="l00096"></a><a class="code" href="system_8h.html#a43c1dff0d63700785cba2c8b66f954ba">00096</a> <span class="preprocessor">#define selabel_lookup_raw(_hnd, _scon, _key,_type)     (-1)</span>
<a name="l00097"></a>00097 <span class="preprocessor"></span>
<a name="l00098"></a><a class="code" href="system_8h.html#ad3804338ea38779c1d21857a3dc03d5b">00098</a> <span class="preprocessor">#define selinux_file_context_path() (0)</span>
<a name="l00099"></a>00099 <span class="preprocessor"></span>
<a name="l00100"></a><a class="code" href="system_8h.html#a97e4e71d31e95800050ae0f1bfaf09bb">00100</a> <span class="preprocessor">#define rpm_execcon(_v, _fn, _av, _envp)        (0)</span>
<a name="l00101"></a>00101 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00102"></a>00102 <span class="preprocessor"></span>
<a name="l00103"></a>00103 <span class="preprocessor">#include &quot;<a class="code" href="rpmutil_8h.html">rpmio/rpmutil.h</a>&quot;</span>
<a name="l00104"></a>00104 <span class="comment">/* compatibility macros to avoid a mass-renaming all over the codebase */</span>
<a name="l00105"></a><a class="code" href="system_8h.html#a4213b2ad4e4e16d946a377f6684fb364">00105</a> <span class="preprocessor">#define xmalloc(_size) rmalloc((_size))</span>
<a name="l00106"></a><a class="code" href="system_8h.html#a574787c4652b31e4f92edc813a1e78b6">00106</a> <span class="preprocessor"></span><span class="preprocessor">#define xcalloc(_nmemb, _size) rcalloc((_nmemb), (_size))</span>
<a name="l00107"></a><a class="code" href="system_8h.html#abd7a1ba91b6b968b64639bb0149a69e5">00107</a> <span class="preprocessor"></span><span class="preprocessor">#define xrealloc(_ptr, _size) rrealloc((_ptr), (_size))</span>
<a name="l00108"></a><a class="code" href="system_8h.html#ab62344482c6d93843e0388d2ba2cf514">00108</a> <span class="preprocessor"></span><span class="preprocessor">#define xstrdup(_str) rstrdup((_str))</span>
<a name="l00109"></a><a class="code" href="system_8h.html#ae6e74ce39e6413596a772e62aacc51cb">00109</a> <span class="preprocessor"></span><span class="preprocessor">#define _free(_ptr) rfree((_ptr))</span>
<a name="l00110"></a>00110 <span class="preprocessor"></span>
<a name="l00111"></a>00111 <span class="comment">/* Retrofit glibc __progname */</span>
<a name="l00112"></a>00112 <span class="preprocessor">#if defined __GLIBC__ &amp;&amp; __GLIBC__ &gt;= 2</span>
<a name="l00113"></a>00113 <span class="preprocessor"></span><span class="preprocessor">#if __GLIBC_MINOR__ &gt;= 1</span>
<a name="l00114"></a>00114 <span class="preprocessor"></span><span class="preprocessor">#define __progname      __assert_program_name</span>
<a name="l00115"></a>00115 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00116"></a>00116 <span class="preprocessor"></span><span class="preprocessor">#define setprogname(pn)</span>
<a name="l00117"></a>00117 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00118"></a><a class="code" href="system_8h.html#a41c2f9db0a7e23392fbbebb1d1c185ec">00118</a> <span class="preprocessor"></span><span class="preprocessor">#define __progname      program_name</span>
<a name="l00119"></a><a class="code" href="system_8h.html#a08b0a5a39651f29857ebec61a69217a2">00119</a> <span class="preprocessor"></span><span class="preprocessor">#define setprogname(pn) \</span>
<a name="l00120"></a>00120 <span class="preprocessor">  { if ((__progname = strrchr(pn, &#39;/&#39;)) != NULL) __progname++; \</span>
<a name="l00121"></a>00121 <span class="preprocessor">    else __progname = pn;               \</span>
<a name="l00122"></a>00122 <span class="preprocessor">  }</span>
<a name="l00123"></a>00123 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00124"></a>00124 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="system_8h.html#a41c2f9db0a7e23392fbbebb1d1c185ec">__progname</a>;
<a name="l00125"></a>00125 
<a name="l00126"></a>00126 <span class="comment">/* Take care of NLS matters.  */</span>
<a name="l00127"></a>00127 <span class="preprocessor">#if ENABLE_NLS</span>
<a name="l00128"></a>00128 <span class="preprocessor"></span><span class="preprocessor"># include &lt;locale.h&gt;</span>
<a name="l00129"></a>00129 <span class="preprocessor"># include &lt;libintl.h&gt;</span>
<a name="l00130"></a>00130 <span class="preprocessor"># define _(Text) dgettext (PACKAGE, Text)</span>
<a name="l00131"></a>00131 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00132"></a><a class="code" href="system_8h.html#a8a97de23397d8af6821824c0234d8c3c">00132</a> <span class="preprocessor"></span><span class="preprocessor"># define _(Text) Text</span>
<a name="l00133"></a>00133 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00134"></a>00134 <span class="preprocessor"></span>
<a name="l00135"></a><a class="code" href="system_8h.html#aca24492e24b07d15df23b4957092a9f3">00135</a> <span class="preprocessor">#define N_(Text) Text</span>
<a name="l00136"></a>00136 <span class="preprocessor"></span>
<a name="l00137"></a>00137 <span class="comment">/* ============== from misc/miscfn.h */</span>
<a name="l00138"></a>00138 
<a name="l00139"></a>00139 <span class="preprocessor">#if !defined(USE_GNU_GLOB) </span>
<a name="l00140"></a>00140 <span class="preprocessor"></span><span class="preprocessor">#if HAVE_FNMATCH_H</span>
<a name="l00141"></a>00141 <span class="preprocessor"></span><span class="preprocessor">#include &lt;fnmatch.h&gt;</span>
<a name="l00142"></a>00142 <span class="preprocessor">#endif</span>
<a name="l00143"></a>00143 <span class="preprocessor"></span>
<a name="l00144"></a>00144 <span class="preprocessor">#if HAVE_GLOB_H </span>
<a name="l00145"></a>00145 <span class="preprocessor"></span><span class="preprocessor">#include &lt;glob.h&gt;</span>
<a name="l00146"></a>00146 <span class="preprocessor">#endif</span>
<a name="l00147"></a>00147 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00148"></a>00148 <span class="preprocessor"></span><span class="preprocessor">#include &quot;misc/glob.h&quot;</span>
<a name="l00149"></a>00149 <span class="preprocessor">#include &quot;misc/fnmatch.h&quot;</span>
<a name="l00150"></a>00150 <span class="preprocessor">#endif</span>
<a name="l00151"></a>00151 <span class="preprocessor"></span>
<a name="l00152"></a>00152 <span class="preprocessor">#include &lt;dlfcn.h&gt;</span>
<a name="l00153"></a>00153 
<a name="l00154"></a>00154 <span class="preprocessor">#endif  </span><span class="comment">/* H_SYSTEM */</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Fri Jul 15 2011 for rpm 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>