--- os2sdk/demos/apps/ds/tree.c 2018/08/09 12:25:13 1.1 +++ os2sdk/demos/apps/ds/tree.c 2018/08/09 12:26:02 1.1.1.2 @@ -1,4 +1,6 @@ -/* tree.c - build and maintain directory tree */ +/* tree.c - build and maintain directory tree */ +/* Created by Microsoft Corp. 1986 */ + #include #include @@ -156,7 +158,7 @@ newLine () */ modLine (col, str, color) int col; -char *str; +NPCH str; int color; { cellType *p; @@ -173,9 +175,9 @@ int color; Canonicalize (fullPath, p, headPath) -char *fullPath; +NPCH fullPath; Directory *p; -char *headPath; +NPCH headPath; { if (p->d_parent) Canonicalize (fullPath, p->d_parent, headPath); @@ -193,7 +195,7 @@ char *headPath; */ buildTree (par,parPath) Directory *par; -char *parPath; +NPCH parPath; { char sName[MAX_PATH_LEN]; /* Search path name */ Directory *child; @@ -205,7 +207,7 @@ char *parPath; Directory *bfsTail; FileSearch sBuf; /* Find First/Next buffer */ unsigned sCount; /* Number of entries to search for */ - unsigned sHandle; /* Search Handle */ + HDIR sHandle; /* Search Handle */ bfsHead = par; bfsTail = par; @@ -218,8 +220,8 @@ char *parPath; Canonicalize (sName, bfsHead, parPath); sLen = strlen(sName); - VIOWRTCHARSTRATT (chfs(sName), sLen, WINDOW_TOP,0, afs(&a), VioHandle); - VIOWRTNCELL (cefs(&c), N_of_Cols-sLen, WINDOW_TOP,sLen, VioHandle); + VioWrtCharStrAtt (chfs(sName), sLen, WINDOW_TOP,0, afs(&a), VioHandle); + VioWrtNCell (cefs(&c), N_of_Cols-sLen, WINDOW_TOP,sLen, VioHandle); if (sName[sLen-1] == '\\') strcat (sName, "*.*"); @@ -227,28 +229,28 @@ char *parPath; strcat (sName, "\\*.*"); sHandle = -1; /* Family API only has one handle */ sCount = 1; /* Search for one at a time */ - errCode = DOSFINDFIRST (chfs(sName), - ufs(&sHandle), + errCode = DosFindFirst (chfs(sName), + &sHandle, DosAttrSubDir, - (FileSearch far *) &sBuf, + &sBuf, sizeof(sBuf), ufs(&sCount), 0L); while (!errCode) { - if (sBuf.file_name[0] != '.') { /* Not a back link */ - if (sBuf.attributes & DosAttrSubDir) { /* A subdirectory */ - newDir (&child, sBuf.file_name, bfsHead); + if (sBuf.achName[0] != '.') { /* Not a back link */ + if (sBuf.attrFile & DosAttrSubDir) { /* A subdirectory */ + newDir (&child, sBuf.achName, bfsHead); insDir (bfsHead, child, &bfsTail); bfsTail->d_link = child; bfsTail = child; } } - errCode = DOSFINDNEXT (sHandle, - (FileSearch far *) &sBuf, + errCode = DosFindNext (sHandle, + &sBuf, sizeof(sBuf), ufs(&sCount)); } - DOSFINDCLOSE (sHandle); + DosFindClose (sHandle); bfsHead = bfsHead->d_link; } } /* buildTree */ @@ -289,7 +291,7 @@ Directory *child; */ newDir (dir,name,par) Directory **dir; -char *name; +NPCH name; Directory *par; { Directory *p;