From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <007001c480c8$f6de6100$75fb7d50@SOMA> From: "boyd, rounin" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu> References: <001001c480aa$a79d3530$75fb7d50@SOMA> Subject: Re: [9fans] drawterm Date: Fri, 13 Aug 2004 02:03:26 +0200 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_006D_01C480D9.B8D0B280" Topicbox-Message-UUID: d43f10b0-eacd-11e9-9e20-41e7f4b1d025 This is a multi-part message in MIME format. ------=_NextPart_000_006D_01C480D9.B8D0B280 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit > From: "Russ Cox" thanks for the clarification, but PING is not an acceptable error message should you have a routing/ISP/firewall problem ... cut to monty python's _the meaning of life_: have we got the machine that goes BING? btw: nor is 'postnote 2'. bbtw: even ralph tries to get things right. ------=_NextPart_000_006D_01C480D9.B8D0B280 Content-Type: application/octet-stream; name="ralph.c" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ralph.c" #include =0A= #include =0A= #include =0A= #include =0A= =0A= /*=0A= * ralph=0A= *=0A= * A filter to read stdin and write latin-1 diacriticals as=0A= * quasi troff to stdout.=0A= *=0A= * =C2=A9 Boyd Roberts 2004=0A= */=0A= =0A= /* map latin-1 to troff diacriticals */=0A= static Rune *tab[256] =3D=0A= {=0A= [0xe0] L"`a", L"'a", L"^a", 0, 0, 0, 0, L"=C3=A7",=0A= [0xe8] L"`e", L"'e", L"^e", 0, 0, 0, L"^i", 0,=0A= [0xf0] 0, 0, 0, 0, 0, 0, L":o", 0,=0A= };=0A= =0A= /* troff string [diacritical] prefix */=0A= char *tp =3D "\\*";=0A= =0A= void=0A= main(int argc, char *argv[])=0A= {=0A= Biobuf bin;=0A= Biobuf bout;=0A= Biobuf *in;=0A= Biobuf *out;=0A= int c;=0A= int e;=0A= =0A= USED(argc);=0A= USED(argv);=0A= =0A= Binit(in =3D &bin, 0, OREAD);=0A= Binit(out =3D &bout, 1, OWRITE);=0A= e =3D 0;=0A= =0A= while ((c =3D Bgetc(in)) >=3D 0) {=0A= Rune *r;=0A= =0A= if (isascii(c)) {=0A= /* damn windows' CRs */=0A= if (c !=3D '\r' && Bputc(out, c) < 0) {=0A= e =3D 1;=0A= break;=0A= }=0A= =0A= continue;=0A= }=0A= =0A= if ((r =3D tab[c]) =3D=3D 0) {=0A= fprint(2, "ralph: unknown latin-1 0x%02x\n", c);=0A= exits("update latin-1 table");=0A= }=0A= =0A= /* single Rune or troff diacritical */=0A= if (runestrlen(r) =3D=3D 1) {=0A= if (Bprint(out, "%C", *r) =3D=3D Beof)=0A= e =3D 1;=0A= }=0A= else if (Bprint(out, "%s%S", tp, r) =3D=3D Beof)=0A= e =3D 1;=0A= =0A= if (e)=0A= break;=0A= }=0A= =0A= if (!e && Bflush(out) < 0)=0A= e =3D 1;=0A= =0A= exits(e ? "i/o error" : "");=0A= }=0A= ------=_NextPart_000_006D_01C480D9.B8D0B280--