Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
apreq.h
Go to the documentation of this file.
1 /*
2 ** Licensed to the Apache Software Foundation (ASF) under one or more
3 ** contributor license agreements. See the NOTICE file distributed with
4 ** this work for additional information regarding copyright ownership.
5 ** The ASF licenses this file to You under the Apache License, Version 2.0
6 ** (the "License"); you may not use this file except in compliance with
7 ** the License. You may obtain a copy of the License at
8 **
9 ** http://www.apache.org/licenses/LICENSE-2.0
10 **
11 ** Unless required by applicable law or agreed to in writing, software
12 ** distributed under the License is distributed on an "AS IS" BASIS,
13 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 ** See the License for the specific language governing permissions and
15 ** limitations under the License.
16 */
17 
18 #ifndef APREQ_H
19 #define APREQ_H
20 
21 #ifdef APREQ_DEBUG
22 #include <assert.h>
23 #endif
24 
25 #include "ap_config.h"
26 #include "apr_tables.h"
27 #include <stddef.h>
28 
29 #ifdef __cplusplus
30  extern "C" {
31 #endif
32 
45 #define APREQ_DEFAULT_READ_BLOCK_SIZE (64 * 1024)
46 
53 #define APREQ_DEFAULT_READ_LIMIT (64 * 1024 * 1024)
54 
60 #define APREQ_DEFAULT_BRIGADE_LIMIT (256 * 1024)
61 
66 #define APREQ_DEFAULT_NELTS 8
67 
68 
69 
73 #define APREQ_FLAGS_OFF(f, name) ((f) &= ~(name##_MASK << name##_BIT))
74 
77 #define APREQ_FLAGS_ON(f, name) ((f) |= (name##_MASK << name##_BIT))
78 
81 #define APREQ_FLAGS_GET(f, name) (((f) >> name##_BIT) & name##_MASK)
82 
88 #define APREQ_FLAGS_SET(f, name, value) \
89  ((f) = (((f) & ~(name##_MASK << name##_BIT)) \
90  | ((name##_MASK & (value)) << name##_BIT)))
91 
97 #define APREQ_CHARSET_BIT 0
98 
104 #define APREQ_CHARSET_MASK 255
105 
111 #define APREQ_TAINTED_BIT 8
112 
117 #define APREQ_TAINTED_MASK 1
118 
125 #define APREQ_COOKIE_VERSION_BIT 11
126 
131 #define APREQ_COOKIE_VERSION_MASK 3
132 
138 #define APREQ_COOKIE_SECURE_BIT 13
139 
144 #define APREQ_COOKIE_SECURE_MASK 1
145 
151 #define APREQ_COOKIE_HTTPONLY_BIT 14
152 
157 #define APREQ_COOKIE_HTTPONLY_MASK 1
158 
160 typedef enum {
162  APREQ_CHARSET_LATIN1 =1, /* ISO-8859-1 */
163  APREQ_CHARSET_CP1252 =2, /* Windows-1252 */
166 
167 
169 typedef enum {
174 } apreq_join_t;
175 
177 typedef enum {
180 } apreq_match_t;
181 
183 typedef enum {
187 
188 
190 typedef struct apreq_value_t {
191  char *name;
194  char data[1];
195 } apreq_value_t;
196 
208 static APR_INLINE
209 void apreq_value_table_add(const apreq_value_t *v, apr_table_t *t) {
210  apr_table_addn(t, v->name, v->data);
211 }
212 
220 #define apreq_attr_to_type(T,A,P) ( (T*) ((char*)(P)-offsetof(T,A)) )
221 
234 
235 
248 
257 
258 
259 #ifdef __cplusplus
260  }
261 #endif
262 
263 #endif /* APREQ_H */
size_t apr_size_t
Definition: apr.h:375
Definition: apreq.h:178
Definition: apreq.h:171
apr_bucket_brigade request_rec apr_pool_t * pool
Definition: mod_dav.h:552
Definition: apreq.h:172
#define APREQ_DECLARE(x)
Definition: macros.h:12
apreq_charset_t
Definition: apreq.h:160
char data[1]
Definition: apreq.h:194
Definition: apreq.h:185
struct apreq_value_t apreq_value_t
libapreq's pre-extensible string type
Symbol export macros and hook functions.
Definition: apreq.h:161
char * name
Definition: apreq.h:191
apreq_match_t
Definition: apreq.h:177
apr_size_t dlen
Definition: apreq.h:193
apreq_expires_t
Definition: apreq.h:183
APR Table library.
Definition: apreq.h:179
Definition: apreq.h:184
apr_size_t nlen
Definition: apreq.h:192
libapreq's pre-extensible string type
Definition: apreq.h:190
apr_status_t apreq_initialize(apr_pool_t *pool)
Definition: apreq.h:170
#define APR_INLINE
Definition: apr.h:65
Definition: apreq.h:162
apreq_join_t
Definition: apreq.h:169
struct apr_table_t apr_table_t
Definition: apr_tables.h:56
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
void apr_table_addn(apr_table_t *t, const char *key, const char *val)
Definition: apreq.h:164
int apr_status_t
Definition: apr_errno.h:44
Definition: apreq.h:163
apr_status_t apreq_pre_initialize(apr_pool_t *pool)
Definition: apreq.h:173
apr_status_t apreq_post_initialize(apr_pool_t *pool)