1 /* source: procan-cdefs.c */
2 /* Copyright Gerhard Rieger 2008 */
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 "F_Zu
"\n", 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 /* termios constants */
46 fprintf(outfile
, "#define CRDLY 0%011o\n", CRDLY
);
49 fprintf(outfile
, "#define CR0 0%011o\n", CR0
);
52 fprintf(outfile
, "#define CR1 0%011o\n", CR1
);
55 fprintf(outfile
, "#define CR2 0%011o\n", CR2
);
58 fprintf(outfile
, "#define CR3 0%011o\n", CR3
);
61 fprintf(outfile
, "#define TABDLY 0%011o\n", TABDLY
);
64 fprintf(outfile
, "#define TAB0 0%011o\n", TAB0
);
67 fprintf(outfile
, "#define TAB1 0%011o\n", TAB1
);
70 fprintf(outfile
, "#define TAB2 0%011o\n", TAB2
);
73 fprintf(outfile
, "#define TAB3 0%011o\n", TAB3
);
76 fprintf(outfile
, "#define CSIZE 0%011o\n", CSIZE
);
79 fprintf(outfile
, "#define TIOCEXCL 0x%lx\n", (unsigned long)TIOCEXCL
);
84 fprintf(outfile
, "#define FOPEN_MAX %u\n", FOPEN_MAX
);
87 /* socket constants */
89 fprintf(outfile
, "#define PF_UNIX %d\n", PF_UNIX
);
90 #elif defined(PF_LOCAL)
91 fprintf(outfile
, "#define PF_LOCAL %d\n", PF_LOCAL
);
94 fprintf(outfile
, "#define PF_INET %d\n", PF_INET
);
97 fprintf(outfile
, "#define PF_INET6 %d\n", PF_INET6
);
100 fprintf(outfile
, "#define PF_APPLETALK %d\n", PF_APPLETALK
);
103 fprintf(outfile
, "#define PF_PACKET %d\n", PF_PACKET
);
106 fprintf(outfile
, "#define SOCK_STREAM %d\n", SOCK_STREAM
);
109 fprintf(outfile
, "#define SOCK_DGRAM %d\n", SOCK_DGRAM
);
112 fprintf(outfile
, "#define SOCK_RAW %d\n", SOCK_RAW
);
114 #ifdef SOCK_SEQPACKET
115 fprintf(outfile
, "#define SOCK_SEQPACKET %d\n", SOCK_SEQPACKET
);
118 fprintf(outfile
, "#define SOCK_PACKET %d\n", SOCK_PACKET
);
121 fprintf(outfile
, "#define IPPROTO_IP %d\n", IPPROTO_IP
);
124 fprintf(outfile
, "#define IPPROTO_TCP %d\n", IPPROTO_TCP
);
127 fprintf(outfile
, "#define IPPROTO_UDP %d\n", IPPROTO_UDP
);
130 fprintf(outfile
, "#define IPPROTO_SCTP %d\n", IPPROTO_SCTP
);
133 fprintf(outfile
, "#define IPPROTO_DCCP %d\n", IPPROTO_DCCP
);
136 fprintf(outfile
, "#define SOL_SOCKET 0x%x\n", SOL_SOCKET
);
139 fprintf(outfile
, "#define SOL_PACKET 0x%x\n", SOL_PACKET
);
142 fprintf(outfile
, "#define SOL_IP 0x%x\n", SOL_IP
);
145 fprintf(outfile
, "#define SOL_IPV6 0x%x\n", SOL_IPV6
);
148 fprintf(outfile
, "#define SOL_TCP 0x%x\n", SOL_TCP
);
151 fprintf(outfile
, "#define SOL_UDP 0x%x\n", SOL_UDP
);
154 fprintf(outfile
, "#define SOL_SCTP 0x%x\n", SOL_SCTP
);
157 fprintf(outfile
, "#define SOL_DCCP 0x%x\n", SOL_DCCP
);
160 fprintf(outfile
, "#define SO_REUSEADDR %d\n", SO_REUSEADDR
);