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
84,
92-96(3),
591,
699,
751-753(4),
791-794(2),
834-835(2),
1223,
1277,
1392-1394(4),
1512,
1541
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
18-21(4),
528(2),
581-589(8),
703-704(4),
731-736(6),
760-765(8),
811-816(8),
935(2),
945(2),
953-955(4),
1001-1007(6),
1026-1030(6),
1083(2),
1151(2),
1171-1174(4),
1250-1255(6),
1283(2),
1332-1335(4),
1351(2),
1370-1372(4),
1420-1424(6),
1468(2),
1496-1500(6),
1518-1520(4),
1527-1531(6),
1588(2),
1628-1629(4),
1639(2),
1671-1675(4),
1689-1702(10),
1719-1724(6),
1740(2),
1750(2),
1759(2),
1783(2),
1791(2),
1824(2),
1867(2),
1886(2),
1895-1897(4),
1908(2),
1918-1920(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
60,
105,
128,
186,
213,
225,
297,
314,
325,
365,
397,
455,
492,
498,
534
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
113,
129,
137,
300,
327-336(3),
388,
407-410(2),
438,
460-467(3),
503-510(3),
540,
553
fsfile
defined in line
19; used 32 times
- in /usr/src/usr.bin/dc/dc.c line
188,
230,
237,
266,
315,
457,
500,
599,
606,
617,
626,
685,
691,
711-713(2),
769,
779,
799,
822,
1035,
1044,
1101,
1110,
1188,
1197,
1226,
1287,
1383,
1404,
1450,
1456,
1615
length
defined in line
16; used 56 times
- in /usr/src/usr.bin/dc/dc.c line
107,
136,
187,
219,
228,
236,
265,
278,
299,
308,
326,
376,
462,
482,
505,
517-521(2),
593,
601-605(2),
612(2),
768,
795,
820-821(2),
830-834(2),
841,
848,
1009,
1039,
1048-1053(3),
1195,
1219,
1258-1262(3),
1269,
1340,
1379-1382(2),
1388,
1399,
1410,
1429(4),
1594,
1635,
1641,
1648,
1730
rewind
defined in line
17; used 30 times
- in /usr/src/usr.bin/dc/dc.c line
142,
302,
329,
417,
445,
546,
637-638(2),
646,
673,
738,
751,
853,
1014,
1055-1059(3),
1089,
1177-1180(2),
1244,
1257,
1271,
1354,
1392,
1431-1432(2),
1502,
1636,
1847
sbackc
defined in line
34; used 50 times
- in /usr/src/usr.bin/dc/dc.c line
112,
132,
189-195(3),
231,
238-241(2),
267,
316,
459,
465,
502,
508,
600,
607,
618-630(6),
660-662(2),
687,
693,
715,
770-771(2),
780,
800,
825,
1038,
1047,
1102-1103(2),
1111,
1189,
1198,
1227,
1290,
1302,
1318,
1325,
1384,
1406,
1452-1458(3),
1616
sfbeg
defined in line
22; used 29 times
- in /usr/src/usr.bin/dc/dc.c line
132,
190-193(2),
241,
459,
465,
502,
508,
607,
620-622(2),
628-630(2),
686,
692,
715(2),
771,
800,
823,
1037,
1046,
1190,
1227,
1289,
1406,
1451-1457(3)
sfeof
defined in line
21; used 26 times
- in /usr/src/usr.bin/dc/dc.c line
144,
303,
418,
446,
640,
649-651(2),
675,
746,
752,
1015,
1056,
1062-1064(2),
1071,
1090,
1119,
1178-1181(2),
1245,
1355,
1393,
1435-1436(2),
1508,
1637
sgetc
defined in line
32; used 26 times
- in /usr/src/usr.bin/dc/dc.c line
143-145(2),
303,
330,
641,
651,
742-746(2),
752,
854,
1016,
1057,
1063,
1119,
1179-1182(2),
1245,
1264,
1272,
1360,
1393,
1435-1436(2),
1461,
1504-1508(2)
sputc
defined in line
36; used 69 times
- in /usr/src/usr.bin/dc/dc.c line
48,
76,
92,
100,
108,
122,
153-162(3),
168-169(2),
177-181(3),
204-208(3),
220,
263,
279,
290,
309,
319-320(2),
366,
400,
560-563(3),
615,
716,
742-746(2),
752,
784,
819,
856,
892-894(2),
901-906(3),
983,
993,
1011-1016(2),
1100,
1106,
1166,
1264,
1272-1273(2),
1339,
1356,
1366,
1393,
1402-1417(6),
1447-1449(2),
1508,
1535,
1542,
1550,
1654
sunputc
defined in line
38; used 16 times
- in /usr/src/usr.bin/dc/dc.c line
46,
63-67(3),
106,
129,
139,
712-714(2),
1196,
1413,
1476-1477(2),
1523,
1548,
1593
zero
defined in line
39; used 3 times
Usage of this include