apr_dso.h revision 251875
1251875Speter/* Licensed to the Apache Software Foundation (ASF) under one or more 2251875Speter * contributor license agreements. See the NOTICE file distributed with 3251875Speter * this work for additional information regarding copyright ownership. 4251875Speter * The ASF licenses this file to You under the Apache License, Version 2.0 5251875Speter * (the "License"); you may not use this file except in compliance with 6251875Speter * the License. You may obtain a copy of the License at 7251875Speter * 8251875Speter * http://www.apache.org/licenses/LICENSE-2.0 9251875Speter * 10251875Speter * Unless required by applicable law or agreed to in writing, software 11251875Speter * distributed under the License is distributed on an "AS IS" BASIS, 12251875Speter * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13251875Speter * See the License for the specific language governing permissions and 14251875Speter * limitations under the License. 15251875Speter */ 16251875Speter 17251875Speter#ifndef APR_DSO_DOT_H 18251875Speter#define APR_DSO_DOT_H 19251875Speter 20251875Speter/** 21251875Speter * @file apr_dso.h 22251875Speter * @brief APR Dynamic Object Handling Routines 23251875Speter */ 24251875Speter 25251875Speter#include "apr.h" 26251875Speter#include "apr_pools.h" 27251875Speter#include "apr_errno.h" 28251875Speter 29251875Speter#ifdef __cplusplus 30251875Speterextern "C" { 31251875Speter#endif 32251875Speter 33251875Speter/** 34251875Speter * @defgroup apr_dso Dynamic Object Handling 35251875Speter * @ingroup APR 36251875Speter * @{ 37251875Speter */ 38251875Speter 39251875Speter#if APR_HAS_DSO || defined(DOXYGEN) 40251875Speter 41251875Speter/** 42251875Speter * Structure for referencing dynamic objects 43251875Speter */ 44251875Spetertypedef struct apr_dso_handle_t apr_dso_handle_t; 45251875Speter 46251875Speter/** 47251875Speter * Structure for referencing symbols from dynamic objects 48251875Speter */ 49251875Spetertypedef void * apr_dso_handle_sym_t; 50251875Speter 51251875Speter/** 52251875Speter * Load a DSO library. 53251875Speter * @param res_handle Location to store new handle for the DSO. 54251875Speter * @param path Path to the DSO library 55251875Speter * @param ctx Pool to use. 56251875Speter * @bug We aught to provide an alternative to RTLD_GLOBAL, which 57251875Speter * is the only supported method of loading DSOs today. 58251875Speter */ 59251875SpeterAPR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, 60251875Speter const char *path, apr_pool_t *ctx); 61251875Speter 62251875Speter/** 63251875Speter * Close a DSO library. 64251875Speter * @param handle handle to close. 65251875Speter */ 66251875SpeterAPR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle); 67251875Speter 68251875Speter/** 69251875Speter * Load a symbol from a DSO handle. 70251875Speter * @param ressym Location to store the loaded symbol 71251875Speter * @param handle handle to load the symbol from. 72251875Speter * @param symname Name of the symbol to load. 73251875Speter */ 74251875SpeterAPR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, 75251875Speter apr_dso_handle_t *handle, 76251875Speter const char *symname); 77251875Speter 78251875Speter/** 79251875Speter * Report more information when a DSO function fails. 80251875Speter * @param dso The dso handle that has been opened 81251875Speter * @param buf Location to store the dso error 82251875Speter * @param bufsize The size of the provided buffer 83251875Speter */ 84251875SpeterAPR_DECLARE(const char *) apr_dso_error(apr_dso_handle_t *dso, char *buf, apr_size_t bufsize); 85251875Speter 86251875Speter#endif /* APR_HAS_DSO */ 87251875Speter 88251875Speter/** @} */ 89251875Speter 90251875Speter#ifdef __cplusplus 91251875Speter} 92251875Speter#endif 93251875Speter 94251875Speter#endif 95