/* Testbed for duencode(), dudecode(), du2dir(), dir2du(), getwhl(). Link with Z3func01, z3func03, z3func05, itoa, strn. */ #include main() { int d,u,i; char name[9],pass[9]; char *du2dir(); printf("Environment type is %x\n",getetype()); printf("ZCPR path is at %x and is %d elements long.\n",getpath(),getspath()); printf("Wheel status: %s\n",getwhl() ? "ON":"OFF"); printf("Du ok flag is %s\n",getduok() ? "ON":"OFF"); printf("Quiet flag is %s\n",getquiet() ? "ON":"OFF"); for(d=0;d<16;++d) { for(u=0;u<32;++u) { i=duencode(d,u); du2dir(i,name); if(name[0]) { if(getwhl()) { getpass(i,pass); printf("%c%d:%s Password: %s \n",d+'A',u,name,pass[0]!=' '? pass:"None"); } else printf("%c%d:%s\n",d+'A',u,name); } } } printf("\nOK, now enter the name of a directory "); scanf("%s",name); i = dir2du(name); if(i == -1) printf("\nNo match found, sorry!\n"); else { printf("Found: %s\n",dir2a(i,name)); } }