gisi: Add convenience API for structs

This commit is contained in:
Aki Niemi 2010-11-14 18:20:38 +02:00
parent 4f14a6c179
commit 42ff2b6d17
2 changed files with 11 additions and 0 deletions

View File

@ -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);
}

View File

@ -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
}