1 /* source: procan-cdefs.c */
2 /* Copyright Gerhard Rieger and contributors (see file CHANGES) */
3 /* Published under the GNU General Public License V.2, see file COPYING */
5 /* a function that prints compile time parameters */
6 /* the set of parameters is only a small subset of the available defines and
7 will be extended on demand */
10 #include "xiosysincludes.h"
17 int procan_cdefs(FILE *outfile
) {
18 /* basic C/system constants */
20 fprintf(outfile
, "#define FD_SETSIZE %u\n", FD_SETSIZE
);
23 fprintf(outfile
, "#define NFDBITS %d\n", (int)NFDBITS
);
26 fprintf(outfile
, "#define O_RDONLY %u\n", O_RDONLY
);
29 fprintf(outfile
, "#define O_WRONLY %u\n", O_WRONLY
);
32 fprintf(outfile
, "#define O_RDWR %u\n", O_RDWR
);
35 fprintf(outfile
, "#define SHUT_RD %u\n", SHUT_RD
);
38 fprintf(outfile
, "#define SHUT_WR %u\n", SHUT_WR
);
41 fprintf(outfile
, "#define SHUT_RDWR %u\n", SHUT_RDWR
);
44 /* Compile time controls */
45 #ifdef _FILE_OFFSET_BITS
46 fprintf(outfile
, "#define _FILE_OFFSET_BITS %u\n", _FILE_OFFSET_BITS
);
49 fprintf(outfile
, "#define _LARGE_FILES %u\n", _LARGE_FILES
);
52 /* termios constants */
54 fprintf(outfile
, "#define CRDLY 0%011o\n", CRDLY
);
57 fprintf(outfile
, "#define CR0 0%011o\n", CR0
);
60 fprintf(outfile
, "#define CR1 0%011o\n", CR1
);
63 fprintf(outfile
, "#define CR2 0%011o\n", CR2
);
66 fprintf(outfile
, "#define CR3 0%011o\n", CR3
);
69 fprintf(outfile
, "#define TABDLY 0%011o\n", TABDLY
);
72 fprintf(outfile
, "#define TAB0 0%011o\n", TAB0
);
75 fprintf(outfile
, "#define TAB1 0%011o\n", TAB1
);
78 fprintf(outfile
, "#define TAB2 0%011o\n", TAB2
);
81 fprintf(outfile
, "#define TAB3 0%011o\n", TAB3
);
84 fprintf(outfile
, "#define CSIZE 0%011o\n", CSIZE
);
87 fprintf(outfile
, "#define TIOCEXCL 0x%lx\n", (unsigned long)TIOCEXCL
);
92 fprintf(outfile
, "#define FOPEN_MAX %u\n", FOPEN_MAX
);
95 /* socket constants */
97 fprintf(outfile
, "#define PF_UNSPEC %d\n", PF_UNSPEC
);
100 fprintf(outfile
, "#define PF_UNIX %d\n", PF_UNIX
);
101 #elif defined(PF_LOCAL)
102 fprintf(outfile
, "#define PF_LOCAL %d\n", PF_LOCAL
);
105 fprintf(outfile
, "#define PF_INET %d\n", PF_INET
);
108 fprintf(outfile
, "#define PF_INET6 %d\n", PF_INET6
);
111 fprintf(outfile
, "#define PF_APPLETALK %d\n", PF_APPLETALK
);
114 fprintf(outfile
, "#define PF_PACKET %d\n", PF_PACKET
);
117 fprintf(outfile
, "#define PF_VSOCK %d\n", PF_VSOCK
);
120 fprintf(outfile
, "#define SOCK_STREAM %d\n", SOCK_STREAM
);
123 fprintf(outfile
, "#define SOCK_DGRAM %d\n", SOCK_DGRAM
);
126 fprintf(outfile
, "#define SOCK_RAW %d\n", SOCK_RAW
);
128 #ifdef SOCK_SEQPACKET
129 fprintf(outfile
, "#define SOCK_SEQPACKET %d\n", SOCK_SEQPACKET
);
132 fprintf(outfile
, "#define SOCK_PACKET %d\n", SOCK_PACKET
);
135 fprintf(outfile
, "#define IPPROTO_IP %d\n", IPPROTO_IP
);
138 fprintf(outfile
, "#define IPPROTO_TCP %d\n", IPPROTO_TCP
);
141 fprintf(outfile
, "#define IPPROTO_UDP %d\n", IPPROTO_UDP
);
144 fprintf(outfile
, "#define IPPROTO_DCCP %d\n", IPPROTO_DCCP
);
147 fprintf(outfile
, "#define IPPROTO_SCTP %d\n", IPPROTO_SCTP
);
149 #ifdef IPPROTO_UDPLITE
150 fprintf(outfile
, "#define IPPROTO_UDPLITE %d\n", IPPROTO_UDPLITE
);
153 fprintf(outfile
, "#define IPPROTO_RAW %d\n", IPPROTO_RAW
);
156 fprintf(outfile
, "#define SOL_SOCKET 0x%x\n", SOL_SOCKET
);
159 fprintf(outfile
, "#define SOL_PACKET 0x%x\n", SOL_PACKET
);
162 fprintf(outfile
, "#define SOL_IP 0x%x\n", SOL_IP
);
165 fprintf(outfile
, "#define SOL_IPV6 0x%x\n", SOL_IPV6
);
168 fprintf(outfile
, "#define SOL_TCP 0x%x\n", SOL_TCP
);
171 fprintf(outfile
, "#define SOL_UDP 0x%x\n", SOL_UDP
);
174 fprintf(outfile
, "#define SOL_SCTP 0x%x\n", SOL_SCTP
);
177 fprintf(outfile
, "#define SOL_DCCP 0x%x\n", SOL_DCCP
);
180 fprintf(outfile
, "#define SO_PROTOCOL %d\n", SO_PROTOCOL
);
183 fprintf(outfile
, "#define SO_PROTOTYPE %d\n", SO_PROTOTYPE
);
186 fprintf(outfile
, "#define SO_REUSEADDR %d\n", SO_REUSEADDR
);
189 fprintf(outfile
, "#define TCP_MAXSEG %d\n", TCP_MAXSEG
);