1/* $OpenLDAP$ */
2/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
3 *
4 * Copyright 1998-2011 The OpenLDAP Foundation.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted only as authorized by the OpenLDAP
9 * Public License.
10 *
11 * A copy of this license is available in file LICENSE in the
12 * top-level directory of the distribution or, alternatively, at
13 * <http://www.OpenLDAP.org/license.html>.
14 */
15/* Copyright 1997, 1998, 1999 Computing Research Labs,
16 * New Mexico State University
17 *
18 * Permission is hereby granted, free of charge, to any person obtaining a
19 * copy of this software and associated documentation files (the "Software"),
20 * to deal in the Software without restriction, including without limitation
21 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
22 * and/or sell copies of the Software, and to permit persons to whom the
23 * Software is furnished to do so, subject to the following conditions:
24 *
25 * The above copyright notice and this permission notice shall be included in
26 * all copies or substantial portions of the Software.
27 *
28 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
29 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
30 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
31 * THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY
32 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
33 * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
34 * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35 */
36/* $Id: utbm.h,v 1.1 1999/09/21 15:45:18 mleisher Exp $ */
37
38#ifndef _h_utbm
39#define _h_utbm
40
41#include "portable.h"
42
43LDAP_BEGIN_DECL
44
45/*************************************************************************
46 *
47 * Types.
48 *
49 *************************************************************************/
50
51/*
52 * Fundamental character types.
53 */
54typedef unsigned long ucs4_t;
55typedef unsigned short ucs2_t;
56
57/*
58 * An opaque type used for the search pattern.
59 */
60typedef struct _utbm_pattern_t *utbm_pattern_t;
61
62/*************************************************************************
63 *
64 * Flags.
65 *
66 *************************************************************************/
67
68#define UTBM_CASEFOLD          0x01
69#define UTBM_IGNORE_NONSPACING 0x02
70#define UTBM_SPACE_COMPRESS    0x04
71
72/*************************************************************************
73 *
74 * API.
75 *
76 *************************************************************************/
77
78LDAP_LUNICODE_F (utbm_pattern_t) utbm_create_pattern LDAP_P((void));
79
80LDAP_LUNICODE_F (void) utbm_free_pattern LDAP_P((utbm_pattern_t pattern));
81
82LDAP_LUNICODE_F (void)
83utbm_compile LDAP_P((ucs2_t *pat, unsigned long patlen,
84		     unsigned long flags, utbm_pattern_t pattern));
85
86LDAP_LUNICODE_F (int)
87utbm_exec LDAP_P((utbm_pattern_t pat, ucs2_t *text,
88		  unsigned long textlen, unsigned long *match_start,
89		  unsigned long *match_end));
90
91/*************************************************************************
92 *
93 * Prototypes for the stub functions needed.
94 *
95 *************************************************************************/
96
97LDAP_LUNICODE_F (int) _utbm_isspace LDAP_P((ucs4_t c, int compress));
98
99LDAP_LUNICODE_F (int) _utbm_iscntrl LDAP_P((ucs4_t c));
100
101LDAP_LUNICODE_F (int) _utbm_nonspacing LDAP_P((ucs4_t c));
102
103LDAP_LUNICODE_F (ucs4_t) _utbm_tolower LDAP_P((ucs4_t c));
104
105LDAP_LUNICODE_F (ucs4_t) _utbm_toupper LDAP_P((ucs4_t c));
106
107LDAP_LUNICODE_F (ucs4_t) _utbm_totitle LDAP_P((ucs4_t c));
108
109LDAP_END_DECL
110
111#endif
112
113
114#endif /* _h_utbm */
115