Enable compilation in maemo fremantle sdk.
[connman] / gatchat / gatresult.h
1 /*
2  *
3  *  AT chat library with GLib integration
4  *
5  *  Copyright (C) 2008-2009  Intel Corporation. All rights reserved.
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License version 2 as
9  *  published by the Free Software Foundation.
10  *
11  *  This program 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
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  *
20  */
21
22 #ifndef __GATCHAT_RESULT_H
23 #define __GATCHAT_RESULT_H
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 struct _GAtResult {
30         GSList *lines;
31         char *final_or_pdu;
32 };
33
34 typedef struct _GAtResult GAtResult;
35
36 struct _GAtResultIter {
37         GAtResult *result;
38         GSList *l;
39         char buf[2048];
40         unsigned int line_pos;
41         GSList pre;
42 };
43
44 typedef struct _GAtResultIter GAtResultIter;
45
46 void g_at_result_iter_init(GAtResultIter *iter, GAtResult *result);
47
48 gboolean g_at_result_iter_next(GAtResultIter *iter, const char *prefix);
49 gboolean g_at_result_iter_open_list(GAtResultIter *iter);
50 gboolean g_at_result_iter_close_list(GAtResultIter *iter);
51
52 gboolean g_at_result_iter_skip_next(GAtResultIter *iter);
53
54 gboolean g_at_result_iter_next_range(GAtResultIter *iter, gint *min, gint *max);
55 gboolean g_at_result_iter_next_string(GAtResultIter *iter, const char **str);
56 gboolean g_at_result_iter_next_number(GAtResultIter *iter, gint *number);
57 gboolean g_at_result_iter_next_hexstring(GAtResultIter *iter,
58                 const guint8 **str, gint *length);
59
60 const char *g_at_result_iter_raw_line(GAtResultIter *iter);
61
62 const char *g_at_result_final_response(GAtResult *result);
63 const char *g_at_result_pdu(GAtResult *result);
64
65 gint g_at_result_num_response_lines(GAtResult *result);
66
67 #ifdef __cplusplus
68 }
69 #endif
70
71 #endif /* __GATCHAT_RESULT_H */