testinc.c (477B)
1 #include "stdinc.h" 2 #include "vac.h" 3 #include "dat.h" 4 #include "fns.h" 5 #include "error.h" 6 7 void 8 threadmain(int argc, char **argv) 9 { 10 Biobuf b; 11 char *p; 12 13 ARGBEGIN{ 14 default: 15 goto usage; 16 }ARGEND 17 18 if(argc != 1){ 19 usage: 20 fprint(2, "usage: testinc includefile\n"); 21 threadexitsall("usage"); 22 } 23 24 loadexcludefile(argv[0]); 25 Binit(&b, 0, OREAD); 26 while((p = Brdline(&b, '\n')) != nil){ 27 p[Blinelen(&b)-1] = 0; 28 print("%d %s\n", includefile(p), p); 29 } 30 threadexitsall(0); 31 }