libsyncml  0.5.4
sml_manager_internals.h
1 /*
2  * libsyncml - A syncml protocol implementation
3  * Copyright (C) 2005 Armin Bauer <armin.bauer@opensync.org>
4  * Copyright (C) 2008 Michael Bell <michael.bell@opensync.org>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  */
21 
29 
30 #ifndef _SML_MANAGER_INTERNALS_H
31 #define _SML_MANAGER_INTERNALS_H
32 
33 #include "sml_queue_internals.h"
34 
35 struct SmlManager {
36  SmlTransport *transport;
37 
38  GList *sessions;
39 
40  SmlManagerEventCb eventCallback;
41  void *eventCallbackUserdata;
42 
43  SmlHeaderCb headerCallback;
44  SmlStatusReplyCb headerStatusCallback;
45  void *headerCallbackUserdata;
46 
47  GList *objects;
48 
49  GSourceFuncs *functions;
50  SmlThread *thread;
51  GMainContext *context;
52  GSource *source;
53 
54  GCond *running;
55  GMutex *running_mutex;
56 
57  SmlQueue *userEventQueue;
58 
59  unsigned int localMaxMsgSize;
60  unsigned int localMaxObjSize;
61 };
62 
63 typedef struct SmlManagerEvent {
64  SmlManagerEventType type;
65  SmlSession *session;
66  SmlCommand *command;
67  SmlCommand *parent;
68  SmlError *error;
70 
71 struct SmlObject {
72  SmlCommandType type;
73  SmlLocation *location;
74  SmlLocation *source;
75  SmlCommandCb commandCallback;
76  SmlCommandCb childCallback;
77  void *commandCallbackUserdata;
78  char *contentType;
79 };
80 
81 void smlManagerSessionFinalLockRef(SmlManager *manager, SmlSession *session);
82 void smlManagerSessionFinalLockUnref(SmlManager *manager, SmlSession *session);
83 
84 SmlLink *smlManagerSessionGetLink(
85  SmlManager *manager,
86  SmlSession *session,
87  SmlError **error);
88 
89 #endif //_SML_MANAGER_INTERNALS_H
90