1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-03-04 02:15:03 +00:00

Start by removing all the ifdef'd DOS code in source and include files

This commit is contained in:
Nick Briggs
2021-02-15 17:32:58 -08:00
parent 081e2288ff
commit 1b869932d8
41 changed files with 11 additions and 2280 deletions

View File

@@ -49,12 +49,7 @@ extern int DisplayRasterWidth;
#define MOUSEYH ((int)*EmMouseY68K + YDELTA)
#ifdef DOS
#define HideCursor { (currentdsp->mouse_invisible)(currentdsp, IOPage68K); }
#define ShowCursor { (currentdsp->mouse_visible)(IOPage68K->dlmousex, \
IOPage68K->dlmousey); }
#elif defined(SUNDISPLAY) && defined(OLD_CURSOR)
#if defined(SUNDISPLAY) && defined(OLD_CURSOR)
extern struct winlock DisplayLockArea;
#define HideCursor \
ioctl( LispWindowFd, WINLOCKSCREEN, &DisplayLockArea)
@@ -82,14 +77,7 @@ extern DLword *EmCursorX68K,*EmCursorY68K;
/* Macro for locking and unlocking screen to prevent multiple updates */
#ifdef DOS
#define LOCKSCREEN currentdsp->device.locked++;
#define UNLOCKSCREEN currentdsp->device.locked--;
#else
#define LOCKSCREEN ScreenLocked = T;
#define UNLOCKSCREEN ScreenLocked = NIL;
#endif /* DOS */
#endif /* BITBLT_H */

View File

@@ -154,19 +154,6 @@ typedef struct
{
DevRec device;
PFV device_event; /* Event handler for the keyboard. */
#ifdef DOS
u_char KeyMap[0x80]; /* The key translation table. Use the keycode you
get from the keyboard as an index. The value
gives the lispkeycode.*/
unsigned char lastbyte; /* Last byte that we got from the keyboard. */
unsigned int keyeventsize; /* The sizeof() one kbd event */
unsigned int maxkeyevent; /* Offset to the end of the ringbuffer. */
int eurokbd; /* Keep tabs of the euro-ness of the kbd */
PFV prev_handler; /* The previous keyboard handler.
Keep this around
to restore when we exit Medley */
int URaid; /* Put this in a better place later.. /jarl */
#endif /* DOS */
} KbdInterfaceRec, *KbdInterface;
@@ -221,20 +208,7 @@ typedef struct
unsigned long oldstate; /* Keep the old state around */
unsigned long graphicsmode; /* Magic cookie used to set the state. */
unsigned long numberofbanks;
#ifdef DOS
unsigned long BytesPerLine;
unsigned long DisplayStartAddr;
unsigned long DisplaySegSize;
unsigned long DisplaySegMagnitude;
unsigned long LinesPerBank;
unsigned short LastLineLen[32]; /* length of last line fragment per bank */
unsigned short LinesInBank[32]; /* True # of full lines in this bank */
/* # of lines we can do with the full-line dumpline */
/* for sure. */
unsigned short LinesBeforeBank[32]; /* Scan lines before start of this bank. */
void (* SwitchBank)(); /* Method to switch the bank (see vesa standard) */
#elif XWINDOW
#if XWINDOW
char *identifier;
int BitGravity;
Display *display_id;

View File

@@ -1,9 +1,6 @@
#ifndef DIRDEFS_H
#define DIRDEFS_H 1
#include "lispemul.h" /* for LispPTR */
#ifdef DOS
int make_old_version(char *old, char *file);
#endif
#ifdef FSDEBUG
void print_finfo(FINFO *fp);
#endif

View File

@@ -44,10 +44,6 @@ extern DLword *DISP_MAX_Address;
#define DISPLAYBUFFER
#endif /* XWINDOW */
#ifdef DOS
#define DISPLAYBUFFER
#endif /* DOS */
#ifdef DISPLAYBUFFER
/************************************************************************/
/* */

View File

@@ -1,11 +1,7 @@
#ifndef DSKDEFS_H
#define DSKDEFS_H 1
#include "lispemul.h" /* for LispPTR */
#ifdef DOS
void separate_host(char *lfname, char *host, char *drive);
#else
void separate_host(char *lfname, char *host);
#endif
LispPTR COM_openfile(register LispPTR *args);
LispPTR COM_closefile(register LispPTR *args);
LispPTR DSK_getfilename(register LispPTR *args);

View File

@@ -15,10 +15,6 @@
typedef struct {
u_char KeyMap[0x80];
#ifdef DOS
u_char lastbyte;
void (*prev_handler)();
#endif /* DOS */
void (* sync_device)(); /* Make reality and emulator coincide with each other */
void (* enter_device)();
void (* exit_device)();
@@ -26,9 +22,5 @@ typedef struct {
void (* before_raid)();
void (* after_raid)();
int lispkeycode;
#ifdef DOS
int device_active;
int device_locked;
#endif /* DOS */
} KbdInterfaceRec, *KbdInterface;
#endif /* KBDIF_H */

View File

@@ -312,16 +312,8 @@ extern DLword *Lisp_world; /* To access LispSysout area */
* They might be lost in the course of the conversion.
*
*/
#ifdef DOS
/* DOS version of LispVersionToUnixVersion */
/* * * * * This is done this way because DOS can't handle the non-DOS version -- */
/* * * * * it gave "Too many characters in a character constant" errors! */
#include "lispver1.h"
#else /* DOS */
/* NON-DOS version of the macro LispVersionToUnixVersion */
#include "lispver2.h"
#endif /* DOS */
/*
@@ -501,13 +493,9 @@ extern DLword *Lisp_world; /* To access LispSysout area */
(((varray)->version_no == LASTVERSIONARRAY)? 1 : 0)
#ifdef DOS
#define OnlyVersionlessP(varray) 0
#else
#define OnlyVersionlessP(varray) \
#define OnlyVersionlessP(varray) \
(((varray)->version_no == 0 && ((varray) + 1)->version_no == LASTVERSIONARRAY) ? \
1 : 0)
#endif /* DOS */
/* An argument of AddDotNoExtension must be LispVersion convention */
/* Like "foo/fee.fee;3" or "/foo/foo;3" */
@@ -622,13 +610,6 @@ extern int errno;
/* DRIVESEP = OS-specific drive separator character. */
/* (only used with DOS as of 3/93) */
/********************************************************/
#ifdef DOS
#define DIRSEP '\\'
#define DIRSEPSTR "\\"
#define DRIVESEP ':'
#define UNIXDIRSEP '/'
#define MAXNAMLEN _MAX_PATH
#else
#define DIRSEPSTR "/"
#define DIRSEP '/'
#define UNIXDIRSEP '/'
@@ -636,6 +617,5 @@ extern int errno;
#if !defined(MAXNAMLEN)
#define MAXNAMLEN NAME_MAX
#endif
#endif
#endif /* LOCFILE_H */

View File

@@ -39,11 +39,6 @@ extern volatile sig_atomic_t FP_error;
#define FPCLEAR FP_error = 0;
#define FPTEST(result) FP_error
#elif defined(DOS)
#include <i32.h>
#define FPCLEAR
#define FPTEST(result) (_getrealerror() & ( I87_ZERO_DIVIDE | I87_OVERFLOW | I87_UNDERFLOW))
#else
#include <math.h>
#define FPCLEAR

View File

@@ -5,11 +5,7 @@ LispPTR UFS_getfilename(LispPTR *args);
LispPTR UFS_deletefile(LispPTR *args);
LispPTR UFS_renamefile(LispPTR *args);
LispPTR UFS_directorynamep(LispPTR *args);
#ifdef DOS
int unixpathname(char *src, char *dst, int versionp, int genp, char *drive, int *extlenptr, char *rawname);
#else
int unixpathname(char *src, char *dst, int versionp, int genp);
#endif
int lisppathname(char *fullname, char *lispname, int dirp, int versionp);
int quote_fname(char *file);
int quote_fname_ufs(char *file);

View File

@@ -233,15 +233,7 @@ error Must specify RELEASE to build Medley.
/* */
/********************************************************/
#ifdef DOS
typedef unsigned char u_char;
typedef unsigned long u_int;
typedef unsigned short u_short;
#undef UNALIGNED_FETCH_OK
#define USHORT unsigned
#else
#define USHORT unsigned short
#endif /* DOS */
/****************************************************************/
/* End of architecture-specific flag settings */

View File

@@ -28,9 +28,7 @@
#include <stdlib.h>
#ifdef XWINDOW
#ifndef DOS
#include <sys/ioctl.h>
#endif /* DOS */
#include <sys/types.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
@@ -453,11 +451,7 @@ void bitbltsub(LispPTR *argv) {
}
do_it_now:
#ifdef DOS
currentdsp->device.locked++;
#else
ScreenLocked = T;
#endif /* DOS */
#ifdef REALCURSOR
displayflg |= n_new_cursorin(dstbase, dx, dty, w, h);
@@ -489,23 +483,11 @@ do_it_now:
XUNLOCK;
#endif /* XWINDOW */
#ifdef DOS
/* Copy the changed section of display bank to the frame buffer */
if (in_display_segment(dstbase)) {
/* DBPRINT(("bltsub: x %d, y %d, w %d, h %d.\n",dx, dty, w,h)); */
flush_display_region(dx, dty, w, h);
}
#endif /* DOS */
#ifdef REALCURSOR
if (displayflg) ShowCursor;
#endif /* REALCURSOR */
#ifdef DOS
currentdsp->device.locked--;
#else
ScreenLocked = NIL;
#endif /* DOS */
} /* end of bitbltsub */
@@ -846,14 +828,6 @@ do_it_now:
XUNLOCK;
#endif /* XWINDOW */
#ifdef DOS
/* Copy the changed section of display bank to the frame buffer */
if (in_display_segment(dstbase)) {
/* DBPRINT(("bltsub: x %d, y %d, w %d, h %d.\n",dx, dty, w,h)); */
flush_display_region(dlx, dty, width, height);
}
#endif /* DOS */
#ifdef REALCURSOR
if (displayflg) ShowCursor;
#endif /* REALCURSOR */
@@ -1095,14 +1069,6 @@ do_it_now:
XUNLOCK;
#endif /* XWINDOW */
#ifdef DOS
/* Copy the changed section of display bank to the frame buffer */
if (in_display_segment(dstbase)) {
/* DBPRINT(("bltsub: x %d, y %d, w %d, h %d.\n",dx, dty, w,h)); */
flush_display_region(left, dty, width, height);
}
#endif /* DOS */
#ifdef REALCURSOR
if (displayflg) ShowCursor;
#endif /* REALCURSOR */
@@ -1227,10 +1193,6 @@ void bltchar(LispPTR *args)
XUNLOCK;
#endif /* XWINDOW */
#ifdef DOS
if (in_display_segment(dstbase)) flush_display_lineregion(dx, dstbase, w, h);
#endif /* DOS */
#ifdef REALCURSOR
if (displayflg) ShowCursor;
#endif /* REALCURSOR */
@@ -1321,10 +1283,6 @@ LispPTR bltchar(LispPTR *args)
XUNLOCK;
#endif /* XWINDOW */
#ifdef DOS
if (in_display_segment(dstbase)) flush_display_lineregion(dx, dstbase, w, h);
#endif /* DOS */
#ifdef REALCURSOR
if (displayflg) ShowCursor;
#endif /* REALCURSOR */
@@ -1535,9 +1493,6 @@ void newbltchar(LispPTR *args) {
#ifdef XWINDOW
if (in_display_segment(dstbase)) flush_display_lineregion(dx, dstbase, w, h);
#endif /* XWINDOW */
#ifdef DOS
if (in_display_segment(dstbase)) flush_display_lineregion(dx, dstbase, w, h);
#endif /* DOS */
#ifdef REALCURSOR
if (displayflg) ShowCursor;
@@ -1679,11 +1634,6 @@ LispPTR newbltchar(LispPTR *args) {
flush_display_lineregion(left, dstbase, (right - left), pbt->pbtheight);
#endif /* XWINDOW */
#ifdef DOS
if (in_display_segment(dstbase)) flush_display_lineregion(dx, dstbase, w, h);
if (displayflg) ShowCursor;
#endif /* DOS */
ScreenLocked = NIL;
/****** OLD bltchar *****/

View File

@@ -46,13 +46,6 @@
extern int kbd_for_makeinit;
#endif
#ifdef DOS
#include "devif.h"
#include "iopage.h"
extern DspInterface currentdsp;
extern IOPAGE *IOPage68K;
#endif
extern int LispWindowFd;
extern int ScreenLocked;
@@ -105,11 +98,7 @@ LispPTR N_OP_pilotbitblt(LispPTR pilot_bt_tbl,int tos)
sx = pbt->pbtsourcebit;
backwardflg = pbt->pbtbackward;
/* if displayflg != 0 then source or destination is DisplayBitMap */
#ifdef DOS
currentdsp->device.locked++;
#else
ScreenLocked = T;
#endif /* DOS */
#if SUNDISPLAY || DOS
displayflg = cursorin(pbt->pbtdesthi, (pbt->pbtdestlo + (dx >> 4)), w, h, backwardflg) ||
@@ -129,9 +118,6 @@ LispPTR N_OP_pilotbitblt(LispPTR pilot_bt_tbl,int tos)
#ifdef SUNDISPLAY
if (displayflg) HideCursor;
#elif DOS
if (displayflg) (currentdsp->mouse_invisible)(currentdsp, IOPage68K);
;
#endif /* SUNDISPLAY / DOS */
new_bitblt_code
@@ -145,20 +131,13 @@ LispPTR N_OP_pilotbitblt(LispPTR pilot_bt_tbl,int tos)
if (in_display_segment(dstbase)) flush_display_lineregion(dx, dstbase, w, h);
#endif
if (displayflg) ShowCursor;
#elif DOS
flush_display_lineregion(dx, dstbase, w, h);
if (displayflg) (currentdsp->mouse_visible)(IOPage68K->dlmousex, IOPage68K->dlmousey);
#endif /* SUNDISPLAY / DOS */
#ifdef XWINDOW
flush_display_lineregion(dx, dstbase, w, h);
#endif /* XWINDOW */
#ifdef DOS
currentdsp->device.locked--;
#else
ScreenLocked = NIL;
#endif /* DOS */
return (pilot_bt_tbl);

View File

@@ -25,7 +25,6 @@
#include <string.h>
#include <unistd.h>
#ifndef DOS
#include <dirent.h>
#include <stdio.h>
#include <sys/types.h>
@@ -34,7 +33,6 @@
#include <sys/param.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#endif /* DOS */
#include "lispemul.h"
#include "lispmap.h"
@@ -75,7 +73,6 @@ LispPTR CHAR_openfile(LispPTR *args)
/* args[1] access */
/* args[2] errno */
{
#ifndef DOS
register int fd; /* return value of open system call. */
register int flags; /* open system call's argument */
/* struct stat statbuf; */
@@ -106,7 +103,6 @@ LispPTR CHAR_openfile(LispPTR *args)
fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK);
return (GetSmallp(fd));
#endif /* DOS */
}
/************************************************************************/
@@ -127,7 +123,6 @@ LispPTR CHAR_closefile(LispPTR *args)
/* args[0] fd */
/* args[1] errno */
{
#ifndef DOS
register int fd; /* file descriptor */
register int rval;
Lisp_errno = (int *)(Addr68k_from_LADDR(args[1]));
@@ -148,7 +143,6 @@ LispPTR CHAR_closefile(LispPTR *args)
return (NIL);
}
return (ATOM_T);
#endif /* DOS */
}
/************************************************************************/
@@ -171,7 +165,6 @@ LispPTR CHAR_closefile(LispPTR *args)
LispPTR CHAR_ioctl(LispPTR *args)
{
#ifndef DOS
int fd, request;
void *data;
register int rval;
@@ -187,7 +180,6 @@ LispPTR CHAR_ioctl(LispPTR *args)
return (NIL);
}
return (ATOM_T);
#endif /* DOS */
}
/************************************************************************/
@@ -203,7 +195,6 @@ LispPTR CHAR_ioctl(LispPTR *args)
LispPTR CHAR_bin(int fd, LispPTR errn)
{
#ifndef DOS
register int rval;
unsigned char ch[4];
Lisp_errno = (int *)(Addr68k_from_LADDR(errn));
@@ -220,7 +211,6 @@ LispPTR CHAR_bin(int fd, LispPTR errn)
return (NIL);
}
return (GetSmallp(ch[0]));
#endif /* DOS */
}
/************************************************************************/
@@ -235,7 +225,6 @@ LispPTR CHAR_bin(int fd, LispPTR errn)
LispPTR CHAR_bout(int fd, LispPTR ch, LispPTR errn)
{
#ifndef DOS
register int rval;
char buf[4];
Lisp_errno = (int *)(Addr68k_from_LADDR(errn));
@@ -254,7 +243,6 @@ LispPTR CHAR_bout(int fd, LispPTR ch, LispPTR errn)
return (NIL);
}
return (ATOM_T);
#endif /* DOS */
}
/************************************************************************/
@@ -280,7 +268,6 @@ LispPTR CHAR_bout(int fd, LispPTR ch, LispPTR errn)
LispPTR CHAR_bins(LispPTR *args)
{
#ifndef DOS
register int fd, rval;
char *buffer;
int nbytes;
@@ -305,7 +292,6 @@ LispPTR CHAR_bins(LispPTR *args)
#endif /* BYTESWAP */
return (GetSmallp(rval));
#endif /* DOS */
}
/************************************************************************/
@@ -331,7 +317,6 @@ LispPTR CHAR_bins(LispPTR *args)
LispPTR CHAR_bouts(LispPTR *args)
{
#ifndef DOS
register int fd, rval;
char *buffer;
int nbytes;
@@ -359,5 +344,4 @@ LispPTR CHAR_bouts(LispPTR *args)
return (NIL);
}
return (GetSmallp(rval));
#endif /* DOS */
}

View File

@@ -91,7 +91,6 @@ int error(const char *cp) {
fflush(stdout); fflush(stderr);
URaid_currentFX = URMAXFXNUM + 1;
memset(URaid_FXarray, 0, URMAXFXNUM * 4);
#ifndef DOS
{
int stat = fcntl(fileno(stdin), F_GETFL, 0);
if (stat != O_RDONLY && stat != O_RDWR)
@@ -100,7 +99,6 @@ int error(const char *cp) {
exit(0);
}
}
#endif /* DOS */
uraidloop:
if (setjmp(BT_jumpbuf) == 1) goto uraidloop;
if (setjmp(SD_jumpbuf) == 1) goto uraidloop;

View File

@@ -67,18 +67,6 @@ extern int URaid_ArrMAXIndex;
int BT_lines;
int BT_temp;
jmp_buf BT_jumpbuf;
#ifdef DOS
#define BTMAXLINE 24
/* DOS has a 25-line screen, and getchar discards ESC for some reason */
#define BT_morep \
if ((BT_temp != '!') && (++BT_lines > BTMAXLINE)) { \
printf("Press Return(Esc & Ret to quit, ! don't stop):"); \
BT_temp = getch(); \
fflush(stdin); \
BT_lines = 0; \
if (BT_temp == 27) longjmp(BT_jumpbuf, 1); \
}
#else /* DOS */
#define BTMAXLINE 30
#define BT_morep \
if (++BT_lines > BTMAXLINE) { \
@@ -88,7 +76,6 @@ jmp_buf BT_jumpbuf;
BT_lines = 0; \
if (BT_temp == 27) longjmp(BT_jumpbuf, 1); \
}
#endif /* DOS */
/***************************************************************/
/*

527
src/dir.c
View File

@@ -18,16 +18,9 @@
#include <sys/types.h>
#include <unistd.h>
#ifndef DOS
#include <dirent.h>
#include <pwd.h>
#include <sys/param.h>
#else /* DOS, now */
#include <dos.h>
#define MAXPATHLEN _MAX_PATH
#define MAXNAMLEN _MAX_PATH
#define alarm(x) 1
#endif /* DOS */
#include "lispemul.h"
#include "lispmap.h"
@@ -146,12 +139,6 @@ static int match_pattern(char *tp, char *pp)
register char *tsp, *psp;
register int inastr;
#ifdef DOS
/* % is not allowed in DOS names for Medley. */
if (strchr(tp, '%')) return 0;
#endif /* DOS */
for (tsp = tp, psp = pp, inastr = 0;; tp++, pp++) {
switch (*pp) {
case '\0': return ((*tp == '\0') ? 1 : 0);
@@ -191,29 +178,6 @@ static int match_pattern(char *tp, char *pp)
}
}
#ifdef DOS
int make_old_version(char *old, char *file)
{
int len = (int)strlen(file) - 1;
if (file[len] == DIRCHAR) return 0;
/* look up old versions of files for version # 0's */
strcpy(old, file);
if (old[len] == '.')
strcat(old, "%");
else if ((len > 0) && old[len - 1] == '.')
strcat(old, "%");
else if ((len > 1) && old[len - 2] == '.')
strcat(old, "%");
else if ((len > 2) && old[len - 3] == '.')
old[len] = '%';
else
strcat(old, ".%");
return 1;
}
#endif /* DOS */
/************************************************************************/
/******** E N D O F P A T T E R N - M A T C H I N G C O D E *******/
/************************************************************************/
@@ -447,167 +411,6 @@ static int get_finfo_id() {
* of FINFO structures.
*/
#ifdef DOS
static int enum_dsk_prop(char *dir, char *name, char *ver, FINFO **finfo_buf)
{
register struct direct *dp;
register FINFO *prevp;
register FINFO *nextp;
int n, len, rval, res, isslash = 0, drive = 0;
struct find_t dirp;
register struct passwd *pwd;
struct stat sbuf;
char namebuf[MAXPATHLEN];
char fver[VERSIONLEN];
char old[MAXNAMLEN];
/* The null directory has to be special cased */
/* because adjacent \'s in the pathname don't match anything */
if (dir[1] == DRIVESEP) drive = dir[0];
if (strcmp(dir, "\\") == 0)
isslash = 1;
else if (drive && (strcmp(dir + 2, "\\") == 0))
isslash = 1;
if (!isslash)
strcpy(namebuf, dir); /* Only add the dir if it's real */
else if (drive) {
namebuf[0] = drive;
namebuf[1] = DRIVESEP;
namebuf[2] = '\0';
} else
*namebuf = '\0';
strcat(namebuf, DIRSEPSTR);
strcat(namebuf, name);
TIMEOUT(res = _dos_findfirst(namebuf, _A_NORMAL | _A_SUBDIR, &dirp));
if (res < 0) {
*Lisp_errno = errno;
return (-1);
}
for (nextp = prevp = (FINFO *)NULL, n = 0; res == 0;
S_TOUT(res = _dos_findnext(&dirp)), prevp = nextp) {
if (strcmp(dirp.name, ".") == 0 || strcmp(dirp.name, "..") == 0) continue;
MatchP(dirp.name, name, ver, match, unmatch);
unmatch:
continue;
match:
AllocFinfo(nextp);
if (nextp == (FINFO *)NULL) {
FreeFinfo(prevp);
*Lisp_errno = errno;
return (-1);
}
nextp->next = prevp;
if (isslash) {
if (drive)
sprintf(namebuf, "%c:\\%s", drive, dirp.name);
else
sprintf(namebuf, "\\%s", dirp.name);
} else
sprintf(namebuf, "%s\\%s", dir, dirp.name);
TIMEOUT(rval = stat(namebuf, &sbuf));
if (rval == -1 && errno != ENOENT) {
/*
* ENOENT error might be caused by missing symbolic
* link. We should ignore such error here.
*/
FreeFinfo(nextp);
*Lisp_errno = errno;
return (-1);
}
strcpy(namebuf, dirp.name);
if (sbuf.st_mode & S_IFDIR) {
nextp->dirp = 1;
quote_dname(namebuf);
strcpy(nextp->lname, namebuf);
len = strlen(namebuf);
*(nextp->lname + len) = DIRCHAR;
*(nextp->lname + len + 1) = '\0';
nextp->lname_len = len + 1;
} else {
/* All other types than directory. */
nextp->dirp = 0;
strcat(namebuf, ".~1~");
quote_fname(namebuf);
len = strlen(namebuf);
strcpy(nextp->lname, namebuf);
*(nextp->lname + len) = '\0';
nextp->lname_len = len;
}
strcpy(namebuf, dirp.name);
len = strlen(namebuf);
DOWNCASE(namebuf);
strcpy(nextp->no_ver_name, namebuf);
nextp->version = 1;
nextp->ino = sbuf.st_ino;
nextp->prop->length = (unsigned)sbuf.st_size;
nextp->prop->wdate = (unsigned)ToLispTime(sbuf.st_mtime);
nextp->prop->rdate = (unsigned)ToLispTime(sbuf.st_atime);
nextp->prop->protect = (unsigned)sbuf.st_mode;
/* TIMEOUT(pwd = getpwuid(sbuf.st_uid));
if (pwd == (struct passwd *)NULL) {
nextp->prop->au_len = 0;
} else {
len = strlen(pwd->pw_name);
strcpy(nextp->prop->author, pwd->pw_name);
*(nextp->prop->author + len) = '\0';
nextp->prop->au_len = len;
} */
n++;
}
/***********************/
/* Now go looking for version-0 entries */
/***********************/
for (nextp = prevp; nextp; nextp = nextp->next) {
FINFO *newp;
if (!make_old_version(old, nextp->no_ver_name)) continue;
if (isslash) {
if (drive)
sprintf(namebuf, "%c:\\%s", drive, old);
else
sprintf(namebuf, "\\%s", old);
} else
sprintf(namebuf, "%s\\%s", dir, old);
TIMEOUT(rval = stat(namebuf, &sbuf));
if (rval == -1) continue;
AllocFinfo(newp);
newp->next = prevp;
/* All other types than directory. */
newp->dirp = 0;
sprintf(namebuf, "%s.~00~", nextp->no_ver_name);
quote_fname(namebuf);
len = strlen(namebuf);
strcpy(newp->lname, namebuf);
*(newp->lname + len) = '\0';
newp->lname_len = len;
strcpy(newp->no_ver_name, old);
newp->version = 0;
newp->ino = sbuf.st_ino;
newp->prop->length = (unsigned)sbuf.st_size;
newp->prop->wdate = (unsigned)ToLispTime(sbuf.st_mtime);
newp->prop->rdate = (unsigned)ToLispTime(sbuf.st_atime);
newp->prop->protect = (unsigned)sbuf.st_mode;
n++;
prevp = newp;
}
if (n > 0) *finfo_buf = prevp;
return (n);
}
#else /* DOS */
static int enum_dsk_prop(char *dir, char *name, char *ver, FINFO **finfo_buf)
{
register struct dirent *dp;
@@ -706,7 +509,6 @@ static int enum_dsk_prop(char *dir, char *name, char *ver, FINFO **finfo_buf)
if (n > 0) *finfo_buf = prevp;
return (n);
}
#endif /* DOS */
/*
* Name: enum_dsk
@@ -727,150 +529,6 @@ static int enum_dsk_prop(char *dir, char *name, char *ver, FINFO **finfo_buf)
*
* Similar to enum_dsk_prop, but file properties are not stored.
*/
#ifdef DOS
static int enum_dsk(char *dir, char *name, char *ver, FINFO **finfo_buf)
{
register struct direct *dp;
register FINFO *prevp;
register FINFO *nextp;
int n, len, rval, isslash = 0, drive = 0;
struct find_t dirp;
struct stat sbuf;
char namebuf[MAXPATHLEN];
char fver[VERSIONLEN];
char old[MAXPATHLEN];
/* The null directory has to be special cased */
/* because adjacent \'s in the pathname don't match anything */
if (dir[1] == DRIVESEP) drive = dir[0];
if (strcmp(dir, "\\") == 0)
isslash = 1;
else if (drive && (strcmp(dir + 2, "\\") == 0))
isslash = 1;
if (!isslash)
strcpy(namebuf, dir); /* Only add the dir if it's real */
else if (drive) {
namebuf[0] = drive;
namebuf[1] = DRIVESEP;
namebuf[2] = '\0';
} else
*namebuf = '\0';
strcat(namebuf, DIRSEPSTR);
strcat(namebuf, name);
TIMEOUT(rval = _dos_findfirst(namebuf, _A_NORMAL | _A_SUBDIR, &dirp));
if (rval != 0) {
*Lisp_errno = errno;
return (-1);
}
for (nextp = prevp = (FINFO *)NULL, n = 0; rval == 0;
S_TOUT(rval = _dos_findnext(&dirp)), prevp = nextp) {
if (strcmp(dirp.name, ".") == 0 || strcmp(dirp.name, "..") == 0) continue;
MatchP(dirp.name, name, ver, match, unmatch);
unmatch:
continue;
match:
AllocFinfo(nextp);
if (nextp == (FINFO *)NULL) {
FreeFinfo(prevp);
*Lisp_errno = errno;
return (-1);
}
nextp->next = prevp;
if (isslash) {
if (drive)
sprintf(namebuf, "%c:\\%s", drive, dirp.name);
else
sprintf(namebuf, "\\%s", dirp.name);
} else
sprintf(namebuf, "%s\\%s", dir, dirp.name);
TIMEOUT(rval = stat(namebuf, &sbuf));
if (rval == -1 && errno != ENOENT) {
/*
* ENOENT error might be caused by missing symbolic
* link. We should ignore such error here.
*/
FreeFinfo(nextp);
*Lisp_errno = errno;
return (-1);
}
strcpy(namebuf, dirp.name); /* moved from below 2/26/93 */
if (sbuf.st_mode & S_IFDIR) {
nextp->dirp = 1;
quote_dname(namebuf);
strcpy(nextp->lname, namebuf);
len = strlen(namebuf);
*(nextp->lname + len) = DIRCHAR;
*(nextp->lname + len + 1) = '\0';
nextp->lname_len = len + 1;
} else {
/* All other types than directory. */
nextp->dirp = 0;
strcat(namebuf, ".~1~");
quote_fname(namebuf);
len = strlen(namebuf);
strcpy(nextp->lname, namebuf);
*(nextp->lname + len) = '\0';
nextp->lname_len = len;
}
strcpy(namebuf, dirp.name); /* to get real versionless name */
len = strlen(namebuf);
DOWNCASE(namebuf);
strcpy(nextp->no_ver_name, namebuf);
nextp->version = 1;
nextp->ino = sbuf.st_ino;
n++;
}
/***********************/
/* Now go looking for version-0 entries */
/***********************/
for (nextp = prevp; nextp; nextp = nextp->next) {
FINFO *newp;
if (!make_old_version(old, nextp->no_ver_name)) continue;
if (isslash) {
if (drive)
sprintf(namebuf, "%c:\\%s", drive, old);
else
sprintf(namebuf, "\\%s", old);
} else
sprintf(namebuf, "%s\\%s", dir, old);
TIMEOUT(rval = stat(namebuf, &sbuf));
if (rval == -1) continue;
AllocFinfo(newp);
newp->next = prevp;
/* All other types than directory. */
newp->dirp = 0;
sprintf(namebuf, "%s.~00~", nextp->no_ver_name);
quote_fname(namebuf);
len = strlen(namebuf);
strcpy(newp->lname, namebuf);
*(newp->lname + len) = '\0';
newp->lname_len = len;
strcpy(newp->no_ver_name, old);
newp->version = 0;
newp->ino = sbuf.st_ino;
n++;
prevp = newp;
}
if (n > 0) *finfo_buf = prevp;
return (n);
}
#else /* DOS */
static int enum_dsk(char *dir, char *name, char *ver, FINFO **finfo_buf)
{
@@ -956,7 +614,6 @@ static int enum_dsk(char *dir, char *name, char *ver, FINFO **finfo_buf)
if (n > 0) *finfo_buf = prevp;
return (n);
}
#endif /* DOS */
/*
* Name: enum_ufs_prop
@@ -980,93 +637,6 @@ static int enum_dsk(char *dir, char *name, char *ver, FINFO **finfo_buf)
* File properties Lisp will need later are also stored in the result linked list
* of FINFO structures.
*/
#ifdef DOS
static int enum_ufs_prop(char *dir, char *name, char *ver, FINFO **finfo_buf)
{
register struct direct *dp;
register FINFO *prevp;
register FINFO *nextp;
int n, len, rval;
struct find_t dirp;
/* register struct passwd *pwd; -- From author support */
struct stat sbuf;
char namebuf[MAXPATHLEN];
TIMEOUT(rval = _dos_findfirst(dir, _A_SUBDIR, &dirp));
if (rval != 0) {
*Lisp_errno = errno;
return (-1);
}
for (nextp = prevp = (FINFO *)NULL, n = 0; rval == 0;
S_TOUT(rval = _dos_findnext(&dirp)), prevp = nextp) {
if (strcmp(dirp.name, ".") == 0 || strcmp(dirp.name, "..") == 0) continue;
MatchP_Case(dirp.name, name, ver, match, unmatch);
unmatch:
continue;
match:
AllocFinfo(nextp);
if (nextp == (FINFO *)NULL) {
FreeFinfo(prevp);
*Lisp_errno = errno;
return (-1);
}
nextp->next = prevp;
sprintf(namebuf, "%s\\%s", dir, dirp.name);
TIMEOUT(rval = stat(namebuf, &sbuf));
if (rval == -1 && errno != ENOENT) {
/*
* ENOENT error might be caused by missing symbolic
* link. We should ignore such error here.
*/
FreeFinfo(nextp);
*Lisp_errno = errno;
return (-1);
}
strcpy(namebuf, dirp.name);
if (sbuf.st_mode & S_IFDIR) {
nextp->dirp = 1;
quote_dname(namebuf);
strcpy(nextp->lname, namebuf);
len = strlen(namebuf);
*(nextp->lname + len) = DIRCHAR;
*(nextp->lname + len + 1) = '\0';
nextp->lname_len = len + 1;
} else {
/* All other types than directory. */
nextp->dirp = 0;
quote_fname_ufs(namebuf);
len = strlen(namebuf);
strcpy(nextp->lname, namebuf);
*(nextp->lname + len) = '\0';
nextp->lname_len = len;
}
strcpy(namebuf, dirp.name);
len = strlen(namebuf);
nextp->ino = sbuf.st_ino;
nextp->prop->length = (unsigned)sbuf.st_size;
nextp->prop->wdate = (unsigned)ToLispTime(sbuf.st_mtime);
nextp->prop->rdate = (unsigned)ToLispTime(sbuf.st_atime);
nextp->prop->protect = (unsigned)sbuf.st_mode;
/*
TIMEOUT(pwd = getpwuid(sbuf.st_uid));
if (pwd == (struct passwd *)NULL) {
nextp->prop->au_len = 0;
} else {
len = strlen(pwd->pw_name);
strcpy(nextp->prop->author, pwd->pw_name);
*(nextp->prop->author + len) = '\0';
nextp->prop->au_len = len;
}
*/
n++;
}
if (n > 0) *finfo_buf = prevp;
return (n);
}
#else /* DOS */
static int enum_ufs_prop(char *dir, char *name, char *ver, FINFO **finfo_buf)
{
register struct dirent *dp;
@@ -1159,7 +729,6 @@ static int enum_ufs_prop(char *dir, char *name, char *ver, FINFO **finfo_buf)
if (n > 0) *finfo_buf = prevp;
return (n);
}
#endif /* DOS */
/*
* Name: enum_ufs
@@ -1180,77 +749,6 @@ static int enum_ufs_prop(char *dir, char *name, char *ver, FINFO **finfo_buf)
*
* Similar to enum_ufs_prop, but file properties are not stored.
*/
#ifdef DOS
static int enum_ufs(char *dir, char *name, char *ver, FINFO **finfo_buf)
{
register struct direct *dp;
register FINFO *prevp;
register FINFO *nextp;
int n, len, rval;
struct find_t dirp;
struct stat sbuf;
char namebuf[MAXPATHLEN];
TIMEOUT(rval = _dos_findfirst(dir, _A_SUBDIR, &dirp));
if (rval != 0) {
*Lisp_errno = errno;
return (-1);
}
for (nextp = prevp = (FINFO *)NULL, n = 0; rval == 0;
S_TOUT(rval = _dos_findnext(&dirp)), prevp = nextp) {
if (strcmp(dirp.name, ".") == 0 || strcmp(dirp.name, "..") == 0) continue;
MatchP_Case(dirp.name, name, ver, match, unmatch);
unmatch:
continue;
match:
AllocFinfo(nextp);
if (nextp == (FINFO *)NULL) {
FreeFinfo(prevp);
*Lisp_errno = errno;
return (-1);
}
nextp->next = prevp;
sprintf(namebuf, "%s\\%s", dir, dirp.name);
TIMEOUT(rval = stat(namebuf, &sbuf));
if (rval == -1 && errno != ENOENT) {
/*
* ENOENT error might be caused by missing symbolic
* link. We should ignore such error here.
*/
FreeFinfo(nextp);
*Lisp_errno = errno;
return (-1);
}
strcpy(namebuf, dirp.name);
if (sbuf.st_mode & S_IFDIR) {
nextp->dirp = 1;
quote_dname(namebuf);
strcpy(nextp->lname, namebuf);
len = strlen(namebuf);
*(nextp->lname + len) = DIRCHAR;
*(nextp->lname + len + 1) = '\0';
nextp->lname_len = len + 1;
} else {
/* All other types than directory. */
nextp->dirp = 0;
quote_fname_ufs(namebuf);
len = strlen(namebuf);
strcpy(nextp->lname, namebuf);
*(nextp->lname + len) = '\0';
nextp->lname_len = len;
}
strcpy(namebuf, dirp.name);
len = strlen(namebuf);
nextp->ino = sbuf.st_ino;
n++;
}
if (n > 0) *finfo_buf = prevp;
return (n);
}
#else /* DOS */
static int enum_ufs(char *dir, char *name, char *ver, FINFO **finfo_buf)
{
register struct dirent *dp;
@@ -1327,7 +825,6 @@ static int enum_ufs(char *dir, char *name, char *ver, FINFO **finfo_buf)
if (n > 0) *finfo_buf = prevp;
return (n);
}
#endif /* DOS*/
/*
* Name: trim_finfo
@@ -1349,7 +846,6 @@ static int enum_ufs(char *dir, char *name, char *ver, FINFO **finfo_buf)
static int trim_finfo(FINFO **fp)
{
#ifndef DOS
register FINFO *tp, *sp, *mp, *cp, *pp;
register int num, pnum;
int linkp;
@@ -1448,16 +944,6 @@ static int trim_finfo(FINFO **fp)
}
} while (sp != (FINFO *)NULL);
#else /* DOS version */
int num = 0;
FINFO *tp;
tp = *fp;
while (tp) {
num++;
tp = tp->next;
}
#endif /* DOS */
return (num);
}
@@ -1845,10 +1331,8 @@ static int dsk_filecmp(FINFO **fp1, FINFO **fp2)
if ((res = strcmp((*fp1)->no_ver_name, (*fp2)->no_ver_name)) != 0) return (res);
if ((*fp1)->version == (*fp2)->version) return (0);
#ifndef DOS
if ((v1 = (*fp1)->version) == 0) return (-1);
if ((v2 = (*fp2)->version) == 0) return (1);
#endif /* DOS */
return ((v1 < v2) ? 1 : -1);
}
@@ -2029,9 +1513,6 @@ LispPTR COM_gen_files(register LispPTR *args)
{
char fbuf[MAXPATHLEN + 5], dir[MAXPATHLEN], pattern[MAXPATHLEN];
char host[MAXNAMLEN], name[MAXNAMLEN], ver[VERSIONLEN];
#ifdef DOS
char drive[1];
#endif
int dskp, count, highestp, propp, fid, version;
register char *cp;
FINFO *fp;
@@ -2053,11 +1534,7 @@ LispPTR COM_gen_files(register LispPTR *args)
if (count > MAXPATHLEN + 5) FileNameTooLong((GetSmallp(-1)));
LispStringToCString(args[0], fbuf, MAXPATHLEN);
#ifdef DOS
separate_host(fbuf, host, drive);
#else
separate_host(fbuf, host);
#endif /* DOS */
UPCASE(host);
if (strcmp(host, "DSK") == 0)
@@ -2091,11 +1568,7 @@ LispPTR COM_gen_files(register LispPTR *args)
* to do some trick here.
*/
#ifdef DOS
if (!unixpathname(fbuf, pattern, 1, 1, drive, 0, 0)) {
#else
if (!unixpathname(fbuf, pattern, 1, 1)) {
#endif /* DOS */
/* Yes, always dskp is on */
return (GetSmallp(-1));
}

568
src/dsk.c

File diff suppressed because it is too large Load Diff

View File

@@ -32,36 +32,9 @@ extern DspInterface X_init(DspInterface dsp, char *lispbitmap, int width_hint, i
int depth_hint);
#endif /* XWINDOW */
#ifdef DOS
extern int dosdisplaymode;
#endif /* DOS */
void make_dsp_instance(DspInterface dsp, char *lispbitmap, int width_hint, int height_hint,
int depth_hint) {
#ifdef DOS
TPRINT(("Enter make_dsp_instance, dosdisplaymode is: %d\n", dosdisplaymode));
if (depth_hint == 0) depth_hint = 1;
switch (dosdisplaymode) {
case 1: VGA_init(dsp, 0, 0, 0, depth_hint); break;
case 0x102:
case 0x104: VESA_init(dsp, 0, 0, 0, depth_hint); break;
default:
if (VESA_p()) {
VESA_init(dsp, 0, 0, 0, depth_hint);
} else if (VGA_p()) {
VGA_init(dsp, 0, 0, 0, depth_hint);
} else { /* Can't set *ANY* video mode! */
(void)fprintf(stderr, "No portable graphics mode supported by this host.\n");
(void)fprintf(stderr, "\n-Expected VESA or VGA.\n");
exit(1);
}
break;
}
#elif XWINDOW
#if XWINDOW
/* lispbitmap is 0 when we call X_init the first time. */
if (X_init(dsp, 0, LispDisplayRequestedWidth, LispDisplayRequestedHeight, depth_hint) == NULL) {
fprintf(stderr, "Can't open display.");
@@ -70,15 +43,6 @@ void make_dsp_instance(DspInterface dsp, char *lispbitmap, int width_hint, int h
#endif /* DOS | XWINDOW */
} /* Now we know the maximum capabilities of the hardware. */
#ifdef DOS
VESA_p() {
/* Magic. Do a vesa call to determine the current mode. */
return (VESA_call(3, 0));
}
VGA_p() { return (TRUE); }
#endif /* DOS */
/*********************************************************************/
/* */
/* G e n e r i c R e t u r n T */
@@ -107,16 +71,7 @@ void describedsp(DspInterface dsp) {
printf("colors= %lu\n", dsp->colors);
printf("graphicsmode= %lu\n", dsp->graphicsmode);
printf("numberofbanks= %lu\n", dsp->numberofbanks);
#ifdef DOS
printf("BytesPerLine= %d\n", dsp->BytesPerLine);
printf("DisplayStartAddr= %d\n", dsp->DisplayStartAddr);
#endif /* DOS */
printf("bitblt_to_screen= %p\n", dsp->bitblt_to_screen);
printf("cleardisplay= %p\n", dsp->cleardisplay);
#ifdef DOS
printf("mouse_visible= %d\n", dsp->mouse_visible);
printf("mouse_invisible= %d\n", dsp->mouse_invisible);
printf("\n");
#endif /* DOS */
fflush(stdout);
}

View File

@@ -21,7 +21,6 @@
#include <string.h>
#include <unistd.h>
#include <ctype.h>
#ifndef DOS
#include <sys/file.h>
#include <signal.h>
#include <errno.h>
@@ -60,7 +59,6 @@
#endif
#include <nlist.h>
#endif /* DOS */
#endif /* MAIKO_ENABLE_ETHERNET */
#include "commondefs.h"
#include "lispemul.h"

View File

@@ -14,7 +14,6 @@
#include <stdio.h>
#include <string.h> /* for mem... fns */
#ifndef DOS
#include <errno.h>
#include <netdb.h>
#include <netinet/in.h>
@@ -26,7 +25,6 @@
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#endif /* DOS */
#if (defined(OS5) || defined(__CYGWIN__)) && !defined(O_ASYNC)
/* Cygwin and Solaris don't define O_ASYNC, yet still define FASYNC. */
@@ -78,7 +76,6 @@ fd_set LispIOFds;
LispPTR subr_TCP_ops(int op, LispPTR nameConn, LispPTR proto, LispPTR length, LispPTR bufaddr, LispPTR maxlen)
{
#ifndef DOS
int sock, len, buflen, res;
unsigned ures;
char namestring[100];
@@ -335,5 +332,4 @@ LispPTR subr_TCP_ops(int op, LispPTR nameConn, LispPTR proto, LispPTR length, Li
default: return (NIL); break;
}
#endif /* DOS */
}

View File

@@ -60,10 +60,6 @@
#include "xcursordefs.h"
#endif
#ifdef DOS
#define getpagesize() 512
#endif /* DOS */
#if defined(XWINDOW) || defined(DOS)
#include "devif.h"
DLword *DisplayRegion68k_end_addr;
@@ -225,11 +221,6 @@ void clear_display() {
#endif /* SUNDISPLAY */
#ifdef DOS
TPRINT(("Enter Clear_display\n"));
(currentdsp->cleardisplay)(currentdsp);
TPRINT(("Exit Clear_display\n"));
#endif /* DOS */
}
#else /* COLOR */
@@ -524,11 +515,7 @@ void init_display2(DLword *display_addr, int display_max)
DBPRINT(("after mem_point\n"));
#endif /* SUNDISPLAY */
#ifdef DOS
(currentdsp->cleardisplay)(currentdsp);
#else /* DOS */
clear_display();
#endif /* DOS */
DBPRINT(("after clear_display()\n"));
@@ -636,11 +623,6 @@ void flush_display_buffer() {
(currentdsp->bitblt_to_screen)(currentdsp, DisplayRegion68k, currentdsp->Visible.x,
currentdsp->Visible.y, currentdsp->Visible.width,
currentdsp->Visible.height);
#elif DOS
TPRINT(("Enter flush_display_buffer\n"));
(currentdsp->bitblt_to_screen)(currentdsp, DisplayRegion68k, 0, 0, currentdsp->Display.width,
currentdsp->Display.height);
TPRINT(("Exit flush_display_buffer\n"));
#endif /* DOS */
}

View File

@@ -17,19 +17,8 @@
#include <string.h>
#include <sys/types.h>
#ifndef DOS
#include <sys/file.h>
#include <sys/select.h>
#endif /* DOS */
#ifdef DOS
#include <i32.h> /* "#pragma interrupt" & '_chain_intr'*/
#include <dos.h> /* defines REGS & other structs */
#include <stdio.h> /* define NULL */
#include <conio.h>
#include <time.h>
#include <stk.h>
#endif /* DOS */
#ifdef SUNDISPLAY
#include <sundev/kbd.h>
@@ -70,12 +59,6 @@
extern DspInterface currentdsp;
#endif /* XWINDOW */
#ifdef DOS
#include "devif.h"
extern MouseInterface currentmouse;
extern KbdInterface currentkbd;
extern DspInterface currentdsp;
#endif /* DOS */
#ifdef SUNDISPLAY
extern struct screen LispScreen;
#endif /* SUNDISPLAY */
@@ -243,19 +226,6 @@ void init_keyboard(int flg) /* if 0 init else re-init */
#elif XWINDOW
init_Xevent(currentdsp);
#elif DOS
if (flg == 0) { /* Install the handlers ONLY when we */
/* init the kbd the init the kbd the */
/* first time. */
/* turn on kbd */
make_kbd_instance(currentkbd);
(currentkbd->device.enter)(currentkbd);
/* turn on mouse */
make_mouse_instance(currentmouse);
(currentmouse->device.enter)(currentmouse, currentdsp);
}
#endif /* XWINDOW DOS */
}
@@ -277,9 +247,6 @@ void device_before_exit() {
}
close(LispKbdFd);
#elif DOS
(currentmouse->device.exit)(currentmouse, currentdsp);
(currentkbd->device.exit)(currentkbd);
#endif /* SUNDISPLAY DOS*/
display_before_exit();
}
@@ -498,8 +465,6 @@ void keyboardtype(int fd)
if ((key = getenv("LDEKBDTYPE")) == 0) {
#ifdef XWINDOW
type = KB_X;
#elif DOS
type = KB_DOS;
#elif SUNDISPLAY
if (ioctl(fd, KIOCTYPE, &type) != 0) {
error("keyboardtype:IOCTL(KIOCTYPE) fails (cont. w. type-3");
@@ -557,12 +522,6 @@ void keyboardtype(int fd)
break;
#endif /* XWINDOW */
#ifdef DOS
case KB_DOS:
SUNLispKeyMap = DOSLispKeyMap_101;
InterfacePage->devconfig |= KB_SUN3 - MIN_KEYTYPE; /* 10 */
break;
#endif /* DOS */
default: {
char errmsg[200];
sprintf(errmsg, "Unsupported keyboard type: %d", type);

View File

@@ -22,9 +22,7 @@
#include <string.h>
#include <unistd.h>
#ifndef DOS
#include <pwd.h>
#endif
#include "hdw_conf.h"
#include "lispemul.h"
@@ -143,15 +141,12 @@ void init_ifpage(int sysout_size) {
#endif /* BIGVM */
/* unfortunately, Lisp only looks at a 16 bit serial number */
#ifndef DOS
InterfacePage->serialnumber = 0xffff & gethostid();
#endif /* DOS */
/* get user name and stuff into vmem; this is the VMEM buffer;
This is a BCPL string -- it starts with a length count. C strings
are null terminated instead */
InterfacePage->usernameaddr = 0;
#ifndef DOS
{
struct passwd *pwd;
char *s;
@@ -175,7 +170,6 @@ are null terminated instead */
}
}
#endif /* DOS */
/* Days from Oct-13-87 12:00 It's Takeshi's birthday. */
/* MDate may be set by vdate.c, generated by mkvdate.c. */

View File

@@ -19,21 +19,7 @@
KbdInterfaceRec curkbd;
KbdInterface currentkbd = &curkbd;
#ifdef DOS
extern void Kbd_event();
extern void EnterDosKbd();
extern void ExitDosKbd();
extern unsigned long GenericReturnT();
#endif /* DOS */
void make_kbd_instance(KbdInterface kbd) {
#ifdef DOS
kbd->device_event = &Kbd_event; /* */
kbd->device.enter = &EnterDosKbd;
kbd->device.exit = &ExitDosKbd;
kbd->device.before_raid = &ExitDosKbd;
kbd->device.after_raid = &EnterDosKbd;
kbd->device.active = FALSE;
#elif XWINDOW
#if XWINDOW
#endif /* DOS or XWINDOW */
}

View File

@@ -12,15 +12,10 @@
#include <errno.h>
#include <stdio.h>
#ifdef DOS
#include <time.h>
#include <conio.h>
#else
#include <sys/time.h>
#include <sys/types.h>
#include <sys/file.h>
#include <sys/select.h>
#endif /* DOS */
#ifdef SUNDISPLAY
#include <sundev/kbd.h>
@@ -37,12 +32,7 @@
#include "xwinmandefs.h"
#endif
#ifdef DOS
#define PORT_A 0x60
#include "devif.h"
extern KbdInterface currentkbd;
extern DspInterface currentdsp;
#elif XWINDOW
#if XWINDOW
#include "devif.h"
extern KbdInterface currentkbd;
extern DspInterface currentdsp;
@@ -76,16 +66,12 @@ void KB_enable(LispPTR *args) /* args[0] : ON/OFF flag
FD_SET(LispWindowFd, &LispReadFds);
#elif XWINDOW
enable_Xkeyboard(currentdsp);
#elif DOS
(currentkbd->device.enter)(currentkbd);
#endif /* DOS */
} else if (args[0] == NIL) {
#ifdef SUNDISPLAY
FD_CLR(LispWindowFd, &LispReadFds);
#elif XWINDOW
disable_Xkeyboard(currentdsp);
#elif DOS
(currentkbd->device.exit)(currentkbd);
#endif /* DOS */
} else {
error("KB_enable: illegal arg \n");
@@ -106,10 +92,6 @@ struct timeval belltime ={
*/
extern int LispKbdFd;
#ifdef DOS
int bell_status_word;
#endif /* DOS */
void KB_beep(LispPTR *args) /* args[0] : ON/OFF flag
* T -- ON
* NIL -- OFF
@@ -139,21 +121,6 @@ void KB_beep(LispPTR *args) /* args[0] : ON/OFF flag
#elif XWINDOW
if (args[0] == ATOM_T) beep_Xkeyboard(currentdsp);
#elif DOS
if (args[0] == ATOM_T) {
bell_status_word = inp(0x61);
outp(0x61, bell_status_word | 0x3); /* Turn on the speaker */
/* Prepare timer by sending 10111100 to port 43. */
outp(0x43, 0xb6);
/* Divide input frequency by timer ticks per second and
* write (byte by byte) to timer. */
outp(0x42, (char)(1193180L / (LispIntToCInt(args[1]))));
outp(0x42, (char)(1193180L / (LispIntToCInt(args[1])) >> 8));
} else {
outp(0x61, bell_status_word & ~0x3); /* Turn off the speaker (with */
/* bits 0 and 1). */
}
#endif /* SUNDISPLAY, XWINDOW, DOS */
}
@@ -185,9 +152,4 @@ void KB_setmp(LispPTR *args) /* args[0] : MPCODE */
void KB_setled(LispPTR *args)
{
#ifdef DOS
outp(PORT_A, (unsigned char)0xED);
outp(PORT_A,
(unsigned char)(((args[0] != NIL) << 2) | ((args[1] != NIL) << 1) | (args[2] != NIL)));
#endif /* DOS */
}

View File

@@ -20,25 +20,11 @@
#include <signal.h>
#include <sys/types.h>
#include <string.h>
#ifndef DOS
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/select.h>
#include <sys/time.h>
#else
#include <time.h>
#endif /* DOS */
#ifdef DOS
#include <i32.h> /* Defines "#pragma interrupt" */
#include <dos.h> /* Defines REGS & other structs */
#include <stk.h> /* _XSTACK struct definition */
#pragma interrupt(Mouse_hndlr)
void Mouse_hndlr(void); /* Fields mouse events from driver */
/* (during servicing of mouse interrupt) */
#elif SUNDISPLAY
#if SUNDISPLAY
#include <sunwindow/window_hs.h>
#include <sunwindow/win_ioctl.h>
#include <suntool/window.h>
@@ -134,9 +120,7 @@ extern int ether_fd;
extern DLword *DisplayRegion68k;
#ifndef DOS
static struct timeval SelectTimeout = {0, 0};
#endif /* DOS */
#ifdef XWINDOW
extern volatile sig_atomic_t Event_Req;
@@ -282,7 +266,6 @@ DLword ColorCursor_savebitmap[CURSORWIDTH / COLORPIXELS_IN_DLWORD * CURSORHEIGHT
void getsignaldata(int sig)
{
#ifndef DOS
#ifdef SUNDISPLAY
struct inputevent event;
#endif /* SUNDISPLAY */
@@ -377,7 +360,6 @@ getmore:
}
}
/* #endif */
#endif /* DOS */
} /* end getsignaldata */
#ifdef SUNDISPLAY
@@ -580,9 +562,6 @@ void taking_mouse_down() {
static int sx, dx, w, h, srcbpl, dstbpl, backwardflg = 0;
static int src_comp = 0, op = 0, gray = 0, num_gray = 0, curr_gray_line = 0;
#ifdef DOS
(currentdsp->mouse_invisible)(currentdsp, IOPage68K);
#else
if (!DisplayInitialized) return;
/* restore saved image */
@@ -599,7 +578,6 @@ void taking_mouse_down() {
#ifdef DISPLAYBUFFER
flush_display_region(dx, (LastCursorY), w, h);
#endif /* DISPLAYBUFFER */
#endif /* DOS */
}
#else
@@ -733,9 +711,6 @@ void copy_cursor(int newx, int newy)
/* I'll make it MACRO */
void taking_mouse_up(int newx, int newy)
{
#ifdef DOS
(currentdsp->mouse_visible)(newx, newy);
#else
if (!DisplayInitialized) return;
/* save hidden bitmap */
cursor_hidden_bitmap(newx, newy);
@@ -745,7 +720,6 @@ void taking_mouse_up(int newx, int newy)
#endif
LastCursorX = newx;
LastCursorY = newy;
#endif
}
/* store bitmap image inside rect. which specified by x,y */

View File

@@ -153,16 +153,10 @@ int sysout_loader(const char *sysout_file_name, int sys_size) {
"\nsysout loader: Error, secondary space in use. You can't specify size.\nProcess "
"size = %d\nSys size = %d\n",
ifpage.process_size, sys_size);
#ifdef DOS
/* Note that we have an initialized display by now. */
/* Hence we have to observe the display protocol. */
VESA_errorexit(tmp);
#else
fprintf(stderr, "sysout_loader: You can't specify the process size.\n");
fprintf(stderr, "Because, secondary space is already used.\n");
fprintf(stderr, "(size is %d, you specified %d.)\n", ifpage.process_size, sys_size);
exit(-1);
#endif /* DOS */
}
/*Can use this sys_size as the process size */
/* The sys_size should be same as the previous one */
@@ -279,28 +273,6 @@ int sysout_loader(const char *sysout_file_name, int sys_size) {
/* read sysout file to lispworld */
for (i = 0; i < (sysout_size / 2); i++) {
#ifdef DOS
/* Dial that floats from left to right on the top line of the */
/* displaty. Dial shows % of sysout loaded by digits and */
/* position. */
int columns;
switch (currentdsp->graphicsmode) {
case 0x104:
columns = 120; /* 131 - 10 */
break;
case 0x102:
columns = 69; /* 79 - 10 */
break;
default:
columns = 69; /* 79 - 10 */
break;
}
_settextposition((short)0, (short)0);
if ((i & 0xf) == 0) {
for (int j = 0; j < (columns * i) / (sysout_size >> 1); j++) putchar(' ');
printf("-=(%2d%%)=-\n", (100 * i) / (sysout_size >> 1));
}
#endif /* DOS */
if (GETPAGEOK(fptovp, i) != 0177777) {
if (lseek(sysout, i * BYTESPER_PAGE, SEEK_SET) == -1) {
perror("sysout_loader: can't seek sysout file");

View File

@@ -16,15 +16,8 @@
#include "lispemul.h"
#ifdef DOS
#include "devif.h"
#endif /* DOS */
extern int KBDEventFlg;
extern int *KEYBUFFERING68k;
#ifdef DOS
extern MouseInterface currentmouse;
#endif /* DOS */
/* Globals used by solver */
short JustInverted;
@@ -942,10 +935,6 @@ int milpsolve(sstate *st, REAL *upbo, REAL *lowbo, short *sbasis, short *slower,
return (TIMEOUT); /* Time out every 100 LP solves */
else if ((KBDEventFlg > 0) && *KEYBUFFERING68k == ATOM_T)
return (TIMEOUT); /* Time out on key/mouse clicks */
#ifdef DOS
else if (currentmouse->Cursor.Moved)
return (TIMEOUT); /* Time out if mouse moves in DOS */
#endif /* DOS */
if (Break_bb) return (BREAK_BB);
Level++;

View File

@@ -25,15 +25,9 @@
#include <sys/types.h>
#include <time.h>
#ifndef DOS
#include <pwd.h>
#include <sys/param.h>
#include <unistd.h>
#else /* DOS */
#include <i32.h>
#define MAXPATHLEN 128
#define R_OK 04
#endif /* DOS */
#ifdef MAIKO_ENABLE_ETHERNET
#ifndef USE_DLPI
@@ -256,30 +250,7 @@ extern DspInterface currentdsp;
extern time_t MDate;
extern int nokbdflag;
extern int nomouseflag;
#ifdef DOS
extern void dispatch();
int dosdisplaymode = 0;
int twobuttonflag = FALSE;
int eurokbd = TRUE; /* Assume eurokbd by default. */
const char *helpstring =
"\n\
medley [sysout-name] [<options>] ...\n\
Where <options> are:\n\
sysout-name The filename of your sysout.(see manual.)\n\
-m <size> Virtual memory size in Mega Bytes(from 8 to 32)\n\
-vga Use standard VGA 640x480 screen resolution\n\
-vesa102 Use VESA 800x600 screen resolution\n\
-vesa104 Use VESA 1024x768 screen resolution\n\
-2button Force two button mouse handling\n\
-3button Force three button mouse handling\n\
-noeurokbd Force old style kbd handling (for 2.0 and earlier sysouts)\n\
-eurokbd Force new style kbd handling (for 2.01 and later sysouts)\n\
-nokbd Turn the kbd handling off (for debugging only)\n\
-nomouse Turn the mouse handling off (for debugging only)\n\
-info Print general info about the system\n\
-help Print this message\n";
#elif XWINDOW
#if XWINDOW
const char *helpstring =
"\n\
either setenv LDESRCESYSOUT or do:\n\
@@ -360,11 +331,7 @@ int main(int argc, char *argv[])
strncpy(sysout_name, envname, MAXPATHLEN);
} else if ((envname = getenv("LDESOURCESYSOUT")) != NULL)
strncpy(sysout_name, envname, MAXPATHLEN);
#ifdef DOS
else if (!makepathname("lisp.vm", sysout_name)
#else
else if (!makepathname("~/lisp.virtualmem", sysout_name)
#endif /* DOS */
|| access(sysout_name, R_OK)) {
fprintf(stderr, "Couldn't find a sysout to run;\n");
fprintf(stderr, "%s", helpstring);
@@ -401,28 +368,6 @@ int main(int argc, char *argv[])
else if (!strcmp(argv[i], "-INIT")) { /*** init sysout, no packaged */
for_makeinit = 1;
}
#ifdef DOS
else if ((strcmp(argv[i], "-vga") == 0) || (strcmp(argv[i], "-VGA") == 0)) {
dosdisplaymode = 1;
} else if ((strcmp(argv[i], "-vesa102") == 0) || (strcmp(argv[i], "-VESA102") == 0)) {
dosdisplaymode = 0x102;
} else if ((strcmp(argv[i], "-vesa104") == 0) || (strcmp(argv[i], "-VESA104") == 0)) {
dosdisplaymode = 0x104;
} else if ((strcmp(argv[i], "-2button") == 0) || (strcmp(argv[i], "-2BUTTON") == 0)) {
twobuttonflag = TRUE;
} else if ((strcmp(argv[i], "-3button") == 0) || (strcmp(argv[i], "-3BUTTON") == 0)) {
twobuttonflag = FALSE;
} else if ((strcmp(argv[i], "-noeurokbd") == 0) || (strcmp(argv[i], "-NOEUROKBD") == 0)) {
eurokbd = FALSE;
} else if ((strcmp(argv[i], "-eurokbd") == 0) || (strcmp(argv[i], "-EUROKBD") == 0)) {
eurokbd = TRUE;
} else if ((strcmp(argv[i], "-nokbd") == 0) || (strcmp(argv[i], "-NOKBD") == 0)) {
nokbdflag = TRUE;
} else if ((strcmp(argv[i], "-nomouse") == 0) || (strcmp(argv[i], "-NOMOUSE") == 0)) {
nomouseflag = TRUE;
}
#endif /* DOS */
/* Can only do this under SUNOs, for now */
else if (!strcmp(argv[i], "-E")) { /**** ethernet info ****/
@@ -463,14 +408,10 @@ int main(int argc, char *argv[])
}
/* Sanity checks. */
#ifdef DOS
probemouse(); /* See if the mouse is connected. */
#else
if (getuid() != geteuid()) {
fprintf(stderr, "Effective user is not real user. Setting euid to uid.\n");
seteuid(getuid());
}
#endif /* DOS */
FD_ZERO(&LispReadFds);
@@ -478,9 +419,6 @@ int main(int argc, char *argv[])
init_ether(); /* modified by kiuchi Nov. 4 */
#endif /* MAIKO_ENABLE_ETHERNET */
#ifdef DOS
init_host_filesystem();
#else
/* Fork Unix was called in kickstarter; if we forked, look up the */
/* pipe handles to the subprocess and set them up. */
@@ -488,7 +426,6 @@ int main(int argc, char *argv[])
{ /* in case we're re-starting a savevm w/open ptys */
if (please_fork) fprintf(stderr, "Failed to find UNIXCOMM file handles; no processes\n");
}
#endif /* DOS */
#if defined(DOS) || defined(XWINDOW)
make_dsp_instance(currentdsp, 0, 0, 0, 1); /* All defaults the first time */
@@ -527,13 +464,6 @@ int main(int argc, char *argv[])
JDS -- 1/18/90 also BITBLTSUB does it now. */
}
#ifdef DOS
_setrealmode(0x3f); /* Don't interrupt on FP overflows */
_getrealerror();
tzset();
#endif
#ifdef OS5
tzset();
#endif /* OS5 */
@@ -589,9 +519,6 @@ void start_lisp() {
/* entering the bytecode dispatch loop; interrupts get */
/* unblocked here */
int_init();
#ifdef DOS
_dpmi_lockregion((void *)&dispatch, 32768);
#endif /* DOS */
dispatch();
}
@@ -638,18 +565,12 @@ int makepathname(char *src, char *dst)
ERRSETJMP(0);
if (*(base + 1) == '/') {
/* path is "~/foo" */
#ifdef DOS
pwd = 0;
#else
TIMEOUT(pwd = getpwuid(getuid()));
#endif /* DOS */
if (pwd == NULL) {
*Lisp_errno = errno;
return (0);
}
#ifndef DOS
sprintf(dst, "%s%s", pwd->pw_dir, base + 1);
#endif
return (1);
} else {
/* path is "~foo/" */
@@ -659,16 +580,12 @@ int makepathname(char *src, char *dst)
len = (UNSIGNED)cp - (UNSIGNED)base - 1;
strncpy(name, base + 1, len);
name[len] = '\0';
#ifndef DOS
TIMEOUT(pwd = getpwnam(name));
#endif /* DOS */
if (pwd == NULL) {
*Lisp_errno = errno;
return (0);
}
#ifndef DOS
sprintf(dst, "%s%s", pwd->pw_dir, cp);
#endif /* DOS */
return (1);
}
}

View File

@@ -12,9 +12,7 @@
/* misc7.c
*/
#include <stdio.h>
#ifndef DOS
#include <sys/ioctl.h>
#endif /* DOS */
#include "lispemul.h"
#include "lspglob.h"
#include "adr68k.h"

View File

@@ -33,18 +33,8 @@
#include <stdio.h>
#include <time.h>
#ifndef DOS
#include <sys/time.h>
#endif /* DOS */
#ifdef DOS
int main(void) {
long dtime;
time(&dtime);
printf("long MDate= %ld;\n", dtime);
return (0);
}
#else
/* Version for every other Unix */
int main(void) {
struct timeval time;
@@ -60,4 +50,3 @@ int main(void) {
return (0);
}
#endif /* DOS */

View File

@@ -20,102 +20,8 @@
MouseInterfaceRec curmouse;
MouseInterface currentmouse = &curmouse;
#ifdef DOS
#include <dos.h>
int nomouseflag = FALSE;
extern DLword *Lisp_world;
extern LispPTR *LASTUSERACTION68k;
extern int twobuttonflag;
extern void EnterDosMouse();
extern void ExitDosMouse();
extern void DosMouseAfterRaid();
extern void DosMouseBeforeRaid();
extern unsigned long GenericReturnT();
extern void ThreeButtonHandler();
extern void TwoButtonHandler();
#endif /* DOS */
#ifdef DOS
/*****************************************************************/
/* p r o b e m o u s e */
/* */
/* Probe for mouse and return the number of buttons available. */
/*****************************************************************/
int probemouse() {
union REGS regs;
char c;
/***************************************************************************
* Reset mouse driver, exit if no mouse driver present
***************************************************************************/
/* int 33h, case 0000, ax = drive installed, bx = # of buttons. */
if (nomouseflag) {
return (666); /* return something, why not 666? */
} else {
regs.w.eax = 0; /* Func 0 = Reset mouse, ret. button info */
int86(0x33, &regs, &regs);
if (regs.x.ax == 0x0000) VESA_errorexit("No mouse driver found.", -1);
return (regs.x.bx);
}
}
#endif
void make_mouse_instance(MouseInterface mouse)
{
#ifdef DOS
int NumberOfButtons;
if (nomouseflag) {
mouse->device.enter = &GenericReturnT;
mouse->device.exit = &GenericReturnT;
mouse->device.before_raid = &GenericReturnT;
mouse->device.after_raid = &GenericReturnT;
mouse->device.active = FALSE;
NumberOfButtons = 3;
} else {
mouse->device.enter = &EnterDosMouse;
mouse->device.exit = &ExitDosMouse;
mouse->device.before_raid = &DosMouseBeforeRaid;
mouse->device.after_raid = &DosMouseAfterRaid;
mouse->device.active = FALSE;
NumberOfButtons = probemouse();
}
mouse->Button.StartTime = 2;
mouse->Cursor.Last.width = 16;
mouse->Cursor.Last.height = 16;
if (nomouseflag == FALSE) {
if (twobuttonflag) { /* We force two button handling. */
mouse->Handler = &TwoButtonHandler;
mouse->Button.TwoButtonP = TRUE;
} else /* Determine how many buttons we have. */
switch (NumberOfButtons) {
case 0x0000: /* Other than 2 buttons, assume three */
mouse->Button.TwoButtonP = FALSE;
mouse->Handler = &ThreeButtonHandler;
break;
case 0x0002: /* Two buttons. */
mouse->Button.TwoButtonP = TRUE;
mouse->Handler = &TwoButtonHandler;
break;
case 0x0003: /* Three buttons. */
mouse->Button.TwoButtonP = FALSE;
mouse->Handler = &ThreeButtonHandler;
break;
case 0xffff: /* Two buttons. */
mouse->Button.TwoButtonP = TRUE;
mouse->Handler = &TwoButtonHandler;
break;
default: /* Strange case, assume three. */
mouse->Button.TwoButtonP = FALSE;
mouse->Handler = &ThreeButtonHandler;
break;
}
}
/* mouse->timestamp = ((*LASTUSERACTION68k& 0xffffff) + Lisp_world); */
#elif XWINDOW
#if XWINDOW
#endif /* DOS or XWINDOW */
}

View File

@@ -18,7 +18,6 @@
/* */
/************************************************************************/
#ifndef DOS
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
@@ -30,7 +29,6 @@
#include <netdb.h>
#include <errno.h>
#include <string.h> /* for memset/memcpy */
#endif /* DOS */
#include "lispemul.h"
#include "lispmap.h"
#include "lsptypes.h"
@@ -48,7 +46,6 @@
LispPTR rpc(LispPTR *args)
{
#ifndef DOS
/* Arguments are:
args[0]:Destination Address; hostname or internet address are both supported.
args[1]:Remote port for this program.
@@ -194,5 +191,4 @@ getbuf:
*/
handle_error:
return (NIL_PTR);
#endif /* DOS */
}

View File

@@ -515,9 +515,7 @@ void OP_subrcall(int subr_no, int argnum) {
/* Communications with Unix Subprocess */
case sb_UNIX_HANDLECOMM: POP_SUBR_ARGS;
#ifndef DOS
TopOfStack = Unix_handlecomm(args);
#endif /* DOS */
break;
/*

View File

@@ -28,22 +28,8 @@
#include <time.h>
#include <unistd.h>
#ifdef DOS
#include <dos.h>
#include <i32.h> /* "#pragma interrupt" & '_chain_intr'*/
/******************************************************************************
* Global variables
******************************************************************************/
void (*prev_int_1c)(); /* keeps address of previous 1c handlr*/
/* used for chaining & restore at exit*/
#pragma interrupt(DOStimer)
void DOStimer();
unsigned long tick_count = 0; /* approx 18 ticks per sec */
#else /* DOS */
#include <sys/resource.h>
#include <sys/time.h>
#endif /* DOS */
#ifdef USE_DLPI
#include <stropts.h>
@@ -104,18 +90,6 @@ static int gettime(int casep);
/************************************************************************/
void update_miscstats() {
#ifdef DOS
struct dostime_t dtm; /* holds DOS time, so we can get .01 secs */
_dos_gettime(&dtm);
MiscStats->totaltime = (time(0) * 1000) + (10 * dtm.hsecond);
MiscStats->swapwaittime = 0;
MiscStats->pagefaults = 0;
MiscStats->swapwrites = 0;
MiscStats->diskiotime = 0; /* ?? not available ?? */
MiscStats->diskops = 0;
MiscStats->secondstmp = MiscStats->secondsclock = (time(0) + UNIX_ALTO_TIME_DIFF);
#else
struct timeval timev;
struct rusage ru;
@@ -132,7 +106,6 @@ void update_miscstats() {
;
gettimeofday(&timev, NULL);
MiscStats->secondstmp = MiscStats->secondsclock = (timev.tv_sec + UNIX_ALTO_TIME_DIFF);
#endif /* DOS */
}
/************************************************************************/
@@ -197,20 +170,11 @@ LispPTR subr_gettime(LispPTR args[])
static int gettime(int casep)
{
#ifdef DOS
struct dostime_t dtm; /* for hundredths of secs */
#else
struct timeval timev;
#endif /* DOS */
switch (casep) {
case 0: /* elapsed time in alto milliseconds */
#ifdef DOS
_dos_gettime(&dtm);
return ((time(0) + UNIX_ALTO_TIME_DIFF) * 1000) + (10 * dtm.hsecond);
#else /* DOS */
gettimeofday(&timev, NULL);
return ((timev.tv_sec + UNIX_ALTO_TIME_DIFF) * 1000 + timev.tv_usec / 1000);
#endif /* DOS */
case 1: /* starting elapsed time in milliseconds */ return (MiscStats->starttime);
@@ -221,20 +185,12 @@ static int gettime(int casep)
case 3: /* total GC time in milliseconds */ return (MiscStats->gctime);
case 4: /* current time of day in Alto format */
#ifdef DOS
return (time(0) + UNIX_ALTO_TIME_DIFF);
#else
gettimeofday(&timev, NULL);
return (timev.tv_sec + UNIX_ALTO_TIME_DIFF);
#endif
case 5: /* current time of day in Interlisp format */
#ifdef DOS
return (time(0) + LISP_UNIX_TIME_DIFF);
#else
gettimeofday(&timev, NULL);
return (timev.tv_sec + LISP_UNIX_TIME_DIFF);
#endif
case 6:
return (98); /* this is wrong, only works in PST */
@@ -273,29 +229,10 @@ static int gettime(int casep)
void subr_settime(LispPTR args[])
{
#ifdef DOS
struct dostime_t dostime;
struct dosdate_t dosday;
struct tm uxtime;
uxtime = *localtime((time_t *)(*((int *)Addr68k_from_LADDR(args[0])) - UNIX_ALTO_TIME_DIFF));
dostime.hsecond = 0;
dostime.second = uxtime.tm_sec;
dostime.minute = uxtime.tm_min;
dostime.hour = uxtime.tm_hour;
_dos_settime(&dostime);
dosday.day = uxtime.tm_mday;
dosday.month = uxtime.tm_mon;
dosday.year = uxtime.tm_year;
dosday.dayofweek = uxtime.tm_wday;
_dos_setdate(&dosday);
#else
struct timeval timev;
timev.tv_sec = *((int *)Addr68k_from_LADDR(args[0])) - UNIX_ALTO_TIME_DIFF;
timev.tv_usec = 0;
settimeofday(&timev, NULL);
#endif
} /* end subr_settime */
/************************************************************************/
@@ -332,19 +269,11 @@ void subr_copytimestats(LispPTR args[])
LispPTR N_OP_rclk(LispPTR tos)
{
unsigned int usec;
#ifdef DOS
struct dostime_t dtm;
#endif /* DOS */
#ifdef DOS
_dos_gettime(&dtm);
usec = (time(0) * 1000000) + (10000 * dtm.hsecond);
#else
struct timeval timev;
gettimeofday(&timev, NULL);
usec = (timev.tv_sec * 1000000UL) + timev.tv_usec;
#endif /* DOS */
*((unsigned int *)(Addr68k_from_LADDR(tos))) = usec;
return (tos);
} /* end N_OP_rclk */
@@ -364,13 +293,9 @@ LispPTR N_OP_rclk(LispPTR tos)
/************************************************************************/
void update_timer() {
#ifdef DOS
MiscStats->secondstmp = MiscStats->secondsclock = time(0) + UNIX_ALTO_TIME_DIFF;
#else
struct timeval timev;
gettimeofday(&timev, NIL);
MiscStats->secondstmp = MiscStats->secondsclock = (timev.tv_sec + UNIX_ALTO_TIME_DIFF);
#endif /* DOS */
}
/************************************************************************/
@@ -443,24 +368,6 @@ static void int_timer_service(int sig)
static void int_timer_init()
{
#ifdef DOS
/******************************************************************************
* All code and data touched during the processing of an interrupt should
* locked prior to receiving any interrupts. This prevents the Timer
* function from being swapped out during an interrupt.
******************************************************************************/
_dpmi_lockregion((void *)Irq_Stk_End, sizeof(Irq_Stk_End));
_dpmi_lockregion((void *)Irq_Stk_Check, sizeof(Irq_Stk_Check));
_dpmi_lockregion((void *)tick_count, sizeof(tick_count));
_dpmi_lockregion((void *)&DOStimer, 4096);
_dpmi_lockregion((void *)prev_int_1c, sizeof(prev_int_1c));
/* Set up the DOS time handler. */
prev_int_1c = _dos_getvect(0x1c); /* get addr of current 1c hndlr, */
/* if any*/
_dos_setvect(0x1c, DOStimer); /* hook our int handler to timer int */
#else
struct itimerval timert;
struct sigaction timer_action;
@@ -478,7 +385,6 @@ static void int_timer_init()
setitimer(ITIMER_VIRTUAL, &timert, NULL);
DBPRINT(("Timer interval set to %d usec\n", timert.it_value.tv_usec));
#endif /* DOS */
}
/************************************************************************/
@@ -494,9 +400,7 @@ static void int_timer_init()
void int_io_open(int fd)
{
#ifdef DOS
/* would turn on DOS kbd signal handler here */
#elif KBINT
#if KBINT
DBPRINT(("int_io_opening %d\n", fd));
if (fcntl(fd, F_SETOWN, getpid()) == -1) {
@@ -510,9 +414,7 @@ void int_io_open(int fd)
void int_io_close(int fd)
{
#ifdef DOS
/* Turn off signaller here */
#elif KBINT
#if KBINT
fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) & ~O_ASYNC);
#endif
}
@@ -529,7 +431,6 @@ void int_io_close(int fd)
/************************************************************************/
static void int_io_init() {
#ifndef DOS
struct sigaction io_action;
io_action.sa_handler = getsignaldata;
sigemptyset(&io_action.sa_mask);
@@ -556,7 +457,6 @@ static void int_io_init() {
return;
}
#endif /* USE_DLPI */
#endif /* DOS */
}
/************************************************************************/
@@ -572,9 +472,6 @@ static void int_io_init() {
void int_block() {
/* temporarily turn off interrupts */
#ifdef DOS
_dos_setvect(0x1c, prev_int_1c);
#else /* DOS */
sigset_t signals;
sigemptyset(&signals);
sigaddset(&signals, SIGVTALRM);
@@ -585,7 +482,6 @@ void int_block() {
sigaddset(&signals, SIGFPE);
#endif
sigprocmask(SIG_BLOCK, &signals, NULL);
#endif /* DOS */
}
/************************************************************************/
@@ -600,9 +496,6 @@ void int_block() {
/************************************************************************/
void int_unblock() {
#ifdef DOS
_dos_setvect(0x1c, DOStimer);
#else /* DOS */
sigset_t signals;
sigemptyset(&signals);
sigaddset(&signals, SIGVTALRM);
@@ -613,7 +506,6 @@ void int_unblock() {
sigaddset(&signals, SIGFPE);
#endif
sigprocmask(SIG_UNBLOCK, &signals, NULL);
#endif /* DOS */
}
#ifdef FLTINT
@@ -773,7 +665,6 @@ and do a 'v' before trying anything else.";
/* */
/************************************************************************/
static void int_panic_init() {
#ifndef DOS
struct sigaction panic_action, ignore_action;
panic_action.sa_sigaction = panicuraid;
@@ -797,7 +688,6 @@ static void int_panic_init() {
/* Ignore SIGPIPE */
sigaction(SIGPIPE, &ignore_action, NULL);
#endif
DBPRINT(("Panic interrupts enabled\n"));
}
@@ -823,41 +713,3 @@ void int_init() {
int_unblock(); /* Turn on interrupts */
}
#ifdef DOS
/******************************************************************************
* DOStimer()
*
* The interrupt 0x1c handler. This routine must be declared using the
* '#pragma interrupt()' statement to ensure that all registers are preserved.
* It is also needed to ensure the proper functioning of '_chain_intr()'.
*
* The timer interrupt (normally) occurs 18.2 times per second. This routine
* waits one extra tick every 91 ticks (18.2*5).
*
* Before this interrupt was installed, 'prev_int_1c' was set to the current
* 0x1c interrupt. 'DOStimer()' chains to this interrupt using '_chain_intr()',
* rather than returning back to the caller.
*
* Note that as little as possible should be done within a timer interrupt,
* since further clock ticks are disabled until the interrupt returns.
******************************************************************************/
void DOStimer() {
/* if (--tick_count == 0) { */
Irq_Stk_Check = 0;
Irq_Stk_End = 0;
/* _dos_setvect(0x1c, prev_int_1c);
} else if (tick_count <= 0) { */
/* I'm dead, uninstall me */
/* _dos_setvect(0x1c, prev_int_1c);
tick_count = 0;
} */
_chain_intr(prev_int_1c); /* call previous int 1c handlr, if any*/
/* (pts to 'ret' if no prev installed)*/
}
void alarm(unsigned long sec)
{
/* tick_count = sec * 18;
_dos_setvect(0x1c, DOStimer); */
}
#endif /* DOS */

193
src/ufs.c
View File

@@ -19,21 +19,10 @@
#include <sys/types.h>
#include <unistd.h>
#ifndef DOS
#include <dirent.h>
#include <pwd.h>
#include <sys/param.h>
#include <sys/time.h>
#else /* DOS */
#include <dos.h>
#include <i32.h> /* "#pragma interrupt" & '_chain_intr'*/
#include <io.h>
#include <stk.h> /* _XSTACK struct definition */
#define MAXPATHLEN _MAX_PATH
#define MAXNAMLEN _MAX_PATH
#define alarm(x) 1
#endif /* DOS */
#include "lispemul.h"
#include "lispmap.h"
@@ -59,72 +48,9 @@ int Dummy_errno; /* If errno cell is not provided by Lisp, dummy_errno is used.
/* Used to limit DOS filenames to 8.3 format */
#ifdef DOS
#define NameValid extensionp ? (extlen < 3) : (namelen < 8)
#define CountNameChars \
{ extensionp ? extlen++ : namelen++; }
#else
/* Other file systems don't care */
#define NameValid 1
#define CountNameChars
#endif /* DOS */
#ifdef DOS
void (*prev_int_24)(); /* keeps address of previous 24 handlr*/
#pragma interrupt(Int24)
/*
* Name: Int24
*
* Description: Bypass the "Abort, Retry, Fail?" message that
* DOS issues.
*
*/
void Int24(void) {
unsigned deverr, errcode;
union REGS regs;
_XSTACK *stk;
stk = (_XSTACK *)_get_stk_frame(); /* get ptr to the V86 _XSTACK frame */
deverr = stk->eax;
if ((deverr & 0x00008000) == 0) /* is a disk error */
{
stk->eax = _HARDERR_FAIL;
stk->opts |= _STK_NOINT; /* set _STK_NOINT to prevent V86 call */
_chain_intr(prev_int_24); /* call previous int 24 handlr, if any*/
/* (pts to 'ret' if no prev installed)*/
}
}
/*
* Name: init_host_filesystem
*
* Description: Initialize the hosts filesystem by installing
* the "critical error handler".
*/
init_host_filesystem() {
prev_int_24 = _dos_getvect(0x24); /* get addr of current handler, if any */
_dos_setvect(0x24, Int24); /* hook our int handler to interrupt */
_dpmi_lockregion((void *)prev_int_24, sizeof(prev_int_24));
_dpmi_lockregion((void *)&Int24, 4096);
}
/*
* Name: exit_host_filesystem
*
* Description: Cleanup the filesystem specific patches.
*
*/
exit_host_filesystem() {
_dos_setvect(0x24, prev_int_24); /* unhook our handlr, install previous*/
_dpmi_unlockregion((void *)prev_int_24, sizeof(prev_int_24));
_dpmi_unlockregion((void *)&Int24, 4096);
}
#endif /* DOS */
/*
* Name: UFS_getfilename
@@ -172,11 +98,7 @@ LispPTR UFS_getfilename(LispPTR *args)
* Thus we don't need to convert a version field. Third argument for
* unixpathname specifies it.
*/
#ifdef DOS
if (unixpathname(lfname, file, 0, 0, 0, 0, 0) == 0) return (NIL);
#else
if (unixpathname(lfname, file, 0, 0) == 0) return (NIL);
#endif /* DOS */
switch (args[1]) {
case RECOG_OLD:
@@ -254,11 +176,7 @@ LispPTR UFS_deletefile(LispPTR *args)
LispStringToCString(args[0], fbuf, MAXPATHLEN);
#ifdef DOS
if (unixpathname(fbuf, file, 0, 0, 0, 0, 0) == 0) return (NIL);
#else
if (unixpathname(fbuf, file, 0, 0) == 0) return (NIL);
#endif /* DOS */
/*
* On UNIX device, all we have to do is just to unlink the file.
@@ -312,17 +230,9 @@ LispPTR UFS_renamefile(LispPTR *args)
if (len > MAXPATHLEN) FileNameTooLong(NIL);
LispStringToCString(args[0], fbuf, MAXPATHLEN);
#ifdef DOS
if (unixpathname(fbuf, src, 0, 0, 0, 0, 0) == 0) return (NIL);
#else
if (unixpathname(fbuf, src, 0, 0) == 0) return (NIL);
#endif /* DOS */
LispStringToCString(args[1], fbuf, MAXPATHLEN);
#ifdef DOS
if (unixpathname(fbuf, dst, 0, 0, 0, 0, 0) == 0) return (NIL);
#else
if (unixpathname(fbuf, dst, 0, 0) == 0) return (NIL);
#endif /* DOS */
TIMEOUT(rval = rename(src, dst));
if (rval == -1) {
@@ -384,11 +294,7 @@ LispPTR UFS_directorynamep(LispPTR *args)
LispStringToCString(args[0], dirname, MAXPATHLEN);
/* Convert Xerox Lisp file naming convention to Unix one. */
#ifdef DOS
if (unixpathname(dirname, fullname, 0, 0, 0, 0, 0) == 0) return (NIL);
#else
if (unixpathname(dirname, fullname, 0, 0) == 0) return (NIL);
#endif /* DOS */
TIMEOUT(rval = stat(fullname, &sbuf));
if (rval == -1) {
@@ -447,11 +353,7 @@ LispPTR UFS_directorynamep(LispPTR *args)
* UNIX trail directory delimiter '/'.
*
*/
#ifdef DOS
int unixpathname(char *src, char *dst, int versionp, int genp, char *drive, int *extlenptr, char *rawname)
#else
int unixpathname(char *src, char *dst, int versionp, int genp)
#endif /* DOS */
{
register char *cp, *dp, *np;
register int newdirflg;
@@ -460,20 +362,7 @@ int unixpathname(char *src, char *dst, int versionp, int genp)
char ver1[VERSIONLEN], ver2[VERSIONLEN];
struct passwd *pwd;
#ifdef DOS
char *rp;
int namelen = 0, extlen = 0; /* lengths of name & extension */
int extensionp = 0; /* T if we're in the extension */
int version = 1; /* version # for this file */
#endif /* DOS */
/* If there's a drive letter, it and a colon come first */
#ifdef DOS
if (drive && (*drive)) {
*dst++ = *drive;
*dst++ = DRIVESEP;
}
#endif /* DOS */
/*
* The UNIX root directory is represented as "<" in Xerox Lisp generic
@@ -492,11 +381,7 @@ int unixpathname(char *src, char *dst, int versionp, int genp)
* because the quotation mark which quotes the semicolon might be lost
* in the course of the following conversion.
*/
#ifdef DOS
if (versionp) LispVersionToUnixVersion(lfname, version) else version = -1;
#else
if (versionp) LispVersionToUnixVersion(lfname);
#endif /* DOS */
cp = lfname;
dp = dst;
@@ -516,11 +401,7 @@ int unixpathname(char *src, char *dst, int versionp, int genp)
* user's current working directory.
*/
if (getcwd(dst, MAXPATHLEN) == 0) return (0);
#ifdef DOS
dp = max(strrchr(dst, '/'), strrchr(dst, DIRSEP));
#else
dp = strrchr(dst, '/');
#endif /* DOS */
dp++;
if (*(cp + 2) == '\0')
@@ -532,10 +413,6 @@ int unixpathname(char *src, char *dst, int versionp, int genp)
*dp++ = DIRSEP;
}
break;
#ifdef DOS
case '/':
case DIRSEP:
#endif
case '>':
/* ".>" means the user's current working directory. */
if (getcwd(dst, MAXPATHLEN) == 0) return (0);
@@ -560,7 +437,6 @@ int unixpathname(char *src, char *dst, int versionp, int genp)
break;
}
break;
#ifndef DOS
case '~':
if (*(cp + 1) == '>' || *(cp + 1) == '\0') {
/* "~>" or "~" means the user's home directory. */
@@ -606,30 +482,6 @@ int unixpathname(char *src, char *dst, int versionp, int genp)
}
break;
#else
/* For DOS, ignore ~> or ~/ or ~ */
case '~':
if (*(cp + 1) == '>' || *(cp + 1) == '\0') {
/* "~>" or "~" means the user's home directory. */
*dp++ = DIRSEP;
if (*(cp + 1) == '\0')
cp++;
else
cp += 2;
} else {
/*
* In this case, we assume some user's home directory
* is specified in the form "~username".
*/
for (++cp, np = name; *cp != '\0' && *cp != '>';) *np++ = *cp++;
*dp++ = DIRSEP;
if (*cp == '>') cp++;
}
break;
#endif /* DOS */
default:
*dp++ = '/'; /* Insert the initial directory delimiter. */
break;
@@ -725,9 +577,6 @@ int unixpathname(char *src, char *dst, int versionp, int genp)
}
} else {
switch (*cp) {
#ifdef DOS
case '/': /* in DOS, must xlate / also. */
#endif /* DOS */
case '>':
/*
* Xerox Lisp directory delimiter '>' is translated into
@@ -737,10 +586,6 @@ int unixpathname(char *src, char *dst, int versionp, int genp)
dp++;
cp++;
newdirflg = 1; /* Turn on the new directory flag. */
#ifdef DOS
namelen = extlen = 0;
rp = dp; /* remember where raw filename starts */
#endif /* DOS */
break;
case '\'':
@@ -751,21 +596,8 @@ int unixpathname(char *src, char *dst, int versionp, int genp)
* So only we have to do is to skip the quotation mark
* and copy the next character.
*/
#ifdef DOS
if (NameValid) *dp++ = *(cp + 1);
CountNameChars;
#endif /* DOS */
cp += 2;
break;
#ifdef DOS
case '.': /* start of extension, if not already */
if (!extensionp)
*dp++ = *cp++;
else
cp++;
extensionp = 1;
break;
#endif /* DOS */
default:
if (NameValid)
*dp++ = *cp++;
@@ -808,12 +640,6 @@ int unixpathname(char *src, char *dst, int versionp, int genp)
*(dp - 1) = '\0';
}
}
#ifdef DOS
if (version >= 0)
sprintf(ver2, "%d", version);
else
*ver2 = '\0';
#endif /* DOS */
ConcNameAndVersion(fbuf2, ver2, dst);
}
return (1);
@@ -867,14 +693,6 @@ int lisppathname(char *fullname, char *lispname, int dirp, int versionp)
return (1);
}
#ifdef DOS
/* Split off the drive, if there is one. */
if (fullname[1] == DRIVESEP) {
*lispname++ = *fullname++;
*lispname++ = *fullname++;
}
#endif
if (!dirp) {
/*
* The characters which are dealt with specially (i.e. are quoted)
@@ -945,16 +763,11 @@ int lisppathname(char *fullname, char *lispname, int dirp, int versionp)
switch (*cp) {
case '>':
case ';':
#ifndef DOS
case '\'':
#endif /* DOS */
*dp++ = '\'';
*dp++ = *cp++;
break;
#ifdef DOS
case '/':
#endif
case DIRSEP:
*dp++ = '>';
cp++;
@@ -996,12 +809,6 @@ int lisppathname(char *fullname, char *lispname, int dirp, int versionp)
i = 1;
while (*cp) {
switch (*cp) {
#ifdef DOS
case DIRSEP:
*dp++ = '/';
cp++;
break;
#endif
case '>':
case ';':
case '\'':

View File

@@ -7,7 +7,6 @@ Unix Interface Communications
*/
/* Don't compile this at all under DOS. */
#ifndef DOS
#ifndef _GNU_SOURCE
#define _GNU_SOURCE /* Needed for ptsname on glibc systems. */
@@ -929,4 +928,3 @@ void WriteLispStringToPipe(LispPTR lispstr) {
write(UnixPipeOut, shcom, len);
}
#endif /* DOS */

View File

@@ -27,13 +27,11 @@
#include <sys/types.h>
#include <unistd.h>
#ifndef DOS
#include <sys/file.h>
#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/wait.h>
#include <sys/select.h>
#endif /* DOS */
#ifdef SUNDISPLAY
#include <sundev/kbd.h>
@@ -89,20 +87,11 @@ extern int Win_security_p;
#include "etherdefs.h"
#endif
#ifdef DOS
#define vfork() printf("No forking around here.\n")
#endif /* DOS */
#if defined(DOS) || defined(XWINDOW)
#include "devif.h"
extern DspInterface currentdsp;
#endif /* DOS || XWINDOW */
#ifdef DOS
extern MouseInterface currentmouse;
extern KbdInterface currentkbd;
#endif /* DOS */
#ifdef COLOR
extern int MonoOrColor;
extern int Dispcolorsize;
@@ -175,41 +164,6 @@ DLword *HideColorDisp68k;
extern int Inited_Color;
#endif /* COLOR */
#ifdef DOS
char *URaid_summary1 =
"\n-- Stack display commands\n\
c\t\t\tChecks all user stack contents\n\
f number\t\tDisplays stack frame for that frame number (decimal)\n\
k type\t\t\tChanges the type of stack link following. (a|c)\n\
l [type]\t\tBack Trace for specified type stack. (k|m|r|g|p|u|<null>)\n\
<CR>\t\t\tDisplay next frame.\n";
char *URaid_summary2 =
"\n-- Memory display commands\n\
a litatom\t\tDisplays the top-level value of the litatom\n\
B Xaddress\t\tPrint the contents of the arrayblock at that address.\n\
d litatom\t\tDisplays the definition cell for the litatom\n\
M\t\t\tDisplays TOS,CSP,PVAR,IVAR,PC\n\
m func1 func2\t\tMOVD func1 to func2\n\
O Xaddress\t\tDisplays the object with that address\n\
t Xaddress\t\tDisplays the type of this object\n\
p litatom\t\tDisplays the property list of the litatom\n\
w\t\t\tDisplays the current function-name and PC\n\
x Xaddress [xnum]\tHex-Dump xnum (16-bit) words starting at Xaddress\n\
@ litatom val\t\tSets TOPVAL of litatom to Decimal-val\n\
< Xaddress Xval\t\tSets the (16-bit) word at the address to Xval\n";
char *URaid_summary3 =
"\n-- Continue or exit commands\n\
e\t\t\tExit to DOS\n\
h\t\t\tDo a HARDRESET\n\
q\t\t\tReturns from URAID with NO change\n\
<<Misc>>\ns\t\t\tInvoke Shell\n\
v filename\t\tSave the virtual memory on the filename(Not Bootable)\n\
( [num]\t\t\tSets Print level\n\
!\t\t\tPrints the error message passed from the emulator\n\
?\t\t\tDisplay this summary";
#else
char *URaid_summary =
"---URAID command summary---\n\
\n-- Stack display commands\n\
@@ -241,7 +195,6 @@ v filename\t\tSaves the virtual memory on the filename (Not Bootable)\n\
( [num]\t\t\tSets the print level\n\
!\t\t\tDisplays the error message passed from the emulator\n\
?\t\t\tDisplays this summary";
#endif /* DOS */
#define ADD_RANGEP(address) \
if (((address) < 0) || (POINTERMASK < (address))) { \
@@ -372,9 +325,7 @@ LispPTR uraid_commands() {
int num, address, val;
LispPTR index;
DefCell *defcell68k;
#ifndef DOS
int status;
#endif /* DOS */
if (URaid_argnum == -1) {
/* disp next FX */
@@ -388,11 +339,6 @@ LispPTR uraid_commands() {
}
switch (URaid_comm) {
/*** Displaying STACK stuff */
#ifdef DOS
case '1': printf("%s\n", URaid_summary1); break;
case '2': printf("%s\n", URaid_summary2); break;
case '3': printf("%s\n", URaid_summary3); break;
#endif /* DOS */
case 'c': stack_check(0); break;
case 'C': all_stack_dump(0, 0, T); break;
case 'f': /**if((URaid_arg1[0] < '0') || (URaid_arg1[0] > '9')){
@@ -766,11 +712,7 @@ LispPTR uraid_commands() {
fflush(stdin);
break;
case 'e': /* exit to UNIX */
#ifdef DOS
printf("Exit to DOS?[confirm](Y or N)<");
#else /* DOS */
printf("Exit to UNIX?[confirm](Y or N)<");
#endif /* DOS */
{
int c;
c = getchar();
@@ -787,10 +729,8 @@ LispPTR uraid_commands() {
default: break;
}
#ifndef DOS
(void)wait(&status);
/* system("/bin/sh -i"); */
#endif /* DOS */
return (T);
/* break; */
case 'v':
@@ -827,13 +767,7 @@ LispPTR uraid_commands() {
printf("PrintLevel is set to %d.", num);
break;
case '?':
#ifdef DOS
printf(
" 1: <<Displaying the Stack>>\n 2: <<Displaying memory contents>>\n 3: <<Return or "
"Exit>>\n");
#else
printf("%s\n", URaid_summary);
#endif /* DOS */
break;
case '!': printf("Error message is: %s\n", URaid_errmess); break;
@@ -997,10 +931,6 @@ int device_before_raid() {
#if defined(XWINDOW) || defined(DOS)
(currentdsp->cleardisplay)(currentdsp);
(currentdsp->device.before_raid)(currentdsp);
#ifdef DOS
(currentmouse->device.before_raid)(currentmouse);
(currentkbd->device.before_raid)(currentkbd);
#endif /* DOS */
#endif /* XWINDOW || DOS */
return (0);
@@ -1115,11 +1045,6 @@ int device_after_raid() {
(currentdsp->device.after_raid)(currentdsp);
FD_SET(ConnectionNumber(currentdsp->display_id), &LispReadFds);
flush_display_buffer();
#elif DOS
(currentdsp->device.after_raid)(currentdsp);
(currentmouse->device.after_raid)(currentmouse, currentdsp);
(currentkbd->device.after_raid)(currentkbd);
flush_display_buffer();
#endif /* XWINDOW | DOS */
int_unblock();

View File

@@ -25,9 +25,7 @@
#include <time.h>
#include <unistd.h>
#ifndef DOS
#include <pwd.h>
#endif
#include "lispemul.h"
#include "adr68k.h"
@@ -115,9 +113,6 @@ int c_string_to_lisp_string(char *C, LispPTR Lisp) {
register char *dp;
for (i = 0, dp = C; i < length + 1; i++) {
int ch = *dp++;
#ifdef DOS
if (ch == '\\') dp++; /* skip 2nd \ in \\ in C strings */
#endif /* DOS */
GETBYTE(base++) = ch;
}
}
@@ -149,12 +144,10 @@ LispPTR check_unix_password(LispPTR *args) {
/************************************************************************/
LispPTR unix_username(LispPTR *args) {
#ifndef DOS
struct passwd *pwd;
if ((pwd = getpwuid(getuid())) == NULL) return NIL;
if (c_string_to_lisp_string(pwd->pw_name, args[0])) return NIL;
#endif /* DOS */
return ATOM_T;
}
@@ -202,8 +195,6 @@ LispPTR unix_getparm(LispPTR *args) {
if (strcmp(envname, "MACH") == 0) {
#if defined(sparc)
envvalue = "sparc";
#elif defined(DOS)
envvalue = "386";
#elif defined(MAIKO_OS_MACOS)
envvalue = "i386";
#else
@@ -213,8 +204,6 @@ LispPTR unix_getparm(LispPTR *args) {
} else if (strcmp(envname, "ARCH") == 0) {
#if defined(sparc)
envvalue = "sun4";
#elif defined(DOS)
envvalue = "dos";
#elif defined(MAIKO_OS_MACOS)
envvalue = "i386";
#else
@@ -230,7 +219,6 @@ LispPTR unix_getparm(LispPTR *args) {
envvalue = "DIRECT";
#endif
}
#ifndef DOS
else if (strcmp(envname, "HOSTNAME") == 0) {
if (gethostname(result, sizeof result)) return NIL;
envvalue = result;
@@ -246,7 +234,6 @@ LispPTR unix_getparm(LispPTR *args) {
snprintf(result, sizeof(result), "%lx", gethostid());
envvalue = result;
}
#endif /* DOS */
else
return NIL;
@@ -280,12 +267,10 @@ LispPTR unix_getenv(LispPTR *args) {
/************************************************************************/
LispPTR unix_fullname(LispPTR *args) {
#ifndef DOS
struct passwd *pwd;
if ((pwd = getpwuid(getuid())) == NULL) return NIL;
if (c_string_to_lisp_string(pwd->pw_gecos, args[0])) return NIL;
#endif /* DOS */
return ATOM_T;
}
@@ -301,7 +286,6 @@ extern DLword *EmMouseX68K, *EmMouseY68K, *EmKbdAd068K, *EmRealUtilin68K, *EmUti
extern DLword *EmKbdAd168K, *EmKbdAd268K, *EmKbdAd368K, *EmKbdAd468K, *EmKbdAd568K;
LispPTR suspend_lisp(LispPTR *args) {
#ifndef DOS
extern DLword *CTopKeyevent;
extern LispPTR *KEYBUFFERING68k;
@@ -355,6 +339,5 @@ LispPTR suspend_lisp(LispPTR *args) {
((RING *)CTopKeyevent)->write = MINKEYEVENT;
else
((RING *)CTopKeyevent)->write = w + KEYEVENTSIZE;
#endif /* DOS, which doesn't support suspend-lisp */
return ATOM_T;
}

View File

@@ -22,19 +22,11 @@
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#ifndef DOS
#include <dirent.h>
#include <string.h>
#include <sys/param.h>
#include <pwd.h>
#include <unistd.h>
#else
#include <direct.h>
#include <stdlib.h>
#define MAXPATHLEN _MAX_PATH
#define MAXNAMLEN _MAX_PATH
#define alarm(x) 1
#endif /* DOS */
#if defined(SUNDISPLAY) && defined(OLD_CURSOR)
#include <sunwindow/win_cursor.h>
@@ -78,10 +70,6 @@ extern int LispWindowFd;
extern struct pixrect *CursorBitMap, *InvisibleCursorBitMap;
extern struct cursor CurrentCursor, InvisibleCursor;
extern IFPAGE *InterfacePage;
#ifdef DOS
extern IOPAGE *IOPage68K;
extern DspInterface currentdsp;
#endif /* DOS */
#undef roundup
#define roundup(a, b) ((((unsigned)(a) + (b)-1) / (b)) * (b))
@@ -151,12 +139,7 @@ LispPTR vmem_save0(LispPTR *args)
{
register char *def;
char pathname[MAXPATHLEN], sysout[MAXPATHLEN], host[MAXNAMLEN];
#ifdef DOS
char pwd[MAXNAMLEN];
char drive[1];
#else
struct passwd *pwd;
#endif /* DOS */
Lisp_errno = &Dummy_errno;
@@ -164,34 +147,19 @@ LispPTR vmem_save0(LispPTR *args)
/* Check of lispstringP is safer for LispStringToCString */
LispStringToCString(args[0], pathname, MAXPATHLEN);
separate_host(pathname, host);
#ifdef DOS
if (!unixpathname(pathname, sysout, 0, 0, drive, 0, 0)) return (BADFILENAME);
#else
if (!unixpathname(pathname, sysout, 0, 0)) return (BADFILENAME);
#endif /* DOS */
return (vmem_save(sysout));
} else {
if ((def = getenv("LDEDESTSYSOUT")) == 0) {
#ifdef DOS
if (getcwd(pwd, MAXNAMLEN) == NULL) return (FILETIMEOUT);
strcpy(sysout, pwd);
strcat(sysout, "/lisp.vm");
#else
pwd = getpwuid(getuid()); /* NEED TIMEOUT */
if (pwd == (struct passwd *)NULL) return (FILETIMEOUT);
strcpy(sysout, pwd->pw_dir);
strcat(sysout, "/lisp.virtualmem");
#endif /* DOS */
} else {
if (*def == '~' && (*(def + 1) == '/' || *(def + 1) == '\0')) {
#ifdef DOS
if (getcwd(pwd, MAXNAMLEN) == NULL) return (FILETIMEOUT);
strcpy(sysout, pwd);
#else
pwd = getpwuid(getuid()); /* NEED TIMEOUT */
if (pwd == (struct passwd *)NULL) return (FILETIMEOUT);
strcpy(sysout, pwd->pw_dir);
#endif /* DOS */
strcat(sysout, def + 1);
} else {
strcpy(sysout, def);
@@ -322,13 +290,11 @@ LispPTR vmem_save(char *sysout_file_name)
#ifdef SUNDISPLAY
/* DLword *bmptr; */
#endif
#ifndef DOS
extern int ScreenLocked;
extern DLword *EmCursorX68K;
extern DLword *EmCursorY68K;
extern DLword NullCursor[];
extern DLword *EmCursorBitMap68K;
#endif /* DOS */
/* remove cursor image from screen */
@@ -342,11 +308,6 @@ LispPTR vmem_save(char *sysout_file_name)
EmCursorBitMap68K= NullCursor;*/
#endif /* OLD_CURSOR */
#elif DOS
/* For DOS, must also take the mouse cursor away (it's */
/* written into the display-region bitmap). */
currentdsp->device.locked++;
(currentdsp->mouse_invisible)(currentdsp, IOPage68K);
#endif /* SUNDISPLAY || DOS */
/* set FPTOVP */
@@ -363,12 +324,7 @@ LispPTR vmem_save(char *sysout_file_name)
*/
SETJMP(FILETIMEOUT);
#ifdef DOS
/* Bloddy 8 char filenames in dos ... /jarl */
make_old_version(tempname, sysout_file_name);
#else /* DOS */
sprintf(tempname, "%s-temp", sysout_file_name);
#endif /* DOS */
/* Confirm protection of specified file by open/close */
@@ -525,11 +481,6 @@ LispPTR vmem_save(char *sysout_file_name)
ScreenLocked = NIL;
#endif /* OLD_CURSOR */
#elif DOS
/* Must also put the mouse back. */
(currentdsp->mouse_visible)(IOPage68K->dlmousex, IOPage68K->dlmousey);
currentdsp->device.locked--;
#endif /* SUNDISPLAY */
/*printf("vmem is saved completely.\n");*/
@@ -563,8 +514,5 @@ void lisp_finish() {
/* if (UnixPID >= 0) kill(UnixPID, SIGKILL);*/ /* Then kill fork_Unix itself */
}
device_before_exit();
#ifdef DOS
exit_host_filesystem();
#endif /* DOS */
exit(1);
}

View File

@@ -24,13 +24,7 @@
#include <stdio.h>
#include <sys/types.h>
#ifdef DOS
#include <i32.h> /* Defines "#pragma interrupt" */
#include <stk.h> /* _XSTACK struct definition */
#include <dos.h> /* Defines REGS & other structs */
#else /* DOS */
#include <sys/time.h>
#endif /* DOS */
#include "lispemul.h"
#include "emlglob.h"
@@ -100,15 +94,6 @@
#include "vars3defs.h"
#include "z2defs.h"
#ifdef DOS
#include "iopage.h"
extern IOPAGE *IOPage68K;
#include "devif.h"
extern KbdInterface currentkbd;
extern DspInterface currentdsp;
extern MouseInterface currentmouse;
#endif /* DOS */
typedef struct conspage ConsPage;
typedef ByteCode *InstPtr;
@@ -117,11 +102,6 @@ register InstPtr pccache asm("si");
register LispPTR *cspcache asm("di");
register LispPTR tscache asm("bx");
#include "inlnPS2.h"
#elif (DOS && OPDISP)
#include "inlndos.h"
register InstPtr pccache asm("si");
register LispPTR *cspcache asm("di");
register LispPTR tscache asm("bx");
#endif /* DOS */
/* This used to be here for including optimized dispatch
@@ -210,11 +190,8 @@ void dispatch(void) {
};
#endif
#if (DOS && OPDISP)
#else
register LispPTR *cspcache;
register LispPTR tscache;
#endif
/* OP_FN_COMMON arguments */
@@ -1151,49 +1128,10 @@ check_interrupt:
}
}
#ifdef DOS
if (currentkbd->URaid == TRUE) {
currentkbd->URaid = NIL;
(currentkbd->device.exit)(currentkbd); /* Install the original handler */
error("Call URaid by User Interrupt");
} else if (currentmouse->Cursor.Moved) {
union REGS regs;
currentdsp->device.locked++;
/* Remove the mouse from the old place on the screen */
(currentdsp->mouse_invisible)(currentdsp, IOPage68K);
/* Find the new delta */
regs.w.eax = 0x000B; /* Function 0xB = get delta mickeys */
int86(0x33, &regs, &regs);
currentmouse->Cursor.New.x += (short)regs.w.ecx;
currentmouse->Cursor.New.y += (short)regs.w.edx;
if (currentmouse->Cursor.New.x < 0)
currentmouse->Cursor.New.x = 0;
else if (currentmouse->Cursor.New.x > (currentdsp->Display.width - 1))
currentmouse->Cursor.New.x = currentdsp->Display.width - 1;
if (currentmouse->Cursor.New.y < 0)
currentmouse->Cursor.New.y = 0;
else if (currentmouse->Cursor.New.y > (currentdsp->Display.height - 1))
currentmouse->Cursor.New.y = currentdsp->Display.height - 1;
IOPage68K->dlmousex = IOPage68K->dlcursorx = currentmouse->Cursor.New.x;
IOPage68K->dlmousey = IOPage68K->dlcursory = currentmouse->Cursor.New.y;
/* Paint the mouse back up on the screen on the new place */
(currentdsp->mouse_visible)(currentmouse->Cursor.New.x, currentmouse->Cursor.New.y);
currentmouse->Cursor.Moved = FALSE;
currentdsp->device.locked--;
}
#else
if (URaid_req == T) {
URaid_req = NIL;
error("Call URaid by User Interrupt");
}
#endif /* DOS */
else if ((KBDEventFlg > 0) && (*KEYBUFFERING68k == ATOM_T)) {
*KEYBUFFERING68k = ATOM_STARTED;
cause_interruptcall(DOBUFFEREDTRANSITION_index);