Apache2
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)
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))
77 #define APREQ_FLAGS_ON(f, name) ((f) |= (name##_MASK << name##_BIT))
81 #define APREQ_FLAGS_GET(f, name) (((f) >> name##_BIT) & name##_MASK)
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
117 #define APREQ_TAINTED_MASK 1
118 
125 #define APREQ_COOKIE_VERSION_BIT 11
131 #define APREQ_COOKIE_VERSION_MASK 3
132 
138 #define APREQ_COOKIE_SECURE_BIT 13
144 #define APREQ_COOKIE_SECURE_MASK 1
145 
151 #define APREQ_COOKIE_HTTPONLY_BIT 14
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 {
175 
177 typedef enum {
181 
183 typedef enum {
187 
188 
190 typedef struct apreq_value_t {
191  char *name;
194  char data[1];
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 */
Symbol export macros and hook functions.
APR Table library.
apr_status_t apreq_initialize(apr_pool_t *pool)
apreq_match_t
Definition: apreq.h:177
@ APREQ_MATCH_PARTIAL
Definition: apreq.h:179
@ APREQ_MATCH_FULL
Definition: apreq.h:178
apreq_charset_t
Definition: apreq.h:160
@ APREQ_CHARSET_LATIN1
Definition: apreq.h:162
@ APREQ_CHARSET_UTF8
Definition: apreq.h:164
@ APREQ_CHARSET_CP1252
Definition: apreq.h:163
@ APREQ_CHARSET_ASCII
Definition: apreq.h:161
apreq_join_t
Definition: apreq.h:169
@ APREQ_JOIN_ENCODE
Definition: apreq.h:171
@ APREQ_JOIN_AS_IS
Definition: apreq.h:170
@ APREQ_JOIN_DECODE
Definition: apreq.h:172
@ APREQ_JOIN_QUOTE
Definition: apreq.h:173
apr_status_t apreq_post_initialize(apr_pool_t *pool)
struct apreq_value_t apreq_value_t
libapreq's pre-extensible string type
apreq_expires_t
Definition: apreq.h:183
@ APREQ_EXPIRES_NSCOOKIE
Definition: apreq.h:185
@ APREQ_EXPIRES_HTTP
Definition: apreq.h:184
apr_status_t apreq_pre_initialize(apr_pool_t *pool)
apr_bucket_brigade request_rec apr_pool_t * pool
Definition: mod_dav.h:557
int apr_status_t
Definition: apr_errno.h:44
size_t apr_size_t
Definition: apr.h:394
#define APR_INLINE
Definition: apr.h:65
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
struct apr_table_t apr_table_t
Definition: apr_tables.h:56
void apr_table_addn(apr_table_t *t, const char *key, const char *val)
#define APREQ_DECLARE(x)
Definition: macros.h:12
libapreq's pre-extensible string type
Definition: apreq.h:190
char * name
Definition: apreq.h:191
char data[1]
Definition: apreq.h:194
apr_size_t dlen
Definition: apreq.h:193
apr_size_t nlen
Definition: apreq.h:192