libsyncml 0.5.4

- Main Page
- Modules
- Data Structures
- Files

- File List

sml_command_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_COMMAND_INTERNALS_H_
31 #define _SML_COMMAND_INTERNALS_H_
32
33 typedef struct SmlCommandAlertPrivate {
34 SmlAlertType type;
35 SmlAnchor *anchor;
36 char *contentType;
37 int maxObjSize;
38 } SmlCommandAlertPrivate;
39
40 typedef struct SmlCommandSyncPrivate {
41 unsigned int numChanged;
42 int maxObjSize;
43 SmlBool hasNumChanged;
44 } SmlCommandSyncPrivate;
45
46 typedef struct SmlCommandAccessPrivate {
47 char *type;
48 SmlItem *item;
49 } SmlCommandAccessPrivate;
50
51 typedef struct SmlCommandChangePrivate {
52 GList *items;
53 SmlChangeType type;
54 } SmlCommandChangePrivate;
55
56 typedef struct SmlCommandMapPrivate {
57 GList *items;
58 } SmlCommandMapPrivate;
59
60 typedef struct SmlCommandResultsPrivate {
61 SmlStatus *status;
62 } SmlCommandResultsPrivate;
63
64 typedef union SmlCommandPrivate {
65 SmlCommandAlertPrivate alert;
66 SmlCommandSyncPrivate sync;
67 SmlCommandAccessPrivate access;
68 SmlCommandChangePrivate change;
69 SmlCommandMapPrivate map;
70 SmlCommandResultsPrivate results;
71 } SmlCommandPrivate;
72
73 struct SmlCommand {
74 gint refCount;
75 SmlCommandType type;
76 unsigned int cmdID;
77 unsigned int msgID;
78 SmlCommandPrivate private;
79 SmlLocation *source;
80 SmlLocation *target;
81 SmlPendingStatus *pendingReply;
82 GList *children;
83 SmlCommand *parent;
84 SmlBool noResp;
85
86 unsigned int size;
87
91 SmlBool pushedBack;
92 };
93
94 struct SmlStatus {
95 gint refCount;
96 unsigned int msgRef;
97 unsigned int cmdRef;
98 SmlCommandType type;
99 char *data;
100 SmlAnchor *anchor;
101 SmlLocation *sourceRef;
102 SmlLocation *targetRef;
103 SmlCred *cred;
104 SmlChal *chal;
105 SmlItem *item;
106
107 SmlCommand *result;
108 };
109
110 SmlCommandType smlCommandTypeFromString(const char *name, SmlError **error);
111 const char *smlCommandTypeToString(SmlCommandType type, SmlError **error);
112
113 SmlAlertType smlAlertTypeConvert(unsigned int id, SmlError **error);
114
115 #endif //_SML_COMMAND_INTERNALS_H_
116