sml_manager.h
/*
* libsyncml - A syncml protocol implementation
* Copyright (C) 2005 Armin Bauer <armin.bauer@opensync.org>
* Copyright (C) 2007-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_MANAGER_H
#define _SML_MANAGER_H
typedef enum {
SML_MANAGER_CONNECT_DONE,
SML_MANAGER_DISCONNECT_DONE,
SML_MANAGER_TRANSPORT_ERROR,
SML_MANAGER_SESSION_NEW,
SML_MANAGER_SESSION_FINAL,
SML_MANAGER_SESSION_END,
SML_MANAGER_SESSION_FLUSH,
SML_MANAGER_SESSION_WARNING,
SML_MANAGER_SESSION_ERROR,
SML_MANAGER_SESSION_ESTABLISHED,
} SmlManagerEventType;
typedef void (* SmlManagerEventCb) (SmlManager *manager, SmlManagerEventType type, SmlSession *session, SmlError *error, void *userdata);
typedef void (* SmlCommandCb) (SmlSession *session, SmlCommand *cmd, void *userdata);
typedef void (* SmlHeaderCb) (SmlSession *session, SmlHeader *header, SmlCred *cred, void *userdata);
typedef void (* SmlStatusReplyCb) (SmlSession *session, SmlStatus *status, void *userdata);
SmlManager *smlManagerNew(SmlTransport *tsp, SmlError **error);
void smlManagerFree(SmlManager *manager);
SmlBool smlManagerReceive(SmlManager *manager, SmlError **error);
void smlManagerSetEventCallback(SmlManager *manager, SmlManagerEventCb callback, void *userdata);
SmlSession *smlManagerSessionFind(SmlManager *manager, const char *sessionID);
SmlBool smlManagerSessionAdd(SmlManager *manager, SmlSession *session, SmlLink *link, SmlError **error);
void smlManagerSessionRemove(SmlManager *manager, SmlSession *session);
SmlBool smlManagerObjectRegister(SmlManager *manager, SmlCommandType type, SmlSession *session, SmlLocation *location, SmlLocation *source, const char *contentType, SmlCommandCb callback, SmlCommandCb childCallback, void *userdata, SmlError **error);
void smlManagerRegisterHeaderHandler(SmlManager *manager, SmlHeaderCb callback, SmlStatusReplyCb statuscb, void *userdata);
void smlManagerObjectFree(SmlObject *object);
SmlObject *smlManagerObjectFind(SmlManager *manager, SmlSession *session, SmlCommand *cmd);
SmlBool smlManagerDispatchChildCommand(SmlManager *manager, SmlSession *session, SmlCommand *parent, SmlCommand *cmd, SmlError **error);
SmlBool smlManagerDispatchHeader(SmlManager *manager, SmlSession *session, SmlHeader *header, SmlCred *cred, SmlError **error);
SmlBool smlManagerDispatchCommand(SmlManager *manager, SmlSession *session, SmlCommand *cmd, SmlError **error);
SmlBool smlManagerStart(SmlManager *manager, SmlError **error);
void smlManagerStop(SmlManager *manager);
void smlManagerRun(SmlManager *manager);
void smlManagerQuit(SmlManager *manager);
void smlManagerDispatch(SmlManager *manager);
SmlBool smlManagerCheck(SmlManager *manager);
void smlManagerSetLocalMaxMsgSize(SmlManager *manager, unsigned int size);
void smlManagerSetLocalMaxObjSize(SmlManager *manager, unsigned int size);
char *smlManagerGetNewSessionID(SmlManager *manager);
#endif //_SML_MANAGER_H
SmlCred
Definition: sml_elements_internals.h:87
smlManagerStop
void smlManagerStop(SmlManager *manager)
Stops the active manager part.
Definition: sml_manager.c:565
SmlManager
Definition: sml_manager_internals.h:35
SmlStatus
Definition: sml_command_internals.h:94
SmlHeader
Definition: sml_elements_internals.h:73
SmlTransport
Definition: sml_transport_internals.h:69
SmlSession
Definition: sml_session_internals.h:27
SmlCommand
Definition: sml_command_internals.h:73
SmlLink
Definition: sml_transport_internals.h:92
SmlLocation
Definition: sml_elements_internals.h:40
smlManagerObjectRegister
SmlBool smlManagerObjectRegister(SmlManager *manager, SmlCommandType type, SmlSession *session, SmlLocation *location, SmlLocation *source, const char *contentType, SmlCommandCb callback, SmlCommandCb childCallback, void *userdata, SmlError **error)
Register an object with a session.
Definition: sml_manager.c:926
SmlObject
Definition: sml_manager_internals.h:71
SmlError
Represent an error.
Definition: sml_error_internals.h:29