📄 apr_errno.h
字号:
/* ==================================================================== * The Apache Software License, Version 1.1 * * Copyright (c) 2000-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Apache" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */#ifndef APR_ERRNO_H#define APR_ERRNO_H#include "apr.h"#if APR_HAVE_ERRNO_H#include <errno.h>#endif#ifdef __cplusplusextern "C" {#endif /* __cplusplus *//** * @file apr_errno.h * @brief Error Codes *//** * Type for specifying an error or status code. */typedef int apr_status_t;/** * Return a human readable string describing the specified error. * @param statcode The error code the get a string for. * @param buf A buffer to hold the error string. * @param bufsize Size of the buffer to hold the string. * @deffunc char *apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize) */APR_DECLARE(char *) apr_strerror(apr_status_t statcode, char *buf, apr_size_t bufsize);/** * Fold a platform specific error into an apr_status_t code. * @param syserr The platform os error code. * @deffunc apr_status_t APR_FROM_OS_ERROR(os_err_type syserr) * @tip Warning: macro implementation; the syserr argument may be evaluated * multiple times. *//** * Fold an apr_status_t code back to the native platform defined error. * @param syserr The apr_status_t folded platform os error code. * @deffunc os_err_type APR_TO_OS_ERROR(apr_status_t statcode) * @tip Warning: macro implementation; the statcode argument may be evaluated * multiple times. If the statcode was not created by apr_get_os_error * or APR_FROM_OS_ERROR, the results are undefined. *//** * Return the last platform error, folded into apr_status_t, on some platforms * @deffunc apr_status_t apr_get_os_error() * @tip This retrieves errno, or calls a GetLastError() style function, and * folds it with APR_FROM_OS_ERROR. Some platforms (such as OS2) have no * such mechanism, so this call may be unsupported. Some platforms * require the alternate apr_get_netos_error() to retrieve the last * socket error. *//** * Return the last socket error, folded into apr_status_t, on some platforms * @deffunc apr_status_t apr_get_netos_error() * @tip This retrieves errno, h_errno, or calls a GetLastSocketError() style * function, and folds it with APR_FROM_OS_ERROR. Some platforms (such * as OS2) have no such mechanism, so this call may be unsupported. *//** * Reset the last platform error, unfolded from an apr_status_t, on some platforms * @param statcode The OS error folded in a prior call to APR_FROM_OS_ERROR() * @deffunc void apr_set_os_error(apr_status_t statcode) * @tip Warning: macro implementation; the statcode argument may be evaluated * multiple times. If the statcode was not created by apr_get_os_error * or APR_FROM_OS_ERROR, the results are undefined. This macro sets * errno, or calls a SetLastError() style function, unfolding statcode * with APR_TO_OS_ERROR. Some platforms (such as OS2) have no such * mechanism, so this call may be unsupported. *//** * APR_OS_START_ERROR is where the APR specific error values start. *//** * APR_OS_START_STATUS is where the APR specific status codes start. *//** * APR_OS_START_USEERR are reserved for applications that use APR that * layer their own error codes along with APR's. *//** * APR_OS_START_CANONERR is where APR versions of errno values are defined * on systems which don't have the corresponding errno. *//** * APR_OS_START_SYSERR folds platform-specific system error values into * apr_status_t values. */#define APR_OS_START_ERROR 20000#define APR_OS_START_STATUS (APR_OS_START_ERROR + 500)#define APR_OS_START_USEERR (APR_OS_START_STATUS + 500)#define APR_OS_START_CANONERR (APR_OS_START_USEERR + 500)#define APR_OS_START_SYSERR (APR_OS_START_CANONERR + 500)#define APR_SUCCESS 0/** * <PRE> * <b>APR ERROR VALUES</b> * APR_ENOSTAT APR was unable to perform a stat on the file * APR_ENOPOOL APR was not provided a pool with which to allocate memory * APR_EBADDATE APR was given an invalid date * APR_EINVALSOCK APR was given an invalid socket * APR_ENOFILE APR was not given a file structure * APR_ENOPROC APR was not given a process structure * APR_ENOTIME APR was not given a time structure * APR_ENODIR APR was not given a directory structure * APR_ENOLOCK APR was not given a lock structure * APR_ENOPOLL APR was not given a poll structure * APR_ENOSOCKET APR was not given a socket * APR_ENOTHREAD APR was not given a thread structure * APR_ENOTHDKEY APR was not given a thread key structure * APR_ENOSHMAVAIL There is no more shared memory available * APR_EDSOOPEN APR was unable to open the dso object. For more * information call apr_dso_error(). * APR_EGENERAL General failure (specific information not available) * APR_EBADIP The specified IP address is invalid * APR_EBADMASK The specified netmask is invalid * </PRE> * * <PRE> * <b>APR STATUS VALUES</b> * APR_INCHILD Program is currently executing in the child * APR_INPARENT Program is currently executing in the parent * APR_DETACH The thread is detached * APR_NOTDETACH The thread is not detached * APR_CHILD_DONE The child has finished executing * APR_CHILD_NOTDONE The child has not finished executing * APR_TIMEUP The operation did not finish before the timeout * APR_INCOMPLETE The character conversion stopped because of an * incomplete character or shift sequence at the end * of the input buffer. * APR_BADCH Getopt found an option not in the option string * APR_BADARG Getopt found an option that is missing an argument * and and argument was specified in the option string * APR_EOF APR has encountered the end of the file * APR_NOTFOUND APR was unable to find the socket in the poll structure * APR_ANONYMOUS APR is using anonymous shared memory * APR_FILEBASED APR is using a file name as the key to the shared memory * APR_KEYBASED APR is using a shared key as the key to the shared memory * APR_EINIT Ininitalizer value. If no option has been found, but * the status variable requires a value, this should be used * APR_ENOTIMPL The APR function has not been implemented on this * platform, either because nobody has gotten to it yet, * or the function is impossible on this platform. * APR_EMISMATCH Two passwords do not match. * APR_EABSOLUTE The given path was absolute. * APR_ERELATIVE The given path was relative. * APR_EINCOMPLETE The given path was neither relative nor absolute. * APR_EABOVEROOT The given path was above the root path. * </PRE> * * @param status The APR_status code to check. * @param statcode The apr status code to test. * @deffunc int APR_STATUS_IS_status(apr_status_t statcode) * @tip Warning: macro implementations; the statcode argument may be * evaluated multiple times. To test for APR_ENOFILE, always test * APR_STATUS_IS_ENOFILE(statcode) because platform-specific codes are * not necessarily translated into the corresponding APR_Estatus code. *//* APR ERROR VALUES */#define APR_ENOSTAT (APR_OS_START_ERROR + 1)#define APR_ENOPOOL (APR_OS_START_ERROR + 2)#define APR_ENOFILE (APR_OS_START_ERROR + 3)#define APR_EBADDATE (APR_OS_START_ERROR + 4)#define APR_EINVALSOCK (APR_OS_START_ERROR + 5)#define APR_ENOPROC (APR_OS_START_ERROR + 6)#define APR_ENOTIME (APR_OS_START_ERROR + 7)#define APR_ENODIR (APR_OS_START_ERROR + 8)#define APR_ENOLOCK (APR_OS_START_ERROR + 9)#define APR_ENOPOLL (APR_OS_START_ERROR + 10)#define APR_ENOSOCKET (APR_OS_START_ERROR + 11)#define APR_ENOTHREAD (APR_OS_START_ERROR + 12)#define APR_ENOTHDKEY (APR_OS_START_ERROR + 13)#define APR_EGENERAL (APR_OS_START_ERROR + 14)#define APR_ENOSHMAVAIL (APR_OS_START_ERROR + 15)#define APR_EBADIP (APR_OS_START_ERROR + 16)#define APR_EBADMASK (APR_OS_START_ERROR + 17)/* empty slot: +18 */#define APR_EDSOOPEN (APR_OS_START_ERROR + 19)#define APR_EABSOLUTE (APR_OS_START_ERROR + 20)#define APR_ERELATIVE (APR_OS_START_ERROR + 21)#define APR_EINCOMPLETE (APR_OS_START_ERROR + 22)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -