xine-lib  1.2.10
xmllexer.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2018 the xine project
3  *
4  * This file is part of xine, a free video player.
5  *
6  * The xine-lib XML parser is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public License as
8  * published by the Free Software Foundation; either version 2 of the
9  * License, or (at your option) any later version.
10  *
11  * The xine-lib XML parser is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with the Gnome Library; see the file COPYING.LIB. If not,
18  * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
19  * Floor, Boston, MA 02110, USA
20  */
21 
22 /* xml lexer */
23 #ifndef XML_LEXER_H
24 #define XML_LEXER_H
25 
26 #include <xine/attributes.h>
27 
28 /* public constants */
29 #define T_ERROR -1 /* lexer error */
30 #define T_EOF 0 /* end of file */
31 #define T_EOL 1 /* end of line */
32 #define T_SEPAR 2 /* separator ' ' '/t' '\n' '\r' */
33 #define T_M_START_1 3 /* markup start < */
34 #define T_M_START_2 4 /* markup start </ */
35 #define T_M_STOP_1 5 /* markup stop > */
36 #define T_M_STOP_2 6 /* markup stop /> */
37 #define T_EQUAL 7 /* = */
38 #define T_QUOTE 8 /* \" or \' */
39 #define T_STRING 9 /* "string" */
40 #define T_IDENT 10 /* identifier */
41 #define T_DATA 11 /* data */
42 #define T_C_START 12 /* <!-- */
43 #define T_C_STOP 13 /* --> */
44 #define T_TI_START 14 /* <? */
45 #define T_TI_STOP 15 /* ?> */
46 #define T_DOCTYPE_START 16 /* <!DOCTYPE */
47 #define T_DOCTYPE_STOP 17 /* > */
48 #define T_CDATA_START 18 /* <![CDATA[ */
49 #define T_CDATA_STOP 19 /* ]]> */
50 
51 
52 /* public structure */
53 struct lexer
54 {
55  const char * lexbuf;
58  int lex_mode;
60  char *lex_malloc;
61 };
62 
63 
64 /* public functions */
65 void lexer_init(const char * buf, int size) XINE_DEPRECATED XINE_PROTECTED;
66 struct lexer *lexer_init_r(const char * buf, int size) XINE_PROTECTED;
68 int lexer_get_token_d_r(struct lexer * lexer, char ** tok, int * tok_size, int fixed) XINE_PROTECTED;
69 int lexer_get_token_d(char ** tok, int * tok_size, int fixed) XINE_DEPRECATED XINE_PROTECTED;
70 int lexer_get_token(char * tok, int tok_size) XINE_DEPRECATED XINE_PROTECTED;
71 char *lexer_decode_entities (const char *tok) XINE_PROTECTED;
72 
73 #endif
lexer::lexbuf_pos
int lexbuf_pos
Definition: xmllexer.h:57
lexer::lexbuf
const char * lexbuf
Definition: xmllexer.h:55
lexer::lex_mode
int lex_mode
Definition: xmllexer.h:58
lexer_init_r
struct lexer * lexer_init_r(const char *buf, int size)
Definition: xmllexer.c:108
attributes.h
lexer::lex_malloc
char * lex_malloc
Definition: xmllexer.h:60
lexer_init
void lexer_init(const char *buf, int size) XINE_DEPRECATED
Definition: xmllexer.c:94
lexer::lexbuf_size
int lexbuf_size
Definition: xmllexer.h:56
XINE_DEPRECATED
#define XINE_DEPRECATED
Definition: attributes.h:85
lexer_get_token
int lexer_get_token(char *tok, int tok_size) XINE_DEPRECATED
Definition: xmllexer.c:600
lexer_get_token_d
int lexer_get_token_d(char **tok, int *tok_size, int fixed) XINE_DEPRECATED
Definition: xmllexer.c:167
lexer
Definition: xmllexer.h:53
XINE_PROTECTED
#define XINE_PROTECTED
Definition: attributes.h:73
lexer_finalize_r
void lexer_finalize_r(struct lexer *lexer)
Definition: xmllexer.c:142
lexer_get_token_d_r
int lexer_get_token_d_r(struct lexer *lexer, char **tok, int *tok_size, int fixed)
Definition: xmllexer.c:171
lexer_decode_entities
char * lexer_decode_entities(const char *tok)
Definition: xmllexer.c:618
lexer::in_comment
int in_comment
Definition: xmllexer.h:59