--- /home/andy/clisp/site/osicat/posix/basic-unixint.orig	2008-03-23 21:48:59.000000000 +0100
+++ /home/andy/clisp/site/osicat/posix/basic-unixint.lisp	2008-03-23 22:14:09.000000000 +0100
@@ -36,155 +36,154 @@
 ;;; largefile support on linux
 ;;; TODO: check if these flags are required on solaris too
 #+linux
-(progn
-  (define "_LARGEFILE_SOURCE")
-  (define "_LARGEFILE64_SOURCE")
-  (define "_FILE_OFFSET_BITS" 64))
+(define "_LARGEFILE_SOURCE")
+(define "_LARGEFILE64_SOURCE")
+(define "_FILE_OFFSET_BITS" 64)
 
 (include "sys/types.h" "sys/stat.h" "fcntl.h" "errno.h" "signal.h" "unistd.h"
          "limits.h" "time.h" "stdlib.h")
 
 (in-package #:osicat-posix)
 
-(ctype size "size_t")
-(ctype ssize "ssize_t")
-(ctype pid "pid_t")
-#-windows (ctype uid "uid_t")
-#-windows (ctype gid "gid_t")
-(ctype off "off_t")
-(ctype mode "mode_t")
+(ctype size :unsigned "size_t")
+(ctype ssize :unsigned "ssize_t")
+(ctype pid :unsigned "pid_t")
+#-windows (ctype uid :unsigned"uid_t")
+#-windows (ctype gid :unsigned "gid_t")
+(ctype off :unsigned "off_t")
+(ctype mode :unsigned "mode_t")
 
 (constantenum errno-values
-  ((:eperm "EPERM"))
-  ((:enoent "ENOENT"))
-  ((:esrch "ESRCH"))
-  ((:eintr "EINTR"))
-  ((:eio "EIO"))
-  ((:enxio "ENXIO"))
-  ((:e2big "E2BIG"))
-  ((:enoexec "ENOEXEC"))
-  ((:ebadf "EBADF"))
-  ((:echild "ECHILD"))
-  ((:eagain "EAGAIN"))
-  ((:enomem "ENOMEM"))
-  ((:eacces "EACCES"))
-  ((:efault "EFAULT"))
-  ((:ebusy "EBUSY"))
-  ((:eexist "EEXIST"))
-  ((:exdev "EXDEV"))
-  ((:enodev "ENODEV"))
-  ((:enotdir "ENOTDIR"))
-  ((:eisdir "EISDIR"))
-  ((:einval "EINVAL"))
-  ((:enfile "ENFILE"))
-  ((:emfile "EMFILE"))
-  ((:enotty "ENOTTY"))
-  ((:efbig "EFBIG"))
-  ((:enospc "ENOSPC"))
-  ((:espipe "ESPIPE"))
-  ((:erofs "EROFS"))
-  ((:emlink "EMLINK"))
-  ((:epipe "EPIPE"))
-  ((:edom "EDOM"))
-  ((:erange "ERANGE"))
-  ((:edeadlk "EDEADLK"))
-  ((:enametoolong "ENAMETOOLONG"))
-  ((:enolck "ENOLCK"))
-  ((:enosys "ENOSYS"))
-  ((:enotempty "ENOTEMPTY"))
-  ((:echrng "ECHRNG") :optional t)
-  ((:el2nsync "EL2NSYNC") :optional t)
-  ((:el3hlt "EL3HLT") :optional t)
-  ((:el3rst "EL3RST") :optional t)
-  ((:elnrng "ELNRNG") :optional t)
-  ((:eunatch "EUNATCH") :optional t)
-  ((:enocsi "ENOCSI") :optional t)
-  ((:el2hlt "EL2HLT") :optional t)
-  ((:ebade "EBADE") :optional t)
-  ((:ebadr "EBADR") :optional t)
-  ((:exfull "EXFULL") :optional t)
-  ((:enoano "ENOANO") :optional t)
-  ((:ebadrqc "EBADRQC") :optional t)
-  ((:ebadslt "EBADSLT") :optional t)
-  ((:edeadlock "EDEADLOCK") :optional t)
-  ((:ebfont "EBFONT") :optional t)
-  ((:enostr "ENOSTR") :optional t)
-  ((:enodata "ENODATA") :optional t)
-  ((:etime "ETIME") :optional t)
-  ((:enosr "ENOSR") :optional t)
-  ((:enopkg "ENOPKG") :optional t)
-  ((:eadv "EADV") :optional t)
-  ((:esrmnt "ESRMNT") :optional t)
-  ((:ecomm "ECOMM") :optional t)
-  ((:edotdot "EDOTDOT") :optional t)
-  ((:enotuniq "ENOTUNIQ") :optional t)
-  ((:ebadfd "EBADFD") :optional t)
-  ((:eremchg "EREMCHG") :optional t)
-  ((:elibacc "ELIBACC") :optional t)
-  ((:elibbad "ELIBBAD") :optional t)
-  ((:elibscn "ELIBSCN") :optional t)
-  ((:elibmax "ELIBMAX") :optional t)
-  ((:elibexec "ELIBEXEC") :optional t)
-  ((:eilseq "EILSEQ"))
-  ((:erestart "ERESTART") :optional t)
-  ((:estrpipe "ESTRPIPE") :optional t)
-  ((:euclean "EUCLEAN") :optional t)
-  ((:enotnam "ENOTNAM") :optional t)
-  ((:enavail "ENAVAIL") :optional t)
-  ((:eremoteio "EREMOTEIO") :optional t)
-  ((:enomedium "ENOMEDIUM") :optional t)
-  ((:emediumtype "EMEDIUMTYPE") :optional t)
-  .
-  #+windows nil
-  #-windows
-  #.'(((:estale "ESTALE"))
-      ((:enotblk "ENOTBLK"))
-      ((:etxtbsy "ETXTBSY"))
-      ((:eusers "EUSERS"))
-      ((:eloop "ELOOP"))
-      ((:ewouldblock "EWOULDBLOCK"))
-      ((:enomsg "ENOMSG"))
-      ((:eidrm "EIDRM"))
-      ((:eproto "EPROTO"))
-      ((:emultihop "EMULTIHOP"))
-      ((:ebadmsg "EBADMSG"))
-      ((:eoverflow "EOVERFLOW"))
-      ((:edquot "EDQUOT"))
-      ((:einprogress "EINPROGRESS"))
-      ((:ealready "EALREADY"))
-
-      ;; TODO: These errors are related to sockets.  However they
-      ;; might not be unique to them.  Remove those that are unique
-      ;; and keep those that might be set elsewhere.
-      ((:eprotonosupport "EPROTONOSUPPORT"))
-      ((:esocktnosupport "ESOCKTNOSUPPORT"))
-      ((:enotsock "ENOTSOCK"))
-      ((:edestaddrreq "EDESTADDRREQ"))
-      ((:emsgsize "EMSGSIZE"))
-      ((:eprototype "EPROTOTYPE"))
-      ((:enoprotoopt "ENOPROTOOPT"))
-      ((:eremote "EREMOTE"))
-      ((:enolink "ENOLINK"))
-      ((:epfnosupport "EPFNOSUPPORT"))
-      ((:eafnosupport "EAFNOSUPPORT"))
-      ((:eaddrinuse "EADDRINUSE"))
-      ((:eaddrnotavail "EADDRNOTAVAIL"))
-      ((:enetdown "ENETDOWN"))
-      ((:enetunreach "ENETUNREACH"))
-      ((:enetreset "ENETRESET"))
-      ((:econnaborted "ECONNABORTED"))
-      ((:econnreset "ECONNRESET"))
-      ((:eisconn "EISCONN"))
-      ((:enotconn "ENOTCONN"))
-      ((:eshutdown "ESHUTDOWN"))
-      ((:etoomanyrefs "ETOOMANYREFS"))
-      ((:etimedout "ETIMEDOUT"))
-      ((:econnrefused "ECONNREFUSED"))
-      ((:ehostdown "EHOSTDOWN"))
-      ((:ehostunreach "EHOSTUNREACH"))
-      ((:enonet "ENONET") :optional t)
-      ((:enobufs "ENOBUFS"))
-      ((:eopnotsupp "EOPNOTSUPP"))))
+              ((:eperm "EPERM"))
+              ((:enoent "ENOENT"))
+              ((:esrch "ESRCH"))
+              ((:eintr "EINTR"))
+              ((:eio "EIO"))
+              ((:enxio "ENXIO"))
+              ((:e2big "E2BIG"))
+              ((:enoexec "ENOEXEC"))
+              ((:ebadf "EBADF"))
+              ((:echild "ECHILD"))
+              ((:eagain "EAGAIN"))
+              ((:enomem "ENOMEM"))
+              ((:eacces "EACCES"))
+              ((:efault "EFAULT"))
+              ((:ebusy "EBUSY"))
+              ((:eexist "EEXIST"))
+              ((:exdev "EXDEV"))
+              ((:enodev "ENODEV"))
+              ((:enotdir "ENOTDIR"))
+              ((:eisdir "EISDIR"))
+              ((:einval "EINVAL"))
+              ((:enfile "ENFILE"))
+              ((:emfile "EMFILE"))
+              ((:enotty "ENOTTY"))
+              ((:efbig "EFBIG"))
+              ((:enospc "ENOSPC"))
+              ((:espipe "ESPIPE"))
+              ((:erofs "EROFS"))
+              ((:emlink "EMLINK"))
+              ((:epipe "EPIPE"))
+              ((:edom "EDOM"))
+              ((:erange "ERANGE"))
+              ((:edeadlk "EDEADLK"))
+              ((:enametoolong "ENAMETOOLONG"))
+              ((:enolck "ENOLCK"))
+              ((:enosys "ENOSYS"))
+              ((:enotempty "ENOTEMPTY"))
+              ((:echrng "ECHRNG") :optional t)
+              ((:el2nsync "EL2NSYNC") :optional t)
+              ((:el3hlt "EL3HLT") :optional t)
+              ((:el3rst "EL3RST") :optional t)
+              ((:elnrng "ELNRNG") :optional t)
+              ((:eunatch "EUNATCH") :optional t)
+              ((:enocsi "ENOCSI") :optional t)
+              ((:el2hlt "EL2HLT") :optional t)
+              ((:ebade "EBADE") :optional t)
+              ((:ebadr "EBADR") :optional t)
+              ((:exfull "EXFULL") :optional t)
+              ((:enoano "ENOANO") :optional t)
+              ((:ebadrqc "EBADRQC") :optional t)
+              ((:ebadslt "EBADSLT") :optional t)
+              ((:edeadlock "EDEADLOCK") :optional t)
+              ((:ebfont "EBFONT") :optional t)
+              ((:enostr "ENOSTR") :optional t)
+              ((:enodata "ENODATA") :optional t)
+              ((:etime "ETIME") :optional t)
+              ((:enosr "ENOSR") :optional t)
+              ((:enopkg "ENOPKG") :optional t)
+              ((:eadv "EADV") :optional t)
+              ((:esrmnt "ESRMNT") :optional t)
+              ((:ecomm "ECOMM") :optional t)
+              ((:edotdot "EDOTDOT") :optional t)
+              ((:enotuniq "ENOTUNIQ") :optional t)
+              ((:ebadfd "EBADFD") :optional t)
+              ((:eremchg "EREMCHG") :optional t)
+              ((:elibacc "ELIBACC") :optional t)
+              ((:elibbad "ELIBBAD") :optional t)
+              ((:elibscn "ELIBSCN") :optional t)
+              ((:elibmax "ELIBMAX") :optional t)
+              ((:elibexec "ELIBEXEC") :optional t)
+              ((:eilseq "EILSEQ"))
+              ((:erestart "ERESTART") :optional t)
+              ((:estrpipe "ESTRPIPE") :optional t)
+              ((:euclean "EUCLEAN") :optional t)
+              ((:enotnam "ENOTNAM") :optional t)
+              ((:enavail "ENAVAIL") :optional t)
+              ((:eremoteio "EREMOTEIO") :optional t)
+              ((:enomedium "ENOMEDIUM") :optional t)
+              ((:emediumtype "EMEDIUMTYPE") :optional t)
+              .
+              #+windows nil
+              #-windows
+              #.'(((:estale "ESTALE"))
+                  ((:enotblk "ENOTBLK"))
+                  ((:etxtbsy "ETXTBSY"))
+                  ((:eusers "EUSERS"))
+                  ((:eloop "ELOOP"))
+                  ((:ewouldblock "EWOULDBLOCK"))
+                  ((:enomsg "ENOMSG"))
+                  ((:eidrm "EIDRM"))
+                  ((:eproto "EPROTO"))
+                  ((:emultihop "EMULTIHOP"))
+                  ((:ebadmsg "EBADMSG"))
+                  ((:eoverflow "EOVERFLOW"))
+                  ((:edquot "EDQUOT"))
+                  ((:einprogress "EINPROGRESS"))
+                  ((:ealready "EALREADY"))
+
+                  ;; TODO: These errors are related to sockets.  However they
+                  ;; might not be unique to them.  Remove those that are unique
+                  ;; and keep those that might be set elsewhere.
+                  ((:eprotonosupport "EPROTONOSUPPORT"))
+                  ((:esocktnosupport "ESOCKTNOSUPPORT"))
+                  ((:enotsock "ENOTSOCK"))
+                  ((:edestaddrreq "EDESTADDRREQ"))
+                  ((:emsgsize "EMSGSIZE"))
+                  ((:eprototype "EPROTOTYPE"))
+                  ((:enoprotoopt "ENOPROTOOPT"))
+                  ((:eremote "EREMOTE"))
+                  ((:enolink "ENOLINK"))
+                  ((:epfnosupport "EPFNOSUPPORT"))
+                  ((:eafnosupport "EAFNOSUPPORT"))
+                  ((:eaddrinuse "EADDRINUSE"))
+                  ((:eaddrnotavail "EADDRNOTAVAIL"))
+                  ((:enetdown "ENETDOWN"))
+                  ((:enetunreach "ENETUNREACH"))
+                  ((:enetreset "ENETRESET"))
+                  ((:econnaborted "ECONNABORTED"))
+                  ((:econnreset "ECONNRESET"))
+                  ((:eisconn "EISCONN"))
+                  ((:enotconn "ENOTCONN"))
+                  ((:eshutdown "ESHUTDOWN"))
+                  ((:etoomanyrefs "ETOOMANYREFS"))
+                  ((:etimedout "ETIMEDOUT"))
+                  ((:econnrefused "ECONNREFUSED"))
+                  ((:ehostdown "EHOSTDOWN"))
+                  ((:ehostunreach "EHOSTUNREACH"))
+                  ((:enonet "ENONET") :optional t)
+                  ((:enobufs "ENOBUFS"))
+                  ((:eopnotsupp "EOPNOTSUPP"))))
 
 ;;; more signals in unixint.lisp
 (constant (sigint "SIGINT") :documentation "interrupt program.")
@@ -207,23 +206,26 @@
 (constant (o-binary "O_BINARY"))
 
 #-windows
-(progn
-  (constant (o-noctty "O_NOCTTY"))
-  (constant (o-nonblock "O_NONBLOCK"))
-  (constant (o-ndelay "O_NDELAY"))
-  (constant (o-sync "O_SYNC"))
-  (constant (o-nofollow "O_NOFOLLOW"))
-  (constant (o-async "O_ASYNC")))
+(constant (o-noctty "O_NOCTTY"))
+#-windows
+(constant (o-nonblock "O_NONBLOCK"))
+#-windows
+(constant (o-ndelay "O_NDELAY"))
+#-windows
+(constant (o-sync "O_SYNC"))
+#-windows
+(constant (o-nofollow "O_NOFOLLOW"))
+#-windows
+(constant (o-async "O_ASYNC"))
 
 #-(or windows darwin)
 (constant (o-direct "O_DIRECT"))
 
 #+linux
-(progn
-  (constant (o-directory "O_DIRECTORY"))
-  (constant (o-largefile "O_LARGEFILE"))
-  (constant (o-dsync "O_DSYNC"))
-  (constant (o-rsync "O_RSYNC")))
+(constant (o-directory "O_DIRECTORY"))
+(constant (o-largefile "O_LARGEFILE"))
+(constant (o-dsync "O_DSYNC"))
+(constant (o-rsync "O_RSYNC"))
 
 ;;; lseek()
 (constant (seek-set "SEEK_SET"))
@@ -255,54 +257,52 @@
 (constant (s-iexec "S_IEXEC"))
 
 #-windows
-(progn
-  (constant (s-irwxg "S_IRWXG")
-            :documentation "read, write, execute/search by group")
-  (constant (s-irgrp "S_IRGRP") :documentation "read permission, group")
-  (constant (s-iwgrp "S_IWGRP") :documentation "write permission, group")
-  (constant (s-ixgrp "S_IXGRP")
-            :documentation "execute/search permission, group")
-  (constant (s-irwxo "S_IRWXO")
-            :documentation "read, write, execute/search by others")
-  (constant (s-iroth "S_IROTH") :documentation "read permission, others")
-  (constant (s-iwoth "S_IWOTH") :documentation "write permission, others")
-  (constant (s-ixoth "S_IXOTH")
-            :documentation "execute/search permission, others")
-  (constant (s-isuid "S_ISUID") :documentation "set-user-ID on execution")
-  (constant (s-isgid "S_ISGID") :documentation "set-group-ID on execution")
-  (constant (s-isvtx "S_ISVTX")
-            :documentation "'sticky' bit, many meanings, nonportable")
-  (constant (s-iflnk "S_IFLNK") :documentation "symbolic link")
-  (constant (s-ifsock "S_IFSOCK") :documentation "socket"))
+(constant (s-irwxg "S_IRWXG")
+          :documentation "read, write, execute/search by group")
+(constant (s-irgrp "S_IRGRP") :documentation "read permission, group")
+(constant (s-iwgrp "S_IWGRP") :documentation "write permission, group")
+(constant (s-ixgrp "S_IXGRP")
+          :documentation "execute/search permission, group")
+(constant (s-irwxo "S_IRWXO")
+          :documentation "read, write, execute/search by others")
+(constant (s-iroth "S_IROTH") :documentation "read permission, others")
+(constant (s-iwoth "S_IWOTH") :documentation "write permission, others")
+(constant (s-ixoth "S_IXOTH")
+          :documentation "execute/search permission, others")
+(constant (s-isuid "S_ISUID") :documentation "set-user-ID on execution")
+(constant (s-isgid "S_ISGID") :documentation "set-group-ID on execution")
+(constant (s-isvtx "S_ISVTX")
+          :documentation "'sticky' bit, many meanings, nonportable")
+(constant (s-iflnk "S_IFLNK") :documentation "symbolic link")
+(constant (s-ifsock "S_IFSOCK") :documentation "socket")
 
 (constant (path-max "PATH_MAX" "MAXPATHLEN"))
 
 ;;;; from time.h
 
-(ctype time "time_t")
+(ctype time :unsigned "time_t")
 
 ;;;; from sys/stat.h
 
-(ctype dev "dev_t")
-(ctype ino "ino_t")
+(ctype dev :unsigned "dev_t")
+(ctype ino :unsigned "ino_t")
 
 #-windows
-(progn
-  (ctype nlink "nlink_t")
-  (ctype blksize "blksize_t")
-  (ctype blkcnt "blkcnt_t"))
+(ctype nlink :unsigned "nlink_t")
+(ctype blksize :unsigned "blksize_t")
+(ctype blkcnt :unsigned "blkcnt_t")
 
 (cstruct stat "struct stat"
-  (dev     "st_dev"     :type #-mips dev #+mips :unsigned-long)
-  (ino     "st_ino"     :type ino)
-  (mode    "st_mode"    :type mode)
-  #-windows (nlink "st_nlink" :type nlink)
-  #-windows (uid   "st_uid"   :type uid)
-  #-windows (gid   "st_gid"   :type gid)
-  (rdev    "st_rdev"    :type #-mips dev #+mips :unsigned-long)
-  (size    "st_size"    :type off)
-  #-windows (blksize "st_blksize" :type blkcnt)
-  #-windows (blocks  "st_blocks"  :type blksize)
-  (atime   "st_atime"   :type time)
-  (mtime   "st_mtime"   :type time)
-  (ctime   "st_ctime"   :type time))
+         (dev     "st_dev"     :type #-mips dev #+mips :unsigned-long)
+         (ino     "st_ino"     :type ino)
+         (mode    "st_mode"    :type mode)
+         #-windows (nlink "st_nlink" :type nlink)
+         #-windows (uid   "st_uid"   :type uid)
+         #-windows (gid   "st_gid"   :type gid)
+         (rdev    "st_rdev"    :type #-mips dev #+mips :unsigned-long)
+         (size    "st_size"    :type off)
+         #-windows (blksize "st_blksize" :type blkcnt)
+         #-windows (blocks  "st_blocks"  :type blksize)
+         (atime   "st_atime"   :type time)
+         (mtime   "st_mtime"   :type time)
+         (ctime   "st_ctime"   :type time))

Diff finished.  Sun Mar 23 22:37:46 2008
