Apache Software Foundation > HTTP Server Project > Request Library Subproject

Apache HTTP Server Request Library

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

include/apreq.h

Go to the documentation of this file.
00001 /*
00002 **  Licensed to the Apache Software Foundation (ASF) under one or more
00003 ** contributor license agreements.  See the NOTICE file distributed with
00004 ** this work for additional information regarding copyright ownership.
00005 ** The ASF licenses this file to You under the Apache License, Version 2.0
00006 ** (the "License"); you may not use this file except in compliance with
00007 ** the License.  You may obtain a copy of the License at
00008 **
00009 **      http://www.apache.org/licenses/LICENSE-2.0
00010 **
00011 **  Unless required by applicable law or agreed to in writing, software
00012 **  distributed under the License is distributed on an "AS IS" BASIS,
00013 **  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014 **  See the License for the specific language governing permissions and
00015 **  limitations under the License.
00016 */
00017 
00018 #ifndef APREQ_H
00019 #define APREQ_H
00020 
00021 #ifdef APREQ_DEBUG
00022 #include <assert.h>
00023 #endif
00024 
00025 #include "apr_tables.h"
00026 #include <stddef.h>
00027 
00028 #ifdef  __cplusplus
00029  extern "C" {
00030 #endif
00031 
00040 #ifndef WIN32
00041 
00050 #define APREQ_DECLARE(d)                APR_DECLARE(d)
00051 
00060 #define APREQ_DECLARE_NONSTD(d)         APR_DECLARE_NONSTD(d)
00061 
00071 #define APREQ_DECLARE_DATA
00072 #elif defined (APREQ_DECLARE_STATIC)
00073 #define APREQ_DECLARE(type)             type __stdcall
00074 #define APREQ_DECLARE_NONSTD(type)      type
00075 #define APREQ_DECLARE_DATA
00076 #elif defined (APREQ_DECLARE_EXPORT)
00077 #define APREQ_DECLARE(type)             __declspec(dllexport) type __stdcall
00078 #define APREQ_DECLARE_NONSTD(type)      __declspec(dllexport) type
00079 #define APREQ_DECLARE_DATA              __declspec(dllexport)
00080 #else
00081 #define APREQ_DECLARE(type)             __declspec(dllimport) type __stdcall
00082 #define APREQ_DECLARE_NONSTD(type)      __declspec(dllimport) type
00083 #define APREQ_DECLARE_DATA              __declspec(dllimport)
00084 #endif
00085 
00090 #define APREQ_DEFAULT_READ_BLOCK_SIZE   (64  * 1024)
00091 
00098 #define APREQ_DEFAULT_READ_LIMIT        (64 * 1024 * 1024)
00099 
00105 #define APREQ_DEFAULT_BRIGADE_LIMIT     (256 * 1024)
00106 
00111 #define APREQ_DEFAULT_NELTS              8
00112 
00113 
00114 
00118 #define APREQ_FLAGS_OFF(f, name) ((f) &= ~(name##_MASK << name##_BIT))
00119 
00122 #define APREQ_FLAGS_ON(f, name)  ((f) |=  (name##_MASK << name##_BIT))
00123 
00126 #define APREQ_FLAGS_GET(f, name) (((f) >> name##_BIT) & name##_MASK)
00127 
00133 #define APREQ_FLAGS_SET(f, name, value)                 \
00134     ((f) = (((f) & ~(name##_MASK << name##_BIT))        \
00135             | ((name##_MASK & (value)) << name##_BIT)))
00136 
00142 #define APREQ_CHARSET_BIT           0
00143 
00149 #define APREQ_CHARSET_MASK        255
00150 
00156 #define APREQ_TAINTED_BIT           8
00157 
00162 #define APREQ_TAINTED_MASK          1
00163 
00170 #define APREQ_COOKIE_VERSION_BIT   11
00171 
00176 #define APREQ_COOKIE_VERSION_MASK   3
00177 
00183 #define APREQ_COOKIE_SECURE_BIT    13
00184 
00189 #define APREQ_COOKIE_SECURE_MASK    1
00190 
00196 #define APREQ_COOKIE_HTTPONLY_BIT    14
00197 
00202 #define APREQ_COOKIE_HTTPONLY_MASK    1
00203 
00205 typedef enum {
00206     APREQ_CHARSET_ASCII  =0,
00207     APREQ_CHARSET_LATIN1 =1, /* ISO-8859-1   */
00208     APREQ_CHARSET_CP1252 =2, /* Windows-1252 */
00209     APREQ_CHARSET_UTF8   =8
00210 } apreq_charset_t;
00211 
00212 
00214 typedef enum {
00215     APREQ_JOIN_AS_IS,      
00216     APREQ_JOIN_ENCODE,     
00217     APREQ_JOIN_DECODE,     
00218     APREQ_JOIN_QUOTE       
00219 } apreq_join_t;
00220 
00222 typedef enum {
00223     APREQ_MATCH_FULL,       
00224     APREQ_MATCH_PARTIAL     
00225 } apreq_match_t;
00226 
00228 typedef enum {
00229     APREQ_EXPIRES_HTTP,       
00230     APREQ_EXPIRES_NSCOOKIE    
00231 } apreq_expires_t;
00232 
00233 
00235 typedef struct apreq_value_t {
00236     char             *name;    
00237     apr_size_t        nlen;    
00238     apr_size_t        dlen;    
00239     char              data[1]; 
00240 } apreq_value_t;
00241 
00253 static APR_INLINE
00254 void apreq_value_table_add(const apreq_value_t *v, apr_table_t *t) {
00255     apr_table_addn(t, v->name, v->data);
00256 }
00257 
00265 #define apreq_attr_to_type(T,A,P) ( (T*) ((char*)(P)-offsetof(T,A)) )
00266 
00278 APREQ_DECLARE(apr_status_t) apreq_initialize(apr_pool_t *pool);
00279 
00280 
00292 APREQ_DECLARE(apr_status_t) apreq_pre_initialize(apr_pool_t *pool);
00293 
00301 APREQ_DECLARE(apr_status_t) apreq_post_initialize(apr_pool_t *pool);
00302 
00303 
00304 #ifdef __cplusplus
00305  }
00306 #endif
00307 
00308 #endif /* APREQ_H */

Copyright © 2003-2006 The Apache Software Foundation.
See LICENSE.

page generated by doxygen version 1.5.6 on 25 Nov 2010