libapreq2-2.08: libapreq2: include/apreq.h Source File

Apache HTTP Server Request Library

- Main Page
- Modules
- Data Structures
- Files
- Related Pages
- Examples

- File List
- Globals

# include/apreq.h

Go to the documentation of this file.

    00001 /*
    00002 **  Copyright 2003-2006  The Apache Software Foundation
    00003 **
    00004 **  Licensed under the Apache License, Version 2.0 (the "License");
    00005 **  you may not use this file except in compliance with the License.
    00006 **  You may obtain a copy of the License at
    00007 **
    00008 **      http://www.apache.org/licenses/LICENSE-2.0
    00009 **
    00010 **  Unless required by applicable law or agreed to in writing, software
    00011 **  distributed under the License is distributed on an "AS IS" BASIS,
    00012 **  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00013 **  See the License for the specific language governing permissions and
    00014 **  limitations under the License.
    00015 */
    00016
    00017 #ifndef APREQ_H
    00018 #define APREQ_H
    00019
    00020 #ifdef APREQ_DEBUG
    00021 #include <assert.h>
    00022 #endif
    00023
    00024 #include "apr_tables.h"
    00025 #include <stddef.h>
    00026
    00027 #ifdef  __cplusplus
    00028  extern "C" {
    00029 #endif
    00030
    00039 #ifndef WIN32
    00040
    00049 #define APREQ_DECLARE(d)                APR_DECLARE(d)
    00050
    00059 #define APREQ_DECLARE_NONSTD(d)         APR_DECLARE_NONSTD(d)
    00060
    00070 #define APREQ_DECLARE_DATA
    00071 #else
    00072 #define APREQ_DECLARE(type)             __declspec(dllexport) type __stdcall
    00073 #define APREQ_DECLARE_NONSTD(type)      __declspec(dllexport) type
    00074 #define APREQ_DECLARE_DATA              __declspec(dllexport)
    00075 #endif
    00076
    00081 #define APREQ_DEFAULT_READ_BLOCK_SIZE   (64  * 1024)
    00082
    00089 #define APREQ_DEFAULT_READ_LIMIT        (64 * 1024 * 1024)
    00090
    00096 #define APREQ_DEFAULT_BRIGADE_LIMIT     (256 * 1024)
    00097
    00102 #define APREQ_DEFAULT_NELTS              8
    00103
    00104
    00105
    00109 #define APREQ_FLAGS_OFF(f, name) ((f) &= ~(name##_MASK << name##_BIT))
    00110
    00113 #define APREQ_FLAGS_ON(f, name)  ((f) |=  (name##_MASK << name##_BIT))
    00114
    00117 #define APREQ_FLAGS_GET(f, name) (((f) >> name##_BIT) & name##_MASK)
    00118
    00124 #define APREQ_FLAGS_SET(f, name, value)                 \
    00125     ((f) = (((f) & ~(name##_MASK << name##_BIT))        \
    00126             | ((name##_MASK & (value)) << name##_BIT)))
    00127
    00133 #define APREQ_CHARSET_BIT           0
    00134
    00140 #define APREQ_CHARSET_MASK        255
    00141
    00147 #define APREQ_TAINTED_BIT           8
    00148
    00153 #define APREQ_TAINTED_MASK          1
    00154
    00161 #define APREQ_COOKIE_VERSION_BIT   11
    00162
    00167 #define APREQ_COOKIE_VERSION_MASK   3
    00168
    00174 #define APREQ_COOKIE_SECURE_BIT    13
    00175
    00180 #define APREQ_COOKIE_SECURE_MASK    1
    00181
    00183 typedef enum {
    00184     APREQ_CHARSET_ASCII  =0,
    00185     APREQ_CHARSET_LATIN1 =1, /* ISO-8859-1   */
    00186     APREQ_CHARSET_CP1252 =2, /* Windows-1252 */
    00187     APREQ_CHARSET_UTF8   =8
    00188 } apreq_charset_t;
    00189
    00190
    00192 typedef enum {
    00193     APREQ_JOIN_AS_IS,
    00194     APREQ_JOIN_ENCODE,
    00195     APREQ_JOIN_DECODE,
    00196     APREQ_JOIN_QUOTE
    00197 } apreq_join_t;
    00198
    00200 typedef enum {
    00201     APREQ_MATCH_FULL,
    00202     APREQ_MATCH_PARTIAL
    00203 } apreq_match_t;
    00204
    00206 typedef enum {
    00207     APREQ_EXPIRES_HTTP,
    00208     APREQ_EXPIRES_NSCOOKIE
    00209 } apreq_expires_t;
    00210
    00211
    00213 typedef struct apreq_value_t {
    00214     char             *name;
    00215     apr_size_t        nlen;
    00216     apr_size_t        dlen;
    00217     char              data[1];
    00218 } apreq_value_t;
    00219
    00231 static APR_INLINE
    00232 void apreq_value_table_add(const apreq_value_t *v, apr_table_t *t) {
    00233     apr_table_addn(t, v->name, v->data);
    00234 }
    00235
    00243 #define apreq_attr_to_type(T,A,P) ( (T*) ((char*)(P)-offsetof(T,A)) )
    00244
    00256 APREQ_DECLARE(apr_status_t) apreq_initialize(apr_pool_t *pool);
    00257
    00258
    00270 APREQ_DECLARE(apr_status_t) apreq_pre_initialize(apr_pool_t *pool);
    00271
    00279 APREQ_DECLARE(apr_status_t) apreq_post_initialize(apr_pool_t *pool);
    00280
    00281
    00282 #ifdef __cplusplus
    00283  }
    00284 #endif
    00285
    00286 #endif /* APREQ_H */