13 /* not in ANSI or POSIX */
14 FILE* popen(char*, char*);
25 /* pipe command structure; allows redicously long commends for .pi */
33 int xon = 0; /* records if in middle of \X */
38 static int hx = 0; /* records if have seen HX */
57 switch (j = cbits(i)) {
73 if (!xon && !tflg && dip == &d[0])
74 j = eschar; /* fall through */
76 setcbits(i, trtab[j]);
78 if (NROFF & xon) /* rob fix for man2html */
95 if (!tflg && !print) {
97 dip->alss = dip->blss = 0;
100 if (j == FILLER && !xon)
102 if (tflg) { /* transparent mode, undiverted */
103 if (print) /* assumes that it's ok to print */
104 /* OUT "%c", j PUT; /* i.e., is ascii */
115 void outweird(int k) /* like ptchname() but ascii */
117 char *chn = chname(k);
121 OUT "%s", chn+1 PUT; /* \n not needed? */
124 OUT "\\N'%s'", chn+1 PUT;
127 if (strlen(chn+1) == 2)
128 OUT "\\(%s", chn+1 PUT;
130 OUT "\\C'%s'", chn+1 PUT;
133 OUT " %s? ", chn PUT;
138 void outascii(Tchar i) /* print i in best-guess ascii */
143 /* is this ever called with NROFF set? probably doesn't work at all. */
147 else if (j < ALPHABET && j >= ' ' || j == '\n' || j == '\t')
149 else if (j == DRAWFCN)
151 else if (j == HYPHEN)
153 else if (j == MINUS) /* special pleading for strange encodings */
157 else if (j == FILLER)
161 else if (j == OHC) /* this will never occur; stripped out earlier */
167 else if (j == LIG_FI)
169 else if (j == LIG_FL)
171 else if (j == LIG_FF)
173 else if (j == LIG_FFI)
175 else if (j == LIG_FFL)
177 else if (j == WORDSP) { /* nothing at all */
178 if (xon) /* except in \X */
187 if (NROFF && !toolate && t.twinit)
188 fwrite(t.twinit, strlen(t.twinit), 1, ptid);
191 if (pipeflg && !toolate) {
192 /* fprintf(stderr, "Pipe to <%s>\n", Pipe.buf); */
193 if (!Pipe.buf[0] || (ptid = popen(Pipe.buf, "w")) == NULL)
194 ERROR "pipe %s not created.", Pipe.buf WARN;
232 if (woff) /* BUG!!! This isn't set anywhere */
254 if (numtabp[NL].val) {
300 if (Pipe.buf == NULL) {
301 if ((Pipe.buf = (char *)calloc(NTM, sizeof(char))) == NULL) {
302 ERROR "No buf space for pipe cmd" WARN;
307 Pipe.buf[Pipe.cnt++] = '|';
312 ERROR "Cannot create pipe to %s", buf WARN;
318 if ((Pipe.buf = (char *)realloc(Pipe.buf, Pipe.tick * NTM * sizeof(char))) == NULL) {
319 ERROR "No more buf space for pipe cmd" WARN;
323 strcat(Pipe.buf, buf);