|
|
1.1 root 1: /*
2: * routines for
3: * ACNT: print only count, which is in id
4: * APARAM: print only count from id, but just as tag, not tagcnt
5: */
6:
7: #include "mkconf.h"
8:
9: int
10: cntsyntax(dp, ap, n)
11: register Dev *dp;
12: char **ap;
13: int n;
14: {
15: register Dev *ep, *bp;
16:
17: if (n > 0)
18: fprint(STDERR, "%s: superfluous junk ignored\n", dp->mdev->name);
19: for (ep = dlist, bp = NULL; ep; ) {
20: if (ep->mdev != dp->mdev) {
21: bp = ep;
22: ep = ep->next;
23: continue;
24: }
25: if ((dp->mdev->flags & FDUPOK) == 0) {
26: fprint(STDERR, "%s: multiply declared\n", dp->mdev->name);
27: errs++;
28: return (1);
29: }
30: /*
31: * dup but ok; delete the old one
32: */
33: if (bp == NULL) {
34: dlist = ep->next;
35: free((char *)ep);
36: ep = dlist;
37: }
38: else {
39: bp->next = ep->next;
40: free((char *)ep);
41: ep = bp->next;
42: }
43: }
44: return (0);
45: }
46:
47: int
48: cntputaddr(fd, dp)
49: int fd;
50: register Dev *dp;
51: {
52:
53: fprint(fd, "int %scnt = %d;\n", dp->mdev->tag, dp->id);
54: putstrs(fd, dp->mdev, dp->id);
55: }
56:
57: int
58: prmputaddr(fd, dp)
59: int fd;
60: register Dev *dp;
61: {
62:
63: fprint(fd, "int %s = %d;\n", dp->mdev->tag, dp->id);
64: putstrs(fd, dp->mdev, dp->id);
65: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.