]> git.sur5r.net Git - openldap/blob - libraries/liblunicode/utbm/utbm.h
Cyrus SASL uses screwy terms.
[openldap] / libraries / liblunicode / utbm / utbm.h
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 _h_utbm
24 #define _h_utbm
25
26 /*
27  * $Id: utbm.h,v 1.1 1999/09/21 15:45:18 mleisher Exp $
28  */
29
30 #include "portable.h"
31
32 LDAP_BEGIN_DECL
33
34 #undef __
35 #define __(x) x
36
37 /*************************************************************************
38  *
39  * Types.
40  *
41  *************************************************************************/
42
43 /*
44  * Fundamental character types.
45  */
46 typedef unsigned long ucs4_t;
47 typedef unsigned short ucs2_t;
48
49 /*
50  * An opaque type used for the search pattern.
51  */
52 typedef struct _utbm_pattern_t *utbm_pattern_t;
53
54 /*************************************************************************
55  *
56  * Flags.
57  *
58  *************************************************************************/
59
60 #define UTBM_CASEFOLD          0x01
61 #define UTBM_IGNORE_NONSPACING 0x02
62 #define UTBM_SPACE_COMPRESS    0x04
63
64 /*************************************************************************
65  *
66  * API.
67  *
68  *************************************************************************/
69
70 extern utbm_pattern_t utbm_create_pattern __((void));
71
72 extern void utbm_free_pattern __((utbm_pattern_t pattern));
73
74 extern void utbm_compile __((ucs2_t *pat, unsigned long patlen,
75                              unsigned long flags, utbm_pattern_t pattern));
76
77 extern int utbm_exec __((utbm_pattern_t pat, ucs2_t *text,
78                          unsigned long textlen, unsigned long *match_start,
79                          unsigned long *match_end));
80
81 /*************************************************************************
82  *
83  * Prototypes for the stub functions needed.
84  *
85  *************************************************************************/
86
87 extern int _utbm_isspace __((ucs4_t c, int compress));
88
89 extern int _utbm_iscntrl __((ucs4_t c));
90
91 extern int _utbm_nonspacing __((ucs4_t c));
92
93 extern ucs4_t _utbm_tolower __((ucs4_t c));
94
95 extern ucs4_t _utbm_toupper __((ucs4_t c));
96
97 extern ucs4_t _utbm_totitle __((ucs4_t c));
98
99 #undef __
100
101 LDAP_END_DECL
102
103 #endif
104
105
106 #endif /* _h_utbm */