xref: /titanic_52/usr/src/head/string.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*	Copyright (c) 1988 AT&T	*/
23*7c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
24*7c478bd9Sstevel@tonic-gate 
25*7c478bd9Sstevel@tonic-gate 
26*7c478bd9Sstevel@tonic-gate /*
27*7c478bd9Sstevel@tonic-gate  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
28*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
29*7c478bd9Sstevel@tonic-gate  */
30*7c478bd9Sstevel@tonic-gate 
31*7c478bd9Sstevel@tonic-gate #ifndef _STRING_H
32*7c478bd9Sstevel@tonic-gate #define	_STRING_H
33*7c478bd9Sstevel@tonic-gate 
34*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.7.1.12 */
35*7c478bd9Sstevel@tonic-gate 
36*7c478bd9Sstevel@tonic-gate #include <iso/string_iso.h>
37*7c478bd9Sstevel@tonic-gate 
38*7c478bd9Sstevel@tonic-gate /*
39*7c478bd9Sstevel@tonic-gate  * Allow global visibility for symbols defined in
40*7c478bd9Sstevel@tonic-gate  * C++ "std" namespace in <iso/string_iso.h>.
41*7c478bd9Sstevel@tonic-gate  */
42*7c478bd9Sstevel@tonic-gate #if __cplusplus >= 199711L
43*7c478bd9Sstevel@tonic-gate using std::size_t;
44*7c478bd9Sstevel@tonic-gate using std::memchr;
45*7c478bd9Sstevel@tonic-gate using std::memcmp;
46*7c478bd9Sstevel@tonic-gate using std::memcpy;
47*7c478bd9Sstevel@tonic-gate using std::memmove;
48*7c478bd9Sstevel@tonic-gate using std::memset;
49*7c478bd9Sstevel@tonic-gate using std::strcat;
50*7c478bd9Sstevel@tonic-gate using std::strchr;
51*7c478bd9Sstevel@tonic-gate using std::strcmp;
52*7c478bd9Sstevel@tonic-gate using std::strcoll;
53*7c478bd9Sstevel@tonic-gate using std::strcpy;
54*7c478bd9Sstevel@tonic-gate using std::strcspn;
55*7c478bd9Sstevel@tonic-gate using std::strerror;
56*7c478bd9Sstevel@tonic-gate using std::strlen;
57*7c478bd9Sstevel@tonic-gate using std::strncat;
58*7c478bd9Sstevel@tonic-gate using std::strncmp;
59*7c478bd9Sstevel@tonic-gate using std::strncpy;
60*7c478bd9Sstevel@tonic-gate using std::strpbrk;
61*7c478bd9Sstevel@tonic-gate using std::strrchr;
62*7c478bd9Sstevel@tonic-gate using std::strspn;
63*7c478bd9Sstevel@tonic-gate using std::strstr;
64*7c478bd9Sstevel@tonic-gate using std::strtok;
65*7c478bd9Sstevel@tonic-gate using std::strxfrm;
66*7c478bd9Sstevel@tonic-gate #endif
67*7c478bd9Sstevel@tonic-gate 
68*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
69*7c478bd9Sstevel@tonic-gate extern "C" {
70*7c478bd9Sstevel@tonic-gate #endif
71*7c478bd9Sstevel@tonic-gate 
72*7c478bd9Sstevel@tonic-gate #if defined(__STDC__)
73*7c478bd9Sstevel@tonic-gate 
74*7c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || \
75*7c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
76*7c478bd9Sstevel@tonic-gate 	defined(_XPG6) || defined(_REENTRANT)
77*7c478bd9Sstevel@tonic-gate extern int strerror_r(int, char *, size_t);
78*7c478bd9Sstevel@tonic-gate #endif
79*7c478bd9Sstevel@tonic-gate 
80*7c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || \
81*7c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
82*7c478bd9Sstevel@tonic-gate 	(_POSIX_C_SOURCE - 0 >= 199506L) || defined(_REENTRANT)
83*7c478bd9Sstevel@tonic-gate extern char *strtok_r(char *_RESTRICT_KYWD, const char *_RESTRICT_KYWD,
84*7c478bd9Sstevel@tonic-gate 	char **_RESTRICT_KYWD);
85*7c478bd9Sstevel@tonic-gate #endif
86*7c478bd9Sstevel@tonic-gate 
87*7c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
88*7c478bd9Sstevel@tonic-gate 	defined(__XOPEN_OR_POSIX)
89*7c478bd9Sstevel@tonic-gate extern void *memccpy(void *_RESTRICT_KYWD, const void *_RESTRICT_KYWD,
90*7c478bd9Sstevel@tonic-gate 		int, size_t);
91*7c478bd9Sstevel@tonic-gate #endif
92*7c478bd9Sstevel@tonic-gate 
93*7c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || \
94*7c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
95*7c478bd9Sstevel@tonic-gate extern char *strsignal(int);
96*7c478bd9Sstevel@tonic-gate extern int ffs(int);
97*7c478bd9Sstevel@tonic-gate extern int strcasecmp(const char *, const char *);
98*7c478bd9Sstevel@tonic-gate extern int strncasecmp(const char *, const char *, size_t);
99*7c478bd9Sstevel@tonic-gate extern size_t strlcpy(char *, const char *, size_t);
100*7c478bd9Sstevel@tonic-gate extern size_t strlcat(char *, const char *, size_t);
101*7c478bd9Sstevel@tonic-gate #endif /* defined(__EXTENSIONS__)... */
102*7c478bd9Sstevel@tonic-gate 
103*7c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || \
104*7c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
105*7c478bd9Sstevel@tonic-gate 	defined(_XPG4_2)
106*7c478bd9Sstevel@tonic-gate extern char *strdup(const char *);
107*7c478bd9Sstevel@tonic-gate #endif
108*7c478bd9Sstevel@tonic-gate 
109*7c478bd9Sstevel@tonic-gate #else	/* __STDC__ */
110*7c478bd9Sstevel@tonic-gate 
111*7c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
112*7c478bd9Sstevel@tonic-gate 	defined(_XPG6) || defined(_REENTRANT)
113*7c478bd9Sstevel@tonic-gate extern int strerror_r();
114*7c478bd9Sstevel@tonic-gate #endif
115*7c478bd9Sstevel@tonic-gate 
116*7c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
117*7c478bd9Sstevel@tonic-gate 	(_POSIX_C_SOURCE - 0 >= 199506L) || defined(_REENTRANT)
118*7c478bd9Sstevel@tonic-gate extern char *strtok_r();
119*7c478bd9Sstevel@tonic-gate #endif
120*7c478bd9Sstevel@tonic-gate 
121*7c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
122*7c478bd9Sstevel@tonic-gate 	defined(__XOPEN_OR_POSIX)
123*7c478bd9Sstevel@tonic-gate extern void *memccpy();
124*7c478bd9Sstevel@tonic-gate #endif
125*7c478bd9Sstevel@tonic-gate 
126*7c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)
127*7c478bd9Sstevel@tonic-gate extern char *strsignal();
128*7c478bd9Sstevel@tonic-gate extern int ffs();
129*7c478bd9Sstevel@tonic-gate extern int strcasecmp();
130*7c478bd9Sstevel@tonic-gate extern int strncasecmp();
131*7c478bd9Sstevel@tonic-gate extern size_t strlcpy();
132*7c478bd9Sstevel@tonic-gate extern size_t strlcat();
133*7c478bd9Sstevel@tonic-gate #endif /* defined(__EXTENSIONS__) ... */
134*7c478bd9Sstevel@tonic-gate 
135*7c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)
136*7c478bd9Sstevel@tonic-gate extern char *strdup();
137*7c478bd9Sstevel@tonic-gate #endif
138*7c478bd9Sstevel@tonic-gate 
139*7c478bd9Sstevel@tonic-gate #endif	/* __STDC__ */
140*7c478bd9Sstevel@tonic-gate 
141*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
142*7c478bd9Sstevel@tonic-gate }
143*7c478bd9Sstevel@tonic-gate #endif
144*7c478bd9Sstevel@tonic-gate 
145*7c478bd9Sstevel@tonic-gate #endif	/* _STRING_H */
146