apr__general_8h-source.html

来自「apr函数库使用手册」· HTML 代码 · 共 251 行 · 第 1/2 页

HTML
251
字号
<!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>Apache Portable Runtime: apr_general.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.7 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<h1>apr_general.h</h1><a href="apr__general_8h.html">Go to the documentation of this file.</a><pre class="fragment"><div>00001 <span class="comment">/* Copyright 2000-2005 The Apache Software Foundation or its licensors, as</span>
00002 <span class="comment"> * applicable.</span>
00003 <span class="comment"> *</span>
00004 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</span>
00005 <span class="comment"> * you may not use this file except in compliance with the License.</span>
00006 <span class="comment"> * You may obtain a copy of the License at</span>
00007 <span class="comment"> *</span>
00008 <span class="comment"> *     http://www.apache.org/licenses/LICENSE-2.0</span>
00009 <span class="comment"> *</span>
00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
00011 <span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</span>
00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
00013 <span class="comment"> * See the License for the specific language governing permissions and</span>
00014 <span class="comment"> * limitations under the License.</span>
00015 <span class="comment"> */</span>
00016 
00017 <span class="preprocessor">#ifndef APR_GENERAL_H</span>
00018 <span class="preprocessor"></span><span class="preprocessor">#define APR_GENERAL_H</span>
00019 <span class="preprocessor"></span><span class="comment"></span>
00020 <span class="comment">/**</span>
00021 <span class="comment"> * @file apr_general.h</span>
00022 <span class="comment"> * This is collection of oddballs that didn't fit anywhere else,</span>
00023 <span class="comment"> * and might move to more appropriate headers with the release</span>
00024 <span class="comment"> * of APR 1.0.</span>
00025 <span class="comment"> * @brief APR Miscellaneous library routines</span>
00026 <span class="comment"> */</span>
00027 
00028 <span class="preprocessor">#include "apr.h"</span>
00029 <span class="preprocessor">#include "<a class="code" href="apr__pools_8h.html">apr_pools.h</a>"</span>
00030 <span class="preprocessor">#include "<a class="code" href="apr__errno_8h.html">apr_errno.h</a>"</span>
00031 
00032 <span class="preprocessor">#if APR_HAVE_SIGNAL_H</span>
00033 <span class="preprocessor"></span><span class="preprocessor">#include &lt;signal.h&gt;</span>
00034 <span class="preprocessor">#endif</span>
00035 <span class="preprocessor"></span>
00036 <span class="preprocessor">#ifdef __cplusplus</span>
00037 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
00038 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span>
00039 <span class="comment"></span>
00040 <span class="comment">/**</span>
00041 <span class="comment"> * @defgroup apr_general Miscellaneous library routines</span>
00042 <span class="comment"> * @ingroup APR </span>
00043 <span class="comment"> * This is collection of oddballs that didn't fit anywhere else,</span>
00044 <span class="comment"> * and might move to more appropriate headers with the release</span>
00045 <span class="comment"> * of APR 1.0.</span>
00046 <span class="comment"> * @{</span>
00047 <span class="comment"> */</span>
00048 <span class="comment"></span>
00049 <span class="comment">/** FALSE */</span>
00050 <span class="preprocessor">#ifndef FALSE</span>
<a name="l00051"></a><a class="code" href="group__apr__general.html#ga2">00051</a> <span class="preprocessor"></span><span class="preprocessor">#define FALSE 0</span>
00052 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
00053 <span class="preprocessor"></span><span class="comment">/** TRUE */</span>
00054 <span class="preprocessor">#ifndef TRUE</span>
<a name="l00055"></a><a class="code" href="group__apr__general.html#ga3">00055</a> <span class="preprocessor"></span><span class="preprocessor">#define TRUE (!FALSE)</span>
00056 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
00057 <span class="preprocessor"></span><span class="comment"></span>
00058 <span class="comment">/** a space */</span>
<a name="l00059"></a><a class="code" href="group__apr__general.html#ga4">00059</a> <span class="preprocessor">#define APR_ASCII_BLANK  '\040'</span>
00060 <span class="preprocessor"></span><span class="comment">/** a carrige return */</span>
<a name="l00061"></a><a class="code" href="group__apr__general.html#ga5">00061</a> <span class="preprocessor">#define APR_ASCII_CR     '\015'</span>
00062 <span class="preprocessor"></span><span class="comment">/** a line feed */</span>
<a name="l00063"></a><a class="code" href="group__apr__general.html#ga6">00063</a> <span class="preprocessor">#define APR_ASCII_LF     '\012'</span>
00064 <span class="preprocessor"></span><span class="comment">/** a tab */</span>
<a name="l00065"></a><a class="code" href="group__apr__general.html#ga7">00065</a> <span class="preprocessor">#define APR_ASCII_TAB    '\011'</span>
00066 <span class="preprocessor"></span><span class="comment"></span>
00067 <span class="comment">/** signal numbers typedef */</span>
<a name="l00068"></a><a class="code" href="group__apr__general.html#ga0">00068</a> <span class="keyword">typedef</span> <span class="keywordtype">int</span>               <a class="code" href="group__apr__general.html#ga0">apr_signum_t</a>;
00069 <span class="comment"></span>
00070 <span class="comment">/**</span>
00071 <span class="comment"> * Finding offsets of elements within structures.</span>
00072 <span class="comment"> * Taken from the X code... they've sweated portability of this stuff</span>
00073 <span class="comment"> * so we don't have to.  Sigh...</span>
00074 <span class="comment"> * @param p_type pointer type name</span>
00075 <span class="comment"> * @param field  data field within the structure pointed to</span>
00076 <span class="comment"> * @return offset</span>
00077 <span class="comment"> */</span>
00078 
00079 <span class="preprocessor">#if defined(CRAY) || (defined(__arm) &amp;&amp; !defined(LINUX))</span>
00080 <span class="preprocessor"></span><span class="preprocessor">#ifdef __STDC__</span>
00081 <span class="preprocessor"></span><span class="preprocessor">#define APR_OFFSET(p_type,field) _Offsetof(p_type,field)</span>
00082 <span class="preprocessor"></span><span class="preprocessor">#else</span>
00083 <span class="preprocessor"></span><span class="preprocessor">#ifdef CRAY2</span>
00084 <span class="preprocessor"></span><span class="preprocessor">#define APR_OFFSET(p_type,field) \</span>
00085 <span class="preprocessor">        (sizeof(int)*((unsigned int)&amp;(((p_type)NULL)-&gt;field)))</span>
00086 <span class="preprocessor"></span>
00087 <span class="preprocessor">#else </span><span class="comment">/* !CRAY2 */</span>
00088 
00089 <span class="preprocessor">#define APR_OFFSET(p_type,field) ((unsigned int)&amp;(((p_type)NULL)-&gt;field))</span>
00090 <span class="preprocessor"></span>
00091 <span class="preprocessor">#endif </span><span class="comment">/* !CRAY2 */</span>
00092 <span class="preprocessor">#endif </span><span class="comment">/* __STDC__ */</span>
00093 <span class="preprocessor">#else </span><span class="comment">/* ! (CRAY || __arm) */</span>
00094 
<a name="l00095"></a><a class="code" href="group__apr__general.html#ga8">00095</a> <span class="preprocessor">#define APR_OFFSET(p_type,field) \</span>
00096 <span class="preprocessor">        ((long) (((char *) (&amp;(((p_type)NULL)-&gt;field))) - ((char *) NULL)))</span>
00097 <span class="preprocessor"></span>
00098 <span class="preprocessor">#endif </span><span class="comment">/* !CRAY */</span>
00099 <span class="comment"></span>
00100 <span class="comment">/**</span>
00101 <span class="comment"> * Finding offsets of elements within structures.</span>
00102 <span class="comment"> * @param s_type structure type name</span>
00103 <span class="comment"> * @param field  data field within the structure</span>
00104 <span class="comment"> * @return offset</span>
00105 <span class="comment"> */</span>
00106 <span class="preprocessor">#if defined(offsetof) &amp;&amp; !defined(__cplusplus)</span>
00107 <span class="preprocessor"></span><span class="preprocessor">#define APR_OFFSETOF(s_type,field) offsetof(s_type,field)</span>
00108 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00109"></a><a class="code" href="group__apr__general.html#ga9">00109</a> <span class="preprocessor"></span><span class="preprocessor">#define APR_OFFSETOF(s_type,field) APR_OFFSET(s_type*,field)</span>
00110 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
00111 <span class="preprocessor"></span>
00112 <span class="preprocessor">#ifndef DOXYGEN</span>
00113 <span class="preprocessor"></span>
00114 <span class="comment">/* A couple of prototypes for functions in case some platform doesn't </span>
00115 <span class="comment"> * have it</span>
00116 <span class="comment"> */</span>
00117 <span class="preprocessor">#if (!APR_HAVE_STRCASECMP) &amp;&amp; (APR_HAVE_STRICMP) </span>
00118 <span class="preprocessor"></span><span class="preprocessor">#define strcasecmp(s1, s2) stricmp(s1, s2)</span>
00119 <span class="preprocessor"></span><span class="preprocessor">#elif (!APR_HAVE_STRCASECMP)</span>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?