]> git.sur5r.net Git - openldap/blob - libraries/liblunicode/utbm/utbmstub.c
Initial revision
[openldap] / libraries / liblunicode / utbm / utbmstub.c
1 /*
2  * Copyright 1997, 1998, 1999 Computing Research Labs,
3  * New Mexico State University
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in
13  * all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18  * THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY
19  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
20  * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
21  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22  */
23 #ifndef lint
24 static char rcsid[] = "$Id: utbmstub.c,v 1.1 1999/09/21 15:45:18 mleisher Exp $";
25 #endif
26
27 #include "utbm.h"
28
29 /*
30  * This should be redefined to use the `isspace' function available in the
31  * Unicode support on the platform where this is being used.
32  */
33 #define _platform_isspace(x) 0
34
35 /*
36  * Return non-zero for any character that should be considered the equivalent
37  * of a space character.  Return zero otherwise.
38  */
39 int
40 #ifdef __STDC__
41 _utbm_isspace(ucs4_t c, int compress)
42 #else
43 _utbm_isspace(c, compress)
44 ucs4_t c;
45 int compress;
46 #endif
47 {
48     if (compress)
49       return (c == 0x09 || c == 0x0a || c == 0x0d ||
50               c == 0x2028 || c == 0x2029 || _platform_isspace(c)) ? 1 : 0;
51
52     return _platform_isspace(c);
53         
54 }
55
56 /*
57  * Return non-zero if the character is a control character, or zero otherwise.
58  */
59 int
60 #ifdef __STDC__
61 _utbm_iscntrl(ucs4_t c)
62 #else
63 _utbm_iscntrl(c)
64 ucs4_t c;
65 #endif
66 {
67     return 0;
68 }
69
70 /*
71  * Return non-zero if the character is a non-spacing character, or zero
72  * otherwise.
73  */
74 int
75 #ifdef __STDC__
76 _utbm_nonspacing(ucs4_t c)
77 #else
78 _utbm_nonspacing(c)
79 ucs4_t c;
80 #endif
81 {
82     return 0;
83 }
84
85 /*
86  * Convert a character to lower case.
87  */
88 ucs4_t
89 #ifdef __STDC__
90 _utbm_tolower(ucs4_t c)
91 #else
92 _utbm_tolower(c)
93 ucs4_t c;
94 #endif
95 {
96     return c;
97 }
98
99 /*
100  * Convert a character to upper case.
101  */
102 ucs4_t
103 #ifdef __STDC__
104 _utbm_toupper(ucs4_t c)
105 #else
106 _utbm_toupper(c)
107 ucs4_t c;
108 #endif
109 {
110     return c;
111 }
112
113 /*
114  * Convert a character to title case.
115  */
116 ucs4_t
117 #ifdef __STDC__
118 _utbm_totitle(ucs4_t c)
119 #else
120 _utbm_totitle(c)
121 ucs4_t c;
122 #endif
123 {
124     return c;
125 }