Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

iter.h

Go to the documentation of this file.
00001 #ifndef _dev_w3_org__2001_blindfold_iter
00002 #define _dev_w3_org__2001_blindfold_iter
00003 
00112 struct iter_s;
00113 
00118 typedef void (iter_reset_function)(struct iter_s *iter);
00119 
00120 struct iter_s {
00121     void *state;
00122     iter_reset_function *reset;
00123 };
00124 
00132 typedef struct iter_s iter;
00133 
00134 
00140 /* void iter_reset(iter *i); */
00141 
00142 /* 
00143    why do/while?  see Harbison/Steele p45 -- it works in more cases 
00144    but maybe we don't need it with this current if/then structure.
00145 */
00147 #define iter_reset(i)               \
00148     if ((i)->state) {               \
00149     if ((i)->reset) (*((i)->reset))(i); \
00150     } else {                    \
00151     (i)->state = 0;             \
00152     }
00153 
00154 #endif

Home to blindfold. This page generated via doxygen 1.2.11.1 Wed Oct 10 16:40:33 2001.