Apache Portable Runtime
apr_dso.h
Go to the documentation of this file.
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
30 extern "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  */
45 
46 /**
47  * Structure for referencing symbols from dynamic objects
48  */
49 typedef 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  */
60  const char *path, apr_pool_t *ctx);
61 
62 /**
63  * Close a DSO library.
64  * @param handle handle to close.
65  */
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  */
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  */
84 APR_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
apr_status_t apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx)
const char * apr_dso_error(apr_dso_handle_t *dso, char *buf, apr_size_t bufsize)
struct apr_dso_handle_t apr_dso_handle_t
Definition: apr_dso.h:44
apr_status_t apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_handle_t *handle, const char *symname)
#define APR_DECLARE(type)
Definition: apr.h:498
APR memory allocation.
apr_status_t apr_dso_unload(apr_dso_handle_t *handle)
APR Error Codes.
APR Platform Definitions.
void * apr_dso_handle_sym_t
Definition: apr_dso.h:49
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
int apr_status_t
Definition: apr_errno.h:44