summaryrefslogtreecommitdiffstats
path: root/gisi/iter.h
diff options
context:
space:
mode:
authorAki Niemi <aki.niemi@nokia.com>2009-09-14 14:34:00 +0300
committerAki Niemi <aki.niemi@nokia.com>2009-09-14 14:34:00 +0300
commitdec66954b6e4569f644f3e1f4a0a5a02f30662d4 (patch)
tree9723ab205d37726635afd8f04c8a1354ae5f4604 /gisi/iter.h
parentffaba2b637f403af238551d5ec87d9955ce5a23a (diff)
downloadofono-dec66954b6e4569f644f3e1f4a0a5a02f30662d4.tar.bz2
gisi: Add ISI sub-block iterator
Diffstat (limited to 'gisi/iter.h')
-rw-r--r--gisi/iter.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/gisi/iter.h b/gisi/iter.h
new file mode 100644
index 00000000..87ebfdba
--- /dev/null
+++ b/gisi/iter.h
@@ -0,0 +1,59 @@
+/*
+ * This file is part of oFono - Open Source Telephony
+ *
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * Contact: RĂ©mi Denis-Courmont <remi.denis-courmont@nokia.com>
+ *
+ * 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 __GISI_ITER_H
+#define __GISI_ITER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+#include <stdbool.h>
+
+struct _GIsiSubBlockIter {
+ uint8_t *start;
+ uint8_t *end;
+};
+typedef struct _GIsiSubBlockIter GIsiSubBlockIter;
+
+bool g_isi_sb_iter_is_valid(GIsiSubBlockIter *iter);
+bool g_isi_sb_iter_next(GIsiSubBlockIter *iter);
+
+uint8_t g_isi_sb_iter_get_id(GIsiSubBlockIter *iter);
+uint8_t g_isi_sb_iter_get_len(GIsiSubBlockIter *iter);
+
+bool g_isi_sb_iter_get_byte(GIsiSubBlockIter *iter, uint8_t *byte, int pos);
+bool g_isi_sb_iter_get_word(GIsiSubBlockIter *iter, uint16_t *word, int pos);
+bool g_isi_sb_iter_get_dword(GIsiSubBlockIter *iter, uint32_t *dword, int pos);
+bool g_isi_sb_iter_get_oper_code(GIsiSubBlockIter *iter, char *mcc,
+ char *mnc, int pos);
+bool g_isi_sb_iter_get_alpha_tag(GIsiSubBlockIter *iter, char **utf8, int pos);
+bool g_isi_sb_iter_init(const void restrict *data, size_t len,
+ GIsiSubBlockIter *iter);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __GISI_ITER_H */