mnc[3] = '\0';
}
-void g_isi_sb_iter_init_full(GIsiSubBlockIter *iter, const void *restrict data,
- size_t len, size_t used, gboolean longhdr,
+void g_isi_sb_iter_init_full(GIsiSubBlockIter *iter, const GIsiMessage *msg,
+ size_t used, gboolean longhdr,
uint16_t sub_blocks)
{
+ const uint8_t *data = g_isi_msg_data(msg);
+ size_t len = g_isi_msg_data_len(msg);
+
if (!data)
len = used = 0;
iter->sub_blocks = len > used ? sub_blocks : 0;
}
-void g_isi_sb_iter_init(GIsiSubBlockIter *iter, const void *restrict data,
- size_t len, size_t used)
+void g_isi_sb_iter_init(GIsiSubBlockIter *iter, const GIsiMessage *msg,
+ size_t used)
{
+ const uint8_t *data = g_isi_msg_data(msg);
+ size_t len = g_isi_msg_data_len(msg);
+
if (!data)
len = used = 0;
if ((size_t)pos > g_isi_sb_iter_get_len(iter)
|| iter->start + pos > iter->end)
return FALSE;
+
*data = (void *)iter->start + pos;
return TRUE;
}
if ((size_t)pos > g_isi_sb_iter_get_len(iter)
|| iter->start + pos > iter->end)
return FALSE;
+
*byte = iter->start[pos];
return TRUE;
}
#include <stdint.h>
+#include "message.h"
+
struct _GIsiSubBlockIter {
uint8_t *start;
uint8_t *end;
- uint16_t longhdr;
+ gboolean longhdr;
uint16_t sub_blocks;
};
-
typedef struct _GIsiSubBlockIter GIsiSubBlockIter;
-void g_isi_sb_iter_init(GIsiSubBlockIter *iter,
- const void *restrict data,
- size_t len, size_t used);
-void g_isi_sb_iter_init_full(GIsiSubBlockIter *iter,
- const void *restrict data,
- size_t len, size_t used,
- gboolean longhdr,
+void g_isi_sb_iter_init(GIsiSubBlockIter *iter, const GIsiMessage *msg,
+ size_t used);
+void g_isi_sb_iter_init_full(GIsiSubBlockIter *iter, const GIsiMessage *msg,
+ size_t used, gboolean longhdr,
uint16_t sub_blocks);
gboolean g_isi_sb_iter_is_valid(const GIsiSubBlockIter *iter);