xref: /onnv-gate/usr/src/common/util/string.h (revision 5930:ac8bbb374af7)
13446Smrj /*
23446Smrj  * CDDL HEADER START
33446Smrj  *
43446Smrj  * The contents of this file are subject to the terms of the
53446Smrj  * Common Development and Distribution License (the "License").
63446Smrj  * You may not use this file except in compliance with the License.
73446Smrj  *
83446Smrj  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
93446Smrj  * or http://www.opensolaris.org/os/licensing.
103446Smrj  * See the License for the specific language governing permissions
113446Smrj  * and limitations under the License.
123446Smrj  *
133446Smrj  * When distributing Covered Code, include this CDDL HEADER in each
143446Smrj  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
153446Smrj  * If applicable, add the following below this CDDL HEADER, with the
163446Smrj  * fields enclosed by brackets "[]" replaced with your own identifying
173446Smrj  * information: Portions Copyright [yyyy] [name of copyright owner]
183446Smrj  *
193446Smrj  * CDDL HEADER END
203446Smrj  */
213446Smrj 
223446Smrj /*
23*5930Smyers  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
243446Smrj  * Use is subject to license terms.
253446Smrj  */
263446Smrj 
273446Smrj #ifndef	_COMMON_UTIL_STRING_H
283446Smrj #define	_COMMON_UTIL_STRING_H
293446Smrj 
303446Smrj #pragma ident	"%Z%%M%	%I%	%E% SMI"
313446Smrj 
323446Smrj #include <sys/types.h>
333446Smrj 
343446Smrj #ifdef __cplusplus
353446Smrj extern "C" {
363446Smrj #endif
373446Smrj 
383446Smrj #if !defined(_KMDB) && (!defined(_BOOT) || defined(__sparc))
393446Smrj 
403446Smrj extern size_t vsnprintf(char *, size_t, const char *, va_list);
413446Smrj /*PRINTFLIKE1*/
423446Smrj extern size_t snprintf(char *, size_t, const char *, ...);
433446Smrj 
443446Smrj #if defined(_BOOT) && defined(__sparc)
453446Smrj 
463446Smrj /*PRINTFLIKE2*/
473446Smrj extern int sprintf(char *, const char *, ...);
483446Smrj extern int vsprintf(char *, const char *, va_list);
493446Smrj 
503446Smrj #endif /* _BOOT && __sparc */
513446Smrj #endif /* !_KMDB && (!_BOOT || __sparc) */
523446Smrj 
533446Smrj extern char *strcat(char *, const char *);
543446Smrj extern char *strchr(const char *, int);
553446Smrj extern int strcmp(const char *, const char *);
563446Smrj extern int strncmp(const char *, const char *, size_t);
573446Smrj extern int strcasecmp(const char *, const char *);
583446Smrj extern int strncasecmp(const char *, const char *, size_t);
593446Smrj extern char *strcpy(char *, const char *);
603446Smrj extern char *strncpy(char *, const char *, size_t);
613446Smrj extern char *strrchr(const char *, int c);
623446Smrj extern char *strstr(const char *, const char *);
633446Smrj extern char *strpbrk(const char *, const char *);
643446Smrj extern char *strncat(char *, const char *, size_t);
653446Smrj extern size_t strlcat(char *, const char *, size_t);
663446Smrj extern size_t strlcpy(char *, const char *, size_t);
673446Smrj extern size_t strspn(const char *, const char *);
68*5930Smyers extern size_t strnlen(const char *, size_t);
693446Smrj 
703446Smrj #if defined(_BOOT) || defined(_KMDB)
713446Smrj 
723446Smrj extern char *strtok(char *, const char *);
733446Smrj extern size_t strlen(const char *);
743446Smrj 
753446Smrj #endif /* _BOOT || _KMDB */
763446Smrj 
773446Smrj #ifdef _KERNEL
783446Smrj 
793446Smrj extern int strident_valid(const char *);
803446Smrj extern void strident_canon(char *, size_t);
813446Smrj 
823446Smrj #endif	/* _KERNEL */
833446Smrj 
843446Smrj #ifdef __cplusplus
853446Smrj }
863446Smrj #endif
873446Smrj 
883446Smrj #endif	/* _COMMON_UTIL_STRING_H */
89