xref: /openbsd/gnu/usr.bin/cvs/os2/config.h (revision 02d9f452)
1 /* config.h --- configuration file for OS/2
2    Karl Fogel <kfogel@cyclic.com> --- Oct 1995  */
3 
4 /* This file lives in the os2/ subdirectory, which is only included
5  * in your header search path if you're working under IBM C++,
6  * and use os2/makefile (with GNU make for OS/2).  Thus, this is the
7  * right place to put configuration information for OS/2.
8  */
9 
10 
11 /* You bet! */
12 #define __STDC__ 1
13 
14 /* Define if on AIX 3.
15    System headers sometimes define this.
16    We just want to avoid a redefinition error message.  */
17 #undef _ALL_SOURCE
18 
19 /* Define if using alloca.c.  */
20 #undef C_ALLOCA
21 
22 /* Define if type char is unsigned and you are not using gcc.  */
23 /* We wrote a little test program whose output suggests that char is
24    signed on this system.  Go back and check the verdict when CVS
25    is configured on floss...  */
26 #undef __CHAR_UNSIGNED__
27 
28 /* Define to empty if the keyword does not work.  */
29 /* Const is working.  */
30 #undef const
31 
32 /* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
33    This function is required for alloca.c support on those systems.  */
34 /* This shouldn't matter, but pro forma:  */
35 #undef CRAY_STACKSEG_END
36 
37 /* Define to `int' if <sys/types.h> doesn't define.  */
38 /* OS/2 doesn't have gid_t.  It doesn't even really have group
39    numbers, I think.  This will take more thought to get right, but
40    let's get it running first.  */
41 #define gid_t int
42 
43 /* Define if you have alloca, as a function or macro.  */
44 #define HAVE_ALLOCA 1
45 /* OS/2 has alloca() in <stdlib.h>! */
46 #define ALLOCA_IN_STDLIB 1
47 
48 /* Define if you have <alloca.h> and it should be used (not on Ultrix).  */
49 /* but calls it _alloca and says it returns void *.  We provide our
50    own header file.  */
51 /* OS/2 declares alloca in `stdlib.h'. */
52 /* #define HAVE_ALLOCA_H 1 */
53 #undef HAVE_ALLOCA_H
54 
55 /* Define if you support file names longer than 14 characters.  */
56 /* We support long file names, but not long corporate acronyms. */
57 #define HAVE_LONG_FILE_NAMES 1
58 
59 /* Define if you have <sys/wait.h> that is POSIX.1 compatible.  */
60 /* If POSIX.1 requires this, why doesn't WNT have it?  */
61 /* Maybe POSIX only says that if it is present, it must behave a
62    certain way, but that it can simply be not present too.  I
63    dunno. */
64 /* Anyway, OS/2 ain't got it. */
65 #undef HAVE_SYS_WAIT_H
66 
67 /* Define if utime(file, NULL) sets file's timestamp to the present.  */
68 /* Documentation says yup; haven't verified experimentally. */
69 #define HAVE_UTIME_NULL 1
70 
71 /* We don't appear to have inline functions, so just expand "inline"
72    to "". */
73 #define inline
74 
75 /* Define if on MINIX.  */
76 /* Hah.  */
77 #undef _MINIX
78 
79 /* Define to `int' if <sys/types.h> doesn't define.  */
80 #define mode_t int
81 
82 /* Define to `int' if <sys/types.h> doesn't define.  */
83 #define pid_t int
84 
85 /* Define if the system does not provide POSIX.1 features except
86    with this defined.  */
87 /* This string doesn't appear anywhere in the system header files,
88    so I assume it's irrelevant.  */
89 #undef _POSIX_1_SOURCE
90 
91 /* Define if you need to in order for stat and other things to work.  */
92 /* Same as for _POSIX_1_SOURCE, above.  */
93 #undef _POSIX_SOURCE
94 
95 /* Define as the return type of signal handlers (int or void).  */
96 /* IBMCPP manual indicates they are void.  */
97 #define RETSIGTYPE void
98 
99 /* Define to `unsigned' if <sys/types.h> doesn't define.  */
100 /* sys/types.h doesn't define it, but stdio.h does, which cvs.h
101    #includes, so things should be okay.  */
102 /* #undef size_t */
103 
104 /* If using the C implementation of alloca, define if you know the
105    direction of stack growth for your system; otherwise it will be
106    automatically deduced at run-time.
107 	STACK_DIRECTION > 0 => grows toward higher addresses
108 	STACK_DIRECTION < 0 => grows toward lower addresses
109 	STACK_DIRECTION = 0 => direction of growth unknown
110  */
111 /* This shouldn't matter, but pro forma:  */
112 #undef STACK_DIRECTION
113 
114 /* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
115 /* sys/stat.h apparently doesn't even have them; setting this will let
116    ../lib/system.h define them. */
117 #define STAT_MACROS_BROKEN 1
118 
119 /* Define if you have the ANSI C header files.  */
120 /* We have at least a reasonable facsimile thereof. */
121 #define STDC_HEADERS 1
122 
123 /* Define if you can safely include both <sys/time.h> and <time.h>.  */
124 /* We don't have <sys/time.h> at all.  Why isn't there a definition
125    for HAVE_SYS_TIME_H anywhere in config.h.in?  */
126 #undef TIME_WITH_SYS_TIME
127 
128 /* Define to `int' if <sys/types.h> doesn't define.  */
129 #define uid_t int
130 
131 /* Define if you have MIT Kerberos version 4 available.  */
132 /* We don't. */
133 #undef HAVE_KERBEROS
134 
135 /* Define if you want CVS to be able to be a remote repository client.  */
136 /* That's all we want.  */
137 #define CLIENT_SUPPORT
138 
139 /* Define if you want CVS to be able to serve repositories to remote
140    clients.  */
141 /* No server support yet.  Note that you don't have to define
142    CLIENT_SUPPORT or SERVER_SUPPORT to enable the non-remote code;
143    that's always there.  */
144 #undef SERVER_SUPPORT
145 
146 /* the path to the gnu diff program on your system  */
147 /* We don't need this for CLIENT side.  */
148 #undef DIFF
149 
150 /* the path to the gnu grep program on your system  */
151 /* We don't need this for CLIENT side.  */
152 #undef GREP
153 
154 /* The number of bytes in a int.  */
155 #define SIZEOF_INT 4
156 
157 /* The number of bytes in a long.  */
158 #define SIZEOF_LONG 4
159 
160 /* Define if you have the connect function.  */
161 /* Not used?  */
162 /* It appears to be used in client.c now... don't know yet it OS/2 has it. */
163 #define HAVE_CONNECT
164 
165 /* Define if you have the fchdir function.  */
166 #undef HAVE_FCHDIR
167 
168 /* Define if you have the fchmod function.  */
169 #undef HAVE_FCHMOD
170 
171 /* Define if you have the fsync function.  */
172 #undef HAVE_FSYNC
173 
174 /* Define if you have the ftime function.  */
175 #define HAVE_FTIME 1
176 
177 /* Define if you have the ftruncate function.  */
178 #undef HAVE_FTRUNCATE
179 
180 /* Define if you have the getpagesize function.  */
181 #undef HAVE_GETPAGESIZE
182 
183 /* Define if you have the krb_get_err_text function.  */
184 #undef HAVE_KRB_GET_ERR_TEXT
185 
186 /* Define if you have the mkfifo function.  */
187 #undef HAVE_MKFIFO
188 
189 /* Define if you have the putenv function.  */
190 #define HAVE_PUTENV 1
191 
192 /* Define if you have the setvbuf function.  */
193 #define HAVE_SETVBUF 1
194 
195 /* Define if you have the sigaction function.  */
196 #undef HAVE_SIGACTION
197 
198 /* Define if you have the sigblock function.  */
199 #undef HAVE_SIGBLOCK
200 
201 /* Define if you have the sigprocmask function.  */
202 #undef HAVE_SIGPROCMASK
203 
204 /* Define if you have the sigsetmask function.  */
205 #undef HAVE_SIGSETMASK
206 
207 /* Define if you have the sigvec function.  */
208 #undef HAVE_SIGVEC
209 
210 /* Define if you have the timezone function.  */
211 /* Hmm, I actually rather think it's an extern long
212    variable; that message was mechanically generated
213    by autoconf.  And I don't see any actual uses of
214    this function in the code anyway, hmm.  */
215 #undef HAVE_TIMEZONE
216 
217 /* Define if you have the vfork function.  */
218 #undef HAVE_VFORK
219 
220 /* Define if you have the vprintf function.  */
221 #define HAVE_VPRINTF 1
222 
223 /* Define if you have the <direct.h> header file.  */
224 #define HAVE_DIRECT_H 1
225 
226 /* Define if you have the <dirent.h> header file.  */
227 /* We have our own dirent.h and dirent.c. */
228 #define HAVE_DIRENT_H 1
229 
230 /* Define if you have the <errno.h> header file.  */
231 #define HAVE_ERRNO_H 1
232 
233 /* Define if you have the <fcntl.h> header file.  */
234 #define HAVE_FCNTL_H 1
235 
236 /* Define if you have the <io.h> header file.  */
237 /* Low-level Unix I/O routines like open, creat, etc.  */
238 #define HAVE_IO_H 1
239 
240 /* Define if you have the <memory.h> header file.  */
241 #define HAVE_MEMORY_H 1
242 
243 /* Define if you have the <ndbm.h> header file.  */
244 #undef HAVE_NDBM_H
245 
246 /* Define if you have the <ndir.h> header file.  */
247 #undef HAVE_NDIR_H
248 
249 /* Define if you have the <string.h> header file.  */
250 #define HAVE_STRING_H 1
251 
252 /* Define if you have the <sys/bsdtypes.h> header file.  */
253 #undef HAVE_SYS_BSDTYPES_H
254 
255 /* Define if you have the <sys/dir.h> header file.  */
256 #undef HAVE_SYS_DIR_H
257 
258 /* Define if you have the <sys/ndir.h> header file.  */
259 #undef HAVE_SYS_NDIR_H
260 
261 /* Define if you have the <sys/param.h> header file.  */
262 #undef HAVE_SYS_PARAM_H
263 
264 /* Define if you have the <sys/select.h> header file.  */
265 #undef HAVE_SYS_SELECT_H
266 
267 /* Define if you have the <sys/time.h> header file.  */
268 #undef HAVE_SYS_TIME_H
269 
270 /* Define if you have the <sys/timeb.h> header file.  */
271 #define HAVE_SYS_TIMEB_H 1
272 
273 /* Define if you have the <unistd.h> header file.  */
274 #undef HAVE_UNISTD_H
275 
276 /* Define if you have the <utime.h> header file.  */
277 #undef HAVE_UTIME_H
278 
279 /* Define if you have the <sys/utime.h> header file.  */
280 #define HAVE_SYS_UTIME_H 1
281 
282 /* Define if you have the inet library (-linet).  */
283 #undef HAVE_LIBINET
284 
285 /* Define if you have the nsl library (-lnsl).  */
286 /* This is not used anywhere in the source code.  */
287 #undef HAVE_LIBNSL
288 
289 /* Define if you have the nsl_s library (-lnsl_s).  */
290 #undef HAVE_LIBNSL_S
291 
292 /* Define if you have the socket library (-lsocket).  */
293 /* This isn't ever used either.  */
294 #undef HAVE_LIBSOCKET
295 
296 /* Under OS/2, mkdir only takes one argument.  */
297 #define CVS_MKDIR os2_mkdir
298 extern int os2_mkdir (const char *PATH, int MODE);
299 
300 /* This function doesn't exist under OS/2; we provide a stub. */
301 extern int readlink (char *path, char *buf, int buf_size);
302 
303 /* This is just a call to GetCurrentProcessID.  */
304 extern pid_t getpid (void);
305 
306 /* We definitely have prototypes.  */
307 #define USE_PROTOTYPES 1
308 
309 /* Under OS/2, filenames are case-insensitive, and both / and \
310    are path component separators.  */
311 #define FOLD_FN_CHAR(c) (OS2_filename_classes[(unsigned char) (c)])
312 extern unsigned char OS2_filename_classes[];
313 
314 /* Is the character C a path name separator?  Under OS/2, you can use
315    either / or \.  */
316 #define ISDIRSEP(c) (FOLD_FN_CHAR(c) == '/')
317 
318 /* Like strcmp, but with the appropriate tweaks for file names.
319    Under OS/2, filenames are case-insensitive but case-preserving,
320    and both \ and / are path element separators.  */
321 extern int fncmp (const char *n1, const char *n2);
322 
323 /* Fold characters in FILENAME to their canonical forms.
324    If FOLD_FN_CHAR is not #defined, the system provides a default
325    definition for this.  */
326 extern void fnfold (char *FILENAME);
327 
328 /* #define this if your system terminates lines in text files with
329    CRLF instead of plain LF, and your I/O functions automatically
330    translate between using LF in memory and CRLF on disk, unless you
331    specifically tell them not to.  */
332 #define LINES_CRLF_TERMINATED 1
333 
334 /* Read data from INFILE, and copy it to OUTFILE.
335    Open INFILE using INFLAGS, and OUTFILE using OUTFLAGS.
336    This is useful for converting between CRLF and LF line formats.  */
337 extern void convert_file (char *INFILE,  int INFLAGS,
338 			  char *OUTFILE, int OUTFLAGS);
339 
340 /* This is where old bits go to die under OS/2 as well as WinNT.  */
341 #define DEVNULL "nul"
342 
343 /* Comment markers for some OS/2-specific file types.  */
344 /* Actually, these come from WinNT, but what the heck. */
345 #define SYSTEM_COMMENT_TABLE \
346     "mak", "# ",    			/* makefile */                    \
347     "rc",  " * ",   			/* MS Windows resource file */    \
348     "dlg", " * ",   			/* MS Windows dialog file */      \
349     "frm", "' ",    			/* Visual Basic form */           \
350     "bas", "' ",    			/* Visual Basic code */
351 
352 /* Make sure that we don't try to perform operations on RCS files on the
353    local machine.  I think I neglected to apply some changes from
354    MHI's port in that area of code, or found some issues I didn't want
355    to deal with.  */
356 #define CLIENT_ONLY
357 
358 /* We actually do have a transparent rsh, whew. */
359 #undef RSH_NOT_TRANSPARENT
360 /* But it won't be transparent unless we ask it nicely! */
361 #define RSH_NEEDS_BINARY_FLAG 1
362 
363 /* OS/2 doesn't really have user/group permissions, at least not
364    according to the C library manual pages.  So we'll make decoys. */
365 #define NEED_DECOY_PERMISSIONS 1     /* see system.h */
366 
367 /* See client.c.  Setting execute bits with chmod seems to lose under
368    OS/2, although in some places the documentation grudgingly admits
369    to the existence of execute bits. */
370 #define EXECUTE_PERMISSION_LOSES 1
371 
372 
373 
374 /* For the access() function, for which OS/2 has no pre-defined
375    mnemonic masks. */
376 #define R_OK 04
377 #define W_OK 02
378 #define F_OK 00
379 #define X_OK R_OK  /* I think this is right for OS/2. */
380 
381 /* For getpid() */
382 #include <process.h>
383 
384 /* So "tcpip.h" gets included in lib/system.h: */
385 #define USE_OWN_TCPIP_H 1
386 /* The IBM TCP/IP library gets initialized in main(): */
387 #define INITIALIZE_SOCKET_SUBSYSTEM init_sockets
388 extern void init_sockets();
389 
390 /* Under OS/2, we have our own popen() and pclose()... */
391 #define USE_OWN_POPEN 1
392 /* ... and we use popenRW to start the rsh server. */
393 #define START_RSH_WITH_POPEN_RW 1
394 
395 /*
396  * This tells the client that it must use send()/recv() to talk to the
397  * server if it is connected to the server via a socket.  Sigh.
398  * Windows 95 also cannot convert sockets to file descriptors,
399  * apparently.
400  */
401 #define NO_SOCKET_TO_FD 1
402 
403 /* chmod() doesn't seem to work -- IBM's own example program does not
404  * behave as its documentation claims, in fact!  I suspect that
405  * DosSetPathInfo is the way to go, but can't seem to make that work
406  * either.  For now, we can deal with some cases by invoking the DOS
407  * "attrib" command via system().  */
408 #define CHMOD_BROKEN 1
409 
410 /* Rule Number 1 of OS/2 Programming: If the function you're looking
411    for doesn't exist, try putting "Dos" in front of it. */
412 #ifndef sleep
413 #define sleep(x) DosSleep(((long)(x))*1000L)
414 #endif /* sleep */
415 
416 /* Set to 1 for some debugging messages. */
417 #if 0
418 #define KFF_DEBUG(call) printf("*** %s:%d: ", __FILE__, __LINE__); \
419                         call; fflush(stdout);
420 #else
421 #define KFF_DEBUG(call)
422 #endif
423