📄 apr__errno_8h-source.html
字号:
<!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_errno.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 Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div>
<h1>apr_errno.h</h1><a href="apr__errno_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_ERRNO_H</span>
00018 <span class="preprocessor"></span><span class="preprocessor">#define APR_ERRNO_H</span>
00019 <span class="preprocessor"></span><span class="comment"></span>
00020 <span class="comment">/**</span>
00021 <span class="comment"> * @file apr_errno.h</span>
00022 <span class="comment"> * @brief APR Error Codes</span>
00023 <span class="comment"> */</span>
00024
00025 <span class="preprocessor">#include "apr.h"</span>
00026
00027 <span class="preprocessor">#if APR_HAVE_ERRNO_H</span>
00028 <span class="preprocessor"></span><span class="preprocessor">#include <errno.h></span>
00029 <span class="preprocessor">#endif</span>
00030 <span class="preprocessor"></span>
00031 <span class="preprocessor">#ifdef __cplusplus</span>
00032 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
00033 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span>
00034 <span class="comment"></span>
00035 <span class="comment">/**</span>
00036 <span class="comment"> * @defgroup apr_errno Error Codes</span>
00037 <span class="comment"> * @ingroup APR </span>
00038 <span class="comment"> * @{</span>
00039 <span class="comment"> */</span>
00040 <span class="comment"></span>
00041 <span class="comment">/**</span>
00042 <span class="comment"> * Type for specifying an error or status code.</span>
00043 <span class="comment"> */</span>
<a name="l00044"></a><a class="code" href="group__apr__errno.html#ga0">00044</a> <span class="keyword">typedef</span> <span class="keywordtype">int</span> <a class="code" href="group__apr__errno.html#ga0">apr_status_t</a>;
00045 <span class="comment"></span>
00046 <span class="comment">/**</span>
00047 <span class="comment"> * Return a human readable string describing the specified error.</span>
00048 <span class="comment"> * @param statcode The error code the get a string for.</span>
00049 <span class="comment"> * @param buf A buffer to hold the error string.</span>
00050 <span class="comment"> * @param bufsize Size of the buffer to hold the string.</span>
00051 <span class="comment"> */</span>
00052 APR_DECLARE(<span class="keywordtype">char</span> *) apr_strerror(apr_status_t statcode, <span class="keywordtype">char</span> *buf,
00053 apr_size_t bufsize);
00054
00055 #if defined(DOXYGEN)<span class="comment"></span>
00056 <span class="comment">/**</span>
00057 <span class="comment"> * @def APR_FROM_OS_ERROR(os_err_type syserr)</span>
00058 <span class="comment"> * Fold a platform specific error into an apr_status_t code.</span>
00059 <span class="comment"> * @return apr_status_t</span>
00060 <span class="comment"> * @param e The platform os error code.</span>
00061 <span class="comment"> * @warning macro implementation; the syserr argument may be evaluated</span>
00062 <span class="comment"> * multiple times.</span>
00063 <span class="comment"> */</span>
00064 #define APR_FROM_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e + APR_OS_START_SYSERR)
00065 <span class="comment"></span>
00066 <span class="comment">/**</span>
00067 <span class="comment"> * @def APR_TO_OS_ERROR(apr_status_t statcode)</span>
00068 <span class="comment"> * @return os_err_type</span>
00069 <span class="comment"> * Fold an apr_status_t code back to the native platform defined error.</span>
00070 <span class="comment"> * @param e The apr_status_t folded platform os error code.</span>
00071 <span class="comment"> * @warning macro implementation; the statcode argument may be evaluated</span>
00072 <span class="comment"> * multiple times. If the statcode was not created by apr_get_os_error </span>
00073 <span class="comment"> * or APR_FROM_OS_ERROR, the results are undefined.</span>
00074 <span class="comment"> */</span>
00075 #define APR_TO_OS_ERROR(e) (e == 0 ? APR_SUCCESS : e - APR_OS_START_SYSERR)
00076 <span class="comment"></span>
00077 <span class="comment">/** @def apr_get_os_error()</span>
00078 <span class="comment"> * @return apr_status_t the last platform error, folded into apr_status_t, on most platforms</span>
00079 <span class="comment"> * @remark This retrieves errno, or calls a GetLastError() style function, and</span>
00080 <span class="comment"> * folds it with APR_FROM_OS_ERROR. Some platforms (such as OS2) have no</span>
00081 <span class="comment"> * such mechanism, so this call may be unsupported. Do NOT use this</span>
00082 <span class="comment"> * call for socket errors from socket, send, recv etc!</span>
00083 <span class="comment"> */</span>
00084 <span class="comment"></span>
00085 <span class="comment">/** @def apr_set_os_error(e)</span>
00086 <span class="comment"> * Reset the last platform error, unfolded from an apr_status_t, on some platforms</span>
00087 <span class="comment"> * @param e The OS error folded in a prior call to APR_FROM_OS_ERROR()</span>
00088 <span class="comment"> * @warning This is a macro implementation; the statcode argument may be evaluated</span>
00089 <span class="comment"> * multiple times. If the statcode was not created by apr_get_os_error</span>
00090 <span class="comment"> * or APR_FROM_OS_ERROR, the results are undefined. This macro sets</span>
00091 <span class="comment"> * errno, or calls a SetLastError() style function, unfolding statcode</span>
00092 <span class="comment"> * with APR_TO_OS_ERROR. Some platforms (such as OS2) have no such</span>
00093 <span class="comment"> * mechanism, so this call may be unsupported.</span>
00094 <span class="comment"> */</span>
00095 <span class="comment"></span>
00096 <span class="comment">/** @def apr_get_netos_error()</span>
00097 <span class="comment"> * Return the last socket error, folded into apr_status_t, on all platforms</span>
00098 <span class="comment"> * @remark This retrieves errno or calls a GetLastSocketError() style function,</span>
00099 <span class="comment"> * and folds it with APR_FROM_OS_ERROR.</span>
00100 <span class="comment"> */</span>
00101 <span class="comment"></span>
00102 <span class="comment">/** @def apr_set_netos_error(e)</span>
00103 <span class="comment"> * Reset the last socket error, unfolded from an apr_status_t</span>
00104 <span class="comment"> * @param e The socket error folded in a prior call to APR_FROM_OS_ERROR()</span>
00105 <span class="comment"> * @warning This is a macro implementation; the statcode argument may be evaluated</span>
00106 <span class="comment"> * multiple times. If the statcode was not created by apr_get_os_error</span>
00107 <span class="comment"> * or APR_FROM_OS_ERROR, the results are undefined. This macro sets</span>
00108 <span class="comment"> * errno, or calls a WSASetLastError() style function, unfolding </span>
00109 <span class="comment"> * socketcode with APR_TO_OS_ERROR.</span>
00110 <span class="comment"> */</span>
00111
00112 #endif <span class="comment">/* defined(DOXYGEN) */</span>
00113 <span class="comment"></span>
00114 <span class="comment">/**</span>
00115 <span class="comment"> * APR_OS_START_ERROR is where the APR specific error values start.</span>
00116 <span class="comment"> */</span>
<a name="l00117"></a><a class="code" href="group__apr__errno.html#ga10">00117</a> #define APR_OS_START_ERROR 20000<span class="comment"></span>
00118 <span class="comment">/**</span>
00119 <span class="comment"> * APR_OS_ERRSPACE_SIZE is the maximum number of errors you can fit</span>
00120 <span class="comment"> * into one of the error/status ranges below -- except for</span>
00121 <span class="comment"> * APR_OS_START_USERERR, which see.</span>
00122 <span class="comment"> */</span>
<a name="l00123"></a><a class="code" href="group__apr__errno.html#ga11">00123</a> #define APR_OS_ERRSPACE_SIZE 50000<span class="comment"></span>
00124 <span class="comment">/**</span>
00125 <span class="comment"> * APR_OS_START_STATUS is where the APR specific status codes start.</span>
00126 <span class="comment"> */</span>
<a name="l00127"></a><a class="code" href="group__apr__errno.html#ga12">00127</a> #define APR_OS_START_STATUS (APR_OS_START_ERROR + APR_OS_ERRSPACE_SIZE)<span class="comment"></span>
00128 <span class="comment">/**</span>
00129 <span class="comment"> * APR_OS_START_USERERR are reserved for applications that use APR that</span>
00130 <span class="comment"> * layer their own error codes along with APR's. Note that the</span>
00131 <span class="comment"> * error immediately following this one is set ten times farther</span>
00132 <span class="comment"> * away than usual, so that users of apr have a lot of room in</span>
00133 <span class="comment"> * which to declare custom error codes.</span>
00134 <span class="comment"> */</span>
<a name="l00135"></a><a class="code" href="group__apr__errno.html#ga13">00135</a> #define APR_OS_START_USERERR (APR_OS_START_STATUS + APR_OS_ERRSPACE_SIZE)<span class="comment"></span>
00136 <span class="comment">/**</span>
00137 <span class="comment"> * APR_OS_START_USEERR is obsolete, defined for compatibility only.</span>
00138 <span class="comment"> * Use APR_OS_START_USERERR instead.</span>
00139 <span class="comment"> */</span>
<a name="l00140"></a><a class="code" href="group__apr__errno.html#ga14">00140</a> #define APR_OS_START_USEERR APR_OS_START_USERERR<span class="comment"></span>
00141 <span class="comment">/**</span>
00142 <span class="comment"> * APR_OS_START_CANONERR is where APR versions of errno values are defined</span>
00143 <span class="comment"> * on systems which don't have the corresponding errno.</span>
00144 <span class="comment"> */</span>
<a name="l00145"></a><a class="code" href="group__apr__errno.html#ga15">00145</a> #define APR_OS_START_CANONERR (APR_OS_START_USERERR \
00146 + (APR_OS_ERRSPACE_SIZE * 10))<span class="comment"></span>
00147 <span class="comment">/**</span>
00148 <span class="comment"> * APR_OS_START_EAIERR folds EAI_ error codes from getaddrinfo() into </span>
00149 <span class="comment"> * apr_status_t values.</span>
00150 <span class="comment"> */</span>
<a name="l00151"></a><a class="code" href="group__apr__errno.html#ga16">00151</a> #define APR_OS_START_EAIERR (APR_OS_START_CANONERR + APR_OS_ERRSPACE_SIZE)<span class="comment"></span>
00152 <span class="comment">/**</span>
00153 <span class="comment"> * APR_OS_START_SYSERR folds platform-specific system error values into </span>
00154 <span class="comment"> * apr_status_t values.</span>
00155 <span class="comment"> */</span>
<a name="l00156"></a><a class="code" href="group__apr__errno.html#ga17">00156</a> #define APR_OS_START_SYSERR (APR_OS_START_EAIERR + APR_OS_ERRSPACE_SIZE)
00157 <span class="comment"></span>
00158 <span class="comment">/** no error. */</span>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -