xine-lib: xine-lib-1.2.12/src/xine-utils/xmllexer.c File Reference

xine-lib 1.2.12

Macros | Enumerations | Functions | Variables
xmllexer.c File Reference
`#include <xine/xineutils.h>`
`#include <xine/xmllexer.h>`
`#include <stdio.h>`
`#include <ctype.h>`
`#include <string.h>`
`#include <stdlib.h>`
`#include "bswap.h"`
`#include "xine_private.h"`

## Macros
#define | LOG_MODULE "xmllexer"
#define | LOG_VERBOSE

## Enumerations
enum | utf { UTF32BE , UTF32LE , UTF16BE , UTF16LE }
enum | { NORMAL , DATA , CDATA }
enum | lexer_state_t { STATE_UNKNOWN = -1 , STATE_IDLE , STATE_EOL , STATE_SEPAR , STATE_T_M_START , STATE_T_M_STOP_1 , STATE_T_M_STOP_2 , STATE_T_EQUAL , STATE_T_STRING_SINGLE , STATE_T_STRING_DOUBLE , STATE_T_COMMENT , STATE_T_TI_STOP , STATE_T_DASHDASH , STATE_T_C_STOP , STATE_IDENT }

## Functions
static void | lex_convert (struct lexer *lexer, const char *buf, int size, enum utf utf)
void | lexer_init (const char *buf, int size)
struct lexer * | lexer_init_r (const char *buf, int size)
void | lexer_finalize_r (struct lexer *lexer)
int | lexer_get_token_d (char **_tok, int *_tok_size, int fixed)
int | lexer_get_token_d_r (struct lexer *lexer, char **_tok, int *_tok_size, int fixed)
int | lexer_get_token (char *tok, int tok_size)
char * | lexer_decode_entities (const char *tok)

## Variables
struct lexer * | static_lexer
struct {
char code
unsigned char namelen
char name [6]
} | lexer_entities []

## Macro Definition Documentation

## ◆ LOG_MODULE

#define LOG_MODULE "xmllexer"

## ◆ LOG_VERBOSE

#define LOG_VERBOSE

## Enumeration Type Documentation

## ◆ anonymous enum

anonymous enum

Enumerator
NORMAL |
DATA |
CDATA |

## ◆ lexer_state_t

enum lexer_state_t

Enumerator
STATE_UNKNOWN |
STATE_IDLE |
STATE_EOL |
STATE_SEPAR |
STATE_T_M_START |
STATE_T_M_STOP_1 |
STATE_T_M_STOP_2 |
STATE_T_EQUAL |
STATE_T_STRING_SINGLE |
STATE_T_STRING_DOUBLE |
STATE_T_COMMENT |
STATE_T_TI_STOP |
STATE_T_DASHDASH |
STATE_T_C_STOP |
STATE_IDENT |

## ◆ utf

enum utf

Enumerator
UTF32BE |
UTF32LE |
UTF16BE |
UTF16LE |

## Function Documentation

## ◆ lex_convert()

static void lex_convert | ( | struct lexer * | lexer,
|  | const char * | buf,
|  | int | size,
|  | enum utf | utf
| ) |  |
| static

References _X_BE_16, _X_BE_32, _X_LE_16, _X_LE_32, lexer::lex_malloc, lexer::lexbuf, lexer::lexbuf_size, UTF16BE, UTF16LE, UTF32BE, and UTF32LE.

Referenced by lexer_init_r().

## ◆ lexer_decode_entities()

char * lexer_decode_entities | ( | const char * | tok | ) |

References code, lexer_entities, name, namelen, and NULL.

Referenced by xml_parser_get_node_internal().

## ◆ lexer_finalize_r()

void lexer_finalize_r | ( | struct lexer * | lexer | ) |

References _x_freep(), and lexer::lex_malloc.

Referenced by lexer_init(), and xml_parser_finalize_r().

## ◆ lexer_get_token()

int lexer_get_token | ( | char * | tok,
|  | int | tok_size
| ) |  |

References lexer_get_token_d_r(), and static_lexer.

## ◆ lexer_get_token_d()

int lexer_get_token_d | ( | char ** | _tok,
|  | int * | _tok_size,
|  | int | fixed
| ) |  |

References lexer_get_token_d_r(), and static_lexer.

## ◆ lexer_get_token_d_r()

int lexer_get_token_d_r | ( | struct lexer * | lexer,
|  | char ** | _tok,
|  | int * | _tok_size,
|  | int | fixed
| ) |  |

References CDATA, DATA, lexer::in_comment, lexer::lex_mode, lexer::lexbuf, lexer::lexbuf_pos, lexer::lexbuf_size, lexer_get_token_d_r(), lprintf, NORMAL, STATE_EOL, STATE_IDENT, STATE_IDLE, STATE_SEPAR, STATE_T_C_STOP, STATE_T_COMMENT, STATE_T_DASHDASH, STATE_T_EQUAL, STATE_T_M_START, STATE_T_M_STOP_1, STATE_T_M_STOP_2, STATE_T_STRING_DOUBLE, STATE_T_STRING_SINGLE, STATE_T_TI_STOP, T_C_START, T_C_STOP, T_CDATA_START, T_CDATA_STOP, T_DATA, T_DOCTYPE_START, T_EOF, T_EOL, T_EQUAL, T_ERROR, T_IDENT, T_M_START_1, T_M_START_2, T_M_STOP_1, T_M_STOP_2, T_SEPAR, T_STRING, T_TI_START, and T_TI_STOP.

Referenced by lexer_get_token(), lexer_get_token_d(), lexer_get_token_d_r(), and xml_parser_get_node_internal().

## ◆ lexer_init()

void lexer_init | ( | const char * | buf,
|  | int | size
| ) |  |

References lexer_finalize_r(), lexer_init_r(), and static_lexer.

## ◆ lexer_init_r()

struct lexer * lexer_init_r | ( | const char * | buf,
|  | int | size
| ) |  |

References lexer::in_comment, lex_convert(), lexer::lex_mode, lexer::lexbuf, lexer::lexbuf_pos, lexer::lexbuf_size, lprintf, NORMAL, NULL, UTF16BE, UTF16LE, UTF32BE, and UTF32LE.

Referenced by lexer_init(), and xml_parser_init_r().

## Variable Documentation

## ◆ code

char code

Referenced by _x_report_audio_format_tag(), _x_report_video_fourcc(), code_to_text(), FillSoundBuffer(), lexer_decode_entities(), libmpeg2_accel_frame_completion(), libmpeg2_accel_slice(), mpeg2_decode_data(), mpeg2_find_sequence_header(), mpeg2_slice(), mpeg2_stats(), mpeg2_xvmc_slice(), mpeg2_xxmc_slice(), mpeg2_xxmc_vld_frame_complete(), mpeg_parser_decode_data(), osd_search(), parse_chunk(), read_exp_golomb(), read_exp_golomb_s(), rtsp_get_answers(), rtsp_get_code(), slice_init(), slice_xvmc_init(), and stats_slice().

## ◆

struct { ... } lexer_entities[]

Initial value:
= {
{ '"', 4, "quot" },
{ '&', 3, "amp" },
{ '\'', 4, "apos" },
{ '<', 2, "lt" },
{ '>', 2, "gt" },
{ '\0', 0, "" }
}

Referenced by lexer_decode_entities().

## ◆ name

char name[6]

Referenced by lexer_decode_entities().

## ◆ namelen

unsigned char namelen

Referenced by lexer_decode_entities().

## ◆ static_lexer

struct lexer* static_lexer

Referenced by lexer_get_token(), lexer_get_token_d(), and lexer_init().