Apache HTTPD
apr_portable.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/* This header file is where you should put ANY platform specific information.
18 * This should be the only header file that programs need to include that
19 * actually has platform dependent code which refers to the .
20 */
21#ifndef APR_PORTABLE_H
22#define APR_PORTABLE_H
28#include "apr.h"
29#include "apr_pools.h"
30#include "apr_thread_proc.h"
31#include "apr_file_io.h"
32#include "apr_network_io.h"
33#include "apr_errno.h"
34#include "apr_global_mutex.h"
35#include "apr_proc_mutex.h"
36#include "apr_time.h"
37#include "apr_dso.h"
38#include "apr_shm.h"
39
40#if APR_HAVE_DIRENT_H
41#include <dirent.h>
42#endif
43#if APR_HAVE_FCNTL_H
44#include <fcntl.h>
45#endif
46#if APR_HAVE_PTHREAD_H
47#include <pthread.h>
48#endif
49#if APR_HAVE_SEMAPHORE_H
50#include <semaphore.h>
51#endif
52
53#ifdef __cplusplus
54extern "C" {
55#endif /* __cplusplus */
56
63#ifdef WIN32
64/* The primitives for Windows types */
65typedef HANDLE apr_os_file_t;
66typedef HANDLE apr_os_dir_t;
67typedef SOCKET apr_os_sock_t;
70typedef HANDLE apr_os_proc_t;
75typedef HANDLE apr_os_shm_t;
76
77#elif defined(OS2)
78typedef HFILE apr_os_file_t;
79typedef HDIR apr_os_dir_t;
80typedef int apr_os_sock_t;
82typedef TID apr_os_thread_t;
83typedef PID apr_os_proc_t;
85typedef struct timeval apr_os_imp_time_t;
86typedef struct tm apr_os_exp_time_t;
88typedef void* apr_os_shm_t;
89
90#elif defined(__BEOS__)
91#include <kernel/OS.h>
92#include <kernel/image.h>
93
95 sem_id sem;
96 int32 ben;
97};
98
99typedef int apr_os_file_t;
100typedef DIR apr_os_dir_t;
101typedef int apr_os_sock_t;
105typedef int apr_os_threadkey_t;
106typedef struct timeval apr_os_imp_time_t;
107typedef struct tm apr_os_exp_time_t;
109typedef void* apr_os_shm_t;
110
111#elif defined(NETWARE)
112typedef int apr_os_file_t;
113typedef DIR apr_os_dir_t;
114typedef int apr_os_sock_t;
117typedef long apr_os_proc_t;
119typedef struct timeval apr_os_imp_time_t;
120typedef struct tm apr_os_exp_time_t;
121typedef void * apr_os_dso_handle_t;
122typedef void* apr_os_shm_t;
123
124#else
125/* Any other OS should go above this one. This is the lowest common
126 * denominator typedefs for all UNIX-like systems. :)
127 */
128
131#if APR_HAS_SYSVSEM_SERIALIZE || APR_HAS_FCNTL_SERIALIZE || APR_HAS_FLOCK_SERIALIZE
133 int crossproc;
134#endif
135#if APR_HAS_PROC_PTHREAD_SERIALIZE
138#endif
139#if APR_HAS_THREADS
140 /* If no threads, no need for thread locks */
141#if APR_USE_PTHREAD_SERIALIZE
144#endif
145#endif
146#if APR_HAS_POSIXSEM_SERIALIZE
149#endif
150};
151
152typedef int apr_os_file_t;
154typedef int apr_os_sock_t;
158#if APR_HAS_THREADS && APR_HAVE_PTHREAD_H
162#endif
165typedef struct tm apr_os_exp_time_t;
169#if defined(HPUX) || defined(HPUX10) || defined(HPUX11)
170#include <dl.h>
172#elif defined(DARWIN)
173#include <mach-o/dyld.h>
175#else
176typedef void * apr_os_dso_handle_t;
177#endif
178typedef void* apr_os_shm_t;
180#endif
181
198
200
201#if APR_PROC_MUTEX_IS_GLOBAL || defined(DOXYGEN)
203#define apr_os_global_mutex_t apr_os_proc_mutex_t
205#define apr_os_global_mutex_get apr_os_proc_mutex_get
206#else
213#if APR_HAS_THREADS
215#endif /* APR_HAS_THREADS */
216 };
218
221#endif
222
223
233
241
249
257
270
278
286
294
295#if APR_HAS_THREADS || defined(DOXYGEN)
307
315
325
339
348
350#endif /* APR_HAS_THREADS */
351
364
376
391
400 apr_pool_t *cont);
401
416
430
439 apr_pool_t *cont);
440
457 apr_pool_t *cont);
458
467 apr_pool_t *cont);
468
477 apr_pool_t *cont);
478
490 apr_pool_t *cont);
491
492
493#if APR_HAS_DSO || defined(DOXYGEN)
507
515
517#endif /* APR_HAS_DSO */
518
519
520#if APR_HAS_OS_UUID
525#endif
526
527
533
534
542
545#ifdef __cplusplus
546}
547#endif
548
549#endif /* ! APR_PORTABLE_H */
APR Dynamic Object Handling Routines.
APR Error Codes.
APR File I/O Handling.
APR Global Locking Routines.
APR Network library.
APR memory allocation.
APR Process Locking Routines.
APR Shared Memory Routines.
APR Thread and Process Library.
APR Time Library.
int apr_os_thread_equal(apr_os_thread_t tid1, apr_os_thread_t tid2)
Definition thread.c:117
const void apr_status_t(*) apr_status_t(* APR_DECLARE)(void) apr_pool_pre_cleanup_register(apr_pool_t *p
Definition apr_pools.h:646
apr_size_t size
const char int apr_pool_t * pool
Definition apr_cstr.h:84
int apr_status_t
Definition apr_errno.h:44
const char * key
apr_sockaddr_t * sockaddr
struct tm apr_os_exp_time_t
apr_os_proc_mutex_t * ospmutex
apr_proc_mutex_t apr_lockmech_e * mech
int apr_os_sock_t
pid_t apr_os_proc_t
apr_os_file_t apr_int32_t apr_pool_t * cont
apr_file_t * file
void * apr_os_dso_handle_t
apr_os_dir_t * thedir
struct timeval apr_os_imp_time_t
apr_os_sock_t * thesock
apr_os_file_t * thefile
void * apr_os_shm_t
apr_socket_t * sock
int apr_os_file_t
apr_os_file_t int register_cleanup
apr_os_sock_info_t * os_sock_info
apr_os_shm_t * osshm
apr_time_exp_t * aprtime
DIR apr_os_dir_t
apr_os_imp_time_t ** ostime
apr_os_file_t apr_int32_t flags
apr_global_mutex_t * pmutex
apr_shm_t * shm
apr_dir_t * dir
apr_lockmech_e
apr_size_t apr_size_t const char apr_time_exp_t * tm
Definition apr_time.h:221
apr_int64_t apr_time_t
Definition apr_time.h:45
apr_os_thread_t apr_os_thread_current()
Definition thread.c:142
apr_status_t apr_os_threadkey_get(apr_os_threadkey_t *thekey, apr_threadkey_t *key)
Definition threadpriv.c:82
apr_status_t apr_os_threadkey_put(apr_threadkey_t **key, apr_os_threadkey_t *thekey, apr_pool_t *pool)
Definition threadpriv.c:89
apr_proc_mutex_t * proc_mutex
apr_os_sock_t * os_sock
struct sockaddr * remote
struct sockaddr * local
apr_status_t apr_os_dir_get(apr_os_dir_t **thedir, apr_dir_t *dir)
Definition dir.c:353
apr_status_t apr_os_dir_put(apr_dir_t **dir, apr_os_dir_t *thedir, apr_pool_t *pool)
Definition dir.c:362
apr_status_t apr_os_sock_get(apr_os_sock_t *thesock, apr_socket_t *sock)
Definition sockets.c:506
apr_status_t apr_os_sock_make(apr_socket_t **apr_sock, apr_os_sock_info_t *os_sock_info, apr_pool_t *cont)
Definition sockets.c:512
apr_status_t apr_os_sock_put(apr_socket_t **sock, apr_os_sock_t *thesock, apr_pool_t *cont)
Definition sockets.c:550
typedef HANDLE(WINAPI *apr_winapi_fpt_CreateToolhelp32Snapshot)(DWORD dwFlags
typedef DWORD(WINAPI *apr_winapi_fpt_GetCompressedFileSizeA)(IN LPCSTR lpFileName