4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 1989 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28 /* All Rights Reserved */
31 * University Copyright- Copyright (c) 1982, 1986, 1988
32 * The Regents of the University of California
35 * University Acknowledgment- Portions of this document are derived from
36 * software developed by the University of California, Berkeley, and its
40 #pragma ident "%Z%%M% %I% %E% SMI"
62 char mbobuf
[MB_LEN_MAX
] = {0};
77 static int hx
= 0; /* records if have seen HX */
96 switch (j
= cbits(i
)) {
107 j
= eschar
; /* fall through */
110 setcbits(i
, trtab
[j
]);
113 setcbits(i
, trtab
[j
]);
115 if (!multi_locale
|| (!(j
& CSMASK
) && !(j
& MBMASK1
)))
116 setcbits(i
, trtab
[j
]);
138 if (!tflg
&& !print
) {
140 dip
->alss
= dip
->blss
= 0;
143 if (no_out
|| j
== FILLER
)
145 if (tflg
) { /* transparent mode, undiverted */
146 fdprintf(ptid
, "%c", j
);
160 outascii(i
) /* print i in best-guess ascii */
169 if (j
< 0177 && j
>= ' ' || j
== '\n') {
175 else if (j
== HYPHEN
|| j
== MINUS
)
179 else if (j
== LIG_FI
)
181 else if (j
== LIG_FL
)
183 else if (j
== LIG_FF
)
185 else if (j
== LIG_FFI
)
187 else if (j
== LIG_FFL
)
189 else if (j
== WORDSP
)
190 ; /* nothing at all */
194 oput(chname
[chtab
[j
-128]]);
195 oput(chname
[chtab
[j
-128]+1]);
209 if (obufp >= &obuf[OBUFSZ])
241 if (p
- t
.twinit
> 1)
242 write(ptid
, t
.twinit
, p
- t
.twinit
- 1);
246 toolate
+= write(ptid
, obuf
, obufp
- obuf
);
286 eject((struct s
*)0);
298 if (numtab
[NL
].val
) {
300 eject((struct s
*)0);
337 signal(SIGINT
, SIG_IGN
);
338 signal(SIGTERM
, SIG_IGN
);
370 if (toolate
|| skip() || !getname() || pipe(id
) == -1 || (i
= fork()) == -1) {
371 errprint(gettext("Pipe not created."));
384 execl(nextf
, nextf
, 0);
385 errprint(gettext("Cannot exec %s"), nextf
);