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