aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/vac/testinc.c
blob: 0cd431434a80438995760e2410611d4b4d8b163e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "stdinc.h"
#include "vac.h"
#include "dat.h"
#include "fns.h"
#include "error.h"

void
threadmain(int argc, char **argv)
{
	Biobuf b;
	char *p;

	ARGBEGIN{
	default:
		goto usage;
	}ARGEND
	
	if(argc != 1){
	usage:
		fprint(2, "usage: testinc includefile\n");
		threadexitsall("usage");
	}
	
	loadexcludefile(argv[0]);
	Binit(&b, 0, OREAD);
	while((p = Brdline(&b, '\n')) != nil){
		p[Blinelen(&b)-1] = 0;
		print("%d %s\n", includefile(p), p);
	}
	threadexitsall(0);
}