apr_portable.h revision 251886
1232633Smp/* Licensed to the Apache Software Foundation (ASF) under one or more
259243Sobrien * contributor license agreements.  See the NOTICE file distributed with
359243Sobrien * this work for additional information regarding copyright ownership.
459243Sobrien * The ASF licenses this file to You under the Apache License, Version 2.0
559243Sobrien * (the "License"); you may not use this file except in compliance with
659243Sobrien * the License.  You may obtain a copy of the License at
759243Sobrien *
859243Sobrien *     http://www.apache.org/licenses/LICENSE-2.0
959243Sobrien *
1059243Sobrien * Unless required by applicable law or agreed to in writing, software
11167465Smp * distributed under the License is distributed on an "AS IS" BASIS,
12131962Smp * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1359243Sobrien * See the License for the specific language governing permissions and
1459243Sobrien * limitations under the License.
1559243Sobrien */
1659243Sobrien
1759243Sobrien/* This header file is where you should put ANY platform specific information.
1859243Sobrien * This should be the only header file that programs need to include that
1959243Sobrien * actually has platform dependent code which refers to the .
2059243Sobrien */
2159243Sobrien#ifndef APR_PORTABLE_H
2259243Sobrien#define APR_PORTABLE_H
2359243Sobrien/**
2459243Sobrien * @file apr_portable.h
2559243Sobrien * @brief APR Portability Routines
2659243Sobrien */
2759243Sobrien
2859243Sobrien#include "apr.h"
29232633Smp#include "apr_pools.h"
30232633Smp#include "apr_thread_proc.h"
3159243Sobrien#include "apr_file_io.h"
3259243Sobrien#include "apr_network_io.h"
33232633Smp#include "apr_errno.h"
34232633Smp#include "apr_global_mutex.h"
35232633Smp#include "apr_proc_mutex.h"
36232633Smp#include "apr_time.h"
37232633Smp#include "apr_dso.h"
38232633Smp#include "apr_shm.h"
39232633Smp
40232633Smp#if APR_HAVE_DIRENT_H
4159243Sobrien#include <dirent.h>
4259243Sobrien#endif
4359243Sobrien#if APR_HAVE_FCNTL_H
4459243Sobrien#include <fcntl.h>
4559243Sobrien#endif
46232633Smp#if APR_HAVE_PTHREAD_H
4759243Sobrien#include <pthread.h>
4859243Sobrien#endif
49232633Smp
5059243Sobrien#ifdef __cplusplus
5159243Sobrienextern "C" {
5259243Sobrien#endif /* __cplusplus */
5359243Sobrien
5459243Sobrien/**
5559243Sobrien * @defgroup apr_portabile Portability Routines
5659243Sobrien * @ingroup APR
5759243Sobrien * @{
5859243Sobrien */
5959243Sobrien
6059243Sobrien#ifdef WIN32
6159243Sobrien/* The primitives for Windows types */
6259243Sobrientypedef HANDLE                apr_os_file_t;
6359243Sobrientypedef HANDLE                apr_os_dir_t;
6459243Sobrientypedef SOCKET                apr_os_sock_t;
6559243Sobrientypedef HANDLE                apr_os_proc_mutex_t;
6659243Sobrientypedef HANDLE                apr_os_thread_t;
6759243Sobrientypedef HANDLE                apr_os_proc_t;
6859243Sobrientypedef DWORD                 apr_os_threadkey_t;
6959243Sobrientypedef FILETIME              apr_os_imp_time_t;
7059243Sobrientypedef SYSTEMTIME            apr_os_exp_time_t;
7159243Sobrientypedef HANDLE                apr_os_dso_handle_t;
7259243Sobrientypedef HANDLE                apr_os_shm_t;
7359243Sobrien
7459243Sobrien#elif defined(OS2)
75232633Smptypedef HFILE                 apr_os_file_t;
76232633Smptypedef HDIR                  apr_os_dir_t;
77232633Smptypedef int                   apr_os_sock_t;
78232633Smptypedef HMTX                  apr_os_proc_mutex_t;
7959243Sobrientypedef TID                   apr_os_thread_t;
8059243Sobrientypedef PID                   apr_os_proc_t;
8159243Sobrientypedef PULONG                apr_os_threadkey_t;
8259243Sobrientypedef struct timeval        apr_os_imp_time_t;
8359243Sobrientypedef struct tm             apr_os_exp_time_t;
8459243Sobrientypedef HMODULE               apr_os_dso_handle_t;
8559243Sobrientypedef void*                 apr_os_shm_t;
8659243Sobrien
87232633Smp#elif defined(__BEOS__)
88232633Smp#include <kernel/OS.h>
8959243Sobrien#include <kernel/image.h>
9059243Sobrien
9159243Sobrienstruct apr_os_proc_mutex_t {
9259243Sobrien	sem_id sem;
9359243Sobrien	int32  ben;
9459243Sobrien};
9559243Sobrien
9659243Sobrientypedef int                   apr_os_file_t;
9759243Sobrientypedef DIR                   apr_os_dir_t;
9859243Sobrientypedef int                   apr_os_sock_t;
9959243Sobrientypedef struct apr_os_proc_mutex_t  apr_os_proc_mutex_t;
10059243Sobrientypedef thread_id             apr_os_thread_t;
10159243Sobrientypedef thread_id             apr_os_proc_t;
10259243Sobrientypedef int                   apr_os_threadkey_t;
10359243Sobrientypedef struct timeval        apr_os_imp_time_t;
10459243Sobrientypedef struct tm             apr_os_exp_time_t;
10559243Sobrientypedef image_id              apr_os_dso_handle_t;
10659243Sobrientypedef void*                 apr_os_shm_t;
10759243Sobrien
10859243Sobrien#elif defined(NETWARE)
10959243Sobrientypedef int                   apr_os_file_t;
11059243Sobrientypedef DIR                   apr_os_dir_t;
11159243Sobrientypedef int                   apr_os_sock_t;
11259243Sobrientypedef NXMutex_t             apr_os_proc_mutex_t;
11359243Sobrientypedef NXThreadId_t          apr_os_thread_t;
11459243Sobrientypedef long                  apr_os_proc_t;
11559243Sobrientypedef NXKey_t               apr_os_threadkey_t;
11659243Sobrientypedef struct timeval        apr_os_imp_time_t;
11759243Sobrientypedef struct tm             apr_os_exp_time_t;
11859243Sobrientypedef void *                apr_os_dso_handle_t;
11959243Sobrientypedef void*                 apr_os_shm_t;
12059243Sobrien
121232633Smp#else
12259243Sobrien/* Any other OS should go above this one.  This is the lowest common
12359243Sobrien * denominator typedefs for  all UNIX-like systems.  :)
12459243Sobrien */
12559243Sobrien
12659243Sobrien/** Basic OS process mutex structure. */
12759243Sobrienstruct apr_os_proc_mutex_t {
128232633Smp#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE
12959243Sobrien    /** Value used for SYS V Semaphore, FCNTL and FLOCK serialization */
13059243Sobrien    int crossproc;
13159243Sobrien#endif
13259243Sobrien#if APR_HAS_PROC_PTHREAD_SERIALIZE
13359243Sobrien    /** Value used for PTHREAD serialization */
13459243Sobrien    pthread_mutex_t *pthread_interproc;
13559243Sobrien#endif
13659243Sobrien#if APR_HAS_THREADS
13759243Sobrien    /* If no threads, no need for thread locks */
13859243Sobrien#if APR_USE_PTHREAD_SERIALIZE
13959243Sobrien    /** This value is currently unused within APR and Apache */
14059243Sobrien    pthread_mutex_t *intraproc;
14159243Sobrien#endif
14259243Sobrien#endif
14359243Sobrien};
14459243Sobrien
14559243Sobrientypedef int                   apr_os_file_t;        /**< native file */
14659243Sobrientypedef DIR                   apr_os_dir_t;         /**< native dir */
147131962Smptypedef int                   apr_os_sock_t;        /**< native dir */
14859243Sobrientypedef struct apr_os_proc_mutex_t  apr_os_proc_mutex_t; /**< native process
14959243Sobrien                                                          *   mutex
15059243Sobrien                                                          */
15159243Sobrien#if APR_HAS_THREADS && APR_HAVE_PTHREAD_H
15259243Sobrientypedef pthread_t             apr_os_thread_t;      /**< native thread */
153232633Smptypedef pthread_key_t         apr_os_threadkey_t;   /**< native thread address
154232633Smp                                                     *   space */
155232633Smp#endif
156232633Smptypedef pid_t                 apr_os_proc_t;        /**< native pid */
157232633Smptypedef struct timeval        apr_os_imp_time_t;    /**< native timeval */
158232633Smptypedef struct tm             apr_os_exp_time_t;    /**< native tm */
159232633Smp/** @var apr_os_dso_handle_t
160232633Smp * native dso types
161232633Smp */
162232633Smp#if defined(HPUX) || defined(HPUX10) || defined(HPUX11)
163232633Smp#include <dl.h>
164232633Smptypedef shl_t                 apr_os_dso_handle_t;
165232633Smp#elif defined(DARWIN)
166232633Smp#include <mach-o/dyld.h>
167232633Smptypedef NSModule              apr_os_dso_handle_t;
168232633Smp#else
169232633Smptypedef void *                apr_os_dso_handle_t;
170232633Smp#endif
171232633Smptypedef void*                 apr_os_shm_t;         /**< native SHM */
17259243Sobrien
17359243Sobrien#endif
17459415Sobrien
17559415Sobrien/**
17659415Sobrien * @typedef apr_os_sock_info_t
17759415Sobrien * @brief alias for local OS socket
17859415Sobrien */
17959415Sobrien/**
18059415Sobrien * everything APR needs to know about an active socket to construct
18159243Sobrien * an APR socket from it; currently, this is platform-independent
18259243Sobrien */
183232633Smpstruct apr_os_sock_info_t {
184232633Smp    apr_os_sock_t *os_sock; /**< always required */
185232633Smp    struct sockaddr *local; /**< NULL if not yet bound */
186232633Smp    struct sockaddr *remote; /**< NULL if not connected */
187232633Smp    int family;             /**< always required (APR_INET, APR_INET6, etc.) */
188232633Smp    int type;               /**< always required (SOCK_STREAM, SOCK_DGRAM, etc.) */
189232633Smp    int protocol;           /**< 0 or actual protocol (APR_PROTO_SCTP, APR_PROTO_TCP, etc.) */
190232633Smp};
191232633Smp
192232633Smptypedef struct apr_os_sock_info_t apr_os_sock_info_t;
193232633Smp
194232633Smp#if APR_PROC_MUTEX_IS_GLOBAL || defined(DOXYGEN)
195232633Smp/** Opaque global mutex type */
196232633Smp#define apr_os_global_mutex_t apr_os_proc_mutex_t
197232633Smp/** @return apr_os_global_mutex */
198232633Smp#define apr_os_global_mutex_get apr_os_proc_mutex_get
199232633Smp#else
200232633Smp    /** Thread and process mutex for those platforms where process mutexes
201232633Smp     *  are not held in threads.
202232633Smp     */
203232633Smp    struct apr_os_global_mutex_t {
204232633Smp        apr_pool_t *pool;
205232633Smp        apr_proc_mutex_t *proc_mutex;
206232633Smp#if APR_HAS_THREADS
207232633Smp        apr_thread_mutex_t *thread_mutex;
208232633Smp#endif /* APR_HAS_THREADS */
209232633Smp    };
210232633Smp    typedef struct apr_os_global_mutex_t apr_os_global_mutex_t;
211232633Smp
212232633SmpAPR_DECLARE(apr_status_t) apr_os_global_mutex_get(apr_os_global_mutex_t *ospmutex,
213232633Smp                                                apr_global_mutex_t *pmutex);
214232633Smp#endif
215232633Smp
216232633Smp
217232633Smp/**
218232633Smp * convert the file from apr type to os specific type.
219232633Smp * @param thefile The os specific file we are converting to
220232633Smp * @param file The apr file to convert.
221232633Smp * @remark On Unix, it is only possible to get a file descriptor from
222232633Smp *         an apr file type.
223232633Smp */
224232633SmpAPR_DECLARE(apr_status_t) apr_os_file_get(apr_os_file_t *thefile,
225232633Smp                                          apr_file_t *file);
226232633Smp
227232633Smp/**
228232633Smp * convert the dir from apr type to os specific type.
229232633Smp * @param thedir The os specific dir we are converting to
230232633Smp * @param dir The apr dir to convert.
231232633Smp */
232232633SmpAPR_DECLARE(apr_status_t) apr_os_dir_get(apr_os_dir_t **thedir,
233232633Smp                                         apr_dir_t *dir);
234232633Smp
235232633Smp/**
236232633Smp * Convert the socket from an apr type to an OS specific socket
237232633Smp * @param thesock The socket to convert.
238232633Smp * @param sock The os specific equivalent of the apr socket..
239232633Smp */
240232633SmpAPR_DECLARE(apr_status_t) apr_os_sock_get(apr_os_sock_t *thesock,
241232633Smp                                          apr_socket_t *sock);
242232633Smp
243232633Smp/**
244232633Smp * Convert the proc mutex from os specific type to apr type
245232633Smp * @param ospmutex The os specific proc mutex we are converting to.
246232633Smp * @param pmutex The apr proc mutex to convert.
247232633Smp */
248232633SmpAPR_DECLARE(apr_status_t) apr_os_proc_mutex_get(apr_os_proc_mutex_t *ospmutex,
249232633Smp                                                apr_proc_mutex_t *pmutex);
250232633Smp
251232633Smp/**
252232633Smp * Get the exploded time in the platforms native format.
253232633Smp * @param ostime the native time format
254232633Smp * @param aprtime the time to convert
255232633Smp */
256232633SmpAPR_DECLARE(apr_status_t) apr_os_exp_time_get(apr_os_exp_time_t **ostime,
257232633Smp                                 apr_time_exp_t *aprtime);
258232633Smp
259232633Smp/**
260232633Smp * Get the imploded time in the platforms native format.
261232633Smp * @param ostime  the native time format
262232633Smp * @param aprtime the time to convert
263232633Smp */
264232633SmpAPR_DECLARE(apr_status_t) apr_os_imp_time_get(apr_os_imp_time_t **ostime,
265232633Smp                                              apr_time_t *aprtime);
266232633Smp
267232633Smp/**
268232633Smp * convert the shm from apr type to os specific type.
269232633Smp * @param osshm The os specific shm representation
270232633Smp * @param shm The apr shm to convert.
271232633Smp */
272232633SmpAPR_DECLARE(apr_status_t) apr_os_shm_get(apr_os_shm_t *osshm,
273232633Smp                                         apr_shm_t *shm);
274232633Smp
275232633Smp#if APR_HAS_THREADS || defined(DOXYGEN)
276232633Smp/**
27759243Sobrien * @defgroup apr_os_thread Thread portability Routines
27859243Sobrien * @{
27959243Sobrien */
28059243Sobrien/**
28159243Sobrien * convert the thread to os specific type from apr type.
28259243Sobrien * @param thethd The apr thread to convert
28359243Sobrien * @param thd The os specific thread we are converting to
28459243Sobrien */
28559243SobrienAPR_DECLARE(apr_status_t) apr_os_thread_get(apr_os_thread_t **thethd,
28659243Sobrien                                            apr_thread_t *thd);
28759243Sobrien
288232633Smp/**
289232633Smp * convert the thread private memory key to os specific type from an apr type.
290232633Smp * @param thekey The apr handle we are converting from.
291232633Smp * @param key The os specific handle we are converting to.
29259243Sobrien */
29359243SobrienAPR_DECLARE(apr_status_t) apr_os_threadkey_get(apr_os_threadkey_t *thekey,
29459243Sobrien                                               apr_threadkey_t *key);
29559243Sobrien
29659243Sobrien/**
29759243Sobrien * convert the thread from os specific type to apr type.
29859243Sobrien * @param thd The apr thread we are converting to.
299167465Smp * @param thethd The os specific thread to convert
30059243Sobrien * @param cont The pool to use if it is needed.
30159243Sobrien */
302167465SmpAPR_DECLARE(apr_status_t) apr_os_thread_put(apr_thread_t **thd,
30359243Sobrien                                            apr_os_thread_t *thethd,
30459243Sobrien                                            apr_pool_t *cont);
30559243Sobrien
30659243Sobrien/**
30759243Sobrien * convert the thread private memory key from os specific type to apr type.
30859243Sobrien * @param key The apr handle we are converting to.
30959243Sobrien * @param thekey The os specific handle to convert
31059243Sobrien * @param cont The pool to use if it is needed.
31159243Sobrien */
312232633SmpAPR_DECLARE(apr_status_t) apr_os_threadkey_put(apr_threadkey_t **key,
313232633Smp                                               apr_os_threadkey_t *thekey,
31459243Sobrien                                               apr_pool_t *cont);
31559243Sobrien/**
316232633Smp * Get the thread ID
317232633Smp */
318195609SmpAPR_DECLARE(apr_os_thread_t) apr_os_thread_current(void);
319232633Smp
320232633Smp/**
321232633Smp * Compare two thread id's
322232633Smp * @param tid1 1st Thread ID to compare
323232633Smp * @param tid2 2nd Thread ID to compare
324232633Smp * @return non-zero if the two threads are equal, zero otherwise
32559243Sobrien */
32659243SobrienAPR_DECLARE(int) apr_os_thread_equal(apr_os_thread_t tid1,
32759243Sobrien                                     apr_os_thread_t tid2);
32859243Sobrien
32959243Sobrien/** @} */
330232633Smp#endif /* APR_HAS_THREADS */
331232633Smp
332232633Smp/**
333232633Smp * convert the file from os specific type to apr type.
334232633Smp * @param file The apr file we are converting to.
335232633Smp * @param thefile The os specific file to convert
336232633Smp * @param flags The flags that were used to open this file.
337232633Smp * @param cont The pool to use if it is needed.
338232633Smp * @remark On Unix, it is only possible to put a file descriptor into
339232633Smp *         an apr file type.
340232633Smp */
341232633SmpAPR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file,
34259243Sobrien                                          apr_os_file_t *thefile,
343232633Smp                                          apr_int32_t flags, apr_pool_t *cont);
34459243Sobrien
34559243Sobrien/**
34659243Sobrien * convert the file from os specific type to apr type.
34759243Sobrien * @param file The apr file we are converting to.
34859243Sobrien * @param thefile The os specific pipe to convert
34959243Sobrien * @param cont The pool to use if it is needed.
35059243Sobrien * @remark On Unix, it is only possible to put a file descriptor into
35159243Sobrien *         an apr file type.
352232633Smp */
353232633SmpAPR_DECLARE(apr_status_t) apr_os_pipe_put(apr_file_t **file,
354232633Smp                                          apr_os_file_t *thefile,
355232633Smp                                          apr_pool_t *cont);
35659243Sobrien
35759243Sobrien/**
35859243Sobrien * convert the file from os specific type to apr type.
35959243Sobrien * @param file The apr file we are converting to.
360195609Smp * @param thefile The os specific pipe to convert
36159243Sobrien * @param register_cleanup A cleanup will be registered on the apr_file_t
36259243Sobrien *   to issue apr_file_close().
36359243Sobrien * @param cont The pool to use if it is needed.
364232633Smp * @remark On Unix, it is only possible to put a file descriptor into
365232633Smp *         an apr file type.
366232633Smp */
367232633SmpAPR_DECLARE(apr_status_t) apr_os_pipe_put_ex(apr_file_t **file,
368232633Smp                                             apr_os_file_t *thefile,
369232633Smp                                             int register_cleanup,
370131962Smp                                             apr_pool_t *cont);
37159243Sobrien
37259243Sobrien/**
373232633Smp * convert the dir from os specific type to apr type.
374232633Smp * @param dir The apr dir we are converting to.
37559243Sobrien * @param thedir The os specific dir to convert
37659243Sobrien * @param cont The pool to use when creating to apr directory.
37759243Sobrien */
37859243SobrienAPR_DECLARE(apr_status_t) apr_os_dir_put(apr_dir_t **dir,
37959243Sobrien                                         apr_os_dir_t *thedir,
38059243Sobrien                                         apr_pool_t *cont);
38159243Sobrien
38259243Sobrien/**
38359243Sobrien * Convert a socket from the os specific type to the apr type
384100616Smp * @param sock The pool to use.
385100616Smp * @param thesock The socket to convert to.
386100616Smp * @param cont The socket we are converting to an apr type.
387100616Smp * @remark If it is a true socket, it is best to call apr_os_sock_make()
388100616Smp *         and provide APR with more information about the socket.
38959243Sobrien */
39059243SobrienAPR_DECLARE(apr_status_t) apr_os_sock_put(apr_socket_t **sock,
39159243Sobrien                                          apr_os_sock_t *thesock,
39259243Sobrien                                          apr_pool_t *cont);
39359243Sobrien
39459243Sobrien/**
39559243Sobrien * Create a socket from an existing descriptor and local and remote
39659243Sobrien * socket addresses.
39759243Sobrien * @param apr_sock The new socket that has been set up
39859243Sobrien * @param os_sock_info The os representation of the socket handle and
39959243Sobrien *        other characteristics of the socket
40059243Sobrien * @param cont The pool to use
401145479Smp * @remark If you only know the descriptor/handle or if it isn't really
40259243Sobrien *         a true socket, use apr_os_sock_put() instead.
40359243Sobrien */
40459243SobrienAPR_DECLARE(apr_status_t) apr_os_sock_make(apr_socket_t **apr_sock,
405145479Smp                                           apr_os_sock_info_t *os_sock_info,
40659243Sobrien                                           apr_pool_t *cont);
40759243Sobrien
40859243Sobrien/**
40959243Sobrien * Convert the proc mutex from os specific type to apr type
41059243Sobrien * @param pmutex The apr proc mutex we are converting to.
41159243Sobrien * @param ospmutex The os specific proc mutex to convert.
41259243Sobrien * @param cont The pool to use if it is needed.
41359243Sobrien */
414167465SmpAPR_DECLARE(apr_status_t) apr_os_proc_mutex_put(apr_proc_mutex_t **pmutex,
415167465Smp                                                apr_os_proc_mutex_t *ospmutex,
416167465Smp                                                apr_pool_t *cont);
417232633Smp
418232633Smp/**
419232633Smp * Put the imploded time in the APR format.
42059243Sobrien * @param aprtime the APR time format
42159243Sobrien * @param ostime the time to convert
42259243Sobrien * @param cont the pool to use if necessary
42359243Sobrien */
42459243SobrienAPR_DECLARE(apr_status_t) apr_os_imp_time_put(apr_time_t *aprtime,
42559243Sobrien                                              apr_os_imp_time_t **ostime,
426167465Smp                                              apr_pool_t *cont);
42759243Sobrien
42859243Sobrien/**
42959243Sobrien * Put the exploded time in the APR format.
43059243Sobrien * @param aprtime the APR time format
43159243Sobrien * @param ostime the time to convert
432232633Smp * @param cont the pool to use if necessary
43359243Sobrien */
434131962SmpAPR_DECLARE(apr_status_t) apr_os_exp_time_put(apr_time_exp_t *aprtime,
435131962Smp                                              apr_os_exp_time_t **ostime,
436131962Smp                                              apr_pool_t *cont);
43759243Sobrien
43859415Sobrien/**
43959415Sobrien * convert the shared memory from os specific type to apr type.
44059415Sobrien * @param shm The apr shm representation of osshm
44159415Sobrien * @param osshm The os specific shm identity
44259243Sobrien * @param cont The pool to use if it is needed.
44359243Sobrien * @remark On fork()ed architectures, this is typically nothing more than
444131962Smp * the memory block mapped.  On non-fork architectures, this is typically
445131962Smp * some internal handle to pass the mapping from process to process.
44659243Sobrien */
447131962SmpAPR_DECLARE(apr_status_t) apr_os_shm_put(apr_shm_t **shm,
448131962Smp                                         apr_os_shm_t *osshm,
44959243Sobrien                                         apr_pool_t *cont);
45059243Sobrien
45159243Sobrien
452232633Smp#if APR_HAS_DSO || defined(DOXYGEN)
45359243Sobrien/**
45459243Sobrien * @defgroup apr_os_dso DSO (Dynamic Loading) Portability Routines
455167465Smp * @{
456167465Smp */
457167465Smp/**
458167465Smp * convert the dso handle from os specific to apr
45959243Sobrien * @param dso The apr handle we are converting to
46059243Sobrien * @param thedso the os specific handle to convert
46159243Sobrien * @param pool the pool to use if it is needed
46259243Sobrien */
46359243SobrienAPR_DECLARE(apr_status_t) apr_os_dso_handle_put(apr_dso_handle_t **dso,
46459243Sobrien                                                apr_os_dso_handle_t thedso,
46559243Sobrien                                                apr_pool_t *pool);
46659243Sobrien
467167465Smp/**
468167465Smp * convert the apr dso handle into an os specific one
469167465Smp * @param aprdso The apr dso handle to convert
470167465Smp * @param dso The os specific dso to return
471167465Smp */
472167465SmpAPR_DECLARE(apr_status_t) apr_os_dso_handle_get(apr_os_dso_handle_t *dso,
473167465Smp                                                apr_dso_handle_t *aprdso);
474167465Smp
47559243Sobrien/** @} */
47659243Sobrien#endif /* APR_HAS_DSO */
47759243Sobrien
47859243Sobrien
47959243Sobrien#if APR_HAS_OS_UUID
48059243Sobrien/**
48159243Sobrien * Private: apr-util's apr_uuid module when supported by the platform
48259243Sobrien */
48359243SobrienAPR_DECLARE(apr_status_t) apr_os_uuid_get(unsigned char *uuid_data);
48459243Sobrien#endif
48559243Sobrien
48659243Sobrien
48759243Sobrien/**
48859243Sobrien * Get the name of the system default character set.
48959243Sobrien * @param pool the pool to allocate the name from, if needed
49059243Sobrien */
49159243SobrienAPR_DECLARE(const char*) apr_os_default_encoding(apr_pool_t *pool);
49259243Sobrien
49359243Sobrien
49459243Sobrien/**
49559243Sobrien * Get the name of the current locale character set.
49659243Sobrien * @param pool the pool to allocate the name from, if needed
49759243Sobrien * @remark Defers to apr_os_default_encoding if the current locale's
49859243Sobrien * data can't be retrieved on this system.
49959243Sobrien */
50059243SobrienAPR_DECLARE(const char*) apr_os_locale_encoding(apr_pool_t *pool);
50159243Sobrien
50259243Sobrien/** @} */
50359243Sobrien
50459243Sobrien#ifdef __cplusplus
50559243Sobrien}
50659243Sobrien#endif
50759243Sobrien
50859243Sobrien#endif  /* ! APR_PORTABLE_H */
50959243Sobrien