libsyncml
0.5.4
|
Interfaces to parse syncml messages. More...
![]() |
Functions | |
SmlParser * | smlParserNew (SmlMimeType type, unsigned int limit, SmlError **error) |
Creates a new parser. | |
void | smlParserSetManager (SmlParser *parser, SmlManager *manager) |
void | smlParserFree (SmlParser *parser) |
Frees a parser. | |
SmlBool | smlParserStart (SmlParser *parser, const char *data, unsigned int size, SmlError **error) |
Starts the parser on a given data buffer. | |
SmlBool | smlParserGetHeader (SmlParser *parser, SmlHeader **header, SmlCred **cred, SmlError **error) |
Parses the SyncHdr. | |
SmlParserResult | smlParserGetCommand (SmlParser *parser, SmlCommand **cmd, SmlError **error) |
Parses the next command. | |
SmlBool | smlParserGetStatus (SmlParser *parser, SmlStatus **status, SmlError **error) |
Parses the next status. | |
SmlBool | smlParserEnd (SmlParser *parser, SmlBool *final, SmlBool *end, SmlError **error) |
Ends the parsing. |
Interfaces to parse syncml messages.
Creates a new parser.
type | The type of the parser |
error | A pointer to an error struct |
Definition at line 50 of file sml_parse.c.
void smlParserFree | ( | SmlParser * | parser | ) |
Frees a parser.
parser | The parser to free |
Definition at line 108 of file sml_parse.c.
SmlBool smlParserStart | ( | SmlParser * | parser, |
const char * | data, | ||
unsigned int | size, | ||
SmlError ** | error | ||
) |
Starts the parser on a given data buffer.
This function will parse the data up to the SyncHdr tag
parser | The parser |
data | The data that should be parsed |
size | The size of the data |
error | A pointer to an error struct |
Definition at line 132 of file sml_parse.c.
SmlBool smlParserGetHeader | ( | SmlParser * | parser, |
SmlHeader ** | header, | ||
SmlCred ** | cred, | ||
SmlError ** | error | ||
) |
Parses the SyncHdr.
This function will parse the data inside the SyncHdr Tag. Possible error case are:
parser | The parser |
header | The return location of the header |
error | A pointer to an error struct |
Definition at line 216 of file sml_parse.c.
SmlParserResult smlParserGetCommand | ( | SmlParser * | parser, |
SmlCommand ** | cmd, | ||
SmlError ** | error | ||
) |
Parses the next command.
This function will parse the next command found in the syncbody. Note that if you call this function too early (before the synchdr is parsed this function will return an error.) The correct order is: getHeader, getStatus until NULL, then getCommand until NULL and then End to end parsing.
parser | The parser |
cmd | The return location of the command |
error | A pointer to an error struct |
Definition at line 250 of file sml_parse.c.
Parses the next status.
This function will parse the next status found in the syncbody. Note that if you call this function too early (before the synchdr is parsed this function will return an error.) The correct order is: getHeader, getStatus until NULL, then getCommand until NULL and then End to end parsing.
parser | The parser |
status | The return location of the status |
error | A pointer to an error struct |
Definition at line 284 of file sml_parse.c.
Ends the parsing.
This function will check that all needed closing tags are in place
parser | The parser |
final | Return location to see if this was the final message |
end | Return location to see if this message was a end message (only statuses) |
error | A pointer to an error struct |
Definition at line 314 of file sml_parse.c.