1 /* @(#)string.h	1.12 11/11/24 Copyright 1996-2011 J. Schilling */
2 /*
3  *	Definitions for strings
4  *
5  *	Copyright (c) 1996-2011 J. Schilling
6  */
7 /*
8  * The contents of this file are subject to the terms of the
9  * Common Development and Distribution License, Version 1.0 only
10  * (the "License").  You may not use this file except in compliance
11  * with the License.
12  *
13  * See the file CDDL.Schily.txt in this distribution for details.
14  * A copy of the CDDL is also available via the Internet at
15  * http://www.opensource.org/licenses/cddl1.txt
16  *
17  * When distributing Covered Code, include this CDDL HEADER in each
18  * file and include the License file CDDL.Schily.txt from this distribution.
19  */
20 
21 #ifndef _SCHILY_STRING_H
22 #define	_SCHILY_STRING_H
23 
24 #ifndef	_SCHILY_MCONFIG_H
25 #include <schily/mconfig.h>
26 #endif
27 
28 #ifndef	_SCHILY_TYPES_H
29 #include <schily/types.h>		/* Try to get size_t */
30 #endif
31 
32 /*
33  * It may be that IBM's AIX has problems when doing
34  * #include <string.h>
35  * #include <strings.h>
36  * So I moved the #include <strings.h> to the top. As the file strings.h
37  * defines strcasecmp() we may need it...
38  *
39  * Note that the only real problem appears if we use rubbish FSF based code that
40  * #defines _NO_PROTO
41  */
42 #ifdef	HAVE_STRINGS_H
43 #ifndef	_INCL_STRINGS_H
44 #include <strings.h>
45 #define	_INCL_STRINGS_H
46 #endif
47 #endif	/* HAVE_STRINGS_H */
48 
49 
50 #ifdef	HAVE_STRING_H
51 #ifndef	_INCL_STRING_H
52 #include <string.h>
53 #define	_INCL_STRING_H
54 #endif
55 #else	/* HAVE_STRING_H */
56 
57 #ifdef	__cplusplus
58 extern "C" {
59 #endif
60 
61 #ifndef NULL
62 #define	NULL	0
63 #endif
64 
65 extern void *memcpy	__PR((void *, const void *, int));
66 extern void *memmove	__PR((void *, const void *, int));
67 extern char *strcpy	__PR((char *, const char *));
68 extern char *strncpy	__PR((char *, const char *, int));
69 
70 extern char *strcat	__PR((char *, const char *));
71 extern char *strncat	__PR((char *, const char *, int));
72 
73 extern int memcmp	__PR((const void *, const void *, int));
74 extern int strcmp	__PR((const char *, const char *));
75 extern int strcoll	__PR((const char *, const char *));
76 extern int strncmp	__PR((const char *, const char *, int));
77 extern int strxfrm	__PR((char *, const char *, int));
78 
79 extern void *memchr	__PR((const void *, int, int));
80 extern char *strchr	__PR((const char *, int));
81 
82 extern int strcspn	__PR((const char *, const char *));
83 /* #pragma int_to_unsigned strcspn */
84 
85 extern char *strpbrk	__PR((const char *, const char *));
86 extern char *strrchr	__PR((const char *, int));
87 
88 extern int strspn	__PR((const char *, const char *));
89 /* #pragma int_to_unsigned strspn */
90 
91 extern char *strstr	__PR((const char *, const char *));
92 extern char *strtok	__PR((char *, const char *));
93 extern void *memset	__PR((void *, int, int));
94 extern char *strerror	__PR((int));
95 
96 extern int strlen	__PR((const char *));
97 /* #pragma int_to_unsigned strlen */
98 
99 extern void *memccpy	__PR((void *, const void *, int, int));
100 
101 extern int strcasecmp	__PR((const char *, const char *));
102 extern int strncasecmp	__PR((const char *, const char *, size_t));
103 
104 #ifdef	__cplusplus
105 }
106 #endif
107 
108 #endif	/* HAVE_STRING_H */
109 
110 #endif	/* _SCHILY_STRING_H */
111