Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > 67e32647b06c0323bf90c6b54a6438d1 > files > 75

rpm-apidocs-4.4.2.3-34.el5.x86_64.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>rpm: file/src/file.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.7 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
    <li id="current"><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul></div>
<div class="tabs">
  <ul>
    <li><a href="files.html"><span>File&nbsp;List</span></a></li>
    <li><a href="globals.html"><span>Globals</span></a></li>
  </ul></div>
<h1>file/src/file.h</h1><a href="file_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"> * Copyright (c) Ian F. Darwin 1986-1995.</span>
<a name="l00003"></a>00003 <span class="comment"> * Software written by Ian F. Darwin and others;</span>
<a name="l00004"></a>00004 <span class="comment"> * maintained 1995-present by Christos Zoulas and others.</span>
<a name="l00005"></a>00005 <span class="comment"> * </span>
<a name="l00006"></a>00006 <span class="comment"> * Redistribution and use in source and binary forms, with or without</span>
<a name="l00007"></a>00007 <span class="comment"> * modification, are permitted provided that the following conditions</span>
<a name="l00008"></a>00008 <span class="comment"> * are met:</span>
<a name="l00009"></a>00009 <span class="comment"> * 1. Redistributions of source code must retain the above copyright</span>
<a name="l00010"></a>00010 <span class="comment"> *    notice immediately at the beginning of the file, without modification,</span>
<a name="l00011"></a>00011 <span class="comment"> *    this list of conditions, and the following disclaimer.</span>
<a name="l00012"></a>00012 <span class="comment"> * 2. Redistributions in binary form must reproduce the above copyright</span>
<a name="l00013"></a>00013 <span class="comment"> *    notice, this list of conditions and the following disclaimer in the</span>
<a name="l00014"></a>00014 <span class="comment"> *    documentation and/or other materials provided with the distribution.</span>
<a name="l00015"></a>00015 <span class="comment"> *  </span>
<a name="l00016"></a>00016 <span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND</span>
<a name="l00017"></a>00017 <span class="comment"> * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span>
<a name="l00018"></a>00018 <span class="comment"> * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span>
<a name="l00019"></a>00019 <span class="comment"> * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR</span>
<a name="l00020"></a>00020 <span class="comment"> * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL</span>
<a name="l00021"></a>00021 <span class="comment"> * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS</span>
<a name="l00022"></a>00022 <span class="comment"> * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)</span>
<a name="l00023"></a>00023 <span class="comment"> * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT</span>
<a name="l00024"></a>00024 <span class="comment"> * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY</span>
<a name="l00025"></a>00025 <span class="comment"> * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF</span>
<a name="l00026"></a>00026 <span class="comment"> * SUCH DAMAGE.</span>
<a name="l00027"></a>00027 <span class="comment"> */</span>
<a name="l00028"></a>00028 <span class="comment">/*</span>
<a name="l00029"></a>00029 <span class="comment"> * file.h - definitions for file(1) program</span>
<a name="l00030"></a>00030 <span class="comment"> * @(#)$Id: file.h,v 1.72 2005/10/17 15:36:22 christos Exp $</span>
<a name="l00031"></a>00031 <span class="comment"> */</span>
<a name="l00032"></a>00032 
<a name="l00033"></a>00033 <span class="preprocessor">#ifndef __file_h__</span>
<a name="l00034"></a>00034 <span class="preprocessor"></span><span class="preprocessor">#define __file_h__</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span>
<a name="l00036"></a>00036 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor">#include &lt;<a class="code" href="config_8h.html">config.h</a>&gt;</span>
<a name="l00038"></a>00038 <span class="preprocessor">#endif</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span>
<a name="l00040"></a>00040 <span class="preprocessor">#include &lt;stdio.h&gt;</span>      <span class="comment">/* Include that here, to make sure __P gets defined */</span>
<a name="l00041"></a>00041 <span class="preprocessor">#include &lt;errno.h&gt;</span>
<a name="l00042"></a>00042 <span class="preprocessor">#include &lt;fcntl.h&gt;</span>      <span class="comment">/* For open and flags */</span>
<a name="l00043"></a>00043 <span class="preprocessor">#ifdef HAVE_STDINT_H</span>
<a name="l00044"></a>00044 <span class="preprocessor"></span><span class="preprocessor">#include &lt;stdint.h&gt;</span>
<a name="l00045"></a>00045 <span class="preprocessor">#endif</span>
<a name="l00046"></a>00046 <span class="preprocessor"></span><span class="preprocessor">#ifdef HAVE_INTTYPES_H</span>
<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">#include &lt;inttypes.h&gt;</span>
<a name="l00048"></a>00048 <span class="preprocessor">#endif</span>
<a name="l00049"></a>00049 <span class="preprocessor"></span><span class="comment">/* Do this here and now, because struct stat gets re-defined on solaris */</span>
<a name="l00050"></a>00050 <span class="preprocessor">#include &lt;sys/stat.h&gt;</span>
<a name="l00051"></a>00051 
<a name="l00052"></a>00052 <span class="preprocessor">#ifndef MAGIC</span>
<a name="l00053"></a><a class="code" href="file_8h.html#94630370ae389fb1189282fa0742f310">00053</a> <span class="preprocessor"></span><span class="preprocessor">#define MAGIC "/etc/magic"</span>
<a name="l00054"></a>00054 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00055"></a>00055 <span class="preprocessor"></span>
<a name="l00056"></a>00056 <span class="preprocessor">#ifdef __EMX__</span>
<a name="l00057"></a>00057 <span class="preprocessor"></span><span class="preprocessor">#define PATHSEP ';'</span>
<a name="l00058"></a>00058 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00059"></a><a class="code" href="file_8h.html#dd147d27dd39c3119dfd2d2e7868a66b">00059</a> <span class="preprocessor"></span><span class="preprocessor">#define PATHSEP ':'</span>
<a name="l00060"></a>00060 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00061"></a>00061 <span class="preprocessor"></span>
<a name="l00062"></a><a class="code" href="file_8h.html#6a1d6e1a12975a4e9a0b5b952e79eaad">00062</a> <span class="preprocessor">#define private static</span>
<a name="l00063"></a>00063 <span class="preprocessor"></span><span class="preprocessor">#ifndef protected</span>
<a name="l00064"></a>00064 <span class="preprocessor"></span><span class="preprocessor">#define protected</span>
<a name="l00065"></a>00065 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00066"></a><a class="code" href="file_8h.html#9b06159f783a7975eccfa27e90dff1c2">00066</a> <span class="preprocessor"></span><span class="preprocessor">#define public</span>
<a name="l00067"></a>00067 <span class="preprocessor"></span>
<a name="l00068"></a>00068 <span class="preprocessor">#ifndef HOWMANY</span>
<a name="l00069"></a><a class="code" href="file_8h.html#41e00ab4d3de2683b50119458776bde9">00069</a> <span class="preprocessor"></span><span class="preprocessor"># define HOWMANY (256 * 1024)   </span><span class="comment">/* how much of the file to look at */</span>
<a name="l00070"></a>00070 <span class="preprocessor">#endif</span>
<a name="l00071"></a><a class="code" href="file_8h.html#e3c6ca00d52131a80e7154231bb12caf">00071</a> <span class="preprocessor"></span><span class="preprocessor">#define MAXMAGIS 8192           </span><span class="comment">/* max entries in /etc/magic */</span>
<a name="l00072"></a><a class="code" href="file_8h.html#282ab243d8a050b09c3fb21e4eebb54d">00072</a> <span class="preprocessor">#define MAXDESC 64              </span><span class="comment">/* max leng of text description */</span>
<a name="l00073"></a><a class="code" href="file_8h.html#182a3fb0ba7b39a649c4704d9e0c641e">00073</a> <span class="preprocessor">#define MAXstring 32            </span><span class="comment">/* max leng of "string" types */</span>
<a name="l00074"></a>00074 
<a name="l00075"></a><a class="code" href="file_8h.html#08e8ecf2939d12dcc84a8f389762ebd2">00075</a> <span class="preprocessor">#define MAGICNO         0xF11E041C</span>
<a name="l00076"></a><a class="code" href="file_8h.html#30cbe65e5d0fd5fc06e7253d10b75814">00076</a> <span class="preprocessor"></span><span class="preprocessor">#define VERSIONNO       2</span>
<a name="l00077"></a><a class="code" href="file_8h.html#2c06a52defabb1c9c0488ca6b36505c1">00077</a> <span class="preprocessor"></span><span class="preprocessor">#define FILE_MAGICSIZE  (32 * 4)</span>
<a name="l00078"></a>00078 <span class="preprocessor"></span>
<a name="l00079"></a><a class="code" href="file_8h.html#34461ae2d44fdc5b0ac17751586ecd9a">00079</a> <span class="preprocessor">#define FILE_LOAD       0</span>
<a name="l00080"></a><a class="code" href="file_8h.html#4cfcd6b1de0e51b20358e6b310744410">00080</a> <span class="preprocessor"></span><span class="preprocessor">#define FILE_CHECK      1</span>
<a name="l00081"></a><a class="code" href="file_8h.html#a2c340f672a067172e2f79b4f1ddd3c4">00081</a> <span class="preprocessor"></span><span class="preprocessor">#define FILE_COMPILE    2</span>
<a name="l00082"></a>00082 <span class="preprocessor"></span>
<a name="l00083"></a><a class="code" href="structmagic.html">00083</a> <span class="keyword">struct </span><a class="code" href="structmagic.html">magic</a> {
<a name="l00084"></a>00084         <span class="comment">/* Word 1 */</span>
<a name="l00085"></a><a class="code" href="structmagic.html#23a46cd1d650d2df768ab0ad4a6f3f12">00085</a>         uint16_t <a class="code" href="structmagic.html#23a46cd1d650d2df768ab0ad4a6f3f12">cont_level</a>;    <span class="comment">/* level of "&gt;" */</span>
<a name="l00086"></a><a class="code" href="structmagic.html#0ed01e58244ec8ecd760e45530d0dac2">00086</a>         uint8_t <a class="code" href="structmagic.html#0ed01e58244ec8ecd760e45530d0dac2">nospflag</a>;       <span class="comment">/* supress space character */</span>
<a name="l00087"></a><a class="code" href="structmagic.html#0e7ac867f649499f20572b513e03a132">00087</a>         uint8_t <a class="code" href="structmagic.html#0e7ac867f649499f20572b513e03a132">flag</a>;
<a name="l00088"></a><a class="code" href="file_8h.html#097a22443ff91fcbc27895fb27a86ba1">00088</a> <span class="preprocessor">#define INDIR   1               </span><span class="comment">/* if '&gt;(...)' appears,  */</span>
<a name="l00089"></a><a class="code" href="file_8h.html#08cbc66092284f7da94279f986a0aae9">00089</a> <span class="preprocessor">#define UNSIGNED 2              </span><span class="comment">/* comparison is unsigned */</span>
<a name="l00090"></a><a class="code" href="file_8h.html#b3455a16f39c62aa951a062e90c0c555">00090</a> <span class="preprocessor">#define OFFADD  4               </span><span class="comment">/* if '&gt;&amp;' appears,  */</span>
<a name="l00091"></a><a class="code" href="file_8h.html#798c3669583914c06ee420f0324f4abc">00091</a> <span class="preprocessor">#define INDIROFFADD     8       </span><span class="comment">/* if '&gt;&amp;(' appears,  */</span>
<a name="l00092"></a>00092         <span class="comment">/* Word 2 */</span>
<a name="l00093"></a><a class="code" href="structmagic.html#6bb0410eed598b4c6710ff2a40d5a0d7">00093</a>         uint8_t <a class="code" href="structmagic.html#6bb0410eed598b4c6710ff2a40d5a0d7">reln</a>;           <span class="comment">/* relation (0=eq, '&gt;'=gt, etc) */</span>
<a name="l00094"></a><a class="code" href="structmagic.html#451e74a4d28302ad0c7e03dddcf9b4f7">00094</a>         uint8_t <a class="code" href="structmagic.html#451e74a4d28302ad0c7e03dddcf9b4f7">vallen</a>;         <span class="comment">/* length of string value, if any */</span>
<a name="l00095"></a><a class="code" href="structmagic.html#e75b734f7c71f47276a4632fcdbf47a1">00095</a>         uint8_t <a class="code" href="structmagic.html#e75b734f7c71f47276a4632fcdbf47a1">type</a>;           <span class="comment">/* int, short, long or string. */</span>
<a name="l00096"></a><a class="code" href="structmagic.html#d9115d240386e20609dc6f69a3403319">00096</a>         uint8_t <a class="code" href="structmagic.html#d9115d240386e20609dc6f69a3403319">in_type</a>;        <span class="comment">/* type of indirrection */</span>
<a name="l00097"></a><a class="code" href="file_8h.html#435c581857151ad49c8448544c420698">00097</a> <span class="preprocessor">#define                         FILE_BYTE       1</span>
<a name="l00098"></a><a class="code" href="file_8h.html#1c6d01dcaf1b051e1ddbd2bc3b633f8c">00098</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_SHORT      2</span>
<a name="l00099"></a><a class="code" href="file_8h.html#35322a158d9dd1411e342b53046aa032">00099</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_LONG       4</span>
<a name="l00100"></a><a class="code" href="file_8h.html#4ac938e6d36a7f8a52c4394b0077464f">00100</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_STRING     5</span>
<a name="l00101"></a><a class="code" href="file_8h.html#d6d883aa6378340af8ce4ce8f7a4f80b">00101</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_DATE       6</span>
<a name="l00102"></a><a class="code" href="file_8h.html#23e842a34b0343f1cc98cd822eaac1c7">00102</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_BESHORT    7</span>
<a name="l00103"></a><a class="code" href="file_8h.html#7a9c4223732b87143c7b284abd9fda63">00103</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_BELONG     8</span>
<a name="l00104"></a><a class="code" href="file_8h.html#a365868ea8c750fded62bc4b5e760767">00104</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_BEDATE     9</span>
<a name="l00105"></a><a class="code" href="file_8h.html#3540b04b2b4846fb210496cb78142f58">00105</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_LESHORT    10</span>
<a name="l00106"></a><a class="code" href="file_8h.html#d95a80e01fd45266b3999f437c1b3c60">00106</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_LELONG     11</span>
<a name="l00107"></a><a class="code" href="file_8h.html#0ba7100a1f1044ff87d8f723a2e23b5c">00107</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_LEDATE     12</span>
<a name="l00108"></a><a class="code" href="file_8h.html#0ee3aa128e0786d27fa8a592d2c9d1c6">00108</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_PSTRING    13</span>
<a name="l00109"></a><a class="code" href="file_8h.html#4b2bd5c1277a412368842d361abaa271">00109</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_LDATE      14</span>
<a name="l00110"></a><a class="code" href="file_8h.html#71937f39d86126fb0e5ef25cb311ca0a">00110</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_BELDATE    15</span>
<a name="l00111"></a><a class="code" href="file_8h.html#a229d98fb7bc70ed761f9b3d11765bf2">00111</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_LELDATE    16</span>
<a name="l00112"></a><a class="code" href="file_8h.html#bb376719282da717a652862fc97e4b60">00112</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_REGEX      17</span>
<a name="l00113"></a><a class="code" href="file_8h.html#258ea58d33f4649ba27ef01f5d2c00e2">00113</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_BESTRING16 18</span>
<a name="l00114"></a><a class="code" href="file_8h.html#8f59d2f5ba3a667d3731d4d2a9270670">00114</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_LESTRING16 19</span>
<a name="l00115"></a><a class="code" href="file_8h.html#17a43525a99411f40d7181967e383a8e">00115</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_SEARCH     20</span>
<a name="l00116"></a>00116 <span class="preprocessor"></span>
<a name="l00117"></a><a class="code" href="file_8h.html#513707c1083106b2a0af8448f7850661">00117</a> <span class="preprocessor">#define                         FILE_FORMAT_NAME        \</span>
<a name="l00118"></a>00118 <span class="preprocessor"></span><span class="comment">/* 0 */</span>                         "invalid 0",            \
<a name="l00119"></a>00119 <span class="comment">/* 1 */</span>                         "byte",                 \
<a name="l00120"></a>00120 <span class="comment">/* 2 */</span>                         "short",                \
<a name="l00121"></a>00121 <span class="comment">/* 3 */</span>                         "invalid 3",            \
<a name="l00122"></a>00122 <span class="comment">/* 4 */</span>                         "long",                 \
<a name="l00123"></a>00123 <span class="comment">/* 5 */</span>                         "string",               \
<a name="l00124"></a>00124 <span class="comment">/* 6 */</span>                         "date",                 \
<a name="l00125"></a>00125 <span class="comment">/* 7 */</span>                         "beshort",              \
<a name="l00126"></a>00126 <span class="comment">/* 8 */</span>                         "belong",               \
<a name="l00127"></a>00127 <span class="comment">/* 9 */</span>                         "bedate",               \
<a name="l00128"></a>00128 <span class="comment">/* 10 */</span>                        "leshort",              \
<a name="l00129"></a>00129 <span class="comment">/* 11 */</span>                        "lelong",               \
<a name="l00130"></a>00130 <span class="comment">/* 12 */</span>                        "ledate",               \
<a name="l00131"></a>00131 <span class="comment">/* 13 */</span>                        "pstring",              \
<a name="l00132"></a>00132 <span class="comment">/* 14 */</span>                        "ldate",                \
<a name="l00133"></a>00133 <span class="comment">/* 15 */</span>                        "beldate",              \
<a name="l00134"></a>00134 <span class="comment">/* 16 */</span>                        "leldate",              \
<a name="l00135"></a>00135 <span class="comment">/* 17 */</span>                        "regex",                \
<a name="l00136"></a>00136 <span class="comment">/* 18 */</span>                        "bestring16",           \
<a name="l00137"></a>00137 <span class="comment">/* 19 */</span>                        "lestring16",           \
<a name="l00138"></a>00138 <span class="comment">/* 20 */</span>                        "search",
<a name="l00139"></a>00139 
<a name="l00140"></a><a class="code" href="file_8h.html#2d40001f17ee57db98b1317349afb752">00140</a> <span class="preprocessor">#define FILE_FMT_NUM    "cduxXi"</span>
<a name="l00141"></a><a class="code" href="file_8h.html#fcfb89fd3c9d00301c6f10e1acc94b5c">00141</a> <span class="preprocessor"></span><span class="preprocessor">#define FILE_FMT_STR    "s"     </span>
<a name="l00142"></a>00142 <span class="preprocessor"></span>
<a name="l00143"></a><a class="code" href="file_8h.html#e5a5ba0502655a6bae1dddb6b1be3d9b">00143</a> <span class="preprocessor">#define                         FILE_FORMAT_STRING      \</span>
<a name="l00144"></a>00144 <span class="preprocessor"></span><span class="comment">/* 0 */</span>                         NULL,                   \
<a name="l00145"></a>00145 <span class="comment">/* 1 */</span>                         FILE_FMT_NUM,           \
<a name="l00146"></a>00146 <span class="comment">/* 2 */</span>                         FILE_FMT_NUM,           \
<a name="l00147"></a>00147 <span class="comment">/* 3 */</span>                         NULL,                   \
<a name="l00148"></a>00148 <span class="comment">/* 4 */</span>                         FILE_FMT_NUM,           \
<a name="l00149"></a>00149 <span class="comment">/* 5 */</span>                         FILE_FMT_STR,           \
<a name="l00150"></a>00150 <span class="comment">/* 6 */</span>                         FILE_FMT_STR,           \
<a name="l00151"></a>00151 <span class="comment">/* 7 */</span>                         FILE_FMT_NUM,           \
<a name="l00152"></a>00152 <span class="comment">/* 8 */</span>                         FILE_FMT_NUM,           \
<a name="l00153"></a>00153 <span class="comment">/* 9 */</span>                         FILE_FMT_STR,           \
<a name="l00154"></a>00154 <span class="comment">/* 10 */</span>                        FILE_FMT_NUM,           \
<a name="l00155"></a>00155 <span class="comment">/* 11 */</span>                        FILE_FMT_NUM,           \
<a name="l00156"></a>00156 <span class="comment">/* 12 */</span>                        FILE_FMT_STR,           \
<a name="l00157"></a>00157 <span class="comment">/* 13 */</span>                        FILE_FMT_STR,           \
<a name="l00158"></a>00158 <span class="comment">/* 14 */</span>                        FILE_FMT_STR,           \
<a name="l00159"></a>00159 <span class="comment">/* 15 */</span>                        FILE_FMT_STR,           \
<a name="l00160"></a>00160 <span class="comment">/* 16 */</span>                        FILE_FMT_STR,           \
<a name="l00161"></a>00161 <span class="comment">/* 17 */</span>                        FILE_FMT_STR,           \
<a name="l00162"></a>00162 <span class="comment">/* 18 */</span>                        FILE_FMT_STR,           \
<a name="l00163"></a>00163 <span class="comment">/* 19 */</span>                        FILE_FMT_STR,           \
<a name="l00164"></a>00164 <span class="comment">/* 20 */</span>                        FILE_FMT_STR,
<a name="l00165"></a>00165 
<a name="l00166"></a>00166         <span class="comment">/* Word 3 */</span>
<a name="l00167"></a><a class="code" href="structmagic.html#a7f05dc2642e74b56f9f755d07a6802a">00167</a>         uint8_t <a class="code" href="structmagic.html#a7f05dc2642e74b56f9f755d07a6802a">in_op</a>;          <span class="comment">/* operator for indirection */</span>
<a name="l00168"></a><a class="code" href="structmagic.html#b5f68aa41078eeb7e2c8cabf9d654738">00168</a>         uint8_t <a class="code" href="structmagic.html#b5f68aa41078eeb7e2c8cabf9d654738">mask_op</a>;        <span class="comment">/* operator for mask */</span>
<a name="l00169"></a><a class="code" href="structmagic.html#3667f62ad8464f7ddb6dd4864a01032a">00169</a>         uint8_t <a class="code" href="structmagic.html#3667f62ad8464f7ddb6dd4864a01032a">dummy1</a>; 
<a name="l00170"></a><a class="code" href="structmagic.html#e8a4adaed59f09308a69b12c9b865639">00170</a>         uint8_t <a class="code" href="structmagic.html#e8a4adaed59f09308a69b12c9b865639">dummy2</a>; 
<a name="l00171"></a><a class="code" href="file_8h.html#bd7d3642fe3a166d39cc1622636a0007">00171</a> <span class="preprocessor">#define                         FILE_OPS        "&amp;|^+-*/%"</span>
<a name="l00172"></a><a class="code" href="file_8h.html#2458959ceb0aebeea32770431819b2b9">00172</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_OPAND      0</span>
<a name="l00173"></a><a class="code" href="file_8h.html#1bf5a4964b43abe9b7dc6a9b197ff75c">00173</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_OPOR       1</span>
<a name="l00174"></a><a class="code" href="file_8h.html#04a72e92ac5f7abf7de19b4787b00bb9">00174</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_OPXOR      2</span>
<a name="l00175"></a><a class="code" href="file_8h.html#92729255771e93cef5ce0ff2753abaae">00175</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_OPADD      3</span>
<a name="l00176"></a><a class="code" href="file_8h.html#dff6b072a0c3f988a28ff362eda8a8bd">00176</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_OPMINUS    4</span>
<a name="l00177"></a><a class="code" href="file_8h.html#ef4474425da7fab4eb93f77e465b40f7">00177</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_OPMULTIPLY 5</span>
<a name="l00178"></a><a class="code" href="file_8h.html#7055324280e0c3042cbf153538a22153">00178</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_OPDIVIDE   6</span>
<a name="l00179"></a><a class="code" href="file_8h.html#5d2222c2f36a031bd242fc85abcdcdd5">00179</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_OPMODULO   7</span>
<a name="l00180"></a><a class="code" href="file_8h.html#f4b4aedbfa8c6afecd008b4243928d4f">00180</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_OPINVERSE  0x40</span>
<a name="l00181"></a><a class="code" href="file_8h.html#99d2334c6d27b2eee87c6bbe5b54ea23">00181</a> <span class="preprocessor"></span><span class="preprocessor">#define                         FILE_OPINDIRECT 0x80</span>
<a name="l00182"></a>00182 <span class="preprocessor"></span>        <span class="comment">/* Word 4 */</span>
<a name="l00183"></a><a class="code" href="structmagic.html#b40d534d6197e80d1080abc637c53740">00183</a>         uint32_t <a class="code" href="structmagic.html#b40d534d6197e80d1080abc637c53740">offset</a>;        <span class="comment">/* offset to magic number */</span>
<a name="l00184"></a>00184         <span class="comment">/* Word 5 */</span>
<a name="l00185"></a><a class="code" href="structmagic.html#b0cfe17fa1f034128c80fb5dea7daf5e">00185</a>         int32_t <a class="code" href="structmagic.html#b0cfe17fa1f034128c80fb5dea7daf5e">in_offset</a>;      <span class="comment">/* offset from indirection */</span>
<a name="l00186"></a>00186         <span class="comment">/* Word 6 */</span>
<a name="l00187"></a><a class="code" href="structmagic.html#74302c6a10faec1229e9ea802946f044">00187</a>         uint32_t <a class="code" href="structmagic.html#74302c6a10faec1229e9ea802946f044">mask</a>;  <span class="comment">/* mask before comparison with value */</span>
<a name="l00188"></a>00188         <span class="comment">/* Word 7 */</span>
<a name="l00189"></a><a class="code" href="structmagic.html#448e08e834db332b031aae87c8f8e662">00189</a>         uint32_t <a class="code" href="structmagic.html#448e08e834db332b031aae87c8f8e662">dummy3</a>;
<a name="l00190"></a>00190         <span class="comment">/* Word 8 */</span>
<a name="l00191"></a><a class="code" href="structmagic.html#cd5bb2618ebc6cf8b6339584fa9e02a3">00191</a>         uint32_t <a class="code" href="structmagic.html#cd5bb2618ebc6cf8b6339584fa9e02a3">dummp4</a>;
<a name="l00192"></a>00192         <span class="comment">/* Words 9-16 */</span>
<a name="l00193"></a><a class="code" href="unionmagic_1_1VALUETYPE.html">00193</a>         <span class="keyword">union </span><a class="code" href="unionmagic_1_1VALUETYPE.html">VALUETYPE</a> {
<a name="l00194"></a><a class="code" href="unionmagic_1_1VALUETYPE.html#d9c18f384a44b259a4f1ab16cd21fed6">00194</a>                 uint8_t <a class="code" href="unionmagic_1_1VALUETYPE.html#d9c18f384a44b259a4f1ab16cd21fed6">b</a>;
<a name="l00195"></a><a class="code" href="unionmagic_1_1VALUETYPE.html#5939062f89241984714c60eaaaeeeaab">00195</a>                 uint16_t <a class="code" href="unionmagic_1_1VALUETYPE.html#5939062f89241984714c60eaaaeeeaab">h</a>;
<a name="l00196"></a><a class="code" href="unionmagic_1_1VALUETYPE.html#3fb4b3969388761865f4b781ce7dc48e">00196</a>                 uint32_t <a class="code" href="unionmagic_1_1VALUETYPE.html#3fb4b3969388761865f4b781ce7dc48e">l</a>;
<a name="l00197"></a><a class="code" href="unionmagic_1_1VALUETYPE.html#3567447d4b180ba753c79227e6a9b33f">00197</a>                 <span class="keywordtype">char</span> <a class="code" href="unionmagic_1_1VALUETYPE.html#3567447d4b180ba753c79227e6a9b33f">s</a>[<a class="code" href="file_8h.html#182a3fb0ba7b39a649c4704d9e0c641e">MAXstring</a>];
<a name="l00198"></a>00198                 <span class="keyword">struct </span>{
<a name="l00199"></a>00199 <span class="comment">/*@relnull@*/</span>
<a name="l00200"></a><a class="code" href="unionmagic_1_1VALUETYPE.html#1309203a471a0880e102085049ab3836">00200</a>                         <span class="keywordtype">char</span> *<a class="code" href="unionmagic_1_1VALUETYPE.html#1309203a471a0880e102085049ab3836">buf</a>;
<a name="l00201"></a><a class="code" href="unionmagic_1_1VALUETYPE.html#cfa23a2fef0457703190d2d9030f8db4">00201</a>                         size_t <a class="code" href="unionmagic_1_1VALUETYPE.html#cfa23a2fef0457703190d2d9030f8db4">buflen</a>;
<a name="l00202"></a>00202                 } <a class="code" href="unionmagic_1_1VALUETYPE.html#aa96a2b9ef7eb3b57e67ed2534ac9f6d">search</a>;
<a name="l00203"></a><a class="code" href="unionmagic_1_1VALUETYPE.html#6d6d441943242c9e3c334916fcfeb00d">00203</a>                 uint8_t <a class="code" href="unionmagic_1_1VALUETYPE.html#6d6d441943242c9e3c334916fcfeb00d">hs</a>[2];  <span class="comment">/* 2 bytes of a fixed-endian "short" */</span>
<a name="l00204"></a><a class="code" href="unionmagic_1_1VALUETYPE.html#d5c26bb88be8722ebc03e9be8b1147d2">00204</a>                 uint8_t <a class="code" href="unionmagic_1_1VALUETYPE.html#d5c26bb88be8722ebc03e9be8b1147d2">hl</a>[4];  <span class="comment">/* 4 bytes of a fixed-endian "long" */</span>
<a name="l00205"></a>00205         } <a class="code" href="structmagic.html#22209e0ed0303f04488686dee72c4ddf">value</a>;                <span class="comment">/* either number or string */</span>
<a name="l00206"></a>00206         <span class="comment">/* Words 17..31 */</span>
<a name="l00207"></a><a class="code" href="structmagic.html#7cdb474a5e1d59919e1dec5d928cc2d4">00207</a>         <span class="keywordtype">char</span> <a class="code" href="structmagic.html#7cdb474a5e1d59919e1dec5d928cc2d4">desc</a>[<a class="code" href="file_8h.html#282ab243d8a050b09c3fb21e4eebb54d">MAXDESC</a>];     <span class="comment">/* description */</span>
<a name="l00208"></a>00208 };
<a name="l00209"></a>00209 
<a name="l00210"></a><a class="code" href="file_8h.html#13ef80ed730f46fb2111f8cd399c8419">00210</a> <span class="preprocessor">#define BIT(A)   (1 &lt;&lt; (A))</span>
<a name="l00211"></a><a class="code" href="file_8h.html#8ae3864781a7196368a9408b23ad16f0">00211</a> <span class="preprocessor"></span><span class="preprocessor">#define STRING_IGNORE_LOWERCASE         BIT(0)</span>
<a name="l00212"></a><a class="code" href="file_8h.html#a2eb368002c86135f766be93a90a63fc">00212</a> <span class="preprocessor"></span><span class="preprocessor">#define STRING_COMPACT_BLANK            BIT(1)</span>
<a name="l00213"></a><a class="code" href="file_8h.html#f890d90f64b5feeb3bcfcac22506fd07">00213</a> <span class="preprocessor"></span><span class="preprocessor">#define STRING_COMPACT_OPTIONAL_BLANK   BIT(2)</span>
<a name="l00214"></a><a class="code" href="file_8h.html#5b18c52ce49cb9cf577412d86505dad7">00214</a> <span class="preprocessor"></span><span class="preprocessor">#define CHAR_IGNORE_LOWERCASE           'c'</span>
<a name="l00215"></a><a class="code" href="file_8h.html#e1bbe21c8f083ae991b387e7bfb650db">00215</a> <span class="preprocessor"></span><span class="preprocessor">#define CHAR_COMPACT_BLANK              'B'</span>
<a name="l00216"></a><a class="code" href="file_8h.html#6ba0ad822cdcf26ab58767476bd05d09">00216</a> <span class="preprocessor"></span><span class="preprocessor">#define CHAR_COMPACT_OPTIONAL_BLANK     'b'</span>
<a name="l00217"></a>00217 <span class="preprocessor"></span>
<a name="l00218"></a>00218 
<a name="l00219"></a>00219 <span class="comment">/* list of magic entries */</span>
<a name="l00220"></a><a class="code" href="structmlist.html">00220</a> <span class="keyword">struct </span><a class="code" href="structmlist.html">mlist</a> {
<a name="l00221"></a><a class="code" href="structmlist.html#ec3311b3eade29f807fef30c54d5a465">00221</a>         <span class="keyword">struct </span><a class="code" href="structmagic.html">magic</a> *<a class="code" href="structmagic.html">magic</a>;            <span class="comment">/* array of magic entries */</span>
<a name="l00222"></a><a class="code" href="structmlist.html#960803bec45c08f6c18d4db4ff6bbdef">00222</a>         uint32_t <a class="code" href="structmlist.html#960803bec45c08f6c18d4db4ff6bbdef">nmagic</a>;                        <span class="comment">/* number of entries in array */</span>
<a name="l00223"></a><a class="code" href="structmlist.html#5e0ffea3bea794258ff586fbb795b4cb">00223</a>         <span class="keywordtype">int</span> <a class="code" href="structmlist.html#5e0ffea3bea794258ff586fbb795b4cb">mapped</a>;  <span class="comment">/* allocation type: 0 =&gt; apprentice_file</span>
<a name="l00224"></a>00224 <span class="comment">                      *                  1 =&gt; apprentice_map + malloc</span>
<a name="l00225"></a>00225 <span class="comment">                      *                  2 =&gt; apprentice_map + mmap */</span>
<a name="l00226"></a>00226 <span class="comment">/*@dependent@*/</span>
<a name="l00227"></a><a class="code" href="structmlist.html#7bfc3bb7e579b328319b33db16c10c30">00227</a>         <span class="keyword">struct </span><a class="code" href="structmlist.html">mlist</a> *<a class="code" href="structmlist.html#ee40821902e1c8a56cc56b50707dfa17">next</a>, *<a class="code" href="structmlist.html#7bfc3bb7e579b328319b33db16c10c30">prev</a>;
<a name="l00228"></a>00228 };
<a name="l00229"></a>00229 
<a name="l00230"></a><a class="code" href="structmagic__set.html">00230</a> <span class="keyword">struct </span><a class="code" href="structmagic__set.html">magic_set</a> {
<a name="l00231"></a>00231 <span class="comment">/*@relnull@*/</span>
<a name="l00232"></a><a class="code" href="structmagic__set.html#00626064c66a325a7d5b9557b04c1759">00232</a>     <span class="keyword">struct </span><a class="code" href="structmlist.html">mlist</a> *<a class="code" href="structmlist.html">mlist</a>;
<a name="l00233"></a><a class="code" href="structmagic__set_1_1cont.html">00233</a>     <span class="keyword">struct </span><a class="code" href="structmagic__set_1_1cont.html">cont</a> {
<a name="l00234"></a><a class="code" href="structmagic__set_1_1cont.html#fff6764e727752e9ec202f57a05c1e66">00234</a>         size_t <a class="code" href="structmagic__set_1_1cont.html#fff6764e727752e9ec202f57a05c1e66">len</a>;
<a name="l00235"></a>00235 <span class="comment">/*@relnull@*/</span>
<a name="l00236"></a><a class="code" href="structmagic__set_1_1cont.html#458e7c290f37e5d4d45b9d2ef19396d2">00236</a>         int32_t *<a class="code" href="structmagic__set_1_1cont.html#458e7c290f37e5d4d45b9d2ef19396d2">off</a>;
<a name="l00237"></a>00237     } <a class="code" href="structmagic__set.html#e6fc6e1d52c6cbfff083a512dc7258eb">c</a>;
<a name="l00238"></a><a class="code" href="structmagic__set_1_1out.html">00238</a>     <span class="keyword">struct </span><a class="code" href="structmagic__set_1_1out.html">out</a> {
<a name="l00239"></a>00239         <span class="comment">/* Accumulation buffer */</span>
<a name="l00240"></a>00240 <span class="comment">/*@owned@*/</span> <span class="comment">/*@relnull@*/</span>
<a name="l00241"></a><a class="code" href="structmagic__set_1_1out.html#2cfb1c5821475d0b32c3333336352ec5">00241</a>         <span class="keywordtype">char</span> *<a class="code" href="structmagic__set_1_1out.html#2cfb1c5821475d0b32c3333336352ec5">buf</a>;
<a name="l00242"></a>00242 <span class="comment">/*@dependent@*/</span> <span class="comment">/*@relnull@*/</span>
<a name="l00243"></a><a class="code" href="structmagic__set_1_1out.html#57744a4ef4c9345959d75fb4e8845536">00243</a>         <span class="keywordtype">char</span> *<a class="code" href="structmagic__set_1_1out.html#57744a4ef4c9345959d75fb4e8845536">ptr</a>;
<a name="l00244"></a><a class="code" href="structmagic__set_1_1out.html#dd2df7c842d99a84a793b3d104b3dd9c">00244</a>         size_t <a class="code" href="structmagic__set_1_1out.html#dd2df7c842d99a84a793b3d104b3dd9c">left</a>;
<a name="l00245"></a><a class="code" href="structmagic__set_1_1out.html#a002bbdaf9c7bdbc544380215198e085">00245</a>         size_t <a class="code" href="structmagic__set_1_1out.html#a002bbdaf9c7bdbc544380215198e085">size</a>;
<a name="l00246"></a>00246         <span class="comment">/* Printable buffer */</span>
<a name="l00247"></a>00247 <span class="comment">/*@only@*/</span>
<a name="l00248"></a><a class="code" href="structmagic__set_1_1out.html#f77e76448967fd1d9df2edb6a2633983">00248</a>         <span class="keywordtype">char</span> *<a class="code" href="structmagic__set_1_1out.html#f77e76448967fd1d9df2edb6a2633983">pbuf</a>;
<a name="l00249"></a><a class="code" href="structmagic__set_1_1out.html#07ebf1539f97e2db458be020c100b988">00249</a>         size_t <a class="code" href="structmagic__set_1_1out.html#07ebf1539f97e2db458be020c100b988">psize</a>;
<a name="l00250"></a>00250     } <a class="code" href="structmagic__set.html#079083f822325111a1837243b3b3648a">o</a>;
<a name="l00251"></a><a class="code" href="structmagic__set.html#db8bba74645461010cad687a7c8bc875">00251</a>     <span class="keywordtype">int</span> <a class="code" href="structmagic__set.html#db8bba74645461010cad687a7c8bc875">error</a>;
<a name="l00252"></a><a class="code" href="structmagic__set.html#7677d8f81949874cf4a626d1d4566fc6">00252</a>     <span class="keywordtype">int</span> <a class="code" href="structmagic__set.html#7677d8f81949874cf4a626d1d4566fc6">flags</a>;
<a name="l00253"></a><a class="code" href="structmagic__set.html#910647ba502f633464e06a64338f84a9">00253</a>     <span class="keywordtype">int</span> <a class="code" href="structmagic__set.html#910647ba502f633464e06a64338f84a9">haderr</a>;
<a name="l00254"></a><a class="code" href="structmagic__set.html#19ffcacf3acff9f80bbaedcbe41a27e7">00254</a>     <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="structmagic__set.html#19ffcacf3acff9f80bbaedcbe41a27e7">file</a>;
<a name="l00255"></a><a class="code" href="structmagic__set.html#f04a41e2481f30bb08c07daacdd229dd">00255</a>     size_t <a class="code" href="structmagic__set.html#f04a41e2481f30bb08c07daacdd229dd">line</a>;
<a name="l00256"></a>00256 };
<a name="l00257"></a>00257 
<a name="l00258"></a>00258 <span class="keyword">struct </span>stat;
<a name="l00259"></a>00259 <span class="comment">/*@observer@*/</span>
<a name="l00260"></a>00260 <span class="keyword">protected</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="file_8h.html#777dda603f46f3f94f31805158ed1f4c">file_fmttime</a>(uint32_t, <span class="keywordtype">int</span>)
<a name="l00261"></a>00261         <span class="comment">/*@*/</span>;
<a name="l00262"></a>00262 <span class="keyword">protected</span> <span class="keywordtype">int</span> <a class="code" href="file_8h.html#7573b1217f2a62bcfca3e998e45dc9fc">file_buffer</a>(<span class="keyword">struct</span> <a class="code" href="structmagic__set.html">magic_set</a> *ms, <span class="keywordtype">int</span>, <span class="keyword">const</span> <span class="keywordtype">void</span> *, size_t)
<a name="l00263"></a>00263         <span class="comment">/*@globals fileSystem, internalState @*/</span>
<a name="l00264"></a>00264         <span class="comment">/*@modifies ms, fileSystem, internalState @*/</span>;
<a name="l00265"></a>00265 <span class="keyword">protected</span> <span class="keywordtype">int</span> <a class="code" href="file_8h.html#43c665eb08a79a70f792781fb6489eac">file_fsmagic</a>(<span class="keyword">struct</span> <a class="code" href="structmagic__set.html">magic_set</a> *ms, <span class="comment">/*@null@*/</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *fn, <span class="keyword">struct</span> stat *sb)
<a name="l00266"></a>00266         <span class="comment">/*@modifies ms, sb @*/</span>;
<a name="l00267"></a>00267 <span class="keyword">protected</span> <span class="keywordtype">int</span> <a class="code" href="compress_8c.html#af1b240b21ed4868e1704efc606f57dd">file_pipe2file</a>(<span class="keyword">struct</span> <a class="code" href="structmagic__set.html">magic_set</a> *ms, <span class="keywordtype">int</span> fd, <span class="keyword">const</span> <span class="keywordtype">void</span> *startbuf, size_t nbytes)
<a name="l00268"></a>00268         <span class="comment">/*@globals errno, fileSystem, internalState @*/</span>
<a name="l00269"></a>00269         <span class="comment">/*@modifies ms, errno, fileSystem, internalState @*/</span>;
<a name="l00270"></a>00270 <span class="keyword">protected</span> <span class="keywordtype">int</span> <a class="code" href="file_8h.html#949757705ada92387535cfad72f9243c">file_printf</a>(<span class="keyword">struct</span> <a class="code" href="structmagic__set.html">magic_set</a> *ms, <span class="keyword">const</span> <span class="keywordtype">char</span> *, ...)
<a name="l00271"></a>00271         <span class="comment">/*@modifies ms @*/</span>;
<a name="l00272"></a>00272 <span class="keyword">protected</span> <span class="keywordtype">int</span> <a class="code" href="file_8h.html#0cf1977ac68c230e96621cec56f45c4b">file_reset</a>(<span class="keyword">struct</span> <a class="code" href="structmagic__set.html">magic_set</a> *ms)
<a name="l00273"></a>00273         <span class="comment">/*@modifies ms @*/</span>;
<a name="l00274"></a>00274 <span class="keyword">protected</span> <span class="keywordtype">int</span> <a class="code" href="file_8h.html#01ae7d34c97725d1a1f9f2ef02dae640">file_tryelf</a>(<span class="keyword">struct</span> <a class="code" href="structmagic__set.html">magic_set</a> *ms, <span class="keywordtype">int</span>, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *, size_t)
<a name="l00275"></a>00275         <span class="comment">/*@globals fileSystem, internalState @*/</span>
<a name="l00276"></a>00276         <span class="comment">/*@modifies ms, fileSystem, internalState @*/</span>;
<a name="l00277"></a>00277 <span class="keyword">protected</span> <span class="keywordtype">int</span> <a class="code" href="compress_8c.html#a2fec18b68b359e94bb72491693472c0">file_zmagic</a>(<span class="keyword">struct</span> <a class="code" href="structmagic__set.html">magic_set</a> *ms, <span class="keywordtype">int</span>, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *, size_t)
<a name="l00278"></a>00278         <span class="comment">/*@globals fileSystem, internalState @*/</span>
<a name="l00279"></a>00279         <span class="comment">/*@modifies ms, fileSystem, internalState @*/</span>;
<a name="l00280"></a>00280 <span class="keyword">protected</span> <span class="keywordtype">int</span> <a class="code" href="ascmagic_8c.html#8d10796a389295a449a6f3d288fd79e6">file_ascmagic</a>(<span class="keyword">struct</span> <a class="code" href="structmagic__set.html">magic_set</a> *ms, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *, size_t)
<a name="l00281"></a>00281         <span class="comment">/*@modifies ms @*/</span>;
<a name="l00282"></a>00282 <span class="keyword">protected</span> <span class="keywordtype">int</span> <a class="code" href="file_8h.html#1c8475d583733c4552ab7a77afef01c9">file_is_tar</a>(<span class="keyword">struct</span> <a class="code" href="structmagic__set.html">magic_set</a> *ms, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *, size_t)
<a name="l00283"></a>00283         <span class="comment">/*@modifies ms @*/</span>;
<a name="l00284"></a>00284 <span class="keyword">protected</span> <span class="keywordtype">int</span> <a class="code" href="file_8h.html#566948a9f44124b7ea8cd4fe9db349aa">file_softmagic</a>(<span class="keyword">struct</span> <a class="code" href="structmagic__set.html">magic_set</a> *ms, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *, size_t)
<a name="l00285"></a>00285         <span class="comment">/*@globals fileSystem @*/</span>
<a name="l00286"></a>00286         <span class="comment">/*@modifies ms, fileSystem @*/</span>;
<a name="l00287"></a>00287 <span class="comment">/*@null@*/</span>
<a name="l00288"></a>00288 <span class="keyword">protected</span> <span class="keyword">struct </span><a class="code" href="structmlist.html">mlist</a> *<a class="code" href="apprentice_8c.html#8028adb76e8e80362c304c1ea8914a8f">file_apprentice</a>(<span class="keyword">struct</span> <a class="code" href="structmagic__set.html">magic_set</a> *ms, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keywordtype">int</span>)
<a name="l00289"></a>00289         <span class="comment">/*@globals fileSystem, internalState @*/</span>
<a name="l00290"></a>00290         <span class="comment">/*@modifies ms, fileSystem, internalState @*/</span>;
<a name="l00291"></a>00291 <span class="keyword">protected</span> uint32_t <a class="code" href="apprentice_8c.html#e28db57fd7c1d40cd154e048ca99a075">file_signextend</a>(<span class="keyword">struct</span> <a class="code" href="structmagic__set.html">magic_set</a> *ms, <span class="keyword">struct</span> <a class="code" href="structmagic.html">magic</a> *, uint32_t)
<a name="l00292"></a>00292         <span class="comment">/*@globals fileSystem @*/</span>
<a name="l00293"></a>00293         <span class="comment">/*@modifies ms, fileSystem @*/</span>;
<a name="l00294"></a>00294 <span class="keyword">protected</span> <span class="keywordtype">void</span> <a class="code" href="apprentice_8c.html#728d8460355bf68b718d2485829f0c4d">file_delmagic</a>(<span class="keyword">struct</span> <a class="code" href="structmagic.html">magic</a> *p, <span class="keywordtype">int</span> type, size_t entries)
<a name="l00295"></a>00295         <span class="comment">/*@globals fileSystem @*/</span>
<a name="l00296"></a>00296         <span class="comment">/*@modifies p, fileSystem @*/</span>;
<a name="l00297"></a>00297 <span class="keyword">protected</span> <span class="keywordtype">void</span> <a class="code" href="file_8h.html#e489029528e5a368fbf15657fd940230">file_badread</a>(<span class="keyword">struct</span> <a class="code" href="structmagic__set.html">magic_set</a> *ms)
<a name="l00298"></a>00298         <span class="comment">/*@modifies ms @*/</span>;
<a name="l00299"></a>00299 <span class="keyword">protected</span> <span class="keywordtype">void</span> <a class="code" href="file_8h.html#f843575bf69eb8779dca750d93ee623c">file_badseek</a>(<span class="keyword">struct</span> <a class="code" href="structmagic__set.html">magic_set</a> *ms)
<a name="l00300"></a>00300         <span class="comment">/*@modifies ms @*/</span>;
<a name="l00301"></a>00301 <span class="keyword">protected</span> <span class="keywordtype">void</span> <a class="code" href="file_8h.html#2a6681ad1c2bb84271d99480438f9bcf">file_oomem</a>(<span class="keyword">struct</span> <a class="code" href="structmagic__set.html">magic_set</a> *ms)
<a name="l00302"></a>00302         <span class="comment">/*@modifies ms @*/</span>;
<a name="l00303"></a>00303 <span class="keyword">protected</span> <span class="keywordtype">void</span> <a class="code" href="file_8h.html#b97a2a8e3a9e23613bcb1a49c4411919">file_error</a>(<span class="keyword">struct</span> <a class="code" href="structmagic__set.html">magic_set</a> *ms, <span class="keywordtype">int</span>, <span class="comment">/*@null@*/</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *, ...)
<a name="l00304"></a>00304         <span class="comment">/*@modifies ms @*/</span>;
<a name="l00305"></a>00305 <span class="keyword">protected</span> <span class="keywordtype">void</span> <a class="code" href="file_8h.html#7c997a92425ab69449e740c7c5752a93">file_magwarn</a>(<span class="keyword">struct</span> <a class="code" href="structmagic__set.html">magic_set</a> *ms, <span class="comment">/*@null@*/</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *, ...)
<a name="l00306"></a>00306         <span class="comment">/*@globals fileSystem @*/</span>
<a name="l00307"></a>00307         <span class="comment">/*@modifies fileSystem @*/</span>;
<a name="l00308"></a>00308 <span class="keyword">protected</span> <span class="keywordtype">void</span> <a class="code" href="file_8h.html#89dfc4d84ee5a405fe1700fb3abb1549">file_mdump</a>(<span class="keyword">struct</span> <a class="code" href="structmagic.html">magic</a> *m)
<a name="l00309"></a>00309         <span class="comment">/*@globals fileSystem @*/</span>
<a name="l00310"></a>00310         <span class="comment">/*@modifies m, fileSystem @*/</span>;
<a name="l00311"></a>00311 <span class="keyword">protected</span> <span class="keywordtype">void</span> <a class="code" href="apprentice_8c.html#0d5c3d2cbe9e1c4adf8ef2b26e8e2251">file_showstr</a>(FILE *fp, <span class="keyword">const</span> <span class="keywordtype">char</span> *, size_t)
<a name="l00312"></a>00312         <span class="comment">/*@globals fileSystem @*/</span>
<a name="l00313"></a>00313         <span class="comment">/*@modifies fp, fileSystem @*/</span>;
<a name="l00314"></a>00314 <span class="keyword">protected</span> size_t <a class="code" href="file_8c.html#beade5469bde46ff0e2199188916ccef">file_mbswidth</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *)
<a name="l00315"></a>00315         <span class="comment">/*@*/</span>;
<a name="l00316"></a>00316 <span class="comment">/*@observer@*/</span>
<a name="l00317"></a>00317 <span class="keyword">protected</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="file_8h.html#c75ab035f5b0ccce3e9a107c110c4926">file_getbuffer</a>(<span class="keyword">struct</span> <a class="code" href="structmagic__set.html">magic_set</a> *ms)
<a name="l00318"></a>00318         <span class="comment">/*@modifies ms @*/</span>;
<a name="l00319"></a>00319 
<a name="l00320"></a>00320 <span class="preprocessor">#ifndef HAVE_STRERROR</span>
<a name="l00321"></a>00321 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="file_8h.html#560e1e3acaca1d09a7eddcdb528ed92e">sys_nerr</a>;
<a name="l00322"></a>00322 <span class="keyword">extern</span> <span class="keywordtype">char</span> *<a class="code" href="file_8h.html#47e211ba7b51a50f6998d4f872f12d31">sys_errlist</a>[];
<a name="l00323"></a><a class="code" href="file_8h.html#b6b553574f85ce7727cf5b9a1b638293">00323</a> <span class="preprocessor">#define strerror(e) \</span>
<a name="l00324"></a>00324 <span class="preprocessor">        (((e) &gt;= 0 &amp;&amp; (e) &lt; sys_nerr) ? sys_errlist[(e)] : "Unknown error")</span>
<a name="l00325"></a>00325 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00326"></a>00326 <span class="preprocessor"></span>
<a name="l00327"></a>00327 <span class="preprocessor">#ifndef HAVE_STRTOUL</span>
<a name="l00328"></a><a class="code" href="file_8h.html#b39d013bf56ccc7f9b406a8e44baf054">00328</a> <span class="preprocessor"></span><span class="preprocessor">#define strtoul(a, b, c)        strtol(a, b, c)</span>
<a name="l00329"></a>00329 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00330"></a>00330 <span class="preprocessor"></span>
<a name="l00331"></a>00331 <span class="preprocessor">#if 0 </span><span class="comment">/* HACK -- we have snprintf and I don't want to plumb the autofoo */</span>
<a name="l00332"></a>00332 <span class="keywordtype">int</span> <a class="code" href="rpmps_8c.html#8eff177ddf89d8d85ac7c6b90a011480">snprintf</a>(<span class="keywordtype">char</span> *, size_t, <span class="keyword">const</span> <span class="keywordtype">char</span> *, ...);
<a name="l00333"></a>00333 <span class="preprocessor">#endif</span>
<a name="l00334"></a>00334 <span class="preprocessor"></span>
<a name="l00335"></a>00335 <span class="preprocessor">#if defined(HAVE_MMAP) &amp;&amp; defined(HAVE_SYS_MMAN_H) &amp;&amp; !defined(QUICK)</span>
<a name="l00336"></a>00336 <span class="preprocessor"></span><span class="preprocessor">#define QUICK</span>
<a name="l00337"></a>00337 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00338"></a>00338 <span class="preprocessor"></span>
<a name="l00339"></a>00339 <span class="preprocessor">#ifndef O_BINARY</span>
<a name="l00340"></a><a class="code" href="file_8h.html#36fa9b2e726512bc17a7a6d3e39002be">00340</a> <span class="preprocessor"></span><span class="preprocessor">#define O_BINARY        0</span>
<a name="l00341"></a>00341 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00342"></a>00342 <span class="preprocessor"></span>
<a name="l00343"></a><a class="code" href="file_8h.html#b757e9ff04be9e1b95de08c5536ac334">00343</a> <span class="preprocessor">#define FILE_RCSID(id) \</span>
<a name="l00344"></a>00344 <span class="preprocessor">static const char *rcsid(const char *p) { \</span>
<a name="l00345"></a>00345 <span class="preprocessor">        return rcsid(p = id); \</span>
<a name="l00346"></a>00346 <span class="preprocessor">}</span>
<a name="l00347"></a>00347 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00348"></a>00348 <span class="preprocessor"></span>
<a name="l00349"></a>00349 <span class="preprocessor">#endif </span><span class="comment">/* __file_h__ */</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on 1 Oct 2013 for rpm by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.7 </small></address>
</body>
</html>