xref: /titanic_41/usr/src/head/string.h (revision 69889278ff50c08a6682a39ce6b5d97c5f0c2387)
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 extern int uucopy(const void *_RESTRICT_KYWD, void *_RESTRICT_KYWD, size_t);
91 extern int uucopystr(const void *_RESTRICT_KYWD, void *_RESTRICT_KYWD, size_t);
92 #endif
93 
94 #if defined(__EXTENSIONS__) || \
95 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
96 extern char *strsignal(int);
97 extern int ffs(int);
98 extern int strcasecmp(const char *, const char *);
99 extern int strncasecmp(const char *, const char *, size_t);
100 extern size_t strlcpy(char *, const char *, size_t);
101 extern size_t strlcat(char *, const char *, size_t);
102 #endif /* defined(__EXTENSIONS__)... */
103 
104 #if defined(__EXTENSIONS__) || \
105 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
106 	defined(_XPG4_2)
107 extern char *strdup(const char *);
108 #endif
109 
110 #else	/* __STDC__ */
111 
112 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
113 	defined(_XPG6) || defined(_REENTRANT)
114 extern int strerror_r();
115 #endif
116 
117 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || \
118 	(_POSIX_C_SOURCE - 0 >= 199506L) || defined(_REENTRANT)
119 extern char *strtok_r();
120 #endif
121 
122 #if defined(__EXTENSIONS__) || !defined(_STRICT_STDC) || \
123 	defined(__XOPEN_OR_POSIX)
124 extern void *memccpy();
125 extern int uucopy();
126 extern int uucopystr();
127 #endif
128 
129 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX)
130 extern char *strsignal();
131 extern int ffs();
132 extern int strcasecmp();
133 extern int strncasecmp();
134 extern size_t strlcpy();
135 extern size_t strlcat();
136 #endif /* defined(__EXTENSIONS__) ... */
137 
138 #if defined(__EXTENSIONS__) || !defined(__XOPEN_OR_POSIX) || defined(_XPG4_2)
139 extern char *strdup();
140 #endif
141 
142 #endif	/* __STDC__ */
143 
144 #ifdef	__cplusplus
145 }
146 #endif
147 
148 #endif	/* _STRING_H */
149