exip  Alpha 0.5.4
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
bin/headers/EXIParser.h
Go to the documentation of this file.
1 /*==================================================================*\
2 | EXIP - Embeddable EXI Processor in C |
3 |--------------------------------------------------------------------|
4 | This work is licensed under BSD 3-Clause License |
5 | The full license terms and conditions are located in LICENSE.txt |
6 \===================================================================*/
7 
19 #ifndef EXIPARSER_H_
20 #define EXIPARSER_H_
21 
22 #include "contentHandler.h"
23 
27 struct Parser
28 {
33  void* app_data;
34 };
35 
36 typedef struct Parser Parser;
37 
38 struct EXIParser
39 {
40  errorCode (*initParser)(Parser* parser, BinaryBuffer buffer, void* app_data);
41  errorCode (*parseHeader)(Parser* parser, boolean outOfBandOpts);
42  errorCode (*setSchema)(Parser* parser, EXIPSchema* schema);
43  errorCode (*parseNext)(Parser* parser);
44  errorCode (*pushEXIData)(char* inBuf, unsigned int bufSize, unsigned int* bytesRead, Parser* parser);
45  void (*destroyParser)(Parser* parser);
46 };
47 
48 typedef struct EXIParser EXIParser;
49 
53 extern const EXIParser parse;
54 
62 errorCode initParser(Parser* parser, BinaryBuffer buffer, void* app_data);
63 
64 
72 errorCode parseHeader(Parser* parser, boolean outOfBandOpts);
73 
86 errorCode setSchema(Parser* parser, EXIPSchema* schema);
87 
98 errorCode parseNext(Parser* parser);
99 
125 errorCode pushEXIData(char* inBuf, unsigned int bufSize, unsigned int* bytesRead, Parser* parser);
126 
131 void destroyParser(Parser* parser);
132 
133 #endif /* EXIPARSER_H_ */