From 1b869932d8f57582e3386913fb7012271fa07f53 Mon Sep 17 00:00:00 2001 From: Nick Briggs Date: Mon, 15 Feb 2021 17:32:58 -0800 Subject: [PATCH] Start by removing all the ifdef'd DOS code in source and include files --- inc/bitblt.h | 14 +- inc/devif.h | 28 +-- inc/dirdefs.h | 3 - inc/display.h | 4 - inc/dskdefs.h | 4 - inc/kbdif.h | 8 - inc/locfile.h | 22 +- inc/medleyfp.h | 5 - inc/ufsdefs.h | 4 - inc/version.h | 8 - src/bbtsub.c | 50 ----- src/bitblt.c | 21 -- src/chardev.c | 16 -- src/common.c | 2 - src/dbgtool.c | 13 -- src/dir.c | 527 --------------------------------------------- src/dsk.c | 568 ------------------------------------------------- src/dspif.c | 47 +--- src/ether.c | 2 - src/inet.c | 4 - src/initdsp.c | 18 -- src/initkbd.c | 41 ---- src/initsout.c | 6 - src/kbdif.c | 16 +- src/kbdsubrs.c | 40 +--- src/keyevent.c | 28 +-- src/ldsout.c | 28 --- src/lpsolve.c | 11 - src/main.c | 85 +------- src/misc7.c | 2 - src/mkvdate.c | 11 - src/mouseif.c | 96 +-------- src/rpc.c | 4 - src/subr.c | 2 - src/timer.c | 152 +------------ src/ufs.c | 193 ----------------- src/unixcomm.c | 2 - src/uraid.c | 75 ------- src/uutils.c | 17 -- src/vmemsave.c | 52 ----- src/xc.c | 62 ------ 41 files changed, 11 insertions(+), 2280 deletions(-) diff --git a/inc/bitblt.h b/inc/bitblt.h index 1944b95..36a1bad 100644 --- a/inc/bitblt.h +++ b/inc/bitblt.h @@ -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 */ diff --git a/inc/devif.h b/inc/devif.h index 0d3f9bc..bf42088 100644 --- a/inc/devif.h +++ b/inc/devif.h @@ -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; diff --git a/inc/dirdefs.h b/inc/dirdefs.h index 763e2c5..5aa19a8 100644 --- a/inc/dirdefs.h +++ b/inc/dirdefs.h @@ -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 diff --git a/inc/display.h b/inc/display.h index 8f0191b..a274ff3 100755 --- a/inc/display.h +++ b/inc/display.h @@ -44,10 +44,6 @@ extern DLword *DISP_MAX_Address; #define DISPLAYBUFFER #endif /* XWINDOW */ -#ifdef DOS -#define DISPLAYBUFFER -#endif /* DOS */ - #ifdef DISPLAYBUFFER /************************************************************************/ /* */ diff --git a/inc/dskdefs.h b/inc/dskdefs.h index a868dcf..8574ad5 100644 --- a/inc/dskdefs.h +++ b/inc/dskdefs.h @@ -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); diff --git a/inc/kbdif.h b/inc/kbdif.h index bfe3de4..17b2001 100644 --- a/inc/kbdif.h +++ b/inc/kbdif.h @@ -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 */ diff --git a/inc/locfile.h b/inc/locfile.h index 615b136..60f67ac 100644 --- a/inc/locfile.h +++ b/inc/locfile.h @@ -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 */ diff --git a/inc/medleyfp.h b/inc/medleyfp.h index a6dc94b..af206c4 100644 --- a/inc/medleyfp.h +++ b/inc/medleyfp.h @@ -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 -#define FPCLEAR -#define FPTEST(result) (_getrealerror() & ( I87_ZERO_DIVIDE | I87_OVERFLOW | I87_UNDERFLOW)) - #else #include #define FPCLEAR diff --git a/inc/ufsdefs.h b/inc/ufsdefs.h index ca95197..0800968 100644 --- a/inc/ufsdefs.h +++ b/inc/ufsdefs.h @@ -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); diff --git a/inc/version.h b/inc/version.h index 869a2fa..4f7a5f6 100644 --- a/inc/version.h +++ b/inc/version.h @@ -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 */ diff --git a/src/bbtsub.c b/src/bbtsub.c index 4a38674..715ae9d 100644 --- a/src/bbtsub.c +++ b/src/bbtsub.c @@ -28,9 +28,7 @@ #include #ifdef XWINDOW -#ifndef DOS #include -#endif /* DOS */ #include #include #include @@ -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 *****/ diff --git a/src/bitblt.c b/src/bitblt.c index a8843c2..7a52023 100644 --- a/src/bitblt.c +++ b/src/bitblt.c @@ -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); diff --git a/src/chardev.c b/src/chardev.c index 1860855..bda4555 100644 --- a/src/chardev.c +++ b/src/chardev.c @@ -25,7 +25,6 @@ #include #include -#ifndef DOS #include #include #include @@ -34,7 +33,6 @@ #include #include #include -#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 */ } diff --git a/src/common.c b/src/common.c index 486bcce..b3a1892 100644 --- a/src/common.c +++ b/src/common.c @@ -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; diff --git a/src/dbgtool.c b/src/dbgtool.c index 1cbb691..1a38cd2 100644 --- a/src/dbgtool.c +++ b/src/dbgtool.c @@ -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 */ /***************************************************************/ /* diff --git a/src/dir.c b/src/dir.c index 83aab14..09a25cd 100644 --- a/src/dir.c +++ b/src/dir.c @@ -18,16 +18,9 @@ #include #include -#ifndef DOS #include #include #include -#else /* DOS, now */ -#include -#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)); } diff --git a/src/dsk.c b/src/dsk.c index d483429..66cc12d 100644 --- a/src/dsk.c +++ b/src/dsk.c @@ -19,21 +19,11 @@ #include #include -#ifndef DOS #include #include #include #include #include -#else /* DOS */ -#include -#include -#include -#include -#define MAXPATHLEN _MAX_PATH -#define MAXNAMLEM _MAX_PATH -#define alarm(x) 0 -#endif /* DOS */ #include "lispemul.h" #include "lispmap.h" @@ -85,30 +75,6 @@ static int get_new(char *dir, FileName *varray, char *afile, char *vfile); static int get_old_new(char *dir, FileName *varray, char *afile, char *vfile); static int get_version_array(char *dir, char *file, FileName *varray, CurrentVArray *cache); -#ifdef DOS -static void separate_drive(char *lfname, char *drive) -{ - register char *cp; - - cp = lfname; - - /* Check if there's a drive specified. */ - - if (*(cp + 1) == DRIVESEP) { - *drive = *cp; /* copy the drive letter, if there is one */ - cp++; - cp++; /* Move to the real `<`/ */ - while (*cp) /* Move the rest to the left to cover. */ - { - *(cp - 2) = *cp; - cp++; - } - *(cp - 2) = '\0'; - } else - *drive = '\0'; /* no drive */ -} -#endif /* DOS */ - /* * Name: separate_host * @@ -131,11 +97,7 @@ static void separate_drive(char *lfname, char *drive) * */ -#ifdef DOS -void separate_host(char *lfname, char *host, char *drive) -#else void separate_host(char *lfname, char *host) -#endif /* DOS */ { register char *cp; register size_t diff; @@ -146,16 +108,6 @@ void separate_host(char *lfname, char *host) *host = '\0'; cp++; /* Now, *cp == '<' or drive letter. */ -#ifdef DOS - /* Check if there's a drive specified. */ - - if (*(cp + 1) == DRIVESEP) { - *drive = *cp; /* copy the drive letter, if there is one */ - cp++; - cp++; /* Move to the real `<`/ */ - } else - *drive = '\0'; /* no drive */ -#endif /* DOS */ if (*(cp + 1) == '\0') { /* Root directory is specified. */ @@ -164,9 +116,6 @@ void separate_host(char *lfname, char *host) } else { diff = cp - lfname; if (*cp == '<' || *cp == DIRSEP -#ifdef DOS - || *cp == UNIXDIRSEP -#endif /* DOS */ ) { /* * Skip the initial directory delimiter. @@ -224,11 +173,6 @@ LispPTR COM_openfile(register LispPTR *args) char dir[MAXPATHLEN], name[MAXNAMLEN], ver[VERSIONLEN]; register int fatp, dskp, rval, fd, link_check_flg, flags, *bufp; struct stat sbuf; -#ifdef DOS - char drive[1]; /* Drive designator */ - int extlen; /* length of the raw file extension */ - char rawname[MAXNAMLEN]; -#endif /* DOS */ ERRSETJMP(NIL); Lisp_errno = (int *)(Addr68k_from_LADDR(args[5])); @@ -245,11 +189,7 @@ LispPTR COM_openfile(register LispPTR *args) LispStringToCString(args[0], lfname, MAXPATHLEN); -#ifdef DOS - separate_host(lfname, host, drive); -#else separate_host(lfname, host); -#endif /* DOS */ UPCASE(host); if (strcmp(host, "DSK") == 0) @@ -263,11 +203,7 @@ LispPTR COM_openfile(register LispPTR *args) * Convert a Lisp file name to UNIX one. If host is DSK, we also have to * convert a version field. */ -#ifdef DOS - unixpathname(lfname, file, dskp, 0, drive, &extlen, rawname); -#else unixpathname(lfname, file, dskp, 0); -#endif /* * Set up the flags argument for open system call. @@ -469,14 +405,6 @@ LispPTR COM_openfile(register LispPTR *args) * The subjective file has already existed. We don't need * to maintain a version. */ -#ifdef DOS - if (args[1] == RECOG_NEW) { - char old[MAXPATHLEN]; - make_old_version(old, file); - unlink(old); - rename(file, old); /* make old version */ - } -#endif /* DOS */ } } @@ -559,138 +487,6 @@ LispPTR COM_openfile(register LispPTR *args) LispPTR COM_closefile(register LispPTR *args) { -#ifdef DOS - - register int fd, dskp, rval; - time_t cdate; - char lfname[MAXPATHLEN + 5], host[MAXNAMLEN]; - char file[MAXPATHLEN], dir[MAXPATHLEN], name[MAXNAMLEN + 1]; - char ver[VERSIONLEN], drive[1]; - struct find_t dirp; - int dp; - struct stat sbuf; - ino_t ino; - int extlen; - char rawname[MAXNAMLEN]; - - ERRSETJMP(NIL); - Lisp_errno = (int *)(Addr68k_from_LADDR(args[3])); - - LispStringLength(args[0], rval, dskp); - - /* - * Because of the version number convention, Lisp pathname might - * be shorter than UNIX one. For THIN string, the difference - * is 2 bytes, for FAT string, 4 bytes. Add 1 byte for NULL - * terminating character. - */ - rval = dskp ? rval + 4 + 1 : rval + 2 + 1; - /* Add five for the host name field in Lisp format. */ - if (rval > MAXPATHLEN + 5) FileNameTooLong(NIL); - - LispStringToCString(args[0], lfname, MAXPATHLEN); - - separate_host(lfname, host, drive); - - UPCASE(host); - if (strcmp(host, "DSK") == 0) - dskp = 1; - else if (strcmp(host, "UNIX") == 0) - dskp = 0; - else - return (NIL); - - /* - * Convert a Lisp file name to UNIX one. If host is DSK, we also have to - * convert a version field. - */ - dskp ? unixpathname(lfname, file, 1, 0, drive, &extlen, rawname) - : unixpathname(lfname, file, 0, 0, drive, &extlen, rawname); - fd = LispNumToCInt(args[1]); - cdate = (time_t)LispNumToCInt(args[2]); - if (!dskp) { - TIMEOUT(rval = fstat(fd, &sbuf)); - if (rval == -1) { - *Lisp_errno = errno; - return (NIL); - } - } - - if (cdate == 0) { - /* Just close. */ - TIMEOUT(rval = close(fd)); - if (rval == -1) { - if (!dskp && errno == EPERM && (sbuf.st_mode & S_IFREG) == 0) { - /* - * On {UNIX} device, closing a special file we are not - * the owner of it. Although I don't think close fails - * because of EPERM, in honor of Medley 1.1 code, I put - * this segment here. - */ - return (ATOM_T); - } else { - *Lisp_errno = errno; - return (NIL); - } - } else { - return (ATOM_T); - } - } - - if (!unpack_filename(file, dir, name, ver, 1)) return (NIL); - - if (dskp) { - /* - * On {DSK}, we have to make sure dir is case sensitively existing - * directory. - */ - if (true_name(dir) != -1) return (NIL); - - /* - * There is a very troublesome problem here. The file name Lisp - * recognizes is not always the same as the name which COM_openfile - * used to open the file. Sometimes COM_openfile uses the versionless - * file name to open a file, although Lisp always recognizes with - * *versioned* file name. - * Thus, we compare i-node number of the requested file with ones of all - * of files on the directory. This is time spending implementation. - * More clean up work is needed. - */ - TIMEOUT(rval = fstat(fd, &sbuf)); - if (rval != 0) { - *Lisp_errno = errno; - return (NIL); - } - ino = sbuf.st_ino; - TIMEOUT(rval = _dos_findfirst(dir, _A_SUBDIR, &dirp)); - if (rval < 0) { - *Lisp_errno = errno; - return (NIL); - } - - for (; rval == 0; S_TOUT(rval = _dos_findnext(&dirp))) { - sprintf(file, "%s\\%s", dir, dirp.name); - } - } -#ifndef DOS /* effectively NEVER, since we're in an ifdef DOS */ - time[0].tv_sec = (long)sbuf.st_atime; - time[0].tv_usec = 0L; - time[1].tv_sec = (long)ToUnixTime(cdate); - time[1].tv_usec = 0L; -#endif /* DOS */ - TIMEOUT(rval = close(fd)); - if (rval == -1) { - *Lisp_errno = errno; - return (NIL); - } -#ifndef DOS - TIMEOUT(rval = utimes(file, time)); - if (rval != 0) { - *Lisp_errno = errno; - return (NIL); - } -#endif /* DOS, internal */ -#else /* UNIX version of CLOSEFILE */ register int fd, fatp, dskp, rval; time_t cdate; char lfname[MAXPATHLEN + 5], host[MAXNAMLEN]; @@ -823,8 +619,6 @@ LispPTR COM_closefile(register LispPTR *args) return (NIL); } -#endif /* DOS */ - return (ATOM_T); } @@ -863,10 +657,6 @@ LispPTR DSK_getfilename(register LispPTR *args) char dir[MAXPATHLEN]; char name[MAXNAMLEN]; char ver[VERSIONLEN]; -#ifdef DOS - char drive[1], rawname[MAXNAMLEN]; - int extlen; /* len of extension, for making backup filename */ -#endif /* DOS */ ERRSETJMP(NIL); Lisp_errno = (int *)(Addr68k_from_LADDR(args[3])); @@ -883,20 +673,12 @@ LispPTR DSK_getfilename(register LispPTR *args) LispStringToCString(args[0], lfname, MAXPATHLEN); -#ifdef DOS - separate_drive(lfname, drive); -#endif - /* * Convert a Lisp file name to UNIX one. This is a DSK device method. * Thus we have to convert a version field too. Third argument for * unixpathname specifies it. */ -#ifdef DOS - if (unixpathname(lfname, file, 1, 0, drive, &extlen, rawname) == 0) return (NIL); -#else if (unixpathname(lfname, file, 1, 0) == 0) return (NIL); -#endif if (unpack_filename(file, dir, name, ver, 1) == 0) return (NIL); @@ -942,9 +724,6 @@ LispPTR DSK_getfilename(register LispPTR *args) strcpy(vname, aname); dirp = 1; } else { -#ifdef DOS - strcpy(vname, aname); -#endif dirp = 0; } } @@ -982,9 +761,6 @@ LispPTR DSK_getfilename(register LispPTR *args) strcpy(vname, aname); dirp = 1; } else { -#ifdef DOS - strcpy(vname, aname); -#endif dirp = 0; } } @@ -1094,16 +870,6 @@ LispPTR DSK_getfilename(register LispPTR *args) * format. We have to convert it back to Lisp format. The version field * have to be converted. The fourth argument for lisppathname specifies it. */ -#ifdef DOS - /* For DOS, have to assure we use the name asked for, not the */ - /* faked-up oversion-0 name, so reported names match. */ - { - char dver[VERSIONLEN]; - separate_version(vname, dver, 0); - ConcDirAndName(dir, name, aname); - ConcNameAndVersion(aname, dver, vname); - } -#endif /* DOS */ if (lisppathname(vname, lfname, dirp, (dirp ? 0 : 1)) == 0) return (NIL); @@ -1144,10 +910,6 @@ LispPTR DSK_deletefile(register LispPTR *args) char dir[MAXPATHLEN], ver[VERSIONLEN]; int rval, fatp; register FileName *varray; -#ifdef DOS - char drive[1], rawname[MAXNAMLEN]; - int extlen; /* len of extension, for making backup filename */ -#endif /* DOS */ ERRSETJMP(NIL); Lisp_errno = (int *)(Addr68k_from_LADDR(args[1])); @@ -1163,12 +925,7 @@ LispPTR DSK_deletefile(register LispPTR *args) if (rval > MAXPATHLEN) FileNameTooLong(NIL); LispStringToCString(args[0], fbuf, MAXPATHLEN); -#ifdef DOS - separate_drive(fbuf, drive); - unixpathname(fbuf, file, 1, 0, drive, &extlen, rawname); -#else unixpathname(fbuf, file, 1, 0); -#endif if (unpack_filename(file, dir, fbuf, ver, 1) == 0) return (NIL); if (get_version_array(dir, fbuf, VersionArray, &VArrayInfo) == 0) return (NIL); @@ -1292,11 +1049,6 @@ LispPTR DSK_renamefile(register LispPTR *args) int rval, fatp; register int need_maintain_flg; register FileName *varray; -#ifdef DOS - char drive1[1], drive2[1]; - int extlen1, extlen2; /* len of extension */ - char rawname1[MAXNAMLEN], rawname2[MAXNAMLEN]; -#endif /* DOS */ ERRSETJMP(NIL); Lisp_errno = (int *)(Addr68k_from_LADDR(args[2])); @@ -1316,20 +1068,10 @@ LispPTR DSK_renamefile(register LispPTR *args) if (rval > MAXPATHLEN) FileNameTooLong(NIL); LispStringToCString(args[0], fbuf, MAXPATHLEN); -#ifdef DOS - separate_drive(fbuf, drive1); - unixpathname(fbuf, src, 1, 0, drive1, &extlen1, rawname1); -#else /* DOS */ unixpathname(fbuf, src, 1, 0); -#endif /* DOS */ LispStringToCString(args[1], fbuf, MAXPATHLEN); -#ifdef DOS - separate_drive(fbuf, drive2); - unixpathname(fbuf, dst, 1, 0, drive2, &extlen2, rawname2); -#else /* DOS */ unixpathname(fbuf, dst, 1, 0); -#endif /* DOS */ if (unpack_filename(dst, dir, fbuf, ver, 1) == 0) return (NIL); /* @@ -1515,10 +1257,6 @@ LispPTR DSK_directorynamep(register LispPTR *args) char fullname[MAXPATHLEN]; register int len, fatp; register char *base; -#ifdef DOS - char drive[1], rawname[MAXNAMLEN]; - int extlen; /* len of extension, for making backup filename */ -#endif /* DOS */ ERRSETJMP(NIL); Lisp_errno = (int *)(Addr68k_from_LADDR(args[2])); @@ -1537,12 +1275,7 @@ LispPTR DSK_directorynamep(register LispPTR *args) LispStringToCString(args[0], dirname, MAXPATHLEN); /* Convert Xerox Lisp file naming convention to Unix one. */ -#ifdef DOS - separate_drive(dirname, drive); - if (unixpathname(dirname, fullname, 1, 0, drive, 0, 0) == 0) return (NIL); -#else /* DOS*/ if (unixpathname(dirname, fullname, 1, 0) == 0) return (NIL); -#endif /* DOS */ if (true_name(fullname) != -1) return (NIL); @@ -1598,18 +1331,12 @@ LispPTR COM_getfileinfo(register LispPTR *args) { register int dskp, rval; register unsigned *bufp; -#ifndef DOS register struct passwd *pwd; -#endif register char *base; char lfname[MAXPATHLEN + 5], file[MAXPATHLEN], host[MAXNAMLEN]; char dir[MAXPATHLEN], name[MAXNAMLEN], ver[VERSIONLEN]; struct stat sbuf; LispPTR laddr; -#ifdef DOS - char drive[1], rawname[MAXNAMLEN]; - int extlen; /* len of extension, for making backup filename */ -#endif /* DOS */ ERRSETJMP(NIL); Lisp_errno = (int *)(Addr68k_from_LADDR(args[3])); @@ -1626,11 +1353,7 @@ LispPTR COM_getfileinfo(register LispPTR *args) if (rval > MAXPATHLEN + 5) FileNameTooLong(NIL); LispStringToCString(args[0], lfname, MAXPATHLEN); -#ifdef DOS - separate_host(lfname, host, drive); -#else separate_host(lfname, host); -#endif UPCASE(host); if (strcmp(host, "DSK") == 0) @@ -1644,11 +1367,7 @@ LispPTR COM_getfileinfo(register LispPTR *args) * Convert a Lisp file name to UNIX one. If host is DSK, we also have to * convert a version field. */ -#ifdef DOS - unixpathname(lfname, file, dskp, 0, drive, &extlen, rawname); -#else /* DOS */ unixpathname(lfname, file, dskp, 0); -#endif /* DOS */ /* * The file name which has been passed from Lisp is sometimes different @@ -1701,7 +1420,6 @@ LispPTR COM_getfileinfo(register LispPTR *args) return (ATOM_T); case AUTHOR: -#ifndef DOS TIMEOUT(pwd = getpwuid(sbuf.st_uid)); if (pwd == (struct passwd *)NULL) { /* @@ -1718,7 +1436,6 @@ LispPTR COM_getfileinfo(register LispPTR *args) #else StrNCpyFromCToLisp(base, pwd->pw_name, rval); #endif /* BYTESWAP */ -#endif /* DOS */ return (GetSmallp(rval)); case ALL: @@ -1746,7 +1463,6 @@ LispPTR COM_getfileinfo(register LispPTR *args) laddr = cdr(car(cdr(cdr(cdr(args[2]))))); bufp = (unsigned *)(Addr68k_from_LADDR(laddr)); *bufp = sbuf.st_mode; -#ifndef DOS TIMEOUT(pwd = getpwuid(sbuf.st_uid)); if (pwd == (struct passwd *)NULL) { return (GetSmallp(0)); } laddr = cdr(car(cdr(cdr(cdr(cdr(args[2])))))); @@ -1757,7 +1473,6 @@ LispPTR COM_getfileinfo(register LispPTR *args) #else StrNCpyFromCToLisp(base, pwd->pw_name, rval); #endif /* BYTESWAP */ -#endif /* DOS */ return (GetSmallp(rval)); default: return (NIL); @@ -1799,12 +1514,7 @@ LispPTR COM_setfileinfo(register LispPTR *args) char lfname[MAXPATHLEN + 5], file[MAXPATHLEN], host[MAXNAMLEN]; char dir[MAXPATHLEN], name[MAXNAMLEN], ver[VERSIONLEN]; struct stat sbuf; -#ifndef DOS struct timeval time[2]; -#else - char drive[1], rawname[MAXNAMLEN]; - int extlen; -#endif /* DOS */ ERRSETJMP(NIL); Lisp_errno = (int *)(Addr68k_from_LADDR(args[3])); @@ -1822,11 +1532,7 @@ LispPTR COM_setfileinfo(register LispPTR *args) LispStringToCString(args[0], lfname, MAXPATHLEN); -#ifdef DOS - separate_host(lfname, host, drive); -#else separate_host(lfname, host); -#endif /* DOS */ UPCASE(host); if (strcmp(host, "DSK") == 0) dskp = 1; @@ -1839,11 +1545,7 @@ LispPTR COM_setfileinfo(register LispPTR *args) * Convert a Lisp file name to UNIX one. If host is DSK, we also have to * convert a version field. */ -#ifdef DOS - unixpathname(lfname, file, dskp, 0, drive, &extlen, rawname); -#else /* DOS */ unixpathname(lfname, file, dskp, 0); -#endif /* DOS */ /* * The file name which has been passed from Lisp is sometimes different @@ -1868,14 +1570,12 @@ LispPTR COM_setfileinfo(register LispPTR *args) *Lisp_errno = errno; return (NIL); } -#ifndef DOS date = LispNumToCInt(args[2]); time[0].tv_sec = (long)sbuf.st_atime; time[0].tv_usec = 0L; time[1].tv_sec = (long)ToUnixTime(date); time[1].tv_usec = 0L; TIMEOUT(rval = utimes(file, time)); -#endif /* DOS */ if (rval != 0) { *Lisp_errno = errno; return (NIL); @@ -2103,11 +1803,7 @@ LispPTR COM_truncatefile(register LispPTR *args) return (ATOM_T); } if ((off_t)length != sbuf.st_size) { -#ifdef DOS - TIMEOUT(rval = chsize(fd, (off_t)length)); -#else TIMEOUT(rval = ftruncate(fd, (off_t)length)); -#endif /* DOS */ if (rval != 0) { *Lisp_errno = errno; return (NIL); @@ -2117,9 +1813,7 @@ LispPTR COM_truncatefile(register LispPTR *args) * TRUNCATEFILE FDEV method is invoked from FORCEOUTPUT Lisp function. * Thus we have to sync the file state here. */ -#ifndef DOS TIMEOUT(rval = fsync(fd)); -#endif if (rval != 0) { *Lisp_errno = errno; @@ -2150,10 +1844,6 @@ LispPTR COM_changedir(register LispPTR *args) { register int dskp, rval; char lfname[MAXPATHLEN + 5], dir[MAXPATHLEN], host[MAXNAMLEN]; -#ifdef DOS - char drive[1], rawname[MAXNAMLEN]; - int extlen; -#endif /* DOS */ ERRSETJMP(NIL); Lisp_errno = &Dummy_errno; @@ -2170,11 +1860,7 @@ LispPTR COM_changedir(register LispPTR *args) if (rval > MAXPATHLEN + 5) FileNameTooLong(NIL); LispStringToCString(args[0], lfname, MAXPATHLEN); -#ifdef DOS - separate_host(lfname, host, drive); -#else separate_host(lfname, host); -#endif /* DOS */ UPCASE(host); if (strcmp(host, "DSK") == 0) dskp = 1; @@ -2183,11 +1869,7 @@ LispPTR COM_changedir(register LispPTR *args) else return (NIL); -#ifdef DOS - if (!unixpathname(lfname, dir, 0, 0, drive, 0, 0)) return (NIL); -#else /* DOS */ if (!unixpathname(lfname, dir, 0, 0)) return (NIL); -#endif /* DOS */ if (dskp) { /* @@ -2199,15 +1881,6 @@ LispPTR COM_changedir(register LispPTR *args) TIMEOUT(rval = chdir(dir)); if (rval != 0) return (NIL); -#ifdef DOS - if (*drive) { - if (*drive <= 'Z') - rval = _chdrive(*drive - ('A' - 1)); - else - rval = _chdrive(*drive - ('a' - 1)); - if (rval != 0) return (NIL); - } -#endif /* DOS */ return (ATOM_T); } @@ -2250,12 +1923,7 @@ LispPTR COM_getfreeblock(register LispPTR *args) register int dskp, rval, *buf; char lfname[MAXPATHLEN + 5], dir[MAXPATHLEN], host[MAXNAMLEN]; char name[MAXNAMLEN + 1], file[MAXPATHLEN], ver[VERSIONLEN]; -#ifdef DOS - char drive[2]; - struct diskfree_t sfsbuf; -#else struct statvfs sfsbuf; -#endif ERRSETJMP(NIL); Lisp_errno = &Dummy_errno; @@ -2270,11 +1938,7 @@ LispPTR COM_getfreeblock(register LispPTR *args) LispStringToCString(args[0], lfname, MAXPATHLEN); buf = (int *)(Addr68k_from_LADDR(args[1])); -#ifdef DOS - separate_host(lfname, host, drive); -#else separate_host(lfname, host); -#endif /* DOS */ UPCASE(host); if (strcmp(host, "DSK") == 0) dskp = 1; @@ -2283,11 +1947,7 @@ LispPTR COM_getfreeblock(register LispPTR *args) else return (NIL); -#ifdef DOS - if (!unixpathname(lfname, file, 0, 0, drive, 0, 0)) return (NIL); -#else /* DOS */ if (!unixpathname(lfname, file, 0, 0)) return (NIL); -#endif /* DOS */ if (!unpack_filename(file, dir, name, ver, 0)) return (NIL); @@ -2304,30 +1964,12 @@ LispPTR COM_getfreeblock(register LispPTR *args) * we check the available block size, using the directory on which the file * will be exist. */ -#ifdef DOS - /* For DOS, we have to use either the disk drive the file - will be on, or the default drive. */ - - if (drive[0]) { - drive[1] = 0; - UPCASE(drive); - if (_dos_getdiskfree((unsigned)drive[0] - (int)'@', &sfsbuf)) - return (NIL); /* call failed, so name is invalid */ - - *buf = sfsbuf.avail_clusters * sfsbuf.sectors_per_cluster * sfsbuf.bytes_per_sector; - } else { - if (_dos_getdiskfree(0, &sfsbuf)) return (NIL); /* call failed, so name is invalid */ - - *buf = sfsbuf.avail_clusters * sfsbuf.sectors_per_cluster * sfsbuf.bytes_per_sector; - } -#else TIMEOUT(rval = statvfs(dir, &sfsbuf)); if (rval != 0) { *Lisp_errno = errno; return (NIL); } *buf = sfsbuf.f_bavail; -#endif /* DOS */ return (ATOM_T); } @@ -2451,17 +2093,7 @@ int unpack_filename(char *file, char *dir, char *name, char *ver, int checkp) { register char *cp; -#ifdef DOS - if ((cp = (char *)max((UNSIGNED)strrchr(file, DIRSEP), (UNSIGNED)strrchr(file, UNIXDIRSEP))) == 0) - return (0); - - if (file[1] == DRIVESEP) { /* There's a drive spec; copy it and ignore it from here on. */ - *dir++ = *file++; - *dir++ = *file++; - } -#else /* DOS */ if ((cp = (char *)strrchr(file, UNIXDIRSEP)) == NULL) return (0); -#endif /* DOS */ if (cp == file) { /* File is on a root directory. */ @@ -2502,23 +2134,11 @@ int true_name(register char *path) { char dir[MAXPATHLEN]; char name[MAXNAMLEN]; -#ifdef DOS - char drive[1]; -#endif register char *sp, *cp; register int type, c; if (strcmp(path, "/") == 0) return (-1); -#ifdef DOS - if (*(path + 1) == DRIVESEP) { - drive[0] = *path; - dir[0] = drive[0]; /* but copy it to the working dir string */ - dir[1] = DRIVESEP; - dir[2] = '\0'; - cp = path + 3; /* skip the drive spec & 1st dir delimiter */ - } else { -#endif /* DOS */ *dir = '\0'; /* * locate_file does not accept the directory with * the trail delimiter. Thus, for the root @@ -2526,9 +2146,6 @@ int true_name(register char *path) * as directory. */ cp = path + 1; -#ifdef DOS - } -#endif /* DOS */ /* If all there was was the root /, succeed easily */ if (strcmp((cp - 1), DIRSEPSTR) == 0) return (-1); @@ -2589,24 +2206,6 @@ int true_name(register char *path) static int locate_file(char *dir, char *name) { -#ifdef DOS - char path[MAXPATHLEN]; - char nb1[MAXNAMLEN], nb2[MAXNAMLEN]; - register int type, len; - struct find_t dirp; - struct direct *dp; - - /* First of all, recognize as if. */ - sprintf(path, "%s\\%s", dir, name); - DIR_OR_FILE_P(path, type); - if (type != 0) { - strcpy(dir, path); - return (type); - } - - return (0); - -#else /* UNIX code follows */ char path[MAXPATHLEN]; char nb1[MAXNAMLEN], nb2[MAXNAMLEN]; @@ -2669,7 +2268,6 @@ static int locate_file(char *dir, char *name) } TIMEOUT(closedir(dirp)); return (0); -#endif /* DOS */ } /* @@ -2700,21 +2298,11 @@ static int make_directory(register char *dir) dp = dir_buf; cp = dir; -#ifdef DOS - if (DRIVESEP == *(cp + 1)) { - *dp++ - *cp++; /* copy the drive letter and colon */ - *dp++ = *cp++; - } -#endif /* DOS */ - *dp++ = DIRSEP; /* For a root directory. */ cp++; /* Skip a root directory in dir. */ for (;;) { switch (*cp) { -#ifdef DOS - case DIRSEP: -#endif case '/': case '\0': *dp = '\0'; @@ -2727,11 +2315,7 @@ static int make_directory(register char *dir) * existing or not. */ if (maked) { -#ifdef DOS - TIMEOUT(rval = mkdir(dir_buf)); -#else TIMEOUT(rval = mkdir(dir_buf, 0777)); -#endif /* DOS */ if (rval == -1) { *Lisp_errno = errno; return (0); @@ -2768,11 +2352,7 @@ static int make_directory(register char *dir) /* * Should handle other cases. (special file). */ -#ifdef DOS - TIMEOUT(rval = mkdir(dir_buf)); -#else TIMEOUT(rval = mkdir(dir_buf, 0777)); -#endif /* DOS */ if (rval == -1) { *Lisp_errno = errno; return (0); @@ -2815,18 +2395,6 @@ static int make_directory(register char *dir) * !OnlyVersionlessP(varray)). * */ -#ifdef DOS -#define FindHighestVersion(varray, mentry, max_no) \ - { \ - register FileName *centry; \ - for (centry = varray, max_no = -1; centry->version_no != LASTVERSIONARRAY; centry++) { \ - if (centry->version_no > max_no) { \ - max_no = centry->version_no; \ - mentry = centry; \ - } \ - } \ - } -#else #define FindHighestVersion(varray, mentry, max_no) \ { \ register FileName *centry; \ @@ -2837,7 +2405,6 @@ static int make_directory(register char *dir) } \ } \ } -#endif /* DOS */ /* * Name: FindLowestVersion @@ -2863,18 +2430,6 @@ static int make_directory(register char *dir) * !OnlyVersionlessP(varray)). * */ -#ifdef DOS -#define FindLowestVersion(varray, mentry, min_no) \ - { \ - register FileName *centry; \ - for (centry = varray, min_no = MAXVERSION; centry->version_no != LASTVERSIONARRAY; centry++) { \ - if (centry->version_no < min_no) { \ - min_no = centry->version_no; \ - mentry = centry; \ - } \ - } \ - } -#else #define FindLowestVersion(varray, mentry, min_no) \ { \ register FileName *centry; \ @@ -2885,7 +2440,6 @@ static int make_directory(register char *dir) } \ } \ } -#endif /* DOS */ /* * Name: FindSpecifiedVersion @@ -2946,112 +2500,6 @@ static int make_directory(register char *dir) static int get_version_array(char *dir, char *file, FileName *varray, CurrentVArray *cache) { -#ifdef DOS - - char lcased_file[MAXPATHLEN]; - char old_file[MAXPATHLEN]; - char name[MAXNAMLEN]; - char ver[VERSIONLEN]; - register FileName *svarray; - struct find_t dirp; - register struct direct *dp; - register int rval, drive = 0, isslash = 0; - struct stat sbuf; - int res; - - /* - * First of all, prepare a lower cased file name for the case insensitive - * search. Also we have to separate file name from its version field. - */ - 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(lcased_file, dir); /* Only add the dir if it's real */ - else if (drive) { - lcased_file[0] = drive; - lcased_file[1] = DRIVESEP; - lcased_file[2] = '\0'; - } else - *lcased_file = '\0'; - - /* strcpy(lcased_file, dir); removed when above code added 3/4/93 */ - strcat(lcased_file, DIRSEPSTR); - strcat(lcased_file, file); - separate_version(lcased_file, ver, 1); - DOWNCASE(lcased_file); - - /*************************************************/ - /* First, look up the backup version of the file */ - /*************************************************/ - - /* First, make the "backup-file-name" for this file */ - - make_old_version(old_file, lcased_file); - - svarray = varray; - - TIMEOUT(res = _dos_findfirst(old_file, _A_NORMAL | _A_SUBDIR, &dirp)); - if (res == 0) { - strcpy(name, dirp.name); - strcpy(svarray->name, name); - svarray->version_no = 0; - svarray++; - } - - /*******************************/ - /* Now look up the file itself */ - /*******************************/ - - TIMEOUT(res = _dos_findfirst(lcased_file, _A_NORMAL | _A_SUBDIR, &dirp)); - /* if (res != 0) - { - *Lisp_errno = errno; - return(0); - } - */ - for (; res == 0; S_TOUT(res = _dos_findnext(&dirp))) { - strcpy(name, dirp.name); - separate_version(name, ver, 1); - DOWNCASE(name); - - strcpy(svarray->name, dirp.name); - if (*ver == '\0') { - /* Versionless file */ - svarray->version_no = 1; - } else { - /* - * separator_version guarantees ver is a numeric - * string. - */ - svarray->version_no = atoi(ver); - } - svarray++; - } - - /* - * The last entry of varray is indicated by setting LASTVERSIONARRAY into - * version_no field. - */ - svarray->version_no = LASTVERSIONARRAY; - - /* - * If more than one files have been stored in varray, we store the name - * without version in the last marker entry. - */ - if (!NoFileP(varray)) { - strcpy(name, varray->name); - separate_version(name, ver, 1); - strcpy(svarray->name, name); - } - - return (1); - -#else /* UNIX version-array builder */ char lcased_file[MAXNAMLEN]; char name[MAXNAMLEN]; @@ -3153,7 +2601,6 @@ static int get_version_array(char *dir, char *file, FileName *varray, CurrentVAr */ TIMEOUT(closedir(dirp)); return (1); -#endif /* DOS */ } /* @@ -3214,7 +2661,6 @@ static int maintain_version(char *file, FileName *varray, int forcep) * If forcep, we link the versionless file to the version * 1 file. */ -#ifndef DOS get_versionless(varray, vless, dir); ConcNameAndVersion(vless, "1", fname); TIMEOUT(rval = link(vless, fname)); @@ -3222,7 +2668,6 @@ static int maintain_version(char *file, FileName *varray, int forcep) *Lisp_errno = errno; return (0); } -#endif /* DOS */ } return (1); } @@ -3244,7 +2689,6 @@ static int maintain_version(char *file, FileName *varray, int forcep) * The versionless file should have the same case name as the old * file. */ -#ifndef DOS strcpy(fname, entry->name); separate_version(fname, ver, 1); ConcDirAndName(dir, fname, vless); @@ -3253,7 +2697,6 @@ static int maintain_version(char *file, FileName *varray, int forcep) *Lisp_errno = errno; return (0); } -#endif /* DOS */ return (1); } @@ -3271,14 +2714,12 @@ static int maintain_version(char *file, FileName *varray, int forcep) * The old file should have the same case name as the versionless * file. */ -#ifndef DOS ConcNameAndVersion(vless, ver, old_file); TIMEOUT(rval = link(vless, old_file)); if (rval == -1) { *Lisp_errno = errno; return (0); } -#endif /* DOS */ return (1); } @@ -3306,7 +2747,6 @@ static int maintain_version(char *file, FileName *varray, int forcep) * The versionless file should have the same case name as the old * file. */ -#ifndef DOS strcpy(fname, entry->name); separate_version(fname, ver, 1); ConcDirAndName(dir, fname, vless); @@ -3315,7 +2755,6 @@ static int maintain_version(char *file, FileName *varray, int forcep) *Lisp_errno = errno; return (0); } -#endif /* DOS */ return (1); } } @@ -3345,9 +2784,6 @@ static int maintain_version(char *file, FileName *varray, int forcep) static int get_versionless(FileName *varray, char *file, char *dir) { -#ifdef DOS - return (0); -#endif /* DOS */ if (NoFileP(varray)) return (0); while (varray->version_no != LASTVERSIONARRAY) { @@ -3904,14 +3340,12 @@ static int get_new(char *dir, FileName *varray, char *afile, char *vfile) strcpy(name, afile); separate_version(name, ver, 1); -#ifndef DOS if (NoFileP(varray)) { /* * If there is no file with such name, "new" file is always * recognized. */ if (*ver == '\0' || strcmp(ver, "1") == 0) -#endif /* DOS */ { /* * If version is not specified or 1 is specified, @@ -3922,7 +3356,6 @@ static int get_new(char *dir, FileName *varray, char *afile, char *vfile) ConcDirAndName(dir, name, afile); return (1); } -#ifndef DOS else { /* * A version other than 1 is specified. "New" file @@ -4143,7 +3576,6 @@ static int get_new(char *dir, FileName *varray, char *afile, char *vfile) } } } -#endif /* DOS */ } /* diff --git a/src/dspif.c b/src/dspif.c index 81605d8..6294b0f 100644 --- a/src/dspif.c +++ b/src/dspif.c @@ -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); } diff --git a/src/ether.c b/src/ether.c index c54573d..849592e 100644 --- a/src/ether.c +++ b/src/ether.c @@ -21,7 +21,6 @@ #include #include #include -#ifndef DOS #include #include #include @@ -60,7 +59,6 @@ #endif #include #endif /* DOS */ -#endif /* MAIKO_ENABLE_ETHERNET */ #include "commondefs.h" #include "lispemul.h" diff --git a/src/inet.c b/src/inet.c index e400b87..e1d1d83 100644 --- a/src/inet.c +++ b/src/inet.c @@ -14,7 +14,6 @@ #include #include /* for mem... fns */ -#ifndef DOS #include #include #include @@ -26,7 +25,6 @@ #include #include #include -#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 */ } diff --git a/src/initdsp.c b/src/initdsp.c index 742d11a..f852886 100644 --- a/src/initdsp.c +++ b/src/initdsp.c @@ -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 */ } diff --git a/src/initkbd.c b/src/initkbd.c index b138f78..98f3999 100644 --- a/src/initkbd.c +++ b/src/initkbd.c @@ -17,19 +17,8 @@ #include #include -#ifndef DOS #include #include -#endif /* DOS */ - -#ifdef DOS -#include /* "#pragma interrupt" & '_chain_intr'*/ -#include /* defines REGS & other structs */ -#include /* define NULL */ -#include -#include -#include -#endif /* DOS */ #ifdef SUNDISPLAY #include @@ -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); diff --git a/src/initsout.c b/src/initsout.c index 31d6d80..79a3af2 100644 --- a/src/initsout.c +++ b/src/initsout.c @@ -22,9 +22,7 @@ #include #include -#ifndef DOS #include -#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. */ diff --git a/src/kbdif.c b/src/kbdif.c index b9458bb..ba6a0e6 100644 --- a/src/kbdif.c +++ b/src/kbdif.c @@ -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 */ } diff --git a/src/kbdsubrs.c b/src/kbdsubrs.c index 8f724c0..aabe035 100644 --- a/src/kbdsubrs.c +++ b/src/kbdsubrs.c @@ -12,15 +12,10 @@ #include #include -#ifdef DOS -#include -#include -#else #include #include #include #include -#endif /* DOS */ #ifdef SUNDISPLAY #include @@ -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 */ } diff --git a/src/keyevent.c b/src/keyevent.c index 0d0a285..fe59c0a 100644 --- a/src/keyevent.c +++ b/src/keyevent.c @@ -20,25 +20,11 @@ #include #include #include -#ifndef DOS #include #include #include #include -#else -#include -#endif /* DOS */ -#ifdef DOS - -#include /* Defines "#pragma interrupt" */ -#include /* Defines REGS & other structs */ -#include /* _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 #include #include @@ -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 */ diff --git a/src/ldsout.c b/src/ldsout.c index 27e3bb9..d0c5c75 100644 --- a/src/ldsout.c +++ b/src/ldsout.c @@ -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"); diff --git a/src/lpsolve.c b/src/lpsolve.c index 21ff1d1..71e3b4c 100644 --- a/src/lpsolve.c +++ b/src/lpsolve.c @@ -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++; diff --git a/src/main.c b/src/main.c index ec59528..51cb661 100644 --- a/src/main.c +++ b/src/main.c @@ -25,15 +25,9 @@ #include #include -#ifndef DOS #include #include #include -#else /* DOS */ -#include -#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] [] ...\n\ -Where are:\n\ - sysout-name The filename of your sysout.(see manual.)\n\ - -m 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); } } diff --git a/src/misc7.c b/src/misc7.c index d596ce9..72a5690 100644 --- a/src/misc7.c +++ b/src/misc7.c @@ -12,9 +12,7 @@ /* misc7.c */ #include -#ifndef DOS #include -#endif /* DOS */ #include "lispemul.h" #include "lspglob.h" #include "adr68k.h" diff --git a/src/mkvdate.c b/src/mkvdate.c index 5790ff8..4a63a97 100644 --- a/src/mkvdate.c +++ b/src/mkvdate.c @@ -33,18 +33,8 @@ #include #include -#ifndef DOS #include -#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 */ diff --git a/src/mouseif.c b/src/mouseif.c index 099871f..fdb5a9e 100644 --- a/src/mouseif.c +++ b/src/mouseif.c @@ -20,102 +20,8 @@ MouseInterfaceRec curmouse; MouseInterface currentmouse = &curmouse; -#ifdef DOS -#include - -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, ®s, ®s); - - 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 */ } diff --git a/src/rpc.c b/src/rpc.c index d91875a..b9fcbe1 100644 --- a/src/rpc.c +++ b/src/rpc.c @@ -18,7 +18,6 @@ /* */ /************************************************************************/ -#ifndef DOS #include #include #include @@ -30,7 +29,6 @@ #include #include #include /* 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 */ } diff --git a/src/subr.c b/src/subr.c index ad73f27..766b809 100644 --- a/src/subr.c +++ b/src/subr.c @@ -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; /* diff --git a/src/timer.c b/src/timer.c index 2e0ab8c..1b3c396 100644 --- a/src/timer.c +++ b/src/timer.c @@ -28,22 +28,8 @@ #include #include -#ifdef DOS -#include -#include /* "#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 #include -#endif /* DOS */ #ifdef USE_DLPI #include @@ -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 */ diff --git a/src/ufs.c b/src/ufs.c index 8ed0d3b..7d5a2d9 100644 --- a/src/ufs.c +++ b/src/ufs.c @@ -19,21 +19,10 @@ #include #include -#ifndef DOS #include #include #include #include -#else /* DOS */ -#include -#include /* "#pragma interrupt" & '_chain_intr'*/ -#include -#include /* _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 '\'': diff --git a/src/unixcomm.c b/src/unixcomm.c index 437c66c..452cf1e 100644 --- a/src/unixcomm.c +++ b/src/unixcomm.c @@ -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 */ diff --git a/src/uraid.c b/src/uraid.c index ce70e5d..e1d4b58 100644 --- a/src/uraid.c +++ b/src/uraid.c @@ -27,13 +27,11 @@ #include #include -#ifndef DOS #include #include #include #include #include -#endif /* DOS */ #ifdef SUNDISPLAY #include @@ -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|)\n\ -\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\ -<>\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: <>\n 2: <>\n 3: <>\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(); diff --git a/src/uutils.c b/src/uutils.c index 81196d2..80b0ecc 100644 --- a/src/uutils.c +++ b/src/uutils.c @@ -25,9 +25,7 @@ #include #include -#ifndef DOS #include -#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; } diff --git a/src/vmemsave.c b/src/vmemsave.c index f6f2da6..c26b37e 100644 --- a/src/vmemsave.c +++ b/src/vmemsave.c @@ -22,19 +22,11 @@ #include #include #include -#ifndef DOS #include #include #include #include #include -#else -#include -#include -#define MAXPATHLEN _MAX_PATH -#define MAXNAMLEN _MAX_PATH -#define alarm(x) 1 -#endif /* DOS */ #if defined(SUNDISPLAY) && defined(OLD_CURSOR) #include @@ -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); } diff --git a/src/xc.c b/src/xc.c index e1a5af4..fcbca31 100644 --- a/src/xc.c +++ b/src/xc.c @@ -24,13 +24,7 @@ #include #include -#ifdef DOS -#include /* Defines "#pragma interrupt" */ -#include /* _XSTACK struct definition */ -#include /* Defines REGS & other structs */ -#else /* DOS */ #include -#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, ®s, ®s); - 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);