libsyncml 0.5.4

- Main Page
- Modules
- Data Structures
- Files

- File List

sml_command.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_H_
31 #define _SML_COMMAND_H_
32
33 SmlStatus *smlStatusNew(SmlErrorType data, unsigned int cmdref, unsigned int msgref, SmlLocation *sourceref, SmlLocation *targeref, SmlCommandType type, SmlError **error);
34 SmlStatus *smlStatusRef(SmlStatus *status);
35 void smlStatusUnref(SmlStatus *status);
36 SmlErrorType smlStatusGetCode(SmlStatus *status);
37 SmlErrorClass smlStatusGetClass(SmlStatus *status);
38 SmlCommand *smlStatusGetResult(SmlStatus *status);
39 SmlBool smlStatusIsResult(SmlStatus *status);
40
41 SmlCommand *smlCommandNew(SmlCommandType type, SmlError **error);
42 SmlStatus *smlCommandNewReply(const SmlCommand *cmd, SmlErrorType code, SmlError **error);
43 SmlCommand *smlCommandRef(SmlCommand *cmd);
44 void smlCommandUnref(SmlCommand *cmd);
45
46 SmlCommand *smlCommandNewAlert(SmlAlertType type, SmlLocation *target, SmlLocation *source, const char *next, const char *last, const char *contenttype, SmlError **error);
47 SmlCommand *smlCommandNewSync(SmlLocation *target, SmlLocation *source, unsigned int num_changes, SmlError **error);
48 SmlCommand *smlCommandNewChange(SmlChangeType type, const char *uid, const char *data, unsigned int size, const char *contenttype, SmlError **error);
49 SmlCommand *smlCommandNewPartialChange(SmlChangeType type, const char *uid, const char *data, unsigned int complete_size, unsigned int partial_size, const char *contenttype, SmlError **error);
50 SmlCommand *smlCommandNewResult(SmlCommand *cmd, SmlLocation *source, char *data, unsigned int size, const char *contenttype, SmlError **error);
51 SmlCommand *smlCommandNewPut(SmlLocation *target, SmlLocation *source, const char *data, unsigned int size, const char *contenttype, SmlError **error);
52 SmlCommand *smlCommandNewGet(SmlLocation *target, const char *contenttype, SmlError **error);
53
54 SmlCommand *smlCommandNewMap(SmlLocation *target, SmlLocation *source, SmlError **error);
55 SmlBool smlCommandAddMapItem(SmlCommand *map, SmlMapItem *item, SmlError **error);
56
57 #endif //_SML_COMMAND_H_
58