]> git.sur5r.net Git - openldap/blob - libraries/liblunicode/ucdata/ucdata.man
Merge remote-tracking branch 'origin/mdb.RE/0.9'
[openldap] / libraries / liblunicode / ucdata / ucdata.man
1 .\"
2 .\" $Id: ucdata.man,v 1.5 2001/01/02 18:46:20 mleisher Exp $
3 .\"
4 .TH ucdata 3 "03 January 2001"
5 .SH NAME 
6 ucdata \- package for providing Unicode/ISO10646 character information
7
8 .SH SYNOPSIS
9 #include <ucdata.h>
10 .sp
11 void ucdata_load(char * paths, int masks)
12 .sp
13 void ucdata_unload(int masks)
14 .sp
15 void ucdata_reload(char * paths, int masks)
16 .sp
17 int ucdecomp(unsigned long code, unsigned long *num, unsigned long **decomp)
18 .sp
19 int uccanondecomp(const unsigned long *in, int inlen, unsigned long **out,
20 int *outlen)
21 .sp
22 int ucdecomp_hangul(unsigned long code, unsigned long *num,
23 unsigned long decomp[])
24 .sp
25 int uccomp(unsigned long ch1, unsigned long ch2, unsigned long *comp)
26 .sp
27 int uccomp_hangul(unsigned long *str, int len)
28 .sp
29 int uccanoncomp(unsiged long *str, int len)
30 .nf
31 struct ucnumber {
32   int numerator;
33   int denominator;
34 };
35 .sp
36 int ucnumber_lookup(unsigned long code, struct ucnumber *num)
37 .sp
38 int ucdigit_lookup(unsigned long code, int *digit)
39 .sp
40 struct ucnumber ucgetnumber(unsigned long code)
41 .sp
42 int ucgetdigit(unsigned long code)
43 .sp
44 unsigned long uctoupper(unsigned long code)
45 .sp
46 unsigned long uctolower(unsigned long code)
47 .sp
48 unsigned long uctotitle(unsigned long code)
49 .sp
50 int ucisalpha(unsigned long code)
51 .sp
52 int ucisalnum(unsigned long code)
53 .sp
54 int ucisdigit(unsigned long code)
55 .sp
56 int uciscntrl(unsigned long code)
57 .sp
58 int ucisspace(unsigned long code)
59 .sp
60 int ucisblank(unsigned long code)
61 .sp
62 int ucispunct(unsigned long code)
63 .sp
64 int ucisgraph(unsigned long code)
65 .sp
66 int ucisprint(unsigned long code)
67 .sp
68 int ucisxdigit(unsigned long code)
69 .sp
70 int ucisupper(unsigned long code)
71 .sp
72 int ucislower(unsigned long code)
73 .sp
74 int ucistitle(unsigned long code)
75 .sp
76 int ucisisocntrl(unsigned long code)
77 .sp
78 int ucisfmtcntrl(unsigned long code)
79 .sp
80 int ucissymbol(unsigned long code)
81 .sp
82 int ucisnumber(unsigned long code)
83 .sp
84 int ucisnonspacing(unsigned long code)
85 .sp
86 int ucisopenpunct(unsigned long code)
87 .sp
88 int ucisclosepunct(unsigned long code)
89 .sp
90 int ucisinitialpunct(unsigned long code)
91 .sp
92 int ucisfinalpunct(unsigned long code)
93 .sp
94 int uciscomposite(unsigned long code)
95 .sp
96 int ucisquote(unsigned long code)
97 .sp
98 int ucissymmetric(unsigned long code)
99 .sp
100 int ucismirroring(unsigned long code)
101 .sp
102 int ucisnonbreaking(unsigned long code)
103 .sp
104 int ucisrtl(unsigned long code)
105 .sp
106 int ucisltr(unsigned long code)
107 .sp
108 int ucisstrong(unsigned long code)
109 .sp
110 int ucisweak(unsigned long code)
111 .sp
112 int ucisneutral(unsigned long code)
113 .sp
114 int ucisseparator(unsigned long code)
115 .sp
116 int ucislsep(unsigned long code)
117 .sp
118 int ucispsep(unsigned long code)
119 .sp
120 int ucismark(unsigned long code)
121 .sp
122 int ucisnsmark(unsigned long code)
123 .sp
124 int ucisspmark(unsigned long code)
125 .sp
126 int ucismodif(unsigned long code)
127 .sp
128 int ucismodifsymbol(unsigned long code)
129 .sp
130 int ucisletnum(unsigned long code)
131 .sp
132 int ucisconnect(unsigned long code)
133 .sp
134 int ucisdash(unsigned long code)
135 .sp
136 int ucismath(unsigned long code)
137 .sp
138 int uciscurrency(unsigned long code)
139 .sp
140 int ucisenclosing(unsigned long code)
141 .sp
142 int ucisprivate(unsigned long code)
143 .sp
144 int ucissurrogate(unsigned long code)
145 .sp
146 int ucisidentstart(unsigned long code)
147 .sp
148 int ucisidentpart(unsigned long code)
149 .sp
150 int ucisdefined(unsigned long code)
151 .sp
152 int ucisundefined(unsigned long code)
153 .sp
154 int ucishan(unsigned long code)
155 .sp
156 int ucishangul(unsigned long code)
157
158 .SH DESCRIPTION
159 .TP 4
160 .BR Macros
161 .br
162 UCDATA_CASE
163 .br
164 UCDATA_CTYPE
165 .br
166 UCDATA_DECOMP
167 .br
168 UCDATA_CMBCL
169 .br
170 UCDATA_NUM
171 .br
172 UCDATA_ALL
173 .br
174 .TP 4
175 .BR ucdata_load()
176 This function initializes the UCData library by locating the data files in one
177 of the colon-separated directories in the `paths' parameter.  The data files
178 to be loaded are specified in the `masks' parameter as a bitwise combination
179 of the macros listed above.
180 .sp
181 This should be called before using any of the other functions.
182 .TP 4
183 .BR ucdata_unload()
184 This function unloads the data tables specified in the `masks' parameter.
185 .sp
186 This function should be called when the application is done using the UCData
187 package.
188 .TP 4
189 .BR ucdata_reload()
190 This function reloads the data files from one of the colon-separated
191 directories in the `paths' parameter.  The data files to be reloaded are
192 specified in the `masks' parameter as a bitwise combination of the macros
193 listed above.
194 .TP 4
195 .BR ucdecomp()
196 This function determines if a character has a decomposition and returns the
197 decomposition information if it exists.
198 .sp
199 If a zero is returned, there is no decomposition.  If a non-zero is
200 returned, then the `num' and `decomp' variables are filled in with the
201 appropriate values.
202 .sp
203 Example call:
204 .sp
205 .nf
206     unsigned long i, num, *decomp;
207
208     if (ucdecomp(0x1d5, &num, &decomp) != 0) {
209        for (i = 0; i < num; i++)
210          printf("0x%08lX,", decomp[i]);
211        putchar('\n');
212     }
213 .TP 4
214 .BR uccanondecomp()
215 This function will decompose a string, insuring the characters are in
216 canonical order for comparison.
217 .sp
218 If a decomposed string is returned, the caller is responsible for deallocating
219 the string.
220 .sp
221 If a -1 is returned, memory allocation failed.  If a zero is returned, no
222 decomposition was done.  Any other value means a decomposition string was
223 created and the values returned in the `out' and `outlen' parameters.
224 .TP 4
225 .BR ucdecomp_hangul()
226 This function determines if a Hangul syllable has a
227 decomposition and returns the decomposition information.
228 .sp
229 An array of at least size 3 should be passed to the function
230 for the decomposition of the syllable.
231 .sp
232 If a zero is returned, the character is not a Hangul
233 syllable. If a non-zero is returned, the `num' field
234 will be 2 or 3 and the syllable will be decomposed into
235 the `decomp' array arithmetically.
236 .sp
237 Example call:
238 .sp
239 .nf
240     unsigned long i, num, decomp[3];
241
242     if (ucdecomp_hangul(0xb1ba, &num, &decomp) != 0) {
243        for (i = 0; i < num; i++)
244          printf("0x%08lX,", decomp[i]);
245        putchar('\n');
246     }
247 .TP 4
248 .BR uccomp()
249 This function determines if a pair of characters have a composition, and
250 returns that composition if one exists.
251 .sp
252 A zero is returned is no composition exists for the character pair.  Any other
253 value indicates the `comp' field holds the character code representing the
254 composition of the two character codes.
255 .TP 4
256 .BR uccomp_hangul()
257 This composes the Hangul Jamo in-place in the string.
258 .sp
259 The returned value is the new length of the string.
260 .TP 4
261 .BR uccanoncomp()
262 This function does a full composition in-place in the string, including the
263 Hangul composition.
264 .sp
265 The returned value is the new length of the string.
266 .TP 4
267 .BR ucnumber_lookup()
268 This function determines if the code is a number and
269 fills in the `num' field with the numerator and
270 denominator.  If the code happens to be a single digit,
271 the numerator and denominator fields will be the same.
272 .sp
273 If the function returns 0, the code is not a number.
274 Any other return value means the code is a number.
275 .TP 4
276 .BR ucdigit_lookup()
277 This function determines if the code is a digit and
278 fills in the `digit' field with the digit value.
279 .sp
280 If the function returns 0, the code is not a number.
281 Any other return value means the code is a number.
282 .TP 4
283 .BR ucgetnumber()
284 This is a compatibility function with John Cowan's
285 "uctype" package.  It uses ucnumber_lookup().
286 .TP 4
287 .BR ucgetdigit()
288 This is a compatibility function with John Cowan's
289 "uctype" package.  It uses ucdigit_lookup().
290 .TP 4
291 .BR uctoupper()
292 This function returns the code unchanged if it is
293 already upper case or has no upper case equivalent.
294 Otherwise the upper case equivalent is returned.
295 .TP 4
296 .BR uctolower()
297 This function returns the code unchanged if it is
298 already lower case or has no lower case equivalent.
299 Otherwise the lower case equivalent is returned.
300 .TP 4
301 .BR uctotitle()
302 This function returns the code unchanged if it is
303 already title case or has no title case equivalent.
304 Otherwise the title case equivalent is returned.
305 .TP 4
306 .BR ucisalpha()
307 Test if \fIcode\fR is an alpha character.
308 .TP 4
309 .BR ucisalnum()
310 Test if \fIcode\fR is an alpha or digit character.
311 .TP 4
312 .BR ucisdigit()
313 Test if \fIcode\fR is a digit character.
314 .TP 4
315 .BR uciscntrl()
316 Test if \fIcode\fR is a control character.
317 .TP 4
318 .BR ucisspace()
319 Test if \fIcode\fR is a space character.
320 .TP 4
321 .BR ucisblank()
322 Test if \fIcode\fR is a blank character.
323 .TP 4
324 .BR ucispunct()
325 Test if \fIcode\fR is a punctuation character.
326 .TP 4
327 .BR ucisgraph()
328 Test if \fIcode\fR is a graphical (visible) character.
329 .TP 4
330 .BR ucisprint()
331 Test if \fIcode\fR is a printable character.
332 .TP 4
333 .BR ucisxdigit()
334 Test if \fIcode\fR is a hexadecimal digit character.
335 .TP 4
336 .BR ucisupper()
337 Test if \fIcode\fR is an upper case character.
338 .TP 4
339 .BR ucislower()
340 Test if \fIcode\fR is a lower case character.
341 .TP 4
342 .BR ucistitle()
343 Test if \fIcode\fR is a title case character.
344 .TP 4
345 .BR ucisisocntrl()
346 Is the character a C0 control character (< 32)?
347 .TP 4
348 .BR ucisfmtcntrl()
349 Is the character a format control character?
350 .TP 4
351 .BR ucissymbol()
352 Is the character a symbol?
353 .TP 4
354 .BR ucisnumber()
355 Is the character a number or digit?
356 .TP 4
357 .BR ucisnonspacing()
358 Is the character non-spacing?
359 .TP 4
360 .BR ucisopenpunct()
361 Is the character an open/left punctuation (i.e. '[')
362 .TP 4
363 .BR ucisclosepunct()
364 Is the character an close/right punctuation (i.e. ']')
365 .TP 4
366 .BR ucisinitialpunct()
367 Is the character an initial punctuation (i.e. U+2018 LEFT
368 SINGLE QUOTATION MARK)
369 .TP 4
370 .BR ucisfinalpunct()
371 Is the character a final punctuation (i.e. U+2019 RIGHT
372 SINGLE QUOTATION MARK)
373 .TP 4
374 .BR uciscomposite()
375 Can the character be decomposed into a set of other
376 characters?
377 .TP 4
378 .BR ucisquote()
379 Is the character one of the many quotation marks?
380 .TP 4
381 .BR ucissymmetric()
382 Is the character one that has an opposite form
383 (i.e. <>)
384 .TP 4
385 .BR ucismirroring()
386 Is the character mirroring (superset of symmetric)?
387 .TP 4
388 .BR ucisnonbreaking()
389 Is the character non-breaking (i.e. non-breaking
390 space)?
391 .TP 4
392 .BR ucisrtl()
393 Does the character have strong right-to-left
394 directionality (i.e. Arabic letters)?
395 .TP 4
396 .BR ucisltr()
397 Does the character have strong left-to-right
398 directionality (i.e. Latin letters)?
399 .TP 4
400 .BR ucisstrong()
401 Does the character have strong directionality?
402 .TP 4
403 .BR ucisweak()
404 Does the character have weak directionality
405 (i.e. numbers)?
406 .TP 4
407 .BR ucisneutral()
408 Does the character have neutral directionality
409 (i.e. whitespace)?
410 .TP 4
411 .BR ucisseparator()
412 Is the character a block or segment separator?
413 .TP 4
414 .BR ucislsep()
415 Is the character a line separator?
416 .TP 4
417 .BR ucispsep()
418 Is the character a paragraph separator?
419 .TP 4
420 .BR ucismark()
421 Is the character a mark of some kind?
422 .TP 4
423 .BR ucisnsmark()
424 Is the character a non-spacing mark?
425 .TP 4
426 .BR ucisspmark()
427 Is the character a spacing mark?
428 .TP 4
429 .BR ucismodif()
430 Is the character a modifier letter?
431 .TP 4
432 .BR ucismodifsymbol()
433 Is the character a modifier symbol?
434 .TP 4
435 .BR ucisletnum()
436 Is the character a number represented by a letter?
437 .TP 4
438 .BR ucisconnect()
439 Is the character connecting punctuation?
440 .TP 4
441 .BR ucisdash()
442 Is the character dash punctuation?
443 .TP 4
444 .BR ucismath()
445 Is the character a math character?
446 .TP 4
447 .BR uciscurrency()
448 Is the character a currency character?
449 .TP 4
450 .BR ucisenclosing()
451 Is the character enclosing (i.e. enclosing box)?
452 .TP 4
453 .BR ucisprivate()
454 Is the character from the Private Use Area?
455 .TP 4
456 .BR ucissurrogate()
457 Is the character one of the surrogate codes?
458 .TP 4
459 .BR ucisidentstart()
460 Is the character a legal initial character of an identifier?
461 .TP 4
462 .BR ucisidentpart()
463 Is the character a legal identifier character?
464 .TP 4
465 .BR ucisdefined()
466 Is the character defined (appeared in one of the data
467 files)?
468 .TP 4
469 .BR ucisundefined()
470 Is the character not defined (non-Unicode)?
471 .TP 4
472 .BR ucishan()
473 Is the character a Han ideograph?
474 .TP 4
475 .BR ucishangul()
476 Is the character a pre-composed Hangul syllable?
477
478 .SH "SEE ALSO"
479 ctype(3)
480
481 .SH ACKNOWLEDGMENTS
482 These are people who have helped with patches or
483 alerted me about problems.
484 .sp
485 John Cowan <cowan@locke.ccil.org>
486 .br
487 Bob Verbrugge <bob_verbrugge@nl.compuware.com>
488 .br
489 Christophe Pierret <cpierret@businessobjects.com>
490 .br
491 Kent Johnson <kent@pondview.mv.com>
492 .br
493 Valeriy E. Ushakov <uwe@ptc.spbu.ru>
494 .br
495 Stig Venaas <Stig.Venaas@uninett.no>
496
497 .SH AUTHOR
498 Mark Leisher
499 .br
500 Computing Research Lab
501 .br
502 New Mexico State University
503 .br
504 Email: mleisher@crl.nmsu.edu