libsyncml 0.5.4

- Main Page
- Modules
- Data Structures
- Files

- File List

sml_elements.h
1 /*
2 * libsyncml - A syncml protocol implementation
3 * Copyright (C) 2005 Armin Bauer <armin.bauer@opensync.org>
4 * Copyright (C) 2007-2009 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_ELEMENTS_H_
31 #define _SML_ELEMENTS_H_
32
33 SmlLocation *smlLocationNew (const char *locURI, const char *locName, SmlError **error);
34 SmlLocation *smlLocationRef (SmlLocation *loc);
35 void smlLocationUnref (SmlLocation *loc);
36
37 const char *smlLocationGetURI (SmlLocation *loc);
38 const char *smlLocationGetName (SmlLocation *loc);
39 void smlLocationSetName(SmlLocation *loc, const char *name);
40 void smlLocationCopy (SmlLocation *source, SmlLocation *target);
41 SmlLocation *smlLocationClone (SmlLocation *source, SmlError **error);
42 SmlBool smlLocationCompare (SmlLocation *objectroot, SmlLocation *object, SmlLocation *urlroot, SmlLocation *url);
43 SmlBool smlLocationIsRelative (SmlLocation *location);
44
45 SmlCred *smlCredNewFromString(const char *type, const char *format, const char *data, SmlError **error);
46 SmlCred *smlCredNewAuth(SmlAuthType type, const char *username, const char *password, SmlError **error);
47 SmlCred *smlCredNew(SmlAuthType type, SmlFormatType format, const char *data, const char*username, SmlError **error);
48 void smlCredRef(SmlCred *cred);
49 void smlCredUnref(SmlCred *cred);
50 void smlCredFree(SmlCred *cred) LIBSYNCML_DEPRECATED; /* expire date: 20090120 */
51
52 SmlAnchor *smlAnchorNew(const char *last, const char *next, SmlError **error);
53 void smlAnchorFree(SmlAnchor *anchor);
54
55 SmlItem *smlItemNew(unsigned int size, SmlError **error);
56 SmlItem *smlItemNewForData(const char *data, unsigned int size, SmlError **error);
57 SmlItem *smlItemRef(SmlItem *item);
58 void smlItemUnref(SmlItem *item);
59 SmlBool smlItemAddData(SmlItem *item, const char *data, unsigned int size, SmlError **error);
60 SmlBool smlItemCheck(SmlItem *item);
61 SmlBool smlItemHasData(SmlItem *item);
62 SmlBool smlItemGetData(SmlItem *item, char **data, unsigned int *size, SmlError **error);
63 SmlBool smlItemStealData(SmlItem *item, char **data, unsigned int *size, SmlError **error);
64
65 void smlItemSetSource(SmlItem *item, SmlLocation *source);
66 SmlLocation *smlItemGetSource(SmlItem *item);
67 void smlItemSetTarget(SmlItem *item, SmlLocation *target);
68 SmlLocation *smlItemGetTarget(SmlItem *item);
69 void smlItemSetSourceParent(SmlItem *item, SmlLocation *sourceParent);
70 SmlLocation *smlItemGetSourceParent(SmlItem *item);
71 void smlItemSetTargetParent(SmlItem *item, SmlLocation *targeParent);
72 SmlLocation *smlItemGetTargetParent(SmlItem *item);
73 void smlItemSetRaw(SmlItem *item, SmlBool raw);
74
75 void smlHeaderFree(SmlHeader *header);
76
77 SmlChal *smlChalNew(SmlAuthType type, SmlError **error);
78 SmlChal *smlChalNewFromBinary(SmlAuthType type, const char *nonce, size_t length, SmlError **error);
79 SmlChal *smlChalNewFromBase64(SmlAuthType type, const char *nonce, SmlError **error);
80 void smlChalRef(SmlChal *chal);
81 void smlChalUnref(SmlChal *chal);
82 void smlChalFree(SmlChal *chal) LIBSYNCML_DEPRECATED; /* expire date: 20090417 */
83
84 SmlMapItem *smlMapItemNew(const char *uid, const char *newuid, SmlError **error);
85 SmlMapItem *smlMapItemRef(SmlMapItem *item);
86 void smlMapItemUnref(SmlMapItem *item);
87
88 #endif //_SML_ELEMENTS_H_
89