Apache HTTPD
Classes | Macros | Typedefs | Functions | Variables
apr_xml.c File Reference
#include "apr.h"
#include "apr_strings.h"
#include "apr_want.h"
#include "apr_xml.h"
#include "apu_config.h"
#include <expat.h>

Go to the source code of this file.

Classes

struct  apr_xml_parser
 
struct  apr_xml_ns_scope
 

Macros

#define APR_WANT_STDIO   /* for sprintf() */
 
#define APR_WANT_STRFUNC
 
#define DEBUG_CR   "\r\n"
 
#define APR_XML_NS_ERROR_UNKNOWN_PREFIX   (-1000)
 
#define APR_XML_NS_ERROR_INVALID_DECL   (-1001)
 
#define APR_XML_NS_IS_RESERVED(name)
 
#define APR_XML_ERROR_EXPAT   1
 
#define APR_XML_ERROR_PARSE_DONE   2
 
#define APR_XML_NS_LEN(ns)
 

Typedefs

typedef struct apr_xml_ns_scope apr_xml_ns_scope
 

Functions

static int find_prefix (apr_xml_parser *parser, const char *prefix)
 
static const charfind_prefix_name (const apr_xml_elem *elem, int ns, int parent)
 
static void start_handler (void *userdata, const char *name, const char **attrs)
 
static void end_handler (void *userdata, const char *name)
 
static void cdata_handler (void *userdata, const char *data, int len)
 
static apr_status_t cleanup_parser (void *ctx)
 
static void default_handler (void *userData, const XML_Char *s, int len)
 
 APU_DECLARE (apr_xml_parser *)
 
static apr_status_t do_parse (apr_xml_parser *parser, const char *data, apr_size_t len, int is_final)
 
 APU_DECLARE (apr_status_t)
 
 APU_DECLARE (char *)
 
 APU_DECLARE (void)
 Computes SipHash-2-4, producing a 64bit (APR_SIPHASH_DSIZE) hash from a message and a 128bit (APR_SIPHASH_KSIZE) secret key, into a possibly unaligned buffer (using the little endian representation as defined by the authors for interoperabilty) usable as a MAC.
 
 APU_DECLARE (const char *)
 
static apr_size_t text_size (const apr_text *t)
 
static apr_size_t elem_size (const apr_xml_elem *elem, int style, apr_array_header_t *namespaces, int *ns_map)
 
static charwrite_text (char *s, const apr_text *t)
 
static charwrite_elem (char *s, const apr_xml_elem *elem, int style, apr_array_header_t *namespaces, int *ns_map)
 

Variables

static const char APR_KW_xmlns [] = { 0x78, 0x6D, 0x6C, 0x6E, 0x73, '\0' }
 
static const char APR_KW_xmlns_lang [] = { 0x78, 0x6D, 0x6C, 0x3A, 0x6C, 0x61, 0x6E, 0x67, '\0' }
 
static const char APR_KW_DAV [] = { 0x44, 0x41, 0x56, 0x3A, '\0' }
 

Macro Definition Documentation

◆ APR_WANT_STDIO

#define APR_WANT_STDIO   /* for sprintf() */

Definition at line 20 of file apr_xml.c.

◆ APR_WANT_STRFUNC

#define APR_WANT_STRFUNC

Definition at line 21 of file apr_xml.c.

◆ APR_XML_ERROR_EXPAT

#define APR_XML_ERROR_EXPAT   1

Definition at line 62 of file apr_xml.c.

◆ APR_XML_ERROR_PARSE_DONE

#define APR_XML_ERROR_PARSE_DONE   2

Definition at line 63 of file apr_xml.c.

◆ APR_XML_NS_ERROR_INVALID_DECL

#define APR_XML_NS_ERROR_INVALID_DECL   (-1001)

Definition at line 46 of file apr_xml.c.

◆ APR_XML_NS_ERROR_UNKNOWN_PREFIX

#define APR_XML_NS_ERROR_UNKNOWN_PREFIX   (-1000)

Definition at line 45 of file apr_xml.c.

◆ APR_XML_NS_IS_RESERVED

#define APR_XML_NS_IS_RESERVED (   name)
Value:
( (name[0] == 0x58 || name[0] == 0x78) && \
(name[1] == 0x4D || name[1] == 0x6D) && \
(name[2] == 0x4C || name[2] == 0x6C) )
char * name

Definition at line 49 of file apr_xml.c.

◆ APR_XML_NS_LEN

#define APR_XML_NS_LEN (   ns)
Value:
((ns) < 10 ? 1 : (ns) < 100 ? 2 : (ns) < 1000 ? 3 : \
(ns) < 10000 ? 4 : (ns) < 100000 ? 5 : \
(ns) < 1000000 ? 6 : (ns) < 10000000 ? 7 : \
(ns) < 100000000 ? 8 : (ns) < 1000000000 ? 9 : 10)
#define ns(x)
Definition xmltok.c:1644

Definition at line 649 of file apr_xml.c.

◆ DEBUG_CR

#define DEBUG_CR   "\r\n"

Definition at line 38 of file apr_xml.c.

Typedef Documentation

◆ apr_xml_ns_scope

Function Documentation

◆ APU_DECLARE()

APU_DECLARE ( char )

Definition at line 473 of file apr_xml.c.

◆ cdata_handler()

static void cdata_handler ( void *  userdata,
const char data,
int  len 
)
static

Definition at line 334 of file apr_xml.c.

◆ cleanup_parser()

static apr_status_t cleanup_parser ( void *  ctx)
static

Definition at line 360 of file apr_xml.c.

◆ default_handler()

static void default_handler ( void *  userData,
const XML_Char s,
int  len 
)
static

Definition at line 384 of file apr_xml.c.

◆ do_parse()

static apr_status_t do_parse ( apr_xml_parser parser,
const char data,
apr_size_t  len,
int  is_final 
)
static

Definition at line 430 of file apr_xml.c.

◆ elem_size()

static apr_size_t elem_size ( const apr_xml_elem elem,
int  style,
apr_array_header_t namespaces,
int ns_map 
)
static

< start tag, contents, end tag

< FULL + ns defns + xml:lang

< original prefixes

< FULL + ns defns + xml:lang

< original prefixes

< no namespace for this elem/attr

< original prefixes

< no namespace for this elem/attr

< original prefixes

< xml:lang + inner contents

< original prefixes

< original prefixes

< start tag, contents, end tag

Definition at line 663 of file apr_xml.c.

◆ end_handler()

static void end_handler ( void *  userdata,
const char name 
)
static

Definition at line 322 of file apr_xml.c.

◆ find_prefix()

static int find_prefix ( apr_xml_parser parser,
const char prefix 
)
static

< no namespace for this elem/attr

< no namespace for this elem/attr

Definition at line 80 of file apr_xml.c.

◆ find_prefix_name()

static const char * find_prefix_name ( const apr_xml_elem elem,
int  ns,
int  parent 
)
static

Definition at line 124 of file apr_xml.c.

◆ start_handler()

static void start_handler ( void *  userdata,
const char name,
const char **  attrs 
)
static

< no namespace for this elem/attr

< used only during processing

< no namespace for this elem/attr

< no namespace for this elem/attr

< used only during processing

Definition at line 143 of file apr_xml.c.

◆ text_size()

static apr_size_t text_size ( const apr_text t)
static

Definition at line 654 of file apr_xml.c.

◆ write_elem()

static char * write_elem ( char s,
const apr_xml_elem elem,
int  style,
apr_array_header_t namespaces,
int ns_map 
)
static

< start tag, contents, end tag

< FULL + ns defns + xml:lang

< original prefixes

< no namespace for this elem/attr

< original prefixes

< no namespace for this elem/attr

< original prefixes

< FULL + ns defns + xml:lang

< FULL + ns defns + xml:lang

< original prefixes

< xml:lang + inner contents

< original prefixes

< original prefixes

< start tag, contents, end tag

< start tag, contents, end tag

< FULL + ns defns + xml:lang

< original prefixes

< no namespace for this elem/attr

< original prefixes

Definition at line 795 of file apr_xml.c.

◆ write_text()

static char * write_text ( char s,
const apr_text t 
)
static

Definition at line 785 of file apr_xml.c.

Variable Documentation

◆ APR_KW_DAV

const char APR_KW_DAV[] = { 0x44, 0x41, 0x56, 0x3A, '\0' }
static

Definition at line 42 of file apr_xml.c.

◆ APR_KW_xmlns

const char APR_KW_xmlns[] = { 0x78, 0x6D, 0x6C, 0x6E, 0x73, '\0' }
static

Definition at line 40 of file apr_xml.c.

◆ APR_KW_xmlns_lang

const char APR_KW_xmlns_lang[] = { 0x78, 0x6D, 0x6C, 0x3A, 0x6C, 0x61, 0x6E, 0x67, '\0' }
static

Definition at line 41 of file apr_xml.c.