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