#define SIGNEDP(x) (((x)-1)<0)
#define SIGNED_(x) (SIGNEDP(x)?"":"un")
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/un.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <net/if.h>
#include <netdb.h>
#include <errno.h>
#include <netinet/tcp.h>
#include <fcntl.h>
main() { 

printf("(in-package :SOCKINT)\n");
printf("(cl:deftype int () '(%ssigned-byte %d))\n",SIGNED_(int),8*sizeof (int));
printf("(cl:deftype char () '(%ssigned-byte %d))\n",SIGNED_(char),8*sizeof (char));
printf("(cl:deftype long () '(%ssigned-byte %d))\n",SIGNED_(long),8*sizeof (long));
printf("(cl:defconstant size-of-int %d)\n",sizeof (int));
printf("(cl:defconstant size-of-char %d)\n",sizeof (char));
printf("(cl:defconstant size-of-long %d)\n",sizeof (long));
#ifdef AF_INET
printf("(cl:defconstant AF-INET %d \"IP Protocol family\")\n",AF_INET);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for AF_INET (unknown to the C compiler).\")\n");
#endif
#ifdef AF_UNSPEC
printf("(cl:defconstant AF-UNSPEC %d \"Unspecified\")\n",AF_UNSPEC);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for AF_UNSPEC (unknown to the C compiler).\")\n");
#endif
#ifdef AF_LOCAL
printf("(cl:defconstant AF-LOCAL %d \"Local to host (pipes and file-domain).\")\n",AF_LOCAL);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for AF_LOCAL (unknown to the C compiler).\")\n");
#endif
#ifdef SOCK_STREAM
printf("(cl:defconstant SOCK-STREAM %d \"Sequenced, reliable, connection-based byte streams.\")\n",SOCK_STREAM);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for SOCK_STREAM (unknown to the C compiler).\")\n");
#endif
#ifdef SOCK_DGRAM
printf("(cl:defconstant SOCK-DGRAM %d \"Connectionless, unreliable datagrams of fixed maximum length.\")\n",SOCK_DGRAM);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for SOCK_DGRAM (unknown to the C compiler).\")\n");
#endif
#ifdef SOCK_RAW
printf("(cl:defconstant SOCK-RAW %d \"Raw protocol interface.\")\n",SOCK_RAW);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for SOCK_RAW (unknown to the C compiler).\")\n");
#endif
#ifdef SOCK_RDM
printf("(cl:defconstant SOCK-RDM %d \"Reliably-delivered messages.\")\n",SOCK_RDM);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for SOCK_RDM (unknown to the C compiler).\")\n");
#endif
#ifdef SOCK_SEQPACKET
printf("(cl:defconstant SOCK-SEQPACKET %d \"Sequenced, reliable, connection-based, datagrams of fixed maximum length.\")\n",SOCK_SEQPACKET);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for SOCK_SEQPACKET (unknown to the C compiler).\")\n");
#endif
#ifdef SOL_SOCKET
printf("(cl:defconstant SOL-SOCKET %d \"NIL\")\n",SOL_SOCKET);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for SOL_SOCKET (unknown to the C compiler).\")\n");
#endif
#ifdef SO_DEBUG
printf("(cl:defconstant SO-DEBUG %d \"Enable debugging in underlying protocol modules\")\n",SO_DEBUG);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for SO_DEBUG (unknown to the C compiler).\")\n");
#endif
#ifdef SO_REUSEADDR
printf("(cl:defconstant SO-REUSEADDR %d \"Enable local address reuse\")\n",SO_REUSEADDR);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for SO_REUSEADDR (unknown to the C compiler).\")\n");
#endif
#ifdef SO_TYPE
printf("(cl:defconstant SO-TYPE %d \"NIL\")\n",SO_TYPE);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for SO_TYPE (unknown to the C compiler).\")\n");
#endif
#ifdef SO_ERROR
printf("(cl:defconstant SO-ERROR %d \"NIL\")\n",SO_ERROR);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for SO_ERROR (unknown to the C compiler).\")\n");
#endif
#ifdef SO_DONTROUTE
printf("(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);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for SO_DONTROUTE (unknown to the C compiler).\")\n");
#endif
#ifdef SO_BROADCAST
printf("(cl:defconstant SO-BROADCAST %d \"Request permission to send broadcast datagrams\")\n",SO_BROADCAST);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for SO_BROADCAST (unknown to the C compiler).\")\n");
#endif
#ifdef SO_SNDBUF
printf("(cl:defconstant SO-SNDBUF %d \"NIL\")\n",SO_SNDBUF);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for SO_SNDBUF (unknown to the C compiler).\")\n");
#endif
#ifdef SO_RCVBUF
printf("(cl:defconstant SO-RCVBUF %d \"NIL\")\n",SO_RCVBUF);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for SO_RCVBUF (unknown to the C compiler).\")\n");
#endif
#ifdef SO_KEEPALIVE
printf("(cl:defconstant SO-KEEPALIVE %d \"Send periodic keepalives: if peer does not respond, we get SIGPIPE\")\n",SO_KEEPALIVE);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for SO_KEEPALIVE (unknown to the C compiler).\")\n");
#endif
#ifdef SO_OOBINLINE
printf("(cl:defconstant SO-OOBINLINE %d \"Put out-of-band data into the normal input queue when received\")\n",SO_OOBINLINE);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for SO_OOBINLINE (unknown to the C compiler).\")\n");
#endif
#ifdef SO_NO_CHECK
printf("(cl:defconstant SO-NO-CHECK %d \"NIL\")\n",SO_NO_CHECK);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for SO_NO_CHECK (unknown to the C compiler).\")\n");
#endif
#ifdef SO_LINGER
printf("(cl:defconstant SO-LINGER %d \"For reliable streams, pause a while on closing when unsent messages are queued\")\n",SO_LINGER);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for SO_LINGER (unknown to the C compiler).\")\n");
#endif
#ifdef SO_SNDLOWAT
printf("(cl:defconstant SO-SNDLOWAT %d \"NIL\")\n",SO_SNDLOWAT);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for SO_SNDLOWAT (unknown to the C compiler).\")\n");
#endif
#ifdef SO_RCVLOWAT
printf("(cl:defconstant SO-RCVLOWAT %d \"NIL\")\n",SO_RCVLOWAT);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for SO_RCVLOWAT (unknown to the C compiler).\")\n");
#endif
#ifdef SO_SNDTIMEO
printf("(cl:defconstant SO-SNDTIMEO %d \"NIL\")\n",SO_SNDTIMEO);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for SO_SNDTIMEO (unknown to the C compiler).\")\n");
#endif
#ifdef SO_RCVTIMEO
printf("(cl:defconstant SO-RCVTIMEO %d \"NIL\")\n",SO_RCVTIMEO);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for SO_RCVTIMEO (unknown to the C compiler).\")\n");
#endif
#ifdef TCP_NODELAY
printf("(cl:defconstant TCP-NODELAY %d \"NIL\")\n",TCP_NODELAY);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for TCP_NODELAY (unknown to the C compiler).\")\n");
#endif
#ifdef IFNAMSIZ
printf("(cl:defconstant IFNAMSIZ %d \"NIL\")\n",IFNAMSIZ);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for IFNAMSIZ (unknown to the C compiler).\")\n");
#endif
#ifdef EADDRINUSE
printf("(cl:defconstant EADDRINUSE %d \"NIL\")\n",EADDRINUSE);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for EADDRINUSE (unknown to the C compiler).\")\n");
#endif
#ifdef EAGAIN
printf("(cl:defconstant EAGAIN %d \"NIL\")\n",EAGAIN);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for EAGAIN (unknown to the C compiler).\")\n");
#endif
#ifdef EBADF
printf("(cl:defconstant EBADF %d \"NIL\")\n",EBADF);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for EBADF (unknown to the C compiler).\")\n");
#endif
#ifdef ECONNREFUSED
printf("(cl:defconstant ECONNREFUSED %d \"NIL\")\n",ECONNREFUSED);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for ECONNREFUSED (unknown to the C compiler).\")\n");
#endif
#ifdef EINTR
printf("(cl:defconstant EINTR %d \"NIL\")\n",EINTR);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for EINTR (unknown to the C compiler).\")\n");
#endif
#ifdef EINVAL
printf("(cl:defconstant EINVAL %d \"NIL\")\n",EINVAL);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for EINVAL (unknown to the C compiler).\")\n");
#endif
#ifdef ENOBUFS
printf("(cl:defconstant ENOBUFS %d \"NIL\")\n",ENOBUFS);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for ENOBUFS (unknown to the C compiler).\")\n");
#endif
#ifdef ENOMEM
printf("(cl:defconstant ENOMEM %d \"NIL\")\n",ENOMEM);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for ENOMEM (unknown to the C compiler).\")\n");
#endif
#ifdef EOPNOTSUPP
printf("(cl:defconstant EOPNOTSUPP %d \"NIL\")\n",EOPNOTSUPP);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for EOPNOTSUPP (unknown to the C compiler).\")\n");
#endif
#ifdef EPERM
printf("(cl:defconstant EPERM %d \"NIL\")\n",EPERM);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for EPERM (unknown to the C compiler).\")\n");
#endif
#ifdef EPROTONOSUPPORT
printf("(cl:defconstant EPROTONOSUPPORT %d \"NIL\")\n",EPROTONOSUPPORT);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for EPROTONOSUPPORT (unknown to the C compiler).\")\n");
#endif
#ifdef ESOCKTNOSUPPORT
printf("(cl:defconstant ESOCKTNOSUPPORT %d \"NIL\")\n",ESOCKTNOSUPPORT);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for ESOCKTNOSUPPORT (unknown to the C compiler).\")\n");
#endif
#ifdef ENETUNREACH
printf("(cl:defconstant ENETUNREACH %d \"NIL\")\n",ENETUNREACH);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for ENETUNREACH (unknown to the C compiler).\")\n");
#endif
#ifdef NETDB_INTERNAL
printf("(cl:defconstant NETDB-INTERNAL %d \"See errno.\")\n",NETDB_INTERNAL);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for NETDB_INTERNAL (unknown to the C compiler).\")\n");
#endif
#ifdef NETDB_SUCCESS
printf("(cl:defconstant NETDB-SUCCESS %d \"No problem.\")\n",NETDB_SUCCESS);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for NETDB_SUCCESS (unknown to the C compiler).\")\n");
#endif
#ifdef HOST_NOT_FOUND
printf("(cl:defconstant HOST-NOT-FOUND %d \"Authoritative Answer Host not found.\")\n",HOST_NOT_FOUND);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for HOST_NOT_FOUND (unknown to the C compiler).\")\n");
#endif
#ifdef TRY_AGAIN
printf("(cl:defconstant TRY-AGAIN %d \"Non-Authoritative Host not found, or SERVERFAIL.\")\n",TRY_AGAIN);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for TRY_AGAIN (unknown to the C compiler).\")\n");
#endif
#ifdef NO_RECOVERY
printf("(cl:defconstant NO-RECOVERY %d \"Non recoverable errors, FORMERR, REFUSED, NOTIMP.\")\n",NO_RECOVERY);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for NO_RECOVERY (unknown to the C compiler).\")\n");
#endif
#ifdef NO_DATA
printf("(cl:defconstant NO-DATA %d \"Valid name, no data record of requested type.\")\n",NO_DATA);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for NO_DATA (unknown to the C compiler).\")\n");
#endif
#ifdef NO_ADDRESS
printf("(cl:defconstant NO-ADDRESS %d \"No address, look for MX record.\")\n",NO_ADDRESS);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for NO_ADDRESS (unknown to the C compiler).\")\n");
#endif
#ifdef O_NONBLOCK
printf("(cl:defconstant O-NONBLOCK %d \"NIL\")\n",O_NONBLOCK);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for O_NONBLOCK (unknown to the C compiler).\")\n");
#endif
#ifdef F_GETFL
printf("(cl:defconstant F-GETFL %d \"NIL\")\n",F_GETFL);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for F_GETFL (unknown to the C compiler).\")\n");
#endif
#ifdef F_SETFL
printf("(cl:defconstant F-SETFL %d \"NIL\")\n",F_SETFL);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for F_SETFL (unknown to the C compiler).\")\n");
#endif
#ifdef MSG_OOB
printf("(cl:defconstant MSG-OOB %d \"NIL\")\n",MSG_OOB);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for MSG_OOB (unknown to the C compiler).\")\n");
#endif
#ifdef MSG_PEEK
printf("(cl:defconstant MSG-PEEK %d \"NIL\")\n",MSG_PEEK);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for MSG_PEEK (unknown to the C compiler).\")\n");
#endif
#ifdef MSG_TRUNC
printf("(cl:defconstant MSG-TRUNC %d \"NIL\")\n",MSG_TRUNC);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for MSG_TRUNC (unknown to the C compiler).\")\n");
#endif
#ifdef MSG_WAITALL
printf("(cl:defconstant MSG-WAITALL %d \"NIL\")\n",MSG_WAITALL);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for MSG_WAITALL (unknown to the C compiler).\")\n");
#endif
printf("(sb-grovel::define-c-struct PROTOENT %d)\n",sizeof (struct protoent));
printf("(sb-grovel::define-c-accessor PROTOENT-NAME\n\
  PROTOENT (* T) ");
{ struct protoent t;printf("%d ",((unsigned long)&(t.p_name)) - ((unsigned long)&(t)) ); }
{ struct protoent t;printf("%d",(sizeof t.p_name));}
printf(")\n");
printf("(sb-grovel::define-c-accessor PROTOENT-ALIASES\n\
  PROTOENT (* (* T)) ");
{ struct protoent t;printf("%d ",((unsigned long)&(t.p_aliases)) - ((unsigned long)&(t)) ); }
{ struct protoent t;printf("%d",(sizeof t.p_aliases));}
printf(")\n");
printf("(sb-grovel::define-c-accessor PROTOENT-PROTO\n\
  PROTOENT INTEGER ");
{ struct protoent t;printf("%d ",((unsigned long)&(t.p_proto)) - ((unsigned long)&(t)) ); }
{ struct protoent t;printf("%d",(sizeof t.p_proto));}
printf(")\n");
printf("(cl:declaim (cl:inline GETPROTOBYNAME))\n");
printf("(sb-grovel::define-foreign-routine (\"getprotobyname\" GETPROTOBYNAME)\n\
  (* T)\n\
  (NAME C-STRING))\n");
#ifdef INADDR_ANY
printf("(cl:defconstant INADDR-ANY %d \"NIL\")\n",INADDR_ANY);
#else
printf("(sb-int:style-warn \"Couln't grovel definition for INADDR_ANY (unknown to the C compiler).\")\n");
#endif
printf("(sb-grovel::define-c-struct IN-ADDR %d)\n",sizeof (struct in_addr));
printf("(sb-grovel::define-c-accessor IN-ADDR-ADDR\n\
  IN-ADDR (ARRAY (UNSIGNED 8) 4) ");
{ struct in_addr t;printf("%d ",((unsigned long)&(t.s_addr)) - ((unsigned long)&(t)) ); }
{ struct in_addr t;printf("%d",(sizeof t.s_addr));}
printf(")\n");
printf("(sb-grovel::define-c-struct SOCKADDR-IN %d)\n",sizeof (struct sockaddr_in));
printf("(sb-grovel::define-c-accessor SOCKADDR-IN-FAMILY\n\
  SOCKADDR-IN INTEGER ");
{ struct sockaddr_in t;printf("%d ",((unsigned long)&(t.sin_family)) - ((unsigned long)&(t)) ); }
{ struct sockaddr_in t;printf("%d",(sizeof t.sin_family));}
printf(")\n");
printf("(sb-grovel::define-c-accessor SOCKADDR-IN-PORT\n\
  SOCKADDR-IN (ARRAY (UNSIGNED 8) 2) ");
{ struct sockaddr_in t;printf("%d ",((unsigned long)&(t.sin_port)) - ((unsigned long)&(t)) ); }
{ struct sockaddr_in t;printf("%d",(sizeof t.sin_port));}
printf(")\n");
printf("(sb-grovel::define-c-accessor SOCKADDR-IN-ADDR\n\
  SOCKADDR-IN (ARRAY (UNSIGNED 8) 4) ");
{ struct sockaddr_in t;printf("%d ",((unsigned long)&(t.sin_addr)) - ((unsigned long)&(t)) ); }
{ struct sockaddr_in t;printf("%d",(sizeof t.sin_addr));}
printf(")\n");
printf("(sb-grovel::define-c-struct SOCKADDR-UN %d)\n",sizeof (struct sockaddr_un));
printf("(sb-grovel::define-c-accessor SOCKADDR-UN-FAMILY\n\
  SOCKADDR-UN INTEGER ");
{ struct sockaddr_un t;printf("%d ",((unsigned long)&(t.sun_family)) - ((unsigned long)&(t)) ); }
{ struct sockaddr_un t;printf("%d",(sizeof t.sun_family));}
printf(")\n");
printf("(sb-grovel::define-c-accessor SOCKADDR-UN-PATH\n\
  SOCKADDR-UN (ARRAY (UNSIGNED 8) 108) ");
{ struct sockaddr_un t;printf("%d ",((unsigned long)&(t.sun_path)) - ((unsigned long)&(t)) ); }
{ struct sockaddr_un t;printf("%d",(sizeof t.sun_path));}
printf(")\n");
printf("(sb-grovel::define-c-struct HOSTENT %d)\n",sizeof (struct hostent));
printf("(sb-grovel::define-c-accessor HOSTENT-NAME\n\
  HOSTENT (* T) ");
{ struct hostent t;printf("%d ",((unsigned long)&(t.h_name)) - ((unsigned long)&(t)) ); }
{ struct hostent t;printf("%d",(sizeof t.h_name));}
printf(")\n");
printf("(sb-grovel::define-c-accessor HOSTENT-ALIASES\n\
  HOSTENT (* C-STRING) ");
{ struct hostent t;printf("%d ",((unsigned long)&(t.h_aliases)) - ((unsigned long)&(t)) ); }
{ struct hostent t;printf("%d",(sizeof t.h_aliases));}
printf(")\n");
printf("(sb-grovel::define-c-accessor HOSTENT-TYPE\n\
  HOSTENT INTEGER ");
{ struct hostent t;printf("%d ",((unsigned long)&(t.h_addrtype)) - ((unsigned long)&(t)) ); }
{ struct hostent t;printf("%d",(sizeof t.h_addrtype));}
printf(")\n");
printf("(sb-grovel::define-c-accessor HOSTENT-LENGTH\n\
  HOSTENT INTEGER ");
{ struct hostent t;printf("%d ",((unsigned long)&(t.h_length)) - ((unsigned long)&(t)) ); }
{ struct hostent t;printf("%d",(sizeof t.h_length));}
printf(")\n");
printf("(sb-grovel::define-c-accessor HOSTENT-ADDRESSES\n\
  HOSTENT (* (* (UNSIGNED 8))) ");
{ struct hostent t;printf("%d ",((unsigned long)&(t.h_addr_list)) - ((unsigned long)&(t)) ); }
{ struct hostent t;printf("%d",(sizeof t.h_addr_list));}
printf(")\n");
printf("(cl:declaim (cl:inline SOCKET))\n");
printf("(sb-grovel::define-foreign-routine (\"socket\" SOCKET)\n\
  INTEGER\n\
  (DOMAIN INTEGER)\n\
  (TYPE INTEGER)\n\
  (PROTOCOL INTEGER))\n");
printf("(cl:declaim (cl:inline BIND))\n");
printf("(sb-grovel::define-foreign-routine (\"bind\" BIND)\n\
  INTEGER\n\
  (SOCKFD INTEGER)\n\
  (MY-ADDR (* T))\n\
  (ADDRLEN INTEGER))\n");
printf("(cl:declaim (cl:inline LISTEN))\n");
printf("(sb-grovel::define-foreign-routine (\"listen\" LISTEN)\n\
  INTEGER\n\
  (SOCKET INTEGER)\n\
  (BACKLOG INTEGER))\n");
printf("(cl:declaim (cl:inline ACCEPT))\n");
printf("(sb-grovel::define-foreign-routine (\"accept\" ACCEPT)\n\
  INTEGER\n\
  (SOCKET INTEGER)\n\
  (MY-ADDR (* T))\n\
  (ADDRLEN INTEGER :IN-OUT))\n");
printf("(cl:declaim (cl:inline GETPEERNAME))\n");
printf("(sb-grovel::define-foreign-routine (\"getpeername\" GETPEERNAME)\n\
  INTEGER\n\
  (SOCKET INTEGER)\n\
  (HER-ADDR (* T))\n\
  (ADDRLEN INTEGER :IN-OUT))\n");
printf("(cl:declaim (cl:inline GETSOCKNAME))\n");
printf("(sb-grovel::define-foreign-routine (\"getsockname\" GETSOCKNAME)\n\
  INTEGER\n\
  (SOCKET INTEGER)\n\
  (MY-ADDR (* T))\n\
  (ADDRLEN INTEGER :IN-OUT))\n");
printf("(cl:declaim (cl:inline CONNECT))\n");
printf("(sb-grovel::define-foreign-routine (\"connect\" CONNECT)\n\
  INTEGER\n\
  (SOCKET INTEGER)\n\
  (HIS-ADDR (* T))\n\
  (ADDRLEN INTEGER))\n");
printf("(cl:declaim (cl:inline CLOSE))\n");
printf("(sb-grovel::define-foreign-routine (\"close\" CLOSE)\n\
  INTEGER\n\
  (FD INTEGER))\n");
printf("(cl:declaim (cl:inline RECVFROM))\n");
printf("(sb-grovel::define-foreign-routine (\"recvfrom\" RECVFROM)\n\
  INTEGER\n\
  (SOCKET INTEGER)\n\
  (BUF (* T))\n\
  (LEN INTEGER)\n\
  (FLAGS INTEGER)\n\
  (SOCKADDR (* T))\n\
  (SOCKLEN (* INTEGER)))\n");
printf("(cl:declaim (cl:inline GETHOSTBYNAME))\n");
printf("(sb-grovel::define-foreign-routine (\"gethostbyname\" GETHOSTBYNAME)\n\
  (* T)\n\
  (NAME C-STRING))\n");
printf("(cl:declaim (cl:inline GETHOSTBYADDR))\n");
printf("(sb-grovel::define-foreign-routine (\"gethostbyaddr\" GETHOSTBYADDR)\n\
  (* T)\n\
  (ADDR (* T))\n\
  (LEN INTEGER)\n\
  (AF INTEGER))\n");
printf("(cl:declaim (cl:inline SETSOCKOPT))\n");
printf("(sb-grovel::define-foreign-routine (\"setsockopt\" SETSOCKOPT)\n\
  INTEGER\n\
  (SOCKET INTEGER)\n\
  (LEVEL INTEGER)\n\
  (OPTNAME INTEGER)\n\
  (OPTVAL (* T))\n\
  (OPTLEN INTEGER))\n");
printf("(cl:declaim (cl:inline FCNTL))\n");
printf("(sb-grovel::define-foreign-routine (\"fcntl\" FCNTL)\n\
  INTEGER\n\
  (FD INTEGER)\n\
  (CMD INTEGER)\n\
  (ARG INTEGER))\n");
printf("(cl:declaim (cl:inline GETSOCKOPT))\n");
printf("(sb-grovel::define-foreign-routine (\"getsockopt\" GETSOCKOPT)\n\
  INTEGER\n\
  (SOCKET INTEGER)\n\
  (LEVEL INTEGER)\n\
  (OPTNAME INTEGER)\n\
  (OPTVAL (* T))\n\
  (OPTLEN INTEGER :IN-OUT))\n");
exit(0);
}
