CUBRID Engine
latest
|
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include "xml_parser.h"
#include "utility.h"
Go to the source code of this file.
Macros | |
#define | XML_READ_BUFFSIZE 8192 |
#define | XML_ROOT_DEPTH 0 |
#define | IS_XML_ROOT(el) (el->def->depth == XML_ROOT_DEPTH) |
Enumerations | |
enum | XML_INS_POS { XML_INS_POS_UNDEF = 0, XML_INS_POS_AFTER, XML_INS_POS_BEFORE } |
Functions | |
static XML_ELEMENT * | xml_init_schema_tree (XML_ELEMENT_DEF **element_array, const int count) |
static void | xml_destroy_schema_tree (XML_ELEMENT *pt) |
static XML_ELEMENT * | xml_clone_node (XML_ELEMENT *schema_src, XML_ELEMENT *parent, XML_ELEMENT *prev, bool *has_error) |
static bool | xml_copy_schema_tree (XML_ELEMENT *src, XML_ELEMENT **dest) |
static XML_ELEMENT * | create_xml_node (XML_ELEMENT_DEF *new_elem) |
static int | add_xml_element (XML_ELEMENT *xml_node, XML_ELEMENT_DEF *new_elem_def) |
static XML_ELEMENT * | select_xml_branch_node (XML_ELEMENT *xml_node, const char *sel_name) |
static XML_ELEMENT * | select_xml_node_for_ins (XML_ELEMENT *xml_node, const char *sel_name, XML_INS_POS *insert_pos) |
static char * | get_elem_path_token_at (const XML_ELEMENT_DEF *el_def, const int level, char *short_name) |
static const char * | get_short_elem_name (const XML_ELEMENT_DEF *el_def) |
static int | check_xml_elem_name (XML_ELEMENT *el, const char *check_el_name) |
static void XMLCALL | xml_header_validation_utf8 (void *userData, const XML_Char *version, const XML_Char *encoding, int standalone) |
static void XMLCALL | xml_elem_start (void *data, const char *parsed_el_name, const char **attr) |
static void XMLCALL | xml_elem_end (void *data, const char *parsed_el_name) |
static void XMLCALL | xml_data_handler (void *data, const XML_Char *s, int len) |
static XML_Parser | xml_init_parser_common (void *data, const char *xml_file, const char *encoding) |
static int | xml_parse (void *data, FILE *fp, bool *is_finished) |
static bool | xml_check_include_loop (XML_PARSER_DATA *pd, char *new_file) |
XML_Parser | xml_init_parser (void *data, const char *xml_file, const char *encoding, XML_ELEMENT_DEF **element_array, const int count) |
void | xml_destroy_parser (void *data) |
XML_PARSER_DATA * | xml_create_subparser (XML_PARSER_DATA *pd, char *new_file) |
void | xml_destroy_parser_data (void *data) |
int | xml_check_att_value (const char **attrs, const char *att_name, const char *att_value) |
int | xml_get_att_value (const char **attrs, const char *att_name, char **p_att_value) |
void | xml_parser_exec (XML_PARSER_DATA *pd) |
Variables | |
XML_ELEMENT_DEF | xml_elem_XML = { "XML", XML_ROOT_DEPTH, NULL, NULL, NULL } |
#define IS_XML_ROOT | ( | el | ) | (el->def->depth == XML_ROOT_DEPTH) |
Definition at line 46 of file xml_parser.c.
Referenced by add_xml_element(), and xml_elem_start().
#define XML_READ_BUFFSIZE 8192 |
Definition at line 41 of file xml_parser.c.
Referenced by xml_init_parser_common(), and xml_parse().
#define XML_ROOT_DEPTH 0 |
Definition at line 44 of file xml_parser.c.
enum XML_INS_POS |
Enumerator | |
---|---|
XML_INS_POS_UNDEF | |
XML_INS_POS_AFTER | |
XML_INS_POS_BEFORE |
Definition at line 48 of file xml_parser.c.
|
static |
Definition at line 254 of file xml_parser.c.
References assert, check_xml_elem_name(), xml_element::child, create_xml_node(), xml_element::def, xml_element_def::depth, get_elem_path_token_at(), get_short_elem_name(), IS_XML_ROOT, MAX_ELEMENT_NAME, xml_element::next, NULL, xml_element::parent, xml_element::prev, select_xml_branch_node(), select_xml_node_for_ins(), xml_element::short_name, strlen, XML_CUB_NO_ERROR, XML_CUB_OUT_OF_MEMORY, XML_CUB_SCHEMA_BROKEN, XML_INS_POS_AFTER, XML_INS_POS_BEFORE, and XML_INS_POS_UNDEF.
Referenced by xml_init_schema_tree().
|
static |
Definition at line 593 of file xml_parser.c.
References assert, NULL, and xml_element::short_name.
Referenced by add_xml_element(), select_xml_branch_node(), select_xml_node_for_ins(), and xml_elem_start().
|
static |
Definition at line 225 of file xml_parser.c.
References xml_element::child, xml_element::def, xml_element::match, xml_element::next, NULL, xml_element::parent, xml_element::prev, and xml_element::short_name.
Referenced by add_xml_element().
|
static |
Definition at line 516 of file xml_parser.c.
References assert, xml_element_def::full_name, NULL, and strlen.
Referenced by add_xml_element().
|
static |
Definition at line 562 of file xml_parser.c.
References assert, xml_element_def::full_name, and NULL.
Referenced by add_xml_element().
|
static |
Definition at line 415 of file xml_parser.c.
References assert, check_xml_elem_name(), xml_element::next, and NULL.
Referenced by add_xml_element().
|
static |
Definition at line 466 of file xml_parser.c.
References assert, check_xml_elem_name(), xml_element::next, NULL, XML_INS_POS_AFTER, and XML_INS_POS_BEFORE.
Referenced by add_xml_element().
Definition at line 1152 of file xml_parser.c.
Referenced by start_calendar(), start_calendar_name_context(), start_dayPeriodWidth(), start_month_day_Width(), and start_numbers_symbols().
|
static |
Definition at line 1215 of file xml_parser.c.
References xml_parser_data::filepath, NULL, and xml_parser_data::prev.
Referenced by xml_create_subparser().
|
static |
Definition at line 158 of file xml_parser.c.
References xml_element::child, xml_element::def, xml_element::match, xml_element::next, NULL, xml_element::parent, xml_element::prev, and xml_element::short_name.
Referenced by xml_copy_schema_tree().
|
static |
Definition at line 210 of file xml_parser.c.
References NULL, and xml_clone_node().
Referenced by xml_create_subparser().
XML_PARSER_DATA* xml_create_subparser | ( | XML_PARSER_DATA * | pd, |
char * | new_file | ||
) |
Definition at line 1002 of file xml_parser.c.
References assert, xml_parser_data::ce, xml_parser_data::depth, xml_parser_data::encoding, error(), xml_element::match, xml_parser_data::next, NULL, p, xml_parser_data::prev, xml_parser_data::sc, xml_parser_data::ud, xml_check_include_loop(), xml_copy_schema_tree(), XML_CUB_ERR_INCLUDE_LOOP, XML_CUB_ERR_PARSER_INIT_FAIL, XML_CUB_NO_ERROR, XML_CUB_OUT_OF_MEMORY, xml_destroy_parser_data(), xml_destroy_schema_tree(), xml_parser_data::xml_error, and xml_init_parser_common().
Referenced by start_include_collation().
|
static |
Definition at line 828 of file xml_parser.c.
References assert, xml_parser_data::ce, DATA_FUNC, xml_element::def, xml_element::match, NULL, XML_CUB_ERR_PARSER, XML_CUB_NO_ERROR, xml_parser_data::xml_error, xml_parser_data::xml_error_column, xml_parser_data::xml_error_line, and xml_parser_data::xml_parser.
Referenced by xml_elem_start().
void xml_destroy_parser | ( | void * | data | ) |
Definition at line 977 of file xml_parser.c.
References xml_parser_data::next, NULL, and xml_destroy_parser_data().
Referenced by locale_compile_locale(), and tzc_summary().
void xml_destroy_parser_data | ( | void * | data | ) |
Definition at line 1067 of file xml_parser.c.
References xml_parser_data::buf, NULL, xml_parser_data::sc, xml_destroy_schema_tree(), and xml_parser_data::xml_parser.
Referenced by start_include_collation(), xml_create_subparser(), and xml_destroy_parser().
|
static |
Definition at line 127 of file xml_parser.c.
References assert, xml_element::child, xml_element::def, xml_element::next, NULL, xml_element::parent, xml_element::prev, and xml_element::short_name.
Referenced by xml_create_subparser(), and xml_destroy_parser_data().
|
static |
Definition at line 771 of file xml_parser.c.
References assert, xml_parser_data::ce, xml_element::def, xml_element_def::depth, xml_parser_data::depth, END_FUNC, xml_element::match, NULL, xml_element::parent, XML_CUB_ERR_PARSER, XML_CUB_NO_ERROR, xml_parser_data::xml_error, xml_parser_data::xml_error_column, xml_parser_data::xml_error_line, and xml_parser_data::xml_parser.
Referenced by xml_init_parser_common().
|
static |
Definition at line 643 of file xml_parser.c.
References assert, xml_parser_data::ce, check_xml_elem_name(), xml_element::child, DATA_FUNC, xml_element::def, xml_element_def::depth, xml_parser_data::depth, IS_XML_ROOT, xml_element::match, xml_element::next, NULL, START_FUNC, XML_CUB_ERR_PARSER, XML_CUB_NO_ERROR, xml_data_handler(), xml_parser_data::xml_error, xml_parser_data::xml_error_column, xml_parser_data::xml_error_line, and xml_parser_data::xml_parser.
Referenced by xml_init_parser_common().
Definition at line 1180 of file xml_parser.c.
Referenced by start_collation_cubrid_rule_set_wr(), start_collation_reset(), start_collation_settings(), start_collations(), start_consoleconversion(), start_currency(), start_day(), start_dayPeriod(), start_include_collation(), start_month(), start_one_alphabet(), start_one_collation(), start_unicode_file(), and tzc_summary().
|
static |
Definition at line 614 of file xml_parser.c.
References assert, NULL, XML_CUB_ERR_HEADER_ENCODING, xml_parser_data::xml_error, xml_parser_data::xml_error_column, xml_parser_data::xml_error_line, and xml_parser_data::xml_parser.
Referenced by xml_init_parser_common().
XML_Parser xml_init_parser | ( | void * | data, |
const char * | xml_file, | ||
const char * | encoding, | ||
XML_ELEMENT_DEF ** | element_array, | ||
const int | count | ||
) |
Definition at line 939 of file xml_parser.c.
References assert, xml_parser_data::ce, xml_parser_data::depth, xml_element::match, NULL, p, xml_parser_data::sc, XML_CUB_NO_ERROR, XML_CUB_OUT_OF_MEMORY, xml_parser_data::xml_error, xml_init_parser_common(), xml_init_schema_tree(), and XML_USER_DATA.
Referenced by locale_compile_locale(), and tzc_summary().
|
static |
Definition at line 873 of file xml_parser.c.
References assert, xml_parser_data::buf, xml_parser_data::ce, xml_parser_data::depth, xml_parser_data::encoding, xml_parser_data::filepath, MAX_ENCODE_LEN, xml_parser_data::next, NULL, p, xml_parser_data::prev, xml_parser_data::sc, XML_CUB_ERR_PARSER_INIT_FAIL, XML_CUB_NO_ERROR, XML_CUB_OUT_OF_MEMORY, xml_elem_end(), xml_elem_start(), xml_parser_data::xml_error, xml_parser_data::xml_error_column, xml_parser_data::xml_error_line, xml_header_validation_utf8(), xml_parser_data::xml_parser, XML_READ_BUFFSIZE, and XML_USER_DATA.
Referenced by xml_create_subparser(), and xml_init_parser().
|
static |
Definition at line 92 of file xml_parser.c.
References add_xml_element(), xml_element::child, cubregex::count(), xml_element::def, xml_element_def::full_name, i, xml_element::next, NULL, xml_element::parent, xml_element::prev, xml_element::short_name, XML_CUB_NO_ERROR, and xml_elem_XML.
Referenced by xml_init_parser().
|
static |
Definition at line 1104 of file xml_parser.c.
References assert, xml_parser_data::buf, NULL, XML_CUB_ERR_FILE_READ, XML_CUB_ERR_PARSER, XML_CUB_NO_ERROR, xml_parser_data::xml_error, xml_parser_data::xml_error_column, xml_parser_data::xml_error_line, xml_parser_data::xml_parser, and XML_READ_BUFFSIZE.
Referenced by xml_parser_exec().
void xml_parser_exec | ( | XML_PARSER_DATA * | pd | ) |
Definition at line 1240 of file xml_parser.c.
References xml_parser_data::filepath, fopen_ex(), NULL, XML_CUB_ERR_FILE_MISSING, XML_CUB_NO_ERROR, xml_parser_data::xml_error, and xml_parse().
Referenced by locale_compile_locale(), start_include_collation(), and tzc_summary().
XML_ELEMENT_DEF xml_elem_XML = { "XML", XML_ROOT_DEPTH, NULL, NULL, NULL } |
Definition at line 81 of file xml_parser.c.
Referenced by xml_init_schema_tree().