ap_config.h revision e9e8801c1aac7666455e290c9c260b51e6577d0e
28ec5e4f5c4a71428affc986304e894eda600925takashi/* ====================================================================
89565ae25f070411b0b32505b798195a9c98a1c2mturk * The Apache Software License, Version 1.1
5f5d1b4cc970b7f06ff8ef6526128e9a27303d88nd * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
89565ae25f070411b0b32505b798195a9c98a1c2mturk * reserved.
031b91a62d25106ae69d4693475c79618dd5e884fielding * Redistribution and use in source and binary forms, with or without
031b91a62d25106ae69d4693475c79618dd5e884fielding * modification, are permitted provided that the following conditions
031b91a62d25106ae69d4693475c79618dd5e884fielding * 1. Redistributions of source code must retain the above copyright
031b91a62d25106ae69d4693475c79618dd5e884fielding * notice, this list of conditions and the following disclaimer.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * 2. Redistributions in binary form must reproduce the above copyright
89565ae25f070411b0b32505b798195a9c98a1c2mturk * notice, this list of conditions and the following disclaimer in
89565ae25f070411b0b32505b798195a9c98a1c2mturk * the documentation and/or other materials provided with the
89565ae25f070411b0b32505b798195a9c98a1c2mturk * distribution.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * 3. The end-user documentation included with the redistribution,
89565ae25f070411b0b32505b798195a9c98a1c2mturk * if any, must include the following acknowledgment:
89565ae25f070411b0b32505b798195a9c98a1c2mturk * "This product includes software developed by the
89565ae25f070411b0b32505b798195a9c98a1c2mturk * Apache Software Foundation (http://www.apache.org/)."
89565ae25f070411b0b32505b798195a9c98a1c2mturk * Alternately, this acknowledgment may appear in the software itself,
89565ae25f070411b0b32505b798195a9c98a1c2mturk * if and wherever such third-party acknowledgments normally appear.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * 4. The names "Apache" and "Apache Software Foundation" must
89565ae25f070411b0b32505b798195a9c98a1c2mturk * not be used to endorse or promote products derived from this
89565ae25f070411b0b32505b798195a9c98a1c2mturk * software without prior written permission. For written
edcb4d94a269c3b1c3fdd6473e3f91e6c20e1702takashi * permission, please contact apache@apache.org.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * 5. Products derived from this software may not be called "Apache",
89565ae25f070411b0b32505b798195a9c98a1c2mturk * nor may "Apache" appear in their name, without prior written
89565ae25f070411b0b32505b798195a9c98a1c2mturk * permission of the Apache Software Foundation.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
89565ae25f070411b0b32505b798195a9c98a1c2mturk * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
89565ae25f070411b0b32505b798195a9c98a1c2mturk * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
89565ae25f070411b0b32505b798195a9c98a1c2mturk * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
89565ae25f070411b0b32505b798195a9c98a1c2mturk * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
89565ae25f070411b0b32505b798195a9c98a1c2mturk * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
89565ae25f070411b0b32505b798195a9c98a1c2mturk * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
89565ae25f070411b0b32505b798195a9c98a1c2mturk * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
89565ae25f070411b0b32505b798195a9c98a1c2mturk * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
89565ae25f070411b0b32505b798195a9c98a1c2mturk * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
89565ae25f070411b0b32505b798195a9c98a1c2mturk * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
89565ae25f070411b0b32505b798195a9c98a1c2mturk * SUCH DAMAGE.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * ====================================================================
89565ae25f070411b0b32505b798195a9c98a1c2mturk * This software consists of voluntary contributions made by many
ac08ae3142a205d1af6b8eb9b1810af58d904c00nd * individuals on behalf of the Apache Software Foundation. For more
b97955fc7710323d2352a6c6f514fec02649e12dcovener * information on the Apache Software Foundation, please see
6b9c9dc5117b48184a610fcea6f88a4704f63e5end * @brief Symbol Export Macros
626cbbae0d87d1e58fabf969ef6c55e3f5fcd544humbedooh/* Although this file doesn't declare any hooks, declare the hook group here */
626cbbae0d87d1e58fabf969ef6c55e3f5fcd544humbedooh/** @defgroup hooks Apache Hooks */
626cbbae0d87d1e58fabf969ef6c55e3f5fcd544humbedooh * AP_DECLARE_EXPORT is defined when building the Apache Core dynamic
2fae9d127f7143fabe8f73958eb9bde31df17d41coar * library, so that all public symbols are exported.
eb8ce30512a5e12d6b74971d9add7176fbee8e23rbowen * AP_DECLARE_STATIC is defined when including Apache's Core headers,
6b9c9dc5117b48184a610fcea6f88a4704f63e5end * to provide static linkage when the dynamic library may be unavailable.
eb8ce30512a5e12d6b74971d9add7176fbee8e23rbowen * AP_DECLARE_STATIC and AP_DECLARE_EXPORT are left undefined when
eb8ce30512a5e12d6b74971d9add7176fbee8e23rbowen * including Apache's Core headers, to import and link the symbols from the
eb8ce30512a5e12d6b74971d9add7176fbee8e23rbowen * dynamic Apache Core library and assure appropriate indirection and calling
eb8ce30512a5e12d6b74971d9add7176fbee8e23rbowen * conventions at compile time.
eb8ce30512a5e12d6b74971d9add7176fbee8e23rbowen#if !defined(WIN32)
6b9c9dc5117b48184a610fcea6f88a4704f63e5end * Apache Core dso functions are declared with AP_DECLARE(), so they may
eb8ce30512a5e12d6b74971d9add7176fbee8e23rbowen * use the most appropriate calling convention. Hook functions and other
626cbbae0d87d1e58fabf969ef6c55e3f5fcd544humbedooh * Core functions with variable arguments must use AP_DECLARE_NONSTD().
2fae9d127f7143fabe8f73958eb9bde31df17d41coar * @deffunc AP_DECLARE(rettype) ap_func(args)
eb8ce30512a5e12d6b74971d9add7176fbee8e23rbowen * Apache Core dso variable argument and hook functions are declared with
eb8ce30512a5e12d6b74971d9add7176fbee8e23rbowen * AP_DECLARE_NONSTD(), as they must use the C language calling convention.
b97955fc7710323d2352a6c6f514fec02649e12dcovener * @deffunc AP_DECLARE_NONSTD(rettype) ap_func(args [...])
ac08ae3142a205d1af6b8eb9b1810af58d904c00nd * Apache Core dso variables are declared with AP_MODULE_DECLARE_DATA.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * This assures the appropriate indirection is invoked at compile time.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * @tip AP_DECLARE_DATA extern type apr_variable; syntax is required for
89565ae25f070411b0b32505b798195a9c98a1c2mturk * declarations within headers to properly import the variable.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * @deffunc AP_DECLARE_DATA type apr_variable
89565ae25f070411b0b32505b798195a9c98a1c2mturk#define AP_DECLARE(type) __declspec(dllexport) type __stdcall
89565ae25f070411b0b32505b798195a9c98a1c2mturk#define AP_DECLARE_NONSTD(type) __declspec(dllexport) type
f7f7fdc0557bf57f1b50982c88d422d743aa2f12humbedooh#define AP_DECLARE(type) __declspec(dllimport) type __stdcall
ac08ae3142a205d1af6b8eb9b1810af58d904c00nd#define AP_DECLARE_NONSTD(type) __declspec(dllimport) type
89565ae25f070411b0b32505b798195a9c98a1c2mturk#if !defined(WIN32) || defined(AP_MODULE_DECLARE_STATIC)
89565ae25f070411b0b32505b798195a9c98a1c2mturk * Declare a dso module's exported module structure as AP_MODULE_DECLARE_DATA.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * Unless AP_MODULE_DECLARE_STATIC is defined at compile time, symbols
ac08ae3142a205d1af6b8eb9b1810af58d904c00nd * declared with AP_MODULE_DECLARE_DATA are always exported.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * @deffunc module AP_MODULE_DECLARE_DATA mod_tag
89565ae25f070411b0b32505b798195a9c98a1c2mturk#if defined(WIN32)
89565ae25f070411b0b32505b798195a9c98a1c2mturk * AP_MODULE_DECLARE_EXPORT is a no-op. Unless contradicted by the
89565ae25f070411b0b32505b798195a9c98a1c2mturk * AP_MODULE_DECLARE_STATIC compile-time symbol, it is assumed and defined.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * The old SHARED_MODULE compile-time symbol is now the default behavior,
89565ae25f070411b0b32505b798195a9c98a1c2mturk * so it is no longer referenced anywhere with Apache 2.0.
ab1ccbc6cd311935013f6e620b5103242147d688rjung * @deffunc AP_MODULE_DECLARE_EXPORT
89565ae25f070411b0b32505b798195a9c98a1c2mturk#define AP_MODULE_DECLARE(type) __declspec(dllexport) type __stdcall
89565ae25f070411b0b32505b798195a9c98a1c2mturk#define AP_MODULE_DECLARE_NONSTD(type) __declspec(dllexport) type
89565ae25f070411b0b32505b798195a9c98a1c2mturk * @package Hook Functions
89565ae25f070411b0b32505b798195a9c98a1c2mturk * Implement an Apache core hook that has no return code, and
89565ae25f070411b0b32505b798195a9c98a1c2mturk * therefore runs all of the registered functions. The implementation
89565ae25f070411b0b32505b798195a9c98a1c2mturk * is called ap_run_<I>name</I>.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * @param name The name of the hook
89565ae25f070411b0b32505b798195a9c98a1c2mturk * @param args_decl The declaration of the arguments for the hook, for example
ac08ae3142a205d1af6b8eb9b1810af58d904c00nd * "(int x,void *y)"
89565ae25f070411b0b32505b798195a9c98a1c2mturk * @param args_use The arguments for the hook as used in a call, for example
89565ae25f070411b0b32505b798195a9c98a1c2mturk * @tip If IMPLEMENTing a hook that is not linked into the Apache core,
89565ae25f070411b0b32505b798195a9c98a1c2mturk * (e.g. within a dso) see APR_IMPLEMENT_EXTERNAL_HOOK_VOID.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * @deffunc AP_IMPLEMENT_HOOK_VOID(name, args_decl, args_use)
89565ae25f070411b0b32505b798195a9c98a1c2mturk#define AP_IMPLEMENT_HOOK_VOID(name,args_decl,args_use) \
89565ae25f070411b0b32505b798195a9c98a1c2mturk APR_IMPLEMENT_EXTERNAL_HOOK_VOID(ap,AP,name,args_decl,args_use)
89565ae25f070411b0b32505b798195a9c98a1c2mturk * Implement an Apache core hook that runs until one of the functions
89565ae25f070411b0b32505b798195a9c98a1c2mturk * returns something other than ok or decline. That return value is
89565ae25f070411b0b32505b798195a9c98a1c2mturk * then returned from the hook runner. If the hooks run to completion,
ac08ae3142a205d1af6b8eb9b1810af58d904c00nd * then ok is returned. Note that if no hook runs it would probably be
89565ae25f070411b0b32505b798195a9c98a1c2mturk * more correct to return decline, but this currently does not do
fa34cf7b4d4e5468f70c1c23af39984dfa1d7231nd * so. The implementation is called ap_run_<I>name</I>.
fa34cf7b4d4e5468f70c1c23af39984dfa1d7231nd * @param ret The return type of the hook (and the hook runner)
89565ae25f070411b0b32505b798195a9c98a1c2mturk * @param name The name of the hook
89565ae25f070411b0b32505b798195a9c98a1c2mturk * @param args_decl The declaration of the arguments for the hook, for example
fa34cf7b4d4e5468f70c1c23af39984dfa1d7231nd * "(int x,void *y)"
89565ae25f070411b0b32505b798195a9c98a1c2mturk * @param args_use The arguments for the hook as used in a call, for example
89565ae25f070411b0b32505b798195a9c98a1c2mturk * @param ok The "ok" return value
89565ae25f070411b0b32505b798195a9c98a1c2mturk * @param decline The "decline" return value
89565ae25f070411b0b32505b798195a9c98a1c2mturk * @return ok, decline or an error.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * @tip If IMPLEMENTing a hook that is not linked into the Apache core,
89565ae25f070411b0b32505b798195a9c98a1c2mturk * (e.g. within a dso) see APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL.
fa34cf7b4d4e5468f70c1c23af39984dfa1d7231nd * @deffunc AP_IMPLEMENT_HOOK_RUN_ALL(ret, name, args_decl, args_use, ok, decline)
89565ae25f070411b0b32505b798195a9c98a1c2mturk#define AP_IMPLEMENT_HOOK_RUN_ALL(ret,name,args_decl,args_use,ok,decline) \
89565ae25f070411b0b32505b798195a9c98a1c2mturk APR_IMPLEMENT_EXTERNAL_HOOK_RUN_ALL(ap,AP,ret,name,args_decl, \
89565ae25f070411b0b32505b798195a9c98a1c2mturk * Implement a hook that runs until the first function that returns
fa34cf7b4d4e5468f70c1c23af39984dfa1d7231nd * something other than decline. If all functions return decline, the
89565ae25f070411b0b32505b798195a9c98a1c2mturk * hook runner returns decline. The implementation is called
fa34cf7b4d4e5468f70c1c23af39984dfa1d7231nd * ap_run_<I>name</I>.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * @param ret The return type of the hook (and the hook runner)
fa34cf7b4d4e5468f70c1c23af39984dfa1d7231nd * @param name The name of the hook
89565ae25f070411b0b32505b798195a9c98a1c2mturk * @param args_decl The declaration of the arguments for the hook, for example
89565ae25f070411b0b32505b798195a9c98a1c2mturk * "(int x,void *y)"
89565ae25f070411b0b32505b798195a9c98a1c2mturk * @param args_use The arguments for the hook as used in a call, for example
89565ae25f070411b0b32505b798195a9c98a1c2mturk * @param decline The "decline" return value
89565ae25f070411b0b32505b798195a9c98a1c2mturk * @return decline or an error.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * @tip If IMPLEMENTing a hook that is not linked into the Apache core
fa34cf7b4d4e5468f70c1c23af39984dfa1d7231nd * (e.g. within a dso) see APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * @deffunc AP_IMPLEMENT_HOOK_RUN_FIRST(ret, name, args_decl, args_use, decline)
89565ae25f070411b0b32505b798195a9c98a1c2mturk#define AP_IMPLEMENT_HOOK_RUN_FIRST(ret,name,args_decl,args_use,decline) \
89565ae25f070411b0b32505b798195a9c98a1c2mturk APR_IMPLEMENT_EXTERNAL_HOOK_RUN_FIRST(ap,AP,ret,name,args_decl, \
89565ae25f070411b0b32505b798195a9c98a1c2mturk/* Note that the other optional hook implementations are straightforward but
89565ae25f070411b0b32505b798195a9c98a1c2mturk * have not yet been needed
ac08ae3142a205d1af6b8eb9b1810af58d904c00nd * Implement an optional hook. This is exactly the same as a standard hook
ac08ae3142a205d1af6b8eb9b1810af58d904c00nd * implementation, except the hook is optional.
89565ae25f070411b0b32505b798195a9c98a1c2mturk * @see AP_IMPLEMENT_HOOK_RUN_ALL
89565ae25f070411b0b32505b798195a9c98a1c2mturk#define AP_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(ret,name,args_decl,args_use,ok, \
89565ae25f070411b0b32505b798195a9c98a1c2mturk APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(ap,AP,ret,name,args_decl, \
89565ae25f070411b0b32505b798195a9c98a1c2mturk * Hook an optional hook. Unlike static hooks, this uses a macro instead of a
89565ae25f070411b0b32505b798195a9c98a1c2mturk * function.
89565ae25f070411b0b32505b798195a9c98a1c2mturk/* TODO - We need to put OS detection back to make all the following work */
89565ae25f070411b0b32505b798195a9c98a1c2mturk#if defined(SUNOS4) || defined(IRIX) || defined(NEXT) || defined(AUX3) \
89565ae25f070411b0b32505b798195a9c98a1c2mturk/* These systems don't do well with any lingering close code; I don't know
89565ae25f070411b0b32505b798195a9c98a1c2mturk * why -- manoj */
89565ae25f070411b0b32505b798195a9c98a1c2mturk/* If APR has OTHER_CHILD logic, use reliable piped logs. */
f7f7fdc0557bf57f1b50982c88d422d743aa2f12humbedooh#endif /* AP_CONFIG_H */