xref: /illumos-gate/usr/src/head/strings.h (revision ba3594ba)
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 2014 Garrett D'Amore <garrett@damore.org>
24  *
25  * Copyright (c) 1995, 1996, by Sun Microsystems, Inc.
26  * All rights reserved.
27  */
28 
29 #ifndef	_STRINGS_H
30 #define	_STRINGS_H
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 extern int bcmp(const void *, const void *, size_t);
44 extern void bcopy(const void *, void *, size_t);
45 extern void bzero(void *, size_t);
46 
47 extern char *index(const char *, int);
48 extern char *rindex(const char *, int);
49 
50 /*
51  * X/Open System Interfaces and Headers, Issue 4, Version 2, defines
52  * both <string.h> and <strings.h>.  The namespace requirements
53  * do not permit the visibility of anything other than what is
54  * specifically defined for each of these headers.  As a result,
55  * inclusion of <string.h> would result in declarations not allowed
56  * in <strings.h>, and making the following prototypes visible for
57  * anything other than X/Open UNIX Extension would result in
58  * conflicts with what is now in <string.h>.
59  */
60 #if defined(_XPG4_2) && !defined(__EXTENSIONS__)
61 extern int ffs(int);
62 extern int strcasecmp(const char *, const char *);
63 extern int strncasecmp(const char *, const char *, size_t);
64 #if defined(_XPG7)
65 #ifndef	_LOCALE_T
66 #define	_LOCALE_T
67 typedef struct _locale *locale_t;
68 #endif
69 extern int strcasecmp_l(const char *, const char *, locale_t);
70 extern int strncasecmp_l(const char *, const char *, size_t, locale_t);
71 #endif	/* defined(_XPG7) */
72 #endif	/* defined(_XPG4_2) && !defined(__EXTENSIONS__) */
73 
74 #ifdef	__cplusplus
75 }
76 #endif
77 
78 #endif	/* _STRINGS_H */
79