diff --git a/bin/makefile-sunos4.1.sparc-x b/bin/makefile-sunos4.1.sparc-x index c5985b8..a341cb6 100644 --- a/bin/makefile-sunos4.1.sparc-x +++ b/bin/makefile-sunos4.1.sparc-x @@ -1,10 +1,5 @@ # Options for SunOS4, SPARC and X-Window -CLXFLAGS = -DCLX -DTCP_NODELAY - -CLXFILES = $(OBJECTDIR)socket.o \ - $(OBJECTDIR)socdvr.o - XFILES = $(OBJECTDIR)XClose.o \ $(OBJECTDIR)Cursor.o \ $(OBJECTDIR)XWindow.o \ @@ -28,11 +23,10 @@ XFILES = $(OBJECTDIR)XClose.o \ $(OBJECTDIR)XMouse.o \ $(OBJECTDIR)Xsubwin.o \ $(OBJECTDIR)Xcolor.o \ - $(OBJECTDIR)Xwinman.o \ - $(CLXFILES) + $(OBJECTDIR)Xwinman.o XVERSION = XV11R4 -XFLAGS = -DXWINDOW -D$(XVERSION) $(CLXFLAGS) +XFLAGS = -DXWINDOW -D$(XVERSION) # This is to make the %$#@! Apollo cc happy OEXT = .o diff --git a/bin/makefile-sunos4.sparc-x b/bin/makefile-sunos4.sparc-x index 4e3b742..c44d460 100644 --- a/bin/makefile-sunos4.sparc-x +++ b/bin/makefile-sunos4.sparc-x @@ -1,11 +1,5 @@ # Options for SunOS4, SPARC and X-Window -# CLXFLAGS = -DTCP_NODELAY - -#CLXFILES = $(OBJECTDIR)socket.o \ -# $(OBJECTDIR)socdvr.o - - XFILES = $(OBJECTDIR)xmkicon.o \ $(OBJECTDIR)xbbt.o \ $(OBJECTDIR)dspif.o \ @@ -19,7 +13,7 @@ XFILES = $(OBJECTDIR)xmkicon.o \ CC = gcc XVERSION = XV11R4 -XFLAGS = -DXWINDOW -DNOPIXRECT -D$(XVERSION) # $(CLXFLAGS) +XFLAGS = -DXWINDOW -DNOPIXRECT -D$(XVERSION) # This is to make the %$#@! Apollo cc happy OEXT = .o diff --git a/bin/makefile-sunos5.386-x b/bin/makefile-sunos5.386-x index dc344a6..474f10a 100644 --- a/bin/makefile-sunos5.386-x +++ b/bin/makefile-sunos5.386-x @@ -23,7 +23,7 @@ XFILES = $(OBJECTDIR)xmkicon.o \ $(OBJECTDIR)xwinman.o XVERSION = XV11R4 -XFLAGS = -DXWINDOW -DNOPIXRECT -D$(XVERSION) $(CLXFLAGS) +XFLAGS = -DXWINDOW -DNOPIXRECT -D$(XVERSION) # This is to make the %$#@! Apollo cc happy OEXT = .o diff --git a/bin/makefile-sunos5.i386-x b/bin/makefile-sunos5.i386-x index 9047097..9dc9de3 100644 --- a/bin/makefile-sunos5.i386-x +++ b/bin/makefile-sunos5.i386-x @@ -23,7 +23,7 @@ XFILES = $(OBJECTDIR)xmkicon.o \ $(OBJECTDIR)xwinman.o XVERSION = XV11R4 -XFLAGS = -DXWINDOW -D$(XVERSION) $(CLXFLAGS) +XFLAGS = -DXWINDOW -D$(XVERSION) # This is to make the %$#@! Apollo cc happy OEXT = .o diff --git a/bin/makefile-sunos5.sparc-x b/bin/makefile-sunos5.sparc-x index 555ec72..86108c3 100644 --- a/bin/makefile-sunos5.sparc-x +++ b/bin/makefile-sunos5.sparc-x @@ -30,7 +30,7 @@ XFILES = $(OBJECTDIR)xmkicon.o \ $(OBJECTDIR)xwinman.o XVERSION = XV11R4 -XFLAGS = -DXWINDOW -D$(XVERSION) $(CLXFLAGS) +XFLAGS = -DXWINDOW -D$(XVERSION) # This is to make the %$#@! Apollo cc happy OEXT = .o diff --git a/bin/makefile-sunos5.x86_64-x b/bin/makefile-sunos5.x86_64-x index 96226d6..966f970 100644 --- a/bin/makefile-sunos5.x86_64-x +++ b/bin/makefile-sunos5.x86_64-x @@ -23,7 +23,7 @@ XFILES = $(OBJECTDIR)xmkicon.o \ $(OBJECTDIR)xwinman.o XVERSION = XV11R4 -XFLAGS = -DXWINDOW -DNOPIXRECT -D$(XVERSION) $(CLXFLAGS) +XFLAGS = -DXWINDOW -DNOPIXRECT -D$(XVERSION) # This is to make the %$#@! Apollo cc happy OEXT = .o diff --git a/bin/makefile-tail b/bin/makefile-tail index c47d93d..9c76da5 100755 --- a/bin/makefile-tail +++ b/bin/makefile-tail @@ -806,14 +806,6 @@ $(OBJECTDIR)array6.o : $(SRCDIR)array6.c $(REQUIRED-INCS) $(INCDIR)lispemul.h $(INCDIR)arith.h $(INCDIR)my.h $(CC) $(RFLAGS) $(SRCDIR)array6.c $(INLINE) -o $(OBJECTDIR)array6$(OEXT) -$(OBJECTDIR)socket.o : $(SRCDIR)socket.c $(REQUIRED-INCS) - $(CC) $(RFLAGS) $(SRCDIR)socket.c -o $(OBJECTDIR)socket$(OEXT) - -$(OBJECTDIR)socdvr.o : $(SRCDIR)socdvr.c $(REQUIRED-INCS) $(INCDIR)lispemul.h \ - $(INCDIR)adr68k.h $(INCDIR)lsptypes.h $(INCDIR)lispmap.h \ - $(INCDIR)arith.h - $(CC) $(RFLAGS) $(SRCDIR)socdvr.c -o $(OBJECTDIR)socdvr$(OEXT) - $(OBJECTDIR)sxhash.o : $(SRCDIR)sxhash.c $(REQUIRED-INCS) $(INCDIR)lispemul.h \ $(INCDIR)lspglob.h $(INCDIR)adr68k.h \ $(INCDIR)lispmap.h $(INCDIR)lsptypes.h $(INCDIR)emlglob.h \ diff --git a/bin/u2dnames.sed b/bin/u2dnames.sed index 4c56e0e..ce384c9 100755 --- a/bin/u2dnames.sed +++ b/bin/u2dnames.sed @@ -29,7 +29,6 @@ s/miscstats/miscstat/g s/osmessage/osmsg/g s/osmessage/osmsg/g s/setsysout/setsout/g -s/socketdvr/socdvr/g s/usersubrs/usrsubr/g s/InitXevent/Xinit/g s/LispWindow/Xlspwin/g diff --git a/bin/unix2dos.sed b/bin/unix2dos.sed index 809e7f6..5941983 100755 --- a/bin/unix2dos.sed +++ b/bin/unix2dos.sed @@ -29,7 +29,6 @@ s/miscstats\.h/miscstat\.h/g s/osmessage\.c/osmsg\.c/g s/osmessage\.h/osmsg\.h/g s/setsysout\.c/setsout\.c/g -s/socketdvr\.c/socdvr\.c/g s/usersubrs\.c/usrsubr\.c/g s/InitXevent\.c/Xinit\.c/g s/LispWindow\.c/Xlspwin\.c/g diff --git a/src/socdvr.c b/src/socdvr.c deleted file mode 100644 index d824e4b..0000000 --- a/src/socdvr.c +++ /dev/null @@ -1,277 +0,0 @@ -/* $Id: socdvr.c,v 1.2 1999/01/03 02:07:33 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved - */ - -/************************************************************************/ -/* */ -/* (C) Copyright 1989-95 Venue. All Rights Reserved. */ -/* Manufactured in the United States of America. */ -/* */ -/************************************************************************/ - -#include "version.h" - -#include -#include -#include -#include -#include - -#include "lispemul.h" -#include "arith.h" -#include "adr68k.h" -#include "lsptypes.h" -#include "lispmap.h" - -#define min(x, y) (((x) > (y)) ? (y) : (x)) - -/***********************************************************/ -/* L S t r i n g T o C S t r i n g */ -/* */ -/* Convert a lisp string to a C string up to MaxLen long. */ -/***********************************************************/ - -#define LStringToCString(Lisp, C, MaxLen, Len) \ - { \ - OneDArray *arrayp; \ - char *base; \ - short *sbase; \ - int i; \ - \ - arrayp = (OneDArray *)(Addr68k_from_LADDR((unsigned int)Lisp)); \ - Len = min(MaxLen, arrayp->fillpointer); \ - \ - switch (arrayp->typenumber) { \ - case THIN_CHAR_TYPENUMBER: \ - base = \ - ((char *)(Addr68k_from_LADDR((unsigned int)arrayp->base))) + ((int)(arrayp->offset)); \ - for (i = 0; i < Len; i++) C[i] = base[i]; \ - C[Len] = '\0'; \ - break; \ - \ - case FAT_CHAR_TYPENUMBER: \ - sbase = \ - ((short *)(Addr68k_from_LADDR((unsigned int)arrayp->base))) + ((int)(arrayp->offset)); \ - base = (char *)sbase; \ - for (i = 0; i < Len * 2; i++) C[i] = base[i]; \ - C[Len * 2] = '\0'; \ - break; \ - \ - default: error("LStringToCString can not handle\n"); \ - } \ - } - -#define FGetNum(ptr, place) \ - { \ - if (((ptr)&SEGMASK) == S_POSITIVE) { \ - (place) = ((ptr)&0xffff); \ - } else if (((ptr)&SEGMASK) == S_NEGATIVE) { \ - (place) = (int)((ptr) | 0xffff0000); \ - } else { \ - return (NIL); \ - } \ - } - -#define MAX_NAME_LEN 256 -static char XServer_Name[MAX_NAME_LEN]; /* Name of host with X server */ -static int XPort_Number = 0; /* Display # to ask for on it */ - -int XServer_Fd = -1; /* The socket for the X server */ - -extern DLword *Lisp_world; - -/************************************************************************/ -/* */ -/* O p e n _ S o c k e t */ -/* */ -/* Open a connection to an X server, by calling the CLX routine */ -/* "connect_to_server". Returns T if successful, and NIL if not. */ -/* The socket's fd is left in XServer_Fd, a global, so only one */ -/* server connection can be open at one time (FIX THIS). */ -/* */ -/* args[0] - The lisp string name of the host the server is on */ -/* args[1] - The SMALLP server-number we're connecting to. */ -/* */ -/************************************************************************/ - -LispPTR Open_Socket(LispPTR *args) -{ -#ifdef TRACE - printf("TRACE: Open_Socket()\n"); -#endif - - int length; - - LStringToCString(args[0], XServer_Name, MAX_NAME_LEN, length); - FGetNum(args[1], XPort_Number); - XPort_Number -= X_TCP_PORT; - - if (XServer_Fd == -1) { - XServer_Fd = connect_to_server(XServer_Name, XPort_Number); - - if (XServer_Fd < 0) /* error in connect. */ - { - perror("connecting to X server"); - return (NIL); - } - - { /* Make it non-blocking I/O */ - int res; - res = fcntl(XServer_Fd, F_GETFL); - res |= FNDELAY; - res = fcntl(XServer_Fd, F_SETFL, res); - } - } /* end if(XServer_Fd) */ - - return (ATOM_T); -} - -/************************************************************************/ -/* */ -/* C l o s e _ S o c k e t */ -/* */ -/* Close the socket connection to the X server. */ -/* */ -/************************************************************************/ - -LispPTR Close_Socket() { - int stat; - -#ifdef TRACE - printf("TRACE: Close_Socket()\n"); -#endif - - if ((stat = close(XServer_Fd)) == - -1) { /* close failed; return NIL, but squash the old fd anyhow */ - XServer_Fd = -1; - perror("Close_socket"); - return (NIL); - } else { /* close succeeded; return T. */ - XServer_Fd = -1; - return (ATOM_T); - } -} /* end Close_Socket */ - -/************************************************************************/ -/* */ -/* R e a d _ S o c k e t */ -/* */ -/* Read up to 1 packet's worth from the X-server socket. */ -/* */ -/************************************************************************/ - -typedef struct { /* Format for an X-server packet */ - DLword nil[22]; /* Packet header */ - DLword length; /* Request byte length */ - char data[592]; /* Data body */ -} PACKET; - -#define PACKET_DEFOFFSET 46 -#define PACKET_MAXSIZE 638 - -LispPTR Read_Socket(LispPTR *args) -{ - PACKET *packet; - char *buffer; - int length, actlen; - -#ifdef TRACE - printf("TRACE: Read_Socket()\n"); -#endif - - if (XServer_Fd >= 0) { - packet = (PACKET *)Addr68k_from_LADDR(args[0]); - - if ((length = (int)(packet->length) - PACKET_DEFOFFSET) > 0) { - buffer = &(packet->data[0]); - - if ((actlen = read(XServer_Fd, buffer, length)) > 0) { - packet->length = (DLword)(actlen + PACKET_DEFOFFSET); - return (ATOM_T); - } /* end if(actlen) */ - if (actlen < 0) /* error !*/ - { - if ((errno != EWOULDBLOCK) & (errno != EINTR)) perror("reading X connection"); - return (NIL); - } - - } /* end if(length) */ - - } /* end if( fd ) */ - - return (NIL); - -} /* end Read_Socket */ - -/************************************************************************/ -/* */ -/* W r i t e _ S o c k e t */ -/* */ -/* Write a packet of information to the X server's socket. */ -/* */ -/************************************************************************/ - -LispPTR Write_Socket(LispPTR *args) -{ - PACKET *packet; - char *buffer; - int length, actlen; - -#ifdef TRACE - printf("TRACE: Write_Socket()\n"); -#endif - - if (XServer_Fd >= 0) { - packet = (PACKET *)Addr68k_from_LADDR(args[0]); - - if ((length = (int)(packet->length) - PACKET_DEFOFFSET) > 0) { - buffer = &(packet->data[0]); - - if ((actlen = write(XServer_Fd, buffer, length)) > 0) { - packet->length = (DLword)(actlen + PACKET_DEFOFFSET); - return (ATOM_T); - - } /* end if( actlen ) */ - if (actlen < 0) /* error !*/ - { - if (errno != EINTR) perror("writing X connection"); - return (NIL); - } - - } /* end if(length) */ - - } /* end if( fd ) */ - - packet->length = 0; - return (NIL); - -} /* end Write_Socket */ - -/************************************************************************/ -/* */ -/* K b d _ T r a n s i t i o n */ -/* */ -/* Stuff a key transition into the C-level buffer from Lisp. */ -/* */ -/* args[0] - the key number (in lisps terms? Not sure) */ -/* args[1] - upflg -- is it an up or down-transition? */ -/* */ -/************************************************************************/ -extern int KBDEventFlg; - -void Kbd_Transition(LispPTR *args) -/* args[0] is key-number */ -/* args[1] is up-flg */ -{ - DLword key_number; - - key_number = (DLword)(args[0] & 0xffff); - if (args[1]) - kb_trans(key_number, 1); - else - kb_trans(key_number, 0); - - DoRing(); - /* If there's something for lisp to do, ask for an interrupt: */ - if ((KBDEventFlg += 1) > 0) Irq_Stk_End = Irq_Stk_Check = 0; - -} /* end Kbd_Transition */ diff --git a/src/socket.c b/src/socket.c deleted file mode 100644 index 7f00306..0000000 --- a/src/socket.c +++ /dev/null @@ -1,122 +0,0 @@ -/* $Id: socket.c,v 1.2 1999/01/03 02:07:34 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved - */ -/* Copyright Massachusetts Institute of Technology 1988 */ -/* - * THIS IS AN OS DEPENDENT FILE! It should work on 4.2BSD derived - * systems. VMS and System V should plan to have their own version. - * - * This code was cribbed from lib/X/XConnDis.c. - * Compile using - * % cc -c socket.c -DUNIXCONN - */ - -#include "version.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef UNIXCONN -#include -#ifndef X_UNIX_PATH -#define X_UNIX_PATH "/tmp/.X11-unix/X" -#endif /* X_UNIX_PATH */ -#endif /* UNIXCONN */ -void bcopy(); - -/* - * Attempts to connect to server, given host and display. Returns file - * descriptor (network socket) or 0 if connection fails. - */ - -int connect_to_server(char *host, int display) -{ - struct sockaddr_in inaddr; /* INET socket address. */ - struct sockaddr *addr; /* address to connect to */ - struct hostent *host_ptr; - int addrlen; /* length of address */ -#ifdef UNIXCONN - struct sockaddr_un unaddr; /* UNIX socket address. */ -#endif - extern char *getenv(); - extern struct hostent *gethostbyname(); - int fd; /* Network socket */ - { -#ifdef UNIXCONN - if ((host[0] == '\0') || (strcmp("unix", host) == 0)) { - /* Connect locally using Unix domain. */ - unaddr.sun_family = AF_UNIX; - (void)strcpy(unaddr.sun_path, X_UNIX_PATH); - sprintf(&unaddr.sun_path[strlen(unaddr.sun_path)], "%d", display); - addr = (struct sockaddr *)&unaddr; - addrlen = strlen(unaddr.sun_path) + 2; - /* - * Open the network connection. - */ - if ((fd = socket((int)addr->sa_family, SOCK_STREAM, 0)) < 0) - return (-1); /* errno set by system call. */ - } else -#endif - { - /* Get the statistics on the specified host. */ - if ((inaddr.sin_addr.s_addr = inet_addr(host)) == -1) { - if ((host_ptr = gethostbyname(host)) == NULL) { - /* No such host! */ - errno = EINVAL; - return (-1); - } - /* Check the address type for an internet host. */ - if (host_ptr->h_addrtype != AF_INET) { - /* Not an Internet host! */ - errno = EPROTOTYPE; - return (-1); - } - /* Set up the socket data. */ - inaddr.sin_family = host_ptr->h_addrtype; - bcopy((char *)host_ptr->h_addr, (char *)&inaddr.sin_addr, sizeof(inaddr.sin_addr)); - } else { - inaddr.sin_family = AF_INET; - } - addr = (struct sockaddr *)&inaddr; - addrlen = sizeof(struct sockaddr_in); - inaddr.sin_port = display + X_TCP_PORT; - inaddr.sin_port = htons(inaddr.sin_port); - /* - * Open the network connection. - */ - if ((fd = socket((int)addr->sa_family, SOCK_STREAM, 0)) < 0) { - return (-1); /* errno set by system call. */ - } -/* make sure to turn off TCP coalescence */ -#ifdef TCP_NODELAY - { - int mi = 1; - setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &mi, sizeof(int)); - } -#endif - } - - /* - * Changed 9/89 to retry connection if system call was interrupted. This - * is necessary for multiprocessing implementations that use timers, - * since the timer results in a SIGALRM. -- jdi - */ - while (connect(fd, addr, addrlen) == -1) { - if (errno != EINTR) { - (void)close(fd); - return (-1); /* errno set by system call. */ - } - } - } - /* - * Return the id if the connection succeeded. - */ - return (fd); -} diff --git a/src/subr.c b/src/subr.c index bb01b4e..821d93b 100644 --- a/src/subr.c +++ b/src/subr.c @@ -704,36 +704,6 @@ void OP_subrcall(int subr_no, int argnum) { TopOfStack = ATOM_T; break; } -/*******************/ -/* CLX Support ops */ -/*******************/ -#ifdef NEVER /* CLX */ - case sb_OPEN_SOCKET: { - POP_SUBR_ARGS; - TopOfStack = Open_Socket(args); - break; - } - case sb_CLOSE_SOCKET: { - TopOfStack = Close_Socket(); - break; - } - case sb_READ_SOCKET: { - POP_SUBR_ARGS; - TopOfStack = Read_Socket(args); - break; - } - case sb_WRITE_SOCKET: { - POP_SUBR_ARGS; - TopOfStack = Write_Socket(args); - break; - } - case 0244: /* KB_TRANSITION */ - { - POP_SUBR_ARGS; - TopOfStack = Kbd_Transition(args); - break; - } -#endif /* CLX */ #ifndef NOFORN /*****************************************/