0.9.17.13: SB-POSIX:CFSET*SPEED, SB-POSIX:CFGET*SPEED, and related constants
[sbcl.git] / contrib / sb-posix / constants.lisp
index b2081d8..a040eba 100644 (file)
@@ -6,26 +6,36 @@
 (#||#
  "sys/types.h"
  "sys/stat.h"
-
- "sys/socket.h" "sys/un.h" "netinet/in.h" "netinet/in_systm.h"
- "netinet/ip.h" "net/if.h" "netinet/tcp.h" "sys/mman.h" "sys/wait.h"
+ #-win32 "sys/socket.h"
+ #-win32 "sys/un.h"
+ #-win32 "netinet/in.h"
+ #-win32 "netinet/in_systm.h"
+ #-win32 "netinet/ip.h"
+ #-win32 "net/if.h"
+ #-win32 "netinet/tcp.h"
+ #-win32 "sys/mman.h"
+ #-win32 "sys/wait.h"
  "fcntl.h"
- "netdb.h" "errno.h"
+ #-win32 "netdb.h"
+ "errno.h"
  "dirent.h" "signal.h"
+ #-win32 "pwd.h"
  "unistd.h"
-
- "termios.h")
+ #-win32 "termios.h")
 
 ;;; then the stuff we're looking for
 ((:integer af-inet "AF_INET" "IP Protocol family" t)
 
- (:type uid-t "uid_t")
- (:type gid-t "gid_t")
+ ;; KLUDGE: These types simply do not seem to exist on Windows,
+ ;; but we'll provide these anyways -- at least in a way that should
+ ;; match with stat.
+ (:type uid-t   #-win32 "uid_t"   #+win32 "short")
+ (:type gid-t   #-win32 "gid_t"   #+win32 "short")
+ (:type nlink-t #-win32 "nlink_t" #+win32 "short")
 
  (:type pid-t "pid_t")
  (:type ino-t "ino_t")
 
- (:type nlink-t "nlink_t")
  (:type time-t "time_t")
  (:type dev-t "dev_t")
 
               (:c-string name "char *" "d_name"
                          :distrust-length #+sunos t #-sunos nil)) t)
 
+ ;; password database
+ #-win32
+ (:structure alien-passwd
+             ("struct passwd"
+              (c-string-pointer name "char *" "pw_name")
+              (c-string-pointer passwd "char *" "pw_passwd")
+              (uid-t uid "uid_t" "pw_uid")
+              (gid-t gid "gid_t" "pw_gid")
+              ;; 'change', 'class', and 'expire' are not supported on Linux
+              #+nil
+              (time-t change "time_t" "pw_change")
+              #+nil
+              (c-string-pointer class "char *" "pw_class")
+              (c-string-pointer gecos "char *" "pw_gecos")
+              (c-string-pointer dir "char *" "pw_dir")
+              (c-string-pointer shell "char *" "pw_shell")
+              #+nil
+              (time-t expire "time_t" "pw_expire")
+              ;; OS X manpages say this exists.  they lie!
+              #+nil
+              (:integer fields "int" "pw_fields")))
+
  (:structure alien-stat
              ("struct stat"
               (mode-t mode "mode_t" "st_mode")
               (ino-t ino "ino_t" "st_ino")
+              ;; Linux/MIPS uses unsigned long instead of dev_t here.
+              #-mips
               (dev-t dev "dev_t" "st_dev")
+              #+mips
+              ((unsigned 32) dev "dev_t" "st_dev")
               (nlink-t nlink "nlink_t" "st_nlink")
               (uid-t uid "uid_t" "st_uid")
               (gid-t gid "gid_t" "st_gid")
  (:integer f-setown "F_SETOWN" nil t)
 
  ;; tcgetattr(), tcsetattr()
+ #-win32
  (:type cc-t "cc_t")
+ #-win32
  (:type speed-t "speed_t" nil t)
+ #-win32
  (:type tcflag-t "tcflag_t" nil t)
  (:integer nccs "NCCS" nil t)
-
+ #-win32
  (:structure alien-termios
              ("struct termios"
               (tcflag-t iflag "tcflag_t" "c_iflag")
  (:integer b9600 "B9600" nil t)
  (:integer b19200 "B19200" nil t)
  (:integer b38400 "B38400" nil t)
+ (:integer b57600 "B57600" nil t)
+ (:integer b115200 "B115200" nil t)
+ (:integer b230400 "B230400" nil t)
 
  (:integer csize "CSIZE" nil t)
  (:integer cs5 "CS5" nil t)