xref: /titanic_52/usr/src/uts/common/smbsrv/string.h (revision 911106dfb16696472af8c1b7b4c554a829354fa8)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_SMBSRV_STRING_H
27 #define	_SMBSRV_STRING_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #include <sys/types.h>
32 #include <smbsrv/smb_i18n.h>
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 extern char *strsubst(char *, char, char);
39 extern char *strsep(char **, const char *);
40 extern char *strcanon(char *, const char *);
41 
42 extern char *utf8_strupr(char *);
43 extern char *utf8_strlwr(char *);
44 extern int utf8_isstrupr(const char *);
45 extern int utf8_isstrlwr(const char *);
46 extern int utf8_strcasecmp(const char *, const char *);
47 extern int utf8_strncasecmp(const char *, const char *, int);
48 extern int utf8_isstrascii(const char *);
49 
50 extern int smb_match(char *patn, char *str);
51 extern int smb_match_ci(char *patn, char *str);
52 extern int smb_match83(char *patn, char *str83);
53 
54 /*
55  * Maximum number of bytes per multi-byte character.
56  */
57 #define	MTS_MB_CUR_MAX		3
58 #define	MTS_MB_CHAR_MAX		MTS_MB_CUR_MAX
59 
60 size_t mts_mbstowcs(mts_wchar_t *, const char *, size_t);
61 size_t mts_wcstombs(char *, const mts_wchar_t *, size_t);
62 int mts_mbtowc(mts_wchar_t *, const char *, size_t);
63 int mts_wctomb(char *, mts_wchar_t);
64 
65 size_t mts_wcequiv_strlen(const char *);
66 size_t mts_sbequiv_strlen(const char *);
67 
68 int mts_stombs(char *, char *, int);
69 int mts_mbstos(char *, const char *);
70 
71 #ifdef __cplusplus
72 }
73 #endif
74 
75 #endif	/* _SMBSRV_STRING_H */
76