summaryrefslogtreecommitdiffstats
path: root/core/membuffer.h
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-10-17 18:45:22 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-23 08:06:17 +0100
commit138f27f65d7f92e313be212cdcaee05aa09a7586 (patch)
tree65d608f9cbae7487cd30f4ac6a3b8c5bfa32cce1 /core/membuffer.h
parent343808271c22942992f4470c05e138d8597a630b (diff)
downloadsubsurface-138f27f65d7f92e313be212cdcaee05aa09a7586.tar.gz
Parser: make parser (mostly) reentrant
Introduce a parser_state structure, which describes (most) of the global parser state. Create such a structure in the entry routines to the parser and pass it down to the individual functions. The parser state is initialized and freed with the init_parser_state() and free_parser_state() functions. The main benefits are: 1) Isolation of parser state. 2) Keeping the global name space tidy. 3) Prevent memory leaks which could happen in truncated files by freeing all the parser state after parse. A somewhat controversial point might be that the individual parsing functions are split in those that need parser-state and those that don't. This means that there are now two versions of the MATCH macro, viz. one for the former and one for the latter. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/membuffer.h')
0 files changed, 0 insertions, 0 deletions