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