httpd.h revision c861a36fe9c9a78c4fcb97e29fc1099a5ea81173
2d2eda71267231c2526be701fe655db125852c1ffielding/* ====================================================================
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * The Apache Software License, Version 1.1
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * Copyright (c) 2000 The Apache Software Foundation. All rights
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * reserved.
2d2eda71267231c2526be701fe655db125852c1ffielding * Redistribution and use in source and binary forms, with or without
2d2eda71267231c2526be701fe655db125852c1ffielding * modification, are permitted provided that the following conditions
2d2eda71267231c2526be701fe655db125852c1ffielding * 1. Redistributions of source code must retain the above copyright
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * notice, this list of conditions and the following disclaimer.
2d2eda71267231c2526be701fe655db125852c1ffielding * 2. Redistributions in binary form must reproduce the above copyright
2d2eda71267231c2526be701fe655db125852c1ffielding * notice, this list of conditions and the following disclaimer in
2d2eda71267231c2526be701fe655db125852c1ffielding * the documentation and/or other materials provided with the
2d2eda71267231c2526be701fe655db125852c1ffielding * distribution.
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * 3. The end-user documentation included with the redistribution,
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * if any, must include the following acknowledgment:
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * "This product includes software developed by the
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * Apache Software Foundation (http://www.apache.org/)."
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * Alternately, this acknowledgment may appear in the software itself,
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * if and wherever such third-party acknowledgments normally appear.
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * 4. The names "Apache" and "Apache Software Foundation" must
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * not be used to endorse or promote products derived from this
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * software without prior written permission. For written
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * permission, please contact apache@apache.org.
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * 5. Products derived from this software may not be called "Apache",
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * nor may "Apache" appear in their name, without prior written
64185f9824e42f21ca7b9ae6c004484215c031a7rbb * permission of the Apache Software Foundation.
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
2d2eda71267231c2526be701fe655db125852c1ffielding * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * SUCH DAMAGE.
2d2eda71267231c2526be701fe655db125852c1ffielding * ====================================================================
2d2eda71267231c2526be701fe655db125852c1ffielding * This software consists of voluntary contributions made by many
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * individuals on behalf of the Apache Software Foundation. For more
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * information on the Apache Software Foundation, please see
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * Portions of this software are based upon public domain software
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * originally written at the National Center for Supercomputing Applications,
f062ed7bd262a37a909dd77ce5fc23b446818823fielding * University of Illinois, Urbana-Champaign.
2d2eda71267231c2526be701fe655db125852c1ffieldingextern "C" {
2d2eda71267231c2526be701fe655db125852c1ffielding * httpd.h: header for simple (ha! not anymore) http daemon
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* XXX - We need to push more stuff to other .h files, or even .c files, to
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * make this file smaller
952908500d5f99f35afc5ed510391b9bdc3833farbb * @package HTTP Daemon routines
2d2eda71267231c2526be701fe655db125852c1ffielding/* Headers in which EVERYONE has an interest... */
2d2eda71267231c2526be701fe655db125852c1ffielding/* ----------------------------- config dir ------------------------------ */
2d2eda71267231c2526be701fe655db125852c1ffielding/* Define this to be the default server home dir. Most things later in this
2d2eda71267231c2526be701fe655db125852c1ffielding * file with a relative pathname will have this added.
2d2eda71267231c2526be701fe655db125852c1ffielding/* Set default for OS/2 file system */
2d2eda71267231c2526be701fe655db125852c1ffielding/* Set default for Windows file system */
2e123e8beedc9f921448c113e2d6823a92fd5261fielding/* Set the default for BeOS */
2d2eda71267231c2526be701fe655db125852c1ffielding#endif /* HTTPD_ROOT */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * --------- You shouldn't have to edit anything below this line ----------
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * Any modifications to any defaults not defined above should be done in the
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * respective config. file.
2d2eda71267231c2526be701fe655db125852c1ffielding/* Default location of documents. Can be overridden by the DocumentRoot
2d2eda71267231c2526be701fe655db125852c1ffielding * directive.
2d2eda71267231c2526be701fe655db125852c1ffielding/* Set default for OS/2 file system */
2d2eda71267231c2526be701fe655db125852c1ffielding#endif /* DOCUMENT_LOCATION */
2d2eda71267231c2526be701fe655db125852c1ffielding/* Max. number of dynamically loaded modules */
2d2eda71267231c2526be701fe655db125852c1ffielding/* Default administrator's address */
2d2eda71267231c2526be701fe655db125852c1ffielding/* The target name of the installed Apache */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* --------- Default user name and group name ----------------------------- */
2d2eda71267231c2526be701fe655db125852c1ffielding/* --- These may be specified as numbers by placing a # before a number --- */
2d2eda71267231c2526be701fe655db125852c1ffielding/* The name of the log files */
2d2eda71267231c2526be701fe655db125852c1ffielding#endif /* DEFAULT_XFERLOG */
2d2eda71267231c2526be701fe655db125852c1ffielding#endif /* DEFAULT_ERRORLOG */
2d2eda71267231c2526be701fe655db125852c1ffielding/* Define this to be what your per-directory security files are called */
2d2eda71267231c2526be701fe655db125852c1ffielding/* Set default for OS/2 file system */
2d2eda71267231c2526be701fe655db125852c1ffielding#endif /* DEFAULT_ACCESS_FNAME */
2d2eda71267231c2526be701fe655db125852c1ffielding/* The name of the server config file */
2d2eda71267231c2526be701fe655db125852c1ffielding/* Whether we should enable rfc1413 identity checking */
2d2eda71267231c2526be701fe655db125852c1ffielding/* The default path for CGI scripts if none is currently set */
2d2eda71267231c2526be701fe655db125852c1ffielding#define DEFAULT_PATH "/bin:/usr/bin:/usr/ucb:/usr/bsd:/usr/local/bin"
2d2eda71267231c2526be701fe655db125852c1ffielding/* The path to the suExec wrapper, can be overridden in Configuration */
2d2eda71267231c2526be701fe655db125852c1ffielding/* The timeout for waiting for messages */
2d2eda71267231c2526be701fe655db125852c1ffielding/* The timeout for waiting for keepalive timeout until next request */
2d2eda71267231c2526be701fe655db125852c1ffielding/* The number of requests to entertain per connection */
2d2eda71267231c2526be701fe655db125852c1ffielding/* The maximum length of the queue of pending connections, as defined
2d2eda71267231c2526be701fe655db125852c1ffielding * by listen(2). Under some systems, it should be increased if you
2d2eda71267231c2526be701fe655db125852c1ffielding * are experiencing a heavy TCP SYN flood attack.
2d2eda71267231c2526be701fe655db125852c1ffielding * It defaults to 511 instead of 512 because some systems store it
2d2eda71267231c2526be701fe655db125852c1ffielding * as an 8-bit datatype; 512 truncated to 8-bits is 0, while 511 is
2d2eda71267231c2526be701fe655db125852c1ffielding * 255 when truncated.
2d2eda71267231c2526be701fe655db125852c1ffielding/* Limits on the size of various request items. These limits primarily
2d2eda71267231c2526be701fe655db125852c1ffielding * exist to prevent simple denial-of-service attacks on a server based
2d2eda71267231c2526be701fe655db125852c1ffielding * on misuse of the protocol. The recommended values will depend on the
2d2eda71267231c2526be701fe655db125852c1ffielding * nature of the server resources -- CGI scripts and database backends
2d2eda71267231c2526be701fe655db125852c1ffielding * might require large values, but most servers could get by with much
2d2eda71267231c2526be701fe655db125852c1ffielding * smaller limits than we use below. The request message body size can
2d2eda71267231c2526be701fe655db125852c1ffielding * be limited by the per-dir config directive LimitRequestBody.
2d2eda71267231c2526be701fe655db125852c1ffielding * Internal buffer sizes are two bytes more than the DEFAULT_LIMIT_REQUEST_LINE
2d2eda71267231c2526be701fe655db125852c1ffielding * and DEFAULT_LIMIT_REQUEST_FIELDSIZE below, which explains the 8190.
2d2eda71267231c2526be701fe655db125852c1ffielding * These two limits can be lowered (but not raised) by the server config
2d2eda71267231c2526be701fe655db125852c1ffielding * directives LimitRequestLine and LimitRequestFieldsize, respectively.
2d2eda71267231c2526be701fe655db125852c1ffielding * DEFAULT_LIMIT_REQUEST_FIELDS can be modified or disabled (set = 0) by
2d2eda71267231c2526be701fe655db125852c1ffielding * the server config directive LimitRequestFields.
2d2eda71267231c2526be701fe655db125852c1ffielding#endif /* default limit on bytes in Request-Line (Method+URI+HTTP-version) */
2d2eda71267231c2526be701fe655db125852c1ffielding#endif /* default limit on bytes in any one header field */
2d2eda71267231c2526be701fe655db125852c1ffielding#endif /* default limit on number of request header fields */
2efb935ae8fe12d5192a3bf2c52c28461b6c68afdgaudet * The default default character set name to add if AddDefaultCharset is
2efb935ae8fe12d5192a3bf2c52c28461b6c68afdgaudet * enabled. Overridden with AddDefaultCharsetName.
2efb935ae8fe12d5192a3bf2c52c28461b6c68afdgaudet#define DEFAULT_ADD_DEFAULT_CHARSET_NAME "iso-8859-1"
2d2eda71267231c2526be701fe655db125852c1ffielding * The below defines the base string of the Server: header. Additional
2d2eda71267231c2526be701fe655db125852c1ffielding * tokens can be added via the ap_add_version_component() API call.
2d2eda71267231c2526be701fe655db125852c1ffielding * The tokens are listed in order of their significance for identifying the
2d2eda71267231c2526be701fe655db125852c1ffielding * application.
2d2eda71267231c2526be701fe655db125852c1ffielding * "Product tokens should be short and to the point -- use of them for
2d2eda71267231c2526be701fe655db125852c1ffielding * advertizing or other non-essential information is explicitly forbidden."
2d2eda71267231c2526be701fe655db125852c1ffielding * Example: "Apache/1.1.0 MrWidget/0.1-alpha"
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* Define this to 1 if you want fancy indexing, 0 otherwise */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#endif /* CORE_PRIVATE */
32644678e889a3253f71bde0b3d6daea6d9dc21awrowe#define AP_SERVER_BASEVENDOR "Apache Software Foundation"
32644678e889a3253f71bde0b3d6daea6d9dc21awrowe#define AP_SERVER_BASEVERSION AP_SERVER_BASEPRODUCT "/" AP_SERVER_BASEREVISION
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* ------------------ stuff that modules are allowed to look at ----------- */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* Define this to be what your HTML directory content files are called */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* Define this to be what type you'd like returned for files with unknown */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* suffixes. MUST be all lower case. */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* The name of the MIME types file */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * Define the HTML doctype strings centrally.
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#define DOCTYPE_HTML_2_0 "<!DOCTYPE HTML PUBLIC \"-//IETF//" \
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb "DTD HTML 2.0//EN\">\n"
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#define DOCTYPE_HTML_3_2 "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb "DTD HTML 3.2 Final//EN\">\n"
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#define DOCTYPE_HTML_4_0S "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb "DTD HTML 4.0//EN\"\n" \
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#define DOCTYPE_HTML_4_0T "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb "DTD HTML 4.0 Transitional//EN\"\n" \
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#define DOCTYPE_HTML_4_0F "<!DOCTYPE HTML PUBLIC \"-//W3C//" \
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb "DTD HTML 4.0 Frameset//EN\"\n" \
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* -- Internal representation for a HTTP protocol number, e.g., HTTP/1.1 -- */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* -------------- Port number for server running standalone --------------- */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#define ap_is_default_port(port,r) ((port) == ap_default_port(r))
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* The default string lengths */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* The size of the server's internal read-write buffers */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * Special Apache error codes. These are basically used
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * in http_main.c so we can keep track of various errors.
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * APEXIT_OK:
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * A normal exit
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * APEXIT_INIT:
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * A fatal error arising during the server's init sequence
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * APEXIT_CHILDINIT:
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * The child died during it's init sequence
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * APEXIT_CHILDFATAL:
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * A fatal error, resulting in the whole server aborting.
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * If a child exits with this error, the parent process
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * considers this a server-wide fatal error and aborts.
2d2eda71267231c2526be701fe655db125852c1ffieldingAPI_EXPORT(const char *) ap_get_server_version(void);
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(void) ap_add_version_component(apr_pool_t *pconf, const char *component);
2d2eda71267231c2526be701fe655db125852c1ffielding/* Numeric release version identifier: MMNNFFRBB: major minor fix final beta
2d2eda71267231c2526be701fe655db125852c1ffielding * Always increases along the same track as the source branch.
2d2eda71267231c2526be701fe655db125852c1ffielding * For example, Apache 1.4.2 would be '10402100', 2.5b7 would be '20500007'.
2d2eda71267231c2526be701fe655db125852c1ffielding#define DONE -2 /* Module has served the response completely
2d2eda71267231c2526be701fe655db125852c1ffielding * - it's safe to die() with no more output
2d2eda71267231c2526be701fe655db125852c1ffielding/* ----------------------- HTTP Status Codes ------------------------- */
2d2eda71267231c2526be701fe655db125852c1ffielding/* The size of the static array in http_protocol.c for storing
2d2eda71267231c2526be701fe655db125852c1ffielding * all of the potential response status-lines (a sparse table).
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm * A future version should dynamically generate the apr_table_t at startup.
2d2eda71267231c2526be701fe655db125852c1ffielding#define ap_is_HTTP_INFO(x) (((x) >= 100)&&((x) < 200))
2d2eda71267231c2526be701fe655db125852c1ffielding#define ap_is_HTTP_SUCCESS(x) (((x) >= 200)&&((x) < 300))
2d2eda71267231c2526be701fe655db125852c1ffielding#define ap_is_HTTP_REDIRECT(x) (((x) >= 300)&&((x) < 400))
2d2eda71267231c2526be701fe655db125852c1ffielding#define ap_is_HTTP_ERROR(x) (((x) >= 400)&&((x) < 600))
2d2eda71267231c2526be701fe655db125852c1ffielding#define ap_is_HTTP_CLIENT_ERROR(x) (((x) >= 400)&&((x) < 500))
2d2eda71267231c2526be701fe655db125852c1ffielding#define ap_is_HTTP_SERVER_ERROR(x) (((x) >= 500)&&((x) < 600))
2d2eda71267231c2526be701fe655db125852c1ffielding (((x) == HTTP_BAD_REQUEST) || \
2d2eda71267231c2526be701fe655db125852c1ffielding/* Methods recognized (but not necessarily handled) by the server.
2d2eda71267231c2526be701fe655db125852c1ffielding * These constants are used in bit shifting masks of size int, so it is
2d2eda71267231c2526be701fe655db125852c1ffielding * unsafe to have more methods than bits in an int. HEAD == M_GET.
763f7b125b6d3dd1e4992a3822005efa2616f983coar * This list must be tracked by the list in http_protocol.c in routine
763f7b125b6d3dd1e4992a3822005efa2616f983coar * ap_method_name_of().
2d2eda71267231c2526be701fe655db125852c1ffielding#define INCLUDES_MAGIC_TYPE "text/x-server-parsed-html"
2d2eda71267231c2526be701fe655db125852c1ffielding#define INCLUDES_MAGIC_TYPE3 "text/x-server-parsed-html3"
54e94821097724bf413d2d4cc70711760f7494e1trawick#define ASCIITEXT_MAGIC_TYPE_PREFIX "text/x-ascii-" /* Text files whose content-type starts with this are passed thru unconverted */
54e94821097724bf413d2d4cc70711760f7494e1trawick#endif /*CHARSET_EBCDIC*/
54e94821097724bf413d2d4cc70711760f7494e1trawick/* Just in case your linefeed isn't the one the other end is expecting. */
54e94821097724bf413d2d4cc70711760f7494e1trawick#else /* CHARSET_EBCDIC */
54e94821097724bf413d2d4cc70711760f7494e1trawick/* For platforms using the EBCDIC charset, the transition ASCII->EBCDIC is done
54e94821097724bf413d2d4cc70711760f7494e1trawick * in the buff package (bread/bputs/bwrite). Everywhere else, we use
54e94821097724bf413d2d4cc70711760f7494e1trawick * "native EBCDIC" CR and NL characters. These are therefore
54e94821097724bf413d2d4cc70711760f7494e1trawick * defined as
54e94821097724bf413d2d4cc70711760f7494e1trawick * '\r' and '\n'.
54e94821097724bf413d2d4cc70711760f7494e1trawick#endif /* CHARSET_EBCDIC */
2d2eda71267231c2526be701fe655db125852c1ffielding/* Possible values for request_rec.read_body (set by handling module):
2d2eda71267231c2526be701fe655db125852c1ffielding * REQUEST_NO_BODY Send 413 error if message has any body
2d2eda71267231c2526be701fe655db125852c1ffielding * REQUEST_CHUNKED_ERROR Send 411 error if body without Content-Length
2d2eda71267231c2526be701fe655db125852c1ffielding * REQUEST_CHUNKED_DECHUNK If chunked, remove the chunks for me.
2d2eda71267231c2526be701fe655db125852c1ffielding * REQUEST_CHUNKED_PASS Pass the chunks to me without removal.
2d2eda71267231c2526be701fe655db125852c1ffielding/* Things which may vary per file-lookup WITHIN a request ---
2d2eda71267231c2526be701fe655db125852c1ffielding * e.g., state of MIME config. Basically, the name of an object, info
2d2eda71267231c2526be701fe655db125852c1ffielding * about the object, and any other info we may ahve which may need to
2d2eda71267231c2526be701fe655db125852c1ffielding * change as we go poking around looking for it (e.g., overridden by
2d2eda71267231c2526be701fe655db125852c1ffielding * .htaccess files).
2d2eda71267231c2526be701fe655db125852c1ffielding * Note how the default state of almost all these things is properly
2d2eda71267231c2526be701fe655db125852c1ffielding * zero, so that allocating it with pcalloc does the right thing without
2d2eda71267231c2526be701fe655db125852c1ffielding * a whole lot of hairy initialization... so long as we are willing to
2d2eda71267231c2526be701fe655db125852c1ffielding * make the (fairly) portable assumption that the bit pattern of a NULL
2d2eda71267231c2526be701fe655db125852c1ffielding * pointer is, in fact, zero.
952908500d5f99f35afc5ed510391b9bdc3833farbb * This represents the result of calling htaccess; these are cached for
2d2eda71267231c2526be701fe655db125852c1ffielding * each request.
952908500d5f99f35afc5ed510391b9bdc3833farbb /** the directory to which this applies */
952908500d5f99f35afc5ed510391b9bdc3833farbb const char *dir;
952908500d5f99f35afc5ed510391b9bdc3833farbb /** the overrides allowed for the .htaccess file */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** the configuration directives */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** the next one, or NULL if no more; N.B. never change this */
3887202241db08986e94b252fbd06a55e55d4b2dbhyde/* The following four types define a hierarchy of activities, so that
3887202241db08986e94b252fbd06a55e55d4b2dbhyde * given a request_rec r you can write r->connection->server->process
3887202241db08986e94b252fbd06a55e55d4b2dbhyde * to get to the process_rec. While this reduces substantially the
3887202241db08986e94b252fbd06a55e55d4b2dbhyde * number of arguments that various hooks require beware that in
3887202241db08986e94b252fbd06a55e55d4b2dbhyde * threaded versions of the server you must consider multiplexing
3887202241db08986e94b252fbd06a55e55d4b2dbhyde * issues. */
952908500d5f99f35afc5ed510391b9bdc3833farbb/** structure to aid charset translate between machine and network */
3a50e4da8a0db4515ab45678e5b39ff7e7594320trawick /* contents are experimental! expect it to change! */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** translation handle to use when going to the network */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** whether or not write translation is single-byte-only */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** translation handle to use when coming from the network */
3a50e4da8a0db4515ab45678e5b39ff7e7594320trawick#endif /*APACHE_XLATE*/
952908500d5f99f35afc5ed510391b9bdc3833farbb/** A structure that represents one process */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Global pool. Please try to cleared on _all_ exits */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** aka configuration pool, cleared on restarts */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** How many command line arguments were pass to the program */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The command line arguments */
b28574227fcf956444ac03bde294122a05ad2bderbb char *const *argv;
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The program name used to execute the program */
3887202241db08986e94b252fbd06a55e55d4b2dbhyde const char *short_name;
952908500d5f99f35afc5ed510391b9bdc3833farbb/** A structure that represents the current request */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The pool associated with the request */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The connection over which this connection has been read */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The virtual host this request is for */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** If we wind up getting redirected, pointer to the request we
952908500d5f99f35afc5ed510391b9bdc3833farbb * redirected to. */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** If this is an internal redirect, pointer to where we redirected
952908500d5f99f35afc5ed510391b9bdc3833farbb * *from*. */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** If this is a sub_request (see request.h) pointer back to the
952908500d5f99f35afc5ed510391b9bdc3833farbb * main request. */
2d2eda71267231c2526be701fe655db125852c1ffielding /* Info about the request itself... we begin with stuff that only
2d2eda71267231c2526be701fe655db125852c1ffielding * protocol.c should ever touch...
952908500d5f99f35afc5ed510391b9bdc3833farbb /** First line of request, so we can log it */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** HTTP/0.9, "simple" request */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** A proxy request (calculated during post_read_request/translate_name) */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** HEAD request, as opposed to GET */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Protocol, as given to us, or HTTP/0.9 */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Number version of protocol; 1.1 = 1001 */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Host, as set by full URI or Host: */
952908500d5f99f35afc5ed510391b9bdc3833farbb const char *hostname;
952908500d5f99f35afc5ed510391b9bdc3833farbb /** When the request started */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Status line, if set by script */
952908500d5f99f35afc5ed510391b9bdc3833farbb const char *status_line;
952908500d5f99f35afc5ed510391b9bdc3833farbb /** In any case */
2d2eda71267231c2526be701fe655db125852c1ffielding /* Request method, two ways; also, protocol, etc.. Outside of protocol.c,
2d2eda71267231c2526be701fe655db125852c1ffielding * look, but don't touch.
952908500d5f99f35afc5ed510391b9bdc3833farbb /** GET, HEAD, POST, etc. */
952908500d5f99f35afc5ed510391b9bdc3833farbb const char *method;
952908500d5f99f35afc5ed510391b9bdc3833farbb /** M_GET, M_POST, etc. */
952908500d5f99f35afc5ed510391b9bdc3833farbb * allowed is a bitvector of the allowed methods.
952908500d5f99f35afc5ed510391b9bdc3833farbb * A handler must ensure that the request method is one that
952908500d5f99f35afc5ed510391b9bdc3833farbb * it is capable of handling. Generally modules should DECLINE
952908500d5f99f35afc5ed510391b9bdc3833farbb * any request methods they do not handle. Prior to aborting the
952908500d5f99f35afc5ed510391b9bdc3833farbb * handler like this the handler should set r->allowed to the list
952908500d5f99f35afc5ed510391b9bdc3833farbb * of methods that it is willing to handle. This bitvector is used
952908500d5f99f35afc5ed510391b9bdc3833farbb * to construct the "Allow:" header required for OPTIONS requests,
952908500d5f99f35afc5ed510391b9bdc3833farbb * and HTTP_METHOD_NOT_ALLOWED and HTTP_NOT_IMPLEMENTED status codes.
952908500d5f99f35afc5ed510391b9bdc3833farbb * Since the default_handler deals with OPTIONS, all modules can
952908500d5f99f35afc5ed510391b9bdc3833farbb * usually decline to deal with OPTIONS. TRACE is always allowed,
952908500d5f99f35afc5ed510391b9bdc3833farbb * modules don't need to set it explicitly.
952908500d5f99f35afc5ed510391b9bdc3833farbb * Since the default_handler will always handle a GET, a
952908500d5f99f35afc5ed510391b9bdc3833farbb * module which does *not* implement GET should probably return
952908500d5f99f35afc5ed510391b9bdc3833farbb * HTTP_METHOD_NOT_ALLOWED. Unfortunately this means that a Script GET
952908500d5f99f35afc5ed510391b9bdc3833farbb * handler can't be installed by mod_actions. </PRE>
2d2eda71267231c2526be701fe655db125852c1ffielding int allowed; /* Allowed methods - for 405, OPTIONS, etc */
5d54ba1fdf6f8d7167fafcd93bef30df3906b1aecoar apr_array_header_t *allowed_xmethods; /* Array of extension methods */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** byte count in stream is for body */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** body byte count, for easy access */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Time the resource was last modified */
2d2eda71267231c2526be701fe655db125852c1ffielding /* HTTP/1.1 connection-level features */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** sending chunked transfer-coding */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** number of byte ranges */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** multipart/byteranges boundary */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The Range: header */
952908500d5f99f35afc5ed510391b9bdc3833farbb const char *range;
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The "real" content length */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** bytes left to read */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** bytes that have been read */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** how the request body should be read */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** reading chunked transfer-coding */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** is client waiting for a 100 response? */
2d2eda71267231c2526be701fe655db125852c1ffielding /* MIME header environments, in and out. Also, an array containing
2d2eda71267231c2526be701fe655db125852c1ffielding * environment variables to be passed to subprocesses, so people can
2d2eda71267231c2526be701fe655db125852c1ffielding * write modules to add to that environment.
2d2eda71267231c2526be701fe655db125852c1ffielding * The difference between headers_out and err_headers_out is that the
2d2eda71267231c2526be701fe655db125852c1ffielding * latter are printed even on error, and persist across internal redirects
2d2eda71267231c2526be701fe655db125852c1ffielding * (so the headers printed for ErrorDocument handlers will have them).
1ccd992d37d62c8cb2056126f2234f64ec189bfddougm * The 'notes' apr_table_t is for notes from one module to another, with no
2d2eda71267231c2526be701fe655db125852c1ffielding * other set purpose in mind...
952908500d5f99f35afc5ed510391b9bdc3833farbb /** MIME header environment from the request */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** MIME header environment for the response */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** MIME header environment for the response, printed even on errors and
952908500d5f99f35afc5ed510391b9bdc3833farbb * persist across internal redirects */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Array of environment variables to be used for sub processes */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Notes from one module to another */
2d2eda71267231c2526be701fe655db125852c1ffielding /* content_type, handler, content_encoding, content_language, and all
2d2eda71267231c2526be701fe655db125852c1ffielding * content_languages MUST be lowercased strings. They may be pointers
2d2eda71267231c2526be701fe655db125852c1ffielding * to static strings; they should not be modified in place.
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The content-type for the current request */
2d2eda71267231c2526be701fe655db125852c1ffielding const char *content_type; /* Break these out --- we dispatch on 'em */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The handler string that we use to call a handler function */
2d2eda71267231c2526be701fe655db125852c1ffielding const char *handler; /* What we *really* dispatch on */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** How to encode the data */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** for back-compat. only -- do not use */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** array of (char*) representing the content languages */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** variant list validator (if negotiated) */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** If an authentication check was made, this gets set to the user name. */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** If an authentication check was made, this gets set to the auth type. */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** This response is non-cache-able */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** There is no local copy of this response */
2d2eda71267231c2526be701fe655db125852c1ffielding /* What object is being requested (either directly, or via include
2d2eda71267231c2526be701fe655db125852c1ffielding * or content-negotiation mapping).
952908500d5f99f35afc5ed510391b9bdc3833farbb /** the uri without any parsing performed */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** the path portion of the URI */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The filename on disk that this response corresponds to */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The path_info for this request if there is any. */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** QUERY_ARGS, if any */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** ST_MODE set to zero if no such file */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** components of uri, dismantled */
2d2eda71267231c2526be701fe655db125852c1ffielding /* Various other config info which may change with .htaccess files
2d2eda71267231c2526be701fe655db125852c1ffielding * These are config vectors, with one void* pointer for each module
2d2eda71267231c2526be701fe655db125852c1ffielding * (the thing pointed to being the module's business).
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Options set in config files, etc. */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Notes on *this* request */
2d2eda71267231c2526be701fe655db125852c1ffielding * a linked list of the configuration directives in the .htaccess files
2d2eda71267231c2526be701fe655db125852c1ffielding * accessed by this request.
2d2eda71267231c2526be701fe655db125852c1ffielding * N.B. always add to the head of the list, _never_ to the end.
2d2eda71267231c2526be701fe655db125852c1ffielding * that way, a sub request's list can (temporarily) point to a parent's list
952908500d5f99f35afc5ed510391b9bdc3833farbb * @defvar const htaccess_result *htaccess
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The translation headers for dealing with this request
952908500d5f99f35afc5ed510391b9bdc3833farbb * @defvar ap_rr_xlate *rrx */
3a50e4da8a0db4515ab45678e5b39ff7e7594320trawick#endif /*APACHE_XLATE*/
952908500d5f99f35afc5ed510391b9bdc3833farbb /** A list of filters to be used for this request
952908500d5f99f35afc5ed510391b9bdc3833farbb * @defvar ap_filter_t *filters */
2d2eda71267231c2526be701fe655db125852c1ffielding/* Things placed at the end of the record to avoid breaking binary
2d2eda71267231c2526be701fe655db125852c1ffielding * compatibility. It would be nice to remember to reorder the entire
2d2eda71267231c2526be701fe655db125852c1ffielding * record to improve 64bit alignment the next time we need to break
2d2eda71267231c2526be701fe655db125852c1ffielding * binary compatibility for some other reason.
952908500d5f99f35afc5ed510391b9bdc3833farbb/** Structure to store things which are per connection */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Pool associated with this connection */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Physical vhost this conn come in on */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** used by http_vhost.c */
2d2eda71267231c2526be701fe655db125852c1ffielding /* Information about the connection itself */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Connection to the client */
2d2eda71267231c2526be701fe655db125852c1ffielding /* Who is the client? */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** local address */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** remote address */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Client's IP address */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Client's DNS name, if known. NULL if DNS hasn't been checked,
952908500d5f99f35afc5ed510391b9bdc3833farbb * "" if it has and no address was found. N.B. Only access this though
952908500d5f99f35afc5ed510391b9bdc3833farbb * get_remote_host() */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Only ever set if doing rfc1413 lookups. N.B. Only access this through
952908500d5f99f35afc5ed510391b9bdc3833farbb * get_remote_logname() */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Are we still talking? */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Are we using HTTP Keep-Alive? -1 fatal error, 0 undecided, 1 yes */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Did we use HTTP Keep-Alive? */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** have we done double-reverse DNS? -1 yes/failure, 0 not yet,
952908500d5f99f35afc5ed510391b9bdc3833farbb /** How many times have we used it? */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** server IP address */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** used for ap_get_server_name when UseCanonicalName is set to DNS
952908500d5f99f35afc5ed510391b9bdc3833farbb * (ignores setting of HostnameLookups) */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** ID of this connection; unique at any point in time */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Notes on *this* connection */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** send note from one module to another, must remain valid for all
952908500d5f99f35afc5ed510391b9bdc3833farbb * requests on this conn */
2d2eda71267231c2526be701fe655db125852c1ffielding/* Per-vhost config... */
2d2eda71267231c2526be701fe655db125852c1ffielding/* The address 255.255.255.255, when used as a virtualhost address,
2d2eda71267231c2526be701fe655db125852c1ffielding * will become the "default" server when the ip doesn't match other vhosts.
952908500d5f99f35afc5ed510391b9bdc3833farbb/** A structure to be used for Per-vhost config */
169f62b04de69074b561b4e6dcf6f82572a5e367trawick /** The next server in the list */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The bound address, for this server */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The bound port, for this server */
952908500d5f99f35afc5ed510391b9bdc3833farbb unsigned short host_port;
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The name given in <VirtualHost> */
952908500d5f99f35afc5ed510391b9bdc3833farbb/** A structure to store information for each virtual server */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The process this server is running in */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The next server in the list */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The name of the server */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The line of the config file that the server was defined on */
2d2eda71267231c2526be701fe655db125852c1ffielding /* Contact information */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The admin's contact information */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The server hostname */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** for redirects, etc. */
952908500d5f99f35afc5ed510391b9bdc3833farbb unsigned short port;
2d2eda71267231c2526be701fe655db125852c1ffielding /* Log files --- note that transfer log is now in the modules... */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The name of the error log */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** A file descriptor that references the error log */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** The log level for this server */
2d2eda71267231c2526be701fe655db125852c1ffielding /* Module-specific configuration for server, and defaults... */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** true if this is the virtual server */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Config vector containing pointers to modules' per-server config
952908500d5f99f35afc5ed510391b9bdc3833farbb * structures. */
169f62b04de69074b561b4e6dcf6f82572a5e367trawick /** MIME type info, etc., before we start checking per-directory info */
2d2eda71267231c2526be701fe655db125852c1ffielding /* Transaction handling */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** I haven't got a clue */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Timeout, in seconds, before we give up */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Seconds we'll wait for another request */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Maximum requests per connection */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Use persistent connections? */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Pathname for ServerPath */
952908500d5f99f35afc5ed510391b9bdc3833farbb const char *path;
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Length of path */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Normal names for ServerAlias servers */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** Wildcarded names for ServerAlias servers */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** effective user id when calling exec wrapper */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** effective group id when calling exec wrapper */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** limit on size of the HTTP request line */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** limit on size of any request header field */
952908500d5f99f35afc5ed510391b9bdc3833farbb /** limit on number of request header fields */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* stuff marked API_EXPORT is part of the API, and intended for use
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * by modules
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* Stuff marked API_EXPORT_NONSTD is part of the API, and intended for
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * use by modules. The difference between API_EXPORT and
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * API_EXPORT_NONSTD is that the latter is required for any functions
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * which use varargs or are used via indirect function call. This
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * is to accomodate the two calling conventions in windows dlls.
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* modules should not used functions marked CORE_EXPORT
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * or CORE_EXPORT_NONSTD */
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb/* On Mac OS X Server, symbols that conflict with loaded dylibs
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * (eg. System framework) need to be declared as private symbols with
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * __private_extern__.
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb * For other systems, make that a no-op.
b0f20a4a26bcfa85724b1c2e5ec6a077f12ef44crbb#if (defined(MAC_OS) || defined(MAC_OS_X_SERVER)) && defined(__DYNAMIC__)
952908500d5f99f35afc5ed510391b9bdc3833farbb * Examine a field value (such as a media-/content-type) string and return
952908500d5f99f35afc5ed510391b9bdc3833farbb * it sans any parameters; e.g., strip off any ';charset=foo' and the like.
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p Pool to allocate memory out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param intype The field to examine
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return the field minus any parameters
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_field_noparam(apr_pool_t *p, const char *intype);
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(char *) ap_field_noparam(apr_pool_t *p, const char *intype);
952908500d5f99f35afc5ed510391b9bdc3833farbb * Convert a time from an integer into a string in a specified format
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate memory out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param t The time to convert
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param fmt The format to use for the conversion
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param gmt Convert the time for GMT?
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return The string that represents the specified time
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_ht_time(apr_pool_t *p, apr_time_t t, const char *fmt, int gmt)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(char *) ap_ht_time(apr_pool_t *p, apr_time_t t, const char *fmt, int gmt);
2d2eda71267231c2526be701fe655db125852c1ffielding/* String handling. The *_nc variants allow you to use non-const char **s as
2d2eda71267231c2526be701fe655db125852c1ffielding arguments (unfortunately C won't automatically convert a char ** to a const
2d2eda71267231c2526be701fe655db125852c1ffielding char **) */
952908500d5f99f35afc5ed510391b9bdc3833farbb * Get the characters until the first occurance of a specified character
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate memory out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param line The string to get the characters from
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param stop The character to stop at
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return A copy of the characters up to the first stop character
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_getword(apr_pool_t *p, const char **line, char stop);
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(char *) ap_getword(apr_pool_t *p, const char **line, char stop);
952908500d5f99f35afc5ed510391b9bdc3833farbb * Get the characters until the first occurance of a specified character
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate memory out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param line The string to get the characters from
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param stop The character to stop at
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return A copy of the characters up to the first stop character
952908500d5f99f35afc5ed510391b9bdc3833farbb * @tip This is the same as ap_getword, except it doesn't use const char **.
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_getword_nc(apr_pool_t *p, char **line, char stop);
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(char *) ap_getword_nc(apr_pool_t *p, char **line, char stop);
952908500d5f99f35afc5ed510391b9bdc3833farbb * Get the first word from a given string. A word is defined as all characters
952908500d5f99f35afc5ed510391b9bdc3833farbb * up to the first whitespace.
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate memory from
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param line The string to traverse
952908500d5f99f35afc5ed510391b9bdc3833farbb * @retrn The first word in the line
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_getword_white(apr_pool_t *p, const char **line)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(char *) ap_getword_white(apr_pool_t *p, const char **line);
952908500d5f99f35afc5ed510391b9bdc3833farbb * Get the first word from a given string. A word is defined as all characters
952908500d5f99f35afc5ed510391b9bdc3833farbb * up to the first whitespace.
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate memory from
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param line The string to traverse
952908500d5f99f35afc5ed510391b9bdc3833farbb * @retrn The first word in the line
952908500d5f99f35afc5ed510391b9bdc3833farbb * @tip The same as ap_getword_white, except it doesn't use const char **.
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_getword_white_nc(apr_pool_t *p, const char **line)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(char *) ap_getword_white_nc(apr_pool_t *p, char **line);
952908500d5f99f35afc5ed510391b9bdc3833farbb * Get all characters from the first occurance of stop to the first '\0'
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate memory out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param line The line to traverse
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param stop The character to start at
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return A copy of all caracters after the first occurance of the specified
952908500d5f99f35afc5ed510391b9bdc3833farbb * character
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_getword_nulls(apr_pool_t *p, const char **line, char stop)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(char *) ap_getword_nulls(apr_pool_t *p, const char **line, char stop);
952908500d5f99f35afc5ed510391b9bdc3833farbb * Get all characters from the first occurance of stop to the first '\0'
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate memory out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param line The line to traverse
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param stop The character to start at
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return A copy of all caracters after the first occurance of the specified
952908500d5f99f35afc5ed510391b9bdc3833farbb * character
952908500d5f99f35afc5ed510391b9bdc3833farbb * @tip The same as ap_getword_nulls, except it doesn't use const char **.
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_getword_nulls_nc(apr_pool_t *p, char **line, char stop)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(char *) ap_getword_nulls_nc(apr_pool_t *p, char **line, char stop);
952908500d5f99f35afc5ed510391b9bdc3833farbb * Get the second word in the string paying attention to quoting
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param line The line to traverse
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return A copy of the string
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_getword_conf(apr_pool_t *p, const char **line)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(char *) ap_getword_conf(apr_pool_t *p, const char **line);
952908500d5f99f35afc5ed510391b9bdc3833farbb * Get the second word in the string paying attention to quoting
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param line The line to traverse
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return A copy of the string
952908500d5f99f35afc5ed510391b9bdc3833farbb * @tip The same as ap_getword_conf, except it doesn't use const char **.
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_getword_conf_nc(apr_pool_t *p, char **line)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(char *) ap_getword_conf_nc(apr_pool_t *p, char **line);
952908500d5f99f35afc5ed510391b9bdc3833farbb * Check a string for any ${ENV} environment variable construct and replace
952908500d5f99f35afc5ed510391b9bdc3833farbb * each them by the value of that environment variable, if it exists. If the
952908500d5f99f35afc5ed510391b9bdc3833farbb * environment value does not exist, leave the ${ENV} construct alone; it
952908500d5f99f35afc5ed510391b9bdc3833farbb * means something else.
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param word The string to check
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return The string with the replaced environment variables
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc const char *ap_resolve_env(apr_pool_t *p, const char *word)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(const char *) ap_resolve_env(apr_pool_t *p, const char * word);
952908500d5f99f35afc5ed510391b9bdc3833farbb * Size an HTTP header field list item, as separated by a comma.
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param field The field to size
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param len The length of the field
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return The return value is a pointer to the beginning of the non-empty
952908500d5f99f35afc5ed510391b9bdc3833farbb * list item within the original string (or NULL if there is none) and the
952908500d5f99f35afc5ed510391b9bdc3833farbb * address of field is shifted to the next non-comma, non-whitespace
952908500d5f99f35afc5ed510391b9bdc3833farbb * character. len is the length of the item excluding any beginning whitespace.
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc const char *ap_size_list_item(const char **field, int *len)
2d2eda71267231c2526be701fe655db125852c1ffieldingAPI_EXPORT(const char *) ap_size_list_item(const char **field, int *len);
952908500d5f99f35afc5ed510391b9bdc3833farbb * Retrieve an HTTP header field list item, as separated by a comma,
952908500d5f99f35afc5ed510391b9bdc3833farbb * while stripping insignificant whitespace and lowercasing anything not in
952908500d5f99f35afc5ed510391b9bdc3833farbb * a quoted string or comment.
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param field The field to retrieve
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return The return value is a new string containing the converted list
952908500d5f99f35afc5ed510391b9bdc3833farbb * item (or NULL if none) and the address pointed to by field is
952908500d5f99f35afc5ed510391b9bdc3833farbb * shifted to the next non-comma, non-whitespace.
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_get_list_item(apr_pool_t *p, const char **field)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(char *) ap_get_list_item(apr_pool_t *p, const char **field);
952908500d5f99f35afc5ed510391b9bdc3833farbb * Find an item in canonical form (lowercase, no extra spaces) within
952908500d5f99f35afc5ed510391b9bdc3833farbb * an HTTP field value list.
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param line The field value list to search
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param tok The token to search for
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return 1 if found, 0 if not found.
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc int ap_find_list_item(apr_pool_t *p, const char *line, const char *tok)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(int) ap_find_list_item(apr_pool_t *p, const char *line, const char *tok);
952908500d5f99f35afc5ed510391b9bdc3833farbb * Retrieve a token, spacing over it and returning a pointer to
952908500d5f99f35afc5ed510391b9bdc3833farbb * the first non-white byte afterwards. Note that these tokens
952908500d5f99f35afc5ed510391b9bdc3833farbb * are delimited by semis and commas; and can also be delimited
952908500d5f99f35afc5ed510391b9bdc3833farbb * by whitespace at the caller's option.
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param accept_line The line to retrieve the token from
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param accept_white Is it delimited by whitespace
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return the first non-white byte after the token
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_get_token(apr_pool_t *p, const char **accept_line, int accept_white)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(char *) ap_get_token(apr_pool_t *p, const char **accept_line, int accept_white);
952908500d5f99f35afc5ed510391b9bdc3833farbb * find http tokens, see the definition of token from RFC2068
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param line The line to find the token
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param tok The token to find
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return 1 if the token is found, 0 otherwise
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc int ap_find_token(apr_pool_t *p, const char *line, const char *tok)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(int) ap_find_token(apr_pool_t *p, const char *line, const char *tok);
952908500d5f99f35afc5ed510391b9bdc3833farbb * find http tokens from the end of the line
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param line The line to find the token
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param tok The token to find
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return 1 if the token is found, 0 otherwise
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc int ap_find_last_token(apr_pool_t *p, const char *line, const char *tok)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(int) ap_find_last_token(apr_pool_t *p, const char *line, const char *tok);
952908500d5f99f35afc5ed510391b9bdc3833farbb * Check for an Absolute URI syntax
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param u The string to check
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return 1 if URI, 0 otherwise
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc int ap_is_url(const char *u)
952908500d5f99f35afc5ed510391b9bdc3833farbb * Unescape a URL
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param url The url to unescapte
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return 0 on success, non-zero otherwise
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc int ap_unescape_url(char *url)
952908500d5f99f35afc5ed510391b9bdc3833farbb * Remove all double slashes from a string
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param name The string to parse
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc void ap_no2slash(char *name)
952908500d5f99f35afc5ed510391b9bdc3833farbb * Remove all ./ and ../ substrings from a file name
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param name the file name to parse
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc void ap_getparents(char *name)
952908500d5f99f35afc5ed510391b9bdc3833farbb * Escape a path segment, as defined in RFC 1808
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param s The path to convert
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return The converted URL
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_escape_path_segment(apr_pool_t *p, const char *s)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(char *) ap_escape_path_segment(apr_pool_t *p, const char *s);
952908500d5f99f35afc5ed510391b9bdc3833farbb * convert an OS path to a URL in an OS dependant way.
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param path The path to convert
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param partial if set, assume that the path will be appended to something
952908500d5f99f35afc5ed510391b9bdc3833farbb * with a '/' in it (and thus does not prefix "./")
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return The converted URL
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_os_escape_path(apr_pool_t *p, const char *path, int partial)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(char *) ap_os_escape_path(apr_pool_t *p, const char *path, int partial);
2d2eda71267231c2526be701fe655db125852c1ffielding#define ap_escape_uri(ppool,path) ap_os_escape_path(ppool,path,1)
952908500d5f99f35afc5ed510391b9bdc3833farbb * Escape an html string
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param s The html to escape
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return The escaped string
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_escape_html(apr_pool_t *p, const char *s)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(char *) ap_escape_html(apr_pool_t *p, const char *s);
952908500d5f99f35afc5ed510391b9bdc3833farbb * Construct a full hostname
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param hostname The hostname of the server
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param port The port the server is running on
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param r The current request
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return The server's hostname
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_construct_server(apr_pool_t *p, const char *hostname, unsiged port, const request_rec *r)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(char *) ap_construct_server(apr_pool_t *p, const char *hostname,
952908500d5f99f35afc5ed510391b9bdc3833farbb * Escape a shell command
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param s The command to escape
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return The escaped hostname
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_escape_shell_cmd(apr_pool_t *p, const char *s)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(char *) ap_escape_shell_cmd(apr_pool_t *p, const char *s);
952908500d5f99f35afc5ed510391b9bdc3833farbb * Count the number of directories in a path
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param The path to count
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return The number of directories
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc int ap_count_dirs(const char *path)
952908500d5f99f35afc5ed510391b9bdc3833farbb * copy at most n leading directories of s into d d should be at least as
952908500d5f99f35afc5ed510391b9bdc3833farbb * large as s plus 1 extra byte assumes n > 0
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param d The location to copy to
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param s The location to copy from
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param n The number of directories to copy
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return value is the ever useful pointer to the trailing \0 of d
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_make_dirstr_prefix(char *d, const char *s, int n)
2d2eda71267231c2526be701fe655db125852c1ffieldingAPI_EXPORT(char *) ap_make_dirstr_prefix(char *d, const char *s, int n);
952908500d5f99f35afc5ed510391b9bdc3833farbb * return the parent directory name including trailing / of the file s
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param p The pool to allocate out of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @param s The file to get the parent of
952908500d5f99f35afc5ed510391b9bdc3833farbb * @return A copy of the file's parent directory
952908500d5f99f35afc5ed510391b9bdc3833farbb * @deffunc char *ap_make_dirstr_parent(apr_pool_t *p, const char *s)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(char *) ap_make_dirstr_parent(apr_pool_t *p, const char *s);
2d2eda71267231c2526be701fe655db125852c1ffielding/* deprecated. The previous two routines are preferred. */
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(char *) ap_make_dirstr(apr_pool_t *a, const char *s, int n);
58619148951981bcfa5c506ad8ce745aa8831980rbb * Given a directory and filename, create a single path out of them. This
58619148951981bcfa5c506ad8ce745aa8831980rbb * function is smart enough to ensure that there is a sinlge '/' between the
58619148951981bcfa5c506ad8ce745aa8831980rbb * directory and file names
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param a The pool to allocate out of
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param dir The directory name
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param f The filename
58619148951981bcfa5c506ad8ce745aa8831980rbb * @return A copy of the full path
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc char *ap_make_full_path(apr_pool_t *a, const char *dir, const char *f)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(char *) ap_make_full_path(apr_pool_t *a, const char *dir, const char *f);
58619148951981bcfa5c506ad8ce745aa8831980rbb * Does the provided string contain wildcard characters? This is useful
58619148951981bcfa5c506ad8ce745aa8831980rbb * for determining if the string should be passed to strcmp_match or to strcmp.
58619148951981bcfa5c506ad8ce745aa8831980rbb * The only wildcard characters recognized are '?' and '*'
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param str The string to check
58619148951981bcfa5c506ad8ce745aa8831980rbb * @return 1 if the string has wildcards, 0 otherwise
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc int ap_is_matchexp(const char *str)
58619148951981bcfa5c506ad8ce745aa8831980rbb * Determine if a string matches a patterm containing the wildcards '?' or '*'
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param str The string to check
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param exp The pattern to match against
58619148951981bcfa5c506ad8ce745aa8831980rbb * @return 1 if the two strings match, 0 otherwise
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc int ap_strcmp_match(const char *str, const char *exp)
2d2eda71267231c2526be701fe655db125852c1ffieldingAPI_EXPORT(int) ap_strcmp_match(const char *str, const char *exp);
58619148951981bcfa5c506ad8ce745aa8831980rbb * Determine if a string matches a patterm containing the wildcards '?' or '*',
58619148951981bcfa5c506ad8ce745aa8831980rbb * ignoring case
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param str The string to check
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param exp The pattern to match against
58619148951981bcfa5c506ad8ce745aa8831980rbb * @return 1 if the two strings match, 0 otherwise
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc int ap_strcasecmp_match(const char *str, const char *exp)
2d2eda71267231c2526be701fe655db125852c1ffieldingAPI_EXPORT(int) ap_strcasecmp_match(const char *str, const char *exp);
58619148951981bcfa5c506ad8ce745aa8831980rbb * Find the first occurrence of the substring s2 in s1, regardless of case
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param s1 The string to search
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param s2 The substring to search for
58619148951981bcfa5c506ad8ce745aa8831980rbb * @return A pointer to the beginning of the substring
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc char *ap_strcasestr(const char *s1, const char *s2)
ef7331e9f2c6fb4f671b13db21e0ac27a6dcf4f3dgaudetAPI_EXPORT(char *) ap_strcasestr(const char *s1, const char *s2);
58619148951981bcfa5c506ad8ce745aa8831980rbb * Decode a base64 encoded string into memory allocated out of a pool
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param p The pool to allocate out of
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param bufcoded The encoded string
58619148951981bcfa5c506ad8ce745aa8831980rbb * @return The decoded string
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc char *ap_pbase64decode(apr_pool_t *p, const char *bufcoded)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(char *) ap_pbase64decode(apr_pool_t *p, const char *bufcoded);
58619148951981bcfa5c506ad8ce745aa8831980rbb * Encode a string into memory allocated out of a pool in base 64 format
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param p The pool to allocate out of
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param strin The plaintext string
58619148951981bcfa5c506ad8ce745aa8831980rbb * @return The encoded string
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc char *ap_pbase64encode(apr_pool_t *p, char *string)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(char *) ap_pbase64encode(apr_pool_t *p, char *string);
58619148951981bcfa5c506ad8ce745aa8831980rbb/* The functions have been deprecated for the two above functions.
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(char *) ap_uudecode(apr_pool_t *p, const char *bufcoded);
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(char *) ap_uuencode(apr_pool_t *p, char *string);
58619148951981bcfa5c506ad8ce745aa8831980rbb * Compile a regular expression to be used later
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param p The pool to allocate out of
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param pattern the regular expression to compile
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param cflags The bitwise or of one or more of the following:
58619148951981bcfa5c506ad8ce745aa8831980rbb * REG_EXTENDED - Use POSIX extended Regular Expressions
58619148951981bcfa5c506ad8ce745aa8831980rbb * REG_ICASE - Ignore case
58619148951981bcfa5c506ad8ce745aa8831980rbb * REG_NOSUB - Support for substring addressing of matches not required
58619148951981bcfa5c506ad8ce745aa8831980rbb * REG_NEWLINE - Match-any-character operators don't match new-line
58619148951981bcfa5c506ad8ce745aa8831980rbb * @return The compiled regular expression
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc regex_t *ap_pregcomp(apr_pool_t *p, const char *pattern, int cflags)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(regex_t *) ap_pregcomp(apr_pool_t *p, const char *pattern,
58619148951981bcfa5c506ad8ce745aa8831980rbb * Free the memory associated with a compiled regular expression
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param p The pool the regex was allocated out of
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param reg The regular expression to free
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc void ap_pregfree(apr_pool_t *p, regex_t *reg)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(void) ap_pregfree(apr_pool_t *p, regex_t *reg);
58619148951981bcfa5c506ad8ce745aa8831980rbb * Match a null-terminated string against a pre-compiled regex.
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param preg The pre-compiled regex
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param string The string to match
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param nmatch Provide information regarding the location of any matches
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param pmatch Provide information regarding the location of any matches
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param eflags Bitwise or of one or both of:
58619148951981bcfa5c506ad8ce745aa8831980rbb * REG_NOTBOL - match-beginning-of-line operator always fails to match
58619148951981bcfa5c506ad8ce745aa8831980rbb * REG_NOTEOL - match-end-of-line operator always fails to match
58619148951981bcfa5c506ad8ce745aa8831980rbb * @return 0 for successful match, REG_NOMATCH otherwise
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc int ap_regexec(regex_t *preg, const char *string, size_t nmatch, regmatch_t pmatch[], int eflags)
06924437019f9871bc4ee49748511130548b7d35rbbAPI_EXPORT(int) ap_regexec(regex_t *preg, const char *string,
58619148951981bcfa5c506ad8ce745aa8831980rbb * Return the error code returned by regcomp or regexec into error messages
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param errocode the error code returned by regexec or regcomp
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param preg The precompiled regex
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param errbuf A buffer to store the error in
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param errbuf_size The size of the buffer
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc size_t ap_regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)
2d2eda71267231c2526be701fe655db125852c1ffieldingAPI_EXPORT(size_t) ap_regerror(int errcode, const regex_t *preg,
58619148951981bcfa5c506ad8ce745aa8831980rbb * After performing a successful regex match, you may use this function to
58619148951981bcfa5c506ad8ce745aa8831980rbb * perform a series of string substitutions based on subexpressions that were
58619148951981bcfa5c506ad8ce745aa8831980rbb * matched during the call to ap_regexec
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param p The pool to allocate out of
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param input An arbitrary string containing $1 through $9. These are
58619148951981bcfa5c506ad8ce745aa8831980rbb * replaced with the corresponding matched sub-expressions
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param source The string that was originally matched to the regex
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param nmatch the nmatch returned from ap_pregex
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param pmatch the pmatch array returned from ap_pregex
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc char *ap_pregsub(apr_pool_t *p, const char *input, const char *source, size_t nmatch, regmatch_t pmatch[])
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmAPI_EXPORT(char *) ap_pregsub(apr_pool_t *p, const char *input, const char *source,
58619148951981bcfa5c506ad8ce745aa8831980rbb * we want to downcase the type/subtype for comparison purposes
58619148951981bcfa5c506ad8ce745aa8831980rbb * but nothing else because ;parameter=foo values are case sensitive.
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param s The content-type to convert to lowercase
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc void ap_content_type_tolower(char *s)
58619148951981bcfa5c506ad8ce745aa8831980rbb * convert a string to all lowercase
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param s The string to convert to lowercase
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc void ap_str_tolower(char *s)
58619148951981bcfa5c506ad8ce745aa8831980rbb * Search a string from left to right for the first occurrence of a
58619148951981bcfa5c506ad8ce745aa8831980rbb * specific character
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param str The string to search
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param c The character to search for
58619148951981bcfa5c506ad8ce745aa8831980rbb * @return The index of the first occurrence of c in str
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc int ap_ind(const char *str, char c)
58619148951981bcfa5c506ad8ce745aa8831980rbbAPI_EXPORT(int) ap_ind(const char *str, char c); /* Sigh... */
58619148951981bcfa5c506ad8ce745aa8831980rbb * Search a string from right to left for the first occurrence of a
58619148951981bcfa5c506ad8ce745aa8831980rbb * specific character
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param str The string to search
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param c The character to search for
58619148951981bcfa5c506ad8ce745aa8831980rbb * @return The index of the first occurrence of c in str
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc int ap_rind(const char *str, char c)
58619148951981bcfa5c506ad8ce745aa8831980rbb * Given a string, replace any bare " with \" .
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param p The pool to allocate memory out of
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param instring The string to search for "
58619148951981bcfa5c506ad8ce745aa8831980rbb * @return A copy of the string with escaped quotes
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc char * ap_escape_quotes(apr_pool_t *p, const char *instring)
58619148951981bcfa5c506ad8ce745aa8831980rbbAPI_EXPORT(char *) ap_escape_quotes(apr_pool_t *p, const char *instring);
2d2eda71267231c2526be701fe655db125852c1ffielding/* Misc system hackery */
58619148951981bcfa5c506ad8ce745aa8831980rbb * Convert a username to a numeric ID
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param name The name to convert
58619148951981bcfa5c506ad8ce745aa8831980rbb * @return The user id corresponding to a name
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc uid_t ap_uname2id(const char *name)
58619148951981bcfa5c506ad8ce745aa8831980rbb * Convert a group name to a numeric ID
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param name The name to convert
58619148951981bcfa5c506ad8ce745aa8831980rbb * @return The group id corresponding to a name
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc gid_t ap_gname2id(const char *name)
58619148951981bcfa5c506ad8ce745aa8831980rbb * Given the name of an object in the file system determine if it is a directory
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param name The name of the object to check
58619148951981bcfa5c506ad8ce745aa8831980rbb * @return 1 if it is a directory, 0 otherwise
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc int ap_is_directory(const char *name)
58619148951981bcfa5c506ad8ce745aa8831980rbb * Given a pathname in file, extract the directory and chdir to that directory
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param file The file who's directory we wish to switch to
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc void ap_chdir_file(const char *file)
58619148951981bcfa5c506ad8ce745aa8831980rbb * Get the maximum number of daemons processes for this version of Apache
58619148951981bcfa5c506ad8ce745aa8831980rbb * @return The maximum number of daemon processes
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc int ap_get_max_daemons(void)
1ccd992d37d62c8cb2056126f2234f64ec189bfddougmextern const char *os_set_account(apr_pool_t *p, const char *account);
2d2eda71267231c2526be701fe655db125852c1ffieldingextern int os_init_job_environment(server_rec *s, const char *user_name, int one_process);
2d2eda71267231c2526be701fe655db125852c1ffielding#endif /* _OSD_POSIX */
58619148951981bcfa5c506ad8ce745aa8831980rbb * determine the local host name for the current machine
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param p The pool to allocate out of
58619148951981bcfa5c506ad8ce745aa8831980rbb * @return A copy of the local host name
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc char *ap_get_local_host(apr_pool_t *p)
58619148951981bcfa5c506ad8ce745aa8831980rbb * Parses a host of the form <address>[:port] :port is permitted if 'port'
58619148951981bcfa5c506ad8ce745aa8831980rbb * is not NULL
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param hostname The hostname to parse
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param port The port found in the hostname
58619148951981bcfa5c506ad8ce745aa8831980rbb * @return The address of the server
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc unsigned long ap_get_virthost_addr(char *hostname, unsigned shor *port)
58619148951981bcfa5c506ad8ce745aa8831980rbbunsigned long ap_get_virthost_addr(char *hostname, unsigned short *port);
2d2eda71267231c2526be701fe655db125852c1ffielding * Redefine assert() to something more useful for an Apache...
58619148951981bcfa5c506ad8ce745aa8831980rbb * Log an assertion to the error log
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param szExp The assertion that failed
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param szFile The file the assertion is in
58619148951981bcfa5c506ad8ce745aa8831980rbb * @param nLine The line the assertion is defined on
58619148951981bcfa5c506ad8ce745aa8831980rbb * @deffunc void ap_log_assert(const char *szExp, const char *szFile, int nLine)
2d2eda71267231c2526be701fe655db125852c1ffieldingAPI_EXPORT(void) ap_log_assert(const char *szExp, const char *szFile, int nLine)
2d2eda71267231c2526be701fe655db125852c1ffielding#define ap_assert(exp) ((exp) ? (void)0 : ap_log_assert(#exp,__FILE__,__LINE__))
2d2eda71267231c2526be701fe655db125852c1ffielding/* A set of flags which indicate places where the server should raise(SIGSTOP).
2d2eda71267231c2526be701fe655db125852c1ffielding * This is useful for debugging, because you can then attach to that process
2d2eda71267231c2526be701fe655db125852c1ffielding * with gdb and continue. This is important in cases where one_process
2d2eda71267231c2526be701fe655db125852c1ffielding * debugging isn't possible.
2d2eda71267231c2526be701fe655db125852c1ffielding#define RAISE_SIGSTOP(x) do { \
2d2eda71267231c2526be701fe655db125852c1ffielding if (raise_sigstop_flags & SIGSTOP_##x) raise(SIGSTOP);\
2d2eda71267231c2526be701fe655db125852c1ffielding } while (0)
2d2eda71267231c2526be701fe655db125852c1ffieldingAPI_EXPORT(extern const char *) ap_psignature(const char *prefix, request_rec *r);
2d2eda71267231c2526be701fe655db125852c1ffielding/* strtoul does not exist on sunos4. */
2d2eda71267231c2526be701fe655db125852c1ffielding#define strtoul strtoul_is_not_a_portable_function_use_strtol_instead
0e6e93183d91142d7cf9ffbf502114ff77bd9e19ben /* The C library has functions that allow const to be silently dropped ...
0e6e93183d91142d7cf9ffbf502114ff77bd9e19ben these macros detect the drop in maintainer mode, but use the native
0e6e93183d91142d7cf9ffbf502114ff77bd9e19ben methods far narmal builds
66d349e02d1a5a599a01c977d2c5b0009181f7debenchar *ap_strchr(char *s, int c);
66d349e02d1a5a599a01c977d2c5b0009181f7debenconst char *ap_strchr_c(const char *s, int c);
0e6e93183d91142d7cf9ffbf502114ff77bd9e19benchar *ap_strrchr(char *s, int c);
0e6e93183d91142d7cf9ffbf502114ff77bd9e19benconst char *ap_strrchr_c(const char *s, int c);
dca927eafb338b9de9d0214818136c16d436e3fdrbbchar *ap_strstr(char *s, char *c);
dca927eafb338b9de9d0214818136c16d436e3fdrbbconst char *ap_strstr_c(const char *s, const char *c);
2d2eda71267231c2526be701fe655db125852c1ffielding#endif /* !APACHE_HTTPD_H */