]> git.sur5r.net Git - openldap/blob - libraries/liblunicode/ucdata/api.txt
Cyrus SASL uses screwy terms.
[openldap] / libraries / liblunicode / ucdata / api.txt
1 #
2 # $Id: api.txt,v 1.2 1999/11/19 15:24:29 mleisher Exp $
3 #
4
5                              The MUTT UCData API
6                              -------------------
7
8
9
10
11 -----------------------------------------------------------------------------
12
13 Macros that combine to select data tables for ucdata_load(), ucdata_unload(),
14 and ucdata_reload().
15
16 #define UCDATA_CASE   0x01
17 #define UCDATA_CTYPE  0x02
18 #define UCDATA_DECOMP 0x04
19 #define UCDATA_CMBCL  0x08
20 #define UCDATA_NUM    0x10
21 #define UCATA_ALL (UCDATA_CASE|UCDATA_CTYPE|UCDATA_DECOMP|\
22                    UCDATA_CMBCL|UCDATA_NUM)
23 -----------------------------------------------------------------------------
24
25 void ucdata_load(char *paths, int masks)
26
27   This function initializes the UCData library by locating the data files in
28   one of the colon-separated directories in the `paths' parameter.  The data
29   files to be loaded are specified in the `masks' parameter as a bitwise
30   combination of the macros listed above.
31
32   This should be called before using any of the other functions.
33
34   NOTE: the ucdata_setup(char *paths) function is now a macro that expands
35         into this function at compile time.
36
37 -----------------------------------------------------------------------------
38
39 void ucdata_unload(int masks)
40
41   This function unloads the data tables specified in the `masks' parameter.
42
43   This function should be called when the application is done using the UCData
44   package.
45
46   NOTE: the ucdata_cleanup() function is now a macro that expands into this
47         function at compile time.
48
49 -----------------------------------------------------------------------------
50
51 void ucdata_reload(char *paths, int masks)
52
53   This function reloads the data files from one of the colon-separated
54   directories in the `paths' parameter.  The data files to be reloaded are
55   specified in the `masks' parameter as a bitwise combination of the macros
56   listed above.
57
58   If the data files have already been loaded, they are unloaded before the
59   data files are loaded again.
60
61 -----------------------------------------------------------------------------
62
63 int ucdecomp(unsigned long code, unsigned long *num, unsigned long **decomp)
64
65   This function determines if a character has a decomposition and returns the
66   decomposition information if it exists.
67
68   If a zero is returned, there is no decomposition.  If a non-zero is
69   returned, then the `num' and `decomp' variables are filled in with the
70   appropriate values.
71
72   Example call:
73
74     unsigned long i, num, *decomp;
75
76     if (ucdecomp(0x1d5, &num, &decomp) != 0) {
77        for (i = 0; i < num; i++)
78          printf("0x%08lX,", decomp[i]);
79        putchar('\n');
80     }
81
82 -----------------------------------------------------------------------------
83
84 int ucdecomp_hangul(unsigned long code, unsigned long *num,
85                     unsigned long decomp[])
86
87   This function determines if a Hangul syllable has a decomposition and
88   returns the decomposition information.
89
90   An array of at least size 3 should be passed to the function for the
91   decomposition of the syllable.
92
93   If a zero is returned, the character is not a Hangul syllable.  If a
94   non-zero is returned, the `num' field will be 2 or 3 and the syllable will
95   be decomposed into the `decomp' array arithmetically.
96
97   Example call:
98
99     unsigned long i, num, decomp[3];
100
101     if (ucdecomp_hangul(0xb1ba, &num, &decomp) != 0) {
102        for (i = 0; i < num; i++)
103          printf("0x%08lX,", decomp[i]);
104        putchar('\n');
105     }
106
107 -----------------------------------------------------------------------------
108
109 struct ucnumber {
110   int numerator;
111   int denominator;
112 };
113
114 int ucnumber_lookup(unsigned long code, struct ucnumber *num)
115
116   This function determines if the code is a number and fills in the `num'
117   field with the numerator and denominator.  If the code happens to be a
118   single digit, the numerator and denominator fields will be the same.
119
120   If the function returns 0, the code is not a number.  Any other return
121   value means the code is a number.
122
123 int ucdigit_lookup(unsigned long code, int *digit)
124
125   This function determines if the code is a digit and fills in the `digit'
126   field with the digit value.
127
128   If the function returns 0, the code is not a number.  Any other return
129   value means the code is a number.
130
131 struct ucnumber ucgetnumber(unsigned long code)
132
133   This is a compatibility function with John Cowan's "uctype" package.  It
134   uses ucnumber_lookup().
135
136 int ucgetdigit(unsigned long code)
137
138   This is a compatibility function with John Cowan's "uctype" package.  It
139   uses ucdigit_lookup().
140
141 -----------------------------------------------------------------------------
142
143 unsigned long uctoupper(unsigned long code)
144
145   This function returns the code unchanged if it is already upper case or has
146   no upper case equivalent.  Otherwise the upper case equivalent is returned.
147
148 -----------------------------------------------------------------------------
149
150 unsigned long uctolower(unsigned long code)
151
152   This function returns the code unchanged if it is already lower case or has
153   no lower case equivalent.  Otherwise the lower case equivalent is returned.
154
155 -----------------------------------------------------------------------------
156
157 unsigned long uctotitle(unsigned long code)
158
159   This function returns the code unchanged if it is already title case or has
160   no title case equivalent.  Otherwise the title case equivalent is returned.
161
162 -----------------------------------------------------------------------------
163
164 int ucisalpha(unsigned long code)
165 int ucisalnum(unsigned long code)
166 int ucisdigit(unsigned long code)
167 int uciscntrl(unsigned long code)
168 int ucisspace(unsigned long code)
169 int ucisblank(unsigned long code)
170 int ucispunct(unsigned long code)
171 int ucisgraph(unsigned long code)
172 int ucisprint(unsigned long code)
173 int ucisxdigit(unsigned long code)
174
175 int ucisupper(unsigned long code)
176 int ucislower(unsigned long code)
177 int ucistitle(unsigned long code)
178
179   These functions (actually macros) determine if a character has these
180   properties.  These behave in a fashion very similar to the venerable ctype
181   package.
182
183 -----------------------------------------------------------------------------
184
185 int ucisisocntrl(unsigned long code)
186
187   Is the character a C0 control character (< 32) ?
188
189 int ucisfmtcntrl(unsigned long code)
190
191   Is the character a format control character?
192
193 int ucissymbol(unsigned long code)
194
195   Is the character a symbol?
196
197 int ucisnumber(unsigned long code)
198
199   Is the character a number or digit?
200
201 int ucisnonspacing(unsigned long code)
202
203   Is the character non-spacing?
204
205 int ucisopenpunct(unsigned long code)
206
207   Is the character an open/left punctuation (i.e. '[')
208
209 int ucisclosepunct(unsigned long code)
210
211   Is the character an close/right punctuation (i.e. ']')
212
213 int ucisinitialpunct(unsigned long code)
214
215   Is the character an initial punctuation (i.e. U+2018 LEFT SINGLE QUOTATION
216   MARK)
217
218 int ucisfinalpunct(unsigned long code)
219
220   Is the character a final punctuation (i.e. U+2019 RIGHT SINGLE QUOTATION
221   MARK)
222
223 int uciscomposite(unsigned long code)
224
225   Can the character be decomposed into a set of other characters?
226
227 int ucisquote(unsigned long code)
228
229   Is the character one of the many quotation marks?
230
231 int ucissymmetric(unsigned long code)
232
233   Is the character one that has an opposite form (i.e. <>)
234
235 int ucismirroring(unsigned long code)
236
237   Is the character mirroring (superset of symmetric)?
238
239 int ucisnonbreaking(unsigned long code)
240
241   Is the character non-breaking (i.e. non-breaking space)?
242
243 int ucisrtl(unsigned long code)
244
245   Does the character have strong right-to-left directionality (i.e. Arabic
246   letters)?
247
248 int ucisltr(unsigned long code)
249
250   Does the character have strong left-to-right directionality (i.e. Latin
251   letters)?
252
253 int ucisstrong(unsigned long code)
254
255   Does the character have strong directionality?
256
257 int ucisweak(unsigned long code)
258
259   Does the character have weak directionality (i.e. numbers)?
260
261 int ucisneutral(unsigned long code)
262
263   Does the character have neutral directionality (i.e. whitespace)?
264
265 int ucisseparator(unsigned long code)
266
267   Is the character a block or segment separator?
268
269 int ucislsep(unsigned long code)
270
271   Is the character a line separator?
272
273 int ucispsep(unsigned long code)
274
275   Is the character a paragraph separator?
276
277 int ucismark(unsigned long code)
278
279   Is the character a mark of some kind?
280
281 int ucisnsmark(unsigned long code)
282
283   Is the character a non-spacing mark?
284
285 int ucisspmark(unsigned long code)
286
287   Is the character a spacing mark?
288
289 int ucismodif(unsigned long code)
290
291   Is the character a modifier letter?
292
293 int ucismodifsymbol(unsigned long code)
294
295   Is the character a modifier symbol?
296
297 int ucisletnum(unsigned long code)
298
299   Is the character a number represented by a letter?
300
301 int ucisconnect(unsigned long code)
302
303   Is the character connecting punctuation?
304
305 int ucisdash(unsigned long code)
306
307   Is the character dash punctuation?
308
309 int ucismath(unsigned long code)
310
311   Is the character a math character?
312
313 int uciscurrency(unsigned long code)
314
315   Is the character a currency character?
316
317 int ucisenclosing(unsigned long code)
318
319   Is the character enclosing (i.e. enclosing box)?
320
321 int ucisprivate(unsigned long code)
322
323   Is the character from the Private Use Area?
324
325 int ucissurrogate(unsigned long code)
326
327   Is the character one of the surrogate codes?
328
329 int ucisdefined(unsigned long code)
330
331   Is the character defined (appeared in one of the data files)?
332
333 int ucisundefined(unsigned long code)
334
335   Is the character not defined (non-Unicode)?
336
337 int ucishan(unsigned long code)
338
339   Is the character a Han ideograph?
340
341 int ucishangul(unsigned long code)
342
343   Is the character a pre-composed Hangul syllable?