103 |
*/ |
*/ |
104 |
|
|
105 |
/* TODO: this needs to be updated to cope with utf8 */ |
/* TODO: this needs to be updated to cope with utf8 */ |
106 |
inline char current_char(qnd_xml_context_t *context) { |
static inline char current_char(qnd_xml_context_t *context) { |
107 |
return *context->cur; |
return *context->cur; |
108 |
} |
} |
109 |
|
|
110 |
/* TODO: this needs to be updated to cope with utf8 */ |
/* TODO: this needs to be updated to cope with utf8 */ |
111 |
inline gboolean skip_char(qnd_xml_context_t *context) { |
static inline gboolean skip_char(qnd_xml_context_t *context) { |
112 |
context->cur++; |
context->cur++; |
113 |
/* TODO: check buffer range */ |
/* TODO: check buffer range */ |
114 |
return TRUE; |
return TRUE; |
115 |
} |
} |
116 |
|
|
117 |
gboolean skip_to_char(qnd_xml_context_t *context, char *chrs) { |
static inline gboolean skip_to_char(qnd_xml_context_t *context, char *chrs) { |
118 |
while(context->cur < context->buffer + context->total) { |
while(context->cur < context->buffer + context->total) { |
119 |
if(strchr(chrs, current_char(context))) { |
if(strchr(chrs, current_char(context))) { |
120 |
return skip_char(context); |
return skip_char(context); |
126 |
return FALSE; |
return FALSE; |
127 |
} |
} |
128 |
|
|
129 |
gboolean buffer_overflow(qnd_xml_context_t *context) { |
static inline gboolean buffer_overflow(qnd_xml_context_t *context) { |
130 |
return(!(context->cur < context->buffer + context->total)); |
return(!(context->cur < context->buffer + context->total)); |
131 |
} |
} |
132 |
|
|
133 |
gboolean get_element_name(qnd_xml_context_t *context) { |
static gboolean get_element_name(qnd_xml_context_t *context) { |
134 |
|
|
135 |
char *start = context->cur; |
char *start = context->cur; |
136 |
|
|
178 |
return TRUE; |
return TRUE; |
179 |
} |
} |
180 |
|
|
181 |
gboolean get_attribute_name(qnd_xml_context_t *context) { |
static gboolean get_attribute_name(qnd_xml_context_t *context) { |
182 |
|
|
183 |
char *start = context->cur; |
char *start = context->cur; |
184 |
|
|