102d9f452Stholo /* config.h --- configuration file for OS/2 202d9f452Stholo Karl Fogel <kfogel@cyclic.com> --- Oct 1995 */ 302d9f452Stholo 402d9f452Stholo /* This file lives in the os2/ subdirectory, which is only included 502d9f452Stholo * in your header search path if you're working under IBM C++, 602d9f452Stholo * and use os2/makefile (with GNU make for OS/2). Thus, this is the 702d9f452Stholo * right place to put configuration information for OS/2. 802d9f452Stholo */ 902d9f452Stholo 1002d9f452Stholo 11*461cc63eStholo /* We need some system header files here since we evaluate values from 12*461cc63eStholo * these files below. 13*461cc63eStholo */ 14*461cc63eStholo #include <stdio.h> 15*461cc63eStholo #include <errno.h> 16*461cc63eStholo 17*461cc63eStholo 18*461cc63eStholo 19*461cc63eStholo #ifndef __STDC__ 2002d9f452Stholo /* You bet! */ 2102d9f452Stholo #define __STDC__ 1 22*461cc63eStholo #endif 23*461cc63eStholo 24*461cc63eStholo /* The IBM compiler uses the (non-standard) error code EACCESS instead of 25*461cc63eStholo EACCES (note: one 'S'). Define EACCESS to be EACCES and use the standard 26*461cc63eStholo name in the code. */ 27*461cc63eStholo #ifndef EACCES 28*461cc63eStholo #define EACCES EACCESS 29*461cc63eStholo #endif 30*461cc63eStholo 31*461cc63eStholo /* Handle some other name differences between the IBM and the Watcom 32*461cc63eStholo * compiler. 33*461cc63eStholo */ 34*461cc63eStholo #ifdef __WATCOMC__ 35*461cc63eStholo #define _setmode setmode 36*461cc63eStholo #define _cwait cwait 37*461cc63eStholo #endif 3802d9f452Stholo 3902d9f452Stholo /* Define if on AIX 3. 4002d9f452Stholo System headers sometimes define this. 4102d9f452Stholo We just want to avoid a redefinition error message. */ 4202d9f452Stholo #undef _ALL_SOURCE 4302d9f452Stholo 4402d9f452Stholo /* Define to empty if the keyword does not work. */ 4502d9f452Stholo /* Const is working. */ 4602d9f452Stholo #undef const 4702d9f452Stholo 4802d9f452Stholo /* Define to `int' if <sys/types.h> doesn't define. */ 4902d9f452Stholo /* OS/2 doesn't have gid_t. It doesn't even really have group 5002d9f452Stholo numbers, I think. This will take more thought to get right, but 5102d9f452Stholo let's get it running first. */ 5202d9f452Stholo #define gid_t int 5302d9f452Stholo 5402d9f452Stholo /* Define if you support file names longer than 14 characters. */ 5502d9f452Stholo /* We support long file names, but not long corporate acronyms. */ 5602d9f452Stholo #define HAVE_LONG_FILE_NAMES 1 5702d9f452Stholo 5802d9f452Stholo /* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ 5902d9f452Stholo /* If POSIX.1 requires this, why doesn't WNT have it? */ 6002d9f452Stholo /* Maybe POSIX only says that if it is present, it must behave a 6102d9f452Stholo certain way, but that it can simply be not present too. I 6202d9f452Stholo dunno. */ 6302d9f452Stholo /* Anyway, OS/2 ain't got it. */ 6402d9f452Stholo #undef HAVE_SYS_WAIT_H 6502d9f452Stholo 6602d9f452Stholo /* Define if utime(file, NULL) sets file's timestamp to the present. */ 6702d9f452Stholo /* Documentation says yup; haven't verified experimentally. */ 6802d9f452Stholo #define HAVE_UTIME_NULL 1 6902d9f452Stholo 7002d9f452Stholo /* Define if on MINIX. */ 7102d9f452Stholo /* Hah. */ 7202d9f452Stholo #undef _MINIX 7302d9f452Stholo 7402d9f452Stholo /* Define to `int' if <sys/types.h> doesn't define. */ 7502d9f452Stholo #define mode_t int 7602d9f452Stholo 7702d9f452Stholo /* Define to `int' if <sys/types.h> doesn't define. */ 7802d9f452Stholo #define pid_t int 7902d9f452Stholo 8002d9f452Stholo /* Define if the system does not provide POSIX.1 features except 8102d9f452Stholo with this defined. */ 8202d9f452Stholo /* This string doesn't appear anywhere in the system header files, 8302d9f452Stholo so I assume it's irrelevant. */ 8402d9f452Stholo #undef _POSIX_1_SOURCE 8502d9f452Stholo 8602d9f452Stholo /* Define if you need to in order for stat and other things to work. */ 8702d9f452Stholo /* Same as for _POSIX_1_SOURCE, above. */ 8802d9f452Stholo #undef _POSIX_SOURCE 8902d9f452Stholo 9002d9f452Stholo /* Define as the return type of signal handlers (int or void). */ 9102d9f452Stholo /* IBMCPP manual indicates they are void. */ 9202d9f452Stholo #define RETSIGTYPE void 9302d9f452Stholo 9402d9f452Stholo /* Define to `unsigned' if <sys/types.h> doesn't define. */ 9502d9f452Stholo /* sys/types.h doesn't define it, but stdio.h does, which cvs.h 9602d9f452Stholo #includes, so things should be okay. */ 9702d9f452Stholo /* #undef size_t */ 9802d9f452Stholo 9902d9f452Stholo /* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */ 10002d9f452Stholo /* sys/stat.h apparently doesn't even have them; setting this will let 10102d9f452Stholo ../lib/system.h define them. */ 10202d9f452Stholo #define STAT_MACROS_BROKEN 1 10302d9f452Stholo 10402d9f452Stholo /* Define if you have the ANSI C header files. */ 10502d9f452Stholo /* We have at least a reasonable facsimile thereof. */ 10602d9f452Stholo #define STDC_HEADERS 1 10702d9f452Stholo 10802d9f452Stholo /* Define if you can safely include both <sys/time.h> and <time.h>. */ 10902d9f452Stholo /* We don't have <sys/time.h> at all. Why isn't there a definition 11002d9f452Stholo for HAVE_SYS_TIME_H anywhere in config.h.in? */ 11102d9f452Stholo #undef TIME_WITH_SYS_TIME 11202d9f452Stholo 11302d9f452Stholo /* Define to `int' if <sys/types.h> doesn't define. */ 11402d9f452Stholo #define uid_t int 11502d9f452Stholo 11602d9f452Stholo /* Define if you have MIT Kerberos version 4 available. */ 11702d9f452Stholo /* We don't. */ 11802d9f452Stholo #undef HAVE_KERBEROS 11902d9f452Stholo 12002d9f452Stholo /* Define if you want CVS to be able to be a remote repository client. */ 12102d9f452Stholo /* That's all we want. */ 12202d9f452Stholo #define CLIENT_SUPPORT 12302d9f452Stholo 12402d9f452Stholo /* Define if you want CVS to be able to serve repositories to remote 12502d9f452Stholo clients. */ 12602d9f452Stholo /* No server support yet. Note that you don't have to define 12702d9f452Stholo CLIENT_SUPPORT or SERVER_SUPPORT to enable the non-remote code; 12802d9f452Stholo that's always there. */ 12902d9f452Stholo #undef SERVER_SUPPORT 13002d9f452Stholo 13102d9f452Stholo /* the path to the gnu diff program on your system */ 13202d9f452Stholo /* We don't need this for CLIENT side. */ 13302d9f452Stholo #undef DIFF 13402d9f452Stholo 13502d9f452Stholo /* the path to the gnu grep program on your system */ 13602d9f452Stholo /* We don't need this for CLIENT side. */ 13702d9f452Stholo #undef GREP 13802d9f452Stholo 13902d9f452Stholo /* The number of bytes in a int. */ 14002d9f452Stholo #define SIZEOF_INT 4 14102d9f452Stholo 14202d9f452Stholo /* The number of bytes in a long. */ 14302d9f452Stholo #define SIZEOF_LONG 4 14402d9f452Stholo 14502d9f452Stholo /* Define if you have the connect function. */ 14602d9f452Stholo /* Not used? */ 14702d9f452Stholo /* It appears to be used in client.c now... don't know yet it OS/2 has it. */ 14802d9f452Stholo #define HAVE_CONNECT 14902d9f452Stholo 15002d9f452Stholo /* Define if you have the fchdir function. */ 15102d9f452Stholo #undef HAVE_FCHDIR 15202d9f452Stholo 15302d9f452Stholo /* Define if you have the fchmod function. */ 15402d9f452Stholo #undef HAVE_FCHMOD 15502d9f452Stholo 15602d9f452Stholo /* Define if you have the fsync function. */ 15702d9f452Stholo #undef HAVE_FSYNC 15802d9f452Stholo 15902d9f452Stholo /* Define if you have the ftime function. */ 16002d9f452Stholo #define HAVE_FTIME 1 16102d9f452Stholo 16202d9f452Stholo /* Define if you have the ftruncate function. */ 16302d9f452Stholo #undef HAVE_FTRUNCATE 16402d9f452Stholo 16502d9f452Stholo /* Define if you have the getpagesize function. */ 16602d9f452Stholo #undef HAVE_GETPAGESIZE 16702d9f452Stholo 16802d9f452Stholo /* Define if you have the krb_get_err_text function. */ 16902d9f452Stholo #undef HAVE_KRB_GET_ERR_TEXT 17002d9f452Stholo 17102d9f452Stholo /* Define if you have the mkfifo function. */ 17202d9f452Stholo #undef HAVE_MKFIFO 17302d9f452Stholo 17402d9f452Stholo /* Define if you have the putenv function. */ 17502d9f452Stholo #define HAVE_PUTENV 1 17602d9f452Stholo 17702d9f452Stholo /* Define if you have the setvbuf function. */ 17802d9f452Stholo #define HAVE_SETVBUF 1 17902d9f452Stholo 18002d9f452Stholo /* Define if you have the sigaction function. */ 18102d9f452Stholo #undef HAVE_SIGACTION 18202d9f452Stholo 18302d9f452Stholo /* Define if you have the sigblock function. */ 18402d9f452Stholo #undef HAVE_SIGBLOCK 18502d9f452Stholo 18602d9f452Stholo /* Define if you have the sigprocmask function. */ 18702d9f452Stholo #undef HAVE_SIGPROCMASK 18802d9f452Stholo 18902d9f452Stholo /* Define if you have the sigsetmask function. */ 19002d9f452Stholo #undef HAVE_SIGSETMASK 19102d9f452Stholo 19202d9f452Stholo /* Define if you have the sigvec function. */ 19302d9f452Stholo #undef HAVE_SIGVEC 19402d9f452Stholo 19502d9f452Stholo /* Define if you have the timezone function. */ 19602d9f452Stholo /* Hmm, I actually rather think it's an extern long 19702d9f452Stholo variable; that message was mechanically generated 19802d9f452Stholo by autoconf. And I don't see any actual uses of 19902d9f452Stholo this function in the code anyway, hmm. */ 20002d9f452Stholo #undef HAVE_TIMEZONE 20102d9f452Stholo 202*461cc63eStholo /* Define if you have the tzset function. */ 203*461cc63eStholo #define HAVE_TZSET 1 204*461cc63eStholo 20502d9f452Stholo /* Define if you have the vfork function. */ 20602d9f452Stholo #undef HAVE_VFORK 20702d9f452Stholo 20802d9f452Stholo /* Define if you have the vprintf function. */ 20902d9f452Stholo #define HAVE_VPRINTF 1 21002d9f452Stholo 21102d9f452Stholo /* Define if you have the <direct.h> header file. */ 21202d9f452Stholo #define HAVE_DIRECT_H 1 21302d9f452Stholo 21402d9f452Stholo /* Define if you have the <dirent.h> header file. */ 21502d9f452Stholo /* We have our own dirent.h and dirent.c. */ 216*461cc63eStholo #ifdef __WATCOMC__ 217*461cc63eStholo #undef HAVE_DIRENT_H 218*461cc63eStholo #else 21902d9f452Stholo #define HAVE_DIRENT_H 1 220*461cc63eStholo #endif 22102d9f452Stholo 22202d9f452Stholo /* Define if you have the <errno.h> header file. */ 22302d9f452Stholo #define HAVE_ERRNO_H 1 22402d9f452Stholo 22502d9f452Stholo /* Define if you have the <fcntl.h> header file. */ 22602d9f452Stholo #define HAVE_FCNTL_H 1 22702d9f452Stholo 22802d9f452Stholo /* Define if you have the <io.h> header file. */ 22902d9f452Stholo /* Low-level Unix I/O routines like open, creat, etc. */ 23002d9f452Stholo #define HAVE_IO_H 1 23102d9f452Stholo 23202d9f452Stholo /* Define if you have the <memory.h> header file. */ 23302d9f452Stholo #define HAVE_MEMORY_H 1 23402d9f452Stholo 23502d9f452Stholo /* Define if you have the <ndbm.h> header file. */ 23602d9f452Stholo #undef HAVE_NDBM_H 23702d9f452Stholo 23802d9f452Stholo /* Define if you have the <ndir.h> header file. */ 23902d9f452Stholo #undef HAVE_NDIR_H 24002d9f452Stholo 24102d9f452Stholo /* Define if you have the <string.h> header file. */ 24202d9f452Stholo #define HAVE_STRING_H 1 24302d9f452Stholo 24402d9f452Stholo /* Define if you have the <sys/bsdtypes.h> header file. */ 24502d9f452Stholo #undef HAVE_SYS_BSDTYPES_H 24602d9f452Stholo 24702d9f452Stholo /* Define if you have the <sys/dir.h> header file. */ 24802d9f452Stholo #undef HAVE_SYS_DIR_H 24902d9f452Stholo 25002d9f452Stholo /* Define if you have the <sys/ndir.h> header file. */ 25102d9f452Stholo #undef HAVE_SYS_NDIR_H 25202d9f452Stholo 25302d9f452Stholo /* Define if you have the <sys/param.h> header file. */ 25402d9f452Stholo #undef HAVE_SYS_PARAM_H 25502d9f452Stholo 25602d9f452Stholo /* Define if you have the <sys/select.h> header file. */ 25702d9f452Stholo #undef HAVE_SYS_SELECT_H 25802d9f452Stholo 25902d9f452Stholo /* Define if you have the <sys/time.h> header file. */ 26002d9f452Stholo #undef HAVE_SYS_TIME_H 26102d9f452Stholo 26202d9f452Stholo /* Define if you have the <sys/timeb.h> header file. */ 26302d9f452Stholo #define HAVE_SYS_TIMEB_H 1 26402d9f452Stholo 26502d9f452Stholo /* Define if you have the <unistd.h> header file. */ 26602d9f452Stholo #undef HAVE_UNISTD_H 26702d9f452Stholo 26802d9f452Stholo /* Define if you have the <utime.h> header file. */ 26902d9f452Stholo #undef HAVE_UTIME_H 27002d9f452Stholo 27102d9f452Stholo /* Define if you have the <sys/utime.h> header file. */ 27202d9f452Stholo #define HAVE_SYS_UTIME_H 1 27302d9f452Stholo 27402d9f452Stholo /* Define if you have the inet library (-linet). */ 27502d9f452Stholo #undef HAVE_LIBINET 27602d9f452Stholo 27702d9f452Stholo /* Define if you have the nsl library (-lnsl). */ 27802d9f452Stholo /* This is not used anywhere in the source code. */ 27902d9f452Stholo #undef HAVE_LIBNSL 28002d9f452Stholo 28102d9f452Stholo /* Define if you have the nsl_s library (-lnsl_s). */ 28202d9f452Stholo #undef HAVE_LIBNSL_S 28302d9f452Stholo 28402d9f452Stholo /* Define if you have the socket library (-lsocket). */ 28502d9f452Stholo /* This isn't ever used either. */ 28602d9f452Stholo #undef HAVE_LIBSOCKET 28702d9f452Stholo 28802d9f452Stholo /* Under OS/2, mkdir only takes one argument. */ 28902d9f452Stholo #define CVS_MKDIR os2_mkdir 29002d9f452Stholo extern int os2_mkdir (const char *PATH, int MODE); 29102d9f452Stholo 29202d9f452Stholo /* This function doesn't exist under OS/2; we provide a stub. */ 29302d9f452Stholo extern int readlink (char *path, char *buf, int buf_size); 29402d9f452Stholo 29502d9f452Stholo /* This is just a call to GetCurrentProcessID. */ 296*461cc63eStholo #ifndef __WATCOMC__ 29702d9f452Stholo extern pid_t getpid (void); 298*461cc63eStholo #endif 29902d9f452Stholo 30002d9f452Stholo /* We definitely have prototypes. */ 30102d9f452Stholo #define USE_PROTOTYPES 1 30202d9f452Stholo 30302d9f452Stholo /* Under OS/2, filenames are case-insensitive, and both / and \ 30402d9f452Stholo are path component separators. */ 30502d9f452Stholo #define FOLD_FN_CHAR(c) (OS2_filename_classes[(unsigned char) (c)]) 30602d9f452Stholo extern unsigned char OS2_filename_classes[]; 30702d9f452Stholo 30802d9f452Stholo /* Is the character C a path name separator? Under OS/2, you can use 30902d9f452Stholo either / or \. */ 31002d9f452Stholo #define ISDIRSEP(c) (FOLD_FN_CHAR(c) == '/') 31102d9f452Stholo 31202d9f452Stholo /* Like strcmp, but with the appropriate tweaks for file names. 31302d9f452Stholo Under OS/2, filenames are case-insensitive but case-preserving, 31402d9f452Stholo and both \ and / are path element separators. */ 31502d9f452Stholo extern int fncmp (const char *n1, const char *n2); 31602d9f452Stholo 31702d9f452Stholo /* Fold characters in FILENAME to their canonical forms. 31802d9f452Stholo If FOLD_FN_CHAR is not #defined, the system provides a default 31902d9f452Stholo definition for this. */ 32002d9f452Stholo extern void fnfold (char *FILENAME); 32102d9f452Stholo 32202d9f452Stholo /* #define this if your system terminates lines in text files with 32302d9f452Stholo CRLF instead of plain LF, and your I/O functions automatically 32402d9f452Stholo translate between using LF in memory and CRLF on disk, unless you 32502d9f452Stholo specifically tell them not to. */ 32602d9f452Stholo #define LINES_CRLF_TERMINATED 1 32702d9f452Stholo 32802d9f452Stholo /* Read data from INFILE, and copy it to OUTFILE. 32902d9f452Stholo Open INFILE using INFLAGS, and OUTFILE using OUTFLAGS. 33002d9f452Stholo This is useful for converting between CRLF and LF line formats. */ 33102d9f452Stholo extern void convert_file (char *INFILE, int INFLAGS, 33202d9f452Stholo char *OUTFILE, int OUTFLAGS); 33302d9f452Stholo 33402d9f452Stholo /* This is where old bits go to die under OS/2 as well as WinNT. */ 33502d9f452Stholo #define DEVNULL "nul" 33602d9f452Stholo 33702d9f452Stholo /* Make sure that we don't try to perform operations on RCS files on the 33802d9f452Stholo local machine. I think I neglected to apply some changes from 33902d9f452Stholo MHI's port in that area of code, or found some issues I didn't want 34002d9f452Stholo to deal with. */ 34102d9f452Stholo #define CLIENT_ONLY 34202d9f452Stholo 34302d9f452Stholo /* We actually do have a transparent rsh, whew. */ 34402d9f452Stholo #undef RSH_NOT_TRANSPARENT 34502d9f452Stholo /* But it won't be transparent unless we ask it nicely! */ 34602d9f452Stholo #define RSH_NEEDS_BINARY_FLAG 1 34702d9f452Stholo 34802d9f452Stholo /* OS/2 doesn't really have user/group permissions, at least not 34950bf276cStholo according to the C library manual pages. So we'll make decoys. 35050bf276cStholo (This was partly introduced for an obsolete reason, now taken care 35150bf276cStholo of by CHMOD_BROKEN, but I haven't carefully looked at every case 352*461cc63eStholo (in particular mode_to_string), so it might still be needed). 353*461cc63eStholo We do not need that for the watcom compiler since watcom already 354*461cc63eStholo all those permission bits defined. It would probably be better to 355*461cc63eStholo include the necessary system header files in system.h, and then make 356*461cc63eStholo each permission define only if it is not already defined. 357*461cc63eStholo */ 358*461cc63eStholo #ifndef __WATCOMC__ 35902d9f452Stholo #define NEED_DECOY_PERMISSIONS 1 /* see system.h */ 360*461cc63eStholo #endif 36102d9f452Stholo 36202d9f452Stholo 36302d9f452Stholo 364*461cc63eStholo /* For the access() function, for which IBM OS/2 compiler has no pre-defined 36502d9f452Stholo mnemonic masks. */ 366*461cc63eStholo #ifndef __WATCOMC__ 36702d9f452Stholo #define R_OK 04 36802d9f452Stholo #define W_OK 02 36902d9f452Stholo #define F_OK 00 37002d9f452Stholo #define X_OK R_OK /* I think this is right for OS/2. */ 371*461cc63eStholo #endif 37202d9f452Stholo 37302d9f452Stholo /* For getpid() */ 37402d9f452Stholo #include <process.h> 37502d9f452Stholo 37602d9f452Stholo /* So "tcpip.h" gets included in lib/system.h: */ 37702d9f452Stholo #define USE_OWN_TCPIP_H 1 37802d9f452Stholo /* The IBM TCP/IP library gets initialized in main(): */ 37950bf276cStholo #define SYSTEM_INITIALIZE(pargc,pargv) init_sockets() 38002d9f452Stholo extern void init_sockets(); 38102d9f452Stholo 38202d9f452Stholo /* Under OS/2, we have our own popen() and pclose()... */ 38302d9f452Stholo #define USE_OWN_POPEN 1 38402d9f452Stholo /* ... and we use popenRW to start the rsh server. */ 38502d9f452Stholo #define START_RSH_WITH_POPEN_RW 1 38602d9f452Stholo 38702d9f452Stholo /* 38802d9f452Stholo * This tells the client that it must use send()/recv() to talk to the 38902d9f452Stholo * server if it is connected to the server via a socket. Sigh. 390*461cc63eStholo * Windows 95 and VMS cannot convert sockets to file descriptors either, 39102d9f452Stholo * apparently. 39202d9f452Stholo */ 39302d9f452Stholo #define NO_SOCKET_TO_FD 1 39402d9f452Stholo 39502d9f452Stholo /* chmod() doesn't seem to work -- IBM's own example program does not 39602d9f452Stholo * behave as its documentation claims, in fact! I suspect that 39702d9f452Stholo * DosSetPathInfo is the way to go, but can't seem to make that work 39802d9f452Stholo * either. For now, we can deal with some cases by invoking the DOS 39902d9f452Stholo * "attrib" command via system(). */ 40002d9f452Stholo #define CHMOD_BROKEN 1 40102d9f452Stholo 40202d9f452Stholo /* Rule Number 1 of OS/2 Programming: If the function you're looking 403*461cc63eStholo for doesn't exist, try putting "Dos" in front of it. 404*461cc63eStholo Do not forget to include the os2 header file if we use DosSleep. */ 40502d9f452Stholo #ifndef sleep 406*461cc63eStholo #include "os2inc.h" 40702d9f452Stholo #define sleep(x) DosSleep(((long)(x))*1000L) 40802d9f452Stholo #endif /* sleep */ 40902d9f452Stholo 41002d9f452Stholo /* Set to 1 for some debugging messages. */ 41102d9f452Stholo #if 0 41202d9f452Stholo #define KFF_DEBUG(call) printf("*** %s:%d: ", __FILE__, __LINE__); \ 41302d9f452Stholo call; fflush(stdout); 41402d9f452Stholo #else 41502d9f452Stholo #define KFF_DEBUG(call) 41602d9f452Stholo #endif 417