summaryrefslogtreecommitdiff
path: root/xml.h
AgeCommit message (Collapse)Author
2019-04-06optimization: define GETNEXT as an inline macroHiltjo Posthuma
This reduces much function call overhead. getnext is defined in xml.h for inline optimization. sfeed only uses one XML parser context per program, this allows further optimizations of the compiler also. On OpenBSD it was noticable because of retpoline etc function call overhead. Using clang and a 500MB test XML file reduces processing time from +- 12s to 5s. Tested using some crazy optimization flags: SFEED_CFLAGS = -O3 -std=c99 -DGETNEXT=getchar_unlocked -fno-ret-protector \ -mno-retpoline -static A GETNEXT macro is also nice for programs which mmap(2) some big XML file. Then you can simply define: #define GETNEXT() (off >= len ? EOF : reg[off++])
2019-03-16xml: write x->getnext to a default GETNEXT macroHiltjo Posthuma
this allows to override x->getnext to expand to global context parsing and allows the compiler to optimize this inline. also remove checking if the x->getnext function exists (just crash hard).
2018-08-21xml: interface change: make some functions privateHiltjo Posthuma
... this does not expose the uint* types either.
2018-08-21xml: increase allowed size of attribute namesHiltjo Posthuma
2015-09-09xml.h: fix typo in function declarationHiltjo Posthuma
2015-08-22xml: simplify XML readerHiltjo Posthuma
2015-08-16xml: change xml_parse_string to xml_parse_bufHiltjo Posthuma
In the parser itself allow reading '\0' in the XML itself. Add a length parameter to specify the buffer size.
2015-08-14xml: separate reader context from parserHiltjo Posthuma
also: - rename xmlparser_ prefix to xml_. - make xml_parse public, this allows a custom reader like a direct mmap, see: XMLParser.getnext and (optionall) XMLParser.getnext_data. - improve the README text.
2015-08-05xml.h: sort callbacks and improve commentsHiltjo Posthuma
2015-07-29improve includes (dont include headers in .h), fix build on LinuxHiltjo Posthuma
2015-06-21separate xml specific code into xml.cHiltjo Posthuma
2015-05-16xml: allow to read from fd or string bufferHiltjo Posthuma
+ minor code style.
2015-01-02Makefile: fix prerequisite rulesHiltjo Posthuma
2014-12-13xml.h: code-style, function declarationsHiltjo Posthuma
2014-05-08style: linewrap, etcHiltjo Posthuma
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
2014-04-01fix crlf newlines, add fp arg to xmlparser_initHiltjo Posthuma
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
2014-03-31new versionHiltjo Posthuma
lots of things changed, but cleanup todo. changelog and consistent stream of small updates will come in the future. Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
2013-05-20update xml parser, many optimizations and dos to unix newlines, much cleanup ↵Hiltjo Posthuma
todo though Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
2013-01-20add custom xml parser (WIP)Hiltjo Posthuma
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>