libsyncml
0.5.4
|
The public part. More...
![]() |
Typedefs | |
typedef struct SmlDsServer | SmlDsServer |
typedef struct SmlDsSession | SmlDsSession |
typedef void(* | SmlDsSessionConnectCb )(SmlDsSession *dsession, void *userdata) |
typedef SmlBool(* | SmlDsSessionAlertCb )(SmlDsSession *dsession, SmlAlertType type, const char *last, const char *next, void *userdata) |
typedef void(* | SmlDsSessionSyncCb )(SmlDsSession *dsession, unsigned int numchanges, void *userdata) |
typedef void(* | SmlDsSessionEventCb )(SmlDsSession *dsession, SmlDsEvent event, void *userdata) |
typedef SmlBool(* | SmlDsSessionChangesCb )(SmlDsSession *dsession, SmlChangeType type, const char *uid, char *data, unsigned int size, const char *contenttype, void *userdata, SmlError **error) |
typedef void(* | SmlDsSessionWriteCb )(SmlDsSession *dsession, SmlStatus *status, const char *newuid, void *userdata) |
typedef SmlErrorType(* | SmlDsServerSanSessionCb )(SmlDsServer *dsserver, SmlSession *session, SmlAlertType type, void *userdata) |
typedef SmlErrorType(* | SmlDsServerSanCb )(SmlDsServer *dsserver, SmlAlertType type, void *userdata) |
Enumerations | |
enum | SmlDsEvent { SML_DS_EVENT_GOTCHANGES = 0, SML_DS_EVENT_COMMITEDCHANGES = 1 } |
Functions | |
SmlDsServer * | smlDsServerNew (const char *type, SmlLocation *location, SmlError **error) |
SmlDsServer * | smlDsClientNew (const char *type, SmlLocation *location, SmlLocation *target, SmlError **error) |
SmlDsServerType | smlDsServerGetServerType (SmlDsServer *server) |
void | smlDsServerFree (SmlDsServer *server) |
SmlBool | smlDsServerRegister (SmlDsServer *server, SmlManager *manager, SmlError **error) |
SmlBool | smlDsServerAddSan (SmlDsServer *server, SmlNotification *san, SmlError **error) |
void | smlDsServerReset (SmlDsServer *server) |
void | smlDsServerSetConnectCallback (SmlDsServer *server, SmlDsSessionConnectCb callback, void *userdata) |
Registers a callback that will get called once a client connects. | |
const char * | smlDsServerGetLocation (SmlDsServer *server) |
const char * | smlDsServerGetContentType (SmlDsServer *server) |
SmlDsSession * | smlDsServerSendAlert (SmlDsServer *server, SmlSession *session, SmlAlertType type, const char *last, const char *next, SmlStatusReplyCb callback, void *userdata, SmlError **error) |
SmlDsSession * | smlDsSessionNew (SmlDsServer *server, SmlSession *session, SmlError **error) |
SmlDsSession * | smlDsSessionRef (SmlDsSession *dsession) |
void | smlDsSessionUnref (SmlDsSession *dsession) |
void | smlDsSessionDispatch (SmlDsSession *dsession) |
SmlBool | smlDsSessionCheck (SmlDsSession *dsession) |
void | smlDsSessionGetAlert (SmlDsSession *dsession, SmlDsSessionAlertCb callback, void *userdata) |
Gets a already received alert. | |
SmlBool | smlDsSessionSendAlert (SmlDsSession *dsession, SmlAlertType type, const char *last, const char *next, SmlStatusReplyCb callback, void *userdata, SmlError **error) |
Sends the alert to the remote side. | |
void | smlDsSessionGetChanges (SmlDsSession *dsession, SmlDsSessionChangesCb chgCallback, void *userdata) |
Gets a already received sync command. | |
void | smlDsSessionGetSync (SmlDsSession *dsession, SmlDsSessionSyncCb chgCallback, void *userdata) |
void | smlDsSessionGetEvent (SmlDsSession *dsession, SmlDsSessionEventCb eventCallback, void *userdata) |
SmlBool | smlDsSessionSendSync (SmlDsSession *dsession, unsigned int num_changes, SmlStatusReplyCb callback, void *userdata, SmlError **error) |
Start the sync command to send to the other side. | |
SmlBool | smlDsSessionQueueChange (SmlDsSession *dsession, SmlChangeType type, const char *uid, const char *data, unsigned int size, const char *contenttype, SmlDsSessionWriteCb callback, void *userdata, SmlError **error) |
SmlBool | smlDsSessionCloseSync (SmlDsSession *dsession, SmlError **error) |
Closes the sync command. | |
SmlBool | smlDsSessionQueueMap (SmlDsSession *dsession, const char *uid, const char *newuid, SmlError **error) |
SmlBool | smlDsSessionCloseMap (SmlDsSession *dsession, SmlStatusReplyCb callback, void *userdata, SmlError **error) |
Closes the map command. | |
const char * | smlDsSessionGetLocation (SmlDsSession *dsession) |
const char * | smlDsSessionGetContentType (SmlDsSession *dsession) |
SmlDsServer * | smlDsSessionGetServer (SmlDsSession *dsession) |
SmlLocation * | smlDsSessionGetTarget (SmlDsSession *dsession) |
void | smlDsServerSetSanSessionCallback (SmlDsServer *server, SmlDsServerSanSessionCb callback, void *userdata) |
void | smlDsServerSetSanCallback (SmlDsServer *server, SmlDsServerSanCb callback, void *userdata) LIBSYNCML_DEPRECATED |
The public part.
void smlDsServerSetConnectCallback | ( | SmlDsServer * | server, |
SmlDsSessionConnectCb | callback, | ||
void * | userdata | ||
) |
Registers a callback that will get called once a client connects.
This function will get called once a client connects to our ds server (which means that it sent a alert to our server). You can then use the smlDsServerRequestAlert() function to get the alert
server | The DS server |
callback | The callback that will receive the alert |
userdata | The userdata that will be passed to the alert |
Definition at line 279 of file sml_ds_server.c.
void smlDsSessionGetAlert | ( | SmlDsSession * | dsession, |
SmlDsSessionAlertCb | callback, | ||
void * | userdata | ||
) |
Gets a already received alert.
This function will get a already received alert or register a callback that will be called once the alert is received. If the alert already was waiting the callback is called immediatly.
server | The DS server |
callback | The callback that will receive the alert |
userdata | The userdata that will be passed to the alert |
error | A pointer to a error struct |
Definition at line 946 of file sml_ds_server.c.
SmlBool smlDsSessionSendAlert | ( | SmlDsSession * | dsession, |
SmlAlertType | type, | ||
const char * | last, | ||
const char * | next, | ||
SmlStatusReplyCb | callback, | ||
void * | userdata, | ||
SmlError ** | error | ||
) |
Sends the alert to the remote side.
This function will get a already received alert or register a callback that will be called once the alert is received. If the alert already was waiting the callback is called immediatly.
server | The DS server |
callback | The callback that will receive the alert |
userdata | The userdata that will be passed to the alert |
error | A pointer to a error struct |
Definition at line 972 of file sml_ds_server.c.
void smlDsSessionGetChanges | ( | SmlDsSession * | dsession, |
SmlDsSessionChangesCb | chgCallback, | ||
void * | userdata | ||
) |
Gets a already received sync command.
This function will get a already received sync command or register a callback that will be called once the sync is received. If the sync already was waiting the callback is called immediatly. The read callback is called with every subcommand of the sync.
server | The DS server |
chgCallback | The callback that will receive all the changes (subcommands of sync) |
syncCallback | The callback that will receive the sync command |
userdata | The userdata that will be passed to the sync and change callbacks |
error | A pointer to a error struct |
Definition at line 1022 of file sml_ds_server.c.
SmlBool smlDsSessionSendSync | ( | SmlDsSession * | dsession, |
unsigned int | num_changes, | ||
SmlStatusReplyCb | callback, | ||
void * | userdata, | ||
SmlError ** | error | ||
) |
Start the sync command to send to the other side.
This function will start the sync command with which the changes will be sent to the other side. After this command you can start to queue the changes. After you are done queueing changes, you have to end the sync command with smlDsServerCloseSync().
server | The DS server |
callback | The callback that will the answer to the sync command |
userdata | The userdata that will be passed to the alert |
error | A pointer to a error struct |
Definition at line 1077 of file sml_ds_server.c.
SmlBool smlDsSessionCloseSync | ( | SmlDsSession * | dsession, |
SmlError ** | error | ||
) |
Closes the sync command.
server | The DS server |
error | A pointer to a error struct |
Definition at line 1160 of file sml_ds_server.c.
SmlBool smlDsSessionCloseMap | ( | SmlDsSession * | dsession, |
SmlStatusReplyCb | callback, | ||
void * | userdata, | ||
SmlError ** | error | ||
) |
Closes the map command.
This will tell the ds server that you are not going to queue any more map commands.
server | The DS server |
error | A pointer to a error struct |
Definition at line 1214 of file sml_ds_server.c.