35 #define AFW_URI_OCTET_INVALID (afw_uri_octet_type_t)0x00000000
37 #define AFW_URI_OCTET_GEN_DELIM (afw_uri_octet_type_t)0x00000001
38 #define AFW_URI_OCTET_SUB_DELIM (afw_uri_octet_type_t)0x00000002
39 #define AFW_URI_OCTET_UNRESERVED (afw_uri_octet_type_t)0x00000004
40 #define AFW_URI_OCTET_PCT_ENCODED (afw_uri_octet_type_t)0x00000008
42 #define AFW_URI_OCTET_ALPHA_UPPER (afw_uri_octet_type_t)0x00000010
43 #define AFW_URI_OCTET_ALPHA_LOWER (afw_uri_octet_type_t)0x00000020
44 #define AFW_URI_OCTET_DIGIT (afw_uri_octet_type_t)0x00000040
45 #define AFW_URI_OCTET_HEXDIGIT (afw_uri_octet_type_t)0x00000080
48 #define AFW_URI_OCTET_ENCODE_URI (afw_uri_octet_type_t)0x00000100
51 #define AFW_URI_OCTET_ENCODE_COMPONENT (afw_uri_octet_type_t)0x00000200
54 #define AFW_URI_OCTET_ENCODE_COMPONENT_VALUE (afw_uri_octet_type_t)0x00000400
56 #define AFW_URI_OCTET_AT (afw_uri_octet_type_t)0x00010000
57 #define AFW_URI_OCTET_COLON (afw_uri_octet_type_t)0x00020000
58 #define AFW_URI_OCTET_MINUS (afw_uri_octet_type_t)0x00040000
59 #define AFW_URI_OCTET_PERCENT (afw_uri_octet_type_t)0x00080000
60 #define AFW_URI_OCTET_PERIOD (afw_uri_octet_type_t)0x00100000
61 #define AFW_URI_OCTET_PLUS (afw_uri_octet_type_t)0x00200000
62 #define AFW_URI_OCTET_QUESTION (afw_uri_octet_type_t)0x00400000
63 #define AFW_URI_OCTET_SLASH (afw_uri_octet_type_t)0x00800000
65 #define AFW_URI_OCTET_MASK_IS_BITWISE_NOT (afw_uri_octet_type_t)0x80000000
68 #define AFW_URI_OCTET_ALPHA \
69 ( AFW_URI_OCTET_ALPHA_UPPER | \
70 AFW_URI_OCTET_ALPHA_LOWER )
73 #define AFW_URI_OCTET_PCHAR \
74 ( AFW_URI_OCTET_UNRESERVED | \
75 AFW_URI_OCTET_PCT_ENCODED | \
76 AFW_URI_OCTET_SUB_DELIM | \
77 AFW_URI_OCTET_COLON | \
81 #define AFW_URI_OCTET_SCHEME_START \
82 ( AFW_URI_OCTET_ALPHA )
85 #define AFW_URI_OCTET_SCHEME_CONTINUE \
86 ( AFW_URI_OCTET_ALPHA | \
87 AFW_URI_OCTET_DIGIT | \
88 AFW_URI_OCTET_PLUS | \
89 AFW_URI_OCTET_MINUS | \
90 AFW_URI_OCTET_PERIOD )
93 #define AFW_URI_OCTET_USERINFO \
94 ( AFW_URI_OCTET_UNRESERVED | \
95 AFW_URI_OCTET_PCT_ENCODED | \
96 AFW_URI_OCTET_SUB_DELIM | \
100 #define AFW_URI_OCTET_QUERY \
101 ( AFW_URI_OCTET_PCHAR | \
102 AFW_URI_OCTET_SLASH | \
103 AFW_URI_OCTET_QUESTION )
106 #define AFW_URI_OCTET_FRAGMENT \
107 ( AFW_URI_OCTET_PCHAR | \
108 AFW_URI_OCTET_SLASH | \
109 AFW_URI_OCTET_QUESTION )
112 #define AFW_URI_OCTET_RESERVED \
113 ( AFW_URI_OCTET_GEN_DELIM | \
114 AFW_URI_OCTET_SUB_DELIM )
123 #define AFW_URI_OCTET_IS(type, mask) \
124 ((type) & (AFW_URI_OCTET_ ## mask))
#define AFW_BEGIN_DECLARES
#define AFW_DECLARE(type)
Declare a public afw function.
Interfaceafw_interface header.
AFW_DECLARE_CONST_DATA(afw_utf8_t) afw_s_200
afw_utf8_t for string 200
apr_uint32_t afw_uint32_t
32-bit unsigned integer.
char afw_utf8_octet_t
8 bits of utf-8 codepoint.
apr_size_t afw_size_t
size_t.
unsigned char afw_octet_t
8 bits (unsigned).
const afw_object_t * afw_uri_to_object(const afw_utf8_t *uri, afw_boolean_t is_value_path, const afw_utf8_t *current_path, const afw_pool_t *p, afw_xctx_t *xctx)
Turn a URI into an object representation.
afw_boolean_t afw_uri_are_equivalent(const afw_utf8_t *uri1, const afw_utf8_t *uri2, afw_boolean_t is_value_path, const afw_utf8_t *current_path2, const afw_pool_t *p, afw_xctx_t *xctx)
Determine if two URIs are equivalent.
void afw_uri_parse_next_token(const afw_uri_parser_t *parser, afw_xctx_t *xctx)
Parse next token.
const afw_utf8_t * afw_uri_decode_create(const afw_utf8_octet_t *s, afw_size_t len, const afw_pool_t *p, afw_xctx_t *xctx)
Create a URI decoded string.
void afw_uri_parser_initialize(afw_uri_parser_t *parser, const afw_utf8_t *uri, const afw_pool_t *p, afw_xctx_t *xctx)
Initialize a parser in specific pool.
void afw_uri_parse_reuse_token(const afw_uri_parser_t *parser, afw_xctx_t *xctx)
Cause next call afw_uri_parse_get_next_token() to return current token.
const afw_memory_t * afw_uri_decode_to_raw_create(const afw_utf8_octet_t *s, afw_size_t len, const afw_pool_t *p, afw_xctx_t *xctx)
Decode URI encoded string to raw.
struct afw_uri_parsed_s afw_uri_parsed_t
Typedef for parsed URI returned from afw_uri_parse().
const afw_uri_parsed_t * afw_uri_parse(const afw_utf8_t *uri, afw_boolean_t is_value_path, const afw_utf8_t *current_path, const afw_pool_t *p, afw_xctx_t *xctx)
Parse a URI in specific pool.
afw_size_t afw_uri_encode_len(const afw_utf8_t *string, afw_uri_octet_type_t mask, afw_xctx_t *xctx)
The length needed to URI encode a string.
const afw_utf8_t * afw_uri_encode_create(const afw_utf8_octet_t *s, afw_size_t len, afw_uri_octet_type_t mask, const afw_pool_t *p, afw_xctx_t *xctx)
Create a URI encode a string.
const afw_utf8_t * afw_uri_encode_raw(const afw_memory_t *raw, afw_uri_octet_type_t mask, const afw_pool_t *p, afw_xctx_t *xctx)
URI encode raw.
const afw_object_t * afw_uri_parsed_to_object(const afw_uri_parsed_t *parsed, const afw_pool_t *p, afw_xctx_t *xctx)
Turn a parsed URI into an object representation.
const afw_memory_t * afw_uri_decode_to_raw(const afw_utf8_t *encoded, const afw_pool_t *p, afw_xctx_t *xctx)
Decode a URI encoded string to raw.
const afw_utf8_t * afw_uri_encode(const afw_utf8_t *string, afw_uri_octet_type_t mask, const afw_pool_t *p, afw_xctx_t *xctx)
URI encode a string.
struct afw_uri_parser_s afw_uri_parser_t
URI parser typedef.
const afw_uri_parser_t * afw_uri_parser_create(const afw_utf8_t *uri, const afw_pool_t *p, afw_xctx_t *xctx)
Create and initialize a parser in specific pool.
afw_size_t afw_uri_encode_raw_to_preallocated(afw_utf8_octet_t *s, afw_size_t s_len, const afw_memory_t *raw, afw_uri_octet_type_t mask, const afw_pool_t *p, afw_xctx_t *xctx)
URI encode from raw using supplied afw_utf8_t.
afw_boolean_t afw_uri_octet_test(afw_octet_t octet, afw_uri_octet_type_t mask)
Test uri octet type mask.
const afw_utf8_t * afw_uri_decode(const afw_utf8_t *encoded, const afw_pool_t *p, afw_xctx_t *xctx)
Decode a URI encoded string.
afw_uint32_t afw_uri_octet_type_t
Token type typedef.
void afw_uri_parse_set_consider_period_a_token(const afw_uri_parser_t *parser, afw_boolean_t consider_period_a_token, afw_xctx_t *xctx)
Set consider_period_a_token flag.
afw_size_t afw_uri_encode_raw_len(const afw_memory_t *raw, afw_uri_octet_type_t mask, afw_xctx_t *xctx)
The length needed to URI encode raw.
afw_boolean_t afw_uri_parsed_are_equivalent(const afw_uri_parsed_t *parsed1, const afw_uri_parsed_t *parsed2, afw_xctx_t *xctx)
Determine if two parsed URIs are equivalent.
afw_size_t afw_uri_encode_to_preallocated(afw_utf8_octet_t *s, afw_size_t s_len, const afw_utf8_t *string, afw_uri_octet_type_t mask, const afw_pool_t *p, afw_xctx_t *xctx)
URI encode a string using supplied afw_utf8_t.
afw_uri_octet_type[256]
Token type table indexed by afw_octet_t ( 0 - 255 ).
Struct for memory pointer and size.
Typedef for parsed object path.
Interface afw_object public struct.
Interface afw_pool public struct.
Typedef for parsed URI returned from afw_uri_parse().
NFC normalized UTF-8 string.
Interface afw_xctx public struct.