aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/tcs/hdr.h
diff options
context:
space:
mode:
authorwkj <devnull@localhost>2004-04-21 01:15:41 +0000
committerwkj <devnull@localhost>2004-04-21 01:15:41 +0000
commita31db67d14c0e50353eac3db342f3c969cabdf76 (patch)
tree0cebd9a65bab940355f5be0751f53238366555d7 /src/cmd/tcs/hdr.h
parentba03b8910dd07511378e6f1007faf0539ed25598 (diff)
downloadplan9port-a31db67d14c0e50353eac3db342f3c969cabdf76.tar.gz
plan9port-a31db67d14c0e50353eac3db342f3c969cabdf76.tar.bz2
plan9port-a31db67d14c0e50353eac3db342f3c969cabdf76.zip
Add tcs; it compiles in my world, but I haven't tried it in Russ's yet.
Diffstat (limited to 'src/cmd/tcs/hdr.h')
-rw-r--r--src/cmd/tcs/hdr.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/cmd/tcs/hdr.h b/src/cmd/tcs/hdr.h
new file mode 100644
index 00000000..b065f2a3
--- /dev/null
+++ b/src/cmd/tcs/hdr.h
@@ -0,0 +1,46 @@
+extern int squawk;
+extern int clean;
+extern char *file;
+extern int verbose;
+extern long ninput, noutput, nrunes, nerrors;
+
+enum { From = 1, Table = 2, Func = 4 };
+
+typedef void (*Fnptr)(void);
+struct convert{
+ char *name;
+ char *chatter;
+ int flags;
+ void *data;
+ Fnptr fn;
+};
+extern struct convert convert[];
+struct convert *conv(char *, int);
+typedef void (*Infn)(int, long *, struct convert *);
+typedef void (*Outfn)(Rune *, int, long *);
+void outtable(Rune *, int, long *);
+
+void utf_in(int, long *, struct convert *);
+void utf_out(Rune *, int, long *);
+void isoutf_in(int, long *, struct convert *);
+void isoutf_out(Rune *, int, long *);
+
+#define N 10000 /* just blocking */
+#define OUT(out, r, n) if(out->flags&Table) outtable(r, n, (long *)out->data);\
+ else ((Outfn)(out->fn))(r, n, (long *)0)
+
+extern Rune runes[N];
+extern char obuf[UTFmax*N]; /* maximum bloat from N runes */
+
+#define BADMAP (0xFFFD)
+#define BYTEBADMAP ('?') /* badmap but has to fit in a byte */
+#define ESC 033
+
+#ifdef PLAN9
+#define EPR fprint(2,
+#define EXIT(n,s) exits(s)
+#else
+#define EPR fprintf(stderr,
+#define USED(x) /* in plan 9, USED(x) tells the compiler to treat x as used */
+#define EXIT(n,s) exit(n)
+#endif