xref: /illumos-gate/usr/src/head/strings.h (revision 89b2a9fbeabf42fa54594df0e5927bcc50a07cc9)
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 /*
23  * Copyright (c) 1995, 1996, by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef	_STRINGS_H
28 #define	_STRINGS_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #include <sys/types.h>
33 #include <sys/feature_tests.h>
34 
35 #if !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
36 #include <string.h>
37 #endif
38 
39 #ifdef	__cplusplus
40 extern "C" {
41 #endif
42 
43 #if defined(__STDC__)
44 
45 extern int bcmp(const void *, const void *, size_t);
46 extern void bcopy(const void *, void *, size_t);
47 extern void bzero(void *, size_t);
48 
49 extern char *index(const char *, int);
50 extern char *rindex(const char *, int);
51 
52 /*
53  * X/Open System Interfaces and Headers, Issue 4, Version 2, defines
54  * both <string.h> and <strings.h>.  The namespace requirements
55  * do not permit the visibility of anything other than what is
56  * specifically defined for each of these headers.  As a result,
57  * inclusion of <string.h> would result in declarations not allowed
58  * in <strings.h>, and making the following prototypes visible for
59  * anything other than X/Open UNIX Extension would result in
60  * conflicts with what is now in <string.h>.
61  */
62 #if defined(_XPG4_2) && !defined(__EXTENSIONS__)
63 extern int ffs(int);
64 extern int strcasecmp(const char *, const char *);
65 extern int strncasecmp(const char *, const char *, size_t);
66 #endif	/* defined(_XPG4_2) && !defined(__EXTENSIONS__) */
67 
68 #else
69 
70 extern int bcmp();
71 extern void bcopy();
72 extern void bzero();
73 
74 extern char *index();
75 extern char *rindex();
76 
77 #if defined(_XPG4_2) && !defined(__EXTENSIONS__)
78 extern int ffs();
79 extern int strcasecmp();
80 extern int strncasecmp();
81 #endif /* defined(_XPG4_2) && !defined(__EXTENSIONS__) */
82 
83 #endif	/* __STDC__ */
84 
85 #ifdef	__cplusplus
86 }
87 #endif
88 
89 #endif	/* _STRINGS_H */
90