Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / lib / DtSvc / include / bms / sbstdinc.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /*
24  * File:         sbstdinc.h $TOG: sbstdinc.h /main/7 1998/07/31 17:50:45 mgreess $
25  * Language:     C
26  *
27  * (c) Copyright 1988, Hewlett-Packard Company, all rights reserved.
28  *
29  * (c) Copyright 1993, 1994 Hewlett-Packard Company                     *
30  * (c) Copyright 1993, 1994 International Business Machines Corp.       *
31  * (c) Copyright 1993, 1994 Sun Microsystems, Inc.                      *
32  * (c) Copyright 1993, 1994 Novell, Inc.                                *
33  */
34
35 #ifndef _sbstdinc_h
36 #define _sbstdinc_h
37
38 #include <sys/types.h>
39 #include <sys/param.h>
40
41 #ifdef SVR4
42 #include <netdb.h>              /* MAXHOSTNAMELEN */
43 #endif /* SVR4 */
44
45 #ifndef howmany
46 #define howmany(x, y)  (((x)+((y)-1))/(y))   /* From <sys/param.h>, but not an XPG3 file */
47 #endif
48
49 #include <stdlib.h>
50 #include <unistd.h>
51 #include <string.h>
52 #include <sys/stat.h>
53 #include <stdio.h>
54 #include <fcntl.h>
55 #include <nl_types.h>
56
57 /************************************************************************/
58 /* Routines not defined in include files (yet).                         */
59 /************************************************************************/
60
61 /* Domain/OS BSD has bzero(), bcmp(), and bcopy() defined. */
62 #if !defined(apollo) || !defined(__bsd)
63
64 #if defined(__STDC__)
65 #if !defined(linux) && !defined(__osf__) && !defined(_XFUNCS_H_)
66 extern void bcopy(char *b1, char *b2, int length);
67 extern int  bcmp(char *b1, char *b2, int length);
68 extern void bzero(char *b, int length);
69 #endif
70
71 extern char *mktemp(char *tmplate);
72 #elif ! defined(__cplusplus)
73 #if !defined(linux) && !defined(__osf__) && !defined(_XFUNCS_H_)
74 extern void bcopy();
75 extern int  bcmp();
76 extern void bzero();
77 #endif
78
79 extern char *mktemp();
80 #endif
81
82 #endif
83
84
85 #ifndef  SBSTDINC_H_NO_REDEFINE   /* sbstdinc.c turns this on */
86
87 /************************************************************************/
88 /* Routines from <string.h>                                             */
89 /*  --- These always get redefined so we can catch null ptr deref's     */
90 /************************************************************************/
91
92 #if defined(__STDC__) || defined(__cplusplus)
93 extern XeString Xestrcat(XeString s1, ConstXeString s2);
94 #else
95 extern XeString Xestrcat();
96 #endif
97 #ifdef strcat
98 # undef strcat
99 #endif
100 #define strcat Xestrcat
101
102 #if defined(__STDC__) || defined(__cplusplus)
103 extern XeString Xestrncat(XeString s1, ConstXeString s2, size_t n);
104 #else
105 extern XeString Xestrncat();
106 #endif
107 #ifdef strncat
108 # undef strncat
109 #endif
110 #define strncat Xestrncat
111
112 #if defined(__STDC__) || defined(__cplusplus)
113 extern int Xestrcmp(ConstXeString s1, ConstXeString s2);
114 #else
115 extern int Xestrcmp();
116 #endif
117 #ifdef strcmp
118 # undef strcmp
119 #endif
120 #define strcmp Xestrcmp
121
122 #if defined(__STDC__) || defined(__cplusplus)
123 extern int Xestrncmp(ConstXeString s1, ConstXeString s2, size_t n);
124 #else
125 extern int Xestrncmp();
126 #endif
127 #ifdef strncmp
128 # undef strncmp
129 #endif
130 #define strncmp Xestrncmp
131
132 #if defined(__STDC__) || defined(__cplusplus)
133 extern XeString Xestrcpy(XeString s1, ConstXeString s2);
134 #else
135 extern XeString Xestrcpy();
136 #endif
137 #ifdef strcpy
138 # undef strcpy
139 #endif
140 #define strcpy Xestrcpy
141
142 #if defined(__STDC__) || defined(__cplusplus)
143 extern XeString Xestrncpy(XeString s1, ConstXeString s2, size_t n);
144 #else
145 extern XeString Xestrncpy();
146 #endif
147 #ifdef strncpy
148 # undef strncpy
149 #endif
150 #define strncpy Xestrncpy
151
152 #if defined(__STDC__) || defined(__cplusplus)
153 extern int Xestrcoll(ConstXeString s1, ConstXeString s2);
154 #else
155 extern int Xestrcoll();
156 #endif
157 #ifdef strcoll
158 # undef strcoll
159 #endif
160 #define strcoll Xestrcoll
161
162 #if defined(__STDC__) || defined(__cplusplus)
163 extern size_t Xestrxfrm(XeString s1, ConstXeString s2, size_t n);
164 #else
165 extern size_t Xestrxfrm();
166 #endif
167 #ifdef strxfrm
168 # undef strxfrm
169 #endif
170 #define strxfrm Xestrxfrm
171
172 #if defined(__STDC__) || defined(__cplusplus)
173 extern XeString Xestrchr(ConstXeString s, int c);
174 #else
175 extern XeString Xestrchr();
176 #endif
177 #ifdef strchr
178 # undef strchr
179 #endif
180 #define strchr Xestrchr
181
182 #if defined(__STDC__) || defined(__cplusplus)
183 extern XeString Xestrpbrk(ConstXeString s1, ConstXeString s2);
184 #else
185 extern XeString Xestrpbrk();
186 #endif
187 #ifdef strpbrk
188 # undef strpbrk
189 #endif
190 #define strpbrk Xestrpbrk
191
192 #if defined(__STDC__) || defined(__cplusplus)
193 extern XeString Xestrrchr(ConstXeString s, int c);
194 #else
195 extern XeString Xestrrchr();
196 #endif
197 #ifdef strrchr
198 # undef strrchr
199 #endif
200 #define strrchr Xestrrchr
201
202 #if defined(__STDC__) || defined(__cplusplus)
203 extern XeString Xestrstr(ConstXeString s1, ConstXeString s2);
204 #else
205 extern XeString Xestrstr();
206 #endif
207 #ifdef strstr
208 # undef strstr
209 #endif
210 #define strstr Xestrstr
211
212 #if defined(__STDC__) || defined(__cplusplus)
213 extern XeString Xestrtok(XeString s1, ConstXeString s2);
214 #else
215 extern XeString Xestrtok();
216 #endif
217 #ifdef strtok
218 # undef strtok
219 #endif
220 #define strtok Xestrtok
221
222 #if defined(__STDC__) || defined(__cplusplus)
223 extern size_t Xestrlen(ConstXeString s);
224 #else
225 extern size_t Xestrlen();
226 #endif
227 #ifndef __osf__
228 # ifdef strlen
229 #  undef strlen
230 # endif
231 # define strlen Xestrlen
232 #endif
233
234 #if defined(__STDC__) || defined(__cplusplus)
235 extern XeString Xestrdup(ConstXeString s);
236 #else
237 extern XeString Xestrdup();
238 #endif
239 #ifdef strdup
240 # undef strdup
241 #endif
242 #define strdup Xestrdup
243
244 #endif /* ifndef  SBSTDINC_H_NO_REDEFINE */
245
246 #endif /*  _sbstdinc_h */