sml_ds_server_internals.h
/*
* libsyncml - A syncml protocol implementation
* Copyright (C) 2005 Armin Bauer <armin.bauer@opensync.org>
* Copyright (C) 2008 Michael Bell <michael.bell@opensync.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef _SML_DS_SERVER_INTERNALS_H_
#define _SML_DS_SERVER_INTERNALS_H_
typedef void (* SmlDsSessionMapCb) (SmlDsSession *dsession, SmlLocation *orig, SmlLocation *mapped, void *userdata);
typedef struct SmlWriteContext {
SmlDsSessionWriteCb callback;
char *uid;
char *newuid;
SmlStatus *status;
void *userdata;
SmlChangeType type;
SmlDsSession *session;
} SmlWriteContext;
struct SmlDsSession {
gint refCount;
SmlDsServer *server;
SmlSession *session;
SmlLocation *target;
SmlLocation *location;
SmlDsSessionAlertCb recvAlertCallback;
void *recvAlertCallbackUserdata;
SmlCommand *alertCommand;
SmlStatusReplyCb sentAlertCallback;
void *sentAlertCallbackUserdata;
SmlDsSessionSyncCb recvSyncCallback;
void *recvSyncCallbackUserdata;
SmlDsSessionChangesCb changesCallback;
void *changesCallbackUserdata;
GList *recvSync;
GList *recvChanges;
SmlErrorType syncReply;
SmlBool finalLock;
SmlBool emptySync;
SmlStatusReplyCb sentSyncCallback;
void *sentSyncCallbackUserdata;
SmlDsSessionEventCb recvEventCallback;
void *recvEventCallbackUserdata;
SmlCommand *syncCommand;
GList *pendingMaps;
GMutex *pendingMapsLock;
GList *mapItems;
SmlDsSessionMapCb recvMappingCallback;
void *recvMappingCallbackUserdata;
GMutex *write_lock;
GMutex *lock;
};
struct SmlDsServer {
SmlLocation *location;
SmlLocation *target;
char *contenttype;
SmlDsServerType servertype;
SmlManager *manager;
SmlDsSessionConnectCb connectCallback;
void *connectCallbackUserdata;
SmlDsServerSanSessionCb sanSessionCallback;
void *sanSessionCallbackUserdata;
SmlDsServerSanCb sanCallback;
void *sanCallbackUserdata;
};
void smlDsSessionRecvAlert(SmlSession *session, SmlCommand *cmd, void *userdata);
void smlDsSessionRecvSync(SmlSession *session, SmlCommand *cmd, void *userdata);
void smlDsSessionRecvChange(SmlSession *session, SmlCommand *cmd, void *userdata);
void smlDsSessionRecvMap(SmlSession *session, SmlCommand *cmd, void *userdata);
SmlDsSession *smlDsServerRecvAlert(SmlDsServer *server, SmlSession *session, SmlCommand *cmd);
SmlDsSession *smlDsSessionNew(SmlDsServer *server, SmlSession *session, SmlError **error);
void smlDsSessionFree(SmlDsSession *dsession);
void smlDsSessionGetMapping(SmlDsSession *dsession, SmlDsSessionMapCb mapCallback, void *userdata);
#endif //_SML_DS_SERVER_INTERNALS_H_
SmlDsSession::sentSyncCallback
SmlStatusReplyCb sentSyncCallback
Definition: sml_ds_server_internals.h:79
SmlDsSession::sentAlertCallback
SmlStatusReplyCb sentAlertCallback
Definition: sml_ds_server_internals.h:60
SmlDsSession::recvEventCallback
SmlDsSessionEventCb recvEventCallback
Definition: sml_ds_server_internals.h:83
SmlDsSession::recvSyncCallback
SmlDsSessionSyncCb recvSyncCallback
Definition: sml_ds_server_internals.h:64
SmlManager
Definition: sml_manager_internals.h:35
SmlStatus
Definition: sml_command_internals.h:94
SmlDsServer
Definition: sml_ds_server_internals.h:101
SmlDsSession::recvMappingCallback
SmlDsSessionMapCb recvMappingCallback
Definition: sml_ds_server_internals.h:94
SmlDsServer::connectCallback
SmlDsSessionConnectCb connectCallback
Definition: sml_ds_server_internals.h:110
SmlDsSession::syncCommand
SmlCommand * syncCommand
Definition: sml_ds_server_internals.h:87
SmlSession
Definition: sml_session_internals.h:27
SmlCommand
Definition: sml_command_internals.h:73
SmlDsSession
Definition: sml_ds_server_internals.h:45
SmlDsServer::target
SmlLocation * target
Definition: sml_ds_server_internals.h:104
SmlLocation
Definition: sml_elements_internals.h:40
SmlWriteContext
Definition: sml_ds_server_internals.h:35
SmlDsSession::recvAlertCallback
SmlDsSessionAlertCb recvAlertCallback
Definition: sml_ds_server_internals.h:55
SmlDsSession::recvSync
GList * recvSync
Definition: sml_ds_server_internals.h:72
SmlError
Represent an error.
Definition: sml_error_internals.h:29