Main Page | Modules | File List | Globals

XaintSteam


Typedefs

typedef void(* XaintStreamPairEvent )(XaintStream *xaintst, XaintChar *key, XaintChar *value, XaintChar *ws, XaintType type)
typedef void(* XaintStreamWhitespaceEvent )(XaintStream *xaintst, XaintChar *data)
typedef void(* XaintStreamPragmaEvent )(XaintStream *xaintst, XaintChar *data)
typedef void(* XaintStreamCommentEvent )(XaintStream *xaintst, XaintChar *data)
typedef void(* XaintStreamDataRequest )(XaintStream *xaintst)

Functions

XaintStream * XaintStream_new (void)
XAINT_API void XaintStream_delete (XaintStream *xaintst)
XAINT_API void XaintStream_setStoreRecordNames (XaintStream *xaintst, XaintBool storeRecordNames)
XAINT_API XaintBool XaintStream_getStoreRecordNames (XaintStream *xaintst)
XAINT_API XaintCharXaintStream_getRecordName (XaintStream *xaintst)
XAINT_API void XaintStream_setPairEvent (XaintStream *xaintst, XaintStreamPairEvent event)
XAINT_API XaintStreamPairEvent XaintStream_getPairEvent (XaintStream *xaintst)
XAINT_API void XaintStream_setWhitespaceEvent (XaintStream *xaintst, XaintStreamWhitespaceEvent event)
XAINT_API XaintStreamWhitespaceEvent XaintStream_getWhitespaceEvent (XaintStream *xaintst)
XAINT_API void XaintStream_setPragmaEvent (XaintStream *xaintst, XaintStreamPragmaEvent event)
XAINT_API XaintStreamPragmaEvent XaintStream_getPragmaEvent (XaintStream *xaintst)
XAINT_API void XaintStream_setCommentEvent (XaintStream *xaintst, XaintStreamCommentEvent event)
XAINT_API XaintStreamCommentEvent XaintStream_getCommentEvent (XaintStream *xaintst)
XAINT_API void XaintStream_setDataRequest (XaintStream *xaintst, XaintStreamDataRequest dataRequest)
XAINT_API XaintStreamDataRequest XaintStream_getDataRequest (XaintStream *xaintst)
XAINT_API void XaintStream_setUserData (XaintStream *xaintst, XaintUnknown userData)
XAINT_API XaintUnknown XaintStream_getUserData (XaintStream *xaintst)
XAINT_API XaintErr XaintStream_getLastError (XaintStream *xaintst)
XAINT_API XaintNum XaintStream_getRowNum (XaintStream *xaintst)
XAINT_API XaintNum XaintStream_getColNum (XaintStream *xaintst)
XAINT_API void XaintStream_feedData (XaintStream *xaintst, XaintChar *data, XaintNum size)
XAINT_API XaintBool XaintStream_parse (XaintStream *xaintst)
XAINT_API XaintBool XaintStream_parseString (XaintStream *xaintst, XaintChar *string)


Typedef Documentation

typedef void(* XaintStreamCommentEvent)(XaintStream *xaintst, XaintChar *data)
 

A type definition for the PragmaEvent callback of the XaintStream.

Definition at line 252 of file xaint.h.

typedef void(* XaintStreamDataRequest)(XaintStream *xaintst)
 

A type definition for the CommentEvent callback of the XaintStream.

Definition at line 253 of file xaint.h.

typedef void(* XaintStreamPairEvent)(XaintStream *xaintst, XaintChar *key, XaintChar *value, XaintChar *ws, XaintType type)
 

The XaintStream class.

Definition at line 249 of file xaint.h.

typedef void(* XaintStreamPragmaEvent)(XaintStream *xaintst, XaintChar *data)
 

A type definition for the WhitespaceEvent callback of the XaintStream.

Definition at line 251 of file xaint.h.

typedef void(* XaintStreamWhitespaceEvent)(XaintStream *xaintst, XaintChar *data)
 

A type definition for the PairEvent callback of the XaintStream.

Definition at line 250 of file xaint.h.


Function Documentation

XAINT_API void XaintStream_delete XaintStream *  xaintst  ) 
 

Removes the XaintStream object from memory.

XAINT_API void XaintStream_feedData XaintStream *  xaintst,
XaintChar data,
XaintNum  size
 

Used to feed more data to the XaintStream during the /a XaintStreamDataRequest callback.

XAINT_API XaintNum XaintStream_getColNum XaintStream *  xaintst  ) 
 

Gets the current col number.

XAINT_API XaintStreamCommentEvent XaintStream_getCommentEvent XaintStream *  xaintst  ) 
 

Set the CommentEvent property.

XAINT_API XaintStreamDataRequest XaintStream_getDataRequest XaintStream *  xaintst  ) 
 

Gets the data request callback event for the XaintStream.

XAINT_API XaintErr XaintStream_getLastError XaintStream *  xaintst  ) 
 

Gets the parsing error code.

XAINT_API XaintStreamPairEvent XaintStream_getPairEvent XaintStream *  xaintst  ) 
 

Get the PairEvent property.

XAINT_API XaintStreamPragmaEvent XaintStream_getPragmaEvent XaintStream *  xaintst  ) 
 

Get the PragmaEvent property.

XAINT_API XaintChar* XaintStream_getRecordName XaintStream *  xaintst  ) 
 

Get the current RecordName from memory.

XAINT_API XaintNum XaintStream_getRowNum XaintStream *  xaintst  ) 
 

Gets the current row number.

XAINT_API XaintBool XaintStream_getStoreRecordNames XaintStream *  xaintst  ) 
 

Get the storeRecordNames property.

XAINT_API XaintUnknown XaintStream_getUserData XaintStream *  xaintst  ) 
 

Gets the UserData property.

XAINT_API XaintStreamWhitespaceEvent XaintStream_getWhitespaceEvent XaintStream *  xaintst  ) 
 

Get the WhitespaceEvent property.

XaintStream* XaintStream_new void   ) 
 

Creates a new XaintStream into memory. Example:

This example contains all XaintStream functions.

#include <stdio.h> #include <xaint.h> static void DataRequest(XaintStream *stream) { FILE *f; char buffer[10]; size_t bytesRead; f = (FILE*)XaintStream_getUserData(stream); bytesRead = fread(buffer, 1, sizeof(buffer), f); XaintStream_feedData(stream, buffer, bytesRead); } static void PairEvent(XaintStream *stream, XaintChar *key, XaintChar *value, XaintChar* ws, XaintType type) { printf("Pair Event [%s] \"%s\" type: '%c'\n", key, value, type); } static void CommentEvent(XaintStream *stream, unsigned char *data) { printf("Comment Event (%s)\n", data); } static void PragmaEvent(XaintStream *stream, unsigned char *data) { printf("Pragma Event (%s)\n", data); } static void WhitespaceEvent(XaintStream *stream, unsigned char *data) { printf("Whitespace Event (%s)\n", data); } int main() { XaintStream *stream; FILE *f; f = fopen("note.xnt", "rb"); stream = XaintStream_new(); XaintStream_setUserData(stream, f); XaintStream_setDataRequest(stream, DataRequest); XaintStream_setPairEvent(stream, PairEvent); XaintStream_setPragmaEvent(stream, PragmaEvent); XaintStream_setWhitespaceEvent(stream, WhitespaceEvent); XaintStream_setCommentEvent(stream, CommentEvent); XaintStream_setStoreRecordNames(stream, XAINT_TRUE); if (!XaintStream_parse(stream)) { printf("error: #%d, (col %d, row %d)\n", XaintStream_getLastError(stream), XaintStream_getColNum(stream), XaintStream_getRowNum(stream)); return 1; } fclose(f); XaintStream_delete(stream); return 0; }

XAINT_API XaintBool XaintStream_parse XaintStream *  xaintst  ) 
 

Begins the parsing.

XAINT_API XaintBool XaintStream_parseString XaintStream *  xaintst,
XaintChar string
 

Parses a string and returns immediately.

XAINT_API void XaintStream_setCommentEvent XaintStream *  xaintst,
XaintStreamCommentEvent  event
 

Get the CommentEvent property.

XAINT_API void XaintStream_setDataRequest XaintStream *  xaintst,
XaintStreamDataRequest  dataRequest
 

Sets the data request callback event for the XaintStream.

XAINT_API void XaintStream_setPairEvent XaintStream *  xaintst,
XaintStreamPairEvent  event
 

Set the PairEvent property.

XAINT_API void XaintStream_setPragmaEvent XaintStream *  xaintst,
XaintStreamPragmaEvent  event
 

Set the PragmaEvent property.

XAINT_API void XaintStream_setStoreRecordNames XaintStream *  xaintst,
XaintBool  storeRecordNames
 

Set the storeRecordNames property. When this property is set to true, all XAINT_TYPE_LIST names are recorded in memory. The current name can then be retrieved using the XaintStream_getRecordName function.

XAINT_API void XaintStream_setUserData XaintStream *  xaintst,
XaintUnknown  userData
 

Sets the UserData property.

XAINT_API void XaintStream_setWhitespaceEvent XaintStream *  xaintst,
XaintStreamWhitespaceEvent  event
 

Set the WhitespaceEvent property.


Generated on Sun Apr 25 11:36:04 2004 for Xaint by doxygen 1.3.6