<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>Apache Portable Runtime Utility Library: include/apr_optional_hooks.h Source File</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.4 --> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> </ul> </div> <h1>include/apr_optional_hooks.h</h1><a href="apr__optional__hooks_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* Licensed to the Apache Software Foundation (ASF) under one or more</span> <a name="l00002"></a>00002 <span class="comment"> * contributor license agreements. See the NOTICE file distributed with</span> <a name="l00003"></a>00003 <span class="comment"> * this work for additional information regarding copyright ownership.</span> <a name="l00004"></a>00004 <span class="comment"> * The ASF licenses this file to You under the Apache License, Version 2.0</span> <a name="l00005"></a>00005 <span class="comment"> * (the "License"); you may not use this file except in compliance with</span> <a name="l00006"></a>00006 <span class="comment"> * the License. You may obtain a copy of the License at</span> <a name="l00007"></a>00007 <span class="comment"> *</span> <a name="l00008"></a>00008 <span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span> <a name="l00009"></a>00009 <span class="comment"> *</span> <a name="l00010"></a>00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span> <a name="l00011"></a>00011 <span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</span> <a name="l00012"></a>00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span> <a name="l00013"></a>00013 <span class="comment"> * See the License for the specific language governing permissions and</span> <a name="l00014"></a>00014 <span class="comment"> * limitations under the License.</span> <a name="l00015"></a>00015 <span class="comment"> */</span> <a name="l00022"></a>00022 <span class="preprocessor">#ifndef APR_OPTIONAL_HOOK_H</span> <a name="l00023"></a>00023 <span class="preprocessor"></span><span class="preprocessor">#define APR_OPTIONAL_HOOK_H</span> <a name="l00024"></a>00024 <span class="preprocessor"></span> <a name="l00025"></a>00025 <span class="preprocessor">#include "apr_tables.h"</span> <a name="l00026"></a>00026 <a name="l00027"></a>00027 <span class="preprocessor">#ifdef __cplusplus</span> <a name="l00028"></a>00028 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> { <a name="l00029"></a>00029 <span class="preprocessor">#endif</span> <a name="l00030"></a>00030 <span class="preprocessor"></span> <a name="l00048"></a>00048 <a class="code" href="group___a_p_r___util.html#g408498ed57031391c19bf360cc61733a">APU_DECLARE</a>(<span class="keywordtype">void</span>) <a class="code" href="group___a_p_r___util___o_p_t___h_o_o_k.html#gff32812046580ae53b0368918374a3b6">apr_optional_hook_add</a>(const <span class="keywordtype">char</span> *szName,<span class="keywordtype">void</span> (*pfn)(<span class="keywordtype">void</span>), <a name="l00049"></a>00049 const <span class="keywordtype">char</span> * const *aszPre, <a name="l00050"></a>00050 const <span class="keywordtype">char</span> * const *aszSucc, <a name="l00051"></a>00051 <span class="keywordtype">int</span> nOrder); <a name="l00052"></a>00052 <a name="l00064"></a><a class="code" href="group___a_p_r___util___o_p_t___h_o_o_k.html#g808d07f9a3e5df6517ba027972c79e4f">00064</a> <span class="preprocessor">#define APR_OPTIONAL_HOOK(ns,name,pfn,aszPre,aszSucc,nOrder) do { \</span> <a name="l00065"></a>00065 <span class="preprocessor"> ns##_HOOK_##name##_t *apu__hook = pfn; \</span> <a name="l00066"></a>00066 <span class="preprocessor"> apr_optional_hook_add(#name,(void (*)(void))apu__hook,aszPre, aszSucc, nOrder); \</span> <a name="l00067"></a>00067 <span class="preprocessor">} while (0)</span> <a name="l00068"></a>00068 <span class="preprocessor"></span> <a name="l00074"></a>00074 <a class="code" href="group___a_p_r___util.html#g408498ed57031391c19bf360cc61733a">APU_DECLARE</a>(apr_array_header_t *) apr_optional_hook_get(const <span class="keywordtype">char</span> *szName); <a name="l00075"></a>00075 <a name="l00090"></a><a class="code" href="group___a_p_r___util___o_p_t___h_o_o_k.html#g3e6fa7b8e9ce140b26d8f6ce34e6ae82">00090</a> <span class="preprocessor">#define APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(ns,link,ret,name,args_decl,args_use,ok,decline) \</span> <a name="l00091"></a>00091 <span class="preprocessor">link##_DECLARE(ret) ns##_run_##name args_decl \</span> <a name="l00092"></a>00092 <span class="preprocessor"> { \</span> <a name="l00093"></a>00093 <span class="preprocessor"> ns##_LINK_##name##_t *pHook; \</span> <a name="l00094"></a>00094 <span class="preprocessor"> int n; \</span> <a name="l00095"></a>00095 <span class="preprocessor"> ret rv; \</span> <a name="l00096"></a>00096 <span class="preprocessor"> apr_array_header_t *pHookArray=apr_optional_hook_get(#name); \</span> <a name="l00097"></a>00097 <span class="preprocessor">\</span> <a name="l00098"></a>00098 <span class="preprocessor"> if(!pHookArray) \</span> <a name="l00099"></a>00099 <span class="preprocessor"> return ok; \</span> <a name="l00100"></a>00100 <span class="preprocessor">\</span> <a name="l00101"></a>00101 <span class="preprocessor"> pHook=(ns##_LINK_##name##_t *)pHookArray->elts; \</span> <a name="l00102"></a>00102 <span class="preprocessor"> for(n=0 ; n < pHookArray->nelts ; ++n) \</span> <a name="l00103"></a>00103 <span class="preprocessor"> { \</span> <a name="l00104"></a>00104 <span class="preprocessor"> rv=(pHook[n].pFunc)args_use; \</span> <a name="l00105"></a>00105 <span class="preprocessor">\</span> <a name="l00106"></a>00106 <span class="preprocessor"> if(rv != ok && rv != decline) \</span> <a name="l00107"></a>00107 <span class="preprocessor"> return rv; \</span> <a name="l00108"></a>00108 <span class="preprocessor"> } \</span> <a name="l00109"></a>00109 <span class="preprocessor"> return ok; \</span> <a name="l00110"></a>00110 <span class="preprocessor"> }</span> <a name="l00111"></a>00111 <span class="preprocessor"></span> <a name="l00113"></a>00113 <span class="preprocessor">#ifdef __cplusplus</span> <a name="l00114"></a>00114 <span class="preprocessor"></span>} <a name="l00115"></a>00115 <span class="preprocessor">#endif</span> <a name="l00116"></a>00116 <span class="preprocessor"></span> <a name="l00117"></a>00117 <span class="preprocessor">#endif </span><span class="comment">/* APR_OPTIONAL_HOOK_H */</span> </pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 24 02:22:55 2008 for Apache Portable Runtime Utility Library by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.4 </small></address> </body> </html>