summaryrefslogtreecommitdiff
path: root/include/apr.h.in
blob: 98a9f6b420e7cfe474ff57030033f16fb5c3d676 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#ifndef APR_H
#define APR_H

/* So that we can use inline on some critical functions, and use
 * GNUC attributes (such as to get -Wall warnings for printf-like
 * functions).  Only do this in gcc 2.7 or later ... it may work
 * on earlier stuff, but why chance it.
 *
 * We've since discovered that the gcc shipped with NeXT systems
 * as "cc" is completely broken.  It claims to be __GNUC__ and so
 * on, but it doesn't implement half of the things that __GNUC__
 * means.  In particular it's missing inline and the __attribute__
 * stuff.  So we hack around it.  PR#1613. -djg
 */
#if !defined(__GNUC__) || __GNUC__ < 2 || \
    (__GNUC__ == 2 && __GNUC_MINOR__ < 7) ||\
    defined(NEXT)
#define ap_inline
#define __attribute__(__x)
#define ENUM_BITFIELD(e,n,w)  signed int n : w
#else
#define ap_inline __inline__
#define USE_GNU_INLINE
#define ENUM_BITFIELD(e,n,w)  e n : w
#endif

#define APR_HAVE_ERRNO_H        @errnoh@
#define APR_HAVE_DIRENT_H       @direnth@
#define APR_HAVE_FCNTL_H        @fcntlh@
#define APR_HAVE_NETINET_IN_H   @netinet_inh@
#define APR_HAVE_PTHREAD_H      @pthreadh@
#define APR_HAVE_STDARG_H       @stdargh@
#define APR_HAVE_STDIO_H        @stdioh@
#define APR_HAVE_SYS_TYPES_H    @sys_typesh@
#define APR_HAVE_SYS_UIO_H      @sys_uioh@
#define APR_HAVE_SIGNAL_H       @signalh@
#define APR_HAVE_SYS_WAIT_H     @sys_waith@

#define APR_USE_FLOCK_SERIALIZE           @flockser@ 
#define APR_USE_SYSVSEM_SERIALIZE         @sysvser@
#define APR_USE_FCNTL_SERIALIZE           @fcntlser@
#define APR_USE_PROC_PTHREAD_SERIALIZE    @procpthreadser@ 
#define APR_USE_PTHREAD_SERIALIZE         @pthreadser@ 

#define APR_USES_ANONYMOUS_SHM            @anonymous_shm@
#define APR_USES_FILEBASED_SHM            @filebased_shm@
#define APR_USES_KEYBASED_SHM             @keybased_shm@


#define APR_HAVE_IN_ADDR        @have_in_addr@
#define APR_HAVE_INET_ADDR      @inet_addr@
#define APR_HAVE_INET_NETWORK   @inet_network@
#define APR_HAVE_UNION_SEMUN    @have_union_semun@

#if APR_HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif

/*  APR Feature Macros */
#define APR_HAS_SHARED_MEMORY     @sharedmem@
#define APR_HAS_THREADS           @threads@
#define APR_HAS_SENDFILE          @sendfile@
#define APR_HAS_MMAP              @mmap@
#define APR_HAS_FORK              @fork@
#define APR_HAS_RANDOM            @rand@
#define APR_HAS_XLATE             @iconv@
#define APR_HAS_OTHER_CHILD       @oc@

/* This macro tells APR that it is safe to make a file masquerade as a 
 * socket.  This is necessary, because some platforms support poll'ing
 * on pipes/files, while some don't.  APR only supports poll'ing on 
 * sockets to handle this inconsistensy.  However, it is often useful to
 * be able to poll on files/pipes on platforms that support it.  This
 * feature macro allows us to find those platforms and support the feature
 * where available.
 */
#define APR_FILES_AS_SOCKETS      @file_as_socket@

/* Typedefs that APR needs. */

typedef  @short_value@           ap_int16_t;
typedef  unsigned @short_value@  ap_uint16_t;
                                               
typedef  @int_value@             ap_int32_t;
typedef  unsigned @int_value@    ap_uint32_t;
                                               
typedef  @long_value@            ap_int64_t;
typedef  unsigned @long_value@   ap_uint64_t;

typedef  @size_t_value@          ap_size_t;
typedef  @ssize_t_value@         ap_ssize_t;
typedef  @off_t_value@           ap_off_t;

/* Definitions that APR programs need to work properly. */

#define APR_THREAD_FUNC
#define APR_EXPORT(type)         type
#define APR_EXPORT_NONSTD(type)  type
#define APR_IMPORT_VAR           extern
#define APR_EXPORT_VAR

/* Define APR_SSIZE_T_FMT.  
 * If ssize_t is an integer we define it to be "d",
 * if ssize_t is a long int we define it to be "ld",
 * if ssize_t is neither we declare an error here.
 * I looked for a better way to define this here, but couldn't find one, so
 * to find the logic for this definition search for "ssize_t_fmt" in
 * configure.in.
 */
@ssize_t_fmt@

/* And APR_OFF_T_FMT */
@off_t_fmt@

/* Define ap_signal and related necessary definitions.
 */
/* We are checking for HAVE_SIGACTION, but autoconf is filling this in 
 * for us automatically.
 */
#if @have_sigaction@ && !defined(NO_USE_SIGACTION)
typedef void Sigfunc(int);
Sigfunc *ap_signal(int signo, Sigfunc * func);

#if defined(SIG_ING) && !defined(SIG_ERR)
#define SIG_ERR ((Sigfunc *)-1)
#endif
#else
#define ap_signal(a,b) signal(a,b)
#endif

#ifdef APR_HAVE_SYS_WAIT_H

/* We have a POSIX wait interface */
#include <sys/wait.h>

#ifdef WEXITSTATUS
#define ap_wait_t       int
#else
/* We don't have a POSIX wait interface. Assume we have the old-style. Is this
 * a bad assumption? */
/* Yessiree bob, it was... but will this work instead? */
#define ap_wait_t       union wait
#define WEXITSTATUS(status)    (int)((status).w_retcode)
#define WTERMSIG(status)       (int)((status).w_termsig)
#endif /* !WEXITSTATUS */
#endif /* HAVE_SYS_WAIT_H */

#endif /* APR_H */