00001 #include <stdio.h> 00002 #include <sys/types.h> 00003 #include <sys/socket.h> 00004 #include <sys/stat.h> 00005 #include <unistd.h> 00006 #include <sys/un.h> 00007 #include <netinet/in.h> 00008 #include <netinet/in_systm.h> 00009 #include <netinet/ip.h> 00010 #include <net/if.h> 00011 #include <netdb.h> 00012 #include <errno.h> 00013 #include <netinet/tcp.h> 00014 #include <fcntl.h> 00015 #define SIGNEDP(x) (((x)-1)<0) 00016 #define SIGNED_(x) (SIGNEDP(x)?"":"un") 00017 int main(int argc, char *argv[]) { 00018 FILE *out; 00019 if (argc != 2) { 00020 printf("Invalid argcount!"); 00021 return 1; 00022 } else 00023 out = fopen(argv[1], "w"); 00024 if (!out) { 00025 printf("Error opening output file!"); 00026 return 1; 00027 } 00028 fprintf (out, "(cl:in-package #:SOCKINT)\n"); 00029 fprintf (out, "(cl:eval-when (:compile-toplevel)\n"); 00030 fprintf (out, " (cl:defparameter *integer-sizes* (cl:make-hash-table))\n"); 00031 fprintf (out, " (cl:setf (cl:gethash %d *integer-sizes*) 'sb-alien:char)\n", sizeof(char)); 00032 fprintf (out, " (cl:setf (cl:gethash %d *integer-sizes*) 'sb-alien:short)\n", sizeof(short)); 00033 fprintf (out, " (cl:setf (cl:gethash %d *integer-sizes*) 'sb-alien:long)\n", sizeof(long)); 00034 fprintf (out, " (cl:setf (cl:gethash %d *integer-sizes*) 'sb-alien:int)\n", sizeof(int)); 00035 fprintf (out, ")\n"); 00036 #ifdef AF_INET 00037 fprintf (out, "(cl:defconstant AF-INET %d \"IP Protocol family\")\n", AF_INET); 00038 #else 00039 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for AF_INET (unknown to the C compiler).\")\n"); 00040 #endif 00041 #ifdef AF_UNSPEC 00042 fprintf (out, "(cl:defconstant AF-UNSPEC %d \"Unspecified\")\n", AF_UNSPEC); 00043 #else 00044 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for AF_UNSPEC (unknown to the C compiler).\")\n"); 00045 #endif 00046 #ifdef AF_LOCAL 00047 fprintf (out, "(cl:defconstant AF-LOCAL %d \"Local to host (pipes and file-domain).\")\n", AF_LOCAL); 00048 #else 00049 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for AF_LOCAL (unknown to the C compiler).\")\n"); 00050 #endif 00051 #ifdef AF_INET6 00052 fprintf (out, "(cl:defconstant AF-INET6 %d \"IP version 6\")\n", AF_INET6); 00053 #else 00054 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for AF_INET6 (unknown to the C compiler).\")\n"); 00055 #endif 00056 #ifdef AF_NETLINK 00057 fprintf (out, "(cl:defconstant AF-ROUTE %d \"Alias to emulate 4.4BSD \")\n", AF_NETLINK); 00058 #else 00059 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for AF_NETLINK (unknown to the C compiler).\")\n"); 00060 #endif 00061 #ifdef SOCK_STREAM 00062 fprintf (out, "(cl:defconstant SOCK-STREAM %d \"Sequenced, reliable, connection-based byte streams.\")\n", SOCK_STREAM); 00063 #else 00064 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for SOCK_STREAM (unknown to the C compiler).\")\n"); 00065 #endif 00066 #ifdef SOCK_DGRAM 00067 fprintf (out, "(cl:defconstant SOCK-DGRAM %d \"Connectionless, unreliable datagrams of fixed maximum length.\")\n", SOCK_DGRAM); 00068 #else 00069 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for SOCK_DGRAM (unknown to the C compiler).\")\n"); 00070 #endif 00071 #ifdef SOCK_RAW 00072 fprintf (out, "(cl:defconstant SOCK-RAW %d \"Raw protocol interface.\")\n", SOCK_RAW); 00073 #else 00074 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for SOCK_RAW (unknown to the C compiler).\")\n"); 00075 #endif 00076 #ifdef SOCK_RDM 00077 fprintf (out, "(cl:defconstant SOCK-RDM %d \"Reliably-delivered messages.\")\n", SOCK_RDM); 00078 #else 00079 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for SOCK_RDM (unknown to the C compiler).\")\n"); 00080 #endif 00081 #ifdef SOCK_SEQPACKET 00082 fprintf (out, "(cl:defconstant SOCK-SEQPACKET %d \"Sequenced, reliable, connection-based, datagrams of fixed maximum length.\")\n", SOCK_SEQPACKET); 00083 #else 00084 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for SOCK_SEQPACKET (unknown to the C compiler).\")\n"); 00085 #endif 00086 #ifdef SOL_SOCKET 00087 fprintf (out, "(cl:defconstant SOL-SOCKET %d \"NIL\")\n", SOL_SOCKET); 00088 #else 00089 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for SOL_SOCKET (unknown to the C compiler).\")\n"); 00090 #endif 00091 #ifdef SO_DEBUG 00092 fprintf (out, "(cl:defconstant SO-DEBUG %d \"Enable debugging in underlying protocol modules\")\n", SO_DEBUG); 00093 #else 00094 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for SO_DEBUG (unknown to the C compiler).\")\n"); 00095 #endif 00096 #ifdef SO_REUSEADDR 00097 fprintf (out, "(cl:defconstant SO-REUSEADDR %d \"Enable local address reuse\")\n", SO_REUSEADDR); 00098 #else 00099 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for SO_REUSEADDR (unknown to the C compiler).\")\n"); 00100 #endif 00101 #ifdef SO_TYPE 00102 fprintf (out, "(cl:defconstant SO-TYPE %d \"NIL\")\n", SO_TYPE); 00103 #else 00104 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for SO_TYPE (unknown to the C compiler).\")\n"); 00105 #endif 00106 #ifdef SO_ERROR 00107 fprintf (out, "(cl:defconstant SO-ERROR %d \"NIL\")\n", SO_ERROR); 00108 #else 00109 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for SO_ERROR (unknown to the C compiler).\")\n"); 00110 #endif 00111 #ifdef SO_DONTROUTE 00112 fprintf (out, "(cl:defconstant SO-DONTROUTE %d \"Bypass routing facilities: instead send direct to appropriate network interface for the network portion of the destination address\")\n", SO_DONTROUTE); 00113 #else 00114 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for SO_DONTROUTE (unknown to the C compiler).\")\n"); 00115 #endif 00116 #ifdef SO_BROADCAST 00117 fprintf (out, "(cl:defconstant SO-BROADCAST %d \"Request permission to send broadcast datagrams\")\n", SO_BROADCAST); 00118 #else 00119 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for SO_BROADCAST (unknown to the C compiler).\")\n"); 00120 #endif 00121 #ifdef SO_SNDBUF 00122 fprintf (out, "(cl:defconstant SO-SNDBUF %d \"NIL\")\n", SO_SNDBUF); 00123 #else 00124 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for SO_SNDBUF (unknown to the C compiler).\")\n"); 00125 #endif 00126 #ifdef SO_PASSCRED 00127 fprintf (out, "(cl:defconstant SO-PASSCRED %d \"NIL\")\n", SO_PASSCRED); 00128 #else 00129 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for SO_PASSCRED (unknown to the C compiler).\")\n"); 00130 #endif 00131 #ifdef SO_RCVBUF 00132 fprintf (out, "(cl:defconstant SO-RCVBUF %d \"NIL\")\n", SO_RCVBUF); 00133 #else 00134 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for SO_RCVBUF (unknown to the C compiler).\")\n"); 00135 #endif 00136 #ifdef SO_KEEPALIVE 00137 fprintf (out, "(cl:defconstant SO-KEEPALIVE %d \"Send periodic keepalives: if peer does not respond, we get SIGPIPE\")\n", SO_KEEPALIVE); 00138 #else 00139 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for SO_KEEPALIVE (unknown to the C compiler).\")\n"); 00140 #endif 00141 #ifdef SO_OOBINLINE 00142 fprintf (out, "(cl:defconstant SO-OOBINLINE %d \"Put out-of-band data into the normal input queue when received\")\n", SO_OOBINLINE); 00143 #else 00144 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for SO_OOBINLINE (unknown to the C compiler).\")\n"); 00145 #endif 00146 #ifdef SO_NO_CHECK 00147 fprintf (out, "(cl:defconstant SO-NO-CHECK %d \"NIL\")\n", SO_NO_CHECK); 00148 #else 00149 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for SO_NO_CHECK (unknown to the C compiler).\")\n"); 00150 #endif 00151 #ifdef SO_PRIORITY 00152 fprintf (out, "(cl:defconstant SO-PRIORITY %d \"NIL\")\n", SO_PRIORITY); 00153 #else 00154 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for SO_PRIORITY (unknown to the C compiler).\")\n"); 00155 #endif 00156 #ifdef SO_LINGER 00157 fprintf (out, "(cl:defconstant SO-LINGER %d \"For reliable streams, pause a while on closing when unsent messages are queued\")\n", SO_LINGER); 00158 #else 00159 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for SO_LINGER (unknown to the C compiler).\")\n"); 00160 #endif 00161 #ifdef SO_BSDCOMPAT 00162 fprintf (out, "(cl:defconstant SO-BSDCOMPAT %d \"NIL\")\n", SO_BSDCOMPAT); 00163 #else 00164 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for SO_BSDCOMPAT (unknown to the C compiler).\")\n"); 00165 #endif 00166 #ifdef SO_SNDLOWAT 00167 fprintf (out, "(cl:defconstant SO-SNDLOWAT %d \"NIL\")\n", SO_SNDLOWAT); 00168 #else 00169 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for SO_SNDLOWAT (unknown to the C compiler).\")\n"); 00170 #endif 00171 #ifdef SO_RCVLOWAT 00172 fprintf (out, "(cl:defconstant SO-RCVLOWAT %d \"NIL\")\n", SO_RCVLOWAT); 00173 #else 00174 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for SO_RCVLOWAT (unknown to the C compiler).\")\n"); 00175 #endif 00176 #ifdef SO_SNDTIMEO 00177 fprintf (out, "(cl:defconstant SO-SNDTIMEO %d \"NIL\")\n", SO_SNDTIMEO); 00178 #else 00179 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for SO_SNDTIMEO (unknown to the C compiler).\")\n"); 00180 #endif 00181 #ifdef SO_RCVTIMEO 00182 fprintf (out, "(cl:defconstant SO-RCVTIMEO %d \"NIL\")\n", SO_RCVTIMEO); 00183 #else 00184 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for SO_RCVTIMEO (unknown to the C compiler).\")\n"); 00185 #endif 00186 #ifdef TCP_NODELAY 00187 fprintf (out, "(cl:defconstant TCP-NODELAY %d \"NIL\")\n", TCP_NODELAY); 00188 #else 00189 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for TCP_NODELAY (unknown to the C compiler).\")\n"); 00190 #endif 00191 #ifdef SO_BINDTODEVICE 00192 fprintf (out, "(cl:defconstant SO-BINDTODEVICE %d \"NIL\")\n", SO_BINDTODEVICE); 00193 #else 00194 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for SO_BINDTODEVICE (unknown to the C compiler).\")\n"); 00195 #endif 00196 #ifdef IFNAMSIZ 00197 fprintf (out, "(cl:defconstant IFNAMSIZ %d \"NIL\")\n", IFNAMSIZ); 00198 #else 00199 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for IFNAMSIZ (unknown to the C compiler).\")\n"); 00200 #endif 00201 #ifdef EADDRINUSE 00202 fprintf (out, "(cl:defconstant EADDRINUSE %d \"NIL\")\n", EADDRINUSE); 00203 #else 00204 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for EADDRINUSE (unknown to the C compiler).\")\n"); 00205 #endif 00206 #ifdef EAGAIN 00207 fprintf (out, "(cl:defconstant EAGAIN %d \"NIL\")\n", EAGAIN); 00208 #else 00209 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for EAGAIN (unknown to the C compiler).\")\n"); 00210 #endif 00211 #ifdef EBADF 00212 fprintf (out, "(cl:defconstant EBADF %d \"NIL\")\n", EBADF); 00213 #else 00214 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for EBADF (unknown to the C compiler).\")\n"); 00215 #endif 00216 #ifdef ECONNREFUSED 00217 fprintf (out, "(cl:defconstant ECONNREFUSED %d \"NIL\")\n", ECONNREFUSED); 00218 #else 00219 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for ECONNREFUSED (unknown to the C compiler).\")\n"); 00220 #endif 00221 #ifdef ETIMEDOUT 00222 fprintf (out, "(cl:defconstant ETIMEDOUT %d \"NIL\")\n", ETIMEDOUT); 00223 #else 00224 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for ETIMEDOUT (unknown to the C compiler).\")\n"); 00225 #endif 00226 #ifdef EINTR 00227 fprintf (out, "(cl:defconstant EINTR %d \"NIL\")\n", EINTR); 00228 #else 00229 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for EINTR (unknown to the C compiler).\")\n"); 00230 #endif 00231 #ifdef EINVAL 00232 fprintf (out, "(cl:defconstant EINVAL %d \"NIL\")\n", EINVAL); 00233 #else 00234 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for EINVAL (unknown to the C compiler).\")\n"); 00235 #endif 00236 #ifdef ENOBUFS 00237 fprintf (out, "(cl:defconstant ENOBUFS %d \"NIL\")\n", ENOBUFS); 00238 #else 00239 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for ENOBUFS (unknown to the C compiler).\")\n"); 00240 #endif 00241 #ifdef ENOMEM 00242 fprintf (out, "(cl:defconstant ENOMEM %d \"NIL\")\n", ENOMEM); 00243 #else 00244 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for ENOMEM (unknown to the C compiler).\")\n"); 00245 #endif 00246 #ifdef EOPNOTSUPP 00247 fprintf (out, "(cl:defconstant EOPNOTSUPP %d \"NIL\")\n", EOPNOTSUPP); 00248 #else 00249 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for EOPNOTSUPP (unknown to the C compiler).\")\n"); 00250 #endif 00251 #ifdef EPERM 00252 fprintf (out, "(cl:defconstant EPERM %d \"NIL\")\n", EPERM); 00253 #else 00254 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for EPERM (unknown to the C compiler).\")\n"); 00255 #endif 00256 #ifdef EPROTONOSUPPORT 00257 fprintf (out, "(cl:defconstant EPROTONOSUPPORT %d \"NIL\")\n", EPROTONOSUPPORT); 00258 #else 00259 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for EPROTONOSUPPORT (unknown to the C compiler).\")\n"); 00260 #endif 00261 #ifdef ESOCKTNOSUPPORT 00262 fprintf (out, "(cl:defconstant ESOCKTNOSUPPORT %d \"NIL\")\n", ESOCKTNOSUPPORT); 00263 #else 00264 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for ESOCKTNOSUPPORT (unknown to the C compiler).\")\n"); 00265 #endif 00266 #ifdef ENETUNREACH 00267 fprintf (out, "(cl:defconstant ENETUNREACH %d \"NIL\")\n", ENETUNREACH); 00268 #else 00269 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for ENETUNREACH (unknown to the C compiler).\")\n"); 00270 #endif 00271 #ifdef ENOTCONN 00272 fprintf (out, "(cl:defconstant ENOTCONN %d \"NIL\")\n", ENOTCONN); 00273 #else 00274 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for ENOTCONN (unknown to the C compiler).\")\n"); 00275 #endif 00276 #ifdef NETDB_INTERNAL 00277 fprintf (out, "(cl:defconstant NETDB-INTERNAL %d \"See errno.\")\n", NETDB_INTERNAL); 00278 #else 00279 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for NETDB_INTERNAL (unknown to the C compiler).\")\n"); 00280 #endif 00281 #ifdef NETDB_SUCCESS 00282 fprintf (out, "(cl:defconstant NETDB-SUCCESS %d \"No problem.\")\n", NETDB_SUCCESS); 00283 #else 00284 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for NETDB_SUCCESS (unknown to the C compiler).\")\n"); 00285 #endif 00286 #ifdef HOST_NOT_FOUND 00287 fprintf (out, "(cl:defconstant HOST-NOT-FOUND %d \"Authoritative Answer Host not found.\")\n", HOST_NOT_FOUND); 00288 #else 00289 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for HOST_NOT_FOUND (unknown to the C compiler).\")\n"); 00290 #endif 00291 #ifdef TRY_AGAIN 00292 fprintf (out, "(cl:defconstant TRY-AGAIN %d \"Non-Authoritative Host not found, or SERVERFAIL.\")\n", TRY_AGAIN); 00293 #else 00294 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for TRY_AGAIN (unknown to the C compiler).\")\n"); 00295 #endif 00296 #ifdef NO_RECOVERY 00297 fprintf (out, "(cl:defconstant NO-RECOVERY %d \"Non recoverable errors, FORMERR, REFUSED, NOTIMP.\")\n", NO_RECOVERY); 00298 #else 00299 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for NO_RECOVERY (unknown to the C compiler).\")\n"); 00300 #endif 00301 #ifdef NO_DATA 00302 fprintf (out, "(cl:defconstant NO-DATA %d \"Valid name, no data record of requested type.\")\n", NO_DATA); 00303 #else 00304 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for NO_DATA (unknown to the C compiler).\")\n"); 00305 #endif 00306 #ifdef NO_ADDRESS 00307 fprintf (out, "(cl:defconstant NO-ADDRESS %d \"No address, look for MX record.\")\n", NO_ADDRESS); 00308 #else 00309 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for NO_ADDRESS (unknown to the C compiler).\")\n"); 00310 #endif 00311 fprintf (out, "(cl:declaim (cl:inline H-STRERROR))\n"); 00312 fprintf (out, "(sb-grovel::define-foreign-routine (\"hstrerror\" H-STRERROR)\n"); 00313 fprintf (out, " C-STRING\n (ERRNO INT))\n"); 00314 #ifdef O_NONBLOCK 00315 fprintf (out, "(cl:defconstant O-NONBLOCK %d \"NIL\")\n", O_NONBLOCK); 00316 #else 00317 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for O_NONBLOCK (unknown to the C compiler).\")\n"); 00318 #endif 00319 #ifdef F_GETFL 00320 fprintf (out, "(cl:defconstant F-GETFL %d \"NIL\")\n", F_GETFL); 00321 #else 00322 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for F_GETFL (unknown to the C compiler).\")\n"); 00323 #endif 00324 #ifdef F_SETFL 00325 fprintf (out, "(cl:defconstant F-SETFL %d \"NIL\")\n", F_SETFL); 00326 #else 00327 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for F_SETFL (unknown to the C compiler).\")\n"); 00328 #endif 00329 #ifdef MSG_OOB 00330 fprintf (out, "(cl:defconstant MSG-OOB %d \"NIL\")\n", MSG_OOB); 00331 #else 00332 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for MSG_OOB (unknown to the C compiler).\")\n"); 00333 #endif 00334 #ifdef MSG_PEEK 00335 fprintf (out, "(cl:defconstant MSG-PEEK %d \"NIL\")\n", MSG_PEEK); 00336 #else 00337 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for MSG_PEEK (unknown to the C compiler).\")\n"); 00338 #endif 00339 #ifdef MSG_TRUNC 00340 fprintf (out, "(cl:defconstant MSG-TRUNC %d \"NIL\")\n", MSG_TRUNC); 00341 #else 00342 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for MSG_TRUNC (unknown to the C compiler).\")\n"); 00343 #endif 00344 #ifdef MSG_WAITALL 00345 fprintf (out, "(cl:defconstant MSG-WAITALL %d \"NIL\")\n", MSG_WAITALL); 00346 #else 00347 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for MSG_WAITALL (unknown to the C compiler).\")\n"); 00348 #endif 00349 #ifdef MSG_EOR 00350 fprintf (out, "(cl:defconstant MSG-EOR %d \"NIL\")\n", MSG_EOR); 00351 #else 00352 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for MSG_EOR (unknown to the C compiler).\")\n"); 00353 #endif 00354 #ifdef MSG_DONTROUTE 00355 fprintf (out, "(cl:defconstant MSG-DONTROUTE %d \"NIL\")\n", MSG_DONTROUTE); 00356 #else 00357 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for MSG_DONTROUTE (unknown to the C compiler).\")\n"); 00358 #endif 00359 #ifdef MSG_DONTWAIT 00360 fprintf (out, "(cl:defconstant MSG-DONTWAIT %d \"NIL\")\n", MSG_DONTWAIT); 00361 #else 00362 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for MSG_DONTWAIT (unknown to the C compiler).\")\n"); 00363 #endif 00364 #ifdef MSG_NOSIGNAL 00365 fprintf (out, "(cl:defconstant MSG-NOSIGNAL %d \"NIL\")\n", MSG_NOSIGNAL); 00366 #else 00367 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for MSG_NOSIGNAL (unknown to the C compiler).\")\n"); 00368 #endif 00369 #ifdef MSG_CONFIRM 00370 fprintf (out, "(cl:defconstant MSG-CONFIRM %d \"NIL\")\n", MSG_CONFIRM); 00371 #else 00372 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for MSG_CONFIRM (unknown to the C compiler).\")\n"); 00373 #endif 00374 #ifdef MSG_MORE 00375 fprintf (out, "(cl:defconstant MSG-MORE %d \"NIL\")\n", MSG_MORE); 00376 #else 00377 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for MSG_MORE (unknown to the C compiler).\")\n"); 00378 #endif 00379 fprintf (out, "(cl:eval-when (:compile-toplevel :load-toplevel :execute) (sb-alien:define-alien-type SOCKLEN-T (sb-alien:%ssigned %d)))\n", SIGNED_(socklen_t), (8*sizeof(socklen_t))); 00380 fprintf (out, "(cl:eval-when (:compile-toplevel :load-toplevel :execute) (sb-alien:define-alien-type SIZE-T (sb-alien:%ssigned %d)))\n", SIGNED_(size_t), (8*sizeof(size_t))); 00381 fprintf (out, "(cl:eval-when (:compile-toplevel :load-toplevel :execute) (sb-alien:define-alien-type SSIZE-T (sb-alien:%ssigned %d)))\n", SIGNED_(ssize_t), (8*sizeof(ssize_t))); 00382 fprintf (out, "(cl:eval-when (:compile-toplevel :load-toplevel :execute) (sb-grovel::define-c-struct PROTOENT %d\n", sizeof(struct protoent)); 00383 fprintf (out, " (NAME C-STRING-POINTER \"char *\"\n"); 00384 { struct protoent t; 00385 fprintf (out, " %d\n", ((unsigned long)&(t.p_name)) - ((unsigned long)&(t))); 00386 } 00387 { struct protoent t; 00388 fprintf (out, " %d)\n", sizeof(t.p_name)); 00389 } 00390 fprintf (out, " (ALIASES (* (* T)) \"char **\"\n"); 00391 { struct protoent t; 00392 fprintf (out, " %d\n", ((unsigned long)&(t.p_aliases)) - ((unsigned long)&(t))); 00393 } 00394 { struct protoent t; 00395 fprintf (out, " %d)\n", sizeof(t.p_aliases)); 00396 } 00397 fprintf (out, " (PROTO INTEGER \"int\"\n"); 00398 { struct protoent t; 00399 fprintf (out, " %d\n", ((unsigned long)&(t.p_proto)) - ((unsigned long)&(t))); 00400 } 00401 { struct protoent t; 00402 fprintf (out, " %d)\n", sizeof(t.p_proto)); 00403 } 00404 fprintf (out, "))\n"); 00405 fprintf (out, "(cl:declaim (cl:inline GETPROTOBYNAME))\n"); 00406 fprintf (out, "(sb-grovel::define-foreign-routine (\"getprotobyname\" GETPROTOBYNAME)\n"); 00407 fprintf (out, " (* PROTOENT)\n (NAME C-STRING))\n"); 00408 fprintf (out, "(cl:declaim (cl:inline GETPROTOBYNUMBER))\n"); 00409 fprintf (out, "(sb-grovel::define-foreign-routine (\"getprotobynumber\" GETPROTOBYNUMBER)\n"); 00410 fprintf (out, " (* PROTOENT)\n (PROTO INT))\n"); 00411 #ifdef INADDR_ANY 00412 fprintf (out, "(cl:defconstant INADDR-ANY %d \"NIL\")\n", INADDR_ANY); 00413 #else 00414 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for INADDR_ANY (unknown to the C compiler).\")\n"); 00415 #endif 00416 fprintf (out, "(cl:eval-when (:compile-toplevel :load-toplevel :execute) (sb-grovel::define-c-struct IN-ADDR %d\n", sizeof(struct in_addr)); 00417 fprintf (out, " (ADDR (ARRAY (UNSIGNED 8)) \"u_int32_t\"\n"); 00418 { struct in_addr t; 00419 fprintf (out, " %d\n", ((unsigned long)&(t.s_addr)) - ((unsigned long)&(t))); 00420 } 00421 { struct in_addr t; 00422 fprintf (out, " %d)\n", sizeof(t.s_addr)); 00423 } 00424 fprintf (out, "))\n"); 00425 fprintf (out, "(cl:eval-when (:compile-toplevel :load-toplevel :execute) (sb-grovel::define-c-struct SOCKADDR-IN %d\n", sizeof(struct sockaddr_in)); 00426 fprintf (out, " (FAMILY INTEGER \"sa_family_t\"\n"); 00427 { struct sockaddr_in t; 00428 fprintf (out, " %d\n", ((unsigned long)&(t.sin_family)) - ((unsigned long)&(t))); 00429 } 00430 { struct sockaddr_in t; 00431 fprintf (out, " %d)\n", sizeof(t.sin_family)); 00432 } 00433 fprintf (out, " (PORT (ARRAY (UNSIGNED 8)) \"u_int16_t\"\n"); 00434 { struct sockaddr_in t; 00435 fprintf (out, " %d\n", ((unsigned long)&(t.sin_port)) - ((unsigned long)&(t))); 00436 } 00437 { struct sockaddr_in t; 00438 fprintf (out, " %d)\n", sizeof(t.sin_port)); 00439 } 00440 fprintf (out, " (ADDR (ARRAY (UNSIGNED 8)) \"struct in_addr\"\n"); 00441 { struct sockaddr_in t; 00442 fprintf (out, " %d\n", ((unsigned long)&(t.sin_addr)) - ((unsigned long)&(t))); 00443 } 00444 { struct sockaddr_in t; 00445 fprintf (out, " %d)\n", sizeof(t.sin_addr)); 00446 } 00447 fprintf (out, "))\n"); 00448 fprintf (out, "(cl:eval-when (:compile-toplevel :load-toplevel :execute) (sb-grovel::define-c-struct SOCKADDR-UN %d\n", sizeof(struct sockaddr_un)); 00449 fprintf (out, " (FAMILY INTEGER \"sa_family_t\"\n"); 00450 { struct sockaddr_un t; 00451 fprintf (out, " %d\n", ((unsigned long)&(t.sun_family)) - ((unsigned long)&(t))); 00452 } 00453 { struct sockaddr_un t; 00454 fprintf (out, " %d)\n", sizeof(t.sun_family)); 00455 } 00456 fprintf (out, " (PATH C-STRING \"char\"\n"); 00457 { struct sockaddr_un t; 00458 fprintf (out, " %d\n", ((unsigned long)&(t.sun_path)) - ((unsigned long)&(t))); 00459 } 00460 { struct sockaddr_un t; 00461 fprintf (out, " %d)\n", sizeof(t.sun_path)); 00462 } 00463 fprintf (out, "))\n"); 00464 fprintf (out, "(cl:eval-when (:compile-toplevel :load-toplevel :execute) (sb-grovel::define-c-struct SOCKADDR-UN-ABSTRACT %d\n", sizeof(struct sockaddr_un)); 00465 fprintf (out, " (FAMILY INTEGER \"sa_family_t\"\n"); 00466 { struct sockaddr_un t; 00467 fprintf (out, " %d\n", ((unsigned long)&(t.sun_family)) - ((unsigned long)&(t))); 00468 } 00469 { struct sockaddr_un t; 00470 fprintf (out, " %d)\n", sizeof(t.sun_family)); 00471 } 00472 fprintf (out, " (PATH (ARRAY (UNSIGNED 8)) \"char\"\n"); 00473 { struct sockaddr_un t; 00474 fprintf (out, " %d\n", ((unsigned long)&(t.sun_path)) - ((unsigned long)&(t))); 00475 } 00476 { struct sockaddr_un t; 00477 fprintf (out, " %d)\n", sizeof(t.sun_path)); 00478 } 00479 fprintf (out, "))\n"); 00480 fprintf (out, "(cl:eval-when (:compile-toplevel :load-toplevel :execute) (sb-grovel::define-c-struct HOSTENT %d\n", sizeof(struct hostent)); 00481 fprintf (out, " (NAME C-STRING-POINTER \"char *\"\n"); 00482 { struct hostent t; 00483 fprintf (out, " %d\n", ((unsigned long)&(t.h_name)) - ((unsigned long)&(t))); 00484 } 00485 { struct hostent t; 00486 fprintf (out, " %d)\n", sizeof(t.h_name)); 00487 } 00488 fprintf (out, " (ALIASES (* C-STRING) \"char **\"\n"); 00489 { struct hostent t; 00490 fprintf (out, " %d\n", ((unsigned long)&(t.h_aliases)) - ((unsigned long)&(t))); 00491 } 00492 { struct hostent t; 00493 fprintf (out, " %d)\n", sizeof(t.h_aliases)); 00494 } 00495 fprintf (out, " (TYPE INTEGER \"int\"\n"); 00496 { struct hostent t; 00497 fprintf (out, " %d\n", ((unsigned long)&(t.h_addrtype)) - ((unsigned long)&(t))); 00498 } 00499 { struct hostent t; 00500 fprintf (out, " %d)\n", sizeof(t.h_addrtype)); 00501 } 00502 fprintf (out, " (LENGTH INTEGER \"int\"\n"); 00503 { struct hostent t; 00504 fprintf (out, " %d\n", ((unsigned long)&(t.h_length)) - ((unsigned long)&(t))); 00505 } 00506 { struct hostent t; 00507 fprintf (out, " %d)\n", sizeof(t.h_length)); 00508 } 00509 fprintf (out, " (ADDRESSES (* (* (UNSIGNED 8))) \"char **\"\n"); 00510 { struct hostent t; 00511 fprintf (out, " %d\n", ((unsigned long)&(t.h_addr_list)) - ((unsigned long)&(t))); 00512 } 00513 { struct hostent t; 00514 fprintf (out, " %d)\n", sizeof(t.h_addr_list)); 00515 } 00516 fprintf (out, "))\n"); 00517 fprintf (out, "(cl:eval-when (:compile-toplevel :load-toplevel :execute) (sb-grovel::define-c-struct MSGHDR %d\n", sizeof(struct msghdr)); 00518 fprintf (out, " (NAME C-STRING-POINTER \"void *\"\n"); 00519 { struct msghdr t; 00520 fprintf (out, " %d\n", ((unsigned long)&(t.msg_name)) - ((unsigned long)&(t))); 00521 } 00522 { struct msghdr t; 00523 fprintf (out, " %d)\n", sizeof(t.msg_name)); 00524 } 00525 fprintf (out, " (NAMELEN INTEGER \"socklen_t\"\n"); 00526 { struct msghdr t; 00527 fprintf (out, " %d\n", ((unsigned long)&(t.msg_namelen)) - ((unsigned long)&(t))); 00528 } 00529 { struct msghdr t; 00530 fprintf (out, " %d)\n", sizeof(t.msg_namelen)); 00531 } 00532 fprintf (out, " (IOV (* T) \"struct iovec\"\n"); 00533 { struct msghdr t; 00534 fprintf (out, " %d\n", ((unsigned long)&(t.msg_iov)) - ((unsigned long)&(t))); 00535 } 00536 { struct msghdr t; 00537 fprintf (out, " %d)\n", sizeof(t.msg_iov)); 00538 } 00539 fprintf (out, " (IOVLEN INTEGER \"size_t\"\n"); 00540 { struct msghdr t; 00541 fprintf (out, " %d\n", ((unsigned long)&(t.msg_iovlen)) - ((unsigned long)&(t))); 00542 } 00543 { struct msghdr t; 00544 fprintf (out, " %d)\n", sizeof(t.msg_iovlen)); 00545 } 00546 fprintf (out, " (CONTROL (* T) \"void *\"\n"); 00547 { struct msghdr t; 00548 fprintf (out, " %d\n", ((unsigned long)&(t.msg_control)) - ((unsigned long)&(t))); 00549 } 00550 { struct msghdr t; 00551 fprintf (out, " %d)\n", sizeof(t.msg_control)); 00552 } 00553 fprintf (out, " (CONTROLLEN INTEGER \"socklen_t\"\n"); 00554 { struct msghdr t; 00555 fprintf (out, " %d\n", ((unsigned long)&(t.msg_controllen)) - ((unsigned long)&(t))); 00556 } 00557 { struct msghdr t; 00558 fprintf (out, " %d)\n", sizeof(t.msg_controllen)); 00559 } 00560 fprintf (out, " (FLAGS INTEGER \"int\"\n"); 00561 { struct msghdr t; 00562 fprintf (out, " %d\n", ((unsigned long)&(t.msg_flags)) - ((unsigned long)&(t))); 00563 } 00564 { struct msghdr t; 00565 fprintf (out, " %d)\n", sizeof(t.msg_flags)); 00566 } 00567 fprintf (out, "))\n"); 00568 fprintf (out, "(cl:declaim (cl:inline SOCKET))\n"); 00569 fprintf (out, "(sb-grovel::define-foreign-routine (\"socket\" SOCKET)\n"); 00570 fprintf (out, " INT\n (DOMAIN INT)\n (TYPE INT)\n (PROTOCOL INT))\n"); 00571 fprintf (out, "(cl:declaim (cl:inline BIND))\n"); 00572 fprintf (out, "(sb-grovel::define-foreign-routine (\"bind\" BIND)\n"); 00573 fprintf (out, " INT\n (SOCKFD INT)\n (MY-ADDR (* T))\n (ADDRLEN SOCKLEN-T))\n"); 00574 fprintf (out, "(cl:declaim (cl:inline LISTEN))\n"); 00575 fprintf (out, "(sb-grovel::define-foreign-routine (\"listen\" LISTEN)\n"); 00576 fprintf (out, " INT\n (SOCKET INT)\n (BACKLOG INT))\n"); 00577 fprintf (out, "(cl:declaim (cl:inline ACCEPT))\n"); 00578 fprintf (out, "(sb-grovel::define-foreign-routine (\"accept\" ACCEPT)\n"); 00579 fprintf (out, " INT\n (SOCKET INT)\n (MY-ADDR (* T))\n (ADDRLEN SOCKLEN-T :IN-OUT))\n"); 00580 fprintf (out, "(cl:declaim (cl:inline GETPEERNAME))\n"); 00581 fprintf (out, "(sb-grovel::define-foreign-routine (\"getpeername\" GETPEERNAME)\n"); 00582 fprintf (out, " INT\n (SOCKET INT)\n (HER-ADDR (* T))\n (ADDRLEN SOCKLEN-T :IN-OUT))\n"); 00583 fprintf (out, "(cl:declaim (cl:inline GETSOCKNAME))\n"); 00584 fprintf (out, "(sb-grovel::define-foreign-routine (\"getsockname\" GETSOCKNAME)\n"); 00585 fprintf (out, " INT\n (SOCKET INT)\n (MY-ADDR (* T))\n (ADDRLEN SOCKLEN-T :IN-OUT))\n"); 00586 fprintf (out, "(cl:declaim (cl:inline CONNECT))\n"); 00587 fprintf (out, "(sb-grovel::define-foreign-routine (\"connect\" CONNECT)\n"); 00588 fprintf (out, " INT\n (SOCKET INT)\n (HIS-ADDR (* T))\n (ADDRLEN SOCKLEN-T))\n"); 00589 fprintf (out, "(cl:declaim (cl:inline CLOSE))\n"); 00590 fprintf (out, "(sb-grovel::define-foreign-routine (\"close\" CLOSE)\n"); 00591 fprintf (out, " INT\n (FD INT))\n"); 00592 fprintf (out, "(cl:declaim (cl:inline RECVFROM))\n"); 00593 fprintf (out, "(sb-grovel::define-foreign-routine (\"recvfrom\" RECVFROM)\n"); 00594 fprintf (out, " SSIZE-T\n (SOCKET INT)\n (BUF (* T))\n (LEN INTEGER)\n (FLAGS INT)\n (SOCKADDR (* T))\n (SOCKLEN (* SOCKLEN-T)))\n"); 00595 fprintf (out, "(cl:declaim (cl:inline RECVMSG))\n"); 00596 fprintf (out, "(sb-grovel::define-foreign-routine (\"recvmsg\" RECVMSG)\n"); 00597 fprintf (out, " SSIZE-T\n (SOCKET INT)\n (MSG (* MSGHDR))\n (FLAGS INT))\n"); 00598 fprintf (out, "(cl:declaim (cl:inline SEND))\n"); 00599 fprintf (out, "(sb-grovel::define-foreign-routine (\"send\" SEND)\n"); 00600 fprintf (out, " SSIZE-T\n (SOCKET INT)\n (BUF (* T))\n (LEN SIZE-T)\n (FLAGS INT))\n"); 00601 fprintf (out, "(cl:declaim (cl:inline SENDTO))\n"); 00602 fprintf (out, "(sb-grovel::define-foreign-routine (\"sendto\" SENDTO)\n"); 00603 fprintf (out, " INT\n (SOCKET INT)\n (BUF (* T))\n (LEN SIZE-T)\n (FLAGS INT)\n (SOCKADDR (* T))\n (SOCKLEN SOCKLEN-T))\n"); 00604 fprintf (out, "(cl:declaim (cl:inline SENDMSG))\n"); 00605 fprintf (out, "(sb-grovel::define-foreign-routine (\"sendmsg\" SENDMSG)\n"); 00606 fprintf (out, " INT\n (SOCKET INT)\n (MSG (* MSGHDR))\n (FLAGS INT))\n"); 00607 fprintf (out, "(cl:declaim (cl:inline GETHOSTBYNAME))\n"); 00608 fprintf (out, "(sb-grovel::define-foreign-routine (\"gethostbyname\" GETHOSTBYNAME)\n"); 00609 fprintf (out, " (* HOSTENT)\n (NAME C-STRING))\n"); 00610 fprintf (out, "(cl:declaim (cl:inline GETHOSTBYADDR))\n"); 00611 fprintf (out, "(sb-grovel::define-foreign-routine (\"gethostbyaddr\" GETHOSTBYADDR)\n"); 00612 fprintf (out, " (* HOSTENT)\n (ADDR (* T))\n (LEN INT)\n (AF INT))\n"); 00613 fprintf (out, "(cl:declaim (cl:inline GETHOSTBYNAME-R))\n"); 00614 fprintf (out, "(sb-grovel::define-foreign-routine (\"gethostbyname_r\" GETHOSTBYNAME-R)\n"); 00615 fprintf (out, " INT\n (NAME C-STRING)\n (RET (* HOSTENT))\n (BUF (* CHAR))\n (BUFLEN LONG)\n (RESULT (* (* HOSTENT)))\n (H-ERRNOP (* INT)))\n"); 00616 fprintf (out, "(cl:eval-when (:compile-toplevel :load-toplevel :execute) (sb-grovel::define-c-struct ADDRINFO %d\n", sizeof(struct addrinfo)); 00617 fprintf (out, " (FLAGS INTEGER \"int\"\n"); 00618 { struct addrinfo t; 00619 fprintf (out, " %d\n", ((unsigned long)&(t.ai_flags)) - ((unsigned long)&(t))); 00620 } 00621 { struct addrinfo t; 00622 fprintf (out, " %d)\n", sizeof(t.ai_flags)); 00623 } 00624 fprintf (out, " (FAMILY INTEGER \"int\"\n"); 00625 { struct addrinfo t; 00626 fprintf (out, " %d\n", ((unsigned long)&(t.ai_family)) - ((unsigned long)&(t))); 00627 } 00628 { struct addrinfo t; 00629 fprintf (out, " %d)\n", sizeof(t.ai_family)); 00630 } 00631 fprintf (out, " (SOCKTYPE INTEGER \"int\"\n"); 00632 { struct addrinfo t; 00633 fprintf (out, " %d\n", ((unsigned long)&(t.ai_socktype)) - ((unsigned long)&(t))); 00634 } 00635 { struct addrinfo t; 00636 fprintf (out, " %d)\n", sizeof(t.ai_socktype)); 00637 } 00638 fprintf (out, " (PROTOCOL INTEGER \"int\"\n"); 00639 { struct addrinfo t; 00640 fprintf (out, " %d\n", ((unsigned long)&(t.ai_protocol)) - ((unsigned long)&(t))); 00641 } 00642 { struct addrinfo t; 00643 fprintf (out, " %d)\n", sizeof(t.ai_protocol)); 00644 } 00645 fprintf (out, " (ADDRLEN INTEGER \"size_t\"\n"); 00646 { struct addrinfo t; 00647 fprintf (out, " %d\n", ((unsigned long)&(t.ai_addrlen)) - ((unsigned long)&(t))); 00648 } 00649 { struct addrinfo t; 00650 fprintf (out, " %d)\n", sizeof(t.ai_addrlen)); 00651 } 00652 fprintf (out, " (ADDR (* SOCKADDR-IN) \"struct sockaddr*\"\n"); 00653 { struct addrinfo t; 00654 fprintf (out, " %d\n", ((unsigned long)&(t.ai_addr)) - ((unsigned long)&(t))); 00655 } 00656 { struct addrinfo t; 00657 fprintf (out, " %d)\n", sizeof(t.ai_addr)); 00658 } 00659 fprintf (out, " (CANONNAME C-STRING \"char *\"\n"); 00660 { struct addrinfo t; 00661 fprintf (out, " %d\n", ((unsigned long)&(t.ai_canonname)) - ((unsigned long)&(t))); 00662 } 00663 { struct addrinfo t; 00664 fprintf (out, " %d)\n", sizeof(t.ai_canonname)); 00665 } 00666 fprintf (out, " (NEXT (* T) \"struct addrinfo*\"\n"); 00667 { struct addrinfo t; 00668 fprintf (out, " %d\n", ((unsigned long)&(t.ai_next)) - ((unsigned long)&(t))); 00669 } 00670 { struct addrinfo t; 00671 fprintf (out, " %d)\n", sizeof(t.ai_next)); 00672 } 00673 fprintf (out, "))\n"); 00674 fprintf (out, "(cl:declaim (cl:inline GETADDRINFO))\n"); 00675 fprintf (out, "(sb-grovel::define-foreign-routine (\"getaddrinfo\" GETADDRINFO)\n"); 00676 fprintf (out, " INT\n (NODE C-STRING)\n (SERVICE C-STRING)\n (HINTS (* ADDRINFO))\n (RES (* (* ADDRINFO))))\n"); 00677 fprintf (out, "(cl:declaim (cl:inline FREEADDRINFO))\n"); 00678 fprintf (out, "(sb-grovel::define-foreign-routine (\"freeaddrinfo\" FREEADDRINFO)\n"); 00679 fprintf (out, " VOID\n (RES (* ADDRINFO)))\n"); 00680 fprintf (out, "(cl:declaim (cl:inline GAI-STRERROR))\n"); 00681 fprintf (out, "(sb-grovel::define-foreign-routine (\"gai_strerror\" GAI-STRERROR)\n"); 00682 fprintf (out, " C-STRING\n (ERROR-CODE INT))\n"); 00683 fprintf (out, "(cl:declaim (cl:inline GETNAMEINFO))\n"); 00684 fprintf (out, "(sb-grovel::define-foreign-routine (\"getnameinfo\" GETNAMEINFO)\n"); 00685 fprintf (out, " INT\n (ADDRESS (* SOCKADDR-IN))\n (ADDRESS-LENGTH SIZE-T)\n (HOST (* CHAR))\n (HOST-LEN SIZE-T)\n (SERVICE (* CHAR))\n (SERVICE-LEN SIZE-T)\n (FLAGS INT))\n"); 00686 #ifdef EAI_FAMILY 00687 fprintf (out, "(cl:defconstant EAI-FAMILY %d \"NIL\")\n", EAI_FAMILY); 00688 #else 00689 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for EAI_FAMILY (unknown to the C compiler).\")\n"); 00690 #endif 00691 #ifdef EAI_SOCKTYPE 00692 fprintf (out, "(cl:defconstant EAI-SOCKTYPE %d \"NIL\")\n", EAI_SOCKTYPE); 00693 #else 00694 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for EAI_SOCKTYPE (unknown to the C compiler).\")\n"); 00695 #endif 00696 #ifdef EAI_BADFLAGS 00697 fprintf (out, "(cl:defconstant EAI-BADFLAGS %d \"NIL\")\n", EAI_BADFLAGS); 00698 #else 00699 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for EAI_BADFLAGS (unknown to the C compiler).\")\n"); 00700 #endif 00701 #ifdef EAI_NONAME 00702 fprintf (out, "(cl:defconstant EAI-NONAME %d \"NIL\")\n", EAI_NONAME); 00703 #else 00704 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for EAI_NONAME (unknown to the C compiler).\")\n"); 00705 #endif 00706 #ifdef EAI_SERVICE 00707 fprintf (out, "(cl:defconstant EAI-SERVICE %d \"NIL\")\n", EAI_SERVICE); 00708 #else 00709 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for EAI_SERVICE (unknown to the C compiler).\")\n"); 00710 #endif 00711 #ifdef EAI_ADDRFAMILY 00712 fprintf (out, "(cl:defconstant EAI-ADDRFAMILY %d \"NIL\")\n", EAI_ADDRFAMILY); 00713 #else 00714 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for EAI_ADDRFAMILY (unknown to the C compiler).\")\n"); 00715 #endif 00716 #ifdef EAI_MEMORY 00717 fprintf (out, "(cl:defconstant EAI-MEMORY %d \"NIL\")\n", EAI_MEMORY); 00718 #else 00719 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for EAI_MEMORY (unknown to the C compiler).\")\n"); 00720 #endif 00721 #ifdef EAI_FAIL 00722 fprintf (out, "(cl:defconstant EAI-FAIL %d \"NIL\")\n", EAI_FAIL); 00723 #else 00724 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for EAI_FAIL (unknown to the C compiler).\")\n"); 00725 #endif 00726 #ifdef EAI_AGAIN 00727 fprintf (out, "(cl:defconstant EAI-AGAIN %d \"NIL\")\n", EAI_AGAIN); 00728 #else 00729 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for EAI_AGAIN (unknown to the C compiler).\")\n"); 00730 #endif 00731 #ifdef EAI_SYSTEM 00732 fprintf (out, "(cl:defconstant EAI-SYSTEM %d \"NIL\")\n", EAI_SYSTEM); 00733 #else 00734 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for EAI_SYSTEM (unknown to the C compiler).\")\n"); 00735 #endif 00736 #ifdef NI_NAMEREQD 00737 fprintf (out, "(cl:defconstant NI-NAMEREQD %d \"NIL\")\n", NI_NAMEREQD); 00738 #else 00739 fprintf (out, "(sb-int:style-warn \"Couldn't grovel for NI_NAMEREQD (unknown to the C compiler).\")\n"); 00740 #endif 00741 fprintf (out, "(cl:declaim (cl:inline SETSOCKOPT))\n"); 00742 fprintf (out, "(sb-grovel::define-foreign-routine (\"setsockopt\" SETSOCKOPT)\n"); 00743 fprintf (out, " INT\n (SOCKET INT)\n (LEVEL INT)\n (OPTNAME INT)\n (OPTVAL (* T))\n (OPTLEN INT))\n"); 00744 fprintf (out, "(cl:declaim (cl:inline FCNTL))\n"); 00745 fprintf (out, "(sb-grovel::define-foreign-routine (\"fcntl\" FCNTL)\n"); 00746 fprintf (out, " INT\n (FD INT)\n (CMD INT)\n (ARG LONG))\n"); 00747 fprintf (out, "(cl:declaim (cl:inline GETSOCKOPT))\n"); 00748 fprintf (out, "(sb-grovel::define-foreign-routine (\"getsockopt\" GETSOCKOPT)\n"); 00749 fprintf (out, " INT\n (SOCKET INT)\n (LEVEL INT)\n (OPTNAME INT)\n (OPTVAL (* T))\n (OPTLEN (* INT)))\n"); 00750 return 0; 00751 }