apr_dso.h revision 303975
1/* Licensed to the Apache Software Foundation (ASF) under one or more 2 * contributor license agreements. See the NOTICE file distributed with 3 * this work for additional information regarding copyright ownership. 4 * The ASF licenses this file to You under the Apache License, Version 2.0 5 * (the "License"); you may not use this file except in compliance with 6 * the License. You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17#ifndef APR_DSO_DOT_H 18#define APR_DSO_DOT_H 19 20/** 21 * @file apr_dso.h 22 * @brief APR Dynamic Object Handling Routines 23 */ 24 25#include "apr.h" 26#include "apr_pools.h" 27#include "apr_errno.h" 28 29#ifdef __cplusplus 30extern "C" { 31#endif 32 33/** 34 * @defgroup apr_dso Dynamic Object Handling 35 * @ingroup APR 36 * @{ 37 */ 38 39#if APR_HAS_DSO || defined(DOXYGEN) 40 41/** 42 * Structure for referencing dynamic objects 43 */ 44typedef struct apr_dso_handle_t apr_dso_handle_t; 45 46/** 47 * Structure for referencing symbols from dynamic objects 48 */ 49typedef void * apr_dso_handle_sym_t; 50 51/** 52 * Load a DSO library. 53 * @param res_handle Location to store new handle for the DSO. 54 * @param path Path to the DSO library 55 * @param ctx Pool to use. 56 * @bug We aught to provide an alternative to RTLD_GLOBAL, which 57 * is the only supported method of loading DSOs today. 58 */ 59APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, 60 const char *path, apr_pool_t *ctx); 61 62/** 63 * Close a DSO library. 64 * @param handle handle to close. 65 */ 66APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle); 67 68/** 69 * Load a symbol from a DSO handle. 70 * @param ressym Location to store the loaded symbol 71 * @param handle handle to load the symbol from. 72 * @param symname Name of the symbol to load. 73 */ 74APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, 75 apr_dso_handle_t *handle, 76 const char *symname); 77 78/** 79 * Report more information when a DSO function fails. 80 * @param dso The dso handle that has been opened 81 * @param buf Location to store the dso error 82 * @param bufsize The size of the provided buffer 83 */ 84APR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buf, apr_size_t bufsize); 85 86#endif /* APR_HAS_DSO */ 87 88/** @} */ 89 90#ifdef __cplusplus 91} 92#endif 93 94#endif 95