home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Professional
/
OS2PRO194.ISO
/
os2
/
editor
/
beav
/
patches.1
< prev
next >
Wrap
Text File
|
1994-01-30
|
37KB
|
1,358 lines
Only in new: makefile.os2
Only in new: makefile.mx3
Only in new: patches
Only in new: termcap.c
Only in new: termcap.h
Only in new: termcap.dat
Only in new: beav.def
Only in new: beav.ini
Only in new: beav.tex
diff -c2 -bBw orig/def.h new/def.h
*** orig/def.h Tue Aug 11 09:38:18 1992
--- new/def.h Sat Oct 03 20:53:14 1992
***************
*** 13,22 ****
#include "stdio.h"
- #ifndef NOPROTO
#ifdef UNIX
#include "sys/types.h"
#endif /* UNIX */
- #include "prototyp.h"
- #endif /* NOPROTO */
#define BACKUP 1 /* Make backup file. */
--- 13,19 ----
***************
*** 116,120 ****
#endif
! #define NCOL 80 /* Columns. */
#define NROW 24 /* default rows */
--- 113,117 ----
#endif
! #define NCOL 132 /* Columns. */
#define NROW 24 /* default rows */
***************
*** 130,134 ****
*/
#define NSHASH 31 /* Symbol table hash size. */
! #define NFILEN 80 /* Length, file name. */
#define NBUFN 13 /* Length, buffer name. */
#define NFILE 12 /* Length, file name. */ /* krw */
--- 127,131 ----
*/
#define NSHASH 31 /* Symbol table hash size. */
! #define NFILEN 256 /* Length, file name. */
#define NBUFN 13 /* Length, buffer name. */
#define NFILE 12 /* Length, file name. */ /* krw */
***************
*** 223,227 ****
* mapped into the C1 control area.
*/
! #define NKEYS 2048 /* 11 bit code. */
#define METACH 0x1B /* M- prefix, Control-[, ESC */
--- 220,224 ----
* mapped into the C1 control area.
*/
! #define NKEYS 4096 /* 12 bit code. */
#define METACH 0x1B /* M- prefix, Control-[, ESC */
***************
*** 562,563 ****
--- 559,564 ----
extern char *strcpy ();
extern char *strcat ();
+
+ #ifndef NOPROTO
+ #include "prototyp.h"
+ #endif /* NOPROTO */
diff -c2 -bBw orig/display.c new/display.c
*** orig/display.c Tue Aug 11 09:38:12 1992
--- new/display.c Sat Oct 03 15:07:11 1992
***************
*** 18,23 ****
D16 get_int ();
void writ_echo ();
- void uline ();
- void ucopy ();
void modeline ();
void bin_to_text ();
--- 18,21 ----
***************
*** 25,30 ****
uint get_currow ();
uint get_curcol ();
#if MSDOS
! void mem_line ();
#endif
--- 23,36 ----
uint get_currow ();
uint get_curcol ();
+ #ifndef NOPROTO
+ struct vid;
+ void ucopy (struct vid *vvp, struct vid *pvp);
+ void uline (int row, struct vid *vvp, struct vid *pvp);
+ #else
+ void uline ();
+ void ucopy ();
+ #endif
#if MSDOS
! void mem_line (int row, struct vid *vvp);
#endif
diff -c2 -bBw orig/echo.c new/echo.c
*** orig/echo.c Tue Aug 11 09:38:12 1992
--- new/echo.c Sat Oct 03 18:19:04 1992
***************
*** 197,200 ****
--- 197,201 ----
break;
case (KCTRL | 'M'): /* Return, done. */
+ case (KCTRL | 'J'): /* Linefeed, done. */
buf[cpos] = '\0';
if (kbdmip != NULL)
diff -c2 -bBw orig/file.c new/file.c
*** orig/file.c Tue Aug 11 09:38:12 1992
--- new/file.c Sat Oct 03 18:26:17 1992
***************
*** 13,16 ****
--- 13,17 ----
bool parse_f_name ();
A32 ffseek ();
+ A32 file_len();
extern char MSG_rd_file[];
diff -c2 -bBw orig/fileio.c new/fileio.c
*** orig/fileio.c Tue Aug 11 09:38:12 1992
--- new/fileio.c Sat Oct 03 21:05:08 1992
***************
*** 16,19 ****
--- 16,20 ----
extern char MSG_cnt_wr[];
+ extern char MSG_cnt_rd[];
extern char MSG_wr_io_er[];
extern char MSG_rd_er[];
***************
*** 44,63 ****
#ifdef MSDOS
if ((ffp = fopen (fn, "rb")) == NULL) /* pvr */
- return (FIOERR);
- ;
- return (FIOSUC);
#endif
#ifdef UNIX
if ((ffp = open (fn, O_RDONLY)) == -1) /* pvr */
! return (FIOERR);
! ;
! return (FIOSUC);
#endif
#ifdef AMIGA
if ((ffp = open (fn, O_RDONLY)) == -1) /* pvr */
return (FIOERR);
- ;
return (FIOSUC);
- #endif
}
--- 45,61 ----
#ifdef MSDOS
if ((ffp = fopen (fn, "rb")) == NULL) /* pvr */
#endif
+ #ifdef OS2
+ if ((ffp = open (fn, O_RDONLY | O_BINARY)) == -1) /* pvr */
+ #else
#ifdef UNIX
if ((ffp = open (fn, O_RDONLY)) == -1) /* pvr */
! #endif
#endif
#ifdef AMIGA
if ((ffp = open (fn, O_RDONLY)) == -1) /* pvr */
+ #endif
return (FIOERR);
return (FIOSUC);
}
***************
*** 78,82 ****
#else /* AMIGA */
A32
! file_len ()
{
#ifdef MSDOS
--- 76,80 ----
#else /* AMIGA */
A32
! file_len (void)
{
#ifdef MSDOS
***************
*** 100,122 ****
* FALSE on error (cannot create).
*/
! char
ffwopen (fn, mode)
char *fn;
! ushort mode;
{
#ifdef MSDOS
if ((ffp = fopen (fn, "wb")) == NULL) /* pvr */
- {
- err_echo (MSG_cnt_wr);
- return (FIOERR);
- }
- return (FIOSUC);
#endif
#ifdef UNIX
/* set perms as in original file 1.31 */
! if ((ffp = open (fn, O_WRONLY | O_CREAT, mode)) == -1) /* pvr */
! return (FIOERR);
! ;
! return (FIOSUC);
#endif
#ifdef AMIGA
--- 98,118 ----
* FALSE on error (cannot create).
*/
! bool
ffwopen (fn, mode)
char *fn;
! int mode;
{
#ifdef MSDOS
if ((ffp = fopen (fn, "wb")) == NULL) /* pvr */
#endif
+ #ifdef OS2
+ mode &= (S_IREAD | S_IWRITE);
+ mode |= S_IREAD;
+ if ((ffp = open (fn, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, mode)) == -1)
+ #else
#ifdef UNIX
/* set perms as in original file 1.31 */
! if ((ffp = open (fn, O_WRONLY | O_CREAT, mode)) == -1)
! #endif
#endif
#ifdef AMIGA
***************
*** 123,130 ****
/* set perms as in original file 1.31 */
if ((ffp = open (fn, O_WRONLY | O_CREAT, mode)) == -1) /* pvr */
return (FIOERR);
! ;
return (FIOSUC);
- #endif
}
--- 119,128 ----
/* set perms as in original file 1.31 */
if ((ffp = open (fn, O_WRONLY | O_CREAT, mode)) == -1) /* pvr */
+ #endif
+ {
+ err_echo (MSG_cnt_wr);
return (FIOERR);
! }
return (FIOSUC);
}
***************
*** 259,263 ****
backup = backname;
while ((*source > 0)
! #ifdef MSDOS
&& (*source != '.'))
#else
--- 257,261 ----
backup = backname;
while ((*source > 0)
! #if defined(MSDOS) || defined(OS2)
&& (*source != '.'))
#else
***************
*** 270,274 ****
--- 268,279 ----
*backup = 0;
}
+ #ifdef OS2
+ strcpy(backup, source);
+ strcat(backup, "~");
+ if (!isvalid(backname))
+ strcpy(backup, ".bak");
+ #else
strcat (backname, MSG_bak);
+ #endif
sprintf (buf, MSG_backup, fname, backname);
writ_echo (buf);
***************
*** 312,313 ****
--- 317,348 ----
}
}
+
+
+ #ifdef OS2
+
+ #define INCL_NOPM
+ #define INCL_ERRORS
+ #include <os2.h>
+
+ int isvalid(char *name)
+ {
+ HFILE hf;
+ #ifdef __32BIT__
+ ULONG uAction;
+ #else
+ USHORT uAction;
+ #endif
+
+ switch( DosOpen(name, &hf, &uAction, 0, 0, FILE_OPEN,
+ OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE, 0) )
+ {
+ case ERROR_INVALID_NAME:
+ case ERROR_FILENAME_EXCED_RANGE:
+ return FALSE;
+ case NO_ERROR:
+ DosClose(hf);
+ default:
+ return TRUE;
+ }
+ }
+ #endif
diff -c2 -bBw orig/kbd.c new/kbd.c
*** orig/kbd.c Tue Aug 11 09:38:12 1992
--- new/kbd.c Sat Oct 03 14:13:14 1992
***************
*** 114,118 ****
}
#endif
! if (k & 0x80)
{
if ((np = keystrings (k)) != NULL)
--- 114,118 ----
}
#endif
! if (k & 0x800)
{
if ((np = keystrings (k)) != NULL)
diff -c2 -bBw orig/line.c new/line.c
*** orig/line.c Tue Aug 11 09:38:13 1992
--- new/line.c Sat Oct 03 18:07:04 1992
***************
*** 50,54 ****
register LINE *lp;
char buf[NCOL], buf1[NCOL];
! #if RUNCHK
if (read_pat_mode)
printf (ERR_no_alloc);
--- 50,54 ----
register LINE *lp;
char buf[NCOL], buf1[NCOL];
! #if NOT_RUNCHK
if (read_pat_mode)
printf (ERR_no_alloc);
***************
*** 89,93 ****
register WINDOW *wp;
! #if RUNCHK
if (read_pat_mode)
printf (ERR_db_dalloc);
--- 89,93 ----
register WINDOW *wp;
! #if NOT_RUNCHK
if (read_pat_mode)
printf (ERR_db_dalloc);
diff -c2 -bBw orig/main.c new/main.c
*** orig/main.c Tue Aug 11 09:38:13 1992
--- new/main.c Sat Oct 03 20:45:14 1992
***************
*** 49,52 ****
--- 49,55 ----
extern char MSG_main[];
extern char MSG_prog_name[];
+ extern char MSG_init_file[];
+ extern char MSG_init_var[];
+ extern char MSG_init_path[];
extern char MSG_no_mod[];
extern char MSG_no_s_chg[];
***************
*** 107,110 ****
--- 110,114 ----
register int mflag;
char bname[NBUFN];
+ char initfile[NFILEN];
#if MSDOS
***************
*** 118,122 ****
--- 122,146 ----
vtinit (); /* Virtual terminal. */
keymapinit (); /* Symbols, bindings. */
+
+ #ifdef OS2
+ #ifdef __EMX__
+ _response(&argc, &argv);
+ _wildcard(&argc, &argv);
+ #endif
+
+ _searchenv(MSG_init_file, MSG_init_var, initfile);
+ if ( initfile[0] )
+ check_extend (initfile);
+ else
+ {
+ _searchenv(MSG_init_file, MSG_init_path, initfile);
+ if ( initfile[0] )
+ check_extend (initfile);
+ else
+ check_extend (getenv (MSG_prog_name));
+ }
+ #else
check_extend (NULL); /* check for extended keys */
+ #endif
if (argc == 1)
***************
*** 123,128 ****
{
edinit (bname);
- update ();
eerase ();
}
--- 147,152 ----
{
edinit (bname);
eerase ();
+ update ();
}
***************
*** 137,140 ****
--- 161,165 ----
makename (bname, argv[n]);
edinit (bname); /* Buffers, windows. */
+ eerase ();
update ();
readin (argv[n--], 0L, MAXPOS);
***************
*** 148,151 ****
--- 173,177 ----
{
edinit (bname);
+ eerase ();
update ();
}
diff -c2 -bBw orig/search.c new/search.c
*** orig/search.c Tue Aug 11 09:38:13 1992
--- new/search.c Sat Oct 03 20:53:09 1992
***************
*** 540,545 ****
BUFFER srch_buf, *save_buf;
LINE head_line;
! char disp_buf[120], mask_buf[120], buf1[NCOL], siz_prompt2, r_type, first_time,
! u_off, stat;
--- 540,546 ----
BUFFER srch_buf, *save_buf;
LINE head_line;
! int r_type, siz_prompt2, u_off;
! bool first_time, stat;
! char disp_buf[180], mask_buf[180], buf1[NCOL];
***************
*** 646,650 ****
cod = getkey ();
! if (cod == 0x014D) /* check for return */
{
if ((rplc_mode == TRUE) && (cur_prompt == MSG_sch_str))
--- 647,651 ----
cod = getkey ();
! if (cod == 0x014D || cod == 0x014A) /* check for return or linefeed */
{
if ((rplc_mode == TRUE) && (cur_prompt == MSG_sch_str))
diff -c2 -bBw orig/spawn.c new/spawn.c
*** orig/spawn.c Tue Aug 11 09:38:13 1992
--- new/spawn.c Sat Oct 03 14:22:04 1992
***************
*** 4,7 ****
--- 4,11 ----
#include "def.h"
+ #ifdef OS2
+ #define MSDOS 1
+ #endif
+
extern char MSG_shell[];
extern char MSG_def_shell[];
***************
*** 12,16 ****
/* #include <dos.h> */
! #if MSDOS
#include "process.h"
#endif
--- 16,20 ----
/* #include <dos.h> */
! #ifdef MSDOS
#include "process.h"
#endif
***************
*** 28,32 ****
int f, n, k;
{
! #if MSDOS
char *getenv ();
--- 32,36 ----
int f, n, k;
{
! #ifdef MSDOS
char *getenv ();
***************
*** 38,41 ****
--- 42,46 ----
ttflush ();
ttcooked ();
+ #ifndef OS2
#ifndef IBM
strcpy (prompt_line, MSG_pmpt);
***************
*** 53,62 ****
--- 58,72 ----
#endif
+ #endif
if (!cspec && !(cspec = getenv (MSG_shell))) /* jam */
cspec = MSG_def_shell;
spawnl (P_WAIT, cspec, MSG_null, NULL);
+ #ifndef OS2
+ #ifndef IBM
putenv (MSG_pme);
if (putenv (old_prompt) == -1)
exit (1);
+ #endif
+ #endif
ttraw ();
sgarbf = TRUE;
diff -c2 -bBw orig/tcap.c new/tcap.c
*** orig/tcap.c Tue Aug 11 09:38:13 1992
--- new/tcap.c Sat Oct 03 14:35:17 1992
***************
*** 7,10 ****
--- 7,18 ----
#ifdef UNIX
+ #ifdef OS2
+ #ifndef __EMX__
+ #define INCL_NOPM
+ #define INCL_VIO
+ #include <os2.h>
+ #endif
+ #endif
+
#define MARGIN 8
#define SCRSIZ 64
***************
*** 27,31 ****
#define TCAPSLEN 315
char tcapbuf[TCAPSLEN];
- char *UP, PC, *CM, *CE, *CL, *SO, *SE;
char *UP, PC, *CM, *CE, *CL, *SO, *SE, *TI, *TE; /* DR */
--- 35,38 ----
***************
*** 60,63 ****
--- 67,73 ----
if ((tv_stype = getenv ("TERM")) == NULL)
+ #ifdef OS2
+ tv_stype = "ansi";
+ #else
{
puts ("Environment variable TERM not defined!\r");
***************
*** 65,68 ****
--- 75,79 ----
exit (1);
}
+ #endif
if ((tgetent (tcbuf, tv_stype)) != 1)
***************
*** 92,95 ****
--- 103,108 ----
#endif /* ULTRIX */
#endif /* BSD */
+
+ #ifndef OS2
if ((nrow = (short) tgetnum ("li") - 1) == -1)
{
***************
*** 109,112 ****
--- 122,141 ----
if (ncol > NCOL)
ncol = NCOL;
+ #else
+ {
+ #ifdef __EMX__
+ int dst[2];
+ _scrsize(dst);
+ nrow = dst[1];
+ ncol = dst[0];
+ #else
+ VIOMODEINFO viomi;
+ viomi.cb = sizeof(viomi);
+ VioGetMode(&viomi, 0);
+ nrow = viomi.row;
+ ncol = viomi.col;
+ #endif
+ }
+ #endif
p = tcapbuf;
***************
*** 182,185 ****
--- 211,215 ----
putnpad (str, n)
char *str;
+ int n;
{
tputs (str, n, ttputc);
diff -c2 -bBw orig/termio.c new/termio.c
*** orig/termio.c Tue Aug 11 09:38:14 1992
--- new/termio.c Sat Oct 03 20:24:04 1992
***************
*** 14,18 ****
--- 14,33 ----
#include <sys/ioctl.h>
#else
+ #ifdef OS2
+ #ifndef __EMX__
+ #define INCL_NOPM
+ #define INCL_DOS
+ #define INCL_KBD
+ #include <os2.h>
+ #endif
+ #include <io.h>
+ #else
+ #ifdef MINIX
+ #include <sgtty.h>
+ #define O_NDELAY O_NONBLOCK
+ #else
#include <termio.h>
+ #endif /* MINIX */
+ #endif /* OS2 */
#endif /* BSD */
#include <errno.h>
***************
*** 28,35 ****
--- 43,65 ----
struct sgttyb ntermb;
#else
+ #ifdef OS2
+ #ifndef __EMX__
+ KBDINFO kbst, kbst_std;
+ #endif
+ #else
+ #ifdef MINIX
+ struct sgttyb otermio; /* original terminal characteristics */
+ struct sgttyb ntermio; /* charactoristics to use inside */
+ struct tchars tchars, tcharsorig;
+ #else
struct termio otermio; /* original terminal characteristics */
struct termio ntermio; /* charactoristics to use inside */
+ #endif /* MINIX */
+ #endif /* OS2 */
#endif /* BSD */
+
+ #ifndef OS2
extern errno; /* System error number -- Necessary when compiling in BSD 1.13 */
+ #endif
int nrow; /* Terminal size, rows. */
***************
*** 81,84 ****
--- 111,129 ----
}
#else
+ #ifdef OS2
+ setmode(1, O_BINARY);
+ #else
+ #ifdef MINIX
+ ioctl(0, TIOCGETP, &otermio);
+ ntermio = otermio;
+ ntermio.sg_flags &= ~ECHO;
+ ntermio.sg_flags |= RAW;
+ ioctl(0, TIOCSETP, &ntermio);
+ ioctl(0, TIOCGETC, &tcharsorig);
+ tchars = tcharsorig;
+ tchars.t_intrc = tchars.t_quitc = tchars.t_startc =
+ tchars.t_stopc = tchars.t_eofc = tchars.t_brkc = -1;
+ ioctl(0, TIOCSETC, &tchars);
+ #else
ioctl (0, TCGETA, &otermio);/* save old settings */
ntermio.c_iflag = 0; /* setup new settings */
***************
*** 90,97 ****
ntermio.c_cc[VTIME] = 0;
ioctl (0, TCSETAW, &ntermio); /* and activate them */
kbdflgs = fcntl (0, F_GETFL, 0);
kbdpoll = FALSE;
! /* on all screens we are not sure of the initial position
! of the cursor */
ttrow = 999;
ttcol = 999;
--- 135,143 ----
ntermio.c_cc[VTIME] = 0;
ioctl (0, TCSETAW, &ntermio); /* and activate them */
+ #endif /* MINIX */
kbdflgs = fcntl (0, F_GETFL, 0);
kbdpoll = FALSE;
! #endif /* OS2 */
! /* on all screens we are not sure of the initial position of the cursor */
ttrow = 999;
ttcol = 999;
***************
*** 98,102 ****
nrow = NROW;
ncol = NCOL;
! #endif
}
--- 144,148 ----
nrow = NROW;
ncol = NCOL;
! #endif /* BSD */
}
***************
*** 113,123 ****
--- 159,212 ----
printf ("closing ioctl on dev 0 failure, error = %d\n", errno);
#else
+ #ifdef OS2
+ setmode(1, O_TEXT);
+ #else
+ #ifdef MINIX
+ if (ioctl(0, TIOCSETP, &otermio) == -1 ||
+ ioctl(0, TIOCSETC, &tcharsorig) == -1 )
+ printf ("closing ioctl on dev 0 failure, error = %d\n", errno);
+ #else
if (ioctl (0, TCSETAW, &otermio) == -1) /* restore terminal settings */
printf ("closing ioctl on dev 0 failure, error = %d\n", errno);
+ #endif /* MINIX */
if (fcntl (0, F_SETFL, kbdflgs) == -1)
printf ("closing fcntl on dev 0 failure, error = %d\n", errno);
+ #endif /* OS2 */
+ #endif /* BSD */
+ }
+
+ #ifdef OS2
+ void ttraw(void)
+ {
+ #ifdef __32BIT__
+ signal(SIGINT, SIG_IGN);
+ signal(SIGBREAK, SIG_IGN);
+ #else
+ PFNSIGHANDLER oldhandler;
+ USHORT oldact;
+
+ DosSetSigHandler((PFNSIGHANDLER) NULL, &oldhandler, &oldact,
+ SIGA_IGNORE, SIG_CTRLBREAK);
+ DosSetSigHandler((PFNSIGHANDLER) NULL, &oldhandler, &oldact,
+ SIGA_IGNORE, SIG_CTRLC);
#endif
+ #ifndef __EMX__
+ kbst_std.cb = sizeof(kbst_std);
+ KbdGetStatus(&kbst_std, 0);
+ kbst = kbst_std;
+ kbst.fsMask &= ~(KEYBOARD_ECHO_ON | KEYBOARD_ASCII_MODE |
+ KEYBOARD_SHIFT_REPORT);
+ kbst.fsMask |= (KEYBOARD_ECHO_OFF | KEYBOARD_BINARY_MODE);
+ KbdSetStatus(&kbst, 0);
+ #endif
+ }
+ void ttcooked(void)
+ {
+ #ifndef __EMX__
+ KbdSetStatus(&kbst_std, 0);
+ #endif
}
+ #endif
/*
***************
*** 127,134 ****
* MS-DOS (use the very very raw console output routine).
*/
! void
ttputc (c)
{
fputc (c, stdout);
}
--- 216,239 ----
* MS-DOS (use the very very raw console output routine).
*/
!
! #ifdef OS2
! int tty_io_size = 0;
! char tty_io_buffer[2048];
! #endif
!
! int
ttputc (c)
{
+ #ifdef OS2
+ if ( tty_io_size == sizeof(tty_io_buffer) )
+ {
+ write(1, tty_io_buffer, tty_io_size);
+ tty_io_size = 0;
+ }
+ tty_io_buffer[tty_io_size++] = c;
+ #else
fputc (c, stdout);
+ #endif
+ return c;
}
***************
*** 140,144 ****
--- 245,257 ----
ttflush ()
{
+ #ifdef OS2
+ if ( tty_io_size )
+ {
+ write(1, tty_io_buffer, tty_io_size);
+ tty_io_size = 0;
+ }
+ #else
fflush (stdout);
+ #endif
}
***************
*** 148,153 ****
--- 261,308 ----
* simple on CPM, because the system can do exactly what you want.
*/
+
+ #ifdef OS2
+ #ifdef __EMX__
+ static int chr = -1;
+ #endif
+ #endif
+
ttgetc ()
{
+ #ifdef OS2
+ #ifdef __EMX__
+ if ( chr != -1 )
+ {
+ int c = chr;
+ chr = -1;
+ return c;
+ }
+ else
+ return _read_kbd(0, 1, 0);
+ #else
+ static int ext, scan, chr;
+ KBDKEYINFO ki;
+
+ if ( ext )
+ {
+ ext = 0;
+ return scan;
+ }
+ else
+ {
+ ttflush();
+ KbdCharIn(&ki, IO_WAIT, 0);
+
+ if ( ki.chChar == 0 || ki.chChar == 0xE0 )
+ {
+ ext = 1;
+ scan = ki.chScan;
+ return 0xE0;
+ }
+ else
+ return ki.chChar;
+ }
+ #endif
+ #else
if (kbdqp)
kbdqp = FALSE;
***************
*** 169,172 ****
--- 324,328 ----
}
return (kbdq & 127);
+ #endif /* OS2 */
}
***************
*** 176,179 ****
--- 332,346 ----
ttkeyready ()
{
+ #ifdef OS2
+ #ifdef __EMX__
+ chr = _read_kbd(0, 0, 0);
+ return (chr != -1);
+ #else
+ KBDKEYINFO ki;
+
+ KbdPeek(&ki, 0);
+ return (ki.fbStatus != 0);
+ #endif
+ #else
if (!kbdqp)
{
***************
*** 186,189 ****
--- 353,360 ----
kbdqp = TRUE;
#else
+ #ifdef X_MINIX
+ /* MINIX has non-blocking mode but it doesn't work !?!? */
+ return FALSE;
+ #else
if (!kbdpoll && fcntl (0, F_SETFL, kbdflgs | O_NDELAY) < 0)
return (FALSE);
***************
*** 190,197 ****
kbdpoll = TRUE; /* fix in 1.13 */
kbdqp = (1 == read (0, &kbdq, 1));
! #endif
}
return (kbdqp);
}
--- 361,370 ----
kbdpoll = TRUE; /* fix in 1.13 */
kbdqp = (1 == read (0, &kbdq, 1));
! #endif /* MINIX */
! #endif /* BSD */
}
return (kbdqp);
+ #endif /* OS2 */
}
diff -c2 -bBw orig/text.c new/text.c
*** orig/text.c Tue Aug 11 09:38:14 1992
--- new/text.c Sat Oct 03 19:56:02 1992
***************
*** 10,15 ****
char MSG_bad_num[] = "ERROR: Bad number";
char MSG_lX[] = "%lX";
! char MSG_lO[] = "%lO";
! char MSG_lD[] = "%lD";
/* in buffer.c */
--- 10,15 ----
char MSG_bad_num[] = "ERROR: Bad number";
char MSG_lX[] = "%lX";
! char MSG_lO[] = "%lo";
! char MSG_lD[] = "%ld";
/* in buffer.c */
***************
*** 52,55 ****
--- 52,58 ----
char MSG_08lX[] = "%08lX";
char MSG_prog_name[] = "BEAV";
+ char MSG_init_file[] = "beav.ini";
+ char MSG_init_var[] = "INIT";
+ char MSG_init_path[] = "PATH";
char MSG_disp_b_lst[] = " Buffer List ";
char MSG_file[] = "File: ";
***************
*** 134,137 ****
--- 137,141 ----
/* in fileio.c */
char MSG_cnt_wr[] = "ERROR: Cannot open file for writing";
+ char MSG_cnt_rd[] = "ERROR: Cannot open file for reading";
char MSG_wr_io_er[] = "ERROR: Write I/O error";
char MSG_rd_er[] = "ERROR: File read error";
***************
*** 226,230 ****
--- 230,238 ----
/* in spawn.c */
char MSG_shell[] = "COMSPEC";
+ #ifdef OS2
+ char MSG_def_shell[] = "cmd.exe";
+ #else
char MSG_def_shell[] = "/command.com";
+ #endif
char MSG_pmpt[] = "PROMPT=[BEAV]";
char MSG_pt[] = "PROMPT";
diff -c2 -bBw orig/tty.c new/tty.c
*** orig/tty.c Tue Aug 11 09:38:14 1992
--- new/tty.c Sat Oct 03 15:45:22 1992
***************
*** 43,48 ****
--- 43,53 ----
ttraw ();
#endif
+ #ifdef OS2
+ ttraw ();
+ #endif
#ifdef UNIX
tcapopen ();
+ tcapmove(0, 0);
+ tcapeeop();
#endif
}
***************
*** 56,59 ****
--- 61,67 ----
{
#ifdef MSDOS
+ ttcooked ();
+ #endif
+ #ifdef OS2
ttcooked ();
#endif
diff -c2 -bBw orig/ttyio.c new/ttyio.c
*** orig/ttyio.c Tue Aug 11 09:38:14 1992
--- new/ttyio.c Sat Oct 03 17:59:22 1992
***************
*** 95,99 ****
* Write character.
*/
! void
ttputc (c)
int c;
--- 95,99 ----
* Write character.
*/
! int
ttputc (c)
int c;
***************
*** 100,103 ****
--- 100,104 ----
{
bdos (6, c, 0);
+ return c;
}
diff -c2 -bBw orig/ttykbd.c new/ttykbd.c
*** orig/ttykbd.c Tue Aug 11 09:38:14 1992
--- new/ttykbd.c Sat Oct 03 14:42:24 1992
***************
*** 112,117 ****
/*
* The keyboard's special characters, those things that are prefixed with
! * a 0x1F, are placed into the keyboard tables as KCTRL || 0x80 || x, for some
! * x, i.e. they have both the control and 0x80 bits set, so they won't conflict
* with anything else on the keyboard.
*/
--- 112,117 ----
/*
* The keyboard's special characters, those things that are prefixed with
! * a 0x1F, are placed into the keyboard tables as KCTRL || 0x800 || x, for some
! * x i.e. they have both the control and 0x800 bits set, so they won't conflict
* with anything else on the keyboard.
*/
***************
*** 194,246 ****
0, NULL, NULL
};
KEY_NAME_ARRAY ibm_keys[] =
{
! KCTLX | 0x80 | 0x3B, MSG_display_bindings, "F1",
! KCTLX | 0x80 | 0x3C, MSG_set_mark, "F2",
! KCTLX | 0x80 | 0x3D, MSG_forw_search, "F3",
! KCTLX | 0x80 | 0x3E, MSG_search_again, "F4",
! KCTLX | 0x80 | 0x3F, MSG_query_replace, "F5",
! KCTLX | 0x80 | 0x40, MSG_yank, "F6",
! KCTLX | 0x80 | 0x41, MSG_copy_region, "F7",
! KCTLX | 0x80 | 0x42, MSG_kill_region, "F8",
! KCTLX | 0x80 | 0x43, MSG_goto_line, "F9",
! KCTLX | 0x80 | 0x44, MSG_abort, "F10",
! KCTLX | 0x80 | 0x54, MSG_help, "Sh-F1",
! KCTLX | 0x80 | 0x55, MSG_file_read, "Sh-F2",
! KCTLX | 0x80 | 0x56, MSG_file_save, "Sh-F3",
! KCTLX | 0x80 | 0x57, MSG_file_visit, "Sh-F4",
! KCTLX | 0x80 | 0x58, MSG_file_write, "Sh-F5",
! KCTLX | 0x80 | 0x59, MSG_flush_all, "Sh-F6",
! KCTLX | 0x80 | 0x5A, MSG_set_file_name, "Sh-F7",
! KCTLX | 0x80 | 0x5B, MSG_file_insert, "Sh-F8",
! KCTLX | 0x80 | 0x5C, MSG_exit_flush_all, "Sh-F9",
! KCTLX | 0x80 | 0x5D, MSG_quit, "Sh-F10",
! KCTLX | 0x80 | 0x5E, MSG_display_buffers, "Ctl-F1",
! KCTLX | 0x80 | 0x5F, MSG_use_buffer, "Ctl-F2",
! KCTLX | 0x80 | 0x60, MSG_kill_buffer, "Ctl-F3",
! KCTLX | 0x80 | 0x61, MSG_next_buff, "Ctl-F4",
! KCTLX | 0x80 | 0x62, MSG_prev_buff, "Ctl-F5",
! KCTLX | 0x80 | 0x63, MSG_yank_buffer, "Ctl-F6",
! KCTLX | 0x80 | 0x64, MSG_set_file_name, "Ctl-F7",
! KCTLX | 0x80 | 0x65, MSG_file_insert, "Ctl-F8",
! KCTLX | 0x80 | 0x66, MSG_exit_flush_all, "Ctl-F9",
! KCTLX | 0x80 | 0x67, MSG_quit, "Ctl-F10",
! KCTLX | 0x80 | 0x48, MSG_back_line, "North",
! KCTLX | 0x80 | 0x4D, MSG_forw_char, "East",
! KCTLX | 0x80 | 0x74, MSG_forw_unit, "Ctl-East",
! KCTLX | 0x80 | 0x50, MSG_forw_line, "South",
! KCTLX | 0x80 | 0x4B, MSG_back_char, "West",
! KCTLX | 0x80 | 0x73, MSG_back_unit, "Ctl-West",
! KCTLX | 0x80 | 0x49, MSG_back_page, "PageDown",
! KCTLX | 0x80 | 0x47, MSG_goto_bob, "Home",
! KCTLX | 0x80 | 0x51, MSG_forw_page, "PageUp",
! KCTLX | 0x80 | 0x4F, MSG_goto_eob, "End",
! KCTLX | 0x80 | 0x52, MSG_ins_toggle, "Insert",
! KCTLX | 0x80 | 0x53, MSG_forw_del_char, "Delete",
! KCTLX | 0x80 | 0x76, MSG_forw_window, "Ctl-PageDown",
! KCTLX | 0x80 | 0x84, MSG_back_window, "Ctl-PageUp",
! KCTLX | 0x80 | 0x72, MSG_print, "Ctl-Print",
! KCTLX | 0x80 | 0x0F, MSG_forw_unit, "Sh-Tab",
0, NULL, NULL
};
--- 194,334 ----
0, NULL, NULL
};
+ #endif
+ #if defined(MSDOS) || defined(OS2)
KEY_NAME_ARRAY ibm_keys[] =
{
! KCTLX | 0x800 | 0x3B, MSG_display_bindings, "F1",
! KCTLX | 0x800 | 0x3C, MSG_set_mark, "F2",
! KCTLX | 0x800 | 0x3D, MSG_forw_search, "F3",
! KCTLX | 0x800 | 0x3E, MSG_search_again, "F4",
! KCTLX | 0x800 | 0x3F, MSG_query_replace, "F5",
! KCTLX | 0x800 | 0x40, MSG_yank, "F6",
! KCTLX | 0x800 | 0x41, MSG_copy_region, "F7",
! KCTLX | 0x800 | 0x42, MSG_kill_region, "F8",
! KCTLX | 0x800 | 0x43, MSG_goto_line, "F9",
! KCTLX | 0x800 | 0x44, NULL, "F10",
! KCTLX | 0x800 | 0x85, NULL, "F11",
! KCTLX | 0x800 | 0x86, NULL, "F12",
! KCTLX | 0x800 | 0x54, MSG_help, "Sh-F1",
! KCTLX | 0x800 | 0x55, MSG_file_read, "Sh-F2",
! KCTLX | 0x800 | 0x56, MSG_file_save, "Sh-F3",
! KCTLX | 0x800 | 0x57, MSG_file_visit, "Sh-F4",
! KCTLX | 0x800 | 0x58, MSG_file_write, "Sh-F5",
! KCTLX | 0x800 | 0x59, MSG_flush_all, "Sh-F6",
! KCTLX | 0x800 | 0x5A, MSG_set_file_name, "Sh-F7",
! KCTLX | 0x800 | 0x5B, MSG_file_insert, "Sh-F8",
! KCTLX | 0x800 | 0x5C, MSG_exit_flush_all, "Sh-F9",
! KCTLX | 0x800 | 0x5D, MSG_quit, "Sh-F10",
! KCTLX | 0x800 | 0x87, NULL, "Sh-F11",
! KCTLX | 0x800 | 0x88, NULL, "Sh-F12",
! KCTLX | 0x800 | 0x5E, MSG_display_buffers, "Ctl-F1",
! KCTLX | 0x800 | 0x5F, MSG_use_buffer, "Ctl-F2",
! KCTLX | 0x800 | 0x60, MSG_kill_buffer, "Ctl-F3",
! KCTLX | 0x800 | 0x61, MSG_next_buff, "Ctl-F4",
! KCTLX | 0x800 | 0x62, MSG_prev_buff, "Ctl-F5",
! KCTLX | 0x800 | 0x63, MSG_yank_buffer, "Ctl-F6",
! KCTLX | 0x800 | 0x64, MSG_set_file_name, "Ctl-F7",
! KCTLX | 0x800 | 0x65, MSG_file_insert, "Ctl-F8",
! KCTLX | 0x800 | 0x66, MSG_exit_flush_all, "Ctl-F9",
! KCTLX | 0x800 | 0x67, MSG_quit, "Ctl-F10",
! KCTLX | 0x800 | 0x89, NULL, "Ctl-F11",
! KCTLX | 0x800 | 0x8A, NULL, "Ctl-F12",
! KCTLX | 0x800 | 0x68, NULL, "Alt-F1",
! KCTLX | 0x800 | 0x69, NULL, "Alt-F2",
! KCTLX | 0x800 | 0x6A, NULL, "Alt-F3",
! KCTLX | 0x800 | 0x6B, NULL, "Alt-F4",
! KCTLX | 0x800 | 0x6C, NULL, "Alt-F5",
! KCTLX | 0x800 | 0x6D, NULL, "Alt-F6",
! KCTLX | 0x800 | 0x6E, NULL, "Alt-F7",
! KCTLX | 0x800 | 0x6F, NULL, "Alt-F8",
! KCTLX | 0x800 | 0x70, NULL, "Alt-F9",
! KCTLX | 0x800 | 0x71, NULL, "Alt-F10",
! KCTLX | 0x800 | 0x8B, NULL, "Alt-F11",
! KCTLX | 0x800 | 0x8C, NULL, "Alt-F12",
! KCTLX | 0x800 | 0x48, MSG_back_line, "North",
! KCTLX | 0x800 | 0x4D, MSG_forw_char, "East",
! KCTLX | 0x800 | 0x50, MSG_forw_line, "South",
! KCTLX | 0x800 | 0x4B, MSG_back_char, "West",
! KCTLX | 0x800 | 0x8D, MSG_back_line, "Ctl-North",
! KCTLX | 0x800 | 0x74, MSG_forw_unit, "Ctl-East",
! KCTLX | 0x800 | 0x91, MSG_forw_line, "Ctl-South",
! KCTLX | 0x800 | 0x73, MSG_back_unit, "Ctl-West",
! KCTLX | 0x800 | 0x98, NULL, "Alt-North",
! KCTLX | 0x800 | 0x9D, NULL, "Alt-East",
! KCTLX | 0x800 | 0xA0, NULL, "Alt-South",
! KCTLX | 0x800 | 0x9B, NULL, "Alt-West",
! KCTLX | 0x800 | 0x49, MSG_back_page, "PageDown",
! KCTLX | 0x800 | 0x51, MSG_forw_page, "PageUp",
! KCTLX | 0x800 | 0x47, MSG_goto_bob, "Home",
! KCTLX | 0x800 | 0x4F, MSG_goto_eob, "End",
! KCTLX | 0x800 | 0x4C, NULL, "Center",
! KCTLX | 0x800 | 0x76, MSG_forw_window, "Ctl-PageDown",
! KCTLX | 0x800 | 0x84, MSG_back_window, "Ctl-PageUp",
! KCTLX | 0x800 | 0x77, MSG_goto_bob, "Ctl-Home",
! KCTLX | 0x800 | 0x75, MSG_goto_eob, "Ctl-End",
! KCTLX | 0x800 | 0x8F, NULL, "Ctl-Center",
! KCTLX | 0x800 | 0xA1, NULL, "Alt-PageDown",
! KCTLX | 0x800 | 0x99, NULL, "Alt-PageUp",
! KCTLX | 0x800 | 0x97, NULL, "Alt-Home",
! KCTLX | 0x800 | 0x9F, NULL, "Alt-End",
! KCTLX | 0x800 | 0x52, MSG_ins_toggle, "Insert",
! KCTLX | 0x800 | 0x53, MSG_forw_del_char, "Delete",
! KCTLX | 0x800 | 0x92, NULL, "Ctl-Insert",
! KCTLX | 0x800 | 0x93, NULL, "Ctl-Delete",
! KCTLX | 0x800 | 0xA2, NULL, "Alt-Insert",
! KCTLX | 0x800 | 0xA3, NULL, "Alt-Delete",
! KCTLX | 0x800 | 0x72, MSG_print, "Ctl-Print",
! KCTLX | 0x800 | 0x0F, NULL, "Sh-Tab",
! KCTLX | 0x800 | 0x94, NULL, "Ctl-Tab",
! KCTLX | 0x800 | 0xA5, NULL, "Alt-Tab",
! KCTLX | 0x800 | 0x95, NULL, "Ctrl-Num/",
! KCTLX | 0x800 | 0x96, NULL, "Ctrl-Num*",
! KCTLX | 0x800 | 0x8E, NULL, "Ctrl-Num-",
! KCTLX | 0x800 | 0x90, NULL, "Ctrl-Num+",
! KCTLX | 0x800 | 0xA4, NULL, "Alt-Num/",
! KCTLX | 0x800 | 0x37, NULL, "Alt-Num*",
! KCTLX | 0x800 | 0x4A, NULL, "Alt-Num-",
! KCTLX | 0x800 | 0x4E, NULL, "Alt-Num+",
! KCTLX | 0x800 | 0xA6, NULL, "Alt-NumEnter",
! KCTLX | 0x800 | 0x01, NULL, "Alt-Esc",
! KCTLX | 0x800 | 0x1C, NULL, "Alt-Enter",
! KCTLX | 0x800 | 0x0E, NULL, "Alt-Backspace",
! KCTLX | 0x800 | 0x1E, NULL, "Alt-A",
! KCTLX | 0x800 | 0x30, NULL, "Alt-B",
! KCTLX | 0x800 | 0x2E, NULL, "Alt-C",
! KCTLX | 0x800 | 0x20, NULL, "Alt-D",
! KCTLX | 0x800 | 0x12, NULL, "Alt-E",
! KCTLX | 0x800 | 0x21, NULL, "Alt-F",
! KCTLX | 0x800 | 0x22, NULL, "Alt-G",
! KCTLX | 0x800 | 0x23, NULL, "Alt-H",
! KCTLX | 0x800 | 0x17, NULL, "Alt-I",
! KCTLX | 0x800 | 0x24, NULL, "Alt-J",
! KCTLX | 0x800 | 0x25, NULL, "Alt-K",
! KCTLX | 0x800 | 0x26, NULL, "Alt-L",
! KCTLX | 0x800 | 0x32, NULL, "Alt-M",
! KCTLX | 0x800 | 0x31, NULL, "Alt-N",
! KCTLX | 0x800 | 0x18, NULL, "Alt-O",
! KCTLX | 0x800 | 0x19, NULL, "Alt-P",
! KCTLX | 0x800 | 0x10, NULL, "Alt-Q",
! KCTLX | 0x800 | 0x13, NULL, "Alt-R",
! KCTLX | 0x800 | 0x1F, NULL, "Alt-S",
! KCTLX | 0x800 | 0x14, NULL, "Alt-T",
! KCTLX | 0x800 | 0x16, NULL, "Alt-U",
! KCTLX | 0x800 | 0x2F, NULL, "Alt-V",
! KCTLX | 0x800 | 0x11, NULL, "Alt-W",
! KCTLX | 0x800 | 0x2D, NULL, "Alt-X",
! KCTLX | 0x800 | 0x15, NULL, "Alt-Y",
! KCTLX | 0x800 | 0x2C, NULL, "Alt-Z",
! KCTLX | 0x800 | 0x78, NULL, "Alt-1",
! KCTLX | 0x800 | 0x79, NULL, "Alt-2",
! KCTLX | 0x800 | 0x7A, NULL, "Alt-3",
! KCTLX | 0x800 | 0x7B, NULL, "Alt-4",
! KCTLX | 0x800 | 0x7C, NULL, "Alt-5",
! KCTLX | 0x800 | 0x7D, NULL, "Alt-6",
! KCTLX | 0x800 | 0x7E, NULL, "Alt-7",
! KCTLX | 0x800 | 0x7F, NULL, "Alt-8",
! KCTLX | 0x800 | 0x80, NULL, "Alt-9",
! KCTLX | 0x800 | 0x81, NULL, "Alt-0",
0, NULL, NULL
};
***************
*** 280,287 ****
return (c | KCTRL);
}
! if (c == 0)
{
c = ttgetc ();
! return (c | 0x80 | KCTLX);
}
return (c);
--- 368,375 ----
return (c | KCTRL);
}
! if (c == 0 || c == 0xE0)
{
c = ttgetc ();
! return (c | 0x800 | KCTLX);
}
return (c);
***************
*** 298,302 ****
ttykeymapinit ()
{
! #if MSDOS
KEY_NAME_ARRAY *ptr;
int i;
--- 386,390 ----
ttykeymapinit ()
{
! #ifdef MSDOS
KEY_NAME_ARRAY *ptr;
int i;
***************
*** 322,325 ****
--- 410,429 ----
writ_echo (buf);
#endif
+ #ifdef OS2
+ KEY_NAME_ARRAY *ptr;
+ int i;
+ char buf[NCOL];
+ ptr = ibm_keys;
+ i = 0;
+ while (ptr -> key_code != 0)
+ {
+ if (ptr -> func_name_str != NULL)
+ keydup (ptr -> key_code, ptr -> func_name_str);
+ ptr++;
+ i++;
+ }
+ /* sprintf (buf, MSG_sp_key, i);
+ writ_echo (buf); */
+ #endif
}
***************
*** 332,336 ****
int key;
{
! #if MSDOS
KEY_NAME_ARRAY *ptr;
--- 436,440 ----
int key;
{
! #ifdef MSDOS
KEY_NAME_ARRAY *ptr;
***************
*** 343,346 ****
--- 447,462 ----
if (!wang_pc && !ibm_pc)
return (NULL);
+
+ while (ptr->key_code != 0)
+ {
+ if (key == ptr->key_code)
+ {
+ return (ptr->key_name_str);
+ }
+ ptr++;
+ }
+ #endif
+ #ifdef OS2
+ KEY_NAME_ARRAY *ptr = ibm_keys;
while (ptr->key_code != 0)