libsyncml 0.5.4

- Main Page
- Modules
- Data Structures
- Files

- File List

callbacks.h
1 /*
2 * libsyncml - A syncml protocol implementation
3 * Copyright (C) 2008 Michael Bell <michael.bell@opensync.org>
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 */
20
27
28 #ifndef _SML_DATA_SYNC_API_CALLBACKS_H_
29 #define _SML_DATA_SYNC_API_CALLBACKS_H_
30
31 #include <libsyncml/data_sync_api/standard.h>
32
33 #ifdef __cplusplus
34 extern "C"
35 {
36 #endif
37
38 /* required callbacks - the event handler */
39
40 typedef void (* SmlDataSyncEventCallback) (
41 SmlDataSyncObject *dsObject,
42 SmlDataSyncEventType type,
43 void *userdata,
44 SmlError *error);
45 typedef SmlAlertType (* SmlDataSyncGetAlertTypeCallback) (
46 SmlDataSyncObject *dsObject,
47 const char *source,
48 SmlAlertType type,
49 void *userdata,
50 SmlError **error);
51 typedef SmlBool (* SmlDataSyncChangeCallback) (
52 SmlDataSyncObject *dsObject,
53 const char *source,
54 SmlChangeType type,
55 const char *uid,
56 char *data,
57 unsigned int size,
58 void *userdata,
59 SmlError **error);
60 /* FIXME: newuid must be removed before next API break */
61 /* FIXME: DEPRECATED */
62 typedef SmlBool (* SmlDataSyncChangeStatusCallback) (
63 SmlDataSyncObject *dsObject,
64 unsigned int code,
65 const char *newuid,
66 void *userdata,
67 SmlError **error);
68 typedef SmlBool (* SmlDataSyncMappingCallback) (
69 SmlDataSyncObject *dsObject,
70 const char *source,
71 const char *orig,
72 const char *newuid,
73 void *userdata,
74 SmlError **error);
75 typedef char *(* SmlDataSyncGetAnchorCallback) (
76 SmlDataSyncObject *dsObject,
77 const char *name,
78 void *userdata,
79 SmlError **error);
80 typedef SmlBool (* SmlDataSyncSetAnchorCallback) (
81 SmlDataSyncObject *dsObject,
82 const char *name,
83 const char *value,
84 void *userdata,
85 SmlError **error);
86 typedef SmlBool (* SmlDataSyncWriteDevInfCallback) (
87 SmlDataSyncObject *dsObject,
88 SmlDevInf *devinf,
89 void *userdata,
90 SmlError **error);
91 typedef SmlDevInf *(* SmlDataSyncReadDevInfCallback) (
92 SmlDataSyncObject *dsObject,
93 const char *devid,
94 void *userdata,
95 SmlError **error);
96 typedef SmlBool (* SmlDataSyncHandleRemoteDevInfCallback) (
97 SmlDataSyncObject *dsObject,
98 SmlDevInf *devinf,
99 void *userdata,
100 SmlError **error);
101
102 /* functions to register the callbacks */
103
104 void smlDataSyncRegisterEventCallback(
105 SmlDataSyncObject *dsObject,
106 SmlDataSyncEventCallback callback,
107 void *userdata);
108 void smlDataSyncRegisterGetAlertTypeCallback(
109 SmlDataSyncObject *dsObject,
110 SmlDataSyncGetAlertTypeCallback callback,
111 void *userdata);
112 void smlDataSyncRegisterChangeCallback(
113 SmlDataSyncObject *dsObject,
114 SmlDataSyncChangeCallback callback,
115 void *userdata);
116 void smlDataSyncRegisterMappingCallback(
117 SmlDataSyncObject *dsObject,
118 SmlDataSyncMappingCallback callback,
119 void *userdata);
120 void smlDataSyncRegisterGetAnchorCallback(
121 SmlDataSyncObject *dsObject,
122 SmlDataSyncGetAnchorCallback callback,
123 void *userdata);
124 void smlDataSyncRegisterSetAnchorCallback(
125 SmlDataSyncObject *dsObject,
126 SmlDataSyncSetAnchorCallback callback,
127 void *userdata);
128 void smlDataSyncRegisterWriteDevInfCallback(
129 SmlDataSyncObject *dsObject,
130 SmlDataSyncWriteDevInfCallback callback,
131 void *userdata);
132 void smlDataSyncRegisterReadDevInfCallback(
133 SmlDataSyncObject *dsObject,
134 SmlDataSyncReadDevInfCallback callback,
135 void *userdata);
136 void smlDataSyncRegisterHandleRemoteDevInfCallback(
137 SmlDataSyncObject *dsObject,
138 SmlDataSyncHandleRemoteDevInfCallback callback,
139 void *userdata);
140
141 /* ChangeStatus uses the userdata from AddChange */
142
143 void smlDataSyncRegisterChangeStatusCallback(
144 SmlDataSyncObject *dsObject,
145 SmlDataSyncChangeStatusCallback callback);
146
147 #ifdef __cplusplus
148 }
149 #endif
150
151 #endif /* _SML_DATA_SYNC_API_CALLBACKS_H_ */
152