00001 /* Copyright 2000-2004 The Apache Software Foundation 00002 * 00003 * Licensed under the Apache License, Version 2.0 (the "License"); 00004 * you may not use this file except in compliance with the License. 00005 * You may obtain a copy of the License at 00006 * 00007 * http://www.apache.org/licenses/LICENSE-2.0 00008 * 00009 * Unless required by applicable law or agreed to in writing, software 00010 * distributed under the License is distributed on an "AS IS" BASIS, 00011 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00012 * See the License for the specific language governing permissions and 00013 * limitations under the License. 00014 */ 00015 00016 #ifndef APR_DSO_DOT_H 00017 #define APR_DSO_DOT_H 00018 00019 /** 00020 * @file apr_dso.h 00021 * @brief APR Dynamic Object Handling Routines 00022 */ 00023 00024 #include "apr.h" 00025 #include "apr_pools.h" 00026 #include "apr_errno.h" 00027 00028 #ifdef __cplusplus 00029 extern "C" { 00030 #endif 00031 00032 /** 00033 * @defgroup apr_dso Dynamic Object Handling 00034 * @ingroup APR 00035 * @{ 00036 */ 00037 00038 #if APR_HAS_DSO || defined(DOXYGEN) 00039 00040 /** 00041 * Structure for referencing dynamic objects 00042 */ 00043 typedef struct apr_dso_handle_t apr_dso_handle_t; 00044 00045 /** 00046 * Structure for referencing symbols from dynamic objects 00047 */ 00048 typedef void * apr_dso_handle_sym_t; 00049 00050 /** 00051 * Load a DSO library. 00052 * @param res_handle Location to store new handle for the DSO. 00053 * @param path Path to the DSO library 00054 * @param ctx Pool to use. 00055 * @bug We aught to provide an alternative to RTLD_GLOBAL, which 00056 * is the only supported method of loading DSOs today. 00057 */ 00058 APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, 00059 const char *path, apr_pool_t *ctx); 00060 00061 /** 00062 * Close a DSO library. 00063 * @param handle handle to close. 00064 */ 00065 APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle); 00066 00067 /** 00068 * Load a symbol from a DSO handle. 00069 * @param ressym Location to store the loaded symbol 00070 * @param handle handle to load the symbol from. 00071 * @param symname Name of the symbol to load. 00072 */ 00073 APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, 00074 apr_dso_handle_t *handle, 00075 const char *symname); 00076 00077 /** 00078 * Report more information when a DSO function fails. 00079 * @param dso The dso handle that has been opened 00080 * @param buf Location to store the dso error 00081 * @param bufsize The size of the provided buffer 00082 */ 00083 APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buf, apr_size_t bufsize); 00084 00085 #endif /* APR_HAS_DSO */ 00086 00087 /** @} */ 00088 00089 #ifdef __cplusplus 00090 } 00091 #endif 00092 00093 #endif