xine-lib  1.2.9
xmllexer.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2009 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 #ifndef XINE_DEPRECATED
27 #define XINE_DEPRECATED
28 #endif
29 
30 #ifndef XINE_PROTECTED
31 #define XINE_PROTECTED
32 #endif
33 
34 /* public constants */
35 #define T_ERROR -1 /* lexer error */
36 #define T_EOF 0 /* end of file */
37 #define T_EOL 1 /* end of line */
38 #define T_SEPAR 2 /* separator ' ' '/t' '\n' '\r' */
39 #define T_M_START_1 3 /* markup start < */
40 #define T_M_START_2 4 /* markup start </ */
41 #define T_M_STOP_1 5 /* markup stop > */
42 #define T_M_STOP_2 6 /* markup stop /> */
43 #define T_EQUAL 7 /* = */
44 #define T_QUOTE 8 /* \" or \' */
45 #define T_STRING 9 /* "string" */
46 #define T_IDENT 10 /* identifier */
47 #define T_DATA 11 /* data */
48 #define T_C_START 12 /* <!-- */
49 #define T_C_STOP 13 /* --> */
50 #define T_TI_START 14 /* <? */
51 #define T_TI_STOP 15 /* ?> */
52 #define T_DOCTYPE_START 16 /* <!DOCTYPE */
53 #define T_DOCTYPE_STOP 17 /* > */
54 #define T_CDATA_START 18 /* <![CDATA[ */
55 #define T_CDATA_STOP 19 /* ]]> */
56 
57 
58 /* public structure */
59 struct lexer
60 {
61  const char * lexbuf;
64  int lex_mode;
66  char *lex_malloc;
67 };
68 
69 
70 /* public functions */
71 void lexer_init(const char * buf, int size) XINE_DEPRECATED XINE_PROTECTED;
72 struct lexer *lexer_init_r(const char * buf, int size) XINE_PROTECTED;
74 int lexer_get_token_d_r(struct lexer * lexer, char ** tok, int * tok_size, int fixed) XINE_PROTECTED;
75 int lexer_get_token_d(char ** tok, int * tok_size, int fixed) XINE_DEPRECATED XINE_PROTECTED;
76 int lexer_get_token(char * tok, int tok_size) XINE_DEPRECATED XINE_PROTECTED;
77 char *lexer_decode_entities (const char *tok) XINE_PROTECTED;
78 
79 #endif
struct lexer * lexer_init_r(const char *buf, int size)
Definition: xmllexer.c:108
Definition: xmllexer.h:59
int lexer_get_token_d_r(struct lexer *lexer, char **tok, int *tok_size, int fixed)
Definition: xmllexer.c:171
char * lexer_decode_entities(const char *tok)
Definition: xmllexer.c:618
int in_comment
Definition: xmllexer.h:65
void lexer_init(const char *buf, int size)
Definition: xmllexer.c:94
int lexer_get_token_d(char **tok, int *tok_size, int fixed)
Definition: xmllexer.c:167
int lexbuf_pos
Definition: xmllexer.h:63
int lex_mode
Definition: xmllexer.h:64
int lexbuf_size
Definition: xmllexer.h:62
void lexer_finalize_r(struct lexer *lexer)
Definition: xmllexer.c:142
char * lex_malloc
Definition: xmllexer.h:66
#define XINE_PROTECTED
Definition: attributes.h:73
int lexer_get_token(char *tok, int tok_size)
Definition: xmllexer.c:600
const char * lexbuf
Definition: xmllexer.h:61
#define XINE_DEPRECATED
Definition: xmllexer.h:27