Diff
Not logged in

Differences From Artifact [10c539a44d]:

To Artifact [606006f7b0]:


678
679
680
681
682
683
684
685
686


687
688
689
690
691
692
693
694
695
696








697
698
699
700



701
702
703
704
705
706
707
678
679
680
681
682
683
684


685
686
687
688
689
690
691
692




693
694
695
696
697
698
699
700
701



702
703
704
705
706
707
708
709
710
711







-
-
+
+






-
-
-
-
+
+
+
+
+
+
+
+

-
-
-
+
+
+








#define FOREACH_STRUCT(var, ary) \
    if (i=0, (ary).num>0) for(; var=&((ary).list[i]), i<(ary).num; i++)

/*
 * Convenience macros for iterating through hash tables. FOREACH_HASH_DECLS
 * sets up the declarations needed for the main macro, FOREACH_HASH, which
 * does the actual iteration. FOREACH_HASH_VALUE is a restricted version that
 * only iterates over values.
 * does the actual iteration. FOREACH_HASH_KEY and FOREACH_HASH_VALUE are
 * restricted versions that only iterate over keys or values respectively.
 * REQUIRES DECLARATION: FOREACH_HASH_DECLS;
 */

#define FOREACH_HASH_DECLS \
    Tcl_HashEntry *hPtr;Tcl_HashSearch search
#define FOREACH_HASH(key, val, tablePtr) \
    for(hPtr=Tcl_FirstHashEntry((tablePtr),&search); hPtr!=NULL ?	\
	    (*(void **)&(key)=Tcl_GetHashKey((tablePtr),hPtr),		\
	    *(void **)&(val)=Tcl_GetHashValue(hPtr),1):0;		\
	    hPtr=Tcl_NextHashEntry(&search))
    for(hPtr=Tcl_FirstHashEntry((tablePtr) ,&search); hPtr != NULL ?	\
	    (*(void **)&(key) = Tcl_GetHashKey((tablePtr), hPtr),		\
	    *(void **)&(val)=Tcl_GetHashValue(hPtr), 1):0;		\
	    hPtr = Tcl_NextHashEntry(&search))
#define FOREACH_HASH_KEY(key, tablePtr) \
    for(hPtr = Tcl_FirstHashEntry((tablePtr), &search); hPtr != NULL ? \
	    (*(void **)&(key) = Tcl_GetHashKey((tablePtr), hPtr), 1) : 0; \
	    hPtr = Tcl_NextHashEntry(&search))
#define FOREACH_HASH_VALUE(val, tablePtr) \
    for(hPtr=Tcl_FirstHashEntry((tablePtr),&search); hPtr!=NULL ?	\
	    (*(void **)&(val)=Tcl_GetHashValue(hPtr),1):0;		\
	    hPtr=Tcl_NextHashEntry(&search))
    for(hPtr = Tcl_FirstHashEntry((tablePtr) ,&search); hPtr != NULL ? \
	    (*(void **)&(val) = Tcl_GetHashValue(hPtr), 1): 0;		\
	    hPtr = Tcl_NextHashEntry(&search))

/*
 * Convenience macro for duplicating a list. Needs no external declaration,
 * but all arguments are used multiple times and so must have no side effects.
 */

#undef DUPLICATE /* prevent possible conflict with definition in WINAPI nb30.h */