New for_each_map and tests

This commit is contained in:
Leonardo committed 2019-03-28 22:17:48 -03:00
1 parent 3da4742c5d
commit 5927ab980b
4 files changed
+110 -3

No files matched your search

+29
View File
@@ -41,4 +41,33 @@
} \
} while (0);
#define FOR_EACH_MAP(PFX, SNAME, K, V, TARGET, BODY) \
do \
{ \
size_t index; \
K key; \
V value; \
SNAME##_iter iter; \
PFX##_iter_new(&iter, TARGET); \
while (PFX##_iter_next(&iter, &key, &value, &index)) \
{ \
BODY; \
} \
} while (0);
#define FOR_EACH_MAP_REV(PFX, SNAME, K, V, TARGET, BODY) \
do \
{ \
size_t index; \
K key; \
V value; \
SNAME##_iter iter; \
PFX##_iter_new(&iter, TARGET); \
PFX##_iter_toend(&iter); \
while (PFX##_iter_prev(&iter, &key, &value, &index)) \
{ \
BODY; \
} \
} while (0);
#endif /* CMC_FOR_EACH */
+1 -1
View File
@@ -9,7 +9,7 @@
*/
/*****************************************************************************/
/**************************************************************** TREESET */
/******************************************************************* TREESET */
/*****************************************************************************/
#ifndef CMC_TREESET_H