summaryrefslogtreecommitdiff
path: root/gobex/gobex-apparam.h
blob: 46e20d2641f4ffce5d552a01eb03fb8aa89f6933 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
 *
 *  OBEX library with GLib integration
 *
 *  Copyright (C) 2012  Intel Corporation.
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License version 2 as
 *  published by the Free Software Foundation.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */

#ifndef __GOBEX_APPARAM_H
#define __GOBEX_APPARAM_H

#include <glib.h>

typedef struct _GObexApparam GObexApparam;

GObexApparam *g_obex_apparam_decode(const void *data, gsize size);
gssize g_obex_apparam_encode(GObexApparam *apparam, void *buf, gsize size);

GObexApparam *g_obex_apparam_set_bytes(GObexApparam *apparam, guint8 id,
						const void *value, gsize size);
GObexApparam *g_obex_apparam_set_uint8(GObexApparam *apparam, guint8 id,
							guint8 value);
GObexApparam *g_obex_apparam_set_uint16(GObexApparam *apparam, guint8 id,
							guint16 value);
GObexApparam *g_obex_apparam_set_uint32(GObexApparam *apparam, guint8 id,
							guint32 value);
GObexApparam *g_obex_apparam_set_uint64(GObexApparam *apparam, guint8 id,
							guint64 value);
GObexApparam *g_obex_apparam_set_string(GObexApparam *apparam, guint8 id,
							const char *value);

gboolean g_obex_apparam_get_bytes(GObexApparam *apparam, guint8 id,
					const guint8 **val, gsize *len);
gboolean g_obex_apparam_get_uint8(GObexApparam *apparam, guint8 id,
							guint8 *value);
gboolean g_obex_apparam_get_uint16(GObexApparam *apparam, guint8 id,
							guint16 *value);
gboolean g_obex_apparam_get_uint32(GObexApparam *apparam, guint8 id,
							guint32 *value);
gboolean g_obex_apparam_get_uint64(GObexApparam *apparam, guint8 id,
							guint64 *value);
char *g_obex_apparam_get_string(GObexApparam *apparam, guint8 id);

void g_obex_apparam_free(GObexApparam *apparam);

#endif /* __GOBEX_APPARAM_H */