libsyncml
0.5.4
|
Interfaces to assemble syncml messages. More...
![]() |
Functions | |
SmlAssembler * | smlAssemblerNew (SmlMimeType type, unsigned int limit, SmlError **error) |
Creates a new assembler. More... | |
void | smlAssemblerFree (SmlAssembler *assm) |
Frees a assembler. More... | |
SmlBool | smlAssemblerStart (SmlAssembler *assm, SmlSession *session, SmlError **error) |
Starts a new message. More... | |
SmlBool | smlAssemblerRun (SmlAssembler *assm, char **data, unsigned int *size, SmlBool *end, SmlBool final, SmlError **error) |
Assembles the complete message and returns the result. More... | |
unsigned int | smlAssemblerCheckSize (SmlAssembler *assm, SmlBool headeronly, SmlError **error) |
Assembles the complete message and returns the result. More... | |
unsigned int | smlAssemblerFlush (SmlAssembler *assm) |
Flushes the already parsed commands. More... | |
void | smlAssemblerRestoreCommands (SmlAssembler *assm) |
SmlBool | smlAssemblerGetSpace (SmlAssembler *assm, int *space, SmlCommand *parent, SmlCommand *cmd, SmlError **error) |
Gets the available space in the assembler. More... | |
SmlAssemblerResult | smlAssemblerStartCommand (SmlAssembler *assm, SmlCommand *parent, SmlCommand *cmd, SmlError **error) |
Starts a parent command. More... | |
SmlBool | smlAssemblerEndCommand (SmlAssembler *assm, SmlCommand *parent, SmlError **error) |
Ends a parent command. More... | |
SmlBool | smlAssemblerAddHeader (SmlAssembler *assm, SmlSession *session, SmlError **error) |
Assembles the header. More... | |
SmlAssemblerResult | smlAssemblerReserveStatus (SmlAssembler *assm, unsigned int cmdRef, unsigned int msgRef, unsigned int cmdID, SmlError **error) |
Reserves a place for a status with this assembler. More... | |
SmlAssemblerResult | smlAssemblerAddStatusFull (SmlAssembler *assm, SmlStatus *status, SmlBool force, SmlError **error) |
Assembles a status. More... | |
SmlAssemblerResult | smlAssemblerAddStatus (SmlAssembler *assm, SmlStatus *status, SmlError **error) |
void | smlAssemblerSetOption (SmlAssembler *assm, const char *optionname, const char *value) |
Sets a option on the assembler. More... | |
const char * | smlAssemblerGetOption (SmlAssembler *assm, const char *optionname) |
Gets a option from the assembler. More... | |
unsigned int | smlAssemblerGetLimit (SmlAssembler *assm) |
unsigned int | smlAssemblerGetRemoteMaxMsgSize (SmlAssembler *assm) |
void | smlAssemblerSetRequestedLimit (SmlAssembler *assm, unsigned int limit) |
void | smlAssemblerSetLimit (SmlAssembler *assm, unsigned int limit) |
unsigned int | smlAssemblerSetRemoteMaxMsgSize (SmlAssembler *assm, unsigned int limit) |
int | smlAssemblerGetSendingMaxObjSize (SmlAssembler *assm) |
int | smlAssemblerGetRequestedMaxObjSize (SmlAssembler *assm) |
unsigned int | smlAssemblerGetRemoteMaxObjSize (SmlAssembler *assm) |
void | smlAssemblerSetRequestedMaxObjSize (SmlAssembler *assm, int limit) |
void | smlAssemblerSetSendingMaxObjSize (SmlAssembler *assm, int limit) |
unsigned int | smlAssemblerSetRemoteMaxObjSize (SmlAssembler *assm, unsigned int limit) |
SmlBool | smlAssemblerIsEmpty (SmlAssembler *assm) |
SmlBool | smlAssemblerIsStatusMissing (SmlAssembler *assm) |
Checks if there are reserved statuses missing. More... | |
SmlBool | smlAssemblerGetNextCmdRef (SmlAssembler *assm, unsigned int *cmdRef, unsigned int *msgRef) |
Interfaces to assemble syncml messages.
SmlAssembler* smlAssemblerNew | ( | SmlMimeType | type, |
unsigned int | limit, | ||
SmlError ** | error | ||
) |
Creates a new assembler.
type | The type of the assembler |
limit | The maximum size that can be assembled |
error | A pointer to an error struct |
Definition at line 352 of file sml_parse.c.
Referenced by smlSessionNew().
void smlAssemblerFree | ( | SmlAssembler * | assm | ) |
Frees a assembler.
assm | The assembler to free |
Definition at line 402 of file sml_parse.c.
Referenced by smlSessionNew().
SmlBool smlAssemblerStart | ( | SmlAssembler * | assm, |
SmlSession * | session, | ||
SmlError ** | error | ||
) |
Starts a new message.
Note that the size already includes what will be needed to close the opened tags (like SyncML) and already includes the remaining needed tags (like Final)
assm | The assembler |
session | The session for which to start a message |
error | A pointer to an error struct |
Definition at line 428 of file sml_parse.c.
Referenced by smlSessionNew().
SmlBool smlAssemblerRun | ( | SmlAssembler * | assm, |
char ** | data, | ||
unsigned int * | size, | ||
SmlBool * | end, | ||
SmlBool | final, | ||
SmlError ** | error | ||
) |
Assembles the complete message and returns the result.
assm | The assembler |
data | Place that will receive the data |
size | Place that will receive the size |
error | A pointer to an error struct |
Definition at line 456 of file sml_parse.c.
unsigned int smlAssemblerCheckSize | ( | SmlAssembler * | assm, |
SmlBool | headeronly, | ||
SmlError ** | error | ||
) |
Assembles the complete message and returns the result.
assm | The assembler |
data | Place that will receive the data |
size | Place that will receive the size |
error | A pointer to an error struct |
Definition at line 485 of file sml_parse.c.
Referenced by smlAssemblerAddHeader(), smlAssemblerAddStatusFull(), smlAssemblerGetSpace(), and smlAssemblerStartCommand().
unsigned int smlAssemblerFlush | ( | SmlAssembler * | assm | ) |
Flushes the already parsed commands.
This command can be used to flush the already parsed commands. You can use this to flush the assembler after you pull part of the data using smlAssemblerRun()
assm | The assembler |
error | A pointer to an error struct |
Definition at line 514 of file sml_parse.c.
SmlBool smlAssemblerGetSpace | ( | SmlAssembler * | assm, |
int * | space, | ||
SmlCommand * | parent, | ||
SmlCommand * | cmd, | ||
SmlError ** | error | ||
) |
Gets the available space in the assembler.
This command tries to add the given command to the assembler without the item data. Then it returns how big the item data could be without violating the limits. If there is not limit set, -1 is returned. This command only makes sense for change commands
Definition at line 545 of file sml_parse.c.
SmlAssemblerResult smlAssemblerStartCommand | ( | SmlAssembler * | assm, |
SmlCommand * | parent, | ||
SmlCommand * | cmd, | ||
SmlError ** | error | ||
) |
Starts a parent command.
This command starts a parent command. All commands added after this one will be added as subcommands. This functions also take care if the parent command would spawn 2 messages. This function can nest.
assm | The assembler |
parent | The parent to the command to add. NULL if none |
cmd | The command to add |
error | A pointer to an error struct |
Definition at line 659 of file sml_parse.c.
SmlBool smlAssemblerEndCommand | ( | SmlAssembler * | assm, |
SmlCommand * | parent, | ||
SmlError ** | error | ||
) |
Ends a parent command.
Ends the last previously started parent command. All commands added afterwards wont be subcommands any more.
assm | The assembler |
parent | The parent of the child to end. NULL if none |
error | A pointer to an error struct |
Definition at line 722 of file sml_parse.c.
SmlBool smlAssemblerAddHeader | ( | SmlAssembler * | assm, |
SmlSession * | session, | ||
SmlError ** | error | ||
) |
Assembles the header.
This command adds the header to the assembler.
assm | The assembler |
session | The session header to add |
error | A pointer to an error struct |
Definition at line 762 of file sml_parse.c.
SmlAssemblerResult smlAssemblerReserveStatus | ( | SmlAssembler * | assm, |
unsigned int | cmdRef, | ||
unsigned int | msgRef, | ||
unsigned int | cmdID, | ||
SmlError ** | error | ||
) |
Reserves a place for a status with this assembler.
This command reserves a place for a status. Call this function to make sure that the statuses are added in the correct order. You dont have to reserve for cmdRef=0 . This one is always reserved
assm | The assembler |
cmdRef | The cmdRef of the status to reserve |
cmdID | The cmdID for this status |
error | A pointer to an error struct |
Definition at line 806 of file sml_parse.c.
SmlAssemblerResult smlAssemblerAddStatusFull | ( | SmlAssembler * | assm, |
SmlStatus * | status, | ||
SmlBool | force, | ||
SmlError ** | error | ||
) |
Assembles a status.
This command adds a status to the assembler. The complete package is assembled afterwards to see if the status fits inside the current message. If the status does not fit, SML_ASSEMBLER_RESULT_MISMATCH is returned
assm | The assembler |
status | The command to add |
force | If set to TRUE, libsyncml will ignore if the outgoing limit has been reached |
error | A pointer to an error struct |
Definition at line 839 of file sml_parse.c.
Referenced by smlAssemblerAddStatusFull().
void smlAssemblerSetOption | ( | SmlAssembler * | assm, |
const char * | optionname, | ||
const char * | value | ||
) |
Sets a option on the assembler.
assm | The assembler |
optionname | The name of the option to set |
value | The new value |
Definition at line 896 of file sml_parse.c.
Referenced by smlSessionEnd(), and smlSessionNew().
const char* smlAssemblerGetOption | ( | SmlAssembler * | assm, |
const char * | optionname | ||
) |
Gets a option from the assembler.
assm | The assembler |
optionname | The name of the option to get |
Definition at line 914 of file sml_parse.c.
SmlBool smlAssemblerIsStatusMissing | ( | SmlAssembler * | assm | ) |
Checks if there are reserved statuses missing.
assm | The assembler to check |
Definition at line 1053 of file sml_parse.c.