Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
extern int squawk;
2
extern int clean;
3
extern char *file;
4
extern int verbose;
5
extern long ninput, noutput, nrunes, nerrors;
6
 
7
enum { From = 1, Table = 2, Func = 4 };
8
 
9
typedef void (*Fnptr)(void);
10
struct convert{
11
	char *name;
12
	char *chatter;
13
	int flags;
14
	void *data;
15
	Fnptr fn;
16
};
17
extern struct convert convert[];
18
struct convert *conv(char *, int);
19
typedef void (*Infn)(int, long *, struct convert *);
20
typedef void (*Outfn)(Rune *, int, long *);
21
void outtable(Rune *, int, long *);
22
 
23
void utf_in(int, long *, struct convert *);
24
void utf_out(Rune *, int, long *);
25
void isoutf_in(int, long *, struct convert *);
26
void isoutf_out(Rune *, int, long *);
27
 
28
#define		N		10000		/* just blocking */
29
#define	OUT(out, r, n)	if(out->flags&Table) outtable(r, n, (long *)out->data);\
30
			else ((Outfn)(out->fn))(r, n, (long *)0)
31
 
32
extern Rune runes[N];
33
extern char obuf[UTFmax*N];	/* maximum bloat from N runes */
34
 
35
#define		BADMAP		(0xFFFD)
36
#define		BYTEBADMAP	('?')		/* badmap but has to fit in a byte */
37
#define		ESC		033
38
 
39
#ifdef	PLAN9
40
#define	EPR		fprint(2,
41
#define	EXIT(n,s)	exits(s)
42
#else
43
#define	EPR		fprintf(stderr,
44
#define	USED(x)		/* in plan 9, USED(x) tells the compiler to treat x as used */
45
#define	EXIT(n,s)	exit(n)
46
#endif