summaryrefslogtreecommitdiffstats
path: root/gisi
diff options
context:
space:
mode:
authorAki Niemi <aki.niemi@nokia.com>2010-11-14 18:20:38 +0200
committerAki Niemi <aki.niemi@nokia.com>2010-12-22 17:13:46 +0200
commit42ff2b6d17ffdbe300545040d223c2d5f6d8559e (patch)
tree86e23ef828d109dbbb04e3c6e5ee22a77bf0dfc3 /gisi
parent4f14a6c1799930492b33bfe5581c53fb95fc3406 (diff)
downloadofono-42ff2b6d17ffdbe300545040d223c2d5f6d8559e.tar.bz2
gisi: Add convenience API for structs
Diffstat (limited to 'gisi')
-rw-r--r--gisi/iter.c9
-rw-r--r--gisi/iter.h2
2 files changed, 11 insertions, 0 deletions
diff --git a/gisi/iter.c b/gisi/iter.c
index a0a9b3a1..d0e534b3 100644
--- a/gisi/iter.c
+++ b/gisi/iter.c
@@ -223,3 +223,12 @@ gboolean g_isi_sb_iter_next(GIsiSubBlockIter *iter)
return TRUE;
}
+
+gboolean g_isi_sb_iter_get_struct(const GIsiSubBlockIter *restrict iter,
+ void **type, size_t len, unsigned pos)
+{
+ if (iter->start + pos + len > iter->end)
+ return FALSE;
+
+ return g_isi_sb_iter_get_data(iter, type, pos);
+}
diff --git a/gisi/iter.h b/gisi/iter.h
index 74ec5932..43814a0b 100644
--- a/gisi/iter.h
+++ b/gisi/iter.h
@@ -64,6 +64,8 @@ gboolean g_isi_sb_iter_get_alpha_tag(const GIsiSubBlockIter *restrict iter,
char **utf8, size_t len, unsigned pos);
gboolean g_isi_sb_iter_get_latin_tag(const GIsiSubBlockIter *restrict iter,
char **ascii, size_t len, unsigned pos);
+gboolean g_isi_sb_iter_get_struct(const GIsiSubBlockIter *restrict iter,
+ void **ptr, size_t len, unsigned pos);
#ifdef __cplusplus
}