Apache HTTP Server Request Library

Data Structures | Macros | Typedefs | Enumerations | Functions
apreq.h File Reference
Apache Request Library

Main header file... More...

`#include "apr_tables.h"`
`#include <stddef.h>`

Go to the source code of this file.

## Data Structures

struct | apreq_value_t
| libapreq's pre-extensible string type More...

## Macros

#define | APREQ_DECLARE(d) APR_DECLARE(d)
#define | APREQ_DECLARE_NONSTD(d) APR_DECLARE_NONSTD(d)
#define | APREQ_DECLARE_DATA
#define | APREQ_DEFAULT_READ_BLOCK_SIZE (64 * 1024)
#define | APREQ_DEFAULT_READ_LIMIT (64 * 1024 * 1024)
#define | APREQ_DEFAULT_BRIGADE_LIMIT (256 * 1024)
#define | APREQ_DEFAULT_NELTS 8
#define | APREQ_FLAGS_OFF(f, name) ((f) &= ~(name##_MASK << name##_BIT))
#define | APREQ_FLAGS_ON(f, name) ((f) |= (name##_MASK << name##_BIT))
#define | APREQ_FLAGS_GET(f, name) (((f) >> name##_BIT) & name##_MASK)
#define | APREQ_FLAGS_SET(f, name, value)
#define | APREQ_CHARSET_BIT 0
#define | APREQ_CHARSET_MASK 255
#define | APREQ_TAINTED_BIT 8
#define | APREQ_TAINTED_MASK 1
#define | APREQ_COOKIE_VERSION_BIT 11
#define | APREQ_COOKIE_VERSION_MASK 3
#define | APREQ_COOKIE_SECURE_BIT 13
#define | APREQ_COOKIE_SECURE_MASK 1
#define | APREQ_COOKIE_HTTPONLY_BIT 14
#define | APREQ_COOKIE_HTTPONLY_MASK 1
#define | apreq_attr_to_type(T, A, P) ( (T*) ((char*)(P)-offsetof(T,A)) )

## Typedefs

typedef struct apreq_value_t | apreq_value_t
| libapreq's pre-extensible string type

## Enumerations

enum | apreq_charset_t { APREQ_CHARSET_ASCII =0 , APREQ_CHARSET_LATIN1 =1 , APREQ_CHARSET_CP1252 =2 , APREQ_CHARSET_UTF8 =8 }
enum | apreq_join_t { APREQ_JOIN_AS_IS , APREQ_JOIN_ENCODE , APREQ_JOIN_DECODE , APREQ_JOIN_QUOTE }
enum | apreq_match_t { APREQ_MATCH_FULL , APREQ_MATCH_PARTIAL }
enum | apreq_expires_t { APREQ_EXPIRES_HTTP , APREQ_EXPIRES_NSCOOKIE }

## Functions

static APR_INLINE void | apreq_value_table_add (const apreq_value_t *v, apr_table_t *t)
apr_status_t | apreq_initialize (apr_pool_t *pool)
apr_status_t | apreq_pre_initialize (apr_pool_t *pool)
apr_status_t | apreq_post_initialize (apr_pool_t *pool)

## Detailed Description

Main header file...

Define the generic APREQ_ macros and common data structures.

## Macro Definition Documentation

## ◆ apreq_attr_to_type

#define apreq_attr_to_type | ( |  | T,
|  |  | A,
|  |  | P
| ) |  | ( (T*) ((char*)(P)-offsetof(T,A)) )

Parameters

  T | type
  A | attribute
  P | XXX

## ◆ APREQ_CHARSET_BIT

#define APREQ_CHARSET_BIT 0

Charset Bit

See also
  APREQ_FLAGS_OFF
  APREQ_FLAGS_ON
  APREQ_FLAGS_GET
  APREQ_FLAGS_SET

## ◆ APREQ_CHARSET_MASK

#define APREQ_CHARSET_MASK 255

Charset Mask

See also
  APREQ_FLAGS_OFF
  APREQ_FLAGS_ON
  APREQ_FLAGS_GET
  APREQ_FLAGS_SET

## ◆ APREQ_COOKIE_HTTPONLY_BIT

#define APREQ_COOKIE_HTTPONLY_BIT 14

Cookie's HttpOnly Bit

See also
  APREQ_FLAGS_OFF
  APREQ_FLAGS_ON
  APREQ_FLAGS_GET
  APREQ_FLAGS_SET

## ◆ APREQ_COOKIE_HTTPONLY_MASK

#define APREQ_COOKIE_HTTPONLY_MASK 1

Cookie's HttpOnly Mask

See also
  APREQ_FLAGS_OFF
  APREQ_FLAGS_ON
  APREQ_FLAGS_GET
  APREQ_FLAGS_SET

## ◆ APREQ_COOKIE_SECURE_BIT

#define APREQ_COOKIE_SECURE_BIT 13

Cookie's Secure Bit

See also
  APREQ_FLAGS_OFF
  APREQ_FLAGS_ON
  APREQ_FLAGS_GET
  APREQ_FLAGS_SET

## ◆ APREQ_COOKIE_SECURE_MASK

#define APREQ_COOKIE_SECURE_MASK 1

Cookie's Secure Mask

See also
  APREQ_FLAGS_OFF
  APREQ_FLAGS_ON
  APREQ_FLAGS_GET
  APREQ_FLAGS_SET

## ◆ APREQ_COOKIE_VERSION_BIT

#define APREQ_COOKIE_VERSION_BIT 11

Cookier Version Bit

See also
  APREQ_FLAGS_OFF
  APREQ_FLAGS_ON
  APREQ_FLAGS_GET
  APREQ_FLAGS_SET

## ◆ APREQ_COOKIE_VERSION_MASK

#define APREQ_COOKIE_VERSION_MASK 3

Cookie Version Mask

See also
  APREQ_FLAGS_OFF
  APREQ_FLAGS_ON
  APREQ_FLAGS_GET
  APREQ_FLAGS_SET

## ◆ APREQ_DECLARE

#define APREQ_DECLARE | ( |  | d | ) | APR_DECLARE(d)

The public APREQ functions are declared with APREQ_DECLARE(), so they may use the most appropriate calling convention. Public APR functions with variable arguments must use APR_DECLARE_NONSTD().

Remarks
  Both the declaration and implementations must use the same macro. APREQ_DECLARE(rettype) apeq_func(args)

Examples
  /home/jorton/src/asf/libapreq-v2.17/include/apreq.h.

## ◆ APREQ_DECLARE_DATA

#define APREQ_DECLARE_DATA

The public APREQ variables are declared with APREQ_DECLARE_DATA. This assures the appropriate indirection is invoked at compile time.

See also
  APREQ_DECLARE
  APREQ_DECLARE_NONSTD

Remarks
  Note that the declaration and implementations use different forms, but both must include the macro. extern APREQ_DECLARE_DATA type apr_variable;
  APREQ_DECLARE_DATA type apr_variable = value;

## ◆ APREQ_DECLARE_NONSTD

#define APREQ_DECLARE_NONSTD | ( |  | d | ) | APR_DECLARE_NONSTD(d)

APEQ_DECLARE_NONSTD(rettype) apr_func(args, ...);

## ◆ APREQ_DEFAULT_BRIGADE_LIMIT

#define APREQ_DEFAULT_BRIGADE_LIMIT (256 * 1024)

Maximum number of bytes mod_apreq2 will let accumulate within the heap-buckets in a brigade. Excess data will be spooled to an appended file bucket

See also
  ap_set_brigade_read_limit

## ◆ APREQ_DEFAULT_NELTS

#define APREQ_DEFAULT_NELTS 8

Number of elements in the initial apr_table

See also
  apr_table_make

## ◆ APREQ_DEFAULT_READ_BLOCK_SIZE

#define APREQ_DEFAULT_READ_BLOCK_SIZE (64 * 1024)

Read chucks of data in 64k blocks from the request

## ◆ APREQ_DEFAULT_READ_LIMIT

#define APREQ_DEFAULT_READ_LIMIT (64 * 1024 * 1024)

Maximum number of bytes mod_apreq2 will send off to libapreq2 for parsing. mod_apreq2 will log this event and subsequently remove itself from the filter chain.

See also
  ap_set_read_limit

## ◆ APREQ_FLAGS_GET

#define APREQ_FLAGS_GET | ( |  | f,
|  |  | name
| ) |  | (((f) >> name##_BIT) & name##_MASK)

Get specified bit f in bitfield name

## ◆ APREQ_FLAGS_OFF

#define APREQ_FLAGS_OFF | ( |  | f,
|  |  | name
| ) |  | ((f) &= ~(name##_MASK << name##_BIT))

Check to see if specified bit f is off in bitfield name

## ◆ APREQ_FLAGS_ON

#define APREQ_FLAGS_ON | ( |  | f,
|  |  | name
| ) |  | ((f) |= (name##_MASK << name##_BIT))

Check to see if specified bit f is on in bitfield name

## ◆ APREQ_FLAGS_SET

#define APREQ_FLAGS_SET | ( |  | f,
|  |  | name,
|  |  | value
| ) |  |

Value:
((f) = (((f) & ~(name##_MASK << name##_BIT)) \
| ((name##_MASK & (value)) << name##_BIT)))

Set specified bit f in bitfield name to value Note the below BIT/Mask defines are used sans the _BIT, _MASK because of the this define's ##_MASK, ##_BIT usage. Each come in a pair

## ◆ APREQ_TAINTED_BIT

#define APREQ_TAINTED_BIT 8

Tainted Bit

See also
  APREQ_FLAGS_OFF
  APREQ_FLAGS_ON
  APREQ_FLAGS_GET
  APREQ_FLAGS_SET

## ◆ APREQ_TAINTED_MASK

#define APREQ_TAINTED_MASK 1

Tainted Mask

See also
  APREQ_FLAGS_OFF
  APREQ_FLAGS_ON
  APREQ_FLAGS_GET
  APREQ_FLAGS_SET

## Enumeration Type Documentation

## ◆ apreq_charset_t

enum apreq_charset_t

Character encodings.

Examples
  /home/jorton/src/asf/libapreq-v2.17/include/apreq.h.

## ◆ apreq_expires_t

enum apreq_expires_t

Expiration date format

Enumerator
APREQ_EXPIRES_HTTP | Use date formatting consistent with RFC 2616
APREQ_EXPIRES_NSCOOKIE | Use format consistent with Netscape's Cookie Spec

Examples
  /home/jorton/src/asf/libapreq-v2.17/include/apreq.h.

## ◆ apreq_join_t

enum apreq_join_t

Join type

Enumerator
APREQ_JOIN_AS_IS | Join the strings without modification
APREQ_JOIN_ENCODE | Url-encode the strings before joining them
APREQ_JOIN_DECODE | Url-decode the strings before joining them
APREQ_JOIN_QUOTE | Quote the strings, backslashing existing quote marks.

Examples
  /home/jorton/src/asf/libapreq-v2.17/include/apreq.h.

## ◆ apreq_match_t

enum apreq_match_t

Match type

Enumerator
APREQ_MATCH_FULL | Full match only.
APREQ_MATCH_PARTIAL | Partial matches are ok.

Examples
  /home/jorton/src/asf/libapreq-v2.17/include/apreq.h.

## Function Documentation

## ◆ apreq_initialize()

apr_status_t apreq_initialize | ( | apr_pool_t * | pool | ) |

Initialize libapreq2. Applications (except apache modules using mod_apreq) should call this exactly once before they use any libapreq2 modules. If you want to modify the list of default parsers with apreq_register_parser(), please use apreq_pre_initialize() and apreq_post_initialize() instead.

Parameters

  pool | a base pool persisting while libapreq2 is used

Remarks
  after you destroy the pool, you have to call this function again with a new pool if you still plan to use libapreq2

Examples
  /home/jorton/src/asf/libapreq-v2.17/include/apreq.h.

## ◆ apreq_post_initialize()

apr_status_t apreq_post_initialize | ( | apr_pool_t * | pool | ) |

Post-initialize libapreq2. Applications (except apache modules using mod_apreq2) should this exactly once before they use any libapreq2 modules for parsing.

Parameters

  pool | the same pool that was used in apreq_pre_initialize().

Examples
  /home/jorton/src/asf/libapreq-v2.17/include/apreq.h.

## ◆ apreq_pre_initialize()

apr_status_t apreq_pre_initialize | ( | apr_pool_t * | pool | ) |

Pre-initialize libapreq2. Applications (except apache modules using mod_apreq2) should call this exactly once before they register custom parsers with libapreq2. mod_apreq2 does this automatically during the post-config phase, so modules that need call apreq_register_parser should create a post-config hook using APR_HOOK_MIDDLE.

Parameters

  pool | a base pool persisting while libapreq2 is used

Remarks
  after you destroyed the pool, you have to call this function again with a new pool if you still plan to use libapreq2

Examples
  /home/jorton/src/asf/libapreq-v2.17/include/apreq.h.

## ◆ apreq_value_table_add()

static APR_INLINE void apreq_value_table_add | ( | const apreq_value_t * | v,
|  | apr_table_t * | t
| ) |  |

static

Adds the specified apreq_value_t to the apr_table_t.

Parameters

  v | value to add
  t | add v to this table

Returns
  void

@ see apr_table_t

See also
  apr_value_t

Examples
  /home/jorton/src/asf/libapreq-v2.17/include/apreq.h.