+
+int zebra_strmap_get_size(zebra_strmap_t st)
+{
+ return st->size;
+}
+
+struct zebra_strmap_it_s {
+ int hno;
+ struct strmap_entry *ent;
+ zebra_strmap_t st;
+
+};
+
+zebra_strmap_it zebra_strmap_it_create(zebra_strmap_t st)
+{
+ zebra_strmap_it it = (zebra_strmap_it) xmalloc(sizeof(*it));
+ it->hno = 0;
+ it->ent = 0;
+ it->st = st;
+ return it;
+}
+
+void zebra_strmap_it_destroy(zebra_strmap_it it)
+{
+ xfree(it);
+}
+
+const char *zebra_strmap_it_next(zebra_strmap_it it, void **data_buf,
+ size_t *data_len)
+{
+ struct strmap_entry *ent = 0;
+ while (!it->ent && it->hno < it->st->hsize)
+ {
+ it->ent = it->st->entries[it->hno];
+ it->hno++;
+ }
+ if (it->ent)
+ {
+ ent = it->ent;
+ it->ent = ent->next;
+ }
+ if (ent)
+ {
+ if (data_buf)
+ *data_buf = ent->data_buf;
+ if (data_len)
+ *data_len = ent->data_len;
+ return ent->name;
+ }
+ return 0;
+}
+