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