From 60c249ec24ab865c4a55759c7ffde2da99530b1d Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Wed, 30 Sep 2020 11:42:07 +0100 Subject: several improvements and more efficient xml parser --- xml.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'xml.h') diff --git a/xml.h b/xml.h index 6ee18b4..a2742db 100644 --- a/xml.h +++ b/xml.h @@ -1,5 +1,5 @@ -#ifndef _XML_H -#define _XML_H +#ifndef _XML_H_ +#define _XML_H_ #include @@ -16,9 +16,6 @@ typedef struct xmlparser { void (*xmlcdatastart)(struct xmlparser *); void (*xmlcdata)(struct xmlparser *, const char *, size_t); void (*xmlcdataend)(struct xmlparser *); - void (*xmlcommentstart)(struct xmlparser *); - void (*xmlcomment)(struct xmlparser *, const char *, size_t); - void (*xmlcommentend)(struct xmlparser *); void (*xmldata)(struct xmlparser *, const char *, size_t); void (*xmldataend)(struct xmlparser *); void (*xmldataentity)(struct xmlparser *, const char *, size_t); @@ -29,8 +26,9 @@ typedef struct xmlparser { size_t, int); #ifndef GETNEXT - #define GETNEXT (x)->getnext - int (*getnext)(void); + /* GETNEXT overridden to reduce function call overhead and + further context optimizations. */ + #define GETNEXT getchar #endif /* current tag */ -- cgit v1.2.3