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