xref: /titanic_51/usr/src/head/string.h (revision 9acbbeaf2a1ffe5c14b244867d427714fab43c5c)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*9acbbeafSnn35248  * Common Development and Distribution License (the "License").
6*9acbbeafSnn35248  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*	Copyright (c) 1988 AT&T	*/
227c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
237c478bd9Sstevel@tonic-gate 
247c478bd9Sstevel@tonic-gate 
257c478bd9Sstevel@tonic-gate /*
26*9acbbeafSnn35248  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
277c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
287c478bd9Sstevel@tonic-gate  */
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #ifndef _STRING_H
317c478bd9Sstevel@tonic-gate #define	_STRING_H
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.7.1.12 */
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate #include <iso/string_iso.h>
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate /*
387c478bd9Sstevel@tonic-gate  * Allow global visibility for symbols defined in
397c478bd9Sstevel@tonic-gate  * C++ "std" namespace in <iso/string_iso.h>.
407c478bd9Sstevel@tonic-gate  */
417c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L
427c478bd9Sstevel@tonic-gate using std::size_t;
437c478bd9Sstevel@tonic-gate using std::memchr;
447c478bd9Sstevel@tonic-gate using std::memcmp;
457c478bd9Sstevel@tonic-gate using std::memcpy;
467c478bd9Sstevel@tonic-gate using std::memmove;
477c478bd9Sstevel@tonic-gate using std::memset;
487c478bd9Sstevel@tonic-gate using std::strcat;
497c478bd9Sstevel@tonic-gate using std::strchr;
507c478bd9Sstevel@tonic-gate using std::strcmp;
517c478bd9Sstevel@tonic-gate using std::strcoll;
527c478bd9Sstevel@tonic-gate using std::strcpy;
537c478bd9Sstevel@tonic-gate using std::strcspn;
547c478bd9Sstevel@tonic-gate using std::strerror;
557c478bd9Sstevel@tonic-gate using std::strlen;
567c478bd9Sstevel@tonic-gate using std::strncat;
577c478bd9Sstevel@tonic-gate using std::strncmp;
587c478bd9Sstevel@tonic-gate using std::strncpy;
597c478bd9Sstevel@tonic-gate using std::strpbrk;
607c478bd9Sstevel@tonic-gate using std::strrchr;
617c478bd9Sstevel@tonic-gate using std::strspn;
627c478bd9Sstevel@tonic-gate using std::strstr;
637c478bd9Sstevel@tonic-gate using std::strtok;
647c478bd9Sstevel@tonic-gate using std::strxfrm;
657c478bd9Sstevel@tonic-gate #endif
667c478bd9Sstevel@tonic-gate 
677c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
687c478bd9Sstevel@tonic-gate extern "C" {
697c478bd9Sstevel@tonic-gate #endif
707c478bd9Sstevel@tonic-gate 
717c478bd9Sstevel@tonic-gate #if defined(__STDC__)
727c478bd9Sstevel@tonic-gate 
737c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || \
747c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
757c478bd9Sstevel@tonic-gate 	defined(_XPG6) || defined(_REENTRANT)
767c478bd9Sstevel@tonic-gate extern int strerror_r(int, char *, size_t);
777c478bd9Sstevel@tonic-gate #endif
787c478bd9Sstevel@tonic-gate 
797c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || \
807c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
817c478bd9Sstevel@tonic-gate 	(_POSIX_C_SOURCE - 0 >= 199506L) || defined(_REENTRANT)
827c478bd9Sstevel@tonic-gate extern char *strtok_r(char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
837c478bd9Sstevel@tonic-gate 	char **_RESTRICT_KYWD);
847c478bd9Sstevel@tonic-gate #endif
857c478bd9Sstevel@tonic-gate 
867c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
877c478bd9Sstevel@tonic-gate 	defined(__XOPEN_OR_POSIX)
887c478bd9Sstevel@tonic-gate extern void *memccpy(void *_RESTRICT_KYWD, const void *_RESTRICT_KYWD,
897c478bd9Sstevel@tonic-gate 		int, size_t);
90*9acbbeafSnn35248 extern int uucopy(const void *_RESTRICT_KYWD, void *_RESTRICT_KYWD, size_t);
91*9acbbeafSnn35248 extern int uucopystr(const void *_RESTRICT_KYWD, void *_RESTRICT_KYWD, size_t);
927c478bd9Sstevel@tonic-gate #endif
937c478bd9Sstevel@tonic-gate 
947c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || \
957c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
967c478bd9Sstevel@tonic-gate extern char *strsignal(int);
977c478bd9Sstevel@tonic-gate extern int ffs(int);
987c478bd9Sstevel@tonic-gate extern int strcasecmp(const char *, const char *);
997c478bd9Sstevel@tonic-gate extern int strncasecmp(const char *, const char *, size_t);
1007c478bd9Sstevel@tonic-gate extern size_t strlcpy(char *, const char *, size_t);
1017c478bd9Sstevel@tonic-gate extern size_t strlcat(char *, const char *, size_t);
1027c478bd9Sstevel@tonic-gate #endif /* defined(__EXTENSIONS__)... */
1037c478bd9Sstevel@tonic-gate 
1047c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || \
1057c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
1067c478bd9Sstevel@tonic-gate 	defined(_XPG4_2)
1077c478bd9Sstevel@tonic-gate extern char *strdup(const char *);
1087c478bd9Sstevel@tonic-gate #endif
1097c478bd9Sstevel@tonic-gate 
1107c478bd9Sstevel@tonic-gate #else	/* __STDC__ */
1117c478bd9Sstevel@tonic-gate 
1127c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
1137c478bd9Sstevel@tonic-gate 	defined(_XPG6) || defined(_REENTRANT)
1147c478bd9Sstevel@tonic-gate extern int strerror_r();
1157c478bd9Sstevel@tonic-gate #endif
1167c478bd9Sstevel@tonic-gate 
1177c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
1187c478bd9Sstevel@tonic-gate 	(_POSIX_C_SOURCE - 0 >= 199506L) || defined(_REENTRANT)
1197c478bd9Sstevel@tonic-gate extern char *strtok_r();
1207c478bd9Sstevel@tonic-gate #endif
1217c478bd9Sstevel@tonic-gate 
1227c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
1237c478bd9Sstevel@tonic-gate 	defined(__XOPEN_OR_POSIX)
1247c478bd9Sstevel@tonic-gate extern void *memccpy();
125*9acbbeafSnn35248 extern int uucopy();
126*9acbbeafSnn35248 extern int uucopystr();
1277c478bd9Sstevel@tonic-gate #endif
1287c478bd9Sstevel@tonic-gate 
1297c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)
1307c478bd9Sstevel@tonic-gate extern char *strsignal();
1317c478bd9Sstevel@tonic-gate extern int ffs();
1327c478bd9Sstevel@tonic-gate extern int strcasecmp();
1337c478bd9Sstevel@tonic-gate extern int strncasecmp();
1347c478bd9Sstevel@tonic-gate extern size_t strlcpy();
1357c478bd9Sstevel@tonic-gate extern size_t strlcat();
1367c478bd9Sstevel@tonic-gate #endif /* defined(__EXTENSIONS__) ... */
1377c478bd9Sstevel@tonic-gate 
1387c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)
1397c478bd9Sstevel@tonic-gate extern char *strdup();
1407c478bd9Sstevel@tonic-gate #endif
1417c478bd9Sstevel@tonic-gate 
1427c478bd9Sstevel@tonic-gate #endif	/* __STDC__ */
1437c478bd9Sstevel@tonic-gate 
1447c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1457c478bd9Sstevel@tonic-gate }
1467c478bd9Sstevel@tonic-gate #endif
1477c478bd9Sstevel@tonic-gate 
1487c478bd9Sstevel@tonic-gate #endif	/* _STRING_H */
149