xref: /titanic_50/usr/src/common/util/string.h (revision ae115bc77f6fcde83175c75b4206dc2e50747966)
1*ae115bc7Smrj /*
2*ae115bc7Smrj  * CDDL HEADER START
3*ae115bc7Smrj  *
4*ae115bc7Smrj  * The contents of this file are subject to the terms of the
5*ae115bc7Smrj  * Common Development and Distribution License (the "License").
6*ae115bc7Smrj  * You may not use this file except in compliance with the License.
7*ae115bc7Smrj  *
8*ae115bc7Smrj  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*ae115bc7Smrj  * or http://www.opensolaris.org/os/licensing.
10*ae115bc7Smrj  * See the License for the specific language governing permissions
11*ae115bc7Smrj  * and limitations under the License.
12*ae115bc7Smrj  *
13*ae115bc7Smrj  * When distributing Covered Code, include this CDDL HEADER in each
14*ae115bc7Smrj  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*ae115bc7Smrj  * If applicable, add the following below this CDDL HEADER, with the
16*ae115bc7Smrj  * fields enclosed by brackets "[]" replaced with your own identifying
17*ae115bc7Smrj  * information: Portions Copyright [yyyy] [name of copyright owner]
18*ae115bc7Smrj  *
19*ae115bc7Smrj  * CDDL HEADER END
20*ae115bc7Smrj  */
21*ae115bc7Smrj 
22*ae115bc7Smrj /*
23*ae115bc7Smrj  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24*ae115bc7Smrj  * Use is subject to license terms.
25*ae115bc7Smrj  */
26*ae115bc7Smrj 
27*ae115bc7Smrj #ifndef	_COMMON_UTIL_STRING_H
28*ae115bc7Smrj #define	_COMMON_UTIL_STRING_H
29*ae115bc7Smrj 
30*ae115bc7Smrj #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*ae115bc7Smrj 
32*ae115bc7Smrj #include <sys/types.h>
33*ae115bc7Smrj 
34*ae115bc7Smrj #ifdef __cplusplus
35*ae115bc7Smrj extern "C" {
36*ae115bc7Smrj #endif
37*ae115bc7Smrj 
38*ae115bc7Smrj #if !defined(_KMDB) && (!defined(_BOOT) || defined(__sparc))
39*ae115bc7Smrj 
40*ae115bc7Smrj extern size_t vsnprintf(char *, size_t, const char *, va_list);
41*ae115bc7Smrj /*PRINTFLIKE1*/
42*ae115bc7Smrj extern size_t snprintf(char *, size_t, const char *, ...);
43*ae115bc7Smrj 
44*ae115bc7Smrj #if defined(_BOOT) && defined(__sparc)
45*ae115bc7Smrj 
46*ae115bc7Smrj /*PRINTFLIKE2*/
47*ae115bc7Smrj extern int sprintf(char *, const char *, ...);
48*ae115bc7Smrj extern int vsprintf(char *, const char *, va_list);
49*ae115bc7Smrj 
50*ae115bc7Smrj #endif /* _BOOT && __sparc */
51*ae115bc7Smrj #endif /* !_KMDB && (!_BOOT || __sparc) */
52*ae115bc7Smrj 
53*ae115bc7Smrj extern char *strcat(char *, const char *);
54*ae115bc7Smrj extern char *strchr(const char *, int);
55*ae115bc7Smrj extern int strcmp(const char *, const char *);
56*ae115bc7Smrj extern int strncmp(const char *, const char *, size_t);
57*ae115bc7Smrj extern int strcasecmp(const char *, const char *);
58*ae115bc7Smrj extern int strncasecmp(const char *, const char *, size_t);
59*ae115bc7Smrj extern char *strcpy(char *, const char *);
60*ae115bc7Smrj extern char *strncpy(char *, const char *, size_t);
61*ae115bc7Smrj extern char *strrchr(const char *, int c);
62*ae115bc7Smrj extern char *strstr(const char *, const char *);
63*ae115bc7Smrj extern char *strpbrk(const char *, const char *);
64*ae115bc7Smrj extern char *strncat(char *, const char *, size_t);
65*ae115bc7Smrj extern size_t strlcat(char *, const char *, size_t);
66*ae115bc7Smrj extern size_t strlcpy(char *, const char *, size_t);
67*ae115bc7Smrj extern size_t strspn(const char *, const char *);
68*ae115bc7Smrj 
69*ae115bc7Smrj #if defined(_BOOT) || defined(_KMDB)
70*ae115bc7Smrj 
71*ae115bc7Smrj extern char *strtok(char *, const char *);
72*ae115bc7Smrj extern size_t strlen(const char *);
73*ae115bc7Smrj 
74*ae115bc7Smrj #endif /* _BOOT || _KMDB */
75*ae115bc7Smrj 
76*ae115bc7Smrj #ifdef _KERNEL
77*ae115bc7Smrj 
78*ae115bc7Smrj extern int strident_valid(const char *);
79*ae115bc7Smrj extern void strident_canon(char *, size_t);
80*ae115bc7Smrj 
81*ae115bc7Smrj #endif	/* _KERNEL */
82*ae115bc7Smrj 
83*ae115bc7Smrj #ifdef __cplusplus
84*ae115bc7Smrj }
85*ae115bc7Smrj #endif
86*ae115bc7Smrj 
87*ae115bc7Smrj #endif	/* _COMMON_UTIL_STRING_H */
88