Edinburgh Speech Tools  2.1-release
xmlparser.c File Reference
#include <stdarg.h>
#include <stdlib.h>
#include "system.h"
#include "charset.h"
#include "string16.h"
#include "ctype16.h"
#include "dtd.h"
#include "input.h"
#include "stdio16.h"
#include "xmlparser.h"
Include dependency graph for xmlparser.c:

Go to the source code of this file.

Macros

#define require(x)   if(x >= 0) {} else return -1
 
#define require0(x)   if(x >= 0) {} else return 0
 
#define Consume(buf)   (buf = 0, buf##size = 0)
 
#define ExpandBuf(buf, sz)   if(buf##size >= (sz)+1) {} else if((buf = Realloc(buf, (buf##size = sz + 1) * sizeof(Char)))) {} else return error(p, "System error")
 
#define CopyName(n)   if((n = Malloc((p->namelen + 1)*sizeof(Char)))) {memcpy(n, p->name, p->namelen * sizeof(Char)); n[p->namelen] = 0;} else return error(p, "System error");
 
#define CopyName0(n)   if((n = Malloc((p->namelen + 1)*sizeof(Char)))) {memcpy(n, p->name, p->namelen * sizeof(Char)); n[p->namelen] = 0;} else {error(p, "System error"); return 0;}
 

Enumerations

enum  literal_type { LT_cdata_attr, LT_tok_attr, LT_plain, LT_entity }
 

Functions

void FreeContentParticle (ContentParticle cp)
 
int ParserInit (void)
 
void FreeXBit (XBit xbit)
 
Parser NewParser (void)
 
void FreeParser (Parser p)
 
InputSource ParserRootSource (Parser p)
 
Entity ParserRootEntity (Parser p)
 
void ParserSetCallbackArg (Parser p, void *arg)
 
void ParserSetDtdCallback (Parser p, CallbackProc cb)
 
void ParserSetWarningCallback (Parser p, CallbackProc cb)
 
void ParserSetEntityOpener (Parser p, EntityOpenerProc opener)
 
XBit ReadXTree (Parser p)
 
void FreeXTree (XBit tree)
 
XBit ReadXBit (Parser p)
 
XBit PeekXBit (Parser p)
 
int ParserPush (Parser p, InputSource source)
 
void ParserPop (Parser p)
 
void ParserSetFlag (Parser p, ParserFlag flag, int value)
 
void ParserPerror (Parser p, XBit bit)
 
XBit ParseDtd (Parser p, Entity e)
 

Variables

const char8XBitTypeName [XBIT_enum_count]
 

Macro Definition Documentation

#define require (   x)    if(x >= 0) {} else return -1

Definition at line 107 of file xmlparser.c.

#define require0 (   x)    if(x >= 0) {} else return 0

Definition at line 108 of file xmlparser.c.

#define Consume (   buf)    (buf = 0, buf##size = 0)

Definition at line 110 of file xmlparser.c.

#define ExpandBuf (   buf,
  sz 
)    if(buf##size >= (sz)+1) {} else if((buf = Realloc(buf, (buf##size = sz + 1) * sizeof(Char)))) {} else return error(p, "System error")

Definition at line 111 of file xmlparser.c.

#define CopyName (   n)    if((n = Malloc((p->namelen + 1)*sizeof(Char)))) {memcpy(n, p->name, p->namelen * sizeof(Char)); n[p->namelen] = 0;} else return error(p, "System error");

Definition at line 114 of file xmlparser.c.

#define CopyName0 (   n)    if((n = Malloc((p->namelen + 1)*sizeof(Char)))) {memcpy(n, p->name, p->namelen * sizeof(Char)); n[p->namelen] = 0;} else {error(p, "System error"); return 0;}

Definition at line 116 of file xmlparser.c.

Enumeration Type Documentation

Enumerator
LT_cdata_attr 
LT_tok_attr 
LT_plain 
LT_entity 

Definition at line 95 of file xmlparser.c.

Function Documentation

void FreeContentParticle ( ContentParticle  cp)

Definition at line 2649 of file xmlparser.c.

int ParserInit ( void  )

Definition at line 137 of file xmlparser.c.

void FreeXBit ( XBit  xbit)

Definition at line 300 of file xmlparser.c.

Parser NewParser ( void  )

Definition at line 432 of file xmlparser.c.

void FreeParser ( Parser  p)

Definition at line 488 of file xmlparser.c.

InputSource ParserRootSource ( Parser  p)

Definition at line 498 of file xmlparser.c.

Entity ParserRootEntity ( Parser  p)

Definition at line 508 of file xmlparser.c.

void ParserSetCallbackArg ( Parser  p,
void *  arg 
)

Definition at line 513 of file xmlparser.c.

void ParserSetDtdCallback ( Parser  p,
CallbackProc  cb 
)

Definition at line 518 of file xmlparser.c.

void ParserSetWarningCallback ( Parser  p,
CallbackProc  cb 
)

Definition at line 523 of file xmlparser.c.

void ParserSetEntityOpener ( Parser  p,
EntityOpenerProc  opener 
)

Definition at line 528 of file xmlparser.c.

XBit ReadXTree ( Parser  p)

Definition at line 535 of file xmlparser.c.

void FreeXTree ( XBit  tree)

Definition at line 613 of file xmlparser.c.

XBit ReadXBit ( Parser  p)

Definition at line 633 of file xmlparser.c.

XBit PeekXBit ( Parser  p)

Definition at line 643 of file xmlparser.c.

int ParserPush ( Parser  p,
InputSource  source 
)

Definition at line 656 of file xmlparser.c.

void ParserPop ( Parser  p)

Definition at line 711 of file xmlparser.c.

void ParserSetFlag ( Parser  p,
ParserFlag  flag,
int  value 
)

Definition at line 756 of file xmlparser.c.

void ParserPerror ( Parser  p,
XBit  bit 
)

Definition at line 772 of file xmlparser.c.

XBit ParseDtd ( Parser  p,
Entity  e 
)

Definition at line 1986 of file xmlparser.c.

Variable Documentation

const char8* XBitTypeName[XBIT_enum_count]
Initial value:
= {
"dtd",
"start",
"empty",
"end",
"eof",
"pcdata",
"pi",
"comment",
"cdsect",
"xml",
"error",
"warning",
"none"
}

Definition at line 118 of file xmlparser.c.