#ifdef MARKED_SECTION
enum marked_section_t {
MS_NONE = 0,
MS_INCLUDE,
MS_RCDATA,
MS_CDATA,
MS_IGNORE
};
#endif
#define P_SIGNATURE 0x16091964
enum event_id {
E_DECLARATION = 0,
E_COMMENT,
E_START,
E_END,
E_TEXT,
E_PROCESS,
E_START_DOCUMENT,
E_END_DOCUMENT,
E_DEFAULT,
EVENT_COUNT,
E_NONE
};
typedef enum event_id event_id_t;
static char* event_id_str[] = {
"declaration",
"comment",
"start",
"end",
"text",
"process",
"start_document",
"end_document",
"default",
};
struct p_handler {
SV* cb;
SV* argspec;
};
struct p_state {
U32 signature;
SV* buf;
STRLEN offset;
STRLEN line;
STRLEN column;
bool parsing;
bool eof;
char* literal_mode;
bool is_cdata;
bool no_dash_dash_comment_end;
SV* pend_text;
bool pend_text_is_cdata;
STRLEN pend_text_offset;
STRLEN pend_text_line;
STRLEN pend_text_column;
SV* skipped_text;
#ifdef MARKED_SECTION
enum marked_section_t ms;
AV* ms_stack;
bool marked_sections;
#endif
bool strict_comment;
bool strict_names;
bool strict_end;
bool xml_mode;
bool unbroken_text;
bool attr_encoded;
bool case_sensitive;
SV* bool_attr_val;
struct p_handler handlers[EVENT_COUNT];
HV* report_tags;
HV* ignore_tags;
HV* ignore_elements;
SV* ignoring_element;
int ignore_depth;
HV* entity2char;
SV* tmp;
};
typedef struct p_state PSTATE;