From fd847ba534519d7cb56ffccd750a345df9a792ec Mon Sep 17 00:00:00 2001 From: Tom London Date: Sun, 10 Dec 1978 18:55:22 -0500 Subject: [PATCH] Bell 32V development Work on file usr/src/cmd/tbl/tb.c Co-Authored-By: John Reiser Synthesized-from: 32v --- usr/src/cmd/tbl/tb.c | 82 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 usr/src/cmd/tbl/tb.c diff --git a/usr/src/cmd/tbl/tb.c b/usr/src/cmd/tbl/tb.c new file mode 100644 index 0000000000..0a68bda75f --- /dev/null +++ b/usr/src/cmd/tbl/tb.c @@ -0,0 +1,82 @@ + /* tb.c: check which entries exist, also storage allocation */ +# include "t..c" +checkuse() +{ +int i,c, k; +for(c=0; c=MAXVEC) + error("Too many characters in table"); +spvecs[spcount++]= pp = calloc(MAXCHS+200,1); +if (pp== -1 || pp == 0) + error("no space for characters"); +return(pp); +} +# define MAXPC 50 +char *thisvec; +int tpcount = -1; +char *tpvecs[MAXPC]; +alocv(n) +{ +int *tp, *q; +if (tpcount<0 || thisvec+n > tpvecs[tpcount]+MAXCHS) + { + tpcount++; + if (tpvecs[tpcount]==0) + { + tpvecs[tpcount] = calloc(MAXCHS,1); + } + thisvec = tpvecs[tpcount]; + if (thisvec == -1) + error("no space for vectors"); + } +tp=thisvec; +thisvec+=n; +for(q=tp; q