From 6efc8270ef8f75a842930a0f703cb3539f106d4b Mon Sep 17 00:00:00 2001 From: Matt Kraai Date: Thu, 15 Oct 2009 22:01:24 +0100 Subject: Make the XML lexer and parser re-entrant --- src/xine-utils/xmllexer.h | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'src/xine-utils/xmllexer.h') diff --git a/src/xine-utils/xmllexer.h b/src/xine-utils/xmllexer.h index 425d0e70a..bcea7d6b4 100644 --- a/src/xine-utils/xmllexer.h +++ b/src/xine-utils/xmllexer.h @@ -23,6 +23,10 @@ #ifndef XML_LEXER_H #define XML_LEXER_H +#ifndef XINE_DEPRECATED +#define XINE_DEPRECATED +#endif + #ifndef XINE_PROTECTED #define XINE_PROTECTED #endif @@ -49,10 +53,25 @@ #define T_DOCTYPE_STOP 17 /* > */ +/* public structure */ +struct lexer +{ + const char * lexbuf; + int lexbuf_size; + int lexbuf_pos; + int lex_mode; + int in_comment; + char *lex_malloc; +}; + + /* public functions */ -void lexer_init(const char * buf, int size) XINE_PROTECTED; -int lexer_get_token_d(char ** tok, int * tok_size, int fixed) XINE_PROTECTED; -int lexer_get_token(char * tok, int tok_size) XINE_PROTECTED; +void lexer_init(const char * buf, int size) XINE_DEPRECATED XINE_PROTECTED; +struct lexer *lexer_init_r(const char * buf, int size) XINE_PROTECTED; +void lexer_finalize_r(struct lexer * lexer) XINE_PROTECTED; +int lexer_get_token_d_r(struct lexer * lexer, char ** tok, int * tok_size, int fixed) XINE_PROTECTED; +int lexer_get_token_d(char ** tok, int * tok_size, int fixed) XINE_DEPRECATED XINE_PROTECTED; +int lexer_get_token(char * tok, int tok_size) XINE_DEPRECATED XINE_PROTECTED; char *lexer_decode_entities (const char *tok) XINE_PROTECTED; #endif -- cgit v1.2.3