1: /* dc.h 1.3 86/04/26 */
2:
3: #define FATAL 0
4: #define NFATAL 1
5: #define BLK sizeof(struct blk)
6: #define PTRSZ sizeof(int *)
7: #define HEADSZ 1024
8: #define STKSZ 100
9: #define RDSKSZ 100
10: #define TBLSZ 256
11: #define ARRAYST 0241
12: #define MAXIND 2048
13: #define NL 1
14: #define NG 2
15: #define NE 3
16: #define length(p) ((p)->wt-(p)->beg)
17: #define rewind(p) (p)->rd=(p)->beg
18: #define create(p) (p)->rd = (p)->wt = (p)->beg
19: #define fsfile(p) (p)->rd = (p)->wt
20: #define truncate(p) (p)->wt = (p)->rd
21: #define sfeof(p) (((p)->rd==(p)->wt)?1:0)
22: #define sfbeg(p) (((p)->rd==(p)->beg)?1:0)
23: #define sungetc(p,c) *(--(p)->rd)=c
24: #ifdef interdata
25: #define NEGBYTE 0200
26: #define MASK (-1 & ~0377)
27: #define sgetc(p) ( ((p)->rd==(p)->wt) ? EOF :( ((*(p)->rd & NEGBYTE) != 0) ? ( *(p)->rd++ | MASK): *(p)->rd++ ))
28: #define slookc(p) ( ((p)->rd==(p)->wt) ? EOF :( ((*(p)->rd & NEGBYTE) != 0) ? (*(p)->rd | MASK) : *(p)->rd ))
29: #define sbackc(p) ( ((p)->rd==(p)->beg) ? EOF :( ((*(--(p)->rd) & NEGBYTE) != 0) ? (*(p)->rd | MASK): *(p)->rd ))
30: #endif
31: #ifndef interdata
32: #define sgetc(p) (((p)->rd==(p)->wt)?EOF:*(p)->rd++)
33: #define slookc(p) (((p)->rd==(p)->wt)?EOF:*(p)->rd)
34: #define sbackc(p) (((p)->rd==(p)->beg)?EOF:*(--(p)->rd))
35: #endif
36: #define sputc(p,c) {if((p)->wt==(p)->last)more(p); *(p)->wt++ = c; }
37: #define salterc(p,c) {if((p)->rd==(p)->last)more(p); *(p)->rd++ = c; if((p)->rd>(p)->wt)(p)->wt=(p)->rd;}
38: #define sunputc(p) (*( (p)->rd = --(p)->wt))
39: #define zero(p) for(pp=(p)->beg;pp<(p)->last;)*pp++='\0'
40: #define OUTC(x) {printf("%c",x); if(--count == 0){printf("\\\n"); count=ll;} }
41: #define TEST2 {if((count -= 2) <=0){printf("\\\n");count=ll;}}
42: #define EMPTY if(stkerr != 0){printf("stack empty\n"); continue; }
43: #define EMPTYR(x) if(stkerr!=0){pushp(x);printf("stack empty\n");continue;}
44: #define EMPTYS if(stkerr != 0){printf("stack empty\n"); return(1);}
45: #define EMPTYSR(x) if(stkerr !=0){printf("stack empty\n");pushp(x);return(1);}
46: #define error(p) {printf(p); continue; }
47: #define errorrt(p) {printf(p); return(1); }
48: struct blk {
49: char *rd;
50: char *wt;
51: char *beg;
52: char *last;
53: };
54: struct blk *hfree;
55: struct blk *getwd();
56: struct blk *lookwd();
57: struct blk *getdec();
58: struct blk *morehd();
59:
60: struct blk *arg1, *arg2;
61: int svargc;
62: char savk;
63: char **svargv;
64: int dbg;
65: int ifile;
66: FILE *curfile;
67: struct blk *scalptr, *basptr, *tenptr, *inbas;
68: struct blk *sqtemp, *chptr, *strptr, *divxyz;
69: struct blk *stack[STKSZ];
70: struct blk **stkptr,**stkbeg;
71: struct blk **stkend;
72: int stkerr;
73: int lastchar;
74: struct blk *readstk[RDSKSZ];
75: struct blk **readptr;
76: struct blk *rem;
77: int k;
78: struct blk *irem;
79: int skd,skr;
80: struct blk *pop(),*readin(),*add0(),*mult();
81: struct blk *scalint();
82: struct blk *removc();
83: struct blk *add(),*div(),*removr();
84: struct blk *exp();
85: struct blk *sqrt();
86: struct blk *salloc(),*copy();
87: struct blk *scale();
88: int neg;
89: struct sym {
90: struct sym *next;
91: struct blk *val;
92: } symlst[TBLSZ];
93: struct sym *stable[TBLSZ];
94: struct sym *sptr,*sfree;
95: struct wblk {
96: struct blk **rdw;
97: struct blk **wtw;
98: struct blk **begw;
99: struct blk **lastw;
100: };
101: FILE *fsave;
102: long rel;
103: long nbytes;
104: long all;
105: long headmor;
106: long obase;
107: int fw,fw1,ll;
108: int (*outdit)();
109: int bigot(),hexot();
110: int logo;
111: int log10;
112: int count;
113: char *pp;
114: int (*signal())();
115: int onintr();
116: char *malloc();
117: char *nalloc();
118: char *realloc();
Defined variables
all
defined in line
104; used 4 times
arg1
defined in line
60; used 30 times
arg2
defined in line
60; used 16 times
chptr
defined in line
68; used 4 times
dbg
defined in line
64; used 1 times
fw
defined in line
107; used 7 times
fw1
defined in line
107; used 4 times
hfree
defined in line
54; used 11 times
ifile
defined in line
65; used 1 times
inbas
defined in line
67; used 8 times
irem
defined in line
78; used 8 times
k
defined in line
77; used 14 times
ll
defined in line
107; used 8 times
logo
defined in line
110; used 2 times
neg
defined in line
88; used 9 times
pp
defined in line
113; used 3 times
rel
defined in line
102; used 3 times
rem
defined in line
76; used 22 times
- in /usr/src/usr.bin/dc/dc.c line
83,
91-95(3),
590,
698,
750-752(4),
790-793(2),
833-834(2),
1222,
1276,
1391-1393(4),
1511,
1540
savk
defined in line
62; used 27 times
sfree
defined in line
94; used 15 times
skd
defined in line
79; used 4 times
skr
defined in line
79; used 5 times
sptr
defined in line
94; used 31 times
stable
defined in line
93; used 11 times
stack
defined in line
69; used 9 times
stkptr
defined in line
70; used 17 times
strptr
defined in line
68; used 24 times
Defined struct's
blk
defined in line
48; used 220 times
- in line 54-60(12),
67-99(44)
- in /usr/src/usr.bin/dc/dc.c line
17-20(4),
527(2),
580-588(8),
702-703(4),
730-735(6),
759-764(8),
810-815(8),
934(2),
944(2),
952-954(4),
1000-1006(6),
1025-1029(6),
1082(2),
1150(2),
1170-1173(4),
1249-1254(6),
1282(2),
1331-1334(4),
1350(2),
1369-1371(4),
1419-1423(6),
1467(2),
1495-1499(6),
1517-1519(4),
1526-1530(6),
1587(2),
1627-1628(4),
1638(2),
1670-1674(4),
1685-1698(10),
1715-1720(6),
1736(2),
1746(2),
1755(2),
1779(2),
1787(2),
1820(2),
1863(2),
1882(2),
1891-1893(4),
1904(2),
1914-1916(4)
sym
defined in line
89; used 12 times
wblk
defined in line
95; used 14 times
Defined macros
BLK
defined in line
5; used 1 times
EMPTY
defined in line
42; used 15 times
- in /usr/src/usr.bin/dc/dc.c line
59,
104,
127,
185,
212,
224,
296,
313,
324,
364,
396,
454,
491,
497,
533
FATAL
defined in line
3;
never used
HEADSZ
defined in line
7; used 4 times
MASK
defined in line
26; used 3 times
NE
defined in line
15; used 3 times
NFATAL
defined in line
4;
never used
NG
defined in line
14; used 2 times
NL
defined in line
13; used 2 times
OUTC
defined in line
40; used 9 times
PTRSZ
defined in line
6; used 13 times
RDSKSZ
defined in line
9; used 3 times
STKSZ
defined in line
8; used 2 times
TBLSZ
defined in line
10; used 4 times
TEST2
defined in line
41; used 3 times
error
defined in line
46; used 19 times
- in /usr/src/usr.bin/dc/dc.c line
112,
128,
136,
299,
326-335(3),
387,
406-409(2),
437,
459-466(3),
502-509(3),
539,
552
fsfile
defined in line
19; used 32 times
- in /usr/src/usr.bin/dc/dc.c line
187,
229,
236,
265,
314,
456,
499,
598,
605,
616,
625,
684,
690,
710-712(2),
768,
778,
798,
821,
1034,
1043,
1100,
1109,
1187,
1196,
1225,
1286,
1382,
1403,
1449,
1455,
1614
length
defined in line
16; used 56 times
- in /usr/src/usr.bin/dc/dc.c line
106,
135,
186,
218,
227,
235,
264,
277,
298,
307,
325,
375,
461,
481,
504,
516-520(2),
592,
600-604(2),
611(2),
767,
794,
819-820(2),
829-833(2),
840,
847,
1008,
1038,
1047-1052(3),
1194,
1218,
1257-1261(3),
1268,
1339,
1378-1381(2),
1387,
1398,
1409,
1428(4),
1593,
1634,
1640,
1647,
1726
rewind
defined in line
17; used 30 times
- in /usr/src/usr.bin/dc/dc.c line
141,
301,
328,
416,
444,
545,
636-637(2),
645,
672,
737,
750,
852,
1013,
1054-1058(3),
1088,
1176-1179(2),
1243,
1256,
1270,
1353,
1391,
1430-1431(2),
1501,
1635,
1843
sbackc
defined in line
34; used 50 times
- in /usr/src/usr.bin/dc/dc.c line
111,
131,
188-194(3),
230,
237-240(2),
266,
315,
458,
464,
501,
507,
599,
606,
617-629(6),
659-661(2),
686,
692,
714,
769-770(2),
779,
799,
824,
1037,
1046,
1101-1102(2),
1110,
1188,
1197,
1226,
1289,
1301,
1317,
1324,
1383,
1405,
1451-1457(3),
1615
sfbeg
defined in line
22; used 29 times
- in /usr/src/usr.bin/dc/dc.c line
131,
189-192(2),
240,
458,
464,
501,
507,
606,
619-621(2),
627-629(2),
685,
691,
714(2),
770,
799,
822,
1036,
1045,
1189,
1226,
1288,
1405,
1450-1456(3)
sfeof
defined in line
21; used 26 times
- in /usr/src/usr.bin/dc/dc.c line
143,
302,
417,
445,
639,
648-650(2),
674,
745,
751,
1014,
1055,
1061-1063(2),
1070,
1089,
1118,
1177-1180(2),
1244,
1354,
1392,
1434-1435(2),
1507,
1636
sgetc
defined in line
32; used 26 times
- in /usr/src/usr.bin/dc/dc.c line
142-144(2),
302,
329,
640,
650,
741-745(2),
751,
853,
1015,
1056,
1062,
1118,
1178-1181(2),
1244,
1263,
1271,
1359,
1392,
1434-1435(2),
1460,
1503-1507(2)
sputc
defined in line
36; used 69 times
- in /usr/src/usr.bin/dc/dc.c line
47,
75,
91,
99,
107,
121,
152-161(3),
167-168(2),
176-180(3),
203-207(3),
219,
262,
278,
289,
308,
318-319(2),
365,
399,
559-562(3),
614,
715,
741-745(2),
751,
783,
818,
855,
891-893(2),
900-905(3),
982,
992,
1010-1015(2),
1099,
1105,
1165,
1263,
1271-1272(2),
1338,
1355,
1365,
1392,
1401-1416(6),
1446-1448(2),
1507,
1534,
1541,
1549,
1653
sunputc
defined in line
38; used 16 times
- in /usr/src/usr.bin/dc/dc.c line
45,
62-66(3),
105,
128,
138,
711-713(2),
1195,
1412,
1475-1476(2),
1522,
1547,
1592
zero
defined in line
39; used 3 times
Usage of this include