|
|
1.1 root 1: char id_mkvers[] = "%W%";
2: /*
3: * extract sccs id strings from source files
4: * first arg is lib name.
5: * Put them in Version.c
6: */
7:
8: #include <stdio.h>
9:
10: #define SCCS_ID "@(#)"
11: #define VERSION "Version.c"
12:
13: main(argc, argv)
14: int argc; char **argv;
15: {
16: char buf[256];
17: char *s, *e;
18: char *index(), *ctime();
19: long t;
20: FILE *V, *fdopen();
21:
22: V = stdout; /* fdopen(creat(VERSION, 0644), "w"); */
23: if (!V)
24: {
25: perror("mkvers");
26: exit(1);
27: }
28: fprintf(V, "char *sccs_id[] = {\n");
29: if (argc-- > 1)
30: {
31: time(&t);
32: s = ctime(&t) + 4;
33: s[20] = '\0';
34: fprintf(V, "\t\"%s%s\t%s\",\n", SCCS_ID, *++argv, s);
35: }
36: while (--argc)
37: {
38: if (freopen(*++argv, "r", stdin) == NULL)
39: {
40: perror(*argv);
41: continue;
42: }
43: while(gets(buf))
44: {
45: s = buf;
46: while(s = index(s, '@'))
47: if (strncmp(s, SCCS_ID, 4) == 0)
48: break;
49: if (s)
50: {
51: e = index(s, '"');
52: if (e)
53: {
54: *e = '\0';
55: fprintf(V, "\t\"%s\",\n", s);
56: break;
57: }
58: }
59: }
60: if (feof(stdin))
61: fprintf(stderr, "%s: no sccs id string\n", *argv);
62: }
63: fprintf(V, "};\n");
64: fclose(V);
65: fflush(stdout);
66: fflush(stderr);
67: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.