Files
TempleOS-Rijn/SparrowOS/Demo/Shared/TreeDemoJoin.CPP
T
2018-09-08 21:45:28 +02:00

26 lines
664 B
C++

U0 TreeSub(CDoc *doc,CDirEntry *tempm)
{
CDirEntry *tempm1;
while (tempm) {
tempm1=tempm->next;
if (tempm->attr & _ATTR_DIR) {
DocPutS(doc,"$$TR,\"\"$$");
DocPrintF(doc,"$$MA+A,\"%s\",\"Cd(\\\"%s\\\");Dir;\n\"$$\n",
tempm->name,tempm->full_name);
if (tempm->sub) {
DocPutS(doc,"$$ID,+2$$");
TreeSub(doc,tempm->sub);
DocPutS(doc,"$$ID,-2$$");
}
} else {
DocPrintF(doc,"$$LK,\"%s\",\"FI:%s\"$$\n",
tempm->name,tempm->full_name);
}
//Note there is also a routine
//to delete an entire CDirEntry tree.
//See $LK,"CDirListDel","MN:CDirListDel"$().
CDirEntryDel(tempm);
tempm=tempm1;
}
}