Bell 32V development
authorTom London <tbl@research.uucp>
Fri, 19 Jan 1979 05:26:37 +0000 (00:26 -0500)
committerTom London <tbl@research.uucp>
Fri, 19 Jan 1979 05:26:37 +0000 (00:26 -0500)
Work on file usr/src/cmd/refer/refer4.c

Co-Authored-By: John Reiser <jfr@research.uucp>
Synthesized-from: 32v

usr/src/cmd/refer/refer4.c [new file with mode: 0644]

diff --git a/usr/src/cmd/refer/refer4.c b/usr/src/cmd/refer/refer4.c
new file mode 100644 (file)
index 0000000..476d7c9
--- /dev/null
@@ -0,0 +1,65 @@
+# include "refer..c"
+static gate = 0;
+static char buff[LLINE];
+output (s)
+       char *s;
+{
+if (gate)
+       fputs(buff,ftemp);
+else
+       gate=1;
+strcpy(buff,s);
+if (strlen(buff)>LLINE)
+       err("one buff too big (%d)!", LLINE);
+}
+append(s)
+       char *s;
+{
+char *p, *r; int lch;
+trimnl(buff);
+for (p=buff; *p; p++)
+       ;
+lch = *--p;
+switch (lch)
+       {
+       case '.': case ',':
+               *p=0;
+               r="\\*(<";
+               while (*r) *p++= *r++;
+               *p++ = lch;
+               *p=0;
+       }
+strcat(buff,s);
+switch(lch)
+       {
+       case '.': case ',':
+               for(p=buff; *p; p++)
+                       ;
+               if (*--p=='\n')*p=0;
+               r = "\\*(>";
+               while (*r) *p++ = *r++;
+               *p++ = lch;
+               *p++ = '\n';
+               *p=0;
+       }
+if (strlen(buff)>LLINE)
+       err("output buff too long (%d)", LLINE);
+}
+
+flout()
+{
+if (gate)
+       fputs(buff,ftemp);
+gate=0;
+}
+
+char *
+trimnl(ln)
+       char *ln;
+{
+register char *p = ln;
+while (*p) p++;
+p--;
+if (*p == '\n') *p=0;
+return(ln);
+}