libsyncml  0.5.4
Typedefs | Enumerations | Functions
SyncML Datastore Server Object

The public part. More...

Collaboration diagram for SyncML Datastore Server Object:

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

SmlDsServersmlDsServerNew (const char *type, SmlLocation *location, SmlError **error)
 
SmlDsServersmlDsClientNew (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. More...
 
const char * smlDsServerGetLocation (SmlDsServer *server)
 
const char * smlDsServerGetContentType (SmlDsServer *server)
 
SmlDsSessionsmlDsServerSendAlert (SmlDsServer *server, SmlSession *session, SmlAlertType type, const char *last, const char *next, SmlStatusReplyCb callback, void *userdata, SmlError **error)
 
SmlDsSessionsmlDsSessionNew (SmlDsServer *server, SmlSession *session, SmlError **error)
 
SmlDsSessionsmlDsSessionRef (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. More...
 
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. More...
 
void smlDsSessionGetChanges (SmlDsSession *dsession, SmlDsSessionChangesCb chgCallback, void *userdata)
 Gets a already received sync command. More...
 
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. More...
 
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. More...
 
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. More...
 
const char * smlDsSessionGetLocation (SmlDsSession *dsession)
 
const char * smlDsSessionGetContentType (SmlDsSession *dsession)
 
SmlDsServersmlDsSessionGetServer (SmlDsSession *dsession)
 
SmlLocationsmlDsSessionGetTarget (SmlDsSession *dsession)
 
void smlDsServerSetSanSessionCallback (SmlDsServer *server, SmlDsServerSanSessionCb callback, void *userdata)
 
void smlDsServerSetSanCallback (SmlDsServer *server, SmlDsServerSanCb callback, void *userdata) LIBSYNCML_DEPRECATED
 

Detailed Description

The public part.

Function Documentation

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

Parameters
serverThe DS server
callbackThe callback that will receive the alert
userdataThe userdata that will be passed to the alert

Definition at line 279 of file sml_ds_server.c.

Here is the call graph for this function:

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.

Parameters
serverThe DS server
callbackThe callback that will receive the alert
userdataThe userdata that will be passed to the alert
errorA pointer to a error struct
Returns
TRUE if the call was successful, FALSE otherwise

Definition at line 946 of file sml_ds_server.c.

Here is the call graph for this function:

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.

Parameters
serverThe DS server
callbackThe callback that will receive the alert
userdataThe userdata that will be passed to the alert
errorA pointer to a error struct
Returns
TRUE if the call was successful, FALSE otherwise

Definition at line 972 of file sml_ds_server.c.

Here is the call graph for this function:

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.

Parameters
serverThe DS server
chgCallbackThe callback that will receive all the changes (subcommands of sync)
syncCallbackThe callback that will receive the sync command
userdataThe userdata that will be passed to the sync and change callbacks
errorA pointer to a error struct
Returns
TRUE if the call was successful, FALSE otherwise

Definition at line 1022 of file sml_ds_server.c.

Here is the call graph for this function:

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().

Parameters
serverThe DS server
callbackThe callback that will the answer to the sync command
userdataThe userdata that will be passed to the alert
errorA pointer to a error struct
Returns
TRUE if the call was successful, FALSE otherwise

Definition at line 1077 of file sml_ds_server.c.

Here is the call graph for this function:

SmlBool smlDsSessionCloseSync ( SmlDsSession dsession,
SmlError **  error 
)

Closes the sync command.

Parameters
serverThe DS server
errorA pointer to a error struct
Returns
TRUE if the call was successful, FALSE otherwise

Definition at line 1160 of file sml_ds_server.c.

Here is the call graph for this function:

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.

Parameters
serverThe DS server
errorA pointer to a error struct
Returns
TRUE if the call was successful, FALSE otherwise

Definition at line 1214 of file sml_ds_server.c.

Here is the call graph for this function: