summaryrefslogtreecommitdiffstats
path: root/gatchat/gatresult.h
diff options
context:
space:
mode:
authorDenis Kenzior <denis.kenzior@intel.com>2009-05-06 14:33:17 -0700
committerMarcel Holtmann <marcel.holtmann@intel.com>2009-05-06 14:42:54 -0700
commit64c42764736de15544e58666bdf97de088f7a7b5 (patch)
tree8f496fa6822a15acc593bd8ee66007ed0925efd3 /gatchat/gatresult.h
parent4ea27466bf3a5a3309d5ee689a1470c20c483ef9 (diff)
downloadofono-64c42764736de15544e58666bdf97de088f7a7b5.tar.bz2
Add AT chat library implementation
Diffstat (limited to 'gatchat/gatresult.h')
-rw-r--r--gatchat/gatresult.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/gatchat/gatresult.h b/gatchat/gatresult.h
new file mode 100644
index 00000000..8259e7cd
--- /dev/null
+++ b/gatchat/gatresult.h
@@ -0,0 +1,69 @@
+/*
+ *
+ * AT chat library with GLib integration
+ *
+ * Copyright (C) 2008-2009 Intel Corporation. All rights reserved.
+ *
+ * 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 __GATCHAT_RESULT_H
+#define __GATCHAT_RESULT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct _GAtResult {
+ GSList *lines;
+ char *final_or_pdu;
+};
+
+typedef struct _GAtResult GAtResult;
+
+struct _GAtResultIter {
+ GAtResult *result;
+ GSList *l;
+ char buf[2048];
+ unsigned int line_pos;
+ GSList pre;
+};
+
+typedef struct _GAtResultIter GAtResultIter;
+
+void g_at_result_iter_init(GAtResultIter *iter, GAtResult *result);
+
+gboolean g_at_result_iter_next(GAtResultIter *iter, const char *prefix);
+gboolean g_at_result_iter_open_list(GAtResultIter *iter);
+gboolean g_at_result_iter_close_list(GAtResultIter *iter);
+
+gboolean g_at_result_iter_skip_next(GAtResultIter *iter);
+
+gboolean g_at_result_iter_next_range(GAtResultIter *iter, gint *min, gint *max);
+gboolean g_at_result_iter_next_string(GAtResultIter *iter, const char **str);
+gboolean g_at_result_iter_next_number(GAtResultIter *iter, gint *number);
+
+const char *g_at_result_iter_raw_line(GAtResultIter *iter);
+
+const char *g_at_result_final_response(GAtResult *result);
+const char *g_at_result_pdu(GAtResult *result);
+
+gint g_at_result_num_response_lines(GAtResult *result);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __GATCHAT_RESULT_H */