uint8_t* name;\r
};\r
struct ir_set_t\r
-{ struct ir_set_t* nextchild, * nextsib, * p;\r
+{ struct ir_set_t* nextchild, * nextsib;\r
uint32_t ref;\r
uint8_t* name;\r
struct ir_framebox_t* frameboxes;\r
void ir_test(void)\r
{ uprintf("IR From Directory: %s\n",getcwd(NULL,255));\r
crawl_class(&root_class);\r
+ if (root_class.root_set != NULL)\r
+ crawl_set(root_class.root_set, 0);\r
}\r
\r
-#define pspace(num) for (i = 0; i < (num); i++) putchar('.')\r
static\r
void crawl_class\r
( struct ir_class_t* class )\r
-{ wprintf("%U/\n", class->name);\r
- if(chdir((char*)class->name))\r
- eprintf("CHDIR %U from %s\n",class->name,getcwd(NULL,255));\r
- if (class->nextchild != NULL)\r
- crawl_class(class->nextchild);\r
- if (class->root_set != NULL)\r
- crawl_set(class->root_set, 0);\r
- if (class->nextsib != NULL)\r
- { if (chdir(".."))\r
+{ struct ir_class_t* iter;\r
+ for (iter = class->nextchild; iter != NULL; iter = iter->nextsib)\r
+ { wprintf("%U/\n", iter->name);\r
+ if(chdir((char*)iter->name))\r
+ eprintf("CHDIR %U from %s\n",iter->name,getcwd(NULL,255));\r
+ crawl_class(iter);\r
+ if (iter->root_set != NULL)\r
+ crawl_set(iter->root_set, 0);\r
+ uprintf("%U\\\n",iter->name);\r
+ if (chdir(".."))\r
eprintf("CHDIR ..\n");\r
- crawl_class(class->nextsib);\r
- if(chdir((char*)class->name))\r
- eprintf("CHDIR %U from %s\n",class->name,getcwd(NULL,255));\r
}\r
- uprintf("%U\\\n",class->name);\r
- if (chdir(".."))\r
- eprintf("CHDIR ..\n");\r
}\r
\r
+#define push_setp(setp) (*(struct ir_set_t**)stack_alloc(sizeof(struct ir_set_t*)) = setp)\r
+#define pop_setp() (*(struct ir_set_t**)pagelist_pop(&datapages, sizeof(struct ir_set_t*)))\r
static\r
void crawl_set\r
( struct ir_set_t* set,\r
int depth\r
)\r
-{ struct ir_set_t* iter, * last;\r
+{ struct ir_set_t* iter;\r
int i;\r
- pspace(depth * 12);\r
- last = NULL;\r
+ i = depth * 12;\r
+ while (i--)\r
+ putchar('.');\r
i = depth;\r
for(iter = set; iter != NULL; iter = iter->nextchild)\r
{ uprintf("[%10U]", iter->name);\r
- if (last != NULL)\r
- iter->p = last;\r
- last = iter;\r
+ push_setp(iter);\r
i++;\r
}\r
- --i;\r
putchar('\n');\r
- for(iter = last; iter != NULL; iter = iter->p, --i)\r
- if (iter->nextsib != NULL)\r
+ while (--i >= depth)\r
+ if (((iter = pop_setp())->nextsib) != NULL)\r
crawl_set(iter->nextsib,i);\r
}\r