From 2da3b081c47fe8fe7476da228323d2040e876f56 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Sun, 28 Jun 2009 09:31:46 -0700 Subject: More work on upb_context. --- upb_table.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'upb_table.h') diff --git a/upb_table.h b/upb_table.h index 4452fc9..0c4df93 100644 --- a/upb_table.h +++ b/upb_table.h @@ -102,6 +102,15 @@ INLINE void *upb_inttable_lookup(struct upb_inttable *t, void *upb_strtable_lookup(struct upb_strtable *t, struct upb_string *key); +/* Provides iteration over the table. The order in which the entries are + * returned is undefined. Insertions invalidate iterators. The _next + * functions return NULL when the end has been reached. */ +void *upb_inttable_begin(struct upb_inttable *t); +void *upb_inttable_next(struct upb_inttable *t, struct upb_inttable_entry *cur); + +void *upb_strtable_begin(struct upb_strtable *t); +void *upb_strtable_next(struct upb_strtable *t, struct upb_strtable_entry *cur); + #ifdef __cplusplus } /* extern "C" */ #endif -- cgit v1.2.3