Blob


1 /* Runes for special purposes (0xe800-0xfdff is Private Use Area) */
2 enum { NONE=0xe800, /* Emit nothing */
3 TAGS, /* Start of tag */
4 TAGE, /* End of tag */
5 SPCS, /* Start of special character name */
6 PAR, /* Newline, indent */
7 LIGS, /* Start of ligature codes */
9 /* need to keep in sync with utils.c:/ligtab */
10 LACU=LIGS, /* Acute (´) ligatures */
11 LGRV, /* Grave (ˋ) ligatures */
12 LUML, /* Umlaut (¨) ligatures */
13 LCED, /* Cedilla (¸) ligatures */
14 LTIL, /* Tilde (˜) ligatures */
15 LBRV, /* Breve (˘) ligatures */
16 LRNG, /* Ring (˚) ligatures */
17 LDOT, /* Dot (˙) ligatures */
18 LDTB, /* Dot below (.) ligatures */
19 LFRN, /* Frown (⌢) ligatures */
20 LFRB, /* Frown below (̯) ligatures */
21 LOGO, /* Ogonek (˛) ligatures */
22 LMAC, /* Macron (¯) ligatures */
23 LHCK, /* Hacek (ˇ) ligatures */
24 LASP, /* Asper (ʽ) ligatures */
25 LLEN, /* Lenis (ʼ) ligatures */
26 LBRB, /* Breve below (̮) ligatures */
27 LIGE, /* End of ligature codes */
29 /* need to keep in sync with utils.c:/multitab */
30 MULTI, /* Start of multi-rune codes */
31 MAAS=MULTI, /* ʽα */
32 MALN, /* ʼα */
33 MAND, /* and */
34 MAOQ, /* a/q */
35 MBRA, /* <| */
36 MDD, /* .. */
37 MDDD, /* ... */
38 MEAS, /* ʽε */
39 MELN, /* ʼε */
40 MEMM, /* —— */
41 MHAS, /* ʽη */
42 MHLN, /* ʼη */
43 MIAS, /* ʽι */
44 MILN, /* ʼι */
45 MLCT, /* ct */
46 MLFF, /* ff */
47 MLFFI, /* ffi */
48 MLFFL, /* ffl */
49 MLFL, /* fl */
50 MLFI, /* fi */
51 MLLS, /* ll with swing */
52 MLST, /* st */
53 MOAS, /* ʽο */
54 MOLN, /* ʼο */
55 MOR, /* or */
56 MRAS, /* ʽρ */
57 MRLN, /* ʼρ */
58 MTT, /* ~~ */
59 MUAS, /* ʽυ */
60 MULN, /* ʼυ */
61 MWAS, /* ʽω */
62 MWLN, /* ʼω */
63 MOE, /* oe */
64 MES, /* em space */
65 MULTIE, /* End of multi-rune codes */
66 };
67 #define Nligs (LIGE-LIGS)
68 #define Nmulti (MULTIE-MULTI)
70 typedef struct Entry Entry;
71 typedef struct Assoc Assoc;
72 typedef struct Nassoc Nassoc;
73 typedef struct Dict Dict;
75 struct Entry {
76 char *start; /* entry starts at start */
77 char *end; /* and finishes just before end */
78 long doff; /* dictionary offset (for debugging) */
79 };
81 struct Assoc {
82 char *key;
83 long val;
84 };
86 struct Nassoc {
87 long key;
88 long val;
89 };
91 struct Dict {
92 char *name; /* dictionary name */
93 char *desc; /* description */
94 char *path; /* path to dictionary data */
95 char *indexpath; /* path to index data */
96 long (*nextoff)(long); /* function to find next entry offset from arg */
97 void (*printentry)(Entry, int); /* function to print entry */
98 void (*printkey)(void); /* function to print pronunciation key */
99 };
101 int acomp(Rune*, Rune*);
102 Rune *changett(Rune *, Rune *, int);
103 void err(char*, ...);
104 void fold(Rune *);
105 void foldre(char*, char*);
106 Rune liglookup(Rune, Rune);
107 long lookassoc(Assoc*, int, char*);
108 long looknassoc(Nassoc*, int, long);
109 void outprint(char*, ...);
110 void outrune(long);
111 void outrunes(Rune *);
112 void outchar(int);
113 void outchars(char *);
114 void outnl(int);
115 void outpiece(char *, char *);
116 void runescpy(Rune*, Rune*);
117 long runetol(Rune*);
119 long oednextoff(long);
120 void oedprintentry(Entry, int);
121 void oedprintkey(void);
122 long ahdnextoff(long);
123 void ahdprintentry(Entry, int);
124 void ahdprintkey(void);
125 long pcollnextoff(long);
126 void pcollprintentry(Entry, int);
127 void pcollprintkey(void);
128 long pcollgnextoff(long);
129 void pcollgprintentry(Entry, int);
130 void pcollgprintkey(void);
131 long movienextoff(long);
132 void movieprintentry(Entry, int);
133 void movieprintkey(void);
134 long pgwnextoff(long);
135 void pgwprintentry(Entry,int);
136 void pgwprintkey(void);
137 void rogetprintentry(Entry, int);
138 long rogetnextoff(long);
139 void rogetprintkey(void);
140 long slangnextoff(long);
141 void slangprintentry(Entry, int);
142 void slangprintkey(void);
143 long robertnextoff(long);
144 void robertindexentry(Entry, int);
145 void robertprintkey(void);
146 long robertnextflex(long);
147 void robertflexentry(Entry, int);
148 long simplenextoff(long);
149 void simpleprintentry(Entry, int);
150 void simpleprintkey(void);
151 long thesnextoff(long);
152 void thesprintentry(Entry, int);
153 void thesprintkey(void);
154 long worldnextoff(long);
155 void worldprintentry(Entry, int);
156 void worldprintkey(void);
158 extern Biobuf *bdict;
159 extern Biobuf *bout;
160 extern int linelen;
161 extern int breaklen;
162 extern int outinhibit;
163 extern int debug;
164 extern Rune multitab[][5];
165 extern Dict dicts[];
167 #define asize(a) (sizeof (a)/sizeof(a[0]))