19 /* pipe command structure; allows redicously long commends for .pi */
27 int xon
= 0; /* records if in middle of \X */
32 static int hx
= 0; /* records if have seen HX */
51 switch (j
= cbits(i
)) {
67 if (!xon
&& !tflg
&& dip
== &d
[0])
68 j
= eschar
; /* fall through */
70 setcbits(i
, trtab
[j
]);
72 if (NROFF
& xon
) /* rob fix for man2html */
89 if (!tflg
&& !print
) {
91 dip
->alss
= dip
->blss
= 0;
94 if (j
== FILLER
&& !xon
)
96 if (tflg
) { /* transparent mode, undiverted */
97 if (print
) /* assumes that it's ok to print */
98 /* OUT "%c", j PUT; /* i.e., is ascii */
109 void outweird(int k
) /* like ptchname() but ascii */
111 char *chn
= chname(k
);
115 OUT
"%s", chn
+1 PUT
; /* \n not needed? */
118 OUT
"\\N'%s'", chn
+1 PUT
;
121 if (strlen(chn
+1) == 2)
122 OUT
"\\(%s", chn
+1 PUT
;
124 OUT
"\\C'%s'", chn
+1 PUT
;
127 OUT
" %s? ", chn PUT
;
132 void outascii(Tchar i
) /* print i in best-guess ascii */
136 /* is this ever called with NROFF set? probably doesn't work at all. */
140 else if (j
< ALPHABET
&& j
>= ' ' || j
== '\n' || j
== '\t')
142 else if (j
== DRAWFCN
)
144 else if (j
== HYPHEN
)
146 else if (j
== MINUS
) /* special pleading for strange encodings */
150 else if (j
== FILLER
)
154 else if (j
== OHC
) /* this will never occur; stripped out earlier */
160 else if (j
== LIG_FI
)
162 else if (j
== LIG_FL
)
164 else if (j
== LIG_FF
)
166 else if (j
== LIG_FFI
)
168 else if (j
== LIG_FFL
)
170 else if (j
== WORDSP
) { /* nothing at all */
171 if (xon
) /* except in \X */
180 if (NROFF
&& !toolate
&& t
.twinit
)
181 fwrite(t
.twinit
, strlen(t
.twinit
), 1, ptid
);
184 if (pipeflg
&& !toolate
) {
185 /* fprintf(stderr, "Pipe to <%s>\n", Pipe.buf); */
186 if (!Pipe
.buf
[0] || (ptid
= popen(Pipe
.buf
, "w")) == NULL
)
187 ERROR
"pipe %s not created.", Pipe
.buf WARN
;
225 if (woff
) /* BUG!!! This isn't set anywhere */
247 if (numtabp
[NL
].val
) {
293 if (Pipe
.buf
== NULL
) {
294 if ((Pipe
.buf
= (char *)calloc(NTM
, sizeof(char))) == NULL
) {
295 ERROR
"No buf space for pipe cmd" WARN
;
300 Pipe
.buf
[Pipe
.cnt
++] = '|';
305 ERROR
"Cannot create pipe to %s", buf WARN
;
311 if ((Pipe
.buf
= (char *)realloc(Pipe
.buf
, Pipe
.tick
* NTM
* sizeof(char))) == NULL
) {
312 ERROR
"No more buf space for pipe cmd" WARN
;
316 strcat(Pipe
.buf
, buf
);