1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-09 13:46:33 +00:00

Procan -V; more C-defines (__GLIBC__, O_*, AI_*, EAI_*)

This commit is contained in:
Gerhard Rieger 2024-09-08 13:15:49 +02:00 committed by Gerhard
parent 568c26861b
commit 200ccb24cd
3 changed files with 171 additions and 12 deletions

View file

@ -15,30 +15,91 @@
#include "procan.h"
int procan_cdefs(FILE *outfile) {
/* basic C/system constants */
/* System constants */
#ifdef __KERNEL__
fprintf(outfile, "__KERNEL__ = \"%s\"\n", __KERNEL__);
#endif
#ifdef __GLIBC__
fprintf(outfile, "__GLIBC__ = %d\n", __GLIBC__);
#endif
/* Basic C/system constants */
#ifdef FD_SETSIZE
fprintf(outfile, "#define FD_SETSIZE %u\n", FD_SETSIZE);
fprintf(outfile, "#define FD_SETSIZE %u\n", FD_SETSIZE);
#endif
#ifdef NFDBITS
fprintf(outfile, "#define NFDBITS %d\n", (int)NFDBITS);
fprintf(outfile, "#define NFDBITS %d\n", (int)NFDBITS);
#endif
#ifdef O_RDONLY
fprintf(outfile, "#define O_RDONLY %u\n", O_RDONLY);
fprintf(outfile, "#define O_RDONLY %u\n", O_RDONLY);
#endif
#ifdef O_WRONLY
fprintf(outfile, "#define O_WRONLY %u\n", O_WRONLY);
fprintf(outfile, "#define O_WRONLY %u\n", O_WRONLY);
#endif
#ifdef O_RDWR
fprintf(outfile, "#define O_RDWR %u\n", O_RDWR);
fprintf(outfile, "#define O_RDWR %u\n", O_RDWR);
#endif
#ifdef O_CREAT
fprintf(outfile, "#define O_CREAT 0x%06x\n", O_CREAT);
#endif
#ifdef O_EXCL
fprintf(outfile, "#define O_EXCL 0x%06x\n", O_EXCL);
#endif
#ifdef O_NOCTTY
fprintf(outfile, "#define O_NOCTTY 0x%06x\n", O_NOCTTY);
#endif
#ifdef O_TRUNC
fprintf(outfile, "#define O_TRUNC 0x%06x\n", O_TRUNC);
#endif
#ifdef O_APPEND
fprintf(outfile, "#define O_APPEND 0x%06x\n", O_APPEND);
#endif
#ifdef O_NONBLOCK
fprintf(outfile, "#define O_NONBLOCK 0x%06x\n", O_NONBLOCK);
#endif
#ifdef O_NDELAY
fprintf(outfile, "#define O_NDELAY 0x%06x\n", O_NDELAY);
#endif
#ifdef O_SYNC
fprintf(outfile, "#define O_SYNC 0x%06x\n", O_SYNC);
#endif
#ifdef O_FSYNC
fprintf(outfile, "#define O_FSYNC 0x%06x\n", O_FSYNC);
#endif
#ifdef O_LARGEFILE
fprintf(outfile, "#define O_LARGEFILE 0x%06x\n", O_LARGEFILE);
#endif
#ifdef O_DIRECTORY
fprintf(outfile, "#define O_DIRECTORY 0x%06x\n", O_DIRECTORY);
#endif
#ifdef O_NOFOLLOW
fprintf(outfile, "#define O_NOFOLLOW 0x%06x\n", O_NOFOLLOW);
#endif
#ifdef O_CLOEXEC
fprintf(outfile, "#define O_CLOEXEC 0x%06x\n", O_CLOEXEC);
#endif
#ifdef O_DIRECT
fprintf(outfile, "#define O_DIRECT 0x%06x\n", O_DIRECT);
#endif
#ifdef O_NOATIME
fprintf(outfile, "#define O_NOATIME 0x%06x\n", O_NOATIME);
#endif
#ifdef O_PATH
fprintf(outfile, "#define O_PATH 0x%06x\n", O_PATH);
#endif
#ifdef O_DSYNC
fprintf(outfile, "#define O_DSYNC 0x%06x\n", O_SYNC);
#endif
#ifdef O_TMPFILE
fprintf(outfile, "#define O_TMPFILE 0x%06x\n", O_TMPFILE);
#endif
#ifdef SHUT_RD
fprintf(outfile, "#define SHUT_RD %u\n", SHUT_RD);
fprintf(outfile, "#define SHUT_RD %u\n", SHUT_RD);
#endif
#ifdef SHUT_WR
fprintf(outfile, "#define SHUT_WR %u\n", SHUT_WR);
fprintf(outfile, "#define SHUT_WR %u\n", SHUT_WR);
#endif
#ifdef SHUT_RDWR
fprintf(outfile, "#define SHUT_RDWR %u\n", SHUT_RDWR);
fprintf(outfile, "#define SHUT_RDWR %u\n", SHUT_RDWR);
#endif
/* Compile time controls */
@ -188,5 +249,78 @@ int procan_cdefs(FILE *outfile) {
#ifdef TCP_MAXSEG
fprintf(outfile, "#define TCP_MAXSEG %d\n", TCP_MAXSEG);
#endif
#ifdef AI_PASSIVE
fprintf(outfile, "#define AI_PASSIVE 0x%02x\n", AI_PASSIVE);
#endif
#ifdef AI_CANONNAME
fprintf(outfile, "#define AI_CANONNAME 0x%02x\n", AI_CANONNAME);
#endif
#ifdef AI_NUMERICHOST
fprintf(outfile, "#define AI_NUMERICHOST 0x%02x\n", AI_NUMERICHOST);
#endif
#ifdef AI_V4MAPPED
fprintf(outfile, "#define AI_V4MAPPED 0x%02x\n", AI_V4MAPPED);
#endif
#ifdef AI_ALL
fprintf(outfile, "#define AI_ALL 0x%02x\n", AI_ALL);
#endif
#ifdef AI_ADDRCONFIG
fprintf(outfile, "#define AI_ADDRCONFIG 0x%02x\n", AI_ADDRCONFIG);
#endif
#ifdef EAI_BADFLAGS
fprintf(outfile, "#define EAI_BADFLAGS %d\n", EAI_BADFLAGS);
#endif
#ifdef EAI_NONAME
fprintf(outfile, "#define EAI_NONAME %d\n", EAI_NONAME);
#endif
#ifdef EAI_AGAIN
fprintf(outfile, "#define EAI_AGAIN %d\n", EAI_AGAIN);
#endif
#ifdef EAI_FAIL
fprintf(outfile, "#define EAI_FAIL %d\n", EAI_FAIL);
#endif
#ifdef EAI_FAMILY
fprintf(outfile, "#define EAI_FAMILY %d\n", EAI_FAMILY);
#endif
#ifdef EAI_SOCKTYPE
fprintf(outfile, "#define EAI_SOCKTYPE %d\n", EAI_SOCKTYPE);
#endif
#ifdef EAI_SERVICE
fprintf(outfile, "#define EAI_SERVICE %d\n", EAI_SERVICE);
#endif
#ifdef EAI_MEMORY
fprintf(outfile, "#define EAI_MEMORY %d\n", EAI_MEMORY);
#endif
#ifdef EAI_SYSTEM
fprintf(outfile, "#define EAI_SYSTEM %d\n", EAI_SYSTEM);
#endif
#ifdef EAI_OVERFLOW
fprintf(outfile, "#define EAI_OVERFLOW %d\n", EAI_OVERFLOW);
#endif
#ifdef EAI_NODATA
fprintf(outfile, "#define EAI_NODATA %d\n", EAI_NODATA);
#endif
#ifdef EAI_ADDRFAMILY
fprintf(outfile, "#define EAI_ADDRFAMILY %d\n", EAI_ADDRFAMILY);
#endif
#ifdef EAI_INPROGRESS
fprintf(outfile, "#define EAI_INPROGRESS %d\n", EAI_INPROGRESS);
#endif
#ifdef EAI_CANCELED
fprintf(outfile, "#define EAI_CANCELED %d\n", EAI_CANCELED);
#endif
#ifdef EAI_NOTCANCELED
fprintf(outfile, "#define EAI_NOTCANCELED %d\n", EAI_NOTCANCELED);
#endif
#ifdef EAI_ALLDONE
fprintf(outfile, "#define EAI_ALLDONE %d\n", EAI_ALLDONE);
#endif
#ifdef EAI_INTR
fprintf(outfile, "#define EAI_INTR %d\n", EAI_INTR);
#endif
#ifdef EAI_IDN_ENCODE
fprintf(outfile, "#define EAI_IDN_ENCODE %d\n", EAI_IDN_ENCODE);
#endif
return 0;
}