3 ;;; This isn't really lisp, but it's definitely a source file.
5 ;;; first, the headers necessary to find definitions of everything
10 #-win32 "sys/socket.h"
12 #-win32 "netinet/in.h"
13 #-win32 "netinet/in_systm.h"
14 #-win32 "netinet/ip.h"
16 #-win32 "netinet/tcp.h"
27 ;;; then the stuff we're looking for
28 ((:integer af-inet "AF_INET" "IP Protocol family" t)
30 ;; KLUDGE: These types simply do not seem to exist on Windows,
31 ;; but we'll provide these anyways -- at least in a way that should
33 (:type uid-t #-win32 "uid_t" #+win32 "short")
34 (:type gid-t #-win32 "gid_t" #+win32 "short")
35 (:type nlink-t #-win32 "nlink_t" #+win32 "short")
40 (:type time-t "time_t")
44 (:integer SIGHUP "SIGHUP" #+sb-doc "terminal line hangup." t)
45 (:integer SIGINT "SIGINT" #+sb-doc "interrupt program." t)
46 (:integer SIGQUIT "SIGQUIT" #+sb-doc "quit program." t)
47 (:integer SIGILL "SIGILL" #+sb-doc "illegal instruction." t)
48 (:integer SIGTRAP "SIGTRAP" #+sb-doc "trace trap." t)
49 (:integer SIGABRT "SIGABRT" #+sb-doc "abort program (formerly SIGIOT)." t)
50 (:integer SIGEMT "SIGEMT" #+sb-doc "emulate instruction executed." t)
51 (:integer SIGFPE "SIGFPE" #+sb-doc "floating-point exception." t)
52 (:integer SIGKILL "SIGKILL" #+sb-doc "kill program." t)
53 (:integer SIGBUS "SIGBUS" #+sb-doc "bus error." t)
54 (:integer SIGSEGV "SIGSEGV" #+sb-doc "segmentation violation." t)
55 (:integer SIGSYS "SIGSYS" #+sb-doc "non-existent system call invoked." t)
56 (:integer SIGPIPE "SIGPIPE" #+sb-doc "write on a pipe with no reader." t)
57 (:integer SIGALRM "SIGALRM" #+sb-doc "real-time timer expired." t)
58 (:integer SIGTERM "SIGTERM" #+sb-doc "software termination signal." t)
59 (:integer SIGURG "SIGURG" #+sb-doc "urgent condition present on socket." t)
60 (:integer SIGSTOP "SIGSTOP" #+sb-doc "stop (cannot be caught or ignored)." t)
61 (:integer SIGTSTP "SIGTSTP" #+sb-doc "stop signal generated from keyboard." t)
62 (:integer SIGCONT "SIGCONT" #+sb-doc "continue after stop." t)
63 (:integer SIGCHLD "SIGCHLD" #+sb-doc "child status has changed." t)
64 (:integer SIGTTIN "SIGTTIN"
65 #+sb-doc "background read attempted from control terminal." t)
66 (:integer SIGTTOU "SIGTTOU"
67 #+sb-doc "background write attempted to control terminal." t)
68 (:integer SIGIO "SIGIO"
69 #+sb-doc "I/O is possible on a descriptor (see fcntl(2))." t)
70 (:integer SIGXCPU "SIGXCPU"
71 #+sb-doc "cpu time limit exceeded (see setrlimit(2))." t)
72 (:integer SIGXFSZ "SIGXFSZ"
73 #+sb-doc "file size limit exceeded (see setrlimit(2))." t)
74 (:integer SIGVTALRM "SIGVTALRM"
75 #+sb-doc "virtual time alarm (see setitimer(2))." t)
76 (:integer SIGPROF "SIGPROF"
77 #+sb-doc "profiling timer alarm (see setitimer(2))." t)
78 (:integer SIGWINCH "SIGWINCH" #+sb-doc "Window size change." t)
79 (:integer SIGINFO "SIGINFO" #+sb-doc "status request from keyboard." t)
80 (:integer SIGUSR1 "SIGUSR1" #+sb-doc "User defined signal 1." t)
81 (:integer SIGUSR2 "SIGUSR2" #+sb-doc "User defined signal 2." t)
82 (:integer SIGRTMIN "SIGRTMIN" #+sb-doc "Smallest real-time signal number." t)
83 (:integer SIGRTMAX "SIGRTMAX" #+sb-doc "Largest real-time signal number." t)
86 (:integer eperm "EPERM" nil t)
87 (:integer enoent "ENOENT" nil t)
88 (:integer esrch "ESRCH" nil t)
89 (:integer eintr "EINTR" nil t)
90 (:integer eio "EIO" nil t)
91 (:integer enxio "ENXIO" nil t)
92 (:integer e2big "E2BIG" nil t)
93 (:integer enoexec "ENOEXEC" nil t)
94 (:integer ebadf "EBADF" nil t)
95 (:integer echild "ECHILD" nil t)
96 (:integer eagain "EAGAIN" nil t)
97 (:integer enomem "ENOMEM" nil t)
98 (:integer eacces "EACCES" nil t)
99 (:integer efault "EFAULT" nil t)
100 (:integer enotblk "ENOTBLK" nil t)
101 (:integer ebusy "EBUSY" nil t)
102 (:integer eexist "EEXIST" nil t)
103 (:integer exdev "EXDEV" nil t)
104 (:integer enodev "ENODEV" nil t)
105 (:integer enotdir "ENOTDIR" nil t)
106 (:integer eisdir "EISDIR" nil t)
107 (:integer einval "EINVAL" nil t)
108 (:integer enfile "ENFILE" nil t)
109 (:integer emfile "EMFILE" nil t)
110 (:integer enotty "ENOTTY" nil t)
111 (:integer etxtbsy "ETXTBSY" nil t)
112 (:integer efbig "EFBIG" nil t)
113 (:integer enospc "ENOSPC" nil t)
114 (:integer espipe "ESPIPE" nil t)
115 (:integer erofs "EROFS" nil t)
116 (:integer emlink "EMLINK" nil t)
117 (:integer epipe "EPIPE" nil t)
118 (:integer edom "EDOM" nil t)
119 (:integer erange "ERANGE" nil t)
120 (:integer edeadlk "EDEADLK" nil t)
121 (:integer enametoolong "ENAMETOOLONG" nil t)
122 (:integer enolck "ENOLCK" nil t)
123 (:integer enosys "ENOSYS" nil t)
124 (:integer enotempty "ENOTEMPTY" nil t)
125 (:integer eloop "ELOOP" nil t)
126 (:integer ewouldblock "EWOULDBLOCK" nil t)
127 (:integer enomsg "ENOMSG" nil t)
128 (:integer eidrm "EIDRM" nil t)
129 (:integer echrng "ECHRNG" nil t)
130 (:integer el2nsync "EL2NSYNC" nil t)
131 (:integer el3hlt "EL3HLT" nil t)
132 (:integer el3rst "EL3RST" nil t)
133 (:integer elnrng "ELNRNG" nil t)
134 (:integer eunatch "EUNATCH" nil t)
135 (:integer enocsi "ENOCSI" nil t)
136 (:integer el2hlt "EL2HLT" nil t)
137 (:integer ebade "EBADE" nil t)
138 (:integer ebadr "EBADR" nil t)
139 (:integer exfull "EXFULL" nil t)
140 (:integer enoano "ENOANO" nil t)
141 (:integer ebadrqc "EBADRQC" nil t)
142 (:integer ebadslt "EBADSLT" nil t)
143 (:integer edeadlock "EDEADLOCK" nil t)
144 (:integer ebfont "EBFONT" nil t)
145 (:integer enostr "ENOSTR" nil t)
146 (:integer enodata "ENODATA" nil t)
147 (:integer etime "ETIME" nil t)
148 (:integer enosr "ENOSR" nil t)
149 (:integer enonet "ENONET" nil t)
150 (:integer enopkg "ENOPKG" nil t)
151 (:integer eremote "EREMOTE" nil t)
152 (:integer enolink "ENOLINK" nil t)
153 (:integer eadv "EADV" nil t)
154 (:integer esrmnt "ESRMNT" nil t)
155 (:integer ecomm "ECOMM" nil t)
156 (:integer eproto "EPROTO" nil t)
157 (:integer emultihop "EMULTIHOP" nil t)
158 (:integer edotdot "EDOTDOT" nil t)
159 (:integer ebadmsg "EBADMSG" nil t)
160 (:integer eoverflow "EOVERFLOW" nil t)
161 (:integer enotuniq "ENOTUNIQ" nil t)
162 (:integer ebadfd "EBADFD" nil t)
163 (:integer eremchg "EREMCHG" nil t)
164 (:integer elibacc "ELIBACC" nil t)
165 (:integer elibbad "ELIBBAD" nil t)
166 (:integer elibscn "ELIBSCN" nil t)
167 (:integer elibmax "ELIBMAX" nil t)
168 (:integer elibexec "ELIBEXEC" nil t)
169 (:integer eilseq "EILSEQ" nil t)
170 (:integer erestart "ERESTART" nil t)
171 (:integer estrpipe "ESTRPIPE" nil t)
172 (:integer eusers "EUSERS" nil t)
173 (:integer enotsock "ENOTSOCK" nil t)
174 (:integer edestaddrreq "EDESTADDRREQ" nil t)
175 (:integer emsgsize "EMSGSIZE" nil t)
176 (:integer eprototype "EPROTOTYPE" nil t)
177 (:integer enoprotoopt "ENOPROTOOPT" nil t)
178 (:integer eprotonosupport "EPROTONOSUPPORT" nil t)
179 (:integer esocktnosupport "ESOCKTNOSUPPORT" nil t)
180 (:integer eopnotsupp "EOPNOTSUPP" nil t)
181 (:integer epfnosupport "EPFNOSUPPORT" nil t)
182 (:integer eafnosupport "EAFNOSUPPORT" nil t)
183 (:integer eaddrinuse "EADDRINUSE" nil t)
184 (:integer eaddrnotavail "EADDRNOTAVAIL" nil t)
185 (:integer enetdown "ENETDOWN" nil t)
186 (:integer enetunreach "ENETUNREACH" nil t)
187 (:integer enetreset "ENETRESET" nil t)
188 (:integer econnaborted "ECONNABORTED" nil t)
189 (:integer econnreset "ECONNRESET" nil t)
190 (:integer enobufs "ENOBUFS" nil t)
191 (:integer eisconn "EISCONN" nil t)
192 (:integer enotconn "ENOTCONN" nil t)
193 (:integer eshutdown "ESHUTDOWN" nil t)
194 (:integer etoomanyrefs "ETOOMANYREFS" nil t)
195 (:integer etimedout "ETIMEDOUT" nil t)
196 (:integer econnrefused "ECONNREFUSED" nil t)
197 (:integer ehostdown "EHOSTDOWN" nil t)
198 (:integer ehostunreach "EHOSTUNREACH" nil t)
199 (:integer ealready "EALREADY" nil t)
200 (:integer einprogress "EINPROGRESS" nil t)
201 (:integer estale "ESTALE" nil t)
202 (:integer euclean "EUCLEAN" nil t)
203 (:integer enotnam "ENOTNAM" nil t)
204 (:integer enavail "ENAVAIL" nil t)
205 (:integer eremoteio "EREMOTEIO" nil t)
206 (:integer edquot "EDQUOT" nil t)
207 (:integer enomedium "ENOMEDIUM" nil t)
208 (:integer emediumtype "EMEDIUMTYPE" nil t)
211 (:integer wnohang "WNOHANG")
212 (:integer wuntraced "WUNTRACED")
215 (:type mode-t "mode_t")
216 (:integer s-isuid "S_ISUID" nil t)
217 (:integer s-isgid "S_ISGID" nil t)
218 (:integer s-isvtx "S_ISVTX" nil t)
219 (:integer s-irusr "S_IRUSR" nil t)
220 (:integer s-iwusr "S_IWUSR" nil t)
221 (:integer s-ixusr "S_IXUSR" nil t)
222 (:integer s-iread "S_IRUSR" nil t)
223 (:integer s-iwrite "S_IWUSR" nil t)
224 (:integer s-iexec "S_IXUSR" nil t)
225 (:integer s-irgrp "S_IRGRP" nil t)
226 (:integer s-iwgrp "S_IWGRP" nil t)
227 (:integer s-ixgrp "S_IXGRP" nil t)
228 (:integer s-iroth "S_IROTH" nil t)
229 (:integer s-iwoth "S_IWOTH" nil t)
230 (:integer s-ixoth "S_IXOTH" nil t)
233 (:integer r-ok "R_OK" nil t)
234 (:integer w-ok "W_OK" nil t)
235 (:integer x-ok "X_OK" nil t)
236 (:integer f-ok "F_OK" nil t)
239 (:type off-t "off_t")
240 (:integer prot-none "PROT_NONE" #+sb-doc "mmap: no protection" t)
241 (:integer prot-read "PROT_READ" #+sb-doc "mmap: read protection" t)
242 (:integer prot-write "PROT_WRITE" #+sb-doc "mmap: write protection" t)
243 (:integer prot-exec "PROT_EXEC" #+sb-doc "mmap: execute protection" t)
244 (:integer map-shared "MAP_SHARED" #+sb-doc "mmap: shared memory" t)
245 (:integer map-private "MAP_PRIVATE" #+sb-doc "mmap: private mapping" t)
246 (:integer map-fixed "MAP_FIXED" #+sb-doc "mmap: map at given location" t)
249 (:integer ms-async "MS_ASYNC" #+sb-doc "msync: return immediately" t)
250 (:integer ms-sync "MS_SYNC" #+sb-doc "msync: perform synchronous writes" t)
251 (:integer ms-invalidate "MS_INVALIDATE"
252 #+sb-doc "msync: invalidate all cached data" t)
256 (#+(and linux largefile) "struct dirent64"
257 #-(and linux largefile) "struct dirent"
258 (:c-string name "char *" "d_name"
259 :distrust-length #+sunos t #-sunos nil)) t)
263 (:structure alien-passwd
265 (c-string-pointer name "char *" "pw_name")
266 (c-string-pointer passwd "char *" "pw_passwd")
267 (uid-t uid "uid_t" "pw_uid")
268 (gid-t gid "gid_t" "pw_gid")
269 ;; 'change', 'class', and 'expire' are not supported on Linux
271 (time-t change "time_t" "pw_change")
273 (c-string-pointer class "char *" "pw_class")
274 (c-string-pointer gecos "char *" "pw_gecos")
275 (c-string-pointer dir "char *" "pw_dir")
276 (c-string-pointer shell "char *" "pw_shell")
278 (time-t expire "time_t" "pw_expire")
279 ;; OS X manpages say this exists. they lie!
281 (:integer fields "int" "pw_fields")))
283 (:structure alien-stat
285 (mode-t mode "mode_t" "st_mode")
286 (ino-t ino "ino_t" "st_ino")
287 ;; Linux/MIPS uses unsigned long instead of dev_t here.
289 (dev-t dev "dev_t" "st_dev")
291 ((unsigned 32) dev "dev_t" "st_dev")
292 (nlink-t nlink "nlink_t" "st_nlink")
293 (uid-t uid "uid_t" "st_uid")
294 (gid-t gid "gid_t" "st_gid")
295 (off-t size "off_t" "st_size")
296 (time-t atime "time_t" "st_atime")
297 (time-t mtime "time_t" "st_mtime")
298 (time-t ctime "time_t" "st_ctime")))
301 (:integer o-rdonly "O_RDONLY" nil t)
302 (:integer o-wronly "O_WRONLY" nil t)
303 (:integer o-rdwr "O_RDWR" nil t)
304 (:integer o-creat "O_CREAT" nil t)
305 (:integer o-excl "O_EXCL" nil t)
306 (:integer o-noctty "O_NOCTTY" nil t)
307 (:integer o-trunc "O_TRUNC" nil t)
308 (:integer o-append "O_APPEND" nil t)
309 (:integer o-nonblock "O_NONBLOCK" nil t)
310 (:integer o-ndelay "O_NDELAY" nil t)
311 (:integer o-sync "O_SYNC" nil t)
312 (:integer o-nofollow "O_NOFOLLOW" nil t)
313 (:integer o-directory "O_DIRECTORY" nil t)
314 (:integer o-direct "O_DIRECT" nil t)
315 (:integer o-async "O_ASYNC" nil t)
316 (:integer o-largefile "O_LARGEFILE" nil t) ; hmm...
317 (:integer o-dsync "O_DSYNC" nil t)
318 (:integer o-rsync "O_RSYNC" nil t)
321 (:integer seek-set "SEEK_SET" nil t)
322 (:integer seek-cur "SEEK_CUR" nil t)
323 (:integer seek-end "SEEK_END" nil t)
326 (:integer f-dupfd "F_DUPFD" nil t)
327 (:integer f-getfd "F_GETFD" nil t)
328 (:integer f-setfd "F_SETFD" nil t)
329 (:integer f-getfl "F_GETFL" nil t)
330 (:integer f-setfl "F_SETFL" nil t)
331 (:integer f-getlk "F_GETLK" nil t)
332 (:integer f-setlk "F_SETLK" nil t)
333 (:integer f-setlkw "F_SETLKW" nil t)
334 (:integer f-getown "F_GETOWN" nil t)
335 (:integer f-setown "F_SETOWN" nil t)
337 ;; tcgetattr(), tcsetattr()
341 (:type speed-t "speed_t" nil t)
343 (:type tcflag-t "tcflag_t" nil t)
344 (:integer nccs "NCCS" nil t)
346 (:structure alien-termios
348 (tcflag-t iflag "tcflag_t" "c_iflag")
349 (tcflag-t oflag "tcflag_t" "c_oflag")
350 (tcflag-t cflag "tcflag_t" "c_cflag")
351 (tcflag-t lflag "tcflag_t" "c_lflag")
352 ((array cc-t) cc "cc_t" "c_cc")))
356 (:structure alien-utimbuf
358 (time-t actime "time_t" "actime")
359 (time-t modtime "time_t" "modtime")))
361 (:structure alien-timeval
363 (long sec "long" "tv_sec")
364 (long usec "long" "tv_usec")))
366 (:integer veof "VEOF" nil t)
367 (:integer veol "VEOL" nil t)
368 (:integer verase "VERASE" nil t)
369 (:integer vintr "VINTR" nil t)
370 (:integer vkill "VKILL" nil t)
371 (:integer vmin "VMIN" nil t)
372 (:integer vquit "VQUIT" nil t)
373 (:integer vstart "VSTART" nil t)
374 (:integer vstop "VSTOP" nil t)
375 (:integer vsusp "VSUSP" nil t)
376 (:integer vtime "VTIME" nil t)
378 (:integer brkint "BRKINT" nil t)
379 (:integer icrnl "ICRNL" nil t)
380 (:integer ignbrk "IGNBRK" nil t)
381 (:integer igncr "IGNCR" nil t)
382 (:integer ignpar "IGNPAR" nil t)
383 (:integer inlcr "INLCR" nil t)
384 (:integer inpck "INPCK" nil t)
385 (:integer istrip "ISTRIP" nil t)
386 #+xsi ; FIXME: an extension, apparently
387 (:integer ixany "IXANY" nil t)
388 (:integer ixoff "IXOFF" nil t)
389 (:integer ixon "IXON" nil t)
390 (:integer parmrk "PARMRK" nil t)
392 (:integer opost "OPOST" nil t)
394 (:integer onlcr "ONLCR" nil t)
395 (:integer ocrnl "OCRNL" nil t)
396 (:integer onlret "ONLRET" nil t)
397 (:integer ofill "OFILL" nil t)
398 (:integer nldly "NLDLY" nil t)
399 (:integer nl0 "NL0" nil t)
400 (:integer nl1 "NL1" nil t)
401 (:integer crdly "CRDLY" nil t)
402 (:integer cr0 "CR0" nil t)
403 (:integer cr1 "CR1" nil t)
404 (:integer cr2 "CR2" nil t)
405 (:integer cr3 "CR3" nil t)
406 (:integer tabdly "TABDLY" nil t)
407 (:integer tab0 "TAB0" nil t)
408 (:integer tab1 "TAB1" nil t)
409 (:integer tab2 "TAB2" nil t)
410 (:integer tab3 "TAB3" nil t)
411 (:integer bsdly "BSDLY" nil t)
412 (:integer bs0 "BS0" nil t)
413 (:integer bs1 "BS1" nil t)
414 (:integer vtdly "VTDLY" nil t)
415 (:integer vt0 "VT0" nil t)
416 (:integer vt1 "VT1" nil t)
417 (:integer ffdly "FFDLY" nil t)
418 (:integer ff0 "FF0" nil t)
419 (:integer ff1 "FF1" nil t)
421 (:integer b0 "B0" nil t)
422 (:integer b50 "B50" nil t)
423 (:integer b75 "B75" nil t)
424 (:integer b110 "B110" nil t)
425 (:integer b134 "B134" nil t)
426 (:integer b150 "B150" nil t)
427 (:integer b200 "B200" nil t)
428 (:integer b300 "B300" nil t)
429 (:integer b600 "B600" nil t)
430 (:integer b1200 "B1200" nil t)
431 (:integer b1800 "B1800" nil t)
432 (:integer b2400 "B2400" nil t)
433 (:integer b4800 "B4800" nil t)
434 (:integer b9600 "B9600" nil t)
435 (:integer b19200 "B19200" nil t)
436 (:integer b38400 "B38400" nil t)
437 (:integer b57600 "B57600" nil t)
438 (:integer b115200 "B115200" nil t)
439 (:integer b230400 "B230400" nil t)
441 (:integer csize "CSIZE" nil t)
442 (:integer cs5 "CS5" nil t)
443 (:integer cs6 "CS6" nil t)
444 (:integer cs7 "CS7" nil t)
445 (:integer cs8 "CS8" nil t)
446 (:integer cstopb "CSTOPB" nil t)
447 (:integer cread "CREAD" nil t)
448 (:integer parenb "PARENB" nil t)
449 (:integer parodd "PARODD" nil t)
450 (:integer hupcl "HUPCL" nil t)
451 (:integer clocal "CLOCAL" nil t)
453 (:integer echo "ECHO" nil t)
454 (:integer echoe "ECHOE" nil t)
455 (:integer echok "ECHOK" nil t)
456 (:integer echonl "ECHONL" nil t)
457 (:integer icanon "ICANON" nil t)
458 (:integer iexten "IEXTEN" nil t)
459 (:integer isig "ISIG" nil t)
460 (:integer noflsh "NOFLSH" nil t)
461 (:integer tostop "TOSTOP" nil t)
463 (:integer tcsanow "TCSANOW" nil t)
464 (:integer tcsadrain "TCSADRAIN" nil t)
465 (:integer tcsaflush "TCSAFLUSH" nil t)
467 (:integer tciflush "TCIFLUSH" nil t)
468 (:integer tcioflush "TCIOFLUSH" nil t)
469 (:integer tcoflush "TCOFLUSH" nil t)
470 (:integer tcioff "TCIOFF" nil t)
471 (:integer tcion "TCION" nil t)
472 (:integer tcooff "TCOOFF" nil t)
473 (:integer tcoon "TCOON" nil t)