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