diff options
Diffstat (limited to 'src/interp/sockio.lisp')
-rw-r--r-- | src/interp/sockio.lisp | 123 |
1 files changed, 5 insertions, 118 deletions
diff --git a/src/interp/sockio.lisp b/src/interp/sockio.lisp index 48a99f29..ab963588 100644 --- a/src/interp/sockio.lisp +++ b/src/interp/sockio.lisp @@ -1,6 +1,6 @@ -;; Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. +;; Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd. ;; All rights reserved. -;; Copyright (C) 2007, Gabriel Dos Reis. +;; Copyright (C) 2007-2008, Gabriel Dos Reis. ;; All rights reserved. ;; ;; Redistribution and use in source and binary forms, with or without @@ -15,7 +15,7 @@ ;; the documentation and/or other materials provided with the ;; distribution. ;; -;; - Neither the name of The Numerical ALgorithms Group Ltd. nor the +;; - Neither the name of The Numerical Algorithms Group Ltd. nor the ;; names of its contributors may be used to endorse or promote products ;; derived from this software without specific prior written permission. ;; @@ -33,32 +33,11 @@ -(import-module "sys-macros") +(import-module "boot-pkg") (in-package "BOOT") -#+(and :Lucid (not :ibm/370)) -(progn - (system:define-foreign-function :c 'open_server :fixnum) - (system:define-foreign-function :c 'sock_get_int :fixnum) - (system:define-foreign-function :c 'sock_send_int :fixnum) - (system:define-foreign-function :c 'sock_get_string_buf :fixnum) - (system:define-foreign-function :c 'sock_send_string_len :fixnum) - (system:define-foreign-function :c 'sock_get_float :single) - (system:define-foreign-function :c 'sock_send_float :fixnum) - (system:define-foreign-function :c 'sock_send_wakeup :fixnum) - (system:define-foreign-function :c 'server_switch :fixnum) - (system:define-foreign-function :c 'flush_stdout :fixnum) - (system:define-foreign-function :c 'sock_send_signal :fixnum) - (system:define-foreign-function :c 'print_line :fixnum) - (system:define-foreign-function :c 'plus_infininty :single) - (system:define-foreign-function :c 'minus_infinity :single) - (system:define-foreign-function :c 'NANQ :single) -) - #+KCL (progn - (clines "extern double plus_infinity(), minus_infinity(), NANQ();") - (clines "extern double sock_get_float();") ;; GCL may pass strings by value. 'sock_get_string_buf' should fill ;; string with data read from connection, therefore needs address of ;; actual string buffer. We use 'sock_get_string_buf_wrapper' to @@ -68,96 +47,12 @@ " if (x->st.st_fillp<j)" " FEerror(\"string too small in sock_get_string_buf_wrapper\",0);" " return sock_get_string_buf(i, x->st.st_self, j); }") - (defentry open_server (string) (int "open_server")) - (defentry sock_get_int (int) (int "sock_get_int")) - (defentry sock_send_int (int int) (int "sock_send_int")) - (defentry sock_get_string_buf (int object int) + (defentry |sockGetString| (int object int) (int "sock_get_string_buf_wrapper")) - (defentry sock_send_string_len (int string int) (int "sock_send_string_len")) - (defentry sock_get_float (int) (double "sock_get_float")) - (defentry sock_send_float (int double) (int "sock_send_float")) - (defentry sock_send_wakeup (int int) (int "sock_send_wakeup")) - (defentry server_switch () (int "server_switch")) - (defentry flush_stdout () (int "flush_stdout")) - (defentry sock_send_signal (int int) (int "sock_send_signal")) - (defentry print_line (string) (int "print_line")) - (defentry plus_infinity () (double "plus_infinity")) - (defentry minus_infinity () (double "minus_infinity")) - (defentry NANQ () (double "NANQ")) ) -(defun open-server (name) -#+(and :lucid :ibm/370) -2 -#-(and :lucid :ibm/370) - (open_server name)) -(defun sock-get-int (type) -#+(and :lucid :ibm/370) () -#-(and :lucid :ibm/370) - (sock_get_int type)) -(defun sock-send-int (type val) -#+(and :lucid :ibm/370) () -#-(and :lucid :ibm/370) - (sock_send_int type val)) -(defun sock-get-string (type buf buf-len) -#+(and :lucid :ibm/370) () -#-(and :lucid :ibm/370) - (sock_get_string_buf type buf buf-len)) -(defun sock-send-string (type str) -#+(and :lucid :ibm/370) () -#-(and :lucid :ibm/370) - (sock_send_string_len type str (length str))) -(defun sock-get-float (type) -#+(and :lucid :ibm/370) () -#-(and :lucid :ibm/370) - (sock_get_float type)) -(defun sock-send-float (type val) -#+(and :lucid :ibm/370) () -#-(and :lucid :ibm/370) - (sock_send_float type val)) -(defun sock-send-wakeup (type) -#+(and :lucid :ibm/370) () -#-(and :lucid :ibm/370) - (sock_send_wakeup type)) -(defun server-switch () -#+(and :lucid :ibm/370) () -#-(and :lucid :ibm/370) - (server_switch)) -(defun sock-send-signal (type signal) -#+(and :lucid :ibm/370) () -#-(and :lucid :ibm/370) - (sock_send_signal type signal)) -(defun print-line (str) -#+(and :lucid :ibm/370) () -#-(and :lucid :ibm/370) - (print_line str)) -(defun |plusInfinity| () (plus_infinity)) -(defun |minusInfinity| () (minus_infinity)) - ;; Macros for use in Boot -(defun |openServer| (name) - (open_server name)) -(defun |sockGetInt| (type) - (sock_get_int type)) -(defun |sockSendInt| (type val) - (sock_send_int type val)) -(defun |sockGetString| (type buf buf-len) - (sock_get_string_buf type buf buf-len)) -(defun |sockSendString| (type str) - (sock_send_string_len type str (length str))) -(defun |sockGetFloat| (type) - (sock_get_float type)) -(defun |sockSendFloat| (type val) - (sock_send_float type val)) -(defun |sockSendWakeup| (type) - (sock_send_wakeup type)) -(defun |serverSwitch| () - (server_switch)) -(defun |sockSendSignal| (type signal) - (sock_send_signal type signal)) -(defun |printLine| (str) - (print_line str)) - ;; Socket types. This list must be consistent with the one in com.h (defconstant SessionManager 1) @@ -231,11 +126,3 @@ (defconstant SIGUSR1 30) ;; user defined signal 1 (defconstant SIGUSR2 31) ;; user defined signal 2 ) - -(setq |$NaNvalue| (NANQ)) -#-:ccl - (setq |$plusInfinity| (* 1.1 MOST-POSITIVE-LONG-FLOAT)) -#+:ccl - (setq |$plusInfinity| MOST-POSITIVE-LONG-FLOAT) -(setq |$minusInfinity| (- |$plusInfinity|)) - |