From be9a6f91631c6841a3a256de1a2409744f87cf33 Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 3 Sep 2020 12:25:04 +0200 Subject: [PATCH 01/37] Add files via upload --- cygwin/Makefile | 117 ++++ cygwin/estruct.h | 1376 ++++++++++++++++++++++++++++++++++++++++++++++ cygwin/mepipe | 4 + cygwin/merun | 7 + theos/_locate_.c | 54 ++ theos/_setargv.c | 145 +++++ theos/estruct.h | 1312 +++++++++++++++++++++++++++++++++++++++++++ theos/makefile.5 | 124 +++++ 8 files changed, 3139 insertions(+) create mode 100644 cygwin/Makefile create mode 100644 cygwin/estruct.h create mode 100644 cygwin/mepipe create mode 100644 cygwin/merun create mode 100644 theos/_locate_.c create mode 100644 theos/_setargv.c create mode 100644 theos/estruct.h create mode 100644 theos/makefile.5 diff --git a/cygwin/Makefile b/cygwin/Makefile new file mode 100644 index 0000000..3f82406 --- /dev/null +++ b/cygwin/Makefile @@ -0,0 +1,117 @@ +# Linux makefile for +# MicroEMACS 5.00 with UTF-8 character set +# (C)Copyright 1995 by Daniel Lawrence +# all rights reserved + +# modify the following lines with the proper relative directories + +# object file directory +OBJD = . +# source file directory +SRCD = ../src +# header file directory +HDIR = ../h + +# options and arguments to the C compiler + +#CFLAGS += -I. -I$(HDIR) +CFLAGS = -g -I. -I$(HDIR) -DLINUX -D_XOPEN_SOURCE_EXTENDED=1 + +# list of header files + +HFILES = estruct.h $(HDIR)/edef.h $(HDIR)/efunc.h $(HDIR)/epath.h $(HDIR)/ebind.h $(HDIR)/eproto.h + +#list of object files + +F1 = $(OBJD)/abbrev.o $(OBJD)/basic.o $(OBJD)/bind.o $(OBJD)/buffer.o $(OBJD)/char.o +F2 = $(OBJD)/crypt.o $(OBJD)/curses.o $(OBJD)/display.o $(OBJD)/dolock.o $(OBJD)/message.o +F3 = $(OBJD)/eval.o $(OBJD)/exec.o $(OBJD)/file.o $(OBJD)/fileio.o $(OBJD)/input.o +F4 = $(OBJD)/isearch.o $(OBJD)/keyboard.o $(OBJD)/libhelp.o $(OBJD)/line.o $(OBJD)/lock.o +F5 = $(OBJD)/main.o $(OBJD)/mouse.o $(OBJD)/screen.o $(OBJD)/random.o $(OBJD)/region.o +F6 = $(OBJD)/search.o $(OBJD)/replace.o $(OBJD)/tags.o $(OBJD)/theox.o $(OBJD)/undo.o +F7 = $(OBJD)/unix.o $(OBJD)/unixterm.o $(OBJD)/utf8.o $(OBJD)/window.o $(OBJD)/word.o + +# product list + +all: emacs + +OFILES = $(F1) $(F2) $(F3) $(F4) $(F5) $(F6) $(F7) + +emacs: $(OFILES) + $(CC) $(CFLAGS) $(OFILES) -lncursesw -lc -o emacs + +$(OBJD)/abbrev.o: $(SRCD)/abbrev.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/abbrev.o $(SRCD)/abbrev.c +$(OBJD)/basic.o: $(SRCD)/basic.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/basic.o $(SRCD)/basic.c +$(OBJD)/bind.o: $(SRCD)/bind.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/bind.o $(SRCD)/bind.c +$(OBJD)/buffer.o: $(SRCD)/buffer.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/buffer.o $(SRCD)/buffer.c +$(OBJD)/char.o: $(SRCD)/char.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/char.o $(SRCD)/char.c +$(OBJD)/crypt.o: $(SRCD)/crypt.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/crypt.o $(SRCD)/crypt.c +$(OBJD)/curses.o: $(SRCD)/curses.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/curses.o $(SRCD)/curses.c +$(OBJD)/cmdfix.o: $(SRCD)/cmdfix.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/cmdfix.o $(SRCD)/cmdfix.c +$(OBJD)/display.o: $(SRCD)/display.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/display.o $(SRCD)/display.c +$(OBJD)/dolock.o: $(SRCD)/dolock.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/dolock.o $(SRCD)/dolock.c +$(OBJD)/message.o: $(SRCD)/message.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/message.o $(SRCD)/message.c +$(OBJD)/eval.o: $(SRCD)/eval.c $(HFILES) $(HDIR)/evar.h + $(CC) $(CFLAGS) -c -o $(OBJD)/eval.o $(SRCD)/eval.c +$(OBJD)/exec.o: $(SRCD)/exec.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/exec.o $(SRCD)/exec.c +$(OBJD)/file.o: $(SRCD)/file.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/file.o $(SRCD)/file.c +$(OBJD)/fileio.o: $(SRCD)/fileio.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/fileio.o $(SRCD)/fileio.c +$(OBJD)/input.o: $(SRCD)/input.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/input.o $(SRCD)/input.c +$(OBJD)/isearch.o: $(SRCD)/isearch.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/isearch.o $(SRCD)/isearch.c +$(OBJD)/keyboard.o: $(SRCD)/keyboard.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/keyboard.o $(SRCD)/keyboard.c +$(OBJD)/libhelp.o: $(SRCD)/libhelp.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/libhelp.o $(SRCD)/libhelp.c +$(OBJD)/line.o: $(SRCD)/line.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/line.o $(SRCD)/line.c +$(OBJD)/lock.o: $(SRCD)/lock.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/lock.o $(SRCD)/lock.c +$(OBJD)/main.o: $(SRCD)/main.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/main.o $(SRCD)/main.c +$(OBJD)/mouse.o: $(SRCD)/mouse.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/mouse.o $(SRCD)/mouse.c +$(OBJD)/unix.o: $(SRCD)/unix.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/unix.o $(SRCD)/unix.c +$(OBJD)/unixterm.o: $(SRCD)/unixterm.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/unixterm.o $(SRCD)/unixterm.c +$(OBJD)/utf8.o: $(SRCD)/utf8.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/utf8.o $(SRCD)/utf8.c +$(OBJD)/random.o: $(SRCD)/random.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/random.o $(SRCD)/random.c +$(OBJD)/region.o: $(SRCD)/region.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/region.o $(SRCD)/region.c +$(OBJD)/screen.o: $(SRCD)/screen.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/screen.o $(SRCD)/screen.c +$(OBJD)/search.o: $(SRCD)/search.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/search.o $(SRCD)/search.c +$(OBJD)/replace.o: $(SRCD)/replace.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/replace.o $(SRCD)/replace.c +$(OBJD)/tags.o: $(SRCD)/tags.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/tags.o $(SRCD)/tags.c +$(OBJD)/theox.o: $(SRCD)/theox.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/theox.o $(SRCD)/theox.c +$(OBJD)/undo.o: $(SRCD)/undo.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/undo.o $(SRCD)/undo.c +$(OBJD)/window.o: $(SRCD)/window.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/window.o $(SRCD)/window.c +$(OBJD)/word.o: $(SRCD)/word.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/word.o $(SRCD)/word.c + +clean: + rm -f *.o emacs diff --git a/cygwin/estruct.h b/cygwin/estruct.h new file mode 100644 index 0000000..2890943 --- /dev/null +++ b/cygwin/estruct.h @@ -0,0 +1,1376 @@ +/* ESTRUCT: Structure and preprocesser defined for + MicroEMACS 4.01 + + (C)Copyright 1997 by Daniel Lawrence + written by Daniel Lawrence + based on code by Dave G. Conroy, + Steve Wilhite and George Jones + + Unicode support by Jean-Michel Dubois +*/ + +#ifdef LATTICE +#undef LATTICE /* don't use their definitions...use ours */ +#endif +#ifdef MSDOS +#undef MSDOS +#endif +#ifdef WINNT +#undef WINNT +#endif +#ifdef AMIGA +#undef AMIGA +#endif +#ifdef EGA +#undef EGA +#endif +#ifdef CTRLZ +#undef CTRLZ +#endif + +/* Program Identification..... + + PROGNAME should always be MicroEMACS for a distribution + unmodified version. People using MicroEMACS as a shell + for other products should change this to reflect their + product. Macros can query this via the $progname variable +*/ + +#define PROGNAME "MicroEMACS" +#define VERSION "5.10e" + +/* Machine/OS definitions */ +/* [Set one of these!!] */ + +#define AMIGA 0 /* AmigaDOS */ +#define AOSVS 0 /* Data General AOS/VS */ +#define AUX 0 /* Apple UNIX for Macintosh */ +#define AIX 0 /* IBM UNIX for various machines*/ +#define AVIION 0 /* Data General AViiON */ +#define BSD 0 /* UNIX BSD 4.2 and ULTRIX */ +#define FINDER 0 /* Macintosh OS */ +#define FREEBSD 0 /* FREEBSD 386 version 2 or + */ +#define HPUX8 0 /* HPUX HP 9000 ver 8 or less */ +#define HPUX9 0 /* HPUX HP 9000 ver 9 */ +#define MPE 0 /* HP MPE/XL */ +#define MSDOS 0 /* MS-DOS */ +#define WINNT 0 /* MS-Win NT */ +#define WINXP 0 /* Windows XP/Visual studio 2008*/ +#define OS2 0 /* Microsoft or IBM OS/2 */ +#define SMOS 0 /* Supermax UNIX System V */ +#define SUN 0 /* SUN v4.0 */ +#define TOS 0 /* ST520, TOS */ +#define USG 1 /* UNIX system V */ +#define VMS 0 /* VAX/VMS */ +#define WMCS 0 /* Wicat's MCS */ +#define XENIX 0 /* IBM-PC SCO XENIX */ +#define LINUX 1 /* Linux */ + +#if LINUX +#undef USG +#define USG 1 +#endif +/* Compiler definitions */ +/* [Set one of these!!] */ +#define ALCYON 0 /* ALCYON Atari ST compiler */ +#define AZTEC 0 /* Aztec C 4.00e ONLY for the amiga now... */ +#define DGC 0 /* Data General AOS/VS C... */ +#define GCC 1 /* the GNU C compiler */ +#define IC 0 /* Rational Systems Instant C */ +#define LATTICE 0 /* Lattice 2.14 through 3.0 compilers */ +#define MSC 0 /* MicroSoft C compile version 3 and up */ +#define MWC 0 /* Mark Williams C */ +#define TURBO 0 /* Turbo C and Borland C++ under MSDOS */ +#define UNIX 0 /* a standard UNIX compiler (cc) */ +#define ZTC 0 /* Zortech C/C++ 1.02 thru 2.10 under MSDOS */ + +/* Machine stack growth direction. */ +/* [Set this to 1 if your machine stack grows UP!!!] */ +/* data general mv/eclipse series stack grows up. */ +/* dec vax series stack grows down... got it??? */ + +#define STACK_GROWS_UP 0 + +/* Debugging options */ +#define RAMSIZE 0 /* dynamic RAM memory usage tracking */ +#define RAMSHOW 0 /* auto dynamic RAM reporting */ +#define RAMTRCK 0 /* send debug info to MALLOC.DAT */ +#define DEBUG_SEARCH 0 /* pop some search info on patterns */ + +/* Special keyboard/network definitions */ + +#define ATKBD 0 /* AT-style keyboard with F11, F12 & grey keys */ +#define WANGPC 0 /* WangPC - mostly escape sequences */ +#define VT100 0 /* Handle VT100 style keypad - NOT VMS. */ +#define KEYPAD 0 /* VMS - turn on and off application */ + /* keypad automatically */ +#define XONDATA 0 /* VMS - set to force /NOTTSYNC/NOHOSTSY */ +#define RMSIO 0 /* VMS - skip the rotten C runtime and */ + /* use RMS directly */ +#define OPTMEM 0 /* VMS 5.0 and up - use a less standard */ + /* but more efficient memory allocator */ + +/* Terminal Output definitions */ +/* [Set one of these!!] */ + +#define ANSI 0 /* ANSI escape sequences */ +#define CURSES 1 /* Use CURSES */ +#define DASHER 0 /* DG Dasher 2xx/4xx crts */ +#define DG10 0 /* Data General system/10 */ +#define FMR 0 /* Fujitsu FMR series driver */ +#define HP110 0 /* HP110 screen driver */ +#define HP150 0 /* HP150 screen driver */ +#define I55 0 /* IBM PS55 DOS J4.0/V */ +#define IBMPC 0 /* IBM-PC CGA/MONO/EGA/VGA drvr */ +#define MAC 0 /* Macintosh */ +#define NEC 0 /* NEC-9801VM driver */ +#define OS2NPM 0 /* OS/2 non-Presentation Mgr. */ +#define SMG 0 /* SMG library on VMS */ +#define ST52 0 /* Atari 520/1040ST screen */ +#define TERMCAP 0 /* Use TERMCAP */ +#define TIPC 0 /* TI Professional PC driver */ +#define VT52 0 /* VT52 terminal (Zenith). */ +#define NTCON 0 /* Windows NT console */ +#define XPCON 0 /* windows XP console app */ +#define XVT 0 /* XVT windowing system */ +#define Z309 0 /* Zenith 100 PC family driver */ + +/* Windowing system style (pick one) */ + +#define WINDOW_TEXT 1 /* [default] Text mode */ +#define WINDOW_MSWIN 0 /* MicroSoft Windows */ +#define WINDOW_MSWIN32 0 /* MicroSoft Windows 32 bit API */ +#define WINDOW_X 0 /* X/Unix */ + +/* Language text options (pick one) */ + +#define ENGLISH 1 /* [default] */ +#define FRENCH 0 +#define SPANISH 0 +#define GERMAN 0 +#define DUTCH 0 +#define PLATIN 0 /* Pig Latin */ +#define JAPAN 0 +#define LATIN 0 /* real Latin */ + +/* Configuration options */ + +#define TYPEAH 1 /* type ahead causes update to be skipped */ +#define LOGFLG 0 /* send all executed commands to EMACS.LOG */ +#define VISMAC 0 /* update display during keyboard macros */ +#define CTRLZ 0 /* add a ^Z at end of files under MSDOS only */ +#define CLEAN 0 /* de-alloc memory on exit */ +#define CALLED 0 /* is emacs a called subroutine? or stand alone */ + +#define REVSTA 0 /* Status line appears in reverse video */ +#define COLOR 1 /* color commands and windows */ + +#define FILOCK 1 /* file locking under unix BSD 4.2 */ +#define ISRCH 1 /* Incremental searches like ITS EMACS */ +#define FLABEL 0 /* function key label code [HP150] */ +#define CRYPT 1 /* file encryption enabled? */ +#define MAGIC 1 /* include regular expression matching? */ +#define MOUSE 1 /* Include routines for mouse actions */ +#define NOISY 1 /* Use a fancy BELL if it exists */ +#define CTAGS 1 /* include vi-like tagging? */ +#define VARARG 1 /* use varargs.h for mlwrite() */ + +#if XVT +#undef COLOR +#define COLOR 1 /* overide this to be TRUE for XVT always */ +#endif + +#define JMDEXT 1 /* enable J-M Dubois' extensions */ + +#if JMDEXT +#define BACKUP 1 /* backup previous file version */ +#define LIBHELP 1 /* online help for C functions */ +#define DYNMSGS 1 /* dynamic load of messages */ +#define THEOX 1 /* allow TheoX character set files edition */ + /* including semi-graphics entry from numeric */ + /* keypad (require UTF8) */ +#endif + +#if DYNMSGS +#define OQUOTE_CHAR 34 +#define CQUOTE_CHAR 34 +#endif + +/* Character set options */ +/* [Set one of these!!] */ +#define ASCII 0 /* use ASCII char sequences */ +#define EBCDIC 0 /* later IBM mainfraim versions will use EBCDIC */ +#define UTF8 1 /* use UTF-8 encoded Unicode */ + +#if UTF8 +#include "utf8.h" +#include +#else +#undef THEOX +#define THEOX 0 +#endif + +/* handle constant and voids properly */ + +#if VMS +#define CONST readonly +#define VOID void +#define NOSHARE noshare +#else +#if AOSVS +#define CONST $shared $align(1) /* fake a const */ +#define VOID +#define NOSHARE $low32k $align(1) /* attempt to optimize read/write vars. */ +#else + +#if __STDC__ || MSC || TURBO || GCC || (AMIGA && LATTICE) +#define CONST const +#define VOID void +#define NOSHARE +#else +#define CONST +#if IC +#define VOID void +#else +#define VOID +#endif +#define NOSHARE +#endif + +#endif +#endif + +/* System dependent library redefinitions, structures and includes */ + +/* multibyte character support? */ + +#if NEC || FMR || I55 +#define DBCS 1 /* double byte character sets enabled */ +#define INSDEL 1 /* use insert/delete line display optimizations */ + +/* define DBCS prefix bytes */ +#define is2char(ch) (((ch&0xff) >= 0x81 && (ch&0xff) <= 0x9f) || ((ch&0xff) >=0xe0 && (ch&0xff) <= 0xfc)) + +#else +#define DBCS 0 +#define INSDEL 0 +#endif + +/* Can we catch the SIGWINCH (the window size change signal)? */ + +#if AIX || HPUX9 || LINUX +#define HANDLE_WINCH 1 +#else +#define HANDLE_WINCH 0 +#endif + +/* Prototypes in use? */ + +#if MSC || TURBO || IC || VMS || GCC || ZTC +#define PROTO 1 +#else +#define PROTO 0 +#endif + +/* the following define allows me to initialize unions... + otherwise we make them structures (like the keybinding table) */ + +#if __STDC__ || MSC || TURBO || IC || ZTC +#define ETYPE union +#else +#define ETYPE struct +#endif + +/* Instant C can't do stat()s. Arrrg. No file locking for you */ +#if IC && MSDOS +#undef FILOCK +#define FILOCK 0 +#endif + +/* Mark Williams/Atari has no standard or varargs or directory functions */ +#if TOS & MWC +#undef VARARG +#define VARARG 0 +#undef FILOCK +#define FILOCK 0 +#endif + +/* MS-Windows */ + +#if WINNT || WINDOW_MSWIN || WINDOW_MSWIN32 +#if WINDOW_MSWIN32 +#undef WINDOW_MSWIN +#define WINDOW_MSWIN 1 +#endif +#if WINDOW_MSWIN && (WINNT || WINXP) +#undef WINDOW_MSWIN32 +#define WINDOW_MSWIN32 1 +#endif +#if 1 +#undef MAC /* Mac conflicts with a definition used by rpc.h */ +#undef VOID /* windows.h will wind up defining this when compiled as a console app */ +#include /* --------- Huge include file here !!! ---------*/ +#ifndef VOID +#define VOID void /* Redefine, incase we are compiled as a Windows app */ +#endif +#endif +#if NTCON +#include +#include +#include +#endif + +#undef NEAR +#define NEAR +#define DNEAR +#if MSC || IC +#undef CDECL +#define CDECL __cdecl +#define DUMMYSZ 1 /* dummy size for unsized extern arrays to avoid + silly DGROUP fixup */ +#else +#if TURBO +#define DUMMYSZ /* nothing */ +#else +#define CDECL _cdecl /* ZTC */ +#define DUMMYSZ /* nothing */ +#endif +#endif + +#if (WINNT || WINXP) && !WINDOW_MSWIN +#define EXPORT /* Windows NT doesn't like this */ +#endif + +#if WINDOW_MSWIN +#undef TYPEAH +#define TYPEAH 0 /* typeahead is handled at the term driver level */ +#undef CALLED +#define CALLED 1 /* under MS Windows, "main" resides in the sys driver */ +#if WINNT || WINXP +#define EXPORT /* Windows NT doesn't like this */ +#elif MSC +#define EXPORT __export +#else +#define EXPORT _export /* Fine for TURBO and ZTC */ +#endif +#endif +#else + +/* neither Windows NT nor MS-Windows */ + +#define DUMMYSZ /* nothing */ + +#if MSDOS & (TURBO | MSC | TIPC) +#define NEAR +#define DNEAR +#define pascal +#define CDECL cdecl +#else +#if MSDOS & ZTC +#define NEAR +#define DNEAR +#define _pascal +#define CDECL _cdecl +#else +#define NEAR +#define DNEAR +#define PASCAL +#define CDECL +#endif +#endif + +#endif + +#if TURBO +#include +#include +#undef peek +#undef poke +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#endif + +#if IC +#include +#undef peek +#undef poke +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#endif + +#if LATTICE & MSDOS +/* you may have to remove this one definition with LATTICE version + 3.2 and above */ +#define unsigned +#endif + +#if IC +#define inp inportb +#define outp outportb +#define intdos(a, b) int86(33, a, b) +#endif + +#if AZTEC +#undef putc +#undef getc +#if MSDOS +#define getc a1getc +#define int86 sysint +#define intdos(a, b) sysint(33, a, b) +#define inp inportb +#define outp outportb +#else +#define getc agetc +#endif +#define putc aputc + +struct XREG { + unsigned ax,bx,cx,dx,si,di,ds,es; +}; + +struct HREG { + char al,ah,bl,bh,cl,ch,dl,dh,d1,d2,e1,e2; +}; + +union REGS { + struct XREG x; + struct HREG h; +}; + +struct SREGS { + unsigned cs, ss, ds, es; +}; +#endif + +#if MSDOS & MWC +#include +#define int86(a, b, c) intcall(b, c, a) +#define intdos(a, b) intcall(a, b, DOSINT) +#define inp(a) in(a) +#define outp(a, b) out(a, b) +#define movmem(a, b, c) memcpy(b, a, c) + +struct XREG { + unsigned int ax,bx,cx,dx,si,di,ds,es,flags; +}; + +struct HREG { + char al,ah,bl,bh,cl,ch,dl,dh; + unsigned int ds,es,flags; +}; + +union REGS { + struct XREG x; + struct HREG h; +}; +#endif + +#if MSDOS & MSC +#include +#include +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#define movmem(a, b, c) memcpy(b, a, c) +#define _strrev(a) strrev(a) +#endif + +#if MSDOS & LATTICE +#undef CPM +#undef LATTICE +#include +#undef CPM +#endif + +/* System V doesn't name this the same as others */ +#if USG | AIX | AUX | SUN | (OS2 & MSC) +#define movmem(a, b, c) memcpy(b, a, c) +#define min(a,b) ((a)>(b)?(b):(a)) +#define max(a,b) ((a)>(b)?(a):(b)) +#endif + +/* this keeps VMS happy */ +#if VMS +#define getname xgetname +#define unlink(a) delete(a) +#endif + +/* some options for AOS/VS */ +#if AOSVS +#define ORMDNI 1 +#endif + +/* define some ability flags */ + +#if (IBMPC | Z309 | FMR | TIPC) & !(WINDOW_MSWIN | WINDOW_MSWIN32) +#define MEMMAP 1 +#else +#define MEMMAP 0 +#endif + +#if MSDOS | WINNT | WINXP | OS2 | USG | AIX | AUX | SMOS | HPUX8 | HPUX9 | BSD | FREEBSD | (TOS & MWC) | WMCS | SUN | MPE +#define ENVFUNC 1 +#else +#define ENVFUNC 0 +#endif + +#if AUX +#define RETCHAR '\n' +#else +#define RETCHAR '\r' +#endif + +#if THEOS +#define _CTYPE_NO_MACRO 1 +#define RET_CHAR '\n' +#else +#define RET_CHAR '\r' +#endif + +#if MPE +#define DIRSEPSTR "." +#define DIRSEPCHAR '.' +#else +#if TOS || MSDOS || WINNT || WINXP || OS2 +#define DIRSEPSTR "\\" +#define DIRSEPCHAR '\\' +#define DRIVESEPCHAR ':' +#else +#define DIRSEPSTR "/" +#define DIRSEPCHAR '/' +#define DRIVESEPCHAR '\0' +#endif +#endif + +#if VARARG +#if (GCC == 0) && (USG || AIX || AUX || BSD || FREEBSD || SUN || XENIX || HPUX8 || HPUX9 || AVIION || MPE) +#define VARG 1 +#define SARG 0 +#include +#else +#define VARG 0 +#define SARG 1 +#include +#endif +#endif + +#if ZTC +#include +#define movmem(a, b, c) memcpy(b, a, c) +#endif + +/* Emacs global flag bit definitions (for gflags) */ + +#define GFREAD 1 /* read first file in at startup */ +#define GFSDRAW 2 /* suppress a screen redraw */ +#define GFEXIT 4 /* exit from emacs pending */ + +/* internal constants */ + +#define NBINDS 300 /* max # of bound keys */ +#if AOSVS | VMS | WINNT | WINXP | SUN | BSD | FREEBSD | USG | ZENIX | HPUX8 | HPUX9 | OS2 +#define NFILEN 256 +#else +#define NFILEN 80 /* # of bytes, file name */ +#endif +#define NBUFN 128 /* # of bytes, buffer name */ +#define NLINE 512 /* # of bytes, input line */ +#define NSTRING 512 /* # of bytes, string buffers */ +#define NKBDM 4096 /* # of strokes, keyboard macro */ +#define NPAT 512 /* # of bytes, pattern */ +#define HUGENUM 1000 /* Huge number */ +#define NLOCKS 256 /* max # of file locks active */ +#define NCOLORS 16 /* number of supported colors */ +#define KBLOCK 250 /* sizeof kill buffer chunks */ +#define NRING 16 /* # of buffers in kill ring */ +#define NBLOCK 16 /* line block chunk size */ +#define NVSIZE 16 /* max #chars in a var name */ +#define NMARKS 16 /* number of marks */ +#define MAXSYM 32 /* max # chars in symbol to expand */ +#define MINFLEN 3 /* min # chars to match &func */ + +#if UTF8 +#define CTRL 0x01000000 /* Control flag, or'ed in */ +#define META 0x02000000 /* Meta flag, or'ed in */ +#define CTLX 0x04000000 /* ^X flag, or'ed in */ +#define SPEC 0x08000000 /* special key (function keys) */ +#define MOUS 0x10000000 /* alternative input device (mouse) */ +#define SHFT 0x20000000 /* shifted (for function keys) */ +#define ALTD 0x40000000 /* ALT key... */ +#define MENU MOUS+SPEC /* menu selection (WINDOW_MSWIN) */ +#define CMSK 0x00FFFFFF /* Character mask */ +#define SHIFTPFX 24 /* prefix shift in unsigned int */ +#else +#define CTRL 0x0100 /* Control flag, or'ed in */ +#define META 0x0200 /* Meta flag, or'ed in */ +#define CTLX 0x0400 /* ^X flag, or'ed in */ +#define SPEC 0x0800 /* special key (function keys) */ +#define MOUS 0x1000 /* alternative input device (mouse) */ +#define SHFT 0x2000 /* shifted (for function keys) */ +#define ALTD 0x4000 /* ALT key... */ +#define MENU MOUS+SPEC /* menu selection (WINDOW_MSWIN) */ +#define CMSK 0x00FF /* Character mask */ +#define SHIFTPFX 8 /* prefix shift in unsigned int */ +#endif + +#define BINDNUL 0 /* not bound to anything */ +#define BINDFNC 1 /* key bound to a function */ +#define BINDBUF 2 /* key bound to a buffer */ + +#ifdef FALSE +#undef FALSE +#endif +#ifdef TRUE +#undef TRUE +#endif + +#define FALSE 0 /* False, no, bad, etc. */ +#define TRUE 1 /* True, yes, good, etc. */ +#define ABORT 2 /* Death, ^G, abort, etc. */ +#define FAILD 3 /* not-quite fatal false return */ + +#define STOP 0 /* keyboard macro not in use */ +#define PLAY 1 /* playing */ +#define RECORD 2 /* recording */ + +/* Completion types */ + +#define CMP_BUFFER 0 +#define CMP_COMMAND 1 +#define CMP_FILENAME 2 + +/* Directive definitions */ + +#define DIF 0 +#define DELSE 1 +#define DENDIF 2 +#define DGOTO 3 +#define DRETURN 4 +#define DENDM 5 +#define DWHILE 6 +#define DENDWHILE 7 +#define DBREAK 8 +#define DFORCE 9 + +#define NUMDIRS 10 + +/* + * PTBEG, PTEND, FORWARD, and REVERSE are all toggle-able values for + * routines that need directions. + */ +#define PTBEG 0 /* Leave the point at the beginning on search */ +#define PTEND 1 /* Leave the point at the end on search */ +#define FORWARD 0 /* do things in a forward direction */ +#define REVERSE 1 /* do things in a backwards direction */ + +#define FIOSUC 0 /* File I/O, success. */ +#define FIOFNF 1 /* File I/O, file not found. */ +#define FIOEOF 2 /* File I/O, end of file. */ +#define FIOERR 3 /* File I/O, error. */ +#define FIOMEM 4 /* File I/O, out of memory */ +#define FIOFUN 5 /* File I/O, eod of file/bad line*/ +#define FIODEL 6 /* Can't delete/rename file */ + +#if WINDOW_MSWIN +/* values for the fbusy flag */ +#define FREADING 1 /* file read in progress */ +#define FWRITING 2 /* file write in progress */ +/* if no file activity, the value FALSE is used */ +#endif + +#define CFCPCN 0x0001 /* Last command was C-P, C-N */ +#define CFKILL 0x0002 /* Last command was a kill */ +#define CFSRCH 0x0004 /* last command was a search */ +#define CFYANK 0x0008 /* last command was a yank */ + +#define SRNORM 0 /* end past, begin front */ +#define SRBEGIN 1 /* always at front */ +#define SREND 2 /* always one past end */ + +#define BELL 0x07 /* a bell character */ +#define TAB 0x09 /* a tab character */ + +#if USG | AIX | AUX | SMOS | HPUX8 | HPUX9 | BSD | FREEBSD | SUN | XENIX | AVIION +#define PATHCHR ':' +#else +#if WMCS || MPE +#define PATHCHR ',' +#else +#define PATHCHR ';' +#endif +#endif + +#define INTWIDTH sizeof(int) * 3 +#define LONGWIDTH sizeof(long) * 3 + +/* Macro argument token types */ + +#define TKNUL 0 /* end-of-string */ +#define TKARG 1 /* interactive argument */ +#define TKBUF 2 /* buffer argument */ +#define TKVAR 3 /* user variables */ +#define TKENV 4 /* environment variables */ +#define TKFUN 5 /* function.... */ +#define TKDIR 6 /* directive */ +#define TKLBL 7 /* line label */ +#define TKLIT 8 /* numeric literal */ +#define TKSTR 9 /* quoted string literal */ +#define TKCMD 10 /* command name */ + +/* Internal defined functions */ + +#define nextab(a) (a - (a % tabsize)) + tabsize + +/* DIFCASE represents the integer difference between upper + and lower case letters. It is an xor-able value, which is + fortunate, since the relative positions of upper to lower + case letters is the opposite of ascii in ebcdic. +*/ + +#if ASCII +#define DIFCASE 0x20 +#else +#define DIFCASE 0x40 +#endif + +/* Dynamic RAM tracking and reporting redefinitions */ + +#if RAMSIZE +#define malloc Eallocate +#define free Erelease +#else +#if VMS & OPTMEM +#define malloc VAXC$MALLOC_OPT +#define free VAXC$FREE_OPT +#define calloc VAXC$CALLOC_OPT +#define realloc VAXC$REALLOC_OPT +#define cfree VAXC$CFREE_OPT +#endif +#endif + +/* under MS Windows, we use dialog boxes to prompt the user for filenames */ +#if WINDOW_MSWIN +#define FILENAMEREPLY(p,b,nb) filenamedlg(p,b,nb,TRUE) +#else +#define FILENAMEREPLY(p,b,nb) mlreply(p,b,nb) +#endif + +/* colors respresented as parameters to WORDs and Screen positions */ + +#define CLRVAL unsigned int + +/* formal parameters to procedures are stored as a linked list + of argument names using the following simple structure: +*/ + +typedef struct PARG { + struct PARG *next; /* ptr to next linked argument */ + char name[NVSIZE+1]; /* name of the argument */ +} PARG; + +/* UNDO definitions and types */ + +typedef int OPTYPE; /* type of operation being recorded/played back */ + +#define OP_CMND 1 /* beginning of command */ +#define OP_DELC 2 /* delete a single character */ +#define OP_INSC 3 /* insert a single character */ +#define OP_DSTR 4 /* delete a string of characters */ +#define OP_ISTR 5 /* insert a string of characters */ +#define OP_REPC 6 /* replace a character */ +#define OP_CPOS 7 /* set the cursor position */ + +/* object to be undone! */ + +typedef union OBJECT { + char obj_char; /* a character */ + char obj_string[1]; /* many characters */ + char *obj_sptr; /* a ptr to a character */ +} OBJECT; + +typedef struct UNDO_OBJ { + struct UNDO_OBJ *next; /* ptr to next undo object */ + OPTYPE type; /* type of operation */ + long line_num; /* line offset from buffer beginning */ + int offset; /* offset into that line */ + long count; /* repetitions? */ + OBJECT undo_obj; /* object to be undone */ +} UNDO_OBJ; + +/* + * There is a window structure allocated for every active display window. The + * windows are kept in a big list, in top to bottom screen order, with the + * listhead at "wheadp". Each window contains its own values of dot and mark. + * The flag field contains some bits that are set by commands to guide + * redisplay. Although this is a bit of a compromise in terms of decoupling, + * the full blown redisplay is just too expensive to run for every input + * character. + */ +typedef struct EWINDOW { + struct EWINDOW *w_wndp; /* Next window */ + struct BUFFER *w_bufp; /* Buffer displayed in window */ + struct LINE *w_linep; /* Top line in the window */ + struct LINE *w_dotp; /* Line containing "." */ + short w_doto; /* Byte offset for "." */ + struct LINE *w_markp[NMARKS]; /* Line containing "mark" */ + short w_marko[NMARKS]; /* Byte offset for "mark" */ + char w_toprow; /* Origin 0 top row of window */ + char w_ntrows; /* # of rows of text in window */ + char w_force; /* If NZ, forcing row. */ + char w_flag; /* Flags. */ +#if COLOR + char w_fcolor; /* current forground color */ + char w_bcolor; /* current background color */ +#endif + int w_fcol; /* first column displayed */ +} EWINDOW; + +#define WFFORCE 0x01 /* Window needs forced reframe */ +#define WFMOVE 0x02 /* Movement from line to line */ +#define WFEDIT 0x04 /* Editing within a line */ +#define WFHARD 0x08 /* Better to a full display */ +#define WFMODE 0x10 /* Update mode line. */ +#define WFCOLR 0x20 /* Needs a color change */ + +/* This structure holds the information about each line appearing on the + * video display. The redisplay module uses an array of virtual display + * lines. On systems that do not have direct access to display memory, + * there is also an array of physical display lines used to minimize + * video updating. In most cases, these two arrays are unique. If + * WINDOW_MSWIN is 1, there is a pair of such arrays in each ESCREEN + * structure. + */ + +typedef struct VIDEO { + int v_flag; /* Flags */ +#if COLOR + int v_fcolor; /* current forground color */ + int v_bcolor; /* current background color */ + int v_rfcolor; /* requested forground color */ + int v_rbcolor; /* requested background color */ +#endif + int v_left; /* left edge of reverse video */ + int v_right; /* right right of reverse video */ +#if INSDEL && MEMMAP == 0 + int v_rline; /* requested screen line # */ +#endif +#if UTF8 + unsigned int v_text[1]; /* Screen data. */ +#else + char v_text[1]; /* Screen data. */ +#endif +} VIDEO; + +#define VFNEW 0x0001 /* contents not meaningful yet */ +#define VFCHG 0x0002 /* Changed flag */ +#define VFEXT 0x0004 /* extended (beyond column 80) */ +#define VFREV 0x0008 /* reverse video status */ +#define VFREQ 0x0010 /* reverse video request */ +#define VFCOL 0x0020 /* color change requested */ + +/* + * This structure holds the information about each separate "screen" + * within the current editing session. On a character based system, these + * screens overlay each other, and can individually be brought to front. + * On a windowing system like MicroSoft Windows 3.0, OS/2, the Macintosh, + * Intuition, Sunview or X-windows, each screen is represented in an OS + * window. The terminolgy is wrong in emacs..... + * + * EMACS The outside World + * screen window + * window pane + */ + +typedef struct ESCREEN { + struct ESCREEN *s_next_screen; /* link to next screen in list */ + EWINDOW *s_first_window; /* head of linked list of windows */ + EWINDOW *s_cur_window; /* current window in this screen */ + char *s_screen_name; /* name of the current window */ + short s_roworg; /* row origin of stored screen */ + short s_colorg; /* column origin of stored screen */ + short s_nrow; /* row width of stored screen */ + short s_ncol; /* column origin of stored screen */ +#if WINDOW_MSWIN + VIDEO **s_virtual; /* virtual screen contents */ + VIDEO **s_physical; /* physical screen contents */ + HWND s_drvhandle; /* handle for the "term" driver */ +#endif +} ESCREEN; + +/* + * Text is kept in buffers. A buffer header, described below, exists for every + * buffer in the system. The buffers are kept in a big list, so that commands + * that search for a buffer by name can find the buffer header. There is a + * safe store for the dot and mark in the header, but this is only valid if + * the buffer is not being displayed (that is, if "b_nwnd" is 0). The text for + * the buffer is kept in a circularly linked list of lines, with a pointer to + * the header line in "b_linep". Buffers may be "Inactive" which means the + * files associated with them have not been read in yet. These get read in + * at "use buffer" time. + * Some buffers are really procedures and have a little extra information + * stored with them. + */ +typedef struct BUFFER { + struct BUFFER *b_bufp; /* Link to next BUFFER */ + struct LINE *b_dotp; /* Link to "." LINE structure */ + short b_doto; /* Offset of "." in above LINE */ + struct LINE *b_markp[NMARKS]; /* The same as the above two, */ + short b_marko[NMARKS]; /* but for the "mark" */ + int b_fcol; /* first column to display */ + struct LINE *b_linep; /* Link to the header LINE */ + struct LINE *b_topline; /* Link to narrowed top text */ + struct LINE *b_botline; /* Link to narrowed bottom text */ + char b_active; /* window activated flag */ + char b_nwnd; /* Count of windows on buffer */ + char b_exec; /* how many active executions */ + char b_flag; /* Flags */ + int b_mode; /* editor mode of this buffer */ + char b_fname[NFILEN]; /* File name */ + char b_bname[NBUFN]; /* Buffer name */ +#if CRYPT + char b_key[NPAT]; /* current encrypted key */ +#endif + int b_numargs; /* number of arguments to procedure */ + PARG *b_args; /* ptr to the first argument */ + UNDO_OBJ *undo_head; /* head of undo stack for buffer */ + long undo_count; /* # of undo operations stacked */ + long last_access; /* time of last access */ +#if UTF8 + short b_charset; /* character set */ +#endif +} BUFFER; + +#define BFINVS 0x01 /* Internal invisible buffer */ +#define BFCHG 0x02 /* Changed since last write */ +#define BFTRUNC 0x04 /* buffer was truncated when read */ +#define BFNAROW 0x08 /* buffer has been narrowed */ +#if LIBHELP +#define BFERROR 0x40 /* Error file buffer */ +#define BFHELP 0x80 /* Buffer is a help buffer */ +#endif + +#define NOTPROC -1 /* buffer is not a procedure */ + +/* mode flags */ +#if THEOX +#define NUMMODES 15 /* # of defined modes */ +#elif JMDEXT +#define NUMMODES 14 /* # of defined modes */ +#else +#define NUMMODES 11 /* # of defined modes */ +#endif + +#define MDWRAP 0x0001 /* word wrap */ +#define MDCMOD 0x0002 /* C indentation and fence match*/ +#define MDSPELL 0x0004 /* spell error parsing */ +#define MDEXACT 0x0008 /* Exact matching for searches */ +#define MDVIEW 0x0010 /* read-only buffer */ +#define MDOVER 0x0020 /* overwrite mode */ +#define MDMAGIC 0x0040 /* regular expressions in search */ +#define MDCRYPT 0x0080 /* encryption mode active */ +#define MDASAVE 0x0100 /* auto-save mode */ +#define MDREPL 0x0200 /* replace mode */ +#define MDABBR 0x0400 /* abbreviation expansion mode */ +#if JMDEXT +#define MDNOBAK 0x0800 /* no auto backup */ +#define MDSLINE 0x1000 /* single line graphics */ +#define MDDLINE 0x2000 /* double line graphics */ +#if THEOX +#define MDTHEOX 0x4000 /* TheoX character set file */ +#endif +#endif + +/* + * The starting position of a region, and the size of the region in + * characters, is kept in a region structure. Used by the region commands. + */ +typedef struct { + struct LINE *r_linep; /* Origin LINE address. */ + short r_offset; /* Origin LINE offset. */ + long r_size; /* Length in characters. */ +} REGION; + +/* + * All text is kept in circularly linked lists of "LINE" structures. These + * begin at the header line (which is the blank line beyond the end of the + * buffer). This line is pointed to by the "BUFFER". Each line contains a the + * number of bytes in the line (the "used" size), the size of the text array, + * and the text. The end of line is not stored as a byte; it's implied. + */ +typedef struct LINE { + struct LINE *l_fp; /* Link to the next line */ + struct LINE *l_bp; /* Link to the previous line */ + short l_size; /* Allocated size */ + short l_used; /* Used size */ + char l_text[1]; /* A bunch of characters. */ +} LINE; + +#define lforw(lp) ((lp)->l_fp) +#define lback(lp) ((lp)->l_bp) +#if UNIX && (SUN || HPUX8 || HPUX9 || BSD || FREEBSD) +#define lgetc(lp, n) ((unsigned char)(lp)->l_text[(n)]) +#else +#define lgetc(lp, n) ((lp)->l_text[(n)]) +#endif +#define lputc(lp, n, c) ((lp)->l_text[(n)]=(c)) +#define lused(lp) ((lp)->l_used) +#define lsize(lp) ((lp)->l_size) +#define ltext(lp) ((lp)->l_text) + +/* This structure is used to hold a user variables name and its + current value. These are used for both the global and the + local symbol tables. +*/ + +typedef struct UVAR { + char u_name[NVSIZE + 1]; /* name of user variable */ + char *u_value; /* value (string) */ +} UVAR; + +#define VT_NONE 0 /* don't declare it if not found */ +#define VT_LOCAL 1 /* local to the current procedure */ +#define VT_GLOBAL 2 /* global to all procedures */ + +/* A UTABLE is a user variable table.... containing some header + information and an array of user variable names and definitions. + They are held together in a linked list, the last member of + the list being the global user variable table. +*/ + +typedef struct UTABLE { + struct UTABLE *next; /* ptr to next user variable table */ + int size; /* max number of variables in table */ + BUFFER *bufp; /* ptr to buffer holding procedure + assosiated with this symbol table. */ + UVAR uv[1]; /* list of variable names/definitions + in this variable table */ +} UTABLE; + +/* + * The editor communicates with the display using a high level interface. A + * "TERM" structure holds useful variables, and indirect pointers to routines + * that do useful operations. The low level get and put routines are here too. + * This lets a terminal, in addition to having non standard commands, have + * funny get and put character code too. The calls might get changed to + * "termp->t_field" style in the future, to make it possible to run more than + * one terminal type. + */ +#if PROTO +typedef struct { + short t_mrow; /* max number of rows allowable */ + short t_nrow; /* current number of rows used */ + short t_mcol; /* max Number of columns. */ + short t_ncol; /* current Number of columns. */ + short t_roworg; /* origin row (normally zero) */ + short t_colorg; /* origin column (normally zero)*/ + short t_margin; /* min margin for extended lines*/ + short t_scrsiz; /* size of scroll region " */ + int t_pause; /* # times thru update to pause */ + int (*t_open)(void); /* Open terminal at the start.*/ + int (*t_close)(void); /* Close terminal at end. */ + int (*t_kopen)(void); /* Open keyboard */ + int (*t_kclose)(void); /* Close keyboard */ + int (*t_getchar)(void); /* Get character from keyboard. */ + int (*t_putchar)(int); /* Put character to display. */ + int (*t_flush)(void); /* Flush output buffers. */ + int (*t_move)(int, int);/* Move the cursor, origin 0. */ + int (*t_eeol)(void); /* Erase to end of line. */ + int (*t_eeop)(void); /* Erase to end of page. */ + int (*t_clrdesk)(void); /* Clear the page totally */ + int (*t_beep)(void); /* Beep. */ + int (*t_rev)(int); /* set reverse video state */ + int (*t_rez)(char *); /* change screen resolution */ +#if COLOR + int (*t_setfor)(int); /* set foreground color */ + int (*t_setback)(int); /* set background color */ +#endif +#if INSDEL + int (*t_insline)(int); /* insert a screen line */ + int (*t_delline)(int); /* delete a screen line */ +#endif +#if WINDOW_MSWIN + int (*t_sleep)(int); /* go to sleep for a while */ + int (*t_newscr)(ESCREEN *); /* create new screen display */ + int (*t_delscr)(ESCREEN *); /* destroy screen display */ + int (*t_selscr)(ESCREEN *); /* select screen display */ + int (*t_sizscr)(ESCREEN *); /* resize screen display */ + int (*t_topscr)(ESCREEN *); /* bring screen to top */ +#endif +} TERM; +#else /* TERM structure, no prototyping.*/ + +typedef struct { + short t_mrow; /* max number of rows allowable */ + short t_nrow; /* current number of rows used */ + short t_mcol; /* max Number of columns. */ + short t_ncol; /* current Number of columns. */ + short t_roworg; /* origin row (normally zero) */ + short t_colorg; /* origin column (normally zero)*/ + short t_margin; /* min margin for extended lines*/ + short t_scrsiz; /* size of scroll region " */ + int t_pause; /* # times thru update to pause */ + int (*t_open)(); /* Open terminal at the start. */ + int (*t_close)(); /* Close terminal at end. */ + int (*t_kopen)(); /* Open keyboard */ + int (*t_kclose)(); /* close keyboard */ + int (*t_getchar)(); /* Get character from keyboard. */ + int (*t_putchar)(); /* Put character to display. */ + int (*t_flush)(); /* Flush output buffers. */ + int (*t_move)(); /* Move the cursor, origin 0. */ + int (*t_eeol)(); /* Erase to end of line. */ + int (*t_eeop)(); /* Erase to end of page. */ + int (*t_clrdesk)(); /* Clear the page totally */ + int (*t_beep)(); /* Beep. */ + int (*t_rev)(); /* set reverse video state */ + int (*t_rez)(); /* change screen resolution */ +#if COLOR + int (*t_setfor)(); /* set forground color */ + int (*t_setback)(); /* set background color */ +#endif +#if INSDEL + int (*t_insline)(); /* insert a screen line */ + int (*t_delline)(); /* delete a screen line */ +#endif +#if WINDOW_MSWIN + int (*t_sleep)(); /* go to sleep for a while */ + int (*t_newscr)(); /* create new screen display */ + int (*t_delscr)(); /* destroy screen display */ + int (*t_selscr)(); /* select screen display */ + int (*t_sizscr)(); /* resize screen display */ + int (*t_topscr)(); /* bring screen to top */ +#endif +} TERM; +#endif + + +/* TEMPORARY macros for terminal I/O (to be placed in a machine + dependent place later) */ + +#define TTopen (*term.t_open) +#define TTclose (*term.t_close) +#define TTkopen (*term.t_kopen) +#define TTkclose (*term.t_kclose) +#define TTgetc (*term.t_getchar) +#define TTputc (*term.t_putchar) +#define TTflush (*term.t_flush) +#define TTmove (*term.t_move) +#define TTeeol (*term.t_eeol) +#define TTeeop (*term.t_eeop) +#define TTclrdesk (*term.t_clrdesk) +#define TTbeep (*term.t_beep) +#define TTrev (*term.t_rev) +#define TTrez (*term.t_rez) +#if COLOR +#define TTforg (*term.t_setfor) +#define TTbacg (*term.t_setback) +#endif + +/* Structure for the table of current key bindings */ + +ETYPE EPOINTER { + int (*fp)(); /* C routine to invoke */ + BUFFER *buf; /* buffer to execute */ +}; + +typedef struct { +#if UTF8 + unsigned int k_code; /* Key code */ +#else + short k_code; /* Key code */ +#endif + short k_type; /* binding type (C function or EMACS buffer) */ + ETYPE EPOINTER k_ptr; /* ptr to thing to execute */ +} KEYTAB; + +/* structure for the name binding table */ + +typedef struct { + char *n_name; /* name of function key */ + int (*n_func)(); /* function name is bound to */ +} NBIND; + +/* The editor holds deleted text chunks in the KILL buffer. The + kill buffer is logically a stream of ascii characters, however + due to its unpredicatable size, it gets implemented as a linked + list of chunks. (The d_ prefix is for "deleted" text, as k_ + was taken up by the keycode structure) +*/ + +typedef struct KILL { + struct KILL *d_next; /* link to next chunk, NULL if last */ + char d_chunk[KBLOCK]; /* deleted text */ +} KILL; + +/* When emacs's command interpetor needs to get a variable's name, + rather than it's value, it is passed back as a VDESC variable + description structure. The v_num field is a index into the + appropriate variable table. +*/ + +typedef struct VDESC { + int v_type; /* type of variable */ + int v_num; /* ordinal pointer to variable in list */ + UTABLE *v_ut; /* ptr to appropriate user table if user var */ +} VDESC; + +/* The !WHILE directive in the execution language needs to + stack references to pending whiles. These are stored linked + to each currently open procedure via a linked list of + the following structure +*/ + +typedef struct WHBLOCK { + LINE *w_begin; /* ptr to !while statement */ + LINE *w_end; /* ptr to the !endwhile statement*/ + int w_type; /* block type */ + struct WHBLOCK *w_next; /* next while */ +} WHBLOCK; + +#define BTWHILE 1 +#define BTBREAK 2 + +/* SWORDs are syntactical words to highlight in a different + foreground color. WORDSETs are named lists of these WORDs. +*/ + +typedef struct SWORD { + struct SWORD *wd_next; /* ptr to the next word in the list */ + char *wd_text; /* the actual word */ + CLRVAL wd_color; /* color to display in */ + int wd_symflag; /* TRUE = symbol overiding word boundries + FALSE = word w/ space/symbol delimiters */ +} SWORD; + +typedef struct WORDSET { + struct WORDSET *next; + int tmp; +} WORDSET; + +/* Abbreviations are short symbols that expand to longer strings + when typed into a buffer with no intervening whitespace or commands. + This structure grows dynamically as needed. +*/ + +typedef struct ABBREV { + struct ABBREV *ab_next; /* pointer to the next abbreviation */ + char ab_sym[MAXSYM + 1]; /* name to expand */ + char ab_exp[1]; /* string to expand to */ +} ABBREV; + +/* Search definitions... */ + +/* HICHAR - 1 is the largest character we will deal with. + * BMAPSIZE represents the number of bytes in the bitmap. + */ +#if UTF8 +#define HICHAR 65536 +#else +#define HICHAR 256 +#endif +#define BMAPSIZE HICHAR >> 3 + +/* + * Jump table structures. + */ +typedef struct { + int jump; + int patlen; + int delta[HICHAR]; + char patrn[NPAT]; +} DELTA; + +#if MAGIC +/* + * Defines for the metacharacters in the regular expression + * search routines. MCNIL and GROUP are used in both search + * and replace metachar-arrays. + */ +#define MCNIL 0 /* Like the '\0' for strings.*/ +#define JMPTABLE 1 +#define LITSTRING 2 /* Literal string.*/ +#define LITCHAR 3 /* Literal character.*/ +#define ANY 4 /* Any character but the .*/ +#define CCL 5 +#define NCCL 6 +#define BOL 7 +#define EOL 8 +#define BOWRD 9 +#define EOWRD 10 +#define GRPBEG 11 /* Signal start of group.*/ +#define GRPEND 12 /* Signal end of group.*/ +#define GROUP 13 /* String of group match.*/ +#define DITTO 14 /* Replacement with match string.*/ + +#define CLOSURE 0x0100 /* An or-able value for a closure modifier.*/ +#define CLOSURE_1 0x0200 /* An or-able value for a closure modifier.*/ +#define ZEROONE 0x0400 /* An or-able value for a closure modifier.*/ + +#define ALLCLOS (CLOSURE | CLOSURE_1 | ZEROONE) +#define MASKCLO (~ALLCLOS) + +#define MC_ANY '.' /* 'Any' character (except newline).*/ +#define MC_CCL '[' /* Character class.*/ +#define MC_NCCL '^' /* Negate character class.*/ +#define MC_RCCL '-' /* Range in character class.*/ +#define MC_ECCL ']' /* End of character class.*/ +#define MC_BOL '^' /* Beginning of line.*/ +#define MC_EOL '$' /* End of line.*/ +#define MC_CLOSURE '*' /* Closure - zero to many characters match.*/ +#define MC_CLOSURE_1 '+' /* Closure - one to many characters match.*/ +#define MC_ZEROONE '?' /* Closure - zero to one characters match.*/ +#define MC_DITTO '&' /* Use matched string in replacement.*/ +#define MC_GRPBEG '(' /* Start of group (begun with a backslash).*/ +#define MC_GRPEND ')' /* End of group (begun with a backslash).*/ +#define MC_BOWRD '<' /* Beginning of word (begun with a backslash).*/ +#define MC_EOWRD '>' /* End of word (begun with a backslash).*/ +#define MC_ESC '\\' /* Escape - suppress meta-meaning.*/ + +#define MAXGROUPS 10 /* 1 + maximum # of r. e. groups. */ +#define BIT(n) (1 << (n)) /* An integer with one bit set.*/ + +/* Typedefs that define the bitmap type for searching (EBITMAP), + * the meta-character structure for MAGIC mode searching (MC), + * and the meta-character structure for MAGIC mode replacment (RMC). + */ +typedef char *EBITMAP; + +typedef struct { + short int mc_type; + union { + int lchar; + int group_no; + char *lstring; + DELTA *jmptable; + EBITMAP cclmap; + } u; +} MC; + +typedef struct { + short int mc_type; + union { + int group_no; + char *rstr; + } u; +} RMC; +#endif + +/* + This is the message which should be added to any "About MicroEMACS" + boxes on any of the machines with window managers. + + + ------------------------------------------ + | | + | MicroEMACS v4.xx | + | for the ............ | + | | + | Text Editor and Corrector | + | | + | written by Daniel M. Lawrence | + | [based on code by Dave Conroy] | + | | + | Send inquiries and donations to: | + | 617 New York St | + | Lafayette, IN 47901 | + | | + ------------------------------------------ +*/ diff --git a/cygwin/mepipe b/cygwin/mepipe new file mode 100644 index 0000000..d514d8b --- /dev/null +++ b/cygwin/mepipe @@ -0,0 +1,4 @@ +# to allow non interactive command to be piped and return exit code 0 +#!/bin/bash +$* +exit 0 \ No newline at end of file diff --git a/cygwin/merun b/cygwin/merun new file mode 100644 index 0000000..be679bc --- /dev/null +++ b/cygwin/merun @@ -0,0 +1,7 @@ +# to allow non interactive command to run, pause and return exit code 0 +#!/bin/bash +clear +$* +echo "[End]" +read -n 1 +exit 0 \ No newline at end of file diff --git a/theos/_locate_.c b/theos/_locate_.c new file mode 100644 index 0000000..1b50b70 --- /dev/null +++ b/theos/_locate_.c @@ -0,0 +1,54 @@ +#include "estruct.h" + +#if THEOS + +#include +#include +#include +#include + +/* locate fails when stating a file in root dir from a directory with a + * relative path. Workaround by setting directory to root dir + * getting the file directory block, then restoring the current directory. + */ + +struct fdb* _locate_(const char* fn, char* buf, short* drv) +{ + struct fdb* fdb; + char buf2[256]; + char cwd[256]; + char* p; + char* q; + + /* return if file found */ + if (fdb = _locate(fn, buf, drv)) + return fdb; + + /* if file name does not contain a path delimiter it really does not exist. + */ + strcpy(buf2, fn); + + if ((p = strrchr(buf2, '/')) == NULL) + return NULL; + + /* get drive name from file path */ + q = strrchr(buf2, ':'); + + /* cat drive name if any to directory path */ + if (q) + strcat(buf2, q); + else + *p = '\0'; + /* save current directory */ + getcwd(cwd, 256); + /* chdir to directory path */ + chdir(buf2); + /* get File Directory Block */ + p = strrchr(fn, '/'); + fdb = _locate(p + 1, buf, drv); + /* restore current directory */ + chdir(cwd); + return fdb; +} + +#endif diff --git a/theos/_setargv.c b/theos/_setargv.c new file mode 100644 index 0000000..e90ba15 --- /dev/null +++ b/theos/_setargv.c @@ -0,0 +1,145 @@ +/* + * __setargv.c - command argument expander + * + * Author : Jean-Michel Dubois + * Date : 09/26/92 + * + * Function: Expands the command line arguments by replacing any filename + * including wilcards by the sorted list of matching files name. + * Strings beginning by a dash are considered as options and left + * unchanged. + * + * Syntax : void _setargv(int *argc, char ***argv); + * + * Returns : new argc. Caller's argc and argv are updated. + * If a insufficient memory condition occurs, return 0 and errno + * is set to ENOMEM. + * + * Example : + * main(int argc, char **argv) + * { + * if (_setargv(&argc, &argv)) { + * ... + */ +#pragma library + +#include +#include +#include +#include +#include +#include +#include + +/* Allocate argv array in 16 entries chunks */ + +static int allocarg(int n, int l, char ***nargv, char *s) +{ + if ((n+1) > l) { /* If array full */ + l += 16; /* increase size and reallocate */ + if (!(*nargv = (char **) realloc(*nargv,l * sizeof (void *)))) { + errno = _errnum = ENOMEM; /* Not enough memory */ + return 0; + } + } + (*nargv)[n] = strdup(s); /* Save argument */ + return l; /* Return new maxsize */ +} + +/* Comparison function for qsort */ + +static int sortcmp(char **p, char **q) +{ + return stricmp(*p,*q); +} + +/* Main body of the function */ + +int _setargv(int *argc, char ***argv) +{ + register int nargc; /* New arguments counter */ + char **nargv; /* New arguments pointers */ + register int i, l, base; + char *p, *q, *r; + char path[_MAX_DIR+_MAX_DRIVE]; + char deflib[_MAX_DIR+_MAX_DRIVE]; + char* namecpy; + _errnum = 0; + nargc = 0; /* Initialise counter, size counter */ + l = *argc; /* and new argument vector to the */ + /* current argv array size */ + + if (getenv("LIBRARY")) { + strcat(strcpy(deflib, getenv("LIBRARY")), "."); + namecpy = strend(deflib); + } else + *deflib = '\0'; + + if ((nargv = (char **) calloc((size_t) *argc, sizeof (void *))) != NULL) { + /* For each initial argument */ + for (i = 0; i < *argc; i++) { + q = (*argv)[i]; + if (q[0] == '-' || ! testwild(q)) { + /* if it begins with a dash or doesnt include + * wildcard simply add it to the new array + */ + if (! (l = allocarg(nargc, l, &nargv, q))) + return 0; /* Not enough memory */ + nargc++; + } else { + /* else keep current counter for qsort */ + base = nargc; + /* use default library ? */ + if (strchr(q, '.') == NULL && *deflib != '\0') { + strcpy(namecpy, q); + diropen(deflib); + } else { + /* open directory with argument */ + diropen(q); + } + while ((r = dirread()) != NULL) { + /* reduce path to given one */ + if ((p = strrchr(q, '/')) != NULL) { + strncpy(path, q, p-q+1); + path[p-q+1] = '\0'; + } else + path[0] = '\0'; + + if ((p = strrchr(r, '/')) != NULL && *deflib == '\0') + strcat(path, p+1); + else + strcat(path, r); + + if (peekscr(&SCR->searchseq[1]) == 255 + && strchr(q, ':') == NULL) { + *strchr(path, ':') = '\0'; + } + /* and add each matching filename. */ + if (! (l = allocarg(nargc,l,&nargv,path))) + return 0;/* Not enough memory */ + nargc++; + } + if (nargc == base) { + /* if no match found include wild card name */ + if (! (l = allocarg(nargc, l, &nargv, q))) + return 0; /* Not enough memory */ + nargc++; + } else if ((nargc - base) > 1) + /* If more than one file name matchs */ + /* sort arguments. */ + qsort(&(nargv[base]),(size_t)nargc-base, + sizeof(void *),sortcmp); + dirclose(); + } + } + /* Update caller's parameters */ + *argc = nargc; + *argv = nargv; + /* and sign on success */ + return nargc; + } + + /* If it is not possible to allocate initial array, sign on error */ + _errnum = ENOMEM; + return 0; +} diff --git a/theos/estruct.h b/theos/estruct.h new file mode 100644 index 0000000..b67cedc --- /dev/null +++ b/theos/estruct.h @@ -0,0 +1,1312 @@ +/* ESTRUCT: Structure and preprocesser defined for + MicroEMACS 4.00 + + (C)Copyright 1995 by Daniel Lawrence + written by Daniel Lawrence + based on code by Dave G. Conroy, + Steve Wilhite and George Jones +*/ + +#ifdef LATTICE +#undef LATTICE /* don't use their definitions...use ours */ +#endif +#ifdef MSDOS +#undef MSDOS +#endif +#ifdef WINNT +#undef WINNT +#endif +#ifdef LINUX +#undef LINUX +#endif +#ifdef AMIGA +#undef AMIGA +#endif +#ifdef EGA +#undef EGA +#endif +#ifdef CTRLZ +#undef CTRLZ +#endif + +/* Program Identification..... + + PROGNAME should always be MicroEMACS for a distribution + unmodified version. People using MicroEMACS as a shell + for other products should change this to reflect their + product. Macros can query this via the $progname variable +*/ + +#define PROGNAME "MicroEMACS" +#define VERSION "4.04" + +/* Machine/OS definitions */ +/* [Set one of these!!] */ + +#define AMIGA 0 /* AmigaDOS */ +#define AOSVS 0 /* Data General AOS/VS */ +#define AUX 0 /* Apple UNIX for Macintosh */ +#define AIX 0 /* IBM UNIX for various machines*/ +#define AVIION 0 /* Data General AViiON */ +#define BSD 0 /* UNIX BSD 4.2 and ULTRIX */ +#define FINDER 0 /* Macintosh OS */ +#define FREEBSD 0 /* FREEBSD 386 version 2 or + */ +#define HPUX8 0 /* HPUX HP 9000 ver 8 or less */ +#define HPUX9 0 /* HPUX HP 9000 ver 9 */ +#define LINUX 0 /* Linux */ +#define MPE 0 /* HP MPE/XL */ +#define MSDOS 0 /* MS-DOS */ +#define WINNT 0 /* MS-Win NT */ +#define OS2 0 /* Microsoft or IBM OS/2 */ +#define SMOS 0 /* Supermax UNIX System V */ +#define SUN 0 /* SUN v4.0 */ +#define THEOS 1 /* THEOS */ +#define TOS 0 /* ST520, TOS */ +#define USG 0 /* UNIX system V */ +#define VMS 0 /* VAX/VMS */ +#define WMCS 0 /* Wicat's MCS */ +#define XENIX 0 /* IBM-PC SCO XENIX */ + +/* Compiler definitions */ +/* [Set one of these!!] */ +#define ALCYON 0 /* ALCYON Atari ST compiler */ +#define AZTEC 0 /* Aztec C 4.00e ONLY for the amiga now... */ +#define DGC 0 /* Data General AOS/VS C... */ +#define GCC 0 /* the GNU C compiler */ +#define IC 0 /* Rational Systems Instant C */ +#define LATTICE 0 /* Lattice 2.14 through 3.0 compilers */ +#define MSC 0 /* MicroSoft C compile version 3 thru 7 */ +#define MWC 0 /* Mark Williams C */ +#define THEOSC 1 /* Theos C */ +#define TURBO 0 /* Turbo C and Borland C++ under MSDOS */ +#define UNIX 0 /* a standard UNIX compiler (cc) */ +#define ZTC 0 /* Zortech C/C++ 1.02 thru 2.10 under MSDOS */ + +/* Machine stack growth direction. */ +/* [Set this to 1 if your machine stack grows UP!!!] */ +/* data general mv/eclipse series stack grows up. */ +/* dec vax series stack grows down... got it??? */ + +#define STACK_GROWS_UP 0 + +/* Debugging options */ +#define RAMSIZE 0 /* dynamic RAM memory usage tracking */ +#define RAMSHOW 0 /* auto dynamic RAM reporting */ +#define RAMTRCK 0 /* send debug info to MALLOC.DAT */ +#define DEBUG_SEARCH 0 /* pop some search info on patterns */ + +/* Special keyboard/network definitions */ + +#define ATKBD 0 /* AT-style keyboard with F11, F12 & grey keys */ +#define WANGPC 0 /* WangPC - mostly escape sequences */ +#define VT100 0 /* Handle VT100 style keypad - NOT VMS. */ +#define KEYPAD 0 /* VMS - turn on and off application */ + /* keypad automatically */ +#define XONDATA 0 /* VMS - set to force /NOTTSYNC/NOHOSTSY */ +#define RMSIO 0 /* VMS - skip the rotten C runtime and */ + /* use RMS directly */ +#define OPTMEM 0 /* VMS 5.0 and up - use a less standard */ + /* but more efficient memory allocator */ + +/* Terminal Output definitions */ +/* [Set one of these!!] */ + +#define ANSI 0 /* ANSI escape sequences */ +#define CRT 1 /* Theos Crt */ +#define DASHER 0 /* DG Dasher 2xx/4xx crts */ +#define DG10 0 /* Data General system/10 */ +#define FMR 0 /* Fujitsu FMR series driver */ +#define HP110 0 /* HP110 screen driver */ +#define HP150 0 /* HP150 screen driver */ +#define I55 0 /* IBM PS55 DOS J4.0/V */ +#define IBMPC 0 /* IBM-PC CGA/MONO/EGA/VGA drvr */ +#define MAC 0 /* Macintosh */ +#define NEC 0 /* NEC-9801VM driver */ +#define OS2NPM 0 /* OS/2 non-Presentation Mgr. */ +#define SMG 0 /* SMG library on VMS */ +#define ST52 0 /* Atari 520/1040ST screen */ +#define TERMCAP 0 /* Use TERMCAP */ +#define TIPC 0 /* TI Profesional PC driver */ +#define VT52 0 /* VT52 terminal (Zenith). */ +#define NTCON 0 /* Windows NT console */ +#define XVT 0 /* XVT windowing system */ +#define Z309 0 /* Zenith 100 PC family driver */ + +/* Windowing system style (pick one) */ + +#define WINDOW_TEXT 1 /* [default] Text mode */ +#define WINDOW_MSWIN 0 /* MicroSoft Windows */ +#define WINDOW_MSWIN32 0 /* MicroSoft Windows 32 bit API */ +#define WINDOW_X 0 /* X/Unix */ + +/* Language text options (pick one) */ + +#define ENGLISH 1 /* [default] */ +#define FRENCH 0 +#define SPANISH 0 +#define GERMAN 0 +#define DUTCH 0 +#define PLATIN 0 /* Pig Latin */ +#define JAPAN 0 +#define LATIN 0 /* real Latin */ + +/* Configuration options */ + +#define TYPEAH 1 /* type ahead causes update to be skipped */ +#define LOGFLG 0 /* send all executed commands to EMACS.LOG */ +#define VISMAC 0 /* update display during keyboard macros */ +#define CTRLZ 0 /* add a ^Z at end of files under MSDOS only */ +#define CLEAN 0 /* de-alloc memory on exit */ +#define CALLED 0 /* is emacs a called subroutine? or stand alone */ + +#define REVSTA 1 /* Status line appears in reverse video */ +#define COLOR 1 /* color commands and windows */ + +#define FILOCK 0 /* file locking under unix BSD 4.2 */ +#define ISRCH 1 /* Incremental searches like ITS EMACS */ +#define FLABEL 0 /* function key label code [HP150] */ +#define CRYPT 1 /* file encryption enabled? */ +#define MAGIC 1 /* include regular expression matching? */ +#define MOUSE 1 /* Include routines for mouse actions */ +#define NOISY 1 /* Use a fancy BELL if it exists */ +#define CTAGS 1 /* include vi-like tagging? */ +#define SPEECH 0 /* spoken EMACS, for the sight impared [not ready] */ +#define VARARG 1 /* use varargs.h for mlwrite() */ + +#if XVT +#undef COLOR +#define COLOR 1 /* overide this to be TRUE for XVT always */ +#endif + +#define JMDEXT 1 /* enable J-M Dubois' extensions */ + +#if JMDEXT +#define BACKUP 1 /* backup previous file version */ +#define LIBHELP 1 /* online help from Mark Williams version */ +#define NEWVARS 1 /* other environment variables */ +#define DYNMSGS 1 /* load messages according to current language */ +#endif + +/* Character set options */ +/* [Set one of these!!] */ +#define ASCII 1 /* always using ASCII char sequences for now */ +#define EBCDIC 0 /* later IBM mainfraim versions will use EBCDIC */ + +/* handle constant and voids properly */ + +#if VMS +#define CONST readonly +#define VOID void +#define NOSHARE noshare +#else +#if AOSVS +#define CONST $shared $align(1) /* fake a const */ +#define VOID +#define NOSHARE $low32k $align(1) /* attempt to optimize read/write vars. */ +#else + +#if __STDC__ || MSC || TURBO || GCC || (AMIGA && LATTICE) || USG +#define CONST const +#define VOID void +#define NOSHARE +#else +#define CONST +#if IC +#define VOID void +#else +#define VOID +#endif +#define NOSHARE +#endif + +#endif +#endif + +/* System dependant library redefinitions, structures and includes */ + +/* multibyte character support? */ + +#if NEC || FMR || I55 +#define DBCS 1 /* double byte character sets enabled */ +#define INSDEL 1 /* use insert/delete line display optimizations */ + +/* define DBCS prefix bytes */ +#define is2char(ch) (((ch&0xff) >= 0x81 && (ch&0xff) <= 0x9f) || ((ch&0xff) >=0xe0 && (ch&0xff) <= 0xfc)) + +#else +#define DBCS 0 +#define INSDEL 0 +#endif + +/* Can we catch the SIGWINCH (the window size change signal)? */ + +#if AIX || HPUX9 || LINUX +#define HANDLE_WINCH 1 +#else +#define HANDLE_WINCH 0 +#endif + +/* Prototypes in use? */ + +#if MSC || TURBO || IC || VMS || GCC || ZTC || THEOSC +#define PROTO 1 +#else +#define PROTO 0 +#endif + +/* the following define allows me to initialize unions... + otherwise we make them structures (like the keybinding table) */ + +#if (__STDC__ || MSC || TURBO || IC || ZTC) && ! THEOSC +#define ETYPE union +#else +#define ETYPE struct +#endif + +/* Instant C can't do stat()s. Arrrg. No file locking for you */ +#if IC && MSDOS +#undef FILOCK +#define FILOCK 0 +#endif + +/* Mark Williams/Atari has no standard or varargs or directory functions */ +#if TOS & MWC +#undef VARARG +#define VARARG 0 +#undef FILOCK +#define FILOCK 0 +#endif + +/* MS-Windows */ + +#if WINNT || WINDOW_MSWIN || WINDOW_MSWIN32 +#if WINDOW_MSWIN32 +#undef WINDOW_MSWIN +#define WINDOW_MSWIN 1 +#endif +#if WINDOW_MSWIN && WINNT +#undef WINDOW_MSWIN32 +#define WINDOW_MSWIN32 1 +#endif +#undef VOID /* windows.h will wind up defining this */ +#include /* --------- Huge include file here !!! ---------*/ +#if NTCON +#include +#include +#include +#endif + +#undef NEAR +#define NEAR +#define DNEAR +#if MSC || IC +#undef CDECL +#define CDECL __cdecl +#define DUMMYSZ 1 /* dummy size for unsized extern arrays to avoid + silly DGROUP fixup */ +#else +#if TURBO +#define DUMMYSZ /* nothing */ +#else +#define CDECL _cdecl /* ZTC */ +#define DUMMYSZ /* nothing */ +#endif +#endif + +#if WINNT +#define EXPORT /* Windows NT doesn't like this */ +#endif + +#if WINDOW_MSWIN +#undef TYPEAH +#define TYPEAH 0 /* typeahead is handled at the term driver level */ +#undef CALLED +#define CALLED 1 /* under MS Windows, "main" resides in the sys driver */ +#if MSC +#define EXPORT __export +#else +#define EXPORT _export /* Fine for TURBO and ZTC */ +#endif +#endif +#else + +/* neither Windows NT nor MS-Windows */ + +#define DUMMYSZ /* nothing */ + +#if MSDOS & (TURBO | MSC | TIPC) +#define NEAR +#define DNEAR +#define PASCAL pascal +#define CDECL cdecl +#else +#if MSDOS & ZTC +#define NEAR +#define DNEAR +#define PASCAL _pascal +#define CDECL _cdecl +#else +#define NEAR +#define DNEAR +#define PASCAL +#define CDECL +#endif +#endif + +#endif + +#if TURBO +#include +#include +#undef peek +#undef poke +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#endif + +#if IC +#include +#undef peek +#undef poke +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#endif + +#if LATTICE & MSDOS +/* you may have to remove this one definition with LATTICE version + 3.2 and above */ +#define unsigned +#endif + +#if IC +#define inp inportb +#define outp outportb +#define intdos(a, b) int86(33, a, b) +#endif + +#if AZTEC +#undef putc +#undef getc +#if MSDOS +#define getc a1getc +#define int86 sysint +#define intdos(a, b) sysint(33, a, b) +#define inp inportb +#define outp outportb +#else +#define getc agetc +#endif +#define putc aputc + +struct XREG { + unsigned ax,bx,cx,dx,si,di,ds,es; +}; + +struct HREG { + char al,ah,bl,bh,cl,ch,dl,dh,d1,d2,e1,e2; +}; + +union REGS { + struct XREG x; + struct HREG h; +}; + +struct SREGS { + unsigned cs, ss, ds, es; +}; +#endif + +#if MSDOS & MWC +#include +#define int86(a, b, c) intcall(b, c, a) +#define intdos(a, b) intcall(a, b, DOSINT) +#define inp(a) in(a) +#define outp(a, b) out(a, b) +#define movmem(a, b, c) memcpy(b, a, c) + +struct XREG { + unsigned int ax,bx,cx,dx,si,di,ds,es,flags; +}; + +struct HREG { + char al,ah,bl,bh,cl,ch,dl,dh; + unsigned int ds,es,flags; +}; + +union REGS { + struct XREG x; + struct HREG h; +}; +#endif + +#if MSDOS & MSC +#include +#include +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#define movmem(a, b, c) memcpy(b, a, c) +#define _strrev(a) strrev(a) +#endif + +#if MSDOS & LATTICE +#undef CPM +#undef LATTICE +#include +#undef CPM +#endif + +/* System V doesn't name this the same as others */ +#if USG | AIX | AUX | SUN | (OS2 & MSC) +#define movmem(a, b, c) memcpy(b, a, c) +#endif + +#if LINUX +#define movmem(a, b, c) memmove(b, a, c) +#endif + +/* this keeps VMS happy */ +#if VMS +#define getname xgetname +#define unlink(a) delete(a) +#endif + +/* some options for AOS/VS */ +#if AOSVS +#define ORMDNI 1 +#endif + +/* define some ability flags */ + +#if (IBMPC | Z309 | FMR | TIPC) & !(WINDOW_MSWIN | WINDOW_MSWIN32) +#define MEMMAP 1 +#else +#define MEMMAP 0 +#endif + +#if MSDOS | WINNT | OS2 | USG | LINUX | AIX | AUX | SMOS | HPUX8 | HPUX9 | BSD | FREEBSD | (TOS & MWC) | WMCS | SUN | MPE | THEOS +#define ENVFUNC 1 +#else +#define ENVFUNC 0 +#endif + +#if AUX || THEOS +#define RETCHAR '\n' +#else +#define RETCHAR '\r' +#endif + +#if THEOS +#define _CTYPE_NO_MACRO 1 +#define RET_CHAR '\n' +#else +#define RET_CHAR '\r' +#endif + +#if MPE +#define DIRSEPSTR "." +#define DIRSEPCHAR '.' +#else +#if TOS || MSDOS || WINNT || OS2 +#define DIRSEPSTR "\\" +#define DIRSEPCHAR '\\' +#define DRIVESEPCHAR ':' +#else +#define DIRSEPSTR "/" +#define DIRSEPCHAR '/' +#define DRIVESEPCHAR '\0' +#endif +#endif + +#if VARARG +#if (GCC == 0) && (USG || LINUX || AIX || AUX || BSD || FREEBSD || SUN || XENIX || HPUX8 || HPUX9 || AVIION || MPE) +#define VARG 1 +#define SARG 0 +#include +#else +#define VARG 0 +#define SARG 1 +#include +#endif +#endif + +#if ZTC +#include +#define movmem(a, b, c) memcpy(b, a, c) +#endif + +/* Emacs global flag bit definitions (for gflags) */ + +#define GFREAD 1 /* read first file in at startup */ +#define GFSDRAW 2 /* suppress a screen redraw */ +#define GFEXIT 4 /* exit from emacs pending */ + +/* internal constants */ + +#define NBINDS 300 /* max # of bound keys */ +#if AOSVS | VMS | WINNT | SUN | BSD | FREEBSD | USG | LINUX | ZENIX | HPUX8 | HPUX9 | OS2 | THEOS +#define NFILEN 256 +#else +#define NFILEN 80 /* # of bytes, file name */ +#endif +#define NBUFN 128 /* # of bytes, buffer name */ +#define NLINE 256 /* # of bytes, input line */ +#define NSTRING 128 /* # of bytes, string buffers */ +#define NKBDM 4096 /* # of strokes, keyboard macro */ +#define NPAT 128 /* # of bytes, pattern */ +#define HUGE 1000 /* Huge number */ +#define NLOCKS 256 /* max # of file locks active */ +#define NCOLORS 16 /* number of supported colors */ +#define KBLOCK 250 /* sizeof kill buffer chunks */ +#define NRING 16 /* # of buffers in kill ring */ +#define NBLOCK 16 /* line block chunk size */ +#define NVSIZE 16 /* max #chars in a var name */ +#define NMARKS 16 /* number of marks */ +#define MAXSYM 32 /* max # chars in symbol to expand */ +#define MINFLEN 3 /* min # chars to match &func */ + +#define CTRL 0x0100 /* Control flag, or'ed in */ +#define META 0x0200 /* Meta flag, or'ed in */ +#define CTLX 0x0400 /* ^X flag, or'ed in */ +#define SPEC 0x0800 /* special key (function keys) */ +#define MOUS 0x1000 /* alternative input device (mouse) */ +#define SHFT 0x2000 /* shifted (for function keys) */ +#define ALTD 0x4000 /* ALT key... */ +#define MENU MOUS+SPEC /* menu selection (WINDOW_MSWIN) */ + +#define BINDNUL 0 /* not bound to anything */ +#define BINDFNC 1 /* key bound to a function */ +#define BINDBUF 2 /* key bound to a buffer */ + +#ifdef FALSE +#undef FALSE +#endif +#ifdef TRUE +#undef TRUE +#endif + +#define FALSE 0 /* False, no, bad, etc. */ +#define TRUE 1 /* True, yes, good, etc. */ +#define ABORT 2 /* Death, ^G, abort, etc. */ +#define FAILD 3 /* not-quite fatal false return */ + +#define STOP 0 /* keyboard macro not in use */ +#define PLAY 1 /* playing */ +#define RECORD 2 /* recording */ + +/* Completion types */ + +#define CMP_BUFFER 0 +#define CMP_COMMAND 1 +#define CMP_FILENAME 2 + +/* Directive definitions */ + +#define DIF 0 +#define DELSE 1 +#define DENDIF 2 +#define DGOTO 3 +#define DRETURN 4 +#define DENDM 5 +#define DWHILE 6 +#define DENDWHILE 7 +#define DBREAK 8 +#define DFORCE 9 + +#define NUMDIRS 10 + +/* + * PTBEG, PTEND, FORWARD, and REVERSE are all toggle-able values for + * routines that need directions. + */ +#define PTBEG 0 /* Leave the point at the beginning on search */ +#define PTEND 1 /* Leave the point at the end on search */ +#define FORWARD 0 /* do things in a forward direction */ +#define REVERSE 1 /* do things in a backwards direction */ + +#define FIOSUC 0 /* File I/O, success. */ +#define FIOFNF 1 /* File I/O, file not found. */ +#define FIOEOF 2 /* File I/O, end of file. */ +#define FIOERR 3 /* File I/O, error. */ +#define FIOMEM 4 /* File I/O, out of memory */ +#define FIOFUN 5 /* File I/O, eod of file/bad line*/ +#define FIODEL 6 /* Can't delete/rename file */ + +#if WINDOW_MSWIN +/* values for the fbusy flag */ +#define FREADING 1 /* file read in progress */ +#define FWRITING 2 /* file write in progress */ +/* if no file activity, the value FALSE is used */ +#endif + +#define CFCPCN 0x0001 /* Last command was C-P, C-N */ +#define CFKILL 0x0002 /* Last command was a kill */ +#define CFSRCH 0x0004 /* last command was a search */ +#define CFYANK 0x0008 /* last command was a yank */ + +#define SRNORM 0 /* end past, begin front */ +#define SRBEGIN 1 /* always at front */ +#define SREND 2 /* always one past end */ + +#define BELL 0x07 /* a bell character */ +#define TAB 0x09 /* a tab character */ + +#if USG | LINUX | AIX | AUX | SMOS | HPUX8 | HPUX9 | BSD | FREEBSD | SUN | XENIX | AVIION +#define PATHCHR ':' +#else +#if WMCS || MPE +#define PATHCHR ',' +#else +#define PATHCHR ';' +#endif +#endif + +#define INTWIDTH sizeof(int) * 3 +#define LONGWIDTH sizeof(long) * 3 + +/* Macro argument token types */ + +#define TKNUL 0 /* end-of-string */ +#define TKARG 1 /* interactive argument */ +#define TKBUF 2 /* buffer argument */ +#define TKVAR 3 /* user variables */ +#define TKENV 4 /* environment variables */ +#define TKFUN 5 /* function.... */ +#define TKDIR 6 /* directive */ +#define TKLBL 7 /* line label */ +#define TKLIT 8 /* numeric literal */ +#define TKSTR 9 /* quoted string literal */ +#define TKCMD 10 /* command name */ + +/* Internal defined functions */ + +#define nextab(a) (a - (a % tabsize)) + tabsize + +/* DIFCASE represents the integer difference between upper + and lower case letters. It is an xor-able value, which is + fortunate, since the relative positions of upper to lower + case letters is the opposite of ascii in ebcdic. +*/ + +#if ASCII +#define DIFCASE 0x20 +#else +#define DIFCASE 0x40 +#endif + +/* Dynamic RAM tracking and reporting redefinitions */ + +#if RAMSIZE +#define malloc allocate +#define free release +#else +#if VMS & OPTMEM +#define malloc VAXC$MALLOC_OPT +#define free VAXC$FREE_OPT +#define calloc VAXC$CALLOC_OPT +#define realloc VAXC$REALLOC_OPT +#define cfree VAXC$CFREE_OPT +#endif +#endif + +/* under MS Windows, we use dialog boxes to prompt the user for filenames */ +#if WINDOW_MSWIN +#define FILENAMEREPLY(p,b,nb) filenamedlg(p,b,nb,TRUE) +#else +#define FILENAMEREPLY(p,b,nb) mlreply(p,b,nb) +#endif + +/* formal parameters to procedures are stored as a linked list + of argument names using the following simple structure: +*/ + +typedef struct PARG { + struct PARG *next; /* ptr to next linked argument */ + char name[NVSIZE+1]; /* name of the argument */ +} PARG; + +/* UNDO definitions and types */ + +typedef int OPTYPE; /* type of operation being recorded/played back */ + +#define OP_CMND 1 /* beginning of command */ +#define OP_DELC 2 /* delete a single character */ +#define OP_INSC 3 /* insert a single character */ +#define OP_DSTR 4 /* delete a string of characters */ +#define OP_ISTR 5 /* insert a string of characters */ +#define OP_REPC 6 /* replace a character */ +#define OP_CPOS 7 /* set the cursor position */ + +/* object to be undone! */ + +typedef union OBJECT { + char obj_char; /* a character */ + char obj_string[1]; /* many characters */ + char *obj_sptr; /* a ptr to a character */ +} OBJECT; + +typedef struct UNDO_OBJ { + struct UNDO_OBJ *next; /* ptr to next undo object */ + OPTYPE type; /* type of operation */ + long line_num; /* line offset from buffer beginning */ + int offset; /* offset into that line */ + long count; /* repetitions? */ + OBJECT undo_obj; /* object to be undone */ +} UNDO_OBJ; + +/* + * There is a window structure allocated for every active display window. The + * windows are kept in a big list, in top to bottom screen order, with the + * listhead at "wheadp". Each window contains its own values of dot and mark. + * The flag field contains some bits that are set by commands to guide + * redisplay. Although this is a bit of a compromise in terms of decoupling, + * the full blown redisplay is just too expensive to run for every input + * character. + */ +typedef struct EWINDOW { + struct EWINDOW *w_wndp; /* Next window */ + struct BUFFER *w_bufp; /* Buffer displayed in window */ + struct LINE *w_linep; /* Top line in the window */ + struct LINE *w_dotp; /* Line containing "." */ + short w_doto; /* Byte offset for "." */ + struct LINE *w_markp[NMARKS]; /* Line containing "mark" */ + short w_marko[NMARKS]; /* Byte offset for "mark" */ +#if THEOSC + int w_toprow; /* Origin 0 top row of window */ + int w_ntrows; /* # of rows of text in window */ + int w_force; /* If NZ, forcing row. */ + int w_flag; /* Flags. */ +#if COLOR + int w_fcolor; /* current forground color */ + int w_bcolor; /* current background color */ +#endif +#else + char w_toprow; /* Origin 0 top row of window */ + char w_ntrows; /* # of rows of text in window */ + char w_force; /* If NZ, forcing row. */ + char w_flag; /* Flags. */ +#if COLOR + char w_fcolor; /* current forground color */ + char w_bcolor; /* current background color */ +#endif +#endif + int w_fcol; /* first column displayed */ +} EWINDOW; + +#define WFFORCE 0x01 /* Window needs forced reframe */ +#define WFMOVE 0x02 /* Movement from line to line */ +#define WFEDIT 0x04 /* Editing within a line */ +#define WFHARD 0x08 /* Better to a full display */ +#define WFMODE 0x10 /* Update mode line. */ +#define WFCOLR 0x20 /* Needs a color change */ + +/* This structure holds the information about each line appearing on the + * video display. The redisplay module uses an array of virtual display + * lines. On systems that do not have direct access to display memory, + * there is also an array of physical display lines used to minimize + * video updating. In most cases, these two arrays are unique. If + * WINDOW_MSWIN is 1, there is a pair of such arrays in each SCREEN + * structure. + */ + +typedef struct VIDEO { + int v_flag; /* Flags */ +#if COLOR + int v_fcolor; /* current forground color */ + int v_bcolor; /* current background color */ + int v_rfcolor; /* requested forground color */ + int v_rbcolor; /* requested background color */ +#endif + int v_left; /* left edge of reverse video */ + int v_right; /* right right of reverse video */ +#if INSDEL && MEMMAP == 0 + int v_rline; /* requested screen line # */ +#endif + char v_text[1]; /* Screen data. */ +} VIDEO; + +#define VFNEW 0x0001 /* contents not meaningful yet */ +#define VFCHG 0x0002 /* Changed flag */ +#define VFEXT 0x0004 /* extended (beyond column 80) */ +#define VFCOL 0x0008 /* color change requested */ + +/* + * This structure holds the information about each separate "screen" + * within the current editing session. On a character based system, these + * screens overlay each other, and can individually be brought to front. + * On a windowing system like MicroSoft Windows 3.0, OS/2, the Macintosh, + * Intuition, Sunview or X-windows, each screen is represented in an OS + * window. The terminolgy is wrong in emacs..... + * + * EMACS The outside World + * screen window + * window pane + */ + +typedef struct ESCREEN { + struct ESCREEN *s_next_screen; /* link to next screen in list */ + EWINDOW *s_first_window; /* head of linked list of windows */ + EWINDOW *s_cur_window; /* current window in this screen */ + char *s_screen_name; /* name of the current window */ + short s_roworg; /* row origin of stored screen */ + short s_colorg; /* column origin of stored screen */ + short s_nrow; /* row width of stored screen */ + short s_ncol; /* column origin of stored screen */ +#if WINDOW_MSWIN + VIDEO **s_virtual; /* virtual screen contents */ + VIDEO **s_physical; /* physical screen contents */ + HWND s_drvhandle; /* handle for the "term" driver */ +#endif +} ESCREEN; + +/* + * Text is kept in buffers. A buffer header, described below, exists for every + * buffer in the system. The buffers are kept in a big list, so that commands + * that search for a buffer by name can find the buffer header. There is a + * safe store for the dot and mark in the header, but this is only valid if + * the buffer is not being displayed (that is, if "b_nwnd" is 0). The text for + * the buffer is kept in a circularly linked list of lines, with a pointer to + * the header line in "b_linep". Buffers may be "Inactive" which means the + * files associated with them have not been read in yet. These get read in + * at "use buffer" time. + * Some buffers are really procedures and have a little extra information + * stored with them. + */ +typedef struct BUFFER { + struct BUFFER *b_bufp; /* Link to next BUFFER */ + struct LINE *b_dotp; /* Link to "." LINE structure */ + short b_doto; /* Offset of "." in above LINE */ + struct LINE *b_markp[NMARKS]; /* The same as the above two, */ + short b_marko[NMARKS]; /* but for the "mark" */ + int b_fcol; /* first col to display */ + struct LINE *b_linep; /* Link to the header LINE */ + struct LINE *b_topline; /* Link to narrowed top text */ + struct LINE *b_botline; /* Link to narrowed bottom text */ +#if THEOSC + int b_active; /* window activated flag */ + int b_nwnd; /* Count of windows on buffer */ + int b_exec; /* how many active executions */ + int b_flag; /* Flags */ +#else + char b_active; /* window activated flag */ + char b_nwnd; /* Count of windows on buffer */ + char b_exec; /* how many active executions */ + char b_flag; /* Flags */ +#endif + int b_mode; /* editor mode of this buffer */ + char b_fname[NFILEN]; /* File name */ + char b_bname[NBUFN]; /* Buffer name */ +#if CRYPT + char b_key[NPAT]; /* current encrypted key */ +#endif + int b_numargs; /* number of arguments to procedure */ + PARG *b_args; /* ptr to the first argument */ + UNDO_OBJ *undo_head; /* head of undo stack for buffer */ + long undo_count; /* # of undo operations stacked */ + long last_access; /* time of last access */ +} BUFFER; + +#define BFINVS 0x01 /* Internal invisable buffer */ +#define BFCHG 0x02 /* Changed since last write */ +#define BFTRUNC 0x04 /* buffer was truncated when read */ +#define BFNAROW 0x08 /* buffer has been narrowed */ +#if LIBHELP +#define BFERROR 0x40 /* Error file buffer */ +#define BFHELP 0x80 /* Buffer is a help buffer */ +#endif + +#define NOTPROC -1 /* buffer is not a procedure */ + +/* mode flags */ +#if JMDEXT +#define NUMMODES 14 /* # of defined modes */ +#else +#define NUMMODES 11 /* # of defined modes */ +#endif + +#define MDWRAP 0x0001 /* word wrap */ +#define MDCMOD 0x0002 /* C indentation and fence match*/ +#define MDSPELL 0x0004 /* spell error parsing */ +#define MDEXACT 0x0008 /* Exact matching for searches */ +#define MDVIEW 0x0010 /* read-only buffer */ +#define MDOVER 0x0020 /* overwrite mode */ +#define MDMAGIC 0x0040 /* regular expresions in search */ +#define MDCRYPT 0x0080 /* encrytion mode active */ +#define MDASAVE 0x0100 /* auto-save mode */ +#define MDREPL 0x0200 /* replace mode */ +#define MDABBR 0x0400 /* abbreviation expansion mode */ +#if JMDEXT +#define MDNOBAK 0x0800 /* no auto backup */ +#define MDGRAF1 0x1000 /* single line graphics */ +#define MDGRAF2 0x2000 /* double line graphics */ +#endif + +/* + * The starting position of a region, and the size of the region in + * characters, is kept in a region structure. Used by the region commands. + */ +typedef struct { + struct LINE *r_linep; /* Origin LINE address. */ + short r_offset; /* Origin LINE offset. */ + long r_size; /* Length in characters. */ +} REGION; + +/* + * All text is kept in circularly linked lists of "LINE" structures. These + * begin at the header line (which is the blank line beyond the end of the + * buffer). This line is pointed to by the "BUFFER". Each line contains a the + * number of bytes in the line (the "used" size), the size of the text array, + * and the text. The end of line is not stored as a byte; it's implied. + */ +typedef struct LINE { + struct LINE *l_fp; /* Link to the next line */ + struct LINE *l_bp; /* Link to the previous line */ + short l_size; /* Allocated size */ + short l_used; /* Used size */ + char l_text[1]; /* A bunch of characters. */ +} LINE; + +#define lforw(lp) ((lp)->l_fp) +#define lback(lp) ((lp)->l_bp) +#if UNIX && (SUN || HPUX8 || HPUX9 || BSD || FREEBSD) +#define lgetc(lp, n) ((unsigned char)(lp)->l_text[(n)]) +#else +#define lgetc(lp, n) ((lp)->l_text[(n)]) +#endif +#define lputc(lp, n, c) ((lp)->l_text[(n)]=(c)) +#define lused(lp) ((lp)->l_used) +#define lsize(lp) ((lp)->l_size) +#define ltext(lp) ((lp)->l_text) + +/* This structure is used to hold a user variables name and its + current value. These are used for both the global and the + local symbol tables. +*/ + +typedef struct UVAR { + char u_name[NVSIZE + 1]; /* name of user variable */ + char *u_value; /* value (string) */ +} UVAR; + +#define VT_NONE 0 /* don't declare it if not found */ +#define VT_LOCAL 1 /* local to the current procedure */ +#define VT_GLOBAL 2 /* global to all procedures */ + +/* A UTABLE is a user variable table.... containing some header + information and an array of user variable names and definitions. + They are held together in a linked list, the last member of + the list being the global user variable table. +*/ + +typedef struct UTABLE { + struct UTABLE *next; /* ptr to next user variable table */ + int size; /* max number of variables in table */ + BUFFER *bufp; /* ptr to buffer holding procedure + assosiated with this symbol table. */ + UVAR uv[1]; /* list of variable names/definitions + in this variable table */ +} UTABLE; + +/* + * The editor communicates with the display using a high level interface. A + * "TERM" structure holds useful variables, and indirect pointers to routines + * that do useful operations. The low level get and put routines are here too. + * This lets a terminal, in addition to having non standard commands, have + * funny get and put character code too. The calls might get changed to + * "termp->t_field" style in the future, to make it possible to run more than + * one terminal type. + */ +#if PROTO +typedef struct { + short t_mrow; /* max number of rows allowable */ + short t_nrow; /* current number of rows used */ + short t_mcol; /* max Number of columns. */ + short t_ncol; /* current Number of columns. */ + short t_roworg; /* origin row (normally zero) */ + short t_colorg; /* origin column (normally zero)*/ + short t_margin; /* min margin for extended lines*/ + short t_scrsiz; /* size of scroll region " */ + int t_pause; /* # times thru update to pause */ + int (PASCAL NEAR *t_open)(void); /* Open terminal at the start.*/ + int (PASCAL NEAR *t_close)(void); /* Close terminal at end. */ + int (PASCAL NEAR *t_kopen)(void); /* Open keyboard */ + int (PASCAL NEAR *t_kclose)(void); /* Close keyboard */ + int (PASCAL NEAR *t_getchar)(void); /* Get character from keyboard. */ + int (PASCAL NEAR *t_putchar)(int); /* Put character to display.*/ + int (PASCAL NEAR *t_flush)(void); /* Flush output buffers. */ + int (PASCAL NEAR *t_move)(int, int);/* Move the cursor, origin 0.*/ + int (PASCAL NEAR *t_eeol)(void); /* Erase to end of line. */ + int (PASCAL NEAR *t_eeop)(void); /* Erase to end of page. */ + int (PASCAL NEAR *t_clrdesk)(void); /* Clear the page totally */ + int (PASCAL NEAR *t_beep)(void); /* Beep. */ + int (PASCAL NEAR *t_rev)(int); /* set reverse video state */ + int (PASCAL NEAR *t_rez)(char *); /* change screen resolution */ +#if COLOR + int (PASCAL NEAR *t_setfor)(int); /* set forground color */ + int (PASCAL NEAR *t_setback)(int); /* set background color */ +#endif +#if INSDEL + int (PASCAL NEAR *t_insline)(int); /* insert a screen line */ + int (PASCAL NEAR *t_delline)(int); /* delete a screen line */ +#endif +#if WINDOW_MSWIN + int (PASCAL NEAR *t_sleep)(int); /* go to sleep for a while */ + int (PASCAL NEAR *t_newscr)(ESCREEN *); /* create new screen display */ + int (PASCAL NEAR *t_delscr)(ESCREEN *); /* destroy screen display */ + int (PASCAL NEAR *t_selscr)(ESCREEN *); /* select screen display */ + int (PASCAL NEAR *t_sizscr)(ESCREEN *); /* resize screen display */ + int (PASCAL NEAR *t_topscr)(ESCREEN *); /* bring screen to top */ +#endif +} TERM; +#else /* TERM structure, no prototyping.*/ + +typedef struct { + short t_mrow; /* max number of rows allowable */ + short t_nrow; /* current number of rows used */ + short t_mcol; /* max Number of columns. */ + short t_ncol; /* current Number of columns. */ + short t_roworg; /* origin row (normally zero) */ + short t_colorg; /* origin column (normally zero)*/ + short t_margin; /* min margin for extended lines*/ + short t_scrsiz; /* size of scroll region " */ + int t_pause; /* # times thru update to pause */ + int (PASCAL NEAR *t_open)(); /* Open terminal at the start. */ + int (PASCAL NEAR *t_close)(); /* Close terminal at end. */ + int (PASCAL NEAR *t_kopen)(); /* Open keyboard */ + int (PASCAL NEAR *t_kclose)(); /* close keyboard */ + int (PASCAL NEAR *t_getchar)(); /* Get character from keyboard. */ + int (PASCAL NEAR *t_putchar)(); /* Put character to display. */ + int (PASCAL NEAR *t_flush)(); /* Flush output buffers. */ + int (PASCAL NEAR *t_move)(); /* Move the cursor, origin 0. */ + int (PASCAL NEAR *t_eeol)(); /* Erase to end of line. */ + int (PASCAL NEAR *t_eeop)(); /* Erase to end of page. */ + int (PASCAL NEAR *t_clrdesk)(); /* Clear the page totally */ + int (PASCAL NEAR *t_beep)(); /* Beep. */ + int (PASCAL NEAR *t_rev)(); /* set reverse video state */ + int (PASCAL NEAR *t_rez)(); /* change screen resolution */ +#if COLOR + int (PASCAL NEAR *t_setfor)(); /* set forground color */ + int (PASCAL NEAR *t_setback)(); /* set background color */ +#endif +#if INSDEL + int (PASCAL NEAR *t_insline)(); /* insert a screen line */ + int (PASCAL NEAR *t_delline)(); /* delete a screen line */ +#endif +#if WINDOW_MSWIN + int (PASCAL NEAR *t_sleep)(); /* go to sleep for a while */ + int (PASCAL NEAR *t_newscr)(); /* create new screen display */ + int (PASCAL NEAR *t_delscr)(); /* destroy screen display */ + int (PASCAL NEAR *t_selscr)(); /* select screen display */ + int (PASCAL NEAR *t_sizscr)(); /* resize screen display */ + int (PASCAL NEAR *t_topscr)(); /* bring screen to top */ +#endif +} TERM; +#endif + + +/* TEMPORARY macros for terminal I/O (to be placed in a machine + dependant place later) */ + +#define TTopen (*term.t_open) +#define TTclose (*term.t_close) +#define TTkopen (*term.t_kopen) +#define TTkclose (*term.t_kclose) +#define TTgetc (*term.t_getchar) +#define TTputc (*term.t_putchar) +#define TTflush (*term.t_flush) +#define TTmove (*term.t_move) +#define TTeeol (*term.t_eeol) +#define TTeeop (*term.t_eeop) +#define TTclrdesk (*term.t_clrdesk) +#define TTbeep (*term.t_beep) +#define TTrev (*term.t_rev) +#define TTrez (*term.t_rez) +#if COLOR +#define TTforg (*term.t_setfor) +#define TTbacg (*term.t_setback) +#endif + +/* Structure for the table of current key bindings */ + +ETYPE EPOINTER { + int (PASCAL NEAR *fp)(); /* C routine to invoke */ + BUFFER *buf; /* buffer to execute */ +}; + +typedef struct { + short k_code; /* Key code */ + short k_type; /* binding type (C function or EMACS buffer) */ + ETYPE EPOINTER k_ptr; /* ptr to thing to execute */ +} KEYTAB; + +/* structure for the name binding table */ + +typedef struct { + char *n_name; /* name of function key */ + int (PASCAL NEAR *n_func)(); /* function name is bound to */ +} NBIND; + +/* The editor holds deleted text chunks in the KILL buffer. The + kill buffer is logically a stream of ascii characters, however + due to its unpredicatable size, it gets implemented as a linked + list of chunks. (The d_ prefix is for "deleted" text, as k_ + was taken up by the keycode structure) +*/ + +typedef struct KILL { + struct KILL *d_next; /* link to next chunk, NULL if last */ + char d_chunk[KBLOCK]; /* deleted text */ +} KILL; + +/* When emacs's command interpetor needs to get a variable's name, + rather than it's value, it is passed back as a VDESC variable + description structure. The v_num field is a index into the + appropriate variable table. +*/ + +typedef struct VDESC { + int v_type; /* type of variable */ + int v_num; /* ordinal pointer to variable in list */ + UTABLE *v_ut; /* ptr to appropriate user table if user var */ +} VDESC; + +/* The !WHILE directive in the execution language needs to + stack references to pending whiles. These are stored linked + to each currently open procedure via a linked list of + the following structure +*/ + +typedef struct WHBLOCK { + LINE *w_begin; /* ptr to !while statement */ + LINE *w_end; /* ptr to the !endwhile statement*/ + int w_type; /* block type */ + struct WHBLOCK *w_next; /* next while */ +} WHBLOCK; + +#define BTWHILE 1 +#define BTBREAK 2 + +/* Abbreviations are short symbols that expand to longer strings + when typed into a buffer with no intervening whitespace or commands. + This structure grows dynamically as needed. +*/ + +typedef struct ABBREV { + struct ABBREV *ab_next; /* pointer to the next abbreviation */ + char ab_sym[MAXSYM + 1]; /* name to expand */ + char ab_exp[1]; /* string to expand to */ +} ABBREV; + +/* Search definitions... */ + +/* HICHAR - 1 is the largest character we will deal with. + * BMAPSIZE represents the number of bytes in the bitmap. + */ +#define HICHAR 256 +#define BMAPSIZE HICHAR >> 3 + +/* + * Jump table structures. + */ +typedef struct { + int jump; + int patlen; + int delta[HICHAR]; + char patrn[NPAT]; +} DELTA; + +#if MAGIC +/* + * Defines for the metacharacters in the regular expression + * search routines. MCNIL and GROUP are used in both search + * and replace metachar-arrays. + */ +#define MCNIL 0 /* Like the '\0' for strings.*/ +#define JMPTABLE 1 +#define LITSTRING 2 /* Literal string.*/ +#define LITCHAR 3 /* Literal character.*/ +#define ANY 4 /* Any character but the .*/ +#define CCL 5 +#define NCCL 6 +#define BOL 7 +#define EOL 8 +#define BOWRD 9 +#define EOWRD 10 +#define GRPBEG 11 /* Signal start of group.*/ +#define GRPEND 12 /* Signal end of group.*/ +#define GROUP 13 /* String of group match.*/ +#define DITTO 14 /* Replacement with match string.*/ + +#define CLOSURE 0x0100 /* An or-able value for a closure modifier.*/ +#define CLOSURE_1 0x0200 /* An or-able value for a closure modifier.*/ +#define ZEROONE 0x0400 /* An or-able value for a closure modifier.*/ + +#define ALLCLOS (CLOSURE | CLOSURE_1 | ZEROONE) +#define MASKCLO (~ALLCLOS) + +#define MC_ANY '.' /* 'Any' character (except newline).*/ +#define MC_CCL '[' /* Character class.*/ +#define MC_NCCL '^' /* Negate character class.*/ +#define MC_RCCL '-' /* Range in character class.*/ +#define MC_ECCL ']' /* End of character class.*/ +#define MC_BOL '^' /* Beginning of line.*/ +#define MC_EOL '$' /* End of line.*/ +#define MC_CLOSURE '*' /* Closure - zero to many characters match.*/ +#define MC_CLOSURE_1 '+' /* Closure - one to many characters match.*/ +#define MC_ZEROONE '?' /* Closure - zero to one characters match.*/ +#define MC_DITTO '&' /* Use matched string in replacement.*/ +#define MC_GRPBEG '(' /* Start of group (begun with a backslash).*/ +#define MC_GRPEND ')' /* End of group (begun with a backslash).*/ +#define MC_BOWRD '<' /* Beginning of word (begun with a backslash).*/ +#define MC_EOWRD '>' /* End of word (begun with a backslash).*/ +#define MC_ESC '\\' /* Escape - suppress meta-meaning.*/ + +#define MAXGROUPS 10 /* 1 + maximum # of r. e. groups. */ +#define BIT(n) (1 << (n)) /* An integer with one bit set.*/ + +/* Typedefs that define the bitmap type for searching (EBITMAP), + * the meta-character structure for MAGIC mode searching (MC), + * and the meta-character structure for MAGIC mode replacment (RMC). + */ +typedef char *EBITMAP; + +typedef struct { + short int mc_type; + union { + int lchar; + int group_no; + char *lstring; + DELTA *jmptable; + EBITMAP cclmap; + } u; +} MC; + +typedef struct { + short int mc_type; + union { + int group_no; + char *rstr; + } u; +} RMC; +#endif + +/* + This is the message which should be added to any "About MicroEMACS" + boxes on any of the machines with window managers. + + + ------------------------------------------ + | | + | MicroEMACS v4.xx | + | for the ............ | + | | + | Text Editor and Corrector | + | | + | written by Daniel M. Lawrence | + | [based on code by Dave Conroy] | + | | + | Send inquiries and donations to: | + | 617 New York St | + | Lafayette, IN 47901 | + | | + ------------------------------------------ +*/ diff --git a/theos/makefile.5 b/theos/makefile.5 new file mode 100644 index 0000000..2d683df --- /dev/null +++ b/theos/makefile.5 @@ -0,0 +1,124 @@ +# Theos makefile for +# MicroEMACS 3.12 +# (C)Copyright 1993 by Daniel Lawrence +# all rights reserved + +# modify the following lines with the proper relative directories + +# object file directory +OBJD = obj +# source file directory +SRCD = ../src +# header file directory +HDIR = ../h + +# options and arguments to the C compiler + +CC= cl +CFLAGS= -W0 -FPi87 -DUSE_JMDEXT -DMAINWA_BUG +LD= cl + +# list of header files + +HFILES = estruct.h edef.h eproto.h elang.h + +#list of object files + +F1 = main.o abbrev.o basic.o bind.o +F2 = char.o crypt.o display.o dolock.o +F3 = buffer.o eval.o exec.o file.o +F4 = fileio.o input.o +F5 = isearch.o libhelp.o line.o lock.o +F6 = message.o mouse.o screen.o +F7 = random.o region.o search.o replace.o +F8 = tags.o theos.o undo.o window.o word.o _setargv.o + +# product list + +#all: bin/me.cmd +all: me.cmd + +OFILES = $(F1) $(F2) $(F3) $(F4) $(F5) $(F6) $(F7) $(F8) + +#bin/me.cmd: $(OFILES) +# $(LD) $(LDFLAGS) $(OFILES) -Febin/me.cmd + +me.cmd: $(OFILES) + echo >emacs.link name me.cmd + echo >>emacs.link inc $(F1) + echo >>emacs.link inc $(F2) + echo >>emacs.link inc $(F3) + echo >>emacs.link inc $(F4) + echo >>emacs.link inc $(F5) + echo >>emacs.link inc $(F6) + echo >>emacs.link inc $(F7) + echo >>emacs.link inc $(F8) + link32 emacs.link(file symbol + +abbrev.o: $(SRCD)/abbrev.c $(HFILES) + $(CC) $(CFLAGS) -c -Foabbrev.o $(SRCD)/abbrev.c +basic.o: $(SRCD)/basic.c $(HFILES) + $(CC) $(CFLAGS) -c -Fobasic.o $(SRCD)/basic.c +bind.o: $(SRCD)/bind.c $(HFILES) epath.h + $(CC) $(CFLAGS) -c -Fobind.o $(SRCD)/bind.c +buffer.o: $(SRCD)/buffer.c $(HFILES) + $(CC) $(CFLAGS) -c -Fobuffer.o $(SRCD)/buffer.c +char.o: $(SRCD)/char.c $(HFILES) + $(CC) $(CFLAGS) -c -Fochar.o $(SRCD)/char.c +crypt.o: $(SRCD)/crypt.c $(HFILES) + $(CC) $(CFLAGS) -c -Focrypt.o $(SRCD)/crypt.c +cmdfix.o: $(SRCD)/cmdfix.c $(HFILES) + $(CC) $(CFLAGS) -c -Focmdfix.o $(SRCD)/cmdfix.c +display.o: $(SRCD)/display.c $(HFILES) + $(CC) $(CFLAGS) -c -Fodisplay.o $(SRCD)/display.c +dolock.o: $(SRCD)/dolock.c $(HFILES) + $(CC) $(CFLAGS) -c -Fodolock.o $(SRCD)/dolock.c +eval.o: $(SRCD)/eval.c $(HFILES) evar.h + $(CC) $(CFLAGS) -c -Foeval.o $(SRCD)/eval.c +exec.o: $(SRCD)/exec.c $(HFILES) + $(CC) $(CFLAGS) -c -Foexec.o $(SRCD)/exec.c +file.o: $(SRCD)/file.c $(HFILES) + $(CC) $(CFLAGS) -c -Fofile.o $(SRCD)/file.c +fileio.o: $(SRCD)/fileio.c $(HFILES) + $(CC) $(CFLAGS) -c -Fofileio.o $(SRCD)/fileio.c +input.o: $(SRCD)/input.c $(HFILES) + $(CC) $(CFLAGS) -c -Foinput.o $(SRCD)/input.c +isearch.o: $(SRCD)/isearch.c $(HFILES) + $(CC) $(CFLAGS) -c -Foisearch.o $(SRCD)/isearch.c +libhelp.o: $(SRCD)/libhelp.c $(HFILES) + $(CC) $(CFLAGS) -c -Folibhelp.o $(SRCD)/libhelp.c +line.o: $(SRCD)/line.c $(HFILES) + $(CC) $(CFLAGS) -c -Foline.o $(SRCD)/line.c +lock.o: $(SRCD)/lock.c $(HFILES) + $(CC) $(CFLAGS) -c -Folock.o $(SRCD)/lock.c +main.o: $(SRCD)/main.c $(HFILES) efunc.h ebind.h + $(CC) $(CFLAGS) -c -Fomain.o $(SRCD)/main.c +message.o: $(SRCD)/message.c $(HFILES) epath.h + $(CC) $(CFLAGS) -c -Fomessage.o $(SRCD)/message.c +mouse.o: $(SRCD)/mouse.c $(HFILES) + $(CC) $(CFLAGS) -c -Fomouse.o $(SRCD)/mouse.c +random.o: $(SRCD)/random.c $(HFILES) + $(CC) $(CFLAGS) -c -Forandom.o $(SRCD)/random.c +region.o: $(SRCD)/region.c $(HFILES) + $(CC) $(CFLAGS) -c -Foregion.o $(SRCD)/region.c +screen.o: $(SRCD)/screen.c $(HFILES) + $(CC) $(CFLAGS) -c -Foscreen.o $(SRCD)/screen.c +search.o: $(SRCD)/search.c $(HFILES) + $(CC) $(CFLAGS) -c -Fosearch.o $(SRCD)/search.c +replace.o: $(SRCD)/replace.c $(HFILES) + $(CC) $(CFLAGS) -c -Foreplace.o $(SRCD)/replace.c +tags.o: $(SRCD)/tags.c $(HFILES) + $(CC) $(CFLAGS) -c -Fotags.o $(SRCD)/tags.c +theos.o: $(SRCD)/theos.c $(HFILES) + $(CC) $(CFLAGS) -c -Fotheos.o $(SRCD)/theos.c +undo.o: $(SRCD)/undo.c $(HFILES) + $(CC) $(CFLAGS) -c -Foundo.o $(SRCD)/undo.c +window.o: $(SRCD)/window.c $(HFILES) + $(CC) $(CFLAGS) -c -Fowindow.o $(SRCD)/window.c +word.o: $(SRCD)/word.c $(HFILES) + $(CC) $(CFLAGS) -c -Foword.o $(SRCD)/word.c +_setargv.o: $(SRCD)/_setargv.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo_setargv.o $(SRCD)/_setargv.c + +install: + c me.cmd /Programs/Jmd/=.=:s(rep From ae342ef1c103769cf47e697d89feafab19001328 Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 3 Sep 2020 12:27:52 +0200 Subject: [PATCH 02/37] Add files via upload --- cmd/bpage.cmd | 561 ++--- cmd/c.hlp | 4628 ++++++++++++++++++++++++++++++++++++++++ cmd/c.idx | Bin 0 -> 7836 bytes cmd/ehelp.cmd | 13 +- cmd/ehelp1.txt | 158 +- cmd/ehelp2.txt | 269 ++- cmd/emacs.rc | 114 +- cmd/emacs.rc_curses | 129 ++ cmd/emacs.rc_linux | 320 +++ cmd/tpage.cmd | 315 +++ cmd/tpage.cmd_nocurses | 269 +++ 11 files changed, 6203 insertions(+), 573 deletions(-) create mode 100644 cmd/c.hlp create mode 100644 cmd/c.idx create mode 100644 cmd/emacs.rc_curses create mode 100644 cmd/emacs.rc_linux create mode 100644 cmd/tpage.cmd create mode 100644 cmd/tpage.cmd_nocurses diff --git a/cmd/bpage.cmd b/cmd/bpage.cmd index 0802dc3..8ecc269 100644 --- a/cmd/bpage.cmd +++ b/cmd/bpage.cmd @@ -13,44 +13,37 @@ store-procedure clean delete-buffer "[b-change-line]" delete-buffer "[b-del-block]" delete-buffer "[b-draw-box]" - delete-buffer "[b-ins-line]" delete-buffer "[b-copy-block]" delete-buffer "[b-yank-block]" - delete-buffer "[b-ins-blank]" delete-buffer "[b-yank-block]" delete-buffer "[getblock]" delete-buffer "[putblock]" - delete-buffer "[drawbox]" - delete-buffer "[setpoints]" - delete-buffer "[horizontal]" - delete-buffer "[vertical]" - delete-buffer "[horline]" - delete-buffer "[vertline]" - delete-buffer "[delcol]" !endm ; Write out the page instructions save-window 1 next-window beginning-of-file + delete-mode "VIEW" set $curcol 25 - overwrite-string " F1 Line type [DOUBLE] F2 kill block " + overwrite-string " F1 single line box F2 kill block " next-line set $curcol 25 - overwrite-string " F3 draw box F4 copy block " + overwrite-string " F3 double line box F4 copy block " next-line set $curcol 25 - overwrite-string " F5 insert line F6 yank block " + overwrite-string " F6 yank block " next-line set $curcol 18 overwrite-string "BOX " set $curcol 25 - overwrite-string " F7 insert space F8 insert block " + overwrite-string " F8 insert block " next-line set $curcol 25 overwrite-string " " unmark-buffer beginning-of-file + add-mode "VIEW" !force restore-window update-screen @@ -64,416 +57,25 @@ store-procedure b-change-line set %rcltype 2 set %rctmp "DOUBLE" !else - !if &equ %rcltype 2 - set %rcltype 3 - set %rctmp "C-CMNT" - !else - set %rcltype 1 - set %rctmp "SINGLE" - !endif + set %rcltype 1 + set %rctmp "SINGLE" !endif set %cbuf $cbufname set %cline $cwline - select-buffer "Function Keys" + select-buffer "[Function Keys]" beginning-of-file 1 goto-line 40 forward-character + delete-mode "VIEW" 6 delete-next-character insert-string %rctmp unmark-buffer - select-buffer %cbuf + add-mode "VIEW" + select-buffer %cbuf %cline redraw-display !return !endm -; Draw a box - -store-procedure b-draw-box - !if &equal %rcltype 1 - set %c1 "Ú" - set %c2 "Ä" - set %c3 "¿" - set %c4 "À" - set %c5 "Ù" - set %c6 "³" - !else - !if &equal %rcltype 2 - set %c1 "É" - set %c2 "Í" - set %c3 "»" - set %c4 "È" - set %c5 "¼" - set %c6 "º" - !else - set %c1 "/" - set %c2 "*" - set %c3 "\" - set %c4 "\" - set %c5 "/" - set %c6 "*" - !endif - !endif - run drawbox -!endm - -; insert a blank line in a box - -store-procedure b-ins-blank - set %rctmp %rcltype - set %rcltype 0 - run b-ins-line - set %rcltype %rctmp -!endm - -; insert a line in a box - -store-procedure b-ins-line - run setpoints - !if &equal %pcol %mcol - run vertical - !else - !if &equal %pline %mline - run horizontal - !else - write-message "Illegal point and mark for lines" - !endif - !endif -!endm - -store-procedure setpoints -; procedure will set pcol, pline, mcol and mline. currently at point -; it will also detab the region - set %pcol $curcol - set %pline $curline - exchange-point-and-mark - set %mcol $curcol - set %mline $curline - exchange-point-and-mark - detab-region - set $curline %pline - set $curcol %pcol -!endm - -store-procedure drawbox - run setpoints - set $curline %mline - set $curcol %mcol -;draw top horizontal line - insert-string %c1 -; set %width &sub &sub %pcol %mcol 1 - set %width &add 2 &sub %pcol %mcol - %width insert-string %c2 - insert-string %c3 - newline-and-indent -;draw bottom horizontal line - %pline goto-line - next-line - end-of-line - newline - %mcol insert-string " " -; set $curcol %mcol - insert-string %c4 - %width insert-string %c2 - insert-string %c5 -; bump pline - set %pline &add %pline 1 -;draw verticals -- go to top and work our way down - %mline goto-line - !while &less $curline %pline - next-line - end-of-line - !if &less $curcol %pcol - &sub %pcol $curcol insert-string " " - !endif - set $curcol %pcol - insert-string " " - insert-string %c6 - set $curcol %mcol - insert-string %c6 - insert-string " " - !endwhile -;return to point - %pline goto-line - next-line - beginning-of-line - %width forward-character -!force 6 forward-character -!endm - -; user procedure to draw a horizontal from mark to point making spaces for -; the characters. -store-procedure horizontal - set %s1 "º" - set %s2 "³" - set %s3 "*" - !if &equal %rcltype 0 -; then insert blanks - set %c1 "º" - set %c2 "³" - set %c3 " " - set %c4 "º" - set %c5 "³" - set %c6 "º" - set %c7 "³" - set %c8 "*" - !else - !if &equal %rcltype 1 -; then insert a single line - set %c1 "Ç" - set %c2 "Ã" - set %c3 "Ä" - set %c4 "×" - set %c5 "Å" - set %c6 "¶" - set %c7 "´" - set %c8 "*" - !else - !if &equal %rcltype 2 -; then insert a double line - set %c1 "Ì" - set %c2 "Æ" - set %c3 "Í" - set %c4 "Î" - set %c5 "Ø" - set %c6 "¹" - set %c7 "µ" - set %c8 "*" - !else - set %c1 "*" - set %c2 "*" - set %c3 "*" - set %c4 "*" - set %c5 "*" - set %c6 "*" - set %c7 "*" - set %c8 "*" - !endif - !endif - !endif - run horline -!endm - -store-procedure vertical - set %s1 "Í" - set %s2 "Ä" - set %s3 "*" - !if &equal %rcltype 0 - set %c1 "Í" - set %c2 "Ä" - set %c3 " " - set %c4 "Í" - set %c5 "Ä" - set %c6 "Í" - set %c7 "Ä" - set %c8 "*" - !else - !if &equal %rcltype 1 - set %c1 "Ñ" - set %c2 "Â" - set %c3 "³" - set %c4 "Ø" - set %c5 "Å" - set %c6 "Ï" - set %c7 "Á" - set %c8 "*" - !else - !if &equal %rcltype 2 - set %c1 "Ë" - set %c2 "Ò" - set %c3 "º" - set %c4 "Î" - set %c5 "×" - set %c6 "Ê" - set %c7 "Ð" - set %c8 "*" - !else - set %c1 "*" - set %c2 "*" - set %c3 "*" - set %c4 "*" - set %c5 "*" - set %c6 "*" - set %c7 "*" - set %c8 "*" - !endif - !endif - !endif - run verline -!endm - -store-procedure horline -; procedure to draw a line from beginning of line to point - !if &equal %mcol %pcol - !return - !endif - set $curline %pline - set $curcol %pcol - !if &less %pcol %mcol -; then point was to left of mark. exchange and reset variables - exchange-point-and-mark - run setpoints - !endif - !if %rcinsert - set $curcol %mcol - !else - beginning-of-line - newline - previous-line -; end-of-line -; newline - ; move to under mark - %mcol insert-string " " - !endif -; see if first char is a vertical line - previous-line - set %char &chr $curchar - next-line - %rcinsert delete-next-character - !if &sequal %char %s1 - insert-string %c1 - !else - !if &sequal %char %s2 - insert-string %c2 - !else - !if &sequal %char %s3 - insert-string %c8 - !else - insert-string %c3 - !endif - !endif - !endif -; now for all chars but the last character i.e., char at point - !while &less $curcol %pcol - previous-line - set %char &chr $curchar - next-line - %rcinsert delete-next-character - !if &sequal %char %s1 - insert-string %c4 - !else - !if &sequal %char %s2 - insert-string %c5 - !else - !if &sequal %char %s3 - insert-string %c8 - !else - insert-string %c3 - !endif - !endif - !endif - !endwhile -; see if last char is a vertical line - previous-line - set %char &chr $curchar - next-line - %rcinsert delete-next-character - !if &sequal %char %s1 - insert-string %c6 - !else - !if &sequal %char %s2 - insert-string %c7 - !else - !if &sequal %char %s3 - insert-string %c8 - !else - insert-string %c3 - !endif - !endif - !endif -!endm - -store-procedure verline -; proc to draw vertical line from mark to point. mark should be above point. - !if &equal %mline %pline - !return - !endif -; if point was above mark exchange and reset variables - !if &less %pline %mline - exchange-point-and-mark - run setpoints - !endif -;top line - %mline goto-line - set $curcol %pcol - backward-character - set %char &chr $curchar - forward-character - %rcinsert delete-next-character - !if &sequal %char %s1 - insert-string %c1 - !else - !if &sequal %char %s2 - insert-string %c2 - !else - !if &sequal %char %s3 - insert-string %c8 - !else - insert-string %c3 - !endif - !endif - !endif -;all but pline - !while &less $curline &sub %pline 1 - next-line - beginning-of-line - set $curcol %pcol - backward-character - set %char &chr $curchar - forward-character - %rcinsert delete-next-character - !if &sequal %char %s1 - insert-string %c4 - !else - !if &sequal %char %s2 - insert-string %c5 - !else - !if &sequal %char %s3 - insert-string %c8 - !else - insert-string %c3 - !endif - !endif - !endif - !endwhile -; bottom line - next-line - beginning-of-line - set $curcol %pcol - backward-character - set %char &chr $curchar - forward-character - %rcinsert delete-next-character - !if &sequal %char %s1 - insert-string %c6 - !else - !if &sequal %char %s2 - insert-string %c7 - !else - !if &sequal %char %s3 - insert-string %c8 - !else - insert-string %c3 - !endif - !endif - !endif -!endm - -store-procedure delcol -; proc to delete column. we will use the getblock procedure with the column of -; the point set to one beyond the column point - set-points - !if &equal %mcol %pcol - ; same columns - forward-character - run getblock - !return - !else - !if &equal %mline %pline - run getblock - !return - !endif -!endm - ; delete a rectangular block of text store-procedure b-del-block @@ -511,7 +113,7 @@ store-procedure getblock set %rcbuf $cbufname set %cline $cwline - ;save block boundries + ;save block boundaries set %endpos $curcol set %endline $curline detab-region @@ -562,12 +164,13 @@ store-procedure getblock ; insert/overlay a rectangular block of text store-procedure putblock +; set $debug TRUE ;set up needed variables set $discmd FALSE set %rcbuf $cbufname set %cline $cwline - ;save block boundries + ;save block boundaries set %begpos $curcol set %begline $curline @@ -581,7 +184,7 @@ store-procedure putblock select-buffer %rcbuf beginning-of-line !if ¬ &equ $lwidth 0 - 1 detab-line + 1 detab-region previous-line !endif !force set $curcol %begpos @@ -619,16 +222,140 @@ store-procedure putblock set $curcol %begpos %cline redraw-display set $discmd TRUE + set $debug FALSE +!endm + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; Draw a box + + delete-buffer "[box]" + delete-buffer "[simple-box]" + delete-buffer "[double-box]" + +store-procedure box +; set $debug TRUE + set $discmd FALSE + !if &less $curline $mline + exchange-point-and-mark + !endif + set %endline $curline + set %rcol $curcol + set %endpos $cwline + exchange-point-and-mark + set %topline $curline + set-mark + set %lcol $curcol + !if &les %rcol %lcol + set %rctmp %lcol + set %lcol %rcol + set %rcol %rctmp + !endif + 1 detab-region + previous-line + set $curcol %lcol + !if &equ $curline %endline + ; insert horizontal line + !while ¬ &gre $curcol %rcol + overwrite-string %hor + !endwhile + !else + !if &equ %lcol %rcol + ; insert vertical line + !while ¬ &gre $curline %endline + end-of-line + !while &les $curcol %lcol + overwrite-string " " + !endwhile + !force set $curcol %lcol + overwrite-string %ver + next-line + !endwhile + !else + ; insert box + set %rc %rcol - 1 + set %lc %lcol - 1 + ; insert upper left corner + overwrite-string %ulc + ; insert line + !while ¬ &equ $curcol %rc + overwrite-string %hor + !endwhile + ; insert upper right corner + overwrite-string %urc + next-line + !while &gre %endline $curline + 1 detab-region + previous-line + end-of-line + ; pad line up to the left side of the box + !while &les $curcol %lc + overwrite-string " " + !endwhile + !force set $curcol %lcol + overwrite-string %ver + end-of-line + !while &les $curcol %rc + overwrite-string " " + !endwhile + !force set $curcol %rcol + overwrite-string %ver + next-line + !endwhile + 1 detab-region + previous-line + end-of-line + ; pad line up to the left side of the box + !while &les $curcol %lc + overwrite-string " " + !endwhile + !force set $curcol %lcol + overwrite-string %llc + !while ¬ &equ $curcol %rc + overwrite-string %hor + !endwhile + overwrite-string %lrc + !endif + !endif + set $cwline %endpos + set $discmd TRUE +!endm + +; display single box + +store-procedure simple-box + set %ulc "┌" + set %urc "â”" + set %lrc "┘" + set %llc "â””" + set %hor "─" + set %ver "│" + run box +!endm + +; display double box + +store-procedure double-box + set %ulc "â•”" + set %urc "â•—" + set %lrc "â•" + set %llc "╚" + set %hor "â•" + set %ver "â•‘" + run box !endm -macro-to-key b-change-line S-FN1 +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +macro-to-key simple-box S-FN1 macro-to-key b-del-block S-FN2 -macro-to-key b-draw-box S-FN3 +macro-to-key double-box S-FN3 macro-to-key b-copy-block S-FN4 -macro-to-key b-ins-line S-FN5 +!force unbind-key S-FN5 macro-to-key b-yank-block S-FN6 -macro-to-key b-ins-blank S-FN7 +!force unbind-key S-FN7 macro-to-key b-ins-block S-FN8 +!force unbind-key S-FN9 +!force unbind-key S-FN0 ; and init some variables set %rcltype 2 diff --git a/cmd/c.hlp b/cmd/c.hlp new file mode 100644 index 0000000..acbbeca --- /dev/null +++ b/cmd/c.hlp @@ -0,0 +1,4628 @@ +@_bios_keybrd +_bios_keybrd (MSVC) Return the keyboard status or keycode +#include +#include +unsigned short _bios_keybrd(unsigned short service) +See also: mapdoskey +@_errarg +_errarg (THEOS) Variable used by error message functions +#include +extern char *_errarg; +See also: strerror +@_errnum +_errnum (THEOS) External integer for return of error status +#include +extern short _errnum; +Functions setting _errnum: access,chdir,clearerr,diropen,erase,fclear,fclose, +fcreate,fopen and derivates,getmsg,mkdir,open,remove,rename,rmdir,topen,unlink +See also: errno,fperror +@_incrmem +_incrmem (THEOS) ??? +#include +char *_incrmem(size_t len); +@_mfg_get_date +_mfg_get_date (THEOS) Copy hardware date into the nuc structure +#include +void _mfg_get_date(void); +See also: _mfg_get_time,_mfg_put_date,_mfg_put_time +@_mfg_get_time +_mfg_get_time (THEOS) Copy hardware time into the nuc structure +#include +void _mfg_get_time(void); +See also: _mfg_get_date,_mfg_put_date,_mfg_put_time +@_mfg_init +_mfg_init (THEOS) Initialise system hardware +#include +long _mfg_init(long addr,long *store); +@_mfg_put_date +_mfg_put_date (THEOS) Copy date from the nuc structure to hardware +#include +void _mfg_put_date(void); +See also: _mfg_get_date,_mfg_get_time,_mfg_put_time +@_mfg_put_time +_mfg_put_time (THEOS) Copy time from the nuc structure to hardware +#include +void _mfg_put_time(void); +See also: _mfg_get_date,_mfg_get_time,_mfg_put_date +@_mfg_reserved +_mfg_reserved (THEOS) ??? +#include +void _mfg_reserved(void) +@_monthen +_monthen (THEOS) Return the number of days in a month +#include <_time.h> +short _monthen(short year,short month); +See also: leapyear,_yday +@_msec_off +_msec_off (THEOS) Turn off millisecond timing +#include +void _msec_off(void); +See also: msec_on +@_msec_on +_msec_on (THEOS) Turn on millisecond timing +#include +void _msec_on(void); +See also: msec_off +@_read +_read (THEOS) Read data from a file into any segment +#include +size_t _read(short fd,unsigned seg,void *buf,size_t len); +See also: close,creat,filelength,flush,lseek,open,read,tell,_write,write +@_rsvmem +_rsvmem (THEOS) ??? +#include +short *_rsvmem(long addr,long len,short code); +@_sched_int +_sched_int (THEOS) Schedule interrupt +#include +void _sched_int(short num,short (*addr)()); +@_set_slice +_set_slice (THEOS) Set the user time slice +#include +void _set_slice(short msec); +@_sema_isr +_sema_isr (THEOS) ??? +#include +_sema_isr(short pid,short num,short cmd); +@_setargv +_setargv (+THEOS) Expand wild cards argument to the list of matching files +#include <_stdlib.h> +short _setargv(short *pargc, char ***pargv); +Set : errno +@_sync +_sync (THEOS) Flush the cache +#include +void _sync(short code); +@_weekday +_weekday (THEOS) Return the number of the day in the week +#include <_time.h> +See also: leapyear,_monthen,_yday +@_write +_write (THEOS) Write data to a file from another memory segment +#include +size_t _write(short fd,unsigned seg,void *buf,size_t len); +See also: close,creat,filelength,flush,lseek,open,_read,read,tell,write +@_yday +_yday (THEOS) Return the number of days since the beginning of the year +@a64l +a64l (UNIX) Convert a number from a base-64 ASCII string to a long integer +#include +long a64l(const char *s); +See also: l64a +@abort +abort (ANSI) End program immediately +#include +void abort(void); +See also: exit +@abs +abs (ANSI) Return the absolute value of an integer +#include +short abs(short n); +See also: fabs +@access +access (UNIX) Check if a file can be accessed in a given mode +#include +short access(const char *filename,short mode); +mode : 0 existence, 1 execution, 2 write, 4 read +Set : errno,_errnum +See also: fperror,strerror +@acos +acos (ANSI) Calculate arc cosine +#include +double acos(double x); +@acot +acot (THEOS) Calculate arc cotangent +#include +double acot(double x); +@acsc +acsc (THEOS) Calculate arc cosecant +#include +double acsc(double x); +Set : errno +@addb +addb (THEOS) Add a value to a byte in another memory segment +#include +void addb(void *ofs,unsigned seg,char val); +See also: Other add functions +@addcs +addcs (THEOS) Add a value to a byte in the code segment +#include +void addcs(void *ofs,char val); +See also: Other add functions +@addl +addl (THEOS) Add a value to a long in another memory segment +#include +void addl(void *ofs,unsigned seg,long val); +See also: Other add functions +@addlcs +addlcs (THEOS) Add a value to a long in the code segment +#include +void addlcs(void *ofs,long val); +See also: Other add functions +@addw +addw (THEOS) Add a value to a word in another memory segment +#include +void addw(void *ofs,unsigned seg,short val); +See also: Other add functions +@addwcs +addwcs (THEOS) Add a value to a word in the code segment +#include +void addwcs(void *ofs,short val); +See also: Other add functions +@alarm +alarm (UNIX) Start a timer in seconds generating a signal interrupt +#include +short alarm(short secs); +See also: delay,msalarm,signal +@andb +andb (THEOS) And a value to a byte in another memory segment +#include +void andb(void *ofs,unsigned seg,char mask); +See also: Other and functions +@andcs +andcs (THEOS) And a value to a byte in the code segment +#include +void andcs(void *ofs,char mask); +See also: Other and functions +@andl +andl (THEOS) And a value to a long in another memory segment +#include +void andl(void *ofs,unsigned seg,long mask); +See also: Other and functions +@andlcs +andlcs (THEOS) And a value to a long in the code segment +#include +void andlcs(void *ofs,long mask); +See also: Other and functions +@andw +andw (THEOS) And a value to a word in another memory segment +#include +void andw(void *ofs,unsigned seg,short mask); +See also: Other and functions +@andwcs +andwcs (THEOS) And a value to a word in the code segment +#include +void andwcs(void *ofs,short mask); +See also: Other and functions +@asctime +asctime (ANSI) Convert time structure to ASCII string +#include +char *asctime(const struct tm *tmp); +See also: ctime,gmtime,localtime,mktime,strftime,time +@asec +asec (THEOS) Calculate arc secant +#include +double asec(double x); +Set : errno +@asin +asin (ANSI) Calculate inverse sine +#include +double asin(double x); +Set : errno +@assert +assert (ANSI) Check assertion at run time +#include +void assert(short expression); +@assert +#assert (ANSI) Check assertion at compile time +#assert expression +@at +at (THEOS) Position the cursor on the console +#include +void at(short x,short y); +See also: putch +@atan +atan (ANSI) Calculate inverse tangent +#include +double atan(double x); +@atan2 +atan2 (ANSI) Calculate inverse tangent +#include +double atan2(double num,double den); +Set : errno +@atexit +atexit (ANSI) Specifie a routine to call at normal exit time +#include +short atexit(void (*func)(void)); +See also: exit +@atof +atof (ANSI) Convert ASCII string to floating point +#include +double atof(const char *string); +See also: ftoa,strtod +@atoi +atoi (ANSI) Convert ASCII string to integer +#include +short atoi(const char *string); +Set : errno +See also: itoa +@atol +atol (ANSI) Convert ASCII string to long integer +#include +long atol(const char *string); +Set : errno +See also: ltoa,strtol,strtoul,ultoa +@bcd2ieee +bcd2ieee (THEOS) Convert a bcd floating point to ieee floating point +#include +void bcd2ieee(double *data); +See also: ieee2bcd +@bsearch +bsearch (ANSI) Perform a binary search in a sorted array +#include +void *bsearch(const void *key,const void *array,size_t nbr_mbr,size_t size, + short (*compar)(const void *,const void *)); +See also: lfind,lsearch,qsort +@c3tol +c3tol (ANSI) Convert a three byte integer to a long integer +#include +long c3tol(const void *c); +See also: l3tol,ltoc3,ltol3 +@cabs +cabs (UNIX) Complex absolute value function +#include +double cabs(struct complex z); +@callcsi +callcsi (THEOS) See system +@calloc +calloc (ANSI) Allocate dynamic memory +#include +char *calloc(size_t count,size_t size); +See also: free,malloc,memset,realloc +@cclose +cclose (+THEOS) Close a serial communication file +#include +short cclose(FILE *port) +See also: ccloseall,cgetc,cputc,csetbuf,csetvbuf,getrxcnt,isrxempty,istxfull +@ccloseall +ccloseall (+THEOS) Close all serial communication files +#include +short ccloseall(void) +See also: cclose,cgetc,cputc,csetbuf,csetvbuf,getrxcnt,isrxempty,istxfull +@ceil +ceil (UNIX) Return the smallest integer greater than or equal to a value +#include +double ceil(double z); +See also: floor, round +@cgetc +cgetc (+THEOS) Read a character from a communication file +#include +short cgetc(FILE *port); +See also: cclose,ccloseall,cputc,csetbuf,csetvbuf,getrxcnt,isrxempty,istxfull +@cgets +cgets (ANSI) Accept a string from the console +#include +char *cgets(char *buffer,short len); +See also: getch,fgets,gets +@chdir +chdir (UNIX) Change the current directory +#include +short chdir(const char *path); +Set : errno,_errnum +See also: mkdir,rmdir +@chgrow +chrow (+THEOS) Set the grow factor of file +#include <_io.h> +short chgrow(char *fname,short grow); +See also: filechange +@chlen +chlen (+THEOS) Change the record length and key length of a file +#include <_io.h> +short chlen(char *fname,unsigned short reclen,unsigned short keylen); +@chmod +chmod (+UNIX) Change protections of a file +#include <_io.h> +short chmod(const char *fname,short prot); +@chorg +chorg (+THEOS) Change the organization mode of a file +#include <_io.h> +short chorg(char *fname,unsigned short filestat); +@chown +chown (+UNIX) Change the owner of a file +#include <_io.h> +short chown(const char *fname,short uid,short gid); +@clearerr +clearerr (ANSI) Clear the end-of-file and error status of a file +#include +clearerr(FILE *fp); +Set : _errnum +See also: feof,ferror +@cld +cld (THEOS) Clear direction flag +#include +void cld(void); +See also: std +@cli +cli (THEOS) Clear interrupt +#include +void cli(void); +See also: sti +@clock +clock (ANSI) Get number of clock ticks since system boot +#include +clock_t clock(void); +See also: time +@clock_t +clock_t (ANSI) Type used for the number of clock ticks since system boot +#include +typedef long clock_t; +@close +close (UNIX) Close a file +#include +short close(short fd); +See also: creat,filelength,flush,lseek,open,_read,read,tell,_write,write +@closedir +closedir (+UNIX) Close the directory search +#include +void closedir(DIR*); +See also: opendir,readdir,seekdir,telldir,rewinddir +Set : errno +@con_tran +con_tran (THEOS) Test and translate system control codes +#include +short con_tran(struct ucb *ucb,short ch,unsigned seg,void *buf); +@conmask +conmask (THEOS) Set the console control mask +#include +void conmask(const char *s); +@conin +conin (THEOS) Read character from console +See getch +@conout +conout (THEOS) Display character on the console +See putch +@conrdy +conrdy (THEOS) Test if characters are available on the console +short conrdy(void); +@cos +cos (ANSI) Calculate cosine +#include +double cos(double radian); +Set : errno +@cosh +cosh (ANSI) Calculate hyperbolic cosine +#include +double cosh(double radian); +@cot +cot (THEOS) Calculate cotangent +#include +double cot(double radian); +@coth +coth (THEOS) Calculate hyperbolic cotangent +#include +double coth(double radian); +@cprintf +cprintf (MSC) Format and print text to the console +#include +short cprintf(const char *format,...); +Note: Floating point conversions are not supported +See also: fprintf,printf,sprintf,vfprintf,vprintf,vsprintf +@cputc +cputc (+THEOS) Write a character to a communication file +#include +void cputc(FILE *port,short c); +See also: cclose,ccloseall,cgetc,csetbuf,csetvbuf,getrxcnt,isrxempty,istxfull +@cputs +cputs (ANSI) Write a string to the console +#include +void cputs(const char *s); +See also: cprintf,fputs,printf,putch,puts +@creat +creat (UNIX) Create/truncate a file +#include +short creat(const char *filename,short mode); +See also: close,filelength,flush,lseek,open,_read,read,tell,write,_write +@crt +crt (THEOS) See putchar +@crtcolor +crtcolor (THEOS) Change the colors of subsequent displays on the console +#include +void crtcolor(short fg,short bg,short rfg,short rbg); +See also: hascolor,CLASSGEN command +@csc +csc (THEOS) Calculate cosecant +#include +double csc(double radian); +@csch +csch (THEOS) Calculate hyperbolic cosecant +#include +double csch(double radian); +@csetbuf +csetbuf (+THEOS) Allocate an i/o buffer for a user buffered file +#include +void csetbuf(FILE *port,UBUFFER *buffer); +See also: cclose,ccloseall,cgetc,cputc,csetvbuf,getrxcnt,isrxempty,istxfull +@csetvbuf +csetvbuf (+THEOS) Allocate an i/o buffer for a user buffered file +#include +short csetvbuf(FILE *port,UBUFFER *buffer,short mode,size_t size); +See also: cclose,ccloseall,cgetc,cputc,csetbuf,getrxcnt,isrxempty,istxfull +@csi +csi (THEOS) Execute a CSI command without returning to the current program +#include +void csi(const char *command); +See also: system +@ctime +ctime (ANSI) Convert system time to an ASCII string +#include +char *ctime(const time_t *timep); +See also: asctime,localtime,mktime,strftime,time +@cuserid +cuserid (THEOS) Return the account name currently logged +#include +char *cuserid(char *account); +See also: getlogin,getuid,logname +@datehdng +datehdng (THEOS) Internal function used by testhead +@daylight +daylight (ANSI) Variable indicating if daylight time is used +#include +extern short daylight; +See also: timezone,tzset,tzname +@dec +dec (THEOS) Decrement a byte in another memory segment +#include +void dec(void *ofs,unsigned seg); +See also: Other dec functions +@deccs +deccs (THEOS) Decrement a byte in the code segment +#include +void deccs(void *ofs); +See also: Other dec functions +@deccsl +deccsl (THEOS) Decrement a long in the code segment +#include +void deccsl(void *ofs); +See also: Other dec functions +@deccsw +deccsw (THEOS) Decrement a word in the code segment +#include +void deccsw(void *ofs); +See also: Other dec functions +@decl +decl (THEOS) Decrement a long in another memory segment +#include +void decl(void *ofs,unsigned seg); +See also: Other dec functions +@decw +decw (THEOS) Decrement a word in another memory segment +#include +void decw(void *ofs,unsigned seg); +See also: Other dec functions +@define +#define (ANSI) Define a variable as manifest constant +#define constant value +@delay +delay (THEOS) Suspend operation for a given time +#include +void delay(unsigned code); +See also: alarm,msalarm,sleep +@deletek +deletek (THEOS) Delete a record from on indexed or keyed file +#include +short deletek(FILE *file,const char *key); +See also: readk,readn,readp,writek +@devname +devname (+THEOS) Return the name of a physical device +#include <_stdio.h> +char* devname(int lub); +See also: termname,ttyname,vdiname +@devopen +devopen (THEOS) Open or close a device +#include <_sc.h> +void devopen(struct ucb *ucb,short cmd); +cmd = 0 : open. cmd = 1 : close +@difftime +difftime (ANSI) Return difference between two times +#include +double difftime(time_t newtime,time_t oldtime); +@dir_mount +dir_mount (THEOS) ??? +#include <_sc.h> +void dir_mount(struct diskucb *ucb); +@dir_rd +dir_rd (THEOS) Read a sector in the directory +#include +void dir_rd(struct diskucb *ucb,long sect,void *buf); +@dirclose +dirclose (THEOS) Close the directory search +#include +void dirclose(void); +See also: diropen,dirread,find_first,find_next +@diropen +diropen (THEOS) Open the directory search for files in the current account +#include +short diropen(const char *fn); +Set : _errnum +See also: dirclose,dirread,find_first,find_next +@dirread +dirread (THEOS) Find the next file in the directory +#include +char *dirread(void); +See also: dirclose,diropen,find_first,find_next +@disk_capacity +disk_capacity (THEOS) ??? +#include <_sc.h> +short disk_capacity(short lub,void *disk_struct); +@display +display (THEOS) Display a string on the console +See cputs +@div +div (ANSI) Return the quotient and remainder of the division of two integers +#include +div_t div(short numer,short denomin); +See also: ldiv +@div_t +div_t (ANSI) Used by div +#include +typedef struct {short quot,rem;} div_t; +@dup +dup (UNIX) Duplicate a file descriptor +#include +short dup(short fd); +Set : errno +See also: close,creat,open +@elif +#elif (ANSI) Include code conditionally +#elif (expression); +@else +#else (ANSI) Include code conditionally +#else +@endif +#endif (ANSI) End conditional inclusion of code +#endif +@erase +erase (THEOS) Erase an existing file +See remove +@errbot +errbot (THEOS) Display a system message at the bottom of the console +#include +short errbot(short num,const char *arg[],short c1,short c2,short c3,short c4); +See also: errmsg,putmsg,syserr,yesno +@errmsg +errmsg (THEOS) Display a system message on stderr +#include +void errmsg(short num,const char *arg[]); +See also: errbot,perror,putmsg,strerror,syserr +@errno +errno (ANSI) External integer for return of error status +#include +extern short errno; +Functions setting errno: access,acos,acsc,asec,asin,atan2,atoi,atol,chdir,cos, +dup,erase,fgetc,fputc,fstat,locking,log,log10,log2,mkdir,open,perror,pow,remove, +rename,rmdir,signal,sin,sqrt,stat,unlink,utime +See also: _errnum,perror +@execl +execl (UNIX) Transfer control to a new program +#include +void execl(const char *program,const char *arg0,...,const char *argn,NULL) +See also: execlp,execv,execvp,forktask,system +@execlp +execlp (UNIX) Transfer control to a new program +#include +void execlp(const char *program,const char *arg0,...,const char *argn,NULL) +See also: execl,execv,execvp,forktask,system +@execv +execv (UNIX) Transfer control to a new program +#include +void execv(const char *program,const char *arg[]); +See also: execl,execlp,execvp,forktask,system +@execvp +execvp (UNIX) Transfer control to a new program +#include +void execvp(const char *program,const char *arg[]); +See also: execl,execlp,execv,forktask,system +@exit +exit (ANSI) Terminate a program +#include +void exit(short status); +See also: abort,atexit,csi +@exp +exp (ANSI) Compute exponential function +#include +double exp(double z); +@fabs +fabs (ANSI) Compute absolute value +#include +double fabs(double z); +@farcat +farcat (THEOS) Concatenate strings from different memory segments +#include +void *farcat(unsigned tseg,char *to,unsigned fseg,const char *from); +See also: strcat +@farchr +farchr (THEOS) Locate the first occurence of a byte in a string +#include +void *farchr(unsigned seg,const void *ofs,short c); +See also: memchr,strpbrk,strchr,strrchr,strstr +@farcmp +farcmp (THEOS) Compare two buffers in different memory segments +#include +short farcmp(unsigned seg1,const void *ofs1,unsigned seg2,const void *ofs2, + size_t len); +See also: fareq,memcmp,memeq,memicmp,strcmp,streq,stricmp,strncmp,strneq, + strnicmp +@farcpy +farcpy (THEOS) Copy one buffer to another buffer in another memory segment +#include +short farcpy(unsigned tseg,void *to,unsigned fseg,const void *from,size_t len); +See also: farcpy,memccpy,memcpy,memmove,memrcpy,strdup,strmake,strncpy +@fareq +fareq (THEOS) Compare two string in different memory segments for equality +#include +short fareq(unsigned seg1,const void *ofs1,unsigned seg2,const void *ofs2); +See also: farcmp,memcmp,memeq,memicmp,strcmp,streq,stricmp,strncmp,strneq, + strnicmp +@farlen +farlen (THEOS) Return the length of a string in another memory segment +#include +size_t farlen(unsigned seg,const char *ofs); +See also: strlen +@farset +farset (THEOS) Initialize a buffer in another memory segment +#include +void *farset(unsigned seg,void *ofs,short c,size_t len); +See also: memset,strnfill,strnset,strset +@fbuf +fbuf (THEOS) Allocate an i/o buffer for an open file +#include +void fbuf(FILE *stream,void *buffer,size_t len); +See also: setbuf,setvbuf,vbuf +@fclear +fclear (+THEOS) Clear a direct,indexed or keyed file +#include <_stdio.h> +short fclear(char *fname); +Set : _errnum +@fclose +fclose (ANSI) Close a file +#include +short fclose(FILE *fp); +Set : _errnum +See also: fcloseall,fflush,flushall +@fcloseall +fcloseall (MSC) Close all the open files +#include +short fcloseall(void); +See also: fclose,fflush,flushall +@fcntl +fcntl (UNIX) Access to file control bloc +#include +short fcntl(FILE *stream,short type,size_t value); +See also: feof,fgetpos,fopen,fsetpos,ftell +@fcreate +fcreate (THEOS) Create an indexed,keyed or direct file +#include +short fcreate(const char *fname,const char *mode,short rlen,short klen,long size); +Set : _errnum +See also: creat,fopen,makelib +@fdopen +fdopen (UNIX) Return a stream pointer to a file opened by open,creat or pipe +#include +FILE *fdopen(short fd,const char *type); +See also: creat,fileno,open,pipe +@feof +feof (ANSI) Determine if a file's current position is at end-of-file +#include +short feof(FILE *fp); +@ferror +ferror (ANSI) Test an open file for its error status +#include +short ferror(FILE *fp); +See also: clearerr,feof,file_err,fperror +@fflush +fflush (ANSI) Write any data in a file's output buffer to the file +#include +short fflush(FILE *fp); +See also: flushall,fclose +@fgetc +fgetc (ANSI) Read one character from a stream +#include +short fgetc(FILE *fp); +Set : errno +See also: fgets,getch,getchar +@fgetl +fgetl (THEOS) Read a long integer from a stream +#include +long fgetl(FILE *fp); +See also: fgetc,fgetw,fputc,fputl,fputw +@fgetpos +fgetpos (ANSI) Get a file's current position pointer +#include +short fgetpos(FILE *fp,fpos_t *pos); +See also: fsetpos,ftell +@fgets +fgets (ANSI) Read a string from a stream up to a new line +#include +char *fgets(char *s,size_t n,FILE *fp); +See also: fgetsn,gets,keyin +@fgetsn +fgetsn (THEOS) Read a buffer from a stream +#include +char *fgetsn(char *s,size_t n,FILE *fp); +See also: fgets,gets,keyin +@fgetw +fgetw (THEOS) Read an integer from a stream +#include +short fgetw(FILE *fp); +See also: fgetc,fgetl,fputc,fputl,fputw +@fgrow +fgrow (THEOS) Set the grow factor of file +#include +short fgrow(FILE *fp,short grow); +See also: filechange +@file_err +file_err (THEOS) Test an open file and exit if error +#include +void file_err(FILE *fp); +See also: clearerr,feof,ferror,fperror,syserr +@filechange +filechange (THEOS) Change a file's directory entry (date,owner,protection...) +#include +short filechange(const char *fn,short type,size_t value); +See also: access,fgrow,utime +@filelength +filelength (+MSC) Return the current filelength +#include <_io.h> +size_t filelength(short fd); +See also: close,creat,flush,lseek,open,_read,read,tell,_write,write +@filelock +filelock (THEOS) Lock a region in a file +#include +short filelock(FILE *fp,short code,unsigned long from,unsigned long to); +See also: locking,reclock,recunlock,unlock +@fileno +fileno (UNIX) Get the file number of a open file +#include +short fileno(FILE *fp); +@find_first +find_first (MSC) Find first entry matching selection in the directory +short find_first(char *mask,void *diskfind); +See also: dirclose,diropen,dirread,find_next +@find_next +find_next (MSC) Find next entry matching selection in the directory +#include <_sc.h> +short find_next(void *diskfind); +See also: dirclose,diropen,dirread,find_first +@floor +floor (ANSI) Return the largest integer less than or equal to a value +#include +double floor(double z); +See also: ceil, round +@flush +flush (THEOS) Write any data in a file's output buffer to the file +#include +short flush(short filenum); +See also: close,creat,filelength,lseek,open,_read,read,tell,_write,write +@flushall +flushall (THEOS) Flush all the files opened for output +#include +short flushall(void); +See also: fflush +@fmod +fmod (ANSI) Return the remainder of a division +#include +double fmod(double x,double y); +@fopen +fopen (ANSI) Open a file +#include +FILE *fopen(const char *name,const char *type); +Set : _errnum +See also: access,freopen +@force +force (THEOS) Force another process to execute a command +#include +void force(short pid,char *cmd); +@fork +fork (UNIX) Spawn a sub-task in a free partition +#include +short fork(void); +See also: forktask,killtask,suicide +@forktask +forktask (UNIX) Spawn a sub-task in a given partition +short forktask(short pid); +See also: fork,killtask,suicide +@formask +formask (THEOS) Display disk format parameters and query +#include +void formask(void); +See also: formclear,formincr,formparm +@formclear +formclear (THEOS) Clear the disk directory +void formclear(struct diskucb *ucb,char *label,short dirct,short trkct, + short hdct,short sectct,short density); +See also: formask,formincr,formparm +@formincr +formincr (THEOS) Set disk format sectors interleave table +void formincr(short incr,short sects,short *lacetable); +See also: formask,formclear,formparm +@formparm +formparm (THEOS) Sets disk format parameters from command line +void formparm(short argc,char **argv); +See also: formask,formclear,formincr +@fperror +fperror (THEOS) Display the system message pointed by _errnum on stderr +#include +short fperror(); +See also: errmsg,file_err,perror,syserr +@fpos_t +fpos_t (ANSI) Used to represent the position in a file +#include +typedef long fpos_t; +@fprintf +fprintf (ANSI) Print formatted output to a stream +#include +short fprintf(FILE *fp,const char *format,...); +See also: cprintf,printf,sprintf,vfprintf,vprintf,vsprintf +@fputc +fputc (ANSI) Write a character to a stream +#include +short fputc(char c,FILE *fp); +Set : errno +See also: putc,putchar +@fputl +fputl (THEOS) Write a character to a stream +#include +long fputl(long l,FILE *fp); +See also: fgetc,fgetl,fgetw,fputc,fputw +@fputs +fputs (ANSI) Write a string to a stream +#include +short fputs(const char *string,FILE *fp); +See also: fputsn,fputsnl,puts +@fputsn +fputsn (THEOS) Write a buffer to a stream +#include +char *fputsn(const char *string,FILE *fp); +See also: fputs,fputsnl,puts +@fputsnl +fputsnl (ANSI) Write a buffer to a stream and append a newline +#include +short fputsnl(const char *string,FILE *fp); +See also: fputs,fputsn,puts +@fputw +fputw (THEOS) Write an integer to a stream +#include +short fputw(short word,FILE *fp); +@fread +fread (ANSI) Read data from file stream +#include +short fread(void *buffer,size_t size,size_t nitems,FILE *fp); +See also: fgets,fgetsn,fgetc,fgetl,fgetw +@free +free (ANSI) Return dynamic memory to free memory pool +#include +void free(void *ptr); +See also: calloc,malloc,realloc +@free_sel +free_sel (THEOS) Release a memory selector +#include +void free_sel(short sel); +See also: make_sel +@freopen +freopen (ANSI) Open a stream using an existing file stream pointer +#include +FILE *freopen(const char *filename,const char *type,FILE *fp); +See also: access,fdopen,fopen +@frexp +frexp (ANSI) Break a floating point into mantissa and exponent power of two +#include +double frexp(double x,short *ep); +See also: ldexp +@fscanf +fscanf (ANSI) Format input from a file stream +#include +short fscanf(FILE *fp,const char *format,...); +See also: scanf,sscanf +@fseek +fseek (ANSI) Change a stream position pointer +#include +short fseek(FILE *fp,fpos_t pos,short base); +See also: fsetpos,rewind,seek +@fsetpos +fsetpos (ANSI) Change a stream position pointer +#include +short fsetpos(FILE *fp,fpos_t pos); +See also: fseek,rewind,seek +@fsign +fsign (THEOS) Return the sign of a floating point value +#include +short fsign(double x); +@ftell +ftell (ANSI) Return current position of stream pointer +#include +long ftell(FILE *fp); +See also: fgetpos +@ftoa +ftoa (THEOS) Convert a floating point value to a string +#include +char *ftoa(char *s,double f); +See also: itoa,ltoa,utoa +@fwrite +fwrite (ANSI) Write data to a stream +#include +short fwrite(const void *buffer,size_t size,size_t n,FILE *fp); +See also: fputc,fputl,fputs,fputsn,fputsnl,fputw,putch +@gcd +gcd (THEOS) Return the greatest common divisor of two values +#include +double gcd(double x,double y); +@get_line +get_line (THEOS) Accept an edited line from the standard input +#include +char *get_line(char *line); +See also: gets +@get_sect +get_sect (THEOS) ??? +#include +struct fdb *get_sect(char *fn,char *buf,long *sect); +@getar +getar (THEOS) Internal function used by malloc +@getbp +getbp (THEOS) Return the value of the BP register +#include +void *getbp(void); +See also: getcs,getcsa,getds,getldt,gettib +@getc +getc (ANSI) Read a character from a stream +See fgetc +@getch +getch (MSC) Read a character from the console +#include +short getch(void); +See also: getc,getchar +@getchar +getchar (ANSI) Read character from the standard input +#include +short getchar(void); +See also: getc,getch +@getclass +getclass (THEOS) Return the console or printer class code +#include +short getclass(short lub); +@getcs +getcs (THEOS) Return the value of the CS register +#include +unsigned getcs(void); +See also: getbp,getcsa,getds,getldt,gettib +@getcsa +getcsa (THEOS) Return the value of the CS register +#include +unsigned getcsa(void); +See also: getbp,getcs,getds,getldt,gettib +@getcwd +getcwd (UNIX) Return the current directory name +#include +char *getcwd(char *s,size_t len); +@getdate +getdate (THEOS) Return the current system date +#include +char *getdate(char *buffer) +See also: gettime,time +@getdev +getdev (THEOS) Return the device or lub number of an open file +#include +short getdev(FILE *fp); +@getdevn +getdevn (+THEOS) Return the device or lub number of a device name +#include <_stdlib.h> +short getdevn(char *name); +@getds +getds (THEOS) Return the value of the DS register +#include +unsigned getds(void); +See also: getbp,getcs,getcsa,getldt,gettib +@getenv +getenv (ANSI) Read environmental variable +#include +char *getenv(const char *variable); +See also: getcwd,getlang,getlib,putenv +@getenvle +getenvle (THEOS) Internal function used by putenv +@getflag +getflag (THEOS) Get processor flag register +#include +long getflag(void); +@getfn +getfn (THEOS) Return the full pathname of a file +#include +char *getfn(char *fn); +See also: locate +@getkey +getkey (THEOS) Get a system keyword token +#include +short getkey(short keynum,char *s); +See also: keyclose,matcharg +@getlang +getlang (THEOS) Return the current language code for the partition +#include +short getlang(void); +See also: getenv +@getldt +getldt (THEOS) Return the Local Descriptor Table selector +#include +unsigned getldt(void); +See also: getbp,getcs,getcsa,getds,gettib +@getlib +getlib (THEOS) Return the default library name for the partition +#include +char *getlib(void); +See also: getcwd,getenv +@getlimit +getlimit (THEOS) Return the maximum address of a memory segment +#include +size_t getlimit(unsigned seg); +See also: getmem +@getll +getll (THEOS) Return the line length of the console or a printer +#include +short getll(short lub); +See also: getpl +@getlogin +getlogin (UNIX) Return the name of the account currently logged +#include +char *getlogin(void); +See also: cuserid,getuid,logname +@getlub +getlub (THEOS) Return the ucb number associated with a logical device +#include +short getlub(short lub); +See also: getucb +@getmem +getmem (THEOS) Allocate memory from the system pool +#include +unsigned getmem(size_t size,short table); +See also: calloc,malloc,putmem,shared +@getmsec +getmsec (THEOS) Return the current time of day to the nearest millisecond +#include +char *getmsec(char *s); +See also: gettime,ctime,time +@getmsg +getmsg (THEOS) Return a system message +#include +char *getmsg(short num); +Set : _errnum +See also: errbot,errmsg,putmsg,strerror,syserr +@getmsw +getmsw (THEOS) Get Machine Status Word +#include +long getmsw(void); +@getpid +getpid (UNIX) Return the process number +#include +short getpid(void); +See also: getppid +@getpl +getpl (THEOS) Return the page length of the console or a printer +#include +short getpl(short lub); +See also: getll +@getppid +getppid (UNIX) Return the parent partition number +#include +short getppid(void); +See also: getpid +@getpriv +getpriv (THEOS) Return the privilege level +#include +short getpriv(void); +@getprty +getprty (+THEOS) Return task priority +#include <_stdlib.h> +short getprty(); +See also: setprty +@getrxcnt +getrxcnt (+THEOS) Return the number of characters in the input buffer +#include +short getrxcnt(FILE *port); +See also: cclose,ccloseall,cgetc,cputc,csetbuf,csetvbuf,isrxempty,istxfull +@gets +gets (ANSI) Read string from the standard input +#include +char *gets(char *buffer); +See also: fgets,fgetsn,get_line,keyin +@gettib +gettib (THEOS) Return the Task Information Block selector +#include +unsigned gettib(void); +See also: getbp,getcs,getcsa,getds,getldt,tib +@gettime +gettime (THEOS) Return the current system time +#include +char *gettime(char *buffer); +See also: getdate,time +@getucb +getucb (THEOS) Return the address of the UCB associated with an attached device +#include +struct ucb *getucb(short lub); +See also: getlub +@getuid +getuid (UNIX) Return the number of the account currently logged +#include +short getuid(void); +See also: getlogin +@getver +getver (THEOS) Return the version number,name,serial number +#include +void getver(short code,char *str); +See also: getenv +@getvol +getvol (THEOS) Return a disk or tape volume label +#include +char *getvol(short lub); +@getw +getw (ANSI) Read a word from a file stream +See fgetw +@gmtime +gmtime (ANSI) Convert system time to calendar structure in GMT time +#include +struct tm *gmtime(const time_t *timep); +See also: asctime,ctime,localtime,mktime,strftime,time +@has +has (THEOS) Test if the console can display a character or an attribute +#include +short has(short c); +See also: hascolor +@hascolor +hascolor (THEOS) Test if the console can display colors +#include +short hascolor(void); +See also: crtcolor,has +@hasmouse +hasmouse (+THEOS) Test if a session mouse is available +#include +int hasmouse(void); +See also: mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@hypot +hypot (UNIX) Compute the length of the hypotenuse of a right triangle +#include +double hypot(double x,double y); +@i2tol +i2tol (THEOS) Convert two integers to a long integer +long i2tol(short i[2]); +Note: Not implemented in THEOS 386 C. +@ieee2bcd +ieee2bcd (THEOS) Convert an ieee floating point to bcd floating point +#include +void ieee2bcd(double *data) +See also: bcd2ieee +@if +#if (ANSI) Include code conditionally +#if (expression); +@ifdef +#ifdef (ANSI) Include code conditionally +#ifdef identifier +@ifndef +#ifndef (ANSI) Include code conditionally +#ifndef identifier +@inb +inb (THEOS) Read a byte from a i/o port +#include +unsigned inb(unsigned port); +See also: ind,insb,insd,insw,inw +@include +#include (ANSI) Copy a header file into a program +#include +#include "file.h" +@ind +ind (THEOS) Read a long from a i/o port +#include +unsigned long ind(unsigned port); +See also: inb,insb,insd,insw,inw +@insb +insb (THEOS) Read bytes from a i/o port +#include +void insb(unsigned port,unsigned seg,void *offset,size_t len); +See also: inb,ind,insd,insw,inw +@interrupt +interrupt (THEOS) Interrupt function declarator +void interrupt isr(void); +@insd +insd (THEOS) Read longs from a i/o port +#include +void insd(unsigned port,unsigned seg,void *offset,size_t len); +See also: inb,ind,insb,insw,inw +@insw +insw (THEOS) Read words from a i/o port +#include +void insw(unsigned port,unsigned seg,void *offset,size_t len); +See also: inb,ind,insb,insd,inw +@inw +inw (THEOS) Read a word on a i/o port +#include +unsigned inw(unsigned port); +See also: ind,insb,insd,insw,inw +@ioctl +ioctl (UNIX) Perform extended I/O control on devices +#include +short ioctl(FILE *fp,struct bytecntl *action); +short ioctl(FILE *fp,struct diskcntl *action); +short ioctl(FILE *fp,struct tapecntl *action); +@ip +ip (THEOS) Return the integral part of a value +#include +double ip(double x); +See also: modf +@inc +inc (THEOS) Increment a byte in another memory segment +#include +void inc(void *ofs,unsigned seg); +See also: Other inc functions +@inccs +inccs (THEOS) Increment a byte in the code segment +#include +void inccs(void *ofs); +See also: Other inc functions +@inccsl +inccsl (THEOS) Increment a long in the code segment +#include +void inccsl(void *ofs); +See also: Other inc functions +@inccsw +inccsw (THEOS) Increment a word in the code segment +#include +void inccsw(void *ofs); +See also: Other inc functions +@incl +incl (THEOS) Increment a long in another memory segment +#include +void incl(void *ofs,unsigned seg); +See also: Other inc functions +@incw +incw (THEOS) Increment a word in another memory segment +#include +void incw(void *ofs,unsigned seg); +See also: Other inc functions +@isalnum +isalnum (ANSI) Check if a character is a number or letter +#include +short isalnum(short c); +See also: setlocale +@isalpha +isalpha (ANSI) Check if a character is a letter +#include +short isalpha(short c); +See also: setlocale +@isascii +isascii (UNIX) Check if a character is an ASCII character +#include +short isascii(short c); +See also: setlocale +@isatty +isatty (UNIX) Check if an open file is a serial communication device +#include +short isatty(FILE *stream); +@iscntrl +iscntrl (ANSI) Check if a character is a control character +#include +short iscntrl(short c); +@iscomname +iscomname (+THEOS) Test if a file name is a valid com port name +#include <_stdlib.h> +short iscomname(char *filename); +@iscon +iscon (THEOS) Check if an open file is the console +#include +short iscon(FILE *stream); +@iscsym +iscsym (THEOS) Test if a character is alphabetic or an underscore +#include +short iscsym(short c); +See also: iscsymnum +@iscsymnum +iscsymnum (THEOS) Test if a character is alphanumeric or an underscore +#include +short iscsymnum(short c); +See also: iscsym +@isdigit +isdigit (ANSI) Check if a character is a decimal diqit +#include +short isdigit(short c); +@isdisp +isdisp (THEOS) Check if a character is displayable by most terminal +#include +short isdisp(short c); +See also: isgraph,isprint +@isfnsym +isfnsym (THEOS) Check if a character is valid for a file name +#include +short isfnsym(short c); +See also: issymbol,issymnum +@isgraph +isgraph (ANSI) Check if a character is visible when printed +#include +short isgraph(short c); +See also: setlocale +@ishex +ishex (THEOS) Check if a character is a hexadecimal digit +#include +short ishex(short c); +See also: isxdigit +@isinter +isinter (+THEOS) Check if a character is an international character +#include +short isinter(short c); +See also: isalpha +@islower +islower (ANSI) Check if a character is a lower-case letter +#include +short islower(short c); +See also: setlocale +@isoctal +isoctal (THEOS) Check if a character is an octal digit +#include +short isoctal(short c); +@isprint +isprint (ANSI) Check if a character is visible or is a space +#include +short isprint(short c); +See also: setlocale +@isprtname +isprtname (+THEOS) Test if a file name is a valid printer name +#include <_stdlib.h> +short isprtname(char *filename); +@ispunct +ispunct (ANSI) Check if a character is a punctuation mark +#include +short ispunct(short c); +See also: setlocale +@isrxempty +isrxempty (+THEOS) Test if an input buffer is empty +#include +short isrxempty(FILE *port); +See also: cclose,ccloseall,cgetc,cputc,csetbuf,csetvbuf,getrxcnt,istxfull +@issesdev +issesdev (+THEOS) Test if a device is session capable +#include <_stdlib.h> +short issesdev(FILE *fp); +@isspace +isspace (ANSI) Check if a character prints white space +#include +short isspace(short c); +@issymbol +issymbol (THEOS) Check if a character is a valid first character for a file name +#include +short issymbol(short c); +See also: issymnum +@issymnum +issymnum (THEOS) Check if a character is a valid character for a symbol +#include +short issymnum(short c); +See also: issymbol +@istapname +istapname (+THEOS) Test if a file name is a valid tape name +#include <_stdlib.h> +short istapname(char *filename); +@istxfull +istxfull (+THEOS) Test if an input buffer is empty +#include +short istxfull(FILE *port); +See also: cclose,ccloseall,cgetc,cputc,csetbuf,csetvbuf,getrxcnt,istxfull +@isupper +isupper (ANSI) Check if a character is an upper-case letter +#include +short isupper(short c); +See also: setlocale +@isv86 +isv86 (THEOS) Test if a process is running in Virtual 86 mode +short isv86(short pid); +@isxdigit +isxdigit (ANSI) Check if a charcter is an hexadecimal digit +#include +short isxdigit(short c); +See also: ishex +@itoa +itoa (THEOS) Convert an integer into an ASCII string +#include +char *itoa(char *s,short i); +See also: ftoa,ltoa,utoa +@keyclose +keyclose (THEOS) Close the keyword file used with getkey +#include +void keyclose(void); +See also: getkey,testarg +@keyin +keyin (THEOS) See cgets +@killtask +killtask (THEOS) Kill a subtask +#include +void killtask(short pid); +See also: fork,forktask,suicide +@l3tol +l3tol (UNIX) Convert three bytes integers to longs integers +#include +void l3tol(long *l,const char *c,short cnt); +See also: c3tol,ltoc3,ltol3 +@l64a +l64a (UNIX) Convert a long integer to a base-64 ASCII string +#include +char *l64a(long x); +See also: a64l +@labs +labs (ANSI) Return the absolute value of an long integer +#include +long labs(long l); +See also: abs,fabs +@ldeletek +ldeletek (THEOS) Delete a record from a direct access file +#include +short ldeletek(FILE *fp,const long *key); +See also: lreadk,lreadn,lwritek +@ldexp +ldexp (ANSI) Combine fraction and exponent +#include +double ldexp(double x,short exp); +See also: frexp +@ldiv +ldiv (ANSI) Return the quotient and remainder of the division of two longs +#include +ldiv_t ldiv(long numer,long denom) +@ldiv_t +ldiv_t (ANSI) used by ldiv +#include +typedef struct {long quot,rem;} ldiv_t; +See also: div +@leapyear +leapyear (THEOS) Indicate if a year is a leap year +#include +short leapyear(short year); +See also: _monthen,_yday +@lfind +lfind (MSC) Perform a linear search of an array +#include +void *lfind(const void *key,const void *array,size_t nbr_mbr,size_t size, + short (*compar)(const void *,const void *)); +See also: bsearch,lsearch,qsort +@line +#line (ANSI) Reset line numbering +#line number +#line number filename +@linput +linput (+THEOS) Accept a data field from the keyboard like BASIC LINPUT +#include <_stdlib.h> +short linput(char *case,char *before_msg,char *after_msg,char *input_var, + char *output_var,short length,short timeout,short timeout_key); +@load +load (THEOS) Load a program into memory +#include +unsigned load(const char *program,short type); +See also: unload +@load_yn +load_yn (THEOS) Initialise the yesno function +#include +void load_yn(void); +See also: yesno +@loc1 +loc1 (THEOS) Reserved variable for regex +#include +extern char *loc1; +@localtime +localtime (ANSI) Convert system time to calendar structure +#include +struct tm *localtime(time_t *timep); +See also: asctime,ctime,gmtime,mktime,strftime,time +@locate +locate (THEOS) Find a file on disk and return a copy of its FDB +#include +struct fdb *locate(const char *filename,char *buf,short *lub); +See also: getfn +@lock_time +lock_time (THEOS) Set the maximum lock time wait +#include <_stdlib.h> +void lock_time(unsigned char seconds); +See also: timeout +@locking +locking (MSC) Lock or unlock a record in a file +#include +short locking(FILE *fp,short mode,long size); +Set : errno +See also: filelock,reclock,recunlock,unlock +@lockres +lockres (THEOS) "Unlock" a byte in memory +#include +void lockres(void *ofs,unsigned seg); +See also: lockset +@lockset +lockset (THEOS) "Lock" a byte in memory +#include +void lockset(void *ofs,unsigned seg); +See also: lockres +@log +log (ANSI) Compute natural logarithm +#include +double log(double z); +Set : errno +See also: log10,log2 +@log10 +log10 (ANSI) Compute common logarithm +#include +double log10(double z); +Set : errno +See also: log,log2 +@log2 +log2 (THEOS) Compute base 2 logarithm +#include +double log2(double z); +Set : errno +See also: log,log10 +@logname +logname (UNIX) Return the account name currently logged +#include +char *logname(void); +See also: cuserid,getlogin,getuid +@longjmp +longjmp (ANSI) Return from a non-local goto +#include +short longjmp(jmp_buf env,short rval); +See also: setjmp +@lowcase +lowcase (THEOS) See strlwr +@lprime +lprime (+THEOS) Compute the smallest prime greater than or equal to a number +#include <_stdlib.h> +unsigned long lprime(unsigned long n); +See also: prime +@lreadk +lreadk (THEOS) Read a record from a direct access file +#include +short lreadk(FILE *fp,const long *key,void *rec); +See also: ldeletek,lreadn,lwritek +@lreadn +lreadn (THEOS) Read the next record from a direct access file +#include +short lreadn(FILE *fp,long *key,void *rec); +See also: ldeletek,lreadk,lwritek +@lsearch +lsearch (UNIX) Perform a linear search of an array,insert key if non existent +#include +void *lsearch(const void *key,const void *array,size_t nbr_mbr,size_t size, + short (*compar)(const void *,const void *)); +See also: bsearch,lfind,qsort +@lseek +lseek (UNIX) Set read/write position +#include +long lseek(short fd,short how,long where); +See also: close,creat,filelength,flush,open,_read,read,tell,_write,write +@ltoa +ltoa (THEOS) Convert an long integer into an ASCII string +#include +char *ltoa(char *s,short l); +See also: ftoa,itoa,utoa +@ltoc3 +ltoc3 (THEOS) Convert a long integer to a three byte integer +#include +long ltoc3(void *c,long l); +See also: c3tol,l3tol,ltol3 +@ltol3 +ltol3 (UNIX) Convert long integers to three byte integers +#include +long ltol3(void *c,const long *l,short cnt); +See also: c3tol,l3tol,ltoc3 +@lwritek +lwritek (THEOS) Write a record to a direct access file +#include +short lwritek(FILE *fp,const long *key,const void *rec); +See also: ldeletek,lreadk,lreadn +@make_sel +make_sel (THEOS) Create a memory selector +#include +void make_sel(short sel,size_t limit,unsigned long base,short int); +See also: free_sel +@makelib +makelib (THEOS) Create a library file +#include +unsigned makelib(const char *filename,short size); +See also: fcreate +@malloc +malloc (ANSI) Allocate dynamic memory +#include +char *malloc(size_t size); +@match +match (THEOS) Compare a string against a format mask +#include +short match(const char *string,const char *mask); +See also: strcmp,streq +@mapdoskey +mapdoskey (+THEOS) Convert THEOS keycodes to PC keycodes +#include +#include +unsigned short mapdoskey(unsigned short key); +See also: _bios_keybrd +@matcharg +matcharg (THEOS) Compare one string with another with abbreviation capability +#include +short matcharg(const char *string,const char *keyword,short min); +See also: strcmp,streq,strncmp,testarg +@max +max (UNIX) Return the larger of two integers +#include +short max(short a,short b); +@max_alloc +max_alloc (THEOS) Return the size of the larger memory bloc available +#include +size_t max_alloc(void); +See also: calloc,free,malloc,realloc,tot_alloc +@mem_grow +mem_grow (THEOS) ??? +#include +short mem_grow(short seg,long adjust); +@mem_ovly +mem_ovly (THEOS) Adjust the size of the data used by the program +#include +void mem_ovly(size_t size); +@memccpy +memccpy (UNIX) Copy a buffer into another for 'n' bytes or up to a character +#include +void *memcpy(void *to,const void *from,short c,size_t len); +See also: farcpy,memcpy,memmove,memrcpy,strcpy,strdup,strmake,strncpy +@memchr +memchr (ANSI) Locate the first occurrence of a byte in a buffer +#include +void *memchr(const void *buffer,unsigned character,size_t len); +See also: farchr,strpbrk,strchr,strrchr,strstr +@memcmp +memcmp (ANSI) Compare two buffers +#include +short memcmp(const void *buf1,const void *buf2,size_t len); +See also: farcmp,fareq,memeq,memicmp,strcmp,streq,stricmp,strncmp,strneq, + strnicmp +@memcpy +memcpy (ANSI) Copy one buffer into another +#include +void *memcpy(void *to,const void *from,size_t len); +See also: farcpy,memccpy,memmove,memrcpy,strcpy,strdup,strmake,strncpy +@memeq +memeq (THEOS) Compare two buffers for equality +#include +short memeq(const void *buf1,const void *buf2,size_t len); +See also: farcmp,fareq,memcmp,memicmp,strcmp,streq,stricmp,strncmp,strnicmp, + strneq +@memicmp +memicmp (MSC) Compare two buffers,ignoring the casemode of the characters +#include +short memicmp(const void *buf1,const void *buf2,size_t len); +See also: farcmp,fareq,memcmp,memeq,strcmp,streq,stricmp,strncmp,strneq,strnicmp +@memmove +memmove (ANSI) Copy one buffer into another with correct handling of overlapping +void *memmove(void *to,const void *from,size_t len); +See also: farcpy,memcpy,memccpy,memrcpy,strcpy,strdup,strmake,strncpy +@memrcpy +memrcpy (THEOS) Copy one buffer into another in reverse sequence +#include +void *memrcpy(void *to,const void *from,size_t len); +See also: farcpy,memcpy,memccpy,memmove,strcpy,strdup,strmake,strncpy +@memset +memset (ANSI) Fill a buffer with a character +#include +void *memset(char *buffer,short character,size_t len); +See also: farset,strnfill,strset,strnset +@menu +menu (THEOS) Display a menu and wait for a selection +#include +short menu(const char **menu,short count); +See also: menu2 +@menu2 +menu2 (THEOS) Display a menu and wait for a selection +#include +short menu2(const char **menu,short count,short start,short display); +See also: menu +@menumsg +menumsg (+THEOS) Display a menu line a wait for a selection +#include <_stdlib.h> +short menumsg(char *msg,char *key,short timeout,short timeout_key); +@min +min (UNIX) Return the smaller of two integers +#include +short min(short a,short b); +@mkdir +mkdir (MSC) Create a directory +#include +short mkdir(const char *filename); +Set : errno,_errnum +See also: chdir,rmdir +@mktemp +mktemp (UNIX) Generate a temporary file name +#include +char *mktemp(const char *template); +See also: tmpnam,tmpfile,tmpnam +@mktime +mktime (MSC) Convert a time structure into a calendar time +#include +time_t mktime(struct tm *timeptr) +See also: asctime,ctime,gmtime,localtime,strftime,time +@modf +modf (ANSI) Separate integral and fractional part +#include +double modf(double x,double *ip); +See also: ip +@mouse +mouse (+THEOS) Compute mouse position and buttons for subsequent use +#include +short mouse(void); +See also: hasmouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@mousebutton +mousebutton (+THEOS) Return mouse buttons state +#include +short mousebutton(void); +See also: hasmouse, mouse, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@mouseclick +mouseclick (+THEOS) Set mouse click and dclick delay +#include +void mouseclick(long click); +See also: hasmouse, mouse, mousebutton, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@mousedisable +mousedisable (+THEOS) Disable the mouse +#include +void mousedisable(void); +See also: hasmouse, mouse, mousebutton, mouseclick, mouseenable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@mouseenable +mouseenable (+THEOS) Initialise and enable the mouse +#include +void mouseenable(void); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@mousemove +mousemove (+THEOS) Move the mouse pointer +#include +void mousemove(short col, short row); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousescale, mouseswap, mousetell, mousexy +@mousescale +mousescale (+THEOS) Set mouse sensitivity +#include +void mousescale(short scale); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mouseswap, mousetell, mousexy +@mouseswap +mouseswap (+THEOS) Swap mouse left and right buttons +#include +void mouseswap(short flag); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mousetell, mousexy +@mousetell +mousetell (+THEOS) Read mouse swap flag and sensitivity +#include +void mousetell(long *click, short *scale); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousexy +@mousexy +mousexy (+THEOS) Read mouse position +#include +void mousexy(short *col, short *row); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousetell +@move +move (THEOS) Copy one buffer to another buffer in another memory segment +Obsolete function,use farcpy +@msalarm +msalarm (THEOS) Start a timer in milli seconds generating a signal interrupt +#include +long msalarm(long msecs); +See also: delay,alarm,signal +@msgclose +msgclose (THEOS) Close the system message file +#include +void msgclose(void); +See also: getmsg +@no_val +no_val (THEOS) Value of no answer +extern char yes_val; +@NULL +NULL (ANSI) Nul pointer type +#include +#define NULL ((void *)0) +@offsetof +offsetof (ANSI) Offset between the beginning of a structure and a member +#include +offsetof(nom_de_structure,nom_de_membre) +@open +open (UNIX) Open a file +#include +short open(const char *filename,short type,...); +Set : errno,_errnum +See also: close,creat,filelength,flush,lseek,_read,read,tell,_write,write +@opendir +opendir (+UNIX) Open a directory +#include +DIR* opendir(const char* fname); +See also: readdir,closedir,seekdir,telldir,rewinddir +Set : errno +@openhelp +openhelp (THEOS) Open the help file for a program +#include +FILE *openhelp(const char *name); +See also: fopen +@openmenu +openmenu (THEOS) Open the menu file for a program +#include +FILE *openmenu(const char *name); +See also: fopen +@orb +orb (THEOS) Or a byte in another memory segment +#include +void orb(void *ofs,unsigned seg,char mask); +See also: Other or functions +@orcs +orcs (THEOS) Or a byte in the code segment +#include +void orcs(void *ofs,char mask); +See also: Other or functions +@orl +orl (THEOS) Or a long in another memory segment +#include +void orl(void *ofs,unsigned seg,long mask); +See also: Other or functions +@orlcs +orlcs (THEOS) Or a long in the code segment +#include +void orlcs(void *ofs,long mask); +See also: Other or functions +@orw +orw (THEOS) Or a word in another memory segment +#include +void orw(void *ofs,unsigned seg,short mask); +See also: Other or functions +@orwcs +orwcs (THEOS) Or a word in the code segment +#include +void orwcs(void *ofs,short mask); +See also: Other or functions +@outb +outb (THEOS) Write a byte into an i/o port +#include +void outb(unsigned port,char byte); +See also: outd,outsb,outsd,outsw,outw +@outd +outd (THEOS) Write a long into an i/o port +#include +void outd(unsigned port,unsigned long dword); +See also: outb,outsb,outsd,outsw,outw +@outsb +outsb (THEOS) Write bytes into an i/o port +#include +void outsb(unsigned port,unsigned seg,void *offset,size_t len); +See also: outb,outd,outsd,outsw,outw +@outsd +outsd (THEOS) Write longs into an i/o port +#include +void outsd(unsigned port,unsigned seg,void *offset,size_t len); +See also: outb,outd,outsb,outsw,outw +@outsw +outsw (THEOS) Write words into an i/o port +#include +void outsw(unsigned port,unsigned seg,void *offset,size_t len); +See also: outb,outd,outsb,outsd,outw +@outw +outw (THEOS) Write a word into an i/o port +#include +void outw(unsigned port,unsigned word); +See also: outb,outd,outsb,outsd,outsw +@pagewait +pagewait (THEOS) Display the wait prompt and wait the a key +#include +short pagewait(void); +See also: getpl +@pause +pause (THEOS) Wait a state change on ii/o port 61 +void pause(char count); +@pcbsc +pcbsc (THEOS) Read or write char or words in the PCB of any process +#include <_sc.h> +long pcbsc(short type,void *ofs,void *arg); +Le premier PCB commence en PCBSTART,les PCB suivant sont consÉcutifs. Le +dernier PCB est suivi par un entier à 0xFFFF. Tout accÈs à une adresse plus +ÉlevÉe entraine un TRAP #13. + +type = 1 : lit un octet type = 2 : lit un mot de 16 bits +type = 0x8001 : Écrit un octet type = 0x8002 : Écrit un mot de 16 bits + +ofs pointe à l'intÉrieur de la table des PCB +arg valeur à Écrire si type = 0x8001 ou 0x8002 + +Lecture de l'État du PID 0 : status = pcbsc(1,PCBSTART,(void *) 0); +Lecture de la version de l'OS : ver = pcbsc(-1,-1,-1); +@peek +peek (THEOS) Return a byte from another memory segment +#include +unsigned peek(const void *ofs,unsigned seg); +See also: Other peek functions +@peekchar +peekchar (THEOS) ??? +#include <_sc.h> +void peekchar(short pid,short type); +@peekcs +peekcs (THEOS) Return a byte from the code segment +#include +unsigned peekcs(const void *ofs); +See also: Other peek functions +@peekfsa +peekfsa (THEOS) ??? +#include <_sc.h> +short peekfsa(void *ofs); +@peekl +peekl (THEOS) Return a long from another memory segment +#include +unsigned long peekl(const void *ofs,unsigned seg); +See also: Other peek functions +@peeklcs +peeklcs (THEOS) Return a long from the code segment +#include +unsigned long peeklcs(const void *ofs); +See also: Other peek functions +@peeklnuc +peeklnuc (THEOS) Return a long from the nucleus segment +#include +unsigned long peeklnuc(const void *ofs); +See also: Other peek functions +@peeklscr +peeklscr (THEOS) Return a long from the SCR segment +#include +unsigned long peeklscr(const void *ofs); +See also: Other peek functions +@peeknuc +peeknuc (THEOS) Return a byte from the nucleus segment +#include +unsigned peeknuc(const void *ofs); +See also: Other peek functions +@peekp +peekp (THEOS) Return a pointer from another memory segment +#include +void *peekp(const void *ofs,unsigned seg); +See also: Other peek functions +@peekpcs +peekpcs (THEOS) Return a pointer from the code segment +#include +void *peekpcs(const void *ofs); +See also: Other peek functions +@peekpnuc +peekpnuc (THEOS) Return a pointer from the nucleus segment +#include +void *peekpnuc(const void *ofs); +See also: Other peek functions +@peekpscr +peekpscr (THEOS) Return a pointer from the SCR segment +#include +void *peekpscr(const void *ofs); +See also: Other peek functions +@peekscr +peekscr (THEOS) Return a byte from the SCR segment +#include +unsigned peekscr(const void *ofs); +See also: Other peek functions +@peektib +peektib (THEOS) Get bytes in the TIB or RCR of any process +#include <_sc.h> +long peektib(short pid,void *ofs); +L'adressage du scr peut Çtre indiquÉ en ajoutant 0x8000 à l'offset +dans le scr. Ainsi : +peektib(pid,0x8000) Équivaut à peektib(pid,&TIB->scr.logonname[0]) +@peekw +peekw (THEOS) Return a word from another memory segment +#include +unsigned peekw(const void *ofs,unsigned seg); +See also: Other peek functions +@peekwcs +peekwcs (THEOS) Return a word from the code segment +#include +unsigned peekwcs(const void *ofs); +See also: Other peek functions +@peekwnuc +peekwnuc (THEOS) Return a word from the nucleus segment +#include +unsigned peekwnuc(const void *ofs); +See also: Other peek functions +@peekwscr +peekwscr (THEOS) Return a word from the SCR segment +#include +unsigned peekwscr(const void *ofs); +See also: Other peek functions +@perror +perror (ANSI) Display a program defined message with a message pointed by errno +#include +void perror(const char *string); +Set : errno +See also: errmsg,fperror,getmsg,strerror,syserr +@phy_addr +phy_addr (THEOS) Determine physical address of memory selector,lock and unlock +#include +unsigned long phy_addr(unsigned seg,void *offset,size_t len); +See also: getmem,putmem +@pipe +pipe (UNIX) Open an interprocess i/o channel +#include +short pipe(short filenum[2]); +See also: popen +@poke +poke (THEOS) Put a byte into another memory segment +#include +void poke(char val,void *ofs,unsigned seg); +See also: Other poke functions +@pokecs +pokecs (THEOS) Put a byte into the code segment +#include +void pokecs(char val,void *ofs); +See also: Other poke functions +@pokecsa +pokecsa (THEOS) Put a byte into the code segment +#include +void pokecsa(char val,void *ofs); +See also: Other poke functions +@pokel +pokel (THEOS) Put a long into another memory segment +#include +void pokel(long val,void *ofs,unsigned seg); +See also: Other poke functions +@pokelcs +pokelcs (THEOS) Put a long into the code segment +#include +void pokelcs(long val,void *ofs); +See also: Other poke functions +@pokelcsa +pokelcsa (THEOS) Put a long into the code segment +#include +void pokelcsa(long val,void *ofs); +See also: Other poke functions +@pokelscr +pokelscr (THEOS) Put a long into the SCR segment +#include +void pokelscr(long val,void *ofs); +See also: Other poke functions +@pokenuc +pokenuc (THEOS) Put a byte into the nucleus segment +#include +void pokenuc(short val,void *ofs); +See also: Other poke functions +@pokep +pokep (THEOS) Put a pointer into another memory segment +#include +void pokep(void *val,void *ofs,unsigned seg); +See also: Other poke functions +@pokepcs +pokepcs (THEOS) Put a pointer into the code segment +#include +void pokepcs(void *val,void *ofs); +See also: Other poke functions +@pokepcsa +pokepcsa (THEOS) Put a pointer into the code segment +#include +void pokepcsa(void *val,void *ofs); +See also: Other poke functions +@pokepscr +pokepscr (THEOS) Put a pointer into the SCR segment +#include +void pokepscr(void *val,void *ofs); +See also: Other poke functions +@pokescr +pokescr (THEOS) Put a byte into the SCR segment +#include +void pokescr(char val,void *ofs); +See also: Other poke functions +@pokeucb +pokeucb (THEOS) Put a byte into the UCB segment +#include +void pokeucb(short val,void *ofs); +See also: Other poke functions +@pokew +pokew (THEOS) Put a word into another memory segment +#include +void pokew(short val,void *ofs,unsigned seg); +See also: Other poke functions +@pokewcs +pokewcs (THEOS) Put a word into the code segment +#include +void pokewcs(short val,void *ofs); +See also: Other poke functions +@pokewcsa +pokewcsa (THEOS) Put a word into the code segment +#include +void pokewcsa(short val,void *ofs); +See also: Other poke functions +@pokewnuc +pokewnuc (THEOS) Put a word into the nucleus segment +#include +void pokewnuc(short val,void *ofs); +See also: Other poke functions +@pokewscr +pokewscr (THEOS) Put a word into the SCR segment +#include +void pokewscr(short val,void *ofs); +See also: Other poke functions +@pokewucb +pokewucb (THEOS) Put a word into the UCB segment +#include +void pokewucb(short val,void *ofs); +See also: Other poke functions +@popen +popen (UNIX) Open an interprocess i/o channel +#include +short popen(FILE **rd_pipe,FILE **wr_pipe); +See also: pipe +@popf +popf (THEOS) Pop flag register +#include +void popf(void); +See also: pushf +@pow +pow (ANSI) Compute a power of a number +#include +double pow(double z,double x); +Set : errno +@pragma +#pragma Sets compiler options +#pragma align 1 | 2 (default) | 4 +#pragma align struct | -struct (default) +#pragma char signed (default) | unsigned +#pragma field char | word (default) +#pragma float bcd | ieee (default) +#pragma float float (default) | double +#pragma int short (default) | long +#pragma library +#pragma prog version,priv[,mfg,serial][,"copyright"][,patchsize] +#pragma shift logical (default) | arithmetic +@pre_empt +pre_empt (THEOS) ??? +#include +void pre_empt(void); +@prime +prime (THEOS) Compute the smallest prime greater than or equal to a number +#include +unsigned prime(unsigned n); +See also: lprime +@printf +printf (ANSI) Format output +#include +short printf(const char *format,...); +See also: cprintf,fprintf,sprintf,vfprintf,vprintf,vsprintf +@pushf +pushf (THEOS) Push flag register +#include +void pushf(void); +@ptrdiff_t +ptrdiff_t (ANSI) Result type of the substraction of two pointers +#include +typedef long ptrdiff_t; +@putc +putc (ANSI) Write a character to a stream +#include +short putc(char c,FILE *fp); +See also: fputc,putchar +@putch +putch (MSC) Write a character to the console +#include +short putch(short c); +See also: fputc,putc,putchar +@putchar +putchar (ANSI) Write a character to standard output +#include +short putchar(short c); +@putenv +putenv (MSC) Set an environment variable +#include +short putenv(const char *s); +See also: getenv +@putmem +putmem (THEOS) Release memory allocated by getmem +#include +void putmem(unsigned seg); +See also: getmem +@putmsg +putmsg (THEOS) Display a message with parameter substitution +#include +void putmsg(const char *text,const char *arg[]); +See also: errbot,errmsg,getmsg,perror,syserr +@puts +puts (ANSI) Write a string to standard output +#include +void puts(const char *string); +See also: cputs,fputs +@putw +putw (ANSI) Write a word to a stream +#include +short putw(short word,FILE *fp); +See also: getw,fgetw,fputw +@qsort +qsort (ANSI) Sort arrays in memory +void qsort(const void **array,size_t nbr,size_t size, + short (*compar)(const void *,const void *)); +See also: bsearch,sort +@quitoff +quitoff (THEOS) Mask the system quit key +#include +void quitoff(void); +See also: quiton +@quiton +quiton (THEOS) Re-enable the system quit key +#include +void quiton(void); +See also: quitoff +@raise +raise (ANSI) Force a signal interrupt +#include +short raise(short sig); +See also: signal +@rand +rand (ANSI) Generate pseudo-random numbers +#include +short rand(void); +See also: srand +@rbrk +rbrk (THEOS) Internal function +@read +read (ANSI) Read data from a file +#include +short read(short fd,void *buffer,size_t n); +See also: close,creat,filelength,flush,lseek,open,_read,tell,_write,write +@readdir +readdir (+UNIX) Read a directory entry +#include +struct dirent* readdir(DIR*); +See also: opendir,closedir,seekdir,telldir,rewinddir +Set : errno +@readk +readk (THEOS) Read a record from an indexed or keyed file +#include +short readk(FILE *fp,const char *key,void *rec); +See also: deletek,readn,readp,writek +@readn +readn (THEOS) Read next record from an indexed or keyed file +#include +short readn(FILE *fp,char *key,void *rec); +See also: deletek,readk,readp,writek +@readp +readp (THEOS) Read previous record from an indexed or keyed file +#include +short readp(FILE *fp,char *key,void *rec); +See also: deletek,readk,readn,writek +@realloc +realloc (ANSI) Reallocate dynamic memory +#include +char *realloc(void *ptr,size_t size); +See also: calloc,free,malloc,max_alloc,tot_alloc +@reclock +reclock (THEOS) Try to lock a record in a file stream or direct file +#include +short reclock(FILE *fp,fpos_t pos); +See also: filelock,locking,recunlock,unlock +@recunlock +recunlock (THEOS) Try to lock a record in a file stream or direct file +#include +short recunlock(FILE *fp,fpos_t pos); +See also: filelock,locking,reclock,unlock +@regcmp +regcmp (UNIX) Compile a search pattern to be used by the regex search function +#include +char *regcmp(char *pattern,...); +See also: regex,strchr,strstr +@regex +regex (UNIX) Perform a search on a string using a pattern compiled by regcmp +#include +char *regex(char *cpattern,char *object,...); +See also: regcmp,strchr,strstr +@remote +remote (THEOS) Call a function in another code segment +#include +remote(unsigned ofs,unsigned seg,...); +@remove +remove (ANSI) Erase a file +#include +short remove(const char *filename); +Set : errno,_errnum +See also: unlink +@rename +rename (ANSI) Change the name of a file +#include +short rename(const char *old,const char *new); +Set : errno,_errnum +@rewind +rewind (ANSI) Reset file pointer +#include +short rewind(FILE *fp); +See also: fseek,fsetpos,seek +@rewinddir +rewinddir (+UNIX) Sets the directory entry location to the beginning +#include +void rewinddir(DIR*); +See also: opendir,closedir,readdir,telldir,seekdir +@rmdir +rmdir (MSC) Removes a directory +#include +short rmdir(const char*dirname); +Set : errno,_errnum +See also: remove,unlink +@round +round (+THEOS) Round a value to the nearest integer +#include <_math.h> +double round(double value, int position) +See also: ceil, floor +@rsema +rsema (THEOS) Return the status of a remote semaphore +#include +short rsema(short pid,short sema_nbr); +See also: rsemaname,rsemares,rsemaset,rsemawait,sema,semaphore,semares,semaset, + semawait +@rsemaname +rsemaname (THEOS) Return the number of a remote semaphore +#include +short rsemaname(short pid,char *name); +See also: rsema,rsemares,rsemaset,rsemawait,sema,semaphore,semares,semaset, + semawait +@rsemares +rsemares (THEOS) Reset a remote semaphore +#include +short rsemares(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemaset,rsemawait,sema,semaphore,semares,semaset, + semawait +@rsemaset +rsemaset (THEOS) Set a remote semaphore +#include +short rsemaset(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemares,rsemawait,sema,semaphore,semares,semaset, + semawait +@rsemawait +rsemawait (THEOS) Wait until a remote semaphore is set +#include +short rsemawait(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemaset,rsemares,sema,semaphore,semares,semaset, + semawait +@sbrk +sbrk (THEOS) Increase a program's data space +void *sbrk(short increment); +@scanf +scanf (ANSI) Accept and format input +#include +short scanf(char *format,...); +See also: fscanf,sscanf +@schedint +schedint (THEOS) Set or reset an interrupt service routine vector +#include +void schedint(long num,short (*isr)()); +@sec +sec (THEOS) Calculate secant +#include +double sec(double x); +@sech +sech (THEOS) Calculate hyperbolic secant +#include +double sech(double x); +@seek +seek (ANSI) Change a stream position pointer +#include +short seek(FILE *fp,short pos,short base); +See also: fsetpos,rewind,seek +@seekdir +seekdir (+UNIX) Sets the directory entry location +#include +void seekdir(DIR*,long); +See also: opendir,closedir,readdir,telldir,rewinddir +@sema +sema (THEOS) Return the status of a semaphore +#include +short rsema(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemares,rsemaset,rsemawait,semaphore,semares, + semaset,semawait +@semaphore +semaphore (THEOS) Return the number of a semaphore +#include +short semaphore(char *name); +See also: rsema,rsemaname,rsemares,rsemaset,rsemawait,sema,semares,semaset, + semawait +@semares +semares (THEOS) Reset a semaphore +#include +short semares(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemares,rsemaset,rsemawait,sema,semaphore,semaset, + semawait +@semaset +semaset (THEOS) Set a semaphore +#include +short semaset(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemares,rsemaset,rsemawait,sema,semaphore,semares, + semawait +@semawait +semawait (THEOS) Wait until a semaphore is set +#include +short semawait(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemaset,rsemares,rsemawait,sema,semaphore,semares, + semaset +@setbuf +setbuf (ANSI) Allocate an i/o buffer for an open file +#include +void setbuf(FILE *fp,char *buffer); +See also: fbuf,setvbuf,vbuf +@setjmp +setjmp (ANSI) Save or restore the current execution environment for a longjmp +#include +short setjmp(jmp_buf env); +See also: longjmp +@setlocale +setlocale (ANSI) Change or return the current locale switches +#include +char *setlocale(short category,const char *locale); +See also: strcoll,strxfrm,is... and to... functions +@setprty +setprty (THEOS) Change the current process priority +#include +void setprty(short priority); +Set also: setslice,snu +@setvbuf +setvbuf (ANSI) Allocate an i/o buffer for an open file +#include +void setvbuf(FILE *fp,char *buffer,short mode,size_t len); +See also: fbuf,setbuf,vbuf +@sgetl +sgetl (THEOS) Retrieve a long integer stored with sputl +#include +long sgetl(char *buf); +See also: sputl +@shared +shared (THEOS) Define or access memory shared with other process +unsigned shared(char *name,size_t len); +See also: far...,getlimit,add...,and...,dec...,inc...,or...,peek...,poke..., + xor... +@sig_atomic_t +sig_atomic_t (ANSI) Used by signal +#include +typedef short sig_atomic_t; +@signal +signal (ANSI) Set the answer to an interrupt +#include +void *signal(short sig,void (*action()); +Set : errno +See also: alarm,msalarm,raise +@sin +sin (ANSI) Calculate sine +#include +double sin(double radian); +Set : errno +@sinh +sinh (ANSI) Calculate hyperbolic sine +#include +double sinh(double radian); +@size_t +size_t (ANSI) Result type of sizeof +#include +typedef unsigned long size_t; +@skipsp +skipsp (THEOS) Locate the next non-space character in a string +#include +char *skipsp(char *s); +See also: strpbrk +@sleep +sleep (UNIX) Suspend execution for a specified time +#include +void sleep(long msecs); +See also: alarm,clock,delay,msalarm,signal +@snu +snu (THEOS) Release any remaining time in this program's slice time +#include +void snu(void); +@sort +sort (THEOS) Sort an array in memory by rearranging an array of pointers +void sort(void **array,size_t nbr,short (*compar)(const void *,const void *)); +See also: qsort +@spawnl +spawnl (MSC) Spawn another program as a subtask +#include +short spawnl(short mode,const char *program,const char *arg,...,NULL); +Set : errno +See also: execl,execlp,execv,execvp,spawnlp,spawnv,spawnvp +@spawnlp +spawnlp (MSC) Spawn another program as a subtask +#include +short spawnlp(short mode,const char *path,const char *arg,...,NULL); +Set : errno +See also: execl,execlp,execv,execvp,fork,spawn,spawnv,spawnvp +@spawnv +spawnv (MSC) Spawn another program as a subtask +#include +short spawnv(short mode,const char *program,const char *arg[]); +Set : errno +See also: execl,execlp,execv,execvp,fork,spawn,spawnlp,spawnvp +@spawnvp +spawnvp (MSC) Spawn another program as a subtask +#include +short spawnvp(short mode,const char *program,const char *arg[]); +Set : errno +See also: execl,execlp,execv,execvp,fork,spawn,spawnlp,spawnv +@sprintf +sprintf (ANSI) Format output +#include +short sprintf(char *string,const char *format,...); +See also: cprintf,fprintf,printf,vfprintf,vprintf,vsprintf +@sputl +sputl (THEOS) Store a long in an hardware independent format +#include +long sputl(long l,char *buf); +See also: sgetl +@sqrt +sqrt (ANSI) Compute square root +#include +double sqrt(double z); +Set : errno +@srand +srand (ANSI) Seed pseudo-random number generator +#include +void srand(unsigned seed); +See also: rand +@sscanf +sscanf (ANSI) Format input from a string +#include +short sscanf(const char *string,const char *format,...); +@stat +stat (ANSI) Find file attributes +#include +short stat(char *file,struct stat *statptr); +Return : EOF or 0 +Set : errno + +struct stat { + dev_t st_dev; /* pÉriphÉrique */ + ino_t st_ino; /* numÉro d'Inode = 0 */ + mode_t st_mode; /* lsb = protections, msb = filestat */ + nlink_t st_nlink; /* nombre de links = 1 */ + uid_t st_uid; /* identificateur de propriÉtaire */ + gid_t st_gid; /* identificateur de groupe = st_uid */ + dev_t st_rdev; /* pÉriphÉrique physique */ + size_t st_size; /* taille du fichier en octets */ + time_t st_atime; /* date et heure de dernier accÈs ** */ + time_t st_mtime; /* date et heure de derniÈre modif ** */ + time_t st_ctime; /* date et heure de crÉation ** */ + unsigned short st_org; /* organisation : sÉq, key, ind, dir, prg */ + unsigned short st_rlen; /* largeur des enregistrements */ + unsigned short st_klen; /* largeur des clÉs */ + char st_grow; /* taux d'agrandissement */ +}; + +/* ** date de derniÈre modification */ +@std +std (THEOS) Set direction flag +#include +void std(void); +See also: cld +@sti +sti (THEOS) Set interrupt +#include +void sti(void); +See also: cli +@strcat +strcat (ANSI) Append one string to another +#include +char *strcat(char *to,const char *from); +See also: farcat,strncat +@strchr +strchr (ANSI) Locate the first occurence of a character in a string +#include +char *strchr(const char *string1,short c); +See also: farchr,memchr,strpbrk,strrchr,strstr +@strcmp +strcmp (ANSI) Compare two strings +#include +short strcmp(const char *string1,const char *string2); +See also: farcmp,fareq,memcmp,memeq,memicmp,streq,stricmp,strncmp,strneq, + strnicmp +@strcoll +strcoll (ANSI) Compare two strings according to the current collating sequence +#include +short strcoll(const char *s1, const char *s2); +See also: setlocale,strlwr,strupr,strxfrm +@strcpy +strcpy (ANSI) Copy one string into another +#include +char *strcpy(char *to,const char *from); +See also: farcpy,memccpy,memcpy,memmove,memrcpy,strdup,strmake,strncpy +@strcrypt +strcrypt (JMD) Crypt a string +#include <_string.h> +char *strcrypt(char *s); +@strcspn +strcspn (ANSI) Return length for which one string excludes characters in another +#include +unsigned short strcspn(const char *string1,const char *string2); +See also: strpbrk,strspn,strtok +@strdup +strdup (MSC) Makes a copy of a string in previously unallocated memory +#include +char *strdup(const char *from); +See also: farcpy,memccpy,memcpy,memmove,memrcpy,strcpy,strmake,strncpy +@strend +strend (THEOS) Locate the end of a string +#include +char *strend(const char *string); +@streq +streq (THEOS) Compare two strings for equality +#include +short streq(const char *string1,const char *string2); +See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,stricmp,strncmp,strneq, + strnicmp +@strerror +strerror (ANSI) Return a system message with the arguments pointed by _errarg +#include +char *strerror(short num); +See also: _errarg,errmsg,fperror,getmsg,perror,syserr +@strftime +strftime (ANSI) Convert a time structure into a formatted string +#include +size_t strftime(char *s,size_t len,const char *fmt,const struct tm *tp); +See also: asctime,ctime,gmtime,localtime,mktime,time +@stricmp +stricmp (MSC) Compare two buffers,ignoring the casemode of the characters +#include +short stricmp(const void *string1,const void *string2); +See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,streq,strncmp,strneq, + strnicmp +@strlen +strlen (ANSI) Return the length of a string +#include +short strlen(const char *string); +See also: farlen,strend +@strlwr +strlwr (MSC) Convert the alphabetic characters in a string to lower case +#include +char *strlwr(char *s); +See also: strupr,tolower,setlocale +@strmake +strmake (THEOS) Copy a memory buffer to a string,adding the nul terminator +#include +char *strmake(char *to,const char *from,size_t len); +See also: farcpy,memccpy,memcpy,memmove,memrcpy,strcpy,strdup,strncpy +@strncat +strncat (ANSI) Append one string onto another +#include +char *strncat(char *to,const char *from,size_t len); +See also: farcat,strcat +@strncmp +strncmp (ANSI) Compare two strings +#include +short strncmp(const char *string1,const char *string2,size_t len); +See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,streq,stricmp,strneq,strnicmp +@strncpy +strncpy (ANSI) Copy one string into another +#include +char *strncpy(char *to,const char *from,size_t len); +See also: farcpy,memccpy,memcpy,memmove,memrcpy,strcpy,strdup,strmake +@strneq +strneq (THEOS) Compare two strings for equality +#include +short strneq(const char *string1,const char *string2,size_t len); +See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,streq,stricmp,strncmp, + strnicmp +@strnfill +strnfill (THEOS) Fill a buffer with a character +#include +char *strnfill(char *buffer,size_t len,short character); +See also: farset,memset,strset,strnset +@strnicmp +strnicmp (MSC) Compare two buffers,ignoring the casemode of the characters +#include +short stricmp(const void *string1,const void *string2,size_t len); +See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,streq,stricmp,strncmp,strneq +@strnset +strnset (MSC) Fill a string with a character +void *strnset(char *buffer,short character,size_t len); +See also: farset,memset,strnfill,strset +@strpbrk +strpbrk (ANSI) Find first occurrence in a string of any character from another +#include +char *strpbrk(const char *string1,const char *string2); +See also: farchr,memchr,strchr,strrchr,strstr +@strrchr +strrchr (ANSI) Locate the last occurence of a character in a string +#include +char *strrchr(const char *string1,short c); +See also: farchr,memchr,strpbrk,strchr,strstr +@strsave +strsave (THEOS) See strdup +@strset +strset (MSC) Fill a string with a character +void *strset(char *buffer,short character); +See also: farset,memset,strnfill,strnset +@strspn +strspn (ANSI) Return length for which one string includes characters in another +#include +unsigned short strspn(const char *string1,const char *string2); +See also: strpbrk,strcspn,strtok +@strstr +strstr (ANSI) Locate the first occurence of one string within another +#include +char *strstr(const char *string1,const char *string2); +See also: farchr,memchr,strpbrk,strchr,strrchr +@strtod +strtod (ANSI) Convert string to floating point value +#include +double strtod(const char *s,char **es); +See also: atof,ftoa +@strtok +strtok (ANSI) Extract a token from a string +#include +char *strtok(char *string,char *delim); +See also: strcspn,srtrspn +@strtol +strtol (ANSI) Convert string in a specified base a to long integer +#include +double strtol(const char *s,char **es,short base); +See also: atol,ltoa,strtoul,ultoa +@strtoul +strtoul (ANSI) Convert string in a specified base a to unsigned long integer +#include +double strtoul(const char *s,char **es,short base); +See also: atol,ltoa,strtol,ultoa +@strupr +strupr (MSC) Convert the alphabetic characters in a string to upper case +#include +char *strupr(char *s); +See also: strlwr,tolower,setlocale +@strxfrm +strxfrm (ANSI) Convert a string according to the current collating sequence +#include +size_t strxfrm(char* to,char* from,size_t maxsize); +See also: setlocale,strcoll +@subb +subb (THEOS) Substract a value to a byte in another memory segment +#include +void subb(void *ofs,unsigned seg,char val); +See also: Other sub functions +@subcs +subcs (THEOS) Substract a value to a byte in the code segment +#include +void subcs(void *ofs,char val); +See also: Other sub functions +@subl +subl (THEOS) Substract a value to a long in another memory segment +#include +void subl(void *ofs,unsigned seg,long val); +See also: Other sub functions +@sublcs +sublcs (THEOS) Substract a value to a long in the code segment +#include +void sublcs(void *ofs,long val); +See also: Other sub functions +@subw +subw (THEOS) Substract a value to a word in another memory segment +#include +void subw(void *ofs,unsigned seg,short val); +See also: Other sub functions +@subwcs +subwcs (THEOS) Substract a value to a word in the code segment +#include +void subwcs(void *ofs,short val); +See also: Other sub functions +@suicide +suicide (THEOS) Kill the current sub-task +#include +void suicide(void); +See also: killtask +@swab +swab (THEOS) Swap a pair of bytes +#include +void swab(char *src,char *dest,unsigned nb); +@syserr +syserr (THEOS) Display a system message on stderr and exit the program +#include +void syserr(short rc,short num,char *arg[]); +See also: errmsg,exit,putmsg +@system +system (ANSI) Pass a command to the CSI shell for execution +#include +short system(const char *commandline); +@tan +tan (ANSI) Calculate tangent +#include +double tan(double radian); +@tanh +tanh (ANSI) Calculate hyperbolic cosine +#include +double tanh(double radian); +@tell +tell (MSC) Return current position of file's data pointer +#include +long tell(short filenum); +See also: close,creat,filelength,flush,lseek,open,_read,read,_write,write +@telldir +telldir (+UNIX) Return the current directory entry location +#include +long telldir(DIR*); +See also: opendir,closedir,readdir,seekdir,rewinddir +@tempnam +tempnam (ANSI) Generate a unique name for a temporary file +#include +char *tempnam(const char *directory,const char *name); +@termname +termname (+THEOS) Return the class name of a terminal or printer +#include <_stdio.h> +char* termname(int class); +See also: devname,termname,ttyname +@testarg +testarg (THEOS) Compare a string to a system keyword +#include +short testarg(char *arg,short keynbr); +See also: getkey,keyclose,matcharg +@testhead +testhead (THEOS) Control page heading and page wait for stdout +#include +void testhead(char *heading); +See also: datehdng,getll,getpl,pagewait +@testwild +testwild (THEOS) Test if a string include "wild cards" +#include +short testwild(char *s); +@tetd_t +tetd_t (MWC) Type to represent file time and date format +#include +typedef unsigned long tetd_t; +@tetd_to_tm +tetd_to_tm (MWC) Convert file time and date to system calendar format +#include +tm_t *tetd_to_tm(tetd_t time); +See also: tetd_to_time,time_to_tetd,tm_to_tetd +@tetd_to_time +tetd_to_time (MWC) Convert file time and date to a number of seconds +#include +time_t tetd_to_time(tetd_t time); +See also: tetd_to_tm,time_to_tetd,tm_to_tetd +@time +time (ANSI) Get current time in seconds since 01-01-1970 00:00:00 GMT +#include +time_t time(time_t *tp); +@time_t +time_t (ANSI) Type to represent time in seconds since 01-01-1970 00:00:00 GMT +#include +typedef long time_t; +@time_to_tetd +time_to_tetd (MWC) Convert a number of seconds to file time and date format +#include +tetd_t time_to_tetd(time_t t); +See also: tetd_to_tm,tetd_to_time,tm_to_tetd +@timeout +timeout (THEOS) Test if previous read failed because of a lock timeout +#include <_stdio.h> +short timeout(); +See also: lock_time +@timer +timer (THEOS) Set a semaphore on after a given time or a defined time of day +#include +void *timer(short sema_nbr,short type,long msec); +See also: alarm,msalarm,sema,semaphore,semares,semaset,semawait +@timezone +timezone (ANSI) Difference in seconds between GMT time and local time +#include +extern long timezone; +See also: daylight,tzset,tzname +@tm_to_tetd +tm_to_tetd (MWC) Convert system calendar format to file date and time +#include +tetd_t tm_to_tetd(tm_t *time); +See also: tetd_to_tm,tetd_to_time,time_to_tetd +@tmpfile +tmpfile (ANSI) Create and open a temporary file +#include +FILE *tmpfile(void); +See also: fopen,mktemp,lempnam,tmpnam +@tmpnam +tmpnam (ANSI) Generate a unique name for a temporary file +#include +char *tmpnam(char *name); +@toascii +#include +toascii (UNIX) Convert characters to ASCII +#include +short toascii(short c); +@toibmpc +toibmpc (+THEOS) Translate THEOS character to native IBM PC extended ASCII +#include +short toibmpc(short c); +See also: totheos +@tolower +tolower (ANSI) Convert characters to lower case +#include +short tolower(short c); +@topen +topen (THEOS) ??? +#include +FILE *topen(char *fname,char *mode,unsigned reclen,size_t blklen); +Set : _errnum +@tot_alloc +tot_alloc (THEOS) Compute the total amount of available memory +#include +size_t tot_alloc(void); +See also: calloc,free,malloc,max_alloc,realloc +@totheos +totheos (+THEOS) Translate IBM PC extended ASCII character to THEOS character +#include +short totheos(short c); +See also: toibmpc +@toupper +toupper (ANSI) Convert characters to upper case +#include +short toupper(short c); +@trim +trim (THEOS) Remove leading,trailing and multiple spaces +#include +char *trim(char *s); +@ttyname +ttyname (+UNIX) Return the name of the console physical device +#include <_stdio.h> +char* ttyname(FILE* stream); +See also: devname,termname,vdiname +@tzname +tzname (ANSI) Time zones names +#include +extern char *tzname[2]; +See also: daylight,timezone,tzset +@tzset +tzset (UNIX) Determine the time zone name for local time +#include +void tzset(void); +See also: daylight,timezone,tzname +@undef +#undef (ANSI) Undefine a manifest constant +#undef variable +@ungetc +ungetc (ANSI) Return character to input stream +#include +short ungetc(short c,FILE *fp); +See also: ungetch +@ungetch +ungetc (MSC) Return character to standard input +#include +short ungetch(short c); +See also: ungetc +@unlink +unlink (ANSI) Remove a file +#include +short unlink(const char *name); +Set : errno,_errnum +See also: remove +@unload +unload (THEOS) Unload a file from memory +#include +void unload(unsigned seg); +See also: load +@unlock +unlock (THEOS) Unlock a record +#include +void unlock(FILE *file); +See also: filelock,locking,reclock,recunlock +@unwait +unwait (THEOS) Awaken a program waiting for an interrupt +#include +void unwait(short pid); +See also: wait +@upcase +upcase (THEOS) See strupr +@utime +utime (+UNIX) Change the date and time of a file +#include +short utime(const char *filename,struct utimbuf *times); +Set : errno +See also: asctime,ctime,gmtime,localtime,stat,time +@utoa +utoa (THEOS) Convert an unsigned integer into an ASCII string +#include +char *utoa(char *s,unsigned i); +See also: ftoa,itoa,ltoa +@va_arg +va_arg (ANSI) Used to access erguments in a variable argument functions +#include +.... va_arg(va_list *arg_ptr,type); +See also: va_start,va_end +@va_end +va_end (ANSI) End variable argument processing +#include +void va_end(va_list *aptr); +See also: va_arg,va_start +@va_list +va_list (ANSI) Used in variable argument processing +#include +typedef long va_list[1]; +@va_start +va_start (ANSI) Start variable argument processing +#include +void va_start(va_list *arg_ptr,void *ptr); +See also: va_arg,va_end +@vdi +vdi (THEOS) Primitive access to the Virtual Device Interface +#include +void vdi(short vidnum,VDIPB *vdipb); +See also: vdiopen +@vdialpha +vdialpha( THEOS) Switch VDI to text mode +#include +void vdialpha(VDIPB *vdipb); +See also: vdigraph,vdiopen +@vdiarc +vdiarc (THEOS) Draw an arc +#include +void vdiarc(VDIPB *vdipb,short x,short y,short radius,short angle1,short angle2); +See also: vdicircle,vdiopen,vdipie +@vdibar +vdibar (THEOS) Draw a rectangle +#include +void vdibar(VDIPB *vdipb,short llx,short lly,short urx,short ury); +See also: vdiopen +@vdicircle +vdicircle (THEOS) Draw a circle +#include +void vdicircle(VDIPB *vdipb,short x,short y,short radius); +See also: vdiarc,vdiopen,vdipie +@vdiclear +vdiclear (THEOS) Clear the graphics page or perform a form feed +#include +void vdiarc(VDIPB *vdipb); +See also: vdiopen +@vdiclose +vdiclose (THEOS) Close a VDI file +#include +void vdiclose(VDIPB *vdipb); +See also: vdiopen +@vdigraph +vdigraph (THEOS) Swith to graphics mode +#include +void vdigraph(VDIPB *vdipb); +See also: vdialpha,vdiopen +@vdiline +vdiline (THEOS) Draw a line +#include +void vdiline(VDIPB *vdipb,short x1,short y1,short x2,short y2); +See also: vdiopen +@vdimark +vdimark (THEOS) Draw a marker +#include +void vdimark(VDIPB *vdipb,short x,short y); +See also: vdiopen +@vdiname +vdiname (+THEOS) Return the name of a VDI physical device +#include <_stdio.h> +char* vdiname(int vdiclass); +See also: devname,termname,ttyname +@vdiopen +vdiopen (THEOS) Open a graphics device +#include +VDIPB *vdiopen(short num); +See also: vdiclose +@vdipie +vdipie (THEOS) Draw a pie section +#include +void vdipie(VDIPB *vdipb,short x,short y,short radius,short angle1,short angle2); +See also: vdiarc,vdicircle,vdiopen +@vdisetfc +vdisetfc (THEOS) Set fill color +#include +void vdisetfc(VDIPB *vdipb,short color); +See also: vdibar,vdicircle,vdiopen,vdipie +@vdisetfs +vdisetfs (THEOS) Set fill style +#include +void vdisetfs(VDIPB *vdipb,short style); +See also: vdibar,vdicircle,vdiopen,vdipie +@vdisetlc +vdisetlc (THEOS) Set line color +#include +void vdisetlc(VDIPB *vdipb,short color); +See also: vdiarc,vdibar,vdicircle,vdiline,vdiopen,vdipie +@vdisetlh +vdisetlh (THEOS) Set line width or height +#include +void vdisetlh(VDIPB *vdipb,short size); +See also: vdiline,vdiopen +@vdisetls +vdisetls (THEOS) Set line style +#include +void vdisetls(VDIPB *vdipb,short style); +See also: vdiarc,vdibar,vdicircle,vdiline,vdiopen,vdipie +@vdisetmc +vdisetmc (THEOS) Set marker color +#include +void vdisetmc(VDIPB *vdipb,short color); +See also: vdimark,vdiopen +@vdisetmh +vdisetmh (THEOS) Set marker size or height +#include +void vdisetmh(VDIPB *vdipb,short size); +See also: vdimark,vdiopen +@vdisetms +vdisetms (THEOS) Set marker style +#include +void vdisetms(VDIPB *vdipb,short style); +See also: vdimark,vdiopen +@vdisetta +vdisetta (THEOS) Set text angle +#include +void vdisetta(VDIPB *vdipb,short color); +See also: vdiopen,vditext +@vdisettc +vdisettc (THEOS) Set text color +#include +void vdisettc(VDIPB *vdipb,short color); +See also: vdiopen,vditext +@vdisetth +vdisetth (THEOS) Set text size or height +#include +void vdisetth(VDIPB *vdipb,short size); +See also: vdiopen,vditext +@vdisettp +vdisettp (THEOS) Set text path +#include +void vdisettp(VDIPB *vdipb,short path); +See also: vdiopen,vditext +@vdisetts +vdisetts (THEOS) Set text style +#include +void vdisetts(VDIPB *vdipb,short style); +See also: vdiopen,vditext +@vditext +vditext (THEOS) Display a text string +#include +void vditext(VDIPB *vdipb,short x,short y,char *s); +See also: vdiopen +@vfprintf +vfprintf (ANSI) Print formatted output to a stream +#include +short vfprintf(const FILE *stream,const char *FORMAT,va_list arg); +See also: cprintf,fprintf,printf,sprintf,vprintf,vsprintf +@vprintf +vprintf (ANSI) Print formatted output to standard output +#include +short vprintf(const char *FORMAT,va_list arg); +See also: cprintf,fprintf,printf,sprintf,vfprintf,vsprintf +@vsprintf +vsprintf (ANSI) Print formatted output to a string +#include +short vsprintf(char *s,const char *FORMAT,va_list arg); +See also: cprintf,fprintf,printf,sprintf,vfprintf,vprintf +@wait (THEOS) Suspend a program until an interrupt occurs +#include +void wait(void); +See also: unwait +@write +write (ANSI) Write data to a file +#include +size_t write(short fd,void *buffer,size_t len); +See also: close,creat,filelength,flush,lseek,open,_read,read,tell,_write +@writek +writek (THEOS) Write a record to an indexed or keyed file +#include +short writek(FILE *fp,const char *key,const void *rec); +See also: deletek,readk,readn,readp +@xorb +xorb (THEOS) Xor a byte in another memory segment +#include +void xorb(void *ofs,unsigned seg,char mask); +See also: Other xor functions +@xorcs +xorcs (THEOS) Xor a byte in the code segment +#include +void xorcs(void *ofs,char mask); +See also: Other xor functions +@xorl +xorl (THEOS) Xor a long in another memory segment +#include +void xorl(void *ofs,unsigned seg,long mask); +See also: Other xor functions +@xorlcs +xorlcs (THEOS) Xor a long in the code segment +#include +void xorlcs(void *ofs,long mask); +See also: Other xor functions +@xorw +xorw (THEOS) Xor a word in another memory segment +#include +void xorw(void *ofs,unsigned seg,short mask); +See also: Other xor functions +@xorwcs +xorwcs (THEOS) Xor a word in the code segment +#include +void xorwcs(void *ofs,short mask); +See also: Other xor functions +#include <_time.h> +short _yday(short month,short day,short year); +See also: leapyear,_weekday +@yes_val +yes_val (THEOS) Value of yes answer +extern char yes_val; +@yesno +yesno (THEOS) Accept the answer yes or no according to the system keyword file +#include +short yesno(void); +See also: load_yn +@yield +yield (THEOS) See snu +@account +account (THEOS) Format of SYSTEM.ACCOUNT +#include +struct account { + char name[8]; /* [00] - logon id */ + char password[8]; /* [08] - password (spaces if none) */ + char id[2]; /* [10] - account number: + ascii-hex if 00-FE + else: 76543210-76543210 + *3210987 *6543210 + * = always set + if number >= 0x2000, + then synonym to account + & 0x1fff */ + char priv; /* [14] - privlege level */ + char mail_sw; /* [13] - you have mail */ + char abbrev_sw; /* [14] - CSI abbreviation switch */ + char stdsyn_sw; /* [15] - CSI synonym switch */ + char synonym[9]; /* [16] - CSI synonym fn______d */ + char rdy_sw; /* [1F] - CSI ready switch */ + char msg_sw; /* [20] - MSG switch */ + char break_chr[2]; /* [21] - break value (ascii-hex) */ + char work_drv; /* [23] - work drive code */ + char lang_code; /* [24] - default language code */ + char dec_is_comma; /* [25] - decimal is comma switch */ + char def_lib[19]; /* [26] - default library fn.ft:d */ + char mac_lib[9]; /* [39] - macro library fn______d */ + char obj_lib[9]; /* [42] - object library fn______d */ + char copy_lib[9]; /* [4B] - include library fn______d */ + char search[26]; /* [54] - search sequence */ + char cmd_lib[9]; /* [6E] - command library fn______d */ + char link_lib[9]; /* [77] - link library fn______d */ + char csi_case_sw; /* [80] - CSI lower case mode */ + char prompt[50]; /* [81] - CSI prompt */ +}; +@acb +acb (THEOS) Format of accseg in memory +#include +struct acb { + char name[8]; /* [00] - account name */ + short id; /* [08] - account number */ + char msgname[8]; /* [0A] - msg name */ +}; +@TERMINAL_FD +TERMINAL_FD (THEOS) Translate table used by international terminals +#include +struct TERMINAL_FD { + char type_code; + char terminal_name[25]; + near char *home; + near char *fon; + near char *foff; + near char *hon; + near char *hoff; + near char *right; + near char *left; + near char *down; + near char *ulon; + near char *clear; + near char *rvon; + near char *rvoff; + near char *dca; + near char *il; + near char *dl; + near char *setup; + near char *ic; + near char *dc; + near char *uloff; + near char *eol; + near char *eos; + near char *up; + near char *eu; + near char *bon; + near char *boff; + near char *mon; + near char *moff; + near char *color; + near char *koff; + near char *kon; + near char *son; + near char *soff; + near char *ISO_23; + near char *ISO_40; + near char *ISO_5B; + near char *ISO_5C; + near char *down_key; + near char *up_key; + near char *left_key; + near char *right_key; + near char *esc_key; + near char *top_key; + near char *bottom_key; + near char *delchar_key; + near char *page_fwd_key; + near char *page_bck_key; + near char *word_right_key; + near char *word_left_key; + near char *sch_fwd_key; + near char *sch_bck_key; + near char *again_key; + near char *file_key; + near char *erase_key; + near char *beg_line_key; + near char *end_line_key; + near char *case_key; + near char *save_key; + near char *quit_key; + near char *find_key; + near char *replace_key; + near char *del_left_key; + near char *transpose_key; + near char *ins_line_key; + near char *del_line_key; + near char *help_key; + near char *ulc; + near char *urc; + near char *lrc; + near char *llc; + near char *fwi; + near char *li; + near char *ri; + near char *ui; + near char *di; + near char *horiz; + near char *vert; + near char *rulc; + near char *rurc; + near char *rlrc; + near char *rllc; + near char *dulc; + near char *durc; + near char *dlrc; + near char *dllc; + near char *dfsi; + near char *dli; + near char *dri; + near char *dui; + near char *ddi; + near char *dhoriz; + near char *dvert; + near char *slave_enable; + near char *slave_disable; + near char *A_umlaut; + near char *a_umlaut; + near char *a_circumflex; + near char *a_grave; + near char *a_acute; + near char *E_acute; + near char *e_umlaut; + near char *e_circumflex; + near char *e_grave; + near char *e_acute; + near char *i_umlaut; + near char *i_circumflex; + near char *i_grave; + near char *i_acute; + near char *O_umlaut; + near char *o_umlaut; + near char *o_circumflex; + near char *o_grave; + near char *o_acute; + near char *U_umlaut; + near char *u_umlaut; + near char *u_circumflex; + near char *u_grave; + near char *u_acute; + near char *C_tail; + near char *c_tail; + near char *N_squiggle; + near char *n_squiggle; + near char *AE; + near char *ae; + near char *A_degree; + near char *a_degree; + near char *German_esset; + near char *invert_question; + near char *invert_exclaim; + near char *cent; + near char *english_pound; + near char *japenese_yen; + near char *spanish_pentada; + near char *dutch_guilder; + near char *one_quarter; + near char *one_half; + near char *y_umlaut; + near char *section; + near char *degree; + near char *bullet; + near char *A_umlaut_key; + near char *a_umlaut_key; + near char *a_circumflex_key; + near char *a_grave_key; + near char *a_acute_key; + near char *E_acute_key; + near char *e_umlaut_key; + near char *e_circumflex_key; + near char *e_grave_key; + near char *e_acute_key; + near char *i_umlaut_key; + near char *i_circumflex_key; + near char *i_grave_key; + near char *i_acute_key; + near char *O_umlaut_key; + near char *o_umlaut_key; + near char *o_circumflex_key; + near char *o_grave_key; + near char *o_acute_key; + near char *U_umlaut_key; + near char *u_umlaut_key; + near char *u_circumflex_key; + near char *u_grave_key; + near char *u_acute_key; + near char *C_tail_key; + near char *c_tail_key; + near char *N_squiggle_key; + near char *n_squiggle_key; + near char *AE_key; + near char *ae_key; + near char *A_degree_key; + near char *a_degree_key; + near char *German_esset_key; + near char *invert_question_key; + near char *invert_exclaim_key; + near char *cent_key; + near char *english_pound_key; + near char *japenese_yen_key; + near char *spanish_pentada_key; + near char *dutch_guilder_key; + near char *one_quarter_key; + near char *one_half_key; + near char *y_umlaut_key; + near char *section_key; + near char *degree_key; + near char *bullet_key; + near char *ISO_5D; + near char *ISO_5E; + near char *ISO_60; + near char *ISO_7B; + near char *ISO_7C; + near char *ISO_7D; + near char *ISO_7E; + near char *ISO_23_key; + near char *ISO_40_key; + near char *ISO_5B_key; + near char *ISO_5C_key; + near char *ISO_5D_key; + near char *ISO_5E_key; + near char *ISO_60_key; + near char *ISO_7B_key; + near char *ISO_7C_key; + near char *ISO_7D_key; + near char *ISO_7E_key; +}; +@TERMINAL_FE +TERMINAL_FE (THEOS) Translate table used by US terminals +#include +struct TERMINAL_FE { + char type_code; + char terminal_name[25]; + near char *home; + near char *fon; + near char *foff; + near char *hon; + near char *hoff; + near char *right; + near char *left; + near char *down; + near char *ulon; + near char *clear; + near char *rvon; + near char *rvoff; + near char *dca; + near char *il; + near char *dl; + near char *setup; + near char *ic; + near char *dc; + near char *uloff; + near char *eol; + near char *eos; + near char *up; + near char *eu; + near char *bon; + near char *boff; + near char *mon; + near char *moff; + near char *color; + near char *koff; + near char *kon; + near char *son; + near char *soff; + char filler[8]; + near char *down_key; + near char *up_key; + near char *left_key; + near char *right_key; + near char *esc_key; + near char *top_key; + near char *bottom_key; + near char *delchar_key; + near char *page_fwd_key; + near char *page_bck_key; + near char *word_right_key; + near char *word_left_key; + near char *sch_fwd_key; + near char *sch_bck_key; + near char *again_key; + near char *file_key; + near char *erase_key; + near char *beg_line_key; + near char *end_line_key; + near char *case_key; + near char *save_key; + near char *quit_key; + near char *find_key; + near char *replace_key; + near char *del_left_key; + near char *transpose_key; + near char *ins_line_key; + near char *del_line_key; + near char *help_key; + near char *ulc; + near char *urc; + near char *lrc; + near char *llc; + near char *fwi; + near char *li; + near char *ri; + near char *ui; + near char *di; + near char *horiz; + near char *vert; + near char *rulc; + near char *rurc; + near char *rlrc; + near char *rllc; + near char *dulc; + near char *durc; + near char *dlrc; + near char *dllc; + near char *dfsi; + near char *dli; + near char *dri; + near char *dui; + near char *ddi; + near char *dhoriz; + near char *dvert; + near char *slave_enable; + near char *slave_disable; +}; +@PRINTER_FC +PRINTER_FC (THEOS) Translate table used by printers +#include +struct PRINTER_FC { + char type_code; + char printer_name[25]; + near char *bold_on; + near char *bold_off; + near char *ul_on; + near char *ul_off; + near char *ital_on; + near char *ital_off; + near char *color_on; + near char *color_off; + near char *compress_on; + near char *compress_off; + near char *wide_on; + near char *wide_off; + near char *high_on; + near char *high_off; + near char *ulc; + near char *urc; + near char *lrc; + near char *llc; + near char *fwi; + near char *li; + near char *ri; + near char *ui; + near char *di; + near char *horiz; + near char *vert; + near char *rulc; + near char *rurc; + near char *rlrc; + near char *rllc; + near char *dulc; + near char *durc; + near char *dlrc; + near char *dllc; + near char *dfsi; + near char *dli; + near char *dri; + near char *dui; + near char *ddi; + near char *dhoriz; + near char *dvert; + near char *slave_enable; + near char *slave_disable; + near char *A_umlaut; + near char *a_umlaut; + near char *a_circumflex; + near char *a_grave; + near char *a_acute; + near char *E_acute; + near char *e_umlaut; + near char *e_circumflex; + near char *e_grave; + near char *e_acute; + near char *i_umlaut; + near char *i_circumflex; + near char *i_grave; + near char *i_acute; + near char *O_umlaut; + near char *o_umlaut; + near char *o_circumflex; + near char *o_grave; + near char *o_acute; + near char *U_umlaut; + near char *u_umlaut; + near char *u_circumflex; + near char *u_grave; + near char *u_acute; + near char *C_tail; + near char *c_tail; + near char *N_squiggle; + near char *n_squiggle; + near char *AE; + near char *ae; + near char *A_degree; + near char *a_degree; + near char *German_esset; + near char *invert_question; + near char *invert_exclaim; + near char *cent; + near char *english_pound; + near char *japenese_yen; + near char *spanish_pentada; + near char *dutch_guilder; + near char *one_quarter; + near char *one_half; + near char *y_umlaut; + near char *section; + near char *degree; + near char *bullet; + near char *ISO_23; + near char *ISO_40; + near char *ISO_5B; + near char *ISO_5C; + near char *ISO_5D; + near char *ISO_5E; + near char *ISO_60; + near char *ISO_7B; + near char *ISO_7C; + near char *ISO_7D; + near char *ISO_7E; +}; +@elt +elt (THEOS) Exclusive Lock Table +#include +struct elt { + void *lock_ofs; /* [00] - offset address */ + unsigned lock_seg; /* [04] - segment address */ + unsigned char lock_own; /* [06] - pid of owner */ + char lock_flag; /* [07] - set if waiting */ +}; + +#define ELT ((struct elt *)0) +#define ELTLEN 8 +#define ELTSEG 0x0078 +@fcb +fcb (THEOS) File Control Block +See FILE +@FILE +FILE (THEOS) File Control Block +#include +typedef struct fcb { + char _fst; /* [00] - 1 - file status: + 76543210 + ªªªªªªª£© = disk full on last write + ªªªªªª£©© = tape no HDR2 labels + ªªªªª£©©© = tape end of file + ªªªª£©©©© = printer needs close + ªªª£©©©©© = printer + ªª£©©©©©© = buffer has write data + ª£©©©©©©© = buffer allocated + £©©©©©©©© = opened */ + char _flub; /* [01] - 5 - logical unit,255 = null */ + short _faccess; /* [02] - 11 - access mode: + 111111 + 5432109876543210 + ªªªªªªªªªªªªªªª£© = input + ªªªªªªªªªªªªªª£©© = output + ªªªªªªªªªªªªª£©©© = lock + ªªªªªªªªªªªª£©©©© = temp file (erase) + ªªªªªªªªªªª£©©©©© = stream + ªªªªªªªªªª£©©©©©© = relative + ªªªªªªªªª£©©©©©©© = indexed + ªªªªªªªª£©©©©©©©© = keyed + ªªªªªªª£©©©©©©©©© = append mode + ªªªªªª£©©©©©©©©©© = private + ªªªªª£©©©©©©©©©©© = last prt FF + ªªªª£©©©©©©©©©©©© = pipe file + ªªª£©©©©©©©©©©©©© = printer pass-thru + ªª£©©©©©©©©©©©©©© = last prt FE + ª£©©©©©©©©©©©©©©© = lock writes + £©©©©©©©©©©©©©©©© = ix node rd/wr */ + short _freclen; /* [04] - 19 - record length */ + short _fkeylen; /* [06] - 27 - key length */ + char *_fbufbase; /* [08] - 801 - location of buffer */ + long _fbufsize; /* [0C] - 817 - buffer size */ + char *_fbufptr; /* [10] - 833 - next char position */ + long _fcount; /* [14] - 849 - number of chars left */ + long _floc; /* [18] - 865 - location next read or write */ + short _fsa; /* [1C] - 371 - slot number of fsa */ + char *_fnxtkey; /* [1E] - 889 - pointer to IX key storage */ + short _fnxt; /* [22] - 395 - type of IX key */ + long _fixnxt; /* [24] - 913 - disk address of IX key */ + char *_ftapefn; /* [28] - 929 - pointer to tape file name */ + char _filler[10]; /* [2C] - filler */ +} FILE; /* len of fcb = 54 bytes */ + +struct fcb_286 { + char _fst; /* [00] - 1 - file status: + 76543210 + ªªªªªªª£© = disk full on last write + ªªªªªª£©© = tape no HDR2 labels + ªªªªª£©©© = tape end of file + ªªªª£©©©© = printer needs close + ªªª£©©©©© = printer + ªª£©©©©©© = buffer has write data + ª£©©©©©©© = buffer allocated + £©©©©©©©© = opened */ + char _flub; /* [01] - 5 - logical unit,255 = null */ + short _faccess; /* [02] - 11 - access mode: + 111111 + 5432109876543210 + ªªªªªªªªª£© = input + ªªªªªªªª£©© = output + ªªªªªªª£©©© = lock + ªªªªªª£©©©© = temp file (erase) + ªªªªª£©©©©© = stream + ªªªª£©©©©©© = relative + ªªª£©©©©©©© = indexed + ªª£©©©©©©©© = keyed + ª£©©©©©©©©© = append mode + £©©©©©©©©©© = private */ + short _freclen; /* [04] - 19 - record length */ + short _fkeylen; /* [06] - 27 - key length */ + near char *_fbufbase; /* [08] - 35 - location of buffer */ + unsigned _fbufsize; /* [0A] - 43 - buffer size */ + near char *_fbufptr; /* [0C] - 51 - next char position */ + unsigned _fcount; /* [0E] - 59 - number of chars left */ + long _floc; /* [10] - 67 - location next read or write */ + short _fsa; /* [14] - 83 - slot number of fsa in nucleus */ +}; /* len of fcb_286 = 22 bytes */ +@fdb +fdb (THEOS) File Directory Block +#include +struct fdb { + char filename[8]; /* [00] - filename or member name */ + char filetype[8]; /* [08] - filetype */ + char filestat; /* [10] - file status: + 76543210 + 00000000 empty + 11111111 erased + 10000000 library + 01000000 sub directory + 00010000 normal stream + 00001000 relative + 00000100 keyed + 00000010 indexed + xxx00001 program + xxx = 000 8086 & 80286 real + xxx = 001 80286 protected + xxx = 010 80386 */ + unsigned short fileowner; /* [11] - owner id */ + char protect; /* [13] - protection code: + 76543210 + ªªªªªªª£© = read protect + ªªªªªª£©© = write protect + ªªªªª£©©© = execute protect + ªªªª£©©©© = erase protect + ªªª£©©©©© = shared read protect + ªª£©©©©©© = shared write protect + ª£©©©©©©© = shared execute protect + £©©©©©©©© = shared erase protect */ + union { + struct { + year : 6; /* years since 1986 [0-31] = [1986 - 2017] */ + month : 4; /* month [1 - 12] */ + day : 5; /* day [1 - 31] */ + hour : 5; /* hour [0 - 23] */ + min : 6; /* minute [0 - 59] */ + sec : 6; /* second [0 - 59] */ + } new; + struct { + char type; /* code 0=old,!0=new */ + year : 4; /* years since 1980 [0-15] = [1980 - 1995] */ + month : 4; /* month [1 - 12] */ + day : 5; /* day [1 - 31] */ + hour : 5; /* hour [0 - 23] */ + min : 6; /* minute [0 - 59] */ + : 0; + } old; + unsigned long datetime; + } filedate; /* [14] - date & time of last write */ + long filesize; /* [18] - file size in bytes */ + unsigned short reclen; /* [1C] - record length */ + unsigned short keylen; /* [1E] - key len */ + struct { + unsigned short ext_ct; /* [20] - sector count */ + char ext_addr[3]; /* [22] - sector address */ + } extlev1[5]; /* [20] - 5 level 1 extents */ + char extlev2a[3]; /* [39] - address of sector contain 51 exts */ + char extlev2b[3]; /* [3C] - address of sector contain 51 exts */ + char filegrow; /* [3F] - extent increase amount; + 0 = dynamic,chop at close + n = filesize/n,no chop */ +}; /* (fdb len = 64) */ +@fsa +fsa (THEOS) File Save Area +#include +struct fsa { + near struct diskucb *fsa_ucb; /* [00] - file ucb */ + long fsa_sect; /* [02] - fdb sector address */ + near struct fdb *fsa_ofs; /* [06] - fdb offset within sector */ + short fsa_count; /* [08] - open fcb count */ + char fsa_lock; /* [0A] - file locked: + 76543210 + ª£© deny read + £©© deny write */ + char fsa_write; /* [0B] - file modified if non zero */ + char fsa_temp; /* [0C] - erase at final close */ + char fsa_1[3]; /* [0D] - not used */ + char filestat; /* [10] - file status: + 0x10 normal stream + 0x08 direct + 0x04 keyed + 0x02 indexed */ + unsigned short fileowner; /* [11] - owner id */ + char protect; /* [13] - protection code: + 0x8? shared erase protect + 0x4? shared execute protect + 0x2? shared write protect + 0x1? shared read protect + 0x?8 erase protect + 0x?4 execute protect + 0x?2 write protect + 0x?1 read protect */ + union { + struct { + year : 6; /* years since 1986 [0 - 31] */ + month : 4; /* month [1 - 12] */ + day : 5; /* day [1 - 31] */ + hour : 5; /* hour [0 - 23] */ + min : 6; /* minute [0 - 59] */ + sec : 6; /* second [0 - 59] */ + } new; + struct { + char type; /* code 0=old,!0=new */ + year : 4; /* years since 1980 [0 - 15] */ + month : 4; /* month [1 - 12] */ + day : 5; /* day [1 - 31] */ + hour : 5; /* hour [0 - 23] */ + min : 6; /* minute [0 - 59] */ + : 0; + } old; + unsigned long datetime; + } filedate; /* [14] - date & time of last write */ + long filesize; /* [18] - file size in bytes */ + unsigned short reclen; /* [1C] - record length */ + unsigned short keylen; /* [1E] - key len */ + struct { + unsigned short ext_ct; /* [20] - sector count */ + char ext_addr[3]; /* [22] - sector address */ + } extlev1[5]; + char extlev2a[3]; /* [39] - addr of sector with 51 ext */ + char extlev2b[3]; /* [3C] - addr of sector with 51 ext */ + char filegrow; /* [3F] - extent growth factor */ +}; /* (fsa len = 64) */ + +#define FSASEG 0x0088 +@filedate +filedate (JMD) File's date and time structure +#include +typedef union filedate { /* date & time of last write */ + struct { + year : 6; /* years since 1986 [0-31] = [1986-2017] */ + month : 4; /* month [1-12] */ + day : 5; /* day [1-31] */ + hour : 5; /* hour [0-23] */ + min : 6; /* minute [0-59] */ + sec : 6; /* second [0-59] */ + } new; + struct { + type : 8; /* Type 0=old,!0=new */ + year : 4; /* years since 1980 [0-15] = [1980-1995] */ + month : 4; /* month [1-12] */ + day : 5; /* day [1-31] */ + hour : 5; /* hour [0-23] */ + min : 6; /* minute [0-59] */ + } old; + tetd_t datetime; +} FILEDATE; +@tetd_t +tetd_t (JMD) Packed file's date and time +#include +typedef unsigned long tetd_t; +@lconv +lconv (ANSI) Locale structure +#include +struct lconv { + char *decimal_point; + char *thousands_sep; + char *grouping; + char *int_curr_symbol; + char *currency_symbol; + char *mon_decimal_point; + char *mon_thousands_sep; + char *mon_grouping; + char *positive_sign; + char *negative_sign; + char int_frac_digits; + char frac_digits; + char p_cs_precedes; + char p_sep_by_space; + char n_cs_precedes; + char n_sep_by_space; + char p_sign_posn; + char n_sign_posn; +}; + +#define LC_ALL 31 +#define LC_COLLATE 1 +#define LC_CTYPE 2 +#define LC_NUMERIC 4 +#define LC_TIME 8 +#define LC_MONETARY 16 +@complex +complex (UNIX) Complex number +#include +struct complex { + double x; + double y; +}; +@nuc +nuc (THEOS) Nucleus data structure +#include +struct nuc { + char pad1[4]; /* [00] filler */ + struct { + char year; /* [04] year - 1900 */ + char month; /* [05] month (1 - 12) */ + char day; /* [06] day of month (1 - 31) */ + char hour; /* [07] hour of day (0 - 23) */ + char min; /* [08] minute of hour (0 - 59) */ + char sec; /* [09] second of minute (0 - 59) */ + } time_of_day; /* [04] system date & time */ + char dateopt; /* [0A] date option: */ + #define kanji 1 /* 16 bit Japanese Kanji */ + #define extime 2 /* external clock chip */ + #define exdate 4 /* external date chip */ + #define havusr 8 /* have USER module */ + #define aform 16 /* American MM/DD/YY */ + #define eform 32 /* European DD-MM-YY */ + #define iform 64 /* International YY.MM.DD */ + #define whist 128 /* write history records */ + char curpid; /* [0B] current process number */ + char cpu[4]; /* [0C] cpu */ + near char *curpcb; /* [10] current PCB pointer */ + unsigned short slice; /* [12] slice interval (msec) */ + near char *mstick; /* [14] address of msec tick */ + near char *snutick; /* [16] address of snu tick */ + unsigned short spoolseg; /* [18] DESPOOL segment */ + char version[5]; /* [1A] version number */ + char mfgnum; /* [1F] manufacturer number */ + unsigned short sernum; /* [20] serial number */ + long csisize; /* [22] SYSTEM.THEOS386.CSI filesize */ + struct { + unsigned short size; + char addr[3]; + } csiext[4]; /* [26] SYSTEM.THEOS386.CSI extent info */ + unsigned short csistack; /* [3A] SYSTEM.THEOS386.CSI stack len */ + char errmsg[3]; /* [3C] SYSTEM.THEOS386.MESSAGE extent info */ + unsigned short pdlseg; /* [3F] segment of PDL */ + unsigned pipenum; /* [41] next pipe number */ + char npxpid; /* [43] 80287/80387 owner pid */ + char slpcnt; /* [44] number of sleepers */ + char spdrv; /* [45] SYSTEM.SPOOLER drive */ + char sppid; /* [46] spooler pid */ + char snu_val[3]; /* [47] select next user */ + long cputime; /* [4A] time of day in msec (software) */ + short cache_seg; /* [4E] directory cache head segment */ + char srlo; /* [50] SunRiver */ + char public[26]; /* [51] public drive list A-Z */ + near char *rpb; /* [6B] RPB head seg address */ + char srhi; /* [6D] SunRiver */ + near char *rlt; /* [6E] RLT head offset address */ + unsigned pipe_hd; /* [70] PIPE head segment */ + near char *teb; /* [72] TEB head offset address */ + char tz[12]; /* [74] time zone info */ + unsigned short svdeb; /* [80] DEBUG386 use */ + long csicode; /* [82] SYSTEM.THEOS386.CSI code length */ + unsigned short msgseg; /* [86] SYSTEM.THEOS386.MESSAGE segment */ + char msgnum; /* [88] SYSTEM.THEOS386.MESSAGE suffix */ + char sync_pid; /* [89] process id of sync'er */ + unsigned short keyseg; /* [8A] SYSTEM.THEOS386.KEYWORD segment */ + char keynum; /* [8C] SYSTEM.THEOS386.KEYWORD suffix */ + char mca; /* [8D] cpu flags: */ + + #define MCA_BUS 1 + #define EISA_BUS 2 + #define ISA_BUS 32 + + #define CPU_286 64 + #define CPU_386 16 + #define CPU_486 4 + + #define FPU 8 + + #define MDOS_VER 128 + + unsigned mem_size; /* [8E] memory size at bootup */ + unsigned shmemseg; /* [90] shared memory segment */ + char sysname[16]; /* [92] system identification */ + unsigned short synseg; /* [A2] SYSTEM.THEOS386.SYNONYM segment */ + char synnum; /* [A4] SYSTEM.THEOS386.SYNONYM suffix */ + unsigned short devseg; /* [A5] SYSTEM.THEOS386.DEVNAMES segment */ + unsigned short gucb; /* [A7] VDI UCB segment address */ + char dflang; /* [A9] default language code */ + short cache_delay; /* [AA] cache write delay in .1 seconds */ + unsigned short accseg; /* [AC] ACCOUNT segment address */ + unsigned short csidata; /* [AE] SYSTEM.THEOS386.CSI data length */ + unsigned short csiheap; /* [B0] SYSTEM.THEOS386.CSI heap length */ + unsigned long pdbr; /* [B2] Page Descriptor Base reg */ + unsigned short ptseg; /* [B6] Page Table Selector */ + unsigned short v86seg; /* [B8] V86 Monitor segment */ + char v86pids[32]; /* [BA] V86 pid masks */ + unsigned char v86count; /* [DA] V86 Monitor count */ + char v86_inuse; /* [DB] set while loading V86 */ + unsigned short network; /* [DC] Network phantom pid */ + unsigned short ncb_seg; /* [DE] Network socket control block segment */ + short v86reserve; /* [E0] V86 reserve I/O segment */ + unsigned short flt_seg; /* [E2] File Lock Table */ + char copyright[28]; /* [E4] copyright notice */ + char ucb[1]; /* [100] Unit control blocks */ +}; +@pcb +pcb (THEOS) Process Control Block +#include +struct pcb { + unsigned short pstat; /* [00] - process status: */ + #define WAITING 0x00ff /* if non zero,waiting,else either \ + running or ready to run */ + #define W_INT 0x0001 /* set if waiting for interrupt */ + #define W_LOCK 0x0002 /* set if waiting for resource lock */ + #define W_SCREEN 0x0004 /* waiting for screen switch */ + #define SLEEPING 0x0008 /* set if sleeping */ + #define STOPPED 0x0010 /* set if stopped */ + #define W_PAUSE 0x0020 /* set if BREAK-S */ + #define W_SEMA 0x0040 /* set if waiting for semaphore */ + #define SR_PAGE 0x0100 /* set if need cntx swtch THEO+Grafx */ + #define MUST_COMPLETE 0x0200 /* set if task cannot be context + switched away */ + + unsigned short tib; /* [02] - TSS selector */ + + unsigned short pending; /* [04] - traps pending */ + #define QUITPEND 0x0001 /* set if BREAK-Q pending */ + #define CANPEND 0x0002 /* set if BREAK-C pending */ + #define ALRMPEND 0x0004 /* set if alarm pending */ + #define OVFPEND 0x0008 /* set if overflow/underflow pending */ + #define DIV0PEND 0x0010 /* set if divide by zero pending */ + #define FUNPEND 0x0020 /* set if function error pending */ + #define BOUNDPEN 0x0040 /* set if array bounds pending */ + #define FPEPEND 0x0080 /* set if floating point exception */ + #define SESSPEND 0x0200 /* set if need to switch sessions */ + #define FORCPEND 0x1000 /* set if FORCE pending */ + #define DEBPEND 0x2000 /* set if BREAK-D pending */ + #define KILLPEND 0x4000 /* set if kill syscall pending */ + #define STAGE 0x8000 /* set if staging the trap */ + + char taskprty; /* [06] - priority level */ + char tasklev; /* [07] - task level,0 == main task */ + unsigned long cputime; /* [08] - amount of CPU time */ + unsigned long sleeptime; /* [0C] - sleep time remain */ + near struct pcb *prtylink; /* [10] - link to next PID same prty */ + unsigned char taskfath; /* [12] - PID of parent task */ + char waitsema; /* [13] - semaphore if W_SEMA */ +}; +@pdl +pdl (THEOS) Public Device List +#include +struct pdl { + char ucbnum; /* ucb index */ + char pid; /* owner pid + 1 */ + short open_ct; /* number of opens */ +}; +@pipehdr +pipehdr (THEOS) PIPE control structure +#include +struct pipehdr { + unsigned pnext; /* fwd link to next pipe */ + unsigned pprev; /* back link to prev pipe */ + char pname[16]; /* pipe name (space pad) */ + char prd_ct; /* reader count */ + char pwr_ct; /* writer count */ + char prd_pid; /* pid of read waiter */ + char pwr_pid; /* pid of write waiter */ + unsigned psize; /* size of pipe buffer (exclude header) */ + unsigned pcount; /* number of chars in buffer */ + unsigned phead; /* read offset */ + unsigned ptail; /* write offset */ + char pbuf[]; /* pipe circular buffer */ +}; +@rlt +rlt (THEOS) Rocord Lock Table +#include +struct rlt { + short fsa_num; /* [00] - fsa number */ + unsigned char lockpid; /* [02] - locking pid plus one */ + long lockad; /* [03] - byte address */ + near struct rlt *fwd_rlt; /* [07] - fwd ptr to next */ +}; /* rlt len = 9 bytes */ +@scr +scr (THEOS) System Communication Region +#include +struct scr { + char logonname[8]; /* [00] - user name */ + unsigned short usernum; /* [08] - user number */ + char logdate[3]; /* [0A] - logon date */ + char logtime[3]; /* [0D] - logon time */ + unsigned char conmask; /* [10] - console mask: + 76543210 + ªªªªªªª£ = 1st char ctl is ok + ªªªªªª£© = suppress output if stack + ªªªªª£©© = stacked lines + ªªªª£©©© = no page wait + ªªª£©©©© = output suppress + ªª£©©©©© = inverted case + ª£©©©©©© = upper case + £©©©©©©© = echo mode */ + unsigned char csisw; /* [11] - csi switch: + 76543210 + ªªªªªªª£ = return from logon + ªªªªªª£© = execute csi command + ªªªªª£©© = from exec + ªªªª£©©© = nomsg + ªªª£©©©© = rdymsg + ªª£©©©©© = usersyn + ª£©©©©©© = stdsyn + £©©©©©©© = abbrev */ + unsigned char execsw; /* [12] - exec switch: + 76543210 + ªªªª£©©© = CSI lower case + ªªª£©©©© = error + ªª£©©©©© = noecho + ª£©©©©©© = trace + £©©©©©©© = ctl on */ + char pgmtime[3]; /* [13] - program start time */ + char pgmname[8]; /* [16] - program name */ + unsigned short execloc; /* [1E] - location in system.exec */ + near char *slofs; /* [20] - stacked line offset */ + unsigned short slseg; /* [22] - stacked line segment */ + near char *memhead; /* [24] - malloc head */ + char pipenr; /* [26] - next pipe number (0-25) */ + char privlev; /* [27] - privlege level */ + char lub[52]; /* [28] - lub table + unsigned short trapseg; /* [5C] - signal code segment */ + near void *quittrap; /* [5E] - break,q trap */ + near void *cantrap; /* [60] - break,c trap */ + near void *alrmtrap; /* [62] - alarm trap */ + near void *ovftrap; /* [64] - overflow/underflow trap */ + near void *div0trap; /* [66] - divide by zero trap */ + near void *funtrap; /* [68] - function argument trap */ + near void *boundtrap; /* [6A] - array bounds trap */ + near void *fpetrap; /* [6C] - floating point except trap */ + long cputimes; /* [6E] - cpu time start */ + char err_ext[3]; /* [72] - SYSTEM.THEOS.MESSAGE xtent */ + char workdrive; /* [75] - default work drive */ + char searchseq[26]; /* [76] - search sequence */ + unsigned char foreign; /* [90] - Foreign language switch + 76543210 + ªªªª.... = language code + ªªª£©©©© = not used + ªª£©©©©© = THEOS/Z80 style modify + ª£©©©©©© = no quit + £©©©©©©© = decimal is comma */ + char deflib[19]; /* [91] - default library */ + char cmdlib[9]; /* [A4] - cmd library */ + char maclib[9]; /* [AD] - macro library */ + char objlib[9]; /* [B6] - object library */ + char copylib[9]; /* [BF] - copy library */ + char linklib[9]; /* [C8] - link library */ + char synfile[9]; /* [D1] - synonym file */ + unsigned short comad; /* [DA] - BASIC286 common seg addr */ + char conbuf[8]; /* [DC] - console buffer (ungetch) */ + char tsb[16]; /* [E4] - tab set block */ + char cmdbuf[140]; /* [F4] - cmd storage */ + unsigned short quittraphi; /* [180] - high word */ + unsigned short cantraphi; /* [182] - high word */ + unsigned short alrmtraphi; /* [184] - high word */ + unsigned short ovftraphi; /* [186] - high word */ + unsigned short div0traphi; /* [188] - high word */ + unsigned short funtraphi; /* [18A] - high word */ + unsigned short boundtraphi; /* [18C] - high word */ + unsigned short fpetraphi; /* [18E] - high word */ + unsigned short memheadhi; /* [190] - high word */ + unsigned short cebphi; /* [192] - high word */ + unsigned short clev; /* [194] - call csi level */ + unsigned short cexec; /* [196] - execloc at call csi */ + near void *cebp; /* [198] - ebp at call csi */ + unsigned short cnlev; /* [19A] - next call csi level */ + char echo; /* [19C] - set if echoing */ + char echolub; /* [19D] - echo device */ + short echobuf; /* [19E] - buffer seg,if disk echo */ + short echofsa; /* [1A0] - fsa number */ + short echokl; /* [1A2] - offset if echo to spool */ + short echorl; /* [1A4] - page# if echo to spool */ + unsigned char echoct; /* [1A6] - buffer char ct */ + char loadtrap; /* [1A7] - debug trap on load */ + unsigned short snbseg; /* [1A8] - sema name block seg */ + char semaphor[8]; /* [1AA] - 64 semaphore bits */ + char sp_ll[4]; /* [1B2] - spool prt line len */ + char sp_pl[4]; /* [1B6] - spool prt page len */ + char sp_que[4]; /* [1BA] - spool prt que number */ + char sp_copies[4]; /* [1BE] - spool prt # copies */ + char sp_class[4]; /* [1C2] - spool prt class */ + char graphlub[4]; /* [1C6] - graphic lub number */ + unsigned short graphwork[4]; /* [1CA] - graphic work buffer */ + char graphdev[4]; /* [1D2] - graphic device number */ + char peeker; /* [1D6] - peeker pid number + 1 */ + char peekch; /* [1D7] - char to be peeked */ + char forcech; /* [1D8] - char from FORCE command */ + char cache_write_thru; /* [1D9] - set if write thru cache */ + unsigned short main_scr; /* [1DA] - alias to main task SCR */ + unsigned short main_data; /* [1DC] - alias to main task DATA */ + unsigned short atexit_ofshi; /* [1DE] - high word */ + char fill2[6]; /* [1E0] - filler */ + unsigned char lock_wait; /* [1E6] - seconds to wait for lock */ + unsigned char lock_remain; /* [1E7] - number seconds remain */ + char slave_ll; /* [1E8] - slave printer line length */ + char slave_pl; /* [1E9] - slave printer page length */ + char slave_ol; /* [1EA] - slave printer overflow */ + char slave_cl; /* [1EB] - slave printer cur line */ + char slave_cc; /* [1EC] - slave printer class code */ + unsigned short slave_seg; /* [1ED] - slave printer class seg */ + unsigned short environ_seg; /* [1EF] - segment of environment */ + near char *atexit_ofs; /* [1F1] - at exit offset */ + unsigned short atexit_seg; /* [1F3] - at exit segment */ + char csi_color[4]; /* [1F5] - normal crt color */ + unsigned cmdnum; /* [1F9] - command number */ + char fill3[5]; /* [1FB] - filler */ +}; /* length = 512 */ +@jmp_buf +jmp_buf (THEOS) Non-Local Jumps +#include +struct FarPointer { + void *ptr; + short seg; +}; + +typedef struct jmp_buf { + struct FarPointer _jmp_eip; /* return pointer */ + struct FarPointer _jmp_esp; /* stack pointer */ + void *_jmp_ebp; /* frame pointer */ + long _jmp_reg[3]; /* registers */ +} jmp_buf; +@tm +tm (ANSI) Date and time structure +#include +struct tm { + short tm_sec; /* seconds after the minute [0,60] */ + short tm_min; /* minutes after the hour [0,59] */ + short tm_hour; /* hours since midnight [0,23] */ + short tm_mday; /* day of the month [1,31] */ + short tm_mon; /* months since January [0,11] */ + short tm_year; /* years since 1900 */ + short tm_wday; /* days since Sunday [0,6] */ + short tm_yday; /* days since January 1 [0,365] */ + short tm_isdst; /* Daylight Savings Time flag */ +}; +@ucb +ucb (THEOS) Unit Control Block for character devices +#include +struct ucb { + unsigned short devaddr; /* [00] - memory address,offset always 0 */ + unsigned short iobuff1; /* [02] - i/o buffer 1 */ + char devnr; /* [04] - device number */ + char devunit; /* [05] - unit within device */ + unsigned short ubuf_ofs2; /* [06] - high ubuf_ofs pointer */ + char devtype; /* [08] - device type: + 76543210 + ªªªªª100 byte i/o + ªªªª£©©© = console + ªªª£©©©© = 2nd char of DCA + ªª£©©©©© = 3rd char of DCA + ª£©©©©©© = keyboard off + £©©©©©©© = 2nd char of BREAK */ + char devowner; /* [09] - owner process id */ + char classnr; /* [0A] - class number */ + char ll; /* [0B] - line length */ + char pl; /* [0C] - page length */ + char ol; /* [0D] - overflow lines */ + char baud; /* [0E] - baud rate: + 76543210 + xxxx.... If Sync option bit: + 0001.... BSC + 0010.... SDLC + 0011.... HDLC + 0100.... X.25 + 0101.... SNA + 0110.... GPIB + 0111.... thru 1111.... user defined + ....xxxx ASYNC baud rates: + 0 = no software baud + 1 = 56000 + 2 = 38400 + 3 = 110 + 4 = 135 + 5 = 150 + 6 = 300 + 7 = 600 + 8 = 1200 + 9 = 1800 + 10 = 2400 + 11 = 3600 + 12 = 4800 + 13 = 7200 + 14 = 9600 + 15 = 19200 + ....xxxx SYNC baud rates: + 1 = 1200 + 2 = 2400 + 3 = 4800 + 4 = 9600 + 5 = 19200 + 6 = 38400 + 7 = 48000 + 8 = 56000 + 9 = 64000 + 10 = 100000 + 11 = 200000 + 12 = 500000 + 13 = 800000 */ + char lfdly; /* [0F] - line feed delay */ + char ffdly; /* [10] - form feed delay */ + char option; /* [11] - option byte: + 76543210 + 00...... no parity + 01...... parity zero + 10...... parity odd + 11...... parity even + ..1..... synchronous + ...1.... alf + ....1... 8 bit words + .....001 dtr enable (1) + .....010 xon/xoff enable (2) + .....011 etx/ack enable (3) + .....100 cts enable (4) + .....101 xpc (5) */ + char curline; /* [12] - current line system use */ + char curcol; /* [13] - current column system use */ + unsigned short transeg; /* [14] - translate segment addr */ + near void *ubuf_ofs; /* [16] - user buffer offset */ + unsigned short ubuf_seg; /* [18] - user buffer segment */ + char scantmp; /* [1A] - scan code temporary */ + char prot_st; /* [1B] - protocol (XON/XOFF) status */ + char scan_st; /* [1C] - scan code status: + 76543210 + ªªªªªªª£© = shift + ªªªªªª£©© = compose + ªªªªª£©©© = ctl + ªªªª£©©©© = alt + ªªª£©©©©© = scroll lock + ªª£©©©©©© = num lock + ª£©©©©©©© = caps lock + £©©©©©©©© = Kanji mode */ + char brk_chr; /* [1D] - break character */ + short attrib; /* [1E] - system use (saves crt attribute) + 5432109876543210 + ªªªªªªªªªªªªªª£ = protect + ªªªªªªªªªªªªª£© = format + ªªªªªªªªªªªª£©© = reverse + ªªªªªªªªªªª£©©© = blink + ªªªªªªªªªª£©©©© = underline + ªªªªªªªªª£©©©©© = takes space + ªªªªªªªª£©©©©©© = last was attr + ªªªªªªª£©©©©©©© = caused newline + ªªªªªª£©©©©©©©© = slave prt attached + ªªªªª£©©©©©©©©© = slave prt enabled + ªªªª£©©©©©©©©©© = esc mode + ªªª£©©©©©©©©©©© = status mode + ªª£©©©©©©©©©©©© = status ignore + ª£©©©©©©©©©©©©© = last was prt cr + £©©©©©©©©©©©©©© = line graphic mode */ + /* ucb len = 32 */ +}; +@diskucb +diskucb (THEOS) Unit Control Block for disk devices +#include +struct diskucb { + unsigned short devaddr; /* [00] - memory address,offset always 0 */ + unsigned short iobuff1; /* [02] - i/o buffer 1 */ + char devnr; /* [04] - device number */ + char devunit; /* [05] - unit within device */ + unsigned short iobuff2; /* [06] - i/o buffer 2 */ + char devtype; /* [08] - device type: + 76543210 + .....001 = disk + ....1001 = disk,need label + .001.... = single density + .010.... = double density + .011.... = cyl0 = single,other dbl + .100.... = cyl0,hd0=128 other 256 + .101.... = 2048 byte sects + .110.... = 1024 byte sects + .111.... = 512 byte sects (IBM PC) + 0....... = removable volume + 1....... = fixed volume */ + char devowner; /* [09] - owner process id 0xff = public */ + char volname[8]; /* [0A] - volume id */ + unsigned short dirsize; /* [12] - directory size */ + short cyls; /* [14] - number of cylinders */ + char heads; /* [16] - number of heads */ + char sects; /* [17] - number of sectors */ + char hdldly; /* [18] - head load delay */ + char stpdly; /* [19] - step delay */ + char stsdly; /* [1A] - step settle delay */ + short curcyl; /* [1B] - current cylinder */ + char diskfill[3]; /* [1D] - work space 3 bytes */ + /* diskucb len = 32 */ +}; +@tapeucb +tapeucb (THEOS) Unit Control Block for tape devices +#include +struct tapeucb { + unsigned short devaddr; /* [00] - memory address,offset always 0 */ + unsigned short iobuff1; /* [02] - i/o buffer 1 */ + char devnr; /* [04] - device number */ + char devunit; /* [05] - unit within device */ + unsigned short iobuff2; /* [06] - i/o buffer 2 */ + char devtype; /* [08] - device type: + 76543210 + .....010 = tape */ + char devowner; /* [09] - owner process id */ + char volname[8]; /* [0A] - volume id */ + short blocknr; /* [12] - block count */ + short filenr; /* [14] - file number */ + short volnr; /* [16] - volume number */ + char devtrack; /* [18] - tape track or channel number */ + unsigned short iostat; /* [19] - status of last I/O */ + unsigned short rdlen; /* [1B] - length of last read */ + char tapefill[3]; /* [1D] - filler,tapeucb len = 32 */ +}; +@diskcntl +diskcntl (THEOS) Extended I/O structure for disk devices +#include +struct diskcntl { + short c_cmd; /* command code: + 0 = home heads to cylinder 0 + 1 = return drive status (MFG dependent) + 2 = read sectors + 3 = write sectors + 4 = format (MFG dependent) + 99 = land heads to safe landing zone */ + long c_sect; /* sector number */ + char *c_buf; /* buffer offset */ + unsigned short c_seg; /* buffer segment */ + short c_count; /* sector count */ + short c_cyl; /* cylinder number (format) */ + short c_head; /* head number (format) */ + short c_den; /* density (format) */ +}; +@bytecntl +bytecntl (THEOS) Extended I/O structure for character devices +#include +struct bytecntl { + short c_cmd; /* command code: + 1 = buffer status: + 76543210 + ª£© = TxBUF not full + £©© = RxBUF not empty + 2 = modem status: + 5432109876543210 + 111100001111ªªª£© = DSR + 111100001111ªª£©© = CTS + 111100001111ª£©©© = RI + 111100001111£©©©© = DCD + 3 = send break + 4 = use c_seg:c_buf input buffer: + struct { + short buf_len; + short buf_count; + short next_store; + short next_fetch; + char buf[buf_len]; + }; + 5 = raise DTR modem control + 6 = drop DTR modem control + 7 = raise RTS modem control + 8 = drop RTS modem control */ + short c_word1; + short c_word2; + char *c_buf; /* offset to buffer */ + unsigned short c_seg; /* selector for buffer */ +}; +@tapecntl +tapecntl (THEOS) Extended I/O structure for tape devices +#include +struct tapecntl { + short c_cmd; /* command code: + 1 = status: + 76543210 + ªªªª£© = BOT + ªªª£©© = EOT + ªª£©©© = Write Protect + ª£©©©© = Ready + £©©©©© = Streamer + 2 = rewind + 3 = rewind & unload + 4 = write tape mark + 7 = erase tape (format) + 8 = re-tension + 9 = get length of last read + 110 = read + 111 = write */ + unsigned short c_tseg; /* read/write segment */ + char *c_tbuf; /* read/write offset */ + unsigned short c_tlen; /* read/write length */ +}; +@utimbuf +utimbuf (UNIX) File time modification structure +#include +struct utimbuf { + time_t actime; + time_t modtime; +}; +@VDIPB +VDIPB (THEOS) Vdi Parameters Block +#include +typedef struct { + short *control; + short *intin; + short *ptsin; + short *intout; + short *ptsout; + short vdinum; + unsigned vdiseg; +} VDIPB; +@UBUFFER +UBUFFER (THEOS) User Buffering +#include <_ucb.h> +typedef struct ubuffer { + short buf_len; + volatile short buf_count; + volatile short next_store; + volatile short next_fetch; + char buf[]; +} UBUFFER; +@lub +lub (THEOS) Device Logical Unit Blocks Numbers +#include +enum lub { + ADISK,BDISK,CDISK,DDISK,EDISK,FDISK,GDISK,HDISK,IDISK,JDISK, + KDISK,LDISK,MDISK,NDISK,ODISK,PDISK,QDISK,RDISK,SDISK,TDISK, + UDISK,VDISK,WDISK,XDISK,YDISK,ZDISK, + CONI,CONO, + PRT1,PRT2,PRT3,PRT4, + COM1,COM2,COM3,COM4, + TAP1,TAP2,TAP3,TAP4, + COM5,COM6,COM7,COM8,COM9,COM10,COM11,COM12,COM13,COM14,COM15, + COM16 +}; +@ diff --git a/cmd/c.idx b/cmd/c.idx new file mode 100644 index 0000000000000000000000000000000000000000..0b6a27ca2041f5c5367957b97b401e95a54152d3 GIT binary patch literal 7836 zcmYkBd7u=FJqirl-5I(6y{ z0Oaz1l;$d4GoKXjs0dz?I7ta3+YE=bD(1A4{m@OSUKMwXQ7x8oB`?broXo?lUf)wP zzv^MD-d6ELKSOuRifi_cL$znyXNwd;6T zjb`X#tG<*Qo>wV2O)OF)@%g%Qx2N6|@jj9>YGi;>{RsIe$#9cWimi8`;<{d%;v>Z< z#c?}|7G=0jA$9RjfkGjVYj;v`Qw-{_6yRwK)K1x1wFW-1K<(lI)B-1|Vvk)&As@2B z0G%i8s#1XU7O0)Sn`#a0v%3LmzYqyl#H-OZFCTRK&LXDEPR-K!CvmfxKH7;d`Ek$HYiICvnTT_XmL6nMDCQ z2a%k7iW?Pzz)gKTZaH!>xr2T;h*A$<^`H|3cyM1jJU_s(`w=)nU3_jS#iISGl?#4? zzJrBINz}j+Q7uEoU{Yw}Ma2{y zhln>VW1&KZ*GyZ+VTaNaC!Fv_?0lGTjU({7r4(l!PK`??!%jyCWjNHdZWKfbJ`{tq z^0?vJmhlq>FU!}82uFzMWpy#;c8cNSBWZQ^Ts@Lh<6Q9z73|!iY*?cEoWfcXiEVuX<-A~9;Ir4TMaaD@EB2we&}JbV!-v+>u3=JFY_u`rd$sl zhMzHGMXyIOKkM_tezB;%oN$a73ByW_LE%8*uXPNvfjteq2>pkY;*XFHQcfjmOR`r*ZBCNrL2qzXIfJh z_P5sHhj7jkJuK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ER] Picks a topic [PG UP] Last Screen [F6] Index Cursor keys - [F10] Exit Help [PG DOWN] Next Screen [HOME] Main Menu are active + [F9] Exit Help [PG DOWN] Next Screen [HOME] Main Menu are active < > =>Main Menu NEXT[The Basics] PREV[Main Menu] - < > The Basics < > Keystrokes + < > THE BASICS < > KEYSTROKES - < > Getting at Files < > Issuing Commands + < > GETTING AT FILES < > ISSUING COMMANDS - < > Searching and Replacing < > Customizing Command Keys + < > SEARCHING AND REPLACING < > CUSTOMIZING COMMAND KEYS < > Regions < > Using the Mouse @@ -45,16 +45,17 @@ NEXT[History] PREV[Main Menu] written by Daniel M. Lawrence Major code contributions by: - Dave Conroy, John Gamble, Dana Hoggatt, Pierre Perret + Dave Conroy, John Gamble, Dana Hoggatt, Pierre Perret, Jean-Michel Dubois Information about MicroEMACS can be obtained via: - USMAIL: Daniel Lawrence - 1615 Virginia Street - Lafayette, IN 47905 + USMAIL: Daniel Lawrence BBS: The Programmer's Room + 617 New York St (317) 742-5533 + Lafayette, IN 47901 Fidonet 1:201/10 - EMAIL: dan@aquest.com - Phone: (765) 426-3409 + Internet: mdbs!dan@dynamo.ecn.purdue.edu + American Online: bardor + Phone (nights): (317) 742-5153 Register MicroEMACS for prefered phone support and information on new releases by sending $25 US to the address above. @@ -99,9 +100,9 @@ NEXT[Alternative Basic Keys] PREV[Main Menu] | [CSR DOWN] - [F9] This saves your file + [F10] This saves your file - [F10] This leaves MicroEMACS + [F9] This leaves MicroEMACS [PG DOWN] for other basic keys =>Alternative Basic Keys @@ -248,13 +249,104 @@ NEXT[Advanced Text Editing] PREV[Advanced Text Editing] M-M (add-global-mode) Adds a global mode M-^M (delete-global-mode) Removes a global mode - These are some of MicroEMACS's modes: + Editing modes: + < > ABBREV mode < > CMODE mode < > WRAP mode + < > DLINE mode < > SLINE mode < > OVER mode + < > REP mode + Search modes: + < > EXACT mode < > MAGIC Mode + File modes: + < > ASAVE mode < > CRYPT mode < > NOBAK mode + < > VIEW mode + +=>ABBREV Mode +NEXT[Modes of Operation] PREV[Modes of Operation] + + ABBREV mode Don't save backup + + When this mode is on, MicroEMACS expands abbreviations. Abbreviations + are defined, undefined, and listed with the following instructions : + + add-abbrev "abbrev" "word" Add an abbreviation + delete-abbrev "abbrev" Delete an abbreviation + define-abbrevs buffer Add abbreviations contained in a buffer. + Abbreviation definitions consists in + pair of lines, one for the abbreviated + word, one for the complete word. + insert-abbrevs Insert a list of current abbreviations + pairs in the current buffer. + kill-abbrevs Clear the list of abbreviations. + describe-abbrevs Show a list of current abbreviations. + + + + +=>NOBAK Mode +NEXT[Modes of Operation] PREV[Modes of Operation] + + NOBAK mode Don't save backup + + When this mode is on, MicroEMACS doesn't make a backup of a saved + file. The backup file has the same name as the original file with + a tilde (~) added at the end. + + + + + + + + + + + + + + + +=>SLINE Mode +NEXT[Modes of Operation] PREV[Modes of Operation] + + SLINE mode Single line semi-graphics + + When this mode is on, MicroEMACS allows to enter single line + semi-graphics character with the keyboard : + + 7 = upper left corner 8 = upper intersection 9 = upper right corner + 4 = left intersection 5 = four ways intersec. 6 = right intersection + 1 = lower left corner 2 = lower intersection 3 = lower right corner + 0 = horizontal line + = vertical line + + + + + + + + + + + +=>DLINE Mode +NEXT[Modes of Operation] PREV[Modes of Operation] + + DLINE mode Double line semi-graphics + + When this mode is on, MicroEMACS allows to enter double line + semi-graphics character with the keyboard : + + 7 = upper left corner 8 = upper intersection 9 = upper right corner + 4 = left intersection 5 = four ways intersec. 6 = right intersection + 1 = lower left corner 2 = lower intersection 3 = lower right corner + 0 = horizontal line + = vertical line + + + + + - < > ASAVE mode < > EXACT mode < > REP mode - < > CMODE mode < > MAGIC Mode < > VIEW mode - < > CRYPT mode < > OVER mode < > WRAP mode @@ -320,7 +412,7 @@ NEXT[Modes of Operation] PREV[Modes of Operation] written out, all the printing characters have been scrambled. To read such a file back in, call up MicroEMACS like this: - emacs -k + me -k and you will be asked the encryption key before the file is read. The encryption algorithm is a Beaufort Cipher with a @@ -458,7 +550,7 @@ NEXT[Modes of Operation] PREV[Modes of Operation] access to, or other people have locked. To read a file in view mode from the command line, type: - emacs -v + me -v @@ -582,7 +674,7 @@ NEXT[Main Menu] PREV[Main Menu] Regions are used in MicroEMACS to specify what text is acted on by many commands. A region is defined as all the text between the point, and the last placed MARKed. To define a region: - + 1) Move the point to the beginning of the text you want to effect @@ -604,21 +696,21 @@ NEXT[Main Menu] PREV[Main Menu] NEXT[Copying Text] PREV[Main Menu] To move text from one place to another: - + 1) Move to the beginning of the text you want to move. - + 2) Set the mark here with the M- (set-mark) command. - + 3) Move the point to the end of the text. - + 4) Use the ^W (kill-region) command to delete the region you just defined. The text will be saved in the "kill buffer". - + 5) Move the point to the place you want the text to appear. - + 6) Use the ^Y (yank) command to copy the text from the kill buffer to the current point. - + Repeat steps 5 and 6 to place more copies of the same text. [PG DOWN] for more info @@ -630,14 +722,14 @@ NEXT[Main Menu] PREV[Cutting and Pasting] and pasting it, except that in place of the ^W (kill-region) command, you use the M-W (copy-region) command which copies the current region into the kill buffer without deleting it. - + The kill buffer accumulates and text which is deleted by ^W, M-W or a number of other delete commands. If more than one delete command is used in a row, all the text from all the commands will be in the kill buffer. Using any command between deletes causes the kill buffer to discard earlier deletes and just hold the most recent deletions. - + Since there is only one kill buffer, you can switch between windows, screens and files to copy text from one file to another. There is no limit to the amount of text that can be stored in the @@ -654,7 +746,7 @@ NEXT[Buffer Commands] PREV[Main Menu] in buffers can also be MicroEMACS macros, temporary storage for macros, or lists of screens, files, buffers, variables, functions or bindings created by MicroEMACS commands. Buffer commands include: - + ^X-B (select-buffer) This prompt for a buffer name, and then makes that buffer the one @@ -1043,7 +1135,7 @@ NEXT[Main Menu] PREV[Main Menu] < > Narrowing Your Scope [PG UP] to return to Main Menu - + =>Controlling Tabs NEXT[More Tab Commands] PREV[Advanced Text Editing] @@ -1066,7 +1158,7 @@ NEXT[More Tab Commands] PREV[Advanced Text Editing] [PG DOWN] for more commands about tabs - + =>More Tab Commands NEXT[Main Menu] PREV[Controlling Tabs] @@ -1111,7 +1203,7 @@ NEXT[More External Commands] PREV[Main Menu] [PG DOWN] for more external commands - + =>More External Commands NEXT[Main Menu] PREV[The Outside World] diff --git a/cmd/ehelp2.txt b/cmd/ehelp2.txt index bb8ea74..55f46a9 100644 --- a/cmd/ehelp2.txt +++ b/cmd/ehelp2.txt @@ -17,13 +17,13 @@ Next[Index 2] PREV[Main Menu] < > Buffer Commands < > Even More Mousing < > Buffers < > Getting at Files < > CMODE Mode < > Glossary of Terms - < > CRYPT Mode < > History - < > Case Control < > Issuing Commands - < > Command Lines < > Keyboard Macros - < > Command List < > Keystrokes - < > Commands < > MAGIC Mode - < > Copying Text < > Macros - < > Creating New Commands < > Main Menu + < > CRYPT Mode < > GRD Mode + < > Case Control < > GRS Mode + < > Command Lines < > History + < > Command List < > Issuing Commands + < > Commands < > Keyboard Macros + < > Copying Text < > Keystrokes + < > Creating New Commands < > MAGIC Mode Press [PG DOWN] for more index topics @@ -32,19 +32,20 @@ Next[Main Menu] PREV[Index] Index to all HELP topics (continued): + < > Macros < > Replacements + < > Main Menu < > Screen Commands < > Memory Usage < > Screens < > Modes of Operation < > Searching and Replacing < > Narrowing Your Scope < > The Basics - < > Numeric Arguments < > The Outside World - < > OVER Mode < > Unbinding Keys - < > Other Searches < > Using the Mouse - < > Pages < > VIEW Mode - < > Paragraphs < > WRAP Mode - < > REP Mode < > Window Commands - < > Regions < > Windows - < > Repetitive Tasks < > Words - < > Replacements - < > Screen Commands + < > NOBAK Mode < > The Outside World + < > Numeric Arguments < > Unbinding Keys + < > OVER Mode < > Using the Mouse + < > Other Searches < > VIEW Mode + < > Pages < > WRAP Mode + < > Paragraphs < > Window Commands + < > REP Mode < > Windows + < > Regions < > Words + < > Repetitive Tasks Press [PG DOWN] to return to main menu @@ -78,10 +79,12 @@ NEXT[Main Menu] PREV[Main Menu] NEXT[Command Summary 2] PREV[Reference Screens] ^G abort-command Abort any command waiting for input +unbound add-abbrev Add an abbreviation M-M add-global-mode Add a global mode for all new buffers ^XM add-mode Add a mode to the current buffer ^X^A append-file Append current buffer to file M-A apropos List out commands containing a given string +unbound back-from-tag-word Return to the file from where we tagged an identifier ^B backward-character Move one character to the left ^X( begin-macro Begin recording a keyboard macro M-< beginning-of-file Move to the beginning of the current file @@ -92,13 +95,13 @@ M-K bind-to-key Bind a key to a function ^X^U case-region-upper Make a marked region all upper case M-C case-word-capitalize Capitalize the following word M-L case-word-lower Lower case the following word -M-U case-word-upper Upper case the following word -^XN change-file-name Change the name of the current file [PG DOWN] for more commands =>Command Summary 2 NEXT[Command Summary 3] PREV[Command Summary 1] +M-U case-word-upper Upper case the following word +^XN change-file-name Change the name of the current file unbound change-screen-column Change column of upper left of current screen unbound change-screen-row Change row of upper left of current screen unbound change-screen-size Change the number of screen lines @@ -110,27 +113,37 @@ M-^C count-words Count words, lines and characters in region ^X ctlx-prefix Change the key used as the ^X prefix ^XY cycle-ring Reposition current string in kill ring A-C cycle-screens Bring the rearmost screen to front +unbound define-abbrevs Define abbreviations from a buffer +unbound delete-abbrevs Delete an abbreviation ^X^O delete-blank-lines Delete all blank lines around the cursor ^XK delete-buffer Delete a non-displayed buffer -M-^M delete-global-mode Turn off a global mode -M-^Y delete-kill-ring Throw out all kill ring text -^X^M delete-mode Turn off a mode in the current buffer -^D delete-next-character Delete the character following the cursor [PG DOWN] for more commands =>Command Summary 3 NEXT[Command Summary 4] PREV[Command Summary 2] +M-^M delete-global-mode Turn off a global mode +M-^Y delete-kill-ring Throw out all kill ring text +^X^M delete-mode Turn off a mode in the current buffer +^D delete-next-character Delete the character following the cursor M-D delete-next-word Delete the word following the cursor ^X1 delete-other-windows Remove all other displayed windows ^H delete-previous-character Delete character to the left of the cursor M-^H delete-previous-word Delete the word to the left of the cursor A-D delete-screen Delete a non-displayed screen -^X0 delete-window Remove the current window from the screen +M-^U delete-undos Delete current buffer's undo stack +^X0 delete-window Remove the current window from the +screen +unbound describe-abbrevs List all defined abbreviations unbound describe-bindings List all legal commands unbound describe-functions List all defined functions ^X? describe-key Describe the command bound to a keystroke unbound describe-variables List all variables + + [PG DOWN] for more commands +=>Command Summary 4 +NEXT[Command Summary 5] PREV[Command Summary 3] + ^X^D detab-region Change tabs in region to equivalent spaces ^XG display Display variables current value ^X) end-macro stop recording a keyboard macro @@ -138,11 +151,6 @@ M-> end-of-file Move to the end of the current buffer ^E end-of-line Move to the end of the current line unbound end-of-word Move to the end of the current word ^X^E entab-region Change spaces to tabs where possible - - [PG DOWN] for more commands -=>Command Summary 4 -NEXT[Command Summary 5] PREV[Command Summary 3] - ^X^X exchange-point-and-mark Swap cursor and mark positions unbound execute-buffer Execute a buffer as a macro M-^X execute-command-line Execute a command line @@ -153,6 +161,11 @@ M-X execute-named-command Execute a command by name M-^E execute-procedure Execute a procedure by name ^X$ execute-program Execute a program directly (not thru a shell) ^X^C exit-emacs Exit EMACS. + + [PG DOWN] for more commands +=>Command Summary 5 +NEXT[Command Summary 6] PREV[Command Summary 4] + M-Q fill-paragraph Fill the current paragraph ^X# filter-buffer Filter current buffer thru external filter ^X^F find-file Find a file to edit in the current window @@ -160,38 +173,43 @@ A-F find-screen Find and make current a named screen ^F forward-character Move cursor one character to the right M-G goto-line Goto a numbered line M-^G goto-mark Goto a numbered mark (0 by default) - - [PG DOWN] for more commands -=>Command Summary 5 -NEXT[Command Summary 6] PREV[Command Summary 4] - M-^F goto-matching-fence Goto the matching fence ^X^ grow-window Make the current window larger ^I handle-tab Insert a tab or set tab stops -M-? help Read EMACS.HLP into a buffer and display it +M-? help Read emacs.hlp into a buffer and display it +unbound hide-buffer Set a buffer as invisible A-R hunt-backward Hunt for last match of previous search string A-S hunt-forward Hunt for next match of previous search string ^XC i-shell Shell up to a new command processor ^XS incremental-search Search for a string, incrementally M-) indent-region Indent region one tab stop + + [PG DOWN] for more commands +=>Command Summary 6 +NEXT[Command Summary 7] PREV[Command Summary 5] + +unbound index-help List index of language help +unbound insert-abbrevs Insert defined abbreviations in a buffer ^X^I insert-file insert a file at cursor ^C insert-space Insert a space to the right of the cursor unbound insert-string Insert a string at the cursor +unbound kill-abbrevs Clear the list of defined abbreviations M-^W kill-paragraph Delete the current paragraph ^W kill-region Delete marked region, save to kill buffer ^K kill-to-end-of-line Delete the rest of the current line -unbound label-function-key Label a function key (hp150 only) ^X^B list-buffers List all existing buffers - - [PG DOWN] for more commands -=>Command Summary 6 -NEXT[Command Summary 7] PREV[Command Summary 5] - A-B list-screens List all existing screens +unbound list-undos List all undoes +M-H look-word Display help on the current word ^X^K macro-to-key Bind a key to a macro ^[ meta-prefix Key used to precede all META commands ^X^N move-window-down Move all lines in the current window down ^X^P move-window-up Move all lines in the current window up + + [PG DOWN] for more commands +=>Command Summary 7 +NEXT[Command Summary 8] PREV[Command Summary 6] + M-^N name-buffer Change the name of the current buffer ^X< narrow-to-region hides all text not in the current region ^M newline Insert at the cursor @@ -204,20 +222,21 @@ M-N next-paragraph Move cursor to the next paragraph M-F next-word Move cursor to beginning of next word unbound nop Does nothing ^O open-line Open a line at the cursor - - [PG DOWN] for more commands -=>Command Summary 7 -NEXT[Command Summary 8] PREV[Command Summary 6] - unbound overwrite-string Overwrite a string at the cursor ^X@ pipe-command Execute an external command, record output unbound pop-buffer Display named buffer as a pop-up ^P previous-line Move cursor up one line ^Z previous-page Move cursor up one page + + [PG DOWN] for more commands +=>Command Summary 8 +NEXT[Command Summary 9] PREV[Command Summary 7] + M-P previous-paragraph Move back one paragraph ^XP previous-window Move the cursor to the last window M-B previous-word Delete the word to the left of the cursor unbound print Display a string on the command line +M-J prompt-look Display help on asked word M-^R query-replace-string Interactively replace one string with another M-Z quick-exit Exit EMACS, writing out all changed buffers ^Q quote-character Insert the next character, literally @@ -226,15 +245,15 @@ M-^L redraw-display Redraw display, centering current line ^X remove-mark Erase numbered mark A-N rename-screen Change the name of the current screen M-R replace-string Replace one string with another - - [PG DOWN] for more commands -=>Command Summary 8 -NEXT[Command Summary 9] PREV[Command Summary 7] - ^XW resize-window Change number of lines in current window unbound restore-window Move cursor to the last saved window ^XR reverse-incremental-search Search backwards, incrementally M-^E run Execute a named procedure + + [PG DOWN] for more commands +=>Command Summary 9 +NEXT[Command Summary 10] PREV[Command Summary 8] + ^X^S save-file Save the current buffer if it is changed unbound save-window Remember current window (to restore later) M-^V scroll-next-down Scroll the next window down @@ -249,14 +268,16 @@ M- set-mark Set a mark ^X! shell-command Causes external shell to execute command unbound show-files List contents of directory ^X^Z shrink-window Make the current window smaller - [PG DOWN] for more commands -=>Command Summary 9 -NEXT[Reference Screens] PREV[Command Summary 8] - M-^S source Execute a file as a macro ^X2 split-current-window Split the current window in two unbound store-macro Store following macro lines to numbered macro + + [PG DOWN] for more commands +=>Command Summary 10 +NEXT[Reference Screens] PREV[Command Summary 9] + unbound store-procedure Store following macro lines to named procedure +unbound tag-word Tag a word ^T transpose-characters Transpose char at cursor with char to left ^X^T trim-region Trim any trailing white space from a region M-^K unbind-key Unbind a key from a function @@ -265,12 +286,14 @@ M-( undent-region undent region one tab stop M-~ unmark-buffer Unmark the current buffer unbound update-screen Force a screen update during macro execution ^X^V view-file Find a file, and put it in view mode -^X> widen-from-region restores hidden text +^X> widen-from-region Restores hidden text unbound wrap-word Wrap the current word ^X^W write-file Write current buffer under new file name unbound write-message Same as print -^Y yank yank kill buffer into current buffer at cursor -M-Y yank-pop yank the next string in the kill ring +^Y yank Yank (paste) kill buffer into current buffer at cursor +M-Y yank-pop Yank (paste) the next string in the kill ring +M-^[ zap-help Deletes the first window on the screen for the help buffer + [PG DOWN] to return to Reference Screens =>Writing EMACS Macros NEXT[Main Menu] PREV[Menu Menu] @@ -391,7 +414,9 @@ NEXT[Function Summary 2] PREV[Reference Screens] any string Return Function logical value Value Arguments Description ----- No return value -------------------------------------------- +------------------------------------------------------------------------------- + + &abb Lookup abbreviation &abs Returns the absolute value of &add Add two numbers &and Returns TRUE if BOTH logical arguments are TRUE @@ -403,12 +428,17 @@ Value Arguments Description ----- No return value &bxo Bitwise XOR function &cat Concatenate the two strings to form one &chr get character represented by ascii code - &div Divide num1 by num2 - [PG DOWN] for more functions =>Function Summary 2 NEXT[Function Summary 3] PREV[Function Summary 1] + MicroEMACS Function Summary Numeric string + any string +Return Function logical value +Value Arguments Description ----- No return value +------------------------------------------------------------------------------- + + &div Divide num1 by num2 &env get environment variable &equ Is and numerically equal? &exi Does the named file exist? @@ -420,85 +450,127 @@ NEXT[Function Summary 3] PREV[Function Summary 1] any &ind Evaluate as a variable. &isn Is str numeric? &lef get leftmost characters from + +=>Function Summary 3 +NEXT[Function Summary 4] PREV[Function Summary 2] + + MicroEMACS Function Summary Numeric string + any string +Return Function logical value +Value Arguments Description ----- No return value +------------------------------------------------------------------------------- + &len find length of str &les Is < numerically? &low Lowercase &mid Get chars from at + &mkc Get column of a mark + &mkl Get line number of a mark &mod Remainder of num1 / num2 &neg Negates number - - [PG DOWN] for more functions -=>Function Summary 3 -NEXT[Reference Screens] PREV[Function Summary 2] - ¬ Return the opposite logical value &or Returns TRUE if either argument is TRUE &rev Return a string with reversed characters &rig Get the rightmost characters from + +=>Function Summary 4 +NEXT[Function Summary 5] PREV[Function Summary 3] + + MicroEMACS Function Summary Numeric string + any string +Return Function logical value +Value Arguments Description ----- No return value +------------------------------------------------------------------------------- + &rnd Returns a random integer between 1 and &seq Is = alphabetically? &sgr Is >= alphabetically? &sin find position of str2 in str1 (0 if fails) &sle Is < alphabetically? ----- &slo Set lowercasing table + &sri find last position of str2 in str1 (0 if fails) &sub Subtract two numbers ----- &sup Set uppercasing table &tim Multiply two numbers &tri Trim the trailing whitespace from a string &tru Is num answer to Life, The Universe, Everything? + +=>Function Summary 5 +NEXT[Reference Screens] PREV[Function Summary 4] + + MicroEMACS Function Summary Numeric string + any string +Return Function logical value +Value Arguments Description ----- No return value +------------------------------------------------------------------------------- + &upp Uppercase &xla Translate str1 via str2<->str3 table + + + + + + + + [PG DOWN] to return to reference screens + =>Environment Variable List =Environment Summary 1 =>Environment Summary 1 NEXT[Environment Summary 2] PREV[Reference Screens] +$abbell ring bell on abbreviation expansion? +$abcap match capitalization in abbreviation expansions +$abquick quick, aggressive expansions enabled? $acount countdown of inserted characters until the next autosave $asave number of inserted characters between automatic file-saves $bufhook macro called on buffer entry $cbflags current buffer's attribute flags $cbufname buffer name of the current buffer $cfname file name of the current buffer +$class class code of terminal (Theos) $cmdhook function run before each user command $cmode mode of the current buffer +$cquote close quote character $curchar ascii value of the character currently at the point $curcol current column of point in current buffer $curline current line of point in current buffer $curwidth number of columns in current screen -$curwind current window number -$cwline current display line in current window -$debug flag to trigger macro debugging -$deskcolor color to use for current desktop, default to BLACK -$diagflag allow diaganal mouse drags? [PG DOWN] for more environment variables =>Environment Summary 2 NEXT[Environment Summary 3] PREV[Environment Summary 1] +$curwind current window number +$cwline current display line in current window +$debug flag to trigger macro debugging +$deskcolor color to use for current desktop, default to BLACK +$diagflag allow diagonal mouse drags? $discmd echo command prompts? Default is TRUE $disinp echo input at the command prompts? Default is TRUE -$disphigh display high-bit characters symbolically? Default is FALSE $exbhook macro to execute when exiting a buffer $fcol text column being displayed in first column of current window $fillcol current fill column $flicker suppress screen flicker (for old IBM-PC CGA adapter) $fmtlead list of all formatter lead characters +$found last search status $gflags global flags controlling some EMACS internal functions $gmode global mode flags $hardtab number of spaces between hard tab stops $hilight hilight selected region? -$hjump columns to scroll the screen horizontally when needed -$hscrlbar display horizontal scroll bars? (under windowing versions) -$hscroll scroll screen horizontally? or just current line -$isterm incremental search terminator character -$kill contains the first 127 characters in the kill buffer [PG DOWN] for more environment variables =>Environment Summary 3 NEXT[Environment Summary 4] PREV[Environment Summary 2] +$hjump columns to scroll the screen horizontally when needed +$hscrlbar display horizontal scroll bars? (under windowing versions) +$hscroll scroll screen horizontally? or just current line +$isterm incremental search terminator character +$kill contains the first 127 characters in the kill buffer $language [READ ONLY] name of the language which messages display $lastkey [READ ONLY] last keyboard character typed $lastmesg [READ ONLY] text of the last message written on command line @@ -506,29 +578,40 @@ $line current line in the current buffer $lterm line terminator characters. default are native ones $lwidth [READ ONLY] number of characters in the current line $match [READ ONLY] last string matched in a search +$mcol mark column +$mline mark line $mmove mode of mouse movement (0=none, 1=default, 2=always) $modeflag display mode lines? $msflag mouse present? -$numwind number of windows displayed -$orgrow desktop row position of current screen -$orgcol desktop column position of current screen -$os Operating system MicroEMACS is running under -$overlap number of lines to overlap during scroll -$pagelen number of screen lines used currently -$palette string used to control the palette register settings [PG DOWN] for more environment variables =>Environment Summary 4 NEXT[Environment Summary 5] PREV[Environment Summary 3] +$newscreen new screen with new buffer? +$numwind number of windows displayed on current screen +$oquote open quote character +$orgcol desktop column position of current screen +$orgrow desktop row position of current screen +$os Operating system MicroEMACS is running under +$overlap number of lines to overlap during scroll +$pagelen number of screen lines used currently +$palette string used to control the palette register settings $paralead string containing all paragraph start characters $pending [READ ONLY] are there are user keystrokes pending? +$pid process id of MicroEmacs $popflag use pop-up windows? Default is TRUE +$popwait user wait on end of pop-up window? $posflag display line and column position on modeline. Default is FALSE $progname [READ ONLY] contains the string "MicroEMACS" $ram amount of remaining memory if compiled with RAMSIZE + + [PG DOWN] for more environment variables +=>Environment Summary 5 +NEXT[Environment Summary 6] PREV[Environment Summary 4] + $readhook macro to execute before reading in a file -$region string of the current region. truncates at 255 characters +$region [READ ONLY] string of the current region. truncates at 255 characters $replace current replace pattern used in replace commands $rval return value from the last invoked subprocess $scrname current screen name @@ -538,18 +621,20 @@ $seed integer seed of the random number generator $softtab number of spaces inserted by EMACS when soft tabbing $sres Current screen resolution $ssave safe file saving? Default is TRUE - - [PG DOWN] for more environment variables -=>Environment Summary 5 -NEXT[Reference Screens] PREV[Environment Summary 4] - $sscroll smooth scrolling? Default is FALSE $status [READ ONLY] Status of the success of the last command $sterm search string input terminator, default is META $target target for line moves $time [READ ONLY] current date and time. "Mon May 09 10:10:58 1988" $timeflag display time of day on modeline? Default is FALSE. + + [PG DOWN] for more environment variables +=>Environment Summary 6 +NEXT[Reference Screens] PREV[Environment Summary 5] + +$tmpnam temporary file name $tpause Controls length of the pause to display matched fence in CMODE +$undoflag currently processing undoes flag $version [READ ONLY] current MicroEMACS version number $vscrlbar display vertical scroll bars? $wchars letters legal in word. Default is alphanumerics and underscore @@ -561,6 +646,10 @@ $yankflag position at end of yanked text? $ypos last mouse row + + + + [PG DOWN] to return to reference screens =>ENDOFFILE < > diff --git a/cmd/emacs.rc b/cmd/emacs.rc index 5acc747..9401603 100644 --- a/cmd/emacs.rc +++ b/cmd/emacs.rc @@ -13,13 +13,14 @@ write-message "[Setting up....]" ; set $sres "EGA" ; If you hate clocks or position counters, comment these -set $timeflag TRUE +;set $timeflag TRUE set $posflag TRUE +set $sscroll TRUE ; Set Default Global modes -add-global-mode "blue" -add-global-mode "WHITE" +add-global-mode "white" +add-global-mode "BLACK" ;bind-to-key meta-prefix ` ;for annoying keyboards with ` at the top left ; Toggle function key window display @@ -35,16 +36,17 @@ store-procedure toggle-fkeys !if &sequal $cbufname "emacs.hlp" delete-window !endif - !if ¬ &sequal $cbufname "Function Keys" + !if ¬ &sequal $cbufname "[Function Keys]" 1 split-current-window - 1 select-buffer "Function Keys" - add-mode "red" + 1 select-buffer "[Function Keys]" + add-mode "blue" + add-mode "WHITE" !force 5 resize-window 1 goto-line !endif set %rcfkeys TRUE !force restore-window - !if &sequal $cbufname "Function Keys" + !if &sequal $cbufname "[Function Keys]" next-window !endif write-message "[Function key window ON]" @@ -54,7 +56,7 @@ store-procedure toggle-fkeys *rcfoff save-window 1 next-window - !if &sequal "Function Keys" $cbufname + !if &sequal "[Function Keys]" $cbufname delete-window !endif !force restore-window @@ -93,15 +95,29 @@ store-procedure set-default-mode !if &equ %rctmp 0 !return !endif - set %rctmp &mid $cfname &add %rctmp 1 5 - !if &or &seq %rctmp "c" &seq %rctmp "h" - add-mode "cmode" - !endif - !if &or &seq %rctmp "cpp" &seq %rctmp "hpp" - add-mode "cmode" - !endif - !if &or &seq %rctmp "mss" &seq %rctmp "txt" - add-mode "wrap" + !if &seq $os "THEOS" + set %rctmp &mid $cfname &add %rctmp 1 2 + !if &or &seq %rctmp "c:" &seq %rctmp "h:" + add-mode "cmode" + !endif + set %rctmp &mid $cfname &add %rctmp 1 4 + !if &or &seq %rctmp "cpp:" &seq %rctmp "hpp:" + add-mode "cmode" + !endif + !if &seq %rctmp "txt:" + add-mode "wrap" + !endif + !else + set %rctmp &mid $cfname &add %rctmp 1 5 + !if &or &seq %rctmp "c" &seq %rctmp "h" + add-mode "cmode" + !endif + !if &or &seq %rctmp "cpp" &seq %rctmp "hpp" + add-mode "cmode" + !endif + !if &or &seq %rctmp "mss" &seq %rctmp "txt" + add-mode "wrap" + !endif !endif !endm set $readhook set-default-mode @@ -116,7 +132,7 @@ store-procedure mouse-clicks !force mouse-move-down ;If not in the function key window... leave - !if ¬ &sequal $cbufname "Function Keys" + !if ¬ &sequal $cbufname "[Function Keys]" !return !endif @@ -188,23 +204,38 @@ macro-to-key toggle-fkeys FN5 macro-to-key get-help FN6 bind-to-key next-window FN7 macro-to-key get-page-loader FN8 -bind-to-key save-file FN9 -bind-to-key exit-emacs FN0 +bind-to-key exit-emacs FN9 +bind-to-key save-file FN0 + +bind-to-key move-window-up FN^P +bind-to-key move-window-down FN^N +bind-to-key scroll-next-up M-FNZ +bind-to-key scroll-next-down M-FNV + +!if &seq $os "UNIX" + bind-to-key delete-next-character ^? + bind-to-key delete-next-word M-^? + bind-to-key delete-previous-word M-^H +!else + bind-to-key delete-previous-character ^? + bind-to-key delete-previous-word M-^? + bind-to-key delete-next-word M-FND +!endif ; bring up the function key window 1 split-current-window - 1 select-buffer "Function Keys" - insert-string "f1 search-> f2 <-search Û MicroEMACS: Text Editor~n" - insert-string "f3 hunt-> f4 <-hunt Û ~n" - insert-string "f5 fkeys f6 help Û Available function key Pages include:~n" - insert-string "f7 nxt wind f8 pg[ ] Û Word Box Emacs Pascal C cObol Lisp~n" - insert-string "f9 save f10 exit Û [use the f8 key to load Pages]~n" + 1 select-buffer "[Function Keys]" + insert-string "f1 search-> f2 <-search | MicroEMACS: Text Editor~n" + insert-string "f3 hunt-> f4 <-hunt | ~n" + insert-string "f5 fkeys f6 help | Available function key Pages include:~n" + insert-string "f7 nxt wind f8 pg[ ] | Word Box Emacs Pascal C cObol Lisp~n" + insert-string "f9 exit f10 save | [use the f8 key to load Pages]~n" unmark-buffer delete-window set %rcfkeys FALSE - !if &seq $os "UNIX" + !if &seq $os "unix" ;Allow mainframes to simulate function ;keys with ^C and ^C shifted- @@ -249,4 +280,31 @@ bind-to-key exit-emacs FN0 set $sres CGA !endif - set $discmd TRUE +store-procedure toggle-insert + !if &gre &mod $cmode 64 31 + delete-mode "over" + !else + add-mode "over" + !endif +!endm +macro-to-key toggle-insert FNC + +store-procedure single-graphics + !force delete-mode "GRD" + add-mode "GRS" +!endm +macro-to-key single-graphics FN- + +store-procedure double-graphics + !force delete-mode "GRS" + add-mode "GRD" +!endm +macro-to-key double-graphics S-FN- + +store-procedure no-graphics + !force add-mode "GRS" + !force add-mode "GRD" +!endm +macro-to-key no-graphics FN^- + +set $discmd TRUE diff --git a/cmd/emacs.rc_curses b/cmd/emacs.rc_curses new file mode 100644 index 0000000..88be80c --- /dev/null +++ b/cmd/emacs.rc_curses @@ -0,0 +1,129 @@ +; EMACS.RC: Standard MicroEMACS Startup program +; for MicroEMACS 3.13 and above +; (C)opyright 1987-99 by Daniel M Lawrence +; Last Update: 11/13/93 + +;set $discmd TRUE +write-message "[Setting up....]" +;set $debug TRUE + +; If you hate clocks or position counters, comment these +;set $timeflag TRUE +set $posflag TRUE +set $sscroll TRUE + +; Set Default Global modes + +add-global-mode "white" +add-global-mode "BLACK" + +; Bring up Online-help system + +store-procedure get-help + set $discmd FALSE + source ehelp.cmd + set $discmd TRUE +!endm + +macro-to-menu get-help "Help>MicroEmacs help" + +; Set up default modes + +add-mode "white" +add-mode "BLACK" + +store-procedure set-default-mode +; set $debug TRUE + set %rctmp &sri $cfname "." + !if &equ %rctmp 0 + !return + !endif + set %rctmp &mid $cfname &add %rctmp 1 5 + !if &or &seq %rctmp "c" &seq %rctmp "h" + add-mode "cmode" + delete-mode "theox" + set $hardtab 4 + kill-abbrevs + !endif + !if &or &seq %rctmp "cpp" &seq %rctmp "hpp" + add-mode "cmode" + delete-mode "theox" + set $hardtab 4 + kill-abbrevs + !endif + !if &seq %rctmp "b" + add-mode "cmode" + add-mode "abbrev" + delete-mode "theox" + set $hardtab 2 + execute-file babbrevs.cmd + !endif + !if &seq %rctmp "basic" + add-mode "cmode" + add-mode "abbrev" + add-mode "theox" + set $hardtab 2 + execute-file babbrevs.cmd + !endif + !if &or &seq %rctmp "mss" &seq %rctmp "txt" + add-mode "wrap" + delete-mode "cmode" + delete-mode "theox" + set $hardtab 8 + kill-abbrevs + !endif +!endm +set $readhook set-default-mode + +; ***** Rebind the Function key group + +bind-to-key search-forward FN1 +bind-to-key search-reverse FN2 +bind-to-key hunt-forward FN3 +bind-to-key hunt-backward FN4 +;bind-to-key toggle-fkeys FN5 +macro-to-key get-help FN6 +bind-to-key next-window FN7 +bind-to-key previous-window FN8 +bind-to-key exit-emacs FN9 +bind-to-key save-file FN0 + +store-procedure toggle-insert + !if &gre &mod $cmode 64 31 + delete-mode "over" + !else + add-mode "over" + !endif +!endm +macro-to-key toggle-insert FNC + +store-procedure convert-to-utf8 +; set $debug TRUE + set %cmode &band $cmode 16384 + !if &equ %cmode 16384 + unmark-buffer + filter-buffer "theoxutf" + delete-mode "theox" + !else + write-message "[File already uses Unicode character set]" + !endif + !force set $debug FALSE +!endm + +store-procedure convert-to-theox +; set $debug TRUE + set %cmode &band $cmode 16384 + !if &equ %cmode 0 + unmark-buffer + filter-buffer "utftheox" + add-mode "theox" + !else + write-message "[File already uses TheoX character set]" + !endif + !force set $debug FALSE +!endm + +macro-to-menu convert-to-utf8 "Modify>Convert to UTF-8" +macro-to-menu convert-to-theox "Modify>Convert to TheoX" + +execute-file tpage.cmd diff --git a/cmd/emacs.rc_linux b/cmd/emacs.rc_linux new file mode 100644 index 0000000..d9e37ec --- /dev/null +++ b/cmd/emacs.rc_linux @@ -0,0 +1,320 @@ +; EMACS.RC: Standard MicroEMACS Startup program +; for MicroEMACS 3.13 and above +; (C)opyright 1987-99 by Daniel M Lawrence +; Last Update: 11/13/93 + +set $discmd TRUE +;set $debug TRUE +write-message "[Setting up....]" + +; If you screen "SNOWS", comment this line + set $flicker "FALSE" + +; To use an IBM-PC EGA card, uncomment the following line +; set $sres "EGA" + +; If you hate clocks or position counters, comment these +;set $timeflag TRUE +set $posflag TRUE +set $sscroll TRUE + +; Set Default Global modes + +add-global-mode "white" +add-global-mode "BLACK" +;bind-to-key meta-prefix ` ;for annoying keyboards with ` at the top left + +; Toggle function key window display + +store-procedure toggle-fkeys + !if %rcfkeys + !goto rcfoff + !endif + +; toggle function key window on + save-window + 1 next-window + !if &sequal $cbufname "emacs.hlp" + delete-window + !endif + !if ¬ &sequal $cbufname "[Function Keys]" + 1 split-current-window + 1 select-buffer "[Function Keys]" + add-mode "red" + add-mode "WHITE" + add-mode "VIEW" + !force 5 resize-window + 1 goto-line + !endif + set %rcfkeys TRUE + !force restore-window + !if &sequal $cbufname "[Function Keys]" + next-window + !endif + write-message "[Function key window ON]" + !return + + ;Toggle the function key window off +*rcfoff + save-window + 1 next-window + !if &sequal "[Function Keys]" $cbufname + delete-window + !endif + !force restore-window + write-message "[Function key window OFF]" + set %rcfkeys FALSE +!endm + +; Bring up Online-help system + +store-procedure get-help + set $discmd FALSE + source ehelp.cmd + set $discmd TRUE +!endm + +; Load a new page + +store-procedure get-page-loader + !if &seq &find newpage.cmd "" + write-message "[Can not find NEWPAGE.CMD]" + !return + !endif + execute-file newpage.cmd +!endm + +;procedure to clean out the current page (which is nothing right now) + +store-procedure clean + ; nothing by default +!endm + +; Set up default modes + +store-procedure set-default-mode +; set $debug TRUE + set %rctmp &sri $cfname "." + !if &equ %rctmp 0 + !return + !endif + !if &seq $os "THEOS" + set %rctmp &mid $cfname &add %rctmp 1 3 + !if &or &seq %rctmp "c:" &seq %rctmp "h:" + add-mode "cmode" + set $hardtab 4 + !endif + set %rctmp &mid $cfname &add %rctmp 1 7 + !if &seq %rctmp "basic:" + add-mode "cmode" + set $hardtab 2 + !endif + !if &seq %rctmp "txt:" + add-mode "wrap" + set $hardtab 8 + !endif + !else + set %rctmp &mid $cfname &add %rctmp 1 5 + !if &or &seq %rctmp "c" &seq %rctmp "h" + add-mode "cmode" + add-mode "utf-8" + set $hardtab 4 + kill-abbrevs + !endif + !if &or &seq %rctmp "cpp" &seq %rctmp "hpp" + add-mode "cmode" + add-mode "utf-8" + set $hardtab 4 + kill-abbrevs + !endif + !if &seq %rctmp "b" + add-mode "cmode" + add-mode "utf-8" + set $hardtab 2 + execute-file babbrevs.cmd + !endif + !if &seq %rctmp "basic" + add-mode "cmode" + add-mode "theox" + set $hardtab 2 + execute-file babbrevs.cmd + !endif + !if &or &seq %rctmp "mss" &seq %rctmp "txt" + add-mode "wrap" + delete-mode "cmode" + add-mode "utf-8" + set $hardtab 8 + kill-abbrevs + !endif + !endif +!endm +set $readhook set-default-mode + +; This function activates the function key window as +; a legitimate place to call up function keys using the mouse + +store-procedure mouse-clicks + + ;remember where we started, and do the mouse movement + save-window + !force mouse-move-down + + ;If not in the function key window... leave + !if ¬ &sequal $cbufname "[Function Keys]" + !return + !endif + + ;First pos is a screen reposition, let it through + !if &and &equ $xpos 0 &equ $ypos 0 + restore-window + !return + !endif + + ;Find out what function key were gonna do + add-mode magic + 2 forward-character + set %rctmp $search + !force search-reverse "[fF][0-9]" + !if &seq $status FALSE + delete-mode magic + set $search %rctmp + !return + !endif + + ;we are on the "f" or "F". Get the function key type and number now + set $search %rctmp + set %fcase lower + !if &equ $curchar 70 + set %fcase upper + !endif + 1 forward-character + set %fnum &chr $curchar + 1 forward-character + set %fnum &cat %fnum &chr $curchar + set %fnum &add %fnum 0 + !if &equ %fnum 10 + set %fnum "0" + !endif + set %fname &cat "FN" %fnum + !if &seq %fcase upper + set %fname &cat "S-" %fname + !endif + + ;save the function + set %rccmd &bind %fname + delete-mode MAGIC + + ;swallow the up-button + set %rctmp >c + + ;restore the window and exit + restore-window + + ;procedures don't need the square brackets + !if &seq &left %rccmd 1 "[" + set %rccmd &mid %rccmd 2 &sub &len %rccmd 2 + %rccmd + !return + !endif + + ;and then execute it + !force execute-named-command %rccmd +!endm +;macro-to-key mouse-clicks MSa + +; ***** Rebind the Function key group + +bind-to-key search-forward FN1 +bind-to-key search-reverse FN2 +bind-to-key hunt-forward FN3 +bind-to-key hunt-backward FN4 +macro-to-key toggle-fkeys FN5 +macro-to-key get-help FN6 +bind-to-key next-window FN7 +macro-to-key get-page-loader FN8 +bind-to-key exit-emacs FN9 +bind-to-key save-file FN0 + +bind-to-key move-window-up FN^P +bind-to-key move-window-down FN^N +bind-to-key scroll-next-up M-FNZ +bind-to-key scroll-next-down M-FNV + +!if &seq $os "UNIX" + bind-to-key delete-next-character ^? + bind-to-key delete-next-word M-^? + bind-to-key delete-previous-word M-^H +!else + bind-to-key delete-previous-character ^? + bind-to-key delete-previous-word M-^? + bind-to-key delete-next-word M-FND +!endif + +; bring up the function key window + + 1 split-current-window + 1 select-buffer "[Function Keys]" + insert-string "f1 search-> f2 <-search | MicroEMACS: Text Editor~n" + insert-string "f3 hunt-> f4 <-hunt | ~n" + insert-string "f5 fkeys f6 help | Available function key Pages include:~n" + insert-string "f7 nxt wind f8 pg[ ] | C Box Emacs TxBasic~n" + insert-string "f9 exit f10 save | [use the f8 key to load Pages]~n" + unmark-buffer + delete-window + set %rcfkeys FALSE + + !if &seq $os "unix" + + ;Allow mainframes to simulate function + ;keys with ^C and ^C shifted- + + store-procedure emulate-fkeys + !if ¬ $pending + write-message "FN-" + !endif + set %rcchar >key + set %rcchar &sindex "1234567890!@#$%^&*()" %rcchar + !if &equ %rcchar 0 + write-message "[Not Bound]" + !return + !endif + clear-message-line + set %rctmp "FN" + !if &gre %rcchar 10 + set %rctmp &cat "S-" %rctmp + !endif + set %rcchar &mid "12345678901234567890" %rcchar 1 + set %rctmp &bind &cat %rctmp %rcchar + !if &seq &lef %rctmp 1 "[" + set %rctmp &mid %rctmp 2 &sub &len %rctmp 2 + run %rctmp + !return + !endif + !force execute-named-command %rctmp + !endm + + macro-to-key emulate-fkeys ^C + + !endif + + !if &seq $os "MSWIN" + source "mewin.cmd" + !else + toggle-fkeys + !endif + +!if &seq $os "OS2" + set $sres VGA + set $sres CGA +!endif + +store-procedure toggle-insert + !if &gre &mod $cmode 64 31 + delete-mode "over" + !else + add-mode "over" + !endif +!endm +macro-to-key toggle-insert FNC + +set $discmd TRUE diff --git a/cmd/tpage.cmd b/cmd/tpage.cmd new file mode 100644 index 0000000..36009b9 --- /dev/null +++ b/cmd/tpage.cmd @@ -0,0 +1,315 @@ +; TPAGE.CMD: TxBasic language MENU Page +; for MicroEMACS 3.9e and above +; + +; set up the "clean" procedure + +store-procedure clean + delete-buffer "[b-indent]" + delete-buffer "[b-indent-brace]" + delete-buffer "[b-check]" + delete-buffer "[b-compile]" + delete-buffer "[b-compile-release]" + delete-buffer "[b-compile-speed]" + delete-buffer "[b-compile-debug]" + delete-buffer "[b-compile-gdb]" + delete-buffer "[b-run]" + delete-buffer "[b-debug]" + delete-buffer "[b-gdb]" + delete-buffer "[b-new-if]" + delete-buffer "[b-new-switch]" + delete-buffer "[b-new-for]" + delete-buffer "[b-new-while]" + set $cmode %oldmode + set $gmode %oldgmode +!endm + +store-procedure b-indent +; set $debug TRUE + unmark-buffer + filter-buffer &cat "txf --unbrace --upper -i" $hardtab + !force set $debug FALSE +!endm + +store-procedure b-indent-brace +; set $debug TRUE + unmark-buffer + filter-buffer &cat "txf --brace --upper -i" $hardtab + !force set $debug FALSE +!endm + +store-procedure b-compile +; set $debug TRUE + !if %rcfkeys + !force toggle-fkeys + !endif + delete-other-windows + delete-buffer "[S-F9 prev error S-F10 next error]" + save-file + set %cfname $cfname + set %cmode &band $cmode 16384 + !if &equ %cmode 0 + !force pipe-command &cat &cat %command " --utf8 " $cfname + !else + !force pipe-command &cat %command $cfname + !endif + name-buffer "[S-F9 prev error S-F10 next error]" + end-of-file + !if &equ $curline 1 + !force delete-mode "VIEW" + insert-string &cat &cat %cfname " successfully " %work + unmark-buffer + !force 1 resize-window + add-mode "VIEW" + !force delete-mode "CMODE" + next-window + !else + beginning-of-file + !force 5 resize-window + add-mode "VIEW" + !force delete-mode "CMODE" + next-window + beginning-of-file + execute-procedure "b-next-error" + !endif + !force set $debug FALSE +!endm + +store-procedure b-check +; set $debug TRUE + set %command "mepipe txlint " + set %work "checked" + execute-procedure "b-compile" + !force set $debug FALSE +!endm + +store-procedure b-compile-release +; set $debug TRUE + set %command "mepipe txb -T -C" + set %work "compiled" + execute-procedure "b-compile" + !force set $debug FALSE +!endm + +store-procedure b-compile-speed +; set $debug TRUE + set %command "mepipe txb" + set %work "compiled" + execute-procedure "b-compile" + !force set $debug FALSE +!endm + +store-procedure b-compile-debug +; set $debug TRUE + set %command "mepipe txb -d -T" + set %work "compiled" + execute-procedure "b-compile" + !force set $debug FALSE +!endm + +store-procedure b-compile-gdb +; set $debug TRUE + set %command "mepipe txb -g -T -C" + set %work "compiled" + execute-procedure "b-compile" + !force set $debug FALSE +!endm + +store-procedure b-run +; set $debug TRUE + set %rctmp &sri $cfname "." + set %cfname &mid $cfname 1 &sub %rctmp 1 + shell-command &cat "merun ./" %cfname + !force set $debug FALSE +!endm + +store-procedure b-gdb +; set $debug TRUE + set %rctmp &sri $cfname "." + set %cfname &mid $cfname 1 &sub %rctmp 1 + shell-command &cat "gdb -tui ./" %cfname + !force set $debug FALSE +!endm + +store-procedure b-prev-error +; set $debug TRUE + delete-other-windows + split-current-window + select-buffer "[S-F9 prev error S-F10 next error]" + add-mode "VIEW" + !force 5 resize-window + beginning-of-line + !force search-reverse ", line " + !if &seq $status FALSE + write-message "[No more error]" + previous-window + !return + !endif + 7 forward-character + set-mark + end-of-word + set %line $region + previous-window + !force %line goto-line + !force set $debug FALSE +!endm + +store-procedure b-next-error +; set $debug TRUE + delete-other-windows + split-current-window + select-buffer "[S-F9 prev error S-F10 next error]" + add-mode "VIEW" + !force 5 resize-window + !force search-forward ", line " + !if &seq $status FALSE + write-message "[No more error]" + previous-window + !return + !endif + set-mark + end-of-word + set %line $region + previous-window + !force %line goto-line + !force set $debug FALSE +!endm + +store-procedure b-new-if + set %cond @"Logical expression: " +; set $debug TRUE + insert-string &cat "IF " %cond + newline-and-indent + newline-and-indent + insert-string "ELSE" + newline-and-indent + handle-tab + newline-and-indent + insert-string "IFEND" + newline-and-indent + delete-previous-character + 4 previous-line + handle-tab + end-of-line + !force set $debug FALSE +!endm + +store-procedure b-new-select + set %cond @"Expression: " +; set $debug TRUE + insert-string &cat "SELECT " %cond + newline-and-indent + newline-and-indent + insert-string "CASE" + newline-and-indent + handle-tab + newline-and-indent + insert-string "CEND" + newline-and-indent + delete-previous-character + 6 previous-line + end-of-line + !force set $debug FALSE +!endm + +; FOR NEXT +store-procedure b-new-for + set %cond @"Variable name: " +; set $debug TRUE + insert-string &cat &cat "FOR " %cond "=" + newline-and-indent + handle-tab + newline-and-indent + insert-string &cat "NEXT " %cond + 2 previous-line + end-of-line + !force set $debug FALSE +!endm + +; +; WHILE WEND +store-procedure b-new-while + set %cond @"Logical expression: " +; set $debug TRUE + insert-string &cat "WHILE " %cond + newline-and-indent + handle-tab + newline-and-indent + insert-string "WEND" + previous-line + end-of-line + !force set $debug FALSE +!endm + +store-procedure toggle-errors + !if %rcerrors + !goto rcfoff + !endif + +; toggle errors window on + save-window + 1 next-window + !if &sequal $cbufname "emacs.hlp" + delete-window + !endif + !if ¬ &sequal $cbufname "[S-F9 prev error S-F10 next error]" + 1 split-current-window + 1 select-buffer "[S-F9 prev error S-F10 next error]" + add-mode "red" + add-mode "WHITE" + !force 5 resize-window + 1 goto-line + !endif + set %rcfkeys TRUE + !force restore-window + !if &sequal $cbufname "[S-F9 prev error S-F10 next error]" + next-window + !endif + write-message "[Errors window ON]" + !return + + ;Toggle the error window off +*rcfoff + save-window + 1 next-window + !if &sequal "[S-F9 prev error S-F10 next error]" $cbufname + delete-window + !endif + !force restore-window + write-message "[Errors window OFF]" + set %rcerrors FALSE +!endm + +macro-to-key b-indent S-FN1 +macro-to-key b-indent-brace S-FN2 +macro-to-key b-check S-FN3 +macro-to-key b-compile-release S-FN4 +macro-to-key b-compile-speed S-FN5 +macro-to-key b-compile-debug S-FN6 +macro-to-key b-compile-gdb S-FN7 +macro-to-key b-run S-FN8 +macro-to-key b-prev-error S-FN9 +macro-to-key b-next-error S-FN0 + +macro-to-menu b-indent "TxBasic>Format b" +macro-to-menu b-indent-brace "TxBasic>Format w" +macro-to-menu b-check "TxBasic>Check" +macro-to-menu b-compile-release "TxBasic>Compile r" +macro-to-menu b-compile-speed "TxBasic>Compile for s" +macro-to-menu b-compile-debug "TxBasic>Compile for T" +macro-to-menu b-compile-gdb "TxBasic>Compile for g" +macro-to-menu b-run "TxBasic>Run" +macro-to-menu b-gdb "TxBasic>Run t" +macro-to-menu b-prev-error "TxBasic>Prev" +macro-to-menu b-next-error "TxBasic>Next" +macro-to-menu b-new-if "TxBasic>IF" +macro-to-menu b-new-select "TxBasic>SELECT" +macro-to-menu b-new-for "TxBasic>FOR" +macro-to-menu b-new-while "TxBasic>WHILE" + +; Set up CMODE +add-mode CMODE +add-global-mode CMODE +set $hardtab 5 + +write-message "[TxBasic perspective loaded]" diff --git a/cmd/tpage.cmd_nocurses b/cmd/tpage.cmd_nocurses new file mode 100644 index 0000000..8625640 --- /dev/null +++ b/cmd/tpage.cmd_nocurses @@ -0,0 +1,269 @@ +; TPAGE.CMD: TxBasic language MENU Page +; for MicroEMACS 3.9e and above +; + +; set up the "clean" procedure +store-procedure clean + delete-buffer "[b-indent]" + delete-buffer "[b-indent-brace]" + delete-buffer "[b-check]" + delete-buffer "[b-compile]" + delete-buffer "[b-run]" + delete-buffer "[b-new-if]" + delete-buffer "[b-new-switch]" + delete-buffer "[b-new-for]" + delete-buffer "[b-new-while]" + set $cmode %oldmode + set $gmode %oldgmode +!endm + +; make sure the function key window is up + set %rcfkeys FALSE + toggle-fkeys + write-message "Loading..." + +; Write out the page instructions + save-window + 1 next-window + beginning-of-file + delete-mode "VIEW" + set $curcol 25 + overwrite-string " F1 indent source F2 indent with braces F11 convert to UTF-8" + next-line + set $curcol 25 + overwrite-string " F3 check syntax F4 compile F12 convert to TheoX" + next-line + set $curcol 25 + overwrite-string " F5 previous error F6 next error " + next-line + set $curcol 18 + overwrite-string "TXB " + set $curcol 25 + overwrite-string " F7 IF ELSE ENDIF F8 SELECT CASE CEND " + next-line + set $curcol 25 + overwrite-string " F9 FOR NEXT F10 WHILE WEND " + unmark-buffer + beginning-of-file + add-mode "VIEW" + !force restore-window + update-screen + +; + +store-procedure b-indent +; set $debug TRUE + unmark-buffer + filter-buffer &cat "txf --unbrace -i" $hardtab + !force set $debug FALSE +!endm + +store-procedure b-indent-brace +; set $debug TRUE + unmark-buffer + filter-buffer &cat "txf --brace -i" $hardtab + !force set $debug FALSE +!endm + +store-procedure b-check +; set $debug TRUE + !if %rcfkeys + !force toggle-fkeys + !endif + delete-other-windows + save-file + pipe-command &cat "txlint " $cfname + delete-buffer "[F5 prev error F6 next error]" + name-buffer "[F5 prev error F6 next error]" + add-mode "VIEW" + delete-mode "CMODE" + !force 5 resize-window + previous-window + !force set $debug FALSE +!endm + +store-procedure b-compile +; set $debug TRUE + !if %rcfkeys + !force toggle-fkeys + !endif + delete-other-windows + save-file + set %cfname $cfname + split-current-window + delete-buffer "[F5 prev error F6 next error]" + select-buffer "[F5 prev error F6 next error]" + add-mode "VIEW" + !force 5 resize-window + pipe-command &cat "txb " %cfname + !force set $debug FALSE +!endm + +store-procedure b-prev-error +; set $debug TRUE + delete-other-windows + split-current-window + select-buffer "[F5 prev error F6 next error]" + add-mode "VIEW" + !force 5 resize-window + beginning-of-line + !force search-reverse ", line " + !if &seq $status FALSE + write-message "[No more error]" + previous-window + !return + !endif + 7 forward-character + set-mark + end-of-word + set %line $region + previous-window + !force %line goto-line + !force set $debug FALSE +!endm + +store-procedure b-next-error +; set $debug TRUE + delete-other-windows + split-current-window + select-buffer "[F5 prev error F6 next error]" + add-mode "VIEW" + !force 5 resize-window + !force search-forward ", line " + !if &seq $status FALSE + write-message "[No more error]" + previous-window + !return + !endif + set-mark + end-of-word + set %line $region + previous-window + !force %line goto-line + !force set $debug FALSE +!endm + +store-procedure b-new-if + set %cond @"Logical expression: " +; set $debug TRUE + insert-string &cat "IF " %cond + newline-and-indent + newline-and-indent + insert-string "ELSE" + newline-and-indent + handle-tab + newline-and-indent + insert-string "IFEND" + newline-and-indent + delete-previous-character + 4 previous-line + handle-tab + end-of-line + !force set $debug FALSE +!endm + +store-procedure b-new-select + set %cond @"Expression: " +; set $debug TRUE + insert-string &cat "SELECT " %cond + newline-and-indent + newline-and-indent + insert-string "CASE" + newline-and-indent + handle-tab + newline-and-indent + insert-string "CEND" + newline-and-indent + delete-previous-character + 6 previous-line + end-of-line + !force set $debug FALSE +!endm + +; FOR NEXT +store-procedure b-new-for + set %cond @"Variable name: " +; set $debug TRUE + insert-string &cat &cat "FOR " %cond "=" + newline-and-indent + handle-tab + newline-and-indent + insert-string &cat "NEXT " %cond + 2 previous-line + end-of-line + !force set $debug FALSE +!endm + +; +; WHILE WEND +store-procedure b-new-while + set %cond @"Logical expression: " +; set $debug TRUE + insert-string &cat "WHILE " %cond + newline-and-indent + handle-tab + newline-and-indent + insert-string "WEND" + previous-line + end-of-line + !force set $debug FALSE +!endm + +store-procedure toggle-errors + !if %rcerrors + !goto rcfoff + !endif + +; toggle errors window on + save-window + 1 next-window + !if &sequal $cbufname "emacs.hlp" + delete-window + !endif + !if ¬ &sequal $cbufname "[F5 prev error F6 next error]" + 1 split-current-window + 1 select-buffer "[F5 prev error F6 next error]" + add-mode "red" + add-mode "WHITE" + !force 5 resize-window + 1 goto-line + !endif + set %rcfkeys TRUE + !force restore-window + !if &sequal $cbufname "[F5 prev error F6 next error]" + next-window + !endif + write-message "[Errors window ON]" + !return + + ;Toggle the error window off +*rcfoff + save-window + 1 next-window + !if &sequal "[F5 prev error F6 next error]" $cbufname + delete-window + !endif + !force restore-window + write-message "[Errors window OFF]" + set %rcerrors FALSE +!endm + +macro-to-key b-indent S-FN1 +macro-to-key b-indent-brace S-FN2 +macro-to-key b-check S-FN3 +macro-to-key b-compile S-FN4 +macro-to-key b-prev-error S-FN5 +macro-to-key b-next-error S-FN6 +macro-to-key b-new-if S-FN7 +macro-to-key b-new-select S-FN8 +macro-to-key b-new-for S-FN9 +macro-to-key b-new-while S-FN0 + +; Set up CMODE +set %oldmode $cmode +set %oldgmode $gmode +add-mode CMODE +add-global-mode CMODE +set $hardtab 5 + +write-message "[TxBasic MENU page loaded]" From b047e5b16ce02ba11d8fd63e4de3b879eb8b74cd Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 3 Sep 2020 12:29:27 +0200 Subject: [PATCH 03/37] Add files via upload --- h/dutch.h | 30 +- h/ebind.h | 458 +++++----- h/edef.h | 97 ++- h/efunc.h | 98 ++- h/elang.h | 309 +++++++ h/english.h | 38 +- h/epath.h | 143 ++- h/eproto.h | 1985 ++++++++++++++++++++++-------------------- h/estruct.h.template | 1377 +++++++++++++++++++++++++++++ h/evar.h | 356 ++++---- h/french.h | 31 +- h/frenchis.h | 33 +- h/german.h | 39 +- h/japan.h | 35 +- h/latin.h | 35 +- h/mswin.h | 84 +- h/platin.h | 29 +- h/resource.h | 8 +- h/spanish.h | 37 +- h/theox.h | 20 + h/utf8.h | 23 + 21 files changed, 3849 insertions(+), 1416 deletions(-) create mode 100644 h/estruct.h.template create mode 100644 h/theox.h create mode 100644 h/utf8.h diff --git a/h/dutch.h b/h/dutch.h index bb80660..31b3b42 100644 --- a/h/dutch.h +++ b/h/dutch.h @@ -2,7 +2,7 @@ MicroEMACS 4.00 Translated by Paul De Bra - debra@research.att.com + debra@research.att.com (C)opyright 1995 by Daniel Lawrence */ @@ -38,7 +38,11 @@ #define TEXT27 "Pop buffer" #define TEXT28 "Buffer wordt nog getoond" #define TEXT29 "Verander buffer-naam in: " +#if JMDEXT +#define TEXT30 "ACTN Modus Grootte Buffer File" +#else #define TEXT30 "ACTN Modus Grootte Buffer File" +#endif /* ^^^The underlining will not match exactly for this line, but it's close*/ #define TEXT31 " Globale Modi" #define TEXT32 "Vergeet Veranderingen" @@ -70,7 +74,7 @@ #define TEXT57 "Kan lijst van variabelen niet tonen" #define TEXT58 "[Opbouwen lijst van variabelen]" #define TEXT59 UNUSED -#define TEXT60 "Lijn %D/%D Kolom %d/%d Kar. %D/%D (%d%%) Kar. = 0x%x" +#define TEXT60 "Lijn %D/%D Kolom %d/%d Kar. %D/%D (%d%%) Kar. = 0x%x %d" #define TEXT61 "" #define TEXT62 "Globale modus om " #define TEXT63 "Modus om " @@ -253,7 +257,26 @@ #define TEXT248 "Enter Label String: " #define TEXT249 "Global variable to declare: " #define TEXT250 "Local variable to declare: " - +#if JMDEXT +#define TEXT284 "Function not available" +#define TEXT285 "No topic" +#define TEXT286 "Searching topic \"%s\"" +#define TEXT287 "Searching keyword \"%s\"" +#define TEXT288 "Topic: " +#define TEXT289 "Keyword: " +#define TEXT290 "No help for topic \"%s\"" +#define TEXT291 "No help for keyword \"%s\"" +#define TEXT292 "Unable to open the help file %s" +#define TEXT293 "Index of " +#define TEXT294 "[Help]" +#define TEXT295 "[Errors]" +#define TEXT296 "[Function Keys]" +#define TEXT297 "%s is not a regular file" +#endif +#if THEOS +#define TEXT298 "%s is not a sequential file" +#define TEXT299 "%s is not a library" +#endif /* some of these are just used in the microsoft windows version */ #define TEXT300 "[Incorrect menu]" #define TEXT301 "[Too many nested popup menus]" @@ -292,4 +315,5 @@ #define TEXT335 "Change screen name to: " #define TEXT336 "[Screen name already in use]" #define TEXT337 "cannot monitor external program" +#define TEXT338 "space for help :" diff --git a/h/ebind.h b/h/ebind.h index 6b28199..a498fe2 100644 --- a/h/ebind.h +++ b/h/ebind.h @@ -12,192 +12,199 @@ NOSHARE KEYTAB keytab[NBINDS] = { #if MOUSE - {MOUS|'m', BINDFNC, mmove}, - {MOUS|CTRL|'m', BINDFNC, mmove}, - {MOUS|SHFT|'m', BINDFNC, mmove}, - {MOUS|CTRL|SHFT|'m', BINDFNC, mmove}, - {MOUS|'a', BINDFNC, movemd}, - {MOUS|'b', BINDFNC, movemu}, - {MOUS|'e', BINDFNC, mregdown}, - {MOUS|'f', BINDFNC, mregup}, - {MOUS|'1', BINDFNC, resizm}, - {MOUS|'2', BINDFNC, resizm2}, -#endif - - {CTRL|'A', BINDFNC, gotobol}, - {CTRL|'B', BINDFNC, backchar}, - {CTRL|'C', BINDFNC, insspace}, - {CTRL|'D', BINDFNC, forwdel}, - {CTRL|'E', BINDFNC, gotoeol}, - {CTRL|'F', BINDFNC, forwchar}, - {CTRL|'G', BINDFNC, ctrlg}, - {CTRL|'H', BINDFNC, backdel}, - {CTRL|'I', BINDFNC, tab}, - {CTRL|'J', BINDFNC, indent}, - {CTRL|'K', BINDFNC, killtext}, - {CTRL|'L', BINDFNC, refresh}, - {CTRL|'M', BINDFNC, newline}, - {CTRL|'N', BINDFNC, forwline}, - {CTRL|'O', BINDFNC, openline}, - {CTRL|'P', BINDFNC, backline}, - {CTRL|'Q', BINDFNC, quote}, - {CTRL|'R', BINDFNC, backsearch}, - {CTRL|'S', BINDFNC, forwsearch}, - {CTRL|'T', BINDFNC, twiddle}, - {CTRL|'U', BINDFNC, unarg}, - {CTRL|'V', BINDFNC, forwpage}, - {CTRL|'W', BINDFNC, killregion}, - {CTRL|'X', BINDFNC, cex}, - {CTRL|'Y', BINDFNC, yank}, - {CTRL|'Z', BINDFNC, backpage}, - {CTRL|'[', BINDFNC, meta}, - {CTRL|'\\', BINDFNC, forwsearch}, - {CTRL|'^', BINDFNC, quote}, - {CTRL|'_', BINDFNC, undo}, - {CTLX|CTRL|'A', BINDFNC, fileapp}, - {CTLX|CTRL|'B', BINDFNC, listbuffers}, - {CTLX|CTRL|'C', BINDFNC, quit}, - {CTLX|CTRL|'D', BINDFNC, detab}, - {CTLX|CTRL|'E', BINDFNC, entab}, - {CTLX|CTRL|'F', BINDFNC, filefind}, - {CTLX|CTRL|'I', BINDFNC, insfile}, - {CTLX|CTRL|'K', BINDFNC, macrotokey}, - {CTLX|CTRL|'L', BINDFNC, lowerregion}, - {CTLX|CTRL|'M', BINDFNC, delmode}, - {CTLX|CTRL|'N', BINDFNC, mvdnwind}, - {CTLX|CTRL|'O', BINDFNC, deblank}, - {CTLX|CTRL|'P', BINDFNC, mvupwind}, - {CTLX|CTRL|'R', BINDFNC, fileread}, - {CTLX|CTRL|'S', BINDFNC, filesave}, - {CTLX|CTRL|'T', BINDFNC, trim}, - {CTLX|CTRL|'U', BINDFNC, upperregion}, - {CTLX|CTRL|'V', BINDFNC, viewfile}, - {CTLX|CTRL|'W', BINDFNC, filewrite}, - {CTLX|CTRL|'X', BINDFNC, swapmark}, - {CTLX|CTRL|'Z', BINDFNC, shrinkwind}, - {CTLX|CTRL|'\\', BINDFNC, filesave}, - {CTLX|'?', BINDFNC, deskey}, - {CTLX|'!', BINDFNC, spawn}, - {CTLX|'@', BINDFNC, pipecmd}, - {CTLX|'#', BINDFNC, filter}, - {CTLX|'$', BINDFNC, execprg}, - {CTLX|'=', BINDFNC, showcpos}, - {CTLX|'(', BINDFNC, ctlxlp}, - {CTLX|')', BINDFNC, ctlxrp}, - {CTLX|'<', BINDFNC, narrow}, - {CTLX|'>', BINDFNC, widen}, - {CTLX|'^', BINDFNC, enlargewind}, - {CTLX|' ', BINDFNC, remmark}, - {CTLX|'0', BINDFNC, delwind}, - {CTLX|'1', BINDFNC, onlywind}, - {CTLX|'2', BINDFNC, splitwind}, - {CTLX|'A', BINDFNC, setvar}, - {CTLX|'B', BINDFNC, usebuffer}, - {CTLX|'C', BINDFNC, spawncli}, + {MOUS|'m', BINDFNC, { mmove } }, + {MOUS|CTRL|'m', BINDFNC, { mmove } }, + {MOUS|SHFT|'m', BINDFNC, { mmove } }, + {MOUS|CTRL|SHFT|'m', BINDFNC, { mmove } }, + {MOUS|'a', BINDFNC, { movemd } }, + {MOUS|'b', BINDFNC, { movemu } }, + {MOUS|'e', BINDFNC, { mregdown } }, + {MOUS|'f', BINDFNC, { mregup } }, + {MOUS|'1', BINDFNC, { resizm } }, + {MOUS|'2', BINDFNC, { resizm2 } }, + {MOUS|'x', BINDFNC, { menudrop } }, +#endif + {CTRL|'?', BINDFNC, { backdel } }, + {CTRL|'A', BINDFNC, { gotobol } }, + {CTRL|'B', BINDFNC, { backchar } }, + {CTRL|'C', BINDFNC, { insspace } }, + {CTRL|'D', BINDFNC, { forwdel } }, + {CTRL|'E', BINDFNC, { gotoeol } }, + {CTRL|'F', BINDFNC, { forwchar } }, + {CTRL|'G', BINDFNC, { ctrlg } }, + {CTRL|'H', BINDFNC, { backdel } }, + {CTRL|'I', BINDFNC, { uetab } }, + {CTRL|'J', BINDFNC, { indent } }, + {CTRL|'K', BINDFNC, { killtext } }, + {CTRL|'L', BINDFNC, { uerefresh } }, + {CTRL|'M', BINDFNC, { new_line } }, + {CTRL|'N', BINDFNC, { forwline } }, + {CTRL|'O', BINDFNC, { openline } }, + {CTRL|'P', BINDFNC, { backline } }, + {CTRL|'Q', BINDFNC, { quote } }, + {CTRL|'R', BINDFNC, { backsearch } }, + {CTRL|'S', BINDFNC, { forwsearch } }, + {CTRL|'T', BINDFNC, { twiddle } }, + {CTRL|'U', BINDFNC, { unarg } }, + {CTRL|'V', BINDFNC, { forwpage } }, + {CTRL|'W', BINDFNC, { killregion } }, + {CTRL|'X', BINDFNC, { cex } }, + {CTRL|'Y', BINDFNC, { yank } }, + {CTRL|'Z', BINDFNC, { backpage } }, + {CTRL|'[', BINDFNC, { uemeta } }, + {CTRL|'\\', BINDFNC, { forwsearch } }, + {CTRL|'^', BINDFNC, { quote } }, + {CTRL|'_', BINDFNC, { undo } }, + {CTLX|CTRL|'A', BINDFNC, { fileapp } }, + {CTLX|CTRL|'B', BINDFNC, { listbuffers } }, + {CTLX|CTRL|'C', BINDFNC, { quit } }, + {CTLX|CTRL|'D', BINDFNC, { detab } }, + {CTLX|CTRL|'E', BINDFNC, { entab } }, + {CTLX|CTRL|'F', BINDFNC, { filefind } }, + {CTLX|CTRL|'I', BINDFNC, { insfile } }, + {CTLX|CTRL|'K', BINDFNC, { macrotokey } }, + {CTLX|CTRL|'L', BINDFNC, { lowerregion } }, + {CTLX|CTRL|'M', BINDFNC, { delmode } }, + {CTLX|CTRL|'N', BINDFNC, { mvdnwind } }, + {CTLX|CTRL|'O', BINDFNC, { deblank } }, + {CTLX|CTRL|'P', BINDFNC, { mvupwind } }, + {CTLX|CTRL|'R', BINDFNC, { fileread } }, + {CTLX|CTRL|'S', BINDFNC, { filesave } }, + {CTLX|CTRL|'T', BINDFNC, { trim } }, + {CTLX|CTRL|'U', BINDFNC, { upperregion } }, + {CTLX|CTRL|'V', BINDFNC, { viewfile } }, + {CTLX|CTRL|'W', BINDFNC, { filewrite } }, + {CTLX|CTRL|'X', BINDFNC, { swapmark } }, + {CTLX|CTRL|'Z', BINDFNC, { shrinkwind } }, + {CTLX|CTRL|'\\', BINDFNC, { filesave } }, + {CTLX|'?', BINDFNC, { deskey } }, + {CTLX|'!', BINDFNC, { spawn } }, + {CTLX|'@', BINDFNC, { pipecmd } }, + {CTLX|'#', BINDFNC, { uefilter } }, + {CTLX|'$', BINDFNC, { execprg } }, + {CTLX|'=', BINDFNC, { showcpos } }, + {CTLX|'(', BINDFNC, { ctlxlp } }, + {CTLX|')', BINDFNC, { ctlxrp } }, + {CTLX|'<', BINDFNC, { narrow } }, + {CTLX|'>', BINDFNC, { widen } }, + {CTLX|'^', BINDFNC, { enlargewind } }, + {CTLX|' ', BINDFNC, { remmark } }, + {CTLX|'0', BINDFNC, { delwind } }, + {CTLX|'1', BINDFNC, { onlywind } }, + {CTLX|'2', BINDFNC, { splitwind } }, + {CTLX|'A', BINDFNC, { setvar } }, + {CTLX|'B', BINDFNC, { usebuffer } }, + {CTLX|'C', BINDFNC, { spawncli } }, #if BSD || FREEBSD || VMS || SUN || HPUX8 || HPUX9 || AVIION - {CTLX|'D', BINDFNC, bktoshell}, + {CTLX|'D', BINDFNC, { bktoshell } }, #endif - {CTLX|'E', BINDFNC, ctlxe}, - {CTLX|'G', BINDFNC, dispvar}, - {CTLX|'K', BINDFNC, killbuffer}, - {CTLX|'M', BINDFNC, setmod}, - {CTLX|'N', BINDFNC, filename}, - {CTLX|'O', BINDFNC, nextwind}, - {CTLX|'P', BINDFNC, prevwind}, + {CTLX|'E', BINDFNC, { ctlxe } }, + {CTLX|'G', BINDFNC, { dispvar } }, + {CTLX|'K', BINDFNC, { killbuffer } }, + {CTLX|'M', BINDFNC, { setmod } }, + {CTLX|'N', BINDFNC, { filename } }, + {CTLX|'O', BINDFNC, { nextwind } }, + {CTLX|'P', BINDFNC, { prevwind } }, #if ISRCH - {CTLX|'R', BINDFNC, risearch}, - {CTLX|'S', BINDFNC, fisearch}, + {CTLX|'R', BINDFNC, { risearch } }, + {CTLX|'S', BINDFNC, { fisearch } }, #endif - {CTLX|'U', BINDFNC, undo_list}, - {CTLX|'W', BINDFNC, resize}, - {CTLX|'X', BINDFNC, nextbuffer}, - {CTLX|'Y', BINDFNC, cycle_ring}, - {CTLX|'Z', BINDFNC, enlargewind}, - {META|CTRL|'C', BINDFNC, wordcount}, - {META|CTRL|'E', BINDFNC, execproc}, - {META|CTRL|'F', BINDFNC, getfence}, - {META|CTRL|'G', BINDFNC, gotomark}, - {META|CTRL|'H', BINDFNC, delbword}, - {META|CTRL|'K', BINDFNC, unbindkey}, - {META|CTRL|'L', BINDFNC, reposition}, - {META|CTRL|'M', BINDFNC, delgmode}, - {META|CTRL|'N', BINDFNC, namebuffer}, - {META|CTRL|'R', BINDFNC, qreplace}, - {META|CTRL|'S', BINDFNC, execfile}, - {META|CTRL|'V', BINDFNC, nextdown}, - {META|CTRL|'U', BINDFNC, undo_delete}, - {META|CTRL|'W', BINDFNC, killpara}, - {META|CTRL|'X', BINDFNC, execcmd}, - {META|CTRL|'Y', BINDFNC, clear_ring}, - {META|CTRL|'Z', BINDFNC, nextup}, - {META|CTRL|'\\', BINDFNC, execfile}, - {META|' ', BINDFNC, setmark}, - {META|'?', BINDFNC, help}, - {META|'!', BINDFNC, reposition}, - {META|')', BINDFNC, indent_region}, - {META|'(', BINDFNC, undent_region}, - {META|'.', BINDFNC, setmark}, - {META|'>', BINDFNC, gotoeob}, - {META|'<', BINDFNC, gotobob}, - {META|'~', BINDFNC, unmark}, - {META|'A', BINDFNC, apro}, - {META|'B', BINDFNC, backword}, - {META|'C', BINDFNC, capword}, - {META|'D', BINDFNC, delfword}, + {CTLX|'U', BINDFNC, { undo_list } }, + {CTLX|'W', BINDFNC, { resize } }, + {CTLX|'X', BINDFNC, { nextbuffer } }, + {CTLX|'Y', BINDFNC, { cycle_ring } }, + {CTLX|'Z', BINDFNC, { enlargewind } }, + {META|CTRL|'?', BINDFNC, { delbword } }, + {META|CTRL|'C', BINDFNC, { wordcount } }, + {META|CTRL|'E', BINDFNC, { execproc } }, + {META|CTRL|'F', BINDFNC, { getfence } }, + {META|CTRL|'G', BINDFNC, { gotomark } }, + {META|CTRL|'H', BINDFNC, { delbword } }, + {META|CTRL|'K', BINDFNC, { unbindkey } }, + {META|CTRL|'L', BINDFNC, { reposition } }, + {META|CTRL|'M', BINDFNC, { delgmode } }, + {META|CTRL|'N', BINDFNC, { namebuffer } }, + {META|CTRL|'R', BINDFNC, { qreplace } }, + {META|CTRL|'S', BINDFNC, { execfile } }, + {META|CTRL|'V', BINDFNC, { nextdown } }, + {META|CTRL|'U', BINDFNC, { undo_delete } }, + {META|CTRL|'W', BINDFNC, { killpara } }, + {META|CTRL|'X', BINDFNC, { execcmd } }, + {META|CTRL|'Y', BINDFNC, { clear_ring } }, + {META|CTRL|'Z', BINDFNC, { nextup } }, + {META|CTRL|'\\', BINDFNC, { execfile } }, + {META|' ', BINDFNC, { setmark } }, + {META|'?', BINDFNC, { help } }, + {META|'!', BINDFNC, { reposition } }, + {META|')', BINDFNC, { indent_region } }, + {META|'(', BINDFNC, { undent_region } }, + {META|'.', BINDFNC, { setmark } }, + {META|'>', BINDFNC, { gotoeob } }, + {META|'<', BINDFNC, { gotobob } }, + {META|'~', BINDFNC, { unmark } }, + {META|'A', BINDFNC, { apro } }, + {META|'B', BINDFNC, { backword } }, + {META|'C', BINDFNC, { capword } }, + {META|'D', BINDFNC, { delfword } }, #if CRYPT - {META|'E', BINDFNC, setekey}, + {META|'E', BINDFNC, { setekey } }, #endif - {META|'F', BINDFNC, forwword}, - {META|'G', BINDFNC, gotoline}, - {META|'K', BINDFNC, bindtokey}, - {META|'L', BINDFNC, lowerword}, - {META|'M', BINDFNC, setgmode}, - {META|'N', BINDFNC, gotoeop}, - {META|'P', BINDFNC, gotobop}, - {META|'Q', BINDFNC, fillpara}, - {META|'R', BINDFNC, sreplace}, + {META|'F', BINDFNC, { forwword } }, + {META|'G', BINDFNC, { gotoline } }, +#if LIBHELP + {META|'H', BINDFNC, { lookupword } }, + {META|'I', BINDFNC, { hlpindex } }, + {META|'J', BINDFNC, { promptlook } }, +#endif + {META|'K', BINDFNC, { bindtokey } }, + {META|'L', BINDFNC, { lowerword } }, + {META|'M', BINDFNC, { setgmode } }, + {META|'N', BINDFNC, { gotoeop } }, + {META|'P', BINDFNC, { gotobop } }, + {META|'Q', BINDFNC, { fillpara } }, + {META|'R', BINDFNC, { sreplace } }, #if BSD || FREEBSD || HPUX8 || HPUX9 || VMS || SUN || AVIION - {META|'S', BINDFNC, bktoshell}, + {META|'S', BINDFNC, { bktoshell } }, #endif - {META|'U', BINDFNC, upperword}, - {META|'V', BINDFNC, backpage}, - {META|'W', BINDFNC, copyregion}, - {META|'X', BINDFNC, namedcmd}, - {META|'Y', BINDFNC, yank_pop}, - {META|'Z', BINDFNC, quickexit}, -/* {META|CTRL|'?', BINDFNC, delbword}, ??? */ + {META|'U', BINDFNC, { upperword } }, + {META|'V', BINDFNC, { backpage } }, + {META|'W', BINDFNC, { copyregion } }, + {META|'X', BINDFNC, { namedcmd } }, + {META|'Y', BINDFNC, { yank_pop } }, + {META|'Z', BINDFNC, { quickexit } }, + {META|SPEC|'D', BINDFNC, { delfword } }, - {ALTD|'B', BINDFNC, list_screens}, - {ALTD|'C', BINDFNC, cycle_screens}, - {ALTD|'D', BINDFNC, delete_screen}, - {ALTD|'F', BINDFNC, find_screen}, - {ALTD|'N', BINDFNC, rename_screen}, - {ALTD|'R', BINDFNC, backhunt}, - {ALTD|'S', BINDFNC, forwhunt}, + {ALTD|'B', BINDFNC, { list_screens } }, + {ALTD|'C', BINDFNC, { cycle_screens } }, + {ALTD|'D', BINDFNC, { delete_screen } }, + {ALTD|'F', BINDFNC, { find_screen } }, + {ALTD|'N', BINDFNC, { rename_screen } }, + {ALTD|'R', BINDFNC, { backhunt } }, + {ALTD|'S', BINDFNC, { forwhunt } }, - {SPEC|'<', BINDFNC, gotobob}, /* Home */ - {SPEC|'P', BINDFNC, backline}, /* up */ - {SPEC|'Z', BINDFNC, backpage}, /* PgUp */ - {SPEC|'B', BINDFNC, backchar}, /* left */ + {SPEC|'<', BINDFNC, { gotobob } }, /* Home */ + {SPEC|'P', BINDFNC, { backline } }, /* up */ + {SPEC|'Z', BINDFNC, { backpage } }, /* PgUp */ + {SPEC|'B', BINDFNC, { backchar } }, /* left */ - {SPEC|'L', BINDFNC, reposition}, /* NP5 */ + {SPEC|'L', BINDFNC, { reposition } }, /* NP5 */ - {SPEC|'F', BINDFNC, forwchar}, /* right */ - {SPEC|'>', BINDFNC, gotoeob}, /* End */ - {SPEC|'N', BINDFNC, forwline}, /* down */ - {SPEC|'V', BINDFNC, forwpage}, /* PgDn */ - {SPEC|'C', BINDFNC, insspace}, /* Ins */ - {SPEC|'D', BINDFNC, forwdel}, /* Del */ + {SPEC|'F', BINDFNC, { forwchar } }, /* right */ + {SPEC|'>', BINDFNC, { gotoeob } }, /* End */ + {SPEC|'N', BINDFNC, { forwline } }, /* down */ + {SPEC|'V', BINDFNC, { forwpage } }, /* PgDn */ + {SPEC|'C', BINDFNC, { insspace } }, /* Ins */ + {SPEC|'D', BINDFNC, { forwdel } }, /* Del */ - {SPEC|CTRL|'B', BINDFNC, backword}, /* ctrl left */ - {SPEC|CTRL|'F', BINDFNC, forwword}, /* ctrl right */ - {SPEC|CTRL|'Z', BINDFNC, gotobop}, /* ctrl PgUp */ - {SPEC|CTRL|'V', BINDFNC, gotoeop}, /* ctrl PgDn */ + {SPEC|CTRL|'B', BINDFNC, { backword } }, /* ctrl left */ + {SPEC|CTRL|'F', BINDFNC, { forwword } }, /* ctrl right */ + {SPEC|CTRL|'Z', BINDFNC, { gotobop } }, /* ctrl PgUp */ + {SPEC|CTRL|'V', BINDFNC, { gotoeop } }, /* ctrl PgDn */ #if WINDOW_MSWIN /* IBM-CUA clipboard bindings */ - {SPEC|CTRL|'C', BINDFNC, clipregion}, /* ctrl Ins */ - {SPEC|SHFT|'C', BINDFNC, insertclip}, /* shift Ins */ - {SPEC|SHFT|'D', BINDFNC, cutregion}, /* shift Del */ + {SPEC|CTRL|'C', BINDFNC, { clipregion } }, /* ctrl Ins */ + {SPEC|SHFT|'C', BINDFNC, { insertclip } }, /* shift Ins */ + {SPEC|SHFT|'D', BINDFNC, { cutregion } }, /* shift Del */ #endif #if ATKBD | OS2 @@ -209,72 +216,72 @@ NOSHARE KEYTAB keytab[NBINDS] = { See keyboard.c for a full list of available keys. */ - {SPEC|'a', BINDFNC, gotobob}, /* grey Home */ - {SPEC|'b', BINDFNC, backline}, /* grey up */ - {SPEC|'c', BINDFNC, backpage}, /* grey PgUp */ - {SPEC|'d', BINDFNC, backchar}, /* grey left */ - {SPEC|'e', BINDFNC, reposition}, /* grey center */ - {SPEC|'f', BINDFNC, forwchar}, /* grey right */ - {SPEC|'g', BINDFNC, gotoeob}, /* grey End */ - {SPEC|'h', BINDFNC, forwline}, /* grey down */ - {SPEC|'i', BINDFNC, forwpage}, /* grey PgDn */ - {SPEC|'j', BINDFNC, insspace}, /* grey Ins */ - {SPEC|'k', BINDFNC, forwdel}, /* grey Del */ - {SPEC|':', BINDFNC, execcmd}, /* pause */ + {SPEC|'a', BINDFNC, { gotobob } }, /* grey Home */ + {SPEC|'b', BINDFNC, { backline } }, /* grey up */ + {SPEC|'c', BINDFNC, { backpage } }, /* grey PgUp */ + {SPEC|'d', BINDFNC, { backchar } }, /* grey left */ + {SPEC|'e', BINDFNC, { reposition } }, /* grey center */ + {SPEC|'f', BINDFNC, { forwchar } }, /* grey right */ + {SPEC|'g', BINDFNC, { gotoeob } }, /* grey End */ + {SPEC|'h', BINDFNC, { forwline } }, /* grey down */ + {SPEC|'i', BINDFNC, { forwpage } }, /* grey PgDn */ + {SPEC|'j', BINDFNC, { insspace } }, /* grey Ins */ + {SPEC|'k', BINDFNC, { forwdel } }, /* grey Del */ + {SPEC|':', BINDFNC, { execcmd } }, /* pause */ - {SPEC|CTRL|'c', BINDFNC, gotobop}, /* ctrl grey PgUp */ - {SPEC|CTRL|'d', BINDFNC, backword}, /* ctrl grey left */ - {SPEC|CTRL|'f', BINDFNC, forwword}, /* ctrl grey right */ - {SPEC|CTRL|'i', BINDFNC, gotoeop}, /* ctrl grey PgDn */ + {SPEC|CTRL|'c', BINDFNC, { gotobop } }, /* ctrl grey PgUp */ + {SPEC|CTRL|'d', BINDFNC, { backword } }, /* ctrl grey left */ + {SPEC|CTRL|'f', BINDFNC, { forwword } }, /* ctrl grey right */ + {SPEC|CTRL|'i', BINDFNC, { gotoeop } }, /* ctrl grey PgDn */ #endif #if HP150 - {SPEC|32, BINDFNC, backline}, - {SPEC|33, BINDFNC, forwline}, - {SPEC|35, BINDFNC, backchar}, - {SPEC|34, BINDFNC, forwchar}, - {SPEC|44, BINDFNC, gotobob}, - {SPEC|46, BINDFNC, forwpage}, - {SPEC|47, BINDFNC, backpage}, - {SPEC|82, BINDFNC, nextwind}, - {SPEC|68, BINDFNC, openline}, - {SPEC|69, BINDFNC, killtext}, - {SPEC|65, BINDFNC, forwdel}, - {SPEC|64, BINDFNC, ctlxe}, - {SPEC|67, BINDFNC, refresh}, - {SPEC|66, BINDFNC, reposition}, - {SPEC|83, BINDFNC, help}, - {SPEC|81, BINDFNC, deskey}, + {SPEC|32, BINDFNC, { backline } }, + {SPEC|33, BINDFNC, { forwline } }, + {SPEC|35, BINDFNC, { backchar } }, + {SPEC|34, BINDFNC, { forwchar } }, + {SPEC|44, BINDFNC, { gotobob } }, + {SPEC|46, BINDFNC, { forwpage } }, + {SPEC|47, BINDFNC, { backpage } }, + {SPEC|82, BINDFNC, { nextwind } }, + {SPEC|68, BINDFNC, { openline } }, + {SPEC|69, BINDFNC, { killtext } }, + {SPEC|65, BINDFNC, { forwdel } }, + {SPEC|64, BINDFNC, { ctlxe } }, + {SPEC|67, BINDFNC, { uerefresh } }, + {SPEC|66, BINDFNC, { reposition } }, + {SPEC|83, BINDFNC, { help } }, + {SPEC|81, BINDFNC, { deskey } }, #endif #if HP110 - {SPEC|0x4b, BINDFNC, backchar}, - {SPEC|0x4d, BINDFNC, forwchar}, - {SPEC|0x48, BINDFNC, backline}, - {SPEC|0x50, BINDFNC, forwline}, - {SPEC|0x43, BINDFNC, help}, - {SPEC|0x73, BINDFNC, backword}, - {SPEC|0x74, BINDFNC, forwword}, - {SPEC|0x49, BINDFNC, backpage}, - {SPEC|0x51, BINDFNC, forwpage}, + {SPEC|0x4b, BINDFNC, { backchar } }, + {SPEC|0x4d, BINDFNC, { forwchar } }, + {SPEC|0x48, BINDFNC, { backline } }, + {SPEC|0x50, BINDFNC, { forwline } }, + {SPEC|0x43, BINDFNC, { help } }, + {SPEC|0x73, BINDFNC, { backword } }, + {SPEC|0x74, BINDFNC, { forwword } }, + {SPEC|0x49, BINDFNC, { backpage } }, + {SPEC|0x51, BINDFNC, { forwpage } }, #endif #if AMIGA - {SPEC|'?', BINDFNC, help}, - {SPEC|'A', BINDFNC, backline}, - {SPEC|'B', BINDFNC, forwline}, - {SPEC|'C', BINDFNC, forwchar}, - {SPEC|'D', BINDFNC, backchar}, - {SPEC|'T', BINDFNC, backpage}, - {SPEC|'S', BINDFNC, forwpage}, - {SPEC|'a', BINDFNC, backword}, - {SPEC|'`', BINDFNC, forwword}, - {127, BINDFNC, forwdel}, + {SPEC|'?', BINDFNC, { help } }, + {SPEC|'A', BINDFNC, { backline } }, + {SPEC|'B', BINDFNC, { forwline } }, + {SPEC|'C', BINDFNC, { forwchar } }, + {SPEC|'D', BINDFNC, { backchar } }, + {SPEC|'T', BINDFNC, { backpage } }, + {SPEC|'S', BINDFNC, { forwpage } }, + {SPEC|'a', BINDFNC, { backword } }, + {SPEC|'`', BINDFNC, { forwword } }, + {127, BINDFNC, { forwdel } }, #endif #if TOS - {SPEC|CTRL|'5', BINDFNC, help}, + {SPEC|CTRL|'5', BINDFNC, { help } }, #endif #if WANGPC @@ -341,8 +348,5 @@ NOSHARE KEYTAB keytab[NBINDS] = { SPEC|0x8F, BINDFNC, gotoline, /* GoTo */ SPEC|0x9F, BINDFNC, usebuffer, /* ^GoTo */ #endif - - {CTRL|'?', BINDFNC, backdel}, - - {0, BINDNUL, NULL} + {0, BINDNUL, { NULL } } }; diff --git a/h/edef.h b/h/edef.h index a16faef..b202055 100644 --- a/h/edef.h +++ b/h/edef.h @@ -4,6 +4,8 @@ written by Daniel Lawrence based on code by Dave G. Conroy, Steve Wilhite and George Jones + + Unicode support by Jean-Michel Dubois */ #ifdef maindef @@ -12,8 +14,22 @@ /* initialized global definitions */ +#if CURSES + +WINDOW* wmenubar; +WINDOW* wmain; +PANEL* pmenu; +PANEL* pmain; +WINDOW* wdrop = NULL; +PANEL* pdrop; +#endif + NOSHARE int DNEAR fillcol = 72; /* Current fill column */ +#if UTF8 +NOSHARE unsigned int kbdm[NKBDM]; /* Macro */ +#else NOSHARE short kbdm[NKBDM]; /* Macro */ +#endif NOSHARE char *execstr = NULL; /* pointer to string to execute */ NOSHARE char golabel[NPAT] = ""; /* current line to go to */ NOSHARE char paralead[NPAT] = " \t"; /* paragraph leadin chars */ @@ -32,12 +48,31 @@ NOSHARE int DNEAR mouse_move = 1; /* user allow tracking mouse moves? */ NOSHARE int DNEAR mmove_flag = TRUE; /* code currently allowing mmoves? */ NOSHARE int DNEAR newscreenflag = FALSE;/* Create new screen on reads? */ NOSHARE int DNEAR overlap = 2; /* overlap when paging screens */ -CONST char *modename[] = { /* name of modes */ +CONST char *modename[NUMMODES] = { /* name of modes */ "WRAP", "CMODE", "SPELL", "EXACT", "VIEW", "OVER", - "MAGIC", "CRYPT", "ASAVE", "REP", "ABBREV"}; + "MAGIC", "CRYPT", "ASAVE", "REP", "ABBREV" +#if JMDEXT + , "NOBAK", "SLINE", "DLINE" +#if THEOX + , "THEOX" /* support of TheoX character set */ +#endif +#endif + }; +#if JMDEXT +CONST char modecode[] = "WCSEVOMYARBKsl"/* letters to represent modes */ +#if THEOX + "X" +#endif + ; +#else CONST char modecode[] = "WCSEVOMYARB"; /* letters to represent modes */ +#endif NOSHARE int DNEAR numfunc = NFUNCS; /* number of bindable functions */ +#if MDTHEOX NOSHARE int DNEAR gmode = 0; /* global editor mode */ +#else +NOSHARE int DNEAR gmode = 0; /* global editor mode */ +#endif NOSHARE int DNEAR gflags = GFREAD; /* global control flag */ NOSHARE int DNEAR gfcolor = 7; /* global forgrnd color (white) */ NOSHARE int DNEAR gbcolor = 0; /* global backgrnd color (black)*/ @@ -94,7 +129,7 @@ NOSHARE CONST char *cname[] = { /* names of colors */ "MAGENTA", "CYAN", "GREY", "GRAY", "LRED", "LGREEN", "LYELLOW", "LBLUE", "LMAGENTA", "LCYAN", "WHITE"}; - + NOSHARE int kill_index; /* current index into kill ring */ NOSHARE KILL *kbufp[NRING]; /* current kill buffer chunk pointer*/ NOSHARE KILL *kbufh[NRING]; /* kill buffer header pointer */ @@ -103,8 +138,17 @@ NOSHARE int kused[NRING]; /* # of bytes used in last kill chunk*/ NOSHARE EWINDOW *swindow = NULL; /* saved window pointer */ NOSHARE int cryptflag = FALSE; /* currently encrypting? */ NOSHARE int oldcrypt = FALSE; /* using old(broken) encryption? */ +#if UTF8 +NOSHARE unsigned int *kbdptr; /* current position in keyboard buf */ +NOSHARE unsigned int *kbdend = &kbdm[0];/* ptr to end of the keyboard */ +#else NOSHARE short *kbdptr; /* current position in keyboard buf */ +#if THEOSC +NOSHARE short *kbdend = kbdm; /* ptr to end of the keyboard */ +#else NOSHARE short *kbdend = &kbdm[0]; /* ptr to end of the keyboard */ +#endif +#endif NOSHARE int DNEAR kbdmode = STOP; /* current keyboard macro mode */ NOSHARE int DNEAR kbdrep = 0; /* number of repetitions */ NOSHARE int DNEAR restflag = FALSE; /* restricted use? */ @@ -119,6 +163,7 @@ CONST char errorm[] = "ERROR"; /* error literal */ CONST char truem[] = "TRUE"; /* true literal */ CONST char falsem[] = "FALSE"; /* false litereal */ NOSHARE int DNEAR cmdstatus = TRUE; /* last command status */ +NOSHARE int schstatus = TRUE; /* last search status jmd */ NOSHARE char palstr[49] = ""; /* palette string */ NOSHARE char lastmesg[NSTRING] = ""; /* last message posted */ NOSHARE char rval[NSTRING] = "0"; /* result of last procedure/sub */ @@ -155,6 +200,9 @@ NOSHARE EWINDOW *curwp; /* Current window */ NOSHARE BUFFER *curbp; /* Current buffer */ NOSHARE EWINDOW *wheadp; /* Head of list of windows */ NOSHARE BUFFER *bheadp; /* Head of list of buffers */ +#if LIBHELP +NOSHARE BUFFER *helpbp; /* Help buffer */ +#endif NOSHARE UTABLE *uv_head; /* head of list of user variables */ NOSHARE UTABLE *uv_global; /* global variable table */ NOSHARE ABBREV *ab_head; /* head of the abbreviation list */ @@ -164,16 +212,19 @@ NOSHARE int DNEAR ab_quick; /* aggressive completion enabled? */ NOSHARE char ab_word[NSTRING]; /* current word being typed */ NOSHARE char *ab_pos; /* current place in ab_word */ NOSHARE char *ab_end; /* ptr to physical end of ab_word */ -NOSHARE SCREEN *first_screen; /* Head and current screen in list */ +NOSHARE ESCREEN *first_screen; /* Head and current screen in list */ NOSHARE BUFFER *blistp; /* Buffer for C-X C-B */ NOSHARE BUFFER *ulistp; /* Buffer for C-X U */ NOSHARE BUFFER *slistp; /* Buffer for A-B */ NOSHARE char sres[NBUFN]; /* current screen resolution */ NOSHARE char os[NBUFN]; /* what OS are we running under */ - +#if UTF8 +NOSHARE char locale[NSTRING]; /* LC_CTYPE locale backup */ +#else NOSHARE char lowcase[HICHAR]; /* lower casing map */ NOSHARE char upcase[HICHAR]; /* upper casing map */ +#endif NOSHARE unsigned char pat[NPAT]; /* Search pattern */ NOSHARE unsigned char tap[NPAT]; /* Reversed pattern array. */ @@ -214,7 +265,7 @@ NOSHARE MC tapcm[NPAT]; /* the reversed magic pattern */ NOSHARE MC mcdeltapat[2]; /* the no-magic pattern */ NOSHARE MC tapatledcm[2]; /* the reversed no-magic pattern*/ NOSHARE RMC rmcpat[NPAT]; /* the replacement magic array */ -NOSHARE char *grpmatch[MAXGROUPS]; /* holds groups found in search */ +NOSHARE char *grpmatch[MAXGROUPS]; /* holds groups found in search */ #endif @@ -253,9 +304,22 @@ int winch_flag=0; /* Window size changed flag */ /* for all the other .C files */ /* initialized global external declarations */ +#if CURSES +extern WINDOW* wmenubar; +extern WINDOW* wmain; +extern PANEL* pmenu; +extern PANEL* pmain; +extern WINDOW* wdrop; +extern PANEL* pdrop; +#endif + NOSHARE extern int DNEAR fillcol; /* Current fill column */ +#if UTF8 +NOSHARE extern unsigned int kbdm[DUMMYSZ]; /* Holds keyboard macro data */ +#else NOSHARE extern short kbdm[DUMMYSZ]; /* Holds keyboard macro data */ +#endif NOSHARE extern char *execstr; /* pointer to string to execute */ NOSHARE extern char golabel[DUMMYSZ]; /* current line to go to */ NOSHARE extern char paralead[DUMMYSZ]; /* paragraph leadin chars */ @@ -332,7 +396,7 @@ NOSHARE extern int DNEAR predef; /* " " default flag */ NOSHARE extern int DNEAR quotec; /* quote char during mlreply() */ NOSHARE extern CONST char *cname[DUMMYSZ];/* names of colors */ - + NOSHARE extern int kill_index; /* current index into kill ring */ NOSHARE extern KILL *kbufp[DUMMYSZ]; /* current kill buffer chunk pointer */ NOSHARE extern KILL *kbufh[DUMMYSZ]; /* kill buffer header pointer */ @@ -341,8 +405,13 @@ NOSHARE extern int kused[DUMMYSZ]; /* # of bytes used in kill buffer*/ NOSHARE extern EWINDOW *swindow; /* saved window pointer */ NOSHARE extern int cryptflag; /* currently encrypting? */ NOSHARE extern int oldcrypt; /* using old(broken) encryption? */ +#if UTF8 +NOSHARE extern unsigned int *kbdptr; /* current position in keyboard buf */ +NOSHARE extern unsigned int *kbdend; /* ptr to end of the keyboard */ +#else NOSHARE extern short *kbdptr; /* current position in keyboard buf */ NOSHARE extern short *kbdend; /* ptr to end of the keyboard */ +#endif NOSHARE extern int kbdmode; /* current keyboard macro mode */ NOSHARE extern int kbdrep; /* number of repetitions */ NOSHARE extern int restflag; /* restricted use? */ @@ -357,6 +426,7 @@ CONST extern char errorm[DUMMYSZ]; /* error literal */ CONST extern char truem[DUMMYSZ]; /* true literal */ CONST extern char falsem[DUMMYSZ]; /* false litereal */ NOSHARE extern int DNEAR cmdstatus; /* last command status */ +NOSHARE extern int schstatus; /* last search status jmd */ NOSHARE extern char palstr[DUMMYSZ]; /* palette string */ NOSHARE extern char lastmesg[DUMMYSZ]; /* last message posted */ NOSHARE extern char rval[DUMMYSZ]; /* result of last procedure */ @@ -393,6 +463,9 @@ NOSHARE extern EWINDOW *curwp; /* Current window */ NOSHARE extern BUFFER *curbp; /* Current buffer */ NOSHARE extern EWINDOW *wheadp; /* Head of list of windows */ NOSHARE extern BUFFER *bheadp; /* Head of list of buffers */ +#if LIBHELP +NOSHARE extern BUFFER *helpbp; /* Help buffer */ +#endif NOSHARE extern ABBREV *ab_head; /* head of the abbreviation list */ NOSHARE extern UTABLE *uv_head; /* head of list of user variables */ NOSHARE extern UTABLE *uv_global; /* global variable table */ @@ -402,17 +475,19 @@ NOSHARE extern int DNEAR ab_quick; /* aggressive completion enabled? */ NOSHARE extern char ab_word[DUMMYSZ]; /* current word being typed */ NOSHARE extern char *ab_pos; /* current place in ab_word */ NOSHARE extern char *ab_end; /* ptr to physical end of ab_word */ -NOSHARE extern SCREEN *first_screen; /* Head and current screen in list */ +NOSHARE extern ESCREEN *first_screen; /* Head and current screen in list */ NOSHARE extern BUFFER *blistp; /* Buffer for C-X C-B */ NOSHARE extern BUFFER *ulistp; /* Buffer for C-X U */ NOSHARE extern BUFFER *slistp; /* Buffer for A-B */ NOSHARE extern char sres[NBUFN]; /* current screen resolution */ NOSHARE extern char os[NBUFN]; /* what OS are we running under */ - +#if UTF8 +NOSHARE char locale[NSTRING]; /* LC_CTYPE locale backup */ +#else NOSHARE extern char lowcase[HICHAR]; /* lower casing map */ NOSHARE extern char upcase[HICHAR]; /* upper casing map */ - +#endif NOSHARE extern unsigned char pat[DUMMYSZ]; /* Search pattern */ NOSHARE extern unsigned char tap[DUMMYSZ]; /* Reversed pattern array. */ NOSHARE extern unsigned char rpat[DUMMYSZ]; /* replacement pattern */ @@ -440,7 +515,7 @@ NOSHARE extern MC tapcm[NPAT]; /* the reversed magic pattern */ NOSHARE extern MC mcdeltapat[2]; /* the no-magic pattern */ NOSHARE extern MC tapatledcm[2]; /* the reversed no-magic pattern*/ NOSHARE extern RMC rmcpat[NPAT]; /* the replacement magic array */ -NOSHARE extern char *grpmatch[MAXGROUPS]; /* holds groups found in search */ +NOSHARE extern char *grpmatch[MAXGROUPS]; /* holds groups found in search */ #endif NOSHARE extern DELTA deltapat; /* Forward pattern delta structure.*/ diff --git a/h/efunc.h b/h/efunc.h index 8127b84..4343d0a 100644 --- a/h/efunc.h +++ b/h/efunc.h @@ -20,24 +20,32 @@ NOSHARE NBIND names[] = { {"add-global-mode", setgmode}, #if UNIX || (VMS && SMG) || MPE {"add-keymap", addkeymap}, +#else + {"add-keymap", notavail}, #endif {"add-mode", setmod}, {"append-file", fileapp}, {"apropos", apro}, #if CTAGS {"back-from-tag-word", backtagword}, +#else + {"back-from-tag-word", notavail}, #endif {"backward-character", backchar}, {"begin-macro", ctlxlp}, {"beginning-of-file", gotobob}, {"beginning-of-line", gotobol}, {"bind-to-key", bindtokey}, -#if WINDOW_MSWIN +#if WINDOW_MSWIN || CURSES {"bind-to-menu", bindtomenu}, +#else + {"bind-to-menu", notavail}, #endif {"buffer-position", showcpos}, #if WINDOW_MSWIN {"cascade-screens", cascadescreens}, +#else + {"cascade-screens", notavail}, #endif {"case-region-lower", lowerregion}, {"case-region-upper", upperregion}, @@ -49,16 +57,20 @@ NOSHARE NBIND names[] = { {"change-screen-row", new_row_org}, {"change-screen-size", newsize}, {"change-screen-width", newwidth}, - {"clear-and-redraw", refresh}, + {"clear-and-redraw", uerefresh}, {"clear-message-line", clrmes}, #if WINDOW_MSWIN {"clip-region", clipregion}, +#else + {"clip-region", notavail}, #endif {"copy-region", copyregion}, {"count-words", wordcount}, {"ctlx-prefix", cex}, #if WINDOW_MSWIN {"cut-region", cutregion}, +#else + {"cut-region", notavail}, #endif {"cycle-ring", cycle_ring}, {"cycle-screens", cycle_screens}, @@ -99,7 +111,7 @@ NOSHARE NBIND names[] = { {"execute-program", execprg}, {"exit-emacs", quit}, {"fill-paragraph", fillpara}, - {"filter-buffer", filter}, + {"filter-buffer", uefilter}, {"find-file", filefind}, {"find-screen", find_screen}, {"forward-character", forwchar}, @@ -108,21 +120,37 @@ NOSHARE NBIND names[] = { {"goto-mark", gotomark}, {"goto-matching-fence", getfence}, {"grow-window", enlargewind}, - {"handle-tab", tab}, + {"handle-tab", uetab}, {"help", help}, #if WINDOW_MSWIN {"help-engine", helpengine}, +#else + {"help-engine", notavail}, +#endif +#if LIBHELP + {"hide-buffer", hidebuffer}, +#else + {"hide-buffer", notavail}, #endif {"hunt-backward", backhunt}, {"hunt-forward", forwhunt}, {"i-shell", spawncli}, #if ISRCH {"incremental-search", fisearch}, +#else + {"incremental-search", notavail}, #endif {"indent-region", indent_region}, +#if LIBHELP + {"index-help", hlpindex}, +#else + {"index-help", notavail}, +#endif {"insert-abbrevs", ins_abbrevs}, #if WINDOW_MSWIN {"insert-clip", insertclip}, +#else + {"insert-clip", notavail}, #endif {"insert-file", insfile}, {"insert-space", insspace}, @@ -133,22 +161,39 @@ NOSHARE NBIND names[] = { {"kill-to-end-of-line", killtext}, #if FLABEL {"label-function-key", fnclabel}, +#else + {"label-function-key", notavail}, #endif {"list-buffers", listbuffers}, -#if UNIX || (VMS && SMG) || MPE +#if UNIX || (VMS && SMG) || MPE || LINUX {"list-keymappings", listkeymaps}, +#else + {"list-keymappings", notavail}, #endif {"list-screens", list_screens}, {"list-undos", undo_list}, {"local", local_var}, +#if LIBHELP + {"look-word", lookupword}, +#else + {"look-word", notavail}, +#endif {"macro-to-key", macrotokey}, -#if WINDOW_MSWIN +#if WINDOW_MSWIN || CURSES {"macro-to-menu", macrotomenu}, +#else + {"macro-to-menu", notavail}, +#endif +#if WINDOW_MSWIN {"maximize-screen", maximizescreen}, +#else + {"maximize-screen", notavail}, #endif - {"meta-prefix", meta}, + {"meta-prefix", uemeta}, #if WINDOW_MSWIN {"minimize-screen", minimizescreen}, +#else + {"minimize-screen", notavail}, #endif #if MOUSE {"mouse-move", mmove}, @@ -158,12 +203,20 @@ NOSHARE NBIND names[] = { {"mouse-region-up", mregup}, {"mouse-resize-screen", resizm}, {"mouse-resize2-screen", resizm2}, +#else + {"mouse-move", notavail}, + {"mouse-move-down", notavail}, + {"mouse-move-up", notavail}, + {"mouse-region-down", notavail}, + {"mouse-region-up", notavail}, + {"mouse-resize-screen", notavail}, + {"mouse-resize2-screen", notavail}, #endif {"move-window-down", mvdnwind}, {"move-window-up", mvupwind}, {"name-buffer", namebuffer}, {"narrow-to-region", narrow}, - {"newline", newline}, + {"newline", new_line}, {"newline-and-indent", indent}, {"next-buffer", nextbuffer}, {"next-line", forwline}, @@ -182,11 +235,18 @@ NOSHARE NBIND names[] = { {"previous-window", prevwind}, {"previous-word", backword}, {"print", writemsg}, +#if LIBHELP + {"prompt-look", promptlook}, +#else + {"prompt-look", notavail}, +#endif {"query-replace-string", qreplace}, {"quick-exit", quickexit}, {"quote-character", quote}, #if CTAGS {"re-tag-word", retagword}, +#else + {"re-tag-word", notavail}, #endif {"read-file", fileread}, {"redraw-display", reposition}, @@ -196,10 +256,14 @@ NOSHARE NBIND names[] = { {"resize-window", resize}, #if WINDOW_MSWIN {"restore-screen", restorescreen}, +#else + {"restore-screen", notavail}, #endif {"restore-window", restwnd}, #if ISRCH {"reverse-incremental-search", risearch}, +#else + {"reverse-incremental-search", notavail}, #endif {"run", execproc}, {"save-file", filesave}, @@ -212,6 +276,8 @@ NOSHARE NBIND names[] = { {"set", setvar}, #if CRYPT {"set-encryption-key", setekey}, +#else + {"set-encryption-key", notavail}, #endif {"set-mark", setmark}, {"shell-command", spawn}, @@ -222,18 +288,26 @@ NOSHARE NBIND names[] = { {"store-procedure", storeproc}, #if BSD || FREEBSD || VMS || SUN || HPUX8 || HPUX9 || AVIION {"suspend-emacs", bktoshell}, +#else + {"suspend-emacs", notavail}, #endif #if CTAGS {"tag-word", tagword}, +#else + {"tag-word", notavail}, #endif #if WINDOW_MSWIN {"tile-screens", tilescreens}, +#else + {"tile-screens", notavail}, #endif {"transpose-characters", twiddle}, {"trim-region", trim}, {"unbind-key", unbindkey}, -#if WINDOW_MSWIN +#if WINDOW_MSWIN || CURSES {"unbind-menu", unbindmenu}, +#else + {"unbind-menu", notavail}, #endif {"undent-region", undent_region}, {"undo", undo}, @@ -247,7 +321,11 @@ NOSHARE NBIND names[] = { {"write-message", writemsg}, {"yank", yank}, {"yank-pop", yank_pop}, - +#if LIBHELP + {"zap-help", zaphelp}, +#else + {"zap-help", notavail}, +#endif {"", NULL} }; diff --git a/h/elang.h b/h/elang.h index 9733748..b162f2d 100644 --- a/h/elang.h +++ b/h/elang.h @@ -3,6 +3,313 @@ (C)opyright 1995 by Daniel Lawrence */ +#if DYNMSGS +extern CONST char* ldmsg(int); +#define LANGUAGE ldmsg(0) +#define TEXT1 ldmsg(1) +#define TEXT2 ldmsg(2) +#define TEXT3 ldmsg(3) +#define TEXT4 ldmsg(4) +#define TEXT5 ldmsg(5) +#define TEXT6 ldmsg(6) +#define TEXT7 ldmsg(7) +#define TEXT8 ldmsg(8) +#define TEXT9 ldmsg(9) +#define TEXT10 ldmsg(10) +#define TEXT11 ldmsg(11) +#define TEXT12 ldmsg(12) +#define TEXT13 ldmsg(13) +#define TEXT14 ldmsg(14) +#define TEXT15 ldmsg(15) +#define TEXT16 ldmsg(16) +#define TEXT17 ldmsg(17) +#define TEXT18 ldmsg(18) +#define TEXT19 ldmsg(19) +#define TEXT20 ldmsg(20) +#define TEXT21 ldmsg(21) +#define TEXT22 ldmsg(22) +#define TEXT23 ldmsg(23) +#define TEXT24 ldmsg(24) +#define TEXT25 ldmsg(25) +#define TEXT26 ldmsg(26) +#define TEXT27 ldmsg(27) +#define TEXT28 ldmsg(28) +#define TEXT29 ldmsg(29) +#define TEXT30 ldmsg(30) +#define TEXT31 ldmsg(31) +#define TEXT32 ldmsg(32) +#define TEXT33 ldmsg(33) +#define TEXT34 ldmsg(34) +#define TEXT35 ldmsg(35) +#define TEXT36 ldmsg(36) +#define TEXT37 ldmsg(37) +#define TEXT38 ldmsg(38) +#define TEXT39 ldmsg(39) +#define TEXT40 ldmsg(40) +#define TEXT41 ldmsg(41) +#define TEXT42 ldmsg(42) +#define TEXT43 ldmsg(43) +#define TEXT44 ldmsg(44) +#define TEXT45 ldmsg(45) +#define TEXT46 ldmsg(46) +#define TEXT47 ldmsg(47) +#define TEXT48 ldmsg(48) +#define TEXT49 ldmsg(49) +#define TEXT50 ldmsg(50) +#define TEXT51 ldmsg(51) +#define TEXT52 ldmsg(52) +#define TEXT53 ldmsg(53) +#define TEXT54 ldmsg(54) +#define TEXT55 ldmsg(55) +#define TEXT56 ldmsg(56) +#define TEXT57 ldmsg(57) +#define TEXT58 ldmsg(58) +#define TEXT59 ldmsg(59) +#define TEXT60 ldmsg(60) +#define TEXT61 ldmsg(61) +#define TEXT62 ldmsg(62) +#define TEXT63 ldmsg(63) +#define TEXT64 ldmsg(64) +#define TEXT65 ldmsg(65) +#define TEXT66 ldmsg(66) +#define TEXT67 ldmsg(67) +#define TEXT68 ldmsg(68) +#define TEXT69 ldmsg(69) +#define TEXT70 ldmsg(70) +#define TEXT71 ldmsg(71) +#define TEXT72 ldmsg(72) +#define TEXT73 ldmsg(73) +#define TEXT74 ldmsg(74) +#define TEXT75 ldmsg(75) +#define TEXT76 ldmsg(76) +#define TEXT77 ldmsg(77) +#define TEXT78 ldmsg(78) +#define TEXT79 ldmsg(79) +#define TEXT80 ldmsg(80) +#define TEXT81 ldmsg(81) +#define TEXT82 ldmsg(82) +#define TEXT83 ldmsg(83) +#define TEXT84 ldmsg(84) +#define TEXT85 ldmsg(85) +#define TEXT86 ldmsg(86) +#define TEXT87 ldmsg(87) +#define TEXT88 ldmsg(88) +#define TEXT89 ldmsg(89) +#define TEXT90 ldmsg(90) +#define TEXT91 ldmsg(91) +#define TEXT92 ldmsg(92) +#define TEXT93 ldmsg(93) +#define TEXT94 ldmsg(94) +#define TEXT95 ldmsg(95) +#define TEXT96 ldmsg(96) +#define TEXT97 ldmsg(97) +#define TEXT98 ldmsg(98) +#define TEXT99 ldmsg(99) +#define TEXT100 ldmsg(100) +#define TEXT101 ldmsg(101) +#define TEXT102 ldmsg(102) +#define TEXT103 ldmsg(103) +#define TEXT104 ldmsg(104) +#define TEXT105 ldmsg(105) +#define TEXT106 ldmsg(106) +#define TEXT107 ldmsg(107) +#define TEXT108 ldmsg(108) +#define TEXT109 ldmsg(109) +#define TEXT110 ldmsg(110) +#define TEXT111 ldmsg(111) +#define TEXT112 ldmsg(112) +#define TEXT113 ldmsg(113) +#define TEXT114 ldmsg(114) +#define TEXT115 ldmsg(115) +#define TEXT116 ldmsg(116) +#define TEXT117 ldmsg(117) +#define TEXT118 ldmsg(118) +#define TEXT119 ldmsg(119) +#define TEXT120 ldmsg(120) +#define TEXT121 ldmsg(121) +#define TEXT122 ldmsg(122) +#define TEXT123 ldmsg(123) +#define TEXT124 ldmsg(124) +#define TEXT125 ldmsg(125) +#define TEXT126 ldmsg(126) +#define TEXT127 ldmsg(127) +#define TEXT128 ldmsg(128) +#define TEXT129 ldmsg(129) +#define TEXT130 ldmsg(130) +#define TEXT131 ldmsg(131) +#define TEXT132 ldmsg(132) +#define TEXT133 ldmsg(133) +#define TEXT134 ldmsg(134) +#define TEXT135 ldmsg(135) +#define TEXT136 ldmsg(136) +#define TEXT137 ldmsg(137) +#define TEXT138 ldmsg(138) +#define TEXT139 ldmsg(139) +#define TEXT140 ldmsg(140) +#define TEXT141 ldmsg(141) +#define TEXT142 ldmsg(142) +#define TEXT143 ldmsg(143) +#define TEXT144 ldmsg(144) +#define TEXT145 ldmsg(145) +#define TEXT146 ldmsg(146) +#define TEXT147 ldmsg(147) +#define TEXT148 ldmsg(148) +#define TEXT149 ldmsg(149) +#define TEXT150 ldmsg(150) +#define TEXT151 ldmsg(151) +#define TEXT152 ldmsg(152) +#define TEXT153 ldmsg(153) +#define TEXT154 ldmsg(154) +#define TEXT155 ldmsg(155) +#define TEXT156 ldmsg(156) +#define TEXT157 ldmsg(157) +#define TEXT158 ldmsg(158) +#define TEXT159 ldmsg(159) +#define TEXT160 ldmsg(160) +#define TEXT161 ldmsg(161) +#define TEXT162 ldmsg(162) +#define TEXT163 ldmsg(163) +#define TEXT164 ldmsg(164) +#define TEXT165 ldmsg(165) +#define TEXT166 ldmsg(166) +#define TEXT167 ldmsg(167) +#define TEXT168 ldmsg(168) +#define TEXT169 ldmsg(169) +#define TEXT170 ldmsg(170) +#define TEXT171 ldmsg(171) +#define TEXT172 ldmsg(172) +#define TEXT173 ldmsg(173) +#define TEXT174 ldmsg(174) +#define TEXT175 ldmsg(175) +#define TEXT176 ldmsg(176) +#define TEXT177 ldmsg(177) +#define TEXT178 ldmsg(178) +#define TEXT179 ldmsg(179) +#define TEXT180 ldmsg(180) +#define TEXT181 ldmsg(181) +#define TEXT182 ldmsg(182) +#define TEXT183 ldmsg(183) +#define TEXT184 ldmsg(184) +#define TEXT185 ldmsg(185) +#define TEXT186 ldmsg(186) +#define TEXT187 ldmsg(187) +#define TEXT188 ldmsg(188) +#define TEXT189 ldmsg(189) +#define TEXT190 ldmsg(190) +#define TEXT191 ldmsg(191) +#define TEXT192 ldmsg(192) +#define TEXT193 ldmsg(193) +#define TEXT194 ldmsg(194) +#define TEXT195 ldmsg(195) +#define TEXT196 ldmsg(196) +#define TEXT197 ldmsg(197) +#define TEXT198 ldmsg(198) +#define TEXT199 ldmsg(199) +#define TEXT200 ldmsg(200) +#define TEXT201 ldmsg(201) +#define TEXT202 ldmsg(202) +#define TEXT203 ldmsg(203) +#define TEXT204 ldmsg(204) +#define TEXT205 ldmsg(205) +#define TEXT206 ldmsg(206) +#define TEXT207 ldmsg(207) +#define TEXT208 ldmsg(208) +#define TEXT209 ldmsg(209) +#define TEXT210 ldmsg(210) +#define TEXT211 ldmsg(211) +#define TEXT212 ldmsg(212) +#define TEXT213 ldmsg(213) +#define TEXT214 ldmsg(214) +#define TEXT215 ldmsg(215) +#define TEXT216 ldmsg(216) +#define TEXT217 ldmsg(217) +#define TEXT218 ldmsg(218) +#define TEXT219 ldmsg(219) +#define TEXT220 ldmsg(220) +#define TEXT221 ldmsg(221) +#define TEXT222 ldmsg(222) +#define TEXT223 ldmsg(223) +#define TEXT224 ldmsg(224) +#define TEXT225 ldmsg(225) +#define TEXT226 ldmsg(226) +#define TEXT227 ldmsg(227) +#define TEXT228 ldmsg(228) +#define TEXT229 ldmsg(229) +#define TEXT230 ldmsg(230) +#define TEXT231 ldmsg(231) +#define TEXT232 ldmsg(232) +#define TEXT233 ldmsg(233) +#define TEXT234 ldmsg(234) +#define TEXT235 ldmsg(235) +#define TEXT236 ldmsg(236) +#define TEXT240 ldmsg(240) +#define TEXT241 ldmsg(241) +#define TEXT242 ldmsg(242) +#define TEXT243 ldmsg(243) +#define TEXT244 ldmsg(244) +#define TEXT245 ldmsg(245) +#define TEXT246 ldmsg(246) +#define TEXT247 ldmsg(247) +#define TEXT248 ldmsg(248) +#define TEXT249 ldmsg(249) +#define TEXT250 ldmsg(250) + +#define TEXT284 ldmsg(284) +#define TEXT285 ldmsg(285) +#define TEXT286 ldmsg(286) +#define TEXT287 ldmsg(287) +#define TEXT288 ldmsg(288) +#define TEXT289 ldmsg(289) +#define TEXT290 ldmsg(290) +#define TEXT291 ldmsg(291) +#define TEXT292 ldmsg(292) +#define TEXT293 ldmsg(293) +#define TEXT294 ldmsg(294) +#define TEXT295 ldmsg(295) +#define TEXT296 ldmsg(296) +#define TEXT297 ldmsg(297) +#define TEXT298 ldmsg(298) +#define TEXT299 ldmsg(299) +#define TEXT300 ldmsg(300) +#define TEXT301 ldmsg(301) +#define TEXT302 ldmsg(302) +#define TEXT303 ldmsg(303) +#define TEXT304 ldmsg(304) +#define TEXT305 ldmsg(305) +#define TEXT306 ldmsg(306) +#define TEXT307 ldmsg(307) +#define TEXT308 ldmsg(308) +#define TEXT310 ldmsg(310) +#define TEXT311 ldmsg(311) +#define TEXT312 ldmsg(312) +#define TEXT313 ldmsg(313) +#define TEXT314 ldmsg(314) +#define TEXT315 ldmsg(315) +#define TEXT316 ldmsg(316) +#define TEXT317 ldmsg(317) +#define TEXT318 ldmsg(318) +#define TEXT319 ldmsg(319) +#define TEXT320 ldmsg(320) +#define TEXT321 ldmsg(321) +#define TEXT322 ldmsg(322) +#define TEXT323 ldmsg(323) +#define TEXT324 ldmsg(324) +#define TEXT325 ldmsg(325) +#define TEXT326 ldmsg(326) +#define TEXT327 ldmsg(327) +#define CHAR328 ldmsg(328)[0] +#define TEXT329 ldmsg(329) +#define TEXT330 ldmsg(330) +#define TEXT331 ldmsg(331) +#define TEXT332 ldmsg(332) +#define TEXT333 ldmsg(333) +#define TEXT334 ldmsg(334) +#define TEXT335 ldmsg(335) +#define TEXT336 ldmsg(336) +#define TEXT337 ldmsg(337) +#define TEXT338 ldmsg(338) + +#else /* ?DYNMSGS */ #if ENGLISH #include "english.h" #define LANGUAGE "english" @@ -39,3 +346,5 @@ #include "latin.h" #define LANGUAGE "latin" #endif +#endif /* !DYNMSGS */ + diff --git a/h/english.h b/h/english.h index cb0dceb..032b7d7 100644 --- a/h/english.h +++ b/h/english.h @@ -36,7 +36,11 @@ #define TEXT27 "Pop buffer" #define TEXT28 "Buffer is being displayed" #define TEXT29 "Change buffer name to: " +#if JMDEXT +#define TEXT30 "ACTN Modes Size Buffer File" +#else #define TEXT30 "ACTN Modes Size Buffer File" +#endif #define TEXT31 " Global Modes" #define TEXT32 "Discard changes" #define TEXT33 "Encryption String: " @@ -66,7 +70,11 @@ #define TEXT57 "Can not display variable list" #define TEXT58 "[Building variable list]" #define TEXT59 UNUSED -#define TEXT60 "Line %D/%D Col %d/%d Char %D/%D (%d%%) char = 0x%x" +#if THEOX +#define TEXT60 "Line %D/%D Col %d/%d Char %D/%D (%d%%) Unicode char = 0x%x %d, TheoX char = 0x%x %d" +#else +#define TEXT60 "Line %D/%D Col %d/%d Char %D/%D (%d%%) char = 0x%x %d" +#endif #define TEXT61 "" #define TEXT62 "Global mode to " #define TEXT63 "Mode to " @@ -92,7 +100,7 @@ #define TEXT83 UNUSED #define TEXT84 "Replace " #define TEXT85 "Query replace " -#define TEXT86 "with " +#define TEXT86 "with abort, =empty, " #define TEXT87 "Replace '" #define TEXT88 "' with '" #define TEXT89 "Aborted!" @@ -242,7 +250,8 @@ #define TEXT233 "[Building Abbreviation list]" #define TEXT234 "Abbreviation list" #define TEXT235 "Can not display abbreviation list" -#define TEXT236 "Define Abbreviations in buffer" +#define TEXT236 "Define Abbreviations from buffer" + #define TEXT240 "[No such screen]" #define TEXT241 "%%Can't delete current screen" #define TEXT242 "Find Screen: " @@ -254,7 +263,26 @@ #define TEXT248 "Enter Label String: " #define TEXT249 "Global variable to declare: " #define TEXT250 "Local variable to declare: " - +#if JMDEXT +#define TEXT284 "Function not available" +#define TEXT285 "No topic" +#define TEXT286 "Searching topic \"%s\"" +#define TEXT287 "Searching keyword \"%s\"" +#define TEXT288 "Topic: " +#define TEXT289 "Keyword: " +#define TEXT290 "No help for topic \"%s\"" +#define TEXT291 "No help for keyword \"%s\"" +#define TEXT292 "Unable to open the help file %s" +#define TEXT293 "Index of " +#define TEXT294 "[Help]" +#define TEXT295 "[Errors]" +#define TEXT296 "[Function Keys]" +#define TEXT297 "%s is not a regular file" +#endif +#if THEOS +#define TEXT298 "%s is not a sequential file" +#define TEXT299 "%s is not a library" +#endif /* some of these are just used in the microsoft windows version */ #define TEXT300 "[Incorrect menu]" #define TEXT301 "[Too many nested popup menus]" @@ -293,4 +321,4 @@ #define TEXT335 "Change screen name to: " #define TEXT336 "[Screen name already in use]" #define TEXT337 "cannot monitor external program" - +#define TEXT338 "Internal command to execute (space for help):" diff --git a/h/epath.h b/h/epath.h index 01103bd..8aba6ef 100644 --- a/h/epath.h +++ b/h/epath.h @@ -1,5 +1,5 @@ /* EPATH: This file contains certain info needed to locate the - MicroEMACS files on a system dependant basis. + MicroEMACS files on a system dependent basis. */ @@ -16,6 +16,17 @@ NOSHARE CONST char *pathname[] = ":t/", ":s/" }; +#if JMDEXT +NOSHARE CONST char *otherpath[] = +{ + "emacs.msg", + "c.hlp", + "c.idx", + ".hlp", + ".idx", + "error.cmd", +}; +#endif #endif #if TOS @@ -27,8 +38,19 @@ NOSHARE CONST char *pathname[] = "\\util\\", "" }; +#if JMDEXT +NOSHARE CONST char *otherpath[] = +{ + "emacs.msg", + "c.hlp", + "c.idx", + ".hlp", + ".idx", + "error.cmd", +}; +#endif #endif - + #if FINDER { "emacs.rc", @@ -37,11 +59,26 @@ NOSHARE CONST char *pathname[] = "/sys/public", "" }; +#if JMDEXT +NOSHARE CONST char *otherpath[] = +{ + "emacs.msg", + "c.hlp", + "c.idx", + ".hlp", + ".idx", + "error.cmd", +}; +#endif #endif #if MSDOS || WINNT || WINXP { +#if WINDOW_MSWIN || WINDOW_MSWIN32 + "mewin.cmd", +#else "emacs.rc", +#endif "emacs.hlp", "\\sys\\public\\", "\\usr\\bin\\", @@ -49,6 +86,17 @@ NOSHARE CONST char *pathname[] = "\\", "" }; +#if JMDEXT +NOSHARE CONST char *otherpath[] = +{ + "emacs.msg", + "c.hlp", + "c.idx", + ".hlp", + ".idx", + "error.cmd", +}; +#endif #endif #if OS2 @@ -62,16 +110,43 @@ NOSHARE CONST char *pathname[] = "\\", "" }; +#if JMDEXT +NOSHARE CONST char *otherpath[] = +{ + "emacs.msg", + "c.hlp", + "c.idx", + ".hlp", + ".idx", + "error.cmd", +}; +#endif #endif #if V7 | BSD | FREEBSD | USG | AIX | SMOS | HPUX8 | HPUX9 | XENIX | SUN | AVIION { ".emacsrc", "emacs.hlp", +#if JMDEXT + "/usr/local/share/uemacs/", + "/opt/lib/uemacs/", + "/usr/lib/uemacs/", +#endif "/usr/local/", "/usr/lib/", "" }; +#if JMDEXT +NOSHARE CONST char *otherpath[] = +{ + "emacs.msg", + "c.hlp", + "c.idx", + ".hlp", + ".idx", + "error.cmd", +}; +#endif #endif #if VMS @@ -82,6 +157,17 @@ NOSHARE CONST char *pathname[] = "SYS$LOGIN:", "" }; +#if JMDEXT +NOSHARE CONST char *otherpath[] = +{ + "emacs.msg", + "c.hlp", + "c.idx", + ".hlp", + ".idx", + "error.cmd", +}; +#endif #endif #if WMCS @@ -91,6 +177,17 @@ NOSHARE CONST char *pathname[] = "", "sys$disk/syslib.users/" }; +#if JMDEXT +NOSHARE CONST char *otherpath[] = +{ + "emacs.msg", + "c.hlp", + "c.idx", + ".hlp", + ".idx", + "error.cmd", +}; +#endif #endif #if AOSVS @@ -104,6 +201,17 @@ NOSHARE CONST char *pathname[] = "/macros/", "/help/" }; +#if JMDEXT +NOSHARE CONST char *otherpath[] = +{ + "emacs.msg", + "c.hlp", + "c.idx", + ".hlp", + ".idx", + "error.cmd", +}; +#endif #endif #if MPE @@ -114,6 +222,37 @@ NOSHARE CONST char *pathname[] = ".pub.sys", "" }; +#if JMDEXT +NOSHARE CONST char *otherpath[] = +{ + "emacs.msg", + "c.hlp", + "c.idx", + ".hlp", + ".idx", + "error.cmd", +}; +#endif #endif /* MPE */ +#if THEOS +{ + "emacs.rc", + "system.help386 ._me", + "/usr/local/lib/emacs/", + "" +}; +#if JMDEXT +NOSHARE CONST char *otherpath[] = +{ + "emacs.msg", + "c.hlp", + "c.idx", + ".hlp", + ".idx", + "error.cmd", +}; +#endif +#endif + #define NPNAMES (sizeof(pathname)/sizeof(char *)) diff --git a/h/eproto.h b/h/eproto.h index bdad979..88d4882 100644 --- a/h/eproto.h +++ b/h/eproto.h @@ -4,36 +4,80 @@ written by Daniel Lawrence based on code by Dave G. Conroy, Steve Wilhite and George Jones + + Unicode support by Jean-Michel Dubois */ +#if LINUX +#include +#include +#include +#include +#include +#include +#endif +#if UTF8 +#include +#endif +#if CURSES +#undef CTRL +#if UTF8 +#include /* Curses screen output */ +#include /* Curses screen output */ +#define CTRL 0x01000000 /* Restore definition */ +#else +#include /* Curses screen output */ +#include /* Curses screen output */ +#define CTRL 0x0100 /* Restore definition */ +#endif +#endif + #if PROTO /*** global function prototypes ***/ +#if CURSES +extern int handlemenu(WINDOW* wmouse, int ypos, int xpos); +#endif + +#if WINDOW_MSWIN || CURSES +extern int bindtomenu (int f, int n); +extern int macrotomenu (int f, int n); +extern int unbindmenu (int f, int n); +extern void closedrop(void); +extern void menukey(int c); +extern int menudrop(int f, int n); +#endif + #if WINDOW_MSWIN -extern char * PASCAL fullpathname (char *PathName, int Nbuf); -extern int PASCAL NEAR vtinitscr (SCREEN *sp, int nrow, int ncol); -extern int PASCAL NEAR vtsizescr (SCREEN *sp, int nrow, int ncol); -extern int PASCAL cutregion (int f, int n); -extern int PASCAL clipregion (int f, int n); -extern int PASCAL insertclip (int f, int n); -extern int PASCAL helpengine (int f, int n); -extern int PASCAL minimizescreen (int f, int n); -extern int PASCAL maximizescreen (int f, int n); -extern int PASCAL restorescreen (int f, int n); -extern int PASCAL tilescreens (int f, int n); -extern int PASCAL cascadescreens (int f, int n); -extern int PASCAL bindtomenu (int f, int n); -extern int PASCAL macrotomenu (int f, int n); -extern int PASCAL unbindmenu (int f, int n); -extern int PASCAL execmenu (int f, int n); -extern int PASCAL longop (int f); -extern int PASCAL filenamedlg (char *prompt, char *buf, int nbuf, int fullpath); -extern int PASCAL NEAR vtfreescr (SCREEN *sp); -extern int PASCAL NEAR unlist_screen(SCREEN *sp); -extern int PASCAL mlhistory(VOID); -extern int PASCAL updscrollbars (SCREEN *sp, char w_flag); -extern VOID PASCAL NEAR vtscreen (SCREEN *sp); +extern char * fullpathname (char *PathName, int Nbuf); +extern int vtinitscr (ESCREEN *sp, int nrow, int ncol); +extern int vtsizescr (ESCREEN *sp, int nrow, int ncol); +extern int cutregion (int f, int n); +extern int clipregion (int f, int n); +extern int insertclip (int f, int n); +extern int helpengine (int f, int n); +extern int minimizescreen (int f, int n); +extern int maximizescreen (int f, int n); +extern int restorescreen (int f, int n); +extern int tilescreens (int f, int n); +extern int cascadescreens (int f, int n); +extern int execmenu (int f, int n); +extern int longop (int f); +extern int filenamedlg (char *prompt, char *buf, int nbuf, int fullpath); +extern int vtfreescr (ESCREEN *sp); +extern int unlist_screen(ESCREEN *sp); +extern int mlhistory(VOID); +extern int updscrollbars (ESCREEN *sp, char w_flag); +extern VOID vtscreen (ESCREEN *sp); +#endif + +#if WINXP +#define ToWUpper(a) CharUpperW(a) +#define ToWLower(a) CharLowerW(a) +#else +#define ToWUpper(a) towupper(a) +#define ToWLower(a) towlower(a) #endif #if CALLED @@ -41,514 +85,584 @@ extern int emacs(int argc, char *argv[]); #endif #if HANDLE_WINCH +#if LINUX +extern VOID winch_changed(int status); +#else extern VOID winch_changed(VOID); +#endif extern VOID winch_new_size(VOID); +VOID winch_vtresize(int rows, int cols); #endif #if DEBUG_SEARCH -int PASCAL NEAR mc_list(int f, int n); -int PASCAL NEAR rmc_list(int f, int n); -VOID PASCAL NEAR mctype_cat(char pline[], int mc_type); +int mc_list(int f, int n); +int rmc_list(int f, int n); +VOID mctype_cat(char pline[], int mc_type); #endif extern VOID undo_insert(OPTYPE op_type, long count, OBJECT op_erand); extern int undo_op(VOID); extern VOID undo_dump(VOID); extern VOID undo_zot(BUFFER *bp); -extern int PASCAL NEAR undo(int f, int n); -extern int PASCAL NEAR undo_delete(int f, int n); -extern int PASCAL NEAR undo_list(int f, int n); +extern int undo(int f, int n); +extern int undo_delete(int f, int n); +extern int undo_list(int f, int n); extern VOID *room(int); extern VOID *reroom(VOID *, int); -extern int PASCAL NEAR ab_insert(char *sym, char *expansion); -extern char *PASCAL NEAR ab_lookup(char *sym); -extern int PASCAL NEAR ab_delete(char *sym); -extern int PASCAL NEAR ab_clean(VOID); -extern BUFFER *PASCAL NEAR bfind(char *bname, int cflag, int bflag); -extern BUFFER *PASCAL NEAR getcbuf(char *prompt, char *defval, int createflag); -extern BUFFER *PASCAL NEAR getdefb(VOID); -extern BUFFER *PASCAL NEAR getoldb(VOID); -extern SCREEN *PASCAL NEAR init_screen(char *, BUFFER *); -extern SCREEN *PASCAL NEAR lookup_screen(char *scr_name); -extern SCREEN *PASCAL NEAR index_screen(int scr_num); -extern int PASCAL NEAR screen_index(SCREEN *sp); -extern int PASCAL NEAR insert_screen(SCREEN *sp); -extern int PASCAL NEAR select_screen(SCREEN *sp, int announce); -extern int PASCAL NEAR free_screen(SCREEN *sp); +extern int ab_insert(char *sym, char *expansion); +extern char *ab_lookup(char *sym); +extern int ab_delete(char *sym); +extern int ab_clean(VOID); +extern BUFFER *bfind(CONST char *bname, int cflag, int bflag); +extern BUFFER *getcbuf(CONST char *prompt, char *defval, int createflag); +extern BUFFER *getdefb(VOID); +extern BUFFER *getoldb(VOID); +extern ESCREEN *init_screen(char *, BUFFER *); +extern ESCREEN *lookup_screen(char *scr_name); +extern ESCREEN *index_screen(int scr_num); +extern int screen_index(ESCREEN *sp); +extern int insert_screen(ESCREEN *sp); +extern int select_screen(ESCREEN *sp, int announce); +extern VOID free_screen(ESCREEN *sp); extern char *Eallocate(unsigned nbytes); -extern char *dolock(char *fname); +extern char *dolock(CONST char *fname); extern char *getpath(char *filespec); extern char *gtname(char *filespec); -extern char *PASCAL NEAR bytecopy(char *dst, char *src, int maxlen); -extern char *PASCAL NEAR cmdstr(int c, char *seq); -extern char *PASCAL NEAR copystr(char *); -extern char *PASCAL NEAR complete(char *prompt, char *defval, int type, int maxlen); -extern char *PASCAL NEAR envval(int i); -extern char *PASCAL NEAR fixnull(char *s); -extern char *PASCAL NEAR flook(char *fname, int hflag); -extern char *PASCAL NEAR funval(int i); -extern char *PASCAL NEAR getctext(char *rline); -extern char *PASCAL NEAR getffile(char *fspec); -extern char *PASCAL NEAR getfname(KEYTAB *key); -extern char *PASCAL NEAR getkill(VOID); -extern char *PASCAL NEAR getnfile(VOID); -extern char *PASCAL NEAR getreg(char *value); -extern char *PASCAL NEAR getval(char *token); -extern char *PASCAL NEAR getwlist(char *buf); -extern char *PASCAL NEAR gtenv(char *vname); -extern char *PASCAL NEAR gtfilename(char *prompt); -extern char *PASCAL NEAR gtfun(char *fname); -extern char *PASCAL NEAR gtusr(char *vname); -extern char *PASCAL NEAR int_asc(int i); -extern char *PASCAL NEAR long_asc(long num); -extern char *PASCAL NEAR ltos(int val); -extern char *PASCAL NEAR makename(char *bname, char *fname); -extern char *PASCAL NEAR mklower(char *str); -extern char *PASCAL NEAR mkupper(char *str); -extern char *PASCAL NEAR namval(int index); -extern char *PASCAL NEAR timeset(VOID); -extern char *PASCAL NEAR token(char *src, char *tok, int size); -extern char *PASCAL NEAR transbind(char *skey); -extern char *PASCAL NEAR trimstr(char *s); -extern char *PASCAL NEAR xlat(char *source, char *lookup, char *trans); -extern char *undolock(char *fname); -extern char *PASCAL NEAR regtostr(char *buf, REGION *region); -extern int PASCAL NEAR lowerc(char ch); -extern int PASCAL NEAR cycle_ring(int f, int n); -extern int PASCAL NEAR upperc(char ch); +extern char *bytecopy(char *dst, CONST char *src, int maxlen); +extern char *cmdstr(int c, char *seq); +extern char *copystr(char *); +extern char *complete(CONST char *prompt, char *defval, int type, int maxlen); +extern char *envval(int i); +extern CONST char *fixnull(CONST char *s); +extern CONST char *flook(CONST char *fname, int hflag); +extern char *funval(int i); +extern char *getctext(char *rline); +extern char *getffile(char *fspec); +extern CONST char *getfname(KEYTAB *key); +extern char *getkill(VOID); +extern char *getnfile(VOID); +extern char *getreg(char *value); +extern CONST char *getval(char *token); +extern char *getwlist(char *buf); +extern CONST char *gtenv(CONST char *vname); +extern char *gtfilename(CONST char *prompt); +extern CONST char *gtfun(char *fname); +extern char *gtusr(char *vname); +extern char *int_asc(int i); +extern char *long_asc(long num); +extern CONST char *ltos(int val); +extern CONST char *makename(char *bname, CONST char *fname); +extern char *mklower(char *str); +extern char *mkupper(char *str); +extern char *namval(int index); +extern char *timeset(VOID); +extern char *token(char *src, char *tok, int size); +extern CONST char *transbind(CONST char *skey); +extern char *trimstr(char *s); +extern char *xlat(char *source, char *lookup, char *trans); +extern char *undolock(CONST char *fname); +extern char *regtostr(char *buf, REGION *region); +#if UTF8 +extern unsigned int chcase(unsigned int ch); +extern unsigned int lowerc(unsigned int ch); +extern unsigned int upperc(unsigned int ch); +extern int setlower(char *ch, char *val); +extern int setupper(char *ch, char *val); +#else +extern unsigned int chcase(register unsigned int ch); +extern VOID initchars(VOID); +extern int lowerc(char ch); +extern int upperc(char ch); +#endif +extern int setlower(char *ch, char *val); +extern int setupper(char *ch, char *val); +extern int cycle_ring(int f, int n); #if ZTC || TURBO || IC -extern int (PASCAL NEAR *PASCAL NEAR fncmatch(char *fname))(int, int); -extern int (PASCAL NEAR *PASCAL NEAR getname(char *prompt))(int, int); +extern int (*fncmatch(char *fname))(int, int); +extern int (*getname(CONST char *prompt))(int, int); #else /* Sun (and others?) screwed up the prototyping.*/ -extern int (PASCAL NEAR *PASCAL NEAR fncmatch(char *fname))(VOID); -extern int (PASCAL NEAR *PASCAL NEAR getname(char *prompt))(VOID); +#if THEOSC +extern int *fncmatch(char* fname); +extern int *getname(CONST char* fname); +#else +extern int (*fncmatch(char *fname))(VOID); +extern int (*getname(CONST char *prompt))(VOID); #endif -extern int PASCAL NEAR asc_int(char *st); -extern int dolhello(VOID); +#endif +extern int asc_int(char *st); +extern VOID dolhello(VOID); extern int dspram(VOID); -extern int lckerror(char *errstr); -extern int lckhello(VOID); -extern int xlock(char *fname); -extern int lockchk(char *fname); +extern VOID lckerror(char *errstr); +extern VOID lckhello(VOID); +extern int xlock(CONST char *fname); +extern int lockchk(CONST char *fname); extern int lockrel(VOID); -extern int mousehello(VOID); +extern VOID mousehello(VOID); extern int nocrypt(VOID); -extern int PASCAL NEAR absv(int x); -extern int PASCAL NEAR add_abbrev(int f, int n); -extern int PASCAL NEAR del_abbrev(int f, int n); -extern int PASCAL NEAR kill_abbrevs(int f, int n); -extern int PASCAL NEAR ins_abbrevs(int f, int n); -extern int PASCAL NEAR def_abbrevs(int f, int n); -extern int PASCAL NEAR addline(BUFFER *bp, char *text); -extern int PASCAL NEAR amatch(MC *mcptr, int direct, LINE **pcwline, int *pcwoff); -extern int PASCAL NEAR backhunt(int f, int n); -extern int PASCAL NEAR backsearch(int f, int n); -extern int PASCAL NEAR biteq(int bc, EBITMAP cclmap); -extern int PASCAL NEAR bktoshell(int f, int n); -extern int PASCAL NEAR boundry(LINE *curline, int curoff, int dir); -extern int PASCAL NEAR cclmake(char **ppatptr, MC *mcptr); -extern int PASCAL NEAR checknext(int chr, int dir); -extern int PASCAL NEAR clear_ring(int f, int n); -extern int PASCAL NEAR delins(int dlength, char *instr, int use_rmc); -extern int PASCAL NEAR desfunc(int f, int n); -extern int PASCAL NEAR dispvar(int f, int n); -extern int PASCAL NEAR echochar(unsigned char c); -extern int PASCAL NEAR echostring(char *, int, int); -extern int PASCAL NEAR eq(register unsigned char bc, register unsigned char pc); -extern long PASCAL NEAR ernd(VOID); -extern int PASCAL NEAR execkey(KEYTAB *key, int f, int n); -extern int PASCAL NEAR fbound(DELTA *tbl, int jump, LINE **pcurline, int *pcuroff, int dir); -extern int PASCAL NEAR fexist(char *fname); -extern int PASCAL NEAR findcol(LINE *lp, int pos); -extern int PASCAL NEAR fisearch(int f, int n); +extern int absv(int x); +extern int add_abbrev(int f, int n); +extern int del_abbrev(int f, int n); +extern int kill_abbrevs(int f, int n); +extern int ins_abbrevs(int f, int n); +extern int def_abbrevs(int f, int n); +extern int addline(BUFFER *bp, CONST char *text); +extern int backhunt(int f, int n); +extern int backsearch(int f, int n); +extern int bktoshell(int f, int n); +extern int boundry(LINE *curline, int curoff, int dir); +extern int checknext(int chr, int dir); +extern int clear_ring(int f, int n); +extern int delins(int dlength, char *instr, int use_rmc); +extern int desfunc(int f, int n); +extern int dispvar(int f, int n); +extern int ueechochar(unsigned char c); +extern int echostring(char *, int, int); +extern int eq(register unsigned char bc, register unsigned char pc); +#if UTF8 +extern int weq(unsigned int bc, unsigned int pc); +#endif +extern long ernd(VOID); +extern int execkey(KEYTAB *key, int f, int n); +extern int fbound(DELTA *tbl, int jump, LINE **pcurline, int *pcuroff, int dir); +extern int fexist(char *fname); +extern int findcol(LINE *lp, int pos); +extern int fisearch(int f, int n); #if FLABEL -extern int PASCAL NEAR fnclabel(int f, int n); +extern int fnclabel(int f, int n); #endif -extern int PASCAL NEAR forwhunt(int f, int n); -extern int PASCAL NEAR forwsearch(int f, int n); -extern int PASCAL NEAR getcwnum(VOID); -extern int PASCAL NEAR getgoal(LINE *dlp); -extern int PASCAL NEAR getstring(unsigned char *buf, int nbuf, int eolchar); -extern int PASCAL NEAR gettwnum(VOID); -extern int PASCAL NEAR gettyp(char *token); -extern int PASCAL NEAR getkey(VOID); -extern int PASCAL NEAR getwpos(VOID); -extern int PASCAL NEAR get_char(VOID); -extern int PASCAL NEAR global_var(int f, int n); +extern int forwhunt(int f, int n); +extern int forwsearch(int f, int n); +extern int getcwnum(VOID); +extern int getgoal(LINE *dlp); +extern int getstring(unsigned char *buf, int nbuf, int eolchar); +extern int gettwnum(VOID); +extern int gettyp(CONST char *token); +extern int getkey(VOID); +extern int getwpos(VOID); +extern int get_char(VOID); +extern int global_var(int f, int n); #if DBCS -extern int PASCAL NEAR is2byte(char *sp, char *cp); +extern int is2byte(char *sp, char *cp); +#endif +#if UTF8 +extern int is_letter(unsigned int ch); +extern int is_lower(unsigned int ch); +extern int is_upper(unsigned int ch); +#else +extern int is_letter(char ch); +extern int is_lower(char ch); +extern int is_upper(char ch); #endif -extern int PASCAL NEAR is_letter(char ch); -extern int PASCAL NEAR is_lower(char ch); -extern int PASCAL NEAR is_num(char *st); -extern int PASCAL NEAR isearch(int dir); -extern int PASCAL NEAR is_upper(char ch); -extern int PASCAL NEAR kinsert(int back, char c); -extern int PASCAL NEAR ldelnewline(VOID); -extern int PASCAL NEAR linstr(char *instr); -extern int PASCAL NEAR liteq(LINE **curline, int *curpos, int direct, char *lstring); -extern int PASCAL NEAR litmake(char **ppatptr, MC *mcptr); -extern int PASCAL NEAR lnewline(VOID); -extern int PASCAL NEAR local_var(int f, int n); -extern int PASCAL NEAR lookup_color(char *sp); -extern int PASCAL NEAR lover(char *ostr); -extern int PASCAL NEAR mceq(unsigned char bc, MC *mt); -extern int PASCAL NEAR mcscanner(MC *mcpatrn, int direct, int beg_or_end, int repeats); -extern int PASCAL NEAR mcstr(VOID); -extern int PASCAL NEAR mlprompt(char *, char *, int); -extern int PASCAL NEAR movelocalpoint(int n, int *pcuroff, LINE **pcurline); -extern int PASCAL NEAR nextch(LINE **pcurline, int *pcuroff, int dir); -extern int PASCAL NEAR pop(BUFFER *popbuffer); -extern int PASCAL NEAR qreplace(int f, int n); -extern int PASCAL NEAR readpattern(char *prompt, char apat[], int srch); +extern int is_num(char *st); +extern int isearch(int dir); +extern int kinsert(int back, char c); +extern int ldelnewline(VOID); +extern int linstr(CONST char *instr); +extern int liteq(LINE **curline, int *curpos, int direct, char *lstring); +extern int lnewline(VOID); +extern int local_var(int f, int n); +extern int lookup_color(char *sp); +extern int lover(CONST char *ostr); +extern int mcstr(VOID); +extern int mlprompt(CONST char *, char *, int); +extern int movelocalpoint(int n, int *pcuroff, LINE **pcurline); +extern int nextch(LINE **pcurline, int *pcuroff, int dir); +extern int pop(BUFFER *popbuffer); +extern int qreplace(int f, int n); +extern int readpattern(CONST char *prompt, char apat[], int srch); #if WINDOW_TEXT -extern VOID PASCAL NEAR refresh_screen(SCREEN *sp); +extern VOID refresh_screen(ESCREEN *sp); #endif -extern int PASCAL NEAR reglines(VOID); -extern int PASCAL NEAR rename_screen(int f, int n); -extern int PASCAL NEAR replaces(int kind, int f, int n); -extern int PASCAL NEAR risearch(int f, int n); -extern int PASCAL NEAR rmcstr(VOID); -extern int PASCAL NEAR savematch(VOID); -extern int PASCAL NEAR scanmore(int dir); +extern int reglines(VOID); +extern int rename_screen(int f, int n); +extern int replaces(int kind, int f, int n); +extern int risearch(int f, int n); +extern int rmcstr(VOID); +extern int savematch(VOID); +extern int scanmore(int dir); #if MAGIC == 0 -extern int PASCAL NEAR scanner(int direct, int beg_or_end, int repeats); +extern int scanner(int direct, int beg_or_end, int repeats); +#else +extern int amatch(MC *mcptr, int direct, LINE **pcwline, int *pcwoff); +extern int biteq(int bc, EBITMAP cclmap); +extern int cclmake(char **ppatptr, MC *mcptr); +extern int litmake(char **ppatptr, MC *mcptr); +extern int mceq(unsigned char bc, MC *mt); +extern int mcscanner(MC *mcpatrn, int direct, int beg_or_end, int repeats); +extern VOID setbit(int bc, EBITMAP cclmap); #endif -extern int PASCAL NEAR setlower(char *ch, char *val); -extern int PASCAL NEAR setlower(char *ch, char *val); -extern int PASCAL NEAR setupper(char *ch, char *val); -extern int PASCAL NEAR setupper(char *ch, char *val); -extern int PASCAL NEAR setvar(int f, int n); -extern int PASCAL NEAR sindex(char *source, char *pattern); -extern int PASCAL NEAR sreplace(int f, int n); -extern int PASCAL NEAR stol(char *val); +extern int setvar(int f, int n); +extern int sindex(CONST char *source, CONST char *pattern); +extern int srindex(CONST char* source, CONST char* pattern); +extern int sreplace(int f, int n); +extern int stol(char *val); #if DBCS -extern int PASCAL NEAR stopback(VOID); -extern int PASCAL NEAR stopforw(VOID); +extern int stopback(VOID); +extern int stopforw(VOID); #endif -extern int PASCAL NEAR svar(VDESC *var, char *value); -extern int PASCAL NEAR tgetc(VOID); -extern int PASCAL NEAR uneat(VOID); -extern int PASCAL NEAR unlist_screen(SCREEN *sp); -extern int PASCAL NEAR upscreen(int f, int n); -extern int PASCAL NEAR vtinit(VOID); -extern int PASCAL NEAR yank(int f, int n); -extern int PASCAL NEAR yank_pop(int f, int n); +extern int svar(VDESC *var, char *value); +extern int tgetc(VOID); +extern int uneat(VOID); +extern VOID unlist_screen(ESCREEN *sp); +extern int upscreen(int f, int n); +extern int vtinit(VOID); +extern int yank(int f, int n); +extern int yank_pop(int f, int n); extern int Erelease(char *mp); extern int set_key(KEYTAB *key, char *name); extern int xunlock(char *fname); extern KEYTAB *getbind(int c); -extern LINE *PASCAL NEAR lalloc(int used); -extern LINE *PASCAL NEAR mouseline(EWINDOW *wp, int row); -extern long PASCAL NEAR getlinenum(BUFFER *bp, LINE *sline); -extern int PASCAL NEAR addkey(unsigned char * seq, int fn); -extern int PASCAL NEAR addkeymap(int f, int n); -extern int PASCAL NEAR adjustmode(int kind, int global); -extern int PASCAL NEAR anycb(VOID); -extern int PASCAL NEAR apro(int f, int n); -extern int PASCAL NEAR backchar(int f, int n); -extern int PASCAL NEAR backdel(int f, int n); -extern int PASCAL NEAR backline(int f, int n); -extern int PASCAL NEAR backpage(register int f, register int n); -extern int PASCAL NEAR backword(int f, int n); -extern int PASCAL NEAR bclear(BUFFER *bp); -extern int PASCAL NEAR binary(char *key, char *(PASCAL NEAR *tval)(), int tlength, int klength); -extern int PASCAL NEAR bindtokey(int f, int n); -extern int PASCAL NEAR buildlist(int type, char *mstring); -extern int PASCAL NEAR capword(int f, int n); -extern int PASCAL NEAR cex(int f, int n); -extern int PASCAL NEAR cinsert(VOID); -extern int PASCAL NEAR clean(VOID); -extern int PASCAL NEAR clrmes(int f, int n); -extern int PASCAL NEAR copyregion(int f, int n); -extern int PASCAL NEAR ctlxe(int f, int n); -extern int PASCAL NEAR ctlxlp(int f, int n); -extern int PASCAL NEAR ctlxrp(int f, int n); -extern int PASCAL NEAR ctoec(int c); -extern int PASCAL NEAR ctrlg(int f, int n); -extern int PASCAL NEAR cycle_screens(int f, int n); -extern VOID PASCAL NEAR dcline(int argc, char *argv[], int firstflag); -extern int PASCAL NEAR deblank(int f, int n); -extern int PASCAL NEAR debug(BUFFER *bp, char *eline, int *skipflag); -extern int PASCAL NEAR delbword(int f, int n); -extern int PASCAL NEAR delete_screen(int f, int n); -extern int PASCAL NEAR delfword(int f, int n); -extern int PASCAL NEAR delgmode(int f, int n); -extern int PASCAL NEAR delmode(int f, int n); -extern int PASCAL NEAR delwind(int f, int n); -extern int PASCAL NEAR desc_abbrevs(int f, int n); -extern int PASCAL NEAR desbind(int f, int n); -extern int PASCAL NEAR deskey(int f, int n); -extern int PASCAL NEAR desvars(int f, int n); -extern int PASCAL NEAR detab(int f, int n); -extern int PASCAL NEAR dobuf(BUFFER *bp); -extern int PASCAL NEAR docmd(char *cline); -extern int PASCAL NEAR dofile(char *fname); -extern int PASCAL NEAR ectoc(int c); -extern VOID PASCAL NEAR edinit(char bname[]); -extern int PASCAL NEAR editloop(VOID); -extern int PASCAL NEAR endword(int f, int n); -extern int PASCAL NEAR enlargewind(int f, int n); -extern int PASCAL NEAR entab(int f, int n); -extern int PASCAL NEAR execbuf(int f, int n); -extern int PASCAL NEAR execcmd(int f, int n); -extern int PASCAL NEAR execfile(int f, int n); -extern int PASCAL NEAR execprg(int f, int n); -extern int PASCAL NEAR execproc(int f, int n); -extern int PASCAL NEAR execute(int c, int f, int n); -extern int PASCAL NEAR ffclose(VOID); -extern int PASCAL NEAR ffgetline(int *nbytes); -extern int PASCAL NEAR ffputline(char buf[], int nbuf); -extern int PASCAL NEAR ffropen(char *fn); -extern int PASCAL NEAR ffwopen(char *fn, char *mode); -extern int PASCAL NEAR fileapp(int f, int n); -extern int PASCAL NEAR find_screen(int f, int n); -extern int PASCAL NEAR filefind(int f, int n); -extern int PASCAL NEAR filename(int f, int n); -extern int PASCAL NEAR fileread(int f, int n); -extern int PASCAL NEAR filesave(int f, int n); -extern int PASCAL NEAR filewrite(int f, int n); -extern int PASCAL NEAR fillpara(int f, int n); -extern int PASCAL NEAR filter(int f, int n); -extern VOID PASCAL NEAR findvar(char *var, VDESC *vd, int size, int scope); -extern int PASCAL NEAR fmatch(char ch); -extern int PASCAL NEAR forwchar(int f, int n); -extern int PASCAL NEAR forwdel(int f, int n); -extern int PASCAL NEAR forwline(int f, int n); -extern int PASCAL NEAR forwpage(int f, int n); -extern int PASCAL NEAR forwword(int f, int n); -extern int PASCAL NEAR getccol(int bflg); -extern int PASCAL NEAR getcmd(VOID); -extern int PASCAL NEAR getfence(int f, int n); -extern int PASCAL NEAR getfile(char fname[], int lockfl); -extern int PASCAL NEAR get_key(VOID); -extern int PASCAL NEAR getregion(REGION *rp); -extern int PASCAL NEAR gotobob(int f, int n); -extern int PASCAL NEAR gotobol(int f, int n); -extern int PASCAL NEAR gotobop(int f, int n); -extern int PASCAL NEAR gotoeob(int f, int n); -extern int PASCAL NEAR gotoeol(int f, int n); -extern int PASCAL NEAR gotoeop(int f, int n); -extern int PASCAL NEAR gotoline(int f, int n); -extern int PASCAL NEAR gotomark(int f, int n); -extern int PASCAL NEAR help(int f, int n); -extern int PASCAL NEAR ifile(char fname[]); -extern int PASCAL NEAR indent(int f, int n); -extern int PASCAL NEAR indent_region(int f, int n); -extern int PASCAL NEAR insbrace(int n, int c); -extern int PASCAL NEAR insfile(int f, int n); -extern int PASCAL NEAR inspound(VOID); -extern int PASCAL NEAR insspace(int f, int n); -extern int PASCAL NEAR inword(VOID); -extern int PASCAL NEAR isinword(char c); -extern int PASCAL NEAR ismodeline(EWINDOW *wp, int row); -extern int PASCAL NEAR istring(int f, int n); -extern int PASCAL NEAR killbuffer(int f, int n); -extern int PASCAL NEAR killpara(int f, int n); -extern int PASCAL NEAR killregion(int f, int n); -extern int PASCAL NEAR killtext(int f, int n); -extern int PASCAL NEAR lchange(register int flag); -extern int PASCAL NEAR ldelete(long n, int kflag); -extern int PASCAL NEAR lfree(LINE *lp); -extern int PASCAL NEAR linsert(int n, char c); -extern int PASCAL NEAR listbuffers(int f, int n); -extern int PASCAL NEAR list_screens(int f, int n); -extern int PASCAL NEAR lowerregion(int f, int n); -extern int PASCAL NEAR lowerword(int f, int n); -extern int PASCAL NEAR lowrite(char c); -extern int PASCAL NEAR macarg(char *tok); -extern int PASCAL NEAR macrotokey(int f, int n); -extern int PASCAL NEAR makelist(int iflag); -extern int PASCAL NEAR movelocalpoint(); -extern int PASCAL NEAR undolist(); -extern int PASCAL NEAR mouse_screen(VOID); -extern int PASCAL NEAR screenlist(int iflag); -extern int PASCAL NEAR meexit(int status); -extern int PASCAL NEAR meta(int f, int n); -extern int PASCAL NEAR mlreply(char *prompt, char *buf, int nbuf); -extern int PASCAL NEAR mlyesno(char *prompt); -extern int PASCAL NEAR mouseoffset(EWINDOW *wp, LINE *lp, int col); -extern int PASCAL NEAR movemd(int f, int n); -extern int PASCAL NEAR movemu(int f, int n); -extern int PASCAL NEAR mregdown(int f, int n); -extern int PASCAL NEAR mmove(int f, int n); -extern int PASCAL NEAR mregup(int f, int n); -extern int PASCAL NEAR mvdnwind(int f, int n); -extern int PASCAL NEAR mvupwind(int f, int n); -extern int PASCAL NEAR namebuffer(int f, int n); -extern int PASCAL NEAR namedcmd(int f, int n); -extern int PASCAL NEAR narrow(int f, int n); -extern int PASCAL NEAR newline(int f, int n); -extern int PASCAL NEAR new_col_org(int f, int n); -extern int PASCAL NEAR new_row_org(int f, int n); -extern int PASCAL NEAR newsize(int f, int n); -extern int PASCAL NEAR newwidth(int f, int n); -extern int PASCAL NEAR nextarg(char *prompt, char *buffer, int size, int terminator); -extern int PASCAL NEAR nextbuffer(int f, int n); -extern int PASCAL NEAR nextdown(int f, int n); -extern int PASCAL NEAR nextup(int f, int n); -extern int PASCAL NEAR nextwind(int f, int n); -extern int PASCAL NEAR nullproc(int f, int n); -extern int PASCAL NEAR onlywind(int f, int n); -extern int PASCAL NEAR openline(int f, int n); -extern int PASCAL NEAR ostring(char *s); -extern int PASCAL NEAR outstring(char *s); -extern int PASCAL NEAR ovstring(int f, int n); -extern int PASCAL NEAR pipecmd(int f, int n); -extern int PASCAL NEAR popbuffer(int f, int n); -extern int PASCAL NEAR prevwind(int f, int n); -extern int PASCAL NEAR putctext(char *iline); -extern int PASCAL NEAR putline(int row, int col, char buf[]); -extern int PASCAL NEAR quickexit(int f, int n); -extern int PASCAL NEAR quit(int f, int n); -extern int PASCAL NEAR quote(int f, int n); -extern int PASCAL NEAR rdonly(VOID); -extern int PASCAL NEAR readin(char fname[], int lockfl); -extern int PASCAL NEAR refresh(int f, int n); -extern int PASCAL NEAR remmark(int f, int n); -extern int PASCAL NEAR reposition(int f, int n); -extern int PASCAL NEAR resetkey(VOID); -extern int PASCAL NEAR resize(int f, int n); -extern int PASCAL NEAR resizm(int f, int n); -extern int PASCAL NEAR resizm2(int f, int n); -extern int PASCAL NEAR resterr(VOID); -extern int PASCAL NEAR restwnd(int f, int n); -extern int PASCAL NEAR savewnd(int f, int n); -extern int PASCAL NEAR scwrite(int row, char *outstr, int forg, int bacg, +extern LINE *lalloc(int used); +extern LINE *mouseline(EWINDOW *wp, int row); +extern long getlinenum(BUFFER *bp, LINE *sline); +extern int addkey(char * seq, int fn); +extern int addkeymap(int f, int n); +extern int adjustmode(int kind, int global); +extern int anycb(VOID); +extern int apro(int f, int n); +extern int backchar(int f, int n); +extern int backdel(int f, int n); +extern int backline(int f, int n); +extern int backpage(register int f, register int n); +extern int backword(int f, int n); +extern int bclear(BUFFER *bp); +#if THEOSC +extern int binary(); +#else +extern int binary(CONST char *key, char *(*tval)(), int tlength, int klength); +#endif +extern int bindtokey(int f, int n); +extern int buildlist(int type, char *mstring); +extern int capword(int f, int n); +extern int cex(int f, int n); +extern int cinsert(VOID); +extern int clean(VOID); +extern int clrmes(int f, int n); +extern int copyregion(int f, int n); +extern int ctlxe(int f, int n); +extern int ctlxlp(int f, int n); +extern int ctlxrp(int f, int n); +extern int ctoec(int c); +extern int ctrlg(int f, int n); +extern int cycle_screens(int f, int n); +extern VOID dcline(int argc, char *argv[], int firstflag); +extern int deblank(int f, int n); +extern int debug(BUFFER *bp, char *eline, int *skipflag); +extern int delbword(int f, int n); +extern int delete_screen(int f, int n); +extern int delfword(int f, int n); +extern int delgmode(int f, int n); +extern int delmode(int f, int n); +extern int delwind(int f, int n); +extern int desc_abbrevs(int f, int n); +extern int desbind(int f, int n); +extern int deskey(int f, int n); +extern int desvars(int f, int n); +extern int detab(int f, int n); +extern int dobuf(BUFFER *bp); +extern int docmd(char *cline); +extern int dofile(CONST char *fname); +extern int ectoc(int c); +extern int edinit(char bname[]); +extern int editloop(VOID); +extern int endword(int f, int n); +extern int enlargewind(int f, int n); +extern int entab(int f, int n); +extern int execbuf(int f, int n); +extern int execcmd(int f, int n); +extern int execfile(int f, int n); +extern int execprg(int f, int n); +extern int execproc(int f, int n); +extern int execute(int c, int f, int n); +extern int ffclose(VOID); +extern int ffgetline(int *nbytes); +extern int ffputline(char buf[], int nbuf); +extern int ffropen(CONST char *fn); +extern int ffwopen(CONST char *fn, CONST char *mode); +extern int fileapp(int f, int n); +extern int find_screen(int f, int n); +extern int filefind(int f, int n); +extern int filename(int f, int n); +extern int fileread(int f, int n); +extern int filesave(int f, int n); +extern int filewrite(int f, int n); +extern int fillpara(int f, int n); +extern int uefilter(int f, int n); +extern VOID findvar(char *var, VDESC *vd, int size, int scope); +extern int fmatch(char ch); +extern int forwchar(int f, int n); +extern int forwdel(int f, int n); +extern int forwline(int f, int n); +extern int forwpage(int f, int n); +extern int forwword(int f, int n); +extern int getccol(int bflg); +extern int getcmd(VOID); +extern int getfence(int f, int n); +extern int getfile(char fname[], int lockfl); +extern int get_key(VOID); +extern int getregion(REGION *rp); +extern int gotobob(int f, int n); +extern int gotobol(int f, int n); +extern int gotobop(int f, int n); +extern int gotoeob(int f, int n); +extern int gotoeol(int f, int n); +extern int gotoeop(int f, int n); +extern int gotoline(int f, int n); +extern int gotomark(int f, int n); +extern int help(int f, int n); +extern int ifile(char fname[]); +extern int indent(int f, int n); +extern int indent_region(int f, int n); +extern int insbrace(int n, int c); +extern int insfile(int f, int n); +extern int inspound(VOID); +extern int insspace(int f, int n); +extern int inword(VOID); +#if UTF8 +extern int isinword(unsigned int c); +#else +extern int isinword(char c); +#endif +extern int ismodeline(EWINDOW *wp, int row); +extern int istring(int f, int n); +extern int killbuffer(int f, int n); +extern int killpara(int f, int n); +extern int killregion(int f, int n); +extern int killtext(int f, int n); +extern VOID lchange(register int flag); +extern int ldelete(long n, int kflag); +extern VOID lfree(LINE *lp); +#if UTF8 +extern int ldelchar(long n, int kflag); +extern int linsert(int n, unsigned int c); +#else +extern int linsert(int n, char c); +#endif +extern int listbuffers(int f, int n); +extern int list_screens(int f, int n); +extern int lowerregion(int f, int n); +extern int lowerword(int f, int n); +#if UTF8 +extern int lowrite(unsigned int c); +#else +extern int lowrite(int c); +#endif +extern int macarg(char *tok); +extern int macrotokey(int f, int n); +extern int makelist(int iflag); +extern int movelocalpoint(); +extern int undolist(); +extern VOID mouse_screen(VOID); +extern int screenlist(int iflag); +extern int meexit(int status); +extern int uemeta(int f, int n); +extern int mlreply(CONST char *prompt, char *buf, int nbuf); +extern int mlyesno(CONST char *prompt); +extern int mouseoffset(EWINDOW *wp, LINE *lp, int col); +extern int movemd(int f, int n); +extern int movemu(int f, int n); +extern int mregdown(int f, int n); +extern int mmove(int f, int n); +extern int mregup(int f, int n); +extern int mvdnwind(int f, int n); +extern int mvupwind(int f, int n); +extern int namebuffer(int f, int n); +extern int namedcmd(int f, int n); +extern int narrow(int f, int n); +extern int new_line(int f, int n); +extern int new_col_org(int f, int n); +extern int new_row_org(int f, int n); +extern int newsize(int f, int n); +extern int newwidth(int f, int n); +extern int nextarg(CONST char *prompt, char *buffer, int size, int terminator); +extern int nextbuffer(int f, int n); +extern int nextdown(int f, int n); +extern int nextup(int f, int n); +extern int nextwind(int f, int n); +extern int nullproc(int f, int n); +extern int onlywind(int f, int n); +extern int openline(int f, int n); +extern VOID ostring(CONST char *s); +extern VOID outstring(CONST char *s); +extern int ovstring(int f, int n); +extern int pipecmd(int f, int n); +extern int popbuffer(int f, int n); +extern int prevwind(int f, int n); +extern int putctext(char *iline); +extern int putline(int row, int col, char buf[]); +extern int quickexit(int f, int n); +extern int quit(int f, int n); +extern int quote(int f, int n); +extern int rdonly(VOID); +extern int readin(CONST char *fname, int lockfl); +extern int uerefresh(int f, int n); +extern int remmark(int f, int n); +extern int reposition(int f, int n); +extern int resetkey(VOID); +extern int resize(int f, int n); +extern int resizm(int f, int n); +extern int resizm2(int f, int n); +extern int resterr(VOID); +extern int restwnd(int f, int n); +extern int savewnd(int f, int n); +extern int scwrite(int row, char *outstr, int forg, int bacg, int revleft, int revright); -extern int PASCAL NEAR setccol(int pos); -extern int PASCAL NEAR setekey(int f, int n); -extern int PASCAL NEAR setfillcol(int f, int n); -extern int PASCAL NEAR setgmode(int f, int n); -extern int PASCAL NEAR setmark(int f, int n); -extern int PASCAL NEAR setmod(int f, int n); -extern int PASCAL NEAR setwlist(char *wclist); -extern int PASCAL NEAR shellprog(char *cmd); -extern int PASCAL NEAR showcpos(int f, int n); -extern int PASCAL NEAR showfiles(int f, int n); -extern int PASCAL NEAR listkeymaps(int f, int n); -extern int PASCAL NEAR shrinkwind(int f, int n); -extern int PASCAL NEAR spal(char *pstr); -extern int PASCAL NEAR spawn(int f, int n); -extern int PASCAL NEAR spawncli(int f, int n); -extern int PASCAL NEAR splitwind(int f, int n); -extern int PASCAL NEAR startup(char *sfname); -extern int PASCAL NEAR storeproc(int f, int n); -extern int PASCAL NEAR strinc(char *source, char *sub); -extern int PASCAL NEAR swapmark(int f, int n); -extern int PASCAL NEAR swbuffer(BUFFER *bp); -extern int PASCAL NEAR tab(int f, int n); -extern int PASCAL NEAR trim(int f, int n); -extern int PASCAL NEAR ttclose(VOID); -extern int PASCAL NEAR ttflush(VOID); -extern int PASCAL NEAR ttgetc(VOID); -extern int PASCAL NEAR ttopen(VOID); -extern int PASCAL NEAR ttputc(int c); -extern int PASCAL NEAR twiddle(int f, int n); -extern int PASCAL NEAR typahead(VOID); -extern int PASCAL NEAR unarg(VOID); -extern int PASCAL NEAR unbindchar(int c); -extern int PASCAL NEAR unbindkey(int f, int n); -extern int PASCAL NEAR undent_region(int f, int n); -extern int PASCAL NEAR unmark(int f, int n); -extern int PASCAL NEAR upperregion(int f, int n); -extern int PASCAL NEAR upperword(int f, int n); -extern int PASCAL NEAR usebuffer(int f, int n); -extern int PASCAL NEAR viewfile(int f, int n); -extern int PASCAL NEAR vteeol(VOID); -extern int PASCAL NEAR vtmove(int row, int col); -extern int PASCAL NEAR vtputc(int c); -extern int PASCAL NEAR vttidy(VOID); -extern int PASCAL NEAR widen(int f, int n); -extern int PASCAL NEAR wordcount(int f, int n); -extern int PASCAL NEAR wrapword(int f, int n); -extern int PASCAL NEAR writemsg(int f, int n); -extern int PASCAL NEAR writeout(char *fn, char *mode); -extern int PASCAL NEAR zotbuf(BUFFER *bp); -extern unsigned int PASCAL NEAR chcase(register unsigned int ch); -extern unsigned int PASCAL NEAR getckey(int mflag); -extern unsigned int PASCAL NEAR stock(unsigned char *keyname); +extern int setccol(int pos); +extern int setekey(int f, int n); +extern int setfillcol(int f, int n); +extern int setgmode(int f, int n); +extern int setmark(int f, int n); +extern int setmod(int f, int n); +extern int setwlist(char *wclist); +extern int shellprog(char *cmd); +extern int showcpos(int f, int n); +extern int showfiles(int f, int n); +extern int listkeymaps(int f, int n); +extern int shrinkwind(int f, int n); +extern int spal(char *pstr); +extern int spawn(int f, int n); +extern int spawncli(int f, int n); +extern int splitwind(int f, int n); +extern int startup(char *sfname); +extern int storeproc(int f, int n); +extern int strinc(char *source, char *sub); +extern int swapmark(int f, int n); +extern int swbuffer(BUFFER *bp); +extern int uetab(int f, int n); +extern int trim(int f, int n); +extern int ttclose(VOID); +extern int ttflush(VOID); +extern int ttgetc(VOID); +extern int ttopen(VOID); +extern int ttputc(int c); +extern int twiddle(int f, int n); +extern int typahead(VOID); +extern int unarg(VOID); +extern int unbindchar(int c); +extern int unbindkey(int f, int n); +extern int undent_region(int f, int n); +extern int unmark(int f, int n); +extern int upperregion(int f, int n); +extern int upperword(int f, int n); +extern int usebuffer(int f, int n); +extern int viewfile(int f, int n); +extern VOID vteeol(VOID); +extern VOID vtmove(int row, int col); +extern VOID vtputc(int c); +extern VOID vttidy(VOID); +extern int widen(int f, int n); +extern int wordcount(int f, int n); +extern int wrapword(int f, int n); +extern int writemsg(int f, int n); +extern int writeout(char *fn, char *mode); +extern int zotbuf(BUFFER *bp); +extern unsigned int getckey(int mflag); +extern unsigned int stock(unsigned char *keyname); #if VARARG && VARG #if GCC -extern VOID CDECL NEAR mlwrite(va_alist); +extern VOID CDECL mlwrite(va_alist); #else -extern VOID CDECL NEAR mlwrite(va_dcl); +extern VOID CDECL mlwrite(va_dcl); #endif /* GCC */ #else -extern VOID CDECL NEAR mlwrite(char *fmt, ...); +extern VOID CDECL mlwrite(CONST char *fmt, ...); #endif -extern VOID PASCAL NEAR ab_init(VOID); -extern VOID PASCAL NEAR ab_save(char c); -extern VOID PASCAL NEAR ab_expand(VOID); -extern VOID PASCAL NEAR clist_buffer(char *name, int *cpos); -extern VOID PASCAL NEAR clist_command(char *name, int *cpos); -extern VOID PASCAL NEAR clist_file(char *name, int *cpos); -extern VOID PASCAL NEAR comp_buffer(char *name, int *cpos); -extern VOID PASCAL NEAR comp_command(char *name, int *cpos); +extern VOID ab_init(VOID); +extern VOID ab_save(char c); +extern VOID ab_expand(VOID); +extern VOID clist_buffer(char *name, int *cpos); +extern VOID clist_command(char *name, int *cpos); +extern VOID clist_file(char *name, int *cpos); +extern VOID comp_buffer(char *name, int *cpos); +extern VOID comp_command(char *name, int *cpos); #if !WINDOW_MSWIN -extern VOID PASCAL NEAR comp_file(char *name, int *cpos); +extern VOID comp_file(char *name, int *cpos); #endif -extern VOID PASCAL NEAR ecrypt(char *bptr, unsigned len); -extern VOID PASCAL NEAR errormesg(char *mesg, BUFFER *bp, LINE *lp); -extern VOID PASCAL NEAR flong_asc(char buf[], int width, long num); -extern VOID PASCAL NEAR freewhile(WHBLOCK *wp); -extern VOID PASCAL NEAR getdtime(char *ts); -extern VOID PASCAL NEAR initchars(VOID); -extern VOID PASCAL NEAR kdelete(VOID); -extern VOID PASCAL NEAR lowercase(unsigned char *cp); -extern VOID PASCAL NEAR mcclear(VOID); -extern VOID PASCAL NEAR mlabort(char *s); -extern VOID PASCAL NEAR mlerase(VOID); -extern VOID PASCAL NEAR mlferase(VOID); -extern VOID PASCAL NEAR mlforce(char *s); -extern VOID PASCAL NEAR mlout(int c); -extern VOID PASCAL NEAR mlputf(int s); -extern VOID PASCAL NEAR mlputi(int i, int r); -extern VOID PASCAL NEAR mlputli(long l, int r); -extern VOID PASCAL NEAR mlputs(char *s); -extern VOID PASCAL NEAR mlrquery(VOID); -extern VOID PASCAL NEAR modeline(EWINDOW *wp); -extern VOID PASCAL NEAR movecursor(int row, int col); -extern VOID PASCAL NEAR next_kill(VOID); -extern VOID PASCAL NEAR pad(char *s, int len); -extern VOID PASCAL NEAR reeat(int c); -extern VOID PASCAL NEAR reframe(EWINDOW *wp); -extern VOID PASCAL NEAR reform(char *para); -extern VOID PASCAL NEAR rmcclear(VOID); -extern VOID PASCAL NEAR setbit(int bc, EBITMAP cclmap); -extern VOID PASCAL NEAR setjtable(VOID); -extern VOID PASCAL NEAR unbind_buf(BUFFER *bp); -extern VOID PASCAL NEAR unqname(char *name); -extern VOID PASCAL NEAR updall(EWINDOW *wp); -extern VOID PASCAL NEAR update(int force); -extern VOID PASCAL NEAR update_size(VOID); -extern VOID PASCAL NEAR upddex(VOID); -extern VOID PASCAL NEAR updext(VOID); -extern VOID PASCAL NEAR updgar(VOID); -extern VOID PASCAL NEAR updone(EWINDOW *wp); -extern VOID PASCAL NEAR updpos(VOID); -extern VOID PASCAL NEAR updupd(int force); -extern VOID PASCAL NEAR upmode(VOID); -extern VOID PASCAL NEAR uppercase(unsigned char *cp); -extern VOID PASCAL NEAR upwind(VOID); -extern VOID PASCAL NEAR varinit(VOID); -extern VOID PASCAL NEAR varclean(UTABLE *ut); -extern VOID PASCAL NEAR uv_init(UTABLE *ut); -extern VOID PASCAL NEAR uv_clean(UTABLE *ut); -extern VOID PASCAL NEAR vtfree(VOID); +extern VOID ecrypt(char *bptr, unsigned len); +extern VOID errormesg(CONST char *mesg, BUFFER *bp, LINE *lp); +extern VOID flong_asc(char buf[], int width, long num); +extern VOID freewhile(WHBLOCK *wp); +extern VOID getdtime(char *ts); +extern VOID kdelete(VOID); +extern int lowercase(unsigned char *cp); +extern VOID mcclear(VOID); +extern VOID mlabort(CONST char *s); +extern VOID mlerase(VOID); +extern VOID mlferase(VOID); +extern VOID mlforce(CONST char *s); +extern VOID mlout(int c); +extern VOID mlputf(int s); +extern VOID mlputi(int i, int r); +extern VOID mlputli(long l, int r); +extern VOID mlputs(CONST char *s); +extern VOID mlrquery(VOID); +extern VOID modeline(EWINDOW *wp); +extern VOID movecursor(int row, int col); +extern VOID next_kill(VOID); +extern VOID pad(char *s, int len); +extern VOID reeat(int c); +extern VOID reframe(EWINDOW *wp); +extern VOID reform(char *para); +extern VOID rmcclear(VOID); +extern VOID setjtable(VOID); +extern VOID unbind_buf(BUFFER *bp); +extern VOID unqname(char *name); +extern VOID updall(EWINDOW *wp); +extern VOID update(int force); +extern VOID update_size(VOID); +extern VOID upddex(VOID); +extern VOID updext(VOID); +extern VOID updgar(VOID); +extern VOID updone(EWINDOW *wp); +extern VOID updpos(VOID); +extern VOID updupd(int force); +extern VOID upmode(VOID); +extern int uppercase(unsigned char *cp); +extern VOID upwind(VOID); +extern VOID varinit(VOID); +extern VOID varclean(UTABLE *ut); +extern VOID uv_init(UTABLE *ut); +extern VOID uv_clean(UTABLE *ut); +extern VOID vtfree(VOID); extern VOID cook(VOID); extern VOID qin(int ch); extern VOID qrep(int ch); -extern EWINDOW *PASCAL NEAR mousewindow(int row); -extern int PASCAL NEAR wpopup(BUFFER *popbuf); +extern EWINDOW *mousewindow(int row); +extern int wpopup(BUFFER *popbuf); + +#if LIBHELP +extern int lookupword(int f, int n); /* Lookup a word... */ +extern int promptlook(int f, int n); /* Prompt for a word to look up */ +extern int zaphelp(int f, int n); /* Zap help window */ +extern int hlpindex(int f, int n); /* Help index generator */ +extern int hidebuffer(int f, int n); /* Set buffer as invisible */ +extern VOID initlook(char* lf); + +#endif #if CTAGS -extern int PASCAL NEAR tagword(int f, int n); /* vi-like tagging */ -extern int PASCAL NEAR retagword(int f, int n); /* Try again (if redefined) */ -extern int PASCAL NEAR backtagword(int f, int n); /* return from tagged word */ +extern int tagword(int f, int n); /* vi-like tagging */ +extern int retagword(int f, int n); /* Try again (if redefined) */ +extern int backtagword(int f, int n); /* return from tagged word */ +#endif + +#if DYNMSGS +extern VOID msinit(VOID); +#endif + +extern int grabwait(void); +extern int grabnowait(void); + +#if THEOX +#include "theox.h" #endif +extern int getmline(VOID); + +#if MDSLINE +extern unsigned int tosgraph(unsigned int c); +#endif /* some library redefinitions */ #if WINXP == 0 @@ -575,7 +689,11 @@ char *realloc(char *block, int siz); #endif #endif -#else +#if JMDEXT | 1 +extern int notavail(); /* bound to unavailable functions */ +#endif + +#else /* PROTO */ /*** global function declarations ***/ #if CALLED @@ -588,9 +706,9 @@ extern VOID winch_new_size(); #endif #if DEBUG_SEARCH -int PASCAL NEAR mc_list(); -int PASCAL NEAR rmc_list(); -VOID PASCAL NEAR mctype_cat(); +int mc_list(); +int rmc_list(); +VOID mctype_cat(); #endif @@ -598,477 +716,498 @@ extern VOID undo_insert(); extern int undo_op(); extern VOID undo_dump(); extern VOID undo_zot(); -extern int PASCAL NEAR undo(); -extern int PASCAL NEAR undo_delete(); -extern int PASCAL NEAR undo_list(); +extern int undo(); +extern int undo_delete(); +extern int undo_list(); extern VOID *room(); extern VOID *reroom(); -extern int PASCAL NEAR ab_insert(); -extern char *PASCAL NEAR ab_lookup(); -extern int PASCAL NEAR ab_delete(); -extern int PASCAL NEAR ab_clean(); -extern BUFFER *PASCAL NEAR bfind(); -extern BUFFER *PASCAL NEAR getcbuf(); -extern BUFFER *PASCAL NEAR getdefb(); -extern BUFFER *PASCAL NEAR getoldb(); -extern SCREEN *PASCAL NEAR init_screen(); -extern SCREEN *PASCAL NEAR lookup_screen(); -extern SCREEN *PASCAL NEAR index_screen(); -extern int PASCAL NEAR screen_index(); -extern int PASCAL NEAR insert_screen(); -extern int PASCAL NEAR select_screen(); -extern int PASCAL NEAR free_screen(); +extern int ab_insert(); +extern char *ab_lookup(); +extern int ab_delete(); +extern int ab_clean(); +extern BUFFER *bfind(); +extern BUFFER *getcbuf(); +extern BUFFER *getdefb(); +extern BUFFER *getoldb(); +extern ESCREEN *init_screen(); +extern ESCREEN *lookup_screen(); +extern ESCREEN *index_screen(); +extern int screen_index(); +extern int insert_screen(); +extern int select_screen(); +extern VOID free_screen(); extern char *Eallocate(); extern char *dolock(); extern char *getpath(); extern char *gtname(); -extern char *PASCAL NEAR bytecopy(); -extern char *PASCAL NEAR cmdstr(); -extern char *PASCAL NEAR copystr(); -extern char *PASCAL NEAR complete(); -extern char *PASCAL NEAR envval(); -extern char *PASCAL NEAR fixnull(); -extern char *PASCAL NEAR flook(); -extern char *PASCAL NEAR funval(); -extern char *PASCAL NEAR getctext(); -extern char *PASCAL NEAR getffile(); -extern char *PASCAL NEAR getfname(); -extern char *PASCAL NEAR getkill(); -extern char *PASCAL NEAR getnfile(); -extern char *PASCAL NEAR getreg(); -extern char *PASCAL NEAR getval(); -extern char *PASCAL NEAR getwlist(); -extern char *PASCAL NEAR gtenv(); -extern char *PASCAL NEAR gtfilename(); -extern char *PASCAL NEAR gtfun(); -extern char *PASCAL NEAR gtusr(); -extern char *PASCAL NEAR int_asc(); -extern char *PASCAL NEAR long_asc(); -extern char *PASCAL NEAR ltos(); -extern char *PASCAL NEAR makename(); -extern char *PASCAL NEAR mklower(); -extern char *PASCAL NEAR mkupper(); -extern char *PASCAL NEAR namval(); -extern char *PASCAL NEAR timeset(); -extern char *PASCAL NEAR token(); -extern char *PASCAL NEAR transbind(); -extern char *PASCAL NEAR trimstr(); -extern char *PASCAL NEAR xlat(); +extern char *bytecopy(); +extern char *cmdstr(); +extern char *copystr(); +extern char *complete(); +extern char *envval(); +extern CONST char *fixnull(); +extern char *flook(); +extern char *funval(); +extern char *getctext(); +extern char *getffile(); +extern CONST char *getfname(); +extern char *getkill(); +extern char *getnfile(); +extern char *getreg(); +extern CONST char *getval(); +extern char *getwlist(); +extern CONST char *gtenv(); +extern char *gtfilename(); +extern CONST char *gtfun(); +extern char *gtusr(); +extern char *int_asc(); +extern char *long_asc(); +extern CONST char *ltos(); +extern char *makename(); +extern char *mklower(); +extern char *mkupper(); +extern char *namval(); +extern char *timeset(); +extern char *token(); +extern char *transbind(); +extern char *trimstr(); +extern char *xlat(); extern char *undolock(); -extern char *PASCAL NEAR regtostr(); -extern int PASCAL NEAR lowerc(); -extern int PASCAL NEAR upperc(); -extern int (PASCAL NEAR *PASCAL NEAR fncmatch())(); -extern int (PASCAL NEAR *PASCAL NEAR getname())(); -extern int PASCAL NEAR asc_int(); -extern int dolhello(); +extern char *regtostr(); +extern VOID initchars(); +extern int lowerc(); +extern int upperc(); +extern int setlower(); +extern int setupper(); +#if THEOSC +extern int* fncmatch(); +extern int* getname(); +#else +extern int (*fncmatch())(); +extern int (*getname())(); +#endif +extern int asc_int(); +extern VOID dolhello(); extern int dspram(); -extern int lckerror(); -extern int lckhello(); +extern VOID lckerror(); +extern VOID lckhello(); extern int xlock(); extern int lockchk(); extern int lockrel(); -extern int mousehello(); +extern VOID mousehello(); extern int nocrypt(); -extern int PASCAL NEAR absv(); -extern int PASCAL NEAR add_abbrev(); -extern int PASCAL NEAR del_abbrev(); -extern int PASCAL NEAR kill_abbrevs(); -extern int PASCAL NEAR ins_abbrevs(); -extern int PASCAL NEAR def_abbrevs(); -extern int PASCAL NEAR addkey(); -extern int PASCAL NEAR addkeymap(); -extern int PASCAL NEAR addline(); -extern int PASCAL NEAR amatch(); -extern int PASCAL NEAR backhunt(); -extern int PASCAL NEAR backsearch(); -extern int PASCAL NEAR biteq(); -extern int PASCAL NEAR bktoshell(); -extern int PASCAL NEAR boundry(); -extern int PASCAL NEAR cclmake(); -extern int PASCAL NEAR checknext(); -extern int PASCAL NEAR clear_ring(); -extern int PASCAL NEAR cycle_ring(); -extern int PASCAL NEAR delins(); -extern int PASCAL NEAR desfunc(); -extern int PASCAL NEAR dispvar(); -extern int PASCAL NEAR echochar(); -extern int PASCAL NEAR echostring(); -extern int PASCAL NEAR eq(); -extern long PASCAL NEAR ernd(); -extern int PASCAL NEAR execkey(); -extern int PASCAL NEAR fbound(); -extern int PASCAL NEAR fexist(); -extern int PASCAL NEAR findcol(); -extern int PASCAL NEAR fisearch(); +extern int absv(); +extern int add_abbrev(); +extern int del_abbrev(); +extern int kill_abbrevs(); +extern int ins_abbrevs(); +extern int def_abbrevs(); +extern int addkey(); +extern int addkeymap(); +extern int addline(); +extern int amatch(); +extern int backhunt(); +extern int backsearch(); +extern int biteq(); +extern int bktoshell(); +extern int boundry(); +extern int cclmake(); +extern int checknext(); +extern int clear_ring(); +extern int cycle_ring(); +extern int delins(); +extern int desfunc(); +extern int dispvar(); +extern int ueechochar(); +extern int echostring(); +extern int eq(); +extern long ernd(); +extern int execkey(); +extern int fbound(); +extern int fexist(); +extern int findcol(); +extern int fisearch(); #if FLABEL -extern int PASCAL NEAR fnclabel(); +extern int fnclabel(); #endif -extern int PASCAL NEAR forwhunt(); -extern int PASCAL NEAR forwsearch(); -extern int PASCAL NEAR getcwnum(); -extern int PASCAL NEAR getgoal(); -extern int PASCAL NEAR getstring(); -extern int PASCAL NEAR gettwnum(); -extern int PASCAL NEAR gettyp(); -extern int PASCAL NEAR getkey(); -extern int PASCAL NEAR getwpos(); -extern int PASCAL NEAR get_char(); -extern int PASCAL NEAR global_var(); +extern int forwhunt(); +extern int forwsearch(); +extern int getcwnum(); +extern int getgoal(); +extern int getstring(); +extern int gettwnum(); +extern int gettyp(); +extern int getkey(); +extern int getwpos(); +extern int get_char(); +extern int global_var(); #if DBCS -extern int PASCAL NEAR is2byte(); +extern int is2byte(); #endif -extern int PASCAL NEAR is_letter(); -extern int PASCAL NEAR is_lower(); -extern int PASCAL NEAR is_num(); -extern int PASCAL NEAR isearch(); -extern int PASCAL NEAR is_upper(); -extern int PASCAL NEAR kinsert(); -extern int PASCAL NEAR ldelnewline(); -extern int PASCAL NEAR linstr(); -extern int PASCAL NEAR liteq(); -extern int PASCAL NEAR litmake(); -extern int PASCAL NEAR lnewline(); -extern int PASCAL NEAR local_var(); -extern int PASCAL NEAR lookup_color(); -extern int PASCAL NEAR lover(); -extern int PASCAL NEAR mceq(); -extern int PASCAL NEAR mcscanner(); -extern int PASCAL NEAR mcstr(); -extern int PASCAL NEAR mlprompt(); -extern int PASCAL NEAR nextch(); -extern int PASCAL NEAR pop(); -extern int PASCAL NEAR qreplace(); -extern int PASCAL NEAR readpattern(); +extern int is_letter(); +extern int is_lower(); +extern int is_num(); +extern int isearch(); +extern int is_upper(); +extern int kinsert(); +extern int ldelnewline(); +extern int linstr(); +extern int liteq(); +extern int litmake(); +extern int lnewline(); +extern int local_var(); +extern int lookup_color(); +extern int lover(); +extern int mceq(); +extern int mcscanner(); +extern int mcstr(); +extern int mlprompt(); +extern int nextch(); +extern int pop(); +extern int qreplace(); +extern int readpattern(); #if WINDOW_TEXT -extern VOID PASCAL NEAR refresh_screen(); +extern VOID refresh_screen(); #endif -extern int PASCAL NEAR reglines(); -extern int PASCAL NEAR rename_screen(); -extern int PASCAL NEAR replaces(); -extern int PASCAL NEAR risearch(); -extern int PASCAL NEAR rmcstr(); -extern int PASCAL NEAR savematch(); -extern int PASCAL NEAR scanmore(); -extern int PASCAL NEAR scanner(); -extern int PASCAL NEAR setlower(); -extern int PASCAL NEAR setlower(); -extern int PASCAL NEAR setupper(); -extern int PASCAL NEAR setupper(); -extern int PASCAL NEAR setvar(); -extern int PASCAL NEAR sindex(); -extern int PASCAL NEAR sreplace(); -extern int PASCAL NEAR stol(); +extern int reglines(); +extern int rename_screen(); +extern int replaces(); +extern int risearch(); +extern int rmcstr(); +extern int savematch(); +extern int scanmore(); +extern int scanner(); +extern int setvar(); +extern int sindex(); +extern int srindex(); +extern int sreplace(); +extern int stol(); #if DBCS -extern int PASCAL NEAR stopback(); -extern int PASCAL NEAR stopforw(); +extern int stopback(); +extern int stopforw(); #endif -extern int PASCAL NEAR svar(); -extern int PASCAL NEAR tgetc(); -extern int PASCAL NEAR uneat(); -extern int PASCAL NEAR unlist_screen(); -extern int PASCAL NEAR upscreen(); -extern int PASCAL NEAR vtinit(); -extern int PASCAL NEAR yank(); -extern int PASCAL NEAR yank_pop(); +extern int svar(); +extern int tgetc(); +extern int uneat(); +extern VOID unlist_screen(); +extern int upscreen(); +extern int vtinit(); +extern int yank(); +extern int yank_pop(); extern int Erelease(); extern int set_key(); extern int xunlock(); extern KEYTAB *getbind(); -extern LINE *PASCAL NEAR lalloc(); -extern LINE *PASCAL NEAR mouseline(); -extern long PASCAL NEAR getlinenum(); -extern int PASCAL NEAR adjustmode(); -extern int PASCAL NEAR anycb(); -extern int PASCAL NEAR apro(); -extern int PASCAL NEAR backchar(); -extern int PASCAL NEAR backdel(); -extern int PASCAL NEAR backline(); -extern int PASCAL NEAR backpage(); -extern int PASCAL NEAR backword(); -extern int PASCAL NEAR bclear(); -extern int PASCAL NEAR binary(); -extern int PASCAL NEAR bindtokey(); -extern int PASCAL NEAR buildlist(); -extern int PASCAL NEAR capword(); -extern int PASCAL NEAR cex(); -extern int PASCAL NEAR cinsert(); -extern int PASCAL NEAR clean(); -extern int PASCAL NEAR clrmes(); -extern int PASCAL NEAR copyregion(); -extern int PASCAL NEAR ctlxe(); -extern int PASCAL NEAR ctlxlp(); -extern int PASCAL NEAR ctlxrp(); -extern int PASCAL NEAR ctoec(); -extern int PASCAL NEAR ctrlg(); -extern int PASCAL NEAR cycle_screens(); -extern VOID PASCAL NEAR dcline(); -extern int PASCAL NEAR deblank(); -extern int PASCAL NEAR debug(); -extern int PASCAL NEAR delbword(); -extern int PASCAL NEAR delete_screen(); -extern int PASCAL NEAR delfword(); -extern int PASCAL NEAR delgmode(); -extern int PASCAL NEAR delmode(); -extern int PASCAL NEAR delwind(); -extern int PASCAL NEAR desbind(); -extern int PASCAL NEAR desc_abbrevs(); -extern int PASCAL NEAR deskey(); -extern int PASCAL NEAR desvars(); -extern int PASCAL NEAR detab(); -extern int PASCAL NEAR dobuf(); -extern int PASCAL NEAR docmd(); -extern int PASCAL NEAR dofile(); -extern int PASCAL NEAR ectoc(); -extern VOID PASCAL NEAR edinit(); -extern int PASCAL NEAR editloop(); -extern int PASCAL NEAR endword(); -extern int PASCAL NEAR enlargewind(); -extern int PASCAL NEAR entab(); -extern int PASCAL NEAR execbuf(); -extern int PASCAL NEAR execcmd(); -extern int PASCAL NEAR execfile(); -extern int PASCAL NEAR execprg(); -extern int PASCAL NEAR execproc(); -extern int PASCAL NEAR execute(); -extern int PASCAL NEAR ffclose(); -extern int PASCAL NEAR ffgetline(); -extern int PASCAL NEAR ffputline(); -extern int PASCAL NEAR ffropen(); -extern int PASCAL NEAR ffwopen(); -extern int PASCAL NEAR fileapp(); -extern int PASCAL NEAR find_screen(); -extern int PASCAL NEAR filefind(); -extern int PASCAL NEAR filename(); -extern int PASCAL NEAR fileread(); -extern int PASCAL NEAR filesave(); -extern int PASCAL NEAR filewrite(); -extern int PASCAL NEAR fillpara(); -extern int PASCAL NEAR filter(); -extern VOID PASCAL NEAR findvar(); -extern int PASCAL NEAR fmatch(); -extern int PASCAL NEAR forwchar(); -extern int PASCAL NEAR forwdel(); -extern int PASCAL NEAR forwline(); -extern int PASCAL NEAR forwpage(); -extern int PASCAL NEAR forwword(); -extern int PASCAL NEAR getccol(); -extern int PASCAL NEAR getcmd(); -extern int PASCAL NEAR getfence(); -extern int PASCAL NEAR getfile(); -extern int PASCAL NEAR get_key(); -extern int PASCAL NEAR getregion(); -extern int PASCAL NEAR gotobob(); -extern int PASCAL NEAR gotobol(); -extern int PASCAL NEAR gotobop(); -extern int PASCAL NEAR gotoeob(); -extern int PASCAL NEAR gotoeol(); -extern int PASCAL NEAR gotoeop(); -extern int PASCAL NEAR gotoline(); -extern int PASCAL NEAR gotomark(); -extern int PASCAL NEAR help(); -extern int PASCAL NEAR ifile(); -extern int PASCAL NEAR indent(); -extern int PASCAL NEAR indent_region(); -extern int PASCAL NEAR insbrace(); -extern int PASCAL NEAR insfile(); -extern int PASCAL NEAR inspound(); -extern int PASCAL NEAR insspace(); -extern int PASCAL NEAR inword(); -extern int PASCAL NEAR isinword(); -extern int PASCAL NEAR ismodeline(); -extern int PASCAL NEAR istring(); -extern int PASCAL NEAR killbuffer(); -extern int PASCAL NEAR killpara(); -extern int PASCAL NEAR killregion(); -extern int PASCAL NEAR killtext(); -extern int PASCAL NEAR lchange(); -extern int PASCAL NEAR ldelete(); -extern int PASCAL NEAR lfree(); -extern int PASCAL NEAR linsert(); -extern int PASCAL NEAR listbuffers(); -extern int PASCAL NEAR list_screens(); -extern int PASCAL NEAR lowerregion(); -extern int PASCAL NEAR lowerword(); -extern int PASCAL NEAR lowrite(); -extern int PASCAL NEAR macarg(); -extern int PASCAL NEAR macrotokey(); -extern int PASCAL NEAR makelist(); -extern int PASCAL NEAR undolist(); -extern int PASCAL NEAR mouse_screen(); -extern int PASCAL NEAR screenlist(); -extern int PASCAL NEAR meexit(); -extern int PASCAL NEAR meta(); -extern int PASCAL NEAR mlreply(); -extern int PASCAL NEAR mlyesno(); -extern int PASCAL NEAR mouseoffset(); -extern int PASCAL NEAR movemd(); -extern int PASCAL NEAR movemu(); -extern int PASCAL NEAR mregdown(); -extern int PASCAL NEAR mmove(); -extern int PASCAL NEAR mregup(); -extern int PASCAL NEAR mvdnwind(); -extern int PASCAL NEAR mvupwind(); -extern int PASCAL NEAR namebuffer(); -extern int PASCAL NEAR namedcmd(); -extern int PASCAL NEAR narrow(); -extern int PASCAL NEAR newline(); -extern int PASCAL NEAR new_col_org(); -extern int PASCAL NEAR new_row_org(); -extern int PASCAL NEAR newsize(); -extern int PASCAL NEAR newwidth(); -extern int PASCAL NEAR nextarg(); -extern int PASCAL NEAR nextbuffer(); -extern int PASCAL NEAR nextdown(); -extern int PASCAL NEAR nextup(); -extern int PASCAL NEAR nextwind(); -extern int PASCAL NEAR nullproc(); -extern int PASCAL NEAR onlywind(); -extern int PASCAL NEAR openline(); -extern int PASCAL NEAR ostring(); -extern int PASCAL NEAR outstring(); -extern int PASCAL NEAR ovstring(); -extern int PASCAL NEAR pipecmd(); -extern int PASCAL NEAR popbuffer(); -extern int PASCAL NEAR prevwind(); -extern int PASCAL NEAR putctext(); -extern int PASCAL NEAR putline(); -extern int PASCAL NEAR quickexit(); -extern int PASCAL NEAR quit(); -extern int PASCAL NEAR quote(); -extern int PASCAL NEAR rdonly(); -extern int PASCAL NEAR readin(); -extern int PASCAL NEAR refresh(); -extern int PASCAL NEAR remmark(); -extern int PASCAL NEAR reposition(); -extern int PASCAL NEAR resetkey(); -extern int PASCAL NEAR resize(); -extern int PASCAL NEAR resizm(); -extern int PASCAL NEAR resterr(); -extern int PASCAL NEAR restwnd(); -extern int PASCAL NEAR savewnd(); -extern int PASCAL NEAR scwrite(); -extern int PASCAL NEAR setccol(); -extern int PASCAL NEAR setekey(); -extern int PASCAL NEAR setfillcol(); -extern int PASCAL NEAR setgmode(); -extern int PASCAL NEAR setmark(); -extern int PASCAL NEAR setmod(); -extern int PASCAL NEAR setwlist(); -extern int PASCAL NEAR shellprog(); -extern int PASCAL NEAR showfiles(); -extern int PASCAL NEAR listkeymaps(); -extern int PASCAL NEAR showcpos(); -extern int PASCAL NEAR shrinkwind(); -extern int PASCAL NEAR spal(); -extern int PASCAL NEAR spawn(); -extern int PASCAL NEAR spawncli(); -extern int PASCAL NEAR splitwind(); -extern int PASCAL NEAR startup(); -extern int PASCAL NEAR storeproc(); -extern int PASCAL NEAR strinc(); -extern int PASCAL NEAR swapmark(); -extern int PASCAL NEAR swbuffer(); -extern int PASCAL NEAR tab(); -extern int PASCAL NEAR trim(); -extern int PASCAL NEAR ttclose(); -extern int PASCAL NEAR ttflush(); -extern int PASCAL NEAR ttgetc(); -extern int PASCAL NEAR ttopen(); -extern int PASCAL NEAR ttputc(); -extern int PASCAL NEAR twiddle(); -extern int PASCAL NEAR typahead(); -extern int PASCAL NEAR unarg(); -extern int PASCAL NEAR unbindchar(); -extern int PASCAL NEAR unbindkey(); -extern int PASCAL NEAR undent_region(); -extern int PASCAL NEAR unmark(); -extern int PASCAL NEAR upperregion(); -extern int PASCAL NEAR upperword(); -extern int PASCAL NEAR usebuffer(); -extern int PASCAL NEAR viewfile(); -extern int PASCAL NEAR vteeol(); -extern int PASCAL NEAR vtmove(); -extern int PASCAL NEAR vtputc(); -extern int PASCAL NEAR vttidy(); -extern int PASCAL NEAR widen(); -extern int PASCAL NEAR wordcount(); -extern int PASCAL NEAR wrapword(); -extern int PASCAL NEAR writemsg(); -extern int PASCAL NEAR writeout(); -extern int PASCAL NEAR zotbuf(); -extern unsigned int PASCAL NEAR chcase(); -extern unsigned int PASCAL NEAR getckey(); -extern unsigned int PASCAL NEAR stock(); -extern VOID CDECL NEAR mlwrite(); -extern VOID PASCAL NEAR ab_init(); -extern VOID PASCAL NEAR ab_save(); -extern VOID PASCAL NEAR ab_expand(); -extern VOID PASCAL NEAR clist_buffer(); -extern VOID PASCAL NEAR clist_command(); -extern VOID PASCAL NEAR clist_file(); -extern VOID PASCAL NEAR comp_buffer(); -extern VOID PASCAL NEAR comp_command(); -extern VOID PASCAL NEAR comp_file(); -extern VOID PASCAL NEAR ecrypt(); -extern VOID PASCAL NEAR errormesg(); -extern VOID PASCAL NEAR flong_asc(); -extern VOID PASCAL NEAR freewhile(); -extern VOID PASCAL NEAR getdtime(); -extern VOID PASCAL NEAR initchars(); -extern VOID PASCAL NEAR kdelete(); -extern VOID PASCAL NEAR lowercase(); -extern VOID PASCAL NEAR mcclear(); -extern VOID PASCAL NEAR mlabort(); -extern VOID PASCAL NEAR mlerase(); -extern VOID PASCAL NEAR mlferase(); -extern VOID PASCAL NEAR mlforce(); -extern VOID PASCAL NEAR mlout(); -extern VOID PASCAL NEAR mlputf(); -extern VOID PASCAL NEAR mlputi(); -extern VOID PASCAL NEAR mlputli(); -extern VOID PASCAL NEAR mlputs(); -extern VOID PASCAL NEAR mlrquery(); -extern VOID PASCAL NEAR modeline(); -extern VOID PASCAL NEAR movecursor(); -extern VOID PASCAL NEAR next_kill(); -extern VOID PASCAL NEAR pad(); -extern VOID PASCAL NEAR reeat(); -extern VOID PASCAL NEAR reframe(); -extern VOID PASCAL NEAR reform(); -extern VOID PASCAL NEAR rmcclear(); -extern VOID PASCAL NEAR setbit(); -extern VOID PASCAL NEAR setjtable(); -extern VOID PASCAL NEAR unbind_buf(); -extern VOID PASCAL NEAR unqname(); -extern VOID PASCAL NEAR updall(); -extern VOID PASCAL NEAR update(); -extern VOID PASCAL NEAR update_size(); -extern VOID PASCAL NEAR upddex(); -extern VOID PASCAL NEAR updext(); -extern VOID PASCAL NEAR updgar(); -extern VOID PASCAL NEAR updone(); -extern VOID PASCAL NEAR updpos(); -extern VOID PASCAL NEAR upmode(); -extern VOID PASCAL NEAR updupd(); -extern VOID PASCAL NEAR uppercase(); -extern VOID PASCAL NEAR upwind(); -extern VOID PASCAL NEAR varinit(); -extern VOID PASCAL NEAR varclean(); -extern VOID PASCAL NEAR uv_init(); -extern VOID PASCAL NEAR uv_clean(); -extern VOID PASCAL NEAR vtfree(); +extern LINE *lalloc(); +extern LINE *mouseline(); +extern long getlinenum(); +extern int adjustmode(); +extern int anycb(); +extern int apro(); +extern int backchar(); +extern int backdel(); +extern int backline(); +extern int backpage(); +extern int backword(); +extern int bclear(); +extern int binary(); +extern int bindtokey(); +extern int buildlist(); +extern int capword(); +extern int cex(); +extern int cinsert(); +extern int clean(); +extern int clrmes(); +extern int copyregion(); +extern int ctlxe(); +extern int ctlxlp(); +extern int ctlxrp(); +extern int ctoec(); +extern int ctrlg(); +extern int cycle_screens(); +extern VOID dcline(); +extern int deblank(); +extern int debug(); +extern int delbword(); +extern int delete_screen(); +extern int delfword(); +extern int delgmode(); +extern int delmode(); +extern int delwind(); +extern int desbind(); +extern int desc_abbrevs(); +extern int deskey(); +extern int desvars(); +extern int detab(); +extern int dobuf(); +extern int docmd(); +extern int dofile(); +extern int ectoc(); +extern int edinit(); +extern int editloop(); +extern int endword(); +extern int enlargewind(); +extern int entab(); +extern int execbuf(); +extern int execcmd(); +extern int execfile(); +extern int execprg(); +extern int execproc(); +extern int execute(); +extern int ffclose(); +extern int ffgetline(); +extern int ffputline(); +extern int ffropen(); +extern int ffwopen(); +extern int fileapp(); +extern int find_screen(); +extern int filefind(); +extern int filename(); +extern int fileread(); +extern int filesave(); +extern int filewrite(); +extern int fillpara(); +extern int uefilter(); +extern VOID findvar(); +extern int fmatch(); +extern int forwchar(); +extern int forwdel(); +extern int forwline(); +extern int forwpage(); +extern int forwword(); +extern int getccol(); +extern int getcmd(); +extern int getfence(); +extern int getfile(); +extern int get_key(); +extern int getregion(); +extern int gotobob(); +extern int gotobol(); +extern int gotobop(); +extern int gotoeob(); +extern int gotoeol(); +extern int gotoeop(); +extern int gotoline(); +extern int gotomark(); +extern int help(); +extern int ifile(); +extern int indent(); +extern int indent_region(); +extern int insbrace(); +extern int insfile(); +extern int inspound(); +extern int insspace(); +extern int inword(); +extern int isinword(); +extern int ismodeline(); +extern int istring(); +extern int killbuffer(); +extern int killpara(); +extern int killregion(); +extern int killtext(); +extern VOID lchange(); +extern int ldelete(); +extern VOID lfree(); +extern int ldelchar(); +extern int linsert(); +extern int listbuffers(); +extern int list_screens(); +extern int lowerregion(); +extern int lowerword(); +extern int lowrite(); +extern int macarg(); +extern int macrotokey(); +extern int makelist(); +extern int undolist(); +extern VOID mouse_screen(); +extern int screenlist(); +extern int meexit(); +extern int uemeta(); +extern int mlreply(); +extern int mlyesno(); +extern int mouseoffset(); +extern int movemd(); +extern int movemu(); +extern int mregdown(); +extern int mmove(); +extern int mregup(); +extern int mvdnwind(); +extern int mvupwind(); +extern int namebuffer(); +extern int namedcmd(); +extern int narrow(); +extern int new_line(); +extern int new_col_org(); +extern int new_row_org(); +extern int newsize(); +extern int newwidth(); +extern int nextarg(); +extern int nextbuffer(); +extern int nextdown(); +extern int nextup(); +extern int nextwind(); +extern int nullproc(); +extern int onlywind(); +extern int openline(); +extern VOID ostring(); +extern VOID outstring(); +extern int ovstring(); +extern int pipecmd(); +extern int popbuffer(); +extern int prevwind(); +extern int putctext(); +extern int putline(); +extern int quickexit(); +extern int quit(); +extern int quote(); +extern int rdonly(); +extern int readin(); +extern int uerefresh(); +extern int remmark(); +extern int reposition(); +extern int resetkey(); +extern int resize(); +extern int resizm(); +extern int resterr(); +extern int restwnd(); +extern int savewnd(); +extern int scwrite(); +extern int setccol(); +extern int setekey(); +extern int setfillcol(); +extern int setgmode(); +extern int setmark(); +extern int setmod(); +extern int setwlist(); +extern int shellprog(); +extern int showfiles(); +extern int listkeymaps(); +extern int showcpos(); +extern int shrinkwind(); +extern int spal(); +extern int spawn(); +extern int spawncli(); +extern int splitwind(); +extern int startup(); +extern int storeproc(); +extern int strinc(); +extern int swapmark(); +extern int swbuffer(); +extern int uetab(); +extern int trim(); +extern int ttclose(); +extern int ttflush(); +extern int ttgetc(); +extern int ttopen(); +extern int ttputc(); +extern int twiddle(); +extern int typahead(); +extern int unarg(); +extern int unbindchar(); +extern int unbindkey(); +extern int undent_region(); +extern int unmark(); +extern int upperregion(); +extern int upperword(); +extern int usebuffer(); +extern int viewfile(); +extern VOID vteeol(); +extern VOID vtmove(); +extern VOID vtputc(); +extern VOID vttidy(); +extern int widen(); +extern int wordcount(); +extern int wrapword(); +extern int writemsg(); +extern int writeout(); +extern int zotbuf(); +extern unsigned int chcase(); +extern unsigned int getckey(); +extern unsigned int stock(); +extern VOID CDECL mlwrite(); +extern VOID ab_init(); +extern VOID ab_save(); +extern VOID ab_expand(); +extern VOID clist_buffer(); +extern VOID clist_command(); +extern VOID clist_file(); +extern VOID comp_buffer(); +extern VOID comp_command(); +extern VOID comp_file(); +extern VOID ecrypt(); +extern VOID errormesg(); +extern VOID flong_asc(); +extern VOID freewhile(); +extern VOID getdtime(); +extern VOID kdelete(); +extern int lowercase(); +extern VOID mcclear(); +extern VOID mlabort(); +extern VOID mlerase(); +extern VOID mlferase(); +extern VOID mlforce(); +extern VOID mlout(); +extern VOID mlputf(); +extern VOID mlputi(); +extern VOID mlputli(); +extern VOID mlputs(); +extern VOID mlrquery(); +extern VOID modeline(); +extern VOID movecursor(); +extern VOID next_kill(); +extern VOID pad(); +extern VOID reeat(); +extern VOID reframe(); +extern VOID reform(); +extern VOID rmcclear(); +extern VOID setbit(); +extern VOID setjtable(); +extern VOID unbind_buf(); +extern VOID unqname(); +extern VOID updall(); +extern VOID update(); +extern VOID update_size(); +extern VOID upddex(); +extern VOID updext(); +extern VOID updgar(); +extern VOID updone(); +extern VOID updpos(); +extern VOID upmode(); +extern VOID updupd(); +extern int uppercase(); +extern VOID upwind(); +extern VOID varinit(); +extern VOID varclean(); +extern VOID uv_init(); +extern VOID uv_clean(); +extern VOID vtfree(); extern VOID cook(); extern VOID qin(); extern VOID qrep(); -extern EWINDOW *PASCAL NEAR mousewindow(); -extern int PASCAL NEAR wpopup(); +extern EWINDOW *mousewindow(); +extern int wpopup(); #if CTAGS -extern int PASCAL NEAR tagword(); /* vi-like tagging */ -extern int PASCAL NEAR retagword(); /* Try again (if redefined) */ -extern int PASCAL NEAR backtagword(); /* return from tagged word */ +extern int tagword(); /* vi-like tagging */ +extern int retagword(); /* Try again (if redefined) */ +extern int backtagword(); /* return from tagged word */ +#endif + +#if LIBHELP +extern int lookupword(); /* Lookup a word... */ +extern int promptlook(); /* Prompt for a word to look up */ +extern int zaphelp(); /* Zap help window */ +extern int hlpindex(); /* Help index generator */ +extern int hidebuffer(); /* Set buffer as invisible */ +#endif + +#if JMDEXT +extern int notavail(); /* bound to unavailable functions */ +#endif + +#if MDSLINE +extern unsigned int tosgraph(); #endif /* some library redefinitions */ diff --git a/h/estruct.h.template b/h/estruct.h.template new file mode 100644 index 0000000..a27626f --- /dev/null +++ b/h/estruct.h.template @@ -0,0 +1,1377 @@ +/* ESTRUCT: Structure and preprocesser defined for + MicroEMACS 4.01 + + (C)Copyright 1997 by Daniel Lawrence + written by Daniel Lawrence + based on code by Dave G. Conroy, + Steve Wilhite and George Jones +*/ + +#ifdef LATTICE +#undef LATTICE /* don't use their definitions...use ours */ +#endif +#ifdef MSDOS +#undef MSDOS +#endif +#ifdef WINNT +#undef WINNT +#endif +#ifdef AMIGA +#undef AMIGA +#endif +#ifdef EGA +#undef EGA +#endif +#ifdef CTRLZ +#undef CTRLZ +#endif + +/* Program Identification..... + + PROGNAME should always be MicroEMACS for a distribution + unmodified version. People using MicroEMACS as a shell + for other products should change this to reflect their + product. Macros can query this via the $progname variable +*/ + +#define PROGNAME "MicroEMACS" +#define VERSION "5.10" + +/* Machine/OS definitions */ +/* [Set one of these!!] */ + +#define AMIGA 0 /* AmigaDOS */ +#define AOSVS 0 /* Data General AOS/VS */ +#define AUX 0 /* Apple UNIX for Macintosh */ +#define AIX 0 /* IBM UNIX for various machines*/ +#define AVIION 0 /* Data General AViiON */ +#define BSD 0 /* UNIX BSD 4.2 and ULTRIX */ +#define FINDER 0 /* Macintosh OS */ +#define FREEBSD 0 /* FREEBSD 386 version 2 or + */ +#define HPUX8 0 /* HPUX HP 9000 ver 8 or less */ +#define HPUX9 0 /* HPUX HP 9000 ver 9 */ +#define MPE 0 /* HP MPE/XL */ +#define MSDOS 0 /* MS-DOS */ +#define WINNT 0 /* MS-Win NT */ +#define WINXP 0 /* Windows XP/Visual studio 2008*/ +#define OS2 0 /* Microsoft or IBM OS/2 */ +#define SMOS 0 /* Supermax UNIX System V */ +#define SUN 0 /* SUN v4.0 */ +#define TOS 0 /* ST520, TOS */ +#define USG 1 /* UNIX system V */ +#define VMS 0 /* VAX/VMS */ +#define WMCS 0 /* Wicat's MCS */ +#define XENIX 0 /* IBM-PC SCO XENIX */ +#define LINUX 1 /* Linux */ + +#if LINUX +#undef USG +#define USG 1 +#endif +/* Compiler definitions */ +/* [Set one of these!!] */ +#define ALCYON 0 /* ALCYON Atari ST compiler */ +#define AZTEC 0 /* Aztec C 4.00e ONLY for the amiga now... */ +#define DGC 0 /* Data General AOS/VS C... */ +#define GCC 1 /* the GNU C compiler */ +#define IC 0 /* Rational Systems Instant C */ +#define LATTICE 0 /* Lattice 2.14 through 3.0 compilers */ +#define MSC 0 /* MicroSoft C compile version 3 and up */ +#define MWC 0 /* Mark Williams C */ +#define TURBO 0 /* Turbo C and Borland C++ under MSDOS */ +#define UNIX 0 /* a standard UNIX compiler (cc) */ +#define ZTC 0 /* Zortech C/C++ 1.02 thru 2.10 under MSDOS */ + +/* Machine stack growth direction. */ +/* [Set this to 1 if your machine stack grows UP!!!] */ +/* data general mv/eclipse series stack grows up. */ +/* dec vax series stack grows down... got it??? */ + +#define STACK_GROWS_UP 0 + +/* Debugging options */ +#define RAMSIZE 0 /* dynamic RAM memory usage tracking */ +#define RAMSHOW 0 /* auto dynamic RAM reporting */ +#define RAMTRCK 0 /* send debug info to MALLOC.DAT */ +#define DEBUG_SEARCH 0 /* pop some search info on patterns */ + +/* Special keyboard/network definitions */ + +#define ATKBD 0 /* AT-style keyboard with F11, F12 & grey keys */ +#define WANGPC 0 /* WangPC - mostly escape sequences */ +#define VT100 0 /* Handle VT100 style keypad - NOT VMS. */ +#define KEYPAD 0 /* VMS - turn on and off application */ + /* keypad automatically */ +#define XONDATA 0 /* VMS - set to force /NOTTSYNC/NOHOSTSY */ +#define RMSIO 0 /* VMS - skip the rotten C runtime and */ + /* use RMS directly */ +#define OPTMEM 0 /* VMS 5.0 and up - use a less standard */ + /* but more efficient memory allocator */ + +/* Terminal Output definitions */ +/* [Set one of these!!] */ + +#define ANSI 0 /* ANSI escape sequences */ +#define CURSES 0 /* Use CURSES (not complete) */ +#define DASHER 0 /* DG Dasher 2xx/4xx crts */ +#define DG10 0 /* Data General system/10 */ +#define FMR 0 /* Fujitsu FMR series driver */ +#define HP110 0 /* HP110 screen driver */ +#define HP150 0 /* HP150 screen driver */ +#define I55 0 /* IBM PS55 DOS J4.0/V */ +#define IBMPC 0 /* IBM-PC CGA/MONO/EGA/VGA drvr */ +#define MAC 0 /* Macintosh */ +#define NEC 0 /* NEC-9801VM driver */ +#define OS2NPM 0 /* OS/2 non-Presentation Mgr. */ +#define SMG 0 /* SMG library on VMS */ +#define ST52 0 /* Atari 520/1040ST screen */ +#define TERMCAP 1 /* Use TERMCAP */ +#define TIPC 0 /* TI Profesional PC driver */ +#define VT52 0 /* VT52 terminal (Zenith). */ +#define NTCON 0 /* Windows NT console */ +#define XPCON 0 /* windows XP console app */ +#define XVT 0 /* XVT windowing system */ +#define Z309 0 /* Zenith 100 PC family driver */ + +/* Windowing system style (pick one) */ + +#define WINDOW_TEXT 1 /* [default] Text mode */ +#define WINDOW_MSWIN 0 /* MicroSoft Windows */ +#define WINDOW_MSWIN32 0 /* MicroSoft Windows 32 bit API */ +#define WINDOW_X 0 /* X/Unix */ + +/* Language text options (pick one) */ + +#define ENGLISH 1 /* [default] */ +#define FRENCH 0 +#define SPANISH 0 +#define GERMAN 0 +#define DUTCH 0 +#define PLATIN 0 /* Pig Latin */ +#define JAPAN 0 +#define LATIN 0 /* real Latin */ + +/* Configuration options */ + +#define TYPEAH 1 /* type ahead causes update to be skipped */ +#define LOGFLG 0 /* send all executed commands to EMACS.LOG */ +#define VISMAC 0 /* update display during keyboard macros */ +#define CTRLZ 0 /* add a ^Z at end of files under MSDOS only */ +#define CLEAN 0 /* de-alloc memory on exit */ +#define CALLED 0 /* is emacs a called subroutine? or stand alone */ + +#define REVSTA 1 /* Status line appears in reverse video */ +#define COLOR 0 /* color commands and windows */ + +#define FILOCK 0 /* file locking under unix BSD 4.2 */ +#define ISRCH 1 /* Incremental searches like ITS EMACS */ +#define FLABEL 0 /* function key label code [HP150] */ +#define CRYPT 1 /* file encryption enabled? */ +#define MAGIC 1 /* include regular expression matching? */ +#define MOUSE 1 /* Include routines for mouse actions */ +#define NOISY 1 /* Use a fancy BELL if it exists */ +#define CTAGS 1 /* include vi-like tagging? */ +#define SPEECH 0 /* spoken EMACS, for the sight impared [not ready] */ +#define VARARG 1 /* use varargs.h for mlwrite() */ + +#if XVT +#undef COLOR +#define COLOR 1 /* overide this to be TRUE for XVT always */ +#endif + +#define JMDEXT 1 /* enable J-M Dubois extensions */ + +#if JMDEXT +#define BACKUP 1 /* backup previous file version */ +#define LIBHELP 1 /* help des fonctions de la bibliotheque C */ +#define DYNMSGS 1 /* dynamic load of messages */ +#define DYNMSGS 1 /* dynamic load of messages */ +#define THEOX 1 /* allow TheoX character set files edition */ + /* including semi-graphics entry from numeric */ + /* keypad (require UTF8) */ +#endif + +#if DYNMSGS +#define OQUOTE_CHAR 34 +#define CQUOTE_CHAR 34 +#endif + +/* Character set options */ +/* [Set one of these!!] */ +#define ASCII 0 /* use ASCII char sequences */ +#define EBCDIC 0 /* later IBM mainfraim versions will use EBCDIC */ +#define UTF8 1 /* use UTF-8 encoded Unicode */ + +#if UTF8 +#include "utf8.h" +#include +#else +#undef THEOX +#define THEOX 0 +#endif + +/* handle constant and voids properly */ + +#if VMS +#define CONST readonly +#define VOID void +#define NOSHARE noshare +#else +#if AOSVS +#define CONST $shared $align(1) /* fake a const */ +#define VOID +#define NOSHARE $low32k $align(1) /* attempt to optimize read/write vars. */ +#else + +#if __STDC__ || MSC || TURBO || GCC || (AMIGA && LATTICE) +#define CONST const +#define VOID void +#define NOSHARE +#else +#define CONST +#if IC +#define VOID void +#else +#define VOID +#endif +#define NOSHARE +#endif + +#endif +#endif + +/* System dependant library redefinitions, structures and includes */ + +/* multibyte character support? */ + +#if NEC || FMR || I55 +#define DBCS 1 /* double byte character sets enabled */ +#define INSDEL 1 /* use insert/delete line display optimizations */ + +/* define DBCS prefix bytes */ +#define is2char(ch) (((ch&0xff) >= 0x81 && (ch&0xff) <= 0x9f) || ((ch&0xff) >=0xe0 && (ch&0xff) <= 0xfc)) + +#else +#define DBCS 0 +#define INSDEL 0 +#endif + +/* Can we catch the SIGWINCH (the window size change signal)? */ + +#if AIX || HPUX9 || LINUX +#define HANDLE_WINCH 1 +#else +#define HANDLE_WINCH 0 +#endif + +/* Prototypes in use? */ + +#if MSC || TURBO || IC || VMS || GCC || ZTC +#define PROTO 1 +#else +#define PROTO 0 +#endif + +/* the following define allows me to initialize unions... + otherwise we make them structures (like the keybinding table) */ + +#if __STDC__ || MSC || TURBO || IC || ZTC +#define ETYPE union +#else +#define ETYPE struct +#endif + +/* Instant C can't do stat()s. Arrrg. No file locking for you */ +#if IC && MSDOS +#undef FILOCK +#define FILOCK 0 +#endif + +/* Mark Williams/Atari has no standard or varargs or directory functions */ +#if TOS & MWC +#undef VARARG +#define VARARG 0 +#undef FILOCK +#define FILOCK 0 +#endif + +/* MS-Windows */ + +#if WINNT || WINDOW_MSWIN || WINDOW_MSWIN32 +#if WINDOW_MSWIN32 +#undef WINDOW_MSWIN +#define WINDOW_MSWIN 1 +#endif +#if WINDOW_MSWIN && (WINNT || WINXP) +#undef WINDOW_MSWIN32 +#define WINDOW_MSWIN32 1 +#endif +#if 1 +#undef MAC /* Mac conflicts with a definition used by rpc.h */ +#undef VOID /* windows.h will wind up defining this when compiled as a console app */ +#include /* --------- Huge include file here !!! ---------*/ +#ifndef VOID +#define VOID void /* Redefine, incase we are compiled as a Windows app */ +#endif +#endif +#if NTCON +#include +#include +#include +#endif + +#undef NEAR +#define NEAR +#define DNEAR +#if MSC || IC +#undef CDECL +#define CDECL __cdecl +#define DUMMYSZ 1 /* dummy size for unsized extern arrays to avoid + silly DGROUP fixup */ +#else +#if TURBO +#define DUMMYSZ /* nothing */ +#else +#define CDECL _cdecl /* ZTC */ +#define DUMMYSZ /* nothing */ +#endif +#endif + +#if (WINNT || WINXP) && !WINDOW_MSWIN +#define EXPORT /* Windows NT doesn't like this */ +#endif + +#if WINDOW_MSWIN +#undef TYPEAH +#define TYPEAH 0 /* typeahead is handled at the term driver level */ +#undef CALLED +#define CALLED 1 /* under MS Windows, "main" resides in the sys driver */ +#if WINNT || WINXP +#define EXPORT /* Windows NT doesn't like this */ +#elif MSC +#define EXPORT __export +#else +#define EXPORT _export /* Fine for TURBO and ZTC */ +#endif +#endif +#else + +/* neither Windows NT nor MS-Windows */ + +#define DUMMYSZ /* nothing */ + +#if MSDOS & (TURBO | MSC | TIPC) +#define NEAR +#define DNEAR +#define pascal +#define CDECL cdecl +#else +#if MSDOS & ZTC +#define NEAR +#define DNEAR +#define _pascal +#define CDECL _cdecl +#else +#define NEAR +#define DNEAR +#define PASCAL +#define CDECL +#endif +#endif + +#endif + +#if TURBO +#include +#include +#undef peek +#undef poke +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#endif + +#if IC +#include +#undef peek +#undef poke +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#endif + +#if LATTICE & MSDOS +/* you may have to remove this one definition with LATTICE version + 3.2 and above */ +#define unsigned +#endif + +#if IC +#define inp inportb +#define outp outportb +#define intdos(a, b) int86(33, a, b) +#endif + +#if AZTEC +#undef putc +#undef getc +#if MSDOS +#define getc a1getc +#define int86 sysint +#define intdos(a, b) sysint(33, a, b) +#define inp inportb +#define outp outportb +#else +#define getc agetc +#endif +#define putc aputc + +struct XREG { + unsigned ax,bx,cx,dx,si,di,ds,es; +}; + +struct HREG { + char al,ah,bl,bh,cl,ch,dl,dh,d1,d2,e1,e2; +}; + +union REGS { + struct XREG x; + struct HREG h; +}; + +struct SREGS { + unsigned cs, ss, ds, es; +}; +#endif + +#if MSDOS & MWC +#include +#define int86(a, b, c) intcall(b, c, a) +#define intdos(a, b) intcall(a, b, DOSINT) +#define inp(a) in(a) +#define outp(a, b) out(a, b) +#define movmem(a, b, c) memcpy(b, a, c) + +struct XREG { + unsigned int ax,bx,cx,dx,si,di,ds,es,flags; +}; + +struct HREG { + char al,ah,bl,bh,cl,ch,dl,dh; + unsigned int ds,es,flags; +}; + +union REGS { + struct XREG x; + struct HREG h; +}; +#endif + +#if MSDOS & MSC +#include +#include +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#define movmem(a, b, c) memcpy(b, a, c) +#define _strrev(a) strrev(a) +#endif + +#if MSDOS & LATTICE +#undef CPM +#undef LATTICE +#include +#undef CPM +#endif + +/* System V doesn't name this the same as others */ +#if USG | AIX | AUX | SUN | (OS2 & MSC) +#define movmem(a, b, c) memcpy(b, a, c) +#define min(a,b) ((a)>(b)?(b):(a)) +#define max(a,b) ((a)>(b)?(a):(b)) +#endif + +/* this keeps VMS happy */ +#if VMS +#define getname xgetname +#define unlink(a) delete(a) +#endif + +/* some options for AOS/VS */ +#if AOSVS +#define ORMDNI 1 +#endif + +/* define some ability flags */ + +#if (IBMPC | Z309 | FMR | TIPC) & !(WINDOW_MSWIN | WINDOW_MSWIN32) +#define MEMMAP 1 +#else +#define MEMMAP 0 +#endif + +#if MSDOS | WINNT | WINXP | OS2 | USG | AIX | AUX | SMOS | HPUX8 | HPUX9 | BSD | FREEBSD | (TOS & MWC) | WMCS | SUN | MPE +#define ENVFUNC 1 +#else +#define ENVFUNC 0 +#endif + +#if AUX +#define RETCHAR '\n' +#else +#define RETCHAR '\r' +#endif + +#if THEOS +#define _CTYPE_NO_MACRO 1 +#define RET_CHAR '\n' +#else +#define RET_CHAR '\r' +#endif + +#if MPE +#define DIRSEPSTR "." +#define DIRSEPCHAR '.' +#else +#if TOS || MSDOS || WINNT || WINXP || OS2 +#define DIRSEPSTR "\\" +#define DIRSEPCHAR '\\' +#define DRIVESEPCHAR ':' +#else +#define DIRSEPSTR "/" +#define DIRSEPCHAR '/' +#define DRIVESEPCHAR '\0' +#endif +#endif + +#if VARARG +#if (GCC == 0) && (USG || AIX || AUX || BSD || FREEBSD || SUN || XENIX || HPUX8 || HPUX9 || AVIION || MPE) +#define VARG 1 +#define SARG 0 +#include +#else +#define VARG 0 +#define SARG 1 +#include +#endif +#endif + +#if ZTC +#include +#define movmem(a, b, c) memcpy(b, a, c) +#endif + +/* Emacs global flag bit definitions (for gflags) */ + +#define GFREAD 1 /* read first file in at startup */ +#define GFSDRAW 2 /* suppress a screen redraw */ +#define GFEXIT 4 /* exit from emacs pending */ + +/* internal constants */ + +#define NBINDS 300 /* max # of bound keys */ +#if AOSVS | VMS | WINNT | WINXP | SUN | BSD | FREEBSD | USG | ZENIX | HPUX8 | HPUX9 | OS2 +#define NFILEN 256 +#else +#define NFILEN 80 /* # of bytes, file name */ +#endif +#define NBUFN 128 /* # of bytes, buffer name */ +#define NLINE 512 /* # of bytes, input line */ +#define NSTRING 512 /* # of bytes, string buffers */ +#define NKBDM 4096 /* # of strokes, keyboard macro */ +#define NPAT 512 /* # of bytes, pattern */ +#define HUGENUM 1000 /* Huge number */ +#define NLOCKS 256 /* max # of file locks active */ +#define NCOLORS 16 /* number of supported colors */ +#define KBLOCK 250 /* sizeof kill buffer chunks */ +#define NRING 16 /* # of buffers in kill ring */ +#define NBLOCK 16 /* line block chunk size */ +#define NVSIZE 16 /* max #chars in a var name */ +#define NMARKS 16 /* number of marks */ +#define MAXSYM 32 /* max # chars in symbol to expand */ +#define MINFLEN 3 /* min # chars to match &func */ + +#if UTF8 +#define CTRL 0x01000000 /* Control flag, or'ed in */ +#define META 0x02000000 /* Meta flag, or'ed in */ +#define CTLX 0x04000000 /* ^X flag, or'ed in */ +#define SPEC 0x08000000 /* special key (function keys) */ +#define MOUS 0x10000000 /* alternative input device (mouse) */ +#define SHFT 0x20000000 /* shifted (for function keys) */ +#define ALTD 0x40000000 /* ALT key... */ +#define MENU MOUS+SPEC /* menu selection (WINDOW_MSWIN) */ +#define CMSK 0x00FFFFFF /* Character mask */ +#define SHIFTPFX 24 /* prefix shift in unsigned int */ +#else +#define CTRL 0x0100 /* Control flag, or'ed in */ +#define META 0x0200 /* Meta flag, or'ed in */ +#define CTLX 0x0400 /* ^X flag, or'ed in */ +#define SPEC 0x0800 /* special key (function keys) */ +#define MOUS 0x1000 /* alternative input device (mouse) */ +#define SHFT 0x2000 /* shifted (for function keys) */ +#define ALTD 0x4000 /* ALT key... */ +#define MENU MOUS+SPEC /* menu selection (WINDOW_MSWIN) */ +#define CMSK 0x00FF /* Character mask */ +#define SHIFTPFX 8 /* prefix shift in unsigned int */ +#endif + +#define BINDNUL 0 /* not bound to anything */ +#define BINDFNC 1 /* key bound to a function */ +#define BINDBUF 2 /* key bound to a buffer */ + +#ifdef FALSE +#undef FALSE +#endif +#ifdef TRUE +#undef TRUE +#endif + +#define FALSE 0 /* False, no, bad, etc. */ +#define TRUE 1 /* True, yes, good, etc. */ +#define ABORT 2 /* Death, ^G, abort, etc. */ +#define FAILD 3 /* not-quite fatal false return */ + +#define STOP 0 /* keyboard macro not in use */ +#define PLAY 1 /* playing */ +#define RECORD 2 /* recording */ + +/* Completion types */ + +#define CMP_BUFFER 0 +#define CMP_COMMAND 1 +#define CMP_FILENAME 2 + +/* Directive definitions */ + +#define DIF 0 +#define DELSE 1 +#define DENDIF 2 +#define DGOTO 3 +#define DRETURN 4 +#define DENDM 5 +#define DWHILE 6 +#define DENDWHILE 7 +#define DBREAK 8 +#define DFORCE 9 + +#define NUMDIRS 10 + +/* + * PTBEG, PTEND, FORWARD, and REVERSE are all toggle-able values for + * routines that need directions. + */ +#define PTBEG 0 /* Leave the point at the beginning on search */ +#define PTEND 1 /* Leave the point at the end on search */ +#define FORWARD 0 /* do things in a forward direction */ +#define REVERSE 1 /* do things in a backwards direction */ + +#define FIOSUC 0 /* File I/O, success. */ +#define FIOFNF 1 /* File I/O, file not found. */ +#define FIOEOF 2 /* File I/O, end of file. */ +#define FIOERR 3 /* File I/O, error. */ +#define FIOMEM 4 /* File I/O, out of memory */ +#define FIOFUN 5 /* File I/O, eod of file/bad line*/ +#define FIODEL 6 /* Can't delete/rename file */ + +#if WINDOW_MSWIN +/* values for the fbusy flag */ +#define FREADING 1 /* file read in progress */ +#define FWRITING 2 /* file write in progress */ +/* if no file activity, the value FALSE is used */ +#endif + +#define CFCPCN 0x0001 /* Last command was C-P, C-N */ +#define CFKILL 0x0002 /* Last command was a kill */ +#define CFSRCH 0x0004 /* last command was a search */ +#define CFYANK 0x0008 /* last command was a yank */ + +#define SRNORM 0 /* end past, begin front */ +#define SRBEGIN 1 /* always at front */ +#define SREND 2 /* always one past end */ + +#define BELL 0x07 /* a bell character */ +#define TAB 0x09 /* a tab character */ + +#if USG | AIX | AUX | SMOS | HPUX8 | HPUX9 | BSD | FREEBSD | SUN | XENIX | AVIION +#define PATHCHR ':' +#else +#if WMCS || MPE +#define PATHCHR ',' +#else +#define PATHCHR ';' +#endif +#endif + +#define INTWIDTH sizeof(int) * 3 +#define LONGWIDTH sizeof(long) * 3 + +/* Macro argument token types */ + +#define TKNUL 0 /* end-of-string */ +#define TKARG 1 /* interactive argument */ +#define TKBUF 2 /* buffer argument */ +#define TKVAR 3 /* user variables */ +#define TKENV 4 /* environment variables */ +#define TKFUN 5 /* function.... */ +#define TKDIR 6 /* directive */ +#define TKLBL 7 /* line label */ +#define TKLIT 8 /* numeric literal */ +#define TKSTR 9 /* quoted string literal */ +#define TKCMD 10 /* command name */ + +/* Internal defined functions */ + +#define nextab(a) (a - (a % tabsize)) + tabsize + +/* DIFCASE represents the integer difference between upper + and lower case letters. It is an xor-able value, which is + fortunate, since the relative positions of upper to lower + case letters is the opposite of ascii in ebcdic. +*/ + +#if ASCII +#define DIFCASE 0x20 +#else +#define DIFCASE 0x40 +#endif + +/* Dynamic RAM tracking and reporting redefinitions */ + +#if RAMSIZE +#define malloc Eallocate +#define free Erelease +#else +#if VMS & OPTMEM +#define malloc VAXC$MALLOC_OPT +#define free VAXC$FREE_OPT +#define calloc VAXC$CALLOC_OPT +#define realloc VAXC$REALLOC_OPT +#define cfree VAXC$CFREE_OPT +#endif +#endif + +/* under MS Windows, we use dialog boxes to prompt the user for filenames */ +#if WINDOW_MSWIN +#define FILENAMEREPLY(p,b,nb) filenamedlg(p,b,nb,TRUE) +#else +#define FILENAMEREPLY(p,b,nb) mlreply(p,b,nb) +#endif + +/* colors respresented as parameters to WORDs and Screen positions */ + +#define CLRVAL unsigned int + +/* formal parameters to procedures are stored as a linked list + of argument names using the following simple structure: +*/ + +typedef struct PARG { + struct PARG *next; /* ptr to next linked argument */ + char name[NVSIZE+1]; /* name of the argument */ +} PARG; + +/* UNDO definitions and types */ + +typedef int OPTYPE; /* type of operation being recorded/played back */ + +#define OP_CMND 1 /* beginning of command */ +#define OP_DELC 2 /* delete a single character */ +#define OP_INSC 3 /* insert a single character */ +#define OP_DSTR 4 /* delete a string of characters */ +#define OP_ISTR 5 /* insert a string of characters */ +#define OP_REPC 6 /* replace a character */ +#define OP_CPOS 7 /* set the cursor position */ + +/* object to be undone! */ + +typedef union OBJECT { + char obj_char; /* a character */ + char obj_string[1]; /* many characters */ + char *obj_sptr; /* a ptr to a character */ +} OBJECT; + +typedef struct UNDO_OBJ { + struct UNDO_OBJ *next; /* ptr to next undo object */ + OPTYPE type; /* type of operation */ + long line_num; /* line offset from buffer beginning */ + int offset; /* offset into that line */ + long count; /* repetitions? */ + OBJECT undo_obj; /* object to be undone */ +} UNDO_OBJ; + +/* + * There is a window structure allocated for every active display window. The + * windows are kept in a big list, in top to bottom screen order, with the + * listhead at "wheadp". Each window contains its own values of dot and mark. + * The flag field contains some bits that are set by commands to guide + * redisplay. Although this is a bit of a compromise in terms of decoupling, + * the full blown redisplay is just too expensive to run for every input + * character. + */ +typedef struct EWINDOW { + struct EWINDOW *w_wndp; /* Next window */ + struct BUFFER *w_bufp; /* Buffer displayed in window */ + struct LINE *w_linep; /* Top line in the window */ + struct LINE *w_dotp; /* Line containing "." */ + short w_doto; /* Byte offset for "." */ + struct LINE *w_markp[NMARKS]; /* Line containing "mark" */ + short w_marko[NMARKS]; /* Byte offset for "mark" */ + char w_toprow; /* Origin 0 top row of window */ + char w_ntrows; /* # of rows of text in window */ + char w_force; /* If NZ, forcing row. */ + char w_flag; /* Flags. */ +#if COLOR + char w_fcolor; /* current forground color */ + char w_bcolor; /* current background color */ +#endif + int w_fcol; /* first column displayed */ +} EWINDOW; + +#define WFFORCE 0x01 /* Window needs forced reframe */ +#define WFMOVE 0x02 /* Movement from line to line */ +#define WFEDIT 0x04 /* Editing within a line */ +#define WFHARD 0x08 /* Better to a full display */ +#define WFMODE 0x10 /* Update mode line. */ +#define WFCOLR 0x20 /* Needs a color change */ + +/* This structure holds the information about each line appearing on the + * video display. The redisplay module uses an array of virtual display + * lines. On systems that do not have direct access to display memory, + * there is also an array of physical display lines used to minimize + * video updating. In most cases, these two arrays are unique. If + * WINDOW_MSWIN is 1, there is a pair of such arrays in each ESCREEN + * structure. + */ + +typedef struct VIDEO { + int v_flag; /* Flags */ +#if COLOR + int v_fcolor; /* current forground color */ + int v_bcolor; /* current background color */ + int v_rfcolor; /* requested forground color */ + int v_rbcolor; /* requested background color */ +#endif + int v_left; /* left edge of reverse video */ + int v_right; /* right right of reverse video */ +#if INSDEL && MEMMAP == 0 + int v_rline; /* requested screen line # */ +#endif +#if UTF8 + unsigned int v_text[1]; /* Screen data. */ +#else + char v_text[1]; /* Screen data. */ +#endif +} VIDEO; + +#define VFNEW 0x0001 /* contents not meaningful yet */ +#define VFCHG 0x0002 /* Changed flag */ +#define VFEXT 0x0004 /* extended (beyond column 80) */ +#define VFREV 0x0008 /* reverse video status */ +#define VFREQ 0x0010 /* reverse video request */ +#define VFCOL 0x0020 /* color change requested */ + +/* + * This structure holds the information about each separate "screen" + * within the current editing session. On a character based system, these + * screens overlay each other, and can individually be brought to front. + * On a windowing system like MicroSoft Windows 3.0, OS/2, the Macintosh, + * Intuition, Sunview or X-windows, each screen is represented in an OS + * window. The terminolgy is wrong in emacs..... + * + * EMACS The outside World + * screen window + * window pane + */ + +typedef struct ESCREEN { + struct ESCREEN *s_next_screen; /* link to next screen in list */ + EWINDOW *s_first_window; /* head of linked list of windows */ + EWINDOW *s_cur_window; /* current window in this screen */ + char *s_screen_name; /* name of the current window */ + short s_roworg; /* row origin of stored screen */ + short s_colorg; /* column origin of stored screen */ + short s_nrow; /* row width of stored screen */ + short s_ncol; /* column origin of stored screen */ +#if WINDOW_MSWIN + VIDEO **s_virtual; /* virtual screen contents */ + VIDEO **s_physical; /* physical screen contents */ + HWND s_drvhandle; /* handle for the "term" driver */ +#endif +} ESCREEN; + +/* + * Text is kept in buffers. A buffer header, described below, exists for every + * buffer in the system. The buffers are kept in a big list, so that commands + * that search for a buffer by name can find the buffer header. There is a + * safe store for the dot and mark in the header, but this is only valid if + * the buffer is not being displayed (that is, if "b_nwnd" is 0). The text for + * the buffer is kept in a circularly linked list of lines, with a pointer to + * the header line in "b_linep". Buffers may be "Inactive" which means the + * files associated with them have not been read in yet. These get read in + * at "use buffer" time. + * Some buffers are really procedures and have a little extra information + * stored with them. + */ +typedef struct BUFFER { + struct BUFFER *b_bufp; /* Link to next BUFFER */ + struct LINE *b_dotp; /* Link to "." LINE structure */ + short b_doto; /* Offset of "." in above LINE */ + struct LINE *b_markp[NMARKS]; /* The same as the above two, */ + short b_marko[NMARKS]; /* but for the "mark" */ + int b_fcol; /* first column to display */ + struct LINE *b_linep; /* Link to the header LINE */ + struct LINE *b_topline; /* Link to narrowed top text */ + struct LINE *b_botline; /* Link to narrowed bottom text */ + char b_active; /* window activated flag */ + char b_nwnd; /* Count of windows on buffer */ + char b_exec; /* how many active executions */ + char b_flag; /* Flags */ + int b_mode; /* editor mode of this buffer */ + char b_fname[NFILEN]; /* File name */ + char b_bname[NBUFN]; /* Buffer name */ +#if CRYPT + char b_key[NPAT]; /* current encrypted key */ +#endif + int b_numargs; /* number of arguments to procedure */ + PARG *b_args; /* ptr to the first argument */ + UNDO_OBJ *undo_head; /* head of undo stack for buffer */ + long undo_count; /* # of undo operations stacked */ + long last_access; /* time of last access */ +#if UTF8 + short b_charset; /* character set */ +#endif +} BUFFER; + +#define BFINVS 0x01 /* Internal invisible buffer */ +#define BFCHG 0x02 /* Changed since last write */ +#define BFTRUNC 0x04 /* buffer was truncated when read */ +#define BFNAROW 0x08 /* buffer has been narrowed */ +#if LIBHELP +#define BFERROR 0x40 /* Error file buffer */ +#define BFHELP 0x80 /* Buffer is a help buffer */ +#endif + +#define NOTPROC -1 /* buffer is not a procedure */ + +/* mode flags */ +#if THEOX +#define NUMMODES 16 /* # of defined modes */ +#elif JMDEXT +#define NUMMODES 14 /* # of defined modes */ +#else +#define NUMMODES 11 /* # of defined modes */ +#endif + +#define MDWRAP 0x0001 /* word wrap */ +#define MDCMOD 0x0002 /* C indentation and fence match*/ +#define MDSPELL 0x0004 /* spell error parsing */ +#define MDEXACT 0x0008 /* Exact matching for searches */ +#define MDVIEW 0x0010 /* read-only buffer */ +#define MDOVER 0x0020 /* overwrite mode */ +#define MDMAGIC 0x0040 /* regular expressions in search */ +#define MDCRYPT 0x0080 /* encryption mode active */ +#define MDASAVE 0x0100 /* auto-save mode */ +#define MDREPL 0x0200 /* replace mode */ +#define MDABBR 0x0400 /* abbreviation expansion mode */ +#if JMDEXT +#define MDNOBAK 0x0800 /* no auto backup */ +#define MDSLINE 0x1000 /* single line graphics */ +#define MDDLINE 0x2000 /* double line graphics */ +#if THEOX +#define MDTHEOX 0x4000 /* TheoX character set file */ +#define MDUTF8 0x8000 /* UTF-8 character set file */ +#endif +#endif + +/* + * The starting position of a region, and the size of the region in + * characters, is kept in a region structure. Used by the region commands. + */ +typedef struct { + struct LINE *r_linep; /* Origin LINE address. */ + short r_offset; /* Origin LINE offset. */ + long r_size; /* Length in characters. */ +} REGION; + +/* + * All text is kept in circularly linked lists of "LINE" structures. These + * begin at the header line (which is the blank line beyond the end of the + * buffer). This line is pointed to by the "BUFFER". Each line contains a the + * number of bytes in the line (the "used" size), the size of the text array, + * and the text. The end of line is not stored as a byte; it's implied. + */ +typedef struct LINE { + struct LINE *l_fp; /* Link to the next line */ + struct LINE *l_bp; /* Link to the previous line */ + short l_size; /* Allocated size */ + short l_used; /* Used size */ + char l_text[1]; /* A bunch of characters. */ +} LINE; + +#define lforw(lp) ((lp)->l_fp) +#define lback(lp) ((lp)->l_bp) +#if UNIX && (SUN || HPUX8 || HPUX9 || BSD || FREEBSD) +#define lgetc(lp, n) ((unsigned char)(lp)->l_text[(n)]) +#else +#define lgetc(lp, n) ((lp)->l_text[(n)]) +#endif +#define lputc(lp, n, c) ((lp)->l_text[(n)]=(c)) +#define lused(lp) ((lp)->l_used) +#define lsize(lp) ((lp)->l_size) +#define ltext(lp) ((lp)->l_text) + +/* This structure is used to hold a user variables name and its + current value. These are used for both the global and the + local symbol tables. +*/ + +typedef struct UVAR { + char u_name[NVSIZE + 1]; /* name of user variable */ + char *u_value; /* value (string) */ +} UVAR; + +#define VT_NONE 0 /* don't declare it if not found */ +#define VT_LOCAL 1 /* local to the current procedure */ +#define VT_GLOBAL 2 /* global to all procedures */ + +/* A UTABLE is a user variable table.... containing some header + information and an array of user variable names and definitions. + They are held together in a linked list, the last member of + the list being the global user variable table. +*/ + +typedef struct UTABLE { + struct UTABLE *next; /* ptr to next user variable table */ + int size; /* max number of variables in table */ + BUFFER *bufp; /* ptr to buffer holding procedure + assosiated with this symbol table. */ + UVAR uv[1]; /* list of variable names/definitions + in this variable table */ +} UTABLE; + +/* + * The editor communicates with the display using a high level interface. A + * "TERM" structure holds useful variables, and indirect pointers to routines + * that do useful operations. The low level get and put routines are here too. + * This lets a terminal, in addition to having non standard commands, have + * funny get and put character code too. The calls might get changed to + * "termp->t_field" style in the future, to make it possible to run more than + * one terminal type. + */ +#if PROTO +typedef struct { + short t_mrow; /* max number of rows allowable */ + short t_nrow; /* current number of rows used */ + short t_mcol; /* max Number of columns. */ + short t_ncol; /* current Number of columns. */ + short t_roworg; /* origin row (normally zero) */ + short t_colorg; /* origin column (normally zero)*/ + short t_margin; /* min margin for extended lines*/ + short t_scrsiz; /* size of scroll region " */ + int t_pause; /* # times thru update to pause */ + int (*t_open)(void); /* Open terminal at the start.*/ + int (*t_close)(void); /* Close terminal at end. */ + int (*t_kopen)(void); /* Open keyboard */ + int (*t_kclose)(void); /* Close keyboard */ + int (*t_getchar)(void); /* Get character from keyboard. */ + int (*t_putchar)(int); /* Put character to display.*/ + int (*t_flush)(void); /* Flush output buffers. */ + int (*t_move)(int, int);/* Move the cursor, origin 0.*/ + int (*t_eeol)(void); /* Erase to end of line. */ + int (*t_eeop)(void); /* Erase to end of page. */ + int (*t_clrdesk)(void); /* Clear the page totally */ + int (*t_beep)(void); /* Beep. */ + int (*t_rev)(int); /* set reverse video state */ + int (*t_rez)(char *); /* change screen resolution */ +#if COLOR + int (*t_setfor)(int); /* set forground color */ + int (*t_setback)(int); /* set background color */ +#endif +#if INSDEL + int (*t_insline)(int); /* insert a screen line */ + int (*t_delline)(int); /* delete a screen line */ +#endif +#if WINDOW_MSWIN + int (*t_sleep)(int); /* go to sleep for a while */ + int (*t_newscr)(ESCREEN *); /* create new screen display */ + int (*t_delscr)(ESCREEN *); /* destroy screen display */ + int (*t_selscr)(ESCREEN *); /* select screen display */ + int (*t_sizscr)(ESCREEN *); /* resize screen display */ + int (*t_topscr)(ESCREEN *); /* bring screen to top */ +#endif +} TERM; +#else /* TERM structure, no prototyping.*/ + +typedef struct { + short t_mrow; /* max number of rows allowable */ + short t_nrow; /* current number of rows used */ + short t_mcol; /* max Number of columns. */ + short t_ncol; /* current Number of columns. */ + short t_roworg; /* origin row (normally zero) */ + short t_colorg; /* origin column (normally zero)*/ + short t_margin; /* min margin for extended lines*/ + short t_scrsiz; /* size of scroll region " */ + int t_pause; /* # times thru update to pause */ + int (*t_open)(); /* Open terminal at the start. */ + int (*t_close)(); /* Close terminal at end. */ + int (*t_kopen)(); /* Open keyboard */ + int (*t_kclose)(); /* close keyboard */ + int (*t_getchar)(); /* Get character from keyboard. */ + int (*t_putchar)(); /* Put character to display. */ + int (*t_flush)(); /* Flush output buffers. */ + int (*t_move)(); /* Move the cursor, origin 0. */ + int (*t_eeol)(); /* Erase to end of line. */ + int (*t_eeop)(); /* Erase to end of page. */ + int (*t_clrdesk)(); /* Clear the page totally */ + int (*t_beep)(); /* Beep. */ + int (*t_rev)(); /* set reverse video state */ + int (*t_rez)(); /* change screen resolution */ +#if COLOR + int (*t_setfor)(); /* set forground color */ + int (*t_setback)(); /* set background color */ +#endif +#if INSDEL + int (*t_insline)(); /* insert a screen line */ + int (*t_delline)(); /* delete a screen line */ +#endif +#if WINDOW_MSWIN + int (*t_sleep)(); /* go to sleep for a while */ + int (*t_newscr)(); /* create new screen display */ + int (*t_delscr)(); /* destroy screen display */ + int (*t_selscr)(); /* select screen display */ + int (*t_sizscr)(); /* resize screen display */ + int (*t_topscr)(); /* bring screen to top */ +#endif +} TERM; +#endif + + +/* TEMPORARY macros for terminal I/O (to be placed in a machine + dependant place later) */ + +#define TTopen (*term.t_open) +#define TTclose (*term.t_close) +#define TTkopen (*term.t_kopen) +#define TTkclose (*term.t_kclose) +#define TTgetc (*term.t_getchar) +#define TTputc (*term.t_putchar) +#define TTflush (*term.t_flush) +#define TTmove (*term.t_move) +#define TTeeol (*term.t_eeol) +#define TTeeop (*term.t_eeop) +#define TTclrdesk (*term.t_clrdesk) +#define TTbeep (*term.t_beep) +#define TTrev (*term.t_rev) +#define TTrez (*term.t_rez) +#if COLOR +#define TTforg (*term.t_setfor) +#define TTbacg (*term.t_setback) +#endif + +/* Structure for the table of current key bindings */ + +ETYPE EPOINTER { + int (*fp)(); /* C routine to invoke */ + BUFFER *buf; /* buffer to execute */ +}; + +typedef struct { +#if UTF8 + unsigned int k_code; /* Key code */ +#else + short k_code; /* Key code */ +#endif + short k_type; /* binding type (C function or EMACS buffer) */ + ETYPE EPOINTER k_ptr; /* ptr to thing to execute */ +} KEYTAB; + +/* structure for the name binding table */ + +typedef struct { + char *n_name; /* name of function key */ + int (*n_func)(); /* function name is bound to */ +} NBIND; + +/* The editor holds deleted text chunks in the KILL buffer. The + kill buffer is logically a stream of ascii characters, however + due to its unpredicatable size, it gets implemented as a linked + list of chunks. (The d_ prefix is for "deleted" text, as k_ + was taken up by the keycode structure) +*/ + +typedef struct KILL { + struct KILL *d_next; /* link to next chunk, NULL if last */ + char d_chunk[KBLOCK]; /* deleted text */ +} KILL; + +/* When emacs's command interpetor needs to get a variable's name, + rather than it's value, it is passed back as a VDESC variable + description structure. The v_num field is a index into the + appropriate variable table. +*/ + +typedef struct VDESC { + int v_type; /* type of variable */ + int v_num; /* ordinal pointer to variable in list */ + UTABLE *v_ut; /* ptr to appropriate user table if user var */ +} VDESC; + +/* The !WHILE directive in the execution language needs to + stack references to pending whiles. These are stored linked + to each currently open procedure via a linked list of + the following structure +*/ + +typedef struct WHBLOCK { + LINE *w_begin; /* ptr to !while statement */ + LINE *w_end; /* ptr to the !endwhile statement*/ + int w_type; /* block type */ + struct WHBLOCK *w_next; /* next while */ +} WHBLOCK; + +#define BTWHILE 1 +#define BTBREAK 2 + +/* SWORDs are syntactical words to highlight in a different + foreground color. WORDSETs are named lists of these WORDs. +*/ + +typedef struct SWORD { + struct SWORD *wd_next; /* ptr to the next word in the list */ + char *wd_text; /* the actual word */ + CLRVAL wd_color; /* color to display in */ + int wd_symflag; /* TRUE = symbol overiding word boundries + FALSE = word w/ space/symbol delimiters */ +} SWORD; + +typedef struct WORDSET { + struct WORDSET *next; + int tmp; +} WORDSET; + +/* Abbreviations are short symbols that expand to longer strings + when typed into a buffer with no intervening whitespace or commands. + This structure grows dynamically as needed. +*/ + +typedef struct ABBREV { + struct ABBREV *ab_next; /* pointer to the next abbreviation */ + char ab_sym[MAXSYM + 1]; /* name to expand */ + char ab_exp[1]; /* string to expand to */ +} ABBREV; + +/* Search definitions... */ + +/* HICHAR - 1 is the largest character we will deal with. + * BMAPSIZE represents the number of bytes in the bitmap. + */ +#if UTF8 +#define HICHAR 65536 +#else +#define HICHAR 256 +#endif +#define BMAPSIZE HICHAR >> 3 + +/* + * Jump table structures. + */ +typedef struct { + int jump; + int patlen; + int delta[HICHAR]; + char patrn[NPAT]; +} DELTA; + +#if MAGIC +/* + * Defines for the metacharacters in the regular expression + * search routines. MCNIL and GROUP are used in both search + * and replace metachar-arrays. + */ +#define MCNIL 0 /* Like the '\0' for strings.*/ +#define JMPTABLE 1 +#define LITSTRING 2 /* Literal string.*/ +#define LITCHAR 3 /* Literal character.*/ +#define ANY 4 /* Any character but the .*/ +#define CCL 5 +#define NCCL 6 +#define BOL 7 +#define EOL 8 +#define BOWRD 9 +#define EOWRD 10 +#define GRPBEG 11 /* Signal start of group.*/ +#define GRPEND 12 /* Signal end of group.*/ +#define GROUP 13 /* String of group match.*/ +#define DITTO 14 /* Replacement with match string.*/ + +#define CLOSURE 0x0100 /* An or-able value for a closure modifier.*/ +#define CLOSURE_1 0x0200 /* An or-able value for a closure modifier.*/ +#define ZEROONE 0x0400 /* An or-able value for a closure modifier.*/ + +#define ALLCLOS (CLOSURE | CLOSURE_1 | ZEROONE) +#define MASKCLO (~ALLCLOS) + +#define MC_ANY '.' /* 'Any' character (except newline).*/ +#define MC_CCL '[' /* Character class.*/ +#define MC_NCCL '^' /* Negate character class.*/ +#define MC_RCCL '-' /* Range in character class.*/ +#define MC_ECCL ']' /* End of character class.*/ +#define MC_BOL '^' /* Beginning of line.*/ +#define MC_EOL '$' /* End of line.*/ +#define MC_CLOSURE '*' /* Closure - zero to many characters match.*/ +#define MC_CLOSURE_1 '+' /* Closure - one to many characters match.*/ +#define MC_ZEROONE '?' /* Closure - zero to one characters match.*/ +#define MC_DITTO '&' /* Use matched string in replacement.*/ +#define MC_GRPBEG '(' /* Start of group (begun with a backslash).*/ +#define MC_GRPEND ')' /* End of group (begun with a backslash).*/ +#define MC_BOWRD '<' /* Beginning of word (begun with a backslash).*/ +#define MC_EOWRD '>' /* End of word (begun with a backslash).*/ +#define MC_ESC '\\' /* Escape - suppress meta-meaning.*/ + +#define MAXGROUPS 10 /* 1 + maximum # of r. e. groups. */ +#define BIT(n) (1 << (n)) /* An integer with one bit set.*/ + +/* Typedefs that define the bitmap type for searching (EBITMAP), + * the meta-character structure for MAGIC mode searching (MC), + * and the meta-character structure for MAGIC mode replacment (RMC). + */ +typedef char *EBITMAP; + +typedef struct { + short int mc_type; + union { + int lchar; + int group_no; + char *lstring; + DELTA *jmptable; + EBITMAP cclmap; + } u; +} MC; + +typedef struct { + short int mc_type; + union { + int group_no; + char *rstr; + } u; +} RMC; +#endif + +/* + This is the message which should be added to any "About MicroEMACS" + boxes on any of the machines with window managers. + + + ------------------------------------------ + | | + | MicroEMACS v4.xx | + | for the ............ | + | | + | Text Editor and Corrector | + | | + | written by Daniel M. Lawrence | + | [based on code by Dave Conroy] | + | | + | Send inquiries and donations to: | + | 617 New York St | + | Lafayette, IN 47901 | + | | + ------------------------------------------ +*/ diff --git a/h/evar.h b/h/evar.h index 6cf1053..15fc081 100644 --- a/h/evar.h +++ b/h/evar.h @@ -4,48 +4,51 @@ written 1993 by Daniel Lawrence */ -#define MAXVARS 512 /* Maximum number of global user variables */ +#define MAXVARS 512 /* Maximum number of global user variables */ /* list of recognized environment variables */ NOSHARE char *envars[] = { "abbell", /* ring bell on abbreviation expansion? */ - "abcap", /* match capitolization in expansions */ + "abcap", /* match capitalization in expansions */ "abquick", /* quick, aggressive expansions enabled? */ "acount", /* # of chars until next auto-save */ "asave", /* # of chars between auto-saves */ "bufhook", /* enter buffer switch hook */ "cbflags", /* current buffer flags */ - "cbufname", /* current buffer name */ + "cbufname", /* current buffer name */ "cfname", /* current file name */ + "class", /* screen class code */ "cmdhook", /* command loop hook */ "cmode", /* mode of current buffer */ "cquote", /* close quote character */ "curchar", /* current character under the cursor */ "curcol", /* current column pos of cursor */ "curline", /* current line in file */ - "curwidth", /* current screen width */ + "curoffs", /* current offset in line */ + "curwidth", /* current screen width */ "curwind", /* current window ordinal on current screen */ "cwline", /* current screen line in window */ "debug", /* macro debugging */ "deskcolor", /* desktop color */ - "diagflag", /* diagonal mouse movements enabled? */ + "diagflag", /* diagonal mouse movements enabled? */ "discmd", /* display commands on command line */ "disinp", /* display command line input characters */ - "disphigh", /* display high bit characters escaped */ - "dispundo", /* display undo depth on command line */ + "disphigh", /* display high bit characters escaped */ + "dispundo", /* display undo depth on command line */ "exbhook", /* exit buffer switch hook */ - "exithook", /* exiting emacs hook */ - "fcol", /* first displayed column in curent window */ + "exithook", /* exiting emacs hook */ + "fcol", /* first displayed column in current window */ "fillcol", /* current fill column */ - "flicker", /* flicker supression */ + "flicker", /* flicker suppression */ "fmtlead", /* format command lead characters */ + "found", /* last search status */ "gflags", /* global internal emacs flags */ "gmode", /* global modes */ "hardtab", /* current hard tab size */ "hilight", /* region # to hilight (255 to turn off) */ "hjump", /* horizontal screen jump size */ - "hscrlbar", /* horizontal scroll bar flag */ + "hscrlbar", /* horizontal scroll bar flag */ "hscroll", /* horizontal scrolling flag */ "isterm", /* incremental-search terminator character */ "kill", /* kill buffer (read only) */ @@ -55,9 +58,12 @@ NOSHARE char *envars[] = { "line", /* text of current line */ "lterm", /* current line terminator for writes */ "lwidth", /* width of current line */ + "margin", /* minimum margin for extended lines */ "match", /* last matched magic pattern */ + "mcol", /* mark column */ + "mline", /* mark line */ "mmove", /* mouse moves events style */ - "modeflag", /* Modelines displayed flag */ + "modeflag", /* Mode lines displayed flag */ "msflag", /* activate mouse? */ "newscreen", /* new screen with new buffer? */ "numwind", /* number of windows on current screen */ @@ -68,11 +74,12 @@ NOSHARE char *envars[] = { "overlap", /* line overlap when paging */ "pagelen", /* number of lines used by editor */ "palette", /* current palette string */ - "paralead", /* paragraph leadin characters */ + "paralead", /* paragraph leading characters */ "pending", /* type ahead pending flag */ + "pid", /* process id */ "popflag", /* pop-up windows active? */ "popwait", /* user wait on end of pop-up window? */ - "posflag", /* display point position on modeline? */ + "posflag", /* display point position on mode line? */ "progname", /* returns current prog name - "MicroEMACS" */ "ram", /* ram in use by malloc */ "readhook", /* read file execution hook */ @@ -80,6 +87,7 @@ NOSHARE char *envars[] = { "replace", /* replacement pattern */ "rval", /* child process return value */ "scrname", /* current screen name */ + "scrsiz", /* size of scroll region */ "search", /* search pattern */ "searchpnt", /* differing search styles (term point) */ "seed", /* current random number seed */ @@ -89,11 +97,13 @@ NOSHARE char *envars[] = { "sscroll", /* smooth scrolling flag */ "status", /* returns the status of the last command */ "sterm", /* search terminator character */ + "syslang", /* system language */ "target", /* target for line moves */ - "time", /* date and time */ + "time", /* date and time */ "timeflag", /* display time? */ - "tpause", /* length to pause for paren matching */ - "undoflag", /* currently processing undos */ + "tmpnam", /* temporary file name */ + "tpause", /* length to pause for fences matching */ + "undoflag", /* currently processing undoes */ "version", /* current version number */ "vscrlbar", /* vertical scroll bar flag */ "wchars", /* set of characters legal in words */ @@ -102,15 +112,15 @@ NOSHARE char *envars[] = { "writehook", /* write file hook */ "xpos", /* current mouse X position */ "yankflag", /* point placement at yanked/included text */ - "ypos" /* current mouse Y position */ + "ypos", /* current mouse Y position */ }; #define NEVARS sizeof(envars) / sizeof(char *) -/* and its preprocesor definitions */ +/* and its preprocessor definitions */ #define EVABBELL 0 -#define EVABCAP 1 +#define EVABCAP 1 #define EVABQUICK 2 #define EVACOUNT 3 #define EVASAVE 4 @@ -118,97 +128,107 @@ NOSHARE char *envars[] = { #define EVCBFLAGS 6 #define EVCBUFNAME 7 #define EVCFNAME 8 -#define EVCMDHK 9 -#define EVCMODE 10 -#define EVCQUOTE 11 -#define EVCURCHAR 12 -#define EVCURCOL 13 -#define EVCURLINE 14 -#define EVCURWIDTH 15 -#define EVCURWIND 16 -#define EVCWLINE 17 -#define EVDEBUG 18 -#define EVDESKCLR 19 -#define EVDIAGFLAG 20 -#define EVDISCMD 21 -#define EVDISINP 22 -#define EVDISPHIGH 23 -#define EVDISPUNDO 24 -#define EVEXBHOOK 25 -#define EVEXITHOOK 26 -#define EVFCOL 27 -#define EVFILLCOL 28 -#define EVFLICKER 29 -#define EVFMTLEAD 30 -#define EVGFLAGS 31 -#define EVGMODE 32 -#define EVHARDTAB 33 -#define EVHILITE 34 -#define EVHJUMP 35 -#define EVHSCRLBAR 36 -#define EVHSCROLL 37 -#define EVISTERM 38 -#define EVKILL 39 -#define EVLANG 40 -#define EVLASTKEY 41 -#define EVLASTMESG 42 -#define EVLINE 43 -#define EVLTERM 44 -#define EVLWIDTH 45 -#define EVMATCH 46 -#define EVMMOVE 47 -#define EVMODEFLAG 48 -#define EVMSFLAG 49 -#define EVNEWSCRN 50 -#define EVNUMWIND 51 -#define EVOQUOTE 52 -#define EVORGCOL 53 -#define EVORGROW 54 -#define EVOS 55 -#define EVOVERLAP 56 -#define EVPAGELEN 57 -#define EVPALETTE 58 -#define EVPARALEAD 59 -#define EVPENDING 60 -#define EVPOPFLAG 61 -#define EVPOPWAIT 62 -#define EVPOSFLAG 63 -#define EVPROGNAME 64 -#define EVRAM 65 -#define EVREADHK 66 -#define EVREGION 67 -#define EVREPLACE 68 -#define EVRVAL 69 -#define EVSCRNAME 70 -#define EVSEARCH 71 -#define EVSEARCHPNT 72 -#define EVSEED 73 -#define EVSOFTTAB 74 -#define EVSRES 75 -#define EVSSAVE 76 -#define EVSSCROLL 77 -#define EVSTATUS 78 -#define EVSTERM 79 -#define EVTARGET 80 -#define EVTIME 81 -#define EVTIMEFLAG 82 -#define EVTPAUSE 83 -#define EVUNDOFLAG 84 -#define EVVERSION 85 -#define EVVSCRLBAR 86 -#define EVWCHARS 87 -#define EVWLINE 88 -#define EVWRAPHK 89 -#define EVWRITEHK 90 -#define EVXPOS 91 -#define EVYANKFLAG 92 -#define EVYPOS 93 +#define EVCLASS 9 +#define EVCMDHK 10 +#define EVCMODE 11 +#define EVCQUOTE 12 +#define EVCURCHAR 13 +#define EVCURCOL 14 +#define EVCURLINE 15 +#define EVCUROFFS 16 +#define EVCURWIDTH 17 +#define EVCURWIND 18 +#define EVCWLINE 19 +#define EVDEBUG 20 +#define EVDESKCLR 21 +#define EVDIAGFLAG 22 +#define EVDISCMD 23 +#define EVDISINP 24 +#define EVDISPHIGH 25 +#define EVDISPUNDO 26 +#define EVEXBHOOK 27 +#define EVEXITHOOK 28 +#define EVFCOL 29 +#define EVFILLCOL 30 +#define EVFLICKER 31 +#define EVFMTLEAD 32 +#define EVFOUND 33 +#define EVGFLAGS 34 +#define EVGMODE 35 +#define EVHARDTAB 36 +#define EVHILITE 37 +#define EVHJUMP 38 +#define EVHSCRLBAR 39 +#define EVHSCROLL 40 +#define EVISTERM 41 +#define EVKILL 42 +#define EVLANG 43 +#define EVLASTKEY 44 +#define EVLASTMESG 45 +#define EVLINE 46 +#define EVLTERM 47 +#define EVLWIDTH 48 +#define EVMARGIN 49 +#define EVMATCH 50 +#define EVMCOL 51 +#define EVMLINE 52 +#define EVMMOVE 53 +#define EVMODEFLAG 54 +#define EVMSFLAG 55 +#define EVNEWSCRN 56 +#define EVNUMWIND 57 +#define EVOQUOTE 58 +#define EVORGCOL 59 +#define EVORGROW 60 +#define EVOS 61 +#define EVOVERLAP 62 +#define EVPAGELEN 63 +#define EVPALETTE 64 +#define EVPARALEAD 65 +#define EVPENDING 66 +#define EVPID 67 +#define EVPOPFLAG 68 +#define EVPOPWAIT 69 +#define EVPOSFLAG 70 +#define EVPROGNAME 71 +#define EVRAM 72 +#define EVREADHK 73 +#define EVREGION 74 +#define EVREPLACE 75 +#define EVRVAL 76 +#define EVSCRNAME 77 +#define EVSCRSIZ 78 +#define EVSEARCH 79 +#define EVSEARCHPNT 80 +#define EVSEED 81 +#define EVSOFTTAB 82 +#define EVSRES 83 +#define EVSSAVE 84 +#define EVSSCROLL 85 +#define EVSTATUS 86 +#define EVSTERM 87 +#define EVSYSLANG 88 +#define EVTARGET 89 +#define EVTIME 90 +#define EVTIMEFLAG 91 +#define EVTMPNAM 92 +#define EVTPAUSE 93 +#define EVUNDOFLAG 94 +#define EVVERSION 95 +#define EVVSCRLBAR 96 +#define EVWCHARS 97 +#define EVWLINE 98 +#define EVWRAPHK 99 +#define EVWRITEHK 100 +#define EVXPOS 101 +#define EVYANKFLAG 102 +#define EVYPOS 103 /* list of recognized user functions */ typedef struct UFUNC { char *f_name; /* name of function */ - int f_type; /* 1 = monamic, 2 = dynamic */ + int f_type; /* 1 = monamic, 2 = dynamic */ } UFUNC; #define NILNAMIC 0 @@ -217,61 +237,62 @@ typedef struct UFUNC { #define TRINAMIC 3 NOSHARE UFUNC funcs[] = { - "abbrev", MONAMIC, /* look up abbreviation */ - "abs", MONAMIC, /* absolute value of a number */ - "add", DYNAMIC, /* add two numbers together */ - "and", DYNAMIC, /* logical and */ - "ascii", MONAMIC, /* char to integer conversion */ - "band", DYNAMIC, /* bitwise and 9-10-87 jwm */ - "bind", MONAMIC, /* loopup what function name is bound to a key */ - "bnot", MONAMIC, /* bitwise not */ - "bor", DYNAMIC, /* bitwise or 9-10-87 jwm */ - "bxor", DYNAMIC, /* bitwise xor 9-10-87 jwm */ - "call", MONAMIC, /* call a procedure */ - "cat", DYNAMIC, /* concatenate string */ - "chr", MONAMIC, /* integer to char conversion */ - "divide", DYNAMIC, /* division */ - "env", MONAMIC, /* retrieve a system environment var */ - "equal", DYNAMIC, /* logical equality check */ - "exist", MONAMIC, /* check if a file exists */ - "find", MONAMIC, /* look for a file on the path... */ - "greater", DYNAMIC, /* logical greater than */ - "group", MONAMIC, /* return group match in MAGIC mode */ - "gtc", NILNAMIC, /* get 1 emacs command */ - "gtk", NILNAMIC, /* get 1 charater */ - "indirect", MONAMIC, /* evaluate indirect value */ - "isnum", MONAMIC, /* is the arg a number? */ - "left", DYNAMIC, /* left string(string, len) */ - "length", MONAMIC, /* string length */ - "less", DYNAMIC, /* logical less than */ - "lower", MONAMIC, /* lower case string */ - "mid", TRINAMIC, /* mid string(string, pos, len) */ - "mkcol", MONAMIC, /* column position of a mark */ - "mkline", MONAMIC, /* line number of a mark */ - "modulo", DYNAMIC, /* mod */ - "negate", MONAMIC, /* negate */ - "not", MONAMIC, /* logical not */ - "or", DYNAMIC, /* logical or */ - "reverse", MONAMIC, /* reverse */ - "right", DYNAMIC, /* right string(string, pos) */ - "rnd", MONAMIC, /* get a random number */ - "sequal", DYNAMIC, /* string logical equality check */ - "sgreater", DYNAMIC, /* string logical greater than */ - "sindex", DYNAMIC, /* find the index of one string in another */ - "sless", DYNAMIC, /* string logical less than */ - "slower", DYNAMIC, /* set lower to upper char translation */ - "subtract", DYNAMIC, /* subtraction */ - "supper", DYNAMIC, /* set upper to lower char translation */ - "times", DYNAMIC, /* multiplication */ - "trim", MONAMIC, /* trim whitespace off the end of a string */ - "true", MONAMIC, /* Truth of the universe logical test */ - "upper", MONAMIC, /* uppercase string */ - "xlate", TRINAMIC /* XLATE character string translation */ + { "abbrev", MONAMIC }, /* look up abbreviation */ + { "abs", MONAMIC }, /* absolute value of a number */ + { "add", DYNAMIC }, /* add two numbers together */ + { "and", DYNAMIC }, /* logical and */ + { "ascii", MONAMIC }, /* char to integer conversion */ + { "band", DYNAMIC }, /* bitwise and 9-10-87 jwm */ + { "bind", MONAMIC }, /* loopup what function name is bound to a key */ + { "bnot", MONAMIC }, /* bitwise not */ + { "bor", DYNAMIC }, /* bitwise or 9-10-87 jwm */ + { "bxor", DYNAMIC }, /* bitwise xor 9-10-87 jwm */ + { "call", MONAMIC }, /* call a procedure */ + { "cat", DYNAMIC }, /* concatenate string */ + { "chr", MONAMIC }, /* integer to char conversion */ + { "divide", DYNAMIC }, /* division */ + { "env", MONAMIC }, /* retrieve a system environment var */ + { "equal", DYNAMIC }, /* logical equality check */ + { "exist", MONAMIC }, /* check if a file exists */ + { "find", MONAMIC }, /* look for a file on the path... */ + { "greater", DYNAMIC }, /* logical greater than */ + { "group", MONAMIC }, /* return group match in MAGIC mode */ + { "gtc", NILNAMIC }, /* get 1 emacs command */ + { "gtk", NILNAMIC }, /* get 1 character */ + { "indirect", MONAMIC },/* evaluate indirect value */ + { "isnum", MONAMIC }, /* is the arg a number? */ + { "left", DYNAMIC }, /* left string(string, len) */ + { "length", MONAMIC }, /* string length */ + { "less", DYNAMIC }, /* logical less than */ + { "lower", MONAMIC }, /* lower case string */ + { "mid", TRINAMIC }, /* mid string(string, pos, len) */ + { "mkcol", MONAMIC }, /* column position of a mark */ + { "mkline", MONAMIC }, /* line number of a mark */ + { "modulo", DYNAMIC }, /* mod */ + { "negate", MONAMIC }, /* negate */ + { "not", MONAMIC }, /* logical not */ + { "or", DYNAMIC }, /* logical or */ + { "reverse", MONAMIC }, /* reverse */ + { "right", DYNAMIC }, /* right string(string, pos) */ + { "rnd", MONAMIC }, /* get a random number */ + { "sequal", DYNAMIC }, /* string logical equality check */ + { "sgreater", DYNAMIC },/* string logical greater than */ + { "sindex", DYNAMIC }, /* find the index of one string in another */ + { "sless", DYNAMIC }, /* string logical less than */ + { "slower", DYNAMIC }, /* set lower to upper char translation */ + { "srindex", DYNAMIC }, /* find the last index of one string in another */ + { "subtract", DYNAMIC },/* subtraction */ + { "supper", DYNAMIC }, /* set upper to lower char translation */ + { "times", DYNAMIC }, /* multiplication */ + { "trim", MONAMIC }, /* trim whitespace off the end of a string */ + { "true", MONAMIC }, /* Truth of the universe logical test */ + { "upper", MONAMIC }, /* uppercase string */ + { "xlate", TRINAMIC }, /* XLATE character string translation */ }; #define NFUNCS sizeof(funcs) / sizeof(UFUNC) -/* and its preprocesor definitions */ +/* and its preprocessor definitions */ #define UFABBREV 0 #define UFABS 1 @@ -292,17 +313,17 @@ NOSHARE UFUNC funcs[] = { #define UFEXIST 16 #define UFFIND 17 #define UFGREATER 18 -#define UFGROUP 19 +#define UFGROUP 19 #define UFGTCMD 20 #define UFGTKEY 21 #define UFIND 22 -#define UFISNUM 23 +#define UFISNUM 23 #define UFLEFT 24 #define UFLENGTH 25 #define UFLESS 26 #define UFLOWER 27 #define UFMID 28 -#define UFMKCOL 29 +#define UFMKCOL 29 #define UFMKLINE 30 #define UFMOD 31 #define UFNEG 32 @@ -316,10 +337,11 @@ NOSHARE UFUNC funcs[] = { #define UFSINDEX 40 #define UFSLESS 41 #define UFSLOWER 42 -#define UFSUB 43 -#define UFSUPPER 44 -#define UFTIMES 45 -#define UFTRIM 46 -#define UFTRUTH 47 -#define UFUPPER 48 -#define UFXLATE 49 +#define UFSRINDEX 43 +#define UFSUB 44 +#define UFSUPPER 45 +#define UFTIMES 46 +#define UFTRIM 47 +#define UFTRUTH 48 +#define UFUPPER 49 +#define UFXLATE 50 diff --git a/h/french.h b/h/french.h index 8009d26..c9fd4f9 100644 --- a/h/french.h +++ b/h/french.h @@ -4,7 +4,7 @@ (C)opyright 1995 by Daniel Lawrence Translated by Bertrand DECOUTY, 10/88 Modified 12/89 (accent...) - decouty@caroline.irisa.fr, + decouty@caroline.irisa.fr, {uunet,mcvax,inria}!irisa!decouty IRISA-INRIA, Campus de Beaulieu, F-35042 Rennes Cedex Modified 02/93 (code page 850, 8 bits chars) @@ -45,7 +45,11 @@ #define TEXT29 "Changer le nom du tampon en: " /*"Change buffer name to: "*/ /* "ACTN Modes Size Buffer File"*/ +#if JMDEXT +#define TEXT30 "ACTN Modes Taille Tampon Fichier" +#else #define TEXT30 "ACTN Modes Taille Tampon Fichier" +#endif #define TEXT31 " Modes Globaux" /*" Global Modes"*/ #define TEXT32 "Annuler les modifications" /*"Discard changes"*/ #define TEXT33 "Cha\214ne d'encryptage: " /*"Encryption String: "*/ @@ -284,7 +288,8 @@ #define TEXT233 "[Construction liste des abr\202viations]" /*"[Building Abbreviation list]"*/ #define TEXT234 "Liste des abr\202viations" /*"Abbreviation list"*/ #define TEXT235 "Impossible d'afficher la liste des abr\202viations" /*"Can not display abbreviation list"*/ -#define TEXT236 "D\202finition abr\202viations dans un tampon" /*"Define Abbreviations in buffer"*/ +#define TEXT236 "D\202finition abr\202viations depuis le tampon" /*"Define Abbreviations from buffer"*/ + #define TEXT240 "[Aucun \202cran de ce nom]" /*"[No such screen]"*/ #define TEXT241 "%%Impossible de supprimer l'\202cran courant" /*"%%Can't delete current screen"*/ #define TEXT242 "Chercher l'\202cran: " /*"Find Screen: "*/ @@ -296,7 +301,26 @@ #define TEXT248 "Entrer une \202tiquette: " /*"Enter Label String: "*/ #define TEXT249 "Variable globale \205 d\202clarer : " #define TEXT250 "Variable locale \205 d\202clarer : " - +#if JMDEXT +#define TEXT284 "Fonction non disponible" +#define TEXT285 "Aucun sujet indiqu\202" +#define TEXT286 "Recherche du sujet \"%s\"" +#define TEXT287 "Recherche du mot-cl\202 \"%s\"" +#define TEXT288 "Sujet: " +#define TEXT289 "Mot-cl\202: " +#define TEXT290 "Pas d'aide pour le sujet \"%s\"" +#define TEXT291 "Pas d'aide pour le mot-cl\202 \"%s\"" +#define TEXT292 "Ouverture du fichier d'aide %s impossible" +#define TEXT293 "Index de " +#define TEXT294 "[Help]" +#define TEXT295 "[Errors]" +#define TEXT296 "[Function Keys]" +#define TEXT297 "%s n'est pas un fichier" +#if THEOS +#define TEXT298 "%s n'est pas un fichier s\202quentiel" +#define TEXT299 "%s n'est pas une biblioth\212que" +#endif +#endif /* some of these are just used in the microsoft windows version */ #define TEXT300 "[Menu incorrect]" /*"[Incorrect menu]"*/ #define TEXT301 "[Trop de menus imbriqu\202s]" /*"[Too many nested popup menus]"*/ @@ -336,3 +360,4 @@ #define TEXT335 "Changer le nom de l'\202cran en: " /*"Change screen name to: "*/ #define TEXT336 "[Nom d'\202cran d\202j\205 utilis\202]" /*"[Screen name already in use]"*/ #define TEXT337 "impossible de contr\223ler un programme externe" /*"cannot monitor external program"*/ +#define TEXT338 "space for help :" diff --git a/h/frenchis.h b/h/frenchis.h index 98e0a41..929bc08 100644 --- a/h/frenchis.h +++ b/h/frenchis.h @@ -1,4 +1,4 @@ -/* FRENCHISO.H: French language text strings for +/* FRENCHISO.H: French language text ISO8859 strings for MicroEMACS 4.00 (C)opyright 1995 by Daniel Lawrence @@ -45,7 +45,11 @@ #define TEXT29 "Changer le nom du tampon en: " /*"Change buffer name to: "*/ /* "ACTN Modes Size Buffer File"*/ +#if JMDEXT +#define TEXT30 "ACTN Modes Taille Tampon Fichier" +#else #define TEXT30 "ACTN Modes Taille Tampon Fichier" +#endif #define TEXT31 " Modes Globaux" /*" Global Modes"*/ #define TEXT32 "Annuler les modifications" /*"Discard changes"*/ #define TEXT33 "Cha\356ne d'encryptage: " /*"Encryption String: "*/ @@ -77,7 +81,7 @@ #define TEXT59 UNUSED /* "Line %d/%d Col %d/%d Char %D/%D (%d%%) char = 0x%x"*/ -#define TEXT60 "Ligne %D/%D Col %d/%d Car %D/%D (%d%%) car = 0x%x" +#define TEXT60 "Ligne %D/%D Col %d/%d Car %D/%D (%d%%) car = 0x%x %d" #define TEXT61 "" /*"not used"*/ #define TEXT62 "Mode global \340 " /*"Global mode to "*/ @@ -284,7 +288,8 @@ #define TEXT233 "[Construction liste des abr\351viations]" /*"[Building Abbreviation list]"*/ #define TEXT234 "Liste des abr\351viations" /*"Abbreviation list"*/ #define TEXT235 "Impossible d'afficher la liste des abr\351viations" /*"Can not display abbreviation list"*/ -#define TEXT236 "D\351finition abr\351viations dans un tampon" /*"Define Abbreviations in buffer"*/ +#define TEXT236 "D\351finition abr\351viations depuis le tampon" /*"Define Abbreviations from buffer"*/ + #define TEXT240 "[Aucun \351cran de ce nom]" /*"[No such screen]"*/ #define TEXT241 "%%Impossible de supprimer l'\351cran courant" /*"%%Can't delete current screen"*/ #define TEXT242 "Chercher l'\351cran: " /*"Find Screen: "*/ @@ -296,7 +301,26 @@ #define TEXT248 "Entrer une \351tiquette: " /*"Enter Label String: "*/ #define TEXT249 "Variable globale \340 d\351clarer : " #define TEXT250 "Variable locale \340 d\351clarer : " - +#if JMDEXT +#define TEXT284 "Fonction non disponible" +#define TEXT285 "Aucun sujet indiqu\351" +#define TEXT286 "Recherche du sujet \"%s\"" +#define TEXT287 "Recherche du mot-cl\351 \"%s\"" +#define TEXT288 "Sujet: " +#define TEXT289 "Mot-cl\351: " +#define TEXT290 "Pas d'aide pour le sujet \"%s\"" +#define TEXT291 "Pas d'aide pour le mot-cl\351 \"%s\"" +#define TEXT292 "Impossible d'ouvrir le fichier d'aide %s" +#define TEXT293 "Index de " +#define TEXT294 "[Help]" +#define TEXT295 "[Errors]" +#define TEXT296 "[Function Keys]" +#if THEOS +#define TEXT297 "%s n'est pas un fichier" +#define TEXT298 "%s n'est pas un fichier s\351quentiel" +#define TEXT299 "%s n'est pas une biblioth\350que" +#endif +#endif /* some of these are just used in the microsoft windows version */ #define TEXT300 "[Menu incorrect]" /*"[Incorrect menu]"*/ #define TEXT301 "[Trop de menus imbriqu\351s]" /*"[Too many nested popup menus]"*/ @@ -336,3 +360,4 @@ #define TEXT335 "Changer le nom de l'\351cran en: " /*"Change screen name to: "*/ #define TEXT336 "[Nom d'\351cran d\351j\340 utilis\351]" /*"[Screen name already in use]"*/ #define TEXT337 "impossible de contr\364ler un programme externe" /*"cannot monitor external program"*/ +#define TEXT338 "space for help :" diff --git a/h/german.h b/h/german.h index 2131229..7faf5fc 100644 --- a/h/german.h +++ b/h/german.h @@ -44,7 +44,11 @@ #define TEXT27 "Pop buffer" #define TEXT28 "Buffer wird gerade angezeigt" #define TEXT29 "Aendere Buffer-Namen zu: " +#if JMDEXT #define TEXT30 "ACTN Modi Groesse Buffer Datei" +#else +#define TEXT30 "ACTN Modi Groesse Buffer Datei" +#endif /* > ^^^The spacing must match on this line. It is the header for the * buffer list. * (I extended "size" to the left to make "Groesse" fit.) @@ -81,7 +85,7 @@ #define TEXT57 "kann Variablen-Liste nicht anzeigen" #define TEXT58 "[Variablen-Liste wird aufgebaut...]" #define TEXT59 UNUSED -#define TEXT60 "Zeile %D/%D Spalte %d/%d Zeichen %D/%D (%d%%) Zeichen = 0x%x" +#define TEXT60 "Zeile %D/%D Spalte %d/%d Zeichen %D/%D (%d%%) Zeichen = 0x%x %d" #define TEXT61 "" #define TEXT62 "Globaler Modus, der " #define TEXT63 "Modus, der " @@ -286,6 +290,12 @@ #define TEXT228 "[Kill ring cleared]" #define TEXT229 " in < " #define TEXT230 "> at line " +#define TEXT231 "Abbreviation to set: " +#define TEXT232 "Abbreviation to delete: " +#define TEXT233 "[Building Abbreviation list]" +#define TEXT234 "Abbreviation list" +#define TEXT235 "Can not display abbreviation list" +#define TEXT236 "Define Abbreviations from buffer" #define TEXT240 "[No such screen]" #define TEXT241 "%%Can't delete current screen" @@ -298,7 +308,26 @@ #define TEXT248 "Enter Label String: " #define TEXT249 "Global variable to declare: " #define TEXT250 "Local variable to declare: " - +#if JMDEXT +#define TEXT284 "Function not available" +#define TEXT285 "No topic" +#define TEXT286 "Searching topic \"%s\"" +#define TEXT287 "Searching keyword \"%s\"" +#define TEXT288 "Topic: " +#define TEXT289 "Keyword: " +#define TEXT290 "No help for topic \"%s\"" +#define TEXT291 "No help for keyword \"%s\"" +#define TEXT292 "Unable to open the help file %s" +#define TEXT293 "Index of " +#define TEXT294 "[Help]" +#define TEXT295 "[Errors]" +#define TEXT296 "[Function Keys]" +#define TEXT297 "%s n'est pas un fichier" +#if THEOS +#define TEXT298 "%s is not a sequential file" +#define TEXT299 "%s is not a library" +#endif +#endif /* some of these are just used in the microsoft windows version */ #define TEXT300 "[Incorrect menu]" #define TEXT301 "[Too many nested popup menus]" @@ -337,4 +366,10 @@ #define TEXT335 "Change screen name to: " #define TEXT336 "[Screen name already in use]" #define TEXT337 "cannot monitor external program" +#define TEXT338 "space for help :" +#if JMDEXT +#define TEXT400 "%s is not a regular file" +#define TEXT401 "%s is not a sequential file" +#define TEXT402 "%s is not a library" +#endif diff --git a/h/japan.h b/h/japan.h index b640f2d..79322f0 100644 --- a/h/japan.h +++ b/h/japan.h @@ -37,7 +37,11 @@ #define TEXT27 "\203|\203b\203v\202\267\202\351\203o\203b\203t\203@" #define TEXT28 "\203o\203b\203t\203@\202\315\225\\\216\246\202\263\202\352\202\304\202\242\202\334\202\267" #define TEXT29 "\203o\203b\203t\203@\226\274\202\360\225\317\215X: " +#if JMDEXT +#define TEXT30 "ACTN Modes Size Buffer File" +#else #define TEXT30 "ACTN Modes Size Buffer File" +#endif #define TEXT31 " Global Modes" #define TEXT32 "\225\317\215X\223\340\227e\202\360\216\314\202\304\202\334\202\267\202\251" #define TEXT33 "\210\303\215\206\211\273\225\266\216\232\227\361: " @@ -67,7 +71,7 @@ #define TEXT57 "\225\317\220\224\203\212\203X\203g\202\252\225\\\216\246\202\305\202\253\202\334\202\271\202\361" #define TEXT58 "[\225\317\220\224\203\212\203X\203g\215\354\220\254\222\206]" #define TEXT59 UNUSED -#define TEXT60 "\215s %D/%D \214\205 %d/%d \225\266\216\232 %D/%D (%d%%) \225\266\216\232 = 0x%x" +#define TEXT60 "\215s %D/%D \214\205 %d/%d \225\266\216\232 %D/%D (%d%%) \225\266\216\232 = 0x%x %d" #define TEXT61 "" #define TEXT62 "\203O\203\215\201[\203o\203\213\201E\203\202\201[\203h" #define TEXT63 "\203\202\201[\203h" @@ -238,6 +242,12 @@ #define TEXT228 "[Kill ring cleared]" #define TEXT229 " in < " #define TEXT230 "> at line " +#define TEXT231 "Abbreviation to set: " +#define TEXT232 "Abbreviation to delete: " +#define TEXT233 "[Building Abbreviation list]" +#define TEXT234 "Abbreviation list" +#define TEXT235 "Can not display abbreviation list" +#define TEXT236 "Define Abbreviations from buffer" #define TEXT240 "[No such screen]" #define TEXT241 "%%Can't delete current screen" @@ -250,7 +260,26 @@ #define TEXT248 "Enter Label String: " #define TEXT249 "Global variable to declare: " #define TEXT250 "Local variable to declare: " - +#if JMDEXT +#define TEXT284 "Function not available" +#define TEXT285 "No topic" +#define TEXT286 "Searching topic \"%s\"" +#define TEXT287 "Searching keyword \"%s\"" +#define TEXT288 "Topic: " +#define TEXT289 "Keyword: " +#define TEXT290 "No help for topic \"%s\"" +#define TEXT291 "No help for keyword \"%s\"" +#define TEXT292 "Unable to open the help file %s" +#define TEXT293 "Index of " +#define TEXT294 "[Help]" +#define TEXT295 "[Errors]" +#define TEXT296 "[Function Keys]" +#define TEXT297 "%s is not a regular file" +#endif +#if THEOS +#define TEXT298 "%s is not a sequential file" +#define TEXT299 "%s is not a library" +#endif /* some of these are just used in the microsoft windows version */ #define TEXT300 "[Incorrect menu]" #define TEXT301 "[Too many nested popup menus]" @@ -289,4 +318,4 @@ #define TEXT335 "Change screen name to: " #define TEXT336 "[Screen name already in use]" #define TEXT337 "cannot monitor external program" - +#define TEXT338 "space for help :" diff --git a/h/latin.h b/h/latin.h index 10593cd..343772d 100644 --- a/h/latin.h +++ b/h/latin.h @@ -34,7 +34,11 @@ #define TEXT27 "apotheca occidenda: " #define TEXT28 "apotheca ostenditur" #define TEXT29 "mutare nomen apothecae ad: " +#if JMDEXT +#define TEXT30 "ACTN Modi Magn Apothec Filum" +#else #define TEXT30 "ACTN Modi Magn Apothec Filum" +#endif #define TEXT31 " Modi Globales" #define TEXT32 "reicere mutationes" #define TEXT33 "linum encryptionis: " @@ -64,7 +68,7 @@ #define TEXT57 "non possum variabilium ostendere tabula" #define TEXT58 "[struo tabula variabilium]" #define TEXT59 UNUSED -#define TEXT60 "Linea %D/%D Col %d/%d Char %D/%D (%d%%) char = 0x%x" +#define TEXT60 "Linea %D/%D Col %d/%d Char %D/%D (%d%%) char = 0x%x %d" #define TEXT61 "%%argumentum negativum occisionus nefas est" #define TEXT62 "modus globalis " #define TEXT63 "modus " @@ -235,6 +239,12 @@ #define TEXT228 "[Kill ring cleared]" #define TEXT229 " in < " #define TEXT230 "> at line " +#define TEXT231 "Abbreviation to set: " +#define TEXT232 "Abbreviation to delete: " +#define TEXT233 "[Building Abbreviation list]" +#define TEXT234 "Abbreviation list" +#define TEXT235 "Can not display abbreviation list" +#define TEXT236 "Define Abbreviations from buffer" #define TEXT240 "[No such screen]" #define TEXT241 "%%Can't delete current screen" @@ -247,7 +257,26 @@ #define TEXT248 "Enter Label String: " #define TEXT249 "Global variable to declare: " #define TEXT250 "Local variable to declare: " - +#if JMDEXT +#define TEXT284 "Function not available" +#define TEXT285 "No topic" +#define TEXT286 "Searching topic \"%s\"" +#define TEXT287 "Searching keyword \"%s\"" +#define TEXT288 "Topic: " +#define TEXT289 "Keyword: " +#define TEXT290 "No help for topic \"%s\"" +#define TEXT291 "No help for keyword \"%s\"" +#define TEXT292 "Unable to open the help file %s" +#define TEXT293 "Index of " +#define TEXT294 "[Help]" +#define TEXT295 "[Errors]" +#define TEXT296 "[Function Keys]" +#define TEXT297 "%s is not a regular file" +#endif +#if THEOS +#define TEXT298 "%s is not a sequential file" +#define TEXT299 "%s is not a library" +#endif /* some of these are just used in the microsoft windows version */ #define TEXT300 "[Incorrect menu]" #define TEXT301 "[Too many nested popup menus]" @@ -286,4 +315,4 @@ #define TEXT335 "Change screen name to: " #define TEXT336 "[Screen name already in use]" #define TEXT337 "cannot monitor external program" - +#define TEXT338 "space for help :" diff --git a/h/mswin.h b/h/mswin.h index 7cc98ca..518cde1 100644 --- a/h/mswin.h +++ b/h/mswin.h @@ -55,7 +55,7 @@ #define MLSIZE NSTRING /* message line buffer size */ /* offsets for the screen windows extra bytes */ -#define GWL_SCRPTR 0 /* SCREEN structure pointer */ +#define GWL_SCRPTR 0 /* ESCREEN structure pointer */ #if WINXP #define GWW_SCRCX (GWL_SCRPTR+sizeof(LONG_PTR)) /* client area width */ #else @@ -157,51 +157,51 @@ void in_put (int event); int in_get (void); /* Windows-implementation specific functions */ -LONG EXPORT FAR PASCAL ScrWndProc (HWND hWnd, UINT wMsg, WPARAM wParam, +LONG EXPORT FAR ScrWndProc (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam); -LONG EXPORT FAR PASCAL FrameWndProc (HWND hWnd, UINT wMsg, WPARAM wParam, +LONG EXPORT FAR FrameWndProc (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam); -int FAR PASCAL GetInput (void); -int FAR PASCAL TakeANap (int t); +int FAR GetInput (void); +int FAR TakeANap (int t); -void FAR PASCAL GenerateMenuSeq (UINT ID); -KEYTAB * FAR PASCAL FindKeyBinding (void *Func); -void FAR PASCAL InitMenuPopup (HMENU hMenu, LPARAM lParam); -BOOL FAR PASCAL MenuCommand (WPARAM wParam, LPARAM lParam); -HMENU FAR PASCAL GetScreenMenuHandle (void); +void FAR GenerateMenuSeq (UINT ID); +KEYTAB * FAR FindKeyBinding (void *Func); +void FAR InitMenuPopup (HMENU hMenu, LPARAM lParam); +BOOL FAR MenuCommand (WPARAM wParam, LPARAM lParam); +HMENU FAR GetScreenMenuHandle (void); -BOOL FAR PASCAL EatKey (UINT MsgCode, WPARAM wParam, LPARAM lParam); -void FAR PASCAL MouseMessage (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam); -void FAR PASCAL DropMessage (HWND hWnd, HANDLE hDrop); +BOOL FAR EatKey (UINT MsgCode, WPARAM wParam, LPARAM lParam); +void FAR MouseMessage (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam); +void FAR DropMessage (HWND hWnd, HANDLE hDrop); -void FAR PASCAL BuildCellMetrics (CellMetrics *cm, HFONT hFont); -void FAR PASCAL InvalidateCells (HWND hWnd, int leftcol, int toprow, +void FAR BuildCellMetrics (CellMetrics *cm, HFONT hFont); +void FAR InvalidateCells (HWND hWnd, int leftcol, int toprow, int rightcol, int bottomrow); -void FAR PASCAL MinimumClientSize (HWND hWnd, int NCols, int NRows, +void FAR MinimumClientSize (HWND hWnd, int NCols, int NRows, int *Width, int *Height); -int FAR PASCAL DisplayableRows (HWND hWnd, int Height, CellMetrics *cm); -int FAR PASCAL DisplayableColumns (HWND hWnd, int Width, CellMetrics *cm); -void FAR PASCAL EmacsCaret (BOOL Show); -void FAR PASCAL MoveEmacsCaret (HWND hWnd, int col, int row); -void FAR PASCAL ShowEmacsCaret (BOOL Show); -void FAR PASCAL CellToClient (HWND hWnd, POINT Cell, LPPOINT Client); -void FAR PASCAL ClientToCell (HWND hWnd, POINT Client, LPPOINT Cell); -void FAR PASCAL GetMinMaxInfo (HWND hWnd, LPPOINT rgpt); -BOOL FAR PASCAL ScrReSize (HWND hWnd, WPARAM wParam, WORD cx, WORD cy); -void FAR PASCAL ScrPaint (HWND hWnd); -void FAR PASCAL MLPaint (void); - -BOOL FAR PASCAL InMessageLine (void); - -void FAR PASCAL ClipboardCleanup (void); -void FAR PASCAL ScrollMessage (HWND hWnd, UINT wMsg, WORD ScrlCode, int Pos); -void FAR PASCAL ScrollBars (void); - -int FAR PASCAL SetWorkingDir (void); - -void FAR PASCAL InitializeFarStorage (void); -void FAR PASCAL JettisonFarStorage (void); - -HFONT FAR PASCAL SelectFont (HDC hDC, HFONT hFont); -BOOL FAR PASCAL PickEmacsFont (void); -void FAR PASCAL FontInit (void); +int FAR DisplayableRows (HWND hWnd, int Height, CellMetrics *cm); +int FAR DisplayableColumns (HWND hWnd, int Width, CellMetrics *cm); +void FAR EmacsCaret (BOOL Show); +void FAR MoveEmacsCaret (HWND hWnd, int col, int row); +void FAR ShowEmacsCaret (BOOL Show); +void FAR CellToClient (HWND hWnd, POINT Cell, LPPOINT Client); +void FAR ClientToCell (HWND hWnd, POINT Client, LPPOINT Cell); +void FAR GetMinMaxInfo (HWND hWnd, LPPOINT rgpt); +BOOL FAR ScrReSize (HWND hWnd, WPARAM wParam, WORD cx, WORD cy); +void FAR ScrPaint (HWND hWnd); +void FAR MLPaint (void); + +BOOL FAR InMessageLine (void); + +void FAR ClipboardCleanup (void); +void FAR ScrollMessage (HWND hWnd, UINT wMsg, WORD ScrlCode, int Pos); +void FAR ScrollBars (void); + +int FAR SetWorkingDir (void); + +void FAR InitializeFarStorage (void); +void FAR JettisonFarStorage (void); + +HFONT FAR SelectFont (HDC hDC, HFONT hFont); +BOOL FAR PickEmacsFont (void); +void FAR FontInit (void); diff --git a/h/platin.h b/h/platin.h index bbca365..d99b2ec 100644 --- a/h/platin.h +++ b/h/platin.h @@ -38,7 +38,11 @@ #define TEXT27 "Oppay ufferbay" #define TEXT28 "Ufferbay isway eingbay isplayedday" #define TEXT29 "Hangecay ufferbay amenay otay: " +#if JMDEXT +#define TEXT30 "ACTN Odesmay Izesay Ufferbay Ilefay" +#else #define TEXT30 "ACTN Odesmay Izesay Ufferbay Ilefay" +#endif #define TEXT31 " Global Modes" #define TEXT32 "Iscardday hangescay" #define TEXT33 "Encryptionway Tringsay: " @@ -68,7 +72,7 @@ #define TEXT57 "Ancay otnay isplayday ariablevay istlay" #define TEXT58 "[Uildingbay ariablevay istlay]" #define TEXT59 UNUSEDWAY -#define TEXT60 "Inelay %D/%D Olcay %d/%d Archay %D/%D (%d%%) archay = 0x%x" +#define TEXT60 "Inelay %D/%D Olcay %d/%d Archay %D/%D (%d%%) archay = 0x%x %d" #define TEXT61 "" #define TEXT62 "Lobalgay odemay otay " #define TEXT63 "Odemay otay " @@ -256,7 +260,26 @@ #define TEXT248 "Enterway Abelay Ingstray: " #define TEXT249 "Obalglay ariablevay otay eclareday: " #define TEXT250 "Ocallay ariablevay otay eclareday: " - +#if JMDEXT +#define TEXT284 "Function not available" +#define TEXT285 "No topic" +#define TEXT286 "Searching topic \"%s\"" +#define TEXT287 "Searching keyword \"%s\"" +#define TEXT288 "Topic: " +#define TEXT289 "Keyword: " +#define TEXT290 "No help for topic \"%s\"" +#define TEXT291 "No help for keyword \"%s\"" +#define TEXT292 "Unable to open the help file %s" +#define TEXT293 "Index of " +#define TEXT294 "[Help]" +#define TEXT295 "[Errors]" +#define TEXT296 "[Function Keys]" +#define TEXT297 "%s is not a regular file" +#endif +#if THEOS +#define TEXT298 "%s is not a sequential file" +#define TEXT299 "%s is not a library" +#endif /* some of these are just used in the microsoft windows version */ #define TEXT300 "[Incorrectway enumay]" #define TEXT301 "[Ootay anymay estednay opupay enusmay]" @@ -295,4 +318,4 @@ #define TEXT335 "Angechay eenscray amenay otay: " #define TEXT336 "[Eenscray amenay alreadyway inway useway]" #define TEXT337 "annotcay onitormay externalway ogrampray" - +#define TEXT338 "space for help :" diff --git a/h/resource.h b/h/resource.h index 2b6eb9d..af4c1ee 100644 --- a/h/resource.h +++ b/h/resource.h @@ -312,7 +312,7 @@ #define ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID 3 #define SW_SHOWMAXIMIZED 3 #define SW_MAXIMIZE 3 -#define SHOW_FULLSCREEN 3 +#define SHOW_FULLESCREEN 3 #define SW_PARENTOPENING 3 #define VK_CANCEL 0x03 #define WM_MOVE 0x0003 @@ -1157,7 +1157,7 @@ #define TVS_EX_EXCLUSIONCHECKBOXES 0x0100 #define TCS_BUTTONS 0x0100 #define MCS_NOSELCHANGEONNAV 0x0100 -#define IDM_FIND_SCREEN 0x100 +#define IDM_FIND_ESCREEN 0x100 #define WM_KEYUP 0x0101 #define IDM_NEWSIZE 0x101 #define WM_CHAR 0x0102 @@ -1167,7 +1167,7 @@ #define WM_SYSKEYDOWN 0x0104 #define IDM_FONT 0x104 #define WM_SYSKEYUP 0x0105 -#define IDM_RENAME_SCREEN 0x105 +#define IDM_RENAME_ESCREEN 0x105 #define WM_SYSCHAR 0x0106 #define WM_SYSDEADCHAR 0x0107 #define WM_UNICHAR 0x0109 @@ -1748,7 +1748,7 @@ #define SC_ARRANGE 0xF110 #define SC_RESTORE 0xF120 #define SC_TASKLIST 0xF130 -#define SC_SCREENSAVE 0xF140 +#define SC_ESCREENSAVE 0xF140 #define SC_HOTKEY 0xF150 #define SC_DEFAULT 0xF160 #define SC_MONITORPOWER 0xF170 diff --git a/h/spanish.h b/h/spanish.h index 1fa2738..c40d405 100644 --- a/h/spanish.h +++ b/h/spanish.h @@ -24,7 +24,7 @@ #define TEXT14 "No esta declarada" #define TEXT15 ": declara a esta tecla" #define TEXT16 "[Esa funccion no la hay!]" -#define TEXT17 "Tabla de declaraciones esta llena!" +#define TEXT17 "Tabla de declaraciones esta llena!" #define TEXT18 ": unbind-key " #define TEXT19 "[Tecla no declarada]" #define TEXT20 "Apropos string: " @@ -37,7 +37,11 @@ #define TEXT27 "Pop buffer" #define TEXT28 "Buffer is being displayed" #define TEXT29 "Change buffer name to: " +#if JMDEXT #define TEXT30 "ACTN Modes Size Buffer File" +#else +#define TEXT30 "ACTN Modes Size Buffer File" +#endif #define TEXT31 " Global Modes" #define TEXT32 "Discard changes" #define TEXT33 "Encryption String: " @@ -67,7 +71,7 @@ #define TEXT57 "No puedo ensenar la lista de variables" #define TEXT58 "[Creando lista de variables]" #define TEXT59 UNUSED -#define TEXT60 "Linea %D/%D Columna %d/%d Letra %D/%D (%d%%) Letra = 0x%x" +#define TEXT60 "Linea %D/%D Columna %d/%d Letra %D/%D (%d%%) Letra = 0x%x %d" #define TEXT61 "" #define TEXT62 "Modo global a" #define TEXT63 "Modo a" @@ -238,6 +242,12 @@ #define TEXT228 "[Kill ring cleared]" #define TEXT229 " in < " #define TEXT230 "> at line " +#define TEXT231 "Abbreviation to set: " +#define TEXT232 "Abbreviation to delete: " +#define TEXT233 "[Building Abbreviation list]" +#define TEXT234 "Abbreviation list" +#define TEXT235 "Can not display abbreviation list" +#define TEXT236 "Define Abbreviations from buffer" #define TEXT240 "[No such screen]" #define TEXT241 "%%Can't delete current screen" @@ -250,7 +260,26 @@ #define TEXT248 "Enter Label String: " #define TEXT249 "Global variable to declare: " #define TEXT250 "Local variable to declare: " - +#if JMDEXT +#define TEXT284 "Function not available" +#define TEXT285 "No topic" +#define TEXT286 "Searching topic \"%s\"" +#define TEXT287 "Searching keyword \"%s\"" +#define TEXT288 "Topic: " +#define TEXT289 "Keyword: " +#define TEXT290 "No help for topic \"%s\"" +#define TEXT291 "No help for keyword \"%s\"" +#define TEXT292 "Unable to open the help file %s" +#define TEXT293 "Index of " +#define TEXT294 "[Help]" +#define TEXT295 "[Errors]" +#define TEXT296 "[Function Keys]" +#define TEXT297 "%s is not a regular file" +#endif +#if THEOS +#define TEXT298 "%s is not a sequential file" +#define TEXT299 "%s is not a library" +#endif /* some of these are just used in the microsoft windows version */ #define TEXT300 "[Incorrect menu]" #define TEXT301 "[Too many nested popup menus]" @@ -289,4 +318,4 @@ #define TEXT335 "Change screen name to: " #define TEXT336 "[Screen name already in use]" #define TEXT337 "cannot monitor external program" - +#define TEXT338 "space for help :" diff --git a/h/theox.h b/h/theox.h new file mode 100644 index 0000000..1dd9226 --- /dev/null +++ b/h/theox.h @@ -0,0 +1,20 @@ +/* + * theox.h + * + * Created on: 20 févr. 2020 + * Author: system + */ + +#ifndef H_THEOX_H_ +#define H_THEOX_H_ + +extern unsigned char _b_wchar2theox(unsigned int wch); +extern unsigned int _b_theox2wchar(unsigned char c); +extern VOID theoxputchar(unsigned char c); +extern int _b_tolower(int ch); +extern int _b_toupper(int ch); +extern int _b_islower(int ch); +extern int _b_isupper(int ch); + + +#endif /* H_THEOX_H_ */ diff --git a/h/utf8.h b/h/utf8.h new file mode 100644 index 0000000..f50a150 --- /dev/null +++ b/h/utf8.h @@ -0,0 +1,23 @@ +/* UTF8: Unicode UTF-8 prototypes and declarations + MicroEMACS 4.00 + + written by Jean-Michel Dubois +*/ + +#ifndef UTF8_H +#define UTF8_H + +unsigned utf8_to_unicode(const char *line, unsigned index, unsigned len, unsigned int *res); +unsigned unicode_to_utf8(unsigned int c, char *utf8); + +static inline int is_beginning_utf8(unsigned char c) +{ + return (c & 0xc0) != 0x80; +} + +static inline int is_multibyte_utf8(unsigned char c) +{ + return (c & 0xc0) == 0xc0; +} + +#endif From 39c92b341152be4aff0f0bd30c3f0ff32eba15a8 Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 3 Sep 2020 12:31:12 +0200 Subject: [PATCH 04/37] Unicode/UTF-8 support --- h/estruct.h.template | 3 +++ 1 file changed, 3 insertions(+) diff --git a/h/estruct.h.template b/h/estruct.h.template index a27626f..60cc5ae 100644 --- a/h/estruct.h.template +++ b/h/estruct.h.template @@ -5,6 +5,8 @@ written by Daniel Lawrence based on code by Dave G. Conroy, Steve Wilhite and George Jones + + Unicode support by Jean-Michel Dubois */ #ifdef LATTICE @@ -189,6 +191,7 @@ #define THEOX 1 /* allow TheoX character set files edition */ /* including semi-graphics entry from numeric */ /* keypad (require UTF8) */ +#define TXBASIC 1 /* TxBasic IDE menu */ #endif #if DYNMSGS From 9d63c7f6846a02a30cfc5fbaef5ed08839b1c735 Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 3 Sep 2020 12:33:39 +0200 Subject: [PATCH 05/37] Theos O.S. support Support of Theos 4.x and Corona From 6d5daff3670d808e1b22c1539142075e26329474 Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 3 Sep 2020 12:35:29 +0200 Subject: [PATCH 06/37] Linux extended support with UTF-8 --- linux/Makefile | 117 ++++ linux/estruct.h | 1377 +++++++++++++++++++++++++++++++++++++++++++++++ linux/mepipe | 4 + linux/merun | 7 + 4 files changed, 1505 insertions(+) create mode 100644 linux/Makefile create mode 100644 linux/estruct.h create mode 100644 linux/mepipe create mode 100644 linux/merun diff --git a/linux/Makefile b/linux/Makefile new file mode 100644 index 0000000..3f82406 --- /dev/null +++ b/linux/Makefile @@ -0,0 +1,117 @@ +# Linux makefile for +# MicroEMACS 5.00 with UTF-8 character set +# (C)Copyright 1995 by Daniel Lawrence +# all rights reserved + +# modify the following lines with the proper relative directories + +# object file directory +OBJD = . +# source file directory +SRCD = ../src +# header file directory +HDIR = ../h + +# options and arguments to the C compiler + +#CFLAGS += -I. -I$(HDIR) +CFLAGS = -g -I. -I$(HDIR) -DLINUX -D_XOPEN_SOURCE_EXTENDED=1 + +# list of header files + +HFILES = estruct.h $(HDIR)/edef.h $(HDIR)/efunc.h $(HDIR)/epath.h $(HDIR)/ebind.h $(HDIR)/eproto.h + +#list of object files + +F1 = $(OBJD)/abbrev.o $(OBJD)/basic.o $(OBJD)/bind.o $(OBJD)/buffer.o $(OBJD)/char.o +F2 = $(OBJD)/crypt.o $(OBJD)/curses.o $(OBJD)/display.o $(OBJD)/dolock.o $(OBJD)/message.o +F3 = $(OBJD)/eval.o $(OBJD)/exec.o $(OBJD)/file.o $(OBJD)/fileio.o $(OBJD)/input.o +F4 = $(OBJD)/isearch.o $(OBJD)/keyboard.o $(OBJD)/libhelp.o $(OBJD)/line.o $(OBJD)/lock.o +F5 = $(OBJD)/main.o $(OBJD)/mouse.o $(OBJD)/screen.o $(OBJD)/random.o $(OBJD)/region.o +F6 = $(OBJD)/search.o $(OBJD)/replace.o $(OBJD)/tags.o $(OBJD)/theox.o $(OBJD)/undo.o +F7 = $(OBJD)/unix.o $(OBJD)/unixterm.o $(OBJD)/utf8.o $(OBJD)/window.o $(OBJD)/word.o + +# product list + +all: emacs + +OFILES = $(F1) $(F2) $(F3) $(F4) $(F5) $(F6) $(F7) + +emacs: $(OFILES) + $(CC) $(CFLAGS) $(OFILES) -lncursesw -lc -o emacs + +$(OBJD)/abbrev.o: $(SRCD)/abbrev.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/abbrev.o $(SRCD)/abbrev.c +$(OBJD)/basic.o: $(SRCD)/basic.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/basic.o $(SRCD)/basic.c +$(OBJD)/bind.o: $(SRCD)/bind.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/bind.o $(SRCD)/bind.c +$(OBJD)/buffer.o: $(SRCD)/buffer.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/buffer.o $(SRCD)/buffer.c +$(OBJD)/char.o: $(SRCD)/char.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/char.o $(SRCD)/char.c +$(OBJD)/crypt.o: $(SRCD)/crypt.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/crypt.o $(SRCD)/crypt.c +$(OBJD)/curses.o: $(SRCD)/curses.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/curses.o $(SRCD)/curses.c +$(OBJD)/cmdfix.o: $(SRCD)/cmdfix.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/cmdfix.o $(SRCD)/cmdfix.c +$(OBJD)/display.o: $(SRCD)/display.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/display.o $(SRCD)/display.c +$(OBJD)/dolock.o: $(SRCD)/dolock.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/dolock.o $(SRCD)/dolock.c +$(OBJD)/message.o: $(SRCD)/message.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/message.o $(SRCD)/message.c +$(OBJD)/eval.o: $(SRCD)/eval.c $(HFILES) $(HDIR)/evar.h + $(CC) $(CFLAGS) -c -o $(OBJD)/eval.o $(SRCD)/eval.c +$(OBJD)/exec.o: $(SRCD)/exec.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/exec.o $(SRCD)/exec.c +$(OBJD)/file.o: $(SRCD)/file.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/file.o $(SRCD)/file.c +$(OBJD)/fileio.o: $(SRCD)/fileio.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/fileio.o $(SRCD)/fileio.c +$(OBJD)/input.o: $(SRCD)/input.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/input.o $(SRCD)/input.c +$(OBJD)/isearch.o: $(SRCD)/isearch.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/isearch.o $(SRCD)/isearch.c +$(OBJD)/keyboard.o: $(SRCD)/keyboard.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/keyboard.o $(SRCD)/keyboard.c +$(OBJD)/libhelp.o: $(SRCD)/libhelp.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/libhelp.o $(SRCD)/libhelp.c +$(OBJD)/line.o: $(SRCD)/line.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/line.o $(SRCD)/line.c +$(OBJD)/lock.o: $(SRCD)/lock.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/lock.o $(SRCD)/lock.c +$(OBJD)/main.o: $(SRCD)/main.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/main.o $(SRCD)/main.c +$(OBJD)/mouse.o: $(SRCD)/mouse.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/mouse.o $(SRCD)/mouse.c +$(OBJD)/unix.o: $(SRCD)/unix.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/unix.o $(SRCD)/unix.c +$(OBJD)/unixterm.o: $(SRCD)/unixterm.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/unixterm.o $(SRCD)/unixterm.c +$(OBJD)/utf8.o: $(SRCD)/utf8.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/utf8.o $(SRCD)/utf8.c +$(OBJD)/random.o: $(SRCD)/random.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/random.o $(SRCD)/random.c +$(OBJD)/region.o: $(SRCD)/region.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/region.o $(SRCD)/region.c +$(OBJD)/screen.o: $(SRCD)/screen.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/screen.o $(SRCD)/screen.c +$(OBJD)/search.o: $(SRCD)/search.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/search.o $(SRCD)/search.c +$(OBJD)/replace.o: $(SRCD)/replace.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/replace.o $(SRCD)/replace.c +$(OBJD)/tags.o: $(SRCD)/tags.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/tags.o $(SRCD)/tags.c +$(OBJD)/theox.o: $(SRCD)/theox.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/theox.o $(SRCD)/theox.c +$(OBJD)/undo.o: $(SRCD)/undo.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/undo.o $(SRCD)/undo.c +$(OBJD)/window.o: $(SRCD)/window.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/window.o $(SRCD)/window.c +$(OBJD)/word.o: $(SRCD)/word.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/word.o $(SRCD)/word.c + +clean: + rm -f *.o emacs diff --git a/linux/estruct.h b/linux/estruct.h new file mode 100644 index 0000000..3e14a7e --- /dev/null +++ b/linux/estruct.h @@ -0,0 +1,1377 @@ +/* ESTRUCT: Structure and preprocesser defined for + MicroEMACS 4.01 + + (C)Copyright 1997 by Daniel Lawrence + written by Daniel Lawrence + based on code by Dave G. Conroy, + Steve Wilhite and George Jones + + Unicode support by Jean-Michel Dubois +*/ + +#ifdef LATTICE +#undef LATTICE /* don't use their definitions...use ours */ +#endif +#ifdef MSDOS +#undef MSDOS +#endif +#ifdef WINNT +#undef WINNT +#endif +#ifdef AMIGA +#undef AMIGA +#endif +#ifdef EGA +#undef EGA +#endif +#ifdef CTRLZ +#undef CTRLZ +#endif + +/* Program Identification..... + + PROGNAME should always be MicroEMACS for a distribution + unmodified version. People using MicroEMACS as a shell + for other products should change this to reflect their + product. Macros can query this via the $progname variable +*/ + +#define PROGNAME "MicroEMACS" +#define VERSION "5.10e" + +/* Machine/OS definitions */ +/* [Set one of these!!] */ + +#define AMIGA 0 /* AmigaDOS */ +#define AOSVS 0 /* Data General AOS/VS */ +#define AUX 0 /* Apple UNIX for Macintosh */ +#define AIX 0 /* IBM UNIX for various machines*/ +#define AVIION 0 /* Data General AViiON */ +#define BSD 0 /* UNIX BSD 4.2 and ULTRIX */ +#define FINDER 0 /* Macintosh OS */ +#define FREEBSD 0 /* FREEBSD 386 version 2 or + */ +#define HPUX8 0 /* HPUX HP 9000 ver 8 or less */ +#define HPUX9 0 /* HPUX HP 9000 ver 9 */ +#define MPE 0 /* HP MPE/XL */ +#define MSDOS 0 /* MS-DOS */ +#define WINNT 0 /* MS-Win NT */ +#define WINXP 0 /* Windows XP/Visual studio 2008*/ +#define OS2 0 /* Microsoft or IBM OS/2 */ +#define SMOS 0 /* Supermax UNIX System V */ +#define SUN 0 /* SUN v4.0 */ +#define TOS 0 /* ST520, TOS */ +#define USG 1 /* UNIX system V */ +#define VMS 0 /* VAX/VMS */ +#define WMCS 0 /* Wicat's MCS */ +#define XENIX 0 /* IBM-PC SCO XENIX */ +#define LINUX 1 /* Linux */ + +#if LINUX +#undef USG +#define USG 1 +#endif +/* Compiler definitions */ +/* [Set one of these!!] */ +#define ALCYON 0 /* ALCYON Atari ST compiler */ +#define AZTEC 0 /* Aztec C 4.00e ONLY for the amiga now... */ +#define DGC 0 /* Data General AOS/VS C... */ +#define GCC 1 /* the GNU C compiler */ +#define IC 0 /* Rational Systems Instant C */ +#define LATTICE 0 /* Lattice 2.14 through 3.0 compilers */ +#define MSC 0 /* MicroSoft C compile version 3 and up */ +#define MWC 0 /* Mark Williams C */ +#define TURBO 0 /* Turbo C and Borland C++ under MSDOS */ +#define UNIX 0 /* a standard UNIX compiler (cc) */ +#define ZTC 0 /* Zortech C/C++ 1.02 thru 2.10 under MSDOS */ + +/* Machine stack growth direction. */ +/* [Set this to 1 if your machine stack grows UP!!!] */ +/* data general mv/eclipse series stack grows up. */ +/* dec vax series stack grows down... got it??? */ + +#define STACK_GROWS_UP 0 + +/* Debugging options */ +#define RAMSIZE 0 /* dynamic RAM memory usage tracking */ +#define RAMSHOW 0 /* auto dynamic RAM reporting */ +#define RAMTRCK 0 /* send debug info to MALLOC.DAT */ +#define DEBUG_SEARCH 0 /* pop some search info on patterns */ + +/* Special keyboard/network definitions */ + +#define ATKBD 0 /* AT-style keyboard with F11, F12 & grey keys */ +#define WANGPC 0 /* WangPC - mostly escape sequences */ +#define VT100 0 /* Handle VT100 style keypad - NOT VMS. */ +#define KEYPAD 0 /* VMS - turn on and off application */ + /* keypad automatically */ +#define XONDATA 0 /* VMS - set to force /NOTTSYNC/NOHOSTSY */ +#define RMSIO 0 /* VMS - skip the rotten C runtime and */ + /* use RMS directly */ +#define OPTMEM 0 /* VMS 5.0 and up - use a less standard */ + /* but more efficient memory allocator */ + +/* Terminal Output definitions */ +/* [Set one of these!!] */ + +#define ANSI 0 /* ANSI escape sequences */ +#define CURSES 1 /* Use CURSES */ +#define DASHER 0 /* DG Dasher 2xx/4xx crts */ +#define DG10 0 /* Data General system/10 */ +#define FMR 0 /* Fujitsu FMR series driver */ +#define HP110 0 /* HP110 screen driver */ +#define HP150 0 /* HP150 screen driver */ +#define I55 0 /* IBM PS55 DOS J4.0/V */ +#define IBMPC 0 /* IBM-PC CGA/MONO/EGA/VGA drvr */ +#define MAC 0 /* Macintosh */ +#define NEC 0 /* NEC-9801VM driver */ +#define OS2NPM 0 /* OS/2 non-Presentation Mgr. */ +#define SMG 0 /* SMG library on VMS */ +#define ST52 0 /* Atari 520/1040ST screen */ +#define TERMCAP 0 /* Use TERMCAP */ +#define TIPC 0 /* TI Professional PC driver */ +#define VT52 0 /* VT52 terminal (Zenith). */ +#define NTCON 0 /* Windows NT console */ +#define XPCON 0 /* windows XP console app */ +#define XVT 0 /* XVT windowing system */ +#define Z309 0 /* Zenith 100 PC family driver */ + +/* Windowing system style (pick one) */ + +#define WINDOW_TEXT 1 /* [default] Text mode */ +#define WINDOW_MSWIN 0 /* MicroSoft Windows */ +#define WINDOW_MSWIN32 0 /* MicroSoft Windows 32 bit API */ +#define WINDOW_X 0 /* X/Unix */ + +/* Language text options (pick one) */ + +#define ENGLISH 1 /* [default] */ +#define FRENCH 0 +#define SPANISH 0 +#define GERMAN 0 +#define DUTCH 0 +#define PLATIN 0 /* Pig Latin */ +#define JAPAN 0 +#define LATIN 0 /* real Latin */ + +/* Configuration options */ + +#define TYPEAH 1 /* type ahead causes update to be skipped */ +#define LOGFLG 0 /* send all executed commands to EMACS.LOG */ +#define VISMAC 0 /* update display during keyboard macros */ +#define CTRLZ 0 /* add a ^Z at end of files under MSDOS only */ +#define CLEAN 0 /* de-alloc memory on exit */ +#define CALLED 0 /* is emacs a called subroutine? or stand alone */ + +#define REVSTA 0 /* Status line appears in reverse video */ +#define COLOR 1 /* color commands and windows */ + +#define FILOCK 1 /* file locking under unix BSD 4.2 */ +#define ISRCH 1 /* Incremental searches like ITS EMACS */ +#define FLABEL 0 /* function key label code [HP150] */ +#define CRYPT 1 /* file encryption enabled? */ +#define MAGIC 1 /* include regular expression matching? */ +#define MOUSE 1 /* Include routines for mouse actions */ +#define NOISY 1 /* Use a fancy BELL if it exists */ +#define CTAGS 1 /* include vi-like tagging? */ +#define VARARG 1 /* use varargs.h for mlwrite() */ + +#if XVT +#undef COLOR +#define COLOR 1 /* overide this to be TRUE for XVT always */ +#endif + +#define JMDEXT 1 /* enable J-M Dubois' extensions */ + +#if JMDEXT +#define BACKUP 1 /* backup previous file version */ +#define LIBHELP 1 /* online help for C functions */ +#define DYNMSGS 1 /* dynamic load of messages */ +#define THEOX 1 /* allow TheoX character set files edition */ + /* including semi-graphics entry from numeric */ + /* keypad (require UTF8) */ +#define TXBASIC 1 /* TxBasic IDE menu */ +#endif + +#if DYNMSGS +#define OQUOTE_CHAR 34 +#define CQUOTE_CHAR 34 +#endif + +/* Character set options */ +/* [Set one of these!!] */ +#define ASCII 0 /* use ASCII char sequences */ +#define EBCDIC 0 /* later IBM mainfraim versions will use EBCDIC */ +#define UTF8 1 /* use UTF-8 encoded Unicode */ + +#if UTF8 +#include "utf8.h" +#include +#else +#undef THEOX +#define THEOX 0 +#endif + +/* handle constant and voids properly */ + +#if VMS +#define CONST readonly +#define VOID void +#define NOSHARE noshare +#else +#if AOSVS +#define CONST $shared $align(1) /* fake a const */ +#define VOID +#define NOSHARE $low32k $align(1) /* attempt to optimize read/write vars. */ +#else + +#if __STDC__ || MSC || TURBO || GCC || (AMIGA && LATTICE) +#define CONST const +#define VOID void +#define NOSHARE +#else +#define CONST +#if IC +#define VOID void +#else +#define VOID +#endif +#define NOSHARE +#endif + +#endif +#endif + +/* System dependent library redefinitions, structures and includes */ + +/* multibyte character support? */ + +#if NEC || FMR || I55 +#define DBCS 1 /* double byte character sets enabled */ +#define INSDEL 1 /* use insert/delete line display optimizations */ + +/* define DBCS prefix bytes */ +#define is2char(ch) (((ch&0xff) >= 0x81 && (ch&0xff) <= 0x9f) || ((ch&0xff) >=0xe0 && (ch&0xff) <= 0xfc)) + +#else +#define DBCS 0 +#define INSDEL 0 +#endif + +/* Can we catch the SIGWINCH (the window size change signal)? */ + +#if AIX || HPUX9 || LINUX +#define HANDLE_WINCH 1 +#else +#define HANDLE_WINCH 0 +#endif + +/* Prototypes in use? */ + +#if MSC || TURBO || IC || VMS || GCC || ZTC +#define PROTO 1 +#else +#define PROTO 0 +#endif + +/* the following define allows me to initialize unions... + otherwise we make them structures (like the keybinding table) */ + +#if __STDC__ || MSC || TURBO || IC || ZTC +#define ETYPE union +#else +#define ETYPE struct +#endif + +/* Instant C can't do stat()s. Arrrg. No file locking for you */ +#if IC && MSDOS +#undef FILOCK +#define FILOCK 0 +#endif + +/* Mark Williams/Atari has no standard or varargs or directory functions */ +#if TOS & MWC +#undef VARARG +#define VARARG 0 +#undef FILOCK +#define FILOCK 0 +#endif + +/* MS-Windows */ + +#if WINNT || WINDOW_MSWIN || WINDOW_MSWIN32 +#if WINDOW_MSWIN32 +#undef WINDOW_MSWIN +#define WINDOW_MSWIN 1 +#endif +#if WINDOW_MSWIN && (WINNT || WINXP) +#undef WINDOW_MSWIN32 +#define WINDOW_MSWIN32 1 +#endif +#if 1 +#undef MAC /* Mac conflicts with a definition used by rpc.h */ +#undef VOID /* windows.h will wind up defining this when compiled as a console app */ +#include /* --------- Huge include file here !!! ---------*/ +#ifndef VOID +#define VOID void /* Redefine, incase we are compiled as a Windows app */ +#endif +#endif +#if NTCON +#include +#include +#include +#endif + +#undef NEAR +#define NEAR +#define DNEAR +#if MSC || IC +#undef CDECL +#define CDECL __cdecl +#define DUMMYSZ 1 /* dummy size for unsized extern arrays to avoid + silly DGROUP fixup */ +#else +#if TURBO +#define DUMMYSZ /* nothing */ +#else +#define CDECL _cdecl /* ZTC */ +#define DUMMYSZ /* nothing */ +#endif +#endif + +#if (WINNT || WINXP) && !WINDOW_MSWIN +#define EXPORT /* Windows NT doesn't like this */ +#endif + +#if WINDOW_MSWIN +#undef TYPEAH +#define TYPEAH 0 /* typeahead is handled at the term driver level */ +#undef CALLED +#define CALLED 1 /* under MS Windows, "main" resides in the sys driver */ +#if WINNT || WINXP +#define EXPORT /* Windows NT doesn't like this */ +#elif MSC +#define EXPORT __export +#else +#define EXPORT _export /* Fine for TURBO and ZTC */ +#endif +#endif +#else + +/* neither Windows NT nor MS-Windows */ + +#define DUMMYSZ /* nothing */ + +#if MSDOS & (TURBO | MSC | TIPC) +#define NEAR +#define DNEAR +#define pascal +#define CDECL cdecl +#else +#if MSDOS & ZTC +#define NEAR +#define DNEAR +#define _pascal +#define CDECL _cdecl +#else +#define NEAR +#define DNEAR +#define PASCAL +#define CDECL +#endif +#endif + +#endif + +#if TURBO +#include +#include +#undef peek +#undef poke +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#endif + +#if IC +#include +#undef peek +#undef poke +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#endif + +#if LATTICE & MSDOS +/* you may have to remove this one definition with LATTICE version + 3.2 and above */ +#define unsigned +#endif + +#if IC +#define inp inportb +#define outp outportb +#define intdos(a, b) int86(33, a, b) +#endif + +#if AZTEC +#undef putc +#undef getc +#if MSDOS +#define getc a1getc +#define int86 sysint +#define intdos(a, b) sysint(33, a, b) +#define inp inportb +#define outp outportb +#else +#define getc agetc +#endif +#define putc aputc + +struct XREG { + unsigned ax,bx,cx,dx,si,di,ds,es; +}; + +struct HREG { + char al,ah,bl,bh,cl,ch,dl,dh,d1,d2,e1,e2; +}; + +union REGS { + struct XREG x; + struct HREG h; +}; + +struct SREGS { + unsigned cs, ss, ds, es; +}; +#endif + +#if MSDOS & MWC +#include +#define int86(a, b, c) intcall(b, c, a) +#define intdos(a, b) intcall(a, b, DOSINT) +#define inp(a) in(a) +#define outp(a, b) out(a, b) +#define movmem(a, b, c) memcpy(b, a, c) + +struct XREG { + unsigned int ax,bx,cx,dx,si,di,ds,es,flags; +}; + +struct HREG { + char al,ah,bl,bh,cl,ch,dl,dh; + unsigned int ds,es,flags; +}; + +union REGS { + struct XREG x; + struct HREG h; +}; +#endif + +#if MSDOS & MSC +#include +#include +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#define movmem(a, b, c) memcpy(b, a, c) +#define _strrev(a) strrev(a) +#endif + +#if MSDOS & LATTICE +#undef CPM +#undef LATTICE +#include +#undef CPM +#endif + +/* System V doesn't name this the same as others */ +#if USG | AIX | AUX | SUN | (OS2 & MSC) +#define movmem(a, b, c) memcpy(b, a, c) +#define min(a,b) ((a)>(b)?(b):(a)) +#define max(a,b) ((a)>(b)?(a):(b)) +#endif + +/* this keeps VMS happy */ +#if VMS +#define getname xgetname +#define unlink(a) delete(a) +#endif + +/* some options for AOS/VS */ +#if AOSVS +#define ORMDNI 1 +#endif + +/* define some ability flags */ + +#if (IBMPC | Z309 | FMR | TIPC) & !(WINDOW_MSWIN | WINDOW_MSWIN32) +#define MEMMAP 1 +#else +#define MEMMAP 0 +#endif + +#if MSDOS | WINNT | WINXP | OS2 | USG | AIX | AUX | SMOS | HPUX8 | HPUX9 | BSD | FREEBSD | (TOS & MWC) | WMCS | SUN | MPE +#define ENVFUNC 1 +#else +#define ENVFUNC 0 +#endif + +#if AUX +#define RETCHAR '\n' +#else +#define RETCHAR '\r' +#endif + +#if THEOS +#define _CTYPE_NO_MACRO 1 +#define RET_CHAR '\n' +#else +#define RET_CHAR '\r' +#endif + +#if MPE +#define DIRSEPSTR "." +#define DIRSEPCHAR '.' +#else +#if TOS || MSDOS || WINNT || WINXP || OS2 +#define DIRSEPSTR "\\" +#define DIRSEPCHAR '\\' +#define DRIVESEPCHAR ':' +#else +#define DIRSEPSTR "/" +#define DIRSEPCHAR '/' +#define DRIVESEPCHAR '\0' +#endif +#endif + +#if VARARG +#if (GCC == 0) && (USG || AIX || AUX || BSD || FREEBSD || SUN || XENIX || HPUX8 || HPUX9 || AVIION || MPE) +#define VARG 1 +#define SARG 0 +#include +#else +#define VARG 0 +#define SARG 1 +#include +#endif +#endif + +#if ZTC +#include +#define movmem(a, b, c) memcpy(b, a, c) +#endif + +/* Emacs global flag bit definitions (for gflags) */ + +#define GFREAD 1 /* read first file in at startup */ +#define GFSDRAW 2 /* suppress a screen redraw */ +#define GFEXIT 4 /* exit from emacs pending */ + +/* internal constants */ + +#define NBINDS 300 /* max # of bound keys */ +#if AOSVS | VMS | WINNT | WINXP | SUN | BSD | FREEBSD | USG | ZENIX | HPUX8 | HPUX9 | OS2 +#define NFILEN 256 +#else +#define NFILEN 80 /* # of bytes, file name */ +#endif +#define NBUFN 128 /* # of bytes, buffer name */ +#define NLINE 512 /* # of bytes, input line */ +#define NSTRING 512 /* # of bytes, string buffers */ +#define NKBDM 4096 /* # of strokes, keyboard macro */ +#define NPAT 512 /* # of bytes, pattern */ +#define HUGENUM 1000 /* Huge number */ +#define NLOCKS 256 /* max # of file locks active */ +#define NCOLORS 16 /* number of supported colors */ +#define KBLOCK 250 /* sizeof kill buffer chunks */ +#define NRING 16 /* # of buffers in kill ring */ +#define NBLOCK 16 /* line block chunk size */ +#define NVSIZE 16 /* max #chars in a var name */ +#define NMARKS 16 /* number of marks */ +#define MAXSYM 32 /* max # chars in symbol to expand */ +#define MINFLEN 3 /* min # chars to match &func */ + +#if UTF8 +#define CTRL 0x01000000 /* Control flag, or'ed in */ +#define META 0x02000000 /* Meta flag, or'ed in */ +#define CTLX 0x04000000 /* ^X flag, or'ed in */ +#define SPEC 0x08000000 /* special key (function keys) */ +#define MOUS 0x10000000 /* alternative input device (mouse) */ +#define SHFT 0x20000000 /* shifted (for function keys) */ +#define ALTD 0x40000000 /* ALT key... */ +#define MENU MOUS+SPEC /* menu selection (WINDOW_MSWIN) */ +#define CMSK 0x00FFFFFF /* Character mask */ +#define SHIFTPFX 24 /* prefix shift in unsigned int */ +#else +#define CTRL 0x0100 /* Control flag, or'ed in */ +#define META 0x0200 /* Meta flag, or'ed in */ +#define CTLX 0x0400 /* ^X flag, or'ed in */ +#define SPEC 0x0800 /* special key (function keys) */ +#define MOUS 0x1000 /* alternative input device (mouse) */ +#define SHFT 0x2000 /* shifted (for function keys) */ +#define ALTD 0x4000 /* ALT key... */ +#define MENU MOUS+SPEC /* menu selection (WINDOW_MSWIN) */ +#define CMSK 0x00FF /* Character mask */ +#define SHIFTPFX 8 /* prefix shift in unsigned int */ +#endif + +#define BINDNUL 0 /* not bound to anything */ +#define BINDFNC 1 /* key bound to a function */ +#define BINDBUF 2 /* key bound to a buffer */ + +#ifdef FALSE +#undef FALSE +#endif +#ifdef TRUE +#undef TRUE +#endif + +#define FALSE 0 /* False, no, bad, etc. */ +#define TRUE 1 /* True, yes, good, etc. */ +#define ABORT 2 /* Death, ^G, abort, etc. */ +#define FAILD 3 /* not-quite fatal false return */ + +#define STOP 0 /* keyboard macro not in use */ +#define PLAY 1 /* playing */ +#define RECORD 2 /* recording */ + +/* Completion types */ + +#define CMP_BUFFER 0 +#define CMP_COMMAND 1 +#define CMP_FILENAME 2 + +/* Directive definitions */ + +#define DIF 0 +#define DELSE 1 +#define DENDIF 2 +#define DGOTO 3 +#define DRETURN 4 +#define DENDM 5 +#define DWHILE 6 +#define DENDWHILE 7 +#define DBREAK 8 +#define DFORCE 9 + +#define NUMDIRS 10 + +/* + * PTBEG, PTEND, FORWARD, and REVERSE are all toggle-able values for + * routines that need directions. + */ +#define PTBEG 0 /* Leave the point at the beginning on search */ +#define PTEND 1 /* Leave the point at the end on search */ +#define FORWARD 0 /* do things in a forward direction */ +#define REVERSE 1 /* do things in a backwards direction */ + +#define FIOSUC 0 /* File I/O, success. */ +#define FIOFNF 1 /* File I/O, file not found. */ +#define FIOEOF 2 /* File I/O, end of file. */ +#define FIOERR 3 /* File I/O, error. */ +#define FIOMEM 4 /* File I/O, out of memory */ +#define FIOFUN 5 /* File I/O, eod of file/bad line*/ +#define FIODEL 6 /* Can't delete/rename file */ + +#if WINDOW_MSWIN +/* values for the fbusy flag */ +#define FREADING 1 /* file read in progress */ +#define FWRITING 2 /* file write in progress */ +/* if no file activity, the value FALSE is used */ +#endif + +#define CFCPCN 0x0001 /* Last command was C-P, C-N */ +#define CFKILL 0x0002 /* Last command was a kill */ +#define CFSRCH 0x0004 /* last command was a search */ +#define CFYANK 0x0008 /* last command was a yank */ + +#define SRNORM 0 /* end past, begin front */ +#define SRBEGIN 1 /* always at front */ +#define SREND 2 /* always one past end */ + +#define BELL 0x07 /* a bell character */ +#define TAB 0x09 /* a tab character */ + +#if USG | AIX | AUX | SMOS | HPUX8 | HPUX9 | BSD | FREEBSD | SUN | XENIX | AVIION +#define PATHCHR ':' +#else +#if WMCS || MPE +#define PATHCHR ',' +#else +#define PATHCHR ';' +#endif +#endif + +#define INTWIDTH sizeof(int) * 3 +#define LONGWIDTH sizeof(long) * 3 + +/* Macro argument token types */ + +#define TKNUL 0 /* end-of-string */ +#define TKARG 1 /* interactive argument */ +#define TKBUF 2 /* buffer argument */ +#define TKVAR 3 /* user variables */ +#define TKENV 4 /* environment variables */ +#define TKFUN 5 /* function.... */ +#define TKDIR 6 /* directive */ +#define TKLBL 7 /* line label */ +#define TKLIT 8 /* numeric literal */ +#define TKSTR 9 /* quoted string literal */ +#define TKCMD 10 /* command name */ + +/* Internal defined functions */ + +#define nextab(a) (a - (a % tabsize)) + tabsize + +/* DIFCASE represents the integer difference between upper + and lower case letters. It is an xor-able value, which is + fortunate, since the relative positions of upper to lower + case letters is the opposite of ascii in ebcdic. +*/ + +#if ASCII +#define DIFCASE 0x20 +#else +#define DIFCASE 0x40 +#endif + +/* Dynamic RAM tracking and reporting redefinitions */ + +#if RAMSIZE +#define malloc Eallocate +#define free Erelease +#else +#if VMS & OPTMEM +#define malloc VAXC$MALLOC_OPT +#define free VAXC$FREE_OPT +#define calloc VAXC$CALLOC_OPT +#define realloc VAXC$REALLOC_OPT +#define cfree VAXC$CFREE_OPT +#endif +#endif + +/* under MS Windows, we use dialog boxes to prompt the user for filenames */ +#if WINDOW_MSWIN +#define FILENAMEREPLY(p,b,nb) filenamedlg(p,b,nb,TRUE) +#else +#define FILENAMEREPLY(p,b,nb) mlreply(p,b,nb) +#endif + +/* colors respresented as parameters to WORDs and Screen positions */ + +#define CLRVAL unsigned int + +/* formal parameters to procedures are stored as a linked list + of argument names using the following simple structure: +*/ + +typedef struct PARG { + struct PARG *next; /* ptr to next linked argument */ + char name[NVSIZE+1]; /* name of the argument */ +} PARG; + +/* UNDO definitions and types */ + +typedef int OPTYPE; /* type of operation being recorded/played back */ + +#define OP_CMND 1 /* beginning of command */ +#define OP_DELC 2 /* delete a single character */ +#define OP_INSC 3 /* insert a single character */ +#define OP_DSTR 4 /* delete a string of characters */ +#define OP_ISTR 5 /* insert a string of characters */ +#define OP_REPC 6 /* replace a character */ +#define OP_CPOS 7 /* set the cursor position */ + +/* object to be undone! */ + +typedef union OBJECT { + char obj_char; /* a character */ + char obj_string[1]; /* many characters */ + char *obj_sptr; /* a ptr to a character */ +} OBJECT; + +typedef struct UNDO_OBJ { + struct UNDO_OBJ *next; /* ptr to next undo object */ + OPTYPE type; /* type of operation */ + long line_num; /* line offset from buffer beginning */ + int offset; /* offset into that line */ + long count; /* repetitions? */ + OBJECT undo_obj; /* object to be undone */ +} UNDO_OBJ; + +/* + * There is a window structure allocated for every active display window. The + * windows are kept in a big list, in top to bottom screen order, with the + * listhead at "wheadp". Each window contains its own values of dot and mark. + * The flag field contains some bits that are set by commands to guide + * redisplay. Although this is a bit of a compromise in terms of decoupling, + * the full blown redisplay is just too expensive to run for every input + * character. + */ +typedef struct EWINDOW { + struct EWINDOW *w_wndp; /* Next window */ + struct BUFFER *w_bufp; /* Buffer displayed in window */ + struct LINE *w_linep; /* Top line in the window */ + struct LINE *w_dotp; /* Line containing "." */ + short w_doto; /* Byte offset for "." */ + struct LINE *w_markp[NMARKS]; /* Line containing "mark" */ + short w_marko[NMARKS]; /* Byte offset for "mark" */ + char w_toprow; /* Origin 0 top row of window */ + char w_ntrows; /* # of rows of text in window */ + char w_force; /* If NZ, forcing row. */ + char w_flag; /* Flags. */ +#if COLOR + char w_fcolor; /* current forground color */ + char w_bcolor; /* current background color */ +#endif + int w_fcol; /* first column displayed */ +} EWINDOW; + +#define WFFORCE 0x01 /* Window needs forced reframe */ +#define WFMOVE 0x02 /* Movement from line to line */ +#define WFEDIT 0x04 /* Editing within a line */ +#define WFHARD 0x08 /* Better to a full display */ +#define WFMODE 0x10 /* Update mode line. */ +#define WFCOLR 0x20 /* Needs a color change */ + +/* This structure holds the information about each line appearing on the + * video display. The redisplay module uses an array of virtual display + * lines. On systems that do not have direct access to display memory, + * there is also an array of physical display lines used to minimize + * video updating. In most cases, these two arrays are unique. If + * WINDOW_MSWIN is 1, there is a pair of such arrays in each ESCREEN + * structure. + */ + +typedef struct VIDEO { + int v_flag; /* Flags */ +#if COLOR + int v_fcolor; /* current forground color */ + int v_bcolor; /* current background color */ + int v_rfcolor; /* requested forground color */ + int v_rbcolor; /* requested background color */ +#endif + int v_left; /* left edge of reverse video */ + int v_right; /* right right of reverse video */ +#if INSDEL && MEMMAP == 0 + int v_rline; /* requested screen line # */ +#endif +#if UTF8 + unsigned int v_text[1]; /* Screen data. */ +#else + char v_text[1]; /* Screen data. */ +#endif +} VIDEO; + +#define VFNEW 0x0001 /* contents not meaningful yet */ +#define VFCHG 0x0002 /* Changed flag */ +#define VFEXT 0x0004 /* extended (beyond column 80) */ +#define VFREV 0x0008 /* reverse video status */ +#define VFREQ 0x0010 /* reverse video request */ +#define VFCOL 0x0020 /* color change requested */ + +/* + * This structure holds the information about each separate "screen" + * within the current editing session. On a character based system, these + * screens overlay each other, and can individually be brought to front. + * On a windowing system like MicroSoft Windows 3.0, OS/2, the Macintosh, + * Intuition, Sunview or X-windows, each screen is represented in an OS + * window. The terminolgy is wrong in emacs..... + * + * EMACS The outside World + * screen window + * window pane + */ + +typedef struct ESCREEN { + struct ESCREEN *s_next_screen; /* link to next screen in list */ + EWINDOW *s_first_window; /* head of linked list of windows */ + EWINDOW *s_cur_window; /* current window in this screen */ + char *s_screen_name; /* name of the current window */ + short s_roworg; /* row origin of stored screen */ + short s_colorg; /* column origin of stored screen */ + short s_nrow; /* row width of stored screen */ + short s_ncol; /* column origin of stored screen */ +#if WINDOW_MSWIN + VIDEO **s_virtual; /* virtual screen contents */ + VIDEO **s_physical; /* physical screen contents */ + HWND s_drvhandle; /* handle for the "term" driver */ +#endif +} ESCREEN; + +/* + * Text is kept in buffers. A buffer header, described below, exists for every + * buffer in the system. The buffers are kept in a big list, so that commands + * that search for a buffer by name can find the buffer header. There is a + * safe store for the dot and mark in the header, but this is only valid if + * the buffer is not being displayed (that is, if "b_nwnd" is 0). The text for + * the buffer is kept in a circularly linked list of lines, with a pointer to + * the header line in "b_linep". Buffers may be "Inactive" which means the + * files associated with them have not been read in yet. These get read in + * at "use buffer" time. + * Some buffers are really procedures and have a little extra information + * stored with them. + */ +typedef struct BUFFER { + struct BUFFER *b_bufp; /* Link to next BUFFER */ + struct LINE *b_dotp; /* Link to "." LINE structure */ + short b_doto; /* Offset of "." in above LINE */ + struct LINE *b_markp[NMARKS]; /* The same as the above two, */ + short b_marko[NMARKS]; /* but for the "mark" */ + int b_fcol; /* first column to display */ + struct LINE *b_linep; /* Link to the header LINE */ + struct LINE *b_topline; /* Link to narrowed top text */ + struct LINE *b_botline; /* Link to narrowed bottom text */ + char b_active; /* window activated flag */ + char b_nwnd; /* Count of windows on buffer */ + char b_exec; /* how many active executions */ + char b_flag; /* Flags */ + int b_mode; /* editor mode of this buffer */ + char b_fname[NFILEN]; /* File name */ + char b_bname[NBUFN]; /* Buffer name */ +#if CRYPT + char b_key[NPAT]; /* current encrypted key */ +#endif + int b_numargs; /* number of arguments to procedure */ + PARG *b_args; /* ptr to the first argument */ + UNDO_OBJ *undo_head; /* head of undo stack for buffer */ + long undo_count; /* # of undo operations stacked */ + long last_access; /* time of last access */ +#if UTF8 + short b_charset; /* character set */ +#endif +} BUFFER; + +#define BFINVS 0x01 /* Internal invisible buffer */ +#define BFCHG 0x02 /* Changed since last write */ +#define BFTRUNC 0x04 /* buffer was truncated when read */ +#define BFNAROW 0x08 /* buffer has been narrowed */ +#if LIBHELP +#define BFERROR 0x40 /* Error file buffer */ +#define BFHELP 0x80 /* Buffer is a help buffer */ +#endif + +#define NOTPROC -1 /* buffer is not a procedure */ + +/* mode flags */ +#if THEOX +#define NUMMODES 15 /* # of defined modes */ +#elif JMDEXT +#define NUMMODES 14 /* # of defined modes */ +#else +#define NUMMODES 11 /* # of defined modes */ +#endif + +#define MDWRAP 0x0001 /* word wrap */ +#define MDCMOD 0x0002 /* C indentation and fence match*/ +#define MDSPELL 0x0004 /* spell error parsing */ +#define MDEXACT 0x0008 /* Exact matching for searches */ +#define MDVIEW 0x0010 /* read-only buffer */ +#define MDOVER 0x0020 /* overwrite mode */ +#define MDMAGIC 0x0040 /* regular expressions in search */ +#define MDCRYPT 0x0080 /* encryption mode active */ +#define MDASAVE 0x0100 /* auto-save mode */ +#define MDREPL 0x0200 /* replace mode */ +#define MDABBR 0x0400 /* abbreviation expansion mode */ +#if JMDEXT +#define MDNOBAK 0x0800 /* no auto backup */ +#define MDSLINE 0x1000 /* single line graphics */ +#define MDDLINE 0x2000 /* double line graphics */ +#if THEOX +#define MDTHEOX 0x4000 /* TheoX character set file */ +#endif +#endif + +/* + * The starting position of a region, and the size of the region in + * characters, is kept in a region structure. Used by the region commands. + */ +typedef struct { + struct LINE *r_linep; /* Origin LINE address. */ + short r_offset; /* Origin LINE offset. */ + long r_size; /* Length in characters. */ +} REGION; + +/* + * All text is kept in circularly linked lists of "LINE" structures. These + * begin at the header line (which is the blank line beyond the end of the + * buffer). This line is pointed to by the "BUFFER". Each line contains a the + * number of bytes in the line (the "used" size), the size of the text array, + * and the text. The end of line is not stored as a byte; it's implied. + */ +typedef struct LINE { + struct LINE *l_fp; /* Link to the next line */ + struct LINE *l_bp; /* Link to the previous line */ + short l_size; /* Allocated size */ + short l_used; /* Used size */ + char l_text[1]; /* A bunch of characters. */ +} LINE; + +#define lforw(lp) ((lp)->l_fp) +#define lback(lp) ((lp)->l_bp) +#if UNIX && (SUN || HPUX8 || HPUX9 || BSD || FREEBSD) +#define lgetc(lp, n) ((unsigned char)(lp)->l_text[(n)]) +#else +#define lgetc(lp, n) ((lp)->l_text[(n)]) +#endif +#define lputc(lp, n, c) ((lp)->l_text[(n)]=(c)) +#define lused(lp) ((lp)->l_used) +#define lsize(lp) ((lp)->l_size) +#define ltext(lp) ((lp)->l_text) + +/* This structure is used to hold a user variables name and its + current value. These are used for both the global and the + local symbol tables. +*/ + +typedef struct UVAR { + char u_name[NVSIZE + 1]; /* name of user variable */ + char *u_value; /* value (string) */ +} UVAR; + +#define VT_NONE 0 /* don't declare it if not found */ +#define VT_LOCAL 1 /* local to the current procedure */ +#define VT_GLOBAL 2 /* global to all procedures */ + +/* A UTABLE is a user variable table.... containing some header + information and an array of user variable names and definitions. + They are held together in a linked list, the last member of + the list being the global user variable table. +*/ + +typedef struct UTABLE { + struct UTABLE *next; /* ptr to next user variable table */ + int size; /* max number of variables in table */ + BUFFER *bufp; /* ptr to buffer holding procedure + assosiated with this symbol table. */ + UVAR uv[1]; /* list of variable names/definitions + in this variable table */ +} UTABLE; + +/* + * The editor communicates with the display using a high level interface. A + * "TERM" structure holds useful variables, and indirect pointers to routines + * that do useful operations. The low level get and put routines are here too. + * This lets a terminal, in addition to having non standard commands, have + * funny get and put character code too. The calls might get changed to + * "termp->t_field" style in the future, to make it possible to run more than + * one terminal type. + */ +#if PROTO +typedef struct { + short t_mrow; /* max number of rows allowable */ + short t_nrow; /* current number of rows used */ + short t_mcol; /* max Number of columns. */ + short t_ncol; /* current Number of columns. */ + short t_roworg; /* origin row (normally zero) */ + short t_colorg; /* origin column (normally zero)*/ + short t_margin; /* min margin for extended lines*/ + short t_scrsiz; /* size of scroll region " */ + int t_pause; /* # times thru update to pause */ + int (*t_open)(void); /* Open terminal at the start.*/ + int (*t_close)(void); /* Close terminal at end. */ + int (*t_kopen)(void); /* Open keyboard */ + int (*t_kclose)(void); /* Close keyboard */ + int (*t_getchar)(void); /* Get character from keyboard. */ + int (*t_putchar)(int); /* Put character to display. */ + int (*t_flush)(void); /* Flush output buffers. */ + int (*t_move)(int, int);/* Move the cursor, origin 0. */ + int (*t_eeol)(void); /* Erase to end of line. */ + int (*t_eeop)(void); /* Erase to end of page. */ + int (*t_clrdesk)(void); /* Clear the page totally */ + int (*t_beep)(void); /* Beep. */ + int (*t_rev)(int); /* set reverse video state */ + int (*t_rez)(char *); /* change screen resolution */ +#if COLOR + int (*t_setfor)(int); /* set foreground color */ + int (*t_setback)(int); /* set background color */ +#endif +#if INSDEL + int (*t_insline)(int); /* insert a screen line */ + int (*t_delline)(int); /* delete a screen line */ +#endif +#if WINDOW_MSWIN + int (*t_sleep)(int); /* go to sleep for a while */ + int (*t_newscr)(ESCREEN *); /* create new screen display */ + int (*t_delscr)(ESCREEN *); /* destroy screen display */ + int (*t_selscr)(ESCREEN *); /* select screen display */ + int (*t_sizscr)(ESCREEN *); /* resize screen display */ + int (*t_topscr)(ESCREEN *); /* bring screen to top */ +#endif +} TERM; +#else /* TERM structure, no prototyping.*/ + +typedef struct { + short t_mrow; /* max number of rows allowable */ + short t_nrow; /* current number of rows used */ + short t_mcol; /* max Number of columns. */ + short t_ncol; /* current Number of columns. */ + short t_roworg; /* origin row (normally zero) */ + short t_colorg; /* origin column (normally zero)*/ + short t_margin; /* min margin for extended lines*/ + short t_scrsiz; /* size of scroll region " */ + int t_pause; /* # times thru update to pause */ + int (*t_open)(); /* Open terminal at the start. */ + int (*t_close)(); /* Close terminal at end. */ + int (*t_kopen)(); /* Open keyboard */ + int (*t_kclose)(); /* close keyboard */ + int (*t_getchar)(); /* Get character from keyboard. */ + int (*t_putchar)(); /* Put character to display. */ + int (*t_flush)(); /* Flush output buffers. */ + int (*t_move)(); /* Move the cursor, origin 0. */ + int (*t_eeol)(); /* Erase to end of line. */ + int (*t_eeop)(); /* Erase to end of page. */ + int (*t_clrdesk)(); /* Clear the page totally */ + int (*t_beep)(); /* Beep. */ + int (*t_rev)(); /* set reverse video state */ + int (*t_rez)(); /* change screen resolution */ +#if COLOR + int (*t_setfor)(); /* set forground color */ + int (*t_setback)(); /* set background color */ +#endif +#if INSDEL + int (*t_insline)(); /* insert a screen line */ + int (*t_delline)(); /* delete a screen line */ +#endif +#if WINDOW_MSWIN + int (*t_sleep)(); /* go to sleep for a while */ + int (*t_newscr)(); /* create new screen display */ + int (*t_delscr)(); /* destroy screen display */ + int (*t_selscr)(); /* select screen display */ + int (*t_sizscr)(); /* resize screen display */ + int (*t_topscr)(); /* bring screen to top */ +#endif +} TERM; +#endif + + +/* TEMPORARY macros for terminal I/O (to be placed in a machine + dependent place later) */ + +#define TTopen (*term.t_open) +#define TTclose (*term.t_close) +#define TTkopen (*term.t_kopen) +#define TTkclose (*term.t_kclose) +#define TTgetc (*term.t_getchar) +#define TTputc (*term.t_putchar) +#define TTflush (*term.t_flush) +#define TTmove (*term.t_move) +#define TTeeol (*term.t_eeol) +#define TTeeop (*term.t_eeop) +#define TTclrdesk (*term.t_clrdesk) +#define TTbeep (*term.t_beep) +#define TTrev (*term.t_rev) +#define TTrez (*term.t_rez) +#if COLOR +#define TTforg (*term.t_setfor) +#define TTbacg (*term.t_setback) +#endif + +/* Structure for the table of current key bindings */ + +ETYPE EPOINTER { + int (*fp)(); /* C routine to invoke */ + BUFFER *buf; /* buffer to execute */ +}; + +typedef struct { +#if UTF8 + unsigned int k_code; /* Key code */ +#else + short k_code; /* Key code */ +#endif + short k_type; /* binding type (C function or EMACS buffer) */ + ETYPE EPOINTER k_ptr; /* ptr to thing to execute */ +} KEYTAB; + +/* structure for the name binding table */ + +typedef struct { + char *n_name; /* name of function key */ + int (*n_func)(); /* function name is bound to */ +} NBIND; + +/* The editor holds deleted text chunks in the KILL buffer. The + kill buffer is logically a stream of ascii characters, however + due to its unpredicatable size, it gets implemented as a linked + list of chunks. (The d_ prefix is for "deleted" text, as k_ + was taken up by the keycode structure) +*/ + +typedef struct KILL { + struct KILL *d_next; /* link to next chunk, NULL if last */ + char d_chunk[KBLOCK]; /* deleted text */ +} KILL; + +/* When emacs's command interpetor needs to get a variable's name, + rather than it's value, it is passed back as a VDESC variable + description structure. The v_num field is a index into the + appropriate variable table. +*/ + +typedef struct VDESC { + int v_type; /* type of variable */ + int v_num; /* ordinal pointer to variable in list */ + UTABLE *v_ut; /* ptr to appropriate user table if user var */ +} VDESC; + +/* The !WHILE directive in the execution language needs to + stack references to pending whiles. These are stored linked + to each currently open procedure via a linked list of + the following structure +*/ + +typedef struct WHBLOCK { + LINE *w_begin; /* ptr to !while statement */ + LINE *w_end; /* ptr to the !endwhile statement*/ + int w_type; /* block type */ + struct WHBLOCK *w_next; /* next while */ +} WHBLOCK; + +#define BTWHILE 1 +#define BTBREAK 2 + +/* SWORDs are syntactical words to highlight in a different + foreground color. WORDSETs are named lists of these WORDs. +*/ + +typedef struct SWORD { + struct SWORD *wd_next; /* ptr to the next word in the list */ + char *wd_text; /* the actual word */ + CLRVAL wd_color; /* color to display in */ + int wd_symflag; /* TRUE = symbol overiding word boundries + FALSE = word w/ space/symbol delimiters */ +} SWORD; + +typedef struct WORDSET { + struct WORDSET *next; + int tmp; +} WORDSET; + +/* Abbreviations are short symbols that expand to longer strings + when typed into a buffer with no intervening whitespace or commands. + This structure grows dynamically as needed. +*/ + +typedef struct ABBREV { + struct ABBREV *ab_next; /* pointer to the next abbreviation */ + char ab_sym[MAXSYM + 1]; /* name to expand */ + char ab_exp[1]; /* string to expand to */ +} ABBREV; + +/* Search definitions... */ + +/* HICHAR - 1 is the largest character we will deal with. + * BMAPSIZE represents the number of bytes in the bitmap. + */ +#if UTF8 +#define HICHAR 65536 +#else +#define HICHAR 256 +#endif +#define BMAPSIZE HICHAR >> 3 + +/* + * Jump table structures. + */ +typedef struct { + int jump; + int patlen; + int delta[HICHAR]; + char patrn[NPAT]; +} DELTA; + +#if MAGIC +/* + * Defines for the metacharacters in the regular expression + * search routines. MCNIL and GROUP are used in both search + * and replace metachar-arrays. + */ +#define MCNIL 0 /* Like the '\0' for strings.*/ +#define JMPTABLE 1 +#define LITSTRING 2 /* Literal string.*/ +#define LITCHAR 3 /* Literal character.*/ +#define ANY 4 /* Any character but the .*/ +#define CCL 5 +#define NCCL 6 +#define BOL 7 +#define EOL 8 +#define BOWRD 9 +#define EOWRD 10 +#define GRPBEG 11 /* Signal start of group.*/ +#define GRPEND 12 /* Signal end of group.*/ +#define GROUP 13 /* String of group match.*/ +#define DITTO 14 /* Replacement with match string.*/ + +#define CLOSURE 0x0100 /* An or-able value for a closure modifier.*/ +#define CLOSURE_1 0x0200 /* An or-able value for a closure modifier.*/ +#define ZEROONE 0x0400 /* An or-able value for a closure modifier.*/ + +#define ALLCLOS (CLOSURE | CLOSURE_1 | ZEROONE) +#define MASKCLO (~ALLCLOS) + +#define MC_ANY '.' /* 'Any' character (except newline).*/ +#define MC_CCL '[' /* Character class.*/ +#define MC_NCCL '^' /* Negate character class.*/ +#define MC_RCCL '-' /* Range in character class.*/ +#define MC_ECCL ']' /* End of character class.*/ +#define MC_BOL '^' /* Beginning of line.*/ +#define MC_EOL '$' /* End of line.*/ +#define MC_CLOSURE '*' /* Closure - zero to many characters match.*/ +#define MC_CLOSURE_1 '+' /* Closure - one to many characters match.*/ +#define MC_ZEROONE '?' /* Closure - zero to one characters match.*/ +#define MC_DITTO '&' /* Use matched string in replacement.*/ +#define MC_GRPBEG '(' /* Start of group (begun with a backslash).*/ +#define MC_GRPEND ')' /* End of group (begun with a backslash).*/ +#define MC_BOWRD '<' /* Beginning of word (begun with a backslash).*/ +#define MC_EOWRD '>' /* End of word (begun with a backslash).*/ +#define MC_ESC '\\' /* Escape - suppress meta-meaning.*/ + +#define MAXGROUPS 10 /* 1 + maximum # of r. e. groups. */ +#define BIT(n) (1 << (n)) /* An integer with one bit set.*/ + +/* Typedefs that define the bitmap type for searching (EBITMAP), + * the meta-character structure for MAGIC mode searching (MC), + * and the meta-character structure for MAGIC mode replacment (RMC). + */ +typedef char *EBITMAP; + +typedef struct { + short int mc_type; + union { + int lchar; + int group_no; + char *lstring; + DELTA *jmptable; + EBITMAP cclmap; + } u; +} MC; + +typedef struct { + short int mc_type; + union { + int group_no; + char *rstr; + } u; +} RMC; +#endif + +/* + This is the message which should be added to any "About MicroEMACS" + boxes on any of the machines with window managers. + + + ------------------------------------------ + | | + | MicroEMACS v4.xx | + | for the ............ | + | | + | Text Editor and Corrector | + | | + | written by Daniel M. Lawrence | + | [based on code by Dave Conroy] | + | | + | Send inquiries and donations to: | + | 617 New York St | + | Lafayette, IN 47901 | + | | + ------------------------------------------ +*/ diff --git a/linux/mepipe b/linux/mepipe new file mode 100644 index 0000000..d514d8b --- /dev/null +++ b/linux/mepipe @@ -0,0 +1,4 @@ +# to allow non interactive command to be piped and return exit code 0 +#!/bin/bash +$* +exit 0 \ No newline at end of file diff --git a/linux/merun b/linux/merun new file mode 100644 index 0000000..be679bc --- /dev/null +++ b/linux/merun @@ -0,0 +1,7 @@ +# to allow non interactive command to run, pause and return exit code 0 +#!/bin/bash +clear +$* +echo "[End]" +read -n 1 +exit 0 \ No newline at end of file From 3d5bdabe1d12ce26f5457791554fe1568b6da4b5 Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 3 Sep 2020 12:37:38 +0200 Subject: [PATCH 07/37] UTF-8 support added --- src/basic.c | 122 +++- src/bind.c | 142 +++-- src/char.c | 436 +++++++++++-- src/curses.c | 1609 ++++++++++++++++++++++++++++++++++++++++++++++++ src/display.c | 383 ++++++++---- src/eval.c | 341 ++++++---- src/input.c | 264 +++++--- src/isearch.c | 61 +- src/keyboard.c | 56 +- src/line.c | 319 +++++++--- src/main.c | 396 +++++++----- src/mouse.c | 167 ++--- src/random.c | 716 +++++++++++---------- src/region.c | 74 ++- src/search.c | 299 +++++++-- src/unix.c | 1328 +++------------------------------------ src/unixterm.c | 1385 +++++++++++++++++++++++++++++++++++++++++ src/word.c | 230 ++++++- src/xpconio.c | 115 ++-- 19 files changed, 5956 insertions(+), 2487 deletions(-) create mode 100644 src/curses.c create mode 100644 src/unixterm.c diff --git a/src/basic.c b/src/basic.c index 9d80f61..cecf0a0 100644 --- a/src/basic.c +++ b/src/basic.c @@ -2,6 +2,8 @@ * MicroEMACS * (C)Copyright 1995 by Daniel Lawrence * + * Unicode support by Jean-Michel Dubois + * * The routines in this file move the cursor around on the screen. They * compute a new value for the cursor, then adjust ".". The display code * always updates the cursor location, so only moves between lines, or @@ -19,7 +21,7 @@ * beginning of the current line. * Trivial. */ -PASCAL NEAR gotobol(f, n) +int gotobol(f, n) int f,n; /* argument flag and num */ @@ -34,7 +36,7 @@ int f,n; /* argument flag and num */ * location. Error if you try and move out of the buffer. Set the flag if the * line pointer for dot changes. */ -PASCAL NEAR backchar(f, n) +int backchar(f, n) int f,n; /* prefix flag and argument */ @@ -50,8 +52,29 @@ int f,n; /* prefix flag and argument */ curwp->w_dotp = lp; curwp->w_doto = lused(lp); curwp->w_flag |= WFMOVE; - } else + } else { +#if UTF8 +#if THEOX + if ((curbp->b_mode & MDTHEOX)) + curwp->w_doto--; + else { +#endif + do { + unsigned char c; + curwp->w_doto--; + c = lgetc(curwp->w_dotp, curwp->w_doto); + + if (is_beginning_utf8(c)) + break; + + } while (curwp->w_doto); +#if THEOX + } +#endif +#else curwp->w_doto--; +#endif + } } #if DBCS return(stopback()); @@ -63,7 +86,7 @@ int f,n; /* prefix flag and argument */ /* * Move the cursor to the end of the current line. Trivial. No errors. */ -PASCAL NEAR gotoeol(f, n) +int gotoeol(f, n) int f,n; /* argument flag and num */ @@ -78,7 +101,7 @@ int f,n; /* argument flag and num */ * location, and move ".". Error if you try and move off the end of the * buffer. Set the flag if the line pointer for dot changes. */ -PASCAL NEAR forwchar(f, n) +int forwchar(f, n) int f,n; /* prefix flag and argument */ @@ -86,14 +109,37 @@ int f,n; /* prefix flag and argument */ if (n < 0) return(backchar(f, -n)); while (n--) { +#if UTF8 + unsigned char c; + int len = lused(curwp->w_dotp); +#endif if (curwp->w_doto == lused(curwp->w_dotp)) { if (curwp->w_dotp == curbp->b_linep) return(FALSE); curwp->w_dotp = lforw(curwp->w_dotp); curwp->w_doto = 0; curwp->w_flag |= WFMOVE; - } else + } else { +#if UTF8 +#if THEOX + if ((curbp->b_mode & MDTHEOX)) + curwp->w_doto++; + else { +#endif + do { + curwp->w_doto++; + c = lgetc(curwp->w_dotp, curwp->w_doto); + + if (is_beginning_utf8(c)) + break; + } while (curwp->w_doto < len); +#if THEOX + } +#endif +#else curwp->w_doto++; +#endif + } } #if DBCS return(stopforw()); @@ -102,7 +148,7 @@ int f,n; /* prefix flag and argument */ #endif } -PASCAL NEAR gotoline(f, n) /* move to a particular line. +int gotoline(f, n) /* move to a particular line. argument (n) must be a positive integer for this to actually do anything */ @@ -137,7 +183,7 @@ int f,n; /* prefix flag and argument */ * considered to be hard motion; it really isn't if the original value of dot * is the same as the new value of dot. Normally bound to "M-<". */ -PASCAL NEAR gotobob(f, n) +int gotobob(f, n) int f,n; /* argument flag and num */ @@ -153,7 +199,7 @@ int f,n; /* argument flag and num */ * (ZJ). The standard screen code does most of the hard parts of update. * Bound to "M->". */ -PASCAL NEAR gotoeob(f, n) +int gotoeob(f, n) int f,n; /* argument flag and num */ @@ -170,7 +216,7 @@ int f,n; /* argument flag and num */ * controls how the goal column is set. Bound to "C-N". No errors are * possible. */ -PASCAL NEAR forwline(f, n) +int forwline(f, n) int f,n; /* argument flag and num */ @@ -214,7 +260,7 @@ int f,n; /* argument flag and num */ * alternate. Figure out the new line and call "movedot" to perform the * motion. No errors are possible. Bound to "C-P". */ -PASCAL NEAR backline(f, n) +int backline(f, n) int f,n; /* argument flag and num */ @@ -253,7 +299,7 @@ int f,n; /* argument flag and num */ #endif } -PASCAL NEAR gotobop(f, n) /* go back to the beginning of the current paragraph +int gotobop(f, n) /* go back to the beginning of the current paragraph here we look for a blank line or a character from $paralead to delimit the beginning of a paragraph or $fmtlead to delimit a line before the paragraph */ @@ -292,7 +338,7 @@ int f, n; /* default Flag & Numeric argument */ ++sp; } if (c == *sp) - break; + break; /* last line start with member of $fmtlead? */ c = lgetc(lback(curwp->w_dotp), 0); @@ -303,7 +349,7 @@ int f, n; /* default Flag & Numeric argument */ ++sp; } if (c == *sp) - break; + break; /* back one line... */ curwp->w_dotp = lback(curwp->w_dotp); @@ -319,7 +365,7 @@ int f, n; /* default Flag & Numeric argument */ return(TRUE); } -PASCAL NEAR gotoeop(f, n) /* go forword to the end of the current paragraph +int gotoeop(f, n) /* go forword to the end of the current paragraph looking for a member of $paralead or $fmtlead or a blank line to delimit the start of the next paragraph @@ -365,7 +411,7 @@ int f, n; /* default Flag & Numeric argument */ ++sp; } if (c == *sp) - break; + break; /* current line start with member of $fmtlead? */ c = lgetc(curwp->w_dotp, 0); @@ -376,7 +422,7 @@ int f, n; /* default Flag & Numeric argument */ ++sp; } if (c == *sp) - break; + break; /* forward one line... */ curwp->w_dotp = lforw(curwp->w_dotp); @@ -399,19 +445,38 @@ int f, n; /* default Flag & Numeric argument */ * Used by "C-N" and "C-P". */ -int PASCAL NEAR getgoal(dlp) +int getgoal(dlp) register LINE *dlp; { +#if UTF8 + int len = lused(dlp); +#else register int c; +#endif register int col; register int newcol; register int dbo; - col = 0; dbo = 0; while (dbo != lused(dlp)) { +#if UTF8 + unsigned int c; + newcol = col; + int width = utf8_to_unicode(dlp->l_text, dbo, len, &c); + + if (c == '\t' && tabsize > 0) + newcol += -(newcol % tabsize) + (tabsize - 1); + else if (c < 0x20 || c == 0x7F) + ++newcol; + + if (++newcol > curgoal) + break; + + col = newcol; + dbo += width; +#else c = lgetc(dlp, dbo); newcol = col; if (c == '\t' && tabsize > 0) @@ -423,6 +488,7 @@ register LINE *dlp; break; col = newcol; ++dbo; +#endif } return(dbo); } @@ -433,7 +499,7 @@ register LINE *dlp; * is overlap between screens. This defaults to overlap value in ITS EMACS. * Because this zaps the top line in the window, we have to do a hard update. */ -PASCAL NEAR forwpage(f, n) +int forwpage(f, n) int f,n; /* prefix flag and argument */ @@ -466,7 +532,7 @@ int f,n; /* prefix flag and argument */ * EMACS manual. Bound to "M-V". We do a hard update for exactly the same * reason. */ -PASCAL NEAR backpage(f, n) +int backpage(f, n) register int f; register int n; @@ -498,7 +564,7 @@ register int n; * Set the mark in the current window to the value of "." in the window. No * errors are possible. Bound to "M-.". */ -PASCAL NEAR setmark(f, n) +int setmark(f, n) int f,n; /* argument flag and num */ @@ -517,9 +583,9 @@ int f,n; /* argument flag and num */ /* * Remove the mark in the current window. - * Bound to ^X + * Bound to ^X */ -PASCAL NEAR remmark(f, n) +int remmark(f, n) int f,n; /* argument flag and num */ @@ -542,7 +608,7 @@ int f,n; /* argument flag and num */ * that moves the mark about. The only possible error is "no mark". Bound to * "C-X C-X". */ -PASCAL NEAR swapmark(f, n) +int swapmark(f, n) int f,n; /* argument flag and num */ @@ -575,7 +641,7 @@ int f,n; /* argument flag and num */ * the hard work gets done by the standard routine that moves the mark * about. The only possible error is "no mark". Bound to "M-^G". */ -PASCAL NEAR gotomark(f, n) +int gotomark(f, n) int f, n; /* default and numeric args */ @@ -599,7 +665,7 @@ int f, n; /* default and numeric args */ #if DBCS /* advance a char if we are on the second byte of a DBCS character */ -int PASCAL NEAR stopforw() +int stopforw() { /* don't stop on the second byte of a 2 byte character */ @@ -611,7 +677,7 @@ int PASCAL NEAR stopforw() /* retreat a char if we are on the second byte of a DBCS character */ -int PASCAL NEAR stopback() +int stopback() { /* don't stop on the second byte of a 2 byte character */ diff --git a/src/bind.c b/src/bind.c index 445ef09..ebbf351 100644 --- a/src/bind.c +++ b/src/bind.c @@ -2,6 +2,8 @@ descriptions, help commands and startup file. written 11-feb-86 by Daniel Lawrence + + Unicode support by Jean-Michel Dubois */ #include @@ -11,7 +13,7 @@ #include "elang.h" #include "epath.h" -PASCAL NEAR help(f, n) /* give me some help!!!!! +int help(f, n) /* give me some help!!!!! bring up a fake buffer and read the help file into it with view mode */ @@ -19,46 +21,70 @@ int f,n; /* prefix flag and argument */ { register BUFFER *bp; /* buffer pointer to help */ - char *fname; /* file name of help file */ + CONST char *fname; /* file name of help file */ /* first check if we are already here */ +#if LIBHELP + if (helpbp == NULL && (helpbp = bfind(TEXT294, TRUE, BFINVS)) == NULL) + return(FALSE); + + bp = helpbp; +#else bp = bfind("emacs.hlp", FALSE, BFINVS); if (bp == NULL) { +#endif +#if THEOS + if (getlang()) + pathname[1][14] = getlang()+'0'; + +#endif fname = flook(pathname[1], FALSE); if (fname == NULL) { mlwrite(TEXT12); /* "[Help file is not online]" */ return(FALSE); } +#if !LIBHELP } +#endif /* split the current window to make room for the help stuff */ if (splitwind(FALSE, 1) == FALSE) - return(FALSE); + return(FALSE); +#if LIBHELP + swbuffer(bp); + if (readin(fname, FALSE) == FALSE) + return(FALSE); +#else if (bp == NULL) { /* and read the stuff in */ if (getfile(fname, FALSE) == FALSE) return(FALSE); } else swbuffer(bp); +#endif /* make this window in VIEW mode, update all mode lines */ curwp->w_bufp->b_mode |= MDVIEW; +#if LIBHELP + curwp->w_bufp->b_flag |= BFINVS|BFHELP; +#else curwp->w_bufp->b_flag |= BFINVS; +#endif upmode(); return(TRUE); } -PASCAL NEAR deskey(f, n) /* describe the command for a certain key */ +int deskey(f, n) /* describe the command for a certain key */ int f,n; /* prefix flag and argument */ { - register int c; /* key to describe */ - register char *ptr; /* string pointer to scan output strings */ - char outseq[NSTRING]; /* output buffer for command sequence */ + register int c; /* key to describe */ + register CONST char *ptr; /* string pointer to scan output strings */ + char outseq[NSTRING]; /* output buffer for command sequence */ /* prompt the user to type us a key to describe */ mlwrite(TEXT13); @@ -81,13 +107,13 @@ int f,n; /* prefix flag and argument */ /* bindtokey: add a new key to the key binding table */ -PASCAL NEAR bindtokey(f, n) +int bindtokey(f, n) int f, n; /* command arguments [IGNORED] */ { register unsigned int c;/* command key to bind */ - register int (PASCAL NEAR *kfunc)();/* ptr to the requested function to bind to */ + register int (*kfunc)();/* ptr to the requested function to bind to */ register KEYTAB *ktp; /* pointer into the command table */ register int found; /* matched command flag */ char outseq[80]; /* output buffer for keystroke sequence */ @@ -107,8 +133,12 @@ int f, n; /* command arguments [IGNORED] */ } /* get the command sequence to bind */ - c = getckey((kfunc == meta) || (kfunc == cex) || - (kfunc == unarg) || (kfunc == ctrlg)); + c = getckey((kfunc == uemeta) || (kfunc == cex) || + (kfunc == unarg) || (kfunc == ctrlg) +#if THEOSC + ? TRUE : FALSE +#endif + ); if (clexec == FALSE) { @@ -170,7 +200,7 @@ int f, n; /* command arguments [IGNORED] */ /* if we have rebound the meta key, make the search terminators follow it */ - if (kfunc == meta) { + if (kfunc == uemeta) { sterm = c; isterm = c; } @@ -180,7 +210,7 @@ int f, n; /* command arguments [IGNORED] */ /* macrotokey: Bind a key to a macro in the key binding table */ -PASCAL NEAR macrotokey(f, n) +int macrotokey(f, n) int f, n; /* command arguments [IGNORED] */ @@ -258,7 +288,7 @@ int f, n; /* command arguments [IGNORED] */ /* unbindkey: delete a key from the key binding table */ -PASCAL NEAR unbindkey(f, n) +int unbindkey(f, n) int f, n; /* command arguments [IGNORED] */ @@ -286,7 +316,7 @@ int f, n; /* command arguments [IGNORED] */ return(TRUE); } -PASCAL NEAR unbindchar(c) +int unbindchar(c) int c; /* command key to unbind */ @@ -333,7 +363,7 @@ int c; /* command key to unbind */ /* unbind all the keys bound to a buffer (which we can then delete */ -VOID PASCAL NEAR unbind_buf(bp) +VOID unbind_buf(bp) BUFFER *bp; /* buffer to unbind all keys connected to */ @@ -359,7 +389,7 @@ BUFFER *bp; /* buffer to unbind all keys connected to */ into it with view mode */ -PASCAL NEAR desbind(f, n) +int desbind(f, n) int f,n; /* prefix flag and argument */ @@ -367,7 +397,7 @@ int f,n; /* prefix flag and argument */ return(buildlist(TRUE, "")); } -PASCAL NEAR apro(f, n) /* Apropos (List functions that match a substring) */ +int apro(f, n) /* Apropos (List functions that match a substring) */ int f,n; /* prefix flag and argument */ @@ -383,7 +413,7 @@ int f,n; /* prefix flag and argument */ return(buildlist(FALSE, mstring)); } -PASCAL NEAR buildlist(type, mstring) /* build a binding list (limited or full) */ +int buildlist(type, mstring) /* build a binding list (limited or full) */ int type; /* true = full list, false = partial list */ char *mstring; /* match string if a partial list */ @@ -396,7 +426,7 @@ char *mstring; /* match string if a partial list */ int cpos; /* current position to use in outseq */ char outseq[80]; /* output buffer for keystroke sequence */ int first_entry; /* is this the first macro listing? */ - + /* get a buffer for the binding list */ listbuf = bfind(TEXT21, TRUE, BFINVS); /* "Binding list" */ @@ -519,7 +549,7 @@ char *mstring; /* match string if a partial list */ return(TRUE); } -PASCAL NEAR strinc(source, sub) /* does source include sub? */ +int strinc(source, sub) /* does source include sub? */ char *source; /* string to search in */ char *sub; /* substring to look for */ @@ -555,7 +585,7 @@ char *sub; /* substring to look for */ /* get a command key sequence from the keyboard */ -unsigned int PASCAL NEAR getckey(mflag) +unsigned int getckey(mflag) int mflag; /* going for a meta sequence? */ @@ -566,7 +596,7 @@ int mflag; /* going for a meta sequence? */ /* check to see if we are executing a command line */ if (clexec) { macarg(tok); /* get the next token */ - return(stock(tok)); + return(stock((unsigned char*) tok)); } /* or the normal way */ @@ -579,18 +609,18 @@ int mflag; /* going for a meta sequence? */ /* execute the startup file */ -PASCAL NEAR startup(sfname) +int startup(sfname) char *sfname; /* name of startup file (null if default) */ { - char *fname; /* resulting file name to execute */ - char name[NSTRING]; /* name with extention */ + CONST char *fname; /* resulting file name to execute */ + char name[NSTRING]; /* name with extension */ /* look up the startup file */ if (*sfname != 0) { - /* default the extention */ + /* default the extension */ strcpy(name, sfname); if (sindex(name, ".") == 0) strcat(name, ".cmd"); @@ -607,7 +637,7 @@ char *sfname; /* name of startup file (null if default) */ return(dofile(fname)); } -/* Look up the existance of a file along the normal or PATH +/* Look up the existence of a file along the normal or PATH environment variable. LOOKUP ORDER: @@ -623,20 +653,20 @@ char *sfname; /* name of startup file (null if default) */ directories in table from EPATH.H */ -char *PASCAL NEAR flook(fname, hflag) +CONST char *flook(fname, hflag) -char *fname; /* base file name to search for */ +CONST char *fname; /* base file name to search for */ int hflag; /* Look in the HOME environment variable first? */ { register char *home; /* path to home directory */ register char *path; /* environmental PATH variable */ - register char *sp; /* pointer into path spec */ + register char *sp;/* pointer into path spec */ register int i; /* index */ static char fspec[NFILEN]; /* full path spec to search */ /* if we have an absolute path.. check only there! */ - sp = fname; + sp = (char*) fname; while (*sp) { if (*sp == ':' || *sp == '\\' || *sp == '/') { if (ffropen(fname) == FIOSUC) { @@ -675,7 +705,7 @@ int hflag; /* Look in the HOME environment variable first? */ } #endif - /* current directory now overides everything except HOME var */ + /* current directory now overrides everything except HOME var */ if (ffropen(fname) == FIOSUC) { ffclose(); return(fname); @@ -743,7 +773,7 @@ int hflag; /* Look in the HOME environment variable first? */ /* Change a key command to a string we can print out. * Return the string passed in. */ -char *PASCAL NEAR cmdstr(c, seq) +char *cmdstr(c, seq) int c; /* sequence to translate */ char *seq; /* destination string for sequence */ @@ -793,16 +823,22 @@ char *seq; /* destination string for sequence */ if (c & CTRL) { /* non normal spaces look like @ */ - if (ptr == seq && ((c & 255) == ' ')) + if (ptr == seq && ((c & CMSK) == ' ')) c = '@'; *ptr++ = '^'; } - c = c & 255; /* strip the prefixes */ - + c = c & CMSK; /* strip the prefixes */ +#if UTF8 + char utf8[6]; + unsigned int bytes = unicode_to_utf8(c, utf8); + memcpy(ptr, utf8, bytes); + ptr += bytes; +#else /* and output the final sequence */ *ptr++ = c; +#endif *ptr = 0; /* terminate the string */ return (seq); } @@ -832,12 +868,12 @@ register int c; /* key to find what is bound to it */ associated with it */ -char *PASCAL NEAR getfname(key) +CONST char *getfname(key) KEYTAB *key; /* key binding to return a name of */ { - int (PASCAL NEAR *func)(); /* ptr to the requested function */ + int (*func)(); /* ptr to the requested function */ register NBIND *nptr; /* pointer into the name binding table */ register BUFFER *bp; /* ptr to buffer to test */ register BUFFER *kbuf; /* ptr to requested buffer */ @@ -876,12 +912,16 @@ KEYTAB *key; /* key binding to return a name of */ any match or NULL if none */ #if MSC -int (PASCAL NEAR *PASCAL NEAR fncmatch(char *fname))(void) +int (*fncmatch(char *fname))(void) #else -int (PASCAL NEAR *PASCAL NEAR fncmatch(fname))() +#if THEOS +int *fncmatch(char *fname) +#else +int (*fncmatch(fname))(void) char *fname; /* name to attempt to match */ #endif +#endif { int nval; @@ -892,7 +932,7 @@ char *fname; /* name to attempt to match */ return(names[nval].n_func); } -char *PASCAL NEAR namval(index) +char *namval(index) int index; /* index of name to fetch out of the name table */ @@ -905,8 +945,8 @@ int index; /* index of name to fetch out of the name table */ A key binding consists of one or more prefix functions followed by a keystroke. Allowable prefixes must be in the following order: - ^X preceeding control-X - A- similtaneous ALT key (on PCs mainly) + ^X preceding control-X + A- simultaneous ALT key (on PCs mainly) S- shifted function key MS mouse generated keystroke M- Preceding META key @@ -918,7 +958,7 @@ int index; /* index of name to fetch out of the name table */ the ^A form. */ -unsigned int PASCAL NEAR stock(keyname) +unsigned int stock(keyname) unsigned char *keyname; /* name of key to translate to Command key form */ @@ -990,21 +1030,21 @@ unsigned char *keyname; /* name of key to translate to Command key form */ return(c); } -char *PASCAL NEAR transbind(skey) /* string key name to binding name.... */ +CONST char *transbind(skey) /* string key name to binding name.... */ -char *skey; /* name of key to get binding for */ +CONST char *skey; /* name of key to get binding for */ { - char *bindname; + CONST char *bindname; - bindname = getfname(getbind(stock(skey))); + bindname = getfname(getbind(stock((unsigned char*) skey))); if (bindname == NULL) bindname = errorm; return(bindname); } -int PASCAL NEAR execkey(key, f, n) /* execute a function bound to a key */ +int execkey(key, f, n) /* execute a function bound to a key */ KEYTAB *key; /* key to execute */ int f, n; /* agruments to C function */ @@ -1052,7 +1092,7 @@ KEYTAB *key; /* ptr to key to set */ char *name; /* name of function or buffer */ #endif { - int (PASCAL NEAR *ktemp)(); /* temp function pointer to assign */ + int (*ktemp)(); /* temp function pointer to assign */ register BUFFER *kmacro; /* ptr to buffer of macro to bind to key */ char bufn[NBUFN]; /* buffer to hold macro name */ diff --git a/src/char.c b/src/char.c index 80bda95..1cf8214 100644 --- a/src/char.c +++ b/src/char.c @@ -4,6 +4,8 @@ ALL THE CODE HERE IS FOR VARIOUS FORMS OF ASCII AND WILL HAVE TO BE MODIFIED FOR EBCDIC + + Unicode support by Jean-Michel Dubois */ #include @@ -12,18 +14,20 @@ #include "edef.h" #include "elang.h" +#if UTF8 + /* is_letter() Is the character a letter? We presume a letter must be either in the upper or lower case tables (even if it gets translated to itself). */ -int PASCAL NEAR is_letter(ch) +int is_letter(ch) -register char ch; +unsigned int ch; { - return(is_upper(ch) || is_lower(ch)); + return(iswalpha(ch)); } /* is_lower() @@ -31,12 +35,12 @@ register char ch; in the lower to uppercase translation table. */ -int PASCAL NEAR is_lower(ch) +int is_lower(ch) -register char ch; +unsigned int ch; { - return(lowcase[ch & 255] != 0); + return(iswlower(ch)); } /* is_upper() @@ -44,14 +48,15 @@ register char ch; in the upper to lowercase translation table. */ -int PASCAL NEAR is_upper(ch) +int is_upper(ch) -register char ch; +unsigned int ch; { - return(upcase[ch & 255] != 0); + return(iswupper(ch)); } + /* chcase() Change the case of the current character. @@ -59,49 +64,117 @@ register char ch; it gets returned unchanged. */ -unsigned int PASCAL NEAR chcase(ch) -register unsigned int ch; +unsigned int chcase(ch) +unsigned int ch; { - /* translate lowercase */ - if (is_lower(ch)) - return(lowcase[ch & 255]); + /* translate lower case */ + if (iswlower(ch)) + return(ToWUpper(ch)); - /* translate uppercase */ - if (is_upper(ch)) - return(upcase[ch & 255]); + /* translate upper case */ + if (iswupper(ch)) + return(ToWLower(ch)); /* let the rest pass */ return(ch); } -/* change *cp to an upper case character */ +#if PROTO +unsigned int upperc(unsigned int ch) /* return the upper case equivalant of a character */ +#else +int upperc(ch) /* return the upper case equivalant of a character */ -VOID PASCAL NEAR uppercase(cp) +unsigned int ch; /* character to get uppercase euivalant of */ +#endif +{ + if (iswlower(ch)) + return(ToWUpper(ch)); + else + return(ch); +} -unsigned char *cp; /* ptr to character to uppercase */ +#if PROTO +unsigned int lowerc(unsigned int ch) /* return the lower case equivalant of a character */ +#else +unsigned int lowerc(ch) /* return the lower case equivalant of a character */ +unsigned int ch; /* character to get lowercase equivalant of */ +#endif { - /* translate uppercase */ - if (is_lower(*cp)) - *cp = lowcase[*cp & 255]; + if (iswupper(ch)) + return(ToWLower(ch)); + else + return(ch); } -/* change *cp to an lower case character */ +#else + +/* is_letter() + Is the character a letter? We presume a letter must + be either in the upper or lower case tables (even if it gets + translated to itself). +*/ + +int is_letter(ch) -VOID PASCAL NEAR lowercase(cp) +register char ch; + +{ + return(is_upper(ch) || is_lower(ch)); +} + +/* is_lower() + Is the character a lower case letter? This looks + in the lower to uppercase translation table. +*/ + +int is_lower(ch) + +register char ch; + +{ + return(lowcase[ch & 255] != 0); +} + +/* is_upper() + Is the character a upper case letter? This looks + in the upper to lowercase translation table. +*/ + +int is_upper(ch) -unsigned char *cp; /* ptr to character to lowercase */ +register char ch; +{ + return(upcase[ch & 255] != 0); +} + +/* chcase() + + Change the case of the current character. + First check lower and then upper. If it is not a letter, + it gets returned unchanged. +*/ + +unsigned int chcase(ch) +register unsigned int ch; { /* translate lowercase */ - if (is_upper(*cp)) - *cp = upcase[*cp & 255]; + if (is_lower(ch)) + return(lowcase[ch & 255]); + + /* translate uppercase */ + if (is_upper(ch)) + return(upcase[ch & 255]); + + /* let the rest pass */ + return(ch); } #if PROTO -int PASCAL NEAR upperc(char ch) /* return the upper case equivalant of a character */ +int upperc(char ch) /* return the upper case equivalant of a character */ #else -int PASCAL NEAR upperc(ch) /* return the upper case equivalant of a character */ +int upperc(ch) /* return the upper case equivalant of a character */ unsigned char ch; /* character to get uppercase euivalant of */ #endif @@ -113,9 +186,9 @@ unsigned char ch; /* character to get uppercase euivalant of */ } #if PROTO -int PASCAL NEAR lowerc(char ch) /* return the lower case equivalant of a character */ +int lowerc(char ch) /* return the lower case equivalant of a character */ #else -int PASCAL NEAR lowerc(ch) /* return the lower case equivalant of a character */ +int lowerc(ch) /* return the lower case equivalant of a character */ unsigned char ch; /* character to get lowercase equivalant of */ #endif @@ -126,7 +199,83 @@ unsigned char ch; /* character to get lowercase equivalant of */ return(ch); } -VOID PASCAL NEAR initchars() /* initialize the character upper/lower case tables */ +#endif /* UTF8 */ + +/* change *cp to an upper case character */ + +int uppercase(cp) + +unsigned char *cp; /* ptr to character to uppercase */ + +{ +#if UTF8 + /* translate upper case */ + if (is_multibyte_utf8(*cp)) { + char utf8[6]; + size_t len = strlen((char*) cp); + unsigned int wc; + unsigned int bytes = utf8_to_unicode((char*) cp, 0, len, &wc); + + if (iswlower(wc)) { + wc = ToWUpper(wc); + /* it's a in place conversion, so do it only if the converted + * character has the same number of bytes as the original. */ + if (unicode_to_utf8(wc, utf8) == bytes) + memcpy(cp, utf8, bytes); + } + + return bytes; + } + + if (islower(*cp)) + *cp = toupper(*cp); +#else + /* translate uppercase */ + if (is_lower(*cp)) + *cp = lowcase[*cp & 255]; +#endif + return 1; +} + +/* change *cp to an lower case character */ + +int lowercase(cp) + +unsigned char* cp; /* ptr to character to lowercase */ + +{ +#if UTF8 + /* translate lower case */ + if (is_multibyte_utf8(*cp)) { + char utf8[6]; + size_t len = strlen((char*) cp); + unsigned int wc; + unsigned int bytes = utf8_to_unicode((char*) cp, 0, len, &wc); + + if (iswupper(wc)) { + wc = ToWLower(wc); + /* it's a in place conversion, so do it only if the converted + * character has the same number of bytes as the original. */ + if (unicode_to_utf8(wc, utf8) == bytes) + memcpy(cp, utf8, bytes); + } + + return bytes; + } + + if (isupper(*cp)) + *cp = tolower(*cp); +#else + /* translate lowercase */ + if (is_upper(*cp)) + *cp = upcase[*cp & 255]; +#endif + return 1; +} + +#if ! UTF8 + +VOID initchars() /* initialize the character upper/lower case tables */ { register int index; /* index into tables */ @@ -186,7 +335,7 @@ VOID PASCAL NEAR initchars() /* initialize the character upper/lower case tables lowcase[0xa3] = 0xa3; /* u with an acute accent */ lowcase[0xa4] = 0xa5; /* n with a tilde */ upcase[0xa5] = 0xa4; /* N with a tilde */ -#endif +#endif /* MSDOS */ #if VMS /* setup DEC Multinational Character Set */ upcase[ 192] = 224; /* A with a grave accent */ @@ -251,12 +400,46 @@ VOID PASCAL NEAR initchars() /* initialize the character upper/lower case tables lowcase[ 252] = 220; /* u with an umlaut */ lowcase[ 253] = 221; /* y with an umlaut */ -#endif +#endif /* VMS */ +#if THEOS + upcase[192] = 193; /* A with an umlaut */ + lowcase[193] = 192; /* a with an umlaut */ + lowcase[194] = 194; /* a with a circumflex */ + lowcase[195] = 195; /* a with a grave accent */ + lowcase[196] = 196; /* a with a acute accent */ + upcase[197] = 201; /* E with a acute accent */ + lowcase[198] = 198; /* e with an umlaut */ + lowcase[199] = 199; + lowcase[200] = 200; + lowcase[201] = 197; + lowcase[202] = 202; + lowcase[203] = 203; + lowcase[204] = 204; + lowcase[205] = 205; + upcase[206] = 207; + lowcase[207] = 206; + lowcase[208] = 208; + lowcase[209] = 209; + lowcase[210] = 210; + upcase[211] = 212; + lowcase[212] = 211; + lowcase[213] = 213; + lowcase[214] = 214; + lowcase[215] = 215; + upcase[216] = 217; + lowcase[217] = 216; + upcase[218] = 219; + lowcase[219] = 218; + upcase[220] = 221; + lowcase[221] = 220; + upcase[222] = 223; + lowcase[223] = 222; +#endif /* THEOS */ } /* Set a character in the lowercase map */ -int PASCAL NEAR setlower(ch, val) +int setlower(ch, val) char *ch; /* ptr to character to set */ char *val; /* value to set it to */ @@ -267,7 +450,7 @@ char *val; /* value to set it to */ /* Set a character in the uppercase map */ -int PASCAL NEAR setupper(ch, val) +int setupper(ch, val) char *ch; /* ptr to character to set */ char *val; /* value to set it to */ @@ -298,12 +481,102 @@ char *our_str; return(our_str); } -#endif +#endif /* (ZTC | TURBO | MSC) == 0 */ + +#else + +/* Set a character in the lowercase map */ + +int setlower(ch, val) + +char *ch; /* ptr to character to set */ +char *val; /* value to set it to */ + +{ + unsigned int c; + unsigned int bytes; + char utf8[6]; + + if (is_multibyte_utf8(*ch) && utf8_to_unicode(ch, 0, strlen(ch), &c) > 1 && iswupper(c)) { + c = ToWUpper(c); + bytes = unicode_to_utf8(c, utf8); + memcpy(ch, utf8, bytes); + return c; + } + + return (*ch = toupper(*ch)); +} + +/* Set a character in the uppercase map */ + +int setupper(ch, val) + +char *ch; /* ptr to character to set */ +char *val; /* value to set it to */ + +{ + unsigned int c; + unsigned int bytes; + char utf8[6]; + + if (is_multibyte_utf8(*ch) && utf8_to_unicode(ch, 0, strlen(ch), &c) > 1 && iswlower(c)) { + c = ToWLower(c); + bytes = unicode_to_utf8(c, utf8); + memcpy(ch, utf8, bytes); + return c; + } + + return (*ch = toupper(*ch)); +} + +/* strrev -- Reverse UTF-8 string in place. */ + +char *strrev(char *str) +{ + /* this assumes that str is valid UTF-8 */ + char *scanl, *scanr, *scanr2, c; + + /* first reverse the string */ + for (scanl = str, scanr = str + strlen(str); scanl < scanr; ) { + c = *scanl; + *scanl++ = *--scanr; + *scanr = c; + } + + /* then scan all bytes and reverse each multibyte character */ + for (scanl = scanr = str; (c = *scanr++); ) { + if ((c & 0x80) == 0) // ASCII char + scanl = scanr; + else if (is_multibyte_utf8(c)) { // start of multibyte + scanr2 = scanr; + + switch (scanr - scanl) { + case 4: + c = *scanl; + *scanl++ = *--scanr; + *scanr = c; + // no break + case 3: + // no break + case 2: + c = *scanl; + *scanl++ = *--scanr; + *scanr = c; + } + + scanr = scanl = scanr2; + } + } + + return str; +} + +#endif /* UTF8 */ #if DBCS /* is this character a 2 byte character prefix code? */ -int PASCAL NEAR is2byte(sp, cp) +int is2byte(sp, cp) char *sp; /* ptr to beginning of string containing character to test */ char *cp; /* ptr to charactor to test */ @@ -324,3 +597,88 @@ char *cp; /* ptr to charactor to test */ return(FALSE); } #endif + +#if MDSLINE +unsigned int theoxtosgraph(unsigned int c) +{ + if (curbp->b_mode & MDSLINE) { + switch (c) { + case '7': return 0x00A0; + case '8': return 0x00A7; + case '9': return 0x00A1; + case '4': return 0x00A5; + case '5': return 0x00A4; + case '6': return 0x00A6; + case '1': return 0x00A3; + case '2': return 0x00A8; + case '3': return 0x00A2; + case '+': return 0x00AA; + case '0': return 0x00A9; + } + } else if (curbp->b_mode & MDDLINE) { + switch (c) { + case '7': return 0x00AF; + case '8': return 0x00B6; + case '9': return 0x00B0; + case '4': return 0x00B4; + case '5': return 0x00B3; + case '6': return 0x00B5; + case '1': return 0x00B2; + case '2': return 0x00B7; + case '3': return 0x00B1; + case '+': return 0x00B9; + case '0': return 0x00B8; + } + } + + return c; +} + +unsigned int tosgraph(unsigned int c) +{ +#if UTF8 +#if THEOX + if (curbp->b_mode & MDTHEOX) + return theoxtosgraph(c); + else { +#endif + if (curbp->b_mode & MDSLINE) { + switch (c & CMSK) { // single line box + case '7': return 0x250c; // upper left corner + case '8': return 0x252c; // upper intersection + case '9': return 0x2510; // upper right corner + case '4': return 0x251c; // left intersection + case '5': return 0x253c; // four ways + case '6': return 0x2524; // right intersection + case '1': return 0x2514; // lower left corner + case '2': return 0x2534; // lower intersection + case '3': return 0x2518; // lower right corner + case '+': return 0x2502; // vertical + case '0': return 0x2500; // horizontal + } + } else if (curbp->b_mode & MDDLINE) { /* double line box */ + switch (c & CMSK) { + case '7': return 0x2554; // upper left corner + case '8': return 0x2566; // upper intersection + case '9': return 0x2557; // upper right corner + case '4': return 0x2560; // left intersection + case '5': return 0x256c; // four ways + case '6': return 0x2563; // right intersection + case '1': return 0x255a; // lower left corner + case '2': return 0x2569; // lower intersection + case '3': return 0x255d; // lower right corner + case '+': return 0x2551; // vertical + case '0': return 0x2550; // horizontal + } + } +#if THEOX + } +#endif +#elif THEOS + return theoxtosgraph(c); +#endif + + return c; +} + +#endif diff --git a/src/curses.c b/src/curses.c new file mode 100644 index 0000000..e122741 --- /dev/null +++ b/src/curses.c @@ -0,0 +1,1609 @@ +/* + * curses.c + * + * Created on: 10 mars 2020 + * Author: Jean-Michel Dubois + * + * curses terminal with Unicode support + */ + +#include "estruct.h" /* Emacs definitions */ + +#if CURSES +/** Problem with CTRL */ +#undef CTRL + +#include /* Standard I/O definitions */ +#include +#include +#include /* System type definitions */ +#include /* File status definitions */ +#include /* I/O control definitions */ +#if LINUX +#include +#undef TERMIOS +#endif +#if __CYGWIN__ +#include +#endif + +/** Include files **/ +#include "eproto.h" /* Function definitions */ +#include "edef.h" /* Global variable definitions */ +#include "elang.h" /* Language definitions */ + +/** Do nothing routine **/ +int scnothing() +{ + return(0); +} + +/** Parameters **/ +#define NINCHAR 64 /* Input buffer size */ +#define NOUTCHAR 256 /* Output buffer size */ +#define MARGIN 8 /* Margin size */ +#define SCRSIZ 64 /* Scroll for margin */ +#define NPAUSE 500 /* Pause in milliseconds */ +#define TIMEOUT 255 /* No character available */ + +#if COLOR + +static int cfcolor = -1; /* Current foreground color */ +static int cbcolor = -1; /* Current background color */ +#endif /* COLOR */ +static attr_t attrib = 0; /* Current character attribute */ +/** Terminal definition block **/ +int scopen(), scclose(), ttgetc(), ttputc(), ttflush(); +int scmove(), sceeol(), sceeop(), scbeep(), screv(); +int sckopen(), sckclose(); +#if COLOR +int scfcol(), scbcol(); +#endif /* COLOR */ + +TERM term = { + 512, /* Maximum number of rows */ + 25, /* Current number of rows */ + 512, /* Maximum number of columns */ + 80, /* Current number of columns */ + 0, 0, /* upper left corner default screen */ + MARGIN, /* Margin for extending lines */ + SCRSIZ, /* Scroll size for extending */ + NPAUSE, /* # times thru update to pause */ + scopen, /* Open terminal routine */ + scclose, /* Close terminal routine */ + sckopen, /* Open keyboard routine */ + sckclose, /* Close keyboard routine */ + ttgetc, /* Get character routine */ + ttputc, /* Put character routine */ + ttflush, /* Flush output routine */ + scmove, /* Move cursor routine */ + sceeol, /* Erase to end of line routine */ + sceeop, /* Erase to end of page routine */ + sceeop, /* Clear the desktop */ + scbeep, /* Beep! routine */ + screv, /* Set reverse video routine */ + scnothing, /* Set resolution routine */ +#if COLOR + scfcol, /* Set forground color routine */ + scbcol, /* Set background color routine */ +#endif /* COLOR */ +#if INSDEL + scinsline, /* insert a screen line */ + scdelline, /* delete a screen line */ +#endif /* INSDEL */ +}; + +#if MOUSE +#if NCURSES_MOUSE_VERSION > 1 +// button 4 and 5 report mouse wheel +#define _ALL_MOUSE_EVENTS (BUTTON1_PRESSED|BUTTON1_RELEASED|BUTTON1_CLICKED|\ + BUTTON2_PRESSED|BUTTON2_RELEASED|BUTTON2_CLICKED|\ + BUTTON3_PRESSED|BUTTON3_RELEASED|BUTTON3_CLICKED|\ + BUTTON4_PRESSED|BUTTON5_PRESSED|\ + REPORT_MOUSE_POSITION) +#else +#define _ALL_MOUSE_EVENTS (BUTTON1_PRESSED|BUTTON1_RELEASED|BUTTON1_CLICKED|\ + BUTTON2_PRESSED|BUTTON2_RELEASED|BUTTON2_CLICKED|\ + BUTTON3_PRESSED|BUTTON3_RELEASED|BUTTON3_CLICKED|\ + REPORT_MOUSE_POSITION) +#endif +#endif + +#define FILEMENU 0 +#define EDITMENU 1 +#define SEARCHMENU 2 +#define EXECMENU 3 +#define TOOLSMENU 4 + +typedef struct menuitem { + char* i_text; + short i_type; + union EPOINTER i_ptr; + int (*i_markfunc)(); // status function for menu item mark + int (*i_checkdisabled)(); // status function for menu item show + short i_disabled; +} MENUITEM; + +typedef struct menubar { + char* m_text; + short m_nitems; + short m_width; + MENUITEM* m_items; + short m_left; + short m_right; + unsigned int m_shortcut; +} MENUBAR; + +static int issline(void) +{ + return curbp->b_mode & MDSLINE; +} + +static int sline(int n, int f) +{ + if (curbp->b_mode & MDSLINE) + curbp->b_mode &= ~MDSLINE; + else { + curbp->b_mode |= MDSLINE; + curbp->b_mode &= ~MDDLINE; + } + + return(TRUE); +} + +static int isdline(void) +{ + return curbp->b_mode & MDDLINE; +} + +static int dline(int n, int f) +{ + if (curbp->b_mode & MDDLINE) + curbp->b_mode &= ~MDDLINE; + else { + curbp->b_mode |= MDDLINE; + curbp->b_mode &= ~MDSLINE; + } + + return(TRUE); +} + +static int isnumeric(void) +{ + return ! (curbp->b_mode & (MDSLINE | MDDLINE)); +} + +static int numeric(int n, int f) +{ + curbp->b_mode &= ~(MDSLINE|MDDLINE); + return (TRUE); +} + +static int isexact(void) +{ + return curbp->b_mode & MDEXACT; +} + +static int exact(int n, int f) +{ + if (curbp->b_mode & MDEXACT) + curbp->b_mode &= ~MDEXACT; + else + curbp->b_mode |= MDEXACT; + + return(TRUE); +} + +#if MAGIC +static int ismagic(void) +{ + return curbp->b_mode & MDMAGIC; +} + +static int magic(int n, int f) +{ + if (curbp->b_mode & MDMAGIC) + curbp->b_mode &= ~MDMAGIC; + else + curbp->b_mode |= MDMAGIC; + + return(TRUE); +} +#endif + +#if THEOX +static int isutf8(void) +{ + return ! (curbp->b_mode & MDTHEOX); +} + +static int istheox(void) +{ + return curbp->b_mode & MDTHEOX; +} +#endif + +static int isdebug(void) +{ + return macbug; +} + +static int setdebug(int n, int f) +{ + return (macbug = ! macbug); +} + +static int isautosave(void) +{ + return curbp->b_mode & MDASAVE; +} + +static int autosave(int n, int f) +{ + if (curbp->b_mode & MDASAVE) + curbp->b_mode &= ~MDASAVE; + else + curbp->b_mode |= MDASAVE; + + return(TRUE); +} + +static int isnobackup(void) +{ + return curbp->b_mode & MDNOBAK; +} + +static int nobackup(int n, int f) +{ + if (curbp->b_mode & MDNOBAK) + curbp->b_mode &= ~MDNOBAK; + else + curbp->b_mode |= MDNOBAK; + + return(TRUE); +} + +static MENUITEM filemenu[] = { + { "++++++++++++++++++++++++", BINDFNC, { nullproc }, NULL, NULL }, + { " Open... ^X-^F", BINDFNC, { filefind }, NULL, NULL }, + { " Insert... ^X-^I", BINDFNC, { insfile }, NULL, NULL }, + { "------------------------", BINDFNC, { nullproc }, NULL, NULL }, + { " View... ^X-^V", BINDFNC, { viewfile }, NULL, NULL }, + { "------------------------", BINDFNC, { nullproc }, NULL, NULL }, + { " Append to... ^X-^A", BINDFNC, { fileapp }, NULL, NULL }, + { " Save ^X-^S", BINDFNC, { filesave }, NULL, NULL }, + { " Save as... ^X-^W", BINDFNC, { filewrite }, NULL, NULL }, + { " Save all and quit M-Z ", BINDFNC, { quickexit }, NULL, NULL }, + { "------------------------", BINDFNC, { nullproc }, NULL, NULL }, + { " Auto save mode ", BINDFNC, { autosave }, isautosave, NULL }, + { " Don't save backup ", BINDFNC, { nobackup }, isnobackup, NULL }, + { "------------------------", BINDFNC, { nullproc }, NULL, NULL }, + { " Quit ^X-^C", BINDFNC, { quit }, NULL, NULL }, + { "++++++++++++++++++++++++", BINDFNC, { nullproc }, NULL, NULL }, + { NULL, 0, { NULL }, NULL } +}; + +static MENUITEM editmenu[] = { + { "++++++++++++++++++++", BINDFNC, { nullproc }, NULL, NULL }, + { " Cut end of line ^K ", BINDFNC, { killtext }, NULL, NULL }, + { " Cut region ^W ", BINDFNC, { killregion }, NULL, NULL }, + { " Copy region M-W", BINDFNC, { copyregion }, NULL, NULL }, + { " Paste ^Y ", BINDFNC, { yank }, NULL, NULL }, + { "--------------------", BINDFNC, { nullproc }, NULL, NULL }, + { " Undo ^_ ", BINDFNC, { undo }, NULL, NULL }, + { "++++++++++++++++++++", BINDFNC, { nullproc }, NULL, NULL }, + { NULL, 0, { NULL }, NULL } +}; + +static MENUITEM modifmenu[] = { + { "++++++++++++++++++++++", BINDFNC, { nullproc }, NULL, NULL }, + { " Word lower M-L ", BINDFNC, { lowerword }, NULL, NULL }, + { " Word upper M-U ", BINDFNC, { upperword }, NULL, NULL }, + { " Word capitalize M-C ", BINDFNC, { capword }, NULL, NULL }, + { "----------------------", BINDFNC, { nullproc }, NULL, NULL }, + { " Region lower ^X-^L", BINDFNC, { lowerregion }, NULL, NULL }, + { " Region upper ^X-^U", BINDFNC, { upperregion }, NULL, NULL }, + { "----------------------", BINDFNC, { nullproc }, NULL, NULL }, + { " Entab region ^X-E ", BINDFNC, { entab }, NULL, NULL }, + { " Detab region ^X-D ", BINDFNC, { detab }, NULL, NULL }, + { " Trim region ^X-T ", BINDFNC, { trim }, NULL, NULL }, + { " Indent to right M-) ", BINDFNC, { indent_region }, NULL, NULL }, + { " Indent to left M-( ", BINDFNC, { undent_region }, NULL, NULL }, + { "----------------------", BINDFNC, { nullproc }, NULL, NULL }, + { " Swap characters ^T ", BINDFNC, { twiddle }, NULL, NULL }, +#if MDSLINE + { "----------------------", BINDFNC, { nullproc }, NULL, NULL }, + { " Single line graphics ", BINDFNC, { sline }, issline, NULL }, + { " Double line graphics ", BINDFNC, { dline }, isdline, NULL }, + { " Numeric keypad ", BINDFNC, { numeric }, isnumeric, NULL }, +#endif +#if THEOX + { "----------------------", BINDFNC, { nullproc }, NULL, NULL }, + { " Convert to UTF-8 ", BINDFNC, { nullproc }, NULL, isutf8 }, /* bound to b-to-utf8 */ + { " Convert to TheoX ", BINDFNC, { nullproc }, NULL, istheox }, /* bound to b-to-theox */ +#endif + { "++++++++++++++++++++++", BINDFNC, { nullproc }, NULL, NULL }, + { NULL, 0, { NULL }, NULL } +}; + +static MENUITEM searchmenu[] = { + { "++++++++++++++++++++++++", BINDFNC, { nullproc }, NULL, NULL }, + { " Search forward f1 ^S ", BINDFNC, { forwsearch }, NULL, NULL }, + { " Search backward f2 ^R ", BINDFNC, { backsearch }, NULL, NULL }, + { " Next forward f3 ", BINDFNC, { forwhunt }, NULL, NULL }, + { " Next backward f4 ", BINDFNC, { backhunt }, NULL, NULL }, + { "------------------------", BINDFNC, { nullproc }, NULL, NULL }, +#if ISRCH + { " I-Search forward ^X-S", BINDFNC, { isearch }, NULL, NULL }, + { " I-Search backward ^X-R", BINDFNC, { risearch }, NULL, NULL }, +#endif + { "------------------------", BINDFNC, { nullproc }, NULL, NULL }, + { " Query replace M-^R", BINDFNC, { qreplace }, NULL, NULL }, + { " Replace all M-R ", BINDFNC, { sreplace }, NULL, NULL }, + { "------------------------", BINDFNC, { nullproc }, NULL, NULL }, + { " Case sensitive ", BINDFNC, { exact }, isexact, NULL }, +#if MAGIC + { " Regular expressions ", BINDFNC, { magic }, ismagic, NULL }, +#endif + { "++++++++++++++++++++++++", BINDFNC, { nullproc }, NULL, NULL }, + { NULL, 0, { NULL }, NULL } +}; + +static MENUITEM windowmenu[] = { + { "++++++++++++++++++++++++", BINDFNC, { nullproc }, NULL, NULL }, + { " Grow window ^X-^ ", BINDFNC, { enlargewind }, NULL, NULL }, + { " Shrink window ^X-^Z ", BINDFNC, { shrinkwind }, NULL, NULL }, + { "------------------------", BINDFNC, { nullproc }, NULL, NULL }, + { " Previous window ^X-P ", BINDFNC, { prevwind }, NULL, NULL }, + { " Next window ^X-N ", BINDFNC, { nextwind }, NULL, NULL }, + { "------------------------", BINDFNC, { nullproc }, NULL, NULL }, + { " Split window ^X-2 ", BINDFNC, { splitwind }, NULL, NULL }, + { " Delete window ^X-0 ", BINDFNC, { delwind }, NULL, NULL }, + { " Keep one window ^X-1 ", BINDFNC, { onlywind }, NULL, NULL }, + { "------------------------", BINDFNC, { nullproc }, NULL, NULL }, + { " Scroll next up M-PgUp", BINDFNC, { nextup }, NULL, NULL }, + { " Scroll next down M-PgDn", BINDFNC, { nextdown }, NULL, NULL }, + { "++++++++++++++++++++++++", BINDFNC, { nullproc }, NULL, NULL }, + { NULL, 0, { NULL }, NULL } +}; + +static MENUITEM macromenu[] = { + { "+++++++++++++++++++++++++", BINDFNC, { nullproc }, NULL, NULL }, + { " Start recording ^X-(", BINDFNC, { ctlxlp }, NULL, NULL }, + { " Stop recording ^X-)", BINDFNC, { ctlxrp }, NULL, NULL }, + { " Play ^X-E", BINDFNC, { ctlxe }, NULL, NULL }, + { "-------------------------", BINDFNC, { nullproc }, NULL, NULL }, + { " Run uemacs command M-X ", BINDFNC, { namedcmd }, NULL, NULL }, + { " Run procedure M-^E", BINDFNC, { execproc }, NULL, NULL }, + { " Run file M-^S", BINDFNC, { execfile }, NULL, NULL }, + { "-------------------------", BINDFNC, { nullproc }, NULL, NULL }, + { " Debug mode ", BINDFNC, { setdebug }, isdebug, NULL }, + { "+++++++++++++++++++++++++", BINDFNC, { nullproc }, NULL, NULL }, + { NULL, 0, { NULL }, NULL } +}; + +static MENUITEM shellmenu[] = { + { "++++++++++++++++++++++++++", BINDFNC, { nullproc }, NULL, NULL }, + { " Shell command... ^X-!", BINDFNC, { spawn }, NULL, NULL }, + { " Interactive shell... ^X-C", BINDFNC, { spawncli }, NULL, NULL }, + { " Pipe command... ^X-@", BINDFNC, { pipecmd }, NULL, NULL }, + { " Filter buffer... ^X-#", BINDFNC, { uefilter }, NULL, NULL }, + { "++++++++++++++++++++++++++", BINDFNC, { nullproc }, NULL, NULL }, + { NULL, 0, { NULL }, NULL } +}; + +static int ishardtab(void) +{ + return tabsize && ! stabsize; +} + +static int hardtab(int n, int f) +{ + int status; /* status return */ + VDESC vd; /* variable num/type */ + char value[NSTRING]; /* value to set variable to */ + + /* check the legality and find the var */ + findvar("hardtab", &vd, NVSIZE + 1, VT_GLOBAL); + status = mlreply(TEXT53, &value[0], NSTRING); +/* "Value: " */ + if (status == ABORT) + return(status); + + /* and set the appropriate value */ + return svar(&vd, value); +} + +static int issofttab(void) +{ + return stabsize; +} + +static int softtab(int n, int f) +{ + int status; /* status return */ + VDESC vd; /* variable num/type */ + char value[NSTRING]; /* value to set variable to */ + + /* check the legality and find the var */ + findvar("softtab", &vd, NVSIZE + 1, VT_GLOBAL); + status = mlreply(TEXT53, &value[0], NSTRING); +/* "Value: " */ + if (status == ABORT) + return(status); + + /* and set the appropriate value */ + return svar(&vd, value); +} + +#if COLOR && 0 +static int setfcol(int n, int f) +{ + + return(TRUE); +} + +static int setbcol(int n, int f) +{ + + return(TRUE); +} +#endif + +static MENUITEM setupmenu[] = { + { "++++++++++++++++++++++++", BINDFNC, { nullproc }, NULL, NULL }, + { " Hard tab width... ", BINDFNC, { hardtab }, ishardtab, NULL }, + { " Soft tab width... ", BINDFNC, { softtab }, issofttab, NULL }, + { "------------------------", BINDFNC, { nullproc }, NULL, NULL }, + { " Show variable... ", BINDFNC, { dispvar }, NULL, NULL }, + { " Set variable... ", BINDFNC, { setvar }, NULL, NULL }, +#if COLOR && 0 + { "------------------------", BINDFNC, { nullproc }, NULL, NULL }, + { " Set foreground color...", BINDFNC, { setfcol }, NULL, NULL }, + { " Set background color...", BINDFNC, { setbcol }, NULL, NULL }, +#endif + { "++++++++++++++++++++++++", BINDFNC, { nullproc }, NULL, NULL }, + { NULL, 0, { NULL }, NULL } +}; + +#if TXBASIC +static MENUITEM langmenu[] = { + { "++++++++++++++++++++++++++", BINDFNC, { nullproc }, NULL, NULL }, + { " Format buffer S-F1 ", BINDFNC, { nullproc }, NULL, NULL }, + { " Format with braces S-F2 ", BINDFNC, { nullproc }, NULL, NULL }, + { " Check syntax S-F3 ", BINDFNC, { nullproc }, NULL, NULL }, + { " Compile release S-F4 ", BINDFNC, { nullproc }, NULL, NULL }, + { " Compile for speed S-F5 ", BINDFNC, { nullproc }, NULL, NULL }, + { " Compile for TxDebug S-F6 ", BINDFNC, { nullproc }, NULL, NULL }, + { " Compile for gdb S-F7 ", BINDFNC, { nullproc }, NULL, NULL }, + { " Run S-F8 ", BINDFNC, { nullproc }, NULL, NULL }, + { " Run through gdb ", BINDFNC, { nullproc }, NULL, NULL }, + { " Previous error S-F9 ", BINDFNC, { nullproc }, NULL, NULL }, + { " Next error S-F10", BINDFNC, { nullproc }, NULL, NULL }, + { "--------------------------", BINDFNC, { nullproc }, NULL, NULL }, + { " IF...ELSE...ENDIF ", BINDFNC, { nullproc }, NULL, NULL }, + { " SELECT...CASE...CEND ", BINDFNC, { nullproc }, NULL, NULL }, + { " FOR...NEXT ", BINDFNC, { nullproc }, NULL, NULL }, + { " WHILE...WEND ", BINDFNC, { nullproc }, NULL, NULL }, + { "++++++++++++++++++++++++++", BINDFNC, { nullproc }, NULL, NULL }, + { NULL, 0, { NULL }, NULL } +}; +#endif + +static MENUITEM helpmenu[] = { + { "++++++++++++++++++++++++++++", BINDFNC, { nullproc }, NULL, NULL }, + { " MicroEmacs help f6 ", BINDFNC, { nullproc }, NULL, NULL }, /* bound to get-help */ +#if LIBHELP + { " Language help index M-I ", BINDFNC, { hlpindex }, NULL, NULL }, + { " Language help on word M-H ", BINDFNC, { lookupword }, NULL, NULL }, + { " Language help on topic M-J ", BINDFNC, { hlpindex }, NULL, NULL }, +#endif + { "----------------------------", BINDFNC, { nullproc }, NULL, NULL }, + { " Describe abbreviations ", BINDFNC, { desc_abbrevs }, NULL, NULL }, + { " Describe functions ", BINDFNC, { desfunc }, NULL, NULL }, + { " Describe key ", BINDFNC, { deskey }, NULL, NULL }, + { " Describe key bindings ", BINDFNC, { desbind }, NULL, NULL }, + { " Describe variables ", BINDFNC, { desvars }, NULL, NULL }, + { "++++++++++++++++++++++++++++", BINDFNC, { nullproc }, NULL, NULL }, + { NULL, 0, { NULL }, NULL } +}; + +static MENUBAR menubar[] = { + { "File", 0, 0, filemenu }, + { "Edit", 0, 0, editmenu }, + { "Modify", 0, 0, modifmenu }, + { "Search", 0, 0, searchmenu }, + { "Window", 0, 0, windowmenu }, + { "Macro", 0, 0, macromenu }, + { "Shell", 0, 0, shellmenu }, + { "Setup", 0, 0, setupmenu }, +#if TXBASIC + { "TxBasic", 0, 0, langmenu }, +#endif + { "Help", 0, 0, helpmenu }, + { NULL, 0, 0, NULL } +}; + +static MENUITEM* dropmenu; + +/** Open terminal device **/ +int ttopen() +{ +#if LINUX + strcpy(os, "LINUX"); +#else + strcpy(os, "UNIX"); +#endif + reset_prog_mode(); + update_panels(); + doupdate(); + /* Success */ + return(0); +} + +/** Close terminal device **/ +int ttclose() +{ + endwin(); + /* Success */ + return(0); +} + +/** Flush output buffer to display **/ +int ttflush() +{ + wrefresh(wmain); + return(0); +} + +/** Put character onto display **/ +int ttputc(ch) +int ch; /* Character to display */ +{ + /* Put character on screen */ + if (ch == '\b') { + int y, x; + getyx(wmain, y, x); + mvwdelch(wmain, y, x -1); + } else if (ch == 7) { + beep(); + } else { +#if UTF8 + cchar_t cch; + wchar_t wch = ch; +#if COLOR + setcchar(&cch, &wch, attrib, PAIR_NUMBER(cfcolor * ((COLORS == 256) ? 16 : 8) + cbcolor), NULL); +#else + setcchar(&cch, &wch, attrib, 0, NULL); +#endif + wadd_wch(wmain, &cch); +#else +#if COLOR + waddch(ch|COLOR_PAIR(wmain, cfcolor * ((COLORS == 256) ? 16 : 8) + cbcolor)); +#else + waddch(ch); +#endif +#endif + } + return(0); +} + +#if MOUSE + +typedef struct mouse { + MEVENT m_mousePrevEvent; + int32_t m_iMouseMask; + int32_t m_iButtonMask; +} mouse; + +static mouse Mouse; +static int inbuf[100]; /* Mouse input buffer */ +static int * inbufh = /* Head of input buffer */ + inbuf; +static int * inbuft = /* Tail of input buffer */ + inbuf; + +/* + * qin - queue in a character to the input buffer. + */ +VOID qin(int ch) +{ + /* Check for overflow */ + if (inbuft >= &inbuf[sizeof(inbuf) / sizeof(int)]) { + /* Annoy user */ + beep(); + wrefresh(wmain); + return; + } + + /* Add character */ + *inbuft++ = ch; +} + +void checkmouse(void) +{ + MEVENT mouseEvent; + + if (getmouse(&mouseEvent) == OK) { + // ncurses 5.9 doesn't report button releases + + if (mouseEvent.bstate & REPORT_MOUSE_POSITION) { + if ((Mouse.m_mousePrevEvent.bstate & BUTTON1_PRESSED) && ! (mouseEvent.bstate & BUTTON1_PRESSED)) + mouseEvent.bstate |= BUTTON1_PRESSED; + + if ((Mouse.m_mousePrevEvent.bstate & BUTTON2_PRESSED) && ! (mouseEvent.bstate & BUTTON2_PRESSED)) + mouseEvent.bstate |= BUTTON2_PRESSED; + + if ((Mouse.m_mousePrevEvent.bstate & BUTTON3_PRESSED) && ! (mouseEvent.bstate & BUTTON3_PRESSED)) + mouseEvent.bstate |= BUTTON3_PRESSED; + } else { + if ((Mouse.m_mousePrevEvent.bstate & BUTTON1_PRESSED) && ! (mouseEvent.bstate & BUTTON1_PRESSED)) + mouseEvent.bstate |= BUTTON1_RELEASED; + + if ((Mouse.m_mousePrevEvent.bstate & BUTTON2_PRESSED) && ! (mouseEvent.bstate & BUTTON2_PRESSED)) + mouseEvent.bstate |= BUTTON2_RELEASED; + + if ((Mouse.m_mousePrevEvent.bstate & BUTTON3_PRESSED) && ! (mouseEvent.bstate & BUTTON3_PRESSED)) + mouseEvent.bstate |= BUTTON3_RELEASED; + } + + if (mouseEvent.bstate & BUTTON1_RELEASED) { + Mouse.m_mousePrevEvent.bstate &= ~BUTTON1_PRESSED; + mouseEvent.bstate &= ~BUTTON1_PRESSED; + qin(0); + qin(MOUS >> SHIFTPFX); + qin(mouseEvent.x); + qin(mouseEvent.y); + qin('b'); + } + + if (mouseEvent.bstate & BUTTON2_RELEASED) { + Mouse.m_mousePrevEvent.bstate &= ~BUTTON2_PRESSED; + mouseEvent.bstate &= ~BUTTON2_PRESSED; + qin(0); + qin(MOUS >> SHIFTPFX); + qin(mouseEvent.x); + qin(mouseEvent.y); + qin('d'); + } + + if (mouseEvent.bstate & BUTTON3_RELEASED) { + Mouse.m_mousePrevEvent.bstate &= ~BUTTON3_PRESSED; + mouseEvent.bstate &= ~BUTTON3_PRESSED; + qin(0); + qin(MOUS >> SHIFTPFX); + qin(mouseEvent.x); + qin(mouseEvent.y); + qin('f'); + } + + if (mouseEvent.bstate & (BUTTON1_PRESSED | BUTTON1_CLICKED)) { + qin(0); + qin(MOUS >> SHIFTPFX); + qin(mouseEvent.x); + qin(mouseEvent.y); + qin('a'); + } + + if (mouseEvent.bstate & (BUTTON2_PRESSED | BUTTON2_CLICKED)) { + qin(0); + qin(MOUS >> SHIFTPFX); + qin(mouseEvent.x); + qin(mouseEvent.y); + qin('c'); + } + + if (mouseEvent.bstate & (BUTTON3_PRESSED | BUTTON3_CLICKED)) { + qin(0); + qin(MOUS >> SHIFTPFX); + qin(mouseEvent.x); + qin(mouseEvent.y); + qin('e'); + } + + // is mouse dragged ? + if (mouseEvent.bstate & REPORT_MOUSE_POSITION) { + qin(0); + qin(MOUS >> SHIFTPFX); + qin(mouseEvent.x); + qin(mouseEvent.y); + qin('m'); + } + + Mouse.m_mousePrevEvent = mouseEvent; + } +} + +#endif /* MOUSE */ + +/* Cook special characters */ + +int extcode(int ch) +{ + switch (ch) { + case KEY_DOWN: /* down-arrow key */ + return (CTRL|'N'); + case KEY_UP: /* up-arrow key */ + return (CTRL|'P'); + case KEY_LEFT: /* left-arrow key */ + return (CTRL|'B'); + case KEY_RIGHT: /* right-arrow key */ + return (CTRL|'F'); + case KEY_HOME: /* home key */ + return (CTRL|'A'); + case KEY_BACKSPACE: /* backspace key */ + return (CTRL|'?'); + case KEY_F0+1: /* Function keys */ + return (SPEC|'1'); + case KEY_F0+2: + return (SPEC|'2'); + case KEY_F0+3: + return (SPEC|'3'); + case KEY_F0+4: + return (SPEC|'4'); + case KEY_F0+5: + return (SPEC|'5'); + case KEY_F0+6: + return (SPEC|'6'); + case KEY_F0+7: + return (SPEC|'7'); + case KEY_F0+8: + return (SPEC|'8'); + case KEY_F0+9: + return (SPEC|'9'); + case KEY_F0+10: + return (SPEC|'0'); + case KEY_F0+11: + return (SPEC|'a'); + case KEY_F0+12: + return (SPEC|'b'); + case KEY_F0+13: + return (SHFT|SPEC|'1'); + case KEY_F0+14: + return (SHFT|SPEC|'2'); + case KEY_F0+15: + return (SHFT|SPEC|'3'); + case KEY_F0+16: + return (SHFT|SPEC|'4'); + case KEY_F0+17: + return (SHFT|SPEC|'5'); + case KEY_F0+18: + return (SHFT|SPEC|'6'); + case KEY_F0+19: + return (SHFT|SPEC|'7'); + case KEY_F0+20: + return (SHFT|SPEC|'8'); + case KEY_F0+21: + return (SHFT|SPEC|'9'); + case KEY_F0+22: + return (SHFT|SPEC|'0'); + case KEY_F0+23: + return (SHFT|SPEC|'a'); + case KEY_F0+24: + return (SHFT|SPEC|'b'); + case KEY_DL: /* delete-line key */ + return (CTRL|'K'); + case KEY_IL: /* insert-line key */ + return (CTRL|'O'); + case KEY_DC: /* delete-character key */ + return (SPEC|'D'); + case KEY_IC: /* insert-character key */ + return (SPEC|'C'); +// case KEY_EIC: /* sent by rmir or smir in insert mode */ + case KEY_CLEAR: /* clear-screen or erase key */ + return (SPEC|'L'); +// case KEY_EOS: /* clear-to-end-of-screen key */ + case KEY_EOL: /* clear-to-end-of-line key */ + return (CTRL|'K'); + case KEY_SF: /* scroll-forward key */ + return (CTRL|'V'); + case KEY_SR: /* scroll-backward key */ + return (CTRL|'Z'); + case KEY_NPAGE: /* next-page key */ + return (SPEC|'V'); + case KEY_PPAGE: /* previous-page key */ + return (SPEC|'Z'); +// case KEY_STAB: /* set-tab key */ +// case KEY_CTAB: /* clear-tab key */ +// case KEY_CATAB: /* clear-all-tabs key */ + case KEY_ENTER: /* enter/send key */ + return (CTRL|'M'); +// case KEY_PRINT: /* print key */ +// case KEY_LL: /* lower-left key (home down) */ + case KEY_A1: /* upper left of keypad */ + return (SPEC|'<'); + case KEY_A3: /* upper right of keypad */ + return (SPEC|'V'); + case KEY_B2: /* center of keypad */ + return ' '; + case KEY_C1: /* lower left of keypad */ + case KEY_C3: /* lower right of keypad */ + return (CTRL|'V'); + case KEY_BTAB: /* back-tab key */ + return (SHFT|CTRL|'I'); + case KEY_BEG: /* begin key */ + return (META|'<'); + case KEY_CANCEL: /* cancel key */ + return (CTRL|'G'); + case KEY_CLOSE: /* close key */ + return (CTLX|CTRL|'C'); + case KEY_COMMAND: /* command key */ + return (CTLX|'$'); +// case KEY_COPY: /* copy key */ + case KEY_CREATE: /* create key */ + return (CTLX|CTRL|'F'); + case KEY_END: /* end key */ + return (META|'<'); + case KEY_EXIT: /* exit key */ + return (CTLX|CTRL|'C'); + case KEY_FIND: /* find key */ + return (CTRL|'S'); + case KEY_HELP: /* help key */ + return (SPEC|'H'); + case KEY_MARK: /* mark key */ + return (SPEC|' '); +// case KEY_MESSAGE: /* message key */ + case KEY_MOVE: /* move key */ + return (SPEC|'G'); + case KEY_NEXT: /* next key */ + return (ALTD|'S'); + case KEY_OPEN: /* open key */ + case KEY_OPTIONS: /* options key */ + case KEY_PREVIOUS: /* previous key */ + return (ALTD|'R'); +// case KEY_REDO: /* redo key */ +// case KEY_REFERENCE: /* reference key */ + case KEY_REFRESH: /* refresh key */ + return (CTRL|'L'); + case KEY_REPLACE: /* replace key */ + return (SPEC|'R'); +// case KEY_RESTART: /* restart key */ +// case KEY_RESUME: /* resume key */ + case KEY_SAVE: /* save key */ + return (CTLX|CTRL|'W'); + case KEY_SBEG: /* shifted begin key */ + return (SPEC|'B'); +// case KEY_SCANCEL: /* shifted cancel key */ + case KEY_SCOMMAND: /* shifted command key */ + return (CTLX|'#'); +// case KEY_SCOPY: /* shifted copy key */ +// case KEY_SCREATE: /* shifted create key */ + case KEY_SDC: /* shifted delete-character key */ + return (CTRL|'D'); + case KEY_SDL: /* shifted delete-line key */ + return (CTRL|'K'); + case KEY_SELECT: /* select key */ + return (SPEC|'W'); + case KEY_SEND: /* shifted end key */ + return (SPEC|'F'); + case KEY_SEOL: /* shifted clear-to-end-of-line key */ + return (CTRL|'K'); +#if 0 + case KEY_SEXIT: /* shifted exit key */ + case KEY_SFIND: /* shifted find key */ + case KEY_SHELP: /* shifted help key */ + case KEY_SHOME: /* shifted home key */ + case KEY_SIC: /* shifted insert-character key */ + case KEY_SLEFT: /* shifted left-arrow key */ + case KEY_SMESSAGE: /* shifted message key */ + case KEY_SMOVE: /* shifted move key */ + case KEY_SNEXT: /* shifted next key */ + case KEY_SOPTIONS: /* shifted options key */ + case KEY_SPREVIOUS: /* shifted previous key */ + case KEY_SPRINT: /* shifted print key */ + case KEY_SREDO: /* shifted redo key */ + case KEY_SREPLACE: /* shifted replace key */ + case KEY_SRIGHT: /* shifted right-arrow key */ + case KEY_SRSUME: /* shifted resume key */ + case KEY_SSAVE: /* shifted save key */ + case KEY_SSUSPEND: /* shifted suspend key */ + case KEY_SUNDO: /* shifted undo key */ + case KEY_SUSPEND: /* suspend key */ +#endif + case KEY_UNDO: /* undo key */ + return (CTRL|'_'); +#if MOUSE + case KEY_MOUSE: /* Mouse event has occurred */ + checkmouse(); + return *inbufh++; +#endif + case KEY_RESIZE: /* Terminal resize event */ + return (CTRL|'L'); +// case KEY_EVENT: /* We were interrupted by an event */ + case 0x0209: /* ^Suppr */ + return (CTRL|'K'); + case 0x02e1: /* ^Down */ + return (CTLX|CTRL|'N'); + case 0x0214: /* ^End */ + return (CTRL|'G'); + case 0x0219: /* ^Home */ + return (MOUS|'x'); + case 0x0223: /* ^ <- */ + return (SPEC|CTRL|'B'); + case 0x0228: /* ^Page Down */ + return (SPEC|CTRL|'V'); + case 0x022d: /* ^Page Up */ + return (SPEC|CTRL|'Z'); + case 0x0232: /* ^ -> */ + return (SPEC|CTRL|'F'); + case 0x0238: /* ^Up */ + return (CTLX|CTRL|'P'); + } + + return 0; +} + +/** Return cooked characters **/ +int ttgetc() +{ + int ch = 0; + + ttflush(); +#if MOUSE + if (inbufh != inbuft) { + /* Get mouse input from buffer */ + ch = *inbufh++; + + /* reset us to the beginning of the buffer if there are no more + pending characters */ + if (inbufh >= inbuft) + inbufh = inbuft = inbuf; + + return(ch); + } +#endif + /* Return next character */ +#if UTF8 + if (wget_wch(stdscr, (wint_t*) &ch) == KEY_CODE_YES) +#else + if (((ch = wgetch(stdscr)) & KEY_CODE_YES)) +#endif + ch = extcode(ch); +/* No way to distinguish between ALT-A and ESC A + else if (ch == 0x1b) { + wint_t wch; + update_panels(); + wtimeout(stdscr, 10); + + if (wget_wch(stdscr, (wint_t*) &wch) != ERR) + ch = ALTD|wch; + + wtimeout(stdscr, -1); + } +*/ + return(ch); +} + +#if TYPEAH +int typahead() +{ + int count; + +#if MOUSE + /* See if internal buffer is non-empty */ + if (inbufh != inbuft) + return(1); +#endif + /* Get number of pending characters */ + if (ioctl(STDIN_FILENO, FIONREAD, &count)) + return(0); + + return(count); +} +#endif /* TYPEAH */ + +void initmenu(void) +{ + MENUBAR* pbar; + MENUITEM* pitem; + int xpos = 0; + size_t l; +#if REVSTA + wstandout(wmenubar); +#endif + for (pbar = menubar, pbar->m_nitems = 0; pbar->m_text; ++pbar) { + pbar->m_left = xpos; + pbar->m_right = pbar->m_left + strlen(pbar->m_text); + waddstr(wmenubar, pbar->m_text); + waddstr(wmenubar, " "); + xpos = pbar->m_right + 2; + + for (pitem = pbar->m_items; pitem->i_text; ++pitem) { + pitem->i_disabled = 0; + ++pbar->m_nitems; + + if ((l = strlen(pitem->i_text)) > pbar->m_width) + pbar->m_width = l; + } + + pbar->m_width += 2; + } +#if REVSTA + wclrtoeol(wmenubar); + wstandend(wmenubar); + update_panels(); +#endif +} + +/** Initialize screen package **/ +int scopen() +{ + const char* cp; + /* Override size if environment variables exists */ + cp = getenv("LINES"); + if (cp) + term.t_nrow = atoi(cp) - 2; + + cp = getenv("COLUMNS"); + if (cp) + term.t_ncol = atoi(cp); + /* Get real size from screen driver */ +#ifdef TIOCGWINSZ + { + struct winsize w; + if (ioctl(2, TIOCGWINSZ, &w) == 0) + { + if (w.ws_row > 0) + term.t_nrow = w.ws_row - 2; + if (w.ws_col > 0) + term.t_ncol = w.ws_col; + } + } +#else +#ifdef WIOCGETD + { + struct uwdata w; + if (ioctl(2, WIOCGETD, &w) == 0) + { + if (w.uw_height > 0) + term.t_nrow = (w.uw_height / w.uw_vs) - 2; + if (w.uw_width > 0) + term.t_ncol = w.uw_width / w.uw_hs; + } + } +#endif +#endif + if (term.t_nrow < 3 || term.t_ncol < 3) { + puts("Screen size is too small!"); + exit(1); + } + + /* initialize max number of rows and cols */ + term.t_mrow = term.t_nrow; + term.t_mcol = term.t_ncol; + + /* Initialize screen */ + initscr(); +#if COLOR + start_color(); +#endif + cbreak(); + raw(); + noecho(); + nonl(); + intrflush(0, 0); + keypad(stdscr, 1); + idlok(stdscr, 1); + idcok(stdscr, 1); +#if COLOR + if (has_colors()) { + use_default_colors(); + assume_default_colors(COLOR_WHITE, COLOR_BLACK); + + if (COLOR_PAIRS >= 256) { + for (int fg = 0; fg < 16; ++fg) + for (int bg = 0; bg < 16; ++bg) + init_pair(fg * 16 + bg + 1, fg, bg); + } else if (COLOR_PAIRS >= 64) { + for (int fg = 0; fg < 8; ++fg) + for (int bg = 0; bg < 8; ++bg) + init_pair(fg * 8 + bg + 1, fg, bg); + } + } +#endif + + /* Open terminal device */ + if (ttopen()) { + puts("Cannot open terminal"); + exit(1); + } + + wmenubar = newwin(1, term.t_mcol, 0, 0); + scrollok(wmenubar, 0); + wattrset(wmenubar, COLOR_PAIR(COLOR_BLACK * ((COLORS == 256) ? 16 : 8) + COLOR_CYAN + 9)); + wbkgdset(wmenubar, COLOR_PAIR(COLOR_BLACK * ((COLORS == 256) ? 16 : 8) + COLOR_CYAN + 9)); + wclear(wmenubar); + initmenu(); + keypad(wmenubar, 1); + pmenu = new_panel(wmenubar); + show_panel(pmenu); + wmain = newwin(term.t_mrow + 1, term.t_mcol, 1, 0); + scrollok(wmain, 0); + keypad(wmain, 1); + pmain = new_panel(wmain); + show_panel(pmain); + update_panels(); + /* Success */ + return(0); +} + +/** Close screen package **/ +int scclose() +{ + /* Turn off curses */ + update_panels(); + del_panel(pmain); + del_panel(pmenu); + delwin(wmain); + delwin(wmenubar); + endwin(); + /* Success */ + return(0); +} + +/* open keyboard -hm */ +int sckopen() +{ +#if MOUSE + mmask_t oldmask; + mousemask(_ALL_MOUSE_EVENTS, &oldmask); +#endif + return(TRUE); +} + +/* close keyboard -hm */ +int sckclose() +{ + return(TRUE); +} + +/** Move cursor **/ +int scmove(row, col) +int row; /* Row number */ +int col; /* Column number */ +{ + wmove(wmain, row, col); + update_panels(); + /* Success */ + return(0); +} + +/** Erase to end of line **/ +int sceeol() +{ +#if COLOR + wattrset(wmain, COLOR_PAIR(cfcolor * ((COLORS == 256) ? 16 : 8) + cbcolor + 1) | attrib); + wbkgdset(wmain, COLOR_PAIR(cfcolor * ((COLORS == 256) ? 16 : 8) + cbcolor + 1) | attrib); +#endif + wclrtoeol(wmain); + update_panels(); + /* Success */ + return(0); +} + +/** Clear screen **/ +int sceeop() +{ +#if COLOR + wattrset(wmain, COLOR_PAIR(cfcolor * ((COLORS == 256) ? 16 : 8) + cbcolor + 1) | attrib); + wbkgdset(wmain, COLOR_PAIR(cfcolor * ((COLORS == 256) ? 16 : 8) + cbcolor + 1) | attrib); +#endif + werase(wmain); + update_panels(); + /* Success */ + return(0); +} + +/** Set reverse video state **/ +int screv(state) +int state; /* New state */ +{ + if (state) + wstandout(wmain); + else + wstandend(wmain); + + update_panels(); + /* Success */ + return(0); +} + +/** Beep **/ +int scbeep() +{ + beep(); + /* Success */ + return(0); +} + +#if COLOR + +/** Set foreground color (upper case color name) **/ +int scfcol(color) +int color; /* Color to set */ +{ + /* Skip if already the correct color */ + color &= (COLORS == 256) ? 0x0f : 0x07; + + if (color == cfcolor) + return(0); + + if (color & 8) + attrib |= A_BOLD; + else + attrib &= ~A_BOLD; + + cfcolor = color; + wattrset(wmain, COLOR_PAIR(cfcolor * ((COLORS == 256) ? 16 : 8) + cbcolor + 1) | attrib); + wbkgdset(wmain, COLOR_PAIR(cfcolor * ((COLORS == 256) ? 16 : 8) + cbcolor + 1) | attrib); + update_panels(); + return(0); +} + +/** Set background color (lower case color name) **/ +int scbcol(color) +int color; /* Color to set */ +{ + /* Skip if already the correct color */ + color &= (COLORS == 256) ? 0x0f : 0x07; + + if (color == cbcolor) + return(0); + + cbcolor = color; + wattrset(wmain, COLOR_PAIR(cfcolor * ((COLORS == 256) ? 16 : 8) + cbcolor + 1) | attrib); + wbkgdset(wmain, COLOR_PAIR(cfcolor * ((COLORS == 256) ? 16 : 8) + cbcolor + 1) | attrib); + update_panels(); + return(0); +} +#endif /* COLOR */ + +/** Set palette **/ +int spal(cmd) +char * cmd; /* Palette command */ +{ + return(0); +} + +#if HANDLE_WINCH +/* + * Window size changes handled via signals. + */ +void winch_changed(int status) +{ + signal(SIGWINCH,winch_changed); + winch_flag = 1; +} + +void winch_new_size() +{ + struct winsize win; + /* Clear window size changed flag */ + winch_flag = 0; + /* Get new size */ + ioctl(fileno(stdin), TIOCGWINSZ, &win); + winch_vtresize(win.ws_row, win.ws_col); + /* Resize curses screen */ + resizeterm(win.ws_row, win.ws_col); + wresize(wmain, term.t_nrow + 1, term.t_ncol); + /* Reset display */ + onlywind(0,0); + TTmove(0,0); + TTeeop(); + update_panels(); +} + +#endif /* HANDLE_WINCH */ + +static int mdrop = -1; +static int mline = 0; + +static void showitem(MENUITEM* mitem, int ypos, int selected) +{ + int disabled = (mitem->i_checkdisabled && mitem->i_checkdisabled()); + + if (selected) + wstandout(wdrop); + + if (disabled) + wattron(wdrop, A_BOLD); + else + wattron(wdrop, A_DIM); + + wmove(wdrop, ypos, 1); + waddstr(wdrop, mitem->i_text); + + if (mitem->i_markfunc && mitem->i_markfunc()) { + wmove(wdrop, ypos, 1); + waddch(wdrop, '*'); + } + + if (selected) + wstandend(wdrop); + + if (disabled) + wattroff(wdrop, A_BOLD); + else + wattroff(wdrop, A_DIM); +} + +void closedrop(void) +{ + if (wdrop != NULL) { + del_panel(pdrop); + delwin(wdrop); + wdrop = NULL; + + for (MENUBAR* pbar = menubar; pbar->m_text; ++pbar) { + wmove(wmenubar, 0, pbar->m_left); + waddstr(wmenubar, pbar->m_text); + } + } +} + +int handlemenu(WINDOW* wmouse, int ypos, int xpos) +{ + MENUBAR* pbar; + int status = TRUE; + + if (wmouse == wmenubar) { + closedrop(); + + for (pbar = menubar; pbar->m_text; ++pbar) { + if (xpos >= pbar->m_left && xpos <= pbar->m_right) { + if (mdrop == pbar - menubar) + return handlemenu(wmain, 0, 0); + + curs_set(0); +#if REVSTA + wstandend(wmenubar); +#else + wstandout(wmenubar); +#endif + wmove(wmenubar, 0, pbar->m_left); + waddstr(wmenubar, pbar->m_text); +#if REVSTA + wstandout(wmenubar); +#else + wstandend(wmenubar); +#endif + dropmenu = pbar->m_items; + wdrop = newwin(pbar->m_nitems, pbar->m_width, 1, pbar->m_left); + pdrop = new_panel(wdrop); + scrollok(wdrop, false); + wattrset(wdrop, COLOR_PAIR(COLOR_BLACK * ((COLORS == 256) ? 16 : 8) + COLOR_CYAN + 9)); + wbkgdset(wdrop, COLOR_PAIR(COLOR_BLACK * ((COLORS == 256) ? 16 : 8) + COLOR_CYAN + 9)); + + MENUITEM* mitem; + int ypos = 0; + mdrop = pbar - menubar; + mline = 0; + + for (mitem = pbar->m_items; mitem->i_text; ++mitem, ++mline) { + if (*mitem->i_text == '-') + mvwhline(wdrop, ypos, 1, 0, pbar->m_width - 2); + else if (*mitem->i_text != '+') + showitem(mitem, ypos, mline == 1); + + ++ypos; + } + + box(wdrop, 0, 0); + mline = 1; + break; + } + } + + update_panels(); + } else if (wmouse == wdrop) { + int savecl = clexec; + + clexec = FALSE; + closedrop(); + mdrop = -1; + curs_set(1); + update_panels(); + + if (dropmenu[ypos].i_type == BINDFNC) + status = (*(dropmenu[ypos].i_ptr.fp))(0, 0); + else + status = dobuf(dropmenu[ypos].i_ptr.buf); + + clexec = savecl; + } else if (wmouse == wmain) { + closedrop(); + mdrop = -1; + curs_set(2); + update_panels(); + } + + return status; +} + +int menudrop(int f, int n) +{ + return handlemenu(wmenubar, 0, 0); +} + +void menukey(int c) +{ + char begin; + int nline = mline; + + switch (c) { + case CTRL|'N': + begin = *dropmenu[mline + 1].i_text; + + if (begin == '-') + nline += 2; + else if (begin != '+') + ++nline; + + if (mline != nline) { + showitem(&dropmenu[mline], mline, FALSE); + mline = nline; + showitem(&dropmenu[mline], mline, TRUE); + } + + break; + case CTRL|'P': + begin = *dropmenu[mline - 1].i_text; + + if (begin == '-') + nline -= 2; + else if (begin != '+') + nline--; + + if (mline != nline) { + showitem(&dropmenu[mline], mline, FALSE); + mline = nline; + showitem(&dropmenu[mline], mline, TRUE); + } + + break; + case CTRL|'G': + closedrop(); + break; + case CTRL|'M': + handlemenu(wdrop, mline, 1); + break; + case CTRL|'F': + if (menubar[mdrop + 1].m_items) + handlemenu(wmenubar, 0, menubar[mdrop + 1].m_left); + break; + case CTRL|'B': + if (mdrop > 0) + handlemenu(wmenubar, 0, menubar[mdrop - 1].m_left); + break; + case CTRL|'[': + handlemenu(wmain, 0, 0); + break; + } +} + +#define MB_FNC 0 +#define MB_BUF 1 + +/* AddMenuBinding: bind a menu item to an EPOINTER */ +/* ============== */ +/* called by bindtomenu and macrotomenu, once the function or macro name + has been parsed */ + + +static int AddMenuBinding(ETYPE EPOINTER eptr, int type) +{ + char menutext[NSTRING]; + char *itemtext; + MENUBAR* mbar; + MENUITEM* mitem; + + /* Parse the menu text */ + itemtext = &menutext[0]; + + if (mlreply(TEXT306, itemtext, NSTRING) != TRUE) /* "Menu: " */ + return FALSE; + + if ((itemtext = strchr(menutext, '>'))) { + *itemtext++ = '\0'; + + for (mbar = menubar; mbar->m_text; ++mbar) { + if (! strcmp(menutext, mbar->m_text)) { + for (mitem = mbar->m_items; mitem->i_text; ++mitem) { + if (! strncmp(itemtext, mitem->i_text + 1, strlen(itemtext))) { + mitem->i_ptr = eptr; + mitem->i_type = (type == MB_BUF) ? BINDBUF : BINDFNC; + return (TRUE); + } + } + break; + } + } + } + + mlwrite(TEXT300); /* "[Incorrect menu]" */ + return(FALSE); +} + +/* Bind a function to a menu item + * + * Syntax : bind-to-menu function "Menu>Item" + */ + +int bindtomenu(int n, int f) +{ + ETYPE EPOINTER e; + + e.fp = getname(TEXT304); /* "Function: " */ + + if (e.fp == NULL) { + mlwrite (TEXT16); /* "[No such function]" */ + return FALSE; + } + + return AddMenuBinding(e, MB_FNC); +} + +/* Bind a macro buffer to a menu item + * + * Syntax : macro-to-menu buffer "Menu>Item" + */ + +int macrotomenu(int n, int f) +{ + ETYPE EPOINTER e; + char bname[NBUFN]; + + if (mlreply(TEXT305, &bname[1], NBUFN-2) != TRUE) /* "Macro: " */ + return(FALSE); + + bname[0] = '['; + strcat(bname, "]"); + + if ((e.buf = bfind(bname, FALSE, 0)) == NULL) { + mlwrite (TEXT130); + /* "Macro not defined" */ + return(FALSE); + } + + return AddMenuBinding(e, MB_BUF); +} + +/* unbindmenu: remove a menu entry */ +/* ========== */ + +int unbindmenu(int f, int n) +{ + char menutext[NSTRING]; + char *itemtext; + MENUBAR* mbar; + MENUITEM* mitem; + + /* Parse the menu text */ + itemtext = &menutext[0]; + + if (mlreply(TEXT306, itemtext, NSTRING) != TRUE) /* "Menu: " */ + return(FALSE); + + if ((itemtext = strchr(menutext, '>'))) { + *itemtext++ = '\0'; + + for (mbar = menubar; mbar->m_text; ++mbar) { + if (! strcmp(menutext, mbar->m_text)) { + for (mitem = mbar->m_items; mitem->i_text; ++mitem) { + if (! strncmp(itemtext, mitem->i_text + 1, strlen(itemtext))) { + mitem->i_ptr.fp = nullproc; + mitem->i_type = BINDFNC; + return(TRUE); + } + } + break; + } + } + } + + mlwrite(TEXT300); /* "[Incorrect menu]" */ + return(FALSE); +} + +#endif /* CURSES */ + diff --git a/src/display.c b/src/display.c index e1f3da3..e6c9168 100644 --- a/src/display.c +++ b/src/display.c @@ -4,6 +4,8 @@ * physical display screen the same as the virtual display screen. These * functions use hints that are left in the windows by the commands. * + * + * Unicode support by Jean-Michel Dubois */ #include @@ -27,14 +29,14 @@ static VIDEO **pscreen; /* Physical screen. */ #if PROTO #if MEMMAP -extern VOID PASCAL NEAR update_line(int row, struct VIDEO *vp1); +extern VOID update_line(int row, struct VIDEO *vp1); #else -extern VOID PASCAL NEAR update_line(int row, struct VIDEO *vp1, struct VIDEO *vp2); +extern VOID update_line(int row, struct VIDEO *vp1, struct VIDEO *vp2); #endif -extern VOID PASCAL NEAR update_hilite(void); +extern VOID update_hilite(void); #else -extern VOID PASCAL NEAR update_line(); -extern VOID PASCAL NEAR update_hilite(); +extern VOID update_line(); +extern VOID update_hilite(); #endif /* @@ -45,7 +47,7 @@ extern VOID PASCAL NEAR update_hilite(); * redrawn on the first call to "update". */ -int PASCAL NEAR vtinit() +int vtinit() { register int i; register VIDEO *vp; @@ -56,7 +58,7 @@ int PASCAL NEAR vtinit() /* allocate the virtual screen pointer array */ vscreen = (VIDEO **)room(term.t_mrow*sizeof(VIDEO *)); - + if (vscreen == NULL) #if WINDOW_MSWIN return(FALSE); @@ -80,7 +82,11 @@ int PASCAL NEAR vtinit() for (i = 0; i < term.t_mrow; ++i) { /* allocate a virtual screen line */ - vp = (VIDEO *)room(sizeof(VIDEO)+term.t_mcol); + vp = (VIDEO *)room(sizeof(VIDEO)+term.t_mcol +#if UTF8 + * sizeof(unsigned int) +#endif + ); if (vp == NULL) #if WINDOW_MSWIN return(FALSE); @@ -100,7 +106,11 @@ int PASCAL NEAR vtinit() #if MEMMAP == 0 /* allocate and initialize physical shadow screen line */ - vp = (VIDEO *)room(sizeof(VIDEO)+term.t_mcol); + vp = (VIDEO *)room(sizeof(VIDEO)+term.t_mcol +#if UTF8 + * sizeof(unsigned int) +#endif + ); if (vp == NULL) #if WINDOW_MSWIN return(FALSE); @@ -123,7 +133,7 @@ int PASCAL NEAR vtinit() #if CLEAN || WINDOW_MSWIN /* free up all the dynamically allocated video structures */ -VOID PASCAL NEAR vtfree() +VOID vtfree() { int i; for (i = 0; i < term.t_mrow; ++i) { @@ -143,7 +153,7 @@ VOID PASCAL NEAR vtfree() /* vtscreen: map a screen into the Virtual Terminal system */ /* ======== */ -VOID PASCAL NEAR vtscreen(SCREEN *sp) +VOID vtscreen(ESCREEN *sp) { TTflush(); term.t_roworg = sp->s_roworg; @@ -160,7 +170,7 @@ VOID PASCAL NEAR vtscreen(SCREEN *sp) /* vtinitscr: build a virtual terminal resource for a new screen */ /* ========= */ -int PASCAL NEAR vtinitscr(SCREEN *sp, int nrow, int ncol) +int vtinitscr(ESCREEN *sp, int nrow, int ncol) /* returns TRUE if successful */ { @@ -190,7 +200,7 @@ int PASCAL NEAR vtinitscr(SCREEN *sp, int nrow, int ncol) /* vtfreescr: delete a virtual terminal resource for a dying screen */ /* ========= */ -PASCAL NEAR vtfreescr(SCREEN *sp) +vtfreescr(ESCREEN *sp) { vtscreen(sp); vtfree(); @@ -200,7 +210,7 @@ PASCAL NEAR vtfreescr(SCREEN *sp) /* vtsizescr: resize the virtual terminal resources */ /* ========= */ -int PASCAL NEAR vtsizescr(SCREEN *sp, int nrow, int ncol) +int vtsizescr(ESCREEN *sp, int nrow, int ncol) /* returns TRUE if successful. Otherwise, the old VIDEO structures are preserved. */ @@ -215,7 +225,7 @@ int PASCAL NEAR vtsizescr(SCREEN *sp, int nrow, int ncol) if (vtinitscr(sp, nrow, ncol) == TRUE) { /* success! let's free the old VIDEO structures */ EWINDOW *wp; - + vscreen = oldvvp; pscreen = oldpvp; term.t_nrow = oldnrow; @@ -250,7 +260,7 @@ int PASCAL NEAR vtsizescr(SCREEN *sp, int nrow, int ncol) * system prompt will be written in the line). Shut down the channel to the * terminal. */ -PASCAL NEAR vttidy() +VOID vttidy(VOID) { mlerase(); movecursor(term.t_nrow, 0); @@ -264,7 +274,7 @@ PASCAL NEAR vttidy() * screen. There is no checking for nonsense values; this might be a good * idea during the early stages. */ -PASCAL NEAR vtmove(row, col) +VOID vtmove(row, col) int row, col; @@ -280,16 +290,24 @@ int row, col; terminal buffers. Only column overflow is checked. */ -PASCAL NEAR vtputc(c) +VOID vtputc(c) int c; { register VIDEO *vp; /* ptr to line being updated */ - /* defeate automatic sign extenstion */ - c = c & 0xff; + /* defeat automatic sign extension */ +#if UTF8 + if (c < 0) { + c += 256; + if (c < 0) + return; + } +#else + c = c & 0xff; +#endif /* this is the line to put this character! */ vp = vscreen[vtrow]; @@ -338,7 +356,7 @@ int c; * Erase from the end of the software cursor to the end of the line on which * the software cursor is located. */ -PASCAL NEAR vteeol() +VOID vteeol() { register VIDEO *vp; @@ -353,7 +371,7 @@ PASCAL NEAR vteeol() /* upscreen: user routine to force a screen update always finishes complete update */ -int PASCAL NEAR upscreen(f, n) +int upscreen(f, n) int f,n; /* prefix flag and argument */ @@ -369,14 +387,14 @@ int f,n; /* prefix flag and argument */ * correct for the current window. Third, make the virtual and physical * screens the same. */ -VOID PASCAL NEAR update(force) +VOID update(force) int force; /* force update past type ahead? */ { register EWINDOW *wp; #if WINDOW_MSWIN - SCREEN *sp; + ESCREEN *sp; #endif #if TYPEAH @@ -408,9 +426,9 @@ int force; /* force update past type ahead? */ char scroll_flag = 0; int scroll_fcol; static EWINDOW *scroll_wp = (EWINDOW *)NULL; - + sp = sp->s_next_screen; - if (sp == (SCREEN *)NULL) { + if (sp == (ESCREEN *)NULL) { sp = first_screen; sp->s_cur_window = curwp; /* not always up to date */ } @@ -418,7 +436,7 @@ int force; /* force update past type ahead? */ wheadp = sp->s_first_window; scroll_fcol = sp->s_cur_window->w_fcol; #endif - + /* update any windows that need refreshing */ wp = wheadp; while (wp != NULL) { @@ -480,12 +498,12 @@ int force; /* force update past type ahead? */ upddex(); /* if screen is garbage, re-plot it */ - if (sgarbf != FALSE) + if (sgarbf != FALSE) { if (gflags & GFSDRAW) sgarbf = FALSE; else updgar(); - + } /* update the virtual screen to the physical screen */ updupd(force); #if WINDOW_MSWIN @@ -510,7 +528,7 @@ int force; /* force update past type ahead? */ /* reframe: check to see if the cursor is on in the window and re-frame it if needed or wanted */ -VOID PASCAL NEAR reframe(wp) +VOID reframe(wp) EWINDOW *wp; @@ -612,12 +630,12 @@ EWINDOW *wp; /* hilite: in the current window, marks 10 and 11 are set and the area between them is on screen, hilite that area */ -VOID PASCAL NEAR update_hilite() +VOID update_hilite() { - int first_line; /* first screen line to highlight */ + int first_line = 0; /* first screen line to highlight */ short first_pos; /* position in that line */ - int last_line; /* last screen line to highlight */ + int last_line = 0; /* last screen line to highlight */ short last_pos; /* position in that line */ LINE *forptr, *bckptr; /* line pointers searching in current buffer */ int forline, bckline; /* screen lines of for/bck ptrs */ @@ -627,6 +645,7 @@ VOID PASCAL NEAR update_hilite() LINE *b_linep; /* header line of current buffer */ int temp_line; /* temp line # for swap */ short temp_pos; /* more of the same */ + int old_v_left, old_v_right; /* old left/right position */ /* $hilight must be set to the first of 2 consecutive marks used to define the region to highlight */ @@ -710,6 +729,8 @@ VOID PASCAL NEAR update_hilite() first_line += forline; last_line += forline; while (forline < curwp->w_toprow + nlines) { + old_v_left = vscreen[forline]->v_left; + old_v_right = vscreen[forline]->v_right; if ((forline >= first_line) && (forline <= last_line)) { vscreen[forline]->v_left = 0; vscreen[forline]->v_right = findcol(forptr, lused(forptr)); @@ -719,8 +740,17 @@ VOID PASCAL NEAR update_hilite() vscreen[forline]->v_right = last_pos; /* adjust for shifted window */ - vscreen[forline]->v_left -= curwp->w_fcol; - vscreen[forline]->v_right -= curwp->w_fcol; + /* debbugged by jmd */ + if (vscreen[forline]->v_left > curwp->w_fcol) + vscreen[forline]->v_left -= curwp->w_fcol; + else + vscreen[forline]->v_left = 0; + if (vscreen[forline]->v_right > curwp->w_fcol) + vscreen[forline]->v_right -= curwp->w_fcol; + else { + vscreen[forline]->v_left = FARRIGHT; + vscreen[forline]->v_right = 0; + } /* adjust for shifted line */ if (vscreen[forline]->v_flag & VFEXT) { @@ -740,12 +770,17 @@ VOID PASCAL NEAR update_hilite() } else if (vscreen[forline]->v_right>term.t_ncol) vscreen[forline]->v_right = term.t_ncol; - + } else { vscreen[forline]->v_left = FARRIGHT; vscreen[forline]->v_right = 0; } + /* mark line as changed if changed */ + if (vscreen[forline]->v_left != old_v_left || + vscreen[forline]->v_right != old_v_right) + vscreen[forline]->v_flag |= VFCHG; + /* step up one more line */ if (forptr != b_linep) forptr = lforw(forptr); @@ -759,14 +794,38 @@ VOID PASCAL NEAR update_hilite() /* updone: update the current line to the virtual screen */ -VOID PASCAL NEAR updone(wp) +static void show_line(LINE *lp) +{ + int i = 0, len = lused(lp); +#if UTF8 + while (i < len) { + unsigned int wc; +#if THEOX + char c = lgetc(lp, i); + + if ((c & 0x80) && (curbp->b_mode & MDTHEOX)) { + wc = _b_theox2wchar(c); + ++i; + } else +#endif + i += utf8_to_unicode(lp->l_text, i, len, &wc); +#if THEOX + vtputc(wc); +#endif + } +#else + for (i=0; i < len; ++i) + vtputc(lgetc(lp, i)); +#endif +} + +VOID updone(wp) EWINDOW *wp; /* window to update current line in */ { register LINE *lp; /* line to update */ register int sline; /* physical screen line to update */ - register int i; /* search down the line we want */ lp = wp->w_linep; @@ -778,12 +837,12 @@ EWINDOW *wp; /* window to update current line in */ /* and update the virtual line */ vscreen[sline]->v_flag |= VFCHG; + vscreen[sline]->v_flag &= ~VFREQ; taboff = wp->w_fcol; vtmove(sline, -taboff); /* move each char of line to virtual screen until at end */ - for (i=0; i < lused(lp); ++i) - vtputc(lgetc(lp, i)); + show_line(lp); #if COLOR vscreen[sline]->v_rfcolor = wp->w_fcolor; vscreen[sline]->v_rbcolor = wp->w_bcolor; @@ -794,14 +853,13 @@ EWINDOW *wp; /* window to update current line in */ /* updall: update all the lines in a window on the virtual screen */ -VOID PASCAL NEAR updall(wp) +VOID updall(wp) EWINDOW *wp; /* window to update lines in */ { register LINE *lp; /* line to update */ register int sline; /* physical screen line to update */ - register int i; register int nlines; /* number of lines in the current window */ /* search down the lines, updating them */ @@ -820,8 +878,7 @@ EWINDOW *wp; /* window to update lines in */ vtmove(sline, -taboff); if (lp != wp->w_bufp->b_linep) { /* if we are not at the end */ - for (i=0; i < lused(lp); ++i) - vtputc(lgetc(lp, i)); + show_line(lp); lp = lforw(lp); } @@ -843,7 +900,7 @@ EWINDOW *wp; /* window to update lines in */ /* updpos: update the position of the hardware cursor and handle extended lines. This is the only update for simple moves. */ -VOID PASCAL NEAR updpos() +VOID updpos() { register LINE *lp; @@ -893,12 +950,12 @@ VOID PASCAL NEAR updpos() /* upddex: de-extend any line that derserves it */ -VOID PASCAL NEAR upddex() +VOID upddex() { register EWINDOW *wp; register LINE *lp; - register int i,j; + register int i; register int nlines; /* number of lines in the current window */ wp = wheadp; @@ -916,8 +973,7 @@ VOID PASCAL NEAR upddex() (curcol < term.t_ncol - 1)) { taboff = wp->w_fcol; vtmove(i, -taboff); - for (j = 0; j < lused(lp); ++j) - vtputc(lgetc(lp, j)); + show_line(lp); vteeol(); taboff = 0; @@ -937,17 +993,24 @@ VOID PASCAL NEAR upddex() /* updgar: if the screen is garbage, clear the physical screen and the virtual screen and force a full update */ -VOID PASCAL NEAR updgar() +VOID updgar() { register int i; #if MEMMAP == 0 register int j; +#if UTF8 + register unsigned int *txt; +#else register char *txt; +#endif #endif for (i = 0; i < term.t_nrow; ++i) { vscreen[i]->v_flag |= VFCHG; +#if REVSTA + vscreen[i]->v_flag &= ~VFREV; +#endif #if COLOR vscreen[i]->v_fcolor = gfcolor; vscreen[i]->v_bcolor = gbcolor; @@ -963,7 +1026,7 @@ VOID PASCAL NEAR updgar() } movecursor(0, 0); /* Erase the screen. */ -#if COLOR && WINDOW_MSWIN +#if COLOR && (WINDOW_MSWIN || CURSES) TTforg(gfcolor); /* inform the driver of the colors */ TTbacg(gbcolor); /* to be used for erase to end of page */ #endif @@ -988,7 +1051,7 @@ VOID PASCAL NEAR updgar() do the following things */ -VOID PASCAL NEAR update_size() +VOID update_size() { /* if we need the size update */ @@ -1015,9 +1078,9 @@ VOID PASCAL NEAR update_size() */ #if PROTO -int PASCAL NEAR pop(BUFFER *popbuf) +int pop(BUFFER *popbuf) #else -int PASCAL NEAR pop(popbuf) +int pop(popbuf) BUFFER *popbuf; #endif @@ -1029,7 +1092,7 @@ BUFFER *popbuf; int numlines; /* remaining number of lines to display */ int c; /* input character */ - /* add the barrior line to the end of the pop up buffer */ + /* add the barrier line to the end of the pop up buffer */ addline(popbuf, "------------------------------------------"); /* set up to scan pop up buffer */ @@ -1107,7 +1170,7 @@ BUFFER *popbuf; /* updupd: update the physical screen from the virtual screen */ -VOID PASCAL NEAR updupd(force) +VOID updupd(force) int force; /* forced update flag */ @@ -1139,12 +1202,11 @@ int force; /* forced update flag */ will be scrolled right or left to let the user see where the cursor is */ -VOID PASCAL NEAR updext() +VOID updext() { register int rcursor; /* real cursor location */ register LINE *lp; /* pointer to current line */ - register int j; /* index into line */ /* calculate what column the real cursor will end up in */ rcursor = ((curcol - term.t_ncol) % term.t_scrsiz) @@ -1156,9 +1218,7 @@ VOID PASCAL NEAR updext() /* once we reach the left edge */ vtmove(currow, -taboff); /* start scanning offscreen */ lp = curwp->w_dotp; /* line to output */ - for (j=0; jv_flag &= ~(VFCHG | VFCOL); } #else -VOID PASCAL NEAR update_line(row, vp, pp) +VOID update_line(row, vp, pp) int row; /* row of screen to update */ struct VIDEO *vp; /* virtual screen image */ struct VIDEO *pp; /* physical screen image */ { - +#if UTF8 + register unsigned int *vir_left; /* left pointer to virtual line */ + register unsigned int *phy_left; /* left pointer to physical line */ + register unsigned int *vir_right; /* right pointer to virtual line */ + register unsigned int *phy_right; /* right pointer to physical line */ + unsigned int *left_blank; /* left-most trailing blank */ +#else register char *vir_left; /* left pointer to virtual line */ register char *phy_left; /* left pointer to physical line */ register char *vir_right; /* right pointer to virtual line */ register char *phy_right; /* right pointer to physical line */ + char *left_blank; /* left-most trailing blank */ +#endif int rev_left; /* leftmost reversed char index */ int rev_right; /* rightmost reversed char index */ - char *left_blank; /* left-most trailing blank */ int non_blanks; /* non-blanks to the right flag */ int update_column; /* update column */ int old_rev_state = FALSE; /* reverse video states */ @@ -1237,7 +1304,7 @@ struct VIDEO *pp; /* physical screen image */ ++update_column; ++phy_left; } - + #if DBCS /* don't optimize on the left in the middle of a 2 byte char */ if ((vir_left > &vp->v_text[0]) && is2byte(vp->v_text, vir_left - 1)) { @@ -1246,7 +1313,7 @@ struct VIDEO *pp; /* physical screen image */ --phy_left; } #endif - + /* advance past any common chars at the right */ non_blanks = FALSE; while ((vir_right[-1] == phy_right[-1]) && @@ -1258,7 +1325,7 @@ struct VIDEO *pp; /* physical screen image */ if (vir_right[0] != ' ') non_blanks = TRUE; } - + #if DBCS /* don't stop in the middle of a 2 byte char */ if (is2byte(vp->v_text, vir_right-1) || is2byte(pp->v_text, phy_right-1)) { @@ -1336,7 +1403,7 @@ struct VIDEO *pp; /* physical screen image */ /* move to the beginning of the text to update */ movecursor(row, update_column); - while (vir_left != left_blank) { /* Ordinary. */ + while (vir_left != left_blank && update_column < term.t_ncol) { /* Ordinary. */ /* are we in a reverse video field? */ if (pp->v_left <= update_column && update_column < pp->v_right) @@ -1404,12 +1471,13 @@ struct VIDEO *pp; /* physical screen image */ * change the modeline format by hacking at this routine. Called by "update" * any time there is a dirty window. */ -VOID PASCAL NEAR modeline(wp) +VOID modeline(wp) EWINDOW *wp; /* window to update modeline for */ { register char *cp; + register CONST char* ccp; register unsigned char c; register int n; /* cursor position count */ register BUFFER *bp; @@ -1440,8 +1508,8 @@ EWINDOW *wp; /* window to update modeline for */ vscreen[n]->v_left = 0; vscreen[n]->v_right = term.t_ncol; #if COLOR - vscreen[n]->v_rfcolor = 7; /* black on */ - vscreen[n]->v_rbcolor = 0; /* white.....*/ + vscreen[n]->v_rfcolor = 0; /* black on */ + vscreen[n]->v_rbcolor = 7; /* white.....*/ #endif vtmove(n, 0); /* Seek to right line. */ if (wp == curwp) /* mark the current buffer */ @@ -1569,10 +1637,15 @@ EWINDOW *wp; /* window to update modeline for */ if (bp->b_fname[0] != 0) { /* File name. */ vtputc(' '); ++n; - cp = TEXT34; +#if LIBHELP + if (bp->b_flag & BFHELP) + ccp = TEXT289; + else +#endif + ccp = TEXT34; /* "File: " */ - while ((c = *cp++) != 0) { + while ((c = *ccp++) != 0) { vtputc(c); ++n; } @@ -1594,7 +1667,7 @@ EWINDOW *wp; /* window to update modeline for */ } } -VOID PASCAL NEAR getdtime(ts) /* get the current display time string */ +VOID getdtime(ts) /* get the current display time string */ char *ts; @@ -1612,19 +1685,19 @@ char *ts; return; } -VOID PASCAL NEAR upmode() /* update all the mode lines */ +VOID upmode() /* update all the mode lines */ { register EWINDOW *wp; #if WINDOW_MSWIN - SCREEN *sp; + ESCREEN *sp; /* loop through all screens to update even partially hidden ones. Note that we process the "first" screen last */ sp = first_screen; do { sp = sp->s_next_screen; - if (sp == (SCREEN *)NULL) sp = first_screen; + if (sp == (ESCREEN *)NULL) sp = first_screen; vtscreen (sp); wheadp = sp->s_first_window; #endif @@ -1639,19 +1712,19 @@ VOID PASCAL NEAR upmode() /* update all the mode lines */ #endif } -VOID PASCAL NEAR upwind() /* force hard updates on all windows */ +VOID upwind() /* force hard updates on all windows */ { register EWINDOW *wp; #if WINDOW_MSWIN - SCREEN *sp; + ESCREEN *sp; /* loop through all screens to update even partially hidden ones. Note that we process the "first" screen last */ sp = first_screen; do { sp = sp->s_next_screen; - if (sp == (SCREEN *)NULL) sp = first_screen; + if (sp == (ESCREEN *)NULL) sp = first_screen; vtscreen (sp); wheadp = sp->s_first_window; #endif @@ -1671,7 +1744,7 @@ VOID PASCAL NEAR upwind() /* force hard updates on all windows */ * and column "col". The row and column arguments are origin 0. Optimize out * random calls. Update "ttrow" and "ttcol". */ -VOID PASCAL NEAR movecursor(row, col) +VOID movecursor(row, col) int row, col; @@ -1708,7 +1781,7 @@ int row, col; * immediately; the terminal buffer is flushed via a call to the flusher. */ -VOID PASCAL NEAR mlferase() +VOID mlferase() { register int save_discmd; @@ -1719,11 +1792,11 @@ VOID PASCAL NEAR mlferase() discmd = save_discmd;; } -VOID PASCAL NEAR mlerase() +VOID mlerase() { int i; - + movecursor(term.t_nrow, 0); if (discmd == FALSE) return; @@ -1756,7 +1829,7 @@ VOID PASCAL NEAR mlerase() * flag TRUE. Don't write beyond the end of the current terminal width. */ -VOID PASCAL NEAR mlout(c) +VOID mlout(c) int c; /* character to write */ @@ -1766,11 +1839,21 @@ int c; /* character to write */ #else if (ttcol + 1 < term.t_ncol) { #endif +#if THEOX #if WINNT || WINXP - putchar(c); - fflush(stdout); + theoxputchar(c); + fflush(stdout); +#else + theoxputchar(c); #endif +#else +#if WINNT || WINXP + putchar(c); + fflush(stdout); +#else TTputc(c); +#endif +#endif } if (c != '\b') *lastptr++ = c; @@ -1780,14 +1863,18 @@ int c; /* character to write */ #if VARARG #if VARG -VOID CDECL NEAR mlwrite(va_alist) +VOID CDECL mlwrite(va_alist) va_dcl /* variable argument list arg1 = format string arg2+ = arguments in that string */ { +#if UTF8 + register unsigned int c; /* current char in format string */ +#else register int c; /* current char in format string */ +#endif register char *fmt; /* ptr to format string */ register va_list ap; /* ptr to current data field */ int arg_int; /* integer argument */ @@ -1816,12 +1903,25 @@ va_dcl /* variable argument list movecursor(term.t_nrow, 0); lastptr = &lastmesg[0]; /* setup to record message */ - while ((c = *fmt++) != 0) { + while (*fmt) { +#if UTF8 + unsigned int bytes = utf8_to_unicode(fmt, 0, len, &c); + fmt += bytes; + len -= bytes; +#else + c = *fmt++; +#endif if (c != '%') { mlout(c); ++ttcol; } else { +#if UTF8 + bytes = utf8_to_unicode(fmt, 0, len, &c); + fmt += bytes; + len -= bytes; +#else c = *fmt++; +#endif switch (c) { case 'd': arg_int = va_arg(ap, int); @@ -1870,11 +1970,11 @@ va_dcl /* variable argument list } #else #if PROTO -VOID CDECL NEAR mlwrite(char *fmt, ...) +VOID CDECL mlwrite(CONST char *fmt, ...) /* char * fmt;*/ #else -VOID CDECL NEAR mlwrite() -char *fmt; +VOID CDECL mlwrite() +CONST char *fmt; #endif /* variable argument list @@ -1882,7 +1982,12 @@ char *fmt; arg2+ = arguments in that string */ { +#if UTF8 + size_t len = strlen(fmt); + unsigned int c; /* current char in format string */ +#else register int c; /* current char in format string */ +#endif va_list ap; /* ptr to current data field */ int arg_int; /* integer argument */ long arg_long; /* long argument */ @@ -1909,12 +2014,25 @@ char *fmt; movecursor(term.t_nrow, 0); lastptr = &lastmesg[0]; /* setup to record message */ - while ((c = *fmt++) != 0) { + while (*fmt) { +#if UTF8 + unsigned int bytes = utf8_to_unicode(fmt, 0, len, &c); + fmt += bytes; + len -= bytes; +#else + c = *fmt++; +#endif if (c != '%') { mlout(c); ++ttcol; } else { +#if UTF8 + bytes = utf8_to_unicode(fmt, 0, len, &c); + fmt += bytes; + len -= bytes; +#else c = *fmt++; +#endif switch (c) { case 'd': arg_int = va_arg(ap, int); @@ -1970,12 +2088,18 @@ char *fmt; #define ADJUST(ptr, dtype) ptr += sizeof(dtype) #endif -VOID CDECL NEAR mlwrite(fmt) +VOID CDECL mlwrite(fmt) char *fmt; /* format string for output */ { +#if UTF8 + size_t len = strlen(fmt); + unsigned int bytes; + unsigned int c; /* current char in format string */ +#else register int c; /* current char in format string */ +#endif register char *ap; /* ptr to current data field */ /* if we are not currently echoing on the command line, abort this */ @@ -2057,9 +2181,9 @@ char *fmt; /* format string for output */ and for the write-message and clear-message-line commands */ -VOID PASCAL NEAR mlforce(s) +VOID mlforce(s) -char *s; /* string to force out */ +CONST char *s; /* string to force out */ { register int oldcmd; /* original command display flag */ @@ -2076,8 +2200,8 @@ char *s; /* string to force out */ that does not like these kind of errors is used, so that the user can be offered to abort the application */ -VOID PASCAL NEAR mlabort(s) -char *s; +VOID mlabort(s) +CONST char *s; { mlforce(s); } @@ -2086,27 +2210,40 @@ char *s; /* * Write out a string. Update the physical cursor position. This assumes that * the characters in the string all have width "1"; if this is not the case - * things will get screwed up a little. + * things will get screwed up a little. Supports UTF-8 now. */ -VOID PASCAL NEAR mlputs(s) +VOID mlputs(s) -char *s; +CONST char *s; { +#if UTF8 + unsigned int c; + size_t len = strlen(s); + + while (*s) { + unsigned int bytes = utf8_to_unicode(s, 0, len, &c); + s += bytes; + len -= bytes; + mlout(c); + ++ttcol; + } +#else register int c; while ((c = *s++) != 0) { mlout(c); ++ttcol; } +#endif } /* * Write out an integer, in the specified radix. Update the physical cursor * position. */ -VOID PASCAL NEAR mlputi(i, r) +VOID mlputi(i, r) int i, r; @@ -2132,7 +2269,7 @@ int i, r; /* * do the same except as a long integer. */ -VOID PASCAL NEAR mlputli(l, r) +VOID mlputli(l, r) long l; int r; @@ -2159,7 +2296,7 @@ int r; * write out a scaled integer with two decimal places */ -VOID PASCAL NEAR mlputf(s) +VOID mlputf(s) int s; /* scaled integer to output */ @@ -2180,7 +2317,7 @@ int s; /* scaled integer to output */ } #if HANDLE_WINCH -winch_vtresize(rows, cols) +VOID winch_vtresize(rows, cols) int rows, cols; { int i; @@ -2193,26 +2330,34 @@ winch_vtresize(rows, cols) free(vscreen); free(pscreen); +#if CURSES + term.t_mrow=term.t_nrow=rows-2; +#else term.t_mrow=term.t_nrow=rows-1; +#endif term.t_mcol=term.t_ncol=cols; vscreen = (VIDEO **)room(term.t_mrow*sizeof(VIDEO *)); - + if (vscreen == NULL) meexit(1); - + pscreen = (VIDEO **)room(term.t_mrow*sizeof(VIDEO *)); - + if (pscreen == NULL) meexit(1); - + for (i = 0; i < term.t_mrow; ++i) { - vp = (VIDEO *)room(sizeof(VIDEO)+term.t_mcol); - + vp = (VIDEO *)room(sizeof(VIDEO)+term.t_mcol +#if UTF8 + *sizeof(unsigned int) +#endif + ); + if (vp == NULL) meexit(1); - + vp->v_flag = 0; vp->v_left = FARRIGHT; vp->v_right = 0; @@ -2225,18 +2370,22 @@ winch_vtresize(rows, cols) vp->v_rline = i; #endif vscreen[i] = vp; - vp = (VIDEO *)room(sizeof(VIDEO)+term.t_mcol); - + vp = (VIDEO *)room(sizeof(VIDEO)+term.t_mcol +#if UTF8 + *sizeof(unsigned int) +#endif + ); + if (vp == NULL) meexit(1); - + vp->v_flag = VFNEW; vp->v_left = FARRIGHT; vp->v_right = 0; #if INSDEL vp->v_rline = i; /* set requested line position */ #endif - + pscreen[i] = vp; } } diff --git a/src/eval.c b/src/eval.c index 8e49c56..8ac558a 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1,7 +1,10 @@ /* EVAL.C: Expresion evaluation functions for MicroEMACS - written 1993 by Daniel Lawrence */ + written 1993 by Daniel Lawrence + + Unicode support by Jean-Michel Dubois +*/ #include #include "estruct.h" @@ -12,7 +15,7 @@ /* initialize the entries in one user variable table */ -VOID PASCAL NEAR uv_init(ut) +VOID uv_init(ut) UTABLE *ut; /* user variable table to initialize */ @@ -25,7 +28,7 @@ UTABLE *ut; /* user variable table to initialize */ } } -VOID PASCAL NEAR varinit() /* initialize the global user variable table */ +VOID varinit() /* initialize the global user variable table */ { /* allocate the global user variable table */ @@ -39,7 +42,7 @@ VOID PASCAL NEAR varinit() /* initialize the global user variable table */ uv_init(uv_head); } -VOID PASCAL NEAR uv_clean(ut) /* discard the contents of a user variable table */ +VOID uv_clean(ut) /* discard the contents of a user variable table */ UTABLE *ut; /* ptr to table to clear */ @@ -52,7 +55,7 @@ UTABLE *ut; /* ptr to table to clear */ free(ut->uv[i].u_value); } -VOID PASCAL NEAR varclean(ut) /* discard and clear all user variable tables */ +VOID varclean(ut) /* discard and clear all user variable tables */ UTABLE *ut; /* table to clear */ @@ -68,7 +71,7 @@ UTABLE *ut; /* table to clear */ free(ut); } -char *PASCAL NEAR gtfun(fname) /* evaluate a function */ +CONST char *gtfun(fname) /* evaluate a function */ char *fname; /* name of function to evaluate */ @@ -80,7 +83,10 @@ char *fname; /* name of function to evaluate */ char arg2[NSTRING]; /* value of second argument */ char arg3[NSTRING]; /* value of third argument */ static char result[2 * NSTRING]; /* string result */ - +#if UTF8 + unsigned int wc; + unsigned int bytes; +#endif /* look the function up in the function table */ mklower(fname); /* and let it be upper or lower case */ fnum = binary(fname, funval, NFUNCS, MINFLEN); @@ -89,23 +95,23 @@ char *fname; /* name of function to evaluate */ if (fnum == -1) { mlwrite(TEXT244, fname); /* "%%No such function as '%s'" */ - return(errorm); + return ((char*) errorm); } /* if needed, retrieve the first argument */ if (funcs[fnum].f_type >= MONAMIC) { if (macarg(arg1) != TRUE) - return(errorm); + return ((char*) errorm); /* if needed, retrieve the second argument */ if (funcs[fnum].f_type >= DYNAMIC) { if (macarg(arg2) != TRUE) - return(errorm); + return ((char*) errorm); /* if needed, retrieve the third argument */ if (funcs[fnum].f_type >= TRINAMIC) if (macarg(arg3) != TRUE) - return(errorm); + return ((char*) errorm); } } @@ -116,7 +122,15 @@ char *fname; /* name of function to evaluate */ case UFABS: return(int_asc(absv(asc_int(arg1)))); case UFADD: return(int_asc(asc_int(arg1) + asc_int(arg2))); case UFAND: return(ltos(stol(arg1) && stol(arg2))); - case UFASCII: return(int_asc((int)arg1[0])); + case UFASCII: +#if UTF8 + if (is_multibyte_utf8(arg1[0])) { + utf8_to_unicode(arg1, 0, strlen(arg1), &wc); + return int_asc(wc); + } + return(int_asc((int)arg1[0])); +#endif + return(int_asc((int)arg1[0])); case UFBAND: return(int_asc(asc_int(arg1) & asc_int(arg2))); case UFBIND: return(transbind(arg1)); case UFBNOT: return(int_asc(~asc_int(arg1))); @@ -130,7 +144,7 @@ char *fname; /* name of function to evaluate */ /* find it, return ERROR if it does not exist */ bp = bfind(result, FALSE, 0); if (bp == NULL) - return(errorm); + return ((char*) errorm); /* execute it and return whats in the $rval */ dobuf(bp); @@ -140,15 +154,22 @@ char *fname; /* name of function to evaluate */ result[NSTRING - 1] = 0; return(result); - case UFCHR: result[0] = asc_int(arg1); + case UFCHR: +#if UTF8 + wc = asc_int(arg1); + bytes = unicode_to_utf8(wc, result); + result[bytes] = 0; +#else + result[0] = asc_int(arg1); result[1] = 0; +#endif return(result); case UFDIV: if ((arg = asc_int(arg2)) != 0) return(int_asc(asc_int(arg1) / arg)); else { mlwrite(TEXT245); /* "%%Division by Zero is illegal" */ - return(errorm); + return ((char*) errorm); } case UFENV: #if ENVFUNC @@ -166,7 +187,7 @@ char *fname; /* name of function to evaluate */ #if MAGIC if (arg < 0 || arg >= MAXGROUPS) return(bytecopy(result, errorm, NSTRING * 2)); - + return(bytecopy(result, fixnull(grpmatch[arg]), NSTRING * 2)); #else @@ -185,7 +206,7 @@ char *fname; /* name of function to evaluate */ case UFLEFT: return(bytecopy(result, arg1, asc_int(arg2))); case UFLENGTH: return(int_asc(strlen(arg1))); case UFLESS: return(ltos(asc_int(arg1) < asc_int(arg2))); - case UFLOWER: return(mklower(arg1)); + case UFLOWER: return(mklower(strcpy(result, arg1))); case UFMID: arg = asc_int(arg2); if (arg > strlen(arg1)) return(strcpy(result, "")); @@ -198,8 +219,7 @@ char *fname; /* name of function to evaluate */ return (int_asc(-1)); } return(int_asc(findcol(curwp->w_markp[arg], curwp->w_marko[arg]))); - case UFMKLINE: if ((arg = asc_int(arg1)) < 0 || arg >= NMARKS || - curwp->w_markp[arg] == NULL) + case UFMKLINE: if ((arg = asc_int(arg1)) < 0 || arg >= NMARKS || curwp->w_markp[arg] == NULL) { mlwrite(TEXT11, arg); return (int_asc(0)); @@ -210,36 +230,40 @@ char *fname; /* name of function to evaluate */ else { mlwrite(TEXT245); /* "%%Division by Zero is illegal" */ - return(errorm); + return ((char*) errorm); } case UFNEG: return(int_asc(-asc_int(arg1))); case UFNOT: return(ltos(stol(arg1) == FALSE)); case UFOR: return(ltos(stol(arg1) || stol(arg2))); case UFREVERSE: return(strrev(bytecopy(result, arg1, NSTRING * 2))); case UFRIGHT: arg = asc_int(arg2); + if (arg > strlen(arg1)) arg = strlen(arg1); - return(strcpy(result, - &arg1[strlen(arg1) - arg])); + + return(strcpy(result, &arg1[strlen(arg1) - arg])); case UFRND: return(int_asc((int)(ernd() % (long)absv(asc_int(arg1))) + 1L)); case UFSEQUAL: return(ltos(strcmp(arg1, arg2) == 0)); case UFSGREAT: return(ltos(strcmp(arg1, arg2) > 0)); case UFSINDEX: return(int_asc(sindex(arg1, arg2))); case UFSLESS: return(ltos(strcmp(arg1, arg2) < 0)); - case UFSLOWER: return(setlower(arg1, arg2), ""); + case UFSLOWER: return(int_asc(setlower(arg1, arg2))); + case UFSRINDEX: return(int_asc(srindex(arg1, arg2))); case UFSUB: return(int_asc(asc_int(arg1) - asc_int(arg2))); - case UFSUPPER: return(setupper(arg1, arg2), ""); + case UFSUPPER: return(int_asc(setupper(arg1, arg2))); case UFTIMES: return(int_asc(asc_int(arg1) * asc_int(arg2))); - case UFTRIM: return(trimstr(arg1)); + case UFTRIM: return(trimstr(strcpy(result, arg1))); case UFTRUTH: return(ltos(asc_int(arg1) == 42)); - case UFUPPER: return(mkupper(arg1)); - case UFXLATE: return(xlat(arg1, arg2, arg3)); + case UFUPPER: return(mkupper(strcpy(result, arg1))); + case UFXLATE: return(strcpy(result, xlat(arg1, arg2, arg3))); } meexit(-11); /* never should get here */ + + return fixnull(NULL); } -char *PASCAL NEAR gtusr(vname) /* look up a user var's value */ +char *gtusr(vname) /* look up a user var's value */ char *vname; /* name of user variable to fetch */ @@ -251,7 +275,7 @@ char *vname; /* name of user variable to fetch */ /* limit comparisons to significant length */ if (strlen(vname) >= NVSIZE) /* "%" counts, but is not passed */ vname[NVSIZE] = '\0'; - + /* scan through each user variable table starting with the most local and going to the global table */ ut = uv_head; @@ -272,7 +296,7 @@ char *vname; /* name of user variable to fetch */ if (vptr) return(vptr); else - return(errorm); + return ((char*) errorm); } } @@ -280,10 +304,10 @@ next_ut: ut = ut->next; } /* return errorm if we run off the end */ - return(errorm); + return ((char*) errorm); } -char *PASCAL NEAR funval(i) +char *funval(i) int i; @@ -291,7 +315,7 @@ int i; return(funcs[i].f_name); } -char *PASCAL NEAR envval(i) +char *envval(i) int i; @@ -299,10 +323,14 @@ int i; return(envars[i]); } -PASCAL NEAR binary(key, tval, tlength, klength) +int binary(key, tval, tlength, klength) -char *key; /* key string to look for */ -char *(PASCAL NEAR *tval)(); /* ptr to function to fetch table value with */ +CONST char *key; /* key string to look for */ +#if THEOSC +long (*tval)(); +#else +char *(*tval)(); /* ptr to function to fetch table value with */ +#endif int tlength; /* length of table to search */ int klength; /* maximum length of string to compare */ @@ -320,7 +348,11 @@ int klength; /* maximum length of string to compare */ i = (l + u) >> 1; /* do the comparison */ +#if THEOSC + cresult = strncmp(key, (char*) (*tval)(i), klength); +#else cresult = strncmp(key, (*tval)(i), klength); +#endif if (cresult == 0) return(i); if (cresult < 0) @@ -331,9 +363,9 @@ int klength; /* maximum length of string to compare */ return(-1); } -char *PASCAL NEAR gtenv(vname) +CONST char *gtenv(vname) -char *vname; /* name of environment variable to retrieve */ +CONST char *vname; /* name of environment variable to retrieve */ { register int vnum; /* ordinal number of var refrenced */ @@ -344,7 +376,7 @@ char *vname; /* name of environment variable to retrieve */ /* return errorm on a bad reference */ if (vnum == -1) - return(errorm); + return ((char*) errorm); /* otherwise, fetch the appropriate value */ switch (vnum) { @@ -361,9 +393,21 @@ char *vname; /* name of environment variable to retrieve */ case EVCMODE: return(int_asc(curbp->b_mode)); case EVCQUOTE: return(int_asc(cquote)); case EVCURCHAR: +#if UTF8 + if (lused(curwp->w_dotp) == curwp->w_doto) + return int_asc(RET_CHAR); + else if (is_multibyte_utf8(lgetc(curwp->w_dotp, curwp->w_doto))) { + unsigned int wc; + utf8_to_unicode(ltext(curwp->w_dotp), curwp->w_doto, lused(curwp->w_dotp), &wc); + return int_asc(wc); + } + + return int_asc(lgetc(curwp->w_dotp, curwp->w_doto)); +#else return(lused(curwp->w_dotp) == - curwp->w_doto ? int_asc('\r') : + curwp->w_doto ? int_asc(RET_CHAR) : int_asc(lgetc(curwp->w_dotp, curwp->w_doto))); +#endif case EVCURCOL: return(int_asc(getccol(FALSE))); case EVCURLINE: return(long_asc(getlinenum(curbp, curwp->w_dotp))); case EVCURWIDTH:return(int_asc(term.t_ncol)); @@ -451,13 +495,34 @@ char *vname; /* name of environment variable to retrieve */ case EVXPOS: return(int_asc(xpos)); case EVYANKFLAG: return(ltos(yankflag)); case EVYPOS: return(int_asc(ypos)); + case EVMARGIN: return(int_asc(term.t_margin)); + case EVSCRSIZ: return(int_asc(term.t_scrsiz)); + case EVSYSLANG: +#if THEOS + return(int_asc(getlang())); +#else + return(fixnull(getenv("LANG"))); +#endif + case EVPID: return(int_asc(getpid())); + case EVFOUND: return(ltos(schstatus)); + case EVTMPNAM: return(tmpnam(NULL)); + case EVMCOL: return(int_asc(curwp->w_marko[0])); + case EVMLINE: return(int_asc(getmline())); + case EVCUROFFS: return(int_asc(curwp->w_doto)); + case EVCLASS: +#if THEOS + return(int_asc(getclass(27))); +#else + return(fixnull(getenv("TERM"))); +#endif } meexit(-12); /* again, we should never get here */ + return fixnull(NULL); } -char *PASCAL NEAR fixnull(s) /* Don't return NULL pointers! */ +CONST char *fixnull(s) /* Don't return NULL pointers! */ -char *s; +CONST char *s; { if (s == NULL) @@ -468,7 +533,7 @@ char *s; /* return some of the contents of the kill buffer */ -char *PASCAL NEAR getkill() +char *getkill() { register int size; /* max number of chars left to return */ @@ -527,13 +592,13 @@ char *PASCAL NEAR getkill() } } } - + /* and return the constructed value */ *vp = 0; return(value); } -char *PASCAL NEAR trimstr(s) /* trim whitespace off the end of a string */ +char *trimstr(s) /* trim whitespace off the end of a string */ char *s; /* string to trim */ @@ -547,7 +612,7 @@ char *s; /* string to trim */ return(s); } -int PASCAL NEAR setvar(f, n) /* set a variable */ +int setvar(f, n) /* set a variable */ int f; /* default flag */ int n; /* numeric arg (can overide prompted value) */ @@ -571,7 +636,7 @@ int n; /* numeric arg (can overide prompted value) */ /* check the legality and find the var */ findvar(var, &vd, NVSIZE + 1, VT_GLOBAL); - + /* if its not legal....bitch */ if (vd.v_type == -1) { mlwrite(TEXT52, var); @@ -594,7 +659,7 @@ int n; /* numeric arg (can overide prompted value) */ /* if $debug == TRUE, every assignment will echo a statment to that effect here. */ - + if (macbug && (strcmp(var, "%track") != 0)) { strcpy(outline, "((("); @@ -621,7 +686,7 @@ int n; /* numeric arg (can overide prompted value) */ return(status); } -int PASCAL NEAR global_var(f, n) /* declare a global variable */ +int global_var(f, n) /* declare a global variable */ int f; /* default flag */ int n; /* numeric arg (ignored here) */ @@ -644,7 +709,7 @@ int n; /* numeric arg (ignored here) */ /* check the legality and find the var */ findvar(var, &vd, NVSIZE + 1, VT_GLOBAL); - + /* if its not legal....bitch */ if (vd.v_type == -1) { mlwrite(TEXT52, var); @@ -657,7 +722,7 @@ int n; /* numeric arg (ignored here) */ /* if $debug == TRUE, every assignment will echo a statment to that effect here. */ - + if (macbug && (strcmp(var, "%track") != 0)) { strcpy(outline, "(((Globally declare "); @@ -680,7 +745,7 @@ int n; /* numeric arg (ignored here) */ return(status); } -int PASCAL NEAR local_var(f, n) /* declare a local variable */ +int local_var(f, n) /* declare a local variable */ int f; /* default flag */ int n; /* numeric arg (ignored here) */ @@ -703,7 +768,7 @@ int n; /* numeric arg (ignored here) */ /* check the legality and find the var */ findvar(var, &vd, NVSIZE + 1, VT_LOCAL); - + /* if its not legal....bitch */ if (vd.v_type == -1) { mlwrite(TEXT52, var); @@ -716,7 +781,7 @@ int n; /* numeric arg (ignored here) */ /* if $debug == TRUE, every assignment will echo a statment to that effect here. */ - + if (macbug && (strcmp(var, "%track") != 0)) { strcpy(outline, "(((Locally declare "); @@ -741,7 +806,7 @@ int n; /* numeric arg (ignored here) */ /* find a variables type and name */ -VOID PASCAL NEAR findvar(var, vd, size, scope) +VOID findvar(var, vd, size, scope) char *var; /* name of var to get */ VDESC *vd; /* structure to hold type and ptr */ @@ -749,7 +814,7 @@ int size; /* size of var array */ int scope; /* intended scope of any created user variables */ { - register int vnum; /* subscript in varable arrays */ + register int vnum = 0; /* subscript in variable arrays */ register int vtype; /* type to return */ register UTABLE *vut; /* user var table to search */ @@ -818,7 +883,7 @@ retvar: vd->v_num = vnum; return; } -int PASCAL NEAR svar(var, value) /* set a variable */ +int svar(var, value) /* set a variable */ VDESC *var; /* variable to set */ char *value; /* value to set to */ @@ -894,7 +959,7 @@ char *value; /* value to set to */ break; case EVCURCHAR: ldelete(1L, FALSE); /* delete 1 char */ c = asc_int(value); - if (c == '\r') + if (c == RET_CHAR) lnewline(); else linsert(1, (char)c); @@ -976,7 +1041,7 @@ char *value; /* value to set to */ case EVHSCROLL: hscroll = stol(value); lbound = 0; break; - case EVISTERM: isterm = stock(value); + case EVISTERM: isterm = stock((unsigned char*) value); break; case EVKILL: break; case EVLANG: break; @@ -1034,7 +1099,7 @@ char *value; /* value to set to */ case EVREPLACE: strcpy((char *)rpat, value); #if MAGIC rmcclear(); -#endif +#endif break; case EVRVAL: strcpy(rval, value); break; @@ -1063,7 +1128,7 @@ char *value; /* value to set to */ break; case EVSTATUS: cmdstatus = stol(value); break; - case EVSTERM: sterm = stock(value); + case EVSTERM: sterm = stock((unsigned char*) value); break; case EVTARGET: curgoal = asc_int(value); thisflag = saveflag; @@ -1104,7 +1169,7 @@ char *value; /* value to set to */ /* asc_int: ascii string to integer......This is too inconsistant to use the system's */ -int PASCAL NEAR asc_int(st) +int asc_int(st) char *st; @@ -1141,7 +1206,7 @@ char *st; /* int_asc: integer to ascii string.......... This is too inconsistant to use the system's */ -char *PASCAL NEAR int_asc(i) +char *int_asc(i) int i; /* integer to translate to a string */ @@ -1184,7 +1249,7 @@ int i; /* integer to translate to a string */ /* long_asc: long to ascii string.......... This is too inconsistant to use the system's */ -char *PASCAL NEAR long_asc(num) +char *long_asc(num) long num; /* integer to translate to a string */ @@ -1218,9 +1283,9 @@ long num; /* integer to translate to a string */ return(sp); } -int PASCAL NEAR gettyp(token) /* find the type of a passed token */ +int gettyp(token) /* find the type of a passed token */ -char *token; /* token to analyze */ +CONST char *token; /* token to analyze */ { register char c; /* first char in token */ @@ -1251,7 +1316,7 @@ char *token; /* token to analyze */ } } -char *PASCAL NEAR getval(token) /* find the value of a token */ +CONST char *getval(token) /* find the value of a token */ char *token; /* token to evaluate */ @@ -1262,12 +1327,12 @@ char *token; /* token to evaluate */ static char buf[NSTRING];/* string buffer for some returns */ switch (gettyp(token)) { - case TKNUL: return(""); + case TKNUL: return(fixnull("")); case TKARG: /* interactive argument */ strcpy(token, fixnull(getval(&token[1]))); mlwrite("%s", token); - status = getstring(buf, NSTRING, ctoec(RETCHAR)); + status = getstring((unsigned char*) buf, NSTRING, ctoec(RETCHAR)); if (status == ABORT) return(NULL); return(buf); @@ -1279,7 +1344,7 @@ char *token; /* token to evaluate */ bp = bfind(token, FALSE, 0); if (bp == NULL) return(NULL); - + /* if the buffer is displayed, get the window vars instead of the buffer vars */ if (bp->b_nwnd > 0) { @@ -1290,7 +1355,7 @@ char *token; /* token to evaluate */ /* if we are at the end, return */ if (bp->b_linep == bp->b_dotp) return(""); - + /* grab the line as an argument */ blen = lused(bp->b_dotp) - bp->b_doto; if (blen > NSTRING) @@ -1298,7 +1363,7 @@ char *token; /* token to evaluate */ bytecopy(buf, ltext(bp->b_dotp) + bp->b_doto, blen); buf[blen] = 0; - + /* and step the buffer's line ptr ahead a line */ bp->b_dotp = lforw(bp->b_dotp); bp->b_doto = 0; @@ -1311,7 +1376,7 @@ char *token; /* token to evaluate */ } /* and return the spoils */ - return(buf); + return(buf); case TKVAR: return(gtusr(token+1)); case TKENV: return(gtenv(token+1)); @@ -1322,9 +1387,11 @@ char *token; /* token to evaluate */ case TKSTR: return(token+1); case TKCMD: return(token); } + + return fixnull(NULL); } -int PASCAL NEAR stol(val) /* convert a string to a numeric logical */ +int stol(val) /* convert a string to a numeric logical */ char *val; /* value to check for stol */ @@ -1339,7 +1406,7 @@ char *val; /* value to check for stol */ return((asc_int(val) != 0)); } -char *PASCAL NEAR ltos(val) /* numeric logical to string logical */ +CONST char *ltos(val) /* numeric logical to string logical */ int val; /* value to translate */ @@ -1350,7 +1417,7 @@ int val; /* value to translate */ return(falsem); } -char *PASCAL NEAR mkupper(str) /* make a string upper case */ +char *mkupper(str) /* make a string upper case */ char *str; /* string to upper case */ @@ -1359,11 +1426,11 @@ char *str; /* string to upper case */ sp = str; while (*sp) - uppercase((unsigned char *)sp++); + sp += uppercase((unsigned char *)sp); return(str); } -char *PASCAL NEAR mklower(str) /* make a string lower case */ +char *mklower(str) /* make a string lower case */ char *str; /* string to lower case */ @@ -1372,11 +1439,11 @@ char *str; /* string to lower case */ sp = str; while (*sp) - lowercase((unsigned char *)sp++); + sp += lowercase((unsigned char *)sp); return(str); } -int PASCAL NEAR absv(x) /* take the absolute value of an integer */ +int absv(x) /* take the absolute value of an integer */ int x; @@ -1384,7 +1451,7 @@ int x; return(x < 0 ? -x : x); } -long PASCAL NEAR ernd() /* returns a random integer */ +long ernd() /* returns a random integer */ /* This function implements the "minimal standard" RNG from the paper "RNGs: Good Ones are Hard to Find" by Park and @@ -1401,15 +1468,15 @@ long PASCAL NEAR ernd() /* returns a random integer */ return(seed); } -int PASCAL NEAR sindex(source, pattern) /* find pattern within source */ +int sindex(source, pattern) /* find pattern within source */ -char *source; /* source string to search */ -char *pattern; /* string to look for */ +CONST char *source; /* source string to search */ +CONST char *pattern; /* string to look for */ { - char *sp; /* ptr to current position to scan */ - char *csp; /* ptr to source string during comparison */ - char *cp; /* ptr to place to check for equality */ + CONST char *sp; /* ptr to current position to scan */ + CONST char *csp; /* ptr to source string during comparison */ + CONST char *cp; /* ptr to place to check for equality */ /* scanning through the source string */ sp = source; @@ -1434,9 +1501,45 @@ char *pattern; /* string to look for */ return(0); } +#if GCC + +/* find pattern within source */ + +char* strrstr(source, pattern) + +CONST char *source; /* source string to search */ +CONST char *pattern; /* string to look for */ + +{ + CONST char* found = NULL; + CONST char* p = source; + + while ((p = strstr(p, pattern))) { + found = p; + ++p; + } + + return (char*) found; +} + +#endif + +/* find pattern within source from the end */ + +int srindex(source, pattern) + +CONST char *source; /* source string to search */ +CONST char *pattern; /* string to look for */ + +{ + char* p; + + return ((p = strrstr(source, pattern))) ? (p - source + 1) : 0; +} + /* Filter a string through a translation table */ -char *PASCAL NEAR xlat(source, lookup, trans) +char *xlat(source, lookup, trans) char *source; /* string to filter */ char *lookup; /* characters to translate */ @@ -1476,7 +1579,7 @@ xnext: ++sp; /* setwlist: Set an alternative list of character to be considered "in a word */ -PASCAL NEAR setwlist(wclist) +int setwlist(wclist) char *wclist; /* list of characters to consider "in a word" */ @@ -1504,7 +1607,7 @@ char *wclist; /* list of characters to consider "in a word" */ /* getwlist: place in a buffer a list of characters considered "in a word" */ -char *PASCAL NEAR getwlist(buf) +char *getwlist(buf) char *buf; /* buffer to place list of characters */ @@ -1527,31 +1630,31 @@ char *buf; /* buffer to place list of characters */ /* is_num: ascii string is integer......This is too inconsistant to use the system's */ - -int PASCAL NEAR is_num(st) - + +int is_num(st) + char *st; - + { int period_flag; /* have we seen a period yet? */ /* skip preceding whitespace */ while (*st == ' ' || *st == '\t') ++st; - + /* check for sign */ if ((*st == '-') || (*st == '+')) ++st; - + /* scan digits */ period_flag = FALSE; - while ((*st >= '0') && (*st <= '9') || + while (((*st >= '0') && (*st <= '9')) || (*st == '.' && period_flag == FALSE)) { if (*st == '.') period_flag = TRUE; st++; } - + /* scan rest of line for just white space */ while (*st) { if ((*st != '\t') && (*st != ' ')) @@ -1561,7 +1664,7 @@ char *st; return(TRUE); } -int PASCAL NEAR dispvar(f, n) /* display a variable's value */ +int dispvar(f, n) /* display a variable's value */ int f; /* default flag */ int n; /* numeric arg (can overide prompted value) */ @@ -1584,7 +1687,7 @@ int n; /* numeric arg (can overide prompted value) */ /* check the legality and find the var */ findvar(var, &vd, NVSIZE + 1, VT_NONE); - + /* if its not legal....bitch */ if (vd.v_type == -1) { mlwrite(TEXT52, var); @@ -1611,7 +1714,7 @@ int n; /* numeric arg (can overide prompted value) */ of all the environment variables */ -PASCAL NEAR desvars(f, n) +int desvars(f, n) int f,n; /* prefix flag and argument */ @@ -1643,7 +1746,7 @@ int f,n; /* prefix flag and argument */ strcpy(outseq, "$"); strcat(outseq, envars[uindex]); pad(outseq, 14); - + /* add in the value */ olen = strlen(outseq); strncat(outseq, gtenv(envars[uindex]), NSTRING - olen - 1); @@ -1691,17 +1794,17 @@ int f,n; /* prefix flag and argument */ for (uindex = 0; uindex < ut->size; uindex++) { if (ut->uv[uindex].u_name[0] == 0) break; - + /* add in the user variable name */ strcpy(outseq, "%"); strcat(outseq, ut->uv[uindex].u_name); pad(outseq, 14); - + /* add in the value */ olen = strlen(outseq); strncat(outseq, ut->uv[uindex].u_value, NSTRING - olen - 1); outseq[NSTRING - 1] = 0; - + /* and add it as a line into the buffer */ if (addline(varbuf, outseq) != TRUE) return(FALSE); @@ -1719,7 +1822,7 @@ int f,n; /* prefix flag and argument */ names of all the functions */ -int PASCAL NEAR desfunc(f, n) +int desfunc(f, n) int f,n; /* prefix flag and argument */ @@ -1762,7 +1865,7 @@ int f,n; /* prefix flag and argument */ return(TRUE); } -VOID PASCAL NEAR pad(s, len) /* pad a string to indicated length */ +VOID pad(s, len) /* pad a string to indicated length */ char *s; /* string to add spaces to */ int len; /* wanted length of string */ @@ -1773,3 +1876,27 @@ int len; /* wanted length of string */ s[len] = 0; } } + +int getmline(VOID) /* get the mark line number */ +{ + register LINE *lp; /* current line */ + register int numlines; /* # of lines before point */ + + /* starting at the beginning of the buffer */ + lp = lforw(curbp->b_linep); + + /* start counting lines */ + numlines = 0; + while (lp != curbp->b_linep) { + /* if we are on the current line, record it */ + if (lp == curwp->w_markp[0]) + break; + ++numlines; + lp = lforw(lp); + } + + /* and return the resulting count */ + return(numlines + 1); +} + + diff --git a/src/input.c b/src/input.c index d94cf11..6e21573 100644 --- a/src/input.c +++ b/src/input.c @@ -2,6 +2,8 @@ written by Daniel Lawrence (C)Copyright 1995 by Daniel M. Lawrence + Unicode support by Jean-Michel Dubois + Notes: MicroEMACS's kernel processes two distinct forms of @@ -59,9 +61,9 @@ extern struct passwd *getpwnam(); */ #if !WINDOW_MSWIN /* for MS Windows, mlyesno is defined in mswsys.c */ -PASCAL NEAR mlyesno(prompt) +int mlyesno(prompt) -char *prompt; +CONST char *prompt; { int c; /* input character */ @@ -81,6 +83,17 @@ char *prompt; if (c == ectoc(abortc)) /* Bail out! */ return(ABORT); +#if DYNMSGS + if (c & (SPEC|ALTD|CTRL|META|CTLX|MOUS)) + return(FALSE); /* ONLY 'y' or 'Y' allowed!!! */ +#if UTF8 + if (c == tolower(TEXT162[2]) || c == toupper(TEXT162[2])) + return(TRUE); +#else + if (c == lowerc(TEXT162[2]) || c == upperc(TEXT162[2])) + return(TRUE); +#endif +#else /* ?DYNMSGS */ if ((c == 'n') || (c == 'N') || (c & (SPEC|ALTD|CTRL|META|CTLX|MOUS))) return(FALSE); /* ONLY 'y' or 'Y' allowed!!! */ @@ -92,9 +105,11 @@ char *prompt; if (c=='y' || c=='Y') return(TRUE); - - return(FALSE); +#endif /* !DYNMSGS */ + break; } + + return(FALSE); } #endif @@ -106,20 +121,20 @@ char *prompt; * return. Handle erase, kill, and abort keys. */ -PASCAL NEAR mlreply(prompt, buf, nbuf) +int mlreply(prompt, buf, nbuf) -char *prompt; +CONST char *prompt; char *buf; int nbuf; { - return(nextarg(prompt, buf, nbuf, ctoec((int) '\r'))); + return(nextarg(prompt, buf, nbuf, ctoec((int) RET_CHAR))); } /* ectoc: expanded character to character collapse the CTRL and SPEC flags back into an ascii code */ -PASCAL NEAR ectoc(c) +int ectoc(c) int c; @@ -129,14 +144,14 @@ int c; if (c & CTRL) c = c ^ (CTRL | 0x40); if (c & SPEC) - c = c & 255; + c = c & CMSK; return(c); } /* ctoec: character to extended character pull out the CTRL and SPEC prefixes (if possible) */ -PASCAL NEAR ctoec(c) +int ctoec(c) int c; @@ -153,12 +168,15 @@ int c; name if it is unique. */ -#if MSC -int (PASCAL NEAR *PASCAL NEAR getname(char *prompt))(void) +#if MSC || GCC +int (*getname(CONST char *prompt))(void) #else -int (PASCAL NEAR *PASCAL NEAR getname(prompt))() - -char *prompt; /* string to prompt with */ +#if THEOS +int *getname(CONST char* prompt) +#else +int (*getname(CONST char* prompt))() +#endif +CONST char *prompt; /* string to prompt with */ #endif { @@ -177,9 +195,9 @@ char *prompt; /* string to prompt with */ completion code. */ -BUFFER *PASCAL NEAR getcbuf(prompt, defval, createflag) +BUFFER *getcbuf(prompt, defval, createflag) -char *prompt; /* prompt to user on command line */ +CONST char *prompt; /* prompt to user on command line */ char *defval; /* default value to display to user */ int createflag; /* should this create a new buffer? */ @@ -193,9 +211,9 @@ int createflag; /* should this create a new buffer? */ return(bfind(sp, createflag, 0)); } -char *PASCAL NEAR gtfilename(prompt) +char *gtfilename(prompt) -char *prompt; /* prompt to user on command line */ +CONST char *prompt; /* prompt to user on command line */ { #if MSDOS | OS2 @@ -229,9 +247,9 @@ char *prompt; /* prompt to user on command line */ return(sp); } -char *PASCAL NEAR complete(prompt, defval, type, maxlen) +char *complete(prompt, defval, type, maxlen) -char *prompt; /* prompt to user on command line */ +CONST char *prompt; /* prompt to user on command line */ char *defval; /* default value to display to user */ int type; /* type of what we are completing */ int maxlen; /* maximum length of input field */ @@ -259,27 +277,27 @@ int maxlen; /* maximum length of input field */ cpos = 0; /* if it exists, prompt the user for a buffer name */ - if (prompt) + if (prompt) { if (type == CMP_COMMAND) mlwrite("%s", prompt); else if (defval) mlwrite("%s[%s]: ", prompt, defval); else mlwrite("%s: ", prompt); - + } /* build a name string from the keyboard */ while (TRUE) { /* get the keystroke and decode it */ ec = get_key(); - c = ectoc(ec); + c = ectoc(ec); /* if it is from the mouse, or is a function key, blow it off */ if ((ec & MOUS) || (ec & SPEC)) continue; /* if we are at the end, just match it */ - if (c == '\n' || c == '\r') { + if (c == '\n' || c == RET_CHAR) { if (defval && cpos==0) return(defval); else { @@ -312,7 +330,7 @@ int maxlen; /* maximum length of input field */ } TTflush(); - } else if ((c == ' ') || (ec == sterm) || (c == '\t')) { + } else if ((c == ' ') || (ec == sterm) || (c == '\t')) { /* attempt a completion */ switch (type) { case CMP_BUFFER: @@ -492,7 +510,7 @@ int maxlen; /* maximum length of input field */ /* comp_command: Attempt a completion on a command name */ -VOID PASCAL NEAR comp_command(name, cpos) +VOID comp_command(name, cpos) char *name; /* command containing the current name to complete */ int *cpos; /* ptr to position of next character to insert */ @@ -573,7 +591,7 @@ int *cpos; /* ptr to position of next character to insert */ /* clist_command: Make a completion list based on a partial name */ -VOID PASCAL NEAR clist_command(name, cpos) +VOID clist_command(name, cpos) char *name; /* command containing the current name to complete */ int *cpos; /* ptr to position of next character to insert */ @@ -609,7 +627,7 @@ int *cpos; /* ptr to position of next character to insert */ /* comp_buffer: Attempt a completion on a buffer name */ -VOID PASCAL NEAR comp_buffer(name, cpos) +VOID comp_buffer(name, cpos) char *name; /* buffer containing the current name to complete */ int *cpos; /* ptr to position of next character to insert */ @@ -687,7 +705,7 @@ int *cpos; /* ptr to position of next character to insert */ /* clist_buffer: Make a completion list based on a partial buffer name */ -VOID PASCAL NEAR clist_buffer(name, cpos) +VOID clist_buffer(name, cpos) char *name; /* command containing the current name to complete */ int *cpos; /* ptr to position of next character to insert */ @@ -726,18 +744,18 @@ int *cpos; /* ptr to position of next character to insert */ #if !WINDOW_MSWIN /* comp_file: Attempt a completion on a file name */ -VOID PASCAL NEAR comp_file(name, cpos) +VOID comp_file(name, cpos) char *name; /* file containing the current name to complete */ int *cpos; /* ptr to position of next character to insert */ { - register char *fname; /* trial file to complete */ - register int index; /* index into strings to compare */ + register char *fname; /* trial file to complete */ + register int index; /* index into strings to compare */ - register int matches; /* number of matches for name */ - char longestmatch[NSTRING]; /* temp buffer for longest match */ - int longestlen; /* length of longest match (always > *cpos) */ + register int matches; /* number of matches for name */ + char longestmatch[NSTRING]; /* temp buffer for longest match */ + int longestlen = 0; /* length of longest match (always > *cpos) */ /* everything (or nothing) matches an empty string */ if (*cpos == 0) @@ -791,12 +809,21 @@ int *cpos; /* ptr to position of next character to insert */ } name[*cpos] = 0; - +#if THEOS + /* if only one file matched then increment cpos to signal complete() */ + /* that this was a complete match. If a directory was matched then */ + /* 3 from last character will be the DIRSEPCHAR. In this case we do NOT */ + /* want to signal a complete match. */ + if ((matches == 1) + && (name[(*cpos)-3] != DIRSEPCHAR) + && (name[(*cpos)-3] != '.')) +#else /* if only one file matched then increment cpos to signal complete() */ /* that this was a complete match. If a directory was matched then */ /* last character will be the DIRSEPCHAR. In this case we do NOT */ /* want to signal a complete match. */ if ((matches == 1) && (name[(*cpos)-1] != DIRSEPCHAR)) +#endif (*cpos)++; TTflush(); @@ -806,7 +833,7 @@ int *cpos; /* ptr to position of next character to insert */ /* clist_file: Make a completion list based on a partial file name */ -VOID PASCAL NEAR clist_file(name, cpos) +VOID clist_file(name, cpos) char *name; /* command containing the current name to complete */ int *cpos; /* ptr to position of next character to insert */ @@ -848,8 +875,11 @@ int *cpos; /* ptr to position of next character to insert */ /* tgetc: Get a key from the terminal driver, resolve any keyboard macro action */ -int PASCAL NEAR tgetc() - +#if THEOX +int tgetcraw() +#else +int tgetc() +#endif { int c; /* fetched character */ @@ -860,7 +890,7 @@ int PASCAL NEAR tgetc() if (kbdptr < kbdend) return((int)*kbdptr++); - /* at the end of last repitition? */ + /* at the end of last repetition? */ if (--kbdrep < 1) { kbdmode = STOP; #if VISMAC == 0 @@ -869,7 +899,7 @@ int PASCAL NEAR tgetc() #endif } else { - /* reset the macro to the begining for the next rep */ + /* reset the macro to the beginning for the next rep */ kbdptr = &kbdm[0]; return((int)*kbdptr++); } @@ -880,9 +910,8 @@ int PASCAL NEAR tgetc() /* fetch a character from the terminal driver */ c = TTgetc(); - } else { - + c = charpending; cpending = FALSE; } @@ -906,11 +935,25 @@ int PASCAL NEAR tgetc() return(c); } -/* get_key: Get one keystroke. The legal prefixs here +#if THEOX + +int tgetc() +{ + int c = tgetcraw(); + + if ((curbp->b_mode & MDTHEOX) && (c & ~CMSK) == 0) + c = _b_wchar2theox(c & CMSK); + + return c; +} + +#endif + +/* get_key: Get one keystroke. The legal prefixes here are the SPEC, MOUS and CTRL prefixes. */ -int PASCAL NEAR get_key() +int get_key() { int c; /* next input character */ @@ -923,25 +966,40 @@ int PASCAL NEAR get_key() if (c == 0) { /* get the event type */ +#if THEOX + upper = tgetcraw(); +#else upper = tgetc(); - +#endif /* mouse events need us to read in the row/col */ - if (upper & (MOUS >> 8)) { + if (upper & (MOUS >> SHIFTPFX)) { /* grab the x/y position of the mouse */ +#if THEOX + xpos = tgetcraw(); + ypos = tgetcraw(); +#else xpos = tgetc(); ypos = tgetc(); +#endif } /* get the event code */ +#if THEOX + c = tgetcraw(); +#else c = tgetc(); - +#endif + if (upper & (MOUS >> SHIFTPFX)) { + if (! strchr("abcdefm", c)) + return 0; + } /* if it is a function key... map it */ - c = (upper << 8) | c; + c = (upper << SHIFTPFX) | c; } /* yank out the control prefix */ - if (((c & 255) >=0x00 && (c & 255) <= 0x1F) || (c & 255) == 0x7F) - c = CTRL | (c ^ 0x40); + if (((c & CMSK) >= 0x00 && (c & CMSK) <= 0x1F) || (c & CMSK) == 0x7F) + c = CTRL | (c ^ 0x40); /* return the character */ return(c); @@ -950,7 +1008,7 @@ int PASCAL NEAR get_key() /* GETCMD: Get a command from the keyboard. Process all applicable prefix keys */ -int PASCAL NEAR getcmd() +int getcmd() { int c; /* fetched keystroke */ @@ -962,21 +1020,13 @@ int PASCAL NEAR getcmd() /* resolve META and CTLX prefixes */ if (key) { - if (key->k_ptr.fp == meta) { + if (key->k_ptr.fp == uemeta) { c = get_key(); -#if SMOS - c = upperc(c&255) | (c & ~255); /* Force to upper */ -#else - c = upperc(c) | (c & ~255); /* Force to upper */ -#endif + c = upperc(c & CMSK) | (c & ~CMSK); /* Force to upper */ c |= META; } else if (key->k_ptr.fp == cex) { c = get_key(); -#if SMOS - c = upperc(c&255) | (c & ~255); /* Force to upper */ -#else - c = upperc(c) | (c & ~255); /* Force to upper */ -#endif + c = upperc(c & CMSK) | (c & ~CMSK); /* Force to upper */ c |= CTLX; } } @@ -987,9 +1037,9 @@ int PASCAL NEAR getcmd() /* A more generalized prompt/reply function allowing the caller to specify the proper terminator. If the terminator is not - a return('\r'), return will echo as "" + a return(RET_CHAR), return will echo as "" */ -int PASCAL NEAR getstring(buf, nbuf, eolchar) +int getstring(buf, nbuf, eolchar) unsigned char *buf; int nbuf; @@ -1049,10 +1099,19 @@ int eolchar; --ttcol; } - if (buf[cpos] == '\r') { + if (buf[cpos] == RET_CHAR) { outstring("\b\b \b\b"); ttcol -= 2; } +#if UTF8 + + while (cpos) { + if (is_beginning_utf8(buf[cpos])) + break; + + cpos--; + } +#endif TTflush(); } continue; @@ -1063,7 +1122,7 @@ int eolchar; /* clear the buffer */ buf[0] = 0; - + /* clear the message line and return */ mlwrite(""); TTflush(); @@ -1081,7 +1140,7 @@ int eolchar; outstring("\b \b"); --ttcol; } - if (buf[cpos] == '\r') { + if (buf[cpos] == RET_CHAR) { outstring("\b\b \b\b"); ttcol -= 2; } @@ -1116,17 +1175,25 @@ int eolchar; } /* insert the character in the string! */ - if (cpos < nbuf-1) { +#if UTF8 + char utf8[6]; + int bytes = unicode_to_utf8(c, utf8); - buf[cpos++] = c; + if (cpos + bytes < nbuf) { + memcpy(buf + cpos, utf8, bytes); + cpos += bytes; +#else + if (cpos + 1 < nbuf) { - if ((c < ' ') && (c != '\r')) { + buf[cpos++] = c; +#endif + if ((c < ' ') && (c != RET_CHAR)) { outstring("^"); ++ttcol; c ^= 0x40; } - if (c != '\r') { + if (c != RET_CHAR) { if (disinp) mlout(c); } else { /* put out for */ @@ -1137,11 +1204,13 @@ int eolchar; TTflush(); } } + + return(0); } -PASCAL NEAR outstring(s) /* output a string of input characters */ +VOID outstring(s) /* output a string of input characters */ -char *s; /* string to output */ +CONST char *s; /* string to output */ { if (disinp) @@ -1149,22 +1218,35 @@ char *s; /* string to output */ mlout(*s++); } -PASCAL NEAR ostring(s) /* output a string of output characters */ +VOID ostring(s) /* output a string of output characters */ -char *s; /* string to output */ +CONST char *s; /* string to output */ { - if (discmd) - while (*s) +#if UTF8 + size_t len = strlen(s); +#endif + if (discmd) { + while (*s) { +#if UTF8 + unsigned int c; + unsigned int bytes = utf8_to_unicode(s, 0, len, &c); + mlout(c); + s += bytes; + len -= bytes; +#else mlout(*s++); +#endif + } + } } /* * mlprompt -- Display a prompt [with optional default] and the * input terminator. */ -int PASCAL NEAR mlprompt(prompt, dflt, iterm) -char *prompt; +int mlprompt(prompt, dflt, iterm) +CONST char *prompt; char *dflt; int iterm; { @@ -1206,15 +1288,27 @@ int iterm; /* * echostring -- Use echochar() to put out a string. Checks for NULL. */ -int PASCAL NEAR echostring(str, tcol, uptocol) +int echostring(str, tcol, uptocol) char *str; /* characters to be echoed */ int tcol; /* column to be echoed in */ int uptocol; /* last column to be echoed in */ { if (str != NULL) { +#if UTF8 + unsigned int c; + unsigned int bytes; + int len = strlen(str); +#endif while (*str) { movecursor(term.t_nrow, tcol); /* Position the cursor */ - tcol += echochar(*str++); +#if UTF8 + bytes = utf8_to_unicode(str, 0, len, &c); + str += bytes; + len -= bytes; + tcol += ueechochar(c); +#else + tcol += ueechochar(*str++); +#endif if (tcol >= uptocol) { mlout('$'); tcol++; @@ -1229,14 +1323,14 @@ int uptocol; /* last column to be echoed in */ /* * Routine to echo i-search and message-prompting characters. */ -int PASCAL NEAR echochar(c) +int ueechochar(c) unsigned char c; /* character to be echoed */ { int col = 0; /* column to be echoed in */ - if (c == '\r') { /* Newline character? */ + if (c == RET_CHAR) { /* Newline character? */ mlout('<'); mlout('N'); mlout('L'); diff --git a/src/isearch.c b/src/isearch.c index 7bdfa9e..809fb50 100644 --- a/src/isearch.c +++ b/src/isearch.c @@ -25,6 +25,9 @@ * to VMS ports. (Allowing ^X as a synonym for ^S defeats some * of the benefits of the first change above.) * + * Jean-Michel Dubois March 2020 + * - Unicode support + * * (Further comments are in history.c) */ @@ -40,7 +43,7 @@ /* A couple of "own" variables for re-eat */ /* Hey, BLISS user, these were "GLOBAL", I made them "OWN". */ -static int (PASCAL NEAR *saved_get_char)(); /* Get character routine */ +static int (*saved_get_char)(); /* Get character routine */ static int eaten_char = -1; /* Re-eaten char */ /* A couple more "own" variables for the command string */ @@ -54,7 +57,7 @@ static int cmd_reexecute = -1; /* > 0 if re-executing command */ * same code as the normal incremental search, as both can go both ways. */ -int PASCAL NEAR risearch(f, n) +int risearch(f, n) int f, n; /* prefix flag and argument */ { register int status; @@ -64,7 +67,7 @@ int f, n; /* prefix flag and argument */ */ backchar(TRUE, 1); - if (status = isearch(REVERSE)) + if ((status = isearch(REVERSE))) mlerase(); /* If happy, just erase the cmd line */ else mlwrite(TEXT164); @@ -74,12 +77,12 @@ int f, n; /* prefix flag and argument */ /* Again, but for the forward direction */ -int PASCAL NEAR fisearch(f, n) +int fisearch(f, n) int f, n; { register int status; - if (status = isearch(FORWARD)) + if ((status = isearch(FORWARD))) mlerase(); /* If happy, just erase the cmd line */ else mlwrite(TEXT164); @@ -113,7 +116,7 @@ int f, n; * exists (or until the search is aborted). */ -int PASCAL NEAR isearch(dir) +int isearch(dir) int dir; @@ -128,7 +131,7 @@ int dir; int curoff; /* Current offset on entry */ int init_direction; /* The initial search direction */ KEYTAB *ktp; /* The command bound to the key */ - register int (PASCAL NEAR *kfunc)(); /* ptr to the requested function to bind to */ + register int (*kfunc)(); /* ptr to the requested function to bind to */ /* Set up the starting conditions */ @@ -186,8 +189,8 @@ int dir; if (expc == quotec) /* Quote character? */ c = ectoc(expc = get_char()); /* Get the next char */ - else if ((expc > 255 || expc == 0) && - (c != '\t' && c != '\r')) + else if ((expc > CMSK || expc == 0) && + (c != '\t' && c != RET_CHAR)) { kfunc = ((ktp = getbind(expc)) == NULL) ? NULL : ktp->k_ptr.fp; @@ -291,7 +294,7 @@ int dir; TTbacg(gbcolor); #endif movecursor(term.t_nrow, col); /* Position the cursor */ - col += echochar(c); /* Echo the character */ + col += ueechochar(c); /* Echo the character */ if (!status) /* If we lost last time */ TTbeep(); /* Feep again */ else /* Otherwise, we must have won*/ @@ -314,7 +317,7 @@ int dir; * of the matched string for reverse searches. */ -int PASCAL NEAR scanmore(dir) +int scanmore(dir) int dir; /* direction to search */ { register int status; /* search status */ @@ -348,7 +351,7 @@ int dir; /* direction to search */ * If the compare fails, we return FALSE and call scanmore or something. */ -int PASCAL NEAR checknext(chr, dir) +int checknext(chr, dir) int chr; /* Next char to look for */ int dir; /* Search direction */ { @@ -364,12 +367,12 @@ int dir; /* Search direction */ if (dir == FORWARD) { /* If searching forward */ - if (sts = !boundry(curline, curoff, FORWARD)) + if ((sts = !boundry(curline, curoff, FORWARD))) { /* If it's what we're looking for, set the point * and say that we've moved. */ - if (sts = eq(nextch(&curline, &curoff, FORWARD), chr)) + if ((sts = eq(nextch(&curline, &curoff, FORWARD), chr))) { curwp->w_dotp = curline; curwp->w_doto = curoff; @@ -379,12 +382,26 @@ int dir; /* Search direction */ } else { /* Else, reverse search check. */ patrn = (char *) pat; +#if UTF8 + unsigned int wc; + size_t len = strlen(patrn); +#endif while (*patrn) { /* Loop for all characters in patrn */ +#if UTF8 + int bytes = utf8_to_unicode(patrn, 0, len, &wc); + + if ((sts = !boundry(curline, curoff, FORWARD)) == FALSE || + (sts = weq(nextch(&curline, &curoff, FORWARD), *patrn)) == FALSE) + break; /* Nope, just punt it then */ + patrn += bytes; + len -= bytes; +#else if ((sts = !boundry(curline, curoff, FORWARD)) == FALSE || (sts = eq(nextch(&curline, &curoff, FORWARD), *patrn)) == FALSE) break; /* Nope, just punt it then */ patrn++; +#endif } } @@ -405,7 +422,7 @@ int dir; /* Search direction */ * string, so just return the next character. */ -int PASCAL NEAR get_char() +int get_char() { int c; KEYTAB *key; @@ -437,13 +454,15 @@ int PASCAL NEAR get_char() return (isterm); if ((key = getbind(c)) != NULL) { - if (key->k_ptr.fp == cex || key->k_ptr.fp == meta) + if (key->k_ptr.fp == cex || key->k_ptr.fp == uemeta) { c = get_key(); #if SMOS - c = upperc(c&255) | (c & ~255); /* Force to upper */ + c = upperc(c&CMSK) | (c & ~CMSK); /* Force to upper */ +#elif UTF8 + c = ToWUpper(c); #else - c = upperc(c) | (c & ~255); /* Force to upper */ + c = upperc(c) | (c & ~CMSK); /* Force to upper */ #endif c |= (key->k_ptr.fp == cex) ? CTLX : META; } @@ -461,7 +480,7 @@ int PASCAL NEAR get_char() * Come here on the next term.t_getchar call: */ -int PASCAL NEAR uneat() +int uneat() { int c; @@ -471,7 +490,7 @@ int PASCAL NEAR uneat() return (c); /* and return the last char */ } -VOID PASCAL NEAR reeat(c) +VOID reeat(c) int c; { if (eaten_char != -1) /* If we've already been here */ @@ -482,7 +501,7 @@ int c; } #else -int PASCAL NEAR isearch(dir) +int isearch(dir) int dir; { } diff --git a/src/keyboard.c b/src/keyboard.c index badacb8..44547ea 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -17,10 +17,13 @@ Jon Saxton 24 Jan 1990 -===========================================================================*/ + Unicode support by Jean-Michel Dubois + +===========================================================================*/ #include #include "estruct.h" + #include "eproto.h" #include "edef.h" #include "elang.h" @@ -155,7 +158,7 @@ case 0x8C: return(SPEC | ALTD | '='); /* alt F12 */ This implementation distinguishes between the cursor controls on the number pad and those on the grey keypad if an AT-style keyboard is fitted. -*/ +*/ case 0xE047: return(SPEC | 'a'); /* grey home */ case 0xE048: return(SPEC | 'b'); /* grey cursor up */ @@ -237,9 +240,9 @@ typedef struct keyent { /* Key mapping entry */ /* Needed Prototype */ #if PROTO -extern int PASCAL NEAR rec_seq(char *buf, char *bufstart, KEYENT *node); +extern int rec_seq(char *buf, char *bufstart, KEYENT *node); #else -extern int PASCAL NEAR rec_seq(); +extern int rec_seq(); #endif /* some globals needed here */ @@ -252,9 +255,9 @@ static BUFFER *seqbuf; /* For the pop-up buffer */ * add-keymap "escape sequence" keyname */ #if PROTO -int PASCAL NEAR addkeymap(int f, int n) +int addkeymap(int f, int n) #else -int PASCAL NEAR addkeymap( f, n) +int addkeymap( f, n) int f; int n; #endif @@ -289,7 +292,7 @@ int n; } esc_seq[idx++] = c; movecursor(term.t_nrow, col); /* Position the cursor */ - col += echochar(c); + col += ueechochar(c); } ostring(" "); @@ -300,7 +303,7 @@ int n; return FALSE; } - ec = stock(codeseq); + ec = stock((unsigned char*) codeseq); ostring(codeseq); return (addkey(esc_seq, ec)); /* Add to tree */ @@ -310,9 +313,9 @@ int n; * list-keymappings */ #if PROTO -int PASCAL NEAR listkeymaps(int f, int n) +int listkeymaps(int f, int n) #else -int PASCAL NEAR listkeymaps( f, n) +int listkeymaps( f, n) int f; int n; #endif @@ -348,9 +351,9 @@ int n; * and their function name equivalents. */ #if PROTO -int PASCAL NEAR rec_seq(char *buf, char *bufstart, KEYENT *node) +int rec_seq(char *buf, char *bufstart, KEYENT *node) #else -int PASCAL NEAR rec_seq( buf, bufstart, node) +int rec_seq( buf, bufstart, node) char *buf; char *bufstart; KEYENT *node; @@ -380,7 +383,7 @@ KEYENT *node; * * Adds a new escape sequence to the sequence table. * I am not going to try to explain this table to you in detail. - * However, in short, it creates a tree which can easily be transversed + * However, in short, it creates a tree which can easily be traversed * to see if input is in a sequence which can be translated to a * function key (arrows and find/select/do etc. are treated like * function keys). If the sequence is ambiguous or duplicated, @@ -393,18 +396,18 @@ KEYENT *node; * fn - Resulting keycode */ #if PROTO -int PASCAL NEAR addkey(unsigned char * seq, int fn) +int addkey(char * seq, int fn) #else -int PASCAL NEAR addkey( seq, fn) -unsigned char * seq; +int addkey( seq, fn) +char * seq; int fn; #endif { int first; - KEYENT *cur, *nxtcur; + KEYENT *cur = NULL, *nxtcur; /* Skip on null sequences or single character sequences. */ - if (seq == NULL || strlen(seq) < 2) + if (seq == NULL || strlen((CONST char*) seq) < 2) return FALSE; @@ -440,14 +443,14 @@ int fn; } /* Check for room in keymap */ - if (strlen(seq) > NKEYSEQ - (nxtkey - keymap)) { + if (strlen((CONST char*) seq) > NKEYSEQ - (nxtkey - keymap)) { mlwrite("No more room for key entries."); return FALSE; } /* If first character in sequence is inserted, add to prefix table */ if (first) - keyseq[*seq] = 1; + keyseq[(unsigned char) *seq] = 1; /* If characters are left over, insert them into list */ for (first = 1; *seq; first = 0) { @@ -472,6 +475,8 @@ int fn; return TRUE; } +#if !CURSES + /* * Cook input characters, using the key sequences stored by addkey(). * @@ -480,7 +485,11 @@ int fn; #define TIMEOUT 255 VOID cook() { +#if UTF8 + register unsigned int ch; +#else register unsigned char ch; +#endif KEYENT *cur; qin(ch = grabwait()); /* Get first character untimed */ @@ -493,8 +502,8 @@ VOID cook() * But if it is a '\0', make it a (0/1/32). */ if (ch == 0) { - qin(CTRL >> 8); /* control */ - qin(32); /* space */ + qin(CTRL >> SHIFTPFX); /* control */ + qin(32); /* space */ } return; } @@ -530,4 +539,7 @@ VOID cook() cur = cur->samlvl; } } + +#endif + #endif diff --git a/src/line.c b/src/line.c index 539e198..568368f 100644 --- a/src/line.c +++ b/src/line.c @@ -9,6 +9,8 @@ * Since all the code acts on the current window, the buffer that we are * editing must be being displayed, which means that "b_nwnd" is non zero, * which means that the dot and mark values in the buffer headers are nonsense. + * + * Unicode support by Jean-Michel Dubois */ #include @@ -28,7 +30,7 @@ static long last_size = -1L; /* last # of bytes yanked */ * line if no space. */ -LINE *PASCAL NEAR lalloc(used) +LINE *lalloc(used) register int used; @@ -60,11 +62,11 @@ register int used; * might be in. Release the memory. The buffers are updated too; the magic * conditions described in the above comments don't hold here. */ -PASCAL NEAR lfree(lp) +VOID lfree(lp) register LINE *lp; { register BUFFER *bp; - SCREEN *scrp; /* screen to fix pointers in */ + ESCREEN *scrp; /* screen to fix pointers in */ register EWINDOW *wp; register int cmark; /* current mark */ @@ -129,11 +131,11 @@ register LINE *lp; * displayed in more than 1 window we change EDIT t HARD. Set MODE if the * mode line needs to be updated (the "*" has to be set). */ -PASCAL NEAR lchange(flag) +VOID lchange(flag) register int flag; { register EWINDOW *wp; - SCREEN *scrp; /* screen to fix pointers in */ + ESCREEN *scrp; /* screen to fix pointers in */ if (curbp->b_nwnd != 1) /* Ensure hard. */ flag = WFHARD; @@ -158,7 +160,7 @@ register int flag; } } -PASCAL NEAR insspace(f, n) /* insert spaces forward into text */ +int insspace(f, n) /* insert spaces forward into text */ int f, n; /* default flag and numeric argument */ @@ -175,17 +177,36 @@ int f, n; /* default flag and numeric argument */ */ #if PROTO -int PASCAL NEAR linstr(char *instr) +int linstr(CONST char *instr) #else -int PASCAL NEAR linstr( instr) -char *instr; +int linstr( instr) +CONST char *instr; #endif { register int status; +#if !UTF8 register int saved_undo; /* saved undo flag */ - +#endif status = TRUE; if (instr != NULL && *instr != '\0') { +#if UTF8 + unsigned int c; + size_t len = strlen(instr); + + while (*instr && status == TRUE) { + unsigned int bytes = utf8_to_unicode(instr, 0, len, &c); + status = ((*instr == RET_CHAR) ? lnewline(): linsert(1, c)); + + /* Insertion error? */ + if (status != TRUE) { + mlwrite(TEXT168); +/* "%%Can not insert string" */ + break; + } + instr += bytes; + len -= bytes; + } +#else /* record the insertion for the undo stack.... */ undo_insert(OP_ISTR, (long)strlen(instr), obj); @@ -193,7 +214,7 @@ char *instr; saved_undo = undoing; undoing = TRUE; do { - status = ((*instr == '\r') ? lnewline(): linsert(1, *instr)); + status = ((*instr == RET_CHAR) ? lnewline(): linsert(1, *instr)); /* Insertion error? */ if (status != TRUE) { @@ -204,6 +225,7 @@ char *instr; instr++; } while (*instr); undoing = saved_undo; +#endif } return(status); @@ -219,15 +241,7 @@ char *instr; * well, and FALSE on errors. */ -#if PROTO -PASCAL NEAR linsert(int n, char c) -#else -PASCAL NEAR linsert(n, c) - -int n; -char c; -#endif - +static int linsert_byte(int n, unsigned char c) { register char *cp1; register char *cp2; @@ -237,7 +251,7 @@ char c; register int doto; register int i; register EWINDOW *wp; - SCREEN *scrp; /* screen to fix pointers in */ + ESCREEN *scrp; /* screen to fix pointers in */ int cmark; /* current mark */ if (curbp->b_mode&MDVIEW) /* don't allow this command if */ @@ -335,24 +349,87 @@ char c; return(TRUE); } +/* insert a character */ + +#if UTF8 +#if PROTO +int linsert(int n, unsigned int c) +#else +int linsert(n, c) + +int n; +unsigned int c; +#endif +#else +#if PROTO +int linsert(int n, char c) +#else +int linsert(n, c) + +int n; +char c; +#endif +#endif + +{ +#if UTF8 +#if THEOX + if (! (c & 0xFFFF80) || (curbp->b_mode & MDTHEOX)) + return linsert_byte(n, c); +#endif + /* Insert a Unicode character */ + + char utf8[6]; + unsigned int bytes = unicode_to_utf8(c, utf8), i; + + if (bytes == 1) + return linsert_byte(n, (unsigned char) utf8[0]); + + for (i = 0; i < n; i++) { + int j; + for (j = 0; j < bytes; j++) { + unsigned char c = utf8[j]; + + if (!linsert_byte(1, c)) + return FALSE; + } + } + return TRUE; +#else + return linsert_byte(n, c); +#endif +} + /* * Overwrite a character into the current line at the current position * */ - +#if UTF8 #if PROTO -PASCAL NEAR lowrite(char c) +int lowrite(unsigned int c) #else -PASCAL NEAR lowrite(c) +int lowrite(c) char c; /* character to overwrite on current position */ -#endif +#endif /* PROTO */ +#else +#if PROTO +int lowrite(int c) +#else +int lowrite(c) +int c; /* character to overwrite on current position */ +#endif +#endif { if (curwp->w_doto < curwp->w_dotp->l_used && ((lgetc(curwp->w_dotp, curwp->w_doto) != '\t' || tabsize == 0) || (curwp->w_doto) % tabsize == tabsize -1)) +#if UTF8 + ldelchar(1L, FALSE); +#else ldelete(1L, FALSE); +#endif return(linsert(1, c)); } @@ -360,16 +437,38 @@ char c; /* character to overwrite on current position */ * lover -- Overwrite a string at the current point */ -int PASCAL NEAR lover(ostr) +int lover(ostr) -char *ostr; +CONST char *ostr; { register int status = TRUE; - if (ostr != NULL) + if (ostr != NULL && *ostr) { +#if UTF8 + unsigned int c; + size_t len = strlen(ostr); + unsigned int bytes; + + while (*ostr && status == TRUE) { + if (*ostr == RET_CHAR) { + status = lnewline(); + bytes = 1; + } else { + bytes = utf8_to_unicode(ostr, 0, len, &c); + status = lowrite(c); + } + /* Insertion error? */ + if (status != TRUE) { + mlwrite(TEXT172); /* "%%Out of memory while overwriting" */ + break; + } + ostr += bytes; + len -= bytes; + } +#else while (*ostr && status == TRUE) { - status = ((*ostr == '\r') ? lnewline(): lowrite(*ostr)); + status = ((*ostr == RET_CHAR) ? lnewline(): lowrite(*ostr)); /* Insertion error? */ if (status != TRUE) { @@ -379,6 +478,9 @@ char *ostr; } ostr++; } +#endif + } + return(status); } @@ -390,7 +492,7 @@ char *ostr; * update of dot and mark is a bit easier then in the above case, because the * split forces more updating. */ -int PASCAL NEAR lnewline() +int lnewline() { register char *cp1; register char *cp2; @@ -398,7 +500,7 @@ int PASCAL NEAR lnewline() register LINE *lp2; register int doto; register EWINDOW *wp; - SCREEN *scrp; /* screen to fix pointers in */ + ESCREEN *scrp; /* screen to fix pointers in */ int cmark; /* current mark */ if (curbp->b_mode&MDVIEW) /* don't allow this command if */ @@ -457,6 +559,53 @@ int PASCAL NEAR lnewline() return(TRUE); } +#if UTF8 + +int lgetchar(unsigned int *c) +{ +#if THEOX + *c = lgetc(curwp->w_dotp, curwp->w_doto); + + if (! (*c & 0xFFFF80) || (curbp->b_mode & MDTHEOX)) + return 1; +#endif + return utf8_to_unicode(curwp->w_dotp->l_text, curwp->w_doto, lused(curwp->w_dotp), c); +} + +/* + * ldelete() really fundamentally works on bytes, not characters. + * It is used for things like "scan 5 words forwards, and remove + * the bytes we scanned". + * + * If you want to delete characters, use ldelchar(). + */ +int ldelchar(long n, int kflag) +{ + if (n > 0) { + while (n-- > 0) { + unsigned int c; + + if (!ldelete(lgetchar(&c), kflag)) + return FALSE; + } + } else if (n < 0) { + while (n++ < 0) { + unsigned int c; + + if (backchar(FALSE, 1)) { + size_t bytes = lgetchar(&c); + forwchar(FALSE, 1); + + if (!ldelete(-bytes, kflag)) + return FALSE; + } + } + } + return TRUE; +} + +#endif + /* LDELETE: @@ -470,7 +619,7 @@ should be put in the kill buffer. */ -PASCAL NEAR ldelete(n, kflag) +int ldelete(n, kflag) long n; /* # of chars to delete */ int kflag; /* put killed text in kill buffer flag */ @@ -502,32 +651,32 @@ int kflag; /* put killed text in kill buffer flag */ /* record the current point */ dotp = curwp->w_dotp; doto = curwp->w_doto; - + /* can't delete past the end of the buffer */ if (dotp == curbp->b_linep) return(FALSE); - + /* find out how many chars to delete on this line */ chunk = dotp->l_used-doto; /* Size of chunk. */ if (chunk > n) chunk = n; - + /* if at the end of a line, merge with the next */ if (chunk == 0) { - + /* flag that we are making a hard change */ lchange(WFHARD); if (ldelnewline() == FALSE || (kflag != FALSE && - kinsert(FORWARD, '\r')==FALSE)) + kinsert(FORWARD, RET_CHAR)==FALSE)) return(FALSE); --n; continue; } - + /* flag the fact we are changing the current line */ lchange(WFEDIT); - + /* find the limits of the kill */ cp1 = &dotp->l_text[doto]; cp2 = cp1 + chunk; @@ -545,7 +694,7 @@ int kflag; /* put killed text in kill buffer flag */ obj.obj_sptr = cp1; undo_insert(OP_DSTR, (long)chunk, obj); } - + /* save the text to the kill buffer */ if (kflag != FALSE) { while (cp1 != cp2) { @@ -555,23 +704,23 @@ int kflag; /* put killed text in kill buffer flag */ } cp1 = &dotp->l_text[doto]; } - + /* copy what is left of the line upward */ while (cp2 != &dotp->l_text[dotp->l_used]) *cp1++ = *cp2++; dotp->l_used -= chunk; - + /* fix any other windows with the same text displayed */ wp = wheadp; while (wp != NULL) { - + /* reset the dot if needed */ if (wp->w_dotp==dotp && wp->w_doto>=doto) { wp->w_doto -= chunk; if (wp->w_doto < doto) wp->w_doto = doto; } - + /* reset any marks if needed */ for (cmark = 0; cmark < NMARKS; cmark++) { if (wp->w_markp[cmark]==dotp && wp->w_marko[cmark]>=doto) { @@ -580,11 +729,11 @@ int kflag; /* put killed text in kill buffer flag */ wp->w_marko[cmark] = doto; } } - + /* onward to the next window */ wp = wp->w_wndp; } - + /* indicate we have deleted chunk characters */ n -= chunk; } @@ -602,33 +751,33 @@ int kflag; /* put killed text in kill buffer flag */ /* record the current point */ dotp = curwp->w_dotp; doto = curwp->w_doto; - + /* can't delete past the beginning of the buffer */ if (dotp == lforw(curbp->b_linep) && (doto == 0)) return(FALSE); - + /* find out how many chars to delete on this line */ chunk = doto; /* Size of chunk. */ if (chunk > -n) chunk = -n; - + /* if at the beginning of a line, merge with the last */ if (chunk == 0) { - + /* flag that we are making a hard change */ lchange(WFHARD); backchar(TRUE, 1); if (ldelnewline() == FALSE || (kflag != FALSE && - kinsert(REVERSE, '\r')==FALSE)) + kinsert(REVERSE, RET_CHAR)==FALSE)) return(FALSE); ++n; continue; } - + /* flag the fact we are changing the current line */ lchange(WFEDIT); - + /* find the limits of the kill */ cp1 = &dotp->l_text[doto]; cp2 = cp1 - chunk; @@ -639,7 +788,7 @@ int kflag; /* put killed text in kill buffer flag */ ++n; } #endif - + /* save deleted characters for an undo... */ if (undoflag == TRUE) { curwp->w_doto -= chunk; @@ -656,24 +805,24 @@ int kflag; /* put killed text in kill buffer flag */ } cp1 = &dotp->l_text[doto]; } - + /* copy what is left of the line downward */ while (cp1 != &dotp->l_text[dotp->l_used]) *cp2++ = *cp1++; dotp->l_used -= chunk; curwp->w_doto -= chunk; - + /* fix any other windows with the same text displayed */ wp = wheadp; while (wp != NULL) { - + /* reset the dot if needed */ if (wp->w_dotp==dotp && wp->w_doto>=doto) { wp->w_doto -= chunk; if (wp->w_doto < doto) wp->w_doto = doto; } - + /* reset any marks if needed */ for (cmark = 0; cmark < NMARKS; cmark++) { if (wp->w_markp[cmark]==dotp && wp->w_marko[cmark]>=doto) { @@ -682,11 +831,11 @@ int kflag; /* put killed text in kill buffer flag */ wp->w_marko[cmark] = doto; } } - + /* onward to the next window */ wp = wp->w_wndp; } - + /* indicate we have deleted chunk characters */ n += chunk; } @@ -699,9 +848,9 @@ int kflag; /* put killed text in kill buffer flag */ */ #if PROTO -char *PASCAL NEAR getctext(char *rline) +char *getctext(char *rline) #else -char *PASCAL NEAR getctext( rline) +char *getctext( rline) char *rline; #endif @@ -728,7 +877,7 @@ char *rline; /* putctext: replace the current line with the passed in text */ -PASCAL NEAR putctext(iline) +int putctext(iline) char *iline; /* contents of new line */ @@ -757,7 +906,7 @@ char *iline; /* contents of new line */ * about in memory. Return FALSE on error and TRUE if all looks ok. Called by * "ldelete" only. */ -int PASCAL NEAR ldelnewline() +int ldelnewline() { register char *cp1; register char *cp2; @@ -765,7 +914,7 @@ int PASCAL NEAR ldelnewline() register LINE *lp2; register LINE *lp3; register EWINDOW *wp; - SCREEN *scrp; /* screen to fix pointers in */ + ESCREEN *scrp; /* screen to fix pointers in */ int cmark; /* current mark */ if (curbp->b_mode&MDVIEW) /* don't allow this command if */ @@ -873,12 +1022,12 @@ int PASCAL NEAR ldelnewline() */ #if PROTO -int PASCAL NEAR addline(BUFFER *bp, char *text) +int addline(BUFFER *bp, CONST char *text) #else -int PASCAL NEAR addline(bp, text) +int addline(bp, text) BUFFER *bp; /* buffer to add text to */ -char *text; /* line to add */ +CONST char *text; /* line to add */ #endif { register LINE *lp; @@ -913,7 +1062,7 @@ char *text; /* line to add */ * in case the buffer has grown to immense size. No errors. */ -VOID PASCAL NEAR kdelete() +VOID kdelete() { KILL *kp; /* ptr to scan kill buffer chunk list */ @@ -941,7 +1090,7 @@ VOID PASCAL NEAR kdelete() /* and reset all the kill buffer pointers */ kbufh[kill_index] = kbufp[kill_index] = NULL; kskip[kill_index] = 0; - kused[kill_index] = KBLOCK; + kused[kill_index] = KBLOCK; } } @@ -950,7 +1099,7 @@ VOID PASCAL NEAR kdelete() what will be the new kill buffer */ -VOID PASCAL NEAR next_kill() +VOID next_kill() { /* advance to the next kill ring entry */ @@ -968,9 +1117,9 @@ VOID PASCAL NEAR next_kill() */ #if PROTO -int PASCAL NEAR kinsert(int direct, char c) +int kinsert(int direct, char c) #else -int PASCAL NEAR kinsert(direct, c) +int kinsert(direct, c) int direct; /* direction (FORWARD/REVERSE) to insert characters */ char c; /* character to insert in the kill buffer */ @@ -1006,7 +1155,7 @@ char c; /* character to insert in the kill buffer */ } #endif } - + /* and now insert the character */ kbufp[kill_index]->d_chunk[kused[kill_index]++] = c; } else { @@ -1040,7 +1189,7 @@ char c; /* character to insert in the kill buffer */ } #endif } - + /* and now insert the character */ kbufh[kill_index]->d_chunk[--kskip[kill_index]] = c; } @@ -1053,17 +1202,21 @@ char c; /* character to insert in the kill buffer */ * check for errors. Bound to "C-Y". */ -#define Char_insert(a) (a == '\r' ? lnewline() : linsert(1, a)) +#if UTF8 +#define Char_insert(a) (a == RET_CHAR ? lnewline() : linsert_byte(1, a)) +#else +#define Char_insert(a) (a == RET_CHAR ? lnewline() : linsert(1, a)) +#endif -int PASCAL NEAR yank(f, n) +int yank(f, n) int f,n; /* prefix flag and argument */ { register int counter; /* counter into kill buffer data */ register char *sp; /* pointer into string to insert */ - short int curoff; /* storage for line before yanking */ - LINE *curline; + short int curoff = 0; /* storage for line before yanking */ + LINE *curline = NULL; KILL *kptr; /* pointer into kill buffer */ if (curbp->b_mode&MDVIEW) /* don't allow this command if */ @@ -1105,7 +1258,7 @@ int f,n; /* prefix flag and argument */ } else { kptr = kbufh[kill_index]; } - + if (kptr != (KILL *)NULL) { while (kptr != kbufp[kill_index]) { sp = kptr->d_chunk; @@ -1137,7 +1290,7 @@ int f,n; /* prefix flag and argument */ return(TRUE); } -int PASCAL NEAR cycle_ring(f, n) +int cycle_ring(f, n) int f,n; /* prefix flag and argument */ @@ -1160,7 +1313,7 @@ int f,n; /* prefix flag and argument */ return TRUE; } -int PASCAL NEAR yank_pop(f, n) +int yank_pop(f, n) int f,n; /* prefix flag and argument */ @@ -1182,7 +1335,7 @@ int f,n; /* prefix flag and argument */ return(yank(FALSE, 1)); } -int PASCAL NEAR clear_ring(f, n) +int clear_ring(f, n) int f,n; /* prefix flag and argument */ diff --git a/src/main.c b/src/main.c index 57e62c4..10a6e02 100644 --- a/src/main.c +++ b/src/main.c @@ -8,6 +8,8 @@ * non-commercial purposes. MicroEMACS 5.00 can only be incorporated * into commercial software with the permission of the current author. * + * Unicode support by Jean-Michel Dubois + * * This file contains the main driving routine, and some keyboard processing * code, for the MicroEMACS screen editor. * @@ -68,6 +70,13 @@ extern unsigned int _stklen = 10000; #include #endif +#if THEOS +# ifndef MAINWA_BUG +# pragma wild argv +# endif +#pragma prog 5.0,0,0,0,"Port by Jean-Michel Dubois" +#endif + /* This is the primary entry point that is used by command line invocation, and by applications that link with microemacs in @@ -82,15 +91,15 @@ extern unsigned int _stklen = 10000; Note that re-entering an Emacs that is saved in a kept subprocess would require a similar entrypoint. -*/ + */ #if CALLED int emacs(argc, argv) #else #if XVT -called_main(argc, argv) +int called_main(argc, argv) #else -main(argc, argv) +int main(argc, argv) #endif #endif @@ -98,12 +107,34 @@ int argc; /* # of arguments */ char *argv[]; /* argument strings */ { - register int status; - + register int status = 0; +#if UTF8 + char* p = setlocale(LC_CTYPE, NULL); +#endif +#if defined(THEOS) && defined(MAINWA_BUG) + extern int _setargv(int*, char***); + _setargv(&argc, &argv); +#endif #if HANDLE_WINCH signal(SIGWINCH,winch_changed); #endif +#if UTF8 + /* save LC_CTYPE locale */ + if (p) { + size_t l = strlen(p); + l = min(l, NSTRING - 1); + strncpy(locale, p, l); + locale[l] = '\0'; + } + else + p = "C"; + + if (! strstr(p, ".UTF-8")) { + /* set French locale */ + setlocale(LC_CTYPE, ""); + } +#endif /* the room mechanism would deallocate undo info no failure.... its not set up yet, so make sure it doesn't try until the editor is initialized */ @@ -111,6 +142,9 @@ char *argv[]; /* argument strings */ /* Initialize the editor */ eexitflag = FALSE; +#if DYNMSGS + msinit(); /* load dynamic messages */ +#endif #if !WINDOW_MSWIN vtinit(); /* Terminal */ #endif @@ -120,8 +154,9 @@ char *argv[]; /* argument strings */ edinit(mainbuf); /* Buffers, windows, screens */ ab_init(); /* initialize the abbreviation behavior */ varinit(); /* user variables */ +#if ! UTF8 initchars(); /* character set definitions */ - +#endif #if MAGIC mcdeltapat[0].mc_type = tapatledcm[0].mc_type = JMPTABLE; mcdeltapat[0].u.jmptable = &deltapat; @@ -152,6 +187,9 @@ char *argv[]; /* argument strings */ #if CLEAN clean(); #endif +#if UTF8 + setlocale(LC_CTYPE, locale); /* restore LC_CTYPE locale */ +#endif #if CALLED return(status); #else @@ -164,13 +202,13 @@ char *argv[]; /* argument strings */ On some primitive operation systems, and when emacs is used as a subprogram to a larger project, emacs needs to de-alloc its own used memory, otherwise we just exit. -*/ + */ -PASCAL NEAR clean() +clean() { register BUFFER *bp; /* buffer list pointer */ - register SCREEN *scrp; /* ptr to screen to dump */ + register ESCREEN *scrp; /* ptr to screen to dump */ /* first clean up the screens */ scrp = first_screen; @@ -216,7 +254,7 @@ PASCAL NEAR clean() /* Process a command line. May be called any time. */ -VOID PASCAL NEAR dcline(argc, argv, firstflag) +VOID dcline(argc, argv, firstflag) int argc; char *argv[]; @@ -244,8 +282,9 @@ int firstflag; /* is this the first time in? */ int cryptflag; /* encrypting on the way in? */ char ekey[NPAT]; /* startup encryption key */ #endif - NOSHARE CONST extern char *pathname[]; /* startup file path/name array */ - +#if BACKUP + int nobackflag; /* no backup ? */ +#endif viewflag = FALSE; /* view mode defaults off in command line */ gotoflag = FALSE; /* set to off to begin with */ gline = 1; @@ -257,6 +296,9 @@ int firstflag; /* is this the first time in? */ exec_error = FALSE; /* no macro error pending */ #if CRYPT cryptflag = FALSE; /* no encryption by default */ +#endif +#if BACKUP + nobackflag = FALSE; /* backup files by default */ #endif disphigh = FALSE; /* don't escape high bit characters */ lterm[0] = 0; /* standard line terminators */ @@ -265,67 +307,85 @@ int firstflag; /* is this the first time in? */ for (carg = 1; carg < argc; ++carg) { /* Process Switches */ + if (argv[carg][0] == #if WMCS - if (argv[carg][0] == ':') { + ':' #else - if (argv[carg][0] == '-') { + '-' #endif + ) { /* Process Startup macroes */ switch (argv[carg][1]) { - case 'c': /* -c for changable file */ - case 'C': - viewflag = FALSE; - break; - case 'e': /* -e process error file */ - case 'E': - errflag = TRUE; - break; - case 'g': /* -g for initial goto line */ - case 'G': - gotoflag = TRUE; - gline = asc_int(&argv[carg][2]); - break; - case 'i': /* -i set an initial */ - case 'I': /* value for a variable */ - bytecopy(bname, &argv[carg][2], NVSIZE); - findvar(bname, &vd, NVSIZE + 1, VT_GLOBAL); - if (vd.v_type == -1) { - mlwrite(TEXT52, bname); -/* "%%No such variable as '%s'" */ + case 'c': /* -c for changeable file */ + case 'C': + viewflag = FALSE; + break; + case 'e': /* -e process error file */ + case 'E': + errflag = TRUE; + break; + case 'g': /* -g for initial goto line */ + case 'G': + gotoflag = TRUE; + gline = asc_int(&argv[carg][2]); + break; +#if LIBHELP + case 'h': /* Alternate help */ + if (! argv[carg][2]) { + if (++carg == argc) { + continue; + } + initlook(argv[carg]); + } else + initlook(&argv[carg][2]); + break; +#endif + case 'i': /* -i set an initial */ + case 'I': /* value for a variable */ + bytecopy(bname, &argv[carg][2], NVSIZE); + findvar(bname, &vd, NVSIZE + 1, VT_GLOBAL); + if (vd.v_type == -1) { + mlwrite(TEXT52, bname); + /* "%%No such variable as '%s'" */ + break; + } + svar(&vd, argv[++carg]); break; - } - svar(&vd, argv[++carg]); - break; #if CRYPT - case 'k': /* -k for code key */ - case 'K': - cryptflag = TRUE; - strcpy(ekey, &argv[carg][2]); - break; -#endif - case 'p': /* -p for initial goto char position */ - case 'P': - gotoflag = TRUE; - gchar = asc_int(&argv[carg][2]); - break; - case 'r': /* -r restrictive use */ - case 'R': - restflag = TRUE; - break; - case 's': /* -s for initial search string */ - case 'S': - searchflag = TRUE; - bytecopy((char *) pat, &argv[carg][2], NPAT); - setjtable(); - break; - case 'v': /* -v for View File */ - case 'V': - viewflag = TRUE; - break; - default: /* unknown switch */ + case 'k': /* -k for code key */ + case 'K': + cryptflag = TRUE; + strcpy(ekey, &argv[carg][2]); + break; +#endif +#if BACKUP + case 'n': /* -n for No Backup File */ + nobackflag = TRUE; + break; +#endif + case 'p': /* -p for initial goto char position */ + case 'P': + gotoflag = TRUE; + gchar = asc_int(&argv[carg][2]); + break; + case 'r': /* -r restrictive use */ + case 'R': + restflag = TRUE; + break; + case 's': /* -s for initial search string */ + case 'S': + searchflag = TRUE; + bytecopy((char *) pat, &argv[carg][2], NPAT); + setjtable(); + break; + case 'v': /* -v for View File */ + case 'V': + viewflag = TRUE; + break; + default: /* unknown switch */ /* ignore this for now */ - break; + break; } } else if (argv[carg][0] == '+') { @@ -343,12 +403,15 @@ int firstflag; /* is this the first time in? */ #if WINDOW_MSWIN32 } else if ((argv[carg][0] != ' ') || - (argv[carg][1] != '\0')) { - /* WinNT PDK2 causes spurious space arguments */ + (argv[carg][1] != '\0')) { + /* WinNT PDK2 causes spurious space arguments */ #else } else { #endif /* Process an input file */ +#if (MSDOS|ST520|THEOS) + strlwr(argv[carg]); +#endif #if MSDOS | OS2 /* change forward slashes to back */ scan = (unsigned char *) argv[carg]; @@ -384,6 +447,10 @@ int firstflag; /* is this the first time in? */ ecrypt(ekey, strlen(ekey)); bytecopy(bp->b_key, ekey, NPAT); } +#endif +#if BACKUP + if (nobackflag) + bp->b_mode |= MDNOBAK; #endif } } @@ -421,13 +488,13 @@ int firstflag; /* is this the first time in? */ if (gotoflag && searchflag) { update(FALSE); mlwrite(TEXT101); -/* "[Can not search and goto at the same time!]" */ + /* "[Can not search and goto at the same time!]" */ } else if (gotoflag) { if ((gotoline(TRUE, gline) == FALSE) || - (forwchar(TRUE, gchar - 1) == FALSE)) { + (forwchar(TRUE, gchar - 1) == FALSE)) { update(FALSE); mlwrite(TEXT102); -/* "[Bogus goto argument]" */ + /* "[Bogus goto argument]" */ } } else if (searchflag) { if (forwhunt(FALSE, 0) == FALSE) @@ -437,19 +504,19 @@ int firstflag; /* is this the first time in? */ #if WINDOW_MSWIN #define GETBASEKEY getbasekey -static int PASCAL NEAR getbasekey() +static int getbasekey() { - register int c; + register int c; - notquiescent = -1; /* will be <= 0 only if get_key() is called + notquiescent = -1; /* will be <= 0 only if get_key() is called directly from editloop(). This is used to restrict some windows-specific actions (menus, sizing, etc...) when not called from the lowest level of the editor */ - c = get_key(); - notquiescent = 1; - return c; + c = get_key(); + notquiescent = 1; + return c; } #else #define GETBASEKEY get_key @@ -459,9 +526,9 @@ static int PASCAL NEAR getbasekey() This is called to let the user edit something. Note that if you arrange to be able to call this from a macro, you will have invented the "recursive-edit" function. -*/ + */ -PASCAL NEAR editloop() +int editloop() { register int c; /* command character */ @@ -475,14 +542,14 @@ PASCAL NEAR editloop() /* setup to process commands */ lastflag = 0; /* Fake last flags. */ -loop: + loop: /* if a macro error is pending, wait for a character */ if (exec_error) { #if WINDOW_MSWIN mlhistory(); #else mlforce(TEXT227); -/* "\n--- Press any key to Continue ---" */ + /* "\n--- Press any key to Continue ---" */ tgetc(); #endif sgarbf = TRUE; @@ -541,7 +608,6 @@ PASCAL NEAR editloop() discmd = TRUE; disinp = TRUE; c = GETBASEKEY(); - /* if there is something on the command line, clear it */ if (mpresf != FALSE) { mlerase(); @@ -550,8 +616,8 @@ PASCAL NEAR editloop() /* override the arguments if prefixed */ if (prefix) { - if (is_lower(c & 255)) - c = (c & ~255) | upperc(c & 255); + if (is_lower(c & CMSK)) + c = (c & ~CMSK) | upperc(c & CMSK); c |= prefix; f = predef; n = prenum; @@ -565,7 +631,7 @@ PASCAL NEAR editloop() basec = c & ~META; /* strip meta char off if there */ if ((c & META) && ((basec >= '0' && basec <= '9') || basec == '-') && - (getbind(c) == NULL)) { + (getbind(c) == NULL)) { f = TRUE; /* there is a # arg */ n = 0; /* start with a zero default */ mflag = 1; /* current minus flag */ @@ -596,8 +662,8 @@ PASCAL NEAR editloop() n = 4; /* with argument of 4 */ mflag = 0; /* that can be discarded. */ mlwrite("Arg: 4"); - while ((c = GETBASEKEY()) >= '0' && c <= '9' || - c == reptc || c == '-') { + while (((c = GETBASEKEY()) >= '0' && c <= '9') || + c == reptc || c == '-') { if (c == reptc) if ((n > 0) == ((n * 4) > 0)) n = n * 4; @@ -638,8 +704,16 @@ PASCAL NEAR editloop() n = -n; } } - +#if MDSLINE + if (! (c & ~CMSK) && (curbp->b_mode & (MDSLINE|MDDLINE)) && (c =='+' || iswdigit(c))) + c = tosgraph(c); +#endif /* and execute the command */ +#if CURSES + if (wdrop != NULL && ! (c & MOUS)) + menukey(c); + else +#endif execute(c, f, n); goto loop; } @@ -650,7 +724,7 @@ PASCAL NEAR editloop() * to read in a file by default, and we want the buffer name to be right. */ -VOID PASCAL NEAR edinit(bname) +int edinit(bname) char bname[]; /* name of buffer to initialize */ @@ -659,7 +733,7 @@ char bname[]; /* name of buffer to initialize */ register int index; /* the quote characters are LANGUAGE SPECIFIC - so they need to be inited here instrad of in the header file */ + so they need to be set here instead of in the header file */ oquote = OQUOTE_CHAR; cquote = CQUOTE_CHAR; @@ -694,18 +768,28 @@ char bname[]; /* name of buffer to initialize */ blistp = bfind("[Buffers]", TRUE, BFINVS); /* Buffer list buffer */ slistp = bfind("[Screens]", TRUE, BFINVS); /* screen list buffer */ ulistp = bfind("[Undos]", TRUE, BFINVS); /* undo list buffer */ - if (bp == NULL || blistp == NULL) +#if LIBHELP + helpbp = bfind(TEXT294, TRUE, BFINVS|BFHELP); /* Help buffer */ + bfind(TEXT295, TRUE, BFINVS); /* Error buffer */ + bfind(TEXT296, TRUE, BFINVS); /* Fkeys buffer */ +#endif + if (bp == NULL || blistp == NULL +#if LIBHELP + || helpbp == NULL +#endif + ) meexit(1); /* and allocate the default screen */ - first_screen = (SCREEN *) NULL; + first_screen = (ESCREEN *) NULL; init_screen("MAIN", bp); - if (first_screen == (SCREEN *) NULL) - meexit(1); + if (first_screen == (ESCREEN *) NULL) + return(meexit(1)); /* set the current default screen/buffer/window */ curbp = bp; curwp = wheadp = first_screen->s_cur_window = first_screen->s_first_window; + return(TRUE); } /* @@ -715,7 +799,7 @@ char bname[]; /* name of buffer to initialize */ * look at it. Return the status of command. */ -PASCAL NEAR execute(c, f, n) +int execute(c, f, n) int c; /* key to execute */ int f; /* prefix argument flag */ @@ -746,7 +830,7 @@ int n; /* prefix value */ /* Don't reset the function type flags on a prefix */ if ((key->k_type == BINDFNC) && - ((key->k_ptr.fp == meta) || (key->k_ptr.fp == cex))) + ((key->k_ptr.fp == uemeta) || (key->k_ptr.fp == cex))) status = execkey(key, f, n); else { thisflag = 0; @@ -770,12 +854,15 @@ int n; /* prefix value */ * negative, wrap mode is enabled, and we are now past fill column, * and we are not read-only, perform word wrap. */ - if (c == ' ' && (curwp->w_bufp->b_mode & MDWRAP) && fillcol > 0 && - n >= 0 && getccol(FALSE) > fillcol && - (curwp->w_bufp->b_mode & MDVIEW) == FALSE) + if (c == ' ' + && (curwp->w_bufp->b_mode & MDWRAP) + && fillcol > 0 + && n >= 0 + && getccol(FALSE) > fillcol + && (curwp->w_bufp->b_mode & MDVIEW) == FALSE) execkey(&wraphook, FALSE, 1); - if ((c >= 0x20 && c <= 0xFF)) { /* Self inserting. */ + if ((c >= 0x20 && c <= CMSK)) { /* Self inserting. */ if (n <= 0) { /* Fenceposts. */ lastflag = 0; return(n < 0 ? FALSE : TRUE); @@ -790,20 +877,24 @@ int n; /* prefix value */ #endif /* replace or overwrite mode, not at the end of a string */ - if (curwp->w_bufp->b_mode & (MDREPL | MDOVER) && - curwp->w_doto < lused(curwp->w_dotp)) { + if ((curwp->w_bufp->b_mode & (MDREPL | MDOVER)) && + curwp->w_doto < lused(curwp->w_dotp)) { do { /* if we are in replace mode, or (next char is not a tab or we are at a tab stop) */ - if (curwp->w_bufp->b_mode & MDREPL || - ((lgetc(curwp->w_dotp, curwp->w_doto) != '\t' || tabsize == 0) || - getccol(FALSE) % tabsize == (tabsize - 1))) { + if ((curwp->w_bufp->b_mode & MDREPL) + || ((lgetc(curwp->w_dotp, curwp->w_doto) != '\t' + || tabsize == 0) + || getccol(FALSE) % tabsize == (tabsize - 1))) { /* make sure the cursor gets back to the right place on an undo */ undo_insert(OP_CPOS, 0L, obj); - +#if UTF8 + ldelchar(1L, FALSE); +#else ldelete(1L, FALSE); +#endif } /* do the appropriate insertion */ @@ -838,7 +929,7 @@ int n; /* prefix value */ status = FALSE; } } -#endif +#endif else status = linsert(n, c); } @@ -846,12 +937,12 @@ int n; /* prefix value */ /* In ABBREV mode, if we are doing aggressive expansion and the current buffer is a symbol in the abbreviation table */ if (((curbp->b_mode & MDABBR) != 0) && - (ab_quick && (ab_lookup(ab_word) != NULL))) + (ab_quick && (ab_lookup(ab_word) != NULL))) ab_expand(); /* check for CMODE fence matching */ if ((c == '}' || c == ')' || c == ']') && - (curbp->b_mode & MDCMOD) != 0) + (curbp->b_mode & MDCMOD) != 0) fmatch(c); /* check auto-save mode */ @@ -870,7 +961,7 @@ int n; /* prefix value */ } TTbeep(); mlwrite(TEXT19); /* complain */ -/* "[Key not bound]" */ + /* "[Key not bound]" */ lastflag = 0; /* Fake last flags. */ return(FALSE); } @@ -879,9 +970,9 @@ int n; /* prefix value */ Fancy quit command, as implemented by Norm. If the any buffer has changed do a write on that buffer and exit emacs, otherwise simply exit. -*/ + */ -PASCAL NEAR quickexit(f, n) +int quickexit(f, n) int f, n; /* prefix flag and argument */ @@ -899,10 +990,10 @@ int f, n; /* prefix flag and argument */ while (bp != NULL) { if ((bp->b_flag & BFCHG) != 0 /* Changed. */ - && (bp->b_flag & BFINVS) == 0) { /* Real. */ + && (bp->b_flag & BFINVS) == 0) { /* Real. */ curbp = bp; /* make that buffer cur */ mlwrite(TEXT103, bp->b_fname); -/* "[Saving %s]" */ + /* "[Saving %s]" */ mlwrite("\n"); if ((status = filesave(f, n)) != TRUE) { curbp = oldcb; /* restore curbp */ @@ -920,20 +1011,20 @@ int f, n; /* prefix flag and argument */ * has been changed and not written out. Normally bound to "C-X C-C". */ -PASCAL NEAR quit(f, n) +int quit(f, n) int f, n; /* prefix flag and argument */ { register int status; /* return status */ if (f != FALSE /* Argument forces it. */ - || anycb() == FALSE /* All buffers clean or user says it's OK. */ - || (status = mlyesno(TEXT104)) == TRUE) { -/* "Modified buffers exist. Leave anyway" */ + || anycb() == FALSE /* All buffers clean or user says it's OK. */ + || (status = mlyesno(TEXT104)) == TRUE) { + /* "Modified buffers exist. Leave anyway" */ #if FILOCK if (lockrel() != TRUE) { TTputc('\n'); - TTputc('\r'); + TTputc(RET_CHAR); TTclose(); TTkclose(); status = meexit(1); @@ -943,14 +1034,14 @@ int f, n; /* prefix flag and argument */ status = meexit(n); else status = meexit(GOOD); - } + } mlerase(); return(status); - } +} -PASCAL NEAR meexit(status) +int meexit(status) int status; /* return status of emacs */ - { +{ eexitflag = TRUE; /* flag a program exit */ gflags |= GFEXIT; eexitval = status; @@ -965,18 +1056,18 @@ int status; /* return status of emacs */ * return. */ -PASCAL NEAR ctlxlp(f, n) +int ctlxlp(f, n) int f, n; /* prefix flag and argument */ { if (kbdmode != STOP) { mlwrite(TEXT105); -/* "%%Macro already active" */ + /* "%%Macro already active" */ return(FALSE); } mlwrite(TEXT106); -/* "[Start macro]" */ + /* "[Start macro]" */ kbdptr = &kbdm[0]; kbdend = kbdptr; kbdmode = RECORD; @@ -988,19 +1079,19 @@ int f, n; /* prefix flag and argument */ * routine. Set up the variables and return to the caller. */ -PASCAL NEAR ctlxrp(f, n) +int ctlxrp(f, n) int f, n; /* prefix flag and argument */ { if (kbdmode == STOP) { mlwrite(TEXT107); -/* "%%Macro not active" */ + /* "%%Macro not active" */ return(FALSE); - } + } if (kbdmode == RECORD) { mlwrite(TEXT108); -/* "[End macro]" */ + /* "[End macro]" */ kbdmode = STOP; } return(TRUE); @@ -1012,14 +1103,14 @@ int f, n; /* prefix flag and argument */ * command gets an error. Return TRUE if all ok, else FALSE. */ -PASCAL NEAR ctlxe(f, n) +int ctlxe(f, n) int f, n; /* prefix flag and argument */ { if (kbdmode != STOP) { mlwrite(TEXT105); -/* "%%Macro already active" */ + /* "%%Macro already active" */ return(FALSE); } if (n <= 0) @@ -1036,7 +1127,7 @@ int f, n; /* prefix flag and argument */ * Sometimes called as a routine, to do general aborting of stuff. */ -PASCAL NEAR ctrlg(f, n) +int ctrlg(f, n) int f, n; /* prefix flag and argument */ @@ -1044,32 +1135,32 @@ int f, n; /* prefix flag and argument */ TTbeep(); kbdmode = STOP; mlwrite(TEXT8); -/* "[Aborted]" */ + /* "[Aborted]" */ return(ABORT); } /* tell the user that this command is illegal while we are in VIEW (read-only) mode */ -PASCAL NEAR rdonly() +int rdonly() { TTbeep(); mlwrite(TEXT109); -/* "[Key illegal in VIEW mode]" */ + /* "[Key illegal in VIEW mode]" */ return(FALSE); } -PASCAL NEAR resterr() +int resterr() { TTbeep(); mlwrite(TEXT110); -/* "[That command is RESTRICTED]" */ + /* "[That command is RESTRICTED]" */ return(FALSE); } -int PASCAL NEAR nullproc(f, n) /* user function that does NOTHING */ +int nullproc(f, n) /* user function that does NOTHING */ int n, f; /* yes, these are default and never used.. but MUST be here */ @@ -1077,7 +1168,7 @@ int n, f; /* yes, these are default and never used.. but MUST be here */ return(TRUE); } -PASCAL NEAR meta(f, n) /* set META prefixing pending */ +int uemeta(f, n) /* set META prefixing pending */ int f, n; /* prefix flag and argument */ @@ -1088,7 +1179,7 @@ int f, n; /* prefix flag and argument */ return(TRUE); } -PASCAL NEAR cex(f, n) /* set ^X prefixing pending */ +int cex(f, n) /* set ^X prefixing pending */ int f, n; /* prefix flag and argument */ @@ -1099,19 +1190,32 @@ int f, n; /* prefix flag and argument */ return(TRUE); } -int PASCAL NEAR unarg() /* dummy function for binding to universal-argument */ +int unarg() /* dummy function for binding to universal-argument */ { return(TRUE); } +#if JMDEXT +int notavail() +{ + mlwrite(TEXT284); + return (FALSE); +} +#else +int notavail() +{ + mlwrite("Not available"); + return (FALSE); +} +#endif /* bytecopy: copy a string...with length restrictions ALWAYS null terminate -*/ + */ -char *PASCAL NEAR bytecopy(dst, src, maxlen) +char *bytecopy(dst, src, maxlen) char *dst; /* destination of copied string */ -char *src; /* source */ +CONST char *src; /* source */ int maxlen; /* maximum length */ { @@ -1126,9 +1230,9 @@ int maxlen; /* maximum length */ /* copystr: make another copy of the argument -*/ + */ -char *PASCAL NEAR copystr(sp) +char *copystr(sp) char *sp; /* string to copy */ @@ -1153,7 +1257,7 @@ char *sp; /* string to copy */ with RAMSHOW defined, the number is also posted on the end of the bottom mode line and is updated whenever it is changed. -*/ + */ #undef malloc #undef free diff --git a/src/mouse.c b/src/mouse.c index 770841c..bc47ced 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -2,6 +2,7 @@ for MicroEMACS 4.00 originally written by Dave G. Conroy modified by Jeff Lomicka and Daniel Lawrence + Unicode support by Jean-Michel Dubois */ #include @@ -29,7 +30,7 @@ NOSHARE int lastmcmd = MNONE; /* Last mouse command. */ * of the text). If the mouse points at text then dot is * moved to that location. */ -PASCAL NEAR movemd(f, n) +int movemd(f, n) int f,n; /* prefix flag and argument */ @@ -37,46 +38,62 @@ int f,n; /* prefix flag and argument */ register EWINDOW *wp; register EWINDOW *lastwp; register LINE *lp; +#if CURSES + WINDOW* wmouse = NULL; + + if (wdrop != NULL && wenclose(wdrop, ypos, xpos)) + wmouse_trafo(wmouse = wdrop, &ypos, &xpos, 0); + else if (wenclose(wmain, ypos, xpos)) + wmouse_trafo(wmouse = wmain, &ypos, &xpos, 0); + else if (wenclose(wmenubar, ypos, xpos)) + wmouse_trafo(wmouse = wmenubar, &ypos, &xpos, 0); + + if (wmouse == wmain) { + handlemenu(wmouse, ypos, xpos); +#endif + /* make sure we are on the proper screen */ + mouse_screen(); + + /* adjust position by screen offset */ + ypos -= term.t_roworg; + xpos -= term.t_colorg; + + /* if anything has changed, reset the click count */ + if (lastmcmd != MMOVE || lastypos!=ypos || lastxpos!=xpos) + nclicks = 0; + ++nclicks; + lastwp = mousewindow(lastypos); /* remember last window */ + + /* reset the last position */ + lastypos = ypos; + lastxpos = xpos; + lastmcmd = MMOVE; + + /* if we move the mouse off the windows, don't do anything with it */ + if ((wp=mousewindow(ypos)) == NULL) + return(FALSE); - /* make sure we are on the proper screen */ - mouse_screen(); - - /* adjust position by screen offset */ - ypos -= term.t_roworg; - xpos -= term.t_colorg; - - /* if anything has changed, reset the click count */ - if (lastmcmd != MMOVE || lastypos!=ypos || lastxpos!=xpos) - nclicks = 0; - ++nclicks; - lastwp = mousewindow(lastypos); /* remember last window */ - - /* reset the last position */ - lastypos = ypos; - lastxpos = xpos; - lastmcmd = MMOVE; - - /* if we move the mouse off the windows, don't do anything with it */ - if ((wp=mousewindow(ypos)) == NULL) - return(FALSE); - - /* if we are on the line with the point, adjust for extended lines */ - if (wp == curwp && (lp = mouseline(wp, ypos)) == curwp->w_dotp) - xpos += lbound; + /* if we are on the line with the point, adjust for extended lines */ + if (wp == curwp && (lp = mouseline(wp, ypos)) == curwp->w_dotp) + xpos += lbound; - /* make the window the mouse points to current */ - curwp = wp; - curbp = wp->w_bufp; + /* make the window the mouse points to current */ + curwp = wp; + curbp = wp->w_bufp; - /* if we changed windows, update the modelines */ - if (wp != lastwp) - upmode(); + /* if we changed windows, update the modelines */ + if (wp != lastwp) + upmode(); - /* if we aren't off the end of the text, move the point to the mouse */ - if ((lp=mouseline(wp, ypos)) != NULL) { - curwp->w_dotp = lp; - curwp->w_doto = mouseoffset(wp, lp, xpos); - } + /* if we aren't off the end of the text, move the point to the mouse */ + if ((lp=mouseline(wp, ypos)) != NULL) { + curwp->w_dotp = lp; + curwp->w_doto = mouseoffset(wp, lp, xpos); + } +#if CURSES + } else if (wmouse) + return handlemenu(wmouse, ypos, xpos); +#endif return(TRUE); } @@ -86,7 +103,7 @@ int f,n; /* prefix flag and argument */ only if we are holding down the proper button */ -PASCAL NEAR mmove(f, n) +int mmove(f, n) int f,n; /* prefix flag and argument */ @@ -94,8 +111,8 @@ int f,n; /* prefix flag and argument */ register EWINDOW *wp; register EWINDOW *lastwp; register LINE *lp; - register int lastmodeline; /* was the dowbclick on a modeline? */ - register int lastcmdline; /* was the downclick on the command line? */ + register int lastmodeline; /* was the down click on a modeline? */ + register int lastcmdline; /* was the down click on the command line? */ /* ignore this if not hilighting */ if (hilite >= NMARKS) @@ -132,7 +149,7 @@ int f,n; /* prefix flag and argument */ wp->w_marko[hilite+1] = mouseoffset(wp, lp, xpos); } - return(TRUE); + return(TRUE); } /* mouse-region-down: mouse region operations @@ -146,7 +163,7 @@ int f,n; /* prefix flag and argument */ kill-region */ -PASCAL NEAR mregdown(f, n) +int mregdown(f, n) int f,n; /* prefix flag and argument */ @@ -154,7 +171,7 @@ int f,n; /* prefix flag and argument */ register EWINDOW *wp; register EWINDOW *lastwp; register LINE *lp; - SCREEN *sp; + ESCREEN *sp; char scr_name[12]; /* constructed temp screen name */ static int temp_count = 0; /* next temp screen number! */ @@ -184,11 +201,11 @@ int f,n; /* prefix flag and argument */ /* get the name of the screen to create */ strcpy(scr_name, "SCREEN"); strcat(scr_name, int_asc(temp_count++)); - while (lookup_screen(scr_name) != (SCREEN *)NULL) { + while (lookup_screen(scr_name) != (ESCREEN *)NULL) { strcpy(scr_name, "SCREEN"); strcat(scr_name, int_asc(temp_count++)); } - + /* save the current dot position in the buffer info so the new screen will start there! */ curbp->b_dotp = curwp->w_dotp; @@ -196,7 +213,7 @@ int f,n; /* prefix flag and argument */ /* screen does not exist, create it */ sp = init_screen(scr_name, curbp); - + /* and make this screen current */ return(select_screen(sp, TRUE)); } @@ -241,7 +258,7 @@ int f,n; /* prefix flag and argument */ /* mouse-region-up: mouse region operations - If the corrosponding downclick was on a modeline, then we + If the corresponding downclick was on a modeline, then we wish to delete the indicated window. Otherwise we are using this button to copy/paste. @@ -254,7 +271,7 @@ int f,n; /* prefix flag and argument */ 3: reset nclicks to 0 */ -PASCAL NEAR mregup(f, n) +int mregup(f, n) int f,n; /* prefix flag and argument */ @@ -262,7 +279,7 @@ int f,n; /* prefix flag and argument */ register EWINDOW *wp; register EWINDOW *lastwp; register LINE *lp; - register SCREEN *sp; /* ptr to screen to delete */ + register ESCREEN *sp; /* ptr to screen to delete */ register int lastmodeline; /* was the dowbclick on a modeline? */ register int lastcmdline; /* was the downclick on the command line? */ @@ -312,7 +329,7 @@ int f,n; /* prefix flag and argument */ else { /* delete the screen last screen means exiting */ - if (first_screen->s_next_screen == (SCREEN *)NULL) + if (first_screen->s_next_screen == (ESCREEN *)NULL) return(quit(FALSE, 0)); /* bring the second last screen to front*/ @@ -372,7 +389,7 @@ int f,n; /* prefix flag and argument */ * window scrolls. The code in this function is just * too complex! */ -PASCAL NEAR movemu(f, n) +int movemu(f, n) int f,n; /* prefix flag and argument */ @@ -501,13 +518,13 @@ int f,n; /* prefix flag and argument */ } /* - * Return a pointer to the WINDOW structure + * Return a pointer to the EWINDOW structure * for the window in which "row" is located, or NULL * if "row" isn't in any window. The mode line is * considered to be part of the window. */ -EWINDOW *PASCAL NEAR mousewindow(row) +EWINDOW *mousewindow(row) register int row; @@ -535,14 +552,14 @@ register int row; /* * The row "row" is a row within the window - * whose WINDOW structure is pointed to by the "wp" + * whose EWINDOW structure is pointed to by the "wp" * argument. Find the associated line, and return a pointer * to it. Return NULL if the mouse is on the mode line, * or if the mouse is pointed off the end of the * text in the buffer. */ -LINE *PASCAL NEAR mouseline(wp, row) +LINE *mouseline(wp, row) register EWINDOW *wp; register int row; @@ -568,7 +585,7 @@ register int row; * LINE structure is pointed to by "lp". */ -PASCAL NEAR mouseoffset(wp, lp, col) +int mouseoffset(wp, lp, col) register EWINDOW *wp; register LINE *lp; @@ -585,16 +602,22 @@ register int col; col += wp->w_fcol; /* adjust for extended lines */ while (offset != lused(lp)) { newcol = curcol; - if ((c=lgetc(lp, offset)) == '\t' && tabsize > 0) + c = lgetc(lp, offset); +#if UTF8 + if (is_multibyte_utf8(c)) { + unsigned int wc; + + offset += utf8_to_unicode(ltext(lp), offset, lused(lp) - offset, &wc) - 1; + } else +#endif + if (c == '\t' && tabsize > 0) newcol += -(newcol % tabsize) + (tabsize - 1); - else { - if (disphigh && c > 0x7f) { - newcol += 2; - c -= 0x80; - } - if (c < 0x20 || c == 0x7f) /* ISCTRL */ - ++newcol; - } + else if (disphigh && c > 0x7f) { + newcol += 2; + c -= 0x80; + } else if (c < 0x20 || c == 0x7f) /* ISCTRL */ + ++newcol; + ++newcol; if (newcol > col) break; @@ -604,10 +627,10 @@ register int col; return(offset); } -PASCAL NEAR mouse_screen() +VOID mouse_screen() { - register SCREEN *screen_ptr; /* screen to test mouse in */ + register ESCREEN *screen_ptr; /* screen to test mouse in */ /* if we move the mouse off the windows, check for other windows */ if ((ypos < term.t_roworg) || (xpos < term.t_colorg) || @@ -616,7 +639,7 @@ PASCAL NEAR mouse_screen() /* scan through the other windows */ screen_ptr = first_screen->s_next_screen; - while (screen_ptr != (SCREEN *)NULL) { + while (screen_ptr != (ESCREEN *)NULL) { /* is the mouse in this window? */ if ((ypos >= screen_ptr->s_roworg) && @@ -637,7 +660,7 @@ PASCAL NEAR mouse_screen() } } -PASCAL NEAR ismodeline(wp, row) +int ismodeline(wp, row) EWINDOW *wp; int row; @@ -659,7 +682,7 @@ int row; let emacs know about the newsize, and have him force a re-draw */ -PASCAL NEAR resizm(f, n) +int resizm(f, n) int f, n; /* these are ignored... we get the new size info from the mouse driver */ @@ -694,7 +717,7 @@ int f, n; /* these are ignored... we get the new size info from return(TRUE); } -PASCAL NEAR resizm2(f, n) +int resizm2(f, n) int f, n; /* these are ignored... we get the new size info from the mouse driver */ @@ -713,7 +736,7 @@ int f, n; /* these are ignored... we get the new size info from } #else -mousehello() +VOID mousehello() { } #endif diff --git a/src/random.c b/src/random.c index 676e8f8..cb5f4b8 100644 --- a/src/random.c +++ b/src/random.c @@ -1,6 +1,8 @@ /* * This file contains the command processing functions for a number of random * commands. There is no functional grouping here, for sure. + * + * Unicode support by Jean-Michel Dubois */ #include @@ -8,6 +10,10 @@ #include "eproto.h" #include "edef.h" #include "elang.h" +#if THEOSC +# include +# include +#endif /* * Display the current position of the cursor, in origin 1 X-Y coordinates, @@ -17,7 +23,7 @@ * Normally this is bound to "C-X =". */ -PASCAL NEAR showcpos(f, n) +int showcpos(f, n) int f, n; /* prefix flag and argument */ @@ -25,9 +31,13 @@ int f, n; /* prefix flag and argument */ register LINE *lp; /* current line */ register long numchars; /* # of chars in file */ register long numlines; /* # of lines in file */ - register long predchars; /* # chars preceding point */ - register long predlines; /* # lines preceding point */ + register long predchars = 0; /* # chars preceding point */ + register long predlines = 0; /* # lines preceding point */ +#if UTF8 + unsigned int curchar; /* character under cursor */ +#else register int curchar; /* character under cursor */ +#endif int ratio; int col; int savepos; /* temp save for current offset */ @@ -35,7 +45,7 @@ int f, n; /* prefix flag and argument */ /* starting at the beginning of the buffer */ lp = lforw(curbp->b_linep); - curchar = '\r'; + curchar = RET_CHAR; /* start counting chars and lines */ numchars = 0; @@ -47,9 +57,13 @@ int f, n; /* prefix flag and argument */ predlines = numlines; predchars = numchars + curwp->w_doto; if ((curwp->w_doto) == lused(lp)) - curchar = '\r'; + curchar = RET_CHAR; else - curchar = lgetc(lp, curwp->w_doto); +#if UTF8 + utf8_to_unicode(lp->l_text, curwp->w_doto, lused(lp), &curchar); +#else + curchar = lgetc(lp, curwp->w_doto); +#endif } /* on to the next line */ @@ -78,74 +92,100 @@ int f, n; /* prefix flag and argument */ /* summarize and report the info */ #if DBCS if (is2byte(ltext(curwp->w_dotp), - ltext(curwp->w_dotp) + curwp->w_doto)) { + ltext(curwp->w_dotp) + curwp->w_doto)) { mlwrite(TEXT220, -/* "Line %D/%D Col %d/%d Char %D/%D (%d%%) char = 0x%x%x" */ - predlines+1, numlines+1, col, ecol, - predchars, numchars, ratio, (unsigned char)curchar, - (unsigned char)(lgetc(curwp->w_dotp, curwp->w_doto+1))); + /* "Line %D/%D Col %d/%d Char %D/%D (%d%%) char = 0x%x%x" */ + predlines+1, numlines+1, col, ecol, + predchars, numchars, ratio, (unsigned char)curchar, + (unsigned char)(lgetc(curwp->w_dotp, curwp->w_doto+1))); return(TRUE); } #endif +#if UTF8 +#if THEOX mlwrite(TEXT60, -/* "Line %D/%D Col %d/%d Char %D/%D (%d%%) char = 0x%x" */ +/* "Line %D/%D Col %d/%d Char %D/%D (%d%%) Unicode char = 0x%x %d, TheoX char = 0x%x %d" */ predlines + 1, numlines + 1, col, ecol, - predchars, numchars, ratio, curchar); + predchars, numchars, ratio, + (curbp->b_mode & MDTHEOX) ? _b_theox2wchar(curchar) : curchar, + (curbp->b_mode & MDTHEOX) ? _b_theox2wchar(curchar) : curchar, + (curbp->b_mode & MDTHEOX) ? curchar : _b_wchar2theox(curchar), + (curbp->b_mode & MDTHEOX) ? curchar : _b_wchar2theox(curchar)); +#else + mlwrite(TEXT60, +/* "Line %D/%D Col %d/%d Char %D/%D (%d%%) Unicode char = 0x%x %d, TheoX char = 0x%x %d" */ + predlines + 1, numlines + 1, col, ecol, + predchars, numchars, ratio, (unsigned int) curchar, (unsigned int) curchar, + _b_wchar2theox(curchar), _b_wchar2theox(curchar)); +#endif +#else + mlwrite(TEXT60, + /* "Line %D/%D Col %d/%d Char %D/%D (%d%%) char = 0x%x %d" */ + predlines + 1, numlines + 1, col, ecol, + predchars, numchars, ratio, curchar, curchar); +#endif return(TRUE); } -long PASCAL NEAR getlinenum(bp, sline) /* get the a line number */ +long getlinenum(bp, sline) /* get the a line number */ -BUFFER *bp; /* buffer to get current line from */ +BUFFER *bp; /* buffer to get current line from */ LINE *sline; /* line to search for */ - { - register LINE *lp; /* current line */ - register long numlines; /* # of lines before point */ +{ + register LINE *lp; /* current line */ + register long numlines; /* # of lines before point */ /* starting at the beginning of the buffer */ lp = lforw(bp->b_linep); /* start counting lines */ numlines = 0L; - while (lp != bp->b_linep) - { + while (lp != bp->b_linep) { /* if we are on the current line, record it */ if (lp == sline) break; ++numlines; lp = lforw(lp); - } + } /* and return the resulting count */ - return(numlines + 1L); - } + return (numlines + 1L); +} /* * Return current column. Stop at first non-blank given TRUE argument. */ -PASCAL NEAR getccol(bflg) +int getccol(bflg) int bflg; { register int i, col; +#if UTF8 + unsigned int c; + int len = lused(curwp->w_dotp); +#else register unsigned char c; - +#endif col = 0; - for (i = 0; i < curwp->w_doto; ++i) { - c = lgetc(curwp->w_dotp, i) & 0xFF; + for (i = 0; i < curwp->w_doto; ) { +#if UTF8 + i += utf8_to_unicode(curwp->w_dotp->l_text, i, len, &c); +#else + c = lgetc(curwp->w_dotp, i++) & 0xFF; +#endif if (c != ' ' && c != '\t' && bflg) break; if (c == '\t' && tabsize > 0) col += -(col % tabsize) + (tabsize - 1); - else { - if (disphigh && c > 0x7f) { - col += 2; - c -= 0x80; - } - if (c < 0x20 || c == 0x7f) - ++col; - } + else { + if (disphigh && c > 0x7f) { + col += 2; + c -= 0x80; + } + if (c < 0x20 || c == 0x7f) + ++col; + } ++col; } return(col); @@ -153,26 +193,40 @@ int bflg; /* findcol: Return display column in line at char position */ -int PASCAL NEAR findcol(lp, pos) +int findcol(lp, pos) LINE * lp; /* line to scan */ int pos; /* character offset */ { +#if UTF8 + register int i, col; + unsigned int c; +#else register int c, i, col; - +#endif col = 0; - for (i = 0; i < pos; ++i) { + for (i = 0; i < pos; ) { c = lgetc(lp, i); - if (c == '\t' && tabsize > 0) - col += -(col % tabsize) + (tabsize - 1); +#if UTF8 + if (is_multibyte_utf8(c)) + i += utf8_to_unicode(lp->l_text, i, lused(lp), &c) - 1; else { - if (disphigh && c > 0x7f) { - col += 2; - c -= 0x80; +#endif + ++i; + + if (c == '\t' && tabsize > 0) + col += -(col % tabsize) + (tabsize - 1); + else { + if (disphigh && c > 0x7f) { + col += 2; + c -= 0x80; + } + if (c < 0x20 || c == 0x7F) + ++col; } - if (c < 0x20 || c == 0x7F) - ++col; +#if UTF8 } +#endif ++col; } return(col); @@ -182,11 +236,15 @@ int pos; /* character offset */ * Set current column. */ -PASCAL NEAR setccol(pos) +int setccol(pos) int pos; /* position to set cursor */ { +#if UTF8 + unsigned int c; /* character being scanned */ +#else register int c; /* character being scanned */ +#endif register int i; /* index into current line */ register int col; /* current cursor column */ register int llen; /* length of line in bytes */ @@ -195,23 +253,33 @@ int pos; /* position to set cursor */ llen = lused(curwp->w_dotp); /* scan the line until we are at or past the target column */ - for (i = 0; i < llen; ++i) { + for (i = 0; i < llen; ) { /* upon reaching the target, drop out */ if (col >= pos) break; /* advance one character */ c = lgetc(curwp->w_dotp, i); - if (c == '\t' && tabsize > 0) - col += -(col % tabsize) + (tabsize - 1); +#if UTF8 + if (is_multibyte_utf8(c)) + i += utf8_to_unicode(ltext(curwp->w_dotp), i, llen, &c); else { - if (disphigh && c > 0x7f) { - col += 2; - c -= 0x80; +#endif + ++i; + + if (c == '\t' && tabsize > 0) + col += -(col % tabsize) + (tabsize - 1); + else { + if (disphigh && c > 0x7f) { + col += 2; + c -= 0x80; + } + if (c < 0x20 || c == 0x7F) + ++col; } - if (c < 0x20 || c == 0x7F) - ++col; +#if UTF8 } +#endif ++col; } @@ -232,7 +300,7 @@ int pos; /* position to set cursor */ * to keep this working as it always has. */ -PASCAL NEAR twiddle(f, n) +int twiddle(f, n) int f, n; /* prefix flag and argument */ @@ -287,7 +355,7 @@ int f, n; /* prefix flag and argument */ * function key is pressed, its symbolic MicroEMACS name gets inserted! */ -PASCAL NEAR quote(f, n) +int quote(f, n) int f, n; /* prefix flag and argument */ { @@ -309,16 +377,14 @@ int f, n; /* prefix flag and argument */ return(TRUE); /* if this is a mouse event or function key, put its name in */ - if ((ec & MOUS) || (ec & SPEC)) - { + if ((ec & MOUS) || (ec & SPEC)) { cmdstr(ec, key_name); - while (n--) - { + while (n--) { status = linstr(key_name); if (status != TRUE) - return(status); + return (status); } - return(TRUE); + return (TRUE); } /* otherwise, just insert the raw character */ @@ -334,26 +400,25 @@ int f, n; /* prefix flag and argument */ * into "C-I" (in 10 bit code) already. Bound to "C-I". */ -PASCAL NEAR tab(f, n) +int uetab(f, n) int f, n; /* prefix flag and argument */ - { +{ if (n < 0) - return(FALSE); - if (n == 0 || n > 1) - { + return (FALSE); + if (n == 0 || n > 1) { stabsize = n; - return(TRUE); - } - if (!stabsize) - return(linsert(1, '\t')); - return(linsert(stabsize - (getccol(FALSE) % stabsize), ' ')); + return (TRUE); } + if (!stabsize) + return (linsert(1, '\t')); + return (linsert(stabsize - (getccol(FALSE) % stabsize), ' ')); +} -PASCAL NEAR detab(f, n) /* change tabs to spaces */ +int detab(f, n) /* change tabs to spaces */ int f, n; /* default flag and numeric repeat count */ - { +{ register int inc; /* increment to next line [sgn(n)] */ if (curbp->b_mode & MDVIEW) /* don't allow this command if */ @@ -368,37 +433,41 @@ int f, n; /* default flag and numeric repeat count */ /* loop thru detabbing n lines */ inc = ((n > 0) ? 1 : -1); while (n) - { + { curwp->w_doto = 0; /* start at the beginning */ /* detab the entire current line */ while (curwp->w_doto < lused(curwp->w_dotp)) - { + { /* if we have a tab */ if (lgetc(curwp->w_dotp, curwp->w_doto) == '\t') - { + { +#if UTF8 + ldelchar(1L, FALSE); +#else ldelete(1L, FALSE); -/* insspace(TRUE, 8 - (curwp->w_doto & 7));*/ +#endif + /* insspace(TRUE, 8 - (curwp->w_doto & 7));*/ insspace(TRUE, tabsize - (curwp->w_doto % tabsize)); - } - forwchar(FALSE, 1); } + forwchar(FALSE, 1); + } /* advance/or back to the next line */ forwline(TRUE, inc); n -= inc; - } - curwp->w_doto = 0; /* to the begining of the line */ + } + curwp->w_doto = 0; /* to the beginning of the line */ thisflag &= ~CFCPCN; /* flag that this resets the goal column */ lchange(WFEDIT); /* yes, we have made at least an edit */ return(TRUE); - } +} -PASCAL NEAR entab(f, n) /* change spaces to tabs where posible */ +int entab(f, n) /* change spaces to tabs where posible */ int f, n; /* default flag and numeric repeat count */ - { +{ register int inc; /* increment to next line [sgn(n)] */ register int fspace; /* pointer to first space if in a run */ register int ccol; /* current cursor column */ @@ -416,16 +485,16 @@ int f, n; /* default flag and numeric repeat count */ /* loop thru entabbing n lines */ inc = ((n > 0) ? 1 : -1); while (n) - { + { /* entab the entire current line */ ccol = curwp->w_doto = 0; /* start at the beginning */ fspace = -1; while (curwp->w_doto < lused(curwp->w_dotp)) - { + { /* see if it is time to compress */ - if ((fspace >= 0) && (nextab(fspace) <= ccol)) + if ((fspace >= 0) && (nextab(fspace) <= ccol)) { if (ccol - fspace < 2) fspace = -1; else { @@ -433,49 +502,49 @@ int f, n; /* default flag and numeric repeat count */ ldelete((long) (ccol - fspace), FALSE); linsert(1, '\t'); fspace = -1; - } - + } + } /* get the current character */ cchar = lgetc(curwp->w_dotp, curwp->w_doto); switch (cchar) - { - case '\t': /* a tab...count em up (no break here) */ - ldelete(1L, FALSE); - insspace(TRUE, tabsize - (ccol % tabsize)); - - case ' ': /* a space...compress? */ - if (fspace == -1) - fspace = ccol; - break; + { + case '\t': /* a tab...count em up (no break here) */ + ldelete(1L, FALSE); + insspace(TRUE, tabsize - (ccol % tabsize)); + // no break + case ' ': /* a space...compress? */ + if (fspace == -1) + fspace = ccol; + break; - default: /* any other char...just count */ - fspace = -1; - break; - } + default: /* any other char...just count */ + fspace = -1; + break; + } ccol++; forwchar(FALSE, 1); - } + } /* advance/or back to the next line */ forwline(TRUE, inc); n -= inc; curwp->w_doto = 0; /* start at the beginning */ - } - curwp->w_doto = 0; /* to the begining of the line */ + } + curwp->w_doto = 0; /* to the beginning of the line */ thisflag &= ~CFCPCN; /* flag that this resets the goal column */ lchange(WFEDIT); /* yes, we have made at least an edit */ return(TRUE); - } +} /* trim: trim trailing whitespace from the point to eol with no arguments, it trims the current region -*/ + */ -PASCAL NEAR trim(f, n) +int trim(f, n) int f, n; /* default flag and numeric repeat count */ - { +{ register LINE *lp; /* current line pointer */ register int offset; /* original line offset position */ register int length; /* current length */ @@ -490,29 +559,29 @@ int f, n; /* default flag and numeric repeat count */ /* loop thru trimming n lines */ inc = ((n > 0) ? 1 : -1); while (n) - { + { lp = curwp->w_dotp; /* find current line text */ offset = curwp->w_doto; /* save original offset */ length = lused(lp); /* find current length */ /* trim the current line */ while (length > offset) - { + { if (lgetc(lp, length-1) != ' ' && - lgetc(lp, length-1) != '\t') + lgetc(lp, length-1) != '\t') break; length--; - } + } lp->l_used = length; /* advance/or back to the next line */ forwline(TRUE, inc); n -= inc; - } + } lchange(WFEDIT); thisflag &= ~CFCPCN; /* flag that this resets the goal column */ return(TRUE); - } +} /* * Open up some blank space. The basic plan is to insert a bunch of newlines, @@ -520,10 +589,10 @@ int f, n; /* default flag and numeric repeat count */ * procerssors. They even handle the looping. Normally this is bound to "C-O". */ -PASCAL NEAR openline(f, n) +int openline(f, n) int f, n; /* prefix flag and argument */ - { +{ register int i; register int s; @@ -536,22 +605,22 @@ int f, n; /* prefix flag and argument */ i = n; /* Insert newlines. */ do { s = lnewline(); - } + } while (s == TRUE && --i); if (s == TRUE) /* Then back up overtop */ s = backchar(f, n); /* of them all. */ return(s); - } +} /* * Insert a newline. Bound to "C-M". If we are in CMODE, do automatic * indentation as specified. */ -PASCAL NEAR newline(f, n) +int new_line(f, n) int f, n; /* prefix flag and argument */ - { +{ register int s; if (curbp->b_mode & MDVIEW) /* don't allow this command if */ @@ -561,7 +630,7 @@ int f, n; /* prefix flag and argument */ /* if we are in C mode and this is a default */ if (n == 1 && (curbp->b_mode & MDCMOD) && - curwp->w_dotp != curbp->b_linep) + curwp->w_dotp != curbp->b_linep) return(cinsert()); /* @@ -570,22 +639,21 @@ int f, n; /* prefix flag and argument */ * and we are not read-only, perform word wrap. */ if ((curwp->w_bufp->b_mode & MDWRAP) && fillcol > 0 && - getccol(FALSE) > fillcol && - (curwp->w_bufp->b_mode & MDVIEW) == FALSE) + getccol(FALSE) > fillcol && + (curwp->w_bufp->b_mode & MDVIEW) == FALSE) execkey(&wraphook, FALSE, 1); /* insert some lines */ while (n--) - { + { if ((s = lnewline()) != TRUE) return(s); - } - return(TRUE); } + return(TRUE); +} -PASCAL NEAR cinsert() /* insert a newline and indentation for C */ - - { +int cinsert() /* insert a newline and indentation for C */ +{ register char *cptr; /* string pointer into text to copy */ register int i; /* index into line to copy indent from */ register int llen; /* length of line to copy indent from */ @@ -598,12 +666,12 @@ PASCAL NEAR cinsert() /* insert a newline and indentation for C */ lp = curwp->w_dotp; offset = curwp->w_doto; while (offset > 0 && - (lgetc(lp, offset - 1) == ' ' || - lgetc(lp, offset - 1) == '\t')) - { + (lgetc(lp, offset - 1) == ' ' || + lgetc(lp, offset - 1) == '\t')) + { backdel(FALSE, 1); offset--; - } + } /* check for a brace */ bracef = (offset > 0 && lgetc(lp, offset - 1) == '{'); @@ -628,11 +696,11 @@ PASCAL NEAR cinsert() /* insert a newline and indentation for C */ /* save the indent of the last non blank line */ i = 0; while ((i < llen) && (cptr[i] == ' ' || cptr[i] == '\t') - && (i < NSTRING - 1)) - { + && (i < NSTRING - 1)) + { ichar[i] = cptr[i]; ++i; - } + } ichar[i] = 0; /* terminate it */ /* insert this saved indentation */ @@ -640,18 +708,18 @@ PASCAL NEAR cinsert() /* insert a newline and indentation for C */ /* and one more tab for a brace */ if (bracef) - tab(FALSE, 1); + uetab(FALSE, 1); return(TRUE); - } +} -PASCAL NEAR insbrace(n, c) /* insert a brace into the text here...we are in CMODE */ +int insbrace(n, c) /* insert a brace into the text here...we are in CMODE */ int n; /* repeat count */ int c; /* brace to insert (always } for now) */ - { +{ register int ch; /* last character before input */ - register int oc; /* caractere oppose a c */ + register int oc; /* opposite of c */ register int i, count; register int target; /* column brace should go after */ register LINE *oldlp; @@ -660,29 +728,29 @@ int c; /* brace to insert (always } for now) */ /* if we aren't at the beginning of the line... */ if (curwp->w_doto != 0) - /* scan to see if all space before this is white space */ + /* scan to see if all space before this is white space */ for (i = curwp->w_doto - 1; i >= 0; --i) - { + { ch = lgetc(curwp->w_dotp, i); if (ch != ' ' && ch != '\t') return(linsert(n, c)); - } + } /* chercher le caractere oppose correspondant */ switch (c) - { - case '}': - oc = '{'; - break; - case ']': - oc = '['; - break; - case ')': - oc = '('; - break; - default: - return(FALSE); - } + { + case '}': + oc = '{'; + break; + case ']': + oc = '['; + break; + case ')': + oc = '('; + break; + default: + return(FALSE); + } oldlp = curwp->w_dotp; oldoff = curwp->w_doto; @@ -691,9 +759,9 @@ int c; /* brace to insert (always } for now) */ backchar(FALSE, 1); while (count > 0) - { + { if (curwp->w_doto == lused(curwp->w_dotp)) - ch = '\r'; + ch = RET_CHAR; else ch = lgetc(curwp->w_dotp, curwp->w_doto); @@ -705,14 +773,14 @@ int c; /* brace to insert (always } for now) */ backchar(FALSE, 1); if (boundry(curwp->w_dotp, curwp->w_doto, REVERSE)) break; - } + } if (count != 0) - { /* no match */ + { /* no match */ curwp->w_dotp = oldlp; curwp->w_doto = oldoff; return(linsert(n, c)); - } + } curwp->w_doto = 0; /* debut de ligne */ /* aller au debut de la ligne apres la tabulation */ @@ -725,7 +793,7 @@ int c; /* brace to insert (always } for now) */ curwp->w_doto = oldoff; while (target != getccol(FALSE)) - { + { if (target < getccol(FALSE)) /* on doit detruire des caracteres */ while (getccol(FALSE) > target) backdel(FALSE, 1); @@ -734,16 +802,16 @@ int c; /* brace to insert (always } for now) */ while (target - getccol(FALSE) >= tabsize) linsert(1, '\t'); linsert(target - getccol(FALSE), ' '); - } } + } /* and insert the required brace(s) */ return(linsert(n, c)); - } +} -PASCAL NEAR inspound() /* insert a # into the text here...we are in CMODE */ +int inspound() /* insert a # into the text here...we are in CMODE */ - { +{ register int ch; /* last character before input */ register int i; @@ -753,11 +821,11 @@ PASCAL NEAR inspound() /* insert a # into the text here...we are in CMODE */ /* scan to see if all space before this is white space */ for (i = curwp->w_doto - 1; i >= 0; --i) - { + { ch = lgetc(curwp->w_dotp, i); if (ch != ' ' && ch != '\t') return(linsert(1, '#')); - } + } /* delete back first */ while (getccol(FALSE) >= 1) @@ -765,7 +833,7 @@ PASCAL NEAR inspound() /* insert a # into the text here...we are in CMODE */ /* and insert the required pound */ return(linsert(1, '#')); - } +} /* * Delete blank lines around dot. What this command does depends if dot is @@ -776,16 +844,16 @@ PASCAL NEAR inspound() /* insert a # into the text here...we are in CMODE */ * ignored. */ -PASCAL NEAR deblank(f, n) +int deblank(f, n) int f, n; /* prefix flag and argument */ - { - register LINE *lp1; - register LINE *lp2; +{ + register LINE *lp1; + register LINE *lp2; long nld; if (curbp->b_mode & MDVIEW) /* don't allow this command if */ - return(rdonly()); /* we are in read only mode */ + return (rdonly()); /* we are in read only mode */ lp1 = curwp->w_dotp; while (lused(lp1) == 0 && (lp2 = lback(lp1)) != curbp->b_linep) lp1 = lp2; @@ -794,11 +862,11 @@ int f, n; /* prefix flag and argument */ while ((lp2 = lforw(lp2)) != curbp->b_linep && lused(lp2) == 0) ++nld; if (nld == 0) - return(TRUE); + return (TRUE); curwp->w_dotp = lforw(lp1); curwp->w_doto = 0; - return(ldelete(nld, FALSE)); - } + return (ldelete(nld, FALSE)); +} /* * Insert a newline, then enough tabs and spaces to duplicate the indentation @@ -809,46 +877,46 @@ int f, n; /* prefix flag and argument */ * subcomands failed. Normally bound to "C-J". */ -PASCAL NEAR indent(f, n) +int indent(f, n) int f, n; /* prefix flag and argument */ - { - register int nicol; - register int c; - register int i; +{ + register int nicol; + register int c; + register int i; - if (curbp->b_mode & MDVIEW) /* don't allow this command if */ - return(rdonly()); /* we are in read only mode */ + if (curbp->b_mode & MDVIEW) /* don't allow this command if */ + return (rdonly()); /* we are in read only mode */ if (n < 0) - return(FALSE); - while (n--) - { + return (FALSE); + while (n--) { nicol = 0; - for (i = 0; i < lused(curwp->w_dotp); ++i) - { + for (i = 0; i < lused(curwp->w_dotp); ++i) { c = lgetc(curwp->w_dotp, i); if (c != ' ' && c != '\t') break; - if (c == '\t') + if (c == '\t') { if (tabsize > 0) - nicol += -(nicol % tabsize) + (tabsize - 1); + nicol += -(nicol % tabsize) + + (tabsize - 1); else break; - ++nicol; } + ++nicol; + } if (lnewline() == FALSE) return FALSE; if (tabsize == 0) { if (linsert(nicol, ' ') == FALSE) - return(FALSE); - } - else - if (((i = nicol / tabsize) != 0 && linsert(i, '\t') == FALSE) - || ((i = nicol % tabsize) != 0 && linsert(i, ' ') == FALSE)) - return(FALSE); - } - return(TRUE); + return (FALSE); + } else if (((i = nicol / tabsize) != 0 + && linsert(i, '\t') == FALSE) + || ((i = nicol % tabsize) != 0 + && linsert(i, ' ') == FALSE)) + return (FALSE); } + return (TRUE); +} /* * Delete forward. This is real easy, because the basic delete routine does @@ -857,7 +925,7 @@ int f, n; /* prefix flag and argument */ * of text if typed with a big argument. Normally bound to "C-D". */ -PASCAL NEAR forwdel(f, n) +int forwdel(f, n) int f, n; /* prefix flag and argument */ @@ -876,7 +944,11 @@ int f, n; /* prefix flag and argument */ next_kill(); thisflag |= CFKILL; } +#if UTF8 + return(ldelchar((long)n, f)); +#else return(ldelete((long)n, f)); +#endif } /* @@ -886,7 +958,7 @@ int f, n; /* prefix flag and argument */ * both "RUBOUT" and "C-H". */ -PASCAL NEAR backdel(f, n) +int backdel(f, n) int f, n; /* prefix flag and argument */ @@ -913,7 +985,11 @@ int f, n; /* prefix flag and argument */ /* and now delete the characters */ if ((status = backchar(f, n)) == TRUE) - status = ldelete((long) n, f); +#if UTF8 + status = ldelchar((long) n, f); +#else + status = ldelete((long) n, f); +#endif return(status); } @@ -926,7 +1002,7 @@ int f, n; /* prefix flag and argument */ * that number of newlines. Normally bound to "C-K". */ -PASCAL NEAR killtext(f, n) +int killtext(f, n) int f, n; /* prefix flag and argument */ @@ -974,39 +1050,39 @@ int f, n; /* prefix flag and argument */ return(ldelete(chunk, TRUE)); } -PASCAL NEAR setmod(f, n) /* prompt and set an editor mode */ +int setmod(f, n) /* prompt and set an editor mode */ int f, n; /* default and argument */ - { +{ return(adjustmode(TRUE, FALSE)); - } +} -PASCAL NEAR delmode(f, n) /* prompt and delete an editor mode */ +int delmode(f, n) /* prompt and delete an editor mode */ int f, n; /* default and argument */ - { +{ return(adjustmode(FALSE, FALSE)); - } +} -PASCAL NEAR setgmode(f, n) /* prompt and set a global editor mode */ +int setgmode(f, n) /* prompt and set a global editor mode */ int f, n; /* default and argument */ - { +{ return(adjustmode(TRUE, TRUE)); - } +} -PASCAL NEAR delgmode(f, n) /* prompt and delete a global editor mode */ +int delgmode(f, n) /* prompt and delete a global editor mode */ int f, n; /* default and argument */ - { +{ return(adjustmode(FALSE, TRUE)); - } +} -PASCAL NEAR adjustmode(kind, global) /* change the editor mode status */ +int adjustmode(kind, global) /* change the editor mode status */ int kind; /* true = set, false = delete */ int global; /* true = global flag, false = current buffer flag */ - { +{ register char *scan; /* scanning pointer to convert prompt */ register int i; /* loop index */ register int status; /* error return on input */ @@ -1019,17 +1095,17 @@ int global; /* true = global flag, false = current buffer flag */ /* build the proper prompt string */ if (global) strcpy(prompt, TEXT62); -/* "Global mode to " */ + /* "Global mode to " */ else strcpy(prompt, TEXT63); -/* "Mode to " */ + /* "Mode to " */ if (kind == TRUE) strcat(prompt, TEXT64); -/* "add: " */ + /* "add: " */ else strcat(prompt, TEXT65); -/* "delete: " */ + /* "delete: " */ /* prompt the user and get an answer */ @@ -1048,12 +1124,12 @@ int global; /* true = global flag, false = current buffer flag */ /* test it first against the colors we know */ if ((i = lookup_color(cbuf)) != -1) - { + { #if COLOR /* finding the match, we set the color */ if (global) - { + { if (uflag) gfcolor = i; else @@ -1061,7 +1137,7 @@ int global; /* true = global flag, false = current buffer flag */ #if WINDOW_TEXT & 0 refresh_screen(first_screen); #endif - } + } else if (uflag) curwp->w_fcolor = i; @@ -1072,85 +1148,98 @@ int global; /* true = global flag, false = current buffer flag */ #endif mlerase(); return(TRUE); - } + } /* test it against the modes we know */ for (i = 0; i < NUMMODES; i++) - { + { if (strcmp(cbuf, modename[i]) == 0) - { + { /* finding a match, we process it */ if (kind == TRUE) + { if (global) - { + { gmode |= (1 << i); if ((1 << i) == MDOVER) gmode &= ~MDREPL; else if ((1 << i) == MDREPL) gmode &= ~MDOVER; - } +#ifdef MDSLINE + else if ((1 << i) == MDSLINE) + gmode &= ~MDDLINE; + else if ((1 << i) == MDDLINE) + gmode &= ~MDSLINE; +#endif + } else { curbp->b_mode |= (1 << i); if ((1 << i) == MDOVER) curbp->b_mode &= ~MDREPL; else if ((1 << i) == MDREPL) curbp->b_mode &= ~MDOVER; - } - else - if (global) - gmode &= ~(1 << i); - else - curbp->b_mode &= ~(1 << i); +#ifdef MDSLINE + else if ((1 << i) == MDSLINE) + curbp->b_mode &= ~MDDLINE; + else if ((1 << i) == MDDLINE) + curbp->b_mode &= ~MDSLINE; +#endif + } + } else if (global) { + gmode &= ~(1 << i); + } else + curbp->b_mode &= ~(1 << i); + /* display new mode line */ if (global == 0) upmode(); mlerase(); /* erase the junk */ return(TRUE); - } } + } mlwrite(TEXT66); -/* "No such mode!" */ + /* "No such mode!" */ return(FALSE); - } +} /* This function simply clears the message line, mainly for macro usage */ -PASCAL NEAR clrmes(f, n) +int clrmes(f, n) int f, n; /* arguments ignored */ - { +{ mlforce(""); return(TRUE); - } +} /* This function writes a string on the message line mainly for macro usage */ -PASCAL NEAR writemsg(f, n) +int writemsg(f, n) int f, n; /* arguments ignored */ - { +{ register int status; char buf[NPAT]; /* buffer to recieve message into */ if ((status = mlreply(TEXT67, buf, NPAT - 1)) != TRUE) -/* "Message to write: " */ + /* "Message to write: " */ return(status); /* write the message out */ mlforce(buf); return(TRUE); - } +} /* the cursor is moved to a matching fence */ -PASCAL NEAR getfence(f, n) +int getfence(f, n) int f, n; /* not used */ - { +{ register LINE *oldlp; /* original line pointer */ register int oldoff; /* and offset */ register int sdir; /* direction of search (1/-1) */ @@ -1166,41 +1255,41 @@ int f, n; /* not used */ /* get the current character */ if (oldoff == lused(oldlp)) - ch = '\r'; + ch = RET_CHAR; else ch = lgetc(oldlp, oldoff); /* setup proper matching fence */ switch (ch) - { - case '(': - ofence = ')'; - sdir = FORWARD; - break; - case '{': - ofence = '}'; - sdir = FORWARD; - break; - case '[': - ofence = ']'; - sdir = FORWARD; - break; - case ')': - ofence = '('; - sdir = REVERSE; - break; - case '}': - ofence = '{'; - sdir = REVERSE; - break; - case ']': - ofence = '['; - sdir = REVERSE; - break; - default: - TTbeep(); - return(FALSE); - } + { + case '(': + ofence = ')'; + sdir = FORWARD; + break; + case '{': + ofence = '}'; + sdir = FORWARD; + break; + case '[': + ofence = ']'; + sdir = FORWARD; + break; + case ')': + ofence = '('; + sdir = REVERSE; + break; + case '}': + ofence = '{'; + sdir = REVERSE; + break; + case ']': + ofence = '['; + sdir = REVERSE; + break; + default: + TTbeep(); + return(FALSE); + } /* set up for scan */ count = 1; @@ -1208,14 +1297,14 @@ int f, n; /* not used */ /* scan until we find it, or reach the end of file */ while (count > 0) - { + { if (sdir == FORWARD) forwchar(FALSE, 1); else backchar(FALSE, 1); if (curwp->w_doto == lused(curwp->w_dotp)) - c = '\r'; + c = RET_CHAR; else c = lgetc(curwp->w_dotp, curwp->w_doto); @@ -1247,34 +1336,34 @@ int f, n; /* not used */ /* at the end/beginning of the buffer.... abort */ if (boundry(curwp->w_dotp, curwp->w_doto, sdir)) break; - } + } /* if count is zero, we have a match, move the sucker */ if (count == 0) - { + { curwp->w_flag |= WFMOVE; return(TRUE); - } + } /* restore the current position */ curwp->w_dotp = oldlp; curwp->w_doto = oldoff; TTbeep(); return(FALSE); - } +} /* Close fences are matched against their partners, and if on screen the cursor briefly lights there */ #if PROTO -PASCAL NEAR fmatch(char ch) +int fmatch(char ch) #else -PASCAL NEAR fmatch(ch) +int fmatch(ch) char ch; /* fence type to match against */ #endif - { +{ register LINE *oldlp; /* original line pointer */ register int oldoff; /* and offset */ register LINE *toplp; /* top line in current window */ @@ -1282,7 +1371,6 @@ char ch; /* fence type to match against */ register char opench; /* open fence */ register char c; /* current character in scan */ register int qlevel; /* quote level */ - register int i; /* first get the display update out there */ update(FALSE); @@ -1310,7 +1398,7 @@ char ch; /* fence type to match against */ backchar(FALSE, 1); if (curwp->w_doto == lused(curwp->w_dotp)) - c = '\r'; + c = RET_CHAR; else c = lgetc(curwp->w_dotp, curwp->w_doto); @@ -1341,23 +1429,33 @@ char ch; /* fence type to match against */ /* stop at the beginning of the buffer */ if (curwp->w_dotp == lforw(curwp->w_bufp->b_linep) && - curwp->w_doto == 0) + curwp->w_doto == 0) break; - } + } /* if count is zero, we have a match, display the sucker */ - /* there is a real machine dependant timing problem here we have + /* there is a real machine dependent timing problem here we have yet to solve......... */ if (count == 0) - { + { #if WINDOW_MSWIN update(FALSE); term.t_sleep (term.t_pause); #else +# if THEOSC + update(FALSE); + _sleep((long) term.t_pause); +# else +# if USG && JMDEXT + update(FALSE); + usleep(term.t_pause * 1000); +# else for (i = 0; i < term.t_pause; i++) update(FALSE); +# endif +# endif #endif - } + } /* restore the current position */ curwp->w_dotp = oldlp; @@ -1368,7 +1466,7 @@ char ch; /* fence type to match against */ /* ask for and insert a string into the current buffer at the current point */ -PASCAL NEAR istring(f, n) +int istring(f, n) int f, n; /* ignored arguments */ @@ -1378,7 +1476,7 @@ int f, n; /* ignored arguments */ /* ask for string to insert */ status = nextarg(TEXT68, tstring, NPAT, sterm); -/* "String to insert: " */ + /* "String to insert: " */ if (status != TRUE) return(status); @@ -1392,19 +1490,19 @@ int f, n; /* ignored arguments */ while (n-- && (status = linstr(tstring))) ; return(status); - } +} -PASCAL NEAR ovstring(f, n) /* ask for and overwite a string into the current +int ovstring(f, n) /* ask for and overwite a string into the current buffer at the current point */ int f, n; /* ignored arguments */ - { +{ register int status; /* status return code */ char tstring[NPAT + 1]; /* string to add */ /* ask for string to insert */ status = nextarg(TEXT69, tstring, NPAT, sterm); -/* "String to overwrite: " */ + /* "String to overwrite: " */ if (status != TRUE) return(status); @@ -1418,19 +1516,19 @@ int f, n; /* ignored arguments */ while (n-- && (status = lover(tstring))) ; return(status); - } +} -int PASCAL NEAR lookup_color(sp) +int lookup_color(sp) char *sp; /* name to look up */ - { +{ register int i; /* index into color list */ /* test it against the colors we know */ for (i = 0; i < NCOLORS; i++) - { + { if (strcmp(sp, cname[i]) == 0) return(i); - } - return(-1); } + return(-1); +} diff --git a/src/region.c b/src/region.c index 31818f2..31b3de5 100644 --- a/src/region.c +++ b/src/region.c @@ -4,6 +4,8 @@ * between "." and mark. Some functions are * commands. Some functions are just for * internal use. + * + * Unicode support by Jean-Michel Dubois */ #include #include "estruct.h" @@ -15,7 +17,7 @@ used by the trim/entab/detab-region commands */ -int PASCAL NEAR reglines() +int reglines() { register LINE *linep; /* position while scanning */ @@ -51,7 +53,7 @@ int PASCAL NEAR reglines() * Move "." to the start, and kill the characters. * Bound to "C-W". */ -PASCAL NEAR killregion(f, n) +int killregion(f, n) int f,n; /* prefix flag and argument */ @@ -87,7 +89,7 @@ int f,n; /* prefix flag and argument */ * at all. This is a bit like a kill region followed * by a yank. Bound to "M-W". */ -PASCAL NEAR copyregion(f, n) +int copyregion(f, n) int f,n; /* prefix flag and argument */ @@ -106,7 +108,7 @@ int f,n; /* prefix flag and argument */ loffs = region.r_offset; /* Current offset. */ while (region.r_size--) { if (loffs == lused(linep)) { /* End of line. */ - if ((s=kinsert(FORWARD, '\r')) != TRUE) + if ((s=kinsert(FORWARD, RET_CHAR)) != TRUE) return(s); linep = lforw(linep); loffs = 0; @@ -129,7 +131,7 @@ int f,n; /* prefix flag and argument */ * redisplay is done in all buffers. Bound to * "C-X C-L". */ -PASCAL NEAR lowerregion(f, n) +int lowerregion(f, n) int f,n; /* prefix flag and argument */ @@ -137,7 +139,12 @@ int f,n; /* prefix flag and argument */ register LINE *save_dotp;/* pointer and offset to position to preserve */ register int save_doto; register int status; /* return status from fetching region */ +#if UTF8 + char utf8[6]; + unsigned int c; +#else int c; /* current character */ +#endif REGION region; /* region which is being used */ /* don't bother if we are in read only mode */ @@ -170,7 +177,21 @@ int f,n; /* prefix flag and argument */ /* lowercase this character */ c = lgetc(curwp->w_dotp, curwp->w_doto); +#if UTF8 + if (is_multibyte_utf8(c)) { + if (utf8_to_unicode(curwp->w_dotp->l_text, curwp->w_doto, lused(curwp->w_dotp), &c) > 1 && iswupper(c)) { + c = ToWLower(c); + unicode_to_utf8(c, utf8); + + if (lowrite(c) == FALSE) + return (FALSE); + + continue; + } + } else +#endif if (is_upper(c)) { + obj.obj_char = c; c = lowerc(c); lputc(curwp->w_dotp, curwp->w_doto, c); @@ -194,7 +215,7 @@ int f,n; /* prefix flag and argument */ * redisplay is done in all buffers. Bound to * "C-X C-L". */ -PASCAL NEAR upperregion(f, n) +int upperregion(f, n) int f,n; /* prefix flag and argument */ @@ -202,9 +223,13 @@ int f,n; /* prefix flag and argument */ register LINE *save_dotp;/* pointer and offset to position to preserve */ register int save_doto; register int status; /* return status from fetching region */ +#if UTF8 + char utf8[6]; + unsigned int c; /* current character */ +#else int c; /* current character */ +#endif REGION region; /* region which is being used */ - /* don't bother if we are in read only mode */ if (curbp->b_mode&MDVIEW) return(rdonly()); @@ -235,6 +260,19 @@ int f,n; /* prefix flag and argument */ /* uppercase this character */ c = lgetc(curwp->w_dotp, curwp->w_doto); +#if UTF8 + if (is_multibyte_utf8(c)) { + if (utf8_to_unicode(curwp->w_dotp->l_text, curwp->w_doto, lused(curwp->w_dotp), &c) > 1 && iswlower(c)) { + c = ToWUpper(c); + unicode_to_utf8(c, utf8); + + if (lowrite(c) == FALSE) + return (FALSE); + + continue; + } + } else +#endif if (is_lower(c)) { obj.obj_char = c; c = upperc(c); @@ -255,14 +293,14 @@ int f,n; /* prefix flag and argument */ the current buffer invisable and unchangable */ -PASCAL NEAR narrow(f, n) +int narrow(f, n) int f,n; /* prefix flag and argument */ { register int status; /* return status */ BUFFER *bp; /* buffer being narrowed */ - SCREEN *scrp; /* screen to fix pointers in */ + ESCREEN *scrp; /* screen to fix pointers in */ EWINDOW *wp; /* windows to fix up pointers in as well */ REGION creg; /* region boundry structure */ int cmark; /* current mark */ @@ -345,14 +383,14 @@ int f,n; /* prefix flag and argument */ /* widen-from-region (^X->) restores a narrowed region */ -PASCAL NEAR widen(f, n) +int widen(f, n) int f,n; /* prefix flag and argument */ { LINE *lp; /* temp line pointer */ BUFFER *bp; /* buffer being narrowed */ - SCREEN *scrp; /* screen to fix pointers in */ + ESCREEN *scrp; /* screen to fix pointers in */ EWINDOW *wp; /* windows to fix up pointers in as well */ int cmark; /* current mark */ @@ -438,7 +476,7 @@ int f,n; /* prefix flag and argument */ * "ABORT" status; we might make this have the confirm thing later. */ -PASCAL NEAR getregion(rp) +int getregion(rp) register REGION *rp; @@ -500,7 +538,7 @@ register REGION *rp; * It is assumed that the buffer size is at least one plus the * region size. */ -char *PASCAL NEAR regtostr(buf, region) +char *regtostr(buf, region) char *buf; REGION *region; @@ -517,7 +555,7 @@ REGION *region; rsize = region->r_size; while (rsize--) { if (loffs == lused(linep)) { /* End of line. */ - *ptr = '\r'; + *ptr = RET_CHAR; linep = lforw(linep); loffs = 0; } else { /* Middle of line. */ @@ -530,7 +568,7 @@ REGION *region; return buf; } -char *PASCAL NEAR getreg(value) /* return some of the contents of the current region */ +char *getreg(value) /* return some of the contents of the current region */ char *value; @@ -539,7 +577,7 @@ char *value; /* get the region limits */ if (getregion(®ion) != TRUE) - return(errorm); + return((char*)errorm); /* don't let the region be larger than a string can hold */ if (region.r_size >= NSTRING) @@ -548,7 +586,7 @@ char *value; } -PASCAL NEAR indent_region(f, n) /* indent a region n tab-stops */ +int indent_region(f, n) /* indent a region n tab-stops */ int f,n; /* default flag and numeric repeat count */ @@ -587,7 +625,7 @@ int f,n; /* default flag and numeric repeat count */ return(TRUE); } -PASCAL NEAR undent_region(f, n) /* undent a region n tab-stops */ +int undent_region(f, n) /* undent a region n tab-stops */ int f,n; /* default flag and numeric repeat count */ diff --git a/src/search.c b/src/search.c index 51763f4..6bbf29f 100644 --- a/src/search.c +++ b/src/search.c @@ -3,6 +3,8 @@ * and backward directions. * * (History comments formerly here have been moved to history.c) + * + * Unicode support by Jean-Michel Dubois */ #include @@ -31,9 +33,9 @@ static int o = 0; /* For longop() calls.*/ * the match string, and (perhaps) repaint the display. */ #if PROTO -int PASCAL NEAR forwsearch(int f, int n) +int forwsearch(int f, int n) #else -int PASCAL NEAR forwsearch( f, n) +int forwsearch( f, n) int f; int n; #endif @@ -64,9 +66,9 @@ int n; * and (perhaps) repaint the display. */ #if PROTO -int PASCAL NEAR forwhunt(int f, int n) +int forwhunt(int f, int n) #else -int PASCAL NEAR forwhunt( f, n) +int forwhunt( f, n) int f; int n; #endif @@ -135,9 +137,9 @@ int n; * (the last character that was matched). */ #if PROTO -int PASCAL NEAR backsearch(int f, int n) +int backsearch(int f, int n) #else -int PASCAL NEAR backsearch( f, n) +int backsearch( f, n) int f; int n; #endif @@ -169,9 +171,9 @@ int n; * (the last character that was matched). */ #if PROTO -int PASCAL NEAR backhunt(int f, int n) +int backhunt(int f, int n) #else -int PASCAL NEAR backhunt( f, n) +int backhunt( f, n) int f; int n; #endif @@ -240,9 +242,9 @@ int n; * and (perhaps) repaint the display. */ #if PROTO -int PASCAL NEAR mcscanner(MC *mcpatrn, int direct, int beg_or_end, int repeats) +int mcscanner(MC *mcpatrn, int direct, int beg_or_end, int repeats) #else -int PASCAL NEAR mcscanner( mcpatrn, direct, beg_or_end, repeats) +int mcscanner( mcpatrn, direct, beg_or_end, repeats) MC *mcpatrn; int direct; int beg_or_end; @@ -378,9 +380,9 @@ int repeats; * in Kernighan & Plauger's "Software Tools". */ #if PROTO -int PASCAL NEAR amatch(MC *mcptr, int direct, LINE **pcwline, int *pcwoff) +int NEAR amatch(MC *mcptr, int direct, LINE **pcwline, int *pcwoff) #else -int PASCAL NEAR amatch( mcptr, direct, pcwline, pcwoff) +int NEAR amatch( mcptr, direct, pcwline, pcwoff) MC *mcptr; int direct; LINE **pcwline; @@ -410,7 +412,7 @@ int *pcwoff; /* Is the current meta-character modified * by a closure? */ - if (cl_type = (mcptr->mc_type & ALLCLOS)) { + if ((cl_type = (mcptr->mc_type & ALLCLOS))) { /* Minimum number of characters that may * match is 0 or 1. @@ -526,9 +528,9 @@ int *pcwoff; * Software-Practice and Experience, vol 10, 501-506 (1980) */ #if PROTO -int PASCAL NEAR scanner(int direct, int beg_or_end, int repeats) +int scanner(int direct, int beg_or_end, int repeats) #else -int PASCAL NEAR scanner( direct, beg_or_end, repeats) +int scanner( direct, beg_or_end, repeats) int direct; int beg_or_end; int repeats; @@ -647,9 +649,9 @@ fail:; /* continue to search */ * restrictions. */ #if PROTO -int PASCAL NEAR fbound(DELTA *tbl, int jump, LINE **pcurline, int *pcuroff, int dir) +int NEAR fbound(DELTA *tbl, int jump, LINE **pcurline, int *pcuroff, int dir) #else -int PASCAL NEAR fbound( tbl, jump, pcurline, pcuroff, dir) +int NEAR fbound( tbl, jump, pcurline, pcuroff, dir) DELTA *tbl; int jump; LINE **pcurline; @@ -659,7 +661,9 @@ int dir; { int curoff; LINE *curline; - +#if UTF8 + unsigned int wc; +#endif curline = *pcurline; curoff = *pcuroff; @@ -676,9 +680,15 @@ int dir; return (TRUE); /* hit end of buffer */ if (curoff == lused(curline)) - jump = tbl->delta[(int) '\r']; - else + jump = tbl->delta[(int) RET_CHAR]; + else { +#if UTF8 + utf8_to_unicode(ltext(curline), curoff, lused(curline), &wc); + jump = tbl->delta[(unsigned short) wc]; +#else jump = tbl->delta[(int) lgetc(curline, curoff)]; +#endif + } } } else /* Reverse.*/ @@ -696,7 +706,7 @@ int dir; return (TRUE); /* hit end of buffer */ if (curoff == lused(curline)) - jump = tbl->delta[(int) '\r']; + jump = tbl->delta[(int) RET_CHAR]; else jump = tbl->delta[(int) lgetc(curline, curoff)]; } @@ -713,14 +723,66 @@ int dir; * alone and return TRUE. Otherwise all went well, and return FALSE. */ #if PROTO -int PASCAL NEAR movelocalpoint(int n, int *pcuroff, LINE **pcurline) +int movelocalpoint(int n, int *pcuroff, LINE **pcurline) #else -int PASCAL NEAR movelocalpoint( n, pcuroff, pcurline) +int movelocalpoint( n, pcuroff, pcurline) int n; int *pcuroff; LINE **pcurline; #endif { +#if UTF8 + int curoff; + LINE *curline; + unsigned int wc; + + curline = *pcurline; + curoff = *pcuroff; + + if (n > 0) { + if (curline == curbp->b_linep) + return TRUE; /* hit end of buffer */ + + while (n) { + curoff += utf8_to_unicode(ltext(curline), curoff, lused(curline), &wc); + n--; + + if (curoff > lused(curline)) { + curline = lforw(curline); + curoff = 0; + + if (curline == curbp->b_linep) + return (TRUE); /* hit end of buffer */ + } + } + } else { + while (n) { + curoff--; + + if (curoff < 0) { + curline = lback(curline); + curoff = lused(curline); + + if (curline == curbp->b_linep) + return TRUE; /* hit end of buffer */ + } + + while (! is_beginning_utf8(lgetc(curline, curoff))) { + curoff--; + + if (curoff < 0) { + curline = lback(curline); + curoff = lused(curline); + + if (curline == curbp->b_linep) + return TRUE; /* hit end of buffer */ + } + } + + ++n; + } + } +#else register int spare; register int curoff; register LINE *curline; @@ -747,6 +809,7 @@ LINE **pcurline; return (TRUE); /* hit end of buffer */ } } +#endif *pcurline = curline; *pcuroff = curoff; return FALSE; @@ -756,13 +819,58 @@ LINE **pcurline; * make_delta -- Create the delta tables. */ #if PROTO -VOID make_delta(char *pstring, DELTA *tbl) +VOID make_delta(CONST char *pstring, DELTA *tbl) #else VOID make_delta( pstring, tbl) -char *pstring; +CONST char *pstring; DELTA *tbl; #endif { +#if UTF8 + int j, jump_by, pos; + unsigned int ch; + size_t len = strlen(pstring); + + strcpy(tbl->patrn, pstring); + + for (j = jump_by = 0; j < len; ) { + j += utf8_to_unicode(pstring, j, len, &ch); + ++jump_by; + } + + for (j = 0; j < HICHAR; j++) + tbl->delta[j] = jump_by; + + jump_by -= 1; + + /* Now put in the characters contained + * in the pattern, duplicating the CASE. + */ + for (j = pos = 0; j < jump_by; ++j) { + unsigned int bytes = utf8_to_unicode(pstring, pos, len, &ch); + + if (iswalpha(ch)) + tbl->delta[(unsigned short) chcase(ch)] = jump_by - j; + + tbl->delta[(unsigned short) ch] = jump_by - j; + pos += bytes; + } + + /* The last character (left over from the loop above) will + * have the pattern length, unless there are duplicates of + * it. Get the number to jump from the delta array, and + * overwrite with zeroes in delta duplicating the CASE. + */ + utf8_to_unicode(pstring, pos, len, &ch); + + tbl->patlen = jump_by; + tbl->jump = jump_by + tbl->delta[(unsigned short) ch]; + + if (iswalpha(ch)) + tbl->delta[(unsigned short) chcase(ch)] = 0; + + tbl->delta[(unsigned short) ch] = 0; +#else int j, jump_by, ch; strcpy(tbl->patrn, pstring); @@ -778,7 +886,7 @@ DELTA *tbl; * in the pattern, duplicating the CASE. */ for (j = 0; j < jump_by; j++) { - ch = *pstring++; + ch = (unsigned char) *pstring++; if (is_letter(ch)) tbl->delta[(unsigned char) chcase(ch)] = jump_by - j; tbl->delta[ch] = jump_by - j; @@ -789,25 +897,26 @@ DELTA *tbl; * it. Get the number to jump from the delta array, and * overwrite with zeroes in delta duplicating the CASE. */ - ch = *pstring; + ch = (unsigned char) *pstring; tbl->patlen = jump_by; tbl->jump = jump_by + tbl->delta[ch]; if (is_letter(ch)) tbl->delta[(unsigned char) chcase(ch)] = 0; tbl->delta[ch] = 0; +#endif } /* - * setjtable -- Settting up search delta forward and delta backward + * setjtable -- Setting up search delta forward and delta backward * tables. The reverse search string and string lengths are * set here, for table initialization and for substitution * purposes. The default for any character to jump is the * pattern length. */ -VOID PASCAL NEAR setjtable() +VOID setjtable() { - make_delta(pat, &deltapat); + make_delta((char*) pat, &deltapat); make_delta(strrev(strcpy((char *)tap, (char *)pat)), &tapatled); } @@ -815,7 +924,7 @@ VOID PASCAL NEAR setjtable() * eq -- Compare two characters. The "bc" comes from the buffer, "pc" * from the pattern. If we are not in EXACT mode, fold out the case. */ -int PASCAL NEAR eq(bc, pc) +int eq(bc, pc) register unsigned char bc; register unsigned char pc; { @@ -830,6 +939,27 @@ register unsigned char pc; return (bc == pc); } +#if UTF8 + +/* + * weq -- Compare two UTF-8 characters. The "bc" comes from the buffer, "pc" + * from the pattern. If we are not in EXACT mode, fold out the case. + */ +int weq(unsigned int bc, unsigned int pc) +{ + if ((curwp->w_bufp->b_mode & MDEXACT) == 0) { + if (iswlower(bc)) + bc = chcase(bc); + + if (iswlower(pc)) + pc = chcase(pc); + } + + return (bc == pc); +} + +#endif + /* * readpattern -- Read a pattern. Stash it in apat. If it is the * search string (which means that the global variable pat[] @@ -844,10 +974,10 @@ register unsigned char pc; * string. */ #if PROTO -int PASCAL NEAR readpattern(char *prompt, char apat[], int srch) +int readpattern(CONST char *prompt, char apat[], int srch) #else -int PASCAL NEAR readpattern( prompt, apat, srch) -char *prompt; +int readpattern( prompt, apat, srch) +CONST char *prompt; char apat[]; int srch; #endif @@ -858,7 +988,7 @@ int srch; mlprompt(prompt, apat, sterm); /* Read a pattern. Either we get one, - * or we just get the META charater, and use the previous pattern. + * or we just get the META character, and use the previous pattern. * Then, if it's the search string, create the delta tables. * *Then*, make the meta-pattern, if we are defined that way. */ @@ -876,13 +1006,14 @@ int srch; /* Only make the meta-pattern if in magic mode, since the * pattern in question might have an invalid meta combination. */ - if (status == TRUE) + if (status == TRUE) { if ((curwp->w_bufp->b_mode & MDMAGIC) == 0) { mcclear(); rmcclear(); } else status = srch? mcstr(): rmcstr(); + } #endif return (status); } @@ -890,7 +1021,7 @@ int srch; /* * savematch -- We found the pattern? Let's save it away. */ -int PASCAL NEAR savematch() +int savematch() { register int j; REGION tmpreg; @@ -936,9 +1067,9 @@ int PASCAL NEAR savematch() * FALSE depending on if a boundry is hit (ouch). */ #if PROTO -int PASCAL NEAR boundry(LINE *curline, int curoff, int dir) +int boundry(LINE *curline, int curoff, int dir) #else -int PASCAL NEAR boundry( curline, curoff, dir) +int boundry( curline, curoff, dir) LINE *curline; int curoff; int dir; @@ -967,9 +1098,9 @@ int dir; * look at the character. */ #if PROTO -int PASCAL NEAR nextch(LINE **pcurline, int *pcuroff, int dir) +int nextch(LINE **pcurline, int *pcuroff, int dir) #else -int PASCAL NEAR nextch( pcurline, pcuroff, dir) +int nextch( pcurline, pcuroff, dir) LINE **pcurline; int *pcuroff; int dir; @@ -977,8 +1108,11 @@ int dir; { register LINE *curline; register int curoff; +#if UTF8 + unsigned int c; +#else register int c; - +#endif curline = *pcurline; curoff = *pcuroff; @@ -987,20 +1121,33 @@ int dir; { curline = lforw(curline); /* skip to next line */ curoff = 0; - c = '\r'; /* and return a */ + c = RET_CHAR; /* and return a */ } else +#if UTF8 + curoff += utf8_to_unicode(ltext(curline), curoff, lused(curline), &c); +#else c = lgetc(curline, curoff++); /* get the char */ +#endif } else /* Reverse.*/ { if (curoff == 0) { curline = lback(curline); curoff = lused(curline); - c = '\r'; + c = RET_CHAR; } else + { +#if UTF8 + while (--curoff >= 0 && ! is_beginning_utf8(lgetc(curline, curoff))) + ; + + utf8_to_unicode(ltext(curline), curoff, lused(curline), &c); +#else c = lgetc(curline, --curoff); +#endif + } } *pcurline = curline; *pcuroff = curoff; @@ -1013,9 +1160,9 @@ int dir; * Returns 0 (no match) or the number of characters matched. */ #if PROTO -int PASCAL NEAR liteq(LINE **curline, int *curpos, int direct, char *lstring) +int liteq(LINE **curline, int *curpos, int direct, char *lstring) #else -int PASCAL NEAR liteq( curline, curpos, direct, lstring) +int liteq( curline, curpos, direct, lstring) LINE **curline; int *curpos; int direct; @@ -1024,13 +1171,31 @@ char *lstring; { LINE *scanline = *curline; int scanpos = *curpos; +#if UTF8 + size_t len = strlen(lstring); +#else register int c; +#endif register int count = 0; + while (*lstring) { +#if UTF8 + unsigned int wc; + unsigned int bytes = utf8_to_unicode(lstring, 0, len, &wc); - while ((c = (unsigned char)(*lstring++)) != '\0') { + if (! weq(wc, nextch(&scanline, &scanpos, direct))) + return 0; + + count++; + lstring += bytes; + len -= bytes; +#else + c = *lstring++; + if (!eq(c, nextch(&scanline, &scanpos, direct))) return 0; + count++; +#endif } *curline = scanline; @@ -1052,7 +1217,7 @@ char *lstring; * within the 64K limit. C compilers actually do very little * in the way of optimizing - they expect you to do that. */ -int PASCAL NEAR mcstr() +int mcstr() { MC *mcptr, *rtpcm; DELTA *tbl; @@ -1274,7 +1439,7 @@ int PASCAL NEAR mcstr() /* * mcclear -- Free up any CCL bitmaps, and MCNIL the MC search arrays. */ -VOID PASCAL NEAR mcclear() +VOID mcclear() { register MC *mcptr; register int j; @@ -1329,9 +1494,9 @@ VOID PASCAL NEAR mcclear() * too many functions with the 'match' name already. */ #if PROTO -int PASCAL NEAR mceq(unsigned char bc, MC *mt) +int NEAR mceq(unsigned char bc, MC *mt) #else -int PASCAL NEAR mceq( bc, mt) +int NEAR mceq( bc, mt) unsigned char bc; MC *mt; #endif @@ -1344,7 +1509,7 @@ MC *mt; break; case ANY: - result = (bc != '\r'); + result = (bc != RET_CHAR); break; case CCL: @@ -1380,9 +1545,9 @@ MC *mt; * so that a loop may automatically increment with safety. */ #if PROTO -int PASCAL NEAR cclmake(char **ppatptr, MC *mcptr) +int NEAR cclmake(char **ppatptr, MC *mcptr) #else -int PASCAL NEAR cclmake( ppatptr, mcptr) +int NEAR cclmake( ppatptr, mcptr) char **ppatptr; MC *mcptr; #endif @@ -1477,9 +1642,9 @@ MC *mcptr; * you will also need to update this function! */ #if PROTO -int PASCAL NEAR litmake(char **ppatptr, MC *mcptr) +int NEAR litmake(char **ppatptr, MC *mcptr) #else -int PASCAL NEAR litmake( ppatptr, mcptr) +int NEAR litmake( ppatptr, mcptr) char **ppatptr; MC *mcptr; #endif @@ -1500,7 +1665,7 @@ MC *mcptr; * Now loop through the pattern, collecting characters until * we run into a meta-character. */ - while (pchr = *++patptr) + while ((pchr = *++patptr)) { /* * If the current character is a closure character, @@ -1573,9 +1738,9 @@ MC *mcptr; * biteq -- is the character in the bitmap? */ #if PROTO -int PASCAL NEAR biteq(int bc, EBITMAP cclmap) +int NEAR biteq(int bc, EBITMAP cclmap) #else -int PASCAL NEAR biteq( bc, cclmap) +int NEAR biteq( bc, cclmap) int bc; EBITMAP cclmap; #endif @@ -1590,9 +1755,9 @@ EBITMAP cclmap; * setbit -- Set a bit (ON only) in the bitmap. */ #if PROTO -VOID PASCAL NEAR setbit(int bc, EBITMAP cclmap) +VOID setbit(int bc, EBITMAP cclmap) #else -VOID PASCAL NEAR setbit( bc, cclmap) +VOID setbit( bc, cclmap) int bc; EBITMAP cclmap; #endif @@ -1605,9 +1770,9 @@ EBITMAP cclmap; #if DEBUG_SEARCH #if PROTO -int PASCAL NEAR mc_list(int f, int n) +int mc_list(int f, int n) #else -int PASCAL NEAR mc_list( f, n) +int mc_list( f, n) int f; int n; #endif @@ -1723,9 +1888,9 @@ int n; } #if PROTO -int PASCAL NEAR rmc_list(int f, int n) +int rmc_list(int f, int n) #else -int PASCAL NEAR rmc_list( f, n) +int rmc_list( f, n) int f; int n; #endif @@ -1791,9 +1956,9 @@ int n; } #if PROTO -VOID PASCAL NEAR mctype_cat(char pline[], int mc_type) +VOID mctype_cat(char pline[], int mc_type) #else -VOID PASCAL NEAR mctype_cat( pline, mc_type) +VOID mctype_cat( pline, mc_type) char pline[]; int mc_type; #endif diff --git a/src/unix.c b/src/unix.c index 5244f34..6d5afb3 100644 --- a/src/unix.c +++ b/src/unix.c @@ -1,84 +1,18 @@ /* UNIX: Unix specific terminal driver for MicroEMACS 4.0 (C)Copyright 1995 D. Lawrence, C. Smith + + Unicode support by Jean-Michel Dubois */ -/** - New features: (as of version 3.10) - - 1. Timeouts waiting on a function key have been changed from - 35000 to 500000 microseconds. - - 2. Additional keymapping entries can be made from the command - language by issuing a 'set $palette xxx'. The format of - xxx is a string as follows: - "KEYMAP keybinding escape-sequence". - To add "<[>" as a keybinding of FNN, issue: - "KEYMAP FNN ~e[A". - Note that the "~e" sequence represents the escape character in - the MicroEMACS command language. - - 3. Colors are supported. Under AIX the colors will be pulled - in automaticly. For other environments, you can either add - the termcap entries, C0 to D7. Or the colors may be defined - using the command language by issuing a 'set $palette xxx' - command. The format of xxx is a string as follows: - "CLRMAP # escape-sequence". - The number is a number from 0 to 15, where 0 to 7 is the - foreground colors, and 8 to 15 as background colors. - To add foreground color 0 for ansi terminals, issue: - "CLRMAP 0 ~e[30m". - - 'Porting notes: - - I have tried to create this file so that it should work - as well as possible without changes on your part. - - However, if something does go wrong, read the following - helpful hints: - - 1. On SUN-OS4, there is a problem trying to include both - the termio.h and ioctl.h files. I wish Sun would get their - act together. Even though you get lots of redefined messages, - it shouldn't cause any problems with the final object. - - 2. In the type-ahead detection code, the individual UNIX - system either has a FIONREAD or a FIORDCHK ioctl call. - Hopefully, your system uses one of them and this be detected - correctly without any intervention. - - 3. Also lookout for directory handling. The SCO Xenix system - is the weirdest I've seen, requiring a special load file - (see below). Some machine call the result of a readdir() call - a "struct direct" or "struct dirent". Includes files are - named differently depending of the O/S. If your system doesn't - have an opendir()/closedir()/readdir() library call, then - you should use the public domain utility "ndir". - - To compile: - Compile all files normally. - To link: - Select one of the following operating systems: - SCO Xenix: - use "-ltermcap" and "-lx"; - SUN 3 and 4: - use "-ltermcap"; - IBM-RT, IBM-AIX, ATT UNIX, Altos UNIX, Interactive: - use "-lcurses". - - - 20 feb 95 New version 4.00 features - We added new code to implient a TERMIOS driver -**/ /** Include files **/ #include /* Standard I/O definitions */ #include "estruct.h" /* Emacs definitions */ - -/** Do nothing routine **/ -int scnothing() -{ - return(0); -} +#include +#include +#include +#include /* I/O control definitions */ /** Only compile for UNIX machines **/ #if BSD || FREEBSD || USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX || (AVVION || TERMIOS) @@ -88,42 +22,6 @@ int scnothing() #include "edef.h" /* Global variable definitions */ #include "elang.h" /* Language definitions */ -/** Kill predefined **/ -#undef CTRL /* Problems with CTRL */ - - -/** Overall include files **/ -#include /* System type definitions */ -#include /* File status definitions */ -#include /* I/O control definitions */ - -/** Additional include files **/ -#if FREEBSD -#define TERMIOS 1 -#include -#undef BSD -#include -#undef BSD -#define BSD 0 -#endif -#if (BSD && !TERMIOS) -#include /* Timer definitions */ -#endif /* (BSD && !TERMIOS) */ -#if BSD || FREEBSD || SUN || HPUX8 || HPUX9 || (AVVION || TERMIOS) || AIX -#include /* Signal definitions */ -#endif /* BSD || FREEBSD || SUN || HPUX8 || HPUX9 || (AVVION || TERMIOS) */ -#if USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX -#include /* Terminal I/O definitions */ -#endif /* USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX */ -#if (AVVION || TERMIOS) -#include /* Terminal I/O definitions */ -#include -#endif /* (AVVION || TERMIOS) */ -#if CURSES -#include /* Curses screen output */ -#undef WINDOW /* Oh no! */ -#endif /* CURSES */ - /** Completion include files **/ /** Directory accessing: Try and figure this out... if you can! **/ #if ((BSD || FREEBSD) && !TERMIOS) @@ -139,1078 +37,22 @@ int scnothing() #define DIRENTRY dirent #endif /* ((USG || AIX || AUX) && !VAT) || SMOS || HPUX8 || HPUX9 || SUN || (AVVION || TERMIOS) */ -/** Restore predefined definitions **/ -#undef CTRL /* Restore CTRL */ -#define CTRL 0x0100 - -/** Parameters **/ -#define NINCHAR 64 /* Input buffer size */ -#define NOUTCHAR 256 /* Output buffer size */ -#if TERMCAP || TERMIOS -#define NCAPBUF 1024 /* Termcap storage size */ -#endif /* TERMCAP */ -#define MARGIN 8 /* Margin size */ -#define SCRSIZ 64 /* Scroll for margin */ -#define NPAUSE 10 /* # times thru update to pause */ - -/** CONSTANTS **/ -#define TIMEOUT 255 /* No character available */ - -#if TERMCAP || TERMIOS -struct capbind { /* Capability binding entry */ - char * name; /* Termcap name */ - char * store; /* Storage variable */ -}; -struct keybind { /* Keybinding entry */ - char * name; /* Termcap name */ - int value; /* Binding value */ -}; -char *reset = (char*) NULL; /* reset string kjc */ -#endif /* TERMCAP */ - -/** Local variables **/ -#if (BSD && !TERMIOS) -static struct sgttyb cursgtty; /* Current modes */ -static struct sgttyb oldsgtty; /* Original modes */ -static struct tchars oldtchars; /* Current tchars */ -static struct ltchars oldlchars; /* Current ltchars */ -static char blank[6] = /* Blank out character set */ - { -1, -1, -1, -1, -1, -1 }; -#endif /* (BSD && !TERMIOS) */ -#if USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || (SUN && !TERMIOS) || XENIX -static struct termio curterm; /* Current modes */ -static struct termio oldterm; /* Original modes */ -#endif /* USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || (SUN && !TERMIOS) || XENIX */ -#if (AVVION || TERMIOS) -static struct termios curterm; /* Current modes */ -static struct termios oldterm; /* Original modes */ -#endif /* (AVVION || TERMIOS) */ -#if TERMCAP || TERMIOS -static char tcapbuf[NCAPBUF]; /* Termcap character storage */ -#define CAP_CL 0 /* Clear to end of page */ -#define CAP_CM 1 /* Cursor motion */ -#define CAP_CE 2 /* Clear to end of line */ -#define CAP_SE 3 /* Standout ends */ -#define CAP_SO 4 /* Standout (reverse video) */ -#define CAP_IS 5 /* Initialize screen */ -#define CAP_KS 6 /* Keypad mode starts */ -#define CAP_KE 7 /* Keypad mode ends */ -#define CAP_VB 8 /* Visible bell */ -#if COLOR -#define CAP_C0 9 /* Foreground color #0 */ -#define CAP_C1 10 /* Foreground color #1 */ -#define CAP_C2 11 /* Foreground color #2 */ -#define CAP_C3 12 /* Foreground color #3 */ -#define CAP_C4 13 /* Foreground color #4 */ -#define CAP_C5 14 /* Foreground color #5 */ -#define CAP_C6 15 /* Foreground color #6 */ -#define CAP_C7 16 /* Foreground color #7 */ -#define CAP_D0 17 /* Background color #0 */ -#define CAP_D1 18 /* Background color #1 */ -#define CAP_D2 19 /* Background color #2 */ -#define CAP_D3 20 /* Background color #3 */ -#define CAP_D4 21 /* Background color #4 */ -#define CAP_D5 22 /* Background color #5 */ -#define CAP_D6 23 /* Background color #6 */ -#define CAP_D7 24 /* Background color #7 */ -#if USG || AIX || AUX -#define CAP_SF 25 /* Set foreground color */ -#define CAP_SB 26 /* Set background color */ -#endif /* USG || AIX || AUX */ -#endif /* COLOR */ -static struct capbind capbind[] = { /* Capability binding list */ - { "cl" }, /* Clear to end of page */ - { "cm" }, /* Cursor motion */ - { "ce" }, /* Clear to end of line */ - { "se" }, /* Standout ends */ - { "so" }, /* Standout (reverse video) */ - { "is" }, /* Initialize screen */ - { "ks" }, /* Keypad mode starts */ - { "ke" }, /* Keypad mode ends */ - { "vb" }, /* Visible bell */ -#if COLOR - { "c0" }, /* Foreground color #0 */ - { "c1" }, /* Foreground color #1 */ - { "c2" }, /* Foreground color #2 */ - { "c3" }, /* Foreground color #3 */ - { "c4" }, /* Foreground color #4 */ - { "c5" }, /* Foreground color #5 */ - { "c6" }, /* Foreground color #6 */ - { "c7" }, /* Foreground color #7 */ - { "d0" }, /* Background color #0 */ - { "d1" }, /* Background color #1 */ - { "d2" }, /* Background color #2 */ - { "d3" }, /* Background color #3 */ - { "d4" }, /* Background color #4 */ - { "d5" }, /* Background color #5 */ - { "d6" }, /* Background color #6 */ - { "d7" }, /* Background color #7 */ -#if USG || AIX || AUX - { "Sf" }, /* Set foreground color */ - { "Sb" }, /* Set background color */ -#endif /* USG || AIX || AUX */ -#endif /* COLOR */ -}; -#if COLOR -static int cfcolor = -1; /* Current forground color */ -static int cbcolor = -1; /* Current background color */ -#endif /* COLOR */ -static struct keybind keybind[] = { /* Keybinding list */ - { "bt", SHFT|CTRL|'i' }, /* Back-tab key */ - { "k1", SPEC|'1' }, /* F1 key */ - { "k2", SPEC|'2' }, /* F2 key */ - { "k3", SPEC|'3' }, /* F3 key */ - { "k4", SPEC|'4' }, /* F4 key */ - { "k5", SPEC|'5' }, /* F5 key */ - { "k6", SPEC|'6' }, /* F6 key */ - { "k7", SPEC|'7' }, /* F7 key */ - { "k8", SPEC|'8' }, /* F8 key */ - { "k9", SPEC|'9' }, /* F9 key */ - { "k0", SPEC|'0' }, /* F0 or F10 key */ - { "k;", SPEC|'0' }, /* F0 or F10 key (kjc) */ - { "F1", SHFT|SPEC|'1' }, /* Shift-F1 or F11 key */ - { "F2", SHFT|SPEC|'2' }, /* Shift-F2 or F12 key */ - { "F3", SHFT|SPEC|'3' }, /* Shift-F3 or F13 key */ - { "F4", SHFT|SPEC|'4' }, /* Shift-F4 or F14 key */ - { "F5", SHFT|SPEC|'5' }, /* Shift-F5 or F15 key */ - { "F6", SHFT|SPEC|'6' }, /* Shift-F6 or F16 key */ - { "F7", SHFT|SPEC|'7' }, /* Shift-F7 or F17 key */ - { "F8", SHFT|SPEC|'8' }, /* Shift-F8 or F18 key */ - { "F9", SHFT|SPEC|'9' }, /* Shift-F9 or F19 key */ - { "FA", SHFT|SPEC|'0' }, /* Shift-F0 or F20 key */ - { "kA", CTRL|'O' }, /* Insert line key */ - { "kb", CTRL|'H' }, /* Backspace key */ - { "kC", CTRL|'L' }, /* Clear screen key */ - { "kD", SPEC|'D' }, /* Delete character key */ - { "kd", SPEC|'N' }, /* Down arrow key */ - { "kE", CTRL|'K' }, /* Clear to end of line key */ - { "kF", CTRL|'V' }, /* Scroll forward key */ - { "kH", SPEC|'>' }, /* Home down key */ - { "@7", SPEC|'>' }, /* Home down key (kjc) */ - { "kh", SPEC|'<' }, /* Home key */ - { "kI", SPEC|'C' }, /* Insert character key */ - { "kL", CTRL|'K' }, /* Delete line key */ - { "kl", SPEC|'B' }, /* Left arrow key */ - { "kN", SPEC|'V' }, /* Next page key */ - { "kP", SPEC|'Z' }, /* Previous page key */ - { "kR", CTRL|'Z' }, /* Scroll backward key */ - { "kr", SPEC|'F' }, /* Right arrow key */ - { "ku", SPEC|'P' }, /* Up arrow key */ - { "K1", SPEC|'<' }, /* Keypad 7 -> Home */ - { "K2", SPEC|'V' }, /* Keypad 9 -> Page Up */ - { "K3", ' ' }, /* Keypad 5 */ - { "K4", SPEC|'>' }, /* Keypad 1 -> End */ - { "K5", CTRL|'V' }, /* Keypad 3 -> Page Down */ - { "kw", CTRL|'E' } /* End of line */ -}; -#endif /* TERMCAP */ -static int inbuf[NINCHAR]; /* Input buffer */ -static int * inbufh = /* Head of input buffer */ - inbuf; -static int * inbuft = /* Tail of input buffer */ - inbuf; -#if TERMCAP -static unsigned char outbuf[NOUTCHAR]; /* Output buffer */ -static unsigned char * outbuft = /* Output buffer tail */ - outbuf; -#endif /* TERMCAP */ - static DIR *dirptr = NULL; /* Current directory stream */ static char path[NFILEN]; /* Path of file to find */ static char rbuf[NFILEN]; /* Return file buffer */ static char *nameptr; /* Ptr past end of path in rbuf */ -/** Terminal definition block **/ -int scopen(), scclose(), ttgetc(), ttputc(), ttflush(); -int scmove(), sceeol(), sceeop(), scbeep(), screv(); -int sckopen(), sckclose(); -#if COLOR -int scfcol(), scbcol(); -#endif /* COLOR */ - -#if TERMCAP && FLABEL -static void dis_sfk(), dis_ufk(); -#endif - -TERM term = { - 120, /* Maximum number of rows */ - 0, /* Current number of rows */ - 132, /* Maximum number of columns */ - 0, /* Current number of columns */ - 0, 0, /* upper left corner default screen */ - MARGIN, /* Margin for extending lines */ - SCRSIZ, /* Scroll size for extending */ - NPAUSE, /* # times thru update to pause */ - scopen, /* Open terminal routine */ - scclose, /* Close terminal routine */ - sckopen, /* Open keyboard routine */ - sckclose, /* Close keyboard routine */ - ttgetc, /* Get character routine */ - ttputc, /* Put character routine */ - ttflush, /* Flush output routine */ - scmove, /* Move cursor routine */ - sceeol, /* Erase to end of line routine */ - sceeop, /* Erase to end of page routine */ - sceeop, /* Clear the desktop */ - scbeep, /* Beep! routine */ - screv, /* Set reverse video routine */ - scnothing, /* Set resolution routine */ -#if COLOR - scfcol, /* Set forground color routine */ - scbcol, /* Set background color routine */ -#endif /* COLOR */ -#if INSDEL - scinsline, /* insert a screen line */ - scdelline, /* delete a screen line */ -#endif /* INSDEL */ -}; - -int hpterm; /* global flag braindead HP-terminal */ - -/** Open terminal device **/ -int ttopen() -{ - strcpy(os, "UNIX"); -#if (BSD && !TERMIOS) - /* Get tty modes */ - if (ioctl(0, TIOCGETP, &oldsgtty) || - ioctl(0, TIOCGETC, &oldtchars) || - ioctl(0, TIOCGLTC, &oldlchars)) - return(-1); - - /* Save to original mode variables */ - cursgtty = oldsgtty; - - /* Set new modes */ - cursgtty.sg_flags |= CBREAK; - cursgtty.sg_flags &= ~(ECHO|CRMOD); - - /* Set tty modes */ - if (ioctl(0, TIOCSETP, &cursgtty) || - ioctl(0, TIOCSETC, blank) || - ioctl(0, TIOCSLTC, blank)) - return(-1); -#endif /* (BSD && !TERMIOS) */ -#if USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || (SUN && !TERMIOS) || XENIX - -#if SMOS - /* Extended settings; 890619mhs A3 */ - set_parm(0,-1,-1); -#endif /* SMOS */ - - /* Get modes */ - if (ioctl(0, TCGETA, &oldterm)) { - perror("Cannot TCGETA"); - return(-1); - } - - /* Save to original mode variable */ - curterm = oldterm; - - /* Set new modes */ - /* I do not believe the flow control settings of the OS should - be diddled by an application program. But if you do, change this - 1 to a 0, but be warned, all sorts of terminals will get grief - with this */ -#if 1 - curterm.c_iflag &= ~(INLCR|ICRNL|IGNCR); -#else - curterm.c_iflag &= ~(INLCR|ICRNL|IGNCR|IXON|IXANY|IXOFF); -#endif - - curterm.c_lflag &= ~(ICANON|ISIG|ECHO|IEXTEN); - curterm.c_cc[VMIN] = 1; - curterm.c_cc[VTIME] = 0; - -#if SMOS - /****THIS IS A BIG GUESS ON MY PART... the code changed - too much between versions for me to be sure this will work - DML */ - - /* Allow multiple (dual) sessions if already enabled */ - curterm.c_lflag = oldterm.c_lflag & ISIG; - - /* Use old SWTCH char if necessary */ - if (curterm.c_lflag != 0) - curterm.c_cc[VSWTCH] = oldterm.c_cc[VSWTCH]; - - /* Copy VTI settings */ - curterm.c_cc[VTBIT] = oldterm.c_cc[VTBIT]; - - /* Extended settings; 890619mhs A3 */ - set_parm(0,-1,-1); -#endif /* SMOS */ - - /* Set tty mode */ - if (ioctl(0, TCSETA, &curterm)) { - perror("Cannot TCSETA"); - return(-1); - } -#endif /* USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || (SUN && !TERMIOS) || XENIX */ -#if (AVVION || TERMIOS) - /* Get modes */ - if (tcgetattr(0, &oldterm)) { - perror("Cannot tcgetattr"); - return(-1); - } - - /* Save to original mode variable */ - curterm = oldterm; - - /* Set new modes */ - /* disable XON/XOFF. We want to use ^S/^Q */ - curterm.c_iflag &= ~(INLCR|ICRNL|IGNCR|IXON|IXANY|IXOFF); - curterm.c_lflag &= ~(ICANON|ISIG|ECHO|IEXTEN); - curterm.c_cc[VMIN] = 1; - curterm.c_cc[VTIME] = 0; -#ifdef VLNEXT - curterm.c_cc[VLNEXT] = -1; -#endif - -#if AVVION - /* Set line discipline for Data General */ - curterm.c_line = 0; -#endif - - /* Set tty mode */ - if (tcsetattr(0, TCSANOW, &curterm)) { - perror("Cannot tcsetattr"); - return(-1); - } -#endif /* (AVVION || TERMIOS) */ - - /* Success */ - return(0); -} - -/** Close terminal device **/ -int ttclose() -{ -#if ((AIX == 0) && (TERMIOS == 0)) || (FREEBSD == 1) - /* Restore original terminal modes */ - if (reset != (char*)NULL) - write(1, reset, strlen(reset)); -#endif - -#if (BSD && !TERMIOS) - if (ioctl(0, TIOCSETP, &oldsgtty) || - ioctl(0, TIOCSETC, &oldtchars) || - ioctl(0, TIOCSLTC, &oldlchars)) - return(-1); -#endif /* (BSD && !TERMIOS) */ - -#if USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || (SUN && !TERMIOS) || XENIX -#if SMOS - /* Extended settings; 890619mhs A3 */ - set_parm(0,-1,-1); -#endif /* SMOS */ - if (ioctl(0, TCSETA, &oldterm)) - return(-1); -#endif /* USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || (SUN && !TERMIOS) || XENIX */ - -#if (AVVION || TERMIOS) - /* Set tty mode */ - if (tcsetattr(0, TCSANOW, &oldterm)) { - perror("Cannot tcsetattr"); - return(-1); - } -#endif /* (AVVION || TERMIOS) */ - - /* Success */ - return(0); -} - -/** Flush output buffer to display **/ -int ttflush() -{ -#if TERMCAP - int len; - - /* Compute length of write */ - len = outbuft - outbuf; - if (len == 0) - return(0); - - /* Reset buffer position */ - outbuft = outbuf; - - /* Perform write to screen */ - return(write(1, outbuf, len) != len); -#else /* TERMCAP */ -#if CURSES - refresh(); -#endif /* CURSES */ - return(0); -#endif /* TERMCAP */ -} - -/** Put character onto display **/ -int ttputc(ch) -char ch; /* Character to display */ -{ -#if TERMCAP - /* Check for buffer full */ - if (outbuft == &outbuf[sizeof(outbuf)]) - ttflush(); - - /* Add to buffer */ - *outbuft++ = ch; -#endif /* TERMCAP */ - -#if CURSES - /* Put character on screen */ - addch(ch); -#endif /* CURSES */ - - return(0); -} - - -/** Grab input characters, with wait **/ -unsigned char grabwait() -{ -#if (BSD && !TERMIOS) - unsigned char ch; - - /* Perform read */ - if (read(0, &ch, 1) != 1) { - puts("** Horrible read error occured **"); - exit(1); - } - return(ch); -#endif /* (BSD && !TERMIOS) */ -#if USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || (SUN && !TERMIOS) || XENIX || (AVVION || TERMIOS) - unsigned char ch; - - /* Change mode, if necessary */ - if (curterm.c_cc[VTIME]) { - curterm.c_cc[VMIN] = 1; - curterm.c_cc[VTIME] = 0; -#if USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || (SUN && !TERMIOS) || XENIX - ioctl(0, TCSETA, &curterm); -#endif /* USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX */ -#if (AVVION || TERMIOS) - tcsetattr(0, TCSANOW, &curterm); -#endif /* (AVVION || TERMIOS) */ - } - - /* Perform read */ -#if HANDLE_WINCH - while (read(0, &ch, 1) != 1) { - if (winch_flag) - return 0; - } -#else - if (read(0, &ch, 1) != 1) { - puts("** Horrible read error occured **"); - exit(1); - } -#endif - /* Return new character */ - return(ch); -#endif /* USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || (SUN && !TERMIOS) || XENIX || (AVVION || TERMIOS) */ -} - -/** Grab input characters, short wait **/ -unsigned char grabnowait() -{ -#if (BSD && !TERMIOS) - static struct timeval timout = { 0, 500000L }; - int count, r; - - /* Select input */ - r = 1; - count = select(1, &r, NULL, NULL, &timout); - if (count == 0) - return(TIMEOUT); - if (count < 0) { - puts("** Horrible select error occured **"); - exit(1); - } - - /* Perform read */ - return(grabwait()); -#endif /* (BSD && !TERMIOS) */ -#if USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX || (AVVION || TERMIOS) - int count; - unsigned char ch; - - /* Change mode, if necessary */ - if (curterm.c_cc[VTIME] == 0) { - curterm.c_cc[VMIN] = 0; - curterm.c_cc[VTIME] = 5; -#if USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || (SUN && !TERMIOS) || XENIX - ioctl(0, TCSETA, &curterm); -#endif /* USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || (SUN && !TERMIOS) || XENIX */ -#if (AVVION || TERMIOS) - tcsetattr(0, TCSANOW, &curterm); -#endif /* (AVVION || TERMIOS) */ - } - - /* Perform read */ -#if HANDLE_WINCH - while ((count = read(0, &ch, 1)) < 0) { - if (winch_flag) - return 0; - } -#else - count = read(0, &ch, 1); - if (count < 0) { - puts("** Horrible read error occured **"); - exit(1); - } -#endif - if (count == 0) - return(TIMEOUT); - - /* Return new character */ - return(ch); -#endif /* USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX || (AVVION || TERMIOS) */ -} - -/* - * qin - queue in a character to the input buffer. - */ -#if PROTO -VOID qin(int ch) -#else -VOID qin( ch) -int ch; -#endif -{ - /* Check for overflow */ - if (inbuft == &inbuf[sizeof(inbuf)]) { - /* Annoy user */ - scbeep(); - return; - } - - /* Add character */ - *inbuft++ = ch; -} - -/* - * qrep - replace a key sequence with a single character in the input buffer. - */ -#if PROTO -VOID qrep(int ch) -#else -VOID qrep( ch) -int ch; -#endif -{ - inbuft = inbuf; - qin(ch); -} - - -/** Return cooked characters **/ -int ttgetc() -{ - int ch; -ttflush(); - /* Loop until character is in input buffer */ - while (inbufh == inbuft) - cook(); - - /* Get input from buffer, now that it is available */ - ch = *inbufh++; - - /* reset us to the beginning of the buffer if there are no more - pending characters */ - if (inbufh == inbuft) - inbufh = inbuft = inbuf; - - /* Return next character */ - return(ch); -} - -#if TYPEAH -int typahead() -{ - int count; - - /* See if internal buffer is non-empty */ - if (inbufh != inbuft) - return(1); - - /* Now check with system */ -#ifdef FIONREAD /* Watch out! This could bite you! */ - /* Get number of pending characters */ - if (ioctl(0, FIONREAD, &count)) - return(0); - return(count); -#else /* not FIONREAD */ -#ifdef VAT - return(0); -#else /* not VAT */ - /* Ask hardware for count */ - count = ioctl(0, FIORDCHK, 0); - if (count < 0) - return(0); - return(count); -#endif /* VAT */ -#endif /* FIONREAD */ -} -#endif /* TYPEAH */ - -#if TERMCAP || TERMIOS -/** Put out sequence, with padding **/ -void putpad(seq) -char * seq; /* Character sequence */ -{ - /* Check for null */ - if (!seq) - return; - - /* Call on termcap to send sequence */ - tputs(seq, 1, ttputc); -} -#endif /* TERMCAP */ - -/** Initialize screen package **/ -int scopen() -{ -#if TERMCAP || TERMIOS - char * cp, tcbuf[1024]; - int status; - struct capbind * cb; - struct keybind * kp; - char err_str[NSTRING]; - - char * tgetstr(); - -#ifndef VAT -#define TGETSTR(a,b) tgetstr((a), (b)) -#else -#define TGETSTR(a,b) tgetstr((a), *(b)) -#endif - -#if HPUX8 || HPUX9 || VAT || AUX || (AVVION || TERMIOS) || AIX - - /* HP-UX and AUX doesn't seem to have these in the termcap library */ - char PC, * UP; - short ospeed; -#else /* not HPUX8 || HPUX9 || VAT || AUX */ - extern char PC, * UP; - extern short ospeed; -#endif /* HPUX8 || HPUX9 || VAT || AUX */ - - /* Get terminal type */ - cp = getenv("TERM"); - if (!cp) { - puts(TEXT182); -/* "Environment variable \"TERM\" not define!" */ - exit(1); - } - - /* Try to load termcap */ - status = tgetent(tcbuf, cp); - if (status == -1) { - puts("Cannot open termcap file"); - exit(1); - } - if (status == 0) { - sprintf(err_str, TEXT183, cp); -/* "No entry for terminal type \"%s\"\n" */ - puts(err_str); - exit(1); - } - - /* Get size from termcap */ - term.t_nrow = tgetnum("li") - 1; - term.t_ncol = tgetnum("co"); - if (term.t_nrow < 3 || term.t_ncol < 3) { - puts("Screen size is too small!"); - exit(1); - } - - /* initialize max number of rows and cols */ - term.t_mrow = term.t_nrow; - term.t_mcol = term.t_ncol; - - /* Start grabbing termcap commands */ - cp = tcapbuf; - - /* Get the reset string */ - reset = TGETSTR("is", &cp); - - /* Get the pad character */ - if (tgetstr("pc", &cp)) - PC = tcapbuf[0]; - - /* Get up line capability */ - UP = TGETSTR("up", &cp); - - /* Get other capabilities */ - cb = capbind; - while (cb < &capbind[sizeof(capbind)/sizeof(*capbind)]) { - cb->store = TGETSTR(cb->name, &cp); - cb++; - } - - /* Check for minimum */ - if (!capbind[CAP_CL].store && (!capbind[CAP_CM].store || !UP)) { - puts("This terminal doesn't have enough power to run microEmacs!"); - exit(1); - } - - /* Set reverse video and erase to end of line */ - if (capbind[CAP_SO].store && capbind[CAP_SE].store) - revexist = TRUE; - if (!capbind[CAP_CE].store) - eolexist = FALSE; - - /* Get keybindings */ - kp = keybind; - while (kp < &keybind[sizeof(keybind)/sizeof(*keybind)]) { - addkey(TGETSTR(kp->name, &cp), kp->value); - kp++; - } - - /* check for HP-Terminal (so we can label its function keys) */ - hpterm = tgetflag("xs"); - - /* Open terminal device */ - if (ttopen()) { - puts("Cannot open terminal"); - exit(1); - } - - /* Set speed for padding sequences */ -#if (BSD && !TERMIOS) - ospeed = cursgtty.sg_ospeed; -#endif /* (BSD && !TERMIOS) */ -#if USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || (SUN && !TERMIOS) || XENIX - ospeed = curterm.c_cflag & CBAUD; -#endif /* USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || (SUN && !TERMIOS) || XENIX */ -#if (AVVION || TERMIOS) - ospeed = cfgetospeed(&curterm); -#endif /* (AVVION || TERMIOS) */ - - /* Send out initialization sequences */ -#if AIX == 0 - putpad(capbind[CAP_IS].store); -#endif - putpad(capbind[CAP_KS].store); - sckopen(); -#endif /* TERMCAP */ - -#if CURSES - /* Initialize screen */ - initscr(); - - /* Set size of screen */ - term.t_nrow = LINES - 1; - term.t_ncol = COLS; - - /* Open terminal device */ - if (ttopen()) { - puts("Cannot open terminal"); - exit(1); - } -#endif /* CURSES */ - - /* Success */ - return(0); -} - -/** Close screen package **/ -int scclose() -{ -#if TERMCAP - /* Turn off keypad mode */ - putpad(capbind[CAP_KE].store); - sckclose(); - - /* Close terminal device */ - ttflush(); - ttclose(); -#endif /* TERMCAP */ - -#if TERMIOS - /* Close terminal device */ - ttflush(); - ttclose(); -#endif /* TERMIOS */ - -#if CURSES - /* Turn off curses */ - endwin(); - - /* Close terminal device */ - ttflush(); - ttclose(); -#endif /* CURSES */ - - /* Success */ - return(0); -} - -/* open keyboard -hm */ -int sckopen() -{ -#if TERMCAP - putpad(capbind[CAP_KS].store); - ttflush(); -#if FLABEL - dis_ufk(); -#endif -#endif -} - -/* close keyboard -hm */ -int sckclose() -{ -#if TERMCAP - putpad(capbind[CAP_KE].store); - ttflush(); -#if FLABEL - dis_sfk(); -#endif -#endif -} - -/** Move cursor **/ -int scmove(row, col) -int row; /* Row number */ -int col; /* Column number */ -{ - char *tgoto(); - -#if TERMCAP || TERMIOS - /* Call on termcap to create move sequence */ - putpad(tgoto(capbind[CAP_CM].store, col, row)); -#endif /* TERMCAP */ - -#if CURSES - move(row, col); -#endif /* CURSES */ - - /* Success */ - return(0); -} - -/** Erase to end of line **/ -int sceeol() -{ -#if TERMCAP || TERMIOS - /* Send erase sequence */ - putpad(capbind[CAP_CE].store); -#endif /* TERMCAP */ - -#if CURSES - clrtoeol(); -#endif /* CURSES */ - - /* Success */ - return(0); -} - -/** Clear screen **/ -int sceeop() -{ -#if TERMCAP || TERMIOS -#if COLOR - scfcol(gfcolor); - scbcol(gbcolor); -#endif /* COLOR */ - /* Send clear sequence */ - putpad(capbind[CAP_CL].store); -#endif /* TERMCAP */ - -#if CURSES - erase(); -#endif /* CURSES */ - - - /* Success */ - return(0); -} - -/** Set reverse video state **/ -int screv(state) -int state; /* New state */ -{ -#if TERMCAP || TERMIOS -#if COLOR - int ftmp, btmp; /* temporaries for colors */ -#endif /* COLOR */ - - /* Set reverse video state */ - putpad(state ? capbind[CAP_SO].store : capbind[CAP_SE].store); - -#if COLOR - if (state == FALSE) { - ftmp = cfcolor; - btmp = cbcolor; - cfcolor = -1; - cbcolor = -1; - scfcol(ftmp); - scbcol(btmp); - } -#endif /* COLOR */ -#endif /* TERMCAP */ - -#if CURSES - if (state) - standout(); - else - standend(); -#endif /* CURSES */ - - /* Success */ - return(0); -} - -/** Beep **/ -scbeep() -{ -#if TERMCAP || TERMIOS -#if !NOISY - /* Send out visible bell, if it exists */ - if (capbind[CAP_VB].store) - putpad(capbind[CAP_VB].store); - else -#endif /* not NOISY */ - /* The old standby method */ - ttputc('\7'); -#endif /* TERMCAP */ - -#if CURSES - addch('\7'); /* FIX THIS! beep() and flash comes up undefined */ -#endif /* CURSES */ - - /* Success */ - return(0); -} - -#if COLOR -static char cmap[8] = { 0, 4, 2, 6, 1, 5, 3, 7 }; - -/** Set foreground color **/ -int scfcol(color) -int color; /* Color to set */ -{ -#if TERMCAP || TERMIOS - /* Skip if already the correct color */ - if (color == cfcolor) - return(0); - - /* Send out color sequence */ - if (capbind[CAP_C0].store) { - putpad(capbind[CAP_C0 + (color & 7)].store); - cfcolor = color; - } -#if USG || AUX - else if (capbind[CAP_SF].store) { - putpad(tparm(capbind[CAP_SF].store, cmap[color & 7])); - cfcolor = color; - } -#endif /* USG || AUX */ -#endif /* TERMCAP */ - -#if CURSES - /* ? */ -#endif /* CURSES */ - return(0); -} - -/** Set background color **/ -int scbcol(color) -int color; /* Color to set */ -{ -#if TERMCAP || TERMIOS - /* Skip if already the correct color */ - if (color == cbcolor) - return(0); - - /* Send out color sequence */ - if (capbind[CAP_C0].store) { - putpad(capbind[CAP_D0 + (color & 7)].store); - cbcolor = color; - } -#if USG || AUX - else if (capbind[CAP_SB].store) { - putpad(tparm(capbind[CAP_SB].store, cmap[color & 7])); - cbcolor = color; - } -#endif /* USG || AUX */ -#endif /* TERMCAP */ - -#if CURSES - /* ? */ -#endif /* CURSES */ - return(0); -} -#endif /* COLOR */ - -/** Set palette **/ -int spal(cmd) -char * cmd; /* Palette command */ -{ - int code, dokeymap; - char * cp; - - /* Check for keymapping command */ - if (strncmp(cmd, "KEYMAP ", 7) == 0) - dokeymap = 1; - else -#if TERMCAP -#if COLOR - if (strncmp(cmd, "CLRMAP ", 7) == 0) - dokeymap = 0; - else -#endif /* COLOR */ -#endif /* TERMCAP */ - return(0); - cmd += 7; - - /* Look for space */ - for (cp = cmd; *cp != '\0'; cp++) - if (*cp == ' ') { - *cp++ = '\0'; - break; - } - if (*cp == '\0') - return(1); - - /* Perform operation */ - if (dokeymap) { - - /* Convert to keycode */ - code = stock(cmd); - - /* Add to tree */ - addkey(cp, code); - } -#if TERMCAP -#if COLOR - else { - - /* Convert to color number */ - code = atoi(cmd); - if (code < 0 || code > 15) - return(1); - - /* Move color code to capability structure */ - capbind[CAP_C0 + code].store = malloc(strlen(cp) + 1); - if (capbind[CAP_C0 + code].store) - strcpy(capbind[CAP_C0 + code].store, cp); - } -#endif /* COLOR */ -#endif /* TERMCAP */ - return(0); -} - #if BSD || FREEBSD || SUN || HPUX8 || HPUX9 || (AVVION || TERMIOS) /* Surely more than just BSD systems do this */ /** Perform a stop signal **/ int bktoshell(f, n) +int f; +int n; { /* Reset the terminal and go to the last line */ vttidy(); - + /* Okay, stop... */ kill(getpid(), SIGTSTP); @@ -1250,7 +92,7 @@ char * timeset() return(sp); } -#if USG || AUX || SMOS || HPUX8 || XENIX +#if AUX || SMOS || HPUX8 || XENIX /** Rename a file **/ int rename(file1, file2) char * file1; /* Old file name */ @@ -1284,31 +126,39 @@ char * file2; /* New file name */ /* Unlink original file */ return(unlink(file1)); } -#endif /* USG || AUX || SMOS || HPUX8 || XENIX */ +#endif /* AUX || SMOS || HPUX8 || XENIX */ /** Callout to system to perform command **/ -int callout(cmd) +int callout(cmd, reopen) char * cmd; /* Command to execute */ +int reopen; { int status; /* Close down */ - scmove(term.t_nrow, 0); + TTmove(term.t_nrow, 0); ttflush(); - sckclose(); + TTkclose(); ttclose(); - +#if UTF8 + /* restore locale */ + setlocale(LC_CTYPE, locale); /* restore LC_CTYPE locale */ +#endif /* Do command */ status = system(cmd) == 0; - +#if UTF8 + /* Set locale */ + setlocale(LC_CTYPE, ""); +#endif /* Restart system */ - sgarbf = TRUE; - sckopen(); - if (ttopen()) { - puts("** Error reopening terminal device **"); - exit(1); + if (reopen) { + sgarbf = TRUE; + TTkopen(); + if (ttopen()) { + puts("** Error reopening terminal device **"); + exit(1); + } } - /* Success */ return(status); } @@ -1330,12 +180,14 @@ int n; /* Argument count */ #if BSD || FREEBSD || SUN sh = "/bin/csh"; #endif /* BSD || FREEBSD || SUN */ -#if USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || XENIX || (AVVION || TERMIOS) +#if LINUX + sh = "/bin/bash"; +#elif USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || XENIX || (AVVION || TERMIOS) sh = "/bin/sh"; #endif /* USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || XENIX || (AVVION || TERMIOS) */ /* Do shell */ - return(callout(sh)); + return(callout(sh, 1)); } /** Spawn a command **/ @@ -1356,14 +208,36 @@ int n; /* Argument count */ return(s); /* Perform the command */ - s = callout(line); + s = callout(line, 0); /* if we are interactive, pause here */ +#if CURSES + if (clexec == FALSE) { + puts("\n[End]"); + getchar(); + } + /* Restart system */ + sgarbf = TRUE; + TTkopen(); + if (ttopen()) { + puts("** Error reopening terminal device **"); + exit(1); + } +#else + /* Restart system */ + sgarbf = TRUE; + TTkopen(); + if (ttopen()) { + puts("** Error reopening terminal device **"); + exit(1); + } + if (clexec == FALSE) { mlwrite("[End]"); ttflush(); ttgetc(); } +#endif return(s); } @@ -1385,7 +259,7 @@ int n; /* Argument count */ int s; BUFFER * bp; EWINDOW * wp; - static char filnam[] = "command"; + char filnam[NFILEN]; /* Don't allow this command if restricted */ if (restflag) @@ -1396,8 +270,10 @@ int n; /* Argument count */ if (!s) return(s); + /* Initialize temporary file name */ + snprintf(filnam, sizeof(filnam), "command%d", getpid()); /* Get rid of the command output buffer if it exists */ - bp = bfind(filnam, FALSE, 0); + bp = bfind("command", FALSE, 0); if (bp) { /* Try to make sure we are off screen */ wp = wheadp; @@ -1417,10 +293,9 @@ int n; /* Argument count */ strcat(line, filnam); /* Do command */ - s = callout(line); + s = callout(line, 1); if (!s) return(s); - /* Split the current window to make room for the command output */ if (!splitwind(FALSE, 1)) return(0); @@ -1429,6 +304,8 @@ int n; /* Argument count */ if (!getfile(filnam, FALSE)) return(0); + /* Remove file name */ + *curwp->w_bufp->b_fname = '\0'; /* Make this window in VIEW mode, update all mode lines */ curwp->w_bufp->b_mode |= MDVIEW; wp = wheadp; @@ -1443,16 +320,19 @@ int n; /* Argument count */ } /** Filter buffer through command **/ -int filter(f, n) +int uefilter(f, n) int f; /* Flags */ int n; /* Argument count */ { - char line[NLINE], tmpnam[NFILEN]; + char line[NLINE], tempname[NFILEN]; int s; BUFFER * bp; - static char bname1[] = "fltinp"; - static char filnam1[] = "fltinp"; - static char filnam2[] = "fltout"; + char fltpin[NFILEN]; + char fltpout[NFILEN]; + + /* Initialize temporary files name */ + snprintf(fltpin, sizeof(fltpin), "fltpin%d", getpid()); + snprintf(fltpout, sizeof(fltpout), "fltpout%d", getpid()); /* Don't allow this command if restricted */ if (restflag) @@ -1469,37 +349,40 @@ int n; /* Argument count */ /* Setup the proper file names */ bp = curbp; - strcpy(tmpnam, bp->b_fname); /* Save the original name */ - strcpy(bp->b_fname, bname1); /* Set it to our new one */ + strcpy(tempname, bp->b_fname); /* Save the original name */ + strcpy(bp->b_fname, "fltpin"); /* Set it to our new one */ /* Write it out, checking for errors */ - if (!writeout(filnam1, "w")) { + if (!writeout(fltpin, "w")) { mlwrite("[Cannot write filter file]"); - strcpy(bp->b_fname, tmpnam); + strcpy(bp->b_fname, tempname); return(0); } /* Setup input and output */ - strcat(line," fltout"); + strcat(line," <"); + strcat(line, fltpin); + strcat(line, " >"); + strcat(line, fltpout); /* Perform command */ - s = callout(line); + s = callout(line, 1); /* If successful, read in file */ if (s) { - s = readin(filnam2, FALSE); + s = readin(fltpout, FALSE); if (s) /* Mark buffer as changed */ bp->b_flag |= BFCHG; } - + /* Reset file name */ - strcpy(bp->b_fname, tmpnam); + strcpy(bp->b_fname, tempname); /* and get rid of the temporary file */ - unlink(filnam1); - unlink(filnam2); + unlink(fltpin); + unlink(fltpout); /* Show status */ if (!s) @@ -1511,7 +394,7 @@ int n; /* Argument count */ char *getffile(fspec) char *fspec; /* Filename specification */ { - int index, point, extflag; + int index; /* First parse the file path off the file spec */ strcpy(path, fspec); @@ -1520,18 +403,6 @@ char *fspec; /* Filename specification */ --index; path[index+1] = '\0'; - - /* Check for an extension */ - point = strlen(fspec) - 1; - extflag = FALSE; - while (point >= 0) { - if (fspec[point] == '.') { - extflag = TRUE; - break; - } - point--; - } - /* Open the directory pointer */ if (dirptr) { closedir(dirptr); @@ -1553,7 +424,6 @@ char *fspec; /* Filename specification */ /** Get next filename from pattern **/ char *getnfile() { - int index; struct DIRENTRY * dp; struct stat fstat; @@ -1702,28 +572,4 @@ char *name; /* name of directory to delete */ } #endif /* XENIX & FILOCK */ -#if HANDLE_WINCH -/* - * Window size changes handled via signals. - */ -void winch_changed() -{ - signal(SIGWINCH,winch_changed); - winch_flag = 1; -} - -void winch_new_size() -{ - EWINDOW *wp; - struct winsize win; - - winch_flag=0; - ioctl(fileno(stdin),TIOCGWINSZ,&win); - winch_vtresize(win.ws_row,win.ws_col); - onlywind(0,0); - TTmove(0,0); - TTeeop(); -} -#endif - #endif /* BSD || FREEBSD || USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX || (AVVION || TERMIOS) */ diff --git a/src/unixterm.c b/src/unixterm.c new file mode 100644 index 0000000..a0d3ab3 --- /dev/null +++ b/src/unixterm.c @@ -0,0 +1,1385 @@ +/* UNIX: Unix specific terminal driver + for MicroEMACS 4.0 + (C)Copyright 1995 D. Lawrence, C. Smith + + Unicode support by Jean-Michel Dubois +*/ + +/** + New features: (as of version 3.10) + + 1. Timeouts waiting on a function key have been changed from + 35000 to 500000 microseconds. + + 2. Additional keymapping entries can be made from the command + language by issuing a 'set $palette xxx'. The format of + xxx is a string as follows: + "KEYMAP keybinding escape-sequence". + To add "<[>" as a keybinding of FNN, issue: + "KEYMAP FNN ~e[A". + Note that the "~e" sequence represents the escape character in + the MicroEMACS command language. + + 3. Colors are supported. Under AIX the colors will be pulled + in automatically. For other environments, you can either add + the termcap entries, C0 to D7. Or the colors may be defined + using the command language by issuing a 'set $palette xxx' + command. The format of xxx is a string as follows: + "CLRMAP # escape-sequence". + The number is a number from 0 to 15, where 0 to 7 is the + foreground colors, and 8 to 15 as background colors. + To add foreground color 0 for ansi terminals, issue: + "CLRMAP 0 ~e[30m". + + 'Porting notes: + + I have tried to create this file so that it should work + as well as possible without changes on your part. + + However, if something does go wrong, read the following + helpful hints: + + 1. On SUN-OS4, there is a problem trying to include both + the termio.h and ioctl.h files. I wish Sun would get their + act together. Even though you get lots of redefined messages, + it shouldn't cause any problems with the final object. + + 2. In the type-ahead detection code, the individual UNIX + system either has a FIONREAD or a FIORDCHK ioctl call. + Hopefully, your system uses one of them and this be detected + correctly without any intervention. + + 3. Also lookout for directory handling. The SCO Xenix system + is the weirdest I've seen, requiring a special load file + (see below). Some machine call the result of a readdir() call + a "struct direct" or "struct dirent". Includes files are + named differently depending of the O/S. If your system doesn't + have an opendir()/closedir()/readdir() library call, then + you should use the public domain utility "ndir". + + To compile: + Compile all files normally. + To link: + Select one of the following operating systems: + SCO Xenix: + use "-ltermcap" and "-lx"; + SUN 3 and 4: + use "-ltermcap"; + IBM-RT, IBM-AIX, ATT UNIX, Altos UNIX, Interactive: + use "-lcurses". + + - 20 feb 95 New version 4.00 features + We added new code to implement a TERMIOS driver + - 10 mar 2020 Jean-Michel Dubois + Split in three parts. Now : + unix.c now contains directory and system related functions only. + tcapunix.c contains termcap screen and keyboard driver. + (I should see why there is also a tcap.c file) + curses.c contains curses screen and keyboard driver. + !!!!! Tested with Linux only !!!!! +**/ + +/** Include files **/ +#include "estruct.h" /* Emacs definitions */ + +#if TERMCAP + +#include /* Standard I/O definitions */ +#include + +/** Do nothing routine **/ +int scnothing() +{ + return(0); +} + +/** Include files **/ +#include "eproto.h" /* Function definitions */ +#include "edef.h" /* Global variable definitions */ +#include "elang.h" /* Language definitions */ + +/** Kill predefined **/ +#undef CTRL /* Problems with CTRL */ + + +/** Overall include files **/ +#include /* System type definitions */ +#include /* File status definitions */ +#include /* I/O control definitions */ + +/** Additional include files **/ +#if LINUX +#include +#undef TERMIOS +#endif +#if FREEBSD +#define TERMIOS 1 +#undef BSD +#include +#undef BSD +#define BSD 0 +#endif +#if BSD || FREEBSD || SUN || HPUX8 || HPUX9 || (AVVION || TERMIOS) || AIX +#include /* Signal definitions */ +#endif /* BSD || FREEBSD || SUN || HPUX8 || HPUX9 || (AVVION || TERMIOS) */ +#if USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX +#include /* Terminal I/O definitions */ +#endif /* USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX */ +#if (AVVION || TERMIOS) +#include /* Terminal I/O definitions */ +#include +#endif /* (AVVION || TERMIOS) */ + +/** Restore predefined definitions **/ +#undef CTRL /* Restore CTRL */ +#if UTF8 +#define CTRL 0x01000000 +#else +#define CTRL 0x0100 +#endif + +/** Parameters **/ +#define NINCHAR 64 /* Input buffer size */ +#define NOUTCHAR 256 /* Output buffer size */ + +#ifdef SCO +#define NCAPBUF 2048 /* Termcap storage size */ +#elif LINUX +#define NCAPBUF 4096 +#else +#define NCAPBUF 1024 /* Termcap storage size */ +#endif + +#define MARGIN 8 /* Margin size */ +#define SCRSIZ 64 /* Scroll for margin */ +#define NPAUSE 500 /* Pause in milliseconds */ + +/** CONSTANTS **/ +#define TIMEOUT 255 /* No character available */ + +struct capbind { /* Capability binding entry */ + char * name; /* Termcap name */ + char * store; /* Storage variable */ +}; +struct keybind { /* Keybinding entry */ + char * name; /* Termcap name */ + int value; /* Binding value */ +}; +char *reset = (char*) NULL; /* reset string kjc */ + +/** Local variables **/ +#if (BSD && !TERMIOS) +static struct sgttyb cursgtty; /* Current modes */ +static struct sgttyb oldsgtty; /* Original modes */ +static struct tchars oldtchars; /* Current tchars */ +static struct ltchars oldlchars; /* Current ltchars */ +static char blank[6] = /* Blank out character set */ + { -1, -1, -1, -1, -1, -1 }; +#endif /* (BSD && !TERMIOS) */ +#if AVVION || (USG && ! TERMIOS) || AIX || AUX || SMOS || HPUX8 || HPUX9 || (SUN && !TERMIOS) || XENIX +static struct termio curterm; /* Current modes */ +static struct termio oldterm; /* Original modes */ +#endif /* USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || (SUN && !TERMIOS) || XENIX */ +#if (AVVION || TERMIOS) +static struct termios curterm; /* Current modes */ +static struct termios oldterm; /* Original modes */ +#endif /* (AVVION || TERMIOS) */ + +static char tcapbuf[NCAPBUF]; /* Termcap character storage */ +#define CAP_CL 0 /* Clear to end of page */ +#define CAP_CM 1 /* Cursor motion */ +#define CAP_CE 2 /* Clear to end of line */ +#define CAP_SE 3 /* Standout ends */ +#define CAP_SO 4 /* Standout (reverse video) */ +#define CAP_IS 5 /* Initialize screen */ +#define CAP_KS 6 /* Keypad mode starts */ +#define CAP_KE 7 /* Keypad mode ends */ +#define CAP_VB 8 /* Visible bell */ +#define CAP_MD 9 /* Bold on */ +#define CAP_ME 10 /* Bold off */ +#if COLOR +#define CAP_C0 11 /* Foreground color #0 */ +#define CAP_C1 12 /* Foreground color #1 */ +#define CAP_C2 13 /* Foreground color #2 */ +#define CAP_C3 14 /* Foreground color #3 */ +#define CAP_C4 15 /* Foreground color #4 */ +#define CAP_C5 16 /* Foreground color #5 */ +#define CAP_C6 17 /* Foreground color #6 */ +#define CAP_C7 18 /* Foreground color #7 */ +#define CAP_D0 19 /* Background color #0 */ +#define CAP_D1 20 /* Background color #1 */ +#define CAP_D2 21 /* Background color #2 */ +#define CAP_D3 22 /* Background color #3 */ +#define CAP_D4 23 /* Background color #4 */ +#define CAP_D5 24 /* Background color #5 */ +#define CAP_D6 25 /* Background color #6 */ +#define CAP_D7 26 /* Background color #7 */ +#if USG || AIX || AUX +#define CAP_SF 27 /* Set foreground color */ +#define CAP_SB 28 /* Set background color */ +#endif /* USG || AIX || AUX */ +#endif /* COLOR */ +static struct capbind capbind[] = { /* Capability binding list */ + { "cl", NULL }, /* Clear to end of page */ + { "cm", NULL }, /* Cursor motion */ + { "ce", NULL }, /* Clear to end of line */ + { "se", NULL }, /* Standout ends */ + { "so", NULL }, /* Standout (reverse video) */ + { "is", NULL }, /* Initialize screen */ + { "ks", NULL }, /* Keypad mode starts */ + { "ke", NULL }, /* Keypad mode ends */ + { "vb", NULL }, /* Visible bell */ + { "md", NULL }, /* Set bold on */ + { "me", NULL }, /* Set bold off */ +#if COLOR + { "c0", NULL }, /* Foreground color #0 */ + { "c1", NULL }, /* Foreground color #1 */ + { "c2", NULL }, /* Foreground color #2 */ + { "c3", NULL }, /* Foreground color #3 */ + { "c4", NULL }, /* Foreground color #4 */ + { "c5", NULL }, /* Foreground color #5 */ + { "c6", NULL }, /* Foreground color #6 */ + { "c7", NULL }, /* Foreground color #7 */ + { "d0", NULL }, /* Background color #0 */ + { "d1", NULL }, /* Background color #1 */ + { "d2", NULL }, /* Background color #2 */ + { "d3", NULL }, /* Background color #3 */ + { "d4", NULL }, /* Background color #4 */ + { "d5", NULL }, /* Background color #5 */ + { "d6", NULL }, /* Background color #6 */ + { "d7", NULL }, /* Background color #7 */ +#if USG || AIX || AUX + { "Sf", NULL }, /* Set foreground color */ + { "Sb", NULL }, /* Set background color */ +#endif /* USG || AIX || AUX */ +#if LINUX + { "AF", NULL }, /* Set foreground color */ + { "AB", NULL }, /* Set background color */ +#endif +#endif /* COLOR */ +}; +static struct keybind keybind[] = { /* Keybinding list */ + { "bt", SHFT|CTRL|'i' }, /* Back-tab key */ +#if LINUX + { "k1", SPEC|'1' }, /* F1 key */ + { "k2", SPEC|'2' }, /* F2 key */ + { "k3", SPEC|'3' }, /* F3 key */ + { "k4", SPEC|'4' }, /* F4 key */ + { "k5", SPEC|'5' }, /* F5 key */ + { "k6", SPEC|'6' }, /* F6 key */ + { "k7", SPEC|'7' }, /* F7 key */ + { "k8", SPEC|'8' }, /* F8 key */ + { "k9", SPEC|'9' }, /* F9 key */ + { "k0", SPEC|'0' }, /* F0 or F10 key */ + { "k;", SPEC|'0' }, /* F0 or F10 key (kjc) */ + { "F1", SPEC|'a' }, /* F11 key */ + { "F2", SPEC|'b' }, /* F12 key */ + { "F3", SHFT|SPEC|'1' }, /* Shift-F1 or F11 key */ + { "F4", SHFT|SPEC|'2' }, /* Shift-F2 or F12 key */ + { "F5", SHFT|SPEC|'3' }, /* Shift-F3 or F13 key */ + { "F6", SHFT|SPEC|'4' }, /* Shift-F4 or F14 key */ + { "F7", SHFT|SPEC|'5' }, /* Shift-F5 or F15 key */ + { "F8", SHFT|SPEC|'6' }, /* Shift-F6 or F16 key */ + { "F9", SHFT|SPEC|'7' }, /* Shift-F7 or F17 key */ + { "FA", SHFT|SPEC|'8' }, /* Shift-F8 or F18 key */ + { "FB", SHFT|SPEC|'9' }, /* Shift-F9 or F19 key */ + { "FC", SHFT|SPEC|'0' }, /* Shift-F0 or F20 key */ + { "FD", SHFT|SPEC|'a' }, /* Shift-F0 or F20 key */ + { "FE", SHFT|SPEC|'b' }, /* Shift-F0 or F20 key */ + { "kA", CTRL|'O' }, /* Insert line key */ + { "kb", CTRL|'H' }, /* Backspace key */ + { "kC", CTRL|'L' }, /* Clear screen key */ + { "kD", SPEC|'D' }, /* Delete character key */ + { "kd", SPEC|'N' }, /* Down arrow key */ + { "kE", CTRL|'K' }, /* Clear to end of line key */ + { "kF", CTRL|'V' }, /* Scroll forward key */ + { "kH", CTRL|'E' }, /* Home down key */ + { "@7", CTRL|'E' }, /* Home down key (kjc) */ + { "kh", CTRL|'A' }, /* Home key */ + { "kI", SPEC|'C' }, /* Insert character key */ + { "kL", CTRL|'K' }, /* Delete line key */ + { "kl", SPEC|'B' }, /* Left arrow key */ + { "kN", SPEC|'V' }, /* Next page key */ + { "kP", SPEC|'Z' }, /* Previous page key */ + { "kR", CTRL|'Z' }, /* Scroll backward key */ + { "kr", SPEC|'F' }, /* Right arrow key */ + { "ku", SPEC|'P' }, /* Up arrow key */ + { "K1", SPEC|'<' }, /* Keypad 7 -> Home */ + { "K2", SPEC|'V' }, /* Keypad 9 -> Page Up */ + { "K3", ' ' }, /* Keypad 5 */ + { "K4", SPEC|'>' }, /* Keypad 1 -> End */ + { "K5", CTRL|'V' }, /* Keypad 3 -> Page Down */ + { "kw", CTRL|'E' } /* End of line */ +#else + { "k1", SPEC|'1' }, /* F1 key */ + { "k2", SPEC|'2' }, /* F2 key */ + { "k3", SPEC|'3' }, /* F3 key */ + { "k4", SPEC|'4' }, /* F4 key */ + { "k5", SPEC|'5' }, /* F5 key */ + { "k6", SPEC|'6' }, /* F6 key */ + { "k7", SPEC|'7' }, /* F7 key */ + { "k8", SPEC|'8' }, /* F8 key */ + { "k9", SPEC|'9' }, /* F9 key */ + { "k0", SPEC|'0' }, /* F0 or F10 key */ + { "k;", SPEC|'0' }, /* F0 or F10 key (kjc) */ + { "l1", SHFT|SPEC|'1' }, /* F1 key */ + { "l2", SHFT|SPEC|'2' }, /* F2 key */ + { "l3", SHFT|SPEC|'3' }, /* F3 key */ + { "l4", SHFT|SPEC|'4' }, /* F4 key */ + { "l5", SHFT|SPEC|'5' }, /* F5 key */ + { "l6", SHFT|SPEC|'6' }, /* F6 key */ + { "l7", SHFT|SPEC|'7' }, /* F7 key */ + { "l8", SHFT|SPEC|'8' }, /* F8 key */ + { "l9", SHFT|SPEC|'9' }, /* F9 key */ + { "l0", SHFT|SPEC|'0' }, /* F0 or F10 key */ + { "l;", SPEC|'0' }, /* F0 or F10 key (kjc) */ + { "kA", CTRL|'O' }, /* Insert line key */ + { "kb", CTRL|'H' }, /* Backspace key */ + { "kC", CTRL|'L' }, /* Clear screen key */ + { "kD", SPEC|'D' }, /* Delete character key */ + { "kd", SPEC|'N' }, /* Down arrow key */ + { "kE", CTRL|'K' }, /* Clear to end of line key */ + { "kF", CTRL|'V' }, /* Scroll forward key */ + { "EN", SPEC|'>' }, /* Home down key */ + { "kh", SPEC|'<' }, /* Home key */ + { "kI", SPEC|'C' }, /* Insert character key */ + { "kL", CTRL|'K' }, /* Delete line key */ + { "kl", SPEC|'B' }, /* Left arrow key */ + { "kN", SPEC|'V' }, /* Next page key */ + { "kP", SPEC|'Z' }, /* Previous page key */ + { "PD", SPEC|'V' }, /* Next page key */ + { "PU", SPEC|'Z' }, /* Previous page key */ + { "kR", CTRL|'Z' }, /* Scroll backward key */ + { "kr", SPEC|'F' }, /* Right arrow key */ + { "ku", SPEC|'P' } /* Up arrow key */ +#endif +}; + +#if COLOR +static int cfcolor = -1; /* Current foreground color */ +static int cbcolor = -1; /* Current background color */ +#endif /* COLOR */ +static int inbuf[NINCHAR]; /* Input buffer */ +static int * inbufh = /* Head of input buffer */ + inbuf; +static int * inbuft = /* Tail of input buffer */ + inbuf; +#if UTF8 +static unsigned outbuf[NOUTCHAR]; /* Output buffer */ +static unsigned * outbuft = /* Output buffer tail */ + outbuf; +#else +static unsigned char outbuf[NOUTCHAR]; /* Output buffer */ +static unsigned char * outbuft = /* Output buffer tail */ + outbuf; +#endif /* UTF8 */ + +/** Terminal definition block **/ +int scopen(), scclose(), ttgetc(), ttputc(), ttflush(); +int scmove(), sceeol(), sceeop(), scbeep(), screv(); +int sckopen(), sckclose(); +#if COLOR +int scfcol(), scbcol(); +#endif /* COLOR */ + +#if FLABEL +static void dis_sfk(), dis_ufk(); +#endif + +TERM term = { + 512, /* Maximum number of rows */ + 25, /* Current number of rows */ + 512, /* Maximum number of columns */ + 80, /* Current number of columns */ + 0, 0, /* upper left corner default screen */ + MARGIN, /* Margin for extending lines */ + SCRSIZ, /* Scroll size for extending */ + NPAUSE, /* # times thru update to pause */ + scopen, /* Open terminal routine */ + scclose, /* Close terminal routine */ + sckopen, /* Open keyboard routine */ + sckclose, /* Close keyboard routine */ + ttgetc, /* Get character routine */ + ttputc, /* Put character routine */ + ttflush, /* Flush output routine */ + scmove, /* Move cursor routine */ + sceeol, /* Erase to end of line routine */ + sceeop, /* Erase to end of page routine */ + sceeop, /* Clear the desktop */ + scbeep, /* Beep! routine */ + screv, /* Set reverse video routine */ + scnothing, /* Set resolution routine */ +#if COLOR + scfcol, /* Set forground color routine */ + scbcol, /* Set background color routine */ +#endif /* COLOR */ +#if INSDEL + scinsline, /* insert a screen line */ + scdelline, /* delete a screen line */ +#endif /* INSDEL */ +}; + +int hpterm; /* global flag braindead HP-terminal */ + +/** Open terminal device **/ +int ttopen() +{ +#if LINUX + strcpy(os, "LINUX"); +#else + strcpy(os, "UNIX"); +#endif +#if (BSD && !TERMIOS) + /* Get tty modes */ + if (ioctl(0, TIOCGETP, &oldsgtty) || + ioctl(0, TIOCGETC, &oldtchars) || + ioctl(0, TIOCGLTC, &oldlchars)) + return(-1); + + /* Save to original mode variables */ + cursgtty = oldsgtty; + + /* Set new modes */ + cursgtty.sg_flags |= CBREAK; + cursgtty.sg_flags &= ~(ECHO|CRMOD); + + /* Set tty modes */ + if (ioctl(0, TIOCSETP, &cursgtty) || + ioctl(0, TIOCSETC, blank) || + ioctl(0, TIOCSLTC, blank)) + return(-1); +#endif /* (BSD && !TERMIOS) */ +#if USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || (SUN && !TERMIOS) || XENIX + +#if SMOS + /* Extended settings; 890619mhs A3 */ + set_parm(0,-1,-1); +#endif /* SMOS */ + + /* Get modes */ + if (ioctl(0, TCGETA, &oldterm)) { + perror("Cannot TCGETA"); + return(-1); + } + + /* Save to original mode variable */ + curterm = oldterm; + + /* Set new modes */ + /* I do not believe the flow control settings of the OS should + be diddled by an application program. But if you do, change this + 1 to a 0, but be warned, all sorts of terminals will get grief + with this */ +#if 1 + curterm.c_iflag &= ~(INLCR|ICRNL|IGNCR); +#else + curterm.c_iflag &= ~(INLCR|ICRNL|IGNCR|IXON|IXANY|IXOFF); +#endif + + curterm.c_lflag &= ~(ICANON|ISIG|ECHO|IEXTEN); + curterm.c_cc[VMIN] = 1; + curterm.c_cc[VTIME] = 0; + +#if SMOS + /****THIS IS A BIG GUESS ON MY PART... the code changed + too much between versions for me to be sure this will work - DML */ + + /* Allow multiple (dual) sessions if already enabled */ + curterm.c_lflag = oldterm.c_lflag & ISIG; + + /* Use old SWTCH char if necessary */ + if (curterm.c_lflag != 0) + curterm.c_cc[VSWTCH] = oldterm.c_cc[VSWTCH]; + + /* Copy VTI settings */ + curterm.c_cc[VTBIT] = oldterm.c_cc[VTBIT]; + + /* Extended settings; 890619mhs A3 */ + set_parm(0,-1,-1); +#endif /* SMOS */ + + /* Set tty mode */ + if (ioctl(0, TCSETA, &curterm)) { + perror("Cannot TCSETA"); + return(-1); + } +#endif /* USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || (SUN && !TERMIOS) || XENIX */ +#if (AVVION || TERMIOS) + /* Get modes */ + if (tcgetattr(0, &oldterm)) { + perror("Cannot tcgetattr"); + return(-1); + } + + /* Save to original mode variable */ + curterm = oldterm; + + /* Set new modes */ + /* disable XON/XOFF. We want to use ^S/^Q */ + curterm.c_iflag &= ~(INLCR|ICRNL|IGNCR|IXON|IXANY|IXOFF); + curterm.c_lflag &= ~(ICANON|ISIG|ECHO|IEXTEN); + curterm.c_cc[VMIN] = 1; + curterm.c_cc[VTIME] = 0; +#ifdef VLNEXT + curterm.c_cc[VLNEXT] = -1; +#endif + +#if AVVION + /* Set line discipline for Data General */ + curterm.c_line = 0; +#endif + + /* Set tty mode */ + if (tcsetattr(0, TCSANOW, &curterm)) { + perror("Cannot tcsetattr"); + return(-1); + } +#endif /* (AVVION || TERMIOS) */ + + /* Success */ + return(0); +} + +/** Close terminal device **/ +int ttclose() +{ +#if ((AIX == 0) && (TERMIOS == 0)) || (FREEBSD == 1) + /* Restore original terminal modes */ + if (reset != (char*)NULL) + write(1, reset, strlen(reset)); +#endif + +#if (BSD && !TERMIOS) + if (ioctl(0, TIOCSETP, &oldsgtty) || + ioctl(0, TIOCSETC, &oldtchars) || + ioctl(0, TIOCSLTC, &oldlchars)) + return(-1); +#endif /* (BSD && !TERMIOS) */ + +#if USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || (SUN && !TERMIOS) || XENIX +#if SMOS + /* Extended settings; 890619mhs A3 */ + set_parm(0,-1,-1); +#endif /* SMOS */ + if (ioctl(0, TCSETA, &oldterm)) + return(-1); +#endif /* USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || (SUN && !TERMIOS) || XENIX */ + +#if (AVVION || TERMIOS) + /* Set tty mode */ + if (tcsetattr(0, TCSANOW, &oldterm)) { + perror("Cannot tcsetattr"); + return(-1); + } +#endif /* (AVVION || TERMIOS) */ + + /* Success */ + return(0); +} + +/** Flush output buffer to display **/ +int ttflush() +{ + int len; + + /* Compute length of write */ + len = outbuft - outbuf; + if (len == 0) + return(0); + + /* Reset buffer position */ + outbuft = outbuf; +#if UTF8 + char utf8[6]; + unsigned int bytes; + + while (len--) { + bytes = unicode_to_utf8(*outbuft, utf8); + write(1, utf8, bytes); + outbuft++; + } + + outbuft = outbuf; +#else + /* Perform write to screen */ + return(write(1, outbuf, len) != len); +#endif /* UTF8 */ + return(0); +} + +/** Put character onto display **/ +int ttputc(ch) +int ch; /* Character to display */ +{ + /* Check for buffer full */ + if (outbuft == &outbuf[NOUTCHAR]) + ttflush(); + /* Add to buffer */ +#if UTF8 + *outbuft++ = ((unsigned) ch) & CMSK; +#else + *outbuft++ = ch; +#endif + return(0); +} + +#if UTF8 +static char buffer[32]; +static int pending = 0; + +int grabwait(void) +{ + unsigned c; + int count, bytes = 1, expected; + + count = pending; + + if (!count) { + curterm.c_cc[VMIN] = 1; + curterm.c_cc[VTIME] = 0; + ioctl(0, TCSETA, &curterm); + count = read(0, buffer, sizeof(buffer)); + if (count <= 0) + return 0; + pending = count; + } + + c = (unsigned char) buffer[0]; + + if (c == 27 || (c >= 32 && c < 128)) + goto done; + + /* + * Lazy. We don't bother calculating the exact + * expected length. We want at least two characters + * for the special character case (ESC+[) and for + * the normal short UTF8 sequence that starts with + * the 110xxxxx pattern. + * + * But if we have any of the other patterns, just + * try to get more characters. At worst, that will + * just result in a barely perceptible 0.1 second + * delay for some *very* unusual utf8 character + * input. + */ + expected = ((c & 0xe2) == 0xe0 || (c & 0xe2) == 0xe2) ? 6 : 2; + + /* Special character - try to fill buffer */ + if (count < expected) { + int n; + curterm.c_cc[VMIN] = 0; + curterm.c_cc[VTIME] = 1; /* A .1 second lag */ + ioctl(0, TCSETA, &curterm); + n = read(0, buffer + count, sizeof(buffer) - count); + + if (n > 0) + pending += n; + } + + bytes = utf8_to_unicode(buffer, 0, pending, &c); + + /* Hackety hack! Turn no-break space into regular space */ + if (c == 0xa0) + c = ' '; +done: + if ((pending - bytes) > 0 && bytes < 32) { + pending -= bytes; + memmove(buffer, buffer+bytes, pending); + } else + pending = 0; + return c; +} + +int grabnowait(void) +{ + unsigned c; + int count, bytes = 1, expected; + + count = pending; + if (!count) { + + curterm.c_cc[VMIN] = 0; + curterm.c_cc[VTIME] = 1; + ioctl(0, TCSETA, &curterm); + count = read(0, buffer, sizeof(buffer)); + + if (count <= 0) + return TIMEOUT; + pending = count; + } + + c = (unsigned char) buffer[0]; + if (c == 27 || (c >= 32 && c < 128)) + goto done; + + /* + * Lazy. We don't bother calculating the exact + * expected length. We want at least two characters + * for the special character case (ESC+[) and for + * the normal short UTF8 sequence that starts with + * the 110xxxxx pattern. + * + * But if we have any of the other patterns, just + * try to get more characters. At worst, that will + * just result in a barely perceptible 0.1 second + * delay for some *very* unusual utf8 character + * input. + */ + expected = ((c & 0xe2) == 0xe0 || (c & 0xe2) == 0xe2) ? 6 : 2; + + /* Special character - try to fill buffer */ + if (count < expected) { + int n; + curterm.c_cc[VMIN] = 0; + curterm.c_cc[VTIME] = 1; /* A .1 second lag */ + ioctl(0, TCSETA, &curterm); + n = read(0, buffer + count, sizeof(buffer) - count); + + if (n > 0) + pending += n; + } + + bytes = utf8_to_unicode(buffer, 0, pending, &c); + + /* Hackety hack! Turn no-break space into regular space */ + if (c == 0xa0) + c = ' '; +done: + pending -= bytes; + memmove(buffer, buffer+bytes, pending); + return c; +} + +#else /* UTF8 */ + +/** Grab input characters, with wait **/ +unsigned char grabwait() +{ +#if (BSD && !TERMIOS) + unsigned char ch; + + /* Perform read */ + if (read(0, &ch, 1) != 1) { + puts("** Horrible read error occured **"); + exit(1); + } + return(ch); +#endif /* (BSD && !TERMIOS) */ +#if USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || (SUN && !TERMIOS) || XENIX || (AVVION || TERMIOS) + unsigned char ch; + + /* Change mode, if necessary */ + if (curterm.c_cc[VTIME]) { + curterm.c_cc[VMIN] = 1; + curterm.c_cc[VTIME] = 0; +#if USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || (SUN && !TERMIOS) || XENIX + ioctl(0, TCSETA, &curterm); +#endif /* USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX */ +#if (AVVION || TERMIOS) + tcsetattr(0, TCSANOW, &curterm); +#endif /* (AVVION || TERMIOS) */ + } + + /* Perform read */ +#if HANDLE_WINCH + while (read(0, &ch, 1) != 1) { + if (winch_flag) + return 0; + } +#else + if (read(0, &ch, 1) != 1) { + puts("** Horrible read error occured **"); + exit(1); + } +#endif + /* Return new character */ + return(ch); +#endif /* USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || (SUN && !TERMIOS) || XENIX || (AVVION || TERMIOS) */ +} + +/** Grab input characters, short wait **/ +unsigned char grabnowait() +{ +#if (BSD && !TERMIOS) + static struct timeval timout = { 0, 500000L }; + int count, r; + + /* Select input */ + r = 1; + count = select(1, &r, NULL, NULL, &timout); + if (count == 0) + return(TIMEOUT); + if (count < 0) { + puts("** Horrible select error occured **"); + exit(1); + } + + /* Perform read */ + return(grabwait()); +#endif /* (BSD && !TERMIOS) */ +#if USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX || (AVVION || TERMIOS) + int count; + unsigned char ch; + + /* Change mode, if necessary */ + if (curterm.c_cc[VTIME] == 0) { + curterm.c_cc[VMIN] = 0; +#if JMDEXT + curterm.c_cc[VTIME] = 2; +#else + curterm.c_cc[VTIME] = 5; +#endif +#if USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || (SUN && !TERMIOS) || XENIX + ioctl(0, TCSETA, &curterm); +#endif /* USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || (SUN && !TERMIOS) || XENIX */ +#if (AVVION || TERMIOS) + tcsetattr(0, TCSANOW, &curterm); +#endif /* (AVVION || TERMIOS) */ + } + + /* Perform read */ +#if HANDLE_WINCH + while ((count = read(0, &ch, 1)) < 0) { + if (winch_flag) + return 0; + } +#else + count = read(0, &ch, 1); + if (count < 0) { + puts("** Horrible read error occurred **"); + exit(1); + } +#endif + if (count == 0) + return(TIMEOUT); + + /* Return new character */ + return(ch); +#endif /* USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX || (AVVION || TERMIOS) */ +} + +#endif /* UTF8 */ + +/* + * qin - queue in a character to the input buffer. + */ +VOID qin(int ch) +{ + /* Check for overflow */ + if (inbuft == &inbuf[sizeof(inbuf)]) { + /* Annoy user */ + scbeep(); + return; + } + + /* Add character */ + *inbuft++ = ch; +} + +/* + * qrep - replace a key sequence with a single character in the input buffer. + */ +VOID qrep(int ch) +{ + inbuft = inbuf; + qin(ch); +} + + +/** Return cooked characters **/ +int ttgetc() +{ + int ch; + + ttflush(); + /* Loop until character is in input buffer */ + while (inbufh == inbuft) + cook(); + + /* Get input from buffer, now that it is available */ + ch = *inbufh++; + + /* reset us to the beginning of the buffer if there are no more + pending characters */ + if (inbufh == inbuft) + inbufh = inbuft = inbuf; + + /* Return next character */ + return(ch); +} + +#if TYPEAH +int typahead() +{ + int count; + + /* See if internal buffer is non-empty */ + if (inbufh != inbuft) + return(1); + + /* Now check with system */ +#ifdef FIONREAD /* Watch out! This could bite you! */ + /* Get number of pending characters */ + if (ioctl(0, FIONREAD, &count)) + return(0); + return(count); +#else /* not FIONREAD */ +#ifdef VAT + return(0); +#else /* not VAT */ + /* Ask hardware for count */ + count = ioctl(0, FIORDCHK, 0); + if (count < 0) + return(0); + return(count); +#endif /* VAT */ +#endif /* FIONREAD */ +} +#endif /* TYPEAH */ + +/** Put out sequence, with padding **/ +void putpad(seq) +char * seq; /* Character sequence */ +{ + /* Check for null */ + if (!seq) + return; + + /* Call on termcap to send sequence */ + tputs(seq, 1, ttputc); +} + +/** Initialize screen package **/ +int scopen() +{ + char * cp, tcbuf[NCAPBUF]; + int status; + struct capbind * cb; + struct keybind * kp; + char err_str[NSTRING]; + +#ifndef VAT +#define TGETSTR(a,b) tgetstr((a), (b)) +#else +#define TGETSTR(a,b) tgetstr((a), *(b)) +#endif + +#if (HPUX8 || HPUX9 || VAT || AUX || AVVION || TERMIOS || AIX) + + /* HP-UX and AUX doesn't seem to have these in the termcap library */ + char PC, * UP; + short ospeed; +#else /* not HPUX8 || HPUX9 || VAT || AUX */ + extern char PC, * UP; + extern short ospeed; +#endif /* HPUX8 || HPUX9 || VAT || AUX */ + + /* Get terminal type */ + cp = getenv("TERM"); + if (!cp) { + puts(TEXT182); +/* "Environment variable \"TERM\" not define!" */ + exit(1); + } + + /* Try to load termcap */ + status = tgetent(tcbuf, cp); + if (status == -1) { + puts("Cannot open termcap file"); + exit(1); + } + if (status == 0) { + sprintf(err_str, TEXT183, cp); +/* "No entry for terminal type \"%s\"\n" */ + puts(err_str); + exit(1); + } + + /* Set size of screen */ + /* Get default size from termcap */ + term.t_nrow = tgetnum("li") - 1; + term.t_ncol = tgetnum("co"); + /* Override size if environment variables exists */ + cp = getenv("LINES"); + if (cp) + term.t_nrow = atoi(cp) - 1; + + cp = getenv("COLUMNS"); + if (cp) + term.t_ncol = atoi(cp); + /* Get real size from screen driver */ +#ifdef TIOCGWINSZ + { + struct winsize w; + if (ioctl(2, TIOCGWINSZ, &w) == 0) + { + if (w.ws_row > 0) + term.t_nrow = w.ws_row - 1; + if (w.ws_col > 0) + term.t_ncol = w.ws_col; + } + } +#else +#ifdef WIOCGETD + { + struct uwdata w; + if (ioctl(2, WIOCGETD, &w) == 0) + { + if (w.uw_height > 0) + term.t_nrow = (w.uw_height / w.uw_vs) - 1; + if (w.uw_width > 0) + term.t_ncol = w.uw_width / w.uw_hs; + } + } +#endif +#endif + + if (term.t_nrow < 3 || term.t_ncol < 3) { + puts("Screen size is too small!"); + exit(1); + } + + /* initialize max number of rows and cols */ + term.t_mrow = term.t_nrow; + term.t_mcol = term.t_ncol; + + /* Start grabbing termcap commands */ + cp = tcapbuf; + + /* Get the reset string */ + reset = TGETSTR("is", &cp); + + /* Get the pad character */ + if (tgetstr("pc", &cp)) + PC = tcapbuf[0]; + + /* Get up line capability */ + UP = TGETSTR("up", &cp); + + /* Get other capabilities */ + cb = capbind; + while (cb < &capbind[sizeof(capbind)/sizeof(*capbind)]) { + cb->store = TGETSTR(cb->name, &cp); + cb++; + } + + /* Check for minimum */ + if (!capbind[CAP_CL].store && (!capbind[CAP_CM].store || !UP)) { + puts("This terminal doesn't have enough power to run microEmacs!"); + exit(1); + } + + /* Set reverse video and erase to end of line */ + if (capbind[CAP_SO].store && capbind[CAP_SE].store) + revexist = TRUE; + if (!capbind[CAP_CE].store) + eolexist = FALSE; + + /* Get keybindings */ + kp = keybind; + while (kp < &keybind[sizeof(keybind)/sizeof(*keybind)]) { + addkey(TGETSTR(kp->name, &cp), kp->value); + kp++; + } +#if LINUX + //* numeric keypad without caps lock */ + addkey("\x1bOo", '/'); + addkey("\x1bOj", '*'); + addkey("\x1bOm", '-'); + addkey("\x1bOk", '+'); + addkey("\x1bOM", '\n'); + addkey("\x1b[1;5A", CTLX|CTRL|'P'); // move-window-up + addkey("\x1b[1;5B", CTLX|CTRL|'N'); // move-window-down + addkey("\x1b[1;5C", META|'F'); // forward-word + addkey("\x1b[1;5D", META|'B'); // backward-word + addkey("\x1b[1;5F", META|'>'); // end-of-file + addkey("\x1b[1;5H", META|'<'); // beginning-of-file + addkey("\x1b[3;5~", META|CTRL|'Y'); // delete-kill-ring + addkey("\x1b[5;5~", META|CTRL|'Z'); // scroll-next-up + addkey("\x1b[6;5~", META|CTRL|'V'); // scroll-next-down +#endif + /* check for HP-Terminal (so we can label its function keys) */ + hpterm = tgetflag("xs"); + + /* Open terminal device */ + if (ttopen()) { + puts("Cannot open terminal"); + exit(1); + } + + /* Set speed for padding sequences */ +#if (BSD && !TERMIOS) + ospeed = cursgtty.sg_ospeed; +#endif /* (BSD && !TERMIOS) */ +#if USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || (SUN && !TERMIOS) || XENIX + ospeed = curterm.c_cflag & CBAUD; +#endif /* USG || AIX || AUX || SMOS || HPUX8 || HPUX9 || (SUN && !TERMIOS) || XENIX */ +#if (AVVION || TERMIOS) + ospeed = cfgetospeed(&curterm); +#endif /* (AVVION || TERMIOS) */ + + /* Send out initialization sequences */ +#if AIX == 0 + putpad(capbind[CAP_IS].store); +#endif + putpad(capbind[CAP_KS].store); + sckopen(); +/* + if (capbind[CAP_MD].store) + putpad(capbind[CAP_MD].store); +*/ + /* Success */ + return(0); +} + +/** Close screen package **/ +int scclose() +{ + /* Turn off keypad mode */ + putpad(capbind[CAP_KE].store); + sckclose(); + /* Close terminal device */ + ttflush(); + ttclose(); + /* Success */ + return(0); +} + +/* open keyboard -hm */ +int sckopen() +{ + putpad(capbind[CAP_KS].store); + ttflush(); +#if FLABEL + dis_ufk(); +#endif + return(TRUE); +} + +/* close keyboard -hm */ +int sckclose() +{ + putpad(capbind[CAP_KE].store); + ttflush(); +#if FLABEL + dis_sfk(); +#endif + return(TRUE); +} + +/** Move cursor **/ +int scmove(row, col) +int row; /* Row number */ +int col; /* Column number */ +{ + char *tgoto(); + + /* Call on termcap to create move sequence */ + putpad(tgoto(capbind[CAP_CM].store, col, row)); + /* Success */ + return(0); +} + +/** Erase to end of line **/ +int sceeol() +{ +#if COLOR +// scfcol(gfcolor); +// scbcol(gbcolor); +#endif /* COLOR */ + /* Send erase sequence */ + putpad(capbind[CAP_CE].store); + /* Success */ + return(0); +} + +/** Clear screen **/ +int sceeop() +{ +#if COLOR + scfcol(gfcolor); + scbcol(gbcolor); +#endif /* COLOR */ + /* Send clear sequence */ + putpad(capbind[CAP_CL].store); + /* Success */ + return(0); +} + +/** Set reverse video state **/ +int screv(state) +int state; /* New state */ +{ +#if COLOR + int ftmp, btmp; /* temporaries for colors */ +#endif /* COLOR */ + /* Set reverse video state */ + putpad(state ? capbind[CAP_SO].store : capbind[CAP_SE].store); +#if COLOR + if (state == FALSE) { + ftmp = cfcolor; + btmp = cbcolor; + cfcolor = -1; + cbcolor = -1; + scfcol(ftmp); + scbcol(btmp); + } +#endif /* COLOR */ + /* Success */ + return(0); +} + +/** Beep **/ +int scbeep() +{ +#if !NOISY + /* Send out visible bell, if it exists */ + if (capbind[CAP_VB].store) + putpad(capbind[CAP_VB].store); + else +#endif /* not NOISY */ + /* The old standby method */ + ttputc('\7'); + /* Success */ + return(0); +} + +#if COLOR +static char cmap[8] = { 0, 4, 2, 6, 1, 5, 3, 7 }; + +/** Set foreground color **/ +int scfcol(color) +int color; /* Color to set */ +{ + /* Skip if already the correct color */ + if (color == cfcolor) + return(0); + + /* Send out color sequence */ + if (capbind[CAP_C0].store) { + putpad(capbind[CAP_C0 + (color & 7)].store); + cfcolor = color; + } +#if USG || AUX + else if (capbind[CAP_SF].store) { +#ifdef SCO + char s[20]; + sprintf(s, capbind[CAP_SF].store, color & 7); + putpad(s); +#else /* SCO */ + putpad(tparm(capbind[CAP_SF].store, cmap[color & 7])); +#endif /* SCO */ + cfcolor = color; + } +#endif /* USG || AUX */ + return(0); +} + +/** Set background color **/ +int scbcol(color) +int color; /* Color to set */ +{ + /* Skip if already the correct color */ + if (color == cbcolor) + return(0); + + /* Send out color sequence */ + if (capbind[CAP_C0].store) { + putpad(capbind[CAP_D0 + (color & 7)].store); + cbcolor = color; + } +#if USG || AUX + else if (capbind[CAP_SB].store) { +#ifdef SCO + char s[20]; + sprintf(s, capbind[CAP_SB].store, color & 7); + putpad(s); +#else /* SCO */ + putpad(tparm(capbind[CAP_SB].store, cmap[color & 7])); +#endif /* SCO */ + cbcolor = color; + } +#endif /* USG || AUX */ + return(0); +} +#endif /* COLOR */ + +/** Set palette **/ +int spal(cmd) +char * cmd; /* Palette command */ +{ + int code, dokeymap; + char * cp; + + /* Check for keymapping command */ + if (strncmp(cmd, "KEYMAP ", 7) == 0) + dokeymap = 1; + else +#if COLOR + if (strncmp(cmd, "CLRMAP ", 7) == 0) + dokeymap = 0; + else +#endif /* COLOR */ + return(0); + cmd += 7; + + /* Look for space */ + for (cp = cmd; *cp != '\0'; cp++) + if (*cp == ' ') { + *cp++ = '\0'; + break; + } + if (*cp == '\0') + return(1); + + /* Perform operation */ + if (dokeymap) { + + /* Convert to keycode */ + code = stock((unsigned char*) cmd); + + /* Add to tree */ + addkey(cp, code); + } +#if COLOR + else { + + /* Convert to color number */ + code = atoi(cmd); + if (code < 0 || code > 15) + return(1); + + /* Move color code to capability structure */ + capbind[CAP_C0 + code].store = malloc(strlen(cp) + 1); + if (capbind[CAP_C0 + code].store) + strcpy(capbind[CAP_C0 + code].store, cp); + } +#endif /* COLOR */ + return(0); +} + +#if HANDLE_WINCH +/* + * Window size changes handled via signals. + */ +void winch_changed(int status) +{ + signal(SIGWINCH,winch_changed); + winch_flag = 1; +} + +void winch_new_size() +{ + struct winsize win; + + winch_flag = 0; + ioctl(fileno(stdin),TIOCGWINSZ,&win); + winch_vtresize(win.ws_row,win.ws_col); + onlywind(0,0); + TTmove(0,0); + TTeeop(); +} + +#endif /* HANDLE_WINCH */ + +#endif /* TERMCAP */ diff --git a/src/word.c b/src/word.c index 552e529..61629a4 100644 --- a/src/word.c +++ b/src/word.c @@ -1,7 +1,9 @@ /* * The routines in this file implement commands that work word or a * paragraph at a time. There are all sorts of word mode commands. If I - * do any sentence mode commands, they are likely to be put in this file. + * do any sentence mode commands, they are likely to be put in this file. + * + * Unicode support by Jean-Michel Dubois */ #include @@ -18,11 +20,11 @@ * left edge of the current window * Returns TRUE on success, FALSE on errors. */ -PASCAL NEAR wrapword(f, n) +int wrapword(f, n) int f; /* default flag */ int n; /* numeric argument */ - + { register int cnt; /* size of word wrapped to next line */ register int c; /* charector temporary */ @@ -74,7 +76,7 @@ int n; /* numeric argument */ * performed by the "backchar" and "forwchar" routines. Error if you try to * move beyond the buffers. */ -PASCAL NEAR backword(f, n) +int backword(f, n) int f,n; /* prefix flag and argument */ @@ -100,7 +102,7 @@ int f,n; /* prefix flag and argument */ * Move the cursor forward by the specified number of words. All of the motion * is done by "forwchar". Error if you try and move beyond the buffer's end. */ -PASCAL NEAR forwword(f, n) +int forwword(f, n) int f,n; /* prefix flag and argument */ @@ -127,7 +129,7 @@ int f,n; /* prefix flag and argument */ * Move forward to the end of the nth next word. Error if you move past * the end of the buffer. */ -PASCAL NEAR endword(f, n) +int endword(f, n) int f,n; /* prefix flag and argument */ @@ -155,13 +157,16 @@ int f,n; /* prefix flag and argument */ * convert any characters to upper case. Error if you try and move beyond the * end of the buffer. Bound to "M-U". */ -PASCAL NEAR upperword(f, n) +int upperword(f, n) int f,n; /* prefix flag and argument */ { +#if UTF8 + unsigned int c; +#else int c; - +#endif if (curbp->b_mode&MDVIEW) /* don't allow this command if */ return(rdonly()); /* we are in read only mode */ if (n < 0) @@ -173,6 +178,33 @@ int f,n; /* prefix flag and argument */ } while (inword() != FALSE) { c = lgetc(curwp->w_dotp, curwp->w_doto); +#if UTF8 +#if THEOX + if ((c & 0x80) && (curbp->b_mode & MDTHEOX)) { + if (_b_islower(c)) { + c = _b_theox2wchar(_b_toupper(c)); + + if (lowrite(c) == FALSE) + return (FALSE); + + continue; + } + } else +#endif + if (is_multibyte_utf8(c)) { + if (utf8_to_unicode(curwp->w_dotp->l_text, curwp->w_doto, lused(curwp->w_dotp), &c) > 1 && iswlower(c)) { +#if WINXP + c = CharUpperW(c); +#else + c = ToWUpper(c); +#endif + if (lowrite(c) == FALSE) + return (FALSE); + + continue; + } + } else +#endif if (is_lower(c)) { obj.obj_char = c; c = upperc(c); @@ -192,13 +224,16 @@ int f,n; /* prefix flag and argument */ * convert characters to lower case. Error if you try and move over the end of * the buffer. Bound to "M-L". */ -PASCAL NEAR lowerword(f, n) +int lowerword(f, n) int f,n; /* prefix flag and argument */ { +#if UTF8 + unsigned int c; +#else int c; - +#endif if (curbp->b_mode&MDVIEW) /* don't allow this command if */ return(rdonly()); /* we are in read only mode */ if (n < 0) @@ -210,6 +245,30 @@ int f,n; /* prefix flag and argument */ } while (inword() != FALSE) { c = lgetc(curwp->w_dotp, curwp->w_doto); +#if UTF8 +#if THEOX + if ((c & 0x80) && (curbp->b_mode & MDTHEOX)) { + if (_b_isupper(c)) { + c = _b_theox2wchar(_b_tolower(c)); + + if (lowrite(c) == FALSE) + return (FALSE); + + continue; + } + } else +#endif + if (is_multibyte_utf8(c)) { + if (utf8_to_unicode(curwp->w_dotp->l_text, curwp->w_doto, lused(curwp->w_dotp), &c) > 1 && iswupper(c)) { + c = ToWLower(c); + + if (lowrite(c) == FALSE) + return (FALSE); + + continue; + } + } else +#endif if (is_upper(c)) { obj.obj_char = c; c = lowerc(c); @@ -230,13 +289,16 @@ int f,n; /* prefix flag and argument */ * characters to lower case. Error if you try and move past the end of the * buffer. Bound to "M-C". */ -PASCAL NEAR capword(f, n) +int capword(f, n) int f,n; /* prefix flag and argument */ { +#if UTF8 + unsigned int c; +#else int c; - +#endif if (curbp->b_mode&MDVIEW) /* don't allow this command if */ return(rdonly()); /* we are in read only mode */ if (n < 0) @@ -248,19 +310,68 @@ int f,n; /* prefix flag and argument */ } if (inword() != FALSE) { c = lgetc(curwp->w_dotp, curwp->w_doto); +#if UTF8 +#if THEOX + if ((c & 0x80) && (curbp->b_mode & MDTHEOX)) { + if (_b_islower(c)) { + c = _b_theox2wchar(_b_toupper(c)); + + if (lowrite(c) == FALSE) + return (FALSE); + else if (forwchar(FALSE, 1) == FALSE) + return(FALSE); + } + } else +#endif + if (is_multibyte_utf8(c)) { + if (utf8_to_unicode(curwp->w_dotp->l_text, curwp->w_doto, lused(curwp->w_dotp), &c) > 1 && iswlower(c)) { + c = ToWUpper(c); + + if (lowrite(c) == FALSE) + return (FALSE); + else if (forwchar(FALSE, 1) == FALSE) + return(FALSE); + } else if (forwchar(FALSE, 1) == FALSE) + return(FALSE); + } else +#endif if (is_lower(c)) { - obj.obj_char = c; c = upperc(c); lputc(curwp->w_dotp, curwp->w_doto, c); undo_insert(OP_REPC, 1L, obj); lchange(WFHARD); - } - if (forwchar(FALSE, 1) == FALSE) + + if (forwchar(FALSE, 1) == FALSE) + return(FALSE); + } else if (forwchar(FALSE, 1) == FALSE) return(FALSE); while (inword() != FALSE) { c = lgetc(curwp->w_dotp, curwp->w_doto); +#if UTF8 +#if THEOX + if ((c & 0x80) && (curbp->b_mode & MDTHEOX)) { + if (_b_isupper(c)) { + c = _b_theox2wchar(_b_tolower(c)); + + if (lowrite(c) == FALSE) + return (FALSE); + + continue; + } + } else +#endif + if (is_multibyte_utf8(c)) { + if (utf8_to_unicode(curwp->w_dotp->l_text, curwp->w_doto, lused(curwp->w_dotp), &c) > 1 && iswupper(c)) { + c = ToWLower(c); + + if (lowrite(c) == FALSE) + return (FALSE); + + continue; + } + } else +#endif if (is_upper(c)) { - obj.obj_char = c; c = lowerc(c); lputc(curwp->w_dotp, curwp->w_doto, c); undo_insert(OP_REPC, 1L, obj); @@ -280,7 +391,7 @@ int f,n; /* prefix flag and argument */ * command for the right number of characters. With a zero argument, just * kill one word and no whitespace. Bound to "M-D". */ -PASCAL NEAR delfword(f, n) +int delfword(f, n) int f,n; /* prefix flag and argument */ @@ -327,21 +438,21 @@ int f,n; /* prefix flag and argument */ } else { /* skip n words.... */ while (n--) { - + /* if we are at EOL; skip to the beginning of the next */ while (curwp->w_doto == lused(curwp->w_dotp)) { if (forwchar(FALSE, 1) == FALSE) return(FALSE); ++size; } - + /* move forward till we are at the end of the word */ while (inword() == TRUE) { if (forwchar(FALSE, 1) == FALSE) return(FALSE); ++size; } - + /* if there are more words, skip the interword stuff */ if (n != 0) while (inword() == FALSE) { @@ -350,7 +461,7 @@ int f,n; /* prefix flag and argument */ ++size; } } - + /* skip whitespace and newlines */ while ((curwp->w_doto == lused(curwp->w_dotp)) || ((c = lgetc(curwp->w_dotp, curwp->w_doto)) == ' ') || @@ -364,7 +475,11 @@ int f,n; /* prefix flag and argument */ /* restore the original position and delete the words */ curwp->w_dotp = dotp; curwp->w_doto = doto; +#if UTF8 + return(ldelchar(size, TRUE)); +#else return(ldelete(size, TRUE)); +#endif } /* @@ -372,7 +487,7 @@ int f,n; /* prefix flag and argument */ * counting the characters. When dot is finally moved to its resting place, * fire off the kill command. Bound to "M-Rubout" and to "M-Backspace". */ -PASCAL NEAR delbword(f, n) +int delbword(f, n) int f,n; /* prefix flag and argument */ @@ -415,7 +530,11 @@ int f,n; /* prefix flag and argument */ return(FALSE); bckdel: if (forwchar(FALSE, size) == FALSE) return(FALSE); +#if UTF8 + return(ldelchar(-size, TRUE)); +#else return(ldelete(-size, TRUE)); +#endif } /* @@ -424,18 +543,55 @@ bckdel: if (forwchar(FALSE, size) == FALSE) * has been set by the user, use that instead */ -int PASCAL NEAR inword() +int inword() { +#if UTF8 + LINE* lp = curwp->w_dotp; + short pos = curwp->w_doto; + + /* the end of a line is never in a word */ + if (pos == lused(lp)) + return(FALSE); + + /* grab the word to check */ + char c = lgetc(lp, pos); + + if (is_multibyte_utf8(c)) { /* Is it a UTF-8 multi byte character ? */ + /* Yes, convert it to a wide character */ + unsigned int wc; + utf8_to_unicode(lp->l_text, pos, lused(lp), &wc); + return iswalpha(wc); + } + + return(isinword(c)); +#else /* the end of a line is never in a word */ if (curwp->w_doto == lused(curwp->w_dotp)) return(FALSE); /* grab the word to check */ return(isinword(lgetc(curwp->w_dotp, curwp->w_doto))); +#endif +} + +#if UTF8 + +int isinword(unsigned int c) +{ + /* if we are using the table.... */ + if (wlflag) + return(wordlist[(int) (char) c]); + /* else use the default hard coded check */ + if (iswalnum(c) || c == '_') + return(TRUE); + + return(FALSE); } -int PASCAL NEAR isinword(c) +#else + +int isinword(c) char c; @@ -454,7 +610,9 @@ char c; return(FALSE); } -PASCAL NEAR fillpara(f, n) /* Fill the current paragraph according to the +#endif + +int fillpara(f, n) /* Fill the current paragraph according to the current fill column */ int f, n; /* Default flag and Numeric argument */ @@ -552,7 +710,7 @@ int f, n; /* Default flag and Numeric argument */ return(status); } -VOID PASCAL NEAR reform(para) /* reformat a paragraph as stored in a string */ +VOID reform(para) /* reformat a paragraph as stored in a string */ char *para; /* string buffer containing paragraph */ @@ -575,7 +733,7 @@ char *para; /* string buffer containing paragraph */ /* break on whitespace? */ if (col > fillcol) { - *sp = '\r'; + *sp = RET_CHAR; col = 0; } @@ -590,8 +748,8 @@ char *para; /* string buffer containing paragraph */ if (col > fillcol) { /* line break here! */ if ((lastword > para) && - (*(lastword - 1) != '\r')) { - *(lastword - 1) = '\r'; + (*(lastword - 1) != RET_CHAR)) { + *(lastword - 1) = RET_CHAR; sp = lastword; col = 0; } @@ -600,7 +758,7 @@ char *para; /* string buffer containing paragraph */ } } -PASCAL NEAR killpara(f, n) /* delete n paragraphs starting with the current one */ +int killpara(f, n) /* delete n paragraphs starting with the current one */ int f; /* default flag */ int n; /* # of paras to delete */ @@ -620,7 +778,7 @@ int n; /* # of paras to delete */ /* go to the beginning of the paragraph */ gotobop(FALSE, 1); curwp->w_doto = 0; /* force us to the beginning of line */ - + /* and delete it */ if ((status = killregion(FALSE, 1)) != TRUE) return(status); @@ -635,7 +793,7 @@ int n; /* # of paras to delete */ along with average word sizes, # of chars, etc, and report on them. */ -PASCAL NEAR wordcount(f, n) +int wordcount(f, n) int f, n; /* ignored numeric arguments */ @@ -669,7 +827,7 @@ int f, n; /* ignored numeric arguments */ /* get the current character */ if (offset == lused(lp)) { /* end of line */ - ch = '\r'; + ch = RET_CHAR; lp = lforw(lp); offset = 0; ++nlines; @@ -680,7 +838,11 @@ int f, n; /* ignored numeric arguments */ /* and tabulate it */ wordflag = (is_letter(ch) || - (ch >= '0' && ch <= '9')); + (ch >= '0' && ch <= '9') +#if LIBHELP + || ch == '_' +#endif + ); if (wordflag == TRUE && lastword == FALSE) ++nwords; lastword = wordflag; diff --git a/src/xpconio.c b/src/xpconio.c index b8dfa2b..35ebb5d 100644 --- a/src/xpconio.c +++ b/src/xpconio.c @@ -3,6 +3,8 @@ * for MicroEMACS 5.00 * (C)Copyright 2008 by Daniel M. Lawrence * + * Unicode support by Jean-Michel Dubois + * * The routines in this file provide video and keyboard support using the * Windows XP/Visual Studio 2008 console functions. * @@ -31,26 +33,26 @@ /* Forward references. */ -PASCAL NEAR ntmove(); -PASCAL NEAR nteeol(); -PASCAL NEAR nteeop(); -PASCAL NEAR ntbeep(); -PASCAL NEAR ntopen(); -PASCAL NEAR ntclose(); -PASCAL NEAR ntgetc(); -PASCAL NEAR ntputc(); -PASCAL NEAR ntflush(); -PASCAL NEAR ntrev(); -PASCAL NEAR ntkclose(); -PASCAL NEAR ntkopen(); -PASCAL NEAR ntcres(); -PASCAL NEAR ntparm(); +ntmove(); +nteeol(); +nteeop(); +ntbeep(); +ntopen(); +ntclose(); +ntgetc(); +ntputc(); +ntflush(); +ntrev(); +ntkclose(); +ntkopen(); +ntcres(); +ntparm(); #if COLOR -PASCAL NEAR ntfcol(); -PASCAL NEAR ntbcol(); +ntfcol(); +ntbcol(); #endif -PASCAL NEAR fnclabel(); -static WORD NEAR ntAttribute(void); +fnclabel(); +static WORD ntAttribute(void); /* Screen buffer to write to. */ static CHAR_INFO ciScreenBuffer[NROW * NCOL]; @@ -123,8 +125,11 @@ static int oldrow; /* previous y position of mouse */ /* input buffers and pointers */ #define IBUFSIZE 64 /* this must be a power of 2 */ - +#if UTF8 +unsigned int in_buf[IBUFSIZE]; /* input character buffer */ +#else unsigned char in_buf[IBUFSIZE]; /* input character buffer */ +#endif int in_next = 0; /* pos to retrieve next input character */ int in_last = 0; /* pos to place most recent input character */ @@ -168,7 +173,7 @@ int in_get() /* get an event from the input buffer */ /* Set the current foreground color. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR ntfcol( +ntfcol( int color) /* color to set */ { cfcolor = ctrans[color]; @@ -179,14 +184,14 @@ PASCAL NEAR ntfcol( /* Set the current background color. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR ntbcol( +ntbcol( int color) /* color to set */ { cbcolor = ctrans[color]; } #endif -static void near ntSetUpdateValues(void) +static void ntSetUpdateValues(void) { if (ntrow < ntMin) ntMin = ntrow; @@ -205,7 +210,7 @@ static void near ntSetUpdateValues(void) /* Move the cursor. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR ntmove( +ntmove( int row, int col) { @@ -222,7 +227,7 @@ PASCAL NEAR ntmove( /* Update the physical video buffer from the logical video buffer. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR ntflush(void) +ntflush(void) { SMALL_RECT srWriteRegion; COORD coordUpdateBegin, coordBufferSize; @@ -260,7 +265,7 @@ PASCAL NEAR ntflush(void) return(TRUE); } -static void near MouseEvent(void) +static void MouseEvent(void) { register int k; /* current bit/button of mouse */ @@ -292,13 +297,13 @@ static void near MouseEvent(void) #endif /* get the shift key status as well */ - etype = MOUS >> 8; + etype = MOUS >> SHIFTPFX; sstate = m_event->dwControlKeyState; if (sstate & SHIFT_PRESSED) /* shifted? */ - etype |= (SHFT >> 8); + etype |= (SHFT >> SHIFTPFX); if ((sstate & RIGHT_CTRL_PRESSED) || (sstate & LEFT_CTRL_PRESSED)) /* controled? */ - etype |= (CTRL >> 8); + etype |= (CTRL >> SHIFTPFX); /* no buttons changes */ if (oldbut == newbut) { @@ -343,14 +348,14 @@ static void near MouseEvent(void) return(FALSE); } -static void near WindowSizeEvent(void) +static void WindowSizeEvent(void) { CONSOLE_SCREEN_BUFFER_INFO Console; GetConsoleScreenBufferInfo(hOutput, &Console); in_put(0); - in_put(MOUS >> 8); + in_put(MOUS >> SHIFTPFX); in_put(Console.srWindow.Right+1); in_put(Console.srWindow.Bottom); in_put('2'); @@ -362,7 +367,7 @@ static void near WindowSizeEvent(void) /* handle the current keyboard event */ -static void near KeyboardEvent() +static void KeyboardEvent() { int c; /* ascii character to examine */ @@ -375,7 +380,11 @@ static void near KeyboardEvent() return(FALSE); /* If this is an extended character, process it */ +#if UTF8 + c = ir.Event.KeyEvent.uChar.UnicodeChar; +#else c = ir.Event.KeyEvent.uChar.AsciiChar; +#endif state = ir.Event.KeyEvent.dwControlKeyState; prefix = 0; @@ -476,7 +485,7 @@ static void near KeyboardEvent() /* if there is a prefix, insert it in the input stream */ if (prefix != 0) { in_put(0); - in_put(prefix >> 8); + in_put(prefix >> SHIFTPFX); } /* place the ascii character in the input queue */ @@ -503,7 +512,7 @@ int PendingScreenResize() /* Get a character from the keyboard. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR ntgetc() +ntgetc() { long dw; @@ -557,7 +566,7 @@ ttc: ntflush(); /* Returns true if a key has been pressed. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR typahead() +typahead() { /* anything waiting in the input queue? */ @@ -568,7 +577,7 @@ PASCAL NEAR typahead() } #endif -static WORD near ntAttribute(void) +static WORD ntAttribute(void) { return(revflag ? (cbcolor | (cfcolor << 4)) : ((cbcolor << 4) | cfcolor)); } @@ -585,7 +594,7 @@ static WORD near ntAttribute(void) /* a problem. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR ntputc(int c) +ntputc(int c) { WORD wScreenPos; @@ -607,7 +616,11 @@ PASCAL NEAR ntputc(int c) } wScreenPos = (ntrow * term.t_ncol) + ntcol++; +#if UTF8 + ciScreenBuffer[wScreenPos].Char.UnicodeChar = c; +#else ciScreenBuffer[wScreenPos].Char.AsciiChar = c; +#endif ciScreenBuffer[wScreenPos].Attributes = ntAttribute(); ntSetUpdateValues(); } @@ -618,7 +631,7 @@ PASCAL NEAR ntputc(int c) /* Erase to end of line. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR nteeol() +nteeol() { WORD wNum; WORD wScreenPos; @@ -632,7 +645,11 @@ PASCAL NEAR nteeol() wScreenPos = ntrow * term.t_ncol + ntcol; wAttribute = ntAttribute(); for (; wNum; wNum--) { +#if UTF8 + ciScreenBuffer[wScreenPos].Char.UnicodeChar = ' '; +#else ciScreenBuffer[wScreenPos].Char.AsciiChar = ' '; +#endif ciScreenBuffer[wScreenPos].Attributes = wAttribute; wScreenPos++, ntcol++; } @@ -645,7 +662,7 @@ PASCAL NEAR nteeol() /* Erase to end of page. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR nteeop() +nteeop() { WORD wNum; WORD wScreenPos; @@ -660,7 +677,11 @@ PASCAL NEAR nteeop() wScreenPos = ntrow * term.t_ncol + ntcol; wAttribute = ntAttribute(); for (; wNum; wNum--) { +#if UTF8 + ciScreenBuffer[wScreenPos].Char.UnicodeChar = ' '; +#else ciScreenBuffer[wScreenPos].Char.AsciiChar = ' '; +#endif ciScreenBuffer[wScreenPos].Attributes = wAttribute; wScreenPos++, ntcol++; } @@ -672,7 +693,7 @@ PASCAL NEAR nteeop() /* Change reverse video state. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR ntrev(state) +ntrev(state) int state; /* TRUE = reverse, FALSE = normal */ @@ -685,7 +706,7 @@ int state; /* TRUE = reverse, FALSE = normal */ /* Change the screen resolution. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR ntcres(char *res) /* name of desired video mode */ +ntcres(char *res) /* name of desired video mode */ { return TRUE; } @@ -696,7 +717,7 @@ PASCAL NEAR ntcres(char *res) /* name of desired video mode */ /* Change pallette settings. (Does nothing.) */ /*----------------------------------------------------------------------*/ -PASCAL NEAR spal(char *dummy) +spal(char *dummy) { return(TRUE); } @@ -706,7 +727,7 @@ PASCAL NEAR spal(char *dummy) /* ntbeep() */ /*----------------------------------------------------------------------*/ -PASCAL NEAR ntbeep() +ntbeep() { Beep(750, 300); return(TRUE); @@ -716,7 +737,7 @@ PASCAL NEAR ntbeep() /* ntopen() */ /*----------------------------------------------------------------------*/ -PASCAL NEAR ntopen() +ntopen() { CONSOLE_SCREEN_BUFFER_INFO Console; @@ -785,7 +806,7 @@ PASCAL NEAR ntopen() /* Restore the original video settings. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR ntclose() +ntclose() { /* reset the title on the window */ SetConsoleTitleA(chConsoleTitle); @@ -799,7 +820,7 @@ PASCAL NEAR ntclose() /* Open the keyboard. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR ntkopen() +ntkopen() { /* save the original console mode to restore on exit */ GetConsoleMode(hInput, &OldConsoleMode); @@ -820,7 +841,7 @@ PASCAL NEAR ntkopen() /* Close the keyboard. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR ntkclose() +ntkclose() { /* restore the console mode from entry */ SetConsoleMode(hInput, OldConsoleMode); @@ -828,7 +849,7 @@ PASCAL NEAR ntkclose() } #if FLABEL -PASCAL NEAR fnclabel(f, n) /* label a function key */ +fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument [unused] */ From 315153110d41b81203788a0a70743a59d445ea67 Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 3 Sep 2020 13:18:57 +0200 Subject: [PATCH 08/37] Backup, help and over extensions --- src/buffer.c | 60 +++++-- src/libhelp.c | 467 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/message.c | 449 ++++++++++++++++++++++++++++++++++++++++++++++++ src/window.c | 327 ++++++++++++++++++++++++----------- 4 files changed, 1185 insertions(+), 118 deletions(-) create mode 100644 src/libhelp.c create mode 100644 src/message.c diff --git a/src/buffer.c b/src/buffer.c index 072f84a..5860719 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -19,7 +19,7 @@ * if the use count is 0. Otherwise, they come * from some other window. */ -PASCAL NEAR usebuffer(f, n) +int usebuffer(f, n) int f,n; /* prefix flag and argument */ @@ -41,7 +41,7 @@ int f,n; /* prefix flag and argument */ return(swbuffer(bp)); } -PASCAL NEAR nextbuffer(f, n) /* switch to the next buffer in the buffer list */ +int nextbuffer(f, n) /* switch to the next buffer in the buffer list */ int f, n; /* default flag, numeric argument */ { @@ -66,13 +66,13 @@ int f, n; /* default flag, numeric argument */ return(status); } -PASCAL NEAR swbuffer(bp) /* make buffer BP current */ +int swbuffer(bp) /* make buffer BP current */ BUFFER *bp; { register EWINDOW *wp; - SCREEN *scrp; /* screen to fix pointers in */ + ESCREEN *scrp; /* screen to fix pointers in */ register int cmark; /* current mark */ /* let a user macro get hold of things...if he wants */ @@ -95,8 +95,15 @@ BUFFER *bp; curbp = bp; /* Switch. */ bp->last_access = access_time; if (curbp->b_active != TRUE) { /* buffer not active yet*/ +#if THEOS + if (addlname(curbp->b_fname)) +#endif /* read it in and activate it */ readin(curbp->b_fname, ((curbp->b_mode&MDVIEW) == 0)); +#if THEOS + else + curbp->b_mode |= MDVIEW; +#endif curbp->b_dotp = lforw(curbp->b_linep); curbp->b_doto = 0; curbp->b_active = TRUE; @@ -151,7 +158,7 @@ BUFFER *bp; * if the buffer has been changed). Then free the header * line and the buffer header. Bound to "C-X K". */ -PASCAL NEAR killbuffer(f, n) +int killbuffer(f, n) int f,n; /* prefix flag and argument */ @@ -170,7 +177,7 @@ int f,n; /* prefix flag and argument */ /* Allow the user to pop up a buffer, like we do.... */ -PASCAL NEAR popbuffer(f, n) +int popbuffer(f, n) int f, n; /* default and numeric arguments */ @@ -191,7 +198,7 @@ int f, n; /* default and numeric arguments */ return(pop(bp)); } -BUFFER *PASCAL NEAR getdefb() /* get the default buffer for a use or kill */ +BUFFER *getdefb() /* get the default buffer for a use or kill */ { BUFFER *bp; /* default buffer */ @@ -211,11 +218,11 @@ BUFFER *PASCAL NEAR getdefb() /* get the default buffer for a use or kill */ bp = NULL; break; } - } + } return(bp); } -PASCAL NEAR zotbuf(bp) /* kill the buffer pointed to by bp */ +int zotbuf(bp) /* kill the buffer pointed to by bp */ register BUFFER *bp; @@ -271,7 +278,7 @@ register BUFFER *bp; return(TRUE); } -PASCAL NEAR namebuffer(f,n) /* Rename the current buffer */ +int namebuffer(f,n) /* Rename the current buffer */ int f, n; /* default Flag & Numeric arg */ @@ -306,7 +313,7 @@ ask: if (mlreply(TEXT29, bufn, NBUFN) != TRUE) invisible buffers as well. */ -PASCAL NEAR listbuffers(f, n) +int listbuffers(f, n) int f,n; /* prefix flag and argument */ @@ -327,7 +334,7 @@ int f,n; /* prefix flag and argument */ * is an error (if there is no memory). Iflag * indicates whether to list hidden buffers. */ -PASCAL NEAR makelist(iflag) +int makelist(iflag) int iflag; /* list hidden buffer flag */ @@ -348,7 +355,12 @@ int iflag; /* list hidden buffer flag */ strcpy(blistp->b_fname, ""); if (addline(blistp, TEXT30) == FALSE /* "ACTN Modes Size Buffer File" */ +#if JMDEXT +/* "ACTN Modes Size Buffer File" */ + || addline(blistp, "---- ------------ ------- --------------- ----") == FALSE) +#else || addline(blistp, "---- ----------- ------- --------------- ----") == FALSE) +#endif return(FALSE); bp = bheadp; /* For all buffers */ @@ -461,7 +473,7 @@ int iflag; /* list hidden buffer flag */ /* Translate a long to ascii form. Don't trust various systems ltoa() routines.. they aren't consistant */ -VOID PASCAL NEAR flong_asc(buf, width, num) +VOID flong_asc(buf, width, num) char buf[]; int width; @@ -488,7 +500,7 @@ long num; * Return FALSE if no buffers * have been changed. */ -PASCAL NEAR anycb() +int anycb() { register BUFFER *bp; @@ -508,9 +520,9 @@ PASCAL NEAR anycb() * and the "cflag" is TRUE, create it. The "bflag" is * the settings for the flags in in buffer. */ -BUFFER *PASCAL NEAR bfind(bname, cflag, bflag) +BUFFER *bfind(bname, cflag, bflag) -register char *bname; /* name of buffer to find */ +CONST register char *bname; /* name of buffer to find */ int cflag; /* create it if not found? */ int bflag; /* bit settings for a new buffer */ @@ -598,7 +610,7 @@ int bflag; /* bit settings for a new buffer */ * that are required. Return TRUE if everything * looks good. */ -PASCAL NEAR bclear(bp) +int bclear(bp) register BUFFER *bp; { register LINE *lp; @@ -624,7 +636,7 @@ register BUFFER *bp; return(TRUE); } -PASCAL NEAR unmark(f, n) /* unmark the current buffers change flag */ +int unmark(f, n) /* unmark the current buffers change flag */ int f, n; /* unused command arguments */ @@ -638,7 +650,7 @@ int f, n; /* unused command arguments */ return(TRUE); } -BUFFER *PASCAL NEAR getoldb() /* get the most ancient visited buffer */ +BUFFER *getoldb() /* get the most ancient visited buffer */ { BUFFER *bp; /* current buffer */ @@ -670,3 +682,13 @@ BUFFER *PASCAL NEAR getoldb() /* get the most ancient visited buffer */ return(old_bp); } +#if LIBHELP +int hidebuffer(int f, int n) /* set invisible buffer flag */ +{ + curbp->b_flag |= BFINVS; + curbp->b_flag &= ~BFCHG; + curbp->b_mode |= MDVIEW; + return(TRUE); +} +#endif + diff --git a/src/libhelp.c b/src/libhelp.c new file mode 100644 index 0000000..c335b18 --- /dev/null +++ b/src/libhelp.c @@ -0,0 +1,467 @@ +/* + * This is a library module for help file subject lookup. + * + * The functions that are available are: + * + * int looktopic(topic, output) char *topic; int (*output)(); + * Lookup the topic and call output with each line of it. + * Returns 1 if the topic could not be found, -1 if the + * file could not be accessed. + * + * int lookclose(); + * Close help files and clean up the rest of the world. + * + */ + +#include +#include "estruct.h" +#if LIBHELP +#include "eproto.h" +#include "edef.h" +#include "elang.h" + +#if MSDOS +#include +#include +#endif + +#if USG || THEOS || LINUX +#include +#endif + +#ifdef HELPSEP +#undef HELPSEP +#endif + +#define HELPSEP '@' /* marks a new help entry */ + +#define LOOK 0 /* d�tail */ +#define INDEX 1 /* sommaire */ + +extern NOSHARE CONST char *otherpath[]; + +static char *lookfile=0; /* Help file name ptr. */ +static char *lookindx=0; /* Help index file name ptr. */ +static FILE *lookfp; /* Our lookfile */ +static char *lookline; /* Our help buffer */ +static char hfname[NFILEN]; /* Help file name place */ +static char hiname[NFILEN]; /* Help index file name place */ +static char lookbuff[NFILEN]; + +/* + * Structure to speed lookup time. + */ +struct look { + long l_seek; + char *l_name; +}; + +struct look *lread(); + +void fastlook(); + +/* Open the help file "name" with access "acs" along the current libpath. + */ +FILE *hfopen(name, acs) +char *name; +char *acs; +{ + CONST char *fullname; + FILE *fp; + + fp = (FILE *) 0; + + if ((fullname = flook(name, FALSE)) == NULL) + return NULL; /* Can't get full name */ + fp = fopen(fullname, acs); /* Open the file. */ + return fp; /* return the file ptr */ +} + +/* + * Get the "stat" of the help file... + */ +int hstat(name, sb) +char *name; +struct stat *sb; +{ + CONST char *fullname; + register int s; + + if ((fullname = flook(name, FALSE)) == NULL) + return -1; /* could not get the name */ + + s = stat(fullname, sb); /* stat the file. */ + return s; +} + +void lookclose() +{ + if (lookfp != NULL) + fclose(lookfp); + if (lookline != NULL) + free(lookline); + lookfp = (FILE *) 0; + lookline = NULL; +} + +/* + * program interface to the help file. open file(s) as needed. + * subsequent calls will not need to search and open them + * again -- output function takes a string arg and does something + * with it. Non-zero return means no help found. + */ + +/* + * Lookup a command in the given file. + * The format is to look for HELPSEP (@) lines. + * The optional index-file is provided to speed up + * the lookup in situations where there is a very + * large system help file. + */ +int helplookup(com, fp, ind, output) +register char *com; +FILE *fp; +char *ind; +int (*output)(char *str); +{ + if (fp == NULL) + return (1); + fseek(fp, 0L, 0); + fastlook(com, fp, ind); + while (fgets(lookline, NLINE, fp) != NULL) + if (lookline[0] == HELPSEP) { + lookline[strlen(lookline)-1] = '\0'; + if (strcmp(com, lookline+1) == 0) { + while (fgets(lookline, NLINE, fp) != NULL) { + if (lookline[0] == HELPSEP) + break; + lookline[strlen(lookline)-1] = '\0'; + (*output)(lookline); + } + return (0); + } + } + return (1); +} + +/* + * Possibly seek the lookfile to the right place based on an index file. + * Return non-zero only when it is impossible to find it. + */ +void fastlook(com, fp, ind) +char *com; +FILE *fp; +char *ind; +{ + register struct look *lp; + FILE *ifp; + static struct stat sb; + long htime; + + fstat(fileno(fp), &sb); + htime = sb.st_mtime; + + if (ind == NULL) /* No index file? */ + return; + if (hstat(ind, &sb) < 0) /* not found ? */ + return; + + if (htime < sb.st_mtime) { + if ((ifp = hfopen(ind, "rb")) == NULL) + return; + while ((lp = lread(ifp)) != NULL) + if (strcmp(com, lp->l_name) == 0) { + fseek(fp, lp->l_seek, 0); + break; + } + fclose(ifp); + } + return; +} + +/* + * Read in a look structure. Return NULL + * on end of file or error. + */ +struct look *lread(fp) +register FILE *fp; +{ + register char *cp; + register int c; + static struct look look; + static char name[50]; + + look.l_name = name; + if (fread(&look.l_seek, sizeof look.l_seek, 1, fp) != 1) + return (NULL); + for (cp = name; cp<&name[49]; cp++) { + if ((c = getc(fp)) == EOF) + return (NULL); + if (!(*cp = c)) + break; + } + return (&look); +} + +/* Return 0 if s1 found in s2 */ +static int subcmp(s1, s2) +char *s1; +register char *s2; +{ + register char *st; + register char *se; + + st = s1; + for (;;) { + while (*st != *s2++) + if (! *s2) + return 1; + if (! *st++) + return 0; + se = s2; + while (*st++ == *se++) { + if (! *st) + return 0; + if (! *se) + return 1; + } + st = s1; + } +} + +int doindex(com, fp, output) +register char *com; +FILE *fp; +int (*output)(char *str); +{ + register int t = 0; + + if (fp == NULL) + return (1); + fseek(fp, 0L, 0); + while (fgets(lookline, NLINE, fp) != NULL) { + if (lookline[0] == HELPSEP) { + lookline[strlen(lookline)-1] = '\0'; + if (subcmp(com, lookline+1) == 0) { + if (fgets(lookline, NLINE, fp) == NULL) + return (t == 0); + lookline[strlen(lookline)-1] = '\0'; + (*output)(lookline); + t++; + } + } + } + return (t == 0); +} + +/* + * Make an index of help for a given topic. + * Non-zero return means no topics found. + */ + +int looktopic(topic, output, mode) +char *topic; +int (*output)(char *str); +int mode; +{ + if (lookfp == NULL) + if ((lookfp = hfopen(lookfile, "r")) == NULL) + return -1; + if (lookline == NULL) + if ((lookline = malloc(NLINE)) == NULL) + return -1; + if (mode == LOOK) + return(helplookup(topic, lookfp, lookindx, output)); + else + return(doindex(topic, lookfp, output)); +} + +/* + * Service routine for help... + */ +static void addhelp(str) +CONST char *str; +{ + if (! helpbp) + helpbp = bfind(TEXT294, TRUE, BFINVS|BFHELP); /* Help buffer */ + if (helpbp) + addline(helpbp, str); +} + +/* + * This routine rebuilds the text in the special secret buffer that holds + * the help. It is called by the lookwindow function. Return TRUE if + * everything works. Return FALSE if there is an error (if there is no memory + * or no help for the topic or file not found.) + */ +int makelook(tag, mode) +char *tag; +int mode; +{ + register int c; + + if ((c = bclear(helpbp)) != TRUE) /* Blow old text away */ + return (c); + if (mode == LOOK) + strcpy(helpbp->b_fname, tag); + else { + strcpy(helpbp->b_fname, TEXT293); + strcat(helpbp->b_fname, tag); + } + + + if ((c = looktopic(tag, addhelp, mode)) < 0) + mlwrite(TEXT292, lookfile); + else if (c > 0) + mlwrite(mode == LOOK ? TEXT290 : TEXT291, tag); + + return (c == 0); /* All done */ +} +/* + * Put up a help window with the text pointed to by txt (mode == LOOK) + * or + * Put up a help window with an index of matching topics (mode == INDEX) + */ + +int lookwindow(tag, mode) +char *tag; +int mode; +{ + register LINE *lp; + register int s; + register int numlines; + + if (mode == INDEX || curwp->w_bufp != helpbp) + savewnd(TRUE, 0); + + initlook(NULL); + + if ((s = makelook(tag, mode)) != TRUE) + return (s); + + lp = lforw(helpbp->b_linep); + + /* start counting lines */ + numlines = 0; + while (lp != helpbp->b_linep) { + ++numlines; + lp = lforw(lp); + } + + if (helpbp->b_nwnd == 0) { /* Not on screen yet. */ + if (wpopup(helpbp) == FALSE) + return (FALSE); + if (popflag) + return (TRUE); + } else { + while (helpbp->b_nwnd > 1) + zaphelp(0, 0); /* Delete windows */ + } + while (curwp->w_bufp != helpbp) + nextwind(FALSE, 1); + helpbp->b_flag |= BFINVS|BFHELP; + resize(TRUE, numlines); + if (mode == LOOK) + restwnd(TRUE, 0); + lookclose(); + return (TRUE); +} + +/* + * On GEMDOS and MSDOS, lookfiles specified on the command line + * are .HLP for the main help, and .IDX for the index file, + * if any. + */ + +VOID initlook(lf) +char *lf; +{ + extern char *getenv(); + + if (lookfile == NULL) { + if ((lookfile=lf)==NULL && (lookfile=getenv("HELP"))==NULL) { + lookfile = (char *) otherpath[1]; + lookindx = (char *) otherpath[2]; + } else { +#if ! THEOS + strcat(hfname, otherpath[3]); + lookfile = hfname; + strcat(hiname, otherpath[4]); + lookindx = hiname; +#else + strcpy(hfname, lookfile); + lookfile = strcat(hfname, otherpath[3]); + strcpy(hiname, hfname); + lookindx = strcat(hiname, otherpath[4]); +#endif + } + } +} + +int prompthelp(int mode) +{ + register int s; + + if ((s=mlreply(mode == LOOK ? TEXT288 : TEXT289, lookbuff, NFILEN)) != TRUE) + return s; + mlwrite(mode == LOOK ? TEXT286 : TEXT287, lookbuff); + return lookwindow(lookbuff, mode); +} + +int promptlook(int f, int n) +{ + return prompthelp(LOOK); +} + +int hlpindex(int f, int n) +{ + return prompthelp(INDEX); +} + +/* + * Lookup the current word. + * Error if you try and move past the end of the buffer. + * Bound to "M-M-". Count is passed to lookup routine. + */ +int lookupword(int f, int n) +{ + char topic[128]; + register char *cp; + struct LINE *dotp; + int doto; + + doto = curwp->w_doto; + dotp = curwp->w_dotp; + while (! inword()) + if (! backchar(FALSE, 1)) + break; + while (inword()) + if (! backchar(FALSE, 1)) + break; + while (! inword()) + if (! forwchar(FALSE, 1)) + break; + cp = topic; + while (inword()) { + *cp++ = lgetc(curwp->w_dotp, curwp->w_doto); + if (! forwchar(FALSE, 1)) + break; + } + *cp = '\0'; + + curwp->w_doto = doto; + curwp->w_dotp = dotp; + + if (topic == NULL || ! *topic) { + mlwrite(TEXT285); + return FALSE; + } + mlwrite(TEXT286, topic); + return lookwindow(topic, LOOK); +} + +#else +VOID hlphello() /* dummy function */ +{ +} +#endif /* LIBHELP */ diff --git a/src/message.c b/src/message.c new file mode 100644 index 0000000..dfb1fad --- /dev/null +++ b/src/message.c @@ -0,0 +1,449 @@ +#include "estruct.h" +#include "eproto.h" +#include "edef.h" + +#if DYNMSGS +#if WINDOW_MSWIN || WINDOW_MSWIN32 +#include +#endif + +#if THEOS +#include +#endif + +#include +#include + +extern NOSHARE CONST char *otherpath[]; + +static char *msg[339] = { + "english", + "[Starting new CLI]", /* TEXT1 */ + "[Cannot write filter file]", /* TEXT2 */ + "[Execution failed]", /* TEXT3 */ + "Shell variable TERM not defined!", /* TEXT4 */ + "Terminal type not 'vt100'!", /* TEXT5 */ + "\r\n\n[End]", /* TEXT6 */ + "Line to GOTO: ", /* TEXT7 */ + "[Aborted]", /* TEXT8 */ + "[Mark %d set]", /* TEXT9 */ + "[Mark %d removed]", /* TEXT10 */ + "No mark %d in this window", /* TEXT11 */ + "[Help file is not online]", /* TEXT12 */ + ": describe-key ", /* TEXT13 */ + "Not Bound", /* TEXT14 */ + ": bind-to-key ", /* TEXT15 */ + "[No such function]", /* TEXT16 */ + "Binding table FULL!", /* TEXT17 */ + ": unbind-key ", /* TEXT18 */ + "[Key not bound]", /* TEXT19 */ + "Apropos string: ", /* TEXT20 */ + "Binding list", /* TEXT21 */ + "Can not display binding list", /* TEXT22 */ + "[Building binding list]", /* TEXT23 */ + "Use buffer", /* TEXT24 */ + "Use buffer: ", /* TEXT25 */ + "Kill buffer", /* TEXT26 */ + "Pop buffer", /* TEXT27 */ + "Buffer is being displayed", /* TEXT28 */ + "Change buffer name to: ", /* TEXT29 */ +#if JMDEXT + "ACTN Modes Size Buffer File", /* TEXT30 */ +#else + "ACTN Modes Size Buffer File", /* TEXT30 */ +#endif + " Global Modes", /* TEXT31 */ + "Discard changes", /* TEXT32 */ + "Encryption String: ", /* TEXT33 */ + "File: ", /* TEXT34 */ + "another user", /* TEXT35 */ + "LOCK ERROR -- ", /* TEXT36 */ + "checking for existence of %s\n", /* TEXT37 */ + "making directory %s\n", /* TEXT38 */ + "creating %s\n", /* TEXT39 */ + "could not create lock file", /* TEXT40 */ + "pid is %ld\n", /* TEXT41 */ + "reading lock file %s\n", /* TEXT42 */ + "could not read lock file", /* TEXT43 */ + "pid in %s is %ld\n", /* TEXT44 */ + "signaling process %ld\n", /* TEXT45 */ + "process exists", /* TEXT46 */ + "kill was bad", /* TEXT47 */ + "kill was good; process exists", /* TEXT48 */ + "attempting to unlink %s\n", /* TEXT49 */ + "could not remove lock file", /* TEXT50 */ + "Variable to set: ", /* TEXT51 */ + "%%No such variable as '%s'", /* TEXT52 */ + "Value: ", /* TEXT53 */ + "[Macro aborted]", /* TEXT54 */ + "Variable to display: ", /* TEXT55 */ + "Variable list", /* TEXT56 */ + "Can not display variable list", /* TEXT57 */ + "[Building variable list]", /* TEXT58 */ + "", /* TEXT59 */ +#if THEOX + "Line %D/%D Col %d/%d Char %D/%D (%d%%) Unicode char = 0x%x %d, TheoX char = 0x%x %d", +#else + "Line %D/%D Col %d/%d Char %D/%D (%d%%) char = 0x%x %d",/* TEXT60 */ +#endif + "", /* TEXT61 */ + "Global mode to ", /* TEXT62 */ + "Mode to ", /* TEXT63 */ + "add: ", /* TEXT64 */ + "delete: ", /* TEXT65 */ + "No such mode!", /* TEXT66 */ + "Message to write: ", /* TEXT67 */ + "String to insert: ", /* TEXT68 */ + "String to overwrite: ", /* TEXT69 */ + "[region copied]", /* TEXT70 */ + "%%This buffer is already narrowed", /* TEXT71 */ + "%%Must narrow at least 1 full line", /* TEXT72 */ + "[Buffer is narrowed]", /* TEXT73 */ + "%%This buffer is not narrowed", /* TEXT74 */ + "[Buffer is widened]", /* TEXT75 */ + "No mark set in this window", /* TEXT76 */ + "Bug: lost mark", /* TEXT77 */ + "Search ", /* TEXT78 */ + "Not found ", /* TEXT79 */ + "No pattern set", /* TEXT80 */ + "Reverse search ", /* TEXT81 */ + "", /* TEXT82 */ + "", /* TEXT83 */ + "Replace ", /* TEXT84 */ + "Query replace ", /* TEXT85 */ + "with ", /* TEXT86 */ + "Replace '", /* TEXT87 */ + "' with '", /* TEXT88 */ + "Aborted!", /* TEXT89 */ + "(Y)es, (N)o, (!)Do rest, (U)ndo last, (^G)Abort, (.)Abort back, (?)Help: ", /* TEXT90 */ + "Empty string replaced, stopping.", /* TEXT91 */ + "%D substitutions", /* TEXT92 */ + "%%ERROR while deleting", /* TEXT93 */ + "%%Out of memory", /* TEXT94 */ + "%%mceq: what is %d?", /* TEXT95 */ + "%%No characters in character class", /* TEXT96 */ + "%%Character class not ended", /* TEXT97 */ + "No fill column set", /* TEXT98 */ + "[OUT OF MEMORY]", /* TEXT99 */ + "Words %D Chars %D Lines %d Avg chars/word %f", /* TEXT100 */ + "[Can not search and goto at the same time!]", /* TEXT101 */ + "[Bogus goto argument]", /* TEXT102 */ + "[Saving %s]", /* TEXT103 */ + "Modified buffers exist. Leave anyway", /* TEXT104 */ + "%%Macro already active", /* TEXT105 */ + "[Start macro]", /* TEXT106 */ + "%%Macro not active", /* TEXT107 */ + "[End macro]", /* TEXT108 */ + "[Key illegal in VIEW mode]", /* TEXT109 */ + "[That command is RESTRICTED]", /* TEXT110 */ + "No macro specified", /* TEXT111 */ + "Macro number out of range", /* TEXT112 */ + "Can not create macro", /* TEXT113 */ + "Procedure name: ", /* TEXT114 */ + "Execute procedure: ", /* TEXT115 */ + "No such procedure", /* TEXT116 */ + "Execute buffer: ", /* TEXT117 */ + "No such buffer", /* TEXT118 */ + "%%Out of memory during while scan", /* TEXT119 */ + "%%!BREAK outside of any !WHILE loop", /* TEXT120 */ + "%%!ENDWHILE with no preceding !WHILE", /* TEXT121 */ + "%%!WHILE with no matching !ENDWHILE", /* TEXT122 */ + "%%Out of Memory during macro execution", /* TEXT123 */ + "%%Unknown Directive", /* TEXT124 */ + "Out of memory while storing macro", /* TEXT125 */ + "%%Internal While loop error", /* TEXT126 */ + "%%No such label", /* TEXT127 */ + "(e)val exp, (c/x)ommand, (t)rack exp, (^G)abort, exec, stop debug", /* TEXT128 */ + "File to execute: ", /* TEXT129 */ + "Macro not defined", /* TEXT130 */ + "Read file", /* TEXT131 */ + "Insert file", /* TEXT132 */ + "Find file", /* TEXT133 */ + "View file", /* TEXT134 */ + "[Old buffer]", /* TEXT135 */ + "Buffer name: ", /* TEXT136 */ + "Cannot create buffer", /* TEXT137 */ + "[New file]", /* TEXT138 */ + "[Reading file]", /* TEXT139 */ + "Read ", /* TEXT140 */ + "I/O ERROR, ", /* TEXT141 */ + "OUT OF MEMORY, ", /* TEXT142 */ + " line", /* TEXT143 */ + "Write file: ", /* TEXT144 */ + "No file name", /* TEXT145 */ + "Truncated file..write it out", /* TEXT146 */ + "Narrowed Buffer..write it out", /* TEXT147 */ + "[Writing...]", /* TEXT148 */ + "[Wrote ", /* TEXT149 */ + ", saved as ", /* TEXT150 */ + "Name: ", /* TEXT151 */ + "[No such file]", /* TEXT152 */ + "[Inserting file]", /* TEXT153 */ + "Inserted ", /* TEXT154 */ + "Cannot open file for writing", /* TEXT155 */ + "Error closing file", /* TEXT156 */ + "Write I/O error", /* TEXT157 */ + "File read error", /* TEXT158 */ + "%Need function key number", /* TEXT159 */ + "%Function key number out of range", /* TEXT160 */ + "Label contents: ", /* TEXT161 */ + " [y/n]? ", /* TEXT162 */ + "no default", /* TEXT163 */ + "[search failed]", /* TEXT164 */ + "ISearch: ", /* TEXT165 */ + "? Search string too long", /* TEXT166 */ + "? command too long", /* TEXT167 */ + "%%Can not insert string", /* TEXT168 */ + "Inserted" /* this not used anymore */, /* TEXT169 */ + "bug: linsert", /* TEXT170 */ + "Replaced" /* this not used anymore */, /* TEXT171 */ + "%%Out of memory while overwriting", /* TEXT172 */ + "LOCK ERROR: Lock table full", /* TEXT173 */ + "Cannot lock, out of memory", /* TEXT174 */ + "LOCK", /* TEXT175 */ + "File in use by ", /* TEXT176 */ + ", overide?", /* TEXT177 */ + "[can not get system error message]", /* TEXT178 */ + " About MicroEmacs", /* TEXT179 */ + "%%No such resolution", /* TEXT180 */ + "%%Resolution illegal for this monitor", /* TEXT181 */ + "Environment variable TERM not defined!", /* TEXT182 */ + "Unknown terminal type %s!", /* TEXT183 */ + "termcap entry incomplete (lines)", /* TEXT184 */ + "Termcap entry incomplete (columns)", /* TEXT185 */ + "Incomplete termcap entry\n", /* TEXT186 */ + "Terminal description too big!\n", /* TEXT187 */ + "[End]", /* TEXT188 */ + "Cannot find entry for terminal type.\n", /* TEXT189 */ + "Check terminal type with \"SHOW TERMINAL\" or\n", /* TEXT190 */ + "try setting with \"SET TERMINAL/INQUIRE\"\n", /* TEXT191 */ + "The terminal type does not have enough power to run\n", /* TEXT192 */ + "MicroEMACS. Try a different terminal or check\n", /* TEXT193 */ + "type with \"SHOW TERMINAL\".\n", /* TEXT194 */ + "Cannot open channel to terminal.\n", /* TEXT195 */ + "Cannot obtain terminal settings.\n", /* TEXT196 */ + "Cannot modify terminal settings.\n", /* TEXT197 */ + "I/O error (%d,%d)\n", /* TEXT198 */ + "[Starting DCL]\r\n", /* TEXT199 */ + "[Calling DCL]\r\n", /* TEXT200 */ + "[Not available yet under VMS]", /* TEXT201 */ + "Terminal type not 'vt52'or 'z19' !", /* TEXT202 */ + "Window number out of range", /* TEXT203 */ + "Can not delete this window", /* TEXT204 */ + "Cannot split a %d line window", /* TEXT205 */ + "Only one window", /* TEXT206 */ + "Impossible change", /* TEXT207 */ + "[No such window exists]", /* TEXT208 */ + "%%Screen size out of range", /* TEXT209 */ + "%%Screen width out of range", /* TEXT210 */ + "Function list", /* TEXT211 */ + "Can not display function list", /* TEXT212 */ + "[Building function list]", /* TEXT213 */ + "%%No such file as %s", /* TEXT214 */ + ": macro-to-key ", /* TEXT215 */ + "Cannot read/write directories!!!", /* TEXT216 */ + "[Not available yet under AOS/VS]", /* TEXT217 */ + "Append file: ", /* TEXT218 */ + "%%Macro Failed", /* TEXT219 */ + "Line %D/%D Col %d/%d Char %D/%D (%d%%) char = 0x%x%x", /* TEXT220 */ + "Too many groups", /* TEXT221 */ + "Group not ended", /* TEXT222 */ + "%%Column origin out of range", /* TEXT223 */ + "%%Row origin out of range", /* TEXT224 */ + "[Switched to screen %s]", /* TEXT225 */ + "%%Can not kill an executing buffer", /* TEXT226 */ + "\n--- Press any key to Continue ---", /* TEXT227 */ + "[Kill ring cleared]", /* TEXT228 */ + " in < ", /* TEXT229 */ + "> at line ", /* TEXT230 */ + "Abbreviation to set: ", /* TEXT231 */ + "Abbreviation to delete: ", /* TEXT232 */ + "[Building Abbreviation list]", /* TEXT233 */ + "Abbreviation list", /* TEXT234 */ + "Can not display abbreviation list", /* TEXT235 */ + "Define Abbreviations from buffer", /* TEXT236 */ + "", /* TEXT237 */ + "", /* TEXT238 */ + "", /* TEXT239 */ + "[No such screen]", /* TEXT240 */ + "%%Can't delete current screen", /* TEXT241 */ + "Find Screen: ", /* TEXT242 */ + "Delete Screen: ", /* TEXT243 */ + "%%No such function as '%s'", /* TEXT244 */ + "%%Division by Zero is illegal", /* TEXT245 */ + "%%Need function key number", /* TEXT246 */ + "%%Function key number out of range", /* TEXT247 */ + "Enter Label String: ", /* TEXT248 */ + "Global variable to declare: ", /* TEXT249 */ + "Local variable to declare: ", /* TEXT250 */ + "", /* TEXT251 */ + "", /* TEXT252 */ + "", /* TEXT253 */ + "", /* TEXT254 */ + "", /* TEXT255 */ + "", /* TEXT256 */ + "", /* TEXT257 */ + "", /* TEXT258 */ + "", /* TEXT259 */ + "", /* TEXT260 */ + "", /* TEXT261 */ + "", /* TEXT262 */ + "", /* TEXT263 */ + "", /* TEXT264 */ + "", /* TEXT265 */ + "", /* TEXT266 */ + "", /* TEXT267 */ + "", /* TEXT268 */ + "", /* TEXT269 */ + "", /* TEXT270 */ + "", /* TEXT271 */ + "", /* TEXT272 */ + "", /* TEXT273 */ + "", /* TEXT274 */ + "", /* TEXT275 */ + "", /* TEXT276 */ + "", /* TEXT277 */ + "", /* TEXT278 */ + "", /* TEXT279 */ + "", /* TEXT280 */ + "", /* TEXT281 */ + "", /* TEXT282 */ + "", /* TEXT283 */ + "", /* TEXT284 */ +#if JMDEXT + "No topic", /* TEXT285 */ + "Searching topic \"%s\"", /* TEXT286 */ + "Searching keyword \"%s\"", /* TEXT287 */ + "Topic: ", /* TEXT288 */ + "Keyword: ", /* TEXT289 */ + "No help for topic \"%s\"", /* TEXT290 */ + "No help for keyword \"%s\"", /* TEXT291 */ + "Unable to open the help file %s", /* TEXT292 */ + "Index of ", /* TEXT293 */ + "[Help]", /* TEXT294 */ + "[Errors]", /* TEXT295 */ + "[Function Keys]", /* TEXT296 */ + "%s is not a regular file", /* TEXT297 */ +#else + "", /* TEXT285 */ + "", /* TEXT286 */ + "", /* TEXT287 */ + "", /* TEXT288 */ + "", /* TEXT289 */ + "", /* TEXT290 */ + "", /* TEXT291 */ + "", /* TEXT292 */ + "", /* TEXT293 */ + "", /* TEXT294 */ + "", /* TEXT295 */ + "", /* TEXT296 */ + "", /* TEXT297 */ +#endif +#if THEOS + "%s is not a sequential file", /* TEXT298 */ + "%s is not a library", /* TEXT299 */ +#else + "", + "", +#endif + "[Incorrect menu]", /* TEXT300 */ + "[Too many nested popup menus]", /* TEXT301 */ + "[Lack of resources]", /* TEXT302 */ + "Menu: ", /* TEXT303 */ + "Function: ", /* TEXT304 */ + "Macro: ", /* TEXT305 */ + "Menu: ", /* TEXT306 */ + "Help file: ", /* TEXT307 */ + "Help key: ", /* TEXT308 */ + "", /* TEXT309 */ + "Alt+", /* TEXT310 */ + "Shift+", /* TEXT311 */ + "BkSp", /* TEXT312 */ + "Tab", /* TEXT313 */ + "Enter", /* TEXT314 */ + "Esc", /* TEXT315 */ + "Ctrl+", /* TEXT316 */ + "Home", /* TEXT317 */ + "DownArrow", /* TEXT318 */ + "UpArrow", /* TEXT319 */ + "LeftArrow", /* TEXT320 */ + "RightArrow", /* TEXT321 */ + "End", /* TEXT322 */ + "PageUp", /* TEXT323 */ + "PageDown", /* TEXT324 */ + "Ins", /* TEXT325 */ + "Del", /* TEXT326 */ + "F10", /* TEXT327 */ + "F", /* CHAR328 */ + "SpaceBar", /* TEXT329 */ + " - Message history", /* TEXT330 */ + "Global modes", /* TEXT331 */ + "Modes for buffer: ", // TEXT332 + "File write in progress. Quit later!", /* TEXT333 */ + "[No such directory]", /* TEXT334 */ + "Change screen name to: ", /* TEXT335 */ + "[Screen name already in use]", /* TEXT336 */ + "cannot monitor external program", /* TEXT337 */ + "Internal command to execute (space for help):" /* TEXT338 */ +}; + +VOID msinit(VOID) +{ + FILE *menufile; /* message file */ + char s[NSTRING]; + char *p, *q; + int i; + +#if THEOS + if ((menufile = openmenu(otherpath[0])) == NULL) + return; +#else +#if BSD || FREEBSD || USG || LINUX || AIX || AUX || SMOS || HPUX8 || HPUX9 || SUN || XENIX + if ((p = getenv("LANG"))) { + q = strchr(p, '_'); + if (q) + *q = '\0'; + snprintf(s, sizeof(s), "emacs%s.msg", p); + } + if ((menufile = fopen(flook(s, FALSE), "r")) == NULL + && (menufile = fopen(flook(otherpath[0], FALSE), "r")) == NULL) + return; +# else + if ((menufile = fopen(flook(otherpath[0], FALSE), "r")) == NULL) + return; +# endif +#endif + for (i = 0; fgets(s,NSTRING-1,menufile) != NULL && i < sizeof(msg) / sizeof(char*); i++) { + if ((p = strchr(s,'\n'))) + *p = '\0'; + if (! (msg[i] = strdup(s))) { +#if THEOS + syserr(8, ENOMEM, NULL); +#else +#if WINDOW_MSWIN || WINDOW_MSWIN32 + MessageBox(NULL, otherpath[0], "Out of memory", MB_ICONSTOP | MB_OK); +#else + perror(otherpath[0]); +#endif + exit(8); +#endif + } + } + fclose(menufile); +} + +CONST char *ldmsg(int n) +{ + static char m[NSTRING]; + + if (n < (sizeof(msg) / sizeof(char*))) + return msg[n]; + + snprintf(m, sizeof(m),"message %d missing", n); + return m; +} +#else +msgmello() /* dummy function */ +{ +} +#endif /* DYNMSGS */ diff --git a/src/window.c b/src/window.c index 95c51fd..57c573a 100644 --- a/src/window.c +++ b/src/window.c @@ -15,35 +15,35 @@ * bottom. If it is 0 the window is centered (this is what the standard * redisplay code does). With no argument it defaults to 0. Bound to M-!. */ -PASCAL NEAR reposition(f, n) +int reposition(f, n) int f, n; /* prefix flag and argument */ { - if (f == FALSE) /* default to 0 to center screen */ - n = 0; - curwp->w_force = n; - curwp->w_flag |= WFFORCE; - return(TRUE); - } + if (f == FALSE) /* default to 0 to center screen */ + n = 0; + curwp->w_force = n; + curwp->w_flag |= WFFORCE; + return(TRUE); +} /* * Refresh the screen. With no argument, it just does the refresh. With an * argument it recenters "." in the current window. Bound to "C-L". */ -PASCAL NEAR refresh(f, n) +int uerefresh(f, n) int f, n; /* prefix flag and argument */ { - if (f == FALSE) - sgarbf = TRUE; - else { - curwp->w_force = 0; /* Center dot. */ - curwp->w_flag |= WFFORCE; - } + if (f == FALSE) + sgarbf = TRUE; + else { + curwp->w_force = 0; /* Center dot. */ + curwp->w_flag |= WFFORCE; + } - return(TRUE); + return(TRUE); } /* @@ -54,7 +54,7 @@ int f, n; /* prefix flag and argument */ * with an argument this command finds the th window from the top * */ -PASCAL NEAR nextwind(f, n) +int nextwind(f, n) int f, n; /* default flag and numeric argument */ @@ -84,7 +84,7 @@ int f, n; /* default flag and numeric argument */ wp = wp->w_wndp; } else { mlwrite(TEXT203); -/* "Window number out of range" */ + /* "Window number out of range" */ return(FALSE); } } else @@ -101,7 +101,7 @@ int f, n; /* default flag and numeric argument */ * current window. There arn't any errors, although the command does not do a * lot if there is 1 window. */ -PASCAL NEAR prevwind(f, n) +int prevwind(f, n) int f,n; /* prefix flag and argument */ @@ -135,7 +135,7 @@ int f,n; /* prefix flag and argument */ * a new dot. We share the code by having "move down" just be an interface to * "move up". Magic. Bound to "C-X C-N". */ -PASCAL NEAR mvdnwind(f, n) +int mvdnwind(f, n) int f, n; /* prefix flag and argument */ @@ -150,44 +150,44 @@ int f, n; /* prefix flag and argument */ * (this command does not really move "."; it moves the frame). Bound to * "C-X C-P". */ -PASCAL NEAR mvupwind(f, n) +int mvupwind(f, n) int f, n; /* prefix flag and argument */ { - register LINE *lp; - register int i; - - lp = curwp->w_linep; - - if (n < 0) { - while (n++ && lp!=curbp->b_linep) - lp = lforw(lp); - } else { - while (n-- && lback(lp)!=curbp->b_linep) - lp = lback(lp); - } - - curwp->w_linep = lp; - curwp->w_flag |= WFHARD; /* Mode line is OK. */ - - for (i = 0; i < curwp->w_ntrows; ++i) { - if (lp == curwp->w_dotp) - return(TRUE); - if (lp == curbp->b_linep) - break; - lp = lforw(lp); - } - - lp = curwp->w_linep; - i = curwp->w_ntrows/2; - - while (i-- && lp != curbp->b_linep) - lp = lforw(lp); - - curwp->w_dotp = lp; - curwp->w_doto = 0; - return(TRUE); + register LINE *lp; + register int i; + + lp = curwp->w_linep; + + if (n < 0) { + while (n++ && lp!=curbp->b_linep) + lp = lforw(lp); + } else { + while (n-- && lback(lp)!=curbp->b_linep) + lp = lback(lp); + } + + curwp->w_linep = lp; + curwp->w_flag |= WFHARD; /* Mode line is OK. */ + + for (i = 0; i < curwp->w_ntrows; ++i) { + if (lp == curwp->w_dotp) + return(TRUE); + if (lp == curbp->b_linep) + break; + lp = lforw(lp); + } + + lp = curwp->w_linep; + i = curwp->w_ntrows/2; + + while (i-- && lp != curbp->b_linep) + lp = lforw(lp); + + curwp->w_dotp = lp; + curwp->w_doto = 0; + return(TRUE); } /* @@ -197,7 +197,7 @@ int f, n; /* prefix flag and argument */ * the buffer structures right if the distruction of a window makes a buffer * become undisplayed. */ -PASCAL NEAR onlywind(f, n) +int onlywind(f, n) int f,n; /* prefix flag and argument */ @@ -248,12 +248,140 @@ int f,n; /* prefix flag and argument */ return(TRUE); } +#if LIBHELP +/* Remove a window specified from the screen, giving the space that it + * vacates to the window above it, if any, or the window below it otherwise. + * If this is the only window, don't remove it at all, but show a message. + * Try to leave the dot where it was on the physical screen. + */ +int zappwind(twp) +EWINDOW *twp; +{ + register EWINDOW *wp; /* window to receive deleted space */ + register EWINDOW *lwp; /* ptr window before twp */ + register int target; /* target line to search for */ + int cmark; /* current mark */ + + /* if there is only one window, don't delete it */ + if (wheadp->w_wndp == NULL) { + mlwrite(TEXT204); + /* "Can not delete this window" */ + return(FALSE); + } + + /* find window before twp in linked list */ + wp = wheadp; + lwp = NULL; + while (wp != NULL) { + if (wp == twp) + break; + lwp = wp; + wp = wp->w_wndp; + } + + /* find recieving window and give up our space */ + wp = wheadp; + if (twp->w_toprow == 0) { + /* find the next window down */ + target = twp->w_ntrows + 1; + while (wp != NULL) { + if (wp->w_toprow == target) + break; + wp = wp->w_wndp; + } + if (wp == NULL) + return(FALSE); + wp->w_toprow = 0; + wp->w_ntrows += target; + } else { + /* find the next window up */ + target = twp->w_toprow - 1; + while (wp != NULL) { + if ((wp->w_toprow + wp->w_ntrows) == target) + break; + wp = wp->w_wndp; + } + if (wp == NULL) + return(FALSE); + wp->w_ntrows += 1 + twp->w_ntrows; + } + + if (curwp == twp) { + curwp = wp; + wp->w_flag |= WFHARD; + curbp = wp->w_bufp; + } + + /* get rid of the current window */ + if (--twp->w_bufp->b_nwnd == 0) { + twp->w_bufp->b_dotp = twp->w_dotp; + twp->w_bufp->b_doto = twp->w_doto; + for (cmark = 0; cmark < NMARKS; cmark++) { + twp->w_bufp->b_markp[cmark] = twp->w_markp[cmark]; + twp->w_bufp->b_marko[cmark] = twp->w_marko[cmark]; + } + twp->w_bufp->b_fcol = twp->w_fcol; + } + if (lwp == NULL) + first_screen->s_first_window = wheadp = twp->w_wndp; + else + lwp->w_wndp = twp->w_wndp; + free((char *)twp); + wp->w_flag |= WFHARD; + upmode(); +#if COLOR + mlerase(); +#endif + return (TRUE); +} + +/* + * Zap the first window on the screen for the specified buffer using + * zappwind(), above. Return FALSE if no window can be found associated + * with the buffer or if it was the only window. + */ +int zapbwind(bp) +register BUFFER *bp; +{ + register EWINDOW *wp; + + if (bp->b_nwnd < 1) + return FALSE; + + wp = wheadp; + while (wp->w_bufp != bp) { + if ((wp = wp->w_wndp) == NULL) { + return FALSE; + } + } + return zappwind(wp); +} + +/* + * This command deletes the current window from the screen unless it is + * the only window. It uses zappwind(), above. + * Bound to "C-X 0". + */ +int delwind(int f, int n) +{ + return zappwind(curwp); +} + +/* + * This command deletes the first window on the screen for the help buffer. + * Bound to META|CTRL|'[' + */ +int zaphelp(int f, int n) +{ + return zapbwind(helpbp); +} +#else /* ?LIBHELP */ /* * Delete the current window, placing its space in the window above, * or, if it is the top window, the window below. Bound to C-X 0. */ -PASCAL NEAR delwind(f,n) +int delwind(f,n) int f, n; /* arguments are ignored for this command */ @@ -266,7 +394,7 @@ int f, n; /* arguments are ignored for this command */ /* if there is only one window, don't delete it */ if (wheadp->w_wndp == NULL) { mlwrite(TEXT204); -/* "Can not delete this window" */ + /* "Can not delete this window" */ return(FALSE); } @@ -328,6 +456,7 @@ int f, n; /* arguments are ignored for this command */ upmode(); return(TRUE); } +#endif /* !LIBHELP */ /* @@ -336,11 +465,11 @@ split. (Two line windows can be split when mode lines are disabled) An argument of 1 forces the cursor into the upper window, an argument of two forces the cursor to the lower window. The only other error that is possible is a "room" failure allocating the structure for the new -window. Bound to "C-X 2". +window. Bound to "C-X 2". -*/ + */ -PASCAL NEAR splitwind(f, n) +int splitwind(f, n) int f, n; /* default flag and numeric argument */ @@ -357,12 +486,12 @@ int f, n; /* default flag and numeric argument */ /* make sure we have enough space */ if (curwp->w_ntrows < (modeflag ? 3 : 2)) { mlwrite(TEXT205, curwp->w_ntrows); -/* "Cannot split a %d line window" */ + /* "Cannot split a %d line window" */ return(FALSE); } if ((wp = (EWINDOW *)room(sizeof(EWINDOW))) == NULL) { mlabort(TEXT94); -/* "%%Out of memory" */ + /* "%%Out of memory" */ return(FALSE); } ++curbp->b_nwnd; /* Displayed twice. */ @@ -432,7 +561,7 @@ int f, n; /* default flag and numeric argument */ * all the hard work. You don't just set "force reframe" because dot would * move. Bound to "C-X Z". */ -PASCAL NEAR enlargewind(f, n) +int enlargewind(f, n) int f,n; /* prefix flag and argument */ @@ -445,7 +574,7 @@ int f,n; /* prefix flag and argument */ return(shrinkwind(f, -n)); if (wheadp->w_wndp == NULL) { mlwrite(TEXT206); -/* "Only one window" */ + /* "Only one window" */ return(FALSE); } if ((adjwp=curwp->w_wndp) == NULL) { @@ -455,7 +584,7 @@ int f,n; /* prefix flag and argument */ } if ((adjwp->w_ntrows + (modeflag ? 0 : 1)) <= n) { mlwrite(TEXT207); -/* "Impossible change" */ + /* "Impossible change" */ return(FALSE); } if (curwp->w_wndp == adjwp) { /* Shrink below. */ @@ -483,7 +612,7 @@ int f,n; /* prefix flag and argument */ * window descriptions. Ask the redisplay to do all the hard work. Bound to * "C-X C-Z". */ -PASCAL NEAR shrinkwind(f, n) +int shrinkwind(f, n) int f,n; /* prefix flag and argument */ @@ -496,7 +625,7 @@ int f,n; /* prefix flag and argument */ return(enlargewind(f, -n)); if (wheadp->w_wndp == NULL) { mlwrite(TEXT206); -/* "Only one window" */ + /* "Only one window" */ return(FALSE); } if ((adjwp=curwp->w_wndp) == NULL) { @@ -506,7 +635,7 @@ int f,n; /* prefix flag and argument */ } if ((curwp->w_ntrows + (modeflag ? 0 : 1)) <= n) { mlwrite(TEXT207); -/* "Impossible change" */ + /* "Impossible change" */ return(FALSE); } if (curwp->w_wndp == adjwp) { /* Grow below. */ @@ -531,13 +660,13 @@ int f,n; /* prefix flag and argument */ /* Resize the current window to the requested size */ -PASCAL NEAR resize(f, n) +int resize(f, n) int f, n; /* default flag and numeric argument */ { int clines; /* current # of lines in window */ - + /* must have a non-default argument, else ignore call */ if (f == FALSE) return(TRUE); @@ -553,12 +682,12 @@ int f, n; /* default flag and numeric argument */ } /* pop up the indicated buffer -*/ + */ #if PROTO -int PASCAL NEAR wpopup(BUFFER *popbuf) +int wpopup(BUFFER *popbuf) #else -int PASCAL NEAR wpopup(popbuf) +int wpopup(popbuf) BUFFER *popbuf; #endif @@ -577,7 +706,7 @@ BUFFER *popbuf; /* find the window to split */ if (wheadp->w_wndp == NULL /* Only 1 window */ - && splitwind(FALSE, 0) == FALSE) /* and it won't split */ + && splitwind(FALSE, 0) == FALSE) /* and it won't split */ return(FALSE); wp = wheadp; /* Find window to use */ while (wp!=NULL && wp == curwp) @@ -598,7 +727,7 @@ BUFFER *popbuf; ++popbuf->b_nwnd; } -setwin: wp = wheadp; + setwin: wp = wheadp; while (wp != NULL) { if (wp->w_bufp == popbuf) { wp->w_linep = lforw(popbuf->b_linep); @@ -617,27 +746,27 @@ setwin: wp = wheadp; return(TRUE); } -PASCAL NEAR nextup(f, n) /* scroll the next window up (back) a page */ +int nextup(f, n) /* scroll the next window up (back) a page */ int f, n; /* prefix flag and argument */ { nextwind(FALSE, 1); backpage(f, n); - prevwind(FALSE, 1); + return (prevwind(FALSE, 1)); } -PASCAL NEAR nextdown(f, n) /* scroll the next window down (forward) a page */ +int nextdown(f, n) /* scroll the next window down (forward) a page */ int f, n; /* prefix flag and argument */ { nextwind(FALSE, 1); forwpage(f, n); - prevwind(FALSE, 1); + return(prevwind(FALSE, 1)); } -PASCAL NEAR savewnd(f, n) /* save ptr to current window */ +int savewnd(f, n) /* save ptr to current window */ int f, n; /* prefix flag and argument */ @@ -646,7 +775,7 @@ int f, n; /* prefix flag and argument */ return(TRUE); } -PASCAL NEAR restwnd(f, n) /* restore the saved screen */ +int restwnd(f, n) /* restore the saved screen */ int f, n; /* prefix flag and argument */ @@ -666,11 +795,11 @@ int f, n; /* prefix flag and argument */ } mlwrite(TEXT208); -/* "[No such window exists]" */ + /* "[No such window exists]" */ return(FALSE); } -PASCAL NEAR newsize(f, n) /* resize the screen, re-writing the screen */ +int newsize(f, n) /* resize the screen, re-writing the screen */ int f; /* default flag */ int n; /* numeric argument */ @@ -700,13 +829,13 @@ int n; /* numeric argument */ #if WINDOW_MSWIN return FALSE; #else - n = term.t_mrow + 1; + n = term.t_mrow + 1; #endif /* make sure it's in range */ if (n < 3 || n > term.t_mrow + 1) { mlwrite(TEXT209); -/* "%%Screen size out of range" */ + /* "%%Screen size out of range" */ return(FALSE); } @@ -732,7 +861,7 @@ int n; /* numeric argument */ while (nextwp != NULL) { wp = nextwp; nextwp = wp->w_wndp; - + /* get rid of it if it is too low */ if (wp->w_toprow > n - 2) { @@ -746,11 +875,11 @@ int n; /* numeric argument */ } wp->w_bufp->b_fcol = wp->w_fcol; } - + /* update curwp and lastwp if needed */ if (wp == curwp) curwp = wheadp; - curbp = curwp->w_bufp; + curbp = curwp->w_bufp; if (lastwp != NULL) lastwp->w_wndp = NULL; @@ -766,14 +895,14 @@ int n; /* numeric argument */ wp->w_flag |= WFHARD|WFMODE; } } - + lastwp = wp; } } /* screen is garbage */ #if WINDOW_MSWIN - vtsizescr (first_screen, n - 1, first_screen->s_ncol); + vtsizescr (first_screen, n - 1, first_screen->s_ncol); #else term.t_nrow = n - 1; #endif @@ -781,7 +910,7 @@ int n; /* numeric argument */ return(TRUE); } -PASCAL NEAR newwidth(f, n) /* resize the screen, re-writing the screen */ +int newwidth(f, n) /* resize the screen, re-writing the screen */ int f; /* default flag */ int n; /* numeric argument */ @@ -800,14 +929,14 @@ int n; /* numeric argument */ fclose(fp); #endif - /* if the command defaults, assume the largest */ + /* if the command defaults, assume the largest */ if (f == FALSE) n = term.t_mcol; /* make sure it's in range */ if (n < 10 || n > term.t_mcol) { mlwrite(TEXT210); -/* "%%Screen width out of range" */ + /* "%%Screen width out of range" */ return(FALSE); } @@ -831,7 +960,7 @@ int n; /* numeric argument */ return(TRUE); } -PASCAL NEAR new_col_org(f, n) /* reposition the screen, re-writing the screen */ +int new_col_org(f, n) /* reposition the screen, re-writing the screen */ int f; /* default flag */ int n; /* numeric argument */ @@ -847,7 +976,7 @@ int n; /* numeric argument */ /* make sure it's in range */ if (n < 0 || n > term.t_mcol - term.t_ncol) { mlwrite(TEXT223); -/* "%%Column origin out of range" */ + /* "%%Column origin out of range" */ return(FALSE); } @@ -858,7 +987,7 @@ int n; /* numeric argument */ return(TRUE); } -PASCAL NEAR new_row_org(f, n) /* reposition the screen, re-writing the screen */ +int new_row_org(f, n) /* reposition the screen, re-writing the screen */ int f; /* default flag */ int n; /* numeric argument */ @@ -874,7 +1003,7 @@ int n; /* numeric argument */ /* make sure it's in range */ if (n < 0 || n > term.t_mrow - term.t_nrow) { mlwrite(TEXT224); -/* "%%Row origin out of range" */ + /* "%%Row origin out of range" */ return(FALSE); } @@ -886,7 +1015,7 @@ int n; /* numeric argument */ return(TRUE); } -int PASCAL NEAR getwpos() /* get screen offset of current line in current window */ +int getwpos() /* get screen offset of current line in current window */ { register int sline; /* screen line from top of window */ @@ -904,7 +1033,7 @@ int PASCAL NEAR getwpos() /* get screen offset of current line in current window return(sline); } -int PASCAL NEAR getcwnum() /* get current window number */ +int getcwnum() /* get current window number */ { register EWINDOW *wp; @@ -920,7 +1049,7 @@ int PASCAL NEAR getcwnum() /* get current window number */ } -int PASCAL NEAR gettwnum() /* get total window count */ +int gettwnum() /* get total window count */ { register EWINDOW *wp; From d73b68783ed4f1d5c63d19fe6d8c4de2ae6f3c7d Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 3 Sep 2020 13:20:27 +0200 Subject: [PATCH 09/37] TheoX character set support --- src/theox.c | 489 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 489 insertions(+) create mode 100644 src/theox.c diff --git a/src/theox.c b/src/theox.c new file mode 100644 index 0000000..d8d12ad --- /dev/null +++ b/src/theox.c @@ -0,0 +1,489 @@ +/* + * theox.c + * + * Created on: 6 mars 2020 + * Author: Jean-Michel Dubois + * + * TheoX mode + * + * TheoX mode allows to edit files using TheoX character set. + * Keyboard inputs are UTF-8 characters converted to Unicode characters. + * Characters are stored in lines converted to TheoX set. + * They are converted to Unicode then UTF-8 for output. + * + * THis file contains conversions tables and characters categorization. + */ + +#include "estruct.h" + +#if UTF8 && THEOX + +#include "eproto.h" +#include "edef.h" + +#define _B_ISALPHA 1 +#define _B_ISUPPER 2 +#define _B_ISLOWER 4 +#define _B_ISDIGIT 8 +#define _B_ISALNUM 9 +#define _B_ISSPACE 16 +#define _B_ISSYMBOL 32 + +typedef struct map { + wchar_t m_wch; + unsigned char m_ch; +} Map; + +static int compmap(const void* m1, const void* m2) +{ + return ((Map*) m1)->m_wch - ((Map*) m2)->m_wch; +} + +static const Map mapTheoX[] = { + { 0x00a1, 0xe2 }, { 0x00a2, 0xe3 }, { 0x00a3, 0xe4 }, { 0x00a5, 0xe5 }, { 0x00a7, 0xeb }, { 0x00a9, 0xfc }, { 0x00aa, 0xf0 }, { 0x00ab, 0xbe }, + { 0x00ae, 0xfd }, { 0x00b0, 0xec }, { 0x00b1, 0xfb }, { 0x00b2, 0xed }, { 0x00b3, 0xee }, { 0x00b5, 0xbc }, { 0x00b6, 0xbd }, { 0x00b9, 0xef }, + { 0x00ba, 0xf1 }, { 0x00bb, 0xbf }, { 0x00bc, 0xe8 }, { 0x00bd, 0xe9 }, { 0x00bf, 0xe1 }, { 0x00c0, 0x87 }, { 0x00c1, 0x88 }, { 0x00c2, 0x86 }, + { 0x00c3, 0x89 }, { 0x00c4, 0xc0 }, { 0x00c5, 0xde }, { 0x00c6, 0xdc }, { 0x00c7, 0xd8 }, { 0x00c8, 0x8d }, { 0x00c9, 0xc5 }, { 0x00ca, 0x8c }, + { 0x00cb, 0x8b }, { 0x00cc, 0x90 }, { 0x00cd, 0x91 }, { 0x00ce, 0x8f }, { 0x00cf, 0x8e }, { 0x00d0, 0xf6 }, { 0x00d1, 0xda }, { 0x00d2, 0x93 }, + { 0x00d3, 0x94 }, { 0x00d4, 0x92 }, { 0x00d5, 0x95 }, { 0x00d6, 0xce }, { 0x00d7, 0xba }, { 0x00d8, 0x9a }, { 0x00d9, 0x98 }, { 0x00da, 0x99 }, + { 0x00db, 0x97 }, { 0x00dc, 0xd3 }, { 0x00dd, 0x9e }, { 0x00de, 0xf8 }, { 0x00df, 0xe0 }, { 0x00e0, 0xc3 }, { 0x00e1, 0xc4 }, { 0x00e2, 0xc2 }, + { 0x00e3, 0x8a }, { 0x00e4, 0xc1 }, { 0x00e5, 0xdf }, { 0x00e6, 0xdd }, { 0x00e7, 0xd9 }, { 0x00e8, 0xc8 }, { 0x00e9, 0xc9 }, { 0x00ea, 0xc7 }, + { 0x00eb, 0xc6 }, { 0x00ec, 0xcc }, { 0x00ed, 0xcd }, { 0x00ee, 0xcb }, { 0x00ef, 0xca }, { 0x00f0, 0xf7 }, { 0x00f1, 0xdb }, { 0x00f2, 0xd1 }, + { 0x00f3, 0xd2 }, { 0x00f4, 0xd0 }, { 0x00f5, 0x96 }, { 0x00f6, 0xcf }, { 0x00f7, 0xbb }, { 0x00f8, 0x9b }, { 0x00f9, 0xd6 }, { 0x00fa, 0xd7 }, + { 0x00fb, 0xd5 }, { 0x00fc, 0xd4 }, { 0x00fd, 0x9f }, { 0x00fe, 0xf9 }, { 0x00fe, 0xfe }, { 0x00ff, 0xea }, { 0x00ff, 0xff }, { 0x0152, 0x9c }, + { 0x0153, 0x9d }, { 0x0160, 0xf2 }, { 0x0161, 0xf3 }, { 0x0178, 0xfa }, { 0x017d, 0xf4 }, { 0x017e, 0xf5 }, { 0x20a7, 0xe6 }, { 0x20ac, 0xe7 }, + { 0x2500, 0xa9 }, { 0x2502, 0xaa }, { 0x250c, 0xa0 }, { 0x2510, 0xa1 }, { 0x2514, 0xa3 }, { 0x2518, 0xa2 }, { 0x251c, 0xa5 }, { 0x2524, 0xa6 }, + { 0x252c, 0xa7 }, { 0x2534, 0xa8 }, { 0x253c, 0xa4 }, { 0x2550, 0xb8 }, { 0x2551, 0xb9 }, { 0x2554, 0xaf }, { 0x2557, 0xb0 }, { 0x255a, 0xb2 }, + { 0x255d, 0xb1 }, { 0x2560, 0xb4 }, { 0x2563, 0xb5 }, { 0x2566, 0xb6 }, { 0x2569, 0xb7 }, { 0x256c, 0xb3 }, { 0x2588, 0xae }, { 0x2591, 0xab }, + { 0x2592, 0xac }, { 0x2593, 0xad } +}; + +// Unicode to TheoX character set conversion + +unsigned char _b_wchar2theox(unsigned wch) +{ + Map* pMap; + + if (wch < 0x80) + return (unsigned char) wch; + + if (wch > 0x85 && (pMap = (Map*) bsearch(&wch, mapTheoX, sizeof(mapTheoX) / sizeof(Map), sizeof(Map), compmap))) + return pMap->m_ch; + + return '?'; +} + +// table de translation du jeu de caractères TheoX en Unicode en mode normal + +const wchar_t _b_awcTheoX[256] = { +// 0 1 2 3 4 5 6 7 8 9 A B C D E F +/*0*/ 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, +/*1*/ 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, +/*2*/ 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, +/*3*/ 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, +/*4*/ 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, +/*5*/ 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, +/*6*/ 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, +/*7*/ 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x2302, +//  À à à ã Ë Ê È à Î +/*8*/ '?', '?', '?', '?', '?', '?', 0x00c2, 0x00c0, 0x00c1, 0x00c3, 0x00e3, 0x00cb, 0x00ca, 0x00c8, 0x00cf, 0x00ce, +// ÃŒ à Ô Ã’ Ó Õ õ Û Ù Ú Ø ø Å’ Å“ à ý +/*9*/ 0x00cc, 0x00cd, 0x00d4, 0x00d2, 0x00d3, 0x00d5, 0x00f5, 0x00db, 0x00d9, 0x00da, 0x00d8, 0x00f8, 0x0152, 0x0153, 0x00dd, 0x00fd, +// ┌ ┠┘ â”” ┼ ├ ┤ ┬ â”´ ─ │ â–‘ â–’ â–“ â–ˆ â•” +/*A*/ 0x250c, 0x2510, 0x2518, 0x2514, 0x253c, 0x251c, 0x2524, 0x252c, 0x2534, 0x2500, 0x2502, 0x2591, 0x2592, 0x2593, 0x2588, 0x2554, +// â•— ╠╚ ╬ â•  â•£ ╦ â•© â• â•‘ × ÷ µ ¶ « » +/*B*/ 0x2557, 0x255d, 0x255a, 0x256c, 0x2560, 0x2563, 0x2566, 0x2569, 0x2550, 0x2551, 0x00d7, 0x00f7, 0x00b5, 0x00b6, 0x00ab, 0x00bb, +// Ä ä â à á É ë ê è é ï î ì í Ö ö +/*C*/ 0x00c4, 0x00e4, 0x00e2, 0x00e0, 0x00e1, 0x00c9, 0x00eb, 0x00ea, 0x00e8, 0x00e9, 0x00ef, 0x00ee, 0x00ec, 0x00ed, 0x00d6, 0x00f6, +// ô ò ó Ü ü û ù ú Ç ç Ñ ñ Æ æ Ã… Ã¥ +/*D*/ 0x00f4, 0x00f2, 0x00f3, 0x00dc, 0x00fc, 0x00fb, 0x00f9, 0x00fa, 0x00c7, 0x00e7, 0x00d1, 0x00f1, 0x00c6, 0x00e6, 0x00c5, 0x00e5, +// ß ¿ ¡ ¢ £ Â¥ â‚§ € ¼ ½ ÿ § ° ² ³ ¹ +/*E*/ 0x00df, 0x00bf, 0x00a1, 0x00a2, 0x00a3, 0x00a5, 0x20a7, 0x20ac, 0x00bc, 0x00bd, 0x00ff, 0x00a7, 0x00b0, 0x00b2, 0x00b3, 0x00b9, +// ª º Å  Å¡ Ž ž à ð Þ þ Ÿ ± © ® +/*F*/ 0x00aa, 0x00ba, 0x0160, 0x0161, 0x017d, 0x017e, 0x00d0, 0x00f0, 0x00de, 0x00fe, 0x0178, 0x00b1, 0x00a9, 0x00ae, 0x00fe, 0x00ff +// 0 1 2 3 4 5 6 7 8 9 A B C D E F +}; + +static const unsigned char _b_theox_ctype[256] = { + /* 0 */ 0, + /* 1 */ 0, + /* 2 */ 0, + /* 3 */ 0, + /* 4 */ 0, + /* 5 */ 0, + /* 6 */ 0, + /* 7 */ 0, + /* 8 */ 0, + /* 9 */ _B_ISSPACE, + /* 10 */ 0, + /* 11 */ 0, + /* 12 */ 0, + /* 13 */ _B_ISSPACE, + /* 14 */ 0, + /* 15 */ 0, + /* 16 */ 0, + /* 17 */ 0, + /* 18 */ 0, + /* 19 */ 0, + /* 20 */ 0, + /* 21 */ 0, + /* 22 */ 0, + /* 23 */ 0, + /* 24 */ 0, + /* 25 */ 0, + /* 26 */ 0, + /* 27 */ 0, + /* 28 */ 0, + /* 29 */ 0, + /* 30 */ 0, + /* 31 */ 0, + /* 32 */ _B_ISSPACE, + /* 33 */ _B_ISSYMBOL, + /* 34 */ _B_ISSYMBOL, + /* 35 */ _B_ISSYMBOL, + /* 36 */ _B_ISSYMBOL, + /* 37 */ _B_ISSYMBOL, + /* 38 */ _B_ISSYMBOL, + /* 39 */ _B_ISSYMBOL, + /* 40 */ _B_ISSYMBOL, + /* 41 */ _B_ISSYMBOL, + /* 42 */ _B_ISSYMBOL, + /* 43 */ _B_ISSYMBOL, + /* 44 */ _B_ISSYMBOL, + /* 45 */ _B_ISSYMBOL, + /* 46 */ _B_ISSYMBOL, + /* 47 */ _B_ISSYMBOL, + /* 48 */ _B_ISDIGIT, + /* 49 */ _B_ISDIGIT, + /* 50 */ _B_ISDIGIT, + /* 51 */ _B_ISDIGIT, + /* 52 */ _B_ISDIGIT, + /* 53 */ _B_ISDIGIT, + /* 54 */ _B_ISDIGIT, + /* 55 */ _B_ISDIGIT, + /* 56 */ _B_ISDIGIT, + /* 57 */ _B_ISDIGIT, + /* 58 */ _B_ISSYMBOL, + /* 59 */ _B_ISSYMBOL, + /* 60 */ _B_ISSYMBOL, + /* 61 */ _B_ISSYMBOL, + /* 62 */ _B_ISSYMBOL, + /* 63 */ _B_ISSYMBOL, + /* 64 */ _B_ISSYMBOL, + /* 65 */ _B_ISALPHA|_B_ISUPPER, + /* 66 */ _B_ISALPHA|_B_ISUPPER, + /* 67 */ _B_ISALPHA|_B_ISUPPER, + /* 68 */ _B_ISALPHA|_B_ISUPPER, + /* 69 */ _B_ISALPHA|_B_ISUPPER, + /* 70 */ _B_ISALPHA|_B_ISUPPER, + /* 71 */ _B_ISALPHA|_B_ISUPPER, + /* 72 */ _B_ISALPHA|_B_ISUPPER, + /* 73 */ _B_ISALPHA|_B_ISUPPER, + /* 74 */ _B_ISALPHA|_B_ISUPPER, + /* 75 */ _B_ISALPHA|_B_ISUPPER, + /* 76 */ _B_ISALPHA|_B_ISUPPER, + /* 77 */ _B_ISALPHA|_B_ISUPPER, + /* 78 */ _B_ISALPHA|_B_ISUPPER, + /* 79 */ _B_ISALPHA|_B_ISUPPER, + /* 80 */ _B_ISALPHA|_B_ISUPPER, + /* 81 */ _B_ISALPHA|_B_ISUPPER, + /* 82 */ _B_ISALPHA|_B_ISUPPER, + /* 83 */ _B_ISALPHA|_B_ISUPPER, + /* 84 */ _B_ISALPHA|_B_ISUPPER, + /* 85 */ _B_ISALPHA|_B_ISUPPER, + /* 86 */ _B_ISALPHA|_B_ISUPPER, + /* 87 */ _B_ISALPHA|_B_ISUPPER, + /* 88 */ _B_ISALPHA|_B_ISUPPER, + /* 89 */ _B_ISALPHA|_B_ISUPPER, + /* 90 */ _B_ISALPHA|_B_ISUPPER, + /* 91 */ _B_ISSYMBOL, + /* 92 */ _B_ISSYMBOL, + /* 93 */ _B_ISSYMBOL, + /* 94 */ _B_ISSYMBOL, + /* 95 */ _B_ISSYMBOL, + /* 96 */ _B_ISSYMBOL, + /* 97 */ _B_ISALPHA|_B_ISLOWER, + /* 98 */ _B_ISALPHA|_B_ISLOWER, + /* 99 */ _B_ISALPHA|_B_ISLOWER, + /* 100 */ _B_ISALPHA|_B_ISLOWER, + /* 101 */ _B_ISALPHA|_B_ISLOWER, + /* 102 */ _B_ISALPHA|_B_ISLOWER, + /* 103 */ _B_ISALPHA|_B_ISLOWER, + /* 104 */ _B_ISALPHA|_B_ISLOWER, + /* 105 */ _B_ISALPHA|_B_ISLOWER, + /* 106 */ _B_ISALPHA|_B_ISLOWER, + /* 107 */ _B_ISALPHA|_B_ISLOWER, + /* 108 */ _B_ISALPHA|_B_ISLOWER, + /* 109 */ _B_ISALPHA|_B_ISLOWER, + /* 110 */ _B_ISALPHA|_B_ISLOWER, + /* 111 */ _B_ISALPHA|_B_ISLOWER, + /* 112 */ _B_ISALPHA|_B_ISLOWER, + /* 113 */ _B_ISALPHA|_B_ISLOWER, + /* 114 */ _B_ISALPHA|_B_ISLOWER, + /* 115 */ _B_ISALPHA|_B_ISLOWER, + /* 116 */ _B_ISALPHA|_B_ISLOWER, + /* 117 */ _B_ISALPHA|_B_ISLOWER, + /* 118 */ _B_ISALPHA|_B_ISLOWER, + /* 119 */ _B_ISALPHA|_B_ISLOWER, + /* 120 */ _B_ISALPHA|_B_ISLOWER, + /* 121 */ _B_ISALPHA|_B_ISLOWER, + /* 122 */ _B_ISALPHA|_B_ISLOWER, + /* 123 */ _B_ISSYMBOL, + /* 124 */ _B_ISSYMBOL, + /* 125 */ _B_ISSYMBOL, + /* 126 */ _B_ISSYMBOL, + /* 127 */ 0, + /* 128 */ 0, + /* 129 */ 0, + /* 130 */ 0, + /* 131 */ 0, + /* 132 */ 0, + /* 133 */ 0, + /* 134  */ _B_ISALPHA|_B_ISUPPER, + /* 135 À*/ _B_ISALPHA|_B_ISUPPER, + /* 136 à */ _B_ISALPHA|_B_ISUPPER, + /* 137 à */ _B_ISALPHA|_B_ISUPPER, + /* 138 ã */ _B_ISALPHA|_B_ISLOWER, + /* 139 Ë */ _B_ISALPHA|_B_ISUPPER, + /* 140 Ê */ _B_ISALPHA|_B_ISUPPER, + /* 141 È */ _B_ISALPHA|_B_ISUPPER, + /* 142 à */ _B_ISALPHA|_B_ISUPPER, + /* 143 ÃŽ */ _B_ISALPHA|_B_ISUPPER, + /* 144 ÃŒ */ _B_ISALPHA|_B_ISUPPER, + /* 145 à */ _B_ISALPHA|_B_ISUPPER, + /* 146 Ô */ _B_ISALPHA|_B_ISUPPER, + /* 147 Ã’ */ _B_ISALPHA|_B_ISUPPER, + /* 148 Ó */ _B_ISALPHA|_B_ISUPPER, + /* 149 Õ */ _B_ISALPHA|_B_ISUPPER, + /* 150 õ */ _B_ISALPHA|_B_ISLOWER, + /* 151 Û */ _B_ISALPHA|_B_ISUPPER, + /* 152 Ù*/ _B_ISALPHA|_B_ISUPPER, + /* 153 Ú*/ _B_ISALPHA|_B_ISUPPER, + /* 154 Ø */ _B_ISALPHA|_B_ISUPPER, + /* 155 ø */ _B_ISALPHA|_B_ISLOWER, + /* 156 Å’ */ _B_ISALPHA|_B_ISUPPER, + /* 157 Å“ */ _B_ISALPHA|_B_ISLOWER, + /* 158 à */ _B_ISALPHA|_B_ISUPPER, + /* 159 ý */ _B_ISALPHA|_B_ISLOWER, + /* 160 ┌ */ 0, + /* 161 â” */ 0, + /* 162 ┘ */ 0, + /* 163 â”” */ 0, + /* 164 ┼ */ 0, + /* 165 ├ */ 0, + /* 166 ┤ */ 0, + /* 167 ┬ */ 0, + /* 168 â”´ */ 0, + /* 169 ─ */ 0, + /* 170 │ */ 0, + /* 171 â–‘ */ 0, + /* 172 â–’ */ 0, + /* 173 â–“ */ 0, + /* 174 â–ˆ */ 0, + /* 175 â•” */ 0, + /* 176 â•— */ 0, + /* 177 â• */ 0, + /* 178 ╚ */ 0, + /* 179 ╬ */ 0, + /* 180 â•  */ 0, + /* 181 â•£ */ 0, + /* 182 ╦ */ 0, + /* 183 â•© */ 0, + /* 184 â• */ 0, + /* 185 â•‘ */ 0, + /* 186 × */ _B_ISSYMBOL, + /* 187 ÷ */ _B_ISSYMBOL, + /* 188 µ */ _B_ISSYMBOL, + /* 189 ¶ */ _B_ISSYMBOL, + /* 190 « */ _B_ISSYMBOL, + /* 191 » */ _B_ISSYMBOL, + /* 192 Ä */ _B_ISALPHA|_B_ISUPPER, + /* 193 ä */ _B_ISALPHA|_B_ISLOWER, + /* 194 â */ _B_ISALPHA|_B_ISLOWER, + /* 195 à */ _B_ISALPHA|_B_ISLOWER, + /* 196 á */ _B_ISALPHA|_B_ISLOWER, + /* 197 É */ _B_ISALPHA|_B_ISUPPER, + /* 198 ë */ _B_ISALPHA|_B_ISLOWER, + /* 199 ê */ _B_ISALPHA|_B_ISLOWER, + /* 200 è */ _B_ISALPHA|_B_ISLOWER, + /* 201 é */ _B_ISALPHA|_B_ISLOWER, + /* 202 ï */ _B_ISALPHA|_B_ISLOWER, + /* 203 î */ _B_ISALPHA|_B_ISLOWER, + /* 204 ì */ _B_ISALPHA|_B_ISLOWER, + /* 205 í */ _B_ISALPHA|_B_ISLOWER, + /* 206 Ö */ _B_ISALPHA|_B_ISUPPER, + /* 207 ö */ _B_ISALPHA|_B_ISLOWER, + /* 208 ô */ _B_ISALPHA|_B_ISLOWER, + /* 209 ò */ _B_ISALPHA|_B_ISLOWER, + /* 210 ó */ _B_ISALPHA|_B_ISLOWER, + /* 211 Ü */ _B_ISALPHA|_B_ISUPPER, + /* 212 ü */ _B_ISALPHA|_B_ISLOWER, + /* 213 û */ _B_ISALPHA|_B_ISLOWER, + /* 214 ù */ _B_ISALPHA|_B_ISLOWER, + /* 215 ú */ _B_ISALPHA|_B_ISLOWER, + /* 216 Ç */ _B_ISALPHA|_B_ISUPPER, + /* 217 ç */ _B_ISALPHA|_B_ISLOWER, + /* 218 Ñ */ _B_ISALPHA|_B_ISUPPER, + /* 219 ñ */ _B_ISALPHA|_B_ISLOWER, + /* 220 Æ */ _B_ISALPHA|_B_ISUPPER, + /* 221 æ */ _B_ISALPHA|_B_ISLOWER, + /* 222 Ã… */ _B_ISALPHA|_B_ISUPPER, + /* 223 Ã¥ */ _B_ISALPHA|_B_ISLOWER, + /* 224 ß */ _B_ISALPHA, + /* 225 ¿ */ _B_ISSYMBOL, + /* 226 ¡ */ _B_ISSYMBOL, + /* 227 ¢ */ _B_ISSYMBOL, + /* 228 £ */ _B_ISSYMBOL, + /* 229 Â¥ */ _B_ISSYMBOL, + /* 230 â‚§ */ _B_ISSYMBOL, + /* 231 € */ _B_ISSYMBOL, + /* 232 ¼ */ _B_ISSYMBOL, + /* 233 ½ */ _B_ISSYMBOL, + /* 234 ÿ */ _B_ISSYMBOL, + /* 235 § */ _B_ISSYMBOL, + /* 236 ° */ _B_ISSYMBOL, + /* 237 ² */ _B_ISSYMBOL, + /* 238 ³ */ _B_ISSYMBOL, + /* 239 ¹ */ _B_ISSYMBOL, + /* 240 ª */ _B_ISSYMBOL, + /* 241 º */ _B_ISSYMBOL, + /* 242 Å  */ _B_ISALPHA|_B_ISUPPER, + /* 243 Å¡ */ _B_ISALPHA|_B_ISLOWER, + /* 244 Ž */ _B_ISALPHA|_B_ISUPPER, + /* 245 ž */ _B_ISALPHA|_B_ISLOWER, + /* 246 à */ _B_ISALPHA|_B_ISUPPER, + /* 247 ð */ _B_ISALPHA|_B_ISLOWER, + /* 248 Þ */ _B_ISALPHA|_B_ISUPPER, + /* 249 þ */ _B_ISALPHA|_B_ISLOWER, + /* 250 Ÿ */ _B_ISALPHA|_B_ISUPPER, + /* 251 ± */ _B_ISSYMBOL, + /* 252 © */ _B_ISSYMBOL, + /* 253 ® */ _B_ISSYMBOL, + /* 254 . */ 0, + /* 255 . */ 0 +}; + +/* table de translation de TheoX en minuscules */ + +unsigned char _thxlcase[] = { +// 0 1 2 3 4 5 6 7 8 9 A B C D E F + +// 8 . . . . . .  À à à ã Ë Ê È à Î + 0x80,0x81,0x82,0x83, 0x84,0x85,0xc2,0xc3, 0xc4,0x8a,0x8a,0xc6, 0xc7,0xc8,0xca,0xcb, +// 9 ÃŒ à Ô Ã’ Ó Õ õ Û Ù Ú Ø ø Å’ Å“ à ý + 0xcc,0xcd,0xd0,0xd1, 0xd2,0x9a,0x9a,0xd5, 0xd6,0xd7,0x9b,0x9b, 0x9d,0x9d,0x9f,0x9f, +// A ┌ ┠┘ â”” ┼ ├ ┤ ┬ â”´ ─ │ â–‘ â–’ â–“ â–ˆ â•” + 0xa0,0xa1,0xa2,0xa3, 0xa4,0xa5,0xa6,0xa7, 0xa8,0xa9,0xaa,0xab, 0xac,0xad,0xae,0xaf, +// B â•— ╠╚ ╬ â•  â•£ ╦ â•© â• â•‘ × ÷ µ ¶ « » + 0xb0,0xb1,0xb2,0xb3, 0xb4,0xb5,0xb6,0xb7, 0xb8,0xb9,0xba,0xbb, 0xbc,0xbd,0xbe,0xbf, +// C Ä ä â à á É ë ê è é ï î ì í Ö ö + 0xc1,0xc1,0xc2,0xc3, 0xc4,0xc9,0xc6,0xc7, 0xc8,0xc9,0xca,0xcb, 0xcc,0xcd,0xcf,0xcf, +// D ô ò ó Ü ü û ù ú Ç ç Ñ ñ Æ æ Ã… Ã¥ + 0xd0,0xd1,0xd2,0xd4, 0xd4,0xd5,0xd6,0xd7, 0xd9,0xd9,0xdb,0xdb, 0xdd,0xdd,0xdf,0xdf, +// E ß ¿ ¡ ¢ £ Â¥ â‚§ € ¼ ½ ÿ § ° ² ³ ¹ + 0xe0,0xe1,0xe2,0xe3, 0xe4,0xe5,0xe6,0xe7, 0xe8,0xe9,0xea,0xeb, 0xec,0xed,0xee,0xef, +// F ª º Å  Å¡ Ž ž à ð Þ þ Ÿ ± © ® + 0xf0,0xf1,0xf3,0xf3, 0xf5,0xf5,0xf7,0xf7, 0xf9,0xf9,0xaa,0xfb, 0xfc,0xfd,0xfe,0xff +}; + +/* table de translation de TheoX en majuscules */ + +unsigned char _thxucase[] = { +// 0 1 2 3 4 5 6 7 8 9 A B C D E F + +// 8 . . . . . .  À à à ã Ë Ê È à Î + 0x80,0x81,0x82,0x83, 0x84,0x85,0x86,0x87, 0x88,0x89,0x89,0x8b, 0x8c,0x8d,0x8e,0x8f, +// 9 ÃŒ à Ô Ã’ Ó Õ õ Û Ù Ú Ø ø Å’ Å“ à ý + 0x90,0x91,0x92,0x93, 0x94,0x95,0x95,0x97, 0x98,0x99,0x9a,0x9a, 0x9c,0x9c,0x9e,0x9e, +// A ┌ ┠┘ â”” ┼ ├ ┤ ┬ â”´ ─ │ â–‘ â–’ â–“ â–ˆ â•” + 0xa0,0xa1,0xa2,0xa3, 0xa4,0xa5,0xa6,0xa7, 0xa8,0xa9,0xaa,0xab, 0xac,0xad,0xae,0xaf, +// B â•— ╠╚ ╬ â•  â•£ ╦ â•© â• â•‘ × ÷ µ ¶ « » + 0xb0,0xb1,0xb2,0xb3, 0xb4,0xb5,0xb6,0xb7, 0xb8,0xb9,0xba,0xbb, 0xbc,0xbd,0xbe,0xbf, +// C Ä ä â à á É ë ê è é ï î ì í Ö ö + 0xc1,0xc1,0x86,0x87, 0x88,0xc5,0x8b,0x8c, 0x8d,0xc5,0x8e,0x8f, 0x90,0x91,0xce,0xce, +// D ô ò ó Ü ü û ù ú Ç ç Ñ ñ Æ æ Ã… Ã¥ + 0x92,0x93,0x94,0xd3, 0xd3,0x97,0x98,0x99, 0xd8,0xd8,0xda,0xda, 0xdc,0xdc,0xde,0xde, +// E ß ¿ ¡ ¢ £ Â¥ â‚§ € ¼ ½ ÿ § ° ² ³ ¹ + 0xe0,0xe1,0xe2,0xe3, 0xe4,0xe5,0xe6,0xe7, 0xe8,0xe9,0xfa,0xeb, 0xec,0xed,0xee,0xef, +// F ª º Å  Å¡ Ž ž à ð Þ þ Ÿ ± © ® + 0xf0,0xf1,0xf2,0xf2, 0xf4,0xf4,0xf6,0xf6, 0xf8,0xf8,0xfa,0xfb, 0xfc,0xfd,0xfe,0xff +}; + +int _b_islower(int ch) +{ + return (_b_theox_ctype[ch & 0xff] & _B_ISLOWER) != 0; +} + +int _b_isupper(int ch) +{ + return (_b_theox_ctype[ch & 0xff] & _B_ISUPPER) != 0; +} + +int _b_isalpha(int ch) +{ + return (_b_theox_ctype[ch & 0xff] & _B_ISALPHA) != 0; +} + +int _b_isalnum(int ch) +{ + return (_b_theox_ctype[ch & 0xff] & (_B_ISALPHA|_B_ISDIGIT)) != 0; +} + +int _b_isdigit(int ch) +{ + return (_b_theox_ctype[ch & 0xff] & _B_ISDIGIT) != 0; +} + +int _b_isspace(int ch) +{ + return (_b_theox_ctype[ch & 0xff] & _B_ISSPACE) != 0; +} + +int _b_issymbol(int ch) +{ + return (_b_theox_ctype[ch & 0xff] & _B_ISSYMBOL) != 0; +} + +int _b_isprint(int ch) +{ + return (_b_theox_ctype[ch & 0xff] & (_B_ISALNUM|_B_ISSYMBOL)) != 0; +} + +int _b_tolower(int ch) +{ + return (_b_theox_ctype[ch &= 0xff] & _B_ISUPPER) ? (ch & 0x80 ? _thxlcase[ch & 0x7f] : ch | 32) : ch; +} + +int _b_toupper(int ch) +{ + return (_b_theox_ctype[ch &= 0xff] & _B_ISLOWER) ? (ch & 0x80 ? _thxucase[ch & 0x7f] : ch & ~32) : ch; +} + +VOID theoxputchar(unsigned char c) +{ + char utf8[6]; + + if ((c & 0x80) && (curbp->b_mode & MDTHEOX)) { + unsigned wc = _b_awcTheoX[c]; + unsigned bytes = unicode_to_utf8(wc, utf8); + unsigned i; + + for (i = 0; i < bytes; ++i) +#if WINNT || WINXP + putchar(utf8[i]); +#else + TTputc(c); +#endif + } else +#if WINNT || WINXP + putchar(c); +#else + TTputc(c); +#endif +} + +unsigned int _b_theox2wchar(unsigned char c) +{ + return _b_awcTheoX[c]; +} +#endif /* UTF8 && THEOX */ From 59a3a7299e3b11cba0ec76f2e4b9840662ae68e1 Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 3 Sep 2020 13:21:23 +0200 Subject: [PATCH 10/37] Unicode/UTF-8 Support --- src/utf8.c | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 src/utf8.c diff --git a/src/utf8.c b/src/utf8.c new file mode 100644 index 0000000..6445926 --- /dev/null +++ b/src/utf8.c @@ -0,0 +1,98 @@ +#include "utf8.h" + +/* + * utf8_to_unicode() + * + * Convert a UTF-8 sequence to its unicode value, and return the length of + * the sequence in bytes. + * + * NOTE! Invalid UTF-8 will be converted to a one-byte sequence, so you can + * either use it as-is (ie as Latin1) or you can check for invalid UTF-8 + * by checking for a length of 1 and a result > 127. + * + * NOTE 2! This does *not* verify things like minimality. So overlong forms + * are happily accepted and decoded, as are the various "invalid values". + */ +unsigned utf8_to_unicode(const char *line, unsigned index, unsigned len, unsigned int *res) +{ + unsigned value; + unsigned char c = line[index]; + unsigned bytes, mask, i; + + *res = c; + line += index; + len -= index; + + /* + * 0xxxxxxx is valid utf8 + * 10xxxxxx is invalid UTF-8, we assume it is Latin1 + */ + if (c < 0xc0) + return 1; + + /* Ok, it's 11xxxxxx, do a stupid decode */ + mask = 0x20; + bytes = 2; + while (c & mask) { + bytes++; + mask >>= 1; + } + + /* Invalid? Do it as a single byte Latin1 */ + if (bytes > 6) + return 1; + if (bytes > len) + return 1; + + value = c & (mask-1); + + /* Ok, do the bytes */ + for (i = 1; i < bytes; i++) { + c = line[i]; + if ((c & 0xc0) != 0x80) + return 1; + value = (value << 6) | (c & 0x3f); + } + *res = value; + return bytes; +} + +static void reverse_string(char *begin, char *end) +{ + do { + char a = *begin, b = *end; + *end = a; *begin = b; + begin++; end--; + } while (begin < end); +} + +/* + * unicode_to_utf8() + * + * Convert a unicode value to its canonical utf-8 sequence. + * + * NOTE! This does not check for - or care about - the "invalid" unicode + * values. Also, converting a utf-8 sequence to unicode and back does + * *not* guarantee the same sequence, since this generates the shortest + * possible sequence, while utf8_to_unicode() accepts both Latin1 and + * overlong utf-8 sequences. + */ +unsigned unicode_to_utf8(unsigned int c, char *utf8) +{ + int bytes = 1; + + *utf8 = c; + if (c > 0x7f) { + unsigned int prefix = 0x40; + char *p = utf8; + do { + *p++ = 0x80 + (c & 0x3f); + bytes++; + prefix >>= 1; + c >>= 6; + } while (c > prefix); + *p = c - 2*prefix; + reverse_string(utf8, p); + } + return bytes; +} From 7a5fa43dc31b84edbdaa706f934d9de8d198f16f Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 3 Sep 2020 18:55:10 +0200 Subject: [PATCH 11/37] Update to version 5.10 --- src/abbrev.c | 48 +- src/aix.c | 4 +- src/amigados.c | 14 +- src/ansi.c | 92 ++-- src/aosvs.c | 18 +- src/cmdfix.c | 8 +- src/crypt.c | 116 ++--- src/dg10.c | 62 +-- src/dolock.c | 27 +- src/exec.c | 92 ++-- src/file.c | 306 ++++++++++-- src/fileio.c | 20 +- src/fmr.c | 86 ++-- src/fmrdos.c | 54 +-- src/history.c | 45 +- src/hp110.c | 66 +-- src/hp150.c | 106 ++-- src/i55.c | 82 ++-- src/ibmpc.c | 130 +++-- src/lock.c | 25 +- src/mpe.c | 2 +- src/msdos.c | 54 +-- src/mswdisp.c | 52 +- src/mswdrv.c | 88 ++-- src/mswemacs.c | 34 +- src/mswexec.c | 22 +- src/mswfile.c | 80 +++- src/mswfont.c | 34 +- src/mswinput.c | 16 +- src/mswmem.c | 4 +- src/mswmenu.c | 120 ++--- src/mswsys.c | 74 +-- src/nec.c | 88 ++-- src/necdos.c | 54 +-- src/nt.c | 39 +- src/ntconio.c | 84 ++-- src/os2.c | 14 +- src/os2npm.c | 70 +-- src/posix.c | 50 +- src/replace.c | 36 +- src/screen.c | 86 ++-- src/smg.c | 20 +- src/st52.c | 4 +- src/tags.c | 144 +++--- src/tcap.c | 73 +-- src/theos.c | 1248 ++++++++++++++++++++++++++++++++++++++++++++++++ src/tipc.c | 72 +-- src/tos.c | 12 +- src/undo.c | 14 +- src/vms.c | 56 +-- src/wmcs.c | 6 +- src/xp.c | 22 +- src/xvt.c | 74 +-- src/xvtdos.c | 50 +- src/z309.c | 76 +-- 55 files changed, 2951 insertions(+), 1422 deletions(-) create mode 100644 src/theos.c diff --git a/src/abbrev.c b/src/abbrev.c index bd552da..2cdf496 100644 --- a/src/abbrev.c +++ b/src/abbrev.c @@ -9,7 +9,7 @@ #include "edef.h" #include "elang.h" -VOID PASCAL NEAR ab_save(c) +VOID ab_save(c) char c; /* character to add to current word buffer */ @@ -36,12 +36,12 @@ char c; /* character to add to current word buffer */ *ab_pos = 0; } -VOID PASCAL NEAR ab_expand() +VOID ab_expand() { char *exp; /* expansion of current symbol */ char c; /* current character to insert */ - + /* only in ABBREV mode, never in VIEW mode */ if ((curbp->b_mode & MDABBR) == 0 || (curbp->b_mode & MDVIEW) == MDVIEW) @@ -83,7 +83,7 @@ VOID PASCAL NEAR ab_expand() /* add a new abbreviation */ -int PASCAL NEAR add_abbrev(f, n) +int add_abbrev(f, n) int f, n; /* numeric flag and argument */ @@ -114,7 +114,7 @@ int f, n; /* numeric flag and argument */ /* Delete a single abbreviation */ -int PASCAL NEAR del_abbrev(f, n) +int del_abbrev(f, n) int f, n; /* numeric flag and argument */ @@ -134,7 +134,7 @@ int f, n; /* numeric flag and argument */ /* Kill all abbreviations */ -int PASCAL NEAR kill_abbrevs(f, n) +int kill_abbrevs(f, n) int f, n; /* numeric flag and argument */ @@ -143,7 +143,7 @@ int f, n; /* numeric flag and argument */ return(ab_clean()); } -int PASCAL NEAR desc_abbrevs(f, n) +int desc_abbrevs(f, n) int f, n; /* numeric flag and argument */ @@ -172,7 +172,7 @@ int f, n; /* numeric flag and argument */ /* add in the abbreviation symbol name */ strcpy(outseq, cur_node->ab_sym); pad(outseq, 20); - + /* add it's expansion */ strncat(outseq, cur_node->ab_exp, NSTRING - 20); outseq[NSTRING - 1] = 0; @@ -192,7 +192,7 @@ int f, n; /* numeric flag and argument */ /* insert a list of all the current abbreviations into the current buffer */ -int PASCAL NEAR ins_abbrevs(f, n) +int ins_abbrevs(f, n) int f, n; /* numeric flag and argument */ @@ -206,7 +206,7 @@ int f, n; /* numeric flag and argument */ /* insert the abbreviation symbol as a line */ if (addline(curbp, cur_node->ab_sym) != TRUE) return(FALSE); - + /* now a line with the expansion */ if (addline(curbp, cur_node->ab_exp) != TRUE) return(FALSE); @@ -217,25 +217,25 @@ int f, n; /* numeric flag and argument */ return(TRUE); } -int PASCAL NEAR def_abbrevs(f, n) +int def_abbrevs(f, n) int f,n; /* prefix flag and argument */ { register BUFFER *bp; /* ptr to buffer to dump */ register LINE *lp; /* ptr to current line in our buffer */ - register llength; /* length of the current line being examined */ + register int llength; /* length of the current line being examined */ char cur_sym[MAXSYM+1]; /* current symbol being defined */ char cur_exp[NSTRING]; /* current expansion */ - + /* get the buffer to load abbreviations from */ bp = getdefb(); bp = getcbuf(TEXT236, bp ? bp->b_bname : mainbuf, TRUE); -/* "Define Abbreviations in buffer" */ +/* "Define Abbreviations from buffer" */ if (bp == NULL) return(ABORT); - /* step throught the buffer */ + /* step through the buffer */ lp = lforw(bp->b_linep); while (lp != bp->b_linep) { @@ -264,14 +264,16 @@ int f,n; /* prefix flag and argument */ /* on to the next pair */ lp = lforw(lp); } + + return(TRUE); } -VOID PASCAL NEAR ab_init() +VOID ab_init() { ab_head = (ABBREV *)NULL; /* abbreviation list empty */ ab_bell = FALSE; /* no ringing please! */ - ab_cap = FALSE; /* don't match capatilization on expansion */ + ab_cap = FALSE; /* don't match capitalization on expansion */ ab_quick = FALSE; /* no aggressive expansion */ ab_pos = ab_word; /* no word accumulated yet */ ab_end = &ab_word[NSTRING - 1]; /* ptr to detect end of this buffer */ @@ -281,7 +283,7 @@ VOID PASCAL NEAR ab_init() */ -int PASCAL NEAR ab_insert(sym, expansion) +int ab_insert(sym, expansion) char *sym; /* symbol to expand */ char *expansion; /* string to expand to */ @@ -328,7 +330,7 @@ char *expansion; /* string to expand to */ cur_node = ab_head; while (cur_node->ab_next != NULL) { - if (strcmp(sym, cur_node->ab_next->ab_sym) > 0) { + if (strcmp(sym, cur_node->ab_next->ab_sym) < 0) { /* insert after cur_node */ new_node->ab_next = cur_node->ab_next; @@ -353,7 +355,7 @@ char *expansion; /* string to expand to */ Return a NULL if it is not in the list */ -char *PASCAL NEAR ab_lookup(sym) +char *ab_lookup(sym) char *sym; /* name of the symbol to look up */ @@ -378,7 +380,7 @@ char *sym; /* name of the symbol to look up */ /* ab_delete: Delete from the abbreviation list */ -int PASCAL NEAR ab_delete(sym) +int ab_delete(sym) char *sym; @@ -403,7 +405,7 @@ char *sym; } else if (strcmp(sym,cur_node->ab_sym) == 0 && cur_node != NULL) { - previous->ab_next=NULL; + previous->ab_next=NULL; free(cur_node); return(TRUE); } @@ -417,7 +419,7 @@ char *sym; return(FALSE); } -int PASCAL NEAR ab_clean() +int ab_clean() { diff --git a/src/aix.c b/src/aix.c index ca8d4bb..2d8e12a 100644 --- a/src/aix.c +++ b/src/aix.c @@ -121,7 +121,7 @@ int scnothing() #endif /* (AVVION || TERMIOS) */ #if CURSES #include /* Curses screen output */ -#undef WINDOW /* Oh no! */ +#undef EWINDOW /* Oh no! */ #endif /* CURSES */ /** Completion include files **/ @@ -1445,7 +1445,7 @@ int n; /* Argument count */ } /** Filter buffer through command **/ -int filter(f, n) +int uefilter(f, n) int f; /* Flags */ int n; /* Argument count */ { diff --git a/src/amigados.c b/src/amigados.c index b3f478b..7e75802 100644 --- a/src/amigados.c +++ b/src/amigados.c @@ -713,7 +713,7 @@ pipecmd(f, n) * filter a buffer through an external DOS program * Bound to ^X # */ -filter(f, n) +uefilter(f, n) { register int s; /* return status from CLI */ @@ -777,9 +777,9 @@ filter(f, n) return(TRUE); } -/* return a system dependant string with the current time */ +/* return a system dependent string with the current time */ -char *PASCAL NEAR timeset() +char *timeset() { return(errorm); @@ -794,7 +794,7 @@ extern char *scdir(); /* do a wild card directory search (for file name completion) */ -char *PASCAL NEAR getffile(fspec) +char *getffile(fspec) char *fspec; /* pattern to match */ @@ -822,7 +822,7 @@ char *fspec; /* pattern to match */ return(getnfile()); } -char *PASCAL NEAR getnfile() +char *getnfile() { register char *sp; /* return from scdir */ @@ -837,7 +837,7 @@ char *PASCAL NEAR getnfile() return(rbuf); } #else -char *PASCAL NEAR getffile(fspec) +char *getffile(fspec) char *fspec; /* file to match */ @@ -845,7 +845,7 @@ char *fspec; /* file to match */ return(NULL); } -char *PASCAL NEAR getnfile() +char *getnfile() { return(NULL); diff --git a/src/ansi.c b/src/ansi.c index 9a17895..497a6b5 100644 --- a/src/ansi.c +++ b/src/ansi.c @@ -16,17 +16,17 @@ #if ANSI #if PROTO -int PASCAL NEAR fnclabel(int f, int n); -int PASCAL NEAR readparam( int *v); -void PASCAL NEAR dobbnmouse(void); -void PASCAL NEAR docsi( int oh); -void PASCAL NEAR ttputs(char *string); +int fnclabel(int f, int n); +int readparam( int *v); +void dobbnmouse(void); +void docsi( int oh); +void ttputs(char *string); #else -int PASCAL NEAR fnclabel(); -int PASCAL NEAR readparam(); -void PASCAL NEAR dobbnmouse(); -void PASCAL NEAR docsi(); -void PASCAL NEAR ttputs(); +int fnclabel(); +int readparam(); +void dobbnmouse(); +void docsi(); +void ttputs(); #endif #if VMS @@ -57,22 +57,22 @@ extern NOSHARE TTCHAR orgchar; /* Original characteristics */ #define ESC 0x1B /* ESC character. */ /* Forward references. */ -extern int PASCAL NEAR ansimove(); -extern int PASCAL NEAR ansieeol(); -extern int PASCAL NEAR ansieeop(); -extern int PASCAL NEAR ansibeep(); -extern int PASCAL NEAR ansiopen(); -extern int PASCAL NEAR ansirev(); -extern int PASCAL NEAR ansiclose(); -extern int PASCAL NEAR ansikopen(); -extern int PASCAL NEAR ansikclose(); -extern int PASCAL NEAR ansicres(); -extern int PASCAL NEAR ansiparm(); -extern int PASCAL NEAR ansigetc(); +extern int ansimove(); +extern int ansieeol(); +extern int ansieeop(); +extern int ansibeep(); +extern int ansiopen(); +extern int ansirev(); +extern int ansiclose(); +extern int ansikopen(); +extern int ansikclose(); +extern int ansicres(); +extern int ansiparm(); +extern int ansigetc(); #if COLOR -extern int PASCAL NEAR ansifcol(); -extern int PASCAL NEAR ansibcol(); +extern int ansifcol(); +extern int ansibcol(); static int rev_state = FALSE; static int cfcolor = -1; /* current foreground color */ @@ -123,7 +123,7 @@ NOSHARE TERM term = { }; #if COLOR -PASCAL NEAR ansifcol(color) /* set the current output color */ +ansifcol(color) /* set the current output color */ int color; /* color to set */ @@ -155,7 +155,7 @@ int color; /* color to set */ cfcolor = color; } -PASCAL NEAR ansibcol(color) /* set the current background color */ +ansibcol(color) /* set the current background color */ int color; /* color to set */ @@ -174,7 +174,7 @@ int color; /* color to set */ } #endif -PASCAL NEAR ansimove(row, col) +ansimove(row, col) { ttputc(ESC); ttputc('['); @@ -184,14 +184,14 @@ PASCAL NEAR ansimove(row, col) ttputc('H'); } -PASCAL NEAR ansieeol() +ansieeol() { ttputc(ESC); ttputc('['); ttputc('K'); } -PASCAL NEAR ansieeop() +ansieeop() { #if COLOR ansifcol(gfcolor); @@ -203,7 +203,7 @@ PASCAL NEAR ansieeop() ttputc('J'); } -PASCAL NEAR ansirev(state) /* change reverse video state */ +ansirev(state) /* change reverse video state */ int state; /* TRUE = reverse, FALSE = normal */ @@ -228,16 +228,16 @@ int state; /* TRUE = reverse, FALSE = normal */ #endif } -PASCAL NEAR ansicres() /* change screen resolution */ +ansicres() /* change screen resolution */ { return(TRUE); } #if PROTO -PASCAL NEAR spal(char *dummy) /* change pallette settings */ +spal(char *dummy) /* change pallette settings */ #else -PASCAL NEAR spal(dummy) /* change pallette settings */ +spal(dummy) /* change pallette settings */ char *dummy; #endif @@ -246,13 +246,13 @@ char *dummy; /* none for now */ } -PASCAL NEAR ansibeep() +ansibeep() { ttputc(BEL); ttflush(); } -PASCAL NEAR ansiparm(n) +ansiparm(n) register int n; { register int q,r; @@ -268,7 +268,7 @@ register int n; ttputc((n%10) + '0'); } -PASCAL NEAR ansiopen() +ansiopen() { #if USG | AIX | AUX | HPUX8 | HPUX9 | BSD | SUN | XENIX register char *cp; @@ -312,7 +312,7 @@ PASCAL NEAR ansiopen() #endif } -PASCAL NEAR ansiclose() +ansiclose() { #if COLOR @@ -342,12 +342,12 @@ PASCAL NEAR ansiclose() ttclose(); } -PASCAL NEAR ansikopen() /* open the keyboard (a noop here) */ +ansikopen() /* open the keyboard (a noop here) */ { } -PASCAL NEAR ansikclose() /* close the keyboard (a noop here) */ +ansikclose() /* close the keyboard (a noop here) */ { } @@ -358,7 +358,7 @@ PASCAL NEAR ansikclose() /* close the keyboard (a noop here) */ * * Nothing returned ***/ -void PASCAL NEAR ttputs(string) +void ttputs(string) char * string; /* String to write */ { if (string) @@ -378,7 +378,7 @@ static int inlen=0; NOSHARE int mouserow, mousecol; -int PASCAL NEAR readparam( v) /* Read an ansi parameter */ +int readparam( v) /* Read an ansi parameter */ int *v; /* Place to put parameter value */ { int ch; @@ -399,7 +399,7 @@ int *v; /* Place to put parameter value */ * * The 'x' in the arrays keypad[] and dec_fnkey[] are merely placeholders. */ -void PASCAL NEAR docsi( oh) +void docsi( oh) int oh; { static char crsr[4] = {'P', 'N', 'F', 'B'}; @@ -490,7 +490,7 @@ int oh; } } -void PASCAL NEAR dobbnmouse() +void dobbnmouse() { int params[ 5]; int i, ch; @@ -535,7 +535,7 @@ void PASCAL NEAR dobbnmouse() * that come from function keys, mouse reports, and cursor location * reports, and return them using Emacs's coding of these events. */ -PASCAL NEAR ansigetc() +ansigetc() { int ch; @@ -572,11 +572,11 @@ PASCAL NEAR ansigetc() } } #else -PASCAL NEAR ansigetc() {return( ttgetc());} + ansigetc() {return( ttgetc());} #endif #if FLABEL -int PASCAL NEAR fnclabel(f, n) /* label a function key */ +int fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument [unused] */ diff --git a/src/aosvs.c b/src/aosvs.c index 6286f36..dca5e92 100644 --- a/src/aosvs.c +++ b/src/aosvs.c @@ -722,7 +722,7 @@ int execprg(f, n) int pipecmd(f, n) { register int s; /* return status from CLI */ - register WINDOW *wp; /* pointer to new window */ + register EWINDOW *wp; /* pointer to new window */ register BUFFER *bp; /* pointer to buffer to zot */ char line[NLINE]; /* command line send to shell */ const char pipecmd_bname[] = "command"; @@ -831,7 +831,7 @@ int pipecmd(f, n) * filter a buffer through an external DOS program * Bound to ^X # */ -int filter(f, n) +int uefilter(f, n) { mlwrite(TEXT217); @@ -842,11 +842,11 @@ int filter(f, n) /* - return a system dependant string with the current time + return a system dependent string with the current time original version didn't work. modified idea of bill benedetto by doug rady. note the use of sys($ITIME, ...) instead of sys_itime() */ -char *PASCAL NEAR timeset() +char *timeset() { register char *sp; /* temp string pointer */ @@ -894,7 +894,7 @@ VOID do_system_end() mlputs(TEXT188); /* mlputs("[End]");*/ TTflush(); - while ((s = tgetc()) != '\r' && s != ' ') + while ((s = tgetc()) != RET_CHAR && s != ' ') ; } return; @@ -1357,7 +1357,7 @@ int f,n; /* default flag, numeric argument [unused] */ /* Change the current working directory */ -PASCAL NEAR int chdirectory() +int chdirectory() { #if CHDIR /* include this code? */ @@ -1846,11 +1846,11 @@ char gnfnrbuf[NFILEN]; /* return file buffer */ DIR *gnfndir; struct direct *gnfndirect; -char PASCAL NEAR *getnfile(); +char *getnfile(); /* do a template directory search (for file name completion) */ -char *PASCAL NEAR getffile(fspec) +char *getffile(fspec) char *fspec; /* pattern to match */ @@ -1893,7 +1893,7 @@ char *fspec; /* pattern to match */ return(getnfile()); } -char *PASCAL NEAR getnfile() +char *getnfile() { register int index; /* index into various strings */ diff --git a/src/cmdfix.c b/src/cmdfix.c index 490a5cb..780cae3 100644 --- a/src/cmdfix.c +++ b/src/cmdfix.c @@ -4,7 +4,7 @@ All Rights reserved The names of function key command strings have been changed to - help make these names machine independent. This program translates + help make these names machine independant. This program translates old files to new. */ @@ -13,7 +13,7 @@ #include #include "estruct.h" -PASCAL fix(); +fix(); /* Table of command key name changes */ @@ -87,7 +87,7 @@ char *trans[][2] = { "FNu", "FN^>", "FNv", "FN^V", "FNw", "FN^<", - "FN„", "FN^Z", + "FN�", "FN^Z", "set-fill-column", "set $fillcol", }; @@ -143,7 +143,7 @@ char *argv[]; /* text of command line arguments */ exit(0); } -PASCAL fix(fname) +fix(fname) char *fname; /* file to fix */ diff --git a/src/crypt.c b/src/crypt.c index 0aa5115..a2bc67d 100644 --- a/src/crypt.c +++ b/src/crypt.c @@ -11,12 +11,12 @@ #if CRYPT #if PROTO -static int PASCAL NEAR mod95(int); +static int mod95(int); #else -static int PASCAL NEAR mod95(); +static int mod95(); #endif -PASCAL NEAR setekey(f, n) /* reset encryption key of current buffer */ +int setekey(f, n) /* reset encryption key of current buffer */ int f; /* default flag */ int n; /* numeric argument */ @@ -54,22 +54,22 @@ int n; /* numeric argument */ * (C) Copyright 1986, Dana L. Hoggatt * 1216, Beck Lane, Lafayette, IN * - * When consulting directly with the author of this routine, - * please refer to this routine as the "DLH-POLY-86-B CIPHER". + * When consulting directly with the author of this routine, + * please refer to this routine as the "DLH-POLY-86-B CIPHER". * * This routine was written for Dan Lawrence, for use in V3.8 of - * MicroEMACS, a public domain text/program editor. + * MicroEMACS, a public domain text/program editor. * * I kept the following goals in mind when preparing this function: * * 1. All printable characters were to be encrypted back * into the printable range, control characters and * high-bit characters were to remain unaffected. this - * way, encrypted would still be just as cheap to + * way, encrypted would still be just as cheap to * transmit down a 7-bit data path as they were before. * - * 2. The encryption had to be portable. The encrypted - * file from one computer should be able to be decrypted + * 2. The encryption had to be portable. The encrypted + * file from one computer should be able to be decrypted * on another computer. * * 3. The encryption had to be inexpensive, both in terms @@ -78,69 +78,69 @@ int n; /* numeric argument */ * 4. The system needed to be secure against all but the * most determined of attackers. * - * For encryption of a block of data, one calls crypt passing - * a pointer to the data block and its length. The data block is - * encrypted in place, that is, the encrypted output overwrites - * the input. Decryption is totally isomorphic, and is performed - * in the same manner by the same routine. + * For encryption of a block of data, one calls crypt passing + * a pointer to the data block and its length. The data block is + * encrypted in place, that is, the encrypted output overwrites + * the input. Decryption is totally isomorphic, and is performed + * in the same manner by the same routine. * - * Before using this routine for encrypting data, you are expected + * Before using this routine for encrypting data, you are expected * to specify an encryption key. This key is an arbitrary string, - * to be supplied by the user. To set the key takes two calls to - * ecrypt(). First, you call + * to be supplied by the user. To set the key takes two calls to + * ecrypt(). First, you call * * ecrypt(NULL, vector) * - * This resets all internal control information. Typically (and - * specifically in the case on MICRO-emacs) you would use a "vector" - * of 0. Other values can be used to customize your editor to be - * "incompatable" with the normally distributed version. For + * This resets all internal control information. Typically (and + * specifically in the case on MICRO-emacs) you would use a "vector" + * of 0. Other values can be used to customize your editor to be + * "incompatable" with the normally distributed version. For * this purpose, the best results will be obtained by avoiding * multiples of 95. * - * Then, you "encrypt" your password by calling + * Then, you "encrypt" your password by calling * * ecrypt(pass, strlen(pass)) * - * where "pass" is your password string. Ecrypt() will destroy - * the original copy of the password (it becomes encrypted), - * which is good. You do not want someone on a multiuser system - * to peruse your memory space and bump into your password. - * Still, it is a better idea to erase the password buffer to - * defeat memory perusal by a more technical snooper. + * where "pass" is your password string. Ecrypt() will destroy + * the original copy of the password (it becomes encrypted), + * which is good. You do not want someone on a multiuser system + * to peruse your memory space and bump into your password. + * Still, it is a better idea to erase the password buffer to + * defeat memory perusal by a more technical snooper. * - * For the interest of cryptologists, at the heart of this - * function is a Beaufort Cipher. The cipher alphabet is the - * range of printable characters (' ' to '~'), all "control" + * For the interest of cryptologists, at the heart of this + * function is a Beaufort Cipher. The cipher alphabet is the + * range of printable characters (' ' to '~'), all "control" * and "high-bit" characters are left unaltered. * - * The key is a variant autokey, derived from a wieghted sum - * of all the previous clear text and cipher text. A counter - * is used as salt to obiterate any simple cyclic behavior - * from the clear text, and key feedback is used to assure - * that the entire message is based on the original key, - * preventing attacks on the last part of the message as if + * The key is a variant autokey, derived from a wieghted sum + * of all the previous clear text and cipher text. A counter + * is used as salt to obiterate any simple cyclic behavior + * from the clear text, and key feedback is used to assure + * that the entire message is based on the original key, + * preventing attacks on the last part of the message as if * it were a pure autokey system. * - * Overall security of encrypted data depends upon three - * factors: the fundamental cryptographic system must be - * difficult to compromise; exhaustive searching of the key - * space must be computationally expensive; keys and plaintext + * Overall security of encrypted data depends upon three + * factors: the fundamental cryptographic system must be + * difficult to compromise; exhaustive searching of the key + * space must be computationally expensive; keys and plaintext * must remain out of sight. This system satisfies this set * of conditions to within the degree desired for MicroEMACS. * - * Though direct methods of attack (against systems such as - * this) do exist, they are not well known and will consume + * Though direct methods of attack (against systems such as + * this) do exist, they are not well known and will consume * considerable amounts of computing time. An exhaustive * search requires over a billion investigations, on average. * - * The choice, entry, storage, manipulation, alteration, - * protection and security of the keys themselves are the - * responsiblity of the user. + * The choice, entry, storage, manipulation, alteration, + * protection and security of the keys themselves are the + * responsiblity of the user. * **********/ -VOID PASCAL NEAR ecrypt(bptr, len) +VOID ecrypt(bptr, len) register char *bptr; /* buffer of characters to be encrypted */ register unsigned len; /* number of characters in the buffer */ { @@ -170,26 +170,26 @@ register unsigned len; /* number of characters in the buffer */ key = (key & 0x1FFFFFFFl) ^ ((key >> 29) & 0x3l); -/** Down-bias the character, perform a Beaufort encipherment, and - up-bias the character again. We want key to be positive - so that the left shift here will be more portable and the +/** Down-bias the character, perform a Beaufort encipherment, and + up-bias the character again. We want key to be positive + so that the left shift here will be more portable and the mod95() faster **/ cc = mod95((int)(key % 95) - (cc - ' ')) + ' '; -/** the salt will spice up the key a little bit, helping to obscure - any patterns in the clear text, particularly when all the - characters (or long sequences of them) are the same. We do - not want the salt to go negative, or it will affect the key - too radically. It is always a good idea to chop off cyclics +/** the salt will spice up the key a little bit, helping to obscure + any patterns in the clear text, particularly when all the + characters (or long sequences of them) are the same. We do + not want the salt to go negative, or it will affect the key + too radically. It is always a good idea to chop off cyclics to prime values. **/ if (++salt >= 20857) { /* prime modulus */ salt = 0; } -/** our autokey (a special case of the running key) is being - generated by a weighted checksum of clear text, cipher +/** our autokey (a special case of the running key) is being + generated by a weighted checksum of clear text, cipher text, and salt. I had to allow the older broken key calculation to let us decrypt @@ -202,7 +202,7 @@ register unsigned len; /* number of characters in the buffer */ return; } -static int PASCAL NEAR mod95(val) +static int mod95(val) register int val; diff --git a/src/dg10.c b/src/dg10.c index c6d7799..69c885b 100644 --- a/src/dg10.c +++ b/src/dg10.c @@ -21,25 +21,25 @@ #define BEL 0x07 /* BEL character. */ #define ESC 30 /* DG10 ESC character. */ -extern PASCAL NEAR ttopen(); /* Forward references. */ -extern PASCAL NEAR ttgetc(); -extern PASCAL NEAR ttputc(); -extern PASCAL NEAR ttflush(); -extern PASCAL NEAR ttclose(); -extern PASCAL NEAR dg10kopen(); -extern PASCAL NEAR dg10kclose(); -extern PASCAL NEAR dg10move(); -extern PASCAL NEAR dg10eeol(); -extern PASCAL NEAR dg10eeop(); -extern PASCAL NEAR dg10beep(); -extern PASCAL NEAR dg10open(); -extern PASCAL NEAR dg10rev(); -extern PASCAL NEAR dg10close(); -extern PASCAL NEAR dg10cres(); +extern ttopen(); /* Forward references. */ +extern ttgetc(); +extern ttputc(); +extern ttflush(); +extern ttclose(); +extern dg10kopen(); +extern dg10kclose(); +extern dg10move(); +extern dg10eeol(); +extern dg10eeop(); +extern dg10beep(); +extern dg10open(); +extern dg10rev(); +extern dg10close(); +extern dg10cres(); #if COLOR -extern PASCAL NEAR dg10fcol(); -extern PASCAL NEAR dg10bcol(); +extern dg10fcol(); +extern dg10bcol(); int cfcolor = -1; /* current forground color */ int cbcolor = -1; /* current background color */ @@ -80,7 +80,7 @@ TERM term = { }; #if COLOR -PASCAL NEAR dg10fcol(color) /* set the current output color */ +dg10fcol(color) /* set the current output color */ int color; /* color to set */ @@ -93,7 +93,7 @@ int color; /* color to set */ cfcolor = color; } -PASCAL NEAR dg10bcol(color) /* set the current background color */ +dg10bcol(color) /* set the current background color */ int color; /* color to set */ @@ -107,19 +107,19 @@ int color; /* color to set */ } #endif -PASCAL NEAR dg10move(row, col) +dg10move(row, col) { ttputc(16); ttputc(col); ttputc(row); } -PASCAL NEAR dg10eeol() +dg10eeol() { ttputc(11); } -PASCAL NEAR dg10eeop() +dg10eeop() { #if COLOR dg10fcol(gfcolor); @@ -130,7 +130,7 @@ PASCAL NEAR dg10eeop() ttputc(0106); } -PASCAL NEAR dg10rev(state) /* change reverse video state */ +dg10rev(state) /* change reverse video state */ int state; /* TRUE = reverse, FALSE = normal */ @@ -146,25 +146,25 @@ int state; /* TRUE = reverse, FALSE = normal */ #endif } -PASCAL NEAR dg10cres() /* change screen resolution */ +dg10cres() /* change screen resolution */ { return(TRUE); } -PASCAL NEAR spal() /* change palette string */ +spal() /* change palette string */ { /* Does nothing here */ } -PASCAL NEAR dg10beep() +dg10beep() { ttputc(BEL); ttflush(); } -PASCAL NEAR dg10open() +dg10open() { strcpy(sres, "NORMAL"); strcpy(os, "DG10); @@ -172,7 +172,7 @@ PASCAL NEAR dg10open() ttopen(); } -PASCAL NEAR dg10close() +dg10close() { #if COLOR @@ -182,18 +182,18 @@ PASCAL NEAR dg10close() ttclose(); } -PASCAL NEAR dg10kopen() +dg10kopen() { } -PASCAL NEAR dg10kclose() +dg10kclose() { } #if FLABEL -PASCAL NEAR fnclabel(f, n) /* label a function key */ +fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument [unused] */ diff --git a/src/dolock.c b/src/dolock.c index f6c0592..ef4fb24 100644 --- a/src/dolock.c +++ b/src/dolock.c @@ -32,7 +32,7 @@ char *fname; { int i,j,k,lun,status; char xname[95],c; - + for(lun=4; _getfnam(lun,xname) == 0; lun++) { for(i=0;i= buf) && (*c == '\r') || (*c == '\n') || (*c == ' ') + while (((c >= buf) && (*c == RET_CHAR)) || (*c == '\n') || (*c == ' ') || (*c == '\t')) { *c = 0; c--; @@ -207,19 +207,21 @@ char *buf; char *dolock(filespec) -char *filespec; /* full file spec of file to lock */ +CONST char *filespec; /* full file spec of file to lock */ { struct stat sb; /* stat buffer for info on files/dirs */ FILE *fp; /* ptr to lock file */ - long proc_id; /* process id from lock file */ char filename[NFILEN]; /* name of file to lock */ char pathname[NFILEN]; /* path leading to file to lock */ char drivename[NFILEN]; /* drive for file to lock */ char lockpath[NFILEN]; /* lock directory name */ char lockfile[NFILEN]; /* lock file name */ char buf[NSTRING]; /* input buffer */ +#if SUN + long proc_id; /* process id from lock file */ char host[NSTRING]; /* current host name */ +#endif static char result[NSTRING]; /* error return string */ /* separate filespec into components */ @@ -357,8 +359,9 @@ char *filespec; /* full file spec of file to lock */ /* get the process id */ fgets(buf, NSTRING, fp); +#if SUN proc_id = asc_int(buf); - +#endif /* get the user name */ fgets(result, NSTRING, fp); term_trim(result); @@ -399,14 +402,14 @@ char *filespec; /* full file spec of file to lock */ * * undolock -- unlock the file fname * - * if successful, returns NULL + * if successful, returns NULL * if other error, returns "LOCK ERROR: explanation" * *********************/ char *undolock(filespec) -char *filespec; /* filespec to unlock */ +CONST char *filespec; /* filespec to unlock */ { char filename[NFILEN]; /* name of file to lock */ @@ -445,9 +448,9 @@ char *filespec; /* filespec to unlock */ #if LOCKDEBUG printf("Lockfile [%s]\n", lockfile); tgetc(); #endif - if (unlink(lockfile)) { - strcat(result, "could not remove lock file"); - return(result); + if (unlink(lockfile)) { + strcat(result, "could not remove lock file"); + return(result); } else { rmdir(lockpath); /* this will work only if dir is empty */ return(NULL); @@ -455,7 +458,7 @@ char *filespec; /* filespec to unlock */ } #else -dolhello() +VOID dolhello(VOID) { } #endif diff --git a/src/exec.c b/src/exec.c index 88298c7..511adca 100644 --- a/src/exec.c +++ b/src/exec.c @@ -11,16 +11,16 @@ /* namedcmd: execute a named command even if it is not bound */ -PASCAL NEAR namedcmd(f, n) +int namedcmd(f, n) int f, n; /* command arguments [passed through to command executed] */ { - int (PASCAL NEAR *kfunc)(); /* ptr to the function to execute */ + int (*kfunc)(); /* ptr to the function to execute */ char buffer[NSTRING]; /* buffer to store function name */ int status; - /* if we are non-interactive.... force the command interactivly */ + /* if we are non-interactive.... force the command interactively */ if (clexec == TRUE) { /* grab token and advance past */ @@ -37,7 +37,7 @@ int f, n; /* command arguments [passed through to command executed] */ /* "[No such Function]" */ return(FALSE); } - + /* and execute it INTERACTIVE */ clexec = FALSE; status = (*kfunc)(f, n); /* call the function */ @@ -47,7 +47,8 @@ int f, n; /* command arguments [passed through to command executed] */ /* prompt the user to type a named command */ /* and get the function name to execute */ - kfunc = getname(": "); + kfunc = getname(TEXT338); /* "space for help :" */ + if (kfunc == NULL) { mlwrite(TEXT16); /* "[No such function]" */ @@ -61,7 +62,7 @@ int f, n; /* command arguments [passed through to command executed] */ /* execcmd: Execute a command line command to be typed in by the user */ -PASCAL NEAR execcmd(f, n) +int execcmd(f, n) int f, n; /* default Flag and Numeric argument */ @@ -88,14 +89,14 @@ int f, n; /* default Flag and Numeric argument */ */ -PASCAL NEAR docmd(cline) +int docmd(cline) char *cline; /* command line to execute */ { register int f; /* default argument flag */ register int n; /* numeric repeat value */ - int (PASCAL NEAR *fnc)();/* function to execute */ + int (*fnc)();/* function to execute */ BUFFER *bp; /* buffer to execute */ int status; /* return status of function */ int oldcle; /* old contents of clexec flag */ @@ -161,7 +162,7 @@ char *cline; /* command line to execute */ execstr = oldestr; return(status); } - + /* save the arguments and go execute the command */ oldcle = clexec; /* save old clexec flag */ clexec = TRUE; /* in cline execution */ @@ -176,7 +177,7 @@ char *cline; /* command line to execute */ return a pointer past the token */ -char *PASCAL NEAR token(src, tok, size) +char *token(src, tok, size) char *src, *tok; /* source string, destination token string */ int size; /* maximum size of token */ @@ -205,6 +206,7 @@ int size; /* maximum size of token */ case 'b': c = 8; break; case 'f': c = 12; break; case 'e': c = 27; break; + case '"': c = '"';break; default: c = *(src-1); } if (--size > 0) { @@ -238,7 +240,7 @@ int size; /* maximum size of token */ return(src); } -PASCAL NEAR macarg(tok) /* get a macro line argument */ +int macarg(tok) /* get a macro line argument */ char *tok; /* buffer to place argument */ @@ -248,22 +250,22 @@ char *tok; /* buffer to place argument */ savcle = clexec; /* save execution mode */ clexec = TRUE; /* get the argument */ - status = nextarg("", tok, NSTRING, ctoec('\r')); + status = nextarg("", tok, NSTRING, ctoec(RET_CHAR)); clexec = savcle; /* restore execution mode */ return(status); } /* nextarg: get the next argument */ -PASCAL NEAR nextarg(prompt, buffer, size, terminator) +int nextarg(prompt, buffer, size, terminator) -char *prompt; /* prompt to use if we must be interactive */ +CONST char *prompt; /* prompt to use if we must be interactive */ char *buffer; /* buffer to put token into */ int size; /* size of the buffer */ int terminator; /* terminating char to be used on interactive fetch */ { - register char *sp; /* return pointer from getval() */ + register CONST char *sp; /* return pointer from getval() */ /* if we are interactive, go get it! */ if (clexec == FALSE) { @@ -274,7 +276,7 @@ int terminator; /* terminating char to be used on interactive fetch */ else movecursor(term.t_nrow, 0); - return(getstring(buffer, size, terminator)); + return(getstring((unsigned char*) buffer, size, terminator)); } /* grab token and advance past */ @@ -290,7 +292,7 @@ int terminator; /* terminating char to be used on interactive fetch */ /* storeproc: Set up a procedure buffer and flag to store all executed command lines there */ -PASCAL NEAR storeproc(f, n) +int storeproc(f, n) int f; /* default flag */ int n; /* macro number to use */ @@ -352,7 +354,7 @@ int n; /* macro number to use */ /* on to the next parameter */ execstr = token(execstr, bname, NVSIZE); } - + /* and set the macro store pointers to it */ mstore = TRUE; bstore = bp; @@ -361,7 +363,7 @@ int n; /* macro number to use */ /* execproc: Execute a procedure */ -PASCAL NEAR execproc(f, n) +int execproc(f, n) int f, n; /* default flag and numeric arg */ @@ -395,7 +397,7 @@ int f, n; /* default flag and numeric arg */ /* execbuf: Execute the contents of a buffer of commands */ -PASCAL NEAR execbuf(f, n) +int execbuf(f, n) int f, n; /* default flag and numeric arg */ @@ -430,13 +432,13 @@ int f, n; /* default flag and numeric arg */ !force Force macro to continue...even if command fails !while (cond) Execute a loop if the condition is true !endwhile - + Line Labels begin with a "*" as the first nonblank char, like: *LBL01 */ -PASCAL NEAR dobuf(bp) +int dobuf(bp) BUFFER *bp; /* buffer to execute */ @@ -454,11 +456,11 @@ BUFFER *bp; /* buffer to execute */ WHBLOCK *whlist; /* ptr to !WHILE list */ WHBLOCK *scanner; /* ptr during scan */ WHBLOCK *whtemp; /* temporary ptr to a WHBLOCK */ - char *einit; /* initial value of eline */ + char *einit = NULL; /* initial value of eline */ char *eline; /* text of line to execute */ char tkn[NSTRING]; /* buffer to evaluate an expresion in */ int num_locals; /* number of local variables used in procedure */ - UTABLE *ut; /* new local user variable table */ + UTABLE *ut = NULL; /* new local user variable table */ #if LOGFLG FILE *fp; /* file handle for log file */ #endif @@ -654,7 +656,7 @@ failexit: freewhile(scanner); fprintf(fp, "%s", outline); fclose(fp); #endif - + /* only do this if we are debugging */ if (macbug && !mstore && (execlevel == 0)) if (debug(bp, eline, &skipflag) == FALSE) { @@ -700,11 +702,11 @@ failexit: freewhile(scanner); /* "Out of memory while storing macro" */ goto eabort; } - + /* copy the text into the new line */ for (i=0; ib_linep->l_bp->l_fp = mp; mp->l_bp = bstore->b_linep->l_bp; @@ -712,7 +714,7 @@ failexit: freewhile(scanner); mp->l_fp = bstore->b_linep; goto onward; } - + force = FALSE; /* dump comments */ @@ -751,7 +753,7 @@ failexit: freewhile(scanner); goto onward; } /* drop down and act just like !BREAK */ - + /* no break */ case DBREAK: /* BREAK directive */ if (dirnum == DBREAK && execlevel) goto onward; @@ -764,13 +766,13 @@ failexit: freewhile(scanner); break; whtemp = whtemp->w_next; } - + if (whtemp == NULL) { errormesg(TEXT126, bp, lp); /* "%%Internal While loop error" */ goto eabort; } - + /* reset the line pointer back.. */ lp = whtemp->w_end; goto onward; @@ -813,7 +815,7 @@ failexit: freewhile(scanner); goto eabort; } goto onward; - + case DRETURN: /* RETURN directive */ /* if we are executing.... */ if (execlevel == 0) { @@ -844,13 +846,13 @@ failexit: freewhile(scanner); break; whtemp = whtemp->w_next; } - + if (whtemp == NULL) { errormesg(TEXT126, bp, lp); /* "%%Internal While loop error" */ goto eabort; } - + /* reset the line pointer back.. */ lp = lback(whtemp->w_begin); goto onward; @@ -943,9 +945,9 @@ freeut: uv_head = ut->next; /* errormesg: display a macro execution error along with the buffer and line currently being executed */ -VOID PASCAL NEAR errormesg(mesg, bp, lp) +VOID errormesg(mesg, bp, lp) -char *mesg; /* error message to display */ +CONST char *mesg; /* error message to display */ BUFFER *bp; /* buffer error occured in */ LINE *lp; /* line " */ @@ -971,7 +973,7 @@ LINE *lp; /* line " */ if $debug == TRUE, The interactive debugger is invoked commands are listed out with the ? key */ -PASCAL NEAR debug(bp, eline, skipflag) +int debug(bp, eline, skipflag) BUFFER *bp; /* buffer to execute */ char *eline; /* text of line to debug */ @@ -1022,7 +1024,7 @@ dinput: outline[term.t_ncol - 1] = 0; /* META key turns off debugging */ key = getbind(c); - if (key && key->k_type == BINDFNC && key && key->k_ptr.fp == meta) + if (key && key->k_type == BINDFNC && key && key->k_ptr.fp == uemeta) macbug = FALSE; else if (c == abortc) { @@ -1062,7 +1064,7 @@ dinput: outline[term.t_ncol - 1] = 0; oldinp = disinp; disinp = TRUE; mlwrite("Exp:"); - getstring(&temp[11], NSTRING, ctoec(RETCHAR)); + getstring((unsigned char*) &temp[11], NSTRING, ctoec(RETCHAR)); disinp = oldinp; oldstatus = cmdstatus; docmd(temp); @@ -1078,7 +1080,7 @@ dinput: outline[term.t_ncol - 1] = 0; oldinp = disinp; disinp = TRUE; mlwrite("Exp: "); - getstring(temp, NSTRING, ctoec(RETCHAR)); + getstring((unsigned char*) temp, NSTRING, ctoec(RETCHAR)); disinp = oldinp; strcpy(track, "set %track "); strcat(track, temp); @@ -1099,7 +1101,7 @@ dinput: outline[term.t_ncol - 1] = 0; return(TRUE); } -VOID PASCAL NEAR freewhile(wp) /* free a list of while block pointers */ +VOID freewhile(wp) /* free a list of while block pointers */ WHBLOCK *wp; /* head of structure to free */ @@ -1110,14 +1112,14 @@ WHBLOCK *wp; /* head of structure to free */ } } -PASCAL NEAR execfile(f, n) /* execute a series of commands in a file */ +int execfile(f, n) /* execute a series of commands in a file */ int f, n; /* default flag and numeric arg to pass on to file */ { register int status; /* return status of name query */ char fname[NSTRING]; /* name of file to execute */ - char *fspec; /* full file spec */ + CONST char *fspec; /* full file spec */ #if WINDOW_MSWIN /* special case: we want filenamedlg to refrain from stuffing a @@ -1161,9 +1163,9 @@ int f, n; /* default flag and numeric arg to pass on to file */ /* dofile: yank a file into a buffer and execute it if there are no errors, delete the buffer on exit */ -PASCAL NEAR dofile(fname) +int dofile(fname) -char *fname; /* file name to execute */ +CONST char *fname; /* file name to execute */ { register BUFFER *bp; /* buffer to place file to exeute */ diff --git a/src/file.c b/src/file.c index 7091ec0..cbd93f2 100644 --- a/src/file.c +++ b/src/file.c @@ -14,8 +14,20 @@ #if BSD | FREEBSD | SUN | USG | AIX #include #include +# if BACKUP +# include +# endif +#endif +#if THEOS +# include +# include +#endif +#if (MSDOS|TOS) +# include +# include +# include +# include #endif - /* * Read a file into the current * buffer. This is really easy; all you do is @@ -23,9 +35,9 @@ * "read a file into the current buffer" code. * Bound to "C-X C-R". */ -PASCAL NEAR fileread(f, n) +int fileread(f, n) -int f, n; /* defualt and numeric arguments (unused) */ +int f, n; /* default and numeric arguments (unused) */ { char *fname; /* file name to read */ @@ -36,6 +48,10 @@ int f, n; /* defualt and numeric arguments (unused) */ if ((fname = gtfilename(TEXT131)) == NULL) /* "Read file" */ return(FALSE); +#if THEOS4 + if (! addlname(fname)) + return (FALSE); +#endif return(readin(fname, TRUE)); } @@ -46,23 +62,27 @@ int f, n; /* defualt and numeric arguments (unused) */ * "insert a file into the current buffer" code. * Bound to "C-X C-I". */ -PASCAL NEAR insfile(f, n) +int insfile(f, n) int f,n; /* prefix flag and argument */ { register int s; char *fname; /* file name */ - LINE *curline; + LINE *curline = NULL; if (restflag) /* don't allow this command if restricted */ return(resterr()); if (curbp->b_mode&MDVIEW) /* don't allow this command if */ return(rdonly()); /* we are in read only mode */ - if ((fname = gtfilename(TEXT132)) == NULL) + if ((fname = gtfilename(TEXT132)) == NULL) /* "Insert file" */ return(FALSE); +#if THEOS4 + if (! addlname(fname)) + return (FALSE); +#endif /* * Save the local pointers to hold global ".", in case * $yankflag is set to 1. Insert-file always places the @@ -89,7 +109,7 @@ int f,n; /* prefix flag and argument */ * text, and switch to the new buffer. * Bound to C-X C-F. */ -PASCAL NEAR filefind(f, n) +int filefind(f, n) int f,n; /* prefix flag and argument */ @@ -99,13 +119,17 @@ int f,n; /* prefix flag and argument */ if (restflag) /* don't allow this command if restricted */ return(resterr()); - if ((fname = gtfilename(TEXT133)) == NULL) + if ((fname = gtfilename(TEXT133)) == NULL) /* "Find file" */ return(FALSE); +#if THEOS4 + if (! addlname(fname)) + return (FALSE); +#endif return(getfile(fname, TRUE)); } -PASCAL NEAR viewfile(f, n) /* visit a file in VIEW mode */ +int viewfile(f, n) /* visit a file in VIEW mode */ int f,n; /* prefix flag and argument */ @@ -116,9 +140,13 @@ int f,n; /* prefix flag and argument */ if (restflag) /* don't allow this command if restricted */ return(resterr()); - if ((fname = gtfilename(TEXT134)) == NULL) + if ((fname = gtfilename(TEXT134)) == NULL) /* "View file" */ return(FALSE); +#if THEOS4 + if (! addlname(fname)) + return (FALSE); +#endif s = getfile(fname, FALSE); if (s) { /* if we succeed, put it in view mode */ curwp->w_bufp->b_mode |= MDVIEW; @@ -128,7 +156,7 @@ int f,n; /* prefix flag and argument */ } #if CRYPT -PASCAL NEAR resetkey() /* reset the encryption key if needed */ +int resetkey() /* reset the encryption key if needed */ { register int s; /* return status */ @@ -161,7 +189,7 @@ PASCAL NEAR resetkey() /* reset the encryption key if needed */ } #endif -PASCAL NEAR getfile(fname, lockfl) +int getfile(fname, lockfl) char fname[]; /* file name to find */ int lockfl; /* check the file for locks? */ @@ -171,11 +199,11 @@ int lockfl; /* check the file for locks? */ register LINE *lp; register int i; register int s; - SCREEN *sp; /* screen pointer, if we need it */ + ESCREEN *sp; /* screen pointer, if we need it */ char bname[NBUFN]; /* buffer name to put file */ char prompt[NSTRING]; /* string for collisions prompt */ -#if MSDOS | WINNT | WINXP | AOSVS | VMS | TOS +#if MSDOS | WINNT | WINXP | AOSVS | VMS | TOS | THEOS4 mklower(fname); /* msdos isn't case sensitive */ #endif for (bp=bheadp; bp!=NULL; bp=bp->b_bufp) { @@ -232,7 +260,7 @@ int lockfl; /* check the file for locks? */ */ if (newscreenflag) { sp = lookup_screen(bname); - if (sp == (SCREEN *)NULL) { + if (sp == (ESCREEN *)NULL) { /* screen does not exist, create it */ sp = init_screen(bname, bp); } @@ -247,14 +275,14 @@ int lockfl; /* check the file for locks? */ Read file "fname" into the current buffer, blowing away any text found there. Called by both the read and find commands. Return the final status of the read. Also called by the mainline, to - read in a file specified on the command line as an argument. + read in a file specified on the command line as an argument. The command in $readhook is called after the buffer is set up - and before it is read. + and before it is read. */ -PASCAL NEAR readin(fname, lockfl) +int readin(fname, lockfl) -char fname[]; /* name of file to read */ +CONST char* fname; /* name of file to read */ int lockfl; /* check for file locks? */ { @@ -270,7 +298,8 @@ int lockfl; /* check for file locks? */ char mesg[NSTRING]; #if FILOCK - force_read = FALSE; + int force_read = FALSE; + if (lockfl && lockchk(fname) == ABORT) force_read = TRUE; #endif @@ -386,16 +415,56 @@ int lockfl; /* check for file locks? */ * Returns a pointer into fname indicating the end of the file path; i.e., * 1 character BEYOND the path name. */ -char *PASCAL NEAR makename(bname, fname) +CONST char *makename(bname, fname) char *bname; -char *fname; +CONST char *fname; { - register char *cp1; + register CONST char *cp1; register char *cp2; - register char *pathp; + register CONST char *pathp; + +#if THEOS +#if THEOS4 + register int np = 0; + + cp1 = fname; + while (*cp1) { + if (*cp1 == '.') + np++; + ++cp1; + } + if (np != 2) { + while (cp1 != fname && cp1[-1] != '/' && *cp1 != '\\') + --cp1; + } else + cp1 = strrchr(fname,'.')+1; + + /* cp1 is pointing to the first real filename char */ + pathp = cp1; + + cp2 = bname; + while (cp2!=&bname[NBUFN-1] && *cp1 && *cp1!=':' && *cp1!='.') + *cp2++ = *cp1++; + *cp2 = 0; +#else + cp1 = fname; + while (*cp1 != 0) + ++cp1; + + while (cp1 != fname && cp1[-1] != '/' && *cp1 != '\\') + --cp1; + + /* cp1 is pointing to the first real filename char */ + pathp = cp1; + cp2 = bname; + while (cp2!=&bname[NBUFN-1] && *cp1 && *cp1!=':') + *cp2++ = *cp1++; + *cp2 = 0; +#endif +#else /* ?THEOS */ #if AOSVS | MV_UX resolve_full_pathname(fname, fname); mklower(fname); /* aos/vs not case sensitive */ @@ -428,7 +497,7 @@ char *fname; while (cp1!=&fname[0] && cp1[-1]!=':' && cp1[-1]!='\\'&&cp1[-1]!='/') --cp1; #endif -#if USG | AIX | AUX | SMOS | HPUX8 | HPUX9 | BSD | FREEBSD | SUN | XENIX | AVIION +#if USG | LINUX | AIX | AUX | SMOS | HPUX8 | HPUX9 | BSD | FREEBSD | SUN | XENIX | AVIION while (cp1!=&fname[0] && cp1[-1]!='/') --cp1; #endif @@ -444,10 +513,11 @@ char *fname; *cp2++ = *cp1++; *cp2 = 0; +#endif /* !THEOS */ return(pathp); } -VOID PASCAL NEAR unqname(name) /* make sure a buffer name is unique */ +VOID unqname(name) /* make sure a buffer name is unique */ char *name; /* name to check on */ @@ -480,7 +550,7 @@ char *name; /* name to check on */ * and ^X^A for appending. */ -PASCAL NEAR filewrite(f, n) +int filewrite(f, n) int f, n; /* emacs arguments */ @@ -494,6 +564,10 @@ int f, n; /* emacs arguments */ if ((fname = gtfilename(TEXT144)) == NULL) /* "Write file: " */ return(FALSE); +#if THEOS4 + if (! addlname(fname)) + return (FALSE); +#endif if ((s=writeout(fname, "w")) == TRUE) { strcpy(curbp->b_fname, fname); curbp->b_flag &= ~BFCHG; @@ -503,7 +577,7 @@ int f, n; /* emacs arguments */ return(s); } -PASCAL NEAR fileapp(f, n) /* append file */ +int fileapp(f, n) /* append file */ int f, n; /* emacs arguments */ @@ -532,7 +606,7 @@ int f, n; /* emacs arguments */ * name for the buffer. Bound to "C-X C-S". May * get called by "C-Z". */ -PASCAL NEAR filesave(f, n) +int filesave(f, n) int f,n; /* prefix flag and argument */ @@ -577,6 +651,90 @@ int f,n; /* prefix flag and argument */ return(s); } +#if (MSDOS|TOS) +char* backname(char* tname, char* fn) +{ + char* p; + + strcpy(tname, fn); + if ((p = strchr(tname, '.') != NULL) + *p = '\0'; + + return strcat(tname, ".bak"); +} + +#elif BSD | SUN | V7 | USG | LINUX + +char* backname(char* tname, CONST char* fn) +{ + strcpy(tname, fn); + return strcat(tname, "~"); +} + +#elif THEOS4 + +extern char* backname(char* tname, CONST char* fn) +{ + char fname[NFILEN]; + char rname[NFILEN]; + char dname[NFILEN]; + char* p; + char* q; + char* d; + + strcpy(fname, fn); + + if ((p = strchr(fname, ':')) != NULL) { + strcpy(dname, p); + *p = '\0'; + } else + dname[0] = '\0'; + + if ((q = strrchr(fname, '/')) == NULL) + q = fname; + + if ((p = strchr(q, '.')) != NULL) { + strcpy(tname, fname); + + if ((q = strchr(p + 1, '.')) == NULL) { + strcpy(strrchr(tname, '.'), ".BACKUP"); + } else { + if ((p = strrchr(tname, '/')) == NULL) + p = tname; + else + p++; + + strcpy(p, q + 1); + strcat(p, ".BACKUP"); + } + } else + strcat(strcpy(tname, fname), ".BACKUP"); + + strcat(tname, dname); + return tname; +} + +#elif THEOS + +extern char* backname(char* tname, CONST char* fn) +{ + char dname[NFILEN]; + char* p; + + strcpy(tname, fn); + + if ((p = strchr(tname, ':')) != NULL) { + strcpy(dname, p); + *p = '\0'; + } else + dname[0] = '\0'; + + strcat(tbame, ".bak"); + strcat(tname, dname); + return tname; +} + +#endif /* * This function performs the details of file writing. It uses * the file management routines in the "fileio.c" package. The @@ -588,7 +746,7 @@ int f,n; /* prefix flag and argument */ * a user specifyable routine (in $writehook) can be run. */ -PASCAL NEAR writeout(fn, mode) +int writeout(fn, mode) char *fn; /* name of file to write current buffer to */ char *mode; /* mode to open file (w = write a = append) */ @@ -598,19 +756,34 @@ char *mode; /* mode to open file (w = write a = append) */ register long nline; /* number of lines written */ int status; /* return status */ int sflag; /* are we safe saving? */ - char tname[NSTRING]; /* temporary file name */ + char tname[NFILEN]; /* temporary file name */ + char bname[NFILEN]; /* backup file name */ char buf[NSTRING]; /* message buffer */ -#if BSD | FREEBSD | SUN | XENIX | USG | AIX +#if BSD | FREEBSD | SUN | XENIX | USG | AIX | THEOS struct stat st; /* we need info about the file permisions */ #endif +#if BACKUP +# if (MSDOS|TOS) +# if TOS +# define EACCES AEACCDN +# endif /* TOS */ + + struct stat st; + extern char *strchr(); + char *p; +# endif /* (MSDOS|TOS) */ +#endif /* BACKUP */ /* let a user macro get hold of things...if he wants */ execkey(&writehook, FALSE, 1); /* determine if we will use the save method */ - sflag = FALSE; - if (ssave && fexist(fn) && *mode == 'w') - sflag = TRUE; + sflag = ((ssave +#if BACKUP + || (curbp->b_mode & MDNOBAK) == 0 +#endif + ) + && fexist(fn) && *mode == 'w') ? TRUE : FALSE; #if CRYPT /* set up for file encryption */ @@ -622,6 +795,16 @@ char *mode; /* mode to open file (w = write a = append) */ /* turn off ALL keyboard translation in case we get a dos error */ TTkclose(); +#if BACKUP + backname(bname, fn); + + if (sflag && access(bname, 0) == 0 && unlink(bname) == EOF) { + TTkopen(); + mlwrite(TEXT49, bname); + return(FALSE); + } +#endif /* BACKUP */ + /* Perform Safe Save..... */ if (sflag) { /* duplicate original file name, and find where to trunc it */ @@ -680,18 +863,47 @@ char *mode; /* mode to open file (w = write a = append) */ strcat(buf, "s"); if (sflag) { -#if BSD | FREEBSD | SUN | XENIX | USG | AIX +#if BSD | FREEBSD | SUN | XENIX | USG | AIX | THEOS /* get the permisions on the original file */ +#if defined(S_ISLNK) && ! THEOS +#if defined(UW7) || defined(LINUX) + struct stat stl; + stat(fn, &st); + lstat(fn, &stl); +#else + statlstat(fn, &st); +#endif + + if (S_ISLNK(stl.st_mode)) { + char ln[NFILEN]; + int l; + l = readlink(fn, ln, sizeof(ln)); + if (l > -1) { + ln[l] = '\0'; + strcpy(fn, ln); + } + } +#endif stat(fn, &st); #endif - /* erase original file */ +#if BACKUP + /* move original file to backup */ + status = rename(fn, bname); +#else + /* remove original file */ + status = unlink(fn); +#endif /* rename temporary file to original name */ - if (unlink(fn) == 0 && rename(tname, fn) == 0) { + if (status == 0 && rename(tname, fn) == 0) { #if BSD | FREEBSD | SUN | XENIX | USG | AIX chown(fn, (int)st.st_uid, (int)st.st_gid); chmod(fn, (int)st.st_mode); +#else +#if THEOS + _chstat(fn, st.st_protect); #else ; +#endif #endif } else { strcat(buf, TEXT150); @@ -704,6 +916,11 @@ char *mode; /* mode to open file (w = write a = append) */ mlwrite(buf); } +#if BACKUP + if (curbp->b_mode & MDNOBAK) + unlink(bname); +#endif + /* reopen the keyboard, and return our status */ TTkopen(); return(status == FIOSUC); @@ -719,7 +936,7 @@ char *mode; /* mode to open file (w = write a = append) */ * prompt if you wish. */ -PASCAL NEAR filename(f, n) +int filename(f, n) int f,n; /* prefix flag and argument */ @@ -734,8 +951,13 @@ int f,n; /* prefix flag and argument */ return(s); if (s == FALSE) strcpy(curbp->b_fname, ""); - else + else { +#if THEOS4 + if (! addlname(fname)) + return (FALSE); +#endif strcpy(curbp->b_fname, fname); + } /* Update mode lines. */ upmode(); curbp->b_mode &= ~MDVIEW; /* no longer read only mode */ @@ -747,7 +969,7 @@ int f,n; /* prefix flag and argument */ * buffer, Called by insert file command. Return the final * status of the read. */ -PASCAL NEAR ifile(fname) +int ifile(fname) char fname[]; { register LINE *lp0; @@ -859,7 +1081,7 @@ char fname[]; names of all the files in a given directory */ -PASCAL NEAR showfiles(f, n) +int showfiles(f, n) int f,n; /* prefix flag and argument */ diff --git a/src/fileio.c b/src/fileio.c index 78fb5f9..82fdec6 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -28,8 +28,8 @@ char file_buffer[FILE_BUFSIZE]; */ #if !(VMS & RMSIO) /* if using RMS under VMS, the code */ /* is in VMS.C */ -PASCAL NEAR ffropen(fn) -char *fn; +int ffropen(fn) +CONST char *fn; { if ((ffp=fopen(fn, "r")) == NULL) return(FIOFNF); @@ -51,9 +51,9 @@ char *fn; * (cannot create). */ #if AOSVS == 0 -PASCAL NEAR ffwopen(fn, mode) -char *fn; -char *mode; /* mode to open file for */ +int ffwopen(fn, mode) +CONST char *fn; +CONST char *mode; /* mode to open file for */ { char xmode[6]; /* extended file open mode */ @@ -91,7 +91,7 @@ char *mode; /* mode to open file for */ /* * Close a file. Should look at the status in all systems. */ -PASCAL NEAR ffclose() +int ffclose() { /* free this since we do not need it anymore */ if (fline) { @@ -105,7 +105,7 @@ PASCAL NEAR ffclose() #if MSDOS & CTRLZ putc(26, ffp); /* add a ^Z at the end of the file */ #endif - + #if USG | AIX | AUX | SMOS | HPUX8 | HPUX9 | SUN | XENIX | BSD || FREEBSD | WMCS | VMS | (MSDOS & (LATTICE | MSC | TURBO | IC | ZTC)) | WINNT | WINXP | OS2 | (TOS & MWC) | AVIION if (fclose(ffp) != FALSE) { mlwrite(TEXT156); @@ -124,7 +124,7 @@ PASCAL NEAR ffclose() * and the "nbuf" is its length, less the free newline. Return the status. * Check only at the newline. */ -PASCAL NEAR ffputline(buf, nbuf) +int ffputline(buf, nbuf) char buf[]; int nbuf; @@ -183,7 +183,7 @@ int nbuf; * at the end of the file that don't have a newline present. Check for I/O * errors too. Return status. */ -PASCAL NEAR ffgetline(nbytes) +int ffgetline(nbytes) int *nbytes; @@ -256,7 +256,7 @@ int *nbytes; } #endif -int PASCAL NEAR fexist(fname) /* does exist on disk? */ +int fexist(fname) /* does exist on disk? */ char *fname; /* file to check for existance */ diff --git a/src/fmr.c b/src/fmr.c index cc80a1b..dbbd314 100644 --- a/src/fmr.c +++ b/src/fmr.c @@ -102,19 +102,19 @@ union REGS rg; /* cpu register for use of DOS calls */ struct SREGS sg; /* cpu segment registers */ #if PROTO -int PASCAL NEAR fnclabel(int f, int n); -int PASCAL NEAR readparam( int *v); -void PASCAL NEAR dobbnmouse(void); -void PASCAL NEAR docsi( int oh); -void PASCAL NEAR ttputs(char *string); -void PASCAL NEAR charwrite(int row, char *outstr, int forg, int left, int right); +int fnclabel(int f, int n); +int readparam( int *v); +void dobbnmouse(void); +void docsi( int oh); +void ttputs(char *string); +void charwrite(int row, char *outstr, int forg, int left, int right); #else -int PASCAL NEAR fnclabel(); -int PASCAL NEAR readparam(); -void PASCAL NEAR dobbnmouse(); -void PASCAL NEAR docsi(); -void PASCAL NEAR ttputs(); -void PASCAL NEAR charwrite(); +int fnclabel(); +int readparam(); +void dobbnmouse(); +void docsi(); +void ttputs(); +void charwrite(); #endif #define NROW 24 /* Screen size. */ @@ -126,24 +126,24 @@ void PASCAL NEAR charwrite(); #define ESC 0x1B /* ESC character. */ /* Forward references. */ -extern int PASCAL NEAR fmrmove(); -extern int PASCAL NEAR fmreeol(); -extern int PASCAL NEAR fmreeop(); -extern int PASCAL NEAR fmrbeep(); -extern int PASCAL NEAR fmropen(); -extern int PASCAL NEAR fmrrev(); -extern int PASCAL NEAR fmrclose(); -extern int PASCAL NEAR fmrkopen(); -extern int PASCAL NEAR fmrkclose(); -extern int PASCAL NEAR fmrcres(); -extern int PASCAL NEAR fmrparm(); +extern int fmrmove(); +extern int fmreeol(); +extern int fmreeop(); +extern int fmrbeep(); +extern int fmropen(); +extern int fmrrev(); +extern int fmrclose(); +extern int fmrkopen(); +extern int fmrkclose(); +extern int fmrcres(); +extern int fmrparm(); unsigned int octype; /* original cursor type */ unsigned int ocraster; /* original cursor raster line limits */ #if COLOR -extern int PASCAL NEAR fmrfcol(); -extern int PASCAL NEAR fmrbcol(); +extern int fmrfcol(); +extern int fmrbcol(); static int cfcolor = -1; /* current forground color */ static int cbcolor = -1; /* current background color */ @@ -187,7 +187,7 @@ NOSHARE TERM term = { }; #if COLOR -PASCAL NEAR fmrfcol(color) /* set the current output color */ +fmrfcol(color) /* set the current output color */ int color; /* color to set */ @@ -201,7 +201,7 @@ int color; /* color to set */ cfcolor = color; } -PASCAL NEAR fmrbcol(color) /* set the current background color */ +fmrbcol(color) /* set the current background color */ int color; /* color to set */ @@ -218,7 +218,7 @@ int color; /* color to set */ } #endif -PASCAL NEAR fmrmove(row, col) +fmrmove(row, col) { ttputc(ESC); ttputc('['); @@ -228,14 +228,14 @@ PASCAL NEAR fmrmove(row, col) ttputc('H'); } -PASCAL NEAR fmreeol() +fmreeol() { ttputc(ESC); ttputc('['); ttputc('K'); } -PASCAL NEAR fmreeop() +fmreeop() { #if COLOR fmrfcol(gfcolor); @@ -249,7 +249,7 @@ PASCAL NEAR fmreeop() gds_erase(); /* dump the background colors */ } -PASCAL NEAR fmrrev(state) /* change reverse video state */ +fmrrev(state) /* change reverse video state */ int state; /* TRUE = reverse, FALSE = normal */ @@ -262,25 +262,25 @@ int state; /* TRUE = reverse, FALSE = normal */ fmrfcol(7); } -PASCAL NEAR fmrcres() /* change screen resolution */ +fmrcres() /* change screen resolution */ { return(TRUE); } -PASCAL NEAR spal(char *dummy) /* change pallette settings */ +spal(char *dummy) /* change pallette settings */ { /* none for now */ } -PASCAL NEAR fmrbeep() +fmrbeep() { ttputc(BEL); ttflush(); } -PASCAL NEAR fmrparm(n) +fmrparm(n) register int n; { register int q,r; @@ -296,7 +296,7 @@ register int n; ttputc((n%10) + '0'); } -PASCAL NEAR fmropen() +fmropen() { strcpy(sres, "NORMAL"); @@ -311,7 +311,7 @@ PASCAL NEAR fmropen() gds_init(); /* initialize the GDS driver */ } -PASCAL NEAR fmrclose() +fmrclose() { #if COLOR @@ -322,7 +322,7 @@ PASCAL NEAR fmrclose() ttclose(); } -PASCAL NEAR fmrkopen() /* open the keyboard */ +fmrkopen() /* open the keyboard */ { /* save the original function key definitions */ @@ -345,7 +345,7 @@ PASCAL NEAR fmrkopen() /* open the keyboard */ upwind(); } -PASCAL NEAR fmrkclose() /* close the keyboard (a noop here) */ +fmrkclose() /* close the keyboard (a noop here) */ { setkeys(&functab); @@ -440,7 +440,7 @@ KEYDEF *ftable; /* table to set definitions from */ /* charwrite: write some chars directly out to the video */ -void PASCAL NEAR charwrite(row, outstr, forg, left, right) +void charwrite(row, outstr, forg, left, right) int row; /* row of screen to place outstr on */ char *outstr; /* string to write out (must be term.t_ncol long) */ @@ -448,7 +448,7 @@ int forg; /* forground color of string to write */ int left, right; /* limits of the reverse field area */ { - /* move to the begining of the destination line */ + /* move to the beginning of the destination line */ fmrmove(row, left); outstr += left; @@ -465,7 +465,7 @@ int left, right; /* limits of the reverse field area */ /* scwrite: write a line directly out to the video */ -PASCAL NEAR scwrite(row, outstr, forg, bacg, left, right) +scwrite(row, outstr, forg, bacg, left, right) int row; /* row of screen to place outstr on */ char *outstr; /* string to write out (must be term.t_ncol long) */ @@ -502,7 +502,7 @@ int left, right; /* limits of the reverse field area */ } #if FLABEL -int PASCAL NEAR fnclabel(f, n) /* label a function key */ +int fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument [unused] */ diff --git a/src/fmrdos.c b/src/fmrdos.c index a32d563..0c327e1 100644 --- a/src/fmrdos.c +++ b/src/fmrdos.c @@ -50,7 +50,7 @@ static int oldbut; /* Previous state of mouse buttons */ static int oldcol; /* previous x position of mouse */ static int oldrow; /* previous y position of mouse */ -PASCAL NEAR execprog(char *cmd); +execprog(char *cmd); /* input buffers and pointers */ @@ -98,7 +98,7 @@ int in_get() /* get an event from the input buffer */ * This function is called once to set up the terminal device streams. */ -PASCAL NEAR ttopen() +ttopen() { #if MOUSE @@ -165,7 +165,7 @@ int lines; /* # of vertical lines */ * interpreter. On VMS it puts the terminal back in a reasonable state. * Another no-operation on CPM. */ -PASCAL NEAR ttclose() +ttclose() { } @@ -176,7 +176,7 @@ PASCAL NEAR ttclose() * MS-DOS (use the very very raw console output routine). */ -PASCAL NEAR ttputc(c) +ttputc(c) int c; @@ -194,7 +194,7 @@ int c; * Flush terminal buffer. Does real work where the terminal output is buffered * up. A no-operation on systems where byte at a time terminal I/O is done. */ -PASCAL NEAR ttflush() +ttflush() { } @@ -213,7 +213,7 @@ int doschar() /* call the dos to get a char */ * Read a character from the terminal, performing no editing and doing no echo * at all. Also mouse events are forced into the input stream here. */ -PASCAL NEAR ttgetc() +ttgetc() { register int c; /* character read */ @@ -346,7 +346,7 @@ checkmouse() keyboard buffer */ -PASCAL NEAR typahead() +typahead() { int flags; /* cpu flags from dos call */ @@ -384,7 +384,7 @@ PASCAL NEAR typahead() * repaint. Bound to "^X C". */ -PASCAL NEAR spawncli(f, n) +spawncli(f, n) int f, n; @@ -407,7 +407,7 @@ int f, n; * character to be typed, then mark the screen as garbage so a full repaint is * done. Bound to "C-X !". */ -PASCAL NEAR spawn(f, n) +spawn(f, n) int f, n; @@ -441,7 +441,7 @@ int f, n; * done. Bound to "C-X $". */ -PASCAL NEAR execprg(f, n) +execprg(f, n) { register int s; @@ -471,7 +471,7 @@ PASCAL NEAR execprg(f, n) * Pipe a one line command into a window * Bound to ^X @ */ -PASCAL NEAR pipecmd(f, n) +pipecmd(f, n) int f, n; @@ -559,7 +559,7 @@ int f, n; * filter a buffer through an external DOS program * Bound to ^X # */ -PASCAL NEAR filter(f, n) +uefilter(f, n) int f, n; @@ -639,7 +639,7 @@ extern int _doserrno; /* SHELLPROG: Execute a command in a subshell */ -PASCAL NEAR shellprog(cmd) +shellprog(cmd) char *cmd; /* Incoming command line to execute */ @@ -688,7 +688,7 @@ char *cmd; /* Incoming command line to execute */ #define CFLAG 1 #endif -PASCAL NEAR execprog(cmd) +execprog(cmd) char *cmd; /* Incoming command line to execute */ @@ -723,7 +723,7 @@ char *cmd; /* Incoming command line to execute */ strcpy(&tail[1], cmd); strcat(&tail[1], "\r"); - /* look up the program on the path trying various extentions */ + /* look up the program on the path trying various extensions */ if ((sp = flook(prog, TRUE)) == NULL) if ((sp = flook(strcat(prog, ".exe"), TRUE)) == NULL) { strcpy(&prog[strlen(prog)-4], ".com"); @@ -794,9 +794,9 @@ char *cmd; /* Incoming command line to execute */ return((rval < 0) ? FALSE : TRUE); } -/* return a system dependant string with the current time */ +/* return a system dependent string with the current time */ -char *PASCAL NEAR timeset() +char *timeset() { #if MWC | TURBO | IC | MSC @@ -821,14 +821,14 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *PASCAL NEAR getffile(fspec) +char *getffile(fspec) char *fspec; /* pattern to match */ { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ char fname[NFILEN]; /* file/path for DOS call */ /* first parse the file path off the file spec */ @@ -870,12 +870,12 @@ char *fspec; /* pattern to match */ return(rbuf); } -char *PASCAL NEAR getnfile() +char *getnfile() { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ char fname[NFILEN]; /* file/path for DOS call */ /* and call for the first file */ @@ -899,14 +899,14 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *PASCAL NEAR getffile(fspec) +char *getffile(fspec) char *fspec; /* pattern to match */ { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ char fname[NFILEN]; /* file/path for DOS call */ /* first parse the file path off the file spec */ @@ -948,12 +948,12 @@ char *fspec; /* pattern to match */ return(rbuf); } -char *PASCAL NEAR getnfile() +char *getnfile() { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ char fname[NFILEN]; /* file/path for DOS call */ /* and call for the first file */ @@ -969,7 +969,7 @@ char *PASCAL NEAR getnfile() return(rbuf); } #else -char *PASCAL NEAR getffile(fspec) +char *getffile(fspec) char *fspec; /* file to match */ @@ -977,7 +977,7 @@ char *fspec; /* file to match */ return(NULL); } -char *PASCAL NEAR getnfile() +char *getnfile() { return(NULL); diff --git a/src/history.c b/src/history.c index c4d515c..f4d50f2 100644 --- a/src/history.c +++ b/src/history.c @@ -1,8 +1,9 @@ /* * HISTORY.C: Revision History for * - * MicroEMACS 5.00 + * MicroEMACS 4.00 * written by Daniel M. Lawrence + * based on code by Dave G. Conroy. * * (C)Copyright 2008 by Daniel M. Lawrence * MicroEMACS 5.00 can be copied and distributed freely for any @@ -184,7 +185,7 @@ * - added an output flush in vttidy(). Unix really appreciates this. * - added filter-buffer (^X#) command to send a buffer through * a DOS filter - * - made automatic CMODE on .c and .h file compilation dependant + * - made automatic CMODE on .c and .h file compilation dependent * in estruct.h * 1-may-86 * - optimized some code in update(). It certainly needs a lot more. @@ -319,7 +320,7 @@ * for the use of the menu script. Save-window remembers which window * is current, and restore-window returns the cursor to that window. * 20-jun-86 - * - fixed a bug with the fence matching locking up PASCAL NEAR the beginning + * - fixed a bug with the fence matching locking up the beginning * of a buffer * - added argument to update to selectively force a complete update * - added update-screen (unbound) command so macros can force a @@ -421,7 +422,7 @@ * 10-oct-86 * - removed references to lflick....it just won't work that way. * - removed defines LAT2 and LAT3...the code no longer is Lattice - * version dependant. + * version dependent. * 14-oct-86 * - changed spawn so that it will not not pause if executed from * a command line @@ -740,7 +741,7 @@ * getting rid of a lot of junk and making the result smaller * than it started.....(yea!) * - added $tpause to control the fence flashing time in CMODE. - * The value is machine dependant, but you can multiply the + * The value is machine dependent, but you can multiply the * original in macros to stay machine independant. (as * suggested by Baron O.A. Grey) * - added hook to execute M-FNR (null) during a file read, after @@ -944,7 +945,7 @@ * 28-dec-87 * - added new prefix MOUS (coded as MS-) for dealing with mice * 29-dec-87 - * - vastly reorginized machine dependant code. Put termio.c and + * - vastly reorginized machine dependent code. Put termio.c and * spawn.c together and then pulled out msdos.c, unix.c, wmcs.c, * atari.c, amigados.c, and vms.c. These are the operating specific * source files now. @@ -1072,7 +1073,7 @@ * - added binary search to fncmatch() * 28-mar-88 * - optimized the IBMPC version in TURBO C by supplying mixed memory - * mode information (NEAR and PASCAL). The executable is down to + * mode information (and PASCAL). The executable is down to * 89K..but remember to name the code segment (from the options menu) * 1-apr-88 * - added remove-mark (^X) to allow you to unset the mark @@ -1277,14 +1278,14 @@ * - finished changes for the new KEYTAB structure. * - modified describe-bindings to display the bound macroes. * - added arguments to nullproc() in main.c (BUG FIX!) - * - tried (and succeeded) in defining the pascal keyword + * - tried (and succeeded) in defining the keyword * for MSDOS & TURBO. A 2k reduction in the executable was nice. * - added macro-to-key (^X^K) function to bind a macro to a key. * 19-jan-89 * - made numeric arguments to keys bound to macroes repeat those * macroes n times. * - modified docmd() to look for a macro name if it could not find - * a function name. Again a numeric leadin implies repitition. + * a function name. Again a numeric leadin implies repetition. * - added machine code execpr() function to the IBMPC version * because under NOVELL Netware, the DOS 4B exec call does not * preserve the stack on exit... thus execprog() would die. This @@ -1296,7 +1297,7 @@ * compiler on the IBM-RT * 1-feb-89 * - changed the fgetc() in unix.c to a read() under V7 and BSD so - * the time dependant function key checking works. + * the time dependent function key checking works. * - added a support for Hewlet Packard's UNIX system which * is a System V with BSD 4.3 enhancements. This is controled * by the HPUX symbol in estruct.h. @@ -1442,7 +1443,7 @@ * 22-mar-90 * - changed line buffer allocation scheme during file reading to * use realloc() and always double the buffer size. Much faster - * on long line reads. + * on long line reads. * 01-may-90 * - added code to allow SUN verion to work properly * - added .xlk style file locking for unix systems @@ -1460,7 +1461,7 @@ * 6-jun-90 * - modified ansi.c into fmr.c for the Fujitsu FMR-70 series * msdos machines. Extensive modifications to msdos.c were - * needed to accomodate this machine. + * needed to accomodate this machine. * 16-jun-90 * - modified swbuffer() to not check locks on an inactive buffer * in view mode. This allows the -v switch to work from the @@ -1543,7 +1544,7 @@ * - changed search order of files to look in current directory * before HOME and PATH dirs. * 24-mar-91 - * - command file names default to a .cmd extention from the command + * - command file names default to a .cmd extension from the command * line and from the source command. * [released BETA version 3.11] * 02-apr-91 @@ -1617,7 +1618,7 @@ * - in BASIC.C in gotobop/eop() changed some offests to zero constants * speeding things up. * - also added $scribe so I can add in scribe specific formatting - * features, like deciding @commands at the begining of lines delimit + * features, like deciding @commands at the beginning of lines delimit * paragraphs. * 26-jun-91 John Gamble * - added check for isearch and risearch binding in the incremental @@ -1707,7 +1708,7 @@ * - screen resolution changes on the IBMPC force the screen back * to the upper left corner. This may change in the future. * 8-Oct-91 - * - size and position of screen maintained in the SCREEN structure + * - size and position of screen maintained in the ESCREEN structure * so switching screen resets these. * - Mousing code now switches screens if mouse is used outside of * current screen. @@ -1783,7 +1784,7 @@ * suggested by Brian Casiello, defaults to on. * 19-jan-92 John M. Gamble * - On some otherwise ANSI C compilers, __STDC__ is not 1, because we - * also make use of the PASCAL modifier, which is not ANSI. So in + * also make use of the modifier, which is not ANSI. So in * ESTRUCT.H, where there is a check on __STDC__, we also list the * other ANSI C compilers. This turns on VOID, CONST, and makes * ETYPE a union instead of a struct. @@ -1849,7 +1850,7 @@ * suggested by Bruce Momjian * 31-Jul-92 * - in display.c, added line to vtputc() to mask off upper 8 bits of - * passed in int to defeat sign extention of characters. Using the + * passed in int to defeat sign extension of characters. Using the * char as unsigned char switch on a lot of compilers should no * longer be neccessay * - fixed a bug in file.c where a chmod() call needed to be changed @@ -1883,7 +1884,7 @@ * - Fixed bug as pointed out by Pierre Perret in MAGIC mode search. * My match length was not getting reset properly after a failed * recursive amatch() call. - * - Declared VOID PASCAL NEAR kdelete() and next_kill() in line.c. The + * - Declared VOID kdelete() and next_kill() in line.c. The * compiler should have fewer complaints now. * 6 Nov 92 Daniel Lawrence * - Added support for Rational Systems, Inc's DOS/16M package. With this @@ -1994,7 +1995,7 @@ * - bound all controlled and shifted mouse moves to mouse-move to * make the mouse work all the time (suggested by Paul Gomme) * - expanded max file spec size to 256 for all UNIX style systems - * - expanded number of file locks per session to 255 (I've gotta make + * - expanded number of file locks per session to 255 (I've gotta make * this dynamic at some point) * - eliminated the lowercasing of filenames for OS/2 in makename() * in file.c @@ -2266,7 +2267,7 @@ * instead of one character at a time. Many changes to handle * string allocation/deallocation. * 17 Apr 94 John Gamble - * - Merged in Pascal Mehuet's AIX and AIX windows changes. + * - Merged in Mehuet's AIX and AIX windows changes. * 1-jun-94 Daniel Lawrence * - started work on XVT windowing driver. added XVT.c. * 6 Jun 94 @@ -2393,7 +2394,7 @@ * signed/unsigned cahr and sign extension problems. * 25 Feb 95 John Gamble * - "sys$sysdevice:[vmstools]" removed from *pathname in epath.h. - * - Pascal Mehuet's AIX windows changes work for HPUX9 too. + * - Mehuet's AIX windows changes work for HPUX9 too. * Changes in display.c, edef.h, main.c, and unix.c. * - Hitting a space for a completion list when no prior characters * had been typed gave unpredictable results, now check for this. @@ -2576,7 +2577,7 @@ * [0 MOUS #col #row 2] as MS2 and bound it to mouse-resize2-window */ -history() +void history() { /* this is here to keep compilers from complaining... it's not needed */ diff --git a/src/hp110.c b/src/hp110.c index c30a1e8..4e51584 100644 --- a/src/hp110.c +++ b/src/hp110.c @@ -20,26 +20,26 @@ #define BEL 0x07 /* BEL character. */ #define ESC 0x1B /* ESC character. */ -extern PASCAL NEAR ttopen(); /* Forward references. */ -extern PASCAL NEAR ttgetc(); -extern PASCAL NEAR ttputc(); -extern PASCAL NEAR ttflush(); -extern PASCAL NEAR ttclose(); -extern PASCAL NEAR h110move(); -extern PASCAL NEAR h110eeol(); -extern PASCAL NEAR h110eeop(); -extern PASCAL NEAR h110beep(); -extern PASCAL NEAR h110open(); -extern PASCAL NEAR h110rev(); -extern PASCAL NEAR h110cres(); -extern PASCAL NEAR h110close(); -extern PASCAL NEAR h110kopen(); -extern PASCAL NEAR h110kclose(); -extern PASCAL NEAR h110parm(); +extern ttopen(); /* Forward references. */ +extern ttgetc(); +extern ttputc(); +extern ttflush(); +extern ttclose(); +extern h110move(); +extern h110eeol(); +extern h110eeop(); +extern h110beep(); +extern h110open(); +extern h110rev(); +extern h110cres(); +extern h110close(); +extern h110kopen(); +extern h110kclose(); +extern h110parm(); #if COLOR -extern PASCAL NEAR h110fcol(); -extern PASCAL NEAR h110bcol(); +extern h110fcol(); +extern h110bcol(); int cfcolor = -1; /* current forground color */ int cbcolor = -1; /* current background color */ @@ -78,7 +78,7 @@ TERM term = { }; #if COLOR -PASCAL NEAR h110fcol(color) /* set the current output color */ +h110fcol(color) /* set the current output color */ int color; /* color to set */ @@ -92,7 +92,7 @@ int color; /* color to set */ cfcolor = color; } -PASCAL NEAR h110bcol(color) /* set the current background color */ +h110bcol(color) /* set the current background color */ int color; /* color to set */ @@ -107,7 +107,7 @@ int color; /* color to set */ } #endif -PASCAL NEAR h110move(row, col) +h110move(row, col) { ttputc(ESC); ttputc('['); @@ -117,7 +117,7 @@ PASCAL NEAR h110move(row, col) ttputc('H'); } -PASCAL NEAR h110eeol() +h110eeol() { ttputc(ESC); ttputc('['); @@ -125,7 +125,7 @@ PASCAL NEAR h110eeol() ttputc('K'); } -PASCAL NEAR h110eeop() +h110eeop() { #if COLOR h110fcol(gfcolor); @@ -137,7 +137,7 @@ PASCAL NEAR h110eeop() ttputc('J'); } -PASCAL NEAR h110rev(state) /* change reverse video state */ +h110rev(state) /* change reverse video state */ int state; /* TRUE = reverse, FALSE = normal */ @@ -162,25 +162,25 @@ int state; /* TRUE = reverse, FALSE = normal */ #endif } -PASCAL NEAR h110cres() /* change screen resolution */ +h110cres() /* change screen resolution */ { return(TRUE); } -PASCAL NEAR spal() /* change pallette register */ +spal() /* change pallette register */ { /* not here */ } -PASCAL NEAR h110beep() +h110beep() { ttputc(BEL); ttflush(); } -PASCAL NEAR h110parm(n) +h110parm(n) register int n; { register int q,r; @@ -196,7 +196,7 @@ register int n; ttputc((n%10) + '0'); } -PASCAL NEAR h110open() +h110open() { strcpy(sres, "15LINE"); strcpy(os, "MSDOS); @@ -204,7 +204,7 @@ PASCAL NEAR h110open() ttopen(); } -PASCAL NEAR h110close() +h110close() { #if COLOR @@ -214,18 +214,18 @@ PASCAL NEAR h110close() ttclose(); } -PASCAL NEAR h110kopen() +h110kopen() { } -PASCAL NEAR h110kclose() +h110kclose() { } #if FLABEL -PASCAL NEAR fnclabel(f, n) /* label a function key */ +fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument [unused] */ diff --git a/src/hp150.c b/src/hp150.c index 78da02d..635539a 100644 --- a/src/hp150.c +++ b/src/hp150.c @@ -23,34 +23,34 @@ #define BEL 0x07 /* BEL character. */ #define ESC 0x1B /* ESC character. */ -extern int PASCAL NEAR openhp(); /* Forward references. */ -extern int PASCAL NEAR hpflush(); -extern int PASCAL NEAR closehp(); -extern int PASCAL NEAR hp15kopen(); -extern int PASCAL NEAR hp15kclose(); -extern int PASCAL NEAR hp15move(); -extern int PASCAL NEAR hp15eeol(); -extern int PASCAL NEAR hp15eeop(); -extern int PASCAL NEAR hp15beep(); -extern int PASCAL NEAR gethpkey(); -extern int PASCAL NEAR hp15rev(); -extern int PASCAL NEAR hp15cres(); +extern int openhp(); /* Forward references. */ +extern int NEAR hpflush(); +extern int closehp(); +extern int NEAR hp15kopen(); +extern int NEAR hp15kclose(); +extern int hp15move(); +extern int hp15eeol(); +extern int hp15eeop(); +extern int hp15beep(); +extern int NEAR gethpkey(); +extern int NEAR hp15rev(); +extern int NEAR hp15cres(); #if COLOR -extern int PASCAL NEAR hp15fcol(); -extern int PASCAL NEAR hp15bcol(); +extern int NEAR hp15fcol(); +extern int NEAR hp15bcol(); #endif -PASCAL NEAR hp15parm(); -PASCAL NEAR rawon(); -PASCAL NEAR rawoff(); -PASCAL NEAR ckeyoff(); -PASCAL NEAR ckeyon(); -PASCAL NEAR agios(); -PASCAL NEAR keycon(); -PASCAL NEAR keycoff(); -PASCAL NEAR defkey(); -PASCAL NEAR undefkey(); -PASCAL NEAR dsplbls(); +hp15parm(); +rawon(); +rawoff(); +ckeyoff(); +ckeyon(); +agios(); +keycon(); +keycoff(); +defkey(); +undefkey(); +dsplbls(); /* Some needed locals */ @@ -91,7 +91,7 @@ TERM term = { #endif }; -PASCAL NEAR hp15move(row, col) +hp15move(row, col) { ttputc(ESC); ttputc('&'); @@ -102,25 +102,25 @@ PASCAL NEAR hp15move(row, col) ttputc('R'); } -PASCAL NEAR hpflush() +hpflush() { } -PASCAL NEAR hp15eeol() +hp15eeol() { ttputc(ESC); ttputc('K'); } -PASCAL NEAR hp15eeop() +hp15eeop() { ttputc(ESC); ttputc('J'); } -PASCAL NEAR hp15rev(status) /* change the reverse video status */ +hp15rev(status) /* change the reverse video status */ int status; /* TRUE = on, FALSE = off */ @@ -131,25 +131,25 @@ int status; /* TRUE = on, FALSE = off */ ttputc((status != FALSE) ? 'B': '@'); } -PASCAL NEAR hp15cres() /* change screen resolution */ +hp15cres() /* change screen resolution */ { return(TRUE); } -PASCAL NEAR spal() /* change pallette register */ +spal() /* change pallette register */ { /* not here */ } -PASCAL NEAR hp15beep() +hp15beep() { ttputc(BEL); ttflush(); } -PASCAL NEAR hp15parm(n) +hp15parm(n) register int n; @@ -163,16 +163,16 @@ register int n; } #if COLOR -PASCAL NEAR hp15fcol() /* we really can't do colors here, so just ignore it */ +hp15fcol() /* we really can't do colors here, so just ignore it */ { } -PASCAL NEAR hp15bcol() /* we really can't do colors here, so just ignore it */ +hp15bcol() /* we really can't do colors here, so just ignore it */ { } #endif -PASCAL NEAR gethpkey() /* get a key from the HP keyboard while in keycode mode */ +gethpkey() /* get a key from the HP keyboard while in keycode mode */ { unsigned c; /* character to translate */ @@ -342,7 +342,7 @@ unsigned c; /* byte following a zero extended char byte */ return(sstate | c); } -PASCAL NEAR openhp() /* open the HP150 screen for input */ +openhp() /* open the HP150 screen for input */ { strcpy(sres, "NORMAL"); @@ -350,12 +350,12 @@ PASCAL NEAR openhp() /* open the HP150 screen for input */ revexist = TRUE; } -PASCAL NEAR closehp() /* close the HP150 screen for input */ +closehp() /* close the HP150 screen for input */ { } -PASCAL NEAR hp15kopen() /* open the HP150 keyboard for input */ +hp15kopen() /* open the HP150 keyboard for input */ { /* define key charectoristics with AGIOS call (0, 40) */ @@ -374,7 +374,7 @@ PASCAL NEAR hp15kopen() /* open the HP150 keyboard for input */ dsplbls(); } -PASCAL NEAR hp15kclose() /* close the HP150 keyboard for input */ +hp15kclose() /* close the HP150 keyboard for input */ { /* define key charectoristics with AGIOS call (0, 40) */ @@ -390,7 +390,7 @@ PASCAL NEAR hp15kclose() /* close the HP150 keyboard for input */ keycoff(); } -PASCAL NEAR rawon() /* put the HP150 keyboard into RAW mode */ +rawon() /* put the HP150 keyboard into RAW mode */ { /* get the IO control info */ @@ -409,7 +409,7 @@ PASCAL NEAR rawon() /* put the HP150 keyboard into RAW mode */ intdos(&r, &r); /* go fer it */ } -PASCAL NEAR rawoff() /* put the HP150 keyboard into COOKED mode */ +rawoff() /* put the HP150 keyboard into COOKED mode */ { /* get the IO control info */ @@ -428,7 +428,7 @@ PASCAL NEAR rawoff() /* put the HP150 keyboard into COOKED mode */ intdos(&r, &r); /* go fer it */ } -PASCAL NEAR ckeyoff() /* turn control-C trapping off */ +ckeyoff() /* turn control-C trapping off */ { /* find the current state of the control break inturrupt */ @@ -446,7 +446,7 @@ PASCAL NEAR ckeyoff() /* turn control-C trapping off */ } } -PASCAL NEAR ckeyon() /* turn control-C trapping on */ +ckeyon() /* turn control-C trapping on */ { if (break_flag == 1) { @@ -461,7 +461,7 @@ PASCAL NEAR ckeyon() /* turn control-C trapping on */ #undef unsigned #endif -PASCAL NEAR agios(buf, len) /* perform an AGIOS call */ +agios(buf, len) /* perform an AGIOS call */ char *buf; /* sequence of bytes in command */ int len; /* length of command in bytes */ @@ -474,7 +474,7 @@ int len; /* length of command in bytes */ return(intdos(&r, &r)); /* do it */ } -PASCAL NEAR keycon() /* turn keycode mode on */ +keycon() /* turn keycode mode on */ { static char cmd[] = {43, 0, 1}; @@ -482,7 +482,7 @@ PASCAL NEAR keycon() /* turn keycode mode on */ return(agios(&cmd[0], 3)); } -PASCAL NEAR keycoff() /* turn keycode mode off */ +keycoff() /* turn keycode mode off */ { static char cmd[] = {43, 0, 0}; @@ -490,7 +490,7 @@ PASCAL NEAR keycoff() /* turn keycode mode off */ return(agios(&cmd[0], 3)); } -PASCAL NEAR defkey() /* change all special keys to intercept mode */ +defkey() /* change all special keys to intercept mode */ { static char cmd[] = {40, 0, 2, 0, 0xfe, 0}; @@ -498,7 +498,7 @@ PASCAL NEAR defkey() /* change all special keys to intercept mode */ return(agios(&cmd[0], 6)); } -PASCAL NEAR undefkey() /* change all special keys to intercept mode */ +undefkey() /* change all special keys to intercept mode */ { static char cmd[] = {40, 0, 0, 0, 0xfe, 0}; @@ -506,7 +506,7 @@ PASCAL NEAR undefkey() /* change all special keys to intercept mode */ return(agios(&cmd[0], 6)); } -PASCAL NEAR dsplbls() /* display the application softkey labels on the screen */ +dsplbls() /* display the application softkey labels on the screen */ { static char cmd[] = {11, 0}; @@ -515,7 +515,7 @@ PASCAL NEAR dsplbls() /* display the application softkey labels on the screen */ } #if FLABEL -PASCAL NEAR fnclabel(f, n) /* label a function key */ +fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument */ @@ -575,7 +575,7 @@ force: cmd[4] = ptru.cstr[0]; } #endif #else -PASCAL NEAR h15hello() +h15hello() { } diff --git a/src/i55.c b/src/i55.c index c89dba8..3baea8d 100644 --- a/src/i55.c +++ b/src/i55.c @@ -15,17 +15,17 @@ #if I55 #if PROTO -int PASCAL NEAR fnclabel(int f, int n); -int PASCAL NEAR readparam( int *v); -void PASCAL NEAR dobbnmouse(void); -void PASCAL NEAR docsi( int oh); -void PASCAL NEAR ttputs(char *string); +int fnclabel(int f, int n); +int readparam( int *v); +void dobbnmouse(void); +void docsi( int oh); +void ttputs(char *string); #else -int PASCAL NEAR fnclabel(); -int PASCAL NEAR readparam(); -void PASCAL NEAR dobbnmouse(); -void PASCAL NEAR docsi(); -void PASCAL NEAR ttputs(); +int fnclabel(); +int readparam(); +void dobbnmouse(); +void docsi(); +void ttputs(); #endif #define NROW 24 /* Screen size. */ @@ -37,22 +37,22 @@ void PASCAL NEAR ttputs(); #define ESC 0x1B /* ESC character. */ /* Forward references. */ -extern int PASCAL NEAR i55move(); -extern int PASCAL NEAR i55eeol(); -extern int PASCAL NEAR i55eeop(); -extern int PASCAL NEAR i55beep(); -extern int PASCAL NEAR i55open(); -extern int PASCAL NEAR i55rev(); -extern int PASCAL NEAR i55close(); -extern int PASCAL NEAR i55kopen(); -extern int PASCAL NEAR i55kclose(); -extern int PASCAL NEAR i55cres(); -extern int PASCAL NEAR i55parm(); -extern int PASCAL NEAR i55getc(); +extern int i55move(); +extern int i55eeol(); +extern int i55eeop(); +extern int i55beep(); +extern int i55open(); +extern int i55rev(); +extern int i55close(); +extern int i55kopen(); +extern int i55kclose(); +extern int i55cres(); +extern int i55parm(); +extern int i55getc(); #if COLOR -extern int PASCAL NEAR i55fcol(); -extern int PASCAL NEAR i55bcol(); +extern int i55fcol(); +extern int i55bcol(); static int cfcolor = -1; /* current forground color */ static int cbcolor = -1; /* current background color */ @@ -92,7 +92,7 @@ NOSHARE TERM term = { }; #if COLOR -PASCAL NEAR i55fcol(color) /* set the current output color */ +i55fcol(color) /* set the current output color */ int color; /* color to set */ @@ -107,7 +107,7 @@ int color; /* color to set */ cfcolor = color; } -PASCAL NEAR i55bcol(color) /* set the current background color */ +i55bcol(color) /* set the current background color */ int color; /* color to set */ @@ -123,7 +123,7 @@ int color; /* color to set */ } #endif -PASCAL NEAR i55move(row, col) +i55move(row, col) { ttputc(ESC); ttputc('['); @@ -133,14 +133,14 @@ PASCAL NEAR i55move(row, col) ttputc('H'); } -PASCAL NEAR i55eeol() +i55eeol() { ttputc(ESC); ttputc('['); ttputc('K'); } -PASCAL NEAR i55eeop() +i55eeop() { #if COLOR i55fcol(gfcolor); @@ -151,7 +151,7 @@ PASCAL NEAR i55eeop() ttputc('J'); } -PASCAL NEAR i55rev(state) /* change reverse video state */ +i55rev(state) /* change reverse video state */ int state; /* TRUE = reverse, FALSE = normal */ @@ -176,16 +176,16 @@ int state; /* TRUE = reverse, FALSE = normal */ #endif } -PASCAL NEAR i55cres() /* change screen resolution */ +i55cres() /* change screen resolution */ { return(TRUE); } #if PROTO -PASCAL NEAR spal(char *dummy) /* change pallette settings */ +spal(char *dummy) /* change pallette settings */ #else -PASCAL NEAR spal(dummy) /* change pallette settings */ +spal(dummy) /* change pallette settings */ char *dummy; #endif @@ -194,13 +194,13 @@ char *dummy; /* none for now */ } -PASCAL NEAR i55beep() +i55beep() { ttputc(BEL); ttflush(); } -PASCAL NEAR i55parm(n) +i55parm(n) register int n; { register int q,r; @@ -216,7 +216,7 @@ register int n; ttputc((n%10) + '0'); } -PASCAL NEAR i55open() +i55open() { strcpy(sres, "NORMAL"); revexist = TRUE; @@ -228,7 +228,7 @@ PASCAL NEAR i55open() #endif } -PASCAL NEAR i55close() +i55close() { #if COLOR @@ -242,24 +242,24 @@ PASCAL NEAR i55close() ttclose(); } -PASCAL NEAR i55kopen() /* open the keyboard (a noop here) */ +i55kopen() /* open the keyboard (a noop here) */ { } -PASCAL NEAR i55kclose() /* close the keyboard (a noop here) */ +i55kclose() /* close the keyboard (a noop here) */ { } -PASCAL NEAR i55getc() + i55getc() { return(ttgetc()); } #if FLABEL -int PASCAL NEAR fnclabel(f, n) /* label a function key */ +int fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument [unused] */ diff --git a/src/ibmpc.c b/src/ibmpc.c index 0b5d4c2..f756ac5 100644 --- a/src/ibmpc.c +++ b/src/ibmpc.c @@ -7,10 +7,10 @@ #define termdef 1 /* don't define "term" external */ -#include +#include #include "estruct.h" #include "eproto.h" -#include "edef.h" +#include "edef.h" #include "elang.h" #if IBMPC @@ -72,32 +72,32 @@ int desk_rows; /* number of rows on current desktop */ int desk_cols; /* number of cols on current desktop */ int break_flag; /* state of MSDOS control break processing */ -int PASCAL NEAR ibmmove(); -int PASCAL NEAR ibmeeol(); -int PASCAL NEAR ibmputc(); -int PASCAL NEAR ibmeeop(); -int PASCAL NEAR ibmclrdesk(); -int PASCAL NEAR ibmrev(); -int PASCAL NEAR ibmcres(); -int PASCAL NEAR spal(); -int PASCAL NEAR ibmbeep(); -int PASCAL NEAR ibmopen(); -int PASCAL NEAR ibmclose(); -int PASCAL NEAR ibmkopen(); -int PASCAL NEAR ibmkclose(); -int PASCAL NEAR scinit(); -int PASCAL NEAR screen_init(); -int PASCAL NEAR getboard(); -int PASCAL NEAR egaopen(); -int PASCAL NEAR egaclose(); -int PASCAL NEAR cga40_open(); -int PASCAL NEAR cga40_close(); -int PASCAL NEAR change_width(); -int PASCAL NEAR fnclabel(); +int ibmmove(int, int); +int ibmeeol(void); +int ibmputc(int); +int ibmeeop(void); +int ibmclrdesk(void); +int ibmrev(int); +int ibmcres(char*); +int spal(); +int ibmbeep(void); +int ibmopen(void); +int ibmclose(void); +int ibmkopen(void); +int ibmkclose(void); +int scinit(); +int screen_init(); +int getboard(); +int egaopen(); +int egaclose(); +int cga40_open(); +int cga40_close(); +int change_width(); +int fnclabel(); #if COLOR -int PASCAL NEAR ibmfcol(); -int PASCAL NEAR ibmbcol(); +int ibmfcol(int); +int ibmbcol(int); int cfcolor = -1; /* current forground color */ int cbcolor = -1; /* current background color */ int ctrans[] = /* ansi to ibm color translation table */ @@ -111,25 +111,25 @@ int ctrans[] = /* ansi to ibm color translation table */ */ TERM term = { NROW-1, - NROW-1, - NCOL, - NCOL, + NROW-1, + NCOL, + NCOL, 0, 0, MARGIN, SCRSIZ, NPAUSE, - ibmopen, - ibmclose, + ibmopen, + ibmclose, ibmkopen, ibmkclose, - ttgetc, + ttgetc, ibmputc, - ttflush, - ibmmove, - ibmeeol, - ibmeeop, - ibmclrdesk, - ibmbeep, + ttflush, + ibmmove, + ibmeeol, + ibmeeop, + ibmclrdesk, + ibmbeep, ibmrev, ibmcres #if COLOR @@ -139,24 +139,20 @@ TERM term = { }; #if COLOR -int PASCAL NEAR ibmfcol(color) /* set the current output color */ - -int color; /* color to set */ +int ibmfcol(int color) /* set the current output color */ { cfcolor = ctrans[color]; } -int PASCAL NEAR ibmbcol(color) /* set the current background color */ - -int color; /* color to set */ +int ibmbcol(int color) /* set the current background color */ { cbcolor = ctrans[color]; } #endif -int PASCAL NEAR ibmmove(row, col) +int ibmmove(int row, int col) { rg.h.ah = 2; /* set cursor position function code */ rg.h.dl = col + term.t_colorg; @@ -165,7 +161,7 @@ int PASCAL NEAR ibmmove(row, col) int86(0x10, &rg, &rg); } -int PASCAL NEAR ibmeeol() /* erase to the end of the line */ +int ibmeeol(void) /* erase to the end of the line */ { unsigned int attr; /* attribute byte mask to place in RAM */ @@ -214,7 +210,7 @@ int PASCAL NEAR ibmeeol() /* erase to the end of the line */ movmem(&sline[0], scptr[crow+term.t_roworg]+ccol+term.t_colorg, (term.t_ncol-ccol)*2); } -int PASCAL NEAR ibmputc(ch) /* put a character at the current position in the +int ibmputc(ch) /* put a character at the current position in the current colors */ int ch; @@ -303,7 +299,7 @@ int ch; #endif } -int PASCAL NEAR ibmeeop() +int ibmeeop(void) { rg.h.ah = 6; /* scroll page up function code */ @@ -330,7 +326,7 @@ int PASCAL NEAR ibmeeop() int86(0x10, &rg, &rg); } -int PASCAL NEAR ibmclrdesk() +int ibmclrdesk(void) { int attr; /* attribute to fill screen with */ @@ -359,7 +355,7 @@ int PASCAL NEAR ibmclrdesk() int86(0x10, &rg, &rg); } -int PASCAL NEAR ibmrev(state) /* change reverse video state */ +int ibmrev(state) /* change reverse video state */ int state; /* TRUE = reverse, FALSE = normal */ @@ -369,7 +365,7 @@ int state; /* TRUE = reverse, FALSE = normal */ extern dumpscreens(); -int PASCAL NEAR ibmcres(res) /* change screen resolution */ +int ibmcres(res) /* change screen resolution */ char *res; /* resolution to change to */ @@ -384,7 +380,7 @@ char *res; /* resolution to change to */ return(FALSE); } -int PASCAL NEAR spal(mode) /* reset the pallette registers */ +int spal(mode) /* reset the pallette registers */ char *mode; @@ -392,7 +388,7 @@ char *mode; /* nothin here now..... */ } -int PASCAL NEAR ibmbeep() +int ibmbeep(void) { #if MWC ttputc(BEL); @@ -405,7 +401,7 @@ int PASCAL NEAR ibmbeep() #endif /* MWC */ } -int PASCAL NEAR ibmopen() +int ibmopen(void) { scinit(CDSENSE); revexist = TRUE; @@ -413,7 +409,7 @@ int PASCAL NEAR ibmopen() ttopen(); } -int PASCAL NEAR ibmclose() +int ibmclose(void) { #if COLOR @@ -431,7 +427,7 @@ int PASCAL NEAR ibmclose() ttclose(); } -int PASCAL NEAR ibmkopen() /* open the keyboard */ +int ibmkopen(void) /* open the keyboard */ { /* find the current state of the control break inturrupt */ @@ -449,7 +445,7 @@ int PASCAL NEAR ibmkopen() /* open the keyboard */ } } -int PASCAL NEAR ibmkclose() /* close the keyboard */ +int ibmkclose(void) /* close the keyboard */ { if (break_flag == 1) { @@ -460,7 +456,7 @@ int PASCAL NEAR ibmkclose() /* close the keyboard */ } } -int PASCAL NEAR scinit(type) /* initialize the screen head pointers */ +int scinit(type) /* initialize the screen head pointers */ int type; /* type of adapter to init for */ @@ -525,7 +521,7 @@ int type; /* type of adapter to init for */ return(TRUE); } -int PASCAL NEAR screen_init(dtype, type) /* initialize the screen head pointers */ +int screen_init(dtype, type) /* initialize the screen head pointers */ int dtype; /* original screen type (-1 if first time!) */ int type; /* new type of adapter to adjust screens for */ @@ -560,7 +556,7 @@ int type; /* new type of adapter to adjust screens for */ return(TRUE); } -int PASCAL NEAR change_width(ncols) +int change_width(ncols) int ncols; /* number of columns across */ @@ -593,7 +589,7 @@ int ncols; /* number of columns across */ VGA set to CGA EGAexist = TRUE VGAexist = TRUE */ -int PASCAL NEAR getboard() +int getboard() { int type; /* board type to return */ @@ -644,7 +640,7 @@ int PASCAL NEAR getboard() return(type); } -int PASCAL NEAR egaopen(mode) /* init the computer to work with the EGA or VGA */ +int egaopen(mode) /* init the computer to work with the EGA or VGA */ int mode; /* mode to select [CDEGA/CDVGA] */ @@ -696,7 +692,7 @@ int mode; /* mode to select [CDEGA/CDVGA] */ outp(0x3d5, 6); } -int PASCAL NEAR egaclose() +int egaclose() { /* set the proper number of scan lines for CGA */ @@ -710,7 +706,7 @@ int PASCAL NEAR egaclose() int86(16, &rg, &rg); } -int PASCAL NEAR cga40_open() +int cga40_open() { /* put the beast into 40 column mode */ @@ -718,7 +714,7 @@ int PASCAL NEAR cga40_open() int86(16, &rg, &rg); } -int PASCAL NEAR cga40_close() +int cga40_close() { /* put the beast into 80 column mode */ @@ -728,7 +724,7 @@ int PASCAL NEAR cga40_close() /* scwrite: write a line out to the physical screen */ -int PASCAL NEAR scwrite(row, outstr, forg, bacg, revleft, revright) +int scwrite(row, outstr, forg, bacg, revleft, revright) int row; /* row of screen to place outstr on */ char *outstr; /* string to write out (must be term.t_ncol long) */ @@ -783,7 +779,7 @@ int revright; /* first character of non-reverse video area */ } #if FLABEL -int PASCAL NEAR fnclabel(f, n) /* label a function key */ +int fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument [unused] */ diff --git a/src/lock.c b/src/lock.c index aeaf5eb..2d689a5 100644 --- a/src/lock.c +++ b/src/lock.c @@ -13,7 +13,7 @@ #if BSD || FREEBSD || WMCS || SUN || XENIX || HPUX8 || HPUX9 || AVIION || USG || AIX || AUX #include extern int sys_nerr; /* number of system error messages defined */ -extern char *sys_errlist[]; /* list of message texts */ +extern CONST char * CONST sys_errlist[]; /* list of message texts */ #endif #if MSC @@ -27,9 +27,9 @@ int numlocks; /* # of current locks active */ /* lockchk: check a file for locking and add it to the list */ -lockchk(fname) +int lockchk(fname) -char *fname; /* file to check for a lock */ +CONST char *fname; /* file to check for a lock */ { register int i; /* loop indexes */ @@ -72,10 +72,9 @@ char *fname; /* file to check for a lock */ /* lockrel: release all the file locks so others may edit */ -lockrel() +int lockrel() { - register int i; /* loop index */ register int status; /* status of locks */ register int s; /* status of one unlock */ @@ -94,9 +93,9 @@ lockrel() ABORT = file was locked, abort command */ -xlock(fname) +int xlock(fname) -char *fname; /* file name to lock */ +CONST char *fname; /* file name to lock */ { register char *locker; /* lock error message */ @@ -132,7 +131,7 @@ char *fname; /* file name to lock */ this only warns the user if it fails */ -xunlock(fname) +int xunlock(fname) char *fname; /* file to unlock */ @@ -149,7 +148,7 @@ char *fname; /* file to unlock */ return(FALSE); } -lckerror(errstr) /* report a lock error */ +VOID lckerror(errstr) /* report a lock error */ char *errstr; /* lock error string to print out */ @@ -159,11 +158,7 @@ char *errstr; /* lock error string to print out */ strcpy(obuf, errstr); strcat(obuf, " - "); #if BSD || FREEBSD || WMCS || SUN || XENIX || HPUX8 || HPUX9 || AVIION || USG || AIX || AUX - if (errno < sys_nerr) - strcat(obuf, sys_errlist[errno]); - else - strcat(obuf, TEXT178); -/* "[can not get system error message]" */ + strcat(obuf, strerror(errno)); #else strcat(obuf, "Error # "); strcat(obuf, int_asc(errno)); @@ -172,7 +167,7 @@ char *errstr; /* lock error string to print out */ update(TRUE); } #else -lckhello() /* dummy function */ +VOID lckhello() /* dummy function */ { } #endif diff --git a/src/mpe.c b/src/mpe.c index 1fec5fd..497b8d3 100644 --- a/src/mpe.c +++ b/src/mpe.c @@ -729,7 +729,7 @@ int n; /* Argument count */ } /** Filter buffer through command **/ -int filter(f, n) +int uefilter(f, n) int f; /* Flags */ int n; /* Argument count */ { diff --git a/src/msdos.c b/src/msdos.c index adac003..d0159c5 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -54,7 +54,7 @@ static int oldbut; /* Previous state of mouse buttons */ static int oldcol; /* previous x position of mouse */ static int oldrow; /* previous y position of mouse */ -int PASCAL NEAR execprog(char *cmd); +int execprog(char *cmd); /* input buffers and pointers */ @@ -102,7 +102,7 @@ int in_get() /* get an event from the input buffer */ * This function is called once to set up the terminal device streams. */ -int PASCAL NEAR ttopen() +int ttopen() { #if MOUSE @@ -183,7 +183,7 @@ int lines; /* # of vertical lines */ * interpreter. On VMS it puts the terminal back in a reasonable state. * Another no-operation on CPM. */ -int PASCAL NEAR ttclose() +int ttclose() { /* nothing here! */ } @@ -195,7 +195,7 @@ int PASCAL NEAR ttclose() * MS-DOS (use the very very raw console output routine). */ -int PASCAL NEAR ttputc(c) +int ttputc(c) int c; @@ -213,7 +213,7 @@ int c; * Flush terminal buffer. Does real work where the terminal output is buffered * up. A no-operation on systems where byte at a time terminal I/O is done. */ -int PASCAL NEAR ttflush() +int ttflush() { } @@ -282,7 +282,7 @@ int doschar() /* call the dos to get a char */ * Read a character from the terminal, performing no editing and doing no echo * at all. Also mouse events are forced into the input stream here. */ -int PASCAL NEAR ttgetc() +int ttgetc() { register int c; /* character read */ @@ -416,7 +416,7 @@ checkmouse() keyboard buffer */ -int PASCAL NEAR typahead() +int typahead() { int flags; /* cpu flags from dos call */ @@ -454,7 +454,7 @@ int PASCAL NEAR typahead() * repaint. Bound to "^X C". */ -int PASCAL NEAR spawncli(f, n) +int spawncli(f, n) int f, n; @@ -480,7 +480,7 @@ int f, n; * character to be typed, then mark the screen as garbage so a full repaint is * done. Bound to "C-X !". */ -int PASCAL NEAR spawn(f, n) +int spawn(f, n) int f, n; @@ -520,7 +520,7 @@ int f, n; * done. Bound to "C-X $". */ -int PASCAL NEAR execprg(f, n) +int execprg(int f, int n) { register int s; @@ -553,7 +553,7 @@ int PASCAL NEAR execprg(f, n) * Pipe a one line command into a window * Bound to ^X @ */ -int PASCAL NEAR pipecmd(f, n) +int pipecmd(f, n) int f, n; @@ -643,7 +643,7 @@ int f, n; * filter a buffer through an external DOS program * Bound to ^X # */ -int PASCAL NEAR filter(f, n) +int uefilter(f, n) int f, n; @@ -726,7 +726,7 @@ extern int _doserrno; /* SHELLPROG: Execute a command in a subshell */ -int PASCAL NEAR shellprog(cmd) +int shellprog(cmd) char *cmd; /* Incoming command line to execute */ @@ -775,7 +775,7 @@ char *cmd; /* Incoming command line to execute */ #define CFLAG 1 #endif -int PASCAL NEAR execprog(cmd) +int execprog(cmd) char *cmd; /* Incoming command line to execute */ @@ -810,7 +810,7 @@ char *cmd; /* Incoming command line to execute */ strcpy(&tail[1], cmd); strcat(&tail[1], "\r"); - /* look up the program on the path trying various extentions */ + /* look up the program on the path trying various extensions */ if ((sp = flook(prog, TRUE)) == NULL) if ((sp = flook(strcat(prog, ".exe"), TRUE)) == NULL) { strcpy(&prog[strlen(prog)-4], ".com"); @@ -884,9 +884,9 @@ char *cmd; /* Incoming command line to execute */ return((rval < 0) ? FALSE : TRUE); } -/* return a system dependant string with the current time */ +/* return a system dependent string with the current time */ -char *PASCAL NEAR timeset() +char *timeset() { #if MWC | TURBO | IC | MSC | ZTC @@ -916,14 +916,14 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *PASCAL NEAR getffile(fspec) +char *getffile(fspec) char *fspec; /* pattern to match */ { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ char fname[NFILEN]; /* file/path for DOS call */ /* first parse the file path off the file spec */ @@ -965,12 +965,12 @@ char *fspec; /* pattern to match */ return(rbuf); } -char *PASCAL NEAR getnfile() +char *getnfile() { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ char fname[NFILEN]; /* file/path for DOS call */ /* and call for the first file */ @@ -994,14 +994,14 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *PASCAL NEAR getffile(fspec) +char *getffile(fspec) char *fspec; /* pattern to match */ { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ char fname[NFILEN]; /* file/path for DOS call */ /* first parse the file path off the file spec */ @@ -1043,12 +1043,12 @@ char *fspec; /* pattern to match */ return(rbuf); } -char *PASCAL NEAR getnfile() +char *getnfile() { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ char fname[NFILEN]; /* file/path for DOS call */ /* and call for the first file */ @@ -1064,7 +1064,7 @@ char *PASCAL NEAR getnfile() return(rbuf); } #else -char *PASCAL NEAR getffile(fspec) +char *getffile(fspec) char *fspec; /* file to match */ @@ -1072,7 +1072,7 @@ char *fspec; /* file to match */ return(NULL); } -char *PASCAL NEAR getnfile() +char *getnfile() { return(NULL); diff --git a/src/mswdisp.c b/src/mswdisp.c index 9cd9628..3c50d81 100644 --- a/src/mswdisp.c +++ b/src/mswdisp.c @@ -77,7 +77,7 @@ static int CaretCol, CaretRow; /* caret position */ /* BuildCellMetrics: fills a CellMetrics structure from a font description */ /* ================ */ -void FAR PASCAL BuildCellMetrics (CellMetrics *cm, HFONT hFont) +void FAR BuildCellMetrics (CellMetrics *cm, HFONT hFont) { HDC hDC; TEXTMETRIC Metrics; @@ -107,7 +107,7 @@ void FAR PASCAL BuildCellMetrics (CellMetrics *cm, HFONT hFont) /* InvalidateCells: marks character cells for repaint */ /* =============== */ -void FAR PASCAL InvalidateCells (HWND hWnd, int leftcol, int toprow, +void FAR InvalidateCells (HWND hWnd, int leftcol, int toprow, int rightcol, int bottomrow) { RECT Rect; /* used for Cell and Client coordinates */ @@ -144,7 +144,7 @@ void FAR PASCAL InvalidateCells (HWND hWnd, int leftcol, int toprow, /* MinimumClientSize: computes the minimum client area size */ /* ================= */ -void FAR PASCAL MinimumClientSize (HWND hWnd, int NCols, int NRows, +void FAR MinimumClientSize (HWND hWnd, int NCols, int NRows, int *Width, int *Height) /* The values pointed by Height and Width are set to the smallest value @@ -159,7 +159,7 @@ void FAR PASCAL MinimumClientSize (HWND hWnd, int NCols, int NRows, /* DisplayableRows: returns the number of rows displayable in the client area */ /* =============== */ -int FAR PASCAL DisplayableRows (HWND hWnd, int Height, CellMetrics *cm) +int FAR DisplayableRows (HWND hWnd, int Height, CellMetrics *cm) /* Heigh is the hypothetic heigh of the client area. If this parameter is 0, the real client area is measured. If it is negative, the @@ -187,7 +187,7 @@ int FAR PASCAL DisplayableRows (HWND hWnd, int Height, CellMetrics *cm) /* DisplayableColumns: returns the number of columns displayable in the client area */ /* ================== */ -int FAR PASCAL DisplayableColumns (HWND hWnd, int Width, CellMetrics *cm) +int FAR DisplayableColumns (HWND hWnd, int Width, CellMetrics *cm) /* Width is the hypothetic width of the client area. If this parameter is 0, the real client area is measured. If it is negative, the @@ -214,7 +214,7 @@ int FAR PASCAL DisplayableColumns (HWND hWnd, int Width, CellMetrics *cm) /* UpdateEmacsCaretPos: position the caret according to CaretCol/CaretRow */ /* =================== */ -static void PASCAL UpdateEmacsCaretPos (void) +static void UpdateEmacsCaretPos (void) { POINT pt; @@ -232,7 +232,7 @@ static void PASCAL UpdateEmacsCaretPos (void) /* EmacsCaret: Creates or destroys the caret */ /* ========== */ -void FAR PASCAL EmacsCaret (BOOL Show) +void FAR EmacsCaret (BOOL Show) /* the Show parameter is TRUE if the caret should be created and FALSE if it should be destroyed */ @@ -272,7 +272,7 @@ void FAR PASCAL EmacsCaret (BOOL Show) /* MoveEmacsCaret: updates the caret position */ /* ============== */ -void FAR PASCAL MoveEmacsCaret (HWND hWnd, int col, int row) +void FAR MoveEmacsCaret (HWND hWnd, int col, int row) { CaretCol = col; CaretRow = row; @@ -289,7 +289,7 @@ void FAR PASCAL MoveEmacsCaret (HWND hWnd, int col, int row) /* ShowEmacsCaret: shows or hides the caret used by emacs */ /* ============== */ -void FAR PASCAL ShowEmacsCaret (BOOL Show) +void FAR ShowEmacsCaret (BOOL Show) /* this function is used to make the caret visible only when waiting for user input */ @@ -311,7 +311,7 @@ void FAR PASCAL ShowEmacsCaret (BOOL Show) /* InMessageLine: non-zero if caret currently in the message line */ /* ============= */ -BOOL FAR PASCAL InMessageLine (void) +BOOL FAR InMessageLine (void) { return (hCaretWnd == hFrameWnd); } /* InMessageLine */ @@ -319,7 +319,7 @@ BOOL FAR PASCAL InMessageLine (void) /* CellToClient: converts character cell coordinates into client coordinates */ /* ============ */ -void FAR PASCAL CellToClient (HWND hWnd, POINT Cell, LPPOINT Client) +void FAR CellToClient (HWND hWnd, POINT Cell, LPPOINT Client) /* The resulting Client coordinates indicate the upper left pixel one HalfLeadingY above the character cell */ @@ -339,7 +339,7 @@ void FAR PASCAL CellToClient (HWND hWnd, POINT Cell, LPPOINT Client) /* ClientToCell: converts client coordinates into character cell coordinates */ /* ============ */ -void FAR PASCAL ClientToCell (HWND hWnd, POINT Client, LPPOINT Cell) +void FAR ClientToCell (HWND hWnd, POINT Client, LPPOINT Cell) /* The area associated with a Cell is the character cell itself, plus the HalfLeadingY-high areas above and under the cell */ @@ -351,11 +351,11 @@ void FAR PASCAL ClientToCell (HWND hWnd, POINT Client, LPPOINT Cell) MaxRow = 0; } else { /* screen case */ - register SCREEN *sp; + register ESCREEN *sp; #if WINXP - sp = (SCREEN*)GetWindowLongPtr(hWnd, GWL_SCRPTR); + sp = (ESCREEN*)GetWindowLongPtr(hWnd, GWL_SCRPTR); #else - sp = (SCREEN*)GetWindowLong (hWnd, GWL_SCRPTR); + sp = (ESCREEN*)GetWindowLong (hWnd, GWL_SCRPTR); #endif MaxCol = sp->s_ncol - 1; MaxRow = sp->s_nrow - 1; @@ -371,7 +371,7 @@ void FAR PASCAL ClientToCell (HWND hWnd, POINT Client, LPPOINT Cell) /* GetMinMaxInfo: processes the WM_GETMINMAXINFO message for a screen */ /* ============= */ -void FAR PASCAL GetMinMaxInfo (HWND hWnd, LPPOINT rgpt) +void FAR GetMinMaxInfo (HWND hWnd, LPPOINT rgpt) { if (InternalRequest) return; /* none of our business */ @@ -403,7 +403,7 @@ void FAR PASCAL GetMinMaxInfo (HWND hWnd, LPPOINT rgpt) /* ScrReSize: processes the WM_SIZE message */ /* ========= */ -BOOL FAR PASCAL ScrReSize (HWND hWnd, WPARAM wParam, WORD cx, WORD cy) +BOOL FAR ScrReSize (HWND hWnd, WPARAM wParam, WORD cx, WORD cy) /* returns TRUE only if real resizing performed */ { @@ -419,14 +419,14 @@ BOOL FAR PASCAL ScrReSize (HWND hWnd, WPARAM wParam, WORD cx, WORD cy) SetWindowWord (hWnd, GWW_SCRCX, cx); SetWindowWord (hWnd, GWW_SCRCY, cy); if (!InternalRequest) { - SCREEN *TopScreen; + ESCREEN *TopScreen; InternalRequest = TRUE; TopScreen = first_screen; #if WINXP - select_screen((SCREEN *)GetWindowLongPtr(hWnd, GWL_SCRPTR), FALSE); + select_screen((ESCREEN *)GetWindowLongPtr(hWnd, GWL_SCRPTR), FALSE); #else - select_screen((SCREEN *)GetWindowLong(hWnd, GWL_SCRPTR), FALSE); + select_screen((ESCREEN *)GetWindowLong(hWnd, GWL_SCRPTR), FALSE); #endif if (ChgWidth) { newwidth (TRUE, DisplayableColumns (hWnd, cx, &EmacsCM)); @@ -444,9 +444,9 @@ BOOL FAR PASCAL ScrReSize (HWND hWnd, WPARAM wParam, WORD cx, WORD cy) /* ScrPaint: processes WM_PAINT messages for emacs screens */ /* ======== */ -void FAR PASCAL ScrPaint (HWND hWnd) +void FAR ScrPaint (HWND hWnd) { - SCREEN *sp; + ESCREEN *sp; PAINTSTRUCT ps; HANDLE hPrevFont; RECT Rect; @@ -461,9 +461,9 @@ void FAR PASCAL ScrPaint (HWND hWnd) BeginPaint (hWnd, &ps); #if WINXP - sp = (SCREEN*)GetWindowLongPtr(hWnd, GWL_SCRPTR); + sp = (ESCREEN*)GetWindowLongPtr(hWnd, GWL_SCRPTR); #else - sp = (SCREEN*)GetWindowLong (hWnd, GWL_SCRPTR); + sp = (ESCREEN*)GetWindowLong (hWnd, GWL_SCRPTR); #endif /*-calculate the row/col loop control variables and normalize the @@ -574,7 +574,7 @@ void FAR PASCAL ScrPaint (HWND hWnd) /* MLPaint: processes WM_PAINT messages for the Message Line */ /* ======= */ -void FAR PASCAL MLPaint (void) +void FAR MLPaint (void) { PAINTSTRUCT ps; HANDLE hPrev, hPen; @@ -615,7 +615,7 @@ void FAR PASCAL MLPaint (void) /* spal: set palette from $palette string */ /* ==== */ -PASCAL spal (char *pstr) +spal (char *pstr) { #if COLOR int pal; /* current palette position */ diff --git a/src/mswdrv.c b/src/mswdrv.c index a537438..08ffdc6 100644 --- a/src/mswdrv.c +++ b/src/mswdrv.c @@ -23,28 +23,28 @@ /* terminal interface table entries */ -static int PASCAL mswnop(); -static int PASCAL mswopen(); -static int PASCAL mswgetc(); -static int PASCAL mswputc(); -static int PASCAL mswflush(); -static int PASCAL mswbeep(); -static int PASCAL mswmove(); -static int PASCAL msweeol(); -static int PASCAL msweeop(); -static int PASCAL mswbeep(); -static int PASCAL mswrev(); -static int PASCAL mswrez(); +static int mswnop(); +static int mswopen(); +static int mswgetc(); +static int mswputc(); +static int mswflush(); +static int mswbeep(); +static int mswmove(); +static int msweeol(); +static int msweeop(); +static int mswbeep(); +static int mswrev(); +static int mswrez(); #if COLOR -static int PASCAL mswsetfor(); -static int PASCAL mswsetback(); +static int mswsetfor(); +static int mswsetback(); #endif -static int PASCAL mswsleep(); -static int PASCAL mswnewscr(); -static int PASCAL mswdelscr(); -static int PASCAL mswselscr(); -static int PASCAL mswsizscr(); -static int PASCAL mswtopscr(); +static int mswsleep(); +static int mswnewscr(); +static int mswdelscr(); +static int mswselscr(); +static int mswsizscr(); +static int mswtopscr(); /* Standard terminal interface dispatch table. */ @@ -100,7 +100,7 @@ static struct { int rightmost; /* -1 indicates the range is empty */ } UpdateCol; /* Columns to invalidate on UpdateRow */ -static SCREEN *IOScr; /* Screen affected by the I/Os */ +static ESCREEN *IOScr; /* Screen affected by the I/Os */ #if COLOR static int ForgColor; /* current selection of foreground and */ @@ -110,7 +110,7 @@ static int BackColor; /* background colors */ /* PushMLHist: store the last message line contents in the history */ /* ========== */ -static void PASCAL PushMLHist (void) +static void PushMLHist (void) { char *ml; int i, e; @@ -133,7 +133,7 @@ static void PASCAL PushMLHist (void) /* MLHistDlgProc: dialog proc for the Message Line History */ /* ============= */ -int EXPORT FAR PASCAL MLHistDlgProc (HWND hDlg, UINT wMsg, +int EXPORT FAR MLHistDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) { switch (wMsg) { @@ -183,7 +183,7 @@ int EXPORT FAR PASCAL MLHistDlgProc (HWND hDlg, UINT wMsg, core editor loop will pop up a dialog box showing up to MAXMLHIST-1 past messages */ -PASCAL mlhistory (void) +mlhistory (void) { FARPROC ProcInstance; @@ -195,7 +195,7 @@ PASCAL mlhistory (void) FreeProcInstance (ProcInstance); } /* mlhistory */ -static void PASCAL ChangeUpdateRow (int newrow) +static void ChangeUpdateRow (int newrow) /* Set UpdateRow to newrow, invalidating the changed cells in the previous update row */ { @@ -210,7 +210,7 @@ static void PASCAL ChangeUpdateRow (int newrow) /* mswopen: initialize windows interface */ /* ======= */ -static int PASCAL mswopen () +static int mswopen () { static BOOL FirstTime = TRUE; @@ -235,7 +235,7 @@ static int PASCAL mswopen () /* mswgetc: get character from keyboard (or mouse) */ /* ======= */ -static int PASCAL mswgetc () +static int mswgetc () { return GetInput (); } /* mswgetc */ @@ -244,7 +244,7 @@ static int PASCAL mswgetc () /* mswputc: put character to display */ /* ======= */ -static int PASCAL mswputc (c) +static int mswputc (c) int c; /* character to write (or 0 for dummy write) */ { if (UpdateRow != CurrentRow) { @@ -288,7 +288,7 @@ int c; /* character to write (or 0 for dummy write) */ /* mswflush: update display from output buffer */ /* ======== */ -static int PASCAL mswflush () +static int mswflush () { ChangeUpdateRow (-1); if (!InternalRequest && (hIOWnd == hFrameWnd)) UpdateWindow (hIOWnd); @@ -303,7 +303,7 @@ static int PASCAL mswflush () /* mswmove: move the cursor */ /* ======= */ -static int PASCAL mswmove (int newrow, int newcol) +static int mswmove (int newrow, int newcol) { /*-perform IO windows switching depending on the addressed row: if beyond the IO screen, the message line is addressed*/ @@ -333,7 +333,7 @@ static int PASCAL mswmove (int newrow, int newcol) /* msweeol: erase to end of line */ /* ======= */ -static int PASCAL msweeol () +static int msweeol () { mswputc (0); /* ensure change of row is properly handled */ UpdateCol.leftmost = min(UpdateCol.leftmost,CurrentCol); @@ -354,7 +354,7 @@ static int PASCAL msweeol () /* msweeop: erase to end of page */ /* ======= */ -static int PASCAL msweeop () +static int msweeop () { if (hIOWnd == hFrameWnd) { /* message line */ msweeol (); /* only one line here */ @@ -386,7 +386,7 @@ static int PASCAL msweeop () /* mswbeep: sound a beep */ /* ======= */ -static int PASCAL mswbeep () +static int mswbeep () { MessageBeep (0); return 0; @@ -396,7 +396,7 @@ static int PASCAL mswbeep () /* mswrev: set reverse video state */ /* ====== */ -static int PASCAL mswrev (state) +static int mswrev (state) int state; /* TRUE = reverse, FALSE = normal */ { /* nothing to do: the description of reverse video fields is kept @@ -408,7 +408,7 @@ int state; /* TRUE = reverse, FALSE = normal */ /* mswrez: change "resolution" */ /* ====== */ -static int PASCAL mswrez (res) +static int mswrez (res) char *res; { return TRUE; /* $SRES is read-only in MSWIN, but returning an @@ -419,7 +419,7 @@ char *res; /* mswsetfor: set foreground color */ /* ========= */ -static int PASCAL mswsetfor (color) +static int mswsetfor (color) int color; { ForgColor = color; @@ -429,7 +429,7 @@ int color; /* mswsetback: set background color */ /* ========== */ -static int PASCAL mswsetback (color) +static int mswsetback (color) int color; { BackColor = color; @@ -440,7 +440,7 @@ int color; /* mswsleep: wait a specified time (in ms) in an unobtrusive way */ /* ======== */ -static int PASCAL mswsleep (int t) +static int mswsleep (int t) { return TakeANap (t); } /* mswsleep */ @@ -448,7 +448,7 @@ static int PASCAL mswsleep (int t) /* mswnewscr: create new MDI window for new screen */ /* ========= */ -static int PASCAL mswnewscr (SCREEN *sp) +static int mswnewscr (ESCREEN *sp) /* called by screen.c after the screen structure has been allocated. The size of the screen will be determined by the window's size. returns TRUE if successful. */ @@ -501,7 +501,7 @@ static int PASCAL mswnewscr (SCREEN *sp) /* mswdelscr: destroys an MDI window for a disappearing screen */ /* ========= */ -static int PASCAL mswdelscr (SCREEN *sp) +static int mswdelscr (ESCREEN *sp) /* called by screen.c before the screen structure is deallocated */ { if (sp->s_drvhandle == hIOWnd) mswflush (); @@ -513,7 +513,7 @@ static int PASCAL mswdelscr (SCREEN *sp) /* mswselscr: select a window/screen combination for the next IOs */ /* ========= */ -static int PASCAL mswselscr (SCREEN *sp) +static int mswselscr (ESCREEN *sp) { hIOWnd = sp->s_drvhandle; IOScr = sp; @@ -522,7 +522,7 @@ static int PASCAL mswselscr (SCREEN *sp) /* mswsizscr: resize an MDI window to fit the associated screen */ /* ========= */ -static int PASCAL mswsizscr (SCREEN *sp) +static int mswsizscr (ESCREEN *sp) /* called by Emacs when the screen's dimensions have been changed. A resize through the MS-Windows interface is handled by the ReSize function in mswdisp.c */ @@ -651,7 +651,7 @@ static int PASCAL mswsizscr (SCREEN *sp) /* mswtopscr: bring a screen's window to top. */ /* ========= */ -static int PASCAL mswtopscr (SCREEN *sp) +static int mswtopscr (ESCREEN *sp) /* called by screen.c when selecting a screen for current */ { @@ -680,7 +680,7 @@ static int PASCAL mswtopscr (SCREEN *sp) /* mswnop: No Operation */ /* ====== */ -static int PASCAL mswnop () +static int mswnop () { return 0; } diff --git a/src/mswemacs.c b/src/mswemacs.c index ea46e5d..d50e990 100644 --- a/src/mswemacs.c +++ b/src/mswemacs.c @@ -28,7 +28,7 @@ static HANDLE hClipData = NULL; /* used by insertclip and /* CopyToClipboard: internal function to copy region to clipboard */ /* =============== */ -static BOOL PASCAL CopyToClipboard (REGION *Region) +static BOOL CopyToClipboard (REGION *Region) { long Size = 0L; HANDLE hData; @@ -101,7 +101,7 @@ static BOOL PASCAL CopyToClipboard (REGION *Region) /* cutregion: move the current region to the clipboard */ /* ========= */ -int PASCAL cutregion (int f, int n) +int cutregion (int f, int n) { REGION Region; int Result; @@ -120,7 +120,7 @@ int PASCAL cutregion (int f, int n) /* clipregion: copy the current region into the clipboard */ /* ========== */ -int PASCAL clipregion (int f, int n) +int clipregion (int f, int n) { REGION Region; int Result; @@ -133,7 +133,7 @@ int PASCAL clipregion (int f, int n) /* insertclip: insert the clipboard contents at dot */ /* ========== */ -int PASCAL insertclip (int f, int n) +int insertclip (int f, int n) { BOOL Result = TRUE; char *Text, *TextHead; @@ -193,7 +193,7 @@ int PASCAL insertclip (int f, int n) /* ClipboardCleanup: to be called if the user aborts during a longop */ /* ================ */ -void FAR PASCAL ClipboardCleanup (void) +void FAR ClipboardCleanup (void) { if (hClipData) { GlobalUnlock (hClipData); @@ -204,7 +204,7 @@ void FAR PASCAL ClipboardCleanup (void) /* helpengine: invoke the MS-Windows help engine */ /* ========== */ -int PASCAL helpengine (int f, int n) +int helpengine (int f, int n) { char OldHelpFile [NFILEN]; char HelpKey [NLINE]; @@ -255,7 +255,7 @@ int PASCAL helpengine (int f, int n) /* minimizescreen: turn the current screen into an icon */ /* ============== */ -PASCAL minimizescreen (int f, int n) + minimizescreen (int f, int n) { BOOL nq; @@ -269,7 +269,7 @@ PASCAL minimizescreen (int f, int n) /* ForceMessage: do a SendMessage, forcing quiescent mode */ /* ============ */ -static PASCAL ForceMessage (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam) +static ForceMessage (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam) { BOOL nq; @@ -282,7 +282,7 @@ static PASCAL ForceMessage (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam) /* maximizescreen: maximize the current screen */ /* ============== */ -PASCAL maximizescreen (int f, int n) + maximizescreen (int f, int n) { ForceMessage (hMDIClientWnd, WM_MDIMAXIMIZE, (UINT)first_screen->s_drvhandle, 0L); @@ -292,7 +292,7 @@ PASCAL maximizescreen (int f, int n) /* restorescreen: restore the current screen from maximized/minimized state */ /* ============= */ -PASCAL restorescreen (int f, int n) + restorescreen (int f, int n) { ForceMessage (hMDIClientWnd, WM_MDIRESTORE, (UINT)first_screen->s_drvhandle, 0L); @@ -302,7 +302,7 @@ PASCAL restorescreen (int f, int n) /* tilescreens: tile the non-iconized screens */ /* =========== */ -PASCAL tilescreens (int f, int n) + tilescreens (int f, int n) /* without a numeric argument, tile horizontally. With a numeric argument of 1, tile vertically */ @@ -317,7 +317,7 @@ PASCAL tilescreens (int f, int n) /* cascadescreens: position the non-iconized screens in cascade */ /* ============== */ -PASCAL cascadescreens (int f, int n) + cascadescreens (int f, int n) { ForceMessage (hMDIClientWnd, WM_MDICASCADE, 0, 0L); return TRUE; @@ -325,7 +325,7 @@ PASCAL cascadescreens (int f, int n) /* ScrollMessage: handle WM_HSCROLL and WM_VSCROLL */ /* ============= */ -void FAR PASCAL ScrollMessage (HWND hWnd, UINT wMsg, WORD ScrlCode, int Pos) +void FAR ScrollMessage (HWND hWnd, UINT wMsg, WORD ScrlCode, int Pos) { int Delta; @@ -406,20 +406,20 @@ void FAR PASCAL ScrollMessage (HWND hWnd, UINT wMsg, WORD ScrlCode, int Pos) /* ScrollBars: shows/hides, enables/disables scroll bars for all screens */ /* ========== */ -void FAR PASCAL ScrollBars (void) +void FAR ScrollBars (void) { static int VScroll = TRUE; static int HScroll = TRUE; static int Enabled = TRUE; int Quiescence; - SCREEN *sp; + ESCREEN *sp; if (vscrollbar) vscrollbar = TRUE; /* normalize... */ if (hscrollbar) hscrollbar = TRUE; Quiescence = (notquiescent == 0); - for (sp = first_screen; sp != (SCREEN*)NULL; sp = sp->s_next_screen) { + for (sp = first_screen; sp != (ESCREEN*)NULL; sp = sp->s_next_screen) { if (vscrollbar != VScroll) { ShowScrollBar ((HWND)sp->s_drvhandle, SB_VERT, vscrollbar); } @@ -444,7 +444,7 @@ void FAR PASCAL ScrollBars (void) /* updscrollbars: updates the scroll bars for a screen */ /* ============= */ -PASCAL updscrollbars (SCREEN *sp, char w_flag) + updscrollbars (ESCREEN *sp, char w_flag) /* the w_flag is used to determine what needs updating: if the WFHARD bit is set, both scroll bars need an update. If the WFMOVE bit diff --git a/src/mswexec.c b/src/mswexec.c index 89abda7..2ded057 100644 --- a/src/mswexec.c +++ b/src/mswexec.c @@ -29,7 +29,7 @@ static HWND hPrgWnd; /* window handle of the external program task */ /* HandleTimer: checks the existence of the external program window */ /* =========== */ -static void PASCAL HandleTimer (HWND hDlg) +static void HandleTimer (HWND hDlg) /* This function uses a 200ms timeout to check the existence of the window indicated by hPrgWnd. When that window handle becomes invalid, it is @@ -62,7 +62,7 @@ static void PASCAL HandleTimer (HWND hDlg) /* WAITFORPRGDlgProc: dialog proc for WAITFORPRG dialog box */ /* ================= */ -int EXPORT FAR PASCAL WAITFORPRGDlgProc (HWND hDlg, UINT wMsg, +int EXPORT FAR WAITFORPRGDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) { switch (wMsg) { @@ -87,7 +87,7 @@ int EXPORT FAR PASCAL WAITFORPRGDlgProc (HWND hDlg, UINT wMsg, /* LaunchPrgEnumProc: used by LaunchPrg */ /* ================= */ -BOOL EXPORT FAR PASCAL LaunchPrgEnumProc (HWND hWnd, LPARAM lParam) +BOOL EXPORT FAR LaunchPrgEnumProc (HWND hWnd, LPARAM lParam) /* this function sets hPrgWnd when it finds a window that matches the module instance handle passed in lParam */ @@ -104,7 +104,7 @@ BOOL EXPORT FAR PASCAL LaunchPrgEnumProc (HWND hWnd, LPARAM lParam) /* LaunchPrg: launches and monitors an external program */ /* ========= */ -static BOOL PASCAL LaunchPrg (char *Cmd, BOOL DOSApp, +static BOOL LaunchPrg (char *Cmd, BOOL DOSApp, char *InFile, char *OutFile) /* Returns TRUE if all went well, FALSE if wait cancelled and FAILD if @@ -165,7 +165,7 @@ static BOOL PASCAL LaunchPrg (char *Cmd, BOOL DOSApp, string) so that the shell terminates with that command. */ if (Cmd) { char ExecOption [10]; - + GetPrivateProfileString (ProgName, "ShellExecOption", " /c ", ExecOption, 10, IniFile); @@ -235,7 +235,7 @@ static BOOL PASCAL LaunchPrg (char *Cmd, BOOL DOSApp, /* start the process and get a handle on it */ if (CreateProcess (NULL, DOSApp ? FullCmd : Cmd, NULL, NULL, - DETACHED_PROCESS, + DETACHED_PROCESS, FALSE, NULL, NULL, &suInfo, &pInfo)) { int Result; @@ -291,7 +291,7 @@ static BOOL PASCAL LaunchPrg (char *Cmd, BOOL DOSApp, /* spawncli: launch DOS shell. Bound to ^X-C */ /* ======== */ -PASCAL spawncli (int f, int n) +spawncli (int f, int n) { /*-don't allow this command if restricted */ if (restflag) return resterr(); @@ -302,7 +302,7 @@ PASCAL spawncli (int f, int n) /* spawn: run a one-liner in a DOS box. Bound to ^X-! */ /* ===== */ -PASCAL spawn (int f, int n) +spawn (int f, int n) { char Line[NLINE]; int Result; @@ -321,7 +321,7 @@ PASCAL spawn (int f, int n) /* execprg: run another program with arguments. Bound to ^X-$ */ /* ======= */ -PASCAL execprg (int f, int n) +execprg (int f, int n) { char Line[NLINE]; int Result; @@ -345,7 +345,7 @@ PASCAL execprg (int f, int n) /* pipecmd: pipe a one-liner into a window. Bound to ^X-@ */ /* ======= */ -PASCAL pipecmd (int f, int n) +pipecmd (int f, int n) /* this function fills a buffer named "command" with the output of the DOS one-liner. If the command buffer already exist, it is overwritten @@ -426,7 +426,7 @@ PASCAL pipecmd (int f, int n) /* filter: filter a buffer through a DOS box. Bound to ^X-# */ /* ====== */ -PASCAL filter (int f, int n) +uefilter(int f, int n) { char Line[NLINE]; char InFile[NFILEN]; diff --git a/src/mswfile.c b/src/mswfile.c index 3a0c709..f310761 100644 --- a/src/mswfile.c +++ b/src/mswfile.c @@ -7,6 +7,9 @@ #include "estruct.h" #include +#if JMDEXT +#include +#endif #include "eproto.h" #include "edef.h" @@ -55,11 +58,11 @@ static char StarName [FNAMELEN] = "*.*"; /* starname */ static PARAMS *Par; /* function prototypes */ -int EXPORT FAR PASCAL FileDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, +int EXPORT FAR FileDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam); static void CompletePath (char *s, char *FileName); static void UpdateAll (HWND hDlg, char *s); - + /* ChangeWorkingDir: sets the working dir to match the supplied path */ /* ================ */ @@ -101,7 +104,7 @@ static int ChangeWorkingDir (char * FilePath) /* SetWorkingDir: sets the working dir to the current window's path */ /* ============= */ -int FAR PASCAL SetWorkingDir (void) +int FAR SetWorkingDir (void) /* returns 0 if successful, -1 otherwise */ /* this function also sets the text of the Path displayed in the FILE @@ -117,7 +120,7 @@ int FAR PASCAL SetWorkingDir (void) /* fullpathname: fully qualifies the given pathname */ /* ============ */ -char * PASCAL fullpathname (char *PathName, int Nbuf) +char * fullpathname (char *PathName, int Nbuf) /* the PathName argument is assumed to be at least Nbuf characters long. It is modified to contain the corresponding full pathname. The @@ -134,11 +137,16 @@ char * PASCAL fullpathname (char *PathName, int Nbuf) /* filenamedlg: equivalent of mlreply, but specifically to get a filename */ /* =========== */ -PASCAL filenamedlg (char *prompt, char *buf, int nbuf, int fullpath) + filenamedlg (char *prompt, char *buf, int nbuf, int fullpath) { + BOOL Result; +#if JMDEXT + static OPENFILENAME ofn; + char szFileName[256]; +#else PARAMS Parameters; FARPROC ProcInstance; - BOOL Result; +#endif SetWorkingDir (); if (clexec || (kbdmode != STOP)) { /* not interactive */ @@ -148,6 +156,28 @@ PASCAL filenamedlg (char *prompt, char *buf, int nbuf, int fullpath) } return Result; } +#if JMDEXT + strcpy(szFileName, "*.*"); + + /* Set all structure members to zero. */ + + memset(&ofn, 0, sizeof(OPENFILENAME)); + + ofn.lStructSize = sizeof(OPENFILENAME); + ofn.hwndOwner = hFrameWnd; + ofn.lpstrFilter = "All Files\0*.*\0Text Files\0*.txt\0C++ Files\0*.c;*.cpp\0C++ Headers\0*.h;*.hpp\0"; + ofn.nFilterIndex = 1; + ofn.lpstrFile = szFileName; + ofn.nMaxFile = sizeof(szFileName); + ofn.lpstrTitle = prompt; + ofn.Flags = OFN_SHOWHELP | OFN_PATHMUSTEXIST; + + if (GetOpenFileName(&ofn)) { + strcpy(buf, ofn.lpstrFile); + Result = TRUE; + } else + Result = FALSE; +#else Parameters.Prompt = prompt; Par = &Parameters; ProcInstance = MakeProcInstance ((FARPROC)FileDlgProc, hEmacsInstance); @@ -156,14 +186,16 @@ PASCAL filenamedlg (char *prompt, char *buf, int nbuf, int fullpath) CompletePath (buf, Parameters.Name); } FreeProcInstance (ProcInstance); +#endif SetWorkingDir (); return Result; } /* filenamedlg */ +#if !JMDEXT /* FileDlgOK: process OK in File Dialog */ /* ========= */ -static BOOL PASCAL FileDlgOK (HWND hDlg) +static BOOL FileDlgOK (HWND hDlg) /* this is a service function for FileDlgProc. It processes the OK case. The returned value is TRUE if the dialog box is ending, FALSE @@ -216,7 +248,7 @@ static BOOL PASCAL FileDlgOK (HWND hDlg) } return FALSE; } /* FileDlgOK */ - + /* FileNameCompletion: process filename edit box for name completion */ /* ================== */ @@ -224,7 +256,7 @@ static BOOL PASCAL FileDlgOK (HWND hDlg) attempt filename completion if a space is placed at the end of the edit field. Returns TRUE if filename completion was attempted and successful, FALSE otherwise. */ -static BOOL PASCAL FileNameCompletion (HWND hDlg) +static BOOL FileNameCompletion (HWND hDlg) { char s [NFILEN]; int i; @@ -278,7 +310,7 @@ static BOOL PASCAL FileNameCompletion (HWND hDlg) /* FileDlgProc: Open file dialog function */ /* =========== */ -int EXPORT FAR PASCAL FileDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, +int EXPORT FAR FileDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) { char s [NFILEN]; /* all purpose */ @@ -418,7 +450,7 @@ int EXPORT FAR PASCAL FileDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, } return FALSE; } /* FileDlgProc */ - + /* CompletePath: prepend Path to the FileName, result in s */ /* ============ */ @@ -452,7 +484,10 @@ static void UpdateAll (HWND hDlg, char *s) #endif } } /* UpdateAll */ - + + +#endif // !JMDEXT + #if TURBO | IC /* FILE Directory routines */ /* all borrowed from MSDOS.C */ @@ -462,14 +497,14 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *PASCAL getffile(fspec) +char *getffile(fspec) char *fspec; /* pattern to match */ { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ char fname[NFILEN]; /* file/path for DOS call */ /* first parse the file path off the file spec */ @@ -511,12 +546,12 @@ char *fspec; /* pattern to match */ return(rbuf); } -char *PASCAL getnfile() +char *getnfile() { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ char fname[NFILEN]; /* file/path for DOS call */ /* and call for the first file */ @@ -540,14 +575,14 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *PASCAL getffile(fspec) +char *getffile(fspec) char *fspec; /* pattern to match */ { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ char fname[NFILEN]; /* file/path for DOS call */ /* first parse the file path off the file spec */ @@ -600,12 +635,12 @@ char *fspec; /* pattern to match */ return(rbuf); } -char *PASCAL getnfile() +char *getnfile() { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ char fname[NFILEN]; /* file/path for DOS call */ /* and call for the next file */ @@ -634,7 +669,7 @@ char *PASCAL getnfile() return(rbuf); } #else -char *PASCAL getffile(fspec) +char *getffile(fspec) char *fspec; /* file to match */ @@ -642,7 +677,7 @@ char *fspec; /* file to match */ return(NULL); } -char *PASCAL getnfile() +char *getnfile() { return(NULL); @@ -650,4 +685,3 @@ char *PASCAL getnfile() #endif #endif - diff --git a/src/mswfont.c b/src/mswfont.c index 1081829..1b7d3d3 100644 --- a/src/mswfont.c +++ b/src/mswfont.c @@ -20,7 +20,7 @@ static char FaceName[LF_FACESIZE]; /* SelectFont: Selects the emacs-chosen font in the Device Context */ /* ========== */ -HFONT FAR PASCAL SelectFont (HDC hDC, HFONT hFont) +HFONT FAR SelectFont (HDC hDC, HFONT hFont) /* just like SelectObject, this function returns the previously selected font handle */ @@ -37,7 +37,7 @@ HFONT FAR PASCAL SelectFont (HDC hDC, HFONT hFont) /* GetFontMetrics: retrieves the TEXTMETRIC and face name of a given font */ /* ============== */ -static void PASCAL GetFontMetrics (HFONT hFont, TEXTMETRIC *Metrics, +static void GetFontMetrics (HFONT hFont, TEXTMETRIC *Metrics, char *FaceName) /* If either Metrics of FaceName is NULL, the corresponding value is not returned. If not NULL, FaceName must point to a string containing at @@ -57,7 +57,7 @@ static void PASCAL GetFontMetrics (HFONT hFont, TEXTMETRIC *Metrics, /* UpdateMaxRowCol: update the maximas displayed on the dialog box */ /* =============== */ -static void PASCAL UpdateMaxRowCol (HWND hDlg, HFONT hFont) +static void UpdateMaxRowCol (HWND hDlg, HFONT hFont) { CellMetrics cm; char text[17]; @@ -72,7 +72,7 @@ static void PASCAL UpdateMaxRowCol (HWND hDlg, HFONT hFont) /* UpdateSample: Update the sample text displayed on the dialog box */ /* ============ */ -static void PASCAL UpdateSample (HWND hDlg, HFONT hFont, +static void UpdateSample (HWND hDlg, HFONT hFont, TEXTMETRIC *m, char *FaceName) { #define FONTSAMPLESIZE LF_FACESIZE+40+(26*3) @@ -105,7 +105,7 @@ static void PASCAL UpdateSample (HWND hDlg, HFONT hFont, /* NewFont: creates a font matching the user's selections */ /* ======= */ -static void PASCAL NewFont (HWND hDlg, BOOL TrustSizeEdit) +static void NewFont (HWND hDlg, BOOL TrustSizeEdit) /* setting TrustSizeEdit to FALSE indicates that the contents of the ID_FONTSIZE edit box should not be used (this is used when this function is called for a size list-selection change, at which time @@ -162,7 +162,7 @@ static void PASCAL NewFont (HWND hDlg, BOOL TrustSizeEdit) /* AddSize: Add a font size into the font size list (used by EnumSizesProc) */ /* ======= */ -static void PASCAL AddSize (HWND hDlg, short int Height, short int Width) +static void AddSize (HWND hDlg, short int Height, short int Width) { char ItemText[17]; int i; @@ -177,7 +177,7 @@ static void PASCAL AddSize (HWND hDlg, short int Height, short int Width) /* EnumSizesProc: font enumeration function used by BuildSizeList */ /* ============= */ -int EXPORT FAR PASCAL EnumSizesProc (LPLOGFONT lf, LPTEXTMETRIC tm, +int EXPORT FAR EnumSizesProc (LPLOGFONT lf, LPTEXTMETRIC tm, short FontType, LPSTR Data) /* Data should point to a handle to the dialog box */ @@ -219,7 +219,7 @@ int EXPORT FAR PASCAL EnumSizesProc (LPLOGFONT lf, LPTEXTMETRIC tm, /* BuildSizeList: initializes the FontSize list box */ /* ============= */ -static void PASCAL BuildSizeList (HWND hDlg, TEXTMETRIC *Metrics) +static void BuildSizeList (HWND hDlg, TEXTMETRIC *Metrics) /* This function initializes the FontSize list box with the sizes available for the face name currently selected in the Font list box. @@ -286,7 +286,7 @@ static void PASCAL BuildSizeList (HWND hDlg, TEXTMETRIC *Metrics) /* AddFace: Adds a face to the FONT list box if it begets a proper font */ /* ======= */ -static void PASCAL AddFace (HWND hDlg, char *CandidateFace) +static void AddFace (HWND hDlg, char *CandidateFace) { BYTE CharSet; int From, At; /* indexes for list box searches */ @@ -336,7 +336,7 @@ static void PASCAL AddFace (HWND hDlg, char *CandidateFace) /* EnumFacesProc: face enumeration function used by BuildFaceList */ /* ============= */ -int EXPORT FAR PASCAL EnumFacesProc (LPLOGFONT lf, LPTEXTMETRIC tm, +int EXPORT FAR EnumFacesProc (LPLOGFONT lf, LPTEXTMETRIC tm, short FontType, LPSTR Data) /* Data should point to a handle to the dialog box */ @@ -349,7 +349,7 @@ int EXPORT FAR PASCAL EnumFacesProc (LPLOGFONT lf, LPTEXTMETRIC tm, /* BuildFaceList: initialize the FONT list box */ /* ============= */ -static void PASCAL BuildFaceList (HWND hDlg, char *FaceName) +static void BuildFaceList (HWND hDlg, char *FaceName) /* This function initializes the Font list box with fixed fonts matching the current charset selection and then selects an item */ @@ -379,7 +379,7 @@ static void PASCAL BuildFaceList (HWND hDlg, char *FaceName) /* FontDlgProc: Emacs Font dialog box function */ /* =========== */ -int EXPORT FAR PASCAL FontDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, +int EXPORT FAR FontDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) { switch (wMsg) { @@ -517,10 +517,10 @@ int EXPORT FAR PASCAL FontDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, /* ChangeFont: effects the font change on the screen & message line */ /* ========== */ -static void PASCAL ChangeFont (void) +static void ChangeFont (void) { - SCREEN *sp, *fsp; + ESCREEN *sp, *fsp; RECT Rect; /*-loop through all the screens, resizing the vision that emacs has @@ -529,7 +529,7 @@ static void PASCAL ChangeFont (void) fsp = first_screen; do { sp = first_screen; - while (sp->s_next_screen != (SCREEN *)NULL) sp = sp->s_next_screen; + while (sp->s_next_screen != (ESCREEN *)NULL) sp = sp->s_next_screen; select_screen (sp, FALSE); GetClientRect (sp->s_drvhandle, &Rect); newwidth (TRUE, DisplayableColumns (sp->s_drvhandle, @@ -550,7 +550,7 @@ static void PASCAL ChangeFont (void) /* PickEmacsFont: calls-up the FONTS dialog box */ /* ============= */ -BOOL FAR PASCAL PickEmacsFont (void) +BOOL FAR PickEmacsFont (void) /* returns TRUE is a new font has been picked */ { @@ -574,7 +574,7 @@ BOOL FAR PASCAL PickEmacsFont (void) /* FontInit: initialize a font description from WIN.INI */ /* ======== */ -void FAR PASCAL FontInit (void) +void FAR FontInit (void) { LOGFONT lf; char text[20]; diff --git a/src/mswinput.c b/src/mswinput.c index 7f85b6d..f133b32 100644 --- a/src/mswinput.c +++ b/src/mswinput.c @@ -90,16 +90,16 @@ int in_get (void) /* typahead: TRUE if there are typeahead characters in the input stream */ /* ======== */ -PASCAL typahead (void) +typahead (void) { if (in_check()) return TRUE; else return FALSE; } /* typahead */ - + /* EatKey: processes WM_(SYS)KEYxxx and WM_(SYS/MENU)CHAR messages */ /* ====== */ -BOOL FAR PASCAL EatKey (UINT MsgCode, WPARAM wParam, LPARAM lParam) +BOOL FAR EatKey (UINT MsgCode, WPARAM wParam, LPARAM lParam) /* This function must be called for each WM_(SYS)KEYxxx or WM_(SYS/MENU)CHAR message. It returns TRUE if it has taken possesion @@ -224,7 +224,7 @@ BOOL FAR PASCAL EatKey (UINT MsgCode, WPARAM wParam, LPARAM lParam) /* PutMouseMessage: feeds a mouse message into the in_put queue */ /* =============== */ -void PASCAL PutMouseMessage (UINT wMsg, WPARAM wParam, POINT Position) +void PutMouseMessage (UINT wMsg, WPARAM wParam, POINT Position) { char c; @@ -277,7 +277,7 @@ void PASCAL PutMouseMessage (UINT wMsg, WPARAM wParam, POINT Position) /* MouseMessage: handles client area mouse messages */ /* ============ */ -void FAR PASCAL MouseMessage (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam) +void FAR MouseMessage (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam) { POINT Position; static POINT old_Position = {-1, -1};/* last position reported by movement */ @@ -334,7 +334,7 @@ void FAR PASCAL MouseMessage (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam /* DropMessage: handles WM_DROPFILES messages */ /* =========== */ -void FAR PASCAL DropMessage (HWND hWnd, HDROP hDrop) +void FAR DropMessage (HWND hWnd, HDROP hDrop) /* Generates a MS! keystroke. $xpos/$ypos contain the position where the files were dropped, or -1 (actually, 255) if the drop occurred @@ -356,9 +356,9 @@ void FAR PASCAL DropMessage (HWND hWnd, HDROP hDrop) else { /* the drop occured on a screen */ #if WINXP - addline(DropBuf, ((SCREEN*)GetWindowLongPtr(hWnd, GWL_SCRPTR))->s_screen_name); + addline(DropBuf, ((ESCREEN*)GetWindowLongPtr(hWnd, GWL_SCRPTR))->s_screen_name); #else - addline(DropBuf, ((SCREEN*)GetWindowLong (hWnd, GWL_SCRPTR))->s_screen_name); + addline(DropBuf, ((ESCREEN*)GetWindowLong (hWnd, GWL_SCRPTR))->s_screen_name); #endif if (DragQueryPoint (hDrop, &Point)) { ClientToCell (hWnd, Point, &Point); diff --git a/src/mswmem.c b/src/mswmem.c index b8e5ef4..f8fbe92 100644 --- a/src/mswmem.c +++ b/src/mswmem.c @@ -359,7 +359,7 @@ void * CDECL realloc(void * oldblock, size_t size); /* InitializeFarStorage: start the suballocation mechanism */ /* ==================== */ -void FAR PASCAL InitializeFarStorage (void) +void FAR InitializeFarStorage (void) { #if SUBALLOC FarStorage = TRUE; @@ -369,7 +369,7 @@ void FAR PASCAL InitializeFarStorage (void) /* JettisonFarStorage: Release all the global segments (quitting time) */ /* ================== */ -void FAR PASCAL JettisonFarStorage (void) +void FAR JettisonFarStorage (void) { #if SUBALLOC SEGHEADER *sp; diff --git a/src/mswmenu.c b/src/mswmenu.c index 9d4db77..60984d4 100644 --- a/src/mswmenu.c +++ b/src/mswmenu.c @@ -130,7 +130,7 @@ static MENUTAB MenuStaticBind [] = { {IDM_SPAWNCLI, spawncli}, {IDM_SPAWN, spawn}, {IDM_PIPECMD, pipecmd}, - {IDM_FILTER, filter}, + {IDM_FILTER, uefilter}, {IDM_CTLXE, ctlxe}, {IDM_CTLXLP, ctlxlp}, {IDM_CTLXRP, ctlxrp}, @@ -182,7 +182,7 @@ static unsigned int meta_key = 0; /* for GetKeyText */ /* This function is called by the edit loop in main.c, when a MENU extended character is detected. */ -int PASCAL execmenu (int f, int n) +int execmenu (int f, int n) /* f, n: arguments to target function */ { register UINT ID; @@ -213,7 +213,7 @@ int PASCAL execmenu (int f, int n) /* GenerateMenuSeq: send a menu sequence into the input stream */ /* =============== */ -void FAR PASCAL GenerateMenuSeq (UINT ID) +void FAR GenerateMenuSeq (UINT ID) { if (!in_room (5)) return; in_put (0); /* escape indicator */ @@ -225,14 +225,14 @@ void FAR PASCAL GenerateMenuSeq (UINT ID) /* AboutDlgProc: About box dialog function */ /* ============ */ -int EXPORT FAR PASCAL AboutDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, +int EXPORT FAR AboutDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) { char s [50]; static RECT FullBox; - + switch (wMsg) { - + case WM_INITDIALOG: strcpy (s, PROGNAME); strcat (s, " "); @@ -250,7 +250,7 @@ int EXPORT FAR PASCAL AboutDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, FALSE); /* shrink dialog box, do not repaint */ } return TRUE; - + case WM_COMMAND: if (NOTIFICATION_CODE != BN_CLICKED) break; if (LOWORD(wParam) == 1) { @@ -276,7 +276,7 @@ int EXPORT FAR PASCAL AboutDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, /* SetCheck: puts a check mark in a check box */ /* ======== */ -void PASCAL SetCheck (HWND hDlg, int BoxID) +void SetCheck (HWND hDlg, int BoxID) { SendMessage (GetDlgItem (hDlg, BoxID), BM_SETCHECK, 1, 0L); } /* SetCheck */ @@ -284,7 +284,7 @@ void PASCAL SetCheck (HWND hDlg, int BoxID) /* GetCheck: TRUE is the check box is checked */ /* ======== */ -BOOL PASCAL GetCheck (HWND hDlg, int BoxID) +BOOL GetCheck (HWND hDlg, int BoxID) { return (SendMessage (GetDlgItem (hDlg, BoxID), BM_GETCHECK, 0, 0L) != 0); } /* GetCheck */ @@ -295,14 +295,14 @@ BOOL PASCAL GetCheck (HWND hDlg, int BoxID) /* must be invoked through DialogBoxParam, with LOWORD(dwInitParam) set to TRUE for global modes and FALSE for current buffer modes */ -int EXPORT FAR PASCAL ModeDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, +int EXPORT FAR ModeDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) { char s[40+NBUFN]; static int *modep; /* mode flags pointer */ - + switch (wMsg) { - + case WM_INITDIALOG: if (LOWORD(lParam)) { strcpy (s, TEXT331); /* "Global modes" */ @@ -324,11 +324,11 @@ int EXPORT FAR PASCAL ModeDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, if (*modep & MDCRYPT) SetCheck (hDlg, ID_CRYPT); if (*modep & MDASAVE) SetCheck (hDlg, ID_ASAVE); return TRUE; - + case WM_COMMAND: if (NOTIFICATION_CODE != BN_CLICKED) break; switch (LOWORD(wParam)) { - + case 1: /* OK */ *modep = 0; if (GetCheck (hDlg, ID_WRAP)) *modep |= MDWRAP; @@ -342,11 +342,11 @@ int EXPORT FAR PASCAL ModeDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, if (GetCheck (hDlg, ID_ASAVE)) *modep |= MDASAVE; EndDialog (hDlg, 0); break; - + case 2: /* Cancel */ EndDialog (hDlg, -1); break; - + case ID_OVER: /* if OVER set, clear the REP mode check-box */ if (GetCheck (hDlg, ID_OVER)) { @@ -372,10 +372,10 @@ int EXPORT FAR PASCAL ModeDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, /* IsMenuSeparator: TRUE if the item is a separator */ /* =============== */ -static BOOL PASCAL IsMenuSeparator (HMENU hMenu, int Position) +static BOOL IsMenuSeparator (HMENU hMenu, int Position) { DWORD state; - + if (GetSubMenu (hMenu, Position) != 0) return FALSE; if ((state = GetMenuState (hMenu, Position, MF_BYPOSITION)) != -1) { if (state & MF_SEPARATOR) return TRUE; @@ -393,7 +393,7 @@ static BOOL PASCAL IsMenuSeparator (HMENU hMenu, int Position) If the entry is neither an item nor a popup, an item id of 0 is returned */ -UINT PASCAL GetMenuEntryID (HMENU hMenu, int Position) +UINT GetMenuEntryID (HMENU hMenu, int Position) { UINT id; HMENU hSubMenu; @@ -414,7 +414,7 @@ UINT PASCAL GetMenuEntryID (HMENU hMenu, int Position) /* If there is no match, the returned value point to the BINDNUL entry */ -KEYTAB * FAR PASCAL FindKeyBinding (void *Func) +KEYTAB * FAR FindKeyBinding (void *Func) { register KEYTAB *KTp; @@ -425,7 +425,7 @@ KEYTAB * FAR PASCAL FindKeyBinding (void *Func) mouse bindings) */ } return KTp; - + } /* FindKeyBinding */ /* GetKeyText: translates a key code into a CUA-type description */ @@ -440,7 +440,7 @@ KEYTAB * FAR PASCAL FindKeyBinding (void *Func) however, it looks them up. Therefore, these variables can be zeroed if there is a doubt about their validity */ -int PASCAL GetKeyText (int Key, char *Text, int TextLength) +int GetKeyText (int Key, char *Text, int TextLength) { int i; /* index in Text */ char c; @@ -453,7 +453,7 @@ int PASCAL GetKeyText (int Key, char *Text, int TextLength) if (*prefix_key_ptr == 0) { KEYTAB *KTp; - KTp = FindKeyBinding ((Key & CTLX) ? cex : meta); + KTp = FindKeyBinding ((Key & CTLX) ? cex : uemeta); if (KTp->k_type == BINDNUL) return 0; *prefix_key_ptr = KTp->k_code; } @@ -470,11 +470,11 @@ int PASCAL GetKeyText (int Key, char *Text, int TextLength) strcpy (&Text[i], s); i += sizeof(s) - 1;} c = (char)Key; - + if (Key & ALTD) APPENDTEXT(TEXT310) /* "Alt+" */ - + if (Key & SHFT) APPENDTEXT(TEXT311) /* "Shift+" */ - + if (Key & CTRL) { switch (c) { case 'H': @@ -494,7 +494,7 @@ int PASCAL GetKeyText (int Key, char *Text, int TextLength) break; } } - + if (Key & SPEC) { switch (c) { case '<': @@ -524,7 +524,7 @@ int PASCAL GetKeyText (int Key, char *Text, int TextLength) case 'C': APPENDTEXT(TEXT325) /* "Ins" */ break; - case 'D': + case 'D': APPENDTEXT(TEXT326) /* "Del" */ break; case '0': @@ -544,7 +544,7 @@ int PASCAL GetKeyText (int Key, char *Text, int TextLength) if (TextLength - i < 2) return 0; Text[i++] = c; } -all_done: +all_done: Text[i] = '\0'; return i; } /* GetKeyText */ @@ -552,7 +552,7 @@ int PASCAL GetKeyText (int Key, char *Text, int TextLength) /* UpdateMenuItemText: sets the key binding info in a menu item */ /* ================== */ -void PASCAL UpdateMenuItemText (HMENU hMenu, int Position, +void UpdateMenuItemText (HMENU hMenu, int Position, MENUTAB *MTp) { KEYTAB *KTp; @@ -579,7 +579,7 @@ void PASCAL UpdateMenuItemText (HMENU hMenu, int Position, } if (strcmp (NewText, OldText) == 0) return; ModifyMenu (hMenu, Position, MF_BYPOSITION | MF_STRING, - GetMenuItemID (hMenu, Position), NewText); + GetMenuItemID (hMenu, Position), NewText); } /* UpdateMenuItemText */ /* InitMenuPopup: perform popup menu init before display (WM_INITMENUPOPUP) */ @@ -588,7 +588,7 @@ void PASCAL UpdateMenuItemText (HMENU hMenu, int Position, /* here, we may gray menu entries that are invalid. We also try to display a key binding after each menu item */ -void FAR PASCAL InitMenuPopup (HMENU hMenu, LPARAM lParam) +void FAR InitMenuPopup (HMENU hMenu, LPARAM lParam) { int Position; int ItemCount; @@ -601,7 +601,7 @@ void FAR PASCAL InitMenuPopup (HMENU hMenu, LPARAM lParam) ctrlx_key = meta_key = 0; /* these may have changed since the last call to GetKeyText */ - + /*-Scan the menu's items */ ItemCount = GetMenuItemCount (hMenu); PrevMTp = &MenuStaticBind[0]; @@ -760,7 +760,7 @@ void FAR PASCAL InitMenuPopup (HMENU hMenu, LPARAM lParam) /* SimulateExtendedKey: feed an extended key into the input stream */ /* =================== */ -static void PASCAL SimulateExtendedKey (int ec) +static void SimulateExtendedKey (int ec) { char prefix; @@ -786,7 +786,7 @@ static void PASCAL SimulateExtendedKey (int ec) /* returns TRUE if the command has been recognized and FALSE otherwise */ -BOOL FAR PASCAL MenuCommand (WPARAM wParam, LPARAM lParam) +BOOL FAR MenuCommand (WPARAM wParam, LPARAM lParam) { FARPROC ProcInstance; #if WINXP @@ -805,23 +805,23 @@ BOOL FAR PASCAL MenuCommand (WPARAM wParam, LPARAM lParam) DialogBox (hEmacsInstance, "ABOUT", hFrameWnd, ProcInstance); FreeProcInstance (ProcInstance); break; - + #ifdef IDM_DEBUG case IDM_DEBUG: /* places a call to the debugger */ DebugBreak (); break; #endif - + case IDM_QUIT: PostMessage (hFrameWnd, WM_CLOSE, 0, 0L); break; - + case IDM_CTRLG: /* this is a special case: we feed the abort key into the input stream */ SimulateExtendedKey (abortc); break; - + #if WINXP case IDM_WHELPINDEX: strcpy(HelpTopic, MainHelpFile); @@ -858,7 +858,7 @@ BOOL FAR PASCAL MenuCommand (WPARAM wParam, LPARAM lParam) #endif MainHelpUsed = TRUE; break; - + default: if (notquiescent) return TRUE; /* abort processing */ @@ -898,25 +898,25 @@ BOOL FAR PASCAL MenuCommand (WPARAM wParam, LPARAM lParam) case IDM_NORMALIZE: { - SCREEN *sp; + ESCREEN *sp; #if WINXP - sp = (SCREEN*)GetWindowLongPtr((HWND)(SendMessage(hMDIClientWnd, WM_MDIGETACTIVE, 0, 0)), GWL_SCRPTR); + sp = (ESCREEN*)GetWindowLongPtr((HWND)(SendMessage(hMDIClientWnd, WM_MDIGETACTIVE, 0, 0)), GWL_SCRPTR); #else - sp = (SCREEN*)GetWindowLong((HWND)(SendMessage (hMDIClientWnd, WM_MDIGETACTIVE, 0, 0L)), GWL_SCRPTR); + sp = (ESCREEN*)GetWindowLong((HWND)(SendMessage (hMDIClientWnd, WM_MDIGETACTIVE, 0, 0L)), GWL_SCRPTR); #endif newsize (TRUE, sp->s_nrow); newwidth (TRUE, sp->s_ncol); update (FALSE); } break; - + default: if (wParam >= IDM_FIRSTCHILD) return FALSE; GenerateMenuSeq (wParam); return TRUE; } } - + /* we have processed an internal menu command */ if (!notquiescent) GenerateMenuSeq (IDM_NULLPROC); /* this flushes a possible numeric argument */ @@ -926,7 +926,7 @@ BOOL FAR PASCAL MenuCommand (WPARAM wParam, LPARAM lParam) /* GetScreenMenuHandle: returns the handle to the 'Screen' menu (for MDI mgt) */ /* =================== */ -HMENU FAR PASCAL GetScreenMenuHandle (void) +HMENU FAR GetScreenMenuHandle (void) { HMENU hBaseMenu; int Pos; @@ -943,7 +943,7 @@ HMENU FAR PASCAL GetScreenMenuHandle (void) /* MenuEntryCount: count of menu entries, excluding the MDI buttons */ /* ============== */ -static int PASCAL MenuEntryCount (HMENU hMenu) +static int MenuEntryCount (HMENU hMenu) { int Count; @@ -967,7 +967,7 @@ static int PASCAL MenuEntryCount (HMENU hMenu) /* MenuEntryOffset: position of the first non-MDI button menu entry */ /* =============== */ -static int PASCAL MenuEntryOffset (HMENU hMenu) +static int MenuEntryOffset (HMENU hMenu) { if (hMenu == GetMenu (hFrameWnd)) { #if WINXP @@ -983,13 +983,13 @@ static int PASCAL MenuEntryOffset (HMENU hMenu) } } return 0; - + } /* MenuEntryOffset */ /* ParseMenu: parse a piece of menu path */ /* ========= */ -static BOOL PASCAL ParseMenu (char *Name, char *Title, int *Posp) +static BOOL ParseMenu (char *Name, char *Title, int *Posp) /* Puts the text part of the menu name in Title (at most MAXMENUTITLE characters including the \0) and the position number in *Posp. If no @@ -1029,7 +1029,7 @@ static BOOL PASCAL ParseMenu (char *Name, char *Title, int *Posp) /* LocateMenu: locate a menu entry matching a piece of menu path */ /* ========== */ -static BOOL PASCAL LocateMenu (char *Name, CURMENU *CM) +static BOOL LocateMenu (char *Name, CURMENU *CM) /* The returned BOOL is TRUE if a matching menu entry was found, FALSE if no such entry was found and FAILD if a syntax problem was @@ -1089,7 +1089,7 @@ static BOOL PASCAL LocateMenu (char *Name, CURMENU *CM) /* AddMenuEntry: add a menu entry (or, recursively, a cascade of entries) */ /* ============ */ -static BOOL PASCAL AddMenuEntry (char *Name, UINT ID, CURMENU *CM, +static BOOL AddMenuEntry (char *Name, UINT ID, CURMENU *CM, WORD *MenuType) /* the MenuType is a set of flags set returned by this function: MT_DUMMY indicates that the menu item is a mere separator, MT_MENUBAR @@ -1169,7 +1169,7 @@ static BOOL PASCAL AddMenuEntry (char *Name, UINT ID, CURMENU *CM, /* AddMenuBinding: bind a menu item to an EPOINTER */ /* ============== */ -static BOOL PASCAL AddMenuBinding (ETYPE EPOINTER eptr, WORD type) +static BOOL AddMenuBinding (ETYPE EPOINTER eptr, WORD type) /* called by bindtomenu and macrotomenu, once the function or macro name has been parsed */ @@ -1206,7 +1206,7 @@ static BOOL PASCAL AddMenuBinding (ETYPE EPOINTER eptr, WORD type) /* ...looping until we hit a piece of the menu path that does not yet exist */ HMENU hMenu; - + if (CM.cm_x < 0) hMenu = GetMenu (hFrameWnd); else hMenu = CM.cm_parent[CM.cm_x]; hMenu = GetSubMenu (hMenu, CM.cm_pos + MenuEntryOffset (hMenu)); @@ -1243,7 +1243,7 @@ static BOOL PASCAL AddMenuBinding (ETYPE EPOINTER eptr, WORD type) MenuDynBind[DynIndex].m_word = type; MenuDynBind[DynIndex].m_ptr = eptr; } - + if (MenuType & MT_MENUBAR) DrawMenuBar (hFrameWnd); return TRUE; } /* AddMenuBinding */ @@ -1251,7 +1251,7 @@ static BOOL PASCAL AddMenuBinding (ETYPE EPOINTER eptr, WORD type) /* bindtomenu: bind a menu item to an emacs function */ /* ========== */ -PASCAL bindtomenu (int f, int n) +bindtomenu (int f, int n) /* command arguments IGNORED */ { ETYPE EPOINTER e; @@ -1267,7 +1267,7 @@ PASCAL bindtomenu (int f, int n) /* macrotomenu: bind a menu item to a macro (i.e. a buffer) */ /* =========== */ -PASCAL macrotomenu (int f, int n) +macrotomenu (int f, int n) /* command arguments IGNORED */ { ETYPE EPOINTER e; @@ -1291,7 +1291,7 @@ PASCAL macrotomenu (int f, int n) /* DeleteMenuBinding: remove a menu entry and its binding or sub-entries */ /* ================= */ -static BOOL PASCAL DeleteMenuBinding (HMENU hMenu, int Pos) +static BOOL DeleteMenuBinding (HMENU hMenu, int Pos) /* returns TRUE except when an attempt is made to delete the 'Screen' menu */ { @@ -1330,7 +1330,7 @@ static BOOL PASCAL DeleteMenuBinding (HMENU hMenu, int Pos) /* unbindmenu: remove a menu entry */ /* ========== */ -PASCAL unbindmenu (int f, int n) +unbindmenu (int f, int n) /* command arguments IGNORED */ { BOOL Result; @@ -1351,7 +1351,7 @@ PASCAL unbindmenu (int f, int n) else CM = CurrentMenu; while ((Result = LocateMenu (Name, &CM)) == TRUE) { HMENU hMenu; - + if (CM.cm_x < 0) hMenu = GetMenu (hFrameWnd); else hMenu = CM.cm_parent[CM.cm_x]; Name = strchr (Name, '>'); diff --git a/src/mswsys.c b/src/mswsys.c index f5a19fd..30c62d5 100644 --- a/src/mswsys.c +++ b/src/mswsys.c @@ -62,13 +62,13 @@ static HCURSOR hRealHourglass; #endif /* prototypes */ -static void PASCAL MessageLoop (BOOL WaitMode); -static BOOL PASCAL UpdateCursor (HWND hWnd, WPARAM wParam, LPARAM lParam); -static void PASCAL SetHourglass (BOOL hg); +static void MessageLoop (BOOL WaitMode); +static BOOL UpdateCursor (HWND hWnd, WPARAM wParam, LPARAM lParam); +static void SetHourglass (BOOL hg); -/* timeset: return a system-dependant time string */ +/* timeset: return a system-dependent time string */ /* ======= */ -char *PASCAL timeset() +char *timeset() { register char *sp; /* temp string pointer */ @@ -83,7 +83,7 @@ char *PASCAL timeset() /* longop: to be called regularly while a long operation is in progress */ /* ======== */ -PASCAL longop (int f) +longop (int f) /* f is TRUE to set long operation status and FALSE to reset that status */ /* when a long operation is signaled at least twice, the hourglass @@ -125,7 +125,7 @@ PASCAL longop (int f) /* mlyesno: ask a yes/no question */ /* ======= */ -PASCAL mlyesno (char *prompt) +mlyesno (char *prompt) /* This function replaces the mlyesno from input.c. Instead of asking a question on the message line, it pops up a message box */ @@ -139,7 +139,7 @@ PASCAL mlyesno (char *prompt) /* mlabort: display a serious error message (proposes abort) */ /* ======= */ -VOID PASCAL NEAR mlabort (char *s) +VOID mlabort (char *s) { char text[NSTRING]; /* hopefully sufficient! */ @@ -159,7 +159,7 @@ VOID PASCAL NEAR mlabort (char *s) /* WinInit: all the window initialization crap... */ /* ======= */ -BOOL FAR PASCAL WinInit (LPSTR lpCmdLine, int nCmdShow) +BOOL FAR WinInit (LPSTR lpCmdLine, int nCmdShow) /* returns FALSE if failed init */ { @@ -348,7 +348,7 @@ BOOL FAR PASCAL WinInit (LPSTR lpCmdLine, int nCmdShow) /* SetFrameCaption: sets the frame window's text according to the app Id */ /* =============== */ -static void PASCAL SetFrameCaption (void) +static void SetFrameCaption (void) { char text[sizeof(PROGNAME) + sizeof(VERSION)+20]; char *t; @@ -369,9 +369,9 @@ static void PASCAL SetFrameCaption (void) /* BroadcastEnumProc: used by EmacsBroadcast */ /* ================= */ -BOOL EXPORT FAR PASCAL BroadcastEnumProc (HWND hWnd, LPARAM lParam) +BOOL EXPORT FAR BroadcastEnumProc (HWND hWnd, LPARAM lParam) { - char ClassName [sizeof(FrameClassName)+1]; + char ClassName [sizeof(FrameClassName)*4+1]; UINT RetVal; if (hWnd != hFrameWnd) { @@ -397,7 +397,7 @@ BOOL EXPORT FAR PASCAL BroadcastEnumProc (HWND hWnd, LPARAM lParam) /* EmacsBroadcast: send a broadcast message to all Emacs applications */ /* ============== */ -static DWORD PASCAL EmacsBroadcast (DWORD MsgParam) +static DWORD EmacsBroadcast (DWORD MsgParam) /* If MsgParam is not zero, the broadcast is sent as an EmacsBroadcastMsg to all the Emacs frame windows, except the one specified by hFrameWnd. @@ -423,7 +423,7 @@ static DWORD PASCAL EmacsBroadcast (DWORD MsgParam) /* MDIClientSubProc: Subclassing window proc for the MDI Client window */ /* ================ */ -LONG EXPORT FAR PASCAL MDIClientSubProc (HWND hWnd, UINT wMsg, WPARAM wParam, +LONG EXPORT FAR MDIClientSubProc (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam) { switch (wMsg) { @@ -463,7 +463,7 @@ LONG EXPORT FAR PASCAL MDIClientSubProc (HWND hWnd, UINT wMsg, WPARAM wParam, /* FrameInit: Frame window's WM_CREATE */ /* ========= */ -void FAR PASCAL FrameInit (CREATESTRUCT *cs) +void FAR FrameInit (CREATESTRUCT *cs) { RECT Rect; CLIENTCREATESTRUCT ccs; @@ -526,7 +526,7 @@ void FAR PASCAL FrameInit (CREATESTRUCT *cs) /* CloseEmacs: handle WM_CLOSE of WM_QUERYENDSESSION messages */ /* ========== */ -static BOOL PASCAL CloseEmacs (UINT wMsg) +static BOOL CloseEmacs (UINT wMsg) /* returns TRUE if emacs should exit */ { @@ -558,7 +558,7 @@ static BOOL PASCAL CloseEmacs (UINT wMsg) /* ScrWndProc: MDI child (screen) window function */ /* ========== */ -LONG EXPORT FAR PASCAL ScrWndProc (HWND hWnd, UINT wMsg, WPARAM wParam, +LONG EXPORT FAR ScrWndProc (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam) { switch (wMsg) { @@ -575,9 +575,9 @@ LONG EXPORT FAR PASCAL ScrWndProc (HWND hWnd, UINT wMsg, WPARAM wParam, SetWindowWord (hWnd, GWW_SCRCY, (WORD)Rect.bottom); } { /*-setup the stuff for display.c */ - SCREEN *sp; + ESCREEN *sp; - sp = (SCREEN*)(((MDICREATESTRUCT*)(((CREATESTRUCT*)lParam)-> + sp = (ESCREEN*)(((MDICREATESTRUCT*)(((CREATESTRUCT*)lParam)-> lpCreateParams))->lParam); #if WINXP SetWindowLongPtr(hWnd, GWL_SCRPTR, (LONG_PTR)sp); @@ -590,9 +590,9 @@ LONG EXPORT FAR PASCAL ScrWndProc (HWND hWnd, UINT wMsg, WPARAM wParam, case WM_DESTROY: #if WINXP - vtfreescr((SCREEN*)GetWindowLongPtr(hWnd, GWL_SCRPTR)); + vtfreescr((ESCREEN*)GetWindowLongPtr(hWnd, GWL_SCRPTR)); #else - vtfreescr((SCREEN*)GetWindowLong(hWnd, GWL_SCRPTR)); + vtfreescr((ESCREEN*)GetWindowLong(hWnd, GWL_SCRPTR)); #endif break; @@ -616,18 +616,18 @@ LONG EXPORT FAR PASCAL ScrWndProc (HWND hWnd, UINT wMsg, WPARAM wParam, if (!InternalRequest) { InternalRequest = TRUE; #if WINXP - select_screen((SCREEN*)GetWindowLongPtr(hWnd, GWL_SCRPTR), FALSE); + select_screen((ESCREEN*)GetWindowLongPtr(hWnd, GWL_SCRPTR), FALSE); #else - select_screen((SCREEN*)GetWindowLong(hWnd, GWL_SCRPTR), FALSE); + select_screen((ESCREEN*)GetWindowLong(hWnd, GWL_SCRPTR), FALSE); #endif InternalRequest = FALSE; } else { - SCREEN *sp; + ESCREEN *sp; #if WINXP - sp = (SCREEN*)GetWindowLongPtr(hWnd, GWL_SCRPTR); + sp = (ESCREEN*)GetWindowLongPtr(hWnd, GWL_SCRPTR); #else - sp = (SCREEN*)GetWindowLong(hWnd, GWL_SCRPTR); + sp = (ESCREEN*)GetWindowLong(hWnd, GWL_SCRPTR); #endif if (sp->s_virtual == NULL) { /* this is initialization time! */ @@ -706,13 +706,13 @@ LONG EXPORT FAR PASCAL ScrWndProc (HWND hWnd, UINT wMsg, WPARAM wParam, goto DefaultProc; case SC_CLOSE: if (!notquiescent) { - SCREEN *sp; + ESCREEN *sp; /* this must be done here, before any MDI mumbo-jumbo */ #if WINXP - sp = (SCREEN*)GetWindowLongPtr(hWnd, GWL_SCRPTR); + sp = (ESCREEN*)GetWindowLongPtr(hWnd, GWL_SCRPTR); #else - sp = (SCREEN*)GetWindowLong(hWnd, GWL_SCRPTR); + sp = (ESCREEN*)GetWindowLong(hWnd, GWL_SCRPTR); #endif if (sp == first_screen) { cycle_screens (FALSE, 0); @@ -746,7 +746,7 @@ LONG EXPORT FAR PASCAL ScrWndProc (HWND hWnd, UINT wMsg, WPARAM wParam, /* FrameWndProc: frame window function */ /* ============ */ -LONG EXPORT FAR PASCAL FrameWndProc (HWND hWnd, UINT wMsg, WPARAM wParam, +LONG EXPORT FAR FrameWndProc (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam) { switch (wMsg) { @@ -935,7 +935,7 @@ LONG EXPORT FAR PASCAL FrameWndProc (HWND hWnd, UINT wMsg, WPARAM wParam, /* WinMain: Application entry point */ /* ======= */ -int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, +int WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { hEmacsInstance = hInstance; @@ -962,7 +962,7 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, /* ModifyCursor: forces a WM_SETCURSOR */ /* ============ */ -static void PASCAL ModifyCursor (void) +static void ModifyCursor (void) { POINT pt; @@ -973,7 +973,7 @@ static void PASCAL ModifyCursor (void) /* MessageLoop: Main message loop */ /* =========== */ -static void PASCAL MessageLoop (BOOL WaitMode) +static void MessageLoop (BOOL WaitMode) /* If WaitMode is TRUE this function uses GetMessage the first time and PeekMessage after that, until the input queue is empty and there is @@ -1034,7 +1034,7 @@ static void PASCAL MessageLoop (BOOL WaitMode) /* The returned value is the next character from the input stream */ -int FAR PASCAL GetInput (void) +int FAR GetInput (void) { if (!in_check ()) { ShowEmacsCaret (TRUE); @@ -1047,7 +1047,7 @@ int FAR PASCAL GetInput (void) /* TakeANap: put emacs to sleep for a few milliseconds */ /* ======== */ -int FAR PASCAL TakeANap (int t) +int FAR TakeANap (int t) /* this function is used by mswsleep(). It returns TRUE unless the timer could not be created. Note that for a null time, it simply relinquishes the processor */ @@ -1077,7 +1077,7 @@ int FAR PASCAL TakeANap (int t) /* UpdateCursor: sets the apropriate Emacs cursor shape */ /* ============ */ -static BOOL PASCAL UpdateCursor (HWND hWnd, WPARAM wParam, LPARAM lParam) +static BOOL UpdateCursor (HWND hWnd, WPARAM wParam, LPARAM lParam) /* this function should be called on each WM_SETCURSOR message, to display the appropriate cursor. It returns TRUE if all processing has @@ -1140,7 +1140,7 @@ static BOOL PASCAL UpdateCursor (HWND hWnd, WPARAM wParam, LPARAM lParam) /* SetHourglass: sets or removes the hourglass cursor */ /* ============ */ -static void PASCAL SetHourglass (BOOL hg) +static void SetHourglass (BOOL hg) /* hg = TRUE sets the hourglass, hg = FALSE removes it */ { diff --git a/src/nec.c b/src/nec.c index 9e8ce23..6b840fd 100644 --- a/src/nec.c +++ b/src/nec.c @@ -15,17 +15,17 @@ #include #if PROTO -int PASCAL NEAR fnclabel(int f, int n); -int PASCAL NEAR readparam( int *v); -void PASCAL NEAR dobbnmouse(void); -void PASCAL NEAR docsi( int oh); -void PASCAL NEAR ttputs(char *string); +int fnclabel(int f, int n); +int readparam( int *v); +void dobbnmouse(void); +void docsi( int oh); +void ttputs(char *string); #else -int PASCAL NEAR fnclabel(); -int PASCAL NEAR readparam(); -void PASCAL NEAR dobbnmouse(); -void PASCAL NEAR docsi(); -void PASCAL NEAR ttputs(); +int fnclabel(); +int readparam(); +void dobbnmouse(); +void docsi(); +void ttputs(); #endif #define NROW 24 /* Screen size. */ @@ -37,26 +37,26 @@ void PASCAL NEAR ttputs(); #define ESC 0x1B /* ESC character. */ /* Forward references. */ -extern int PASCAL NEAR necmove(); -extern int PASCAL NEAR neceeol(); -extern int PASCAL NEAR neceeop(); -extern int PASCAL NEAR necbeep(); -extern int PASCAL NEAR necopen(); -extern int PASCAL NEAR necrev(); -extern int PASCAL NEAR necclose(); -extern int PASCAL NEAR neckopen(); -extern int PASCAL NEAR neckclose(); -extern int PASCAL NEAR neccres(); -extern int PASCAL NEAR necparm(); -extern int PASCAL NEAR necgetc(); +extern int necmove(); +extern int neceeol(); +extern int neceeop(); +extern int necbeep(); +extern int necopen(); +extern int necrev(); +extern int necclose(); +extern int neckopen(); +extern int neckclose(); +extern int neccres(); +extern int necparm(); +extern int necgetc(); #if INSDEL -extern int PASCAL NEAR necins(); -extern int PASCAL NEAR necdel(); +extern int necins(); +extern int necdel(); #endif #if COLOR -extern int PASCAL NEAR necfcol(); -extern int PASCAL NEAR necbcol(); +extern int necfcol(); +extern int necbcol(); static int cfcolor = -1; /* current forground color */ static int cbcolor = -1; /* current background color */ @@ -152,7 +152,7 @@ NOSHARE TERM term = { }; #if COLOR -PASCAL NEAR necfcol(color) /* set the current output color */ +necfcol(color) /* set the current output color */ int color; /* color to set */ @@ -166,7 +166,7 @@ int color; /* color to set */ cfcolor = color; } -PASCAL NEAR necbcol(color) /* set the current background color */ +necbcol(color) /* set the current background color */ int color; /* color to set */ @@ -184,7 +184,7 @@ int color; /* color to set */ #endif #if INSDEL -PASCAL NEAR necins(lines) /* insert some screen lines */ +necins(lines) /* insert some screen lines */ int lines; /* number of lines to insert */ @@ -197,7 +197,7 @@ int lines; /* number of lines to insert */ ttputc('L'); } -PASCAL NEAR necdel(lines) /* delete some screen lines */ +necdel(lines) /* delete some screen lines */ int lines; /* number of lines to delete */ @@ -211,7 +211,7 @@ int lines; /* number of lines to delete */ } #endif -PASCAL NEAR necmove(row, col) +necmove(row, col) { ttputc(ESC); ttputc('['); @@ -221,14 +221,14 @@ PASCAL NEAR necmove(row, col) ttputc('H'); } -PASCAL NEAR neceeol() +neceeol() { ttputc(ESC); ttputc('['); ttputc('K'); } -PASCAL NEAR neceeop() +neceeop() { #if COLOR necfcol(gfcolor); @@ -239,7 +239,7 @@ PASCAL NEAR neceeop() ttputc('J'); } -PASCAL NEAR necrev(state) /* change reverse video state */ +necrev(state) /* change reverse video state */ int state; /* TRUE = reverse, FALSE = normal */ @@ -264,25 +264,25 @@ int state; /* TRUE = reverse, FALSE = normal */ #endif } -PASCAL NEAR neccres() /* change screen resolution */ +neccres() /* change screen resolution */ { return(TRUE); } -PASCAL NEAR spal(char *dummy) /* change pallette settings */ +spal(char *dummy) /* change pallette settings */ { /* none for now */ } -PASCAL NEAR necbeep() +necbeep() { ttputc(BEL); ttflush(); } -PASCAL NEAR necparm(n) +necparm(n) register int n; { register int q,r; @@ -298,7 +298,7 @@ register int n; ttputc((n%10) + '0'); } -PASCAL NEAR necopen() +necopen() { strcpy(sres, "NORMAL"); revexist = TRUE; @@ -311,7 +311,7 @@ PASCAL NEAR necopen() #endif } -PASCAL NEAR necclose() +necclose() { #if COLOR @@ -321,7 +321,7 @@ PASCAL NEAR necclose() ttclose(); } -PASCAL NEAR neckopen() /* open the keyboard (a noop here) */ +neckopen() /* open the keyboard (a noop here) */ { #if FLABEL @@ -329,7 +329,7 @@ PASCAL NEAR neckopen() /* open the keyboard (a noop here) */ #endif } -PASCAL NEAR neckclose() /* close the keyboard (a noop here) */ +neckclose() /* close the keyboard (a noop here) */ { #if FLABEL @@ -337,14 +337,14 @@ PASCAL NEAR neckclose() /* close the keyboard (a noop here) */ #endif } -PASCAL NEAR necgetc() +necgetc() { return(ttgetc()); } #if FLABEL -int PASCAL NEAR fnclabel(f, n) /* label a function key */ +int fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument [unused] */ diff --git a/src/necdos.c b/src/necdos.c index 30acf3e..1d69f01 100644 --- a/src/necdos.c +++ b/src/necdos.c @@ -50,7 +50,7 @@ static int nbuttons; /* number of buttons on the mouse */ static int oldright; /* old right button status */ static int oldleft; /* old left button status */ -PASCAL NEAR execprog(char *cmd); +execprog(char *cmd); /* input buffers and pointers */ @@ -98,7 +98,7 @@ int in_get() /* get an event from the input buffer */ * This function is called once to set up the terminal device streams. */ -PASCAL NEAR ttopen() +ttopen() { #if MOUSE @@ -185,7 +185,7 @@ int lines; /* # of vertical lines */ * interpreter. On VMS it puts the terminal back in a reasonable state. * Another no-operation on CPM. */ -PASCAL NEAR ttclose() +ttclose() { #if (HP150 == 0) & LATTICE /* restore the ctrl-break interrupt */ @@ -203,7 +203,7 @@ PASCAL NEAR ttclose() * MS-DOS (use the very very raw console output routine). */ -PASCAL NEAR ttputc(c) +ttputc(c) int c; @@ -221,7 +221,7 @@ int c; * Flush terminal buffer. Does real work where the terminal output is buffered * up. A no-operation on systems where byte at a time terminal I/O is done. */ -PASCAL NEAR ttflush() +ttflush() { } @@ -248,7 +248,7 @@ int doschar() /* call the dos to get a char */ * Read a character from the terminal, performing no editing and doing no echo * at all. Also mouse events are forced into the input stream here. */ -PASCAL NEAR ttgetc() +ttgetc() { register int c; /* character read */ @@ -367,7 +367,7 @@ checkmouse() keyboard buffer */ -PASCAL NEAR typahead() +typahead() { int flags; /* cpu flags from dos call */ @@ -398,7 +398,7 @@ PASCAL NEAR typahead() * repaint. Bound to "^X C". */ -PASCAL NEAR spawncli(f, n) +spawncli(f, n) int f, n; @@ -421,7 +421,7 @@ int f, n; * character to be typed, then mark the screen as garbage so a full repaint is * done. Bound to "C-X !". */ -PASCAL NEAR spawn(f, n) +spawn(f, n) int f, n; @@ -455,7 +455,7 @@ int f, n; * done. Bound to "C-X $". */ -PASCAL NEAR execprg(f, n) +execprg(f, n) { register int s; @@ -485,7 +485,7 @@ PASCAL NEAR execprg(f, n) * Pipe a one line command into a window * Bound to ^X @ */ -PASCAL NEAR pipecmd(f, n) +pipecmd(f, n) int f, n; @@ -572,7 +572,7 @@ int f, n; * filter a buffer through an external DOS program * Bound to ^X # */ -PASCAL NEAR filter(f, n) +uefilter(f, n) int f, n; @@ -652,7 +652,7 @@ extern int _doserrno; /* SHELLPROG: Execute a command in a subshell */ -PASCAL NEAR shellprog(cmd) +shellprog(cmd) char *cmd; /* Incoming command line to execute */ @@ -701,7 +701,7 @@ char *cmd; /* Incoming command line to execute */ #define CFLAG 1 #endif -PASCAL NEAR execprog(cmd) +execprog(cmd) char *cmd; /* Incoming command line to execute */ @@ -736,7 +736,7 @@ char *cmd; /* Incoming command line to execute */ strcpy(&tail[1], cmd); strcat(&tail[1], "\r"); - /* look up the program on the path trying various extentions */ + /* look up the program on the path trying various extensions */ if ((sp = flook(prog, TRUE)) == NULL) if ((sp = flook(strcat(prog, ".exe"), TRUE)) == NULL) { strcpy(&prog[strlen(prog)-4], ".com"); @@ -807,9 +807,9 @@ char *cmd; /* Incoming command line to execute */ return((rval < 0) ? FALSE : TRUE); } -/* return a system dependant string with the current time */ +/* return a system dependent string with the current time */ -char *PASCAL NEAR timeset() +char *timeset() { #if MWC | TURBO | IC | MSC @@ -933,14 +933,14 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *PASCAL NEAR getffile(fspec) +char *getffile(fspec) char *fspec; /* pattern to match */ { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ char fname[NFILEN]; /* file/path for DOS call */ /* first parse the file path off the file spec */ @@ -982,12 +982,12 @@ char *fspec; /* pattern to match */ return(rbuf); } -char *PASCAL NEAR getnfile() +char *getnfile() { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ char fname[NFILEN]; /* file/path for DOS call */ /* and call for the first file */ @@ -1011,14 +1011,14 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *PASCAL NEAR getffile(fspec) +char *getffile(fspec) char *fspec; /* pattern to match */ { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ char fname[NFILEN]; /* file/path for DOS call */ /* first parse the file path off the file spec */ @@ -1060,12 +1060,12 @@ char *fspec; /* pattern to match */ return(rbuf); } -char *PASCAL NEAR getnfile() +char *getnfile() { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ char fname[NFILEN]; /* file/path for DOS call */ /* and call for the first file */ @@ -1081,7 +1081,7 @@ char *PASCAL NEAR getnfile() return(rbuf); } #else -char *PASCAL NEAR getffile(fspec) +char *getffile(fspec) char *fspec; /* file to match */ @@ -1089,7 +1089,7 @@ char *fspec; /* file to match */ return(NULL); } -char *PASCAL NEAR getnfile() +char *getnfile() { return(NULL); diff --git a/src/nt.c b/src/nt.c index 5d2d3d3..ecc8311 100644 --- a/src/nt.c +++ b/src/nt.c @@ -33,7 +33,7 @@ * repaint. Bound to "^X C". The message at the start in VMS puts out a newline. * Under some (unknown) condition, you don't get one free when DCL starts up. */ -PASCAL NEAR spawncli(f, n) +spawncli(f, n) { /* don't allow this command if restricted */ if (restflag) @@ -54,7 +54,7 @@ PASCAL NEAR spawncli(f, n) * character to be typed, then mark the screen as garbage so a full repaint is * done. Bound to "C-X !". */ -PASCAL NEAR spawn(f, n) +spawn(f, n) { register int s; char line[NLINE]; @@ -86,7 +86,7 @@ PASCAL NEAR spawn(f, n) * done. Bound to "C-X $". */ -PASCAL NEAR execprg(f, n) +execprg(f, n) { register int s; char line[NLINE]; @@ -117,7 +117,7 @@ PASCAL NEAR execprg(f, n) * We use a unique temporary file name so that multiple instances of * MicroEMACS don't try to use the same file. */ -PASCAL NEAR pipecmd(f, n) +pipecmd(f, n) { register EWINDOW *wp; /* pointer to new window */ register BUFFER *bp; /* pointer to buffer to zot */ @@ -206,7 +206,7 @@ PASCAL NEAR pipecmd(f, n) * We use unique temporary file names so that multiple instances of * MicroEMACS don't try to use the same file. */ -PASCAL NEAR filter(f, n) +uefilter(f, n) { register int s; /* return status from CLI */ @@ -337,7 +337,7 @@ execprog( char *cmd) args[i] = args[i + 1] = 0; /* terminate with 2 nulls */ - /* look up the program on the path, trying various extentions */ + /* look up the program on the path, trying various extensions */ if ((sp = flook(prog, TRUE)) == NULL) if ((sp = flook(strcat(prog, ".exe"), TRUE)) == NULL) { return(FALSE); @@ -363,14 +363,14 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *PASCAL NEAR getffile(fspec) +char *getffile(fspec) char *fspec; /* pattern to match */ { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ char fname[NFILEN]; /* file/path for DOS call */ /* first parse the file path off the file spec */ @@ -413,7 +413,7 @@ char *fspec; /* pattern to match */ return(rbuf); } -char *PASCAL NEAR getnfile() +char *getnfile() { /* and call for the next file */ @@ -429,9 +429,9 @@ char *PASCAL NEAR getnfile() return(rbuf); } -/* return a system dependant string with the current time */ +/* return a system dependent string with the current time */ -char *PASCAL NEAR timeset() +char *timeset() { register char *sp; /* temp string pointer */ @@ -544,3 +544,20 @@ int extcode( #endif /* obsolete */ #endif +#undef va_start +#undef va_end +#include +int dprintf(va_alist, ...) +va_dcl +{ + va_list arg_ptr; + char buffer[200]; + char *fmt; + + va_start(arg_ptr); + fmt = va_arg(arg_ptr, char *); + + vsprintf(buffer, fmt, arg_ptr); + SetConsoleTitle(buffer); +} + diff --git a/src/ntconio.c b/src/ntconio.c index 8a94a46..7a8956f 100644 --- a/src/ntconio.c +++ b/src/ntconio.c @@ -21,7 +21,7 @@ #include "elang.h" #if NTCON -#define NROW 80 /* Screen size. */ +#define NROW 80 /* Screen size. */ #define NCOL 132 /* Edit if you want to. */ #define MARGIN 8 /* size of minimim margin and */ #define SCRSIZ 64 /* scroll size for extended lines */ @@ -29,26 +29,26 @@ /* Forward references. */ -PASCAL NEAR ntmove(); -PASCAL NEAR nteeol(); -PASCAL NEAR nteeop(); -PASCAL NEAR ntbeep(); -PASCAL NEAR ntopen(); -PASCAL NEAR ntclose(); -PASCAL NEAR ntgetc(); -PASCAL NEAR ntputc(); -PASCAL NEAR ntflush(); -PASCAL NEAR ntrev(); -PASCAL NEAR ntkclose(); -PASCAL NEAR ntkopen(); -PASCAL NEAR ntcres(); -PASCAL NEAR ntparm(); +ntmove(); +nteeol(); +nteeop(); +ntbeep(); +ntopen(); +ntclose(); +ntgetc(); +ntputc(); +ntflush(); +ntrev(); +ntkclose(); +ntkopen(); +ntcres(); +ntparm(); #if COLOR -PASCAL NEAR ntfcol(); -PASCAL NEAR ntbcol(); +ntfcol(); +ntbcol(); #endif -PASCAL NEAR fnclabel(); -static WORD near ntAttribute(void); +fnclabel(); +static WORD ntAttribute(void); /* Screen buffer to write to. */ static CHAR_INFO ciScreenBuffer[NROW * NCOL]; @@ -163,7 +163,7 @@ int in_get() /* get an event from the input buffer */ /* Set the current foreground color. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR ntfcol( +ntfcol( int color) /* color to set */ { cfcolor = ctrans[color]; @@ -174,14 +174,14 @@ PASCAL NEAR ntfcol( /* Set the current background color. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR ntbcol( +ntbcol( int color) /* color to set */ { cbcolor = ctrans[color]; } #endif -static void near ntSetUpdateValues(void) +static void ntSetUpdateValues(void) { if (ntrow < ntMin) ntMin = ntrow; @@ -200,7 +200,7 @@ static void near ntSetUpdateValues(void) /* Move the cursor. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR ntmove( +ntmove( int row, int col) { @@ -217,7 +217,7 @@ PASCAL NEAR ntmove( /* Update the physical video buffer from the logical video buffer. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR ntflush(void) +ntflush(void) { SMALL_RECT srWriteRegion; COORD coordUpdateBegin, coordBufferSize; @@ -255,7 +255,7 @@ PASCAL NEAR ntflush(void) return(TRUE); } -static void near MouseEvent(void) +static void MouseEvent(void) { MOUSE_EVENT_RECORD *m_event; /* mouse event to decode */ @@ -338,7 +338,7 @@ static void near MouseEvent(void) return(FALSE); } -static void near WindowSizeEvent(void) +static void WindowSizeEvent(void) { term.t_nrow = ir.Event.WindowBufferSizeEvent.dwSize.Y - 1; term.t_ncol = ir.Event.WindowBufferSizeEvent.dwSize.X; @@ -348,7 +348,7 @@ static void near WindowSizeEvent(void) /* handle the current keyboard event */ -static void near KeyboardEvent() +static void KeyboardEvent() { int c; /* ascii character to examine */ @@ -476,7 +476,7 @@ static void near KeyboardEvent() /* Get a character from the keyboard. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR ntgetc() +ntgetc() { long dw; @@ -517,7 +517,7 @@ ttc: ntflush(); /* Returns true if a key has been pressed. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR typahead() +typahead() { DWORD dwCount; /* number of pending keyboard events */ @@ -563,7 +563,7 @@ printf("UNKNOWN event pending\n"); } #endif -static WORD near ntAttribute(void) +static WORD ntAttribute(void) { return(revflag ? (cbcolor | (cfcolor << 4)) : ((cbcolor << 4) | cfcolor)); } @@ -580,7 +580,7 @@ static WORD near ntAttribute(void) /* a problem. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR ntputc(int c) +ntputc(int c) { WORD wScreenPos; @@ -613,7 +613,7 @@ PASCAL NEAR ntputc(int c) /* Erase to end of line. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR nteeol() +nteeol() { WORD wNum; WORD wScreenPos; @@ -640,7 +640,7 @@ PASCAL NEAR nteeol() /* Erase to end of page. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR nteeop() +nteeop() { WORD wNum; WORD wScreenPos; @@ -667,7 +667,7 @@ PASCAL NEAR nteeop() /* Change reverse video state. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR ntrev(state) +ntrev(state) int state; /* TRUE = reverse, FALSE = normal */ @@ -680,7 +680,7 @@ int state; /* TRUE = reverse, FALSE = normal */ /* Change the screen resolution. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR ntcres(char *res) /* name of desired video mode */ +ntcres(char *res) /* name of desired video mode */ { return TRUE; } @@ -691,7 +691,7 @@ PASCAL NEAR ntcres(char *res) /* name of desired video mode */ /* Change pallette settings. (Does nothing.) */ /*----------------------------------------------------------------------*/ -PASCAL NEAR spal(char *dummy) +spal(char *dummy) { return(TRUE); } @@ -701,7 +701,7 @@ PASCAL NEAR spal(char *dummy) /* ntbeep() */ /*----------------------------------------------------------------------*/ -PASCAL NEAR ntbeep() +ntbeep() { // _beep(1200, 80); return(TRUE); @@ -711,7 +711,7 @@ PASCAL NEAR ntbeep() /* ntopen() */ /*----------------------------------------------------------------------*/ -PASCAL NEAR ntopen() +ntopen() { CONSOLE_SCREEN_BUFFER_INFO Console; @@ -775,7 +775,7 @@ PASCAL NEAR ntopen() /* Restore the original video settings. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR ntclose() +ntclose() { /* reset the title on the window */ SetConsoleTitle(chConsoleTitle); @@ -789,7 +789,7 @@ PASCAL NEAR ntclose() /* Open the keyboard. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR ntkopen() +ntkopen() { /* save the original console mode to restore on exit */ GetConsoleMode(hInput, &OldConsoleMode); @@ -810,7 +810,7 @@ PASCAL NEAR ntkopen() /* Close the keyboard. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR ntkclose() +ntkclose() { /* restore the console mode from entry */ SetConsoleMode(hInput, OldConsoleMode); @@ -818,7 +818,7 @@ PASCAL NEAR ntkclose() } #if FLABEL -PASCAL NEAR fnclabel(f, n) /* label a function key */ +fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument [unused] */ diff --git a/src/os2.c b/src/os2.c index 57d80cc..eb2a18c 100644 --- a/src/os2.c +++ b/src/os2.c @@ -209,7 +209,7 @@ pipecmd(f, n) * We use unique temporary file names so that multiple instances of * MicroEMACS don't try to use the same file. */ -filter(f, n) +uefilter(f, n) { register int s; /* return status from CLI */ @@ -347,7 +347,7 @@ execprog( char *cmd) args[i] = args[i + 1] = 0; /* terminate with 2 nulls */ - /* look up the program on the path, trying various extentions */ + /* look up the program on the path, trying various extensions */ if ((sp = flook(prog, TRUE)) == NULL) if ((sp = flook(strcat(prog, ".exe"), TRUE)) == NULL) { strcpy(&prog[strlen(prog)-4], ".com"); @@ -376,14 +376,14 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *PASCAL NEAR getffile(fspec) +char *getffile(fspec) char *fspec; /* pattern to match */ { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ char fname[NFILEN]; /* file/path for DOS call */ /* first parse the file path off the file spec */ @@ -428,12 +428,12 @@ char *fspec; /* pattern to match */ return(rbuf); } -char *PASCAL NEAR getnfile() +char *getnfile() { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ char fname[NFILEN]; /* file/path for DOS call */ /* and call for the next file */ @@ -449,7 +449,7 @@ char *PASCAL NEAR getnfile() return(rbuf); } -/* return a system dependant string with the current time */ +/* return a system dependent string with the current time */ char *timeset() diff --git a/src/os2npm.c b/src/os2npm.c index 84a3eb9..edda2df 100644 --- a/src/os2npm.c +++ b/src/os2npm.c @@ -54,23 +54,23 @@ char drvname[][8] = { /* names of video modes */ /* Forward references. */ -PASCAL NEAR os2move(); -PASCAL NEAR os2eeol(); -PASCAL NEAR os2eeop(); -PASCAL NEAR os2beep(); -PASCAL NEAR os2open(); -PASCAL NEAR os2close(); -PASCAL NEAR os2getc(); -PASCAL NEAR os2putc(); -PASCAL NEAR os2flush(); -PASCAL NEAR os2rev(); -PASCAL NEAR os2kclose(); -PASCAL NEAR os2kopen(); -PASCAL NEAR os2cres(); -PASCAL NEAR os2parm(); +os2move(); +os2eeol(); +os2eeop(); +os2beep(); +os2open(); +os2close(); +os2getc(); +os2putc(); +os2flush(); +os2rev(); +os2kclose(); +os2kopen(); +os2cres(); +os2parm(); #if COLOR -PASCAL NEAR os2fcol(); -PASCAL NEAR os2bcol(); +os2fcol(); +os2bcol(); #endif struct { /* Current screen attribute for ORing */ @@ -201,7 +201,7 @@ int in_get() /* get an event from the input buffer */ /* Set the current foreground color. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR os2fcol( +os2fcol( int color) /* color to set */ { if (dtype != CDMONO) @@ -223,7 +223,7 @@ PASCAL NEAR os2fcol( /* Set the current background color. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR os2bcol( +os2bcol( int color) /* color to set */ { if (dtype != CDMONO) @@ -247,7 +247,7 @@ PASCAL NEAR os2bcol( /* Move the cursor. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR os2move( +os2move( int row, int col) { @@ -262,7 +262,7 @@ PASCAL NEAR os2move( /* Update the physical video buffer from the logical video buffer. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR os2flush(void) +os2flush(void) { if (lvbMin <= lvbMax) { /* did anything change? */ VioShowBuf(lvbMin * 2, (lvbMax - lvbMin + 1) * 2, 0); @@ -280,7 +280,7 @@ PASCAL NEAR os2flush(void) /* input queue. /*----------------------------------------------------------------------*/ -PASCAL NEAR os2char() +os2char() { register c; /* extended key code for special keys */ KBDKEYINFO keyInfo; @@ -301,7 +301,7 @@ PASCAL NEAR os2char() * Read a character from the terminal, performing no editing and doing no echo * at all. Also mouse events are forced into the input stream here. */ -PASCAL NEAR os2getc() +os2getc() { register int c; /* character read */ @@ -465,7 +465,7 @@ checkmouse() /* Returns true if a key has been pressed. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR typahead() +typahead() { KBDKEYINFO kbdinfo; @@ -488,7 +488,7 @@ PASCAL NEAR typahead() /* a problem. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR os2putc(int c) +os2putc(int c) { USHORT cell; USHORT i; @@ -519,7 +519,7 @@ PASCAL NEAR os2putc(int c) /* Erase to end of line. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR os2eeol() +os2eeol() { USHORT cell = ' '; USHORT i; @@ -541,7 +541,7 @@ PASCAL NEAR os2eeol() /* Erase to end of page. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR os2eeop() +os2eeop() { USHORT cell = ' '; USHORT i; @@ -569,7 +569,7 @@ PASCAL NEAR os2eeop() /* Change reverse video state. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR os2rev(state) +os2rev(state) int state; /* TRUE = reverse, FALSE = normal */ @@ -582,7 +582,7 @@ int state; /* TRUE = reverse, FALSE = normal */ /* Change the screen resolution. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR os2cres(char *res) /* name of desired video mode */ +os2cres(char *res) /* name of desired video mode */ { USHORT err; int type; /* video mode type */ @@ -630,7 +630,7 @@ PASCAL NEAR os2cres(char *res) /* name of desired video mode */ /* Change pallette settings. (Does nothing.) */ /*----------------------------------------------------------------------*/ -PASCAL NEAR spal(char *dummy) +spal(char *dummy) { } @@ -639,7 +639,7 @@ PASCAL NEAR spal(char *dummy) /* os2beep() */ /*----------------------------------------------------------------------*/ -PASCAL NEAR os2beep() +os2beep() { DosBeep(1200, 175); } @@ -652,7 +652,7 @@ PASCAL NEAR os2beep() /* in use, we still use the current mode. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR os2open() +os2open() { #if MOUSE PTRLOC mouse_pos; /* position to place mouse */ @@ -724,7 +724,7 @@ PASCAL NEAR os2open() /* Restore the original video settings. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR os2close() +os2close() { #if MOUSE /* close our use of the mouse */ @@ -743,7 +743,7 @@ PASCAL NEAR os2close() /* Open the keyboard. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR os2kopen() +os2kopen() { KBDINFO kbdInfo; @@ -764,13 +764,13 @@ PASCAL NEAR os2kopen() /* Close the keyboard. */ /*----------------------------------------------------------------------*/ -PASCAL NEAR os2kclose() +os2kclose() { KbdSetStatus(&initial.kbdInfo, 0); /* restore original state */ } #if FLABEL -PASCAL NEAR fnclabel(f, n) /* label a function key */ +fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument [unused] */ diff --git a/src/posix.c b/src/posix.c index 49a0de7..dd569d9 100644 --- a/src/posix.c +++ b/src/posix.c @@ -11,9 +11,12 @@ **/ /** Include files **/ -#include /* Standard I/O definitions */ #include "estruct.h" /* Emacs definitions */ +#if POSIX + +#include /* Standard I/O definitions */ + /** Do nothing routine **/ int scnothing() { @@ -212,25 +215,25 @@ int fn; /* Resulting keycode */ /* If no keys defined, go directly to insert mode */ first = 1; if (nxtkey != keymap) { - + /* Start at top of key map */ cur = keymap; - + /* Loop until matches exhast */ while (*seq) { - + /* Do we match current character */ if (*seq == cur->ch) { - + /* Advance to next level */ seq++; cur = cur->nxtlvl; first = 0; } else { - + /* Try next character on same level */ nxtcur = cur->samlvl; - + /* Stop if no more */ if (nxtcur) cur = nxtcur; @@ -239,25 +242,25 @@ int fn; /* Resulting keycode */ } } } - + /* Check for room in keymap */ if (strlen(seq) > NKEYENT - (nxtkey - keymap)) return; - + /* If first character in sequence is inserted, add to prefix table */ if (first) keyseq[*seq] = 1; - + /* If characters are left over, insert them into list */ for (first = 1; *seq; first = 0) { - + /* Make new entry */ nxtkey->ch = *seq++; nxtkey->code = fn; - + /* If root, nothing to do */ if (nxtkey != keymap) { - + /* Set first to samlvl, others to nxtlvl */ if (first) cur->samlvl = nxtkey; @@ -324,12 +327,12 @@ int ch; /* Character to add */ { /* Check for overflow */ if (inbuft == &inbuf[sizeof(inbuf)]) { - + /* Annoy user */ ttbeep(); return; } - + /* Add character */ *inbuft++ = ch; } @@ -339,11 +342,11 @@ void cook() { unsigned char ch; struct keyent * cur; - + /* Get first character untimed */ ch = grabwait(); qin(ch); - + /* Skip if the key isn't a special leading escape sequence */ if (keyseq[ch] == 0) return; @@ -367,7 +370,7 @@ void cook() } else { /* Advance to next level */ cur = cur->nxtlvl; - + /* Get next character, timed */ ch = grabnowait(); if (ch == TIMEOUT) @@ -389,7 +392,7 @@ int ttgetc() /* Loop until character found */ while (1) { - + /* Get input from buffer, if available */ if (inbufh != inbuft) { ch = *inbufh++; @@ -401,7 +404,7 @@ int ttgetc() /* Fill input buffer */ cook(); } - + /* Return next character */ return(ch); } @@ -433,7 +436,7 @@ int bktoshell(f, n) { /* Reset the terminal and go to the last line */ vttidy(); - + /* Okay, stop... */ kill(getpid(), SIGTSTP); @@ -621,7 +624,7 @@ int n; /* Argument count */ } /** Filter buffer through command **/ -int filter(f, n) +int uefilter(f, n) int f; /* Flags */ int n; /* Argument count */ { @@ -670,7 +673,7 @@ int n; /* Argument count */ /* Mark buffer as changed */ bp->b_flag |= BFCHG; } - + /* Reset file name */ strcpy(bp->b_fname, tmpnam); @@ -756,3 +759,4 @@ char *getnfile() return(rbuf); } +#endif diff --git a/src/replace.c b/src/replace.c index 4a60691..935ed75 100644 --- a/src/replace.c +++ b/src/replace.c @@ -17,7 +17,7 @@ static char *oldpatmatch = NULL; /* allocated memory for un-do.*/ /* * sreplace -- Search and replace. */ -int PASCAL NEAR sreplace(f, n) +int sreplace(f, n) int f; /* default flag */ int n; /* # of repetitions wanted */ { @@ -27,7 +27,7 @@ int n; /* # of repetitions wanted */ /* * qreplace -- search and replace with query. */ -int PASCAL NEAR qreplace(f, n) +int qreplace(f, n) int f; /* default flag */ int n; /* # of repetitions wanted */ { @@ -38,22 +38,22 @@ int n; /* # of repetitions wanted */ * replaces -- Search for a string and replace it with another * string. Query might be enabled (according to kind). */ -int PASCAL NEAR replaces(kind, f, n) -int kind; /* Query enabled flag */ -int f; /* default flag */ -int n; /* # of repetitions wanted */ +int NEAR replaces(kind, f, n) +int kind; /* Query enabled flag */ +int f; /* default flag */ +int n; /* # of repetitions wanted */ { register int status; /* success flag on pattern inputs */ register int nummatch; /* number of found matches */ - long numsub; /* number of substitutions */ - int nlflag; /* last char of search string a ? */ - int nlrepl; /* was a replace done on the last line? */ - char c; /* input char for query */ + long numsub; /* number of substitutions */ + int nlflag; /* last char of search string a ? */ + int nlrepl; /* was a replace done on the last line? */ + char c; /* input char for query */ LINE *origline; /* original "." position */ int origoff; /* and offset (for . query option) */ LINE *lastline; /* position of last replace and */ - int lastoff; /* offset (for 'u' query option) */ - int oldmatchlen; /* Closure may alter the match length.*/ + int lastoff = 0; /* offset (for 'u' query option) */ + int oldmatchlen = 0; /* Closure may alter the match length.*/ /* * Don't allow this command if we are @@ -83,7 +83,7 @@ int n; /* # of repetitions wanted */ /* Set up flags so we can make sure not to do a recursive * replace on the last line. */ - nlflag = (pat[strlen(pat) - 1] == '\r'); + nlflag = (pat[strlen((CONST char*) pat) - 1] == RET_CHAR); nlrepl = FALSE; /* Save original . position, reset the number of matches and @@ -291,7 +291,7 @@ pprompt: mlrquery(); /* * mlrquery -- The prompt for query-replace-string. */ -VOID PASCAL NEAR mlrquery() +VOID mlrquery() { register int tcol; #if MAGIC @@ -334,13 +334,13 @@ VOID PASCAL NEAR mlrquery() * then either insert the string directly, or make use of * replacement meta-array. */ -int PASCAL NEAR delins(dlength, instr, use_rmc) +int delins(dlength, instr, use_rmc) int dlength; char *instr; int use_rmc; { register int status; - register char *rstr; + register CONST char *rstr; #if MAGIC register RMC *rmcptr; #endif @@ -384,7 +384,7 @@ int use_rmc; * the array is never actually created - we will just use the * character array rpat[] as the replacement string. */ -int PASCAL NEAR rmcstr() +int rmcstr() { RMC *rmcptr; char *patptr; @@ -502,7 +502,7 @@ int PASCAL NEAR rmcstr() /* * rmcclear -- Free up any strings, and MCNIL the RMC array. */ -VOID PASCAL NEAR rmcclear() +VOID rmcclear() { register RMC *rmcptr; diff --git a/src/screen.c b/src/screen.c index 0f2c824..a4b9c94 100644 --- a/src/screen.c +++ b/src/screen.c @@ -15,11 +15,11 @@ dumpscreens(msg) char *msg; { - SCREEN *sp; + ESCREEN *sp; printf("<%s>\n", msg); sp = first_screen; - while (sp != (SCREEN *)NULL) { + while (sp != (ESCREEN *)NULL) { printf("%lu - [%s] %d/%d to %d/%d \n", sp, sp->s_screen_name, sp->s_roworg, sp->s_colorg, sp->s_nrow, sp->s_ncol); sp = sp->s_next_screen; @@ -32,9 +32,9 @@ char *msg; #if WINDOW_TEXT /* Redraw given screen and all screens behind it */ -VOID PASCAL NEAR refresh_screen(sp) +VOID refresh_screen(sp) -SCREEN *sp; /* screen image to refresh */ +ESCREEN *sp; /* screen image to refresh */ { /* if we are suppressing redraws */ @@ -42,13 +42,13 @@ SCREEN *sp; /* screen image to refresh */ return; /* at end of list, do nothing */ - if (sp == (SCREEN *)NULL) + if (sp == (ESCREEN *)NULL) return; /* if first refresh, erase the page */ if (sp == first_screen) { (*term.t_clrdesk)(); - if (sp->s_next_screen == (SCREEN *)NULL) + if (sp->s_next_screen == (ESCREEN *)NULL) sgarbf = TRUE; } @@ -66,29 +66,29 @@ SCREEN *sp; /* screen image to refresh */ to A-N on machines with an ALT key */ -PASCAL NEAR cycle_screens(f, n) +int cycle_screens(f, n) int f,n; /* prefix flag and argument */ { - SCREEN *sp; /* ptr to screen to switch to */ + ESCREEN *sp; /* ptr to screen to switch to */ /* find the last screen */ sp = first_screen; - while (sp->s_next_screen != (SCREEN *)NULL) + while (sp->s_next_screen != (ESCREEN *)NULL) sp = sp->s_next_screen; /* and make this screen current */ return(select_screen(sp, TRUE)); } -PASCAL NEAR find_screen(f, n) +int find_screen(f, n) int f,n; /* prefix flag and argument */ { char scr_name[NSTRING]; /* buffer to hold screen name */ - SCREEN *sp; /* ptr to screen to switch to */ + ESCREEN *sp; /* ptr to screen to switch to */ int result; /* get the name of the screen to switch to */ @@ -98,7 +98,7 @@ int f,n; /* prefix flag and argument */ } sp = lookup_screen(scr_name); - if (sp == (SCREEN *)NULL) { + if (sp == (ESCREEN *)NULL) { /* save the current dot position in the buffer info so the new screen will start there! */ @@ -113,9 +113,9 @@ int f,n; /* prefix flag and argument */ return(select_screen(sp, TRUE)); } -PASCAL NEAR free_screen(sp) /* free all resouces associated with a screen */ +VOID free_screen(sp) /* free all resouces associated with a screen */ -SCREEN *sp; /* screen to dump */ +ESCREEN *sp; /* screen to dump */ { register int cmark; /* mark ordinal index */ @@ -149,11 +149,11 @@ SCREEN *sp; /* screen to dump */ free((char *) sp); } -int PASCAL NEAR unlist_screen(sp) +VOID unlist_screen(sp) -SCREEN *sp; /* screen to remove from the list */ +ESCREEN *sp; /* screen to remove from the list */ { - SCREEN *last_scr; /* screen previous to one to delete */ + ESCREEN *last_scr; /* screen previous to one to delete */ last_scr = first_screen; while (last_scr) { @@ -164,13 +164,13 @@ SCREEN *sp; /* screen to remove from the list */ last_scr->s_next_screen = sp->s_next_screen; } -PASCAL NEAR delete_screen(f, n) +int delete_screen(f, n) int f,n; /* prefix flag and argument */ { char scr_name[NSTRING]; /* buffer to hold screen name */ - SCREEN *sp; /* ptr to screen to switch to */ + ESCREEN *sp; /* ptr to screen to switch to */ int result; /* get the name of the screen to delete */ @@ -181,7 +181,7 @@ int f,n; /* prefix flag and argument */ sp = lookup_screen(scr_name); /* make sure it exists... */ - if (sp == (SCREEN *)NULL) { + if (sp == (ESCREEN *)NULL) { mlwrite(TEXT240); /* "[No such screen]" */ return(FALSE); } @@ -202,29 +202,29 @@ int f,n; /* prefix flag and argument */ /* this function initializes a new screen.... */ -SCREEN *PASCAL NEAR init_screen(scr_name, scr_buf) +ESCREEN *init_screen(scr_name, scr_buf) char *scr_name; /* screen name */ BUFFER *scr_buf; /* buffer to place in first window of screen */ { int cmark; /* current mark to initialize */ - SCREEN *sp; /* pointer to allocated screen */ - SCREEN *last_sp; /* pointer to last screen */ + ESCREEN *sp; /* pointer to allocated screen */ + ESCREEN *last_sp; /* pointer to last screen */ EWINDOW *wp; /* ptr to first window of new screen */ /* allocate memory for this screen */ - sp = (SCREEN *)room(sizeof(SCREEN)); - if (sp == (SCREEN *)NULL) + sp = (ESCREEN *)room(sizeof(ESCREEN)); + if (sp == (ESCREEN *)NULL) return(sp); /* set up this new screens fields! */ - sp->s_next_screen = (SCREEN *)NULL; + sp->s_next_screen = (ESCREEN *)NULL; sp->s_screen_name = copystr(scr_name); #if WINDOW_MSWIN if (term.t_newscr (sp) != TRUE) { /* failed */ free ((void *)sp); - return ((SCREEN *)NULL); + return ((ESCREEN *)NULL); } /* ... in MSWIN, the s_nrow/ncol etc... values are kept up to date by vtinitscr; besides, term entries may actually match @@ -244,7 +244,7 @@ BUFFER *scr_buf; /* buffer to place in first window of screen */ wp = (EWINDOW *)room(sizeof(EWINDOW)); if (wp == (EWINDOW *)NULL) { free((char *)sp); - return((SCREEN *)NULL); + return((ESCREEN *)NULL); } sp->s_first_window = sp->s_cur_window = wp; @@ -279,14 +279,14 @@ BUFFER *scr_buf; /* buffer to place in first window of screen */ wp->w_flag = WFMODE|WFHARD; /* Full. */ /* first screen? */ - if (first_screen == (SCREEN *)NULL) { + if (first_screen == (ESCREEN *)NULL) { first_screen = sp; return(sp); } /* insert it at the tail of the screen list */ last_sp = first_screen; - while (last_sp->s_next_screen != (SCREEN *)NULL) + while (last_sp->s_next_screen != (ESCREEN *)NULL) last_sp = last_sp->s_next_screen; last_sp->s_next_screen = sp; @@ -294,12 +294,12 @@ BUFFER *scr_buf; /* buffer to place in first window of screen */ return(sp); } -SCREEN *PASCAL NEAR lookup_screen(scr_name) +ESCREEN *lookup_screen(scr_name) char *scr_name; /* named screen to find */ { - SCREEN *result; + ESCREEN *result; /* scan the screen list */ result = first_screen; @@ -314,20 +314,20 @@ char *scr_name; /* named screen to find */ } /* we didn't find it..... */ - return((SCREEN *)NULL); + return((ESCREEN *)NULL); } -int PASCAL NEAR select_screen(sp, announce) +int select_screen(sp, announce) -SCREEN *sp; /* ptr to screen to switch to */ +ESCREEN *sp; /* ptr to screen to switch to */ int announce; /* announce the selection? */ { EWINDOW *temp_wp; /* backup of current window ptr (curwp) */ - SCREEN *temp_screen; /* temp ptr into screen list */ + ESCREEN *temp_screen; /* temp ptr into screen list */ /* make sure there is something here to set to! */ - if (sp == (SCREEN *)NULL) + if (sp == (ESCREEN *)NULL) return(FALSE); /* nothing to do, it is already current */ @@ -361,7 +361,7 @@ int announce; /* announce the selection? */ /* re-order the screen list */ temp_screen = first_screen; - while (temp_screen->s_next_screen != (SCREEN *)NULL) { + while (temp_screen->s_next_screen != (ESCREEN *)NULL) { if (temp_screen->s_next_screen == sp) { temp_screen->s_next_screen = sp->s_next_screen; break; @@ -396,7 +396,7 @@ int announce; /* announce the selection? */ Bound to "A-B". */ -PASCAL NEAR list_screens(f, n) +int list_screens(f, n) int f,n; /* prefix flag and argument */ @@ -418,12 +418,12 @@ int f,n; /* prefix flag and argument */ * is an error (if there is no memory). Iflag * indicates whether to list hidden screens. */ -PASCAL NEAR screenlist(iflag) +int screenlist(iflag) int iflag; /* list hidden screen flag */ { - SCREEN *sp; /* ptr to current screen to list */ + ESCREEN *sp; /* ptr to current screen to list */ EWINDOW *wp; /* ptr into current screens window list */ int status; /* return status from functions */ char line[NSTRING]; /* buffer to construct list lines */ @@ -492,7 +492,7 @@ int iflag; /* list hidden screen flag */ /* rename_screen: change the current screen's name */ -int PASCAL NEAR rename_screen(f, n) +int rename_screen(f, n) int f, n; /* default number and arguments */ @@ -506,7 +506,7 @@ int f, n; /* default number and arguments */ return(result); } - if (lookup_screen(scr_name) != (SCREEN*)NULL) { + if (lookup_screen(scr_name) != (ESCREEN*)NULL) { mlwrite(TEXT336); /* "[Screen name already in use]" */ return(FALSE); diff --git a/src/smg.c b/src/smg.c index 9b523ce..c5f57bd 100644 --- a/src/smg.c +++ b/src/smg.c @@ -433,16 +433,16 @@ static int * inbuft = inbuf; /* Tail of input buffer */ /* Forward references. */ -extern int PASCAL NEAR smgmove(); -extern int PASCAL NEAR smgeeol(); -extern int PASCAL NEAR smgeeop(); -extern int PASCAL NEAR smgbeep(); -extern int PASCAL NEAR smgopen(); -extern int PASCAL NEAR smgrev(); -extern int PASCAL NEAR smgcres(); -extern int PASCAL NEAR smgparm(); -extern int PASCAL NEAR smggetc(); -extern int PASCAL NEAR smgclose(); +extern int smgmove(); +extern int smgeeol(); +extern int smgeeop(); +extern int smgbeep(); +extern int smgopen(); +extern int smgrev(); +extern int smgcres(); +extern int smgparm(); +extern int smggetc(); +extern int smgclose(); /** Terminal dispatch table **/ NOSHARE TERM term = { diff --git a/src/st52.c b/src/st52.c index 1477247..1c5631e 100644 --- a/src/st52.c +++ b/src/st52.c @@ -732,8 +732,8 @@ stgetc() /* get a char from the keyboard */ 0, menu[1].ob_x, menu[1].ob_y, menu[1].ob_width, menu[1].ob_height, 0, 0, 0, 0, 0, /* enter/exit, x, y, w, h for rect 2 */ - mes, /* Buffer to receive mesasge */ - /* Low and high order miliseconds of counter */ + mes, /* Buffer to receive message */ + /* Low and high order milliseconds of counter */ 100, 0, &mx, &my, /* Mouse location */ &bstate, /* State of the mouse buttons */ diff --git a/src/tags.c b/src/tags.c index 2dd75d5..d7d1934 100644 --- a/src/tags.c +++ b/src/tags.c @@ -29,8 +29,6 @@ #include "edef.h" #include "elang.h" -static char SVER[] = "@(#) %M% %I% %H%"; - #ifdef min #undef min #endif @@ -41,20 +39,20 @@ static char SVER[] = "@(#) %M% %I% %H%"; #define TAGWIDTH 30 typedef struct TAG - { +{ struct TAG *t_tagp; /* Link to the next 'tags' file */ char t_path[NFILEN]; /* Path of 'tags' file */ FILE *t_fp; /* File pointer to 'tags' file */ char t_wd[TAGWIDTH + 1]; /* Word last tagged (this file) */ char t_fname[NFILEN]; /* Holds name of file from where*/ - /* we tagged. */ + /* we tagged. */ int t_indexed; /* Flag: 1=file is indexed */ long t_dotos[NINDEXES]; /* Offsets of first chars (used */ - /* for speed-up purposes only). */ - } TAG; + /* for speed-up purposes only). */ +} TAG; static TAG *theadp = NULL; /* Pointer to the head of the */ - /* 'tags'-chain. */ +/* 'tags'-chain. */ static TAG *curtp = NULL; /* Currently in-use 'tags'. */ @@ -67,24 +65,24 @@ static TAG *curtp = NULL; /* Currently in-use 'tags'. */ * return with TRUE only if we are succesfull. */ -newtags(path) +int newtags(path) char path[NFILEN]; - { +{ register TAG *tnewp; register int i = NINDEXES; if ((tnewp = (TAG *) room(sizeof(TAG))) == NULL) - { + { mlwrite("[OUT OF MEMORY]"); return (FALSE); - } + } strcpy(tnewp->t_path, path); strcat(path, "tags"); if ((tnewp->t_fp = fopen(path, "r")) == NULL) - { + { free((char *) tnewp); return (FALSE); - } + } tnewp->t_tagp = theadp; curtp = theadp = tnewp; @@ -97,7 +95,7 @@ char path[NFILEN]; tnewp->t_dotos[--i] = -1L; return (TRUE); - } +} /* @@ -105,8 +103,8 @@ char path[NFILEN]; * try it the hard way. If we find the file we return TRUE. */ -lookup() - { +int lookup() +{ TAG *tmp = curtp; /* Remember current 'tags' */ char cpath[NFILEN]; /* Path of current file */ register char *cp; /* Auxiliary pointer */ @@ -116,9 +114,9 @@ lookup() #if MSDOS while (cp >= curbp->b_fname && *cp != DIRSEPCHAR && *cp != ':') #else - while (cp >= curbp->b_fname && *cp != DIRSEPCHAR) + while (cp >= curbp->b_fname && *cp != DIRSEPCHAR) #endif - cp--; + cp--; memset(cpath, '\0', NFILEN); if (cp >= curbp->b_fname) @@ -141,7 +139,7 @@ lookup() else curtp = tmp; return (FALSE); - } +} /* @@ -176,27 +174,27 @@ VOID fix_index() * str (but maximum lmax characters). '.' is preserved. */ -restword(str, lmax) +int restword(str, lmax) char *str; int lmax; - { +{ register int i; register int go_on = TRUE; register LINE *dotp = curwp->w_dotp; /* Preserve '.' info */ register int doto = curwp->w_doto; /* Preserve '.' info */ for (i = 0; go_on && i < lmax - 1 && inword(); i++) - { + { str[i] = lgetc(curwp->w_dotp, curwp->w_doto); go_on = forwchar(FALSE, 1); - } + } str[i] = 0; /* Terminate word */ curwp->w_dotp = dotp; /* Restore '.' */ curwp->w_doto = doto; return (TRUE); - } +} /* @@ -207,11 +205,11 @@ int lmax; * results from this code (I did). */ -backupword(f, n) +int backupword(f, n) int f, n; - { +{ while (inword()) if (backchar(FALSE, 1) == FALSE) break; @@ -219,7 +217,7 @@ int f, n; forwchar(FALSE, 1); return (TRUE); - } +} /* @@ -232,13 +230,13 @@ int f, n; * and search direction characters (? or /) */ -alterpattern(pattern) +int alterpattern(pattern) register char pattern[]; - { +{ register int i = 0; /* EMACS pattern index */ register int j = 1; /* VI pattern -skip /or?*/ int len = strlen(pattern) - 1; /* pattern length - 1 */ - /* i.e. drop '/' or '?' */ + /* i.e. drop '/' or '?' */ if (pattern[len - 1] == '$') len--; @@ -251,7 +249,7 @@ register char pattern[]; pattern[min(i, NPAT/2)] = '\0'; /* Terminate pattern string */ return (TRUE); - } +} /* @@ -259,7 +257,7 @@ register char pattern[]; */ static int thisfile = FALSE; /* TRUE if curtp->t_fname equals*/ - /* curbp->fname when tagging */ +/* curbp->fname when tagging */ static int tagvalid = FALSE; /* TRUE if last tag was a succes*/ /* @@ -275,7 +273,7 @@ char *filename; char *tp; if (curtp->t_path[0] == '.' && curtp->t_path[1] == DIRSEPCHAR && - curtp->t_path[2] == '\0') + curtp->t_path[2] == '\0') return; for (tp = filename; *tp && *tp != DIRSEPCHAR; tp++) @@ -298,13 +296,13 @@ char *filename; * so as to prevent loosing the return information. */ -tagger(errmsg, retag) -char *errmsg; +static int tagger(errmsg, retag) +CONST char *errmsg; int retag; - { +{ char tagf[NFILEN]; /* File of tagged word */ char pretagpat[NPAT]; /* Search pattern prior */ - /* to our tagging. */ + /* to our tagging. */ char line[NLINE]; /* Auxilliary string */ int ok = 1; /* Tag search flag */ int result = FALSE; /* Default return value */ @@ -317,18 +315,18 @@ int retag; /* Search for curtp->t_wd in the 'tags' file */ while (ok > 0 && fgets(line, NLINE, curtp->t_fp) != NULL) - { + { if ((ok = strncmp(curtp->t_wd, line, taglen)) < 0) break; else if (ok == 0 && line[taglen] != '\t') ok = -1; - } + } if (ok < 0) - { /* We couldn't find it..*/ + { /* We couldn't find it..*/ mlwrite(errmsg, curtp->t_wd); return (FALSE); - } + } strcpy(pretagpat, (char *) pat); /* Preserve old search pattern */ @@ -344,7 +342,7 @@ int retag; file_ok = thisfile ? TRUE : getfile(tagf, TRUE); oldbmode = curbp->b_mode; /* Preserve buffer mode */ if (file_ok) - { /* Ok, we got the file. Search! */ + { /* Ok, we got the file. Search! */ if (thisfile && retag == FALSE) /* It's the same file so just set mark */ setmark(FALSE, FALSE); @@ -363,35 +361,35 @@ int retag; rmcclear(); if (mcscanner(&mcdeltapat[0], FORWARD, PTBEG, 1) == FALSE) #else - if (scanner(FORWARD, PTBEG, 1) == FALSE) + if (scanner(FORWARD, PTBEG, 1) == FALSE) #endif { - /* Sorry, we couldn't find pattern so return... */ - if (thisfile && retag == FALSE) - /* It's the same file so simply swapmark*/ - swapmark(FALSE, FALSE); - else /* Get old file */ - getfile(curtp->t_fname, TRUE); - /* Tell user about our misfortune */ - mlwrite("[Failed to tag '%s']", curtp->t_wd); + /* Sorry, we couldn't find pattern so return... */ + if (thisfile && retag == FALSE) + /* It's the same file so simply swapmark*/ + swapmark(FALSE, FALSE); + else /* Get old file */ + getfile(curtp->t_fname, TRUE); + /* Tell user about our misfortune */ + mlwrite("[Failed to tag '%s']", curtp->t_wd); } - else { /* We found the pattern. Now point at word! */ - strcpy((char *) pat, curtp->t_wd); - setjtable(); + else { /* We found the pattern. Now point at word! */ + strcpy((char *) pat, curtp->t_wd); + setjtable(); #if MAGIC - result = mcscanner(&mcdeltapat[0], FORWARD, PTBEG, 1); + result = mcscanner(&mcdeltapat[0], FORWARD, PTBEG, 1); #else - result = scanner(FORWARD, PTBEG, 1); + result = scanner(FORWARD, PTBEG, 1); #endif } - } + } curbp->b_mode = oldbmode; /* Restore buffer mode */ strcpy((char *) pat, pretagpat); /* Restore search pattern */ setjtable(); return (result); - } +} @@ -400,7 +398,7 @@ int retag; * '.' is preserved, and return information (= current filename) is saved. */ -extern int PASCAL NEAR tagword(f, n) +extern int tagword(f, n) int f, n; @@ -413,17 +411,17 @@ int f, n; return (resterr()); if (lookup() == FALSE) - { /* Is 'tags' avaliable for this file? */ + { /* Is 'tags' avaliable for this file? */ mlwrite("[Sorry, can't find any 'tags']"); return (FALSE); - } + } /* Get word to tag */ if (inword()) - { + { backupword(FALSE, 1); restword(curtp->t_wd, TAGWIDTH); /* Grab word to tag */ - } + } else if (mlreply("Word to tag: ", curtp->t_wd, TAGWIDTH) != TRUE) return (FALSE); @@ -434,10 +432,10 @@ int f, n; /* Ok, set file offset according to curtp->t_wd (if any) */ if ((i = INDEX(*curtp->t_wd)) == -1 || curtp->t_dotos[i] == -1L) - { + { mlwrite("[No tag entry for '%s' found]", curtp->t_wd); return (FALSE); - } + } fseek(curtp->t_fp, curtp->t_dotos[i], 0); strcpy(curtp->t_fname, curbp->b_fname); /* Save name of current file */ @@ -452,11 +450,11 @@ int f, n; * Note, retagword do not mess up the return information (tagf). */ -extern int PASCAL NEAR retagword(f, n) +extern int retagword(f, n) int f, n; - { +{ if (restflag == TRUE) /* Don't allow when in restricted mode */ return (resterr()); @@ -464,7 +462,7 @@ int f, n; return (FALSE); return (tagger("[No additional tag entry for '%s' found]", TRUE)); - } +} /* @@ -473,25 +471,25 @@ int f, n; * we just swap mark with '.' . */ -extern int PASCAL NEAR backtagword(f, n) +extern int backtagword(f, n) int f, n; - { +{ if (restflag == TRUE) /* Don't allow when in restricted mode */ return (resterr()); if (*curtp->t_fname != '\0') - { + { if (thisfile) swapmark(FALSE, FALSE); else getfile(curtp->t_fname, TRUE); *curtp->t_fname = '\0'; - } + } return (TRUE); - } +} #else tagshello() diff --git a/src/tcap.c b/src/tcap.c index dd68c89..fe27c10 100644 --- a/src/tcap.c +++ b/src/tcap.c @@ -1,59 +1,59 @@ /* tcap: Unix V5, SUN OS, SCO XENIX, and BS4.2 Termcap video driver for MicroEMACS 4.00 - 12-10-88 - Modifications made by Guy Turcotte to accomodate + 12-10-88 - Modifications made by Guy Turcotte to accommodate SunOS V4.0 and Xenix V2.2.1 : - + SunOS mods: - + o p_seq field of TBIND struct augmented to 10 chars to take into account longer definitions for keys (some Sun's keys definitions need at least 7 chars...) as such, the code in get1key has been modified to take care of the longer p_seq string. - + o tcapopen modified to take care of the tgetstr problem (returns NULL on undefined keys instead of a valid string pointer...) - + o The timout algorithm of get1key has been modified to take care of the following select() function problem: if some chars are already in the terminal buffer before select is called and no others char appears on the terminal, it will timeout anyway... (maybe a feature of SunOs V4.0) - + Xenix mods: - + o The first two points indicated above are applicable for the Xenix OS - + o With my current knowledge, I can't find a clean solution to the timeout problem of the get1key function - under Xenix. I modified the code to get rid of the BSD code + under Xenix. I modified the code to get rid of the BSD code (via the #if directive) and use the Xenix nap() and rdchk() - functions to + functions to make a 1/30 second wait. Seems to work as long as there is not to much of activity from other processes on the system. (The link command of the makefile must be modified to link with the x library... you must add the option -lx) - + o The input.c file has been modified to not include the get1key function defined there in the case of USG. The - #if directive preceeding the get1key definition has been + #if directive preceding the get1key definition has been modified from: - + #if BSD == 0 - + to: - + #if (BSD == 0) && (USG == 0) - + o The following lines define the new termcap entry for the ansi kind of terminal: it permits the use of functions keys F1 .. F10 and keys HOME,END,PgUp,PgDn on the IBM PC keyboard (the last 3 lines of the definition have been added): - + li|ansi|Ansi standard crt:\ :al=\E[L:am:bs:cd=\E[J:ce=\E[K:cl=\E[2J\E[H:cm=\E[%i%d;%dH:co#80:\ :dc=\E[P:dl=\E[M:do=\E[B:bt=\E[Z:ei=:ho=\E[H:ic=\E[@:im=:li#25:\ @@ -67,19 +67,20 @@ :k1=\E[M:k2=\E[N:k3=\E[O:k4=\E[P:k5=\E[Q:\ :k6=\E[R:k7=\E[S:k8=\E[T:k9=\E[U:k0=\E[V:\ :kh=\E[H:kH=\E[F:kA=\E[L:kN=\E[G:kP=\E[I: - + */ #define termdef 1 /* don't define "term" external */ -#include #include "estruct.h" + +#if TERMCAP + +#include #include "eproto.h" #include "edef.h" #include "elang.h" -#if TERMCAP - #if USG | AUX | HPUX8 | HPUX9 | SMOS #include #endif @@ -90,7 +91,7 @@ #define MARGIN 8 #define SCRSIZ 64 -#define NPAUSE 10 /* # times thru update to pause */ +#define NPAUSE 500 /* Pause in milliseconds */ #define BEL 0x07 #define ESC 0x1B @@ -183,9 +184,9 @@ extern int tcapfcol(); extern int tcapbcol(); #endif -#define TCAPSLEN 1024 +#define TCAPSLEN 4096 char tcapbuf[TCAPSLEN]; -char *UP, PC, *CM, *CE, *CL, *SO, *SE, *IS, *KS, *KE; +char *UP, PC, *CM, *CE, *CL, *SO, *SE, *IS, *KS, *KE, *HO; TERM term = { 0, 0, 0, 0, /* these four values are set dynamically at open time */ @@ -266,7 +267,7 @@ tcapopen() { register int index; /* general index */ char *t, *p; - char tcbuf[1024]; + char tcbuf[4096]; char *tv_stype; char err_str[72]; char *tgetstr(); @@ -285,7 +286,7 @@ tcapopen() meexit(1); } - + if ((term.t_nrow=(short)tgetnum("li")-1) == -1) { puts(TEXT184); /* "termcap entry incomplete (lines)" */ @@ -311,6 +312,7 @@ tcapopen() UP = tgetstr("up", &p); SE = tgetstr("se", &p); SO = tgetstr("so", &p); + HO = tgetstr("ho", &p); if (SO != NULL) revexist = TRUE; @@ -323,18 +325,18 @@ tcapopen() if (CE == NULL) /* will we be able to use clear to EOL? */ eolexist = FALSE; - + IS = tgetstr("is", &p); /* extract init string */ KS = tgetstr("ks", &p); /* extract keypad transmit string */ KE = tgetstr("ke", &p); /* extract keypad transmit end string */ - + /* read definitions of various function keys into ttable */ for (index = 0; index < NTBINDS; index++) { strcpy(ttable[index].p_seq, fixnull(tgetstr(ttable[index].p_name, &p))); } - /* tell unix we are goint to use the terminal */ + /* tell unix we are going to use the terminal */ ttopen(); /* make sure we don't over run the buffer (TOO LATE I THINK) */ @@ -347,14 +349,14 @@ tcapopen() /* send init strings if defined */ if (IS != NULL) putpad(IS); - + if (KS != NULL) putpad(KS); /* initialize the input buffer */ in_init(); } - + tcapclose() { /* send end-of-keypad-transmit string if defined */ @@ -433,13 +435,13 @@ int tcapgetc() it was generated by an escape sequence and should be SPECed. */ -int PASCAL NEAR get1key() +int get1key() { register int c; register int index; /* index into termcap binding table */ char *sp; -#if BSD | HPUX8 | HPUX9 +#if BSD | HPUX8 | HPUX9 | LINUX int fdset; struct timeval timeout; #endif @@ -453,7 +455,7 @@ int PASCAL NEAR get1key() /* process a possible escape sequence */ /* set up to check the keyboard for input */ -#if BSD | HPUX8 | HPUX9 +#if BSD | HPUX8 | HPUX9 | LINUX fdset = 1; timeout.tv_sec = 0; timeout.tv_usec = 35000L; @@ -474,7 +476,7 @@ int PASCAL NEAR get1key() #if USG | AUX | SMOS /* we don't know how to do this check for a pending char within - 1/30th of a second machine independantly in the general System V + 1/30th of a second machine independently in the general System V case.... so we don't */ if (kbdmode != PLAY) return(CTRL | '['); @@ -567,6 +569,7 @@ char *str; putnpad(str, n) char *str; +int n; { tputs(str, n, ttputc); } diff --git a/src/theos.c b/src/theos.c new file mode 100644 index 0000000..3f886da --- /dev/null +++ b/src/theos.c @@ -0,0 +1,1248 @@ +#include "estruct.h" + +#if THEOS +#include "elang.h" +#include "eproto.h" +#include "edef.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +char dirpath[NFILEN]; + +/* + * Dispatch table. All the hard fields just point into the terminal I/O code. + */ + +int crtopen(),crtclose(),crtkopen(),crtkclose(),crtmove(), + crteol(),crteop(),crtclr(),crtbeep(),crtrev(),crtfcol(),crtbcol(); +int crtcres(); + +#define NROW 24 /* Screen size. */ +#define NCOL 80 /* Edit if you want to. */ +#define MARGIN 8 /* size of minimim margin and */ +#define SCRSIZ 64 /* scroll size for extended lines */ +#define NPAUSE 500 /* # times thru update to pause */ + +/* The Mouse driver only works with typeahead defined */ +#if MOUSE +#undef TYPEAH +#define TYPEAH 1 +static int mexist; /* is the mouse driver installed? */ +static short msig; /* Mouse event */ +static char mbuf[6]; +static short mbpos = 0; +#endif + +TERM term = { + NROW-1, + NROW-1, + NCOL, + NCOL, + 0, 0, + MARGIN, + SCRSIZ, + NPAUSE, + &crtopen, + &crtclose, + &crtkopen, + &crtkclose, + &ttgetc, + &ttputc, + &ttflush, + &crtmove, + &crteol, + &crteop, + &crtclr, + &crtbeep, + &crtrev, + &crtcres +#if COLOR + ,&crtfcol, + &crtbcol +#endif +}; + +#if COLOR +/* + * THEOS colors map + */ +int csinfg,csinbg,csirfg,csirbg; +int colormap[NCOLORS] = { 0,4,2,6,1,5,3,7,0+8,4+8,2+8,6+8,1+8,5+8,3+8,7+8 }; +int cfcolor; +int cbcolor; +#endif + +static int read_raw; + +/* used by terminals supporting any national characters or symbols */ + +#define CTRL_KEYS 29 +#define INTER_KEYS 46 +#define ISO_KEYS 11 + +typedef struct TERMINAL_FD { + char type_code; + char terminal_name[25]; + near char *attrib[36]; + near char *ctrl_key[CTRL_KEYS]; + near char *graph[26]; + near char *slave[2]; + near char *inter[INTER_KEYS]; + near char *inter_key[INTER_KEYS]; + near char *iso[7]; + near char *iso_key[ISO_KEYS]; +} CLASS; + +#define TRM (unsigned short *) ((CLASS *) 0) + +#define CONI 26 +#define CONO 27 + +#define BEL 7 +#define RVON 14 /* SO 0x0e reversed video attribute on */ +#define RVOFF 15 /* SI 0x0f reversed video attribute off */ +#undef EOL +#define EOS 24 /* CAN 0x18 erase from cursor to end of screen */ +#define EOL 23 /* ETB 0x17 erase from cursor to end of line */ +#define CLEAR 12 +#define PON 4 /* EOT 0x04 protect attribute on (half intensity) */ +#define POFF 5 /* ENQ 0x05 protect attribute off */ +#define KON 25 /* EM 0x19 cursor on */ +#define BON 29 /* GS 0x1d blink attribute on */ +#define BOFF 30 /* RS 0x1e blink attribute off */ + +static struct ucb *ucb; +static unsigned short transeg; +static int next; +static char keybuf[20]; +static char term_type; +static int baud; +static char iso[ISO_KEYS] = { + 0x23,0x40,0x5b,0x5c,0x5d,0x5e,0x60,0x7b,0x7c,0x7d,0x7e +}; + +static short ctl[] = { + 0x50|0x100, /* down_key */ + 0x48|0x100, /* up_key */ + 0x4b|0x100, /* left_key */ + 0x4d|0x100, /* right_key */ + 0x1b, /* esc_key may be: ESC = ESC ESC ?? */ + 0x47|0x100, /* top_key */ + 0x4f|0x100, /* bottom_key */ + 0x53|0x100, /* delchar_key */ + 0x51|0x100, /* page_fwd_key */ + 0x49|0x100, /* page_bck_key */ + 0x3c|0x100, /* word_right_key */ + 0x55|0x100, /* word_left_key */ + 0x3b|0x100, /* sch_fwd_key */ + 0x54|0x100, /* sch_bck_key */ + 0x3d|0x100, /* again key */ + 0x44|0x100, /* file_key */ + 0x3f|0x100, /* erase_key */ + 0x42|0x100, /* beg_line_key */ + 0x5b|0x100, /* end_line_key */ + 0x5a|0x100, /* case_key */ + 0x5d|0x100, /* save_key */ + 0x43|0x100, /* quit_key */ + 0x3e|0x100, /* find_key */ + 0x52|0x100, /* replace_key */ + 0x7f, /* del_left_key */ + 0x41|0x100, /* transpose_key */ + 0x40|0x100, /* ins_line_key */ + 0x59|0x100, /* del_line_key */ + 0x5c|0x100 /* help_key */ +}; + +int crtrev(status) /* set the reverse video state */ +int status; /* TRUE = reverse video,FALSE = normal video */ +{ + putch(status ? RVON : RVOFF); + return 0; +} + +int crtcres() +{ + return TRUE; +} + +int spal(char *pal) +{ + return 0; +} + +#if COLOR +int crtfcol(color) +{ + if (cfcolor == color) + return 0; + + crtcolor(colormap[cfcolor = color] & 7, colormap[cbcolor] & 7, + csirfg, csirbg); + putch(colormap[color] < 7 ? PON : POFF); + if (ispcterm() && _osmajor != 3) + putch(colormap[cbcolor] > 7 ? BON : BOFF); + return 0; +} + +int crtbcol(color) +{ + struct bytecntl bc; + + if (cbcolor == color) + return 0; + + crtcolor(colormap[cfcolor] & 7, colormap[cbcolor = color] & 7, + csirfg, csirbg); + putch(colormap[cfcolor] < 7 ? PON : POFF); + if (ispcterm() && _osmajor != 3) + putch(colormap[cbcolor] > 7 ? BON : BOFF); +} + +int getecolor(co) +{ + register int i; + + for (i = 0; i < NCOLORS; i++) + if (co == colormap[i]) + return i; + return 0; +} +#endif + +void quick_exit() +{ + quit(TRUE, 0); +} + +int crtkopen() +{ + signal(SIGQUIT,quick_exit); + return 0; +} + +int crtkclose() +{ + signal(SIGQUIT,SIG_DFL); + return 0; +} + +/* + * Look in the class for the received sequence. + */ + +void scant(unsigned short *ofs, short tblsz, short *exact, short *begin) +{ + register char *sqofs; + register short i, lseq; + + for (i = 0; i < tblsz; i++, ofs++) { + if ((sqofs = (char *) peekw(ofs, transeg)) != NULL) { + lseq = peek(sqofs, transeg); + if (keybuf[0] == lseq) { + /* if exists */ + if (*exact < 0 + && ! farcmp(getds(), keybuf, transeg, sqofs, keybuf[0]+1)) { + *exact = i; + if (*begin >= 0) + break; + } + } else if (keybuf[0] < lseq) { + /* if is beginning of a class sequence */ + if (*begin < 0 + && ! farcmp(getds(), &keybuf[1], transeg, sqofs+1, keybuf[0])) { + *begin = i; + if (*exact >= 0) + break; + } + } + } + } +} + +/* + * Map extended chars to function code. + */ + +int extcode(c) +{ + /* function keys 1 through 9. High-order will be 0x00 */ + if (c >= 0xC0 && c < 0xC9) + return(SPEC | c - 0xBF + '0'); + /* function key 10 */ + if (c == 0xC9) + return(SPEC | '0'); + + /* shifted function keys */ + if (c >= 0xD0 && c < 0xD9) + return(SPEC | SHFT | c - 0xCF + '0'); + if (c == 0xD9) + return(SPEC | SHFT | '0'); + + /* control function keys */ + if (c >= 0xE0 && c < 0xE8) + return(SPEC | CTRL | c - 0xDF + '0'); + if (c == 0xE9) + return(SPEC | CTRL | '0'); + + /* ALTed function keys */ + if (c >= 0xF0 && c < 0xF8) + return(SPEC | ALTD | c - 0xEF + '0'); + if (c == 0xF9) + return(SPEC | ALTD | '0'); + + switch (c) { + case 0x6E: return(SHFT | CTRL | 'I'); /* backtab */ + case 0x47: return(SPEC | '<'); /* home */ + case 0x48: return(SPEC | 'P'); /* cursor up */ + case 0x49: return(SPEC | 'Z'); /* page up */ + case 0x4B: return(SPEC | 'B'); /* cursor left */ + case 0x4D: return(SPEC | 'F'); /* cursor right */ + case 0x4F: return(SPEC | '>'); /* end */ + case 0x50: return(SPEC | 'N'); /* cursor down */ + case 0x51: return(SPEC | 'V'); /* page down */ + case 0x52: return(SPEC | 'C'); /* insert */ + case 0x53: return(SPEC | 'D'); /* delete */ + + case 0x0b: return(SPEC | CTRL | 'B'); /* control left */ + case 0x0d: return(SPEC | CTRL | 'F'); /* control right */ + case 0x0f: return(SPEC | CTRL | '>'); /* control end */ + case 0x11: return(SPEC | CTRL | 'V'); /* control page down */ + case 0x07: return(SPEC | CTRL | '<'); /* control home */ + case 0x09: return(SPEC | CTRL | 'Z'); /* control page up */ + case 0x08: return(SPEC | CTRL | 'P'); /* control up */ + case 0x10: return(SPEC | CTRL | 'N'); /* control down */ + case 0x12: return(SPEC | CTRL | 'C'); /* control grey insert */ + case 0x13: return(SPEC | CTRL | 'D'); /* control grey delete */ + + /* F11 and F12 */ + + case 0xCA: return(SPEC | '-'); /* F11 */ + case 0xCB: return(SPEC | '='); /* F12 */ + case 0xDA: return(SPEC | SHFT | '-'); /* shift F11 */ + case 0xDB: return(SPEC | SHFT | '='); /* shift F12 */ + case 0xEA: return(SPEC | CTRL | '-'); /* control F11 */ + case 0xEB: return(SPEC | CTRL | '='); /* control F12 */ + case 0xFA: return(SPEC | ALTD | '-'); /* alt F11 */ + case 0xFB: return(SPEC | ALTD | '='); /* alt F12 */ + } +} + +#if MOUSE + +int checkmouse() +{ + short mbut; /* State of mouse buttons */ + int mcol; /* x position of mouse */ + int mrow; /* y position of mouse */ + long mtime; + static short obut; /* State of mouse buttons */ + + wMouseRead(&mbut, &mcol, &mrow, &mtime); + + if (mbut == 0) { + mbuf[4] = MOUS>>8; + mbuf[3] = mcol; + mbuf[2] = mrow; + mbuf[1] = (obut & wMOUSE_LEFT_DOWN) ? 'b' : 'd'; + mbpos = 4; + obut = mbut; + return TRUE; + } else if (mbut & (wMOUSE_LEFT_DRAG|wMOUSE_RIGHT_DRAG)) { + /* generate a mouse movement */ + if (((mouse_move == 1) && (mmove_flag == TRUE)) || + (mouse_move == 2)) { + mbuf[4] = MOUS>>8; + mbuf[3] = mcol; + mbuf[2] = mrow; + mbuf[1] = 'm'; + mbpos = 4; + obut = mbut; + return TRUE; + } + } else if (mbut & (wMOUSE_LEFT_DOWN|wMOUSE_RIGHT_DOWN)) { + mbuf[4] = MOUS>>8; + mbuf[3] = mcol; + mbuf[2] = mrow; + mbuf[1] = (mbut & wMOUSE_LEFT_DOWN) ? 'a' : 'c'; + mbpos = 4; + obut = mbut; + return TRUE; + } + obut = mbut; + return FALSE; +} +#endif + +/* + * Read raw from terminal. + */ + +int getkbd() +{ + int c; + struct bytecntl bc; + + if (read_raw) { + bc.c_cmd = READ_RAW; + return _ioctl(stdin, &bc); + } + + pokewucb(0,&ucb->transeg); + c = getch(); + pokewucb(transeg,&ucb->transeg); + + return c; +} + +int kbdget() +{ +#if MOUSE + int c; + + if (mbpos) + return mbuf[mbpos--]; + + for (;;) { + c = getkbd(); + + if (mexist && msig) { + msig = 0; + + if (checkmouse()) + return 0; + } else + return c; + } +#else + return getkbd(); +#endif +} + +/* + * Read keyboard on Ascii terminal. + */ + +int asgetc() +{ + short c; + short n; + short ectrl, einter, eiso; /* exact string */ + short begin; /* beginning of string */ + + if (! keybuf[0]) { + next = 0; +next: + ectrl = einter = eiso = begin = -1; + /* read raw */ + keybuf[1+keybuf[0]++] = kbdget(); + /* look for extended key */ + scant(TRM->ctrl_key, CTRL_KEYS, &ectrl, &begin); + /* if international class and sequence is not a ctrl key */ + if (term_type == '\xfd' && ectrl < 0 && begin < 0) { + /* look for international character */ + scant(TRM->inter_key, INTER_KEYS, &einter, &begin); + /* if not, look for iso key */ + if (einter < 0 && begin < 0) + scant(TRM->iso_key, ISO_KEYS, &eiso, &begin); + } + + /* is received sequence the beginning of a class sequence ? */ + if (begin >= 0) { + /* yes, and main term keyboard grab next character */ + if (baud == 0 || keybuf[0] > 1) + goto next; + /* wait a little on a serial terminal */ + _sleep(10L); + /* if a character exists, grab it */ + if (conrdy()) + goto next; + } + /* map received sequence ... */ + if (ectrl >= 0) { + /* to control key */ + if (ctl[ectrl] & 0x100) { + /* sequence 0xff xx */ + keybuf[0] = 0; + return ctl[ectrl] & 0xff; + } + keybuf[0] = 0; + return ctl[ectrl]; + } else if (einter >= 0) { + /* to international character */ + keybuf[0] = 0; + return (einter + 192); + } else if (eiso >= 0) { + /* to iso character */ + keybuf[0] = 0; + return (iso[eiso]); + } + } + + keybuf[0]--; + return (keybuf[++next]); +} + +/* + * Read keyboard on PcTerm terminal. + */ + +int pcgetc() +{ + int c; + + if ((c = kbdget()) == 0xff) + return extcode(kbdget()); + else if (c > 0x80) + return c; + + return c; +} + +/* + * Read keyboard. + */ + +int ttgetc() +{ + return (ispcterm()) ? pcgetc() : asgetc(); +} + +int crtputc(c) +{ + putch(c); + return 0; +} + +int crtmove(row,col) +{ + at(col,row); + return 0; +} + +int crteol() +{ +#if COLOR + crtcolor(colormap[cfcolor] & 7, colormap[cbcolor] & 7, csirfg, csirbg); + putch(colormap[cfcolor] < 7 ? PON : POFF); + if (ispcterm() && _osmajor != 3) + putch(colormap[cbcolor] > 7 ? BON : BOFF); +#endif + putch(EOL); + return 0; +} + +int crteop() +{ +#if COLOR + crtcolor(colormap[gfcolor] & 7,colormap[gbcolor] & 7,csirfg,csirbg); + putch(colormap[gfcolor] < 7 ? PON : POFF); + if (ispcterm() && _osmajor != 3) + putch(colormap[gbcolor] > 7 ? BON : BOFF); +#endif + putch(EOS); + return 0; +} + +int crtclr() +{ +#if COLOR + crtcolor(csinfg, csinbg, csirfg, csirbg); +#endif + putch(CLEAR); +} + +int crtbeep() +{ + putch(BEL); + return 0; +} + +int crtopen() +{ + /* No echo, ... */ + conmask("nm0"); + /* get screen size */ + term.t_mrow = term.t_nrow = getpl(CONO)-1; + term.t_mcol = term.t_ncol = getll(CONO); + /* open keyboard */ + crtkopen(); + keybuf[0] = '\0'; + /* get and save some terminal parameters */ + ucb = getucb(CONI); + transeg = peekwnuc(&ucb->transeg); + term_type = peek(&((CLASS *)0)->type_code,transeg); + baud = peeknuc(&ucb->baud); + read_raw = _osmajor != 3; + ttopen(); +#if COLOR + /* initialize colors */ + csinfg = peekscr(&SCR->csi_color[0]) & 0x0f; + csinbg = peekscr(&SCR->csi_color[1]) & 0x0f; + csirfg = peekscr(&SCR->csi_color[2]) & 0x0f; + csirbg = peekscr(&SCR->csi_color[3]) & 0x0f; + gfcolor = cfcolor = getecolor(csinfg); + gbcolor = cbcolor = getecolor(csinbg); +#endif + return 0; +} + +int crtclose() +{ + crtkclose(); + ttflush(); + ttclose(); + return 0; +} + +/** Open terminal device **/ +int ttopen() +{ + /* on all screens we are not sure of the initial position + of the cursor */ + ttrow = 999; + ttcol = 999; + cfcolor = cbcolor = -1; + wIntensity(-1); + strcpy(os, "THEOS"); + putch(KON); +#if MOUSE + if (HasMouse()) { + mexist = TRUE; + wMouseEnable(&msig, + wMOUSE_LEFT_DOWN | wMOUSE_LEFT_DRAG | + wMOUSE_LEFT_DOWN | wMOUSE_LEFT_DRAG | + wMOUSE_RIGHT_DOWN | wMOUSE_RIGHT_DRAG | + wMOUSE_RIGHT_DOWN | wMOUSE_RIGHT_DRAG + ); + msig = 0; + mbpos = 0; + } else + mexist = FALSE; +#endif + return 0; +} + +/** Close terminal device **/ +int ttclose() +{ + struct bytecntl bc; + +#if MOUSE + wMouseDisable(); +#endif + wIntensity(0); +#if COLOR + crtcolor(csinfg, csinbg, csirfg, csirbg); +#endif + putch(CLEAR); + putch(KON); + return 0; +} + +/* + * Write a character to the display. On VMS, terminal output is buffered, and + * we just put the characters in the big array, after checking for overflow. + * On MS-DOS use the very very raw console output routine. + */ +int ttputc(int c) +{ + putch(c); + return 0; +} + +/* + * Flush terminal buffer. Does real work where the terminal output is buffered + * up. A no-operation on systems where byte at a time terminal I/O is done. + */ +int ttflush() +{ + return 0; +} + +#if TYPEAH +/* typahead: Check to see if any characters are already in the + keyboard buffer +*/ + +int typahead() +{ + return conrdy(); +} +#endif /* TYPEAH */ + +/** Get time of day **/ +char * timeset() +{ + long int buf; /* Should be time_t */ + char * sp, * cp; + + char * ctime(); + + /* Get system time */ + time(&buf); + + /* Pass system time to converter */ + sp = ctime(&buf); + + /* Eat newline character */ + for (cp = sp; *cp; cp++) + if (*cp == '\n') { + *cp = '\0'; + break; + } + return(sp); +} + +/** Callout to system to perform command **/ +int callout(cmd) +char * cmd; /* Command to execute */ +{ + int status; + + /* Close down */ + crtmove(term.t_nrow, 0); + ttflush(); + crtkclose(); + ttclose(); + + /* Do command */ + status = system(cmd) == 0; + + /* Restart system */ + sgarbf = TRUE; + crtkopen(); + if (ttopen()) { + puts("** Error reopening terminal device **"); + exit(1); + } + + /* Success */ + return(status); +} + +/** Create subshell **/ +int spawncli(f, n) +int f; /* Flags */ +int n; /* Argument count */ +{ + char * sh; + + /* Don't allow this command if restricted */ + if (restflag) + return(resterr()); + + /* Get shell path */ + sh = getenv("SHELL"); + if (!sh) + sh = "SHELL"; + + /* Do shell */ + return(callout(sh)); +} + +/** Spawn a command **/ +int spawn(f, n) +int f; /* Flags */ +int n; /* Argument count */ +{ + char line[NLINE]; + int s; + + /* Don't allow this command if restricted */ + if (restflag) + return(resterr()); + + /* Get command line */ + s = (mlreply("!", line, NLINE) == TRUE); + if (!s) + return(s); + + /* Perform the command */ + s = callout(line); + + /* if we are interactive, pause here */ + if (clexec == FALSE) { + mlwrite("[End]"); + ttflush(); + ttgetc(); + } + return(s); +} + +/** Execute program **/ +int execprg(f, n) +int f; /* Flags */ +int n; /* Argument count */ +{ + /* Same as spawn */ + return(spawn(f, n)); +} + +/** Pipe output of program to buffer **/ +int pipecmd(f, n) +int f; /* Flags */ +int n; /* Argument count */ +{ + char line[NLINE]; + int s; + BUFFER * bp; + EWINDOW * wp; + static char bname[] = "command"; + char filnam[NSTRING]; + + /* Don't allow this command if restricted */ + if (restflag) + return(resterr()); + + /* Get pipe-in command */ + s = (mlreply("@", line, NLINE) == TRUE); + if (!s) + return(s); + + tmpnam(filnam); + + /* Get rid of the command output buffer if it exists */ + if ((bp=bfind(bname, FALSE, 0)) != FALSE) { + /* Try to make sure we are off screen */ + wp = wheadp; + while (wp) { + if (wp->w_bufp == bp) { + onlywind(FALSE, 1); + break; + } + wp = wp->w_wndp; + } + if (!zotbuf(bp)) + return(0); + } + + /* Add output specification */ + strcat(line, ">"); + strcat(line, filnam); + + /* Do command */ + s = callout(line); + if (!s) + return(s); + + /* Split the current window to make room for the command output */ + if (!splitwind(FALSE, 1)) + return(0); + + /* ...and read the stuff in */ + if (!getfile(filnam, FALSE)) + return(0); + + /* Make this window in VIEW mode, update all mode lines */ + curwp->w_bufp->b_mode |= MDVIEW; + wp = wheadp; + while (wp) { + wp->w_flag |= WFMODE; + wp = wp->w_wndp; + } + + /* ...and get rid of the temporary file */ + unlink(filnam); + return(1); +} + +/** Filter buffer through command **/ +#undef filter +int mefilter(f, n) +int f; /* Flags */ +int n; /* Argument count */ +{ + char line[NLINE], tmpname[NFILEN]; + int s; + BUFFER * bp; + static char bname1[] = "fltinp"; + char filnam1[NSTRING]; + char filnam2[NSTRING]; + + tmpnam(filnam1); + tmpnam(filnam2); + + /* Don't allow this command if restricted */ + if (restflag) + return(resterr()); + + /* Don't allow filtering of VIEW mode buffer */ + if (curbp->b_mode & MDVIEW) + return(rdonly()); + + /* Get the filter name and its args */ + s = (mlreply("#", line, NLINE) == TRUE); + if (!s) + return(s); + + /* Setup the proper file names */ + bp = curbp; + strcpy(tmpname, bp->b_fname); /* Save the original name */ + strcpy(bp->b_fname, bname1); /* Set it to our new one */ + + /* Write it out, checking for errors */ + if (!writeout(filnam1, "w")) { + mlwrite("[Cannot write filter file]"); + strcpy(bp->b_fname, tmpname); + return(0); + } + + /* Setup input and output */ + strcat(line," <"); + strcat(line,filnam1); + strcat(line," >"); + strcat(line,filnam2); + + /* Perform command */ + s = callout(line); + + /* If successful, read in file */ + if (s) { + s = readin(filnam2, FALSE); + if (s) + /* Mark buffer as changed */ + bp->b_flag |= BFCHG; + } + + + /* Reset file name */ + strcpy(bp->b_fname, tmpname); + + /* and get rid of the temporary file */ + unlink(filnam1); + unlink(filnam2); + + /* Show status */ + if (!s) + mlwrite("[Execution failed]"); + return(s); +} + +/** Get first filename from pattern **/ +char *getffile(fspec) +char *fspec; /* Filename specification */ +{ + char* p, *q; + char path[NFILEN]; + + /* First parse the file path off the file spec */ + strcpy(path, fspec); + p = strrchr(path, '/'); + + if (p == NULL) { + p = path; + dirpath[0] = '\0'; + } else { + char c = p[1]; + p[1] = '\0'; + strcpy(dirpath, path); + p[1] = c; + } + + /* Check for an extension */ + p = strchr(p, '.'); + + if (p == NULL) + strcat(path, "*.*"); + else { + strcat(path, "*"); + } + + dirclose(); + + if (diropen(path)) + return NULL; + + return(getnfile()); +} + +/** Get next filename from pattern **/ +char *getnfile() +{ + int index; + char* dp; + char* p; + struct stat fstat; + char rbuf[NFILEN]; + char pbuf[NFILEN]; + char disk[3]; + + /* ...and call for the next file */ + do { + dp = dirread(); + if (!dp) + return(NULL); + + } while (stat(dp, &fstat) || + ((fstat.st_mode & S_IFMT) & (S_IFREG | S_IFDIR | S_IFLIB)) == 0); + + /* Return the next file name! */ + strcpy(rbuf, dp); + p = strrchr(dp, '/'); + if (p) { + strcpy(rbuf, dirpath); + strcat(rbuf, p + 1); + } + + /* save disk name */ + p = strchr(rbuf, ':'); + strcpy(disk, p); + + /* if this entry is a directory name, say so */ + if ((fstat.st_mode & S_IFMT) == S_IFDIR) + strcat(strcpy(p, DIRSEPSTR), disk); + /* if this entry is a library name, say so */ + else if ((fstat.st_mode & S_IFMT) == S_IFLIB) + strcat(strcpy(p, "."), disk); + + strlwr(rbuf); + return(rbuf); +} + +/* Retourne un pointeur sur le nom du disque */ + +char *drive(char *s) +{ + if ((s = strchr(s, ':')) != NULL) { /* seek to fd */ + if (s[1] && s[1] != '*') + s[2] = '\0'; + else { /* if fd == *, set fd to search */ +// s[0] = '\0'; +// s = NULL; + s[2] = *getenv("SEARCH"); + } + } + return s; +} + +/* Ajoute le nom de la bibliotheque courante si le nom de fichier ne + comporte pas de point. +*/ + +int addlname(fname) +char *fname; +{ + char buf[256]; + struct fdb *fdb; + short lub; + char lname[40]; + register char *dl, *df; + char *getlib(), *strchr(); + + df = drive(fname); + + /* si fn est un membre et qu'il existe une biblioth�que par d�faut, + qu'il n'y a pas contradiction entre les noms de disque du fichier + et de la biblioth�que, concat�ner le nom de la biblioth�que, celui + du fichier et �ventuellement celui du disque */ + if (! strchr(fname, '.')) { + strcpy(lname, getlib()); + if (*lname) { + if (!(dl = drive(lname)) || df == NULL || dl[1]==df[1]) { + if (df == NULL && dl != NULL) + strcat(fname, dl); + if (dl != NULL) + *dl = '\0'; + strcat(lname, "."); + strcat(lname, fname); + strcpy(fname, lname); + } + } else if (df = strchr(fname, ':')) { + strcpy(lname, df); + strcpy(df, "."); + strcat(fname, lname); + } else + strcat(fname, "."); + } + + if (! strchr(fname, ':')) + strcat(fname, ":*"); + df = strchr(fname, ':') + 1; + strlwr(fname); + if (fdb = _locate(fname, buf, &lub)) { + *df = lub + 'a'; + if (! (fdb->filestat & _FDB_STAT_STREAM)) { + mlwrite(TEXT297, fname); + return (FALSE); + } + } else { + strcpy(lname, fname); + if ((dl = strchr(lname, '.')) && (dl = strchr(dl+1,'.'))) { + strcpy(dl, df - 1); + fdb = _locate(lname, buf, &lub); + *df = lub + 'a'; + if (! fdb || fdb->filestat != _FDB_STAT_LIBRARY) { + mlwrite(TEXT299, lname); + return (FALSE); + } + } else if (*df == '*') { + char cwd[256]; + getcwd(cwd, 256); + dl = strchr(cwd, ':'); + *df = dl ? tolower(dl[1]) : 's'; + } + } + return (TRUE); +} + +#if BACKUP && THEOS40 + +/* + * Retourne l'octet d'etat d'un fichier ou 0 s'il n'existe pas + */ + +int filestat(s) +char *s; +{ + struct fdb *fdb; + char buf[256]; + short lub; + + if (fdb = (struct fdb *) _locate(s,buf,&lub)) + return (fdb->filestat); + else + return 0; +} + +/* Renomme le fichier en backup */ + +int renback(fn, lname) +char *fn, *lname; +{ + register int fs; + + if (fs = filestat(fn)) { + if (fs & _FDB_STAT_STREAM) + rename(fn, lname); + else { + mlwrite(TEXT297, fn); + return (FALSE); + } + } + return(TRUE); +} + +int unlback(lname, bname, dname) +char *lname,*bname,*dname; +{ + register char *p; + + if (filestat(lname) & _FDB_STAT_LIBRARY) { + if ((p = strchr(lname, ':')) == NULL) + p = strend(lname); + *p = '.'; + strcpy(p+1, bname); + unlink(strcat(lname, dname)); + return(TRUE); + } + return(FALSE); +} + +void backname(ft, fn) +char *ft; +char *fn; +{ + char lname[NFILEN]; /* nom complet fn.ft.mn:d */ + char dname[9]; /* :d */ + register char *p; + register char *bname; /* pointeur sur fn ou mn */ + register int fs; /* organisation du fichier */ + extern char *cuserid(); + + /* extract disk name and remove it */ + if (p = strchr(strcpy(ft, fn), ':')) { + strcpy(dname, p); + *p = '\0'; + } else + *dname = '\0'; + + /* look for first dot in name */ + p = strchr(ft, '.'); + /* look for last one */ + bname = strrchr(ft, '.'); + + if (p == NULL) { + /* no dot, add BACKUP and disk name */ + strcat(strcat(ft, ".BACKUP"), dname); + } else if (p == bname) { + /* if only one dot, cut extension, add BACKUP and disk name */ + strcat(strcpy(p + 1, "BACKUP"), dname); + } else { + strcpy(lname, ft); + strcat(strcat(strchr(lname, '.'), ".BACKLIB"), dname); + if (filestat(lname) & _FDB_STAT_LIBRARY) { + .... + } + } else + bname = ft; + + cuserid(lname); + strcat(strcat(lname,".BACKLIB"),dname); + + if (unlback(lname,bname,dname) == FALSE) { + strcat(strcat(strcpy(lname,bname),".BACKUP"),dname); + if (filestat(lname) & _FDB_STAT_LIBRARY) + return(FALSE); + unlink(lname); + } +} + +int fileback(fn) +char *fn; +{ + char lname[NFILEN]; /* nom complet fn.ft.mn:d */ + char fback[NFILEN]; /* copie de travail */ + char dname[9]; /* :d */ + register char *p; + register char *bname; /* pointeur sur fn ou mn */ + register int fs; /* organisation du fichier */ + extern char *cuserid(); + + if ((curbp->b_mode & MDNOBAK) == 0) { + if (p = strchr(strcpy(fback,fn),':')) { + strcpy(dname,p); + *p = '\0'; + } else + dname[0] = '\0'; + + p = strchr(fback,'.'); + + if (p != NULL && p == (bname = strrchr(fback,'.'))) { + bname = fback; + *p++ = '\0'; + } else if (bname != (char *) 0) { + strcpy(lname,fback); + strcat(strcat(strchr(lname,'.'),".BACKLIB"),dname); + bname++; + if (unlback(lname,bname,dname) != FALSE) + return renback(fn,lname); + } else + bname = fback; + + cuserid(lname); + strcat(strcat(lname,".BACKLIB"),dname); + + if (unlback(lname,bname,dname) == FALSE) { + strcat(strcat(strcpy(lname,bname),".BACKUP"),dname); + if (filestat(lname) & _FDB_STAT_LIBRARY) + return(FALSE); + unlink(lname); + } + + return renback(fn,lname); + } + return (TRUE); +} +#endif /* BACKUP */ +#endif diff --git a/src/tipc.c b/src/tipc.c index b585f7f..cd14385 100644 --- a/src/tipc.c +++ b/src/tipc.c @@ -190,25 +190,25 @@ #define WHITE 7+CHAR_ENABLE /* TI attribute for White */ -PASCAL NEAR ttopen(); /* Forward references. */ -PASCAL NEAR ttgetc(); -PASCAL NEAR ttputc(); -PASCAL NEAR ttflush(); -PASCAL NEAR ttclose(); -PASCAL NEAR timove(); -PASCAL NEAR tieeol(); -PASCAL NEAR tieeop(); -PASCAL NEAR tibeep(); -PASCAL NEAR tiopen(); -PASCAL NEAR tikopen(); -PASCAL NEAR tirev(); -PASCAL NEAR ticres(); -PASCAL NEAR ticlose(); -PASCAL NEAR tikclose(); -PASCAL NEAR tiputc(); -PASCAL NEAR tifcol(); -PASCAL NEAR tibcol(); -PASCAL NEAR scinit(); +ttopen(); /* Forward references. */ +ttgetc(); +ttputc(); +ttflush(); +ttclose(); +timove(); +tieeol(); +tieeop(); +tibeep(); +tiopen(); +tikopen(); +tirev(); +ticres(); +ticlose(); +tikclose(); +tiputc(); +tifcol(); +tibcol(); +scinit(); int revflag = FALSE; /* are we currently in rev video? */ int cfcolor = -1; /* current forground color */ @@ -277,7 +277,7 @@ TERM term = { extern union REGS rg; -PASCAL NEAR tifcol(color) /* set the current output color */ +tifcol(color) /* set the current output color */ int color; /* color to set */ { @@ -285,7 +285,7 @@ int color; /* color to set */ } -PASCAL NEAR tibcol(color) /* set the current background color */ +tibcol(color) /* set the current background color */ /* color to set */ int color; { @@ -293,7 +293,7 @@ int color; } -PASCAL NEAR timove(row, col) +timove(row, col) int row; int col; @@ -305,7 +305,7 @@ int col; } -PASCAL NEAR tieeol() /* erase to the end of the line */ +tieeol() /* erase to the end of the line */ { int i; /* loop variable */ @@ -329,7 +329,7 @@ PASCAL NEAR tieeol() /* erase to the end of the line */ } -PASCAL NEAR tiputc(ch) /* put a character at the current position */ +tiputc(ch) /* put a character at the current position */ /* in the current colors */ int ch; { @@ -340,7 +340,7 @@ int ch; } -PASCAL NEAR tieeop() /* Actually a clear screen */ +tieeop() /* Actually a clear screen */ { rg.h.ah = 0x13; /* Clear Text Screen, Home Cursor and */ @@ -348,7 +348,7 @@ PASCAL NEAR tieeop() /* Actually a clear screen */ } -PASCAL NEAR tirev(state) /* change reverse video state */ +tirev(state) /* change reverse video state */ int state; /* TRUE = reverse, FALSE = normal */ { @@ -356,7 +356,7 @@ int state; /* TRUE = reverse, FALSE = normal */ } -PASCAL NEAR ticres() /* Change screen resolution. Should we add the */ +ticres() /* Change screen resolution. Should we add the */ /* the 720x350 mode besides the normal 720x300 */ /* mode for those who can handle it? It really */ /* gains us nothing since we don't gain lines */ @@ -367,14 +367,14 @@ PASCAL NEAR ticres() /* Change screen resolution. Should we add the */ } -PASCAL NEAR tibeep() +tibeep() { bdos(6, BEL, 0); } -PASCAL NEAR tiopen() +tiopen() { strcpy(sres, "NORMAL"); @@ -385,14 +385,14 @@ PASCAL NEAR tiopen() } -PASCAL NEAR tikopen() +tikopen() { /* Does nothing */ } -PASCAL NEAR ticlose() +ticlose() { _fmemset(attradd, WHITE, 1); /* write normal attrbute to latch */ @@ -404,7 +404,7 @@ PASCAL NEAR ticlose() } -PASCAL NEAR tikclose() +tikclose() { _fmemset(attradd, WHITE, 1); /* write normal attrbute to latch */ @@ -416,7 +416,7 @@ PASCAL NEAR tikclose() } -PASCAL NEAR scinit() /* initialize the screen head pointers to */ +scinit() /* initialize the screen head pointers to */ /* logical screen */ { union { @@ -435,7 +435,7 @@ PASCAL NEAR scinit() /* initialize the screen head pointers to */ } -PASCAL NEAR scwrite(int row, char *outstr, int forg, int bacg, int revleft, int +scwrite(int row, char *outstr, int forg, int bacg, int revleft, int /* write a line out */ { char *lnptr; /* Pointer to the destination line */ @@ -465,7 +465,7 @@ PASCAL NEAR scwrite(int row, char *outstr, int forg, int bacg, int revleft, int } -PASCAL NEAR spal(palette) /* change palette string */ +spal(palette) /* change palette string */ char *palette; { @@ -524,7 +524,7 @@ char *palette; #if FLABEL -PASCAL NEAR fnclabel(f, n) /* label a function key */ +fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument [unused] */ diff --git a/src/tos.c b/src/tos.c index 7c9f980..696189a 100644 --- a/src/tos.c +++ b/src/tos.c @@ -286,7 +286,7 @@ pipecmd(f, n) * filter a buffer through an external DOS program * Bound to ^X # */ -filter(f, n) +uefilter(f, n) { register int s; /* return status from CLI */ @@ -360,9 +360,9 @@ char *newname; /* new file name */ Frename(0, oldname, newname); } -/* return a system dependant string with the current time */ +/* return a system dependent string with the current time */ -char *PASCAL NEAR timeset() +char *timeset() { register char *sp; /* temp string pointer */ @@ -382,14 +382,14 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *PASCAL NEAR getffile(fspec) +char *getffile(fspec) char *fspec; /* file to match */ { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ char fname[NFILEN]; /* file/path for DOS call */ /* first parse the file path off the file spec */ @@ -432,7 +432,7 @@ char *fspec; /* file to match */ return(rbuf); } -char *PASCAL NEAR getnfile() +char *getnfile() { diff --git a/src/undo.c b/src/undo.c index de5c99a..c18ae49 100644 --- a/src/undo.c +++ b/src/undo.c @@ -146,7 +146,7 @@ int undo_op() /* fall into the next case! */ case OP_DELC: - if (up->undo_obj.obj_char == '\r') { + if (up->undo_obj.obj_char == RET_CHAR) { count = up->count; while (count--) status = lnewline(); @@ -202,7 +202,7 @@ BUFFER *bp; /* Undo last done command */ -int PASCAL NEAR undo(f, n) +int undo(f, n) int f,n; /* prefix flag and argument */ @@ -239,7 +239,7 @@ int f,n; /* prefix flag and argument */ /* delete current buffer's undo stack */ -int PASCAL NEAR undo_delete(f, n) +int undo_delete(f, n) int f,n; /* prefix flag and argument */ @@ -251,7 +251,7 @@ int f,n; /* prefix flag and argument */ /* pop up a list of the current buffer's undo stack */ -int PASCAL NEAR undo_list(f, n) +int undo_list(f, n) int f,n; /* prefix flag and argument */ @@ -263,7 +263,7 @@ int f,n; /* prefix flag and argument */ return(wpopup(ulistp)); } -PASCAL NEAR undolist() +int undolist() { register char *cp1; /* scanning pointer into line to build */ @@ -448,6 +448,8 @@ nextbuf: bp = getoldb(); lp->next = (UNDO_OBJ *)NULL; bp->undo_count--; } + + return((char *)NULL); } /* RE-ROOM: Allocate memory using realloc() @@ -511,5 +513,7 @@ nxtbuf: bp = getoldb(); lp->next = (UNDO_OBJ *)NULL; bp->undo_count--; } + + return((char *)NULL); } diff --git a/src/vms.c b/src/vms.c index 54a551c..b72aad1 100644 --- a/src/vms.c +++ b/src/vms.c @@ -364,7 +364,7 @@ static mbreadast() LIB$SIGNAL( mbiosb.status); } -PASCAL NEAR ttopen() +ttopen() { TTCHAR newchar; /* Adjusted characteristics */ int status; @@ -477,7 +477,7 @@ PASCAL NEAR ttopen() if (waitstr) short_time[ 0] = -asc_int( waitstr); } -PASCAL NEAR ttclose() +ttclose() { if (tolen > 0) { /* Buffer not empty, flush out last stuff */ @@ -493,7 +493,7 @@ PASCAL NEAR ttclose() test( SYS$DASSGN( vms_iochan)); } -PASCAL NEAR ttputc(int c) +ttputc(int c) { tobuf[ tolen++] = c; if (tolen >= sizeof( tobuf)) @@ -504,7 +504,7 @@ PASCAL NEAR ttputc(int c) } } -PASCAL NEAR ttflush() +ttflush() { /* I choose to ignore any flush requests if there is typeahead @@ -529,7 +529,7 @@ PASCAL NEAR ttflush() Note that we also wake from hibernation if a character arrives, so this never causes an undue delay if the user it actually typing. */ -int PASCAL NEAR grabnowait() +int grabnowait() { if (tylen == 0) { /* Nothing immediately available, hibernate for a short time */ @@ -540,12 +540,12 @@ int PASCAL NEAR grabnowait() return ((tylen == 0)? -1: ttgetc()); } -int PASCAL NEAR grabwait() +int grabwait() { return (ttgetc()); } -int PASCAL NEAR ttgetc() +int ttgetc() { register unsigned ret; @@ -581,7 +581,7 @@ int PASCAL NEAR ttgetc() /* * Typahead - any characters pending? */ -int PASCAL NEAR typahead() +int typahead() { return( tylen != 0); } @@ -589,7 +589,7 @@ int PASCAL NEAR typahead() /* * Shell out to DCL. */ -int PASCAL NEAR spawncli(int f, int n) +int spawncli(int f, int n) { register char *cp; @@ -608,7 +608,7 @@ int PASCAL NEAR spawncli(int f, int n) /* * Spawn a command. */ -int PASCAL NEAR spawn(int f, int n) +int spawn(int f, int n) { register int s; char line[NLINE]; @@ -641,7 +641,7 @@ int PASCAL NEAR spawn(int f, int n) * character to be typed, then mark the screen as garbage so a full repaint is * done. Bound to "C-X $". */ -int PASCAL NEAR execprg(int f, int n) +int execprg(int f, int n) { register int s; char line[NLINE]; @@ -666,7 +666,7 @@ int PASCAL NEAR execprg(int f, int n) return(TRUE); } -int PASCAL NEAR pipecmd() +int pipecmd() { register int s; /* return status from CLI */ register EWINDOW *wp; /* pointer to new window */ @@ -733,7 +733,7 @@ int PASCAL NEAR pipecmd() return(TRUE); } -int PASCAL NEAR filter(int f, int n) +int uefilter(int f, int n) { register int s; /* return status from CLI */ register BUFFER *bp; /* pointer to buffer to zot */ @@ -805,7 +805,7 @@ int PASCAL NEAR filter(int f, int n) duplicated here. */ -char *PASCAL NEAR timeset() +char *timeset() { register char *sp; /* temp string pointer */ char buf[16]; /* time data buffer */ @@ -829,12 +829,12 @@ static struct dsc$descriptor rbuf_desc; /* descriptor for returned file name */ * Do a wild card directory search (for file name completion) * fspec is the pattern to match. */ -char *PASCAL NEAR getffile(char *fspec) +char *getffile(char *fspec) { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ register int verflag; /* does the file have a version? */ register char *cp, c; @@ -909,11 +909,11 @@ char *PASCAL NEAR getffile(char *fspec) return(path); } -char *PASCAL NEAR getnfile() +char *getnfile() { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ char fname[NFILEN]; /* file/path for DOS call */ register char *cp; @@ -999,7 +999,7 @@ ME$EDIT(struct dsc$descriptor *infile, struct dsc$descriptor *outfile) return( status); } -PASCAL NEAR bktoshell(int f, int n) +bktoshell(int f, int n) { /* Pause this process and wait for it to be woken up @@ -1094,7 +1094,7 @@ static struct RAB rab; /* a record access block */ /* * Open a file for reading. */ -PASCAL NEAR ffropen(char *fn) +ffropen(char *fn) { unsigned long status; @@ -1140,11 +1140,11 @@ PASCAL NEAR ffropen(char *fn) } /* - * PASCAL NEAR ffwopen(char *fn, char *mode) + * ffwopen(char *fn, char *mode) * * fn = file name, mode = mode to open file. */ -PASCAL NEAR ffwopen(char *fn, char *mode) +ffwopen(char *fn, char *mode) { unsigned long status; @@ -1195,7 +1195,7 @@ PASCAL NEAR ffwopen(char *fn, char *mode) /* * Close a file. Should look at the status in all systems. */ -PASCAL NEAR ffclose() +ffclose() { unsigned long status; @@ -1222,7 +1222,7 @@ PASCAL NEAR ffclose() * and the "nbuf" is its length, less the free newline. Return the status. * Check only at the newline. */ -PASCAL NEAR ffputline(char buf[], int nbuf) +ffputline(char buf[], int nbuf) { register char *obuf=buf; @@ -1274,7 +1274,7 @@ PASCAL NEAR ffputline(char buf[], int nbuf) * at the end of the file that don't have a newline present. Check for I/O * errors too. Return status. */ -PASCAL NEAR ffgetline(nbytes) +ffgetline(nbytes) int *nbytes; /* save our caller hassle, calc the line length */ @@ -1314,7 +1314,7 @@ int *nbytes; /* save our caller hassle, calc the line length */ * FUNCTION - addspec - utility function for expandargs ***********************************************************/ #define ADDSPEC_INCREMENT 10 -static void PASCAL NEAR addspec(struct dsc$descriptor dsc, int *pargc, +static void addspec(struct dsc$descriptor dsc, int *pargc, char ***pargv, int *pargcapacity) { char *s; @@ -1335,7 +1335,7 @@ static void PASCAL NEAR addspec(struct dsc$descriptor dsc, int *pargc, * FUNCTION - expandargs - massage argc and argv to expand * wildcards by calling VMS. ***********************************************************/ -void PASCAL NEAR expandargs(int *pargc, char ***pargv) +void expandargs(int *pargc, char ***pargv) { int argc = *pargc; char **argv = *pargv; @@ -1384,7 +1384,7 @@ void PASCAL NEAR expandargs(int *pargc, char ***pargv) } #else -PASCAL NEAR vms_hello() +vms_hello() { } #endif diff --git a/src/wmcs.c b/src/wmcs.c index f7f1883..0542dfc 100644 --- a/src/wmcs.c +++ b/src/wmcs.c @@ -287,7 +287,7 @@ pipecmd(f, n) * filter a buffer through an external DOS program * Bound to ^X # */ -filter(f, n) +uefilter(f, n) { register int s; /* return status from CLI */ @@ -353,9 +353,9 @@ filter(f, n) return(TRUE); } -/* return a system dependant string with the current time */ +/* return a system dependent string with the current time */ -char *PASCAL NEAR timeset() +char *timeset() { register char *sp; /* temp string pointer */ diff --git a/src/xp.c b/src/xp.c index 0466329..2f9eb6d 100644 --- a/src/xp.c +++ b/src/xp.c @@ -34,7 +34,7 @@ * repaint. Bound to "^X C". The message at the start in VMS puts out a newline. * Under some (unknown) condition, you don't get one free when DCL starts up. */ -PASCAL NEAR spawncli(f, n) +spawncli(f, n) { /* don't allow this command if restricted */ if (restflag) @@ -55,7 +55,7 @@ PASCAL NEAR spawncli(f, n) * character to be typed, then mark the screen as garbage so a full repaint is * done. Bound to "C-X !". */ -PASCAL NEAR spawn(f, n) +spawn(f, n) { register int s; char line[NLINE]; @@ -87,7 +87,7 @@ PASCAL NEAR spawn(f, n) * done. Bound to "C-X $". */ -PASCAL NEAR execprg(f, n) +execprg(f, n) { register int s; char line[NLINE]; @@ -118,7 +118,7 @@ PASCAL NEAR execprg(f, n) * We use a unique temporary file name so that multiple instances of * MicroEMACS don't try to use the same file. */ -PASCAL NEAR pipecmd(f, n) +pipecmd(f, n) { register EWINDOW *wp; /* pointer to new window */ register BUFFER *bp; /* pointer to buffer to zot */ @@ -207,7 +207,7 @@ PASCAL NEAR pipecmd(f, n) * We use unique temporary file names so that multiple instances of * MicroEMACS don't try to use the same file. */ -PASCAL NEAR filter(f, n) +uefilter(f, n) { register int s; /* return status from CLI */ @@ -341,7 +341,7 @@ execprog( char *cmd) args[i] = args[i + 1] = 0; /* terminate with 2 nulls */ - /* look up the program on the path, trying various extentions */ + /* look up the program on the path, trying various extensions */ if ((sp = flook(prog, TRUE)) == NULL) if ((sp = flook(strcat(prog, ".exe"), TRUE)) == NULL) { return(FALSE); @@ -367,14 +367,14 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *PASCAL NEAR getffile(fspec) +char *getffile(fspec) char *fspec; /* pattern to match */ { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ char fname[NFILEN]; /* file/path for DOS call */ /* first parse the file path off the file spec */ @@ -417,7 +417,7 @@ char *fspec; /* pattern to match */ return(rbuf); } -char *PASCAL NEAR getnfile() +char *getnfile() { /* and call for the next file */ @@ -433,9 +433,9 @@ char *PASCAL NEAR getnfile() return(rbuf); } -/* return a system dependant string with the current time */ +/* return a system dependent string with the current time */ -char *PASCAL NEAR timeset() +char *timeset() { register char *sp; /* temp string pointer */ diff --git a/src/xvt.c b/src/xvt.c index 08858b1..cf90923 100644 --- a/src/xvt.c +++ b/src/xvt.c @@ -32,7 +32,7 @@ #include #include "uemacs.h" -int PASCAL NEAR fnclabel(int f, int n); +int fnclabel(int f, int n); #define NROW 25 /* Screen size. */ #define NCOL 80 /* Edit if you want to. */ @@ -43,21 +43,21 @@ int PASCAL NEAR fnclabel(int f, int n); #define ESC 0x1B /* ESC character. */ /* Forward references. */ -extern int PASCAL NEAR xvtmove(); -extern int PASCAL NEAR xvteeol(); -extern int PASCAL NEAR xvteeop(); -extern int PASCAL NEAR xvtbeep(); -extern int PASCAL NEAR xvtopen(); -extern int PASCAL NEAR xvtrev(); -extern int PASCAL NEAR xvtclose(); -extern int PASCAL NEAR xvtkopen(); -extern int PASCAL NEAR xvtkclose(); -extern int PASCAL NEAR xvtcres(); -extern int PASCAL NEAR xvtgetc(); -extern int PASCAL NEAR xvtputc(); -extern int PASCAL NEAR xvtflush(); -extern int PASCAL NEAR xvtfcol(); -extern int PASCAL NEAR xvtbcol(); +extern int xvtmove(); +extern int xvteeol(); +extern int xvteeop(); +extern int xvtbeep(); +extern int xvtopen(); +extern int xvtrev(); +extern int xvtclose(); +extern int xvtkopen(); +extern int xvtkclose(); +extern int xvtcres(); +extern int xvtgetc(); +extern int xvtputc(); +extern int xvtflush(); +extern int xvtfcol(); +extern int xvtbcol(); static int rev_state = FALSE; static int cfcolor = -1; /* current foreground color */ @@ -71,8 +71,8 @@ static int oldrow; /* previous y position of mouse */ #define MAXOBUF 256 /* maximum number of output characters buffered */ -WINDOW xvt_win; /* current window being displayed by XVT */ -WINDOW init_win; /* the initial window we are to toss */ +EWINDOW xvt_win; /* current window being displayed by XVT */ +EWINDOW init_win; /* the initial window we are to toss */ int xvt_char_width; /* width of characters in pixels */ int xvt_char_height; /* height of characters in pixels */ int xvt_descent; /* height of descenders (character offset) */ @@ -187,7 +187,7 @@ dump_event(char *typ, EVENT *ep) } } -static long windowHandler(WINDOW win, EVENT *ep) +static long windowHandler(EWINDOW win, EVENT *ep) { register int etype; /* event type byte */ @@ -366,7 +366,7 @@ int xvt_code; } -static long taskHandler(WINDOW win, EVENT *ep) +static long taskHandler(EWINDOW win, EVENT *ep) { RCT rct; char aname[80]; /* application name */ @@ -450,7 +450,7 @@ char **argv; xvt_system(argc, argv, 0L, taskHandler, &config); } -PASCAL NEAR xvtfcol(color) /* set the current output color */ +xvtfcol(color) /* set the current output color */ int color; /* color to set */ @@ -462,7 +462,7 @@ int color; /* color to set */ cfcolor = color; } -PASCAL NEAR xvtbcol(color) /* set the current background color */ +xvtbcol(color) /* set the current background color */ int color; /* color to set */ @@ -474,14 +474,14 @@ int color; /* color to set */ cbcolor = color; } -PASCAL NEAR xvtmove(row, col) +xvtmove(row, col) { xvtflush(); xvt_row = row; xvt_col = col; } -PASCAL NEAR xvteeol() +xvteeol() { RCT rect; /* rectangle to use to clear to end of this line */ CBRUSH brush; /* brushed used for the clearing */ @@ -504,7 +504,7 @@ PASCAL NEAR xvteeol() win_draw_rect(xvt_win, &rect); } -PASCAL NEAR xvteeop() +xvteeop() { RCT rect; /* rectangle to use to clear to end of this line */ CBRUSH brush; /* brushed used for the clearing */ @@ -538,7 +538,7 @@ PASCAL NEAR xvteeop() win_draw_rect(xvt_win, &rect); } -PASCAL NEAR xvtrev(state) /* change reverse video state */ +xvtrev(state) /* change reverse video state */ int state; /* TRUE = reverse, FALSE = normal */ @@ -556,24 +556,24 @@ int state; /* TRUE = reverse, FALSE = normal */ } } -PASCAL NEAR xvtcres() /* change screen resolution */ +xvtcres() /* change screen resolution */ { return(TRUE); } -PASCAL NEAR spal(char *dummy) /* change pallette settings */ +spal(char *dummy) /* change pallette settings */ { /* none for now */ } -PASCAL NEAR xvtbeep() +xvtbeep() { xvt_beep(); } -PASCAL NEAR xvtopen() +xvtopen() { DRAW_CTOOLS dtool; @@ -614,7 +614,7 @@ PASCAL NEAR xvtopen() ttopen(); } -PASCAL NEAR xvtclose() +xvtclose() { xvtfcol(7); @@ -622,13 +622,13 @@ PASCAL NEAR xvtclose() ttclose(); } -PASCAL NEAR xvtkopen() /* open the keyboard (a noop here) */ +xvtkopen() /* open the keyboard (a noop here) */ { } -PASCAL NEAR xvtkclose() /* close the keyboard (a noop here) */ +xvtkclose() /* close the keyboard (a noop here) */ { xvtflush(); @@ -638,7 +638,7 @@ PASCAL NEAR xvtkclose() /* close the keyboard (a noop here) */ * Read a character from the terminal, performing no editing and doing no echo * at all. Also mouse events are forced into the input stream here. */ -int PASCAL NEAR xvtgetc() +int xvtgetc() { xvtflush(); @@ -663,7 +663,7 @@ int PASCAL NEAR xvtgetc() } } -int PASCAL NEAR xvtflush() +int xvtflush() { /* if there's nothing to flush */ @@ -679,7 +679,7 @@ int PASCAL NEAR xvtflush() xvt_next = xvt_obuf; } -int PASCAL NEAR xvtputc(c) +int xvtputc(c) char c; /* character to write to the current xvt window */ @@ -701,7 +701,7 @@ char c; /* character to write to the current xvt window */ } #if FLABEL -int PASCAL NEAR fnclabel(f, n) /* label a function key */ +int fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument [unused] */ diff --git a/src/xvtdos.c b/src/xvtdos.c index 8766486..81b41e7 100644 --- a/src/xvtdos.c +++ b/src/xvtdos.c @@ -54,7 +54,7 @@ static int oldbut; /* Previous state of mouse buttons */ static int oldcol; /* previous x position of mouse */ static int oldrow; /* previous y position of mouse */ -int PASCAL NEAR execprog(char *cmd); +int execprog(char *cmd); /* input buffers and pointers */ @@ -102,7 +102,7 @@ int in_get() /* get an event from the input buffer */ * This function is called once to set up the terminal device streams. */ -int PASCAL NEAR ttopen() +int ttopen() { @@ -125,7 +125,7 @@ int PASCAL NEAR ttopen() * interpreter. On VMS it puts the terminal back in a reasonable state. * Another no-operation on CPM. */ -int PASCAL NEAR ttclose() +int ttclose() { /* nothing here! */ } @@ -134,7 +134,7 @@ int PASCAL NEAR ttclose() * Flush terminal buffer. Does real work where the terminal output is buffered * up. A no-operation on systems where byte at a time terminal I/O is done. */ -int PASCAL NEAR ttflush() +int ttflush() { } @@ -142,7 +142,7 @@ int PASCAL NEAR ttflush() keyboard buffer */ -int PASCAL NEAR typahead() +int typahead() { return(in_check()); @@ -154,7 +154,7 @@ int PASCAL NEAR typahead() * repaint. Bound to "^X C". */ -int PASCAL NEAR spawncli(f, n) +int spawncli(f, n) int f, n; @@ -180,7 +180,7 @@ int f, n; * character to be typed, then mark the screen as garbage so a full repaint is * done. Bound to "C-X !". */ -int PASCAL NEAR spawn(f, n) +int spawn(f, n) int f, n; @@ -220,7 +220,7 @@ int f, n; * done. Bound to "C-X $". */ -int PASCAL NEAR execprg(f, n) +int execprg(f, n) { register int s; @@ -253,7 +253,7 @@ int PASCAL NEAR execprg(f, n) * Pipe a one line command into a window * Bound to ^X @ */ -int PASCAL NEAR pipecmd(f, n) +int pipecmd(f, n) int f, n; @@ -343,7 +343,7 @@ int f, n; * filter a buffer through an external DOS program * Bound to ^X # */ -int PASCAL NEAR filter(f, n) +int uefilter(f, n) int f, n; @@ -426,7 +426,7 @@ extern int _doserrno; /* SHELLPROG: Execute a command in a subshell */ -int PASCAL NEAR shellprog(cmd) +int shellprog(cmd) char *cmd; /* Incoming command line to execute */ @@ -475,7 +475,7 @@ char *cmd; /* Incoming command line to execute */ #define CFLAG 1 #endif -int PASCAL NEAR execprog(cmd) +int execprog(cmd) char *cmd; /* Incoming command line to execute */ @@ -510,7 +510,7 @@ char *cmd; /* Incoming command line to execute */ strcpy(&tail[1], cmd); strcat(&tail[1], "\r"); - /* look up the program on the path trying various extentions */ + /* look up the program on the path trying various extensions */ if ((sp = flook(prog, TRUE)) == NULL) if ((sp = flook(strcat(prog, ".exe"), TRUE)) == NULL) { strcpy(&prog[strlen(prog)-4], ".com"); @@ -584,9 +584,9 @@ char *cmd; /* Incoming command line to execute */ return((rval < 0) ? FALSE : TRUE); } -/* return a system dependant string with the current time */ +/* return a system dependent string with the current time */ -char *PASCAL NEAR timeset() +char *timeset() { #if MWC | TURBO | IC | MSC | ZTC @@ -616,14 +616,14 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *PASCAL NEAR getffile(fspec) +char *getffile(fspec) char *fspec; /* pattern to match */ { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ char fname[NFILEN]; /* file/path for DOS call */ /* first parse the file path off the file spec */ @@ -665,12 +665,12 @@ char *fspec; /* pattern to match */ return(rbuf); } -char *PASCAL NEAR getnfile() +char *getnfile() { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ char fname[NFILEN]; /* file/path for DOS call */ /* and call for the first file */ @@ -694,14 +694,14 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *PASCAL NEAR getffile(fspec) +char *getffile(fspec) char *fspec; /* pattern to match */ { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ char fname[NFILEN]; /* file/path for DOS call */ /* first parse the file path off the file spec */ @@ -743,12 +743,12 @@ char *fspec; /* pattern to match */ return(rbuf); } -char *PASCAL NEAR getnfile() +char *getnfile() { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extention? */ + register int extflag; /* does the file have an extension? */ char fname[NFILEN]; /* file/path for DOS call */ /* and call for the first file */ @@ -764,7 +764,7 @@ char *PASCAL NEAR getnfile() return(rbuf); } #else -char *PASCAL NEAR getffile(fspec) +char *getffile(fspec) char *fspec; /* file to match */ @@ -772,7 +772,7 @@ char *fspec; /* file to match */ return(NULL); } -char *PASCAL NEAR getnfile() +char *getnfile() { return(NULL); diff --git a/src/z309.c b/src/z309.c index c2c2a97..5da7f61 100644 --- a/src/z309.c +++ b/src/z309.c @@ -39,28 +39,28 @@ int *scptr[NROW]; /* pointer to screen lines */ int sline[NCOL]; /* screen line image */ extern union REGS rg; /* cpu register for use of DOS calls */ -extern PASCAL NEAR ttopen(); /* Forward references. */ -extern PASCAL NEAR ttgetc(); -extern PASCAL NEAR ttputc(); -extern PASCAL NEAR ttflush(); -extern PASCAL NEAR ttclose(); -extern PASCAL NEAR z309move(); -extern PASCAL NEAR z309eeol(); -extern PASCAL NEAR z309eeop(); -extern PASCAL NEAR z309beep(); -extern PASCAL NEAR z309open(); -extern PASCAL NEAR z309rev(); -extern PASCAL NEAR z309cres(); -extern PASCAL NEAR z309close(); -extern PASCAL NEAR z309putc(); -extern PASCAL NEAR z309kopen(); -extern PASCAL NEAR z309kclose(); -extern PASCAL NEAR scinit(); -extern PASCAL NEAR spal(); +extern ttopen(); /* Forward references. */ +extern ttgetc(); +extern ttputc(); +extern ttflush(); +extern ttclose(); +extern z309move(); +extern z309eeol(); +extern z309eeop(); +extern z309beep(); +extern z309open(); +extern z309rev(); +extern z309cres(); +extern z309close(); +extern z309putc(); +extern z309kopen(); +extern z309kclose(); +extern scinit(); +extern spal(); #if COLOR -extern PASCAL NEAR z309fcol(); -extern PASCAL NEAR z309bcol(); +extern z309fcol(); +extern z309bcol(); int cfcolor = -1; /* current forground color */ int cbcolor = -1; /* current background color */ @@ -103,7 +103,7 @@ TERM term = { extern union REGS rg; #if COLOR -PASCAL NEAR z309fcol(color) /* set the current output color */ +z309fcol(color) /* set the current output color */ int color; /* color to set */ @@ -111,7 +111,7 @@ int color; /* color to set */ cfcolor = ctrans[color]; } -PASCAL NEAR z309bcol(color) /* set the current background color */ +z309bcol(color) /* set the current background color */ int color; /* color to set */ @@ -119,7 +119,7 @@ int color; /* color to set */ cbcolor = ctrans[color]; } #endif -PASCAL NEAR z309move(row, col) +z309move(row, col) { rg.h.ah = 2; /* set cursor position function code */ rg.h.dl = col; @@ -128,7 +128,7 @@ PASCAL NEAR z309move(row, col) int86(0x10, &rg, &rg); } -PASCAL NEAR z309eeol() /* erase to the end of the line */ +z309eeol() /* erase to the end of the line */ { int attr; /* attribute byte mask to place in RAM */ @@ -174,7 +174,7 @@ PASCAL NEAR z309eeol() /* erase to the end of the line */ } -PASCAL NEAR z309putc(ch) /* put a character at the current position in the +z309putc(ch) /* put a character at the current position in the current colors */ int ch; @@ -193,7 +193,7 @@ int ch; int86(0x10, &rg, &rg); } -PASCAL NEAR z309eeop() +z309eeop() { int attr; /* attribute to fill screen with */ @@ -213,7 +213,7 @@ PASCAL NEAR z309eeop() int86(0x10, &rg, &rg); } -PASCAL NEAR z309rev(state) /* change reverse video state */ +z309rev(state) /* change reverse video state */ int state; /* TRUE = reverse, FALSE = normal */ @@ -221,7 +221,7 @@ int state; /* TRUE = reverse, FALSE = normal */ /* This never gets used under the z309-PC driver */ } -PASCAL NEAR z309cres(res) /* change screen resolution */ +z309cres(res) /* change screen resolution */ char *res; /* resolution to change to */ @@ -236,7 +236,7 @@ char *res; /* resolution to change to */ return(FALSE); } -PASCAL NEAR z309beep() +z309beep() { #if MWC putcnb(BEL); @@ -245,14 +245,14 @@ PASCAL NEAR z309beep() #endif } -PASCAL NEAR z309open() +z309open() { scinit(CDSENSE); revexist = TRUE; ttopen(); } -PASCAL NEAR z309close() +z309close() { rg.h.ah = 101; @@ -265,23 +265,23 @@ PASCAL NEAR z309close() ttclose(); } -PASCAL NEAR spal() /* reset the pallette registers */ +spal() /* reset the pallette registers */ { /* nothin here now..... */ } -PASCAL NEAR z309kopen() /* open the keyboard */ +z309kopen() /* open the keyboard */ { } -PASCAL NEAR z309kclose() /* close the keyboard */ +z309kclose() /* close the keyboard */ { } -PASCAL NEAR scinit(type) /* initialize the screen head pointers */ +scinit(type) /* initialize the screen head pointers */ int type; /* type of adapter to init for */ @@ -316,7 +316,7 @@ int type; /* type of adapter to init for */ } } -PASCAL NEAR scwrite(row, outstr, forg, bacg) /* write a line out*/ +scwrite(row, outstr, forg, bacg) /* write a line out*/ int row; /* row of screen to place outstr on */ char *outstr; /* string to write out (must be term.t_ncol long) */ @@ -358,7 +358,7 @@ int bacg; /* background color */ } #if FLABEL -PASCAL NEAR fnclabel(f, n) /* label a function key */ +fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument [unused] */ @@ -368,7 +368,7 @@ int f,n; /* default flag, numeric argument [unused] */ } #endif #else -PASCAL NEAR z309hello() +z309hello() { } #endif From 05b1da0ecaefcaa1bb1fa3fa5dbeb09cc365cf0b Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 3 Sep 2020 18:57:15 +0200 Subject: [PATCH 12/37] Updated to 5.10 version --- src/history.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/history.c b/src/history.c index f4d50f2..eb025b7 100644 --- a/src/history.c +++ b/src/history.c @@ -2575,6 +2575,16 @@ * - added mouse-resize2-window as a new simpler mouse resize command for XP to use * - caused XP code (in XPCONIO.C) to create new mouse input sequence * [0 MOUS #col #row 2] as MS2 and bound it to mouse-resize2-window + * Sep 2020 Jean-Michel Dubois + * - Added Unicode support with UTF-8 files + * - Added Theos O.S. support (in 1988-1992) + * - Added Cygwin support + * - Added file backup (likely borrowed somewhere) + * - Added help on language keywords (currently for Theos C only) (borrowed to Mark Williams) + * - Added semi-graphics character entry through numeric keypad + * - Added dynamic load of messages from a file + * - Removed all PASCAL NEAR + * - Some code cleanup */ void history() From 8a45279743eb385c849cca4badc63fbf4b88bec1 Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 3 Sep 2020 19:01:07 +0200 Subject: [PATCH 13/37] Add files via upload --- src/history.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/history.c b/src/history.c index eb025b7..10817df 100644 --- a/src/history.c +++ b/src/history.c @@ -2579,10 +2579,11 @@ * - Added Unicode support with UTF-8 files * - Added Theos O.S. support (in 1988-1992) * - Added Cygwin support - * - Added file backup (likely borrowed somewhere) + * - Added ncurses display with drop down menus + * - Added file backup (likely borrowed to Mark Williams) * - Added help on language keywords (currently for Theos C only) (borrowed to Mark Williams) * - Added semi-graphics character entry through numeric keypad - * - Added dynamic load of messages from a file + * - Added dynamic load of messages from a file (in 1988-1992) * - Removed all PASCAL NEAR * - Some code cleanup */ From c85aef2bdd35e38ff0a038b55c8ce06f6b499eb0 Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 3 Sep 2020 19:03:29 +0200 Subject: [PATCH 14/37] Update to version 5.10 --- src/history.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/history.c b/src/history.c index 10817df..c953f52 100644 --- a/src/history.c +++ b/src/history.c @@ -2576,10 +2576,11 @@ * - caused XP code (in XPCONIO.C) to create new mouse input sequence * [0 MOUS #col #row 2] as MS2 and bound it to mouse-resize2-window * Sep 2020 Jean-Michel Dubois + * - Changed minor version number to 5.10 * - Added Unicode support with UTF-8 files * - Added Theos O.S. support (in 1988-1992) * - Added Cygwin support - * - Added ncurses display with drop down menus + * - Added ncurses display with drop down menus (Linux and Cygwin only) * - Added file backup (likely borrowed to Mark Williams) * - Added help on language keywords (currently for Theos C only) (borrowed to Mark Williams) * - Added semi-graphics character entry through numeric keypad From c220c7116d2dd2c1a1284934dc8a6e2403fc44e1 Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 3 Sep 2020 19:05:11 +0200 Subject: [PATCH 15/37] Update to version 5.10 --- h/estruct.h.template | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/h/estruct.h.template b/h/estruct.h.template index 60cc5ae..b4f4118 100644 --- a/h/estruct.h.template +++ b/h/estruct.h.template @@ -185,8 +185,7 @@ #if JMDEXT #define BACKUP 1 /* backup previous file version */ -#define LIBHELP 1 /* help des fonctions de la bibliotheque C */ -#define DYNMSGS 1 /* dynamic load of messages */ +#define LIBHELP 1 /* online help from Mark Williams version */ #define DYNMSGS 1 /* dynamic load of messages */ #define THEOX 1 /* allow TheoX character set files edition */ /* including semi-graphics entry from numeric */ From 47e6e3482d97739ec06d9282e21832e25efa567f Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 3 Sep 2020 19:08:52 +0200 Subject: [PATCH 16/37] Update to version 5.10 --- linux/estruct.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/estruct.h b/linux/estruct.h index 3e14a7e..d4c44a3 100644 --- a/linux/estruct.h +++ b/linux/estruct.h @@ -184,7 +184,7 @@ #if JMDEXT #define BACKUP 1 /* backup previous file version */ -#define LIBHELP 1 /* online help for C functions */ +#define LIBHELP 1 /* online help from Mark Williams version */ #define DYNMSGS 1 /* dynamic load of messages */ #define THEOX 1 /* allow TheoX character set files edition */ /* including semi-graphics entry from numeric */ From 50aa498641c9ed465d088d4ff726f00a58eb06ce Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 3 Sep 2020 19:10:17 +0200 Subject: [PATCH 17/37] Update to version 5.10 --- cygwin/estruct.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cygwin/estruct.h b/cygwin/estruct.h index 2890943..d4c44a3 100644 --- a/cygwin/estruct.h +++ b/cygwin/estruct.h @@ -184,11 +184,12 @@ #if JMDEXT #define BACKUP 1 /* backup previous file version */ -#define LIBHELP 1 /* online help for C functions */ +#define LIBHELP 1 /* online help from Mark Williams version */ #define DYNMSGS 1 /* dynamic load of messages */ #define THEOX 1 /* allow TheoX character set files edition */ /* including semi-graphics entry from numeric */ /* keypad (require UTF8) */ +#define TXBASIC 1 /* TxBasic IDE menu */ #endif #if DYNMSGS From 2a65d62f8bdaf035b218d1fee6f62bcc25b7b2dd Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 3 Sep 2020 19:12:44 +0200 Subject: [PATCH 18/37] Add files via upload --- xp/vs2017/cmdfix.vcxproj | 264 +++--- xp/vs2017/cmdfix.vcxproj.user | 4 + xp/vs2017/estruct.h | 1359 ++++++++++++++++++++++++++++++ xp/vs2017/memacs.sln | 82 +- xp/vs2017/memacs.vcxproj | 389 +++++---- xp/vs2017/memacs.vcxproj.filters | 401 ++++----- xp/vs2017/memacs.vcxproj.user | 4 + 7 files changed, 1915 insertions(+), 588 deletions(-) create mode 100644 xp/vs2017/cmdfix.vcxproj.user create mode 100644 xp/vs2017/estruct.h create mode 100644 xp/vs2017/memacs.vcxproj.user diff --git a/xp/vs2017/cmdfix.vcxproj b/xp/vs2017/cmdfix.vcxproj index 4de2eb2..8fca610 100644 --- a/xp/vs2017/cmdfix.vcxproj +++ b/xp/vs2017/cmdfix.vcxproj @@ -1,133 +1,133 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 15.0 - {DF861FD8-273A-44B0-BAE0-97B5BF73FC42} - cmdfix - 10.0.17134.0 - - - - Application - true - v141 - MultiByte - - - Application - false - v141 - true - MultiByte - - - Application - true - v141 - MultiByte - - - Application - false - v141 - true - MultiByte - - - - - - - - - - - - - - - - - - - - - $(ProjectDir)..\..\h\;$(IncludePath) - - - $(ProjectDir)..\..\h\;$(IncludePath) - - - $(ProjectDir)..\..\h\;$(IncludePath) - - - $(ProjectDir)..\..\h\;$(IncludePath) - - - - Level3 - Disabled - false - - - - - Level3 - Disabled - false - - - - - Level3 - MaxSpeed - true - true - false - - - true - true - - - - - Level3 - MaxSpeed - true - true - false - - - true - true - - - - - - - - - - - + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {DF861FD8-273A-44B0-BAE0-97B5BF73FC42} + cmdfix + 10.0 + + + + Application + true + v142 + MultiByte + + + Application + false + v142 + true + MultiByte + + + Application + true + v142 + MultiByte + + + Application + false + v142 + true + MultiByte + + + + + + + + + + + + + + + + + + + + + $(ProjectDir)..\..\h\;$(IncludePath) + + + $(ProjectDir)..\..\h\;$(IncludePath) + + + $(ProjectDir)..\..\h\;$(IncludePath) + + + $(ProjectDir)..\..\h\;$(IncludePath) + + + + Level3 + Disabled + false + + + + + Level3 + Disabled + false + + + + + Level3 + MaxSpeed + true + true + false + + + true + true + + + + + Level3 + MaxSpeed + true + true + false + + + true + true + + + + + + + + + + + \ No newline at end of file diff --git a/xp/vs2017/cmdfix.vcxproj.user b/xp/vs2017/cmdfix.vcxproj.user new file mode 100644 index 0000000..0f14913 --- /dev/null +++ b/xp/vs2017/cmdfix.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/xp/vs2017/estruct.h b/xp/vs2017/estruct.h new file mode 100644 index 0000000..ba260ca --- /dev/null +++ b/xp/vs2017/estruct.h @@ -0,0 +1,1359 @@ +/* ESTRUCT: Structure and preprocesser defined for + MicroEMACS 4.01 + + (C)Copyright 1997 by Daniel Lawrence + written by Daniel Lawrence + based on code by Dave G. Conroy, + Steve Wilhite and George Jones + + Unicode support by Jean-Michel Dubois +*/ + +#ifdef LATTICE +#undef LATTICE /* don't use their definitions...use ours */ +#endif +#ifdef MSDOS +#undef MSDOS +#endif +#ifdef WINNT +#undef WINNT +#endif +#ifdef AMIGA +#undef AMIGA +#endif +#ifdef EGA +#undef EGA +#endif +#ifdef CTRLZ +#undef CTRLZ +#endif + +/* Program Identification..... + + PROGNAME should always be MicroEMACS for a distribution + unmodified version. People using MicroEMACS as a shell + for other products should change this to reflect their + product. Macros can query this via the $progname variable +*/ + +#define PROGNAME "MicroEMACS" +#define VERSION "5.10" + +/* Machine/OS definitions */ +/* [Set one of these!!] */ + +#define AMIGA 0 /* AmigaDOS */ +#define AOSVS 0 /* Data General AOS/VS */ +#define AUX 0 /* Apple UNIX for Macintosh */ +#define AIX 0 /* IBM UNIX for various machines*/ +#define AVIION 0 /* Data General AViiON */ +#define BSD 0 /* UNIX BSD 4.2 and ULTRIX */ +#define FINDER 0 /* Macintosh OS */ +#define FREEBSD 0 /* FREEBSD 386 version 2 or + */ +#define HPUX8 0 /* HPUX HP 9000 ver 8 or less */ +#define HPUX9 0 /* HPUX HP 9000 ver 9 */ +#define MPE 0 /* HP MPE/XL */ +#define MSDOS 0 /* MS-DOS */ +#define WINNT 0 /* MS-Win NT */ +#define WINXP 1 /* Windows XP/Visual studio 2008*/ +#define OS2 0 /* Microsoft or IBM OS/2 */ +#define SMOS 0 /* Supermax UNIX System V */ +#define SUN 0 /* SUN v4.0 */ +#define TOS 0 /* ST520, TOS */ +#define USG 0 /* UNIX system V */ +#define VMS 0 /* VAX/VMS */ +#define WMCS 0 /* Wicat's MCS */ +#define XENIX 0 /* IBM-PC SCO XENIX */ + +/* Compiler definitions */ +/* [Set one of these!!] */ +#define ALCYON 0 /* ALCYON Atari ST compiler */ +#define AZTEC 0 /* Aztec C 4.00e ONLY for the amiga now... */ +#define DGC 0 /* Data General AOS/VS C... */ +#define GCC 0 /* the GNU C compiler */ +#define IC 0 /* Rational Systems Instant C */ +#define LATTICE 0 /* Lattice 2.14 through 3.0 compilers */ +#define MSC 1 /* MicroSoft C compile version 3 and up */ +#define MWC 0 /* Mark Williams C */ +#define TURBO 0 /* Turbo C and Borland C++ under MSDOS */ +#define UNIX 0 /* a standard UNIX compiler (cc) */ +#define ZTC 0 /* Zortech C/C++ 1.02 thru 2.10 under MSDOS */ + +/* Machine stack growth direction. */ +/* [Set this to 1 if your machine stack grows UP!!!] */ +/* data general mv/eclipse series stack grows up. */ +/* dec vax series stack grows down... got it??? */ + +#define STACK_GROWS_UP 0 + +/* Debugging options */ +#define RAMSIZE 0 /* dynamic RAM memory usage tracking */ +#define RAMSHOW 0 /* auto dynamic RAM reporting */ +#define RAMTRCK 0 /* send debug info to MALLOC.DAT */ +#define DEBUG_SEARCH 0 /* pop some search info on patterns */ + +/* Special keyboard/network definitions */ + +#define ATKBD 1 /* AT-style keyboard with F11, F12 & grey keys */ +#define WANGPC 0 /* WangPC - mostly escape sequences */ +#define VT100 0 /* Handle VT100 style keypad - NOT VMS. */ +#define KEYPAD 0 /* VMS - turn on and off application */ + /* keypad automatically */ +#define XONDATA 0 /* VMS - set to force /NOTTSYNC/NOHOSTSY */ +#define RMSIO 0 /* VMS - skip the rotten C runtime and */ + /* use RMS directly */ +#define OPTMEM 0 /* VMS 5.0 and up - use a less standard */ + /* but more efficient memory allocator */ + +/* Terminal Output definitions */ +/* [Set one of these!!] */ + +#define ANSI 0 /* ANSI escape sequences */ +#define CURSES 0 /* Use CURSES (not complete) */ +#define DASHER 0 /* DG Dasher 2xx/4xx crts */ +#define DG10 0 /* Data General system/10 */ +#define FMR 0 /* Fujitsu FMR series driver */ +#define HP110 0 /* HP110 screen driver */ +#define HP150 0 /* HP150 screen driver */ +#define I55 0 /* IBM PS55 DOS J4.0/V */ +#define IBMPC 0 /* IBM-PC CGA/MONO/EGA/VGA drvr */ +#define MAC 0 /* Macintosh */ +#define NEC 0 /* NEC-9801VM driver */ +#define OS2NPM 0 /* OS/2 non-Presentation Mgr. */ +#define SMG 0 /* SMG library on VMS */ +#define ST52 0 /* Atari 520/1040ST screen */ +#define TERMCAP 0 /* Use TERMCAP */ +#define TIPC 0 /* TI Profesional PC driver */ +#define VT52 0 /* VT52 terminal (Zenith). */ +#define NTCON 0 /* Windows NT console */ +#define XPCON 1 /* windows XP console app */ +#define XVT 0 /* XVT windowing system */ +#define Z309 0 /* Zenith 100 PC family driver */ + +/* Windowing system style (pick one) */ + +#define WINDOW_TEXT 1 /* [default] Text mode */ +#define WINDOW_MSWIN 0 /* MicroSoft Windows */ +#define WINDOW_MSWIN32 0 /* MicroSoft Windows 32 bit API */ +#define WINDOW_X 0 /* X/Unix */ + +/* Language text options (pick one) */ + +#define ENGLISH 1 /* [default] */ +#define FRENCH 0 +#define SPANISH 0 +#define GERMAN 0 +#define DUTCH 0 +#define PLATIN 0 /* Pig Latin */ +#define JAPAN 0 +#define LATIN 0 /* real Latin */ + +/* Configuration options */ + +#define TYPEAH 1 /* type ahead causes update to be skipped */ +#define LOGFLG 0 /* send all executed commands to EMACS.LOG */ +#define VISMAC 0 /* update display during keyboard macros */ +#define CTRLZ 0 /* add a ^Z at end of files under MSDOS only */ +#define CLEAN 0 /* de-alloc memory on exit */ +#define CALLED 0 /* is emacs a called subroutine? or stand alone */ + +#define REVSTA 1 /* Status line appears in reverse video */ +#define COLOR 1 /* color commands and windows */ + +#define FILOCK 0 /* file locking under unix BSD 4.2 */ +#define ISRCH 1 /* Incremental searches like ITS EMACS */ +#define FLABEL 0 /* function key label code [HP150] */ +#define CRYPT 1 /* file encryption enabled? */ +#define MAGIC 1 /* include regular expression matching? */ +#define MOUSE 1 /* Include routines for mouse actions */ +#define NOISY 1 /* Use a fancy BELL if it exists */ +#define CTAGS 1 /* include vi-like tagging? */ +#define SPEECH 0 /* spoken EMACS, for the sight impared [not ready] */ +#define VARARG 1 /* use varargs.h for mlwrite() */ + +#if XVT +#undef COLOR +#define COLOR 1 /* overide this to be TRUE for XVT always */ +#endif + +#define JMDEXT 0 /* enable J-M Dubois' extensions */ + +#if JMDEXT +#define BACKUP 1 /* backup previous file version */ +#define LIBHELP 1 /* online help from Mark Williams version */ +#define DYNMSGS 1 /* dynamic load of messages */ +#define THEOX 1 /* allow TheoX character set files edition */ + /* including semi-graphics entry from numeric */ + /* keypad (require UTF8) */ +#define TXBASIC 1 /* TxBasic IDE menu */ +#endif + +#if DYNMSGS +#define OQUOTE_CHAR 34 +#define CQUOTE_CHAR 34 +#endif + +/* Character set options */ +/* [Set one of these!!] */ +#define ASCII 0 /* use ASCII char sequences */ +#define EBCDIC 0 /* later IBM mainfraim versions will use EBCDIC */ +#define UTF8 1 /* use UTF-8 encoded Unicode */ + +#if UTF8 +#include "utf8.h" +#endif + +/* handle constant and voids properly */ + +#if VMS +#define CONST readonly +#define VOID void +#define NOSHARE noshare +#else +#if AOSVS +#define CONST $shared $align(1) /* fake a const */ +#define VOID +#define NOSHARE $low32k $align(1) /* attempt to optimize read/write vars. */ +#else + +#if __STDC__ || MSC || TURBO || GCC || (AMIGA && LATTICE) +#define CONST const +#define VOID void +#define NOSHARE +#else +#define CONST +#if IC +#define VOID void +#else +#define VOID +#endif +#define NOSHARE +#endif + +#endif +#endif + +/* System dependant library redefinitions, structures and includes */ + +/* multibyte character support? */ + +#if NEC || FMR || I55 +#define DBCS 1 /* double byte character sets enabled */ +#define INSDEL 1 /* use insert/delete line display optimizations */ + +/* define DBCS prefix bytes */ +#define is2char(ch) (((ch&0xff) >= 0x81 && (ch&0xff) <= 0x9f) || ((ch&0xff) >=0xe0 && (ch&0xff) <= 0xfc)) + +#else +#define DBCS 0 +#define INSDEL 0 +#endif + +/* Can we catch the SIGWINCH (the window size change signal)? */ + +#if AIX || HPUX9 || LINUX +#define HANDLE_WINCH 1 +#else +#define HANDLE_WINCH 0 +#endif + +/* Prototypes in use? */ + +#if MSC || TURBO || IC || VMS || GCC || ZTC +#define PROTO 1 +#else +#define PROTO 0 +#endif + +/* the following define allows me to initialize unions... + otherwise we make them structures (like the keybinding table) */ + +#if __STDC__ || MSC || TURBO || IC || ZTC +#define ETYPE union +#else +#define ETYPE struct +#endif + + /* Instant C can't do stat()s. Arrrg. No file locking for you */ +#if IC && MSDOS +#undef FILOCK +#define FILOCK 0 +#endif + +/* Mark Williams/Atari has no standard or varargs or directory functions */ +#if TOS & MWC +#undef VARARG +#define VARARG 0 +#undef FILOCK +#define FILOCK 0 +#endif + +/* MS-Windows */ + +#if WINNT || WINDOW_MSWIN || WINDOW_MSWIN32 +#if WINDOW_MSWIN32 +#undef WINDOW_MSWIN +#define WINDOW_MSWIN 1 +#endif +#if WINDOW_MSWIN && (WINNT || WINXP) +#undef WINDOW_MSWIN32 +#define WINDOW_MSWIN32 1 +#endif +#if 1 +#undef MAC /* Mac conflicts with a definition used by rpc.h */ +#undef VOID /* windows.h will wind up defining this when compiled as a console app */ +#include /* --------- Huge include file here !!! ---------*/ +#ifndef VOID +#define VOID void /* Redefine, incase we are compiled as a Windows app */ +#endif +#endif +#if NTCON +#include +#include +#include +#endif + +#undef NEAR +#define NEAR +#define DNEAR +#if MSC || IC +#undef CDECL +#define CDECL __cdecl +#define DUMMYSZ 1 /* dummy size for unsized extern arrays to avoid + silly DGROUP fixup */ +#else +#if TURBO +#define DUMMYSZ /* nothing */ +#else +#define CDECL _cdecl /* ZTC */ +#define DUMMYSZ /* nothing */ +#endif +#endif + +#if (WINNT || WINXP) && !WINDOW_MSWIN +#define EXPORT /* Windows NT doesn't like this */ +#endif + +#if WINDOW_MSWIN +#undef TYPEAH +#define TYPEAH 0 /* typeahead is handled at the term driver level */ +#undef CALLED +#define CALLED 1 /* under MS Windows, "main" resides in the sys driver */ +#if WINNT || WINXP +#define EXPORT /* Windows NT doesn't like this */ +#elif MSC +#define EXPORT __export +#else +#define EXPORT _export /* Fine for TURBO and ZTC */ +#endif +#endif +#else + +/* neither Windows NT nor MS-Windows */ + +#define DUMMYSZ /* nothing */ + +#if MSDOS & (TURBO | MSC | TIPC) +#define NEAR +#define DNEAR +#define PASCAL pascal +#define CDECL cdecl +#else +#if MSDOS & ZTC +#define NEAR +#define DNEAR +#define PASCAL _pascal +#define CDECL _cdecl +#else +#define NEAR +#define DNEAR +#define PASCAL +#define CDECL +#endif +#endif + +#endif + +#if TURBO +#include +#include +#undef peek +#undef poke +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#endif + +#if IC +#include +#undef peek +#undef poke +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#endif + +#if LATTICE & MSDOS +/* you may have to remove this one definition with LATTICE version + 3.2 and above */ +#define unsigned +#endif + +#if IC +#define inp inportb +#define outp outportb +#define intdos(a, b) int86(33, a, b) +#endif + +#if AZTEC +#undef putc +#undef getc +#if MSDOS +#define getc a1getc +#define int86 sysint +#define intdos(a, b) sysint(33, a, b) +#define inp inportb +#define outp outportb +#else +#define getc agetc +#endif +#define putc aputc + +struct XREG { + unsigned ax, bx, cx, dx, si, di, ds, es; +}; + +struct HREG { + char al, ah, bl, bh, cl, ch, dl, dh, d1, d2, e1, e2; +}; + +union REGS { + struct XREG x; + struct HREG h; +}; + +struct SREGS { + unsigned cs, ss, ds, es; +}; +#endif + +#if MSDOS & MWC +#include +#define int86(a, b, c) intcall(b, c, a) +#define intdos(a, b) intcall(a, b, DOSINT) +#define inp(a) in(a) +#define outp(a, b) out(a, b) +#define movmem(a, b, c) memcpy(b, a, c) + +struct XREG { + unsigned int ax, bx, cx, dx, si, di, ds, es, flags; +}; + +struct HREG { + char al, ah, bl, bh, cl, ch, dl, dh; + unsigned int ds, es, flags; +}; + +union REGS { + struct XREG x; + struct HREG h; +}; +#endif + +#if MSDOS & MSC +#include +#include +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#define movmem(a, b, c) memcpy(b, a, c) +#define _strrev(a) strrev(a) +#endif + +#if MSDOS & LATTICE +#undef CPM +#undef LATTICE +#include +#undef CPM +#endif + +/* System V doesn't name this the same as others */ +#if USG | AIX | AUX | SUN | (OS2 & MSC) +#define movmem(a, b, c) memcpy(b, a, c) +#endif + +/* this keeps VMS happy */ +#if VMS +#define getname xgetname +#define unlink(a) delete(a) +#endif + +/* some options for AOS/VS */ +#if AOSVS +#define ORMDNI 1 +#endif + +/* define some ability flags */ + +#if (IBMPC | Z309 | FMR | TIPC) & !(WINDOW_MSWIN | WINDOW_MSWIN32) +#define MEMMAP 1 +#else +#define MEMMAP 0 +#endif + +#if MSDOS | WINNT | WINXP | OS2 | USG | AIX | AUX | SMOS | HPUX8 | HPUX9 | BSD | FREEBSD | (TOS & MWC) | WMCS | SUN | MPE +#define ENVFUNC 1 +#else +#define ENVFUNC 0 +#endif + +#if AUX +#define RETCHAR '\n' +#else +#define RETCHAR '\r' +#endif + +#if THEOS +#define _CTYPE_NO_MACRO 1 +#define RET_CHAR '\n' +#else +#define RET_CHAR '\r' +#endif + +#if MPE +#define DIRSEPSTR "." +#define DIRSEPCHAR '.' +#else +#if TOS || MSDOS || WINNT || WINXP || OS2 +#define DIRSEPSTR "\\" +#define DIRSEPCHAR '\\' +#define DRIVESEPCHAR ':' +#else +#define DIRSEPSTR "/" +#define DIRSEPCHAR '/' +#define DRIVESEPCHAR '\0' +#endif +#endif + +#if VARARG +#if (GCC == 0) && (USG || AIX || AUX || BSD || FREEBSD || SUN || XENIX || HPUX8 || HPUX9 || AVIION || MPE) +#define VARG 1 +#define SARG 0 +#include +#else +#define VARG 0 +#define SARG 1 +#include +#endif +#endif + +#if ZTC +#include +#define movmem(a, b, c) memcpy(b, a, c) +#endif + +/* Emacs global flag bit definitions (for gflags) */ + +#define GFREAD 1 /* read first file in at startup */ +#define GFSDRAW 2 /* suppress a screen redraw */ +#define GFEXIT 4 /* exit from emacs pending */ + +/* internal constants */ + +#define NBINDS 300 /* max # of bound keys */ +#if AOSVS | VMS | WINNT | WINXP | SUN | BSD | FREEBSD | USG | ZENIX | HPUX8 | HPUX9 | OS2 +#define NFILEN 256 +#else +#define NFILEN 80 /* # of bytes, file name */ +#endif +#define NBUFN 128 /* # of bytes, buffer name */ +#define NLINE 512 /* # of bytes, input line */ +#define NSTRING 512 /* # of bytes, string buffers */ +#define NKBDM 4096 /* # of strokes, keyboard macro */ +#define NPAT 512 /* # of bytes, pattern */ +#define HUGENUM 1000 /* Huge number */ +#define NLOCKS 256 /* max # of file locks active */ +#define NCOLORS 16 /* number of supported colors */ +#define KBLOCK 250 /* sizeof kill buffer chunks */ +#define NRING 16 /* # of buffers in kill ring */ +#define NBLOCK 16 /* line block chunk size */ +#define NVSIZE 16 /* max #chars in a var name */ +#define NMARKS 16 /* number of marks */ +#define MAXSYM 32 /* max # chars in symbol to expand */ +#define MINFLEN 3 /* min # chars to match &func */ + +#if UTF8 +#define CTRL 0x01000000 /* Control flag, or'ed in */ +#define META 0x02000000 /* Meta flag, or'ed in */ +#define CTLX 0x04000000 /* ^X flag, or'ed in */ +#define SPEC 0x08000000 /* special key (function keys) */ +#define MOUS 0x10000000 /* alternative input device (mouse) */ +#define SHFT 0x20000000 /* shifted (for function keys) */ +#define ALTD 0x40000000 /* ALT key... */ +#define MENU MOUS+SPEC /* menu selection (WINDOW_MSWIN) */ +#define CMSK 0x00FFFFFF /* Character mask */ +#define SHIFTPFX 24 +#else +#define CTRL 0x0100 /* Control flag, or'ed in */ +#define META 0x0200 /* Meta flag, or'ed in */ +#define CTLX 0x0400 /* ^X flag, or'ed in */ +#define SPEC 0x0800 /* special key (function keys) */ +#define MOUS 0x1000 /* alternative input device (mouse) */ +#define SHFT 0x2000 /* shifted (for function keys) */ +#define ALTD 0x4000 /* ALT key... */ +#define MENU MOUS+SPEC /* menu selection (WINDOW_MSWIN) */ +#define CMSK 0x00FF /* Character mask */ +#define SHIFTPFX 8 +#endif + +#define BINDNUL 0 /* not bound to anything */ +#define BINDFNC 1 /* key bound to a function */ +#define BINDBUF 2 /* key bound to a buffer */ + +#ifdef FALSE +#undef FALSE +#endif +#ifdef TRUE +#undef TRUE +#endif + +#define FALSE 0 /* False, no, bad, etc. */ +#define TRUE 1 /* True, yes, good, etc. */ +#define ABORT 2 /* Death, ^G, abort, etc. */ +#define FAILD 3 /* not-quite fatal false return */ + +#define STOP 0 /* keyboard macro not in use */ +#define PLAY 1 /* playing */ +#define RECORD 2 /* recording */ + +/* Completion types */ + +#define CMP_BUFFER 0 +#define CMP_COMMAND 1 +#define CMP_FILENAME 2 + +/* Directive definitions */ + +#define DIF 0 +#define DELSE 1 +#define DENDIF 2 +#define DGOTO 3 +#define DRETURN 4 +#define DENDM 5 +#define DWHILE 6 +#define DENDWHILE 7 +#define DBREAK 8 +#define DFORCE 9 + +#define NUMDIRS 10 + +/* + * PTBEG, PTEND, FORWARD, and REVERSE are all toggle-able values for + * routines that need directions. + */ +#define PTBEG 0 /* Leave the point at the beginning on search */ +#define PTEND 1 /* Leave the point at the end on search */ +#define FORWARD 0 /* do things in a forward direction */ +#define REVERSE 1 /* do things in a backwards direction */ + +#define FIOSUC 0 /* File I/O, success. */ +#define FIOFNF 1 /* File I/O, file not found. */ +#define FIOEOF 2 /* File I/O, end of file. */ +#define FIOERR 3 /* File I/O, error. */ +#define FIOMEM 4 /* File I/O, out of memory */ +#define FIOFUN 5 /* File I/O, eod of file/bad line*/ +#define FIODEL 6 /* Can't delete/rename file */ + +#if WINDOW_MSWIN + /* values for the fbusy flag */ +#define FREADING 1 /* file read in progress */ +#define FWRITING 2 /* file write in progress */ +/* if no file activity, the value FALSE is used */ +#endif + +#define CFCPCN 0x0001 /* Last command was C-P, C-N */ +#define CFKILL 0x0002 /* Last command was a kill */ +#define CFSRCH 0x0004 /* last command was a search */ +#define CFYANK 0x0008 /* last command was a yank */ + +#define SRNORM 0 /* end past, begin front */ +#define SRBEGIN 1 /* always at front */ +#define SREND 2 /* always one past end */ + +#define BELL 0x07 /* a bell character */ +#define TAB 0x09 /* a tab character */ + +#if USG | AIX | AUX | SMOS | HPUX8 | HPUX9 | BSD | FREEBSD | SUN | XENIX | AVIION +#define PATHCHR ':' +#else +#if WMCS || MPE +#define PATHCHR ',' +#else +#define PATHCHR ';' +#endif +#endif + +#define INTWIDTH sizeof(int) * 3 +#define LONGWIDTH sizeof(long) * 3 + +/* Macro argument token types */ + +#define TKNUL 0 /* end-of-string */ +#define TKARG 1 /* interactive argument */ +#define TKBUF 2 /* buffer argument */ +#define TKVAR 3 /* user variables */ +#define TKENV 4 /* environment variables */ +#define TKFUN 5 /* function.... */ +#define TKDIR 6 /* directive */ +#define TKLBL 7 /* line label */ +#define TKLIT 8 /* numeric literal */ +#define TKSTR 9 /* quoted string literal */ +#define TKCMD 10 /* command name */ + +/* Internal defined functions */ + +#define nextab(a) (a - (a % tabsize)) + tabsize + +/* DIFCASE represents the integer difference between upper + and lower case letters. It is an xor-able value, which is + fortunate, since the relative positions of upper to lower + case letters is the opposite of ascii in ebcdic. +*/ + +#if ASCII +#define DIFCASE 0x20 +#else +#define DIFCASE 0x40 +#endif + +/* Dynamic RAM tracking and reporting redefinitions */ + +#if RAMSIZE +#define malloc Eallocate +#define free Erelease +#else +#if VMS & OPTMEM +#define malloc VAXC$MALLOC_OPT +#define free VAXC$FREE_OPT +#define calloc VAXC$CALLOC_OPT +#define realloc VAXC$REALLOC_OPT +#define cfree VAXC$CFREE_OPT +#endif +#endif + +/* under MS Windows, we use dialog boxes to prompt the user for filenames */ +#if WINDOW_MSWIN +#define FILENAMEREPLY(p,b,nb) filenamedlg(p,b,nb,TRUE) +#else +#define FILENAMEREPLY(p,b,nb) mlreply(p,b,nb) +#endif + +/* colors respresented as parameters to WORDs and Screen positions */ + +#define CLRVAL unsigned int + +/* formal parameters to procedures are stored as a linked list + of argument names using the following simple structure: +*/ + +typedef struct PARG { + struct PARG* next; /* ptr to next linked argument */ + char name[NVSIZE + 1]; /* name of the argument */ +} PARG; + +/* UNDO definitions and types */ + +typedef int OPTYPE; /* type of operation being recorded/played back */ + +#define OP_CMND 1 /* beginning of command */ +#define OP_DELC 2 /* delete a single character */ +#define OP_INSC 3 /* insert a single character */ +#define OP_DSTR 4 /* delete a string of characters */ +#define OP_ISTR 5 /* insert a string of characters */ +#define OP_REPC 6 /* replace a character */ +#define OP_CPOS 7 /* set the cursor position */ + +/* object to be undone! */ + +typedef union OBJECT { + char obj_char; /* a character */ + char obj_string[1]; /* many characters */ + char* obj_sptr; /* a ptr to a character */ +} OBJECT; + +typedef struct UNDO_OBJ { + struct UNDO_OBJ* next; /* ptr to next undo object */ + OPTYPE type; /* type of operation */ + long line_num; /* line offset from buffer beginning */ + int offset; /* offset into that line */ + long count; /* repetitions? */ + OBJECT undo_obj; /* object to be undone */ +} UNDO_OBJ; + +/* + * There is a window structure allocated for every active display window. The + * windows are kept in a big list, in top to bottom screen order, with the + * listhead at "wheadp". Each window contains its own values of dot and mark. + * The flag field contains some bits that are set by commands to guide + * redisplay. Although this is a bit of a compromise in terms of decoupling, + * the full blown redisplay is just too expensive to run for every input + * character. + */ +typedef struct EWINDOW { + struct EWINDOW* w_wndp; /* Next window */ + struct BUFFER* w_bufp; /* Buffer displayed in window */ + struct LINE* w_linep; /* Top line in the window */ + struct LINE* w_dotp; /* Line containing "." */ + short w_doto; /* Byte offset for "." */ + struct LINE* w_markp[NMARKS]; /* Line containing "mark" */ + short w_marko[NMARKS]; /* Byte offset for "mark" */ + char w_toprow; /* Origin 0 top row of window */ + char w_ntrows; /* # of rows of text in window */ + char w_force; /* If NZ, forcing row. */ + char w_flag; /* Flags. */ +#if COLOR + char w_fcolor; /* current forground color */ + char w_bcolor; /* current background color */ +#endif + int w_fcol; /* first column displayed */ +} EWINDOW; + +#define WFFORCE 0x01 /* Window needs forced reframe */ +#define WFMOVE 0x02 /* Movement from line to line */ +#define WFEDIT 0x04 /* Editing within a line */ +#define WFHARD 0x08 /* Better to a full display */ +#define WFMODE 0x10 /* Update mode line. */ +#define WFCOLR 0x20 /* Needs a color change */ + +/* This structure holds the information about each line appearing on the + * video display. The redisplay module uses an array of virtual display + * lines. On systems that do not have direct access to display memory, + * there is also an array of physical display lines used to minimize + * video updating. In most cases, these two arrays are unique. If + * WINDOW_MSWIN is 1, there is a pair of such arrays in each ESCREEN + * structure. + */ + +typedef struct VIDEO { + int v_flag; /* Flags */ +#if COLOR + int v_fcolor; /* current forground color */ + int v_bcolor; /* current background color */ + int v_rfcolor; /* requested forground color */ + int v_rbcolor; /* requested background color */ +#endif + int v_left; /* left edge of reverse video */ + int v_right; /* right right of reverse video */ +#if INSDEL && MEMMAP == 0 + int v_rline; /* requested screen line # */ +#endif +#if UTF8 + unsigned int v_text[1]; /* Screen data. */ +#else + char v_text[1]; /* Screen data. */ +#endif +} VIDEO; + +#define VFNEW 0x0001 /* contents not meaningful yet */ +#define VFCHG 0x0002 /* Changed flag */ +#define VFEXT 0x0004 /* extended (beyond column 80) */ +#define VFREV 0x0008 /* reverse video status */ +#define VFREQ 0x0010 /* reverse video request */ +#define VFCOL 0x0020 /* color change requested */ + +/* + * This structure holds the information about each separate "screen" + * within the current editing session. On a character based system, these + * screens overlay each other, and can individually be brought to front. + * On a windowing system like MicroSoft Windows 3.0, OS/2, the Macintosh, + * Intuition, Sunview or X-windows, each screen is represented in an OS + * window. The terminolgy is wrong in emacs..... + * + * EMACS The outside World + * screen window + * window pane + */ + +typedef struct ESCREEN { + struct ESCREEN* s_next_screen; /* link to next screen in list */ + EWINDOW* s_first_window; /* head of linked list of windows */ + EWINDOW* s_cur_window; /* current window in this screen */ + char* s_screen_name; /* name of the current window */ + short s_roworg; /* row origin of stored screen */ + short s_colorg; /* column origin of stored screen */ + short s_nrow; /* row width of stored screen */ + short s_ncol; /* column origin of stored screen */ +#if WINDOW_MSWIN + VIDEO** s_virtual; /* virtual screen contents */ + VIDEO** s_physical; /* physical screen contents */ + HWND s_drvhandle; /* handle for the "term" driver */ +#endif +} ESCREEN; + +/* + * Text is kept in buffers. A buffer header, described below, exists for every + * buffer in the system. The buffers are kept in a big list, so that commands + * that search for a buffer by name can find the buffer header. There is a + * safe store for the dot and mark in the header, but this is only valid if + * the buffer is not being displayed (that is, if "b_nwnd" is 0). The text for + * the buffer is kept in a circularly linked list of lines, with a pointer to + * the header line in "b_linep". Buffers may be "Inactive" which means the + * files associated with them have not been read in yet. These get read in + * at "use buffer" time. + * Some buffers are really procedures and have a little extra information + * stored with them. + */ +typedef struct BUFFER { + struct BUFFER* b_bufp; /* Link to next BUFFER */ + struct LINE* b_dotp; /* Link to "." LINE structure */ + short b_doto; /* Offset of "." in above LINE */ + struct LINE* b_markp[NMARKS]; /* The same as the above two, */ + short b_marko[NMARKS]; /* but for the "mark" */ + int b_fcol; /* first col to display */ + struct LINE* b_linep; /* Link to the header LINE */ + struct LINE* b_topline; /* Link to narrowed top text */ + struct LINE* b_botline; /* Link to narrowed bottom text */ + char b_active; /* window activated flag */ + char b_nwnd; /* Count of windows on buffer */ + char b_exec; /* how many active executions */ + char b_flag; /* Flags */ + int b_mode; /* editor mode of this buffer */ + char b_fname[NFILEN]; /* File name */ + char b_bname[NBUFN]; /* Buffer name */ +#if CRYPT + char b_key[NPAT]; /* current encrypted key */ +#endif + int b_numargs; /* number of arguments to procedure */ + PARG* b_args; /* ptr to the first argument */ + UNDO_OBJ* undo_head; /* head of undo stack for buffer */ + long undo_count; /* # of undo operations stacked */ + long last_access; /* time of last access */ +} BUFFER; + +#define BFINVS 0x01 /* Internal invisable buffer */ +#define BFCHG 0x02 /* Changed since last write */ +#define BFTRUNC 0x04 /* buffer was truncated when read */ +#define BFNAROW 0x08 /* buffer has been narrowed */ +#if LIBHELP +#define BFERROR 0x40 /* Error file buffer */ +#define BFHELP 0x80 /* Buffer is a help buffer */ +#endif + +#define NOTPROC -1 /* buffer is not a procedure */ + +/* mode flags */ +#if JMDEXT +#define NUMMODES 14 /* # of defined modes */ +#else +#define NUMMODES 11 /* # of defined modes */ +#endif + +#define MDWRAP 0x0001 /* word wrap */ +#define MDCMOD 0x0002 /* C indentation and fence match*/ +#define MDSPELL 0x0004 /* spell error parsing */ +#define MDEXACT 0x0008 /* Exact matching for searches */ +#define MDVIEW 0x0010 /* read-only buffer */ +#define MDOVER 0x0020 /* overwrite mode */ +#define MDMAGIC 0x0040 /* regular expresions in search */ +#define MDCRYPT 0x0080 /* encrytion mode active */ +#define MDASAVE 0x0100 /* auto-save mode */ +#define MDREPL 0x0200 /* replace mode */ +#define MDABBR 0x0400 /* abbreviation expansion mode */ +#if JMDEXT +#define MDNOBAK 0x0800 /* no auto backup */ +#define MDGRAF1 0x1000 /* single line graphics */ +#define MDGRAF2 0x2000 /* double line graphics */ +#endif + +/* + * The starting position of a region, and the size of the region in + * characters, is kept in a region structure. Used by the region commands. + */ +typedef struct { + struct LINE* r_linep; /* Origin LINE address. */ + short r_offset; /* Origin LINE offset. */ + long r_size; /* Length in characters. */ +} REGION; + +/* + * All text is kept in circularly linked lists of "LINE" structures. These + * begin at the header line (which is the blank line beyond the end of the + * buffer). This line is pointed to by the "BUFFER". Each line contains a the + * number of bytes in the line (the "used" size), the size of the text array, + * and the text. The end of line is not stored as a byte; it's implied. + */ +typedef struct LINE { + struct LINE* l_fp; /* Link to the next line */ + struct LINE* l_bp; /* Link to the previous line */ + short l_size; /* Allocated size */ + short l_used; /* Used size */ + char l_text[1]; /* A bunch of characters. */ +} LINE; + +#define lforw(lp) ((lp)->l_fp) +#define lback(lp) ((lp)->l_bp) +#if UNIX && (SUN || HPUX8 || HPUX9 || BSD || FREEBSD) +#define lgetc(lp, n) ((unsigned char)(lp)->l_text[(n)]) +#else +#define lgetc(lp, n) ((lp)->l_text[(n)]) +#endif +#define lputc(lp, n, c) ((lp)->l_text[(n)]=(c)) +#define lused(lp) ((lp)->l_used) +#define lsize(lp) ((lp)->l_size) +#define ltext(lp) ((lp)->l_text) + +/* This structure is used to hold a user variables name and its + current value. These are used for both the global and the + local symbol tables. +*/ + +typedef struct UVAR { + char u_name[NVSIZE + 1]; /* name of user variable */ + char* u_value; /* value (string) */ +} UVAR; + +#define VT_NONE 0 /* don't declare it if not found */ +#define VT_LOCAL 1 /* local to the current procedure */ +#define VT_GLOBAL 2 /* global to all procedures */ + +/* A UTABLE is a user variable table.... containing some header + information and an array of user variable names and definitions. + They are held together in a linked list, the last member of + the list being the global user variable table. +*/ + +typedef struct UTABLE { + struct UTABLE* next; /* ptr to next user variable table */ + int size; /* max number of variables in table */ + BUFFER* bufp; /* ptr to buffer holding procedure + assosiated with this symbol table. */ + UVAR uv[1]; /* list of variable names/definitions + in this variable table */ +} UTABLE; + +/* + * The editor communicates with the display using a high level interface. A + * "TERM" structure holds useful variables, and indirect pointers to routines + * that do useful operations. The low level get and put routines are here too. + * This lets a terminal, in addition to having non standard commands, have + * funny get and put character code too. The calls might get changed to + * "termp->t_field" style in the future, to make it possible to run more than + * one terminal type. + */ +#if PROTO +typedef struct { + short t_mrow; /* max number of rows allowable */ + short t_nrow; /* current number of rows used */ + short t_mcol; /* max Number of columns. */ + short t_ncol; /* current Number of columns. */ + short t_roworg; /* origin row (normally zero) */ + short t_colorg; /* origin column (normally zero)*/ + short t_margin; /* min margin for extended lines*/ + short t_scrsiz; /* size of scroll region " */ + int t_pause; /* # times thru update to pause */ + int (PASCAL NEAR* t_open)(void); /* Open terminal at the start.*/ + int (PASCAL NEAR* t_close)(void); /* Close terminal at end. */ + int (PASCAL NEAR* t_kopen)(void); /* Open keyboard */ + int (PASCAL NEAR* t_kclose)(void); /* Close keyboard */ + int (PASCAL NEAR* t_getchar)(void); /* Get character from keyboard. */ + int (PASCAL NEAR* t_putchar)(int); /* Put character to display.*/ + int (PASCAL NEAR* t_flush)(void); /* Flush output buffers. */ + int (PASCAL NEAR* t_move)(int, int);/* Move the cursor, origin 0.*/ + int (PASCAL NEAR* t_eeol)(void); /* Erase to end of line. */ + int (PASCAL NEAR* t_eeop)(void); /* Erase to end of page. */ + int (PASCAL NEAR* t_clrdesk)(void); /* Clear the page totally */ + int (PASCAL NEAR* t_beep)(void); /* Beep. */ + int (PASCAL NEAR* t_rev)(int); /* set reverse video state */ + int (PASCAL NEAR* t_rez)(char*); /* change screen resolution */ +#if COLOR + int (PASCAL NEAR* t_setfor)(int); /* set forground color */ + int (PASCAL NEAR* t_setback)(int); /* set background color */ +#endif +#if INSDEL + int (PASCAL NEAR* t_insline)(int); /* insert a screen line */ + int (PASCAL NEAR* t_delline)(int); /* delete a screen line */ +#endif +#if WINDOW_MSWIN + int (PASCAL NEAR* t_sleep)(int); /* go to sleep for a while */ + int (PASCAL NEAR* t_newscr)(ESCREEN*); /* create new screen display */ + int (PASCAL NEAR* t_delscr)(ESCREEN*); /* destroy screen display */ + int (PASCAL NEAR* t_selscr)(ESCREEN*); /* select screen display */ + int (PASCAL NEAR* t_sizscr)(ESCREEN*); /* resize screen display */ + int (PASCAL NEAR* t_topscr)(ESCREEN*); /* bring screen to top */ +#endif +} TERM; +#else /* TERM structure, no prototyping.*/ + +typedef struct { + short t_mrow; /* max number of rows allowable */ + short t_nrow; /* current number of rows used */ + short t_mcol; /* max Number of columns. */ + short t_ncol; /* current Number of columns. */ + short t_roworg; /* origin row (normally zero) */ + short t_colorg; /* origin column (normally zero)*/ + short t_margin; /* min margin for extended lines*/ + short t_scrsiz; /* size of scroll region " */ + int t_pause; /* # times thru update to pause */ + int (PASCAL NEAR* t_open)(); /* Open terminal at the start. */ + int (PASCAL NEAR* t_close)(); /* Close terminal at end. */ + int (PASCAL NEAR* t_kopen)(); /* Open keyboard */ + int (PASCAL NEAR* t_kclose)(); /* close keyboard */ + int (PASCAL NEAR* t_getchar)(); /* Get character from keyboard. */ + int (PASCAL NEAR* t_putchar)(); /* Put character to display. */ + int (PASCAL NEAR* t_flush)(); /* Flush output buffers. */ + int (PASCAL NEAR* t_move)(); /* Move the cursor, origin 0. */ + int (PASCAL NEAR* t_eeol)(); /* Erase to end of line. */ + int (PASCAL NEAR* t_eeop)(); /* Erase to end of page. */ + int (PASCAL NEAR* t_clrdesk)(); /* Clear the page totally */ + int (PASCAL NEAR* t_beep)(); /* Beep. */ + int (PASCAL NEAR* t_rev)(); /* set reverse video state */ + int (PASCAL NEAR* t_rez)(); /* change screen resolution */ +#if COLOR + int (PASCAL NEAR* t_setfor)(); /* set forground color */ + int (PASCAL NEAR* t_setback)(); /* set background color */ +#endif +#if INSDEL + int (PASCAL NEAR* t_insline)(); /* insert a screen line */ + int (PASCAL NEAR* t_delline)(); /* delete a screen line */ +#endif +#if WINDOW_MSWIN + int (PASCAL NEAR* t_sleep)(); /* go to sleep for a while */ + int (PASCAL NEAR* t_newscr)(); /* create new screen display */ + int (PASCAL NEAR* t_delscr)(); /* destroy screen display */ + int (PASCAL NEAR* t_selscr)(); /* select screen display */ + int (PASCAL NEAR* t_sizscr)(); /* resize screen display */ + int (PASCAL NEAR* t_topscr)(); /* bring screen to top */ +#endif +} TERM; +#endif + + +/* TEMPORARY macros for terminal I/O (to be placed in a machine + dependant place later) */ + +#define TTopen (*term.t_open) +#define TTclose (*term.t_close) +#define TTkopen (*term.t_kopen) +#define TTkclose (*term.t_kclose) +#define TTgetc (*term.t_getchar) +#define TTputc (*term.t_putchar) +#define TTflush (*term.t_flush) +#define TTmove (*term.t_move) +#define TTeeol (*term.t_eeol) +#define TTeeop (*term.t_eeop) +#define TTclrdesk (*term.t_clrdesk) +#define TTbeep (*term.t_beep) +#define TTrev (*term.t_rev) +#define TTrez (*term.t_rez) +#if COLOR +#define TTforg (*term.t_setfor) +#define TTbacg (*term.t_setback) +#endif + + /* Structure for the table of current key bindings */ + +ETYPE EPOINTER{ + int (PASCAL NEAR * fp)(); /* C routine to invoke */ + BUFFER* buf; /* buffer to execute */ +}; + +typedef struct { +#if UTF8 + unsigned int k_code; /* Key code */ +#else + short k_code; /* Key code */ +#endif + short k_type; /* binding type (C function or EMACS buffer) */ + ETYPE EPOINTER k_ptr; /* ptr to thing to execute */ +} KEYTAB; + +/* structure for the name binding table */ + +typedef struct { + char* n_name; /* name of function key */ + int (PASCAL NEAR* n_func)(); /* function name is bound to */ +} NBIND; + +/* The editor holds deleted text chunks in the KILL buffer. The + kill buffer is logically a stream of ascii characters, however + due to its unpredicatable size, it gets implemented as a linked + list of chunks. (The d_ prefix is for "deleted" text, as k_ + was taken up by the keycode structure) +*/ + +typedef struct KILL { + struct KILL* d_next; /* link to next chunk, NULL if last */ + char d_chunk[KBLOCK]; /* deleted text */ +} KILL; + +/* When emacs's command interpetor needs to get a variable's name, + rather than it's value, it is passed back as a VDESC variable + description structure. The v_num field is a index into the + appropriate variable table. +*/ + +typedef struct VDESC { + int v_type; /* type of variable */ + int v_num; /* ordinal pointer to variable in list */ + UTABLE* v_ut; /* ptr to appropriate user table if user var */ +} VDESC; + +/* The !WHILE directive in the execution language needs to + stack references to pending whiles. These are stored linked + to each currently open procedure via a linked list of + the following structure +*/ + +typedef struct WHBLOCK { + LINE* w_begin; /* ptr to !while statement */ + LINE* w_end; /* ptr to the !endwhile statement*/ + int w_type; /* block type */ + struct WHBLOCK* w_next; /* next while */ +} WHBLOCK; + +#define BTWHILE 1 +#define BTBREAK 2 + +/* SWORDs are syntactical words to highlight in a different + foreground color. WORDSETs are named lists of these WORDs. +*/ + +typedef struct SWORD { + struct SWORD* wd_next; /* ptr to the next word in the list */ + char* wd_text; /* the actual word */ + CLRVAL wd_color; /* color to display in */ + int wd_symflag; /* TRUE = symbol overiding word boundries + FALSE = word w/ space/symbol delimiters */ +} SWORD; + +typedef struct WORDSET { + struct WORDSET* next; + int tmp; +} WORDSET; + +/* Abbreviations are short symbols that expand to longer strings + when typed into a buffer with no intervening whitespace or commands. + This structure grows dynamically as needed. +*/ + +typedef struct ABBREV { + struct ABBREV* ab_next; /* pointer to the next abbreviation */ + char ab_sym[MAXSYM + 1]; /* name to expand */ + char ab_exp[1]; /* string to expand to */ +} ABBREV; + +/* Search definitions... */ + +/* HICHAR - 1 is the largest character we will deal with. + * BMAPSIZE represents the number of bytes in the bitmap. + */ +#if UTF8 +#define HICHAR 65536 +#else +#define HICHAR 256 +#endif +#define BMAPSIZE HICHAR >> 3 + + /* + * Jump table structures. + */ +typedef struct { + int jump; + int patlen; + int delta[HICHAR]; + char patrn[NPAT]; +} DELTA; + +#if MAGIC +/* + * Defines for the metacharacters in the regular expression + * search routines. MCNIL and GROUP are used in both search + * and replace metachar-arrays. + */ +#define MCNIL 0 /* Like the '\0' for strings.*/ +#define JMPTABLE 1 +#define LITSTRING 2 /* Literal string.*/ +#define LITCHAR 3 /* Literal character.*/ +#define ANY 4 /* Any character but the .*/ +#define CCL 5 +#define NCCL 6 +#define BOL 7 +#define EOL 8 +#define BOWRD 9 +#define EOWRD 10 +#define GRPBEG 11 /* Signal start of group.*/ +#define GRPEND 12 /* Signal end of group.*/ +#define GROUP 13 /* String of group match.*/ +#define DITTO 14 /* Replacement with match string.*/ + +#define CLOSURE 0x0100 /* An or-able value for a closure modifier.*/ +#define CLOSURE_1 0x0200 /* An or-able value for a closure modifier.*/ +#define ZEROONE 0x0400 /* An or-able value for a closure modifier.*/ + +#define ALLCLOS (CLOSURE | CLOSURE_1 | ZEROONE) +#define MASKCLO (~ALLCLOS) + +#define MC_ANY '.' /* 'Any' character (except newline).*/ +#define MC_CCL '[' /* Character class.*/ +#define MC_NCCL '^' /* Negate character class.*/ +#define MC_RCCL '-' /* Range in character class.*/ +#define MC_ECCL ']' /* End of character class.*/ +#define MC_BOL '^' /* Beginning of line.*/ +#define MC_EOL '$' /* End of line.*/ +#define MC_CLOSURE '*' /* Closure - zero to many characters match.*/ +#define MC_CLOSURE_1 '+' /* Closure - one to many characters match.*/ +#define MC_ZEROONE '?' /* Closure - zero to one characters match.*/ +#define MC_DITTO '&' /* Use matched string in replacement.*/ +#define MC_GRPBEG '(' /* Start of group (begun with a backslash).*/ +#define MC_GRPEND ')' /* End of group (begun with a backslash).*/ +#define MC_BOWRD '<' /* Beginning of word (begun with a backslash).*/ +#define MC_EOWRD '>' /* End of word (begun with a backslash).*/ +#define MC_ESC '\\' /* Escape - suppress meta-meaning.*/ + +#define MAXGROUPS 10 /* 1 + maximum # of r. e. groups. */ +#define BIT(n) (1 << (n)) /* An integer with one bit set.*/ + + /* Typedefs that define the bitmap type for searching (EBITMAP), + * the meta-character structure for MAGIC mode searching (MC), + * and the meta-character structure for MAGIC mode replacment (RMC). + */ +typedef char* EBITMAP; + +typedef struct { + short int mc_type; + union { + int lchar; + int group_no; + char* lstring; + DELTA* jmptable; + EBITMAP cclmap; + } u; +} MC; + +typedef struct { + short int mc_type; + union { + int group_no; + char* rstr; + } u; +} RMC; +#endif + +/* + This is the message which should be added to any "About MicroEMACS" + boxes on any of the machines with window managers. + + + ------------------------------------------ + | | + | MicroEMACS v4.xx | + | for the ............ | + | | + | Text Editor and Corrector | + | | + | written by Daniel M. Lawrence | + | [based on code by Dave Conroy] | + | | + | Send inquiries and donations to: | + | 617 New York St | + | Lafayette, IN 47901 | + | | + ------------------------------------------ +*/ diff --git a/xp/vs2017/memacs.sln b/xp/vs2017/memacs.sln index 98b33d7..da9341c 100644 --- a/xp/vs2017/memacs.sln +++ b/xp/vs2017/memacs.sln @@ -1,41 +1,41 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26403.3 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "memacs", "memacs.vcxproj", "{E5216D5D-1F3A-4E77-922B-ADC7FC5492D4}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmdfix", "cmdfix.vcxproj", "{DF861FD8-273A-44B0-BAE0-97B5BF73FC42}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E5216D5D-1F3A-4E77-922B-ADC7FC5492D4}.Debug|x64.ActiveCfg = Debug|x64 - {E5216D5D-1F3A-4E77-922B-ADC7FC5492D4}.Debug|x64.Build.0 = Debug|x64 - {E5216D5D-1F3A-4E77-922B-ADC7FC5492D4}.Debug|x86.ActiveCfg = Debug|Win32 - {E5216D5D-1F3A-4E77-922B-ADC7FC5492D4}.Debug|x86.Build.0 = Debug|Win32 - {E5216D5D-1F3A-4E77-922B-ADC7FC5492D4}.Release|x64.ActiveCfg = Release|x64 - {E5216D5D-1F3A-4E77-922B-ADC7FC5492D4}.Release|x64.Build.0 = Release|x64 - {E5216D5D-1F3A-4E77-922B-ADC7FC5492D4}.Release|x86.ActiveCfg = Release|Win32 - {E5216D5D-1F3A-4E77-922B-ADC7FC5492D4}.Release|x86.Build.0 = Release|Win32 - {DF861FD8-273A-44B0-BAE0-97B5BF73FC42}.Debug|x64.ActiveCfg = Debug|x64 - {DF861FD8-273A-44B0-BAE0-97B5BF73FC42}.Debug|x64.Build.0 = Debug|x64 - {DF861FD8-273A-44B0-BAE0-97B5BF73FC42}.Debug|x86.ActiveCfg = Debug|Win32 - {DF861FD8-273A-44B0-BAE0-97B5BF73FC42}.Debug|x86.Build.0 = Debug|Win32 - {DF861FD8-273A-44B0-BAE0-97B5BF73FC42}.Release|x64.ActiveCfg = Release|x64 - {DF861FD8-273A-44B0-BAE0-97B5BF73FC42}.Release|x64.Build.0 = Release|x64 - {DF861FD8-273A-44B0-BAE0-97B5BF73FC42}.Release|x86.ActiveCfg = Release|Win32 - {DF861FD8-273A-44B0-BAE0-97B5BF73FC42}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {E96024AE-E843-4A1F-AA0A-C8B59A903B0D} - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26403.3 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "memacs", "memacs.vcxproj", "{E5216D5D-1F3A-4E77-922B-ADC7FC5492D4}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cmdfix", "cmdfix.vcxproj", "{DF861FD8-273A-44B0-BAE0-97B5BF73FC42}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E5216D5D-1F3A-4E77-922B-ADC7FC5492D4}.Debug|x64.ActiveCfg = Debug|x64 + {E5216D5D-1F3A-4E77-922B-ADC7FC5492D4}.Debug|x64.Build.0 = Debug|x64 + {E5216D5D-1F3A-4E77-922B-ADC7FC5492D4}.Debug|x86.ActiveCfg = Debug|Win32 + {E5216D5D-1F3A-4E77-922B-ADC7FC5492D4}.Debug|x86.Build.0 = Debug|Win32 + {E5216D5D-1F3A-4E77-922B-ADC7FC5492D4}.Release|x64.ActiveCfg = Release|x64 + {E5216D5D-1F3A-4E77-922B-ADC7FC5492D4}.Release|x64.Build.0 = Release|x64 + {E5216D5D-1F3A-4E77-922B-ADC7FC5492D4}.Release|x86.ActiveCfg = Release|Win32 + {E5216D5D-1F3A-4E77-922B-ADC7FC5492D4}.Release|x86.Build.0 = Release|Win32 + {DF861FD8-273A-44B0-BAE0-97B5BF73FC42}.Debug|x64.ActiveCfg = Debug|x64 + {DF861FD8-273A-44B0-BAE0-97B5BF73FC42}.Debug|x64.Build.0 = Debug|x64 + {DF861FD8-273A-44B0-BAE0-97B5BF73FC42}.Debug|x86.ActiveCfg = Debug|Win32 + {DF861FD8-273A-44B0-BAE0-97B5BF73FC42}.Debug|x86.Build.0 = Debug|Win32 + {DF861FD8-273A-44B0-BAE0-97B5BF73FC42}.Release|x64.ActiveCfg = Release|x64 + {DF861FD8-273A-44B0-BAE0-97B5BF73FC42}.Release|x64.Build.0 = Release|x64 + {DF861FD8-273A-44B0-BAE0-97B5BF73FC42}.Release|x86.ActiveCfg = Release|Win32 + {DF861FD8-273A-44B0-BAE0-97B5BF73FC42}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E96024AE-E843-4A1F-AA0A-C8B59A903B0D} + EndGlobalSection +EndGlobal diff --git a/xp/vs2017/memacs.vcxproj b/xp/vs2017/memacs.vcxproj index 4b26fd5..90331c1 100644 --- a/xp/vs2017/memacs.vcxproj +++ b/xp/vs2017/memacs.vcxproj @@ -1,199 +1,192 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 15.0 - {E5216D5D-1F3A-4E77-922B-ADC7FC5492D4} - memacs - 10.0.17134.0 - memacs - - - - Application - true - v141 - MultiByte - - - Application - false - v141 - true - MultiByte - - - Application - true - v141 - MultiByte - - - Application - false - v141 - true - MultiByte - - - - - - - - - - - - - - - - - - - - - $(ProjectDir)..\..\h\;$(IncludePath) - - - $(ProjectDir)..\..\h\;$(IncludePath) - - - $(ProjectDir)..\..\h\;$(IncludePath) - - - $(ProjectDir)..\..\h\;$(IncludePath) - - - - Level3 - Disabled - false - - - - - Level3 - Disabled - false - - - - - Level3 - MaxSpeed - true - true - false - - - true - true - - - - - Level3 - MaxSpeed - true - true - false - - - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 15.0 + {E5216D5D-1F3A-4E77-922B-ADC7FC5492D4} + memacs + 10.0 + memacs + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + $(ProjectDir)..\..\h\;$(IncludePath) + + + $(ProjectDir)..\..\h\;$(IncludePath) + + + $(ProjectDir)..\..\h\;$(IncludePath) + + + $(ProjectDir)..\..\h\;$(IncludePath) + + + + Level3 + Disabled + false + .\ + + + + + Level3 + Disabled + false + .\ + + + + + Level3 + MaxSpeed + true + true + false + .\ + + + true + true + + + + + Level3 + MaxSpeed + true + true + false + .\ + + + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/xp/vs2017/memacs.vcxproj.filters b/xp/vs2017/memacs.vcxproj.filters index b4372a6..c93ae62 100644 --- a/xp/vs2017/memacs.vcxproj.filters +++ b/xp/vs2017/memacs.vcxproj.filters @@ -1,218 +1,185 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Source Files - - - Source Files - - + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Source Files + + + Source Files + + \ No newline at end of file diff --git a/xp/vs2017/memacs.vcxproj.user b/xp/vs2017/memacs.vcxproj.user new file mode 100644 index 0000000..0f14913 --- /dev/null +++ b/xp/vs2017/memacs.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file From 8676d4497049310cad0ff684c9323c8bf8168c62 Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 3 Sep 2020 19:14:49 +0200 Subject: [PATCH 19/37] Update to version 5.10 --- theos/estruct.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/theos/estruct.h b/theos/estruct.h index b67cedc..cd6f8bc 100644 --- a/theos/estruct.h +++ b/theos/estruct.h @@ -183,8 +183,11 @@ #if JMDEXT #define BACKUP 1 /* backup previous file version */ #define LIBHELP 1 /* online help from Mark Williams version */ -#define NEWVARS 1 /* other environment variables */ #define DYNMSGS 1 /* load messages according to current language */ +#define THEOX 0 /* allow TheoX character set files edition */ + /* including semi-graphics entry from numeric */ + /* keypad (require UTF8) */ +#define TXBASIC 0 /* TxBasic IDE menu */ #endif /* Character set options */ From ff73fd410d725e21f88271f4794d38e118e08917 Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 10 Sep 2020 19:16:43 +0200 Subject: [PATCH 20/37] Delete c.hlp --- cmd/c.hlp | 4628 ----------------------------------------------------- 1 file changed, 4628 deletions(-) delete mode 100644 cmd/c.hlp diff --git a/cmd/c.hlp b/cmd/c.hlp deleted file mode 100644 index acbbeca..0000000 --- a/cmd/c.hlp +++ /dev/null @@ -1,4628 +0,0 @@ -@_bios_keybrd -_bios_keybrd (MSVC) Return the keyboard status or keycode -#include -#include -unsigned short _bios_keybrd(unsigned short service) -See also: mapdoskey -@_errarg -_errarg (THEOS) Variable used by error message functions -#include -extern char *_errarg; -See also: strerror -@_errnum -_errnum (THEOS) External integer for return of error status -#include -extern short _errnum; -Functions setting _errnum: access,chdir,clearerr,diropen,erase,fclear,fclose, -fcreate,fopen and derivates,getmsg,mkdir,open,remove,rename,rmdir,topen,unlink -See also: errno,fperror -@_incrmem -_incrmem (THEOS) ??? -#include -char *_incrmem(size_t len); -@_mfg_get_date -_mfg_get_date (THEOS) Copy hardware date into the nuc structure -#include -void _mfg_get_date(void); -See also: _mfg_get_time,_mfg_put_date,_mfg_put_time -@_mfg_get_time -_mfg_get_time (THEOS) Copy hardware time into the nuc structure -#include -void _mfg_get_time(void); -See also: _mfg_get_date,_mfg_put_date,_mfg_put_time -@_mfg_init -_mfg_init (THEOS) Initialise system hardware -#include -long _mfg_init(long addr,long *store); -@_mfg_put_date -_mfg_put_date (THEOS) Copy date from the nuc structure to hardware -#include -void _mfg_put_date(void); -See also: _mfg_get_date,_mfg_get_time,_mfg_put_time -@_mfg_put_time -_mfg_put_time (THEOS) Copy time from the nuc structure to hardware -#include -void _mfg_put_time(void); -See also: _mfg_get_date,_mfg_get_time,_mfg_put_date -@_mfg_reserved -_mfg_reserved (THEOS) ??? -#include -void _mfg_reserved(void) -@_monthen -_monthen (THEOS) Return the number of days in a month -#include <_time.h> -short _monthen(short year,short month); -See also: leapyear,_yday -@_msec_off -_msec_off (THEOS) Turn off millisecond timing -#include -void _msec_off(void); -See also: msec_on -@_msec_on -_msec_on (THEOS) Turn on millisecond timing -#include -void _msec_on(void); -See also: msec_off -@_read -_read (THEOS) Read data from a file into any segment -#include -size_t _read(short fd,unsigned seg,void *buf,size_t len); -See also: close,creat,filelength,flush,lseek,open,read,tell,_write,write -@_rsvmem -_rsvmem (THEOS) ??? -#include -short *_rsvmem(long addr,long len,short code); -@_sched_int -_sched_int (THEOS) Schedule interrupt -#include -void _sched_int(short num,short (*addr)()); -@_set_slice -_set_slice (THEOS) Set the user time slice -#include -void _set_slice(short msec); -@_sema_isr -_sema_isr (THEOS) ??? -#include -_sema_isr(short pid,short num,short cmd); -@_setargv -_setargv (+THEOS) Expand wild cards argument to the list of matching files -#include <_stdlib.h> -short _setargv(short *pargc, char ***pargv); -Set : errno -@_sync -_sync (THEOS) Flush the cache -#include -void _sync(short code); -@_weekday -_weekday (THEOS) Return the number of the day in the week -#include <_time.h> -See also: leapyear,_monthen,_yday -@_write -_write (THEOS) Write data to a file from another memory segment -#include -size_t _write(short fd,unsigned seg,void *buf,size_t len); -See also: close,creat,filelength,flush,lseek,open,_read,read,tell,write -@_yday -_yday (THEOS) Return the number of days since the beginning of the year -@a64l -a64l (UNIX) Convert a number from a base-64 ASCII string to a long integer -#include -long a64l(const char *s); -See also: l64a -@abort -abort (ANSI) End program immediately -#include -void abort(void); -See also: exit -@abs -abs (ANSI) Return the absolute value of an integer -#include -short abs(short n); -See also: fabs -@access -access (UNIX) Check if a file can be accessed in a given mode -#include -short access(const char *filename,short mode); -mode : 0 existence, 1 execution, 2 write, 4 read -Set : errno,_errnum -See also: fperror,strerror -@acos -acos (ANSI) Calculate arc cosine -#include -double acos(double x); -@acot -acot (THEOS) Calculate arc cotangent -#include -double acot(double x); -@acsc -acsc (THEOS) Calculate arc cosecant -#include -double acsc(double x); -Set : errno -@addb -addb (THEOS) Add a value to a byte in another memory segment -#include -void addb(void *ofs,unsigned seg,char val); -See also: Other add functions -@addcs -addcs (THEOS) Add a value to a byte in the code segment -#include -void addcs(void *ofs,char val); -See also: Other add functions -@addl -addl (THEOS) Add a value to a long in another memory segment -#include -void addl(void *ofs,unsigned seg,long val); -See also: Other add functions -@addlcs -addlcs (THEOS) Add a value to a long in the code segment -#include -void addlcs(void *ofs,long val); -See also: Other add functions -@addw -addw (THEOS) Add a value to a word in another memory segment -#include -void addw(void *ofs,unsigned seg,short val); -See also: Other add functions -@addwcs -addwcs (THEOS) Add a value to a word in the code segment -#include -void addwcs(void *ofs,short val); -See also: Other add functions -@alarm -alarm (UNIX) Start a timer in seconds generating a signal interrupt -#include -short alarm(short secs); -See also: delay,msalarm,signal -@andb -andb (THEOS) And a value to a byte in another memory segment -#include -void andb(void *ofs,unsigned seg,char mask); -See also: Other and functions -@andcs -andcs (THEOS) And a value to a byte in the code segment -#include -void andcs(void *ofs,char mask); -See also: Other and functions -@andl -andl (THEOS) And a value to a long in another memory segment -#include -void andl(void *ofs,unsigned seg,long mask); -See also: Other and functions -@andlcs -andlcs (THEOS) And a value to a long in the code segment -#include -void andlcs(void *ofs,long mask); -See also: Other and functions -@andw -andw (THEOS) And a value to a word in another memory segment -#include -void andw(void *ofs,unsigned seg,short mask); -See also: Other and functions -@andwcs -andwcs (THEOS) And a value to a word in the code segment -#include -void andwcs(void *ofs,short mask); -See also: Other and functions -@asctime -asctime (ANSI) Convert time structure to ASCII string -#include -char *asctime(const struct tm *tmp); -See also: ctime,gmtime,localtime,mktime,strftime,time -@asec -asec (THEOS) Calculate arc secant -#include -double asec(double x); -Set : errno -@asin -asin (ANSI) Calculate inverse sine -#include -double asin(double x); -Set : errno -@assert -assert (ANSI) Check assertion at run time -#include -void assert(short expression); -@assert -#assert (ANSI) Check assertion at compile time -#assert expression -@at -at (THEOS) Position the cursor on the console -#include -void at(short x,short y); -See also: putch -@atan -atan (ANSI) Calculate inverse tangent -#include -double atan(double x); -@atan2 -atan2 (ANSI) Calculate inverse tangent -#include -double atan2(double num,double den); -Set : errno -@atexit -atexit (ANSI) Specifie a routine to call at normal exit time -#include -short atexit(void (*func)(void)); -See also: exit -@atof -atof (ANSI) Convert ASCII string to floating point -#include -double atof(const char *string); -See also: ftoa,strtod -@atoi -atoi (ANSI) Convert ASCII string to integer -#include -short atoi(const char *string); -Set : errno -See also: itoa -@atol -atol (ANSI) Convert ASCII string to long integer -#include -long atol(const char *string); -Set : errno -See also: ltoa,strtol,strtoul,ultoa -@bcd2ieee -bcd2ieee (THEOS) Convert a bcd floating point to ieee floating point -#include -void bcd2ieee(double *data); -See also: ieee2bcd -@bsearch -bsearch (ANSI) Perform a binary search in a sorted array -#include -void *bsearch(const void *key,const void *array,size_t nbr_mbr,size_t size, - short (*compar)(const void *,const void *)); -See also: lfind,lsearch,qsort -@c3tol -c3tol (ANSI) Convert a three byte integer to a long integer -#include -long c3tol(const void *c); -See also: l3tol,ltoc3,ltol3 -@cabs -cabs (UNIX) Complex absolute value function -#include -double cabs(struct complex z); -@callcsi -callcsi (THEOS) See system -@calloc -calloc (ANSI) Allocate dynamic memory -#include -char *calloc(size_t count,size_t size); -See also: free,malloc,memset,realloc -@cclose -cclose (+THEOS) Close a serial communication file -#include -short cclose(FILE *port) -See also: ccloseall,cgetc,cputc,csetbuf,csetvbuf,getrxcnt,isrxempty,istxfull -@ccloseall -ccloseall (+THEOS) Close all serial communication files -#include -short ccloseall(void) -See also: cclose,cgetc,cputc,csetbuf,csetvbuf,getrxcnt,isrxempty,istxfull -@ceil -ceil (UNIX) Return the smallest integer greater than or equal to a value -#include -double ceil(double z); -See also: floor, round -@cgetc -cgetc (+THEOS) Read a character from a communication file -#include -short cgetc(FILE *port); -See also: cclose,ccloseall,cputc,csetbuf,csetvbuf,getrxcnt,isrxempty,istxfull -@cgets -cgets (ANSI) Accept a string from the console -#include -char *cgets(char *buffer,short len); -See also: getch,fgets,gets -@chdir -chdir (UNIX) Change the current directory -#include -short chdir(const char *path); -Set : errno,_errnum -See also: mkdir,rmdir -@chgrow -chrow (+THEOS) Set the grow factor of file -#include <_io.h> -short chgrow(char *fname,short grow); -See also: filechange -@chlen -chlen (+THEOS) Change the record length and key length of a file -#include <_io.h> -short chlen(char *fname,unsigned short reclen,unsigned short keylen); -@chmod -chmod (+UNIX) Change protections of a file -#include <_io.h> -short chmod(const char *fname,short prot); -@chorg -chorg (+THEOS) Change the organization mode of a file -#include <_io.h> -short chorg(char *fname,unsigned short filestat); -@chown -chown (+UNIX) Change the owner of a file -#include <_io.h> -short chown(const char *fname,short uid,short gid); -@clearerr -clearerr (ANSI) Clear the end-of-file and error status of a file -#include -clearerr(FILE *fp); -Set : _errnum -See also: feof,ferror -@cld -cld (THEOS) Clear direction flag -#include -void cld(void); -See also: std -@cli -cli (THEOS) Clear interrupt -#include -void cli(void); -See also: sti -@clock -clock (ANSI) Get number of clock ticks since system boot -#include -clock_t clock(void); -See also: time -@clock_t -clock_t (ANSI) Type used for the number of clock ticks since system boot -#include -typedef long clock_t; -@close -close (UNIX) Close a file -#include -short close(short fd); -See also: creat,filelength,flush,lseek,open,_read,read,tell,_write,write -@closedir -closedir (+UNIX) Close the directory search -#include -void closedir(DIR*); -See also: opendir,readdir,seekdir,telldir,rewinddir -Set : errno -@con_tran -con_tran (THEOS) Test and translate system control codes -#include -short con_tran(struct ucb *ucb,short ch,unsigned seg,void *buf); -@conmask -conmask (THEOS) Set the console control mask -#include -void conmask(const char *s); -@conin -conin (THEOS) Read character from console -See getch -@conout -conout (THEOS) Display character on the console -See putch -@conrdy -conrdy (THEOS) Test if characters are available on the console -short conrdy(void); -@cos -cos (ANSI) Calculate cosine -#include -double cos(double radian); -Set : errno -@cosh -cosh (ANSI) Calculate hyperbolic cosine -#include -double cosh(double radian); -@cot -cot (THEOS) Calculate cotangent -#include -double cot(double radian); -@coth -coth (THEOS) Calculate hyperbolic cotangent -#include -double coth(double radian); -@cprintf -cprintf (MSC) Format and print text to the console -#include -short cprintf(const char *format,...); -Note: Floating point conversions are not supported -See also: fprintf,printf,sprintf,vfprintf,vprintf,vsprintf -@cputc -cputc (+THEOS) Write a character to a communication file -#include -void cputc(FILE *port,short c); -See also: cclose,ccloseall,cgetc,csetbuf,csetvbuf,getrxcnt,isrxempty,istxfull -@cputs -cputs (ANSI) Write a string to the console -#include -void cputs(const char *s); -See also: cprintf,fputs,printf,putch,puts -@creat -creat (UNIX) Create/truncate a file -#include -short creat(const char *filename,short mode); -See also: close,filelength,flush,lseek,open,_read,read,tell,write,_write -@crt -crt (THEOS) See putchar -@crtcolor -crtcolor (THEOS) Change the colors of subsequent displays on the console -#include -void crtcolor(short fg,short bg,short rfg,short rbg); -See also: hascolor,CLASSGEN command -@csc -csc (THEOS) Calculate cosecant -#include -double csc(double radian); -@csch -csch (THEOS) Calculate hyperbolic cosecant -#include -double csch(double radian); -@csetbuf -csetbuf (+THEOS) Allocate an i/o buffer for a user buffered file -#include -void csetbuf(FILE *port,UBUFFER *buffer); -See also: cclose,ccloseall,cgetc,cputc,csetvbuf,getrxcnt,isrxempty,istxfull -@csetvbuf -csetvbuf (+THEOS) Allocate an i/o buffer for a user buffered file -#include -short csetvbuf(FILE *port,UBUFFER *buffer,short mode,size_t size); -See also: cclose,ccloseall,cgetc,cputc,csetbuf,getrxcnt,isrxempty,istxfull -@csi -csi (THEOS) Execute a CSI command without returning to the current program -#include -void csi(const char *command); -See also: system -@ctime -ctime (ANSI) Convert system time to an ASCII string -#include -char *ctime(const time_t *timep); -See also: asctime,localtime,mktime,strftime,time -@cuserid -cuserid (THEOS) Return the account name currently logged -#include -char *cuserid(char *account); -See also: getlogin,getuid,logname -@datehdng -datehdng (THEOS) Internal function used by testhead -@daylight -daylight (ANSI) Variable indicating if daylight time is used -#include -extern short daylight; -See also: timezone,tzset,tzname -@dec -dec (THEOS) Decrement a byte in another memory segment -#include -void dec(void *ofs,unsigned seg); -See also: Other dec functions -@deccs -deccs (THEOS) Decrement a byte in the code segment -#include -void deccs(void *ofs); -See also: Other dec functions -@deccsl -deccsl (THEOS) Decrement a long in the code segment -#include -void deccsl(void *ofs); -See also: Other dec functions -@deccsw -deccsw (THEOS) Decrement a word in the code segment -#include -void deccsw(void *ofs); -See also: Other dec functions -@decl -decl (THEOS) Decrement a long in another memory segment -#include -void decl(void *ofs,unsigned seg); -See also: Other dec functions -@decw -decw (THEOS) Decrement a word in another memory segment -#include -void decw(void *ofs,unsigned seg); -See also: Other dec functions -@define -#define (ANSI) Define a variable as manifest constant -#define constant value -@delay -delay (THEOS) Suspend operation for a given time -#include -void delay(unsigned code); -See also: alarm,msalarm,sleep -@deletek -deletek (THEOS) Delete a record from on indexed or keyed file -#include -short deletek(FILE *file,const char *key); -See also: readk,readn,readp,writek -@devname -devname (+THEOS) Return the name of a physical device -#include <_stdio.h> -char* devname(int lub); -See also: termname,ttyname,vdiname -@devopen -devopen (THEOS) Open or close a device -#include <_sc.h> -void devopen(struct ucb *ucb,short cmd); -cmd = 0 : open. cmd = 1 : close -@difftime -difftime (ANSI) Return difference between two times -#include -double difftime(time_t newtime,time_t oldtime); -@dir_mount -dir_mount (THEOS) ??? -#include <_sc.h> -void dir_mount(struct diskucb *ucb); -@dir_rd -dir_rd (THEOS) Read a sector in the directory -#include -void dir_rd(struct diskucb *ucb,long sect,void *buf); -@dirclose -dirclose (THEOS) Close the directory search -#include -void dirclose(void); -See also: diropen,dirread,find_first,find_next -@diropen -diropen (THEOS) Open the directory search for files in the current account -#include -short diropen(const char *fn); -Set : _errnum -See also: dirclose,dirread,find_first,find_next -@dirread -dirread (THEOS) Find the next file in the directory -#include -char *dirread(void); -See also: dirclose,diropen,find_first,find_next -@disk_capacity -disk_capacity (THEOS) ??? -#include <_sc.h> -short disk_capacity(short lub,void *disk_struct); -@display -display (THEOS) Display a string on the console -See cputs -@div -div (ANSI) Return the quotient and remainder of the division of two integers -#include -div_t div(short numer,short denomin); -See also: ldiv -@div_t -div_t (ANSI) Used by div -#include -typedef struct {short quot,rem;} div_t; -@dup -dup (UNIX) Duplicate a file descriptor -#include -short dup(short fd); -Set : errno -See also: close,creat,open -@elif -#elif (ANSI) Include code conditionally -#elif (expression); -@else -#else (ANSI) Include code conditionally -#else -@endif -#endif (ANSI) End conditional inclusion of code -#endif -@erase -erase (THEOS) Erase an existing file -See remove -@errbot -errbot (THEOS) Display a system message at the bottom of the console -#include -short errbot(short num,const char *arg[],short c1,short c2,short c3,short c4); -See also: errmsg,putmsg,syserr,yesno -@errmsg -errmsg (THEOS) Display a system message on stderr -#include -void errmsg(short num,const char *arg[]); -See also: errbot,perror,putmsg,strerror,syserr -@errno -errno (ANSI) External integer for return of error status -#include -extern short errno; -Functions setting errno: access,acos,acsc,asec,asin,atan2,atoi,atol,chdir,cos, -dup,erase,fgetc,fputc,fstat,locking,log,log10,log2,mkdir,open,perror,pow,remove, -rename,rmdir,signal,sin,sqrt,stat,unlink,utime -See also: _errnum,perror -@execl -execl (UNIX) Transfer control to a new program -#include -void execl(const char *program,const char *arg0,...,const char *argn,NULL) -See also: execlp,execv,execvp,forktask,system -@execlp -execlp (UNIX) Transfer control to a new program -#include -void execlp(const char *program,const char *arg0,...,const char *argn,NULL) -See also: execl,execv,execvp,forktask,system -@execv -execv (UNIX) Transfer control to a new program -#include -void execv(const char *program,const char *arg[]); -See also: execl,execlp,execvp,forktask,system -@execvp -execvp (UNIX) Transfer control to a new program -#include -void execvp(const char *program,const char *arg[]); -See also: execl,execlp,execv,forktask,system -@exit -exit (ANSI) Terminate a program -#include -void exit(short status); -See also: abort,atexit,csi -@exp -exp (ANSI) Compute exponential function -#include -double exp(double z); -@fabs -fabs (ANSI) Compute absolute value -#include -double fabs(double z); -@farcat -farcat (THEOS) Concatenate strings from different memory segments -#include -void *farcat(unsigned tseg,char *to,unsigned fseg,const char *from); -See also: strcat -@farchr -farchr (THEOS) Locate the first occurence of a byte in a string -#include -void *farchr(unsigned seg,const void *ofs,short c); -See also: memchr,strpbrk,strchr,strrchr,strstr -@farcmp -farcmp (THEOS) Compare two buffers in different memory segments -#include -short farcmp(unsigned seg1,const void *ofs1,unsigned seg2,const void *ofs2, - size_t len); -See also: fareq,memcmp,memeq,memicmp,strcmp,streq,stricmp,strncmp,strneq, - strnicmp -@farcpy -farcpy (THEOS) Copy one buffer to another buffer in another memory segment -#include -short farcpy(unsigned tseg,void *to,unsigned fseg,const void *from,size_t len); -See also: farcpy,memccpy,memcpy,memmove,memrcpy,strdup,strmake,strncpy -@fareq -fareq (THEOS) Compare two string in different memory segments for equality -#include -short fareq(unsigned seg1,const void *ofs1,unsigned seg2,const void *ofs2); -See also: farcmp,memcmp,memeq,memicmp,strcmp,streq,stricmp,strncmp,strneq, - strnicmp -@farlen -farlen (THEOS) Return the length of a string in another memory segment -#include -size_t farlen(unsigned seg,const char *ofs); -See also: strlen -@farset -farset (THEOS) Initialize a buffer in another memory segment -#include -void *farset(unsigned seg,void *ofs,short c,size_t len); -See also: memset,strnfill,strnset,strset -@fbuf -fbuf (THEOS) Allocate an i/o buffer for an open file -#include -void fbuf(FILE *stream,void *buffer,size_t len); -See also: setbuf,setvbuf,vbuf -@fclear -fclear (+THEOS) Clear a direct,indexed or keyed file -#include <_stdio.h> -short fclear(char *fname); -Set : _errnum -@fclose -fclose (ANSI) Close a file -#include -short fclose(FILE *fp); -Set : _errnum -See also: fcloseall,fflush,flushall -@fcloseall -fcloseall (MSC) Close all the open files -#include -short fcloseall(void); -See also: fclose,fflush,flushall -@fcntl -fcntl (UNIX) Access to file control bloc -#include -short fcntl(FILE *stream,short type,size_t value); -See also: feof,fgetpos,fopen,fsetpos,ftell -@fcreate -fcreate (THEOS) Create an indexed,keyed or direct file -#include -short fcreate(const char *fname,const char *mode,short rlen,short klen,long size); -Set : _errnum -See also: creat,fopen,makelib -@fdopen -fdopen (UNIX) Return a stream pointer to a file opened by open,creat or pipe -#include -FILE *fdopen(short fd,const char *type); -See also: creat,fileno,open,pipe -@feof -feof (ANSI) Determine if a file's current position is at end-of-file -#include -short feof(FILE *fp); -@ferror -ferror (ANSI) Test an open file for its error status -#include -short ferror(FILE *fp); -See also: clearerr,feof,file_err,fperror -@fflush -fflush (ANSI) Write any data in a file's output buffer to the file -#include -short fflush(FILE *fp); -See also: flushall,fclose -@fgetc -fgetc (ANSI) Read one character from a stream -#include -short fgetc(FILE *fp); -Set : errno -See also: fgets,getch,getchar -@fgetl -fgetl (THEOS) Read a long integer from a stream -#include -long fgetl(FILE *fp); -See also: fgetc,fgetw,fputc,fputl,fputw -@fgetpos -fgetpos (ANSI) Get a file's current position pointer -#include -short fgetpos(FILE *fp,fpos_t *pos); -See also: fsetpos,ftell -@fgets -fgets (ANSI) Read a string from a stream up to a new line -#include -char *fgets(char *s,size_t n,FILE *fp); -See also: fgetsn,gets,keyin -@fgetsn -fgetsn (THEOS) Read a buffer from a stream -#include -char *fgetsn(char *s,size_t n,FILE *fp); -See also: fgets,gets,keyin -@fgetw -fgetw (THEOS) Read an integer from a stream -#include -short fgetw(FILE *fp); -See also: fgetc,fgetl,fputc,fputl,fputw -@fgrow -fgrow (THEOS) Set the grow factor of file -#include -short fgrow(FILE *fp,short grow); -See also: filechange -@file_err -file_err (THEOS) Test an open file and exit if error -#include -void file_err(FILE *fp); -See also: clearerr,feof,ferror,fperror,syserr -@filechange -filechange (THEOS) Change a file's directory entry (date,owner,protection...) -#include -short filechange(const char *fn,short type,size_t value); -See also: access,fgrow,utime -@filelength -filelength (+MSC) Return the current filelength -#include <_io.h> -size_t filelength(short fd); -See also: close,creat,flush,lseek,open,_read,read,tell,_write,write -@filelock -filelock (THEOS) Lock a region in a file -#include -short filelock(FILE *fp,short code,unsigned long from,unsigned long to); -See also: locking,reclock,recunlock,unlock -@fileno -fileno (UNIX) Get the file number of a open file -#include -short fileno(FILE *fp); -@find_first -find_first (MSC) Find first entry matching selection in the directory -short find_first(char *mask,void *diskfind); -See also: dirclose,diropen,dirread,find_next -@find_next -find_next (MSC) Find next entry matching selection in the directory -#include <_sc.h> -short find_next(void *diskfind); -See also: dirclose,diropen,dirread,find_first -@floor -floor (ANSI) Return the largest integer less than or equal to a value -#include -double floor(double z); -See also: ceil, round -@flush -flush (THEOS) Write any data in a file's output buffer to the file -#include -short flush(short filenum); -See also: close,creat,filelength,lseek,open,_read,read,tell,_write,write -@flushall -flushall (THEOS) Flush all the files opened for output -#include -short flushall(void); -See also: fflush -@fmod -fmod (ANSI) Return the remainder of a division -#include -double fmod(double x,double y); -@fopen -fopen (ANSI) Open a file -#include -FILE *fopen(const char *name,const char *type); -Set : _errnum -See also: access,freopen -@force -force (THEOS) Force another process to execute a command -#include -void force(short pid,char *cmd); -@fork -fork (UNIX) Spawn a sub-task in a free partition -#include -short fork(void); -See also: forktask,killtask,suicide -@forktask -forktask (UNIX) Spawn a sub-task in a given partition -short forktask(short pid); -See also: fork,killtask,suicide -@formask -formask (THEOS) Display disk format parameters and query -#include -void formask(void); -See also: formclear,formincr,formparm -@formclear -formclear (THEOS) Clear the disk directory -void formclear(struct diskucb *ucb,char *label,short dirct,short trkct, - short hdct,short sectct,short density); -See also: formask,formincr,formparm -@formincr -formincr (THEOS) Set disk format sectors interleave table -void formincr(short incr,short sects,short *lacetable); -See also: formask,formclear,formparm -@formparm -formparm (THEOS) Sets disk format parameters from command line -void formparm(short argc,char **argv); -See also: formask,formclear,formincr -@fperror -fperror (THEOS) Display the system message pointed by _errnum on stderr -#include -short fperror(); -See also: errmsg,file_err,perror,syserr -@fpos_t -fpos_t (ANSI) Used to represent the position in a file -#include -typedef long fpos_t; -@fprintf -fprintf (ANSI) Print formatted output to a stream -#include -short fprintf(FILE *fp,const char *format,...); -See also: cprintf,printf,sprintf,vfprintf,vprintf,vsprintf -@fputc -fputc (ANSI) Write a character to a stream -#include -short fputc(char c,FILE *fp); -Set : errno -See also: putc,putchar -@fputl -fputl (THEOS) Write a character to a stream -#include -long fputl(long l,FILE *fp); -See also: fgetc,fgetl,fgetw,fputc,fputw -@fputs -fputs (ANSI) Write a string to a stream -#include -short fputs(const char *string,FILE *fp); -See also: fputsn,fputsnl,puts -@fputsn -fputsn (THEOS) Write a buffer to a stream -#include -char *fputsn(const char *string,FILE *fp); -See also: fputs,fputsnl,puts -@fputsnl -fputsnl (ANSI) Write a buffer to a stream and append a newline -#include -short fputsnl(const char *string,FILE *fp); -See also: fputs,fputsn,puts -@fputw -fputw (THEOS) Write an integer to a stream -#include -short fputw(short word,FILE *fp); -@fread -fread (ANSI) Read data from file stream -#include -short fread(void *buffer,size_t size,size_t nitems,FILE *fp); -See also: fgets,fgetsn,fgetc,fgetl,fgetw -@free -free (ANSI) Return dynamic memory to free memory pool -#include -void free(void *ptr); -See also: calloc,malloc,realloc -@free_sel -free_sel (THEOS) Release a memory selector -#include -void free_sel(short sel); -See also: make_sel -@freopen -freopen (ANSI) Open a stream using an existing file stream pointer -#include -FILE *freopen(const char *filename,const char *type,FILE *fp); -See also: access,fdopen,fopen -@frexp -frexp (ANSI) Break a floating point into mantissa and exponent power of two -#include -double frexp(double x,short *ep); -See also: ldexp -@fscanf -fscanf (ANSI) Format input from a file stream -#include -short fscanf(FILE *fp,const char *format,...); -See also: scanf,sscanf -@fseek -fseek (ANSI) Change a stream position pointer -#include -short fseek(FILE *fp,fpos_t pos,short base); -See also: fsetpos,rewind,seek -@fsetpos -fsetpos (ANSI) Change a stream position pointer -#include -short fsetpos(FILE *fp,fpos_t pos); -See also: fseek,rewind,seek -@fsign -fsign (THEOS) Return the sign of a floating point value -#include -short fsign(double x); -@ftell -ftell (ANSI) Return current position of stream pointer -#include -long ftell(FILE *fp); -See also: fgetpos -@ftoa -ftoa (THEOS) Convert a floating point value to a string -#include -char *ftoa(char *s,double f); -See also: itoa,ltoa,utoa -@fwrite -fwrite (ANSI) Write data to a stream -#include -short fwrite(const void *buffer,size_t size,size_t n,FILE *fp); -See also: fputc,fputl,fputs,fputsn,fputsnl,fputw,putch -@gcd -gcd (THEOS) Return the greatest common divisor of two values -#include -double gcd(double x,double y); -@get_line -get_line (THEOS) Accept an edited line from the standard input -#include -char *get_line(char *line); -See also: gets -@get_sect -get_sect (THEOS) ??? -#include -struct fdb *get_sect(char *fn,char *buf,long *sect); -@getar -getar (THEOS) Internal function used by malloc -@getbp -getbp (THEOS) Return the value of the BP register -#include -void *getbp(void); -See also: getcs,getcsa,getds,getldt,gettib -@getc -getc (ANSI) Read a character from a stream -See fgetc -@getch -getch (MSC) Read a character from the console -#include -short getch(void); -See also: getc,getchar -@getchar -getchar (ANSI) Read character from the standard input -#include -short getchar(void); -See also: getc,getch -@getclass -getclass (THEOS) Return the console or printer class code -#include -short getclass(short lub); -@getcs -getcs (THEOS) Return the value of the CS register -#include -unsigned getcs(void); -See also: getbp,getcsa,getds,getldt,gettib -@getcsa -getcsa (THEOS) Return the value of the CS register -#include -unsigned getcsa(void); -See also: getbp,getcs,getds,getldt,gettib -@getcwd -getcwd (UNIX) Return the current directory name -#include -char *getcwd(char *s,size_t len); -@getdate -getdate (THEOS) Return the current system date -#include -char *getdate(char *buffer) -See also: gettime,time -@getdev -getdev (THEOS) Return the device or lub number of an open file -#include -short getdev(FILE *fp); -@getdevn -getdevn (+THEOS) Return the device or lub number of a device name -#include <_stdlib.h> -short getdevn(char *name); -@getds -getds (THEOS) Return the value of the DS register -#include -unsigned getds(void); -See also: getbp,getcs,getcsa,getldt,gettib -@getenv -getenv (ANSI) Read environmental variable -#include -char *getenv(const char *variable); -See also: getcwd,getlang,getlib,putenv -@getenvle -getenvle (THEOS) Internal function used by putenv -@getflag -getflag (THEOS) Get processor flag register -#include -long getflag(void); -@getfn -getfn (THEOS) Return the full pathname of a file -#include -char *getfn(char *fn); -See also: locate -@getkey -getkey (THEOS) Get a system keyword token -#include -short getkey(short keynum,char *s); -See also: keyclose,matcharg -@getlang -getlang (THEOS) Return the current language code for the partition -#include -short getlang(void); -See also: getenv -@getldt -getldt (THEOS) Return the Local Descriptor Table selector -#include -unsigned getldt(void); -See also: getbp,getcs,getcsa,getds,gettib -@getlib -getlib (THEOS) Return the default library name for the partition -#include -char *getlib(void); -See also: getcwd,getenv -@getlimit -getlimit (THEOS) Return the maximum address of a memory segment -#include -size_t getlimit(unsigned seg); -See also: getmem -@getll -getll (THEOS) Return the line length of the console or a printer -#include -short getll(short lub); -See also: getpl -@getlogin -getlogin (UNIX) Return the name of the account currently logged -#include -char *getlogin(void); -See also: cuserid,getuid,logname -@getlub -getlub (THEOS) Return the ucb number associated with a logical device -#include -short getlub(short lub); -See also: getucb -@getmem -getmem (THEOS) Allocate memory from the system pool -#include -unsigned getmem(size_t size,short table); -See also: calloc,malloc,putmem,shared -@getmsec -getmsec (THEOS) Return the current time of day to the nearest millisecond -#include -char *getmsec(char *s); -See also: gettime,ctime,time -@getmsg -getmsg (THEOS) Return a system message -#include -char *getmsg(short num); -Set : _errnum -See also: errbot,errmsg,putmsg,strerror,syserr -@getmsw -getmsw (THEOS) Get Machine Status Word -#include -long getmsw(void); -@getpid -getpid (UNIX) Return the process number -#include -short getpid(void); -See also: getppid -@getpl -getpl (THEOS) Return the page length of the console or a printer -#include -short getpl(short lub); -See also: getll -@getppid -getppid (UNIX) Return the parent partition number -#include -short getppid(void); -See also: getpid -@getpriv -getpriv (THEOS) Return the privilege level -#include -short getpriv(void); -@getprty -getprty (+THEOS) Return task priority -#include <_stdlib.h> -short getprty(); -See also: setprty -@getrxcnt -getrxcnt (+THEOS) Return the number of characters in the input buffer -#include -short getrxcnt(FILE *port); -See also: cclose,ccloseall,cgetc,cputc,csetbuf,csetvbuf,isrxempty,istxfull -@gets -gets (ANSI) Read string from the standard input -#include -char *gets(char *buffer); -See also: fgets,fgetsn,get_line,keyin -@gettib -gettib (THEOS) Return the Task Information Block selector -#include -unsigned gettib(void); -See also: getbp,getcs,getcsa,getds,getldt,tib -@gettime -gettime (THEOS) Return the current system time -#include -char *gettime(char *buffer); -See also: getdate,time -@getucb -getucb (THEOS) Return the address of the UCB associated with an attached device -#include -struct ucb *getucb(short lub); -See also: getlub -@getuid -getuid (UNIX) Return the number of the account currently logged -#include -short getuid(void); -See also: getlogin -@getver -getver (THEOS) Return the version number,name,serial number -#include -void getver(short code,char *str); -See also: getenv -@getvol -getvol (THEOS) Return a disk or tape volume label -#include -char *getvol(short lub); -@getw -getw (ANSI) Read a word from a file stream -See fgetw -@gmtime -gmtime (ANSI) Convert system time to calendar structure in GMT time -#include -struct tm *gmtime(const time_t *timep); -See also: asctime,ctime,localtime,mktime,strftime,time -@has -has (THEOS) Test if the console can display a character or an attribute -#include -short has(short c); -See also: hascolor -@hascolor -hascolor (THEOS) Test if the console can display colors -#include -short hascolor(void); -See also: crtcolor,has -@hasmouse -hasmouse (+THEOS) Test if a session mouse is available -#include -int hasmouse(void); -See also: mouse, mousebutton, mouseclick, mousedisable, mouseenable, - mousemove, mousescale, mouseswap, mousetell, mousexy -@hypot -hypot (UNIX) Compute the length of the hypotenuse of a right triangle -#include -double hypot(double x,double y); -@i2tol -i2tol (THEOS) Convert two integers to a long integer -long i2tol(short i[2]); -Note: Not implemented in THEOS 386 C. -@ieee2bcd -ieee2bcd (THEOS) Convert an ieee floating point to bcd floating point -#include -void ieee2bcd(double *data) -See also: bcd2ieee -@if -#if (ANSI) Include code conditionally -#if (expression); -@ifdef -#ifdef (ANSI) Include code conditionally -#ifdef identifier -@ifndef -#ifndef (ANSI) Include code conditionally -#ifndef identifier -@inb -inb (THEOS) Read a byte from a i/o port -#include -unsigned inb(unsigned port); -See also: ind,insb,insd,insw,inw -@include -#include (ANSI) Copy a header file into a program -#include -#include "file.h" -@ind -ind (THEOS) Read a long from a i/o port -#include -unsigned long ind(unsigned port); -See also: inb,insb,insd,insw,inw -@insb -insb (THEOS) Read bytes from a i/o port -#include -void insb(unsigned port,unsigned seg,void *offset,size_t len); -See also: inb,ind,insd,insw,inw -@interrupt -interrupt (THEOS) Interrupt function declarator -void interrupt isr(void); -@insd -insd (THEOS) Read longs from a i/o port -#include -void insd(unsigned port,unsigned seg,void *offset,size_t len); -See also: inb,ind,insb,insw,inw -@insw -insw (THEOS) Read words from a i/o port -#include -void insw(unsigned port,unsigned seg,void *offset,size_t len); -See also: inb,ind,insb,insd,inw -@inw -inw (THEOS) Read a word on a i/o port -#include -unsigned inw(unsigned port); -See also: ind,insb,insd,insw,inw -@ioctl -ioctl (UNIX) Perform extended I/O control on devices -#include -short ioctl(FILE *fp,struct bytecntl *action); -short ioctl(FILE *fp,struct diskcntl *action); -short ioctl(FILE *fp,struct tapecntl *action); -@ip -ip (THEOS) Return the integral part of a value -#include -double ip(double x); -See also: modf -@inc -inc (THEOS) Increment a byte in another memory segment -#include -void inc(void *ofs,unsigned seg); -See also: Other inc functions -@inccs -inccs (THEOS) Increment a byte in the code segment -#include -void inccs(void *ofs); -See also: Other inc functions -@inccsl -inccsl (THEOS) Increment a long in the code segment -#include -void inccsl(void *ofs); -See also: Other inc functions -@inccsw -inccsw (THEOS) Increment a word in the code segment -#include -void inccsw(void *ofs); -See also: Other inc functions -@incl -incl (THEOS) Increment a long in another memory segment -#include -void incl(void *ofs,unsigned seg); -See also: Other inc functions -@incw -incw (THEOS) Increment a word in another memory segment -#include -void incw(void *ofs,unsigned seg); -See also: Other inc functions -@isalnum -isalnum (ANSI) Check if a character is a number or letter -#include -short isalnum(short c); -See also: setlocale -@isalpha -isalpha (ANSI) Check if a character is a letter -#include -short isalpha(short c); -See also: setlocale -@isascii -isascii (UNIX) Check if a character is an ASCII character -#include -short isascii(short c); -See also: setlocale -@isatty -isatty (UNIX) Check if an open file is a serial communication device -#include -short isatty(FILE *stream); -@iscntrl -iscntrl (ANSI) Check if a character is a control character -#include -short iscntrl(short c); -@iscomname -iscomname (+THEOS) Test if a file name is a valid com port name -#include <_stdlib.h> -short iscomname(char *filename); -@iscon -iscon (THEOS) Check if an open file is the console -#include -short iscon(FILE *stream); -@iscsym -iscsym (THEOS) Test if a character is alphabetic or an underscore -#include -short iscsym(short c); -See also: iscsymnum -@iscsymnum -iscsymnum (THEOS) Test if a character is alphanumeric or an underscore -#include -short iscsymnum(short c); -See also: iscsym -@isdigit -isdigit (ANSI) Check if a character is a decimal diqit -#include -short isdigit(short c); -@isdisp -isdisp (THEOS) Check if a character is displayable by most terminal -#include -short isdisp(short c); -See also: isgraph,isprint -@isfnsym -isfnsym (THEOS) Check if a character is valid for a file name -#include -short isfnsym(short c); -See also: issymbol,issymnum -@isgraph -isgraph (ANSI) Check if a character is visible when printed -#include -short isgraph(short c); -See also: setlocale -@ishex -ishex (THEOS) Check if a character is a hexadecimal digit -#include -short ishex(short c); -See also: isxdigit -@isinter -isinter (+THEOS) Check if a character is an international character -#include -short isinter(short c); -See also: isalpha -@islower -islower (ANSI) Check if a character is a lower-case letter -#include -short islower(short c); -See also: setlocale -@isoctal -isoctal (THEOS) Check if a character is an octal digit -#include -short isoctal(short c); -@isprint -isprint (ANSI) Check if a character is visible or is a space -#include -short isprint(short c); -See also: setlocale -@isprtname -isprtname (+THEOS) Test if a file name is a valid printer name -#include <_stdlib.h> -short isprtname(char *filename); -@ispunct -ispunct (ANSI) Check if a character is a punctuation mark -#include -short ispunct(short c); -See also: setlocale -@isrxempty -isrxempty (+THEOS) Test if an input buffer is empty -#include -short isrxempty(FILE *port); -See also: cclose,ccloseall,cgetc,cputc,csetbuf,csetvbuf,getrxcnt,istxfull -@issesdev -issesdev (+THEOS) Test if a device is session capable -#include <_stdlib.h> -short issesdev(FILE *fp); -@isspace -isspace (ANSI) Check if a character prints white space -#include -short isspace(short c); -@issymbol -issymbol (THEOS) Check if a character is a valid first character for a file name -#include -short issymbol(short c); -See also: issymnum -@issymnum -issymnum (THEOS) Check if a character is a valid character for a symbol -#include -short issymnum(short c); -See also: issymbol -@istapname -istapname (+THEOS) Test if a file name is a valid tape name -#include <_stdlib.h> -short istapname(char *filename); -@istxfull -istxfull (+THEOS) Test if an input buffer is empty -#include -short istxfull(FILE *port); -See also: cclose,ccloseall,cgetc,cputc,csetbuf,csetvbuf,getrxcnt,istxfull -@isupper -isupper (ANSI) Check if a character is an upper-case letter -#include -short isupper(short c); -See also: setlocale -@isv86 -isv86 (THEOS) Test if a process is running in Virtual 86 mode -short isv86(short pid); -@isxdigit -isxdigit (ANSI) Check if a charcter is an hexadecimal digit -#include -short isxdigit(short c); -See also: ishex -@itoa -itoa (THEOS) Convert an integer into an ASCII string -#include -char *itoa(char *s,short i); -See also: ftoa,ltoa,utoa -@keyclose -keyclose (THEOS) Close the keyword file used with getkey -#include -void keyclose(void); -See also: getkey,testarg -@keyin -keyin (THEOS) See cgets -@killtask -killtask (THEOS) Kill a subtask -#include -void killtask(short pid); -See also: fork,forktask,suicide -@l3tol -l3tol (UNIX) Convert three bytes integers to longs integers -#include -void l3tol(long *l,const char *c,short cnt); -See also: c3tol,ltoc3,ltol3 -@l64a -l64a (UNIX) Convert a long integer to a base-64 ASCII string -#include -char *l64a(long x); -See also: a64l -@labs -labs (ANSI) Return the absolute value of an long integer -#include -long labs(long l); -See also: abs,fabs -@ldeletek -ldeletek (THEOS) Delete a record from a direct access file -#include -short ldeletek(FILE *fp,const long *key); -See also: lreadk,lreadn,lwritek -@ldexp -ldexp (ANSI) Combine fraction and exponent -#include -double ldexp(double x,short exp); -See also: frexp -@ldiv -ldiv (ANSI) Return the quotient and remainder of the division of two longs -#include -ldiv_t ldiv(long numer,long denom) -@ldiv_t -ldiv_t (ANSI) used by ldiv -#include -typedef struct {long quot,rem;} ldiv_t; -See also: div -@leapyear -leapyear (THEOS) Indicate if a year is a leap year -#include -short leapyear(short year); -See also: _monthen,_yday -@lfind -lfind (MSC) Perform a linear search of an array -#include -void *lfind(const void *key,const void *array,size_t nbr_mbr,size_t size, - short (*compar)(const void *,const void *)); -See also: bsearch,lsearch,qsort -@line -#line (ANSI) Reset line numbering -#line number -#line number filename -@linput -linput (+THEOS) Accept a data field from the keyboard like BASIC LINPUT -#include <_stdlib.h> -short linput(char *case,char *before_msg,char *after_msg,char *input_var, - char *output_var,short length,short timeout,short timeout_key); -@load -load (THEOS) Load a program into memory -#include -unsigned load(const char *program,short type); -See also: unload -@load_yn -load_yn (THEOS) Initialise the yesno function -#include -void load_yn(void); -See also: yesno -@loc1 -loc1 (THEOS) Reserved variable for regex -#include -extern char *loc1; -@localtime -localtime (ANSI) Convert system time to calendar structure -#include -struct tm *localtime(time_t *timep); -See also: asctime,ctime,gmtime,mktime,strftime,time -@locate -locate (THEOS) Find a file on disk and return a copy of its FDB -#include -struct fdb *locate(const char *filename,char *buf,short *lub); -See also: getfn -@lock_time -lock_time (THEOS) Set the maximum lock time wait -#include <_stdlib.h> -void lock_time(unsigned char seconds); -See also: timeout -@locking -locking (MSC) Lock or unlock a record in a file -#include -short locking(FILE *fp,short mode,long size); -Set : errno -See also: filelock,reclock,recunlock,unlock -@lockres -lockres (THEOS) "Unlock" a byte in memory -#include -void lockres(void *ofs,unsigned seg); -See also: lockset -@lockset -lockset (THEOS) "Lock" a byte in memory -#include -void lockset(void *ofs,unsigned seg); -See also: lockres -@log -log (ANSI) Compute natural logarithm -#include -double log(double z); -Set : errno -See also: log10,log2 -@log10 -log10 (ANSI) Compute common logarithm -#include -double log10(double z); -Set : errno -See also: log,log2 -@log2 -log2 (THEOS) Compute base 2 logarithm -#include -double log2(double z); -Set : errno -See also: log,log10 -@logname -logname (UNIX) Return the account name currently logged -#include -char *logname(void); -See also: cuserid,getlogin,getuid -@longjmp -longjmp (ANSI) Return from a non-local goto -#include -short longjmp(jmp_buf env,short rval); -See also: setjmp -@lowcase -lowcase (THEOS) See strlwr -@lprime -lprime (+THEOS) Compute the smallest prime greater than or equal to a number -#include <_stdlib.h> -unsigned long lprime(unsigned long n); -See also: prime -@lreadk -lreadk (THEOS) Read a record from a direct access file -#include -short lreadk(FILE *fp,const long *key,void *rec); -See also: ldeletek,lreadn,lwritek -@lreadn -lreadn (THEOS) Read the next record from a direct access file -#include -short lreadn(FILE *fp,long *key,void *rec); -See also: ldeletek,lreadk,lwritek -@lsearch -lsearch (UNIX) Perform a linear search of an array,insert key if non existent -#include -void *lsearch(const void *key,const void *array,size_t nbr_mbr,size_t size, - short (*compar)(const void *,const void *)); -See also: bsearch,lfind,qsort -@lseek -lseek (UNIX) Set read/write position -#include -long lseek(short fd,short how,long where); -See also: close,creat,filelength,flush,open,_read,read,tell,_write,write -@ltoa -ltoa (THEOS) Convert an long integer into an ASCII string -#include -char *ltoa(char *s,short l); -See also: ftoa,itoa,utoa -@ltoc3 -ltoc3 (THEOS) Convert a long integer to a three byte integer -#include -long ltoc3(void *c,long l); -See also: c3tol,l3tol,ltol3 -@ltol3 -ltol3 (UNIX) Convert long integers to three byte integers -#include -long ltol3(void *c,const long *l,short cnt); -See also: c3tol,l3tol,ltoc3 -@lwritek -lwritek (THEOS) Write a record to a direct access file -#include -short lwritek(FILE *fp,const long *key,const void *rec); -See also: ldeletek,lreadk,lreadn -@make_sel -make_sel (THEOS) Create a memory selector -#include -void make_sel(short sel,size_t limit,unsigned long base,short int); -See also: free_sel -@makelib -makelib (THEOS) Create a library file -#include -unsigned makelib(const char *filename,short size); -See also: fcreate -@malloc -malloc (ANSI) Allocate dynamic memory -#include -char *malloc(size_t size); -@match -match (THEOS) Compare a string against a format mask -#include -short match(const char *string,const char *mask); -See also: strcmp,streq -@mapdoskey -mapdoskey (+THEOS) Convert THEOS keycodes to PC keycodes -#include -#include -unsigned short mapdoskey(unsigned short key); -See also: _bios_keybrd -@matcharg -matcharg (THEOS) Compare one string with another with abbreviation capability -#include -short matcharg(const char *string,const char *keyword,short min); -See also: strcmp,streq,strncmp,testarg -@max -max (UNIX) Return the larger of two integers -#include -short max(short a,short b); -@max_alloc -max_alloc (THEOS) Return the size of the larger memory bloc available -#include -size_t max_alloc(void); -See also: calloc,free,malloc,realloc,tot_alloc -@mem_grow -mem_grow (THEOS) ??? -#include -short mem_grow(short seg,long adjust); -@mem_ovly -mem_ovly (THEOS) Adjust the size of the data used by the program -#include -void mem_ovly(size_t size); -@memccpy -memccpy (UNIX) Copy a buffer into another for 'n' bytes or up to a character -#include -void *memcpy(void *to,const void *from,short c,size_t len); -See also: farcpy,memcpy,memmove,memrcpy,strcpy,strdup,strmake,strncpy -@memchr -memchr (ANSI) Locate the first occurrence of a byte in a buffer -#include -void *memchr(const void *buffer,unsigned character,size_t len); -See also: farchr,strpbrk,strchr,strrchr,strstr -@memcmp -memcmp (ANSI) Compare two buffers -#include -short memcmp(const void *buf1,const void *buf2,size_t len); -See also: farcmp,fareq,memeq,memicmp,strcmp,streq,stricmp,strncmp,strneq, - strnicmp -@memcpy -memcpy (ANSI) Copy one buffer into another -#include -void *memcpy(void *to,const void *from,size_t len); -See also: farcpy,memccpy,memmove,memrcpy,strcpy,strdup,strmake,strncpy -@memeq -memeq (THEOS) Compare two buffers for equality -#include -short memeq(const void *buf1,const void *buf2,size_t len); -See also: farcmp,fareq,memcmp,memicmp,strcmp,streq,stricmp,strncmp,strnicmp, - strneq -@memicmp -memicmp (MSC) Compare two buffers,ignoring the casemode of the characters -#include -short memicmp(const void *buf1,const void *buf2,size_t len); -See also: farcmp,fareq,memcmp,memeq,strcmp,streq,stricmp,strncmp,strneq,strnicmp -@memmove -memmove (ANSI) Copy one buffer into another with correct handling of overlapping -void *memmove(void *to,const void *from,size_t len); -See also: farcpy,memcpy,memccpy,memrcpy,strcpy,strdup,strmake,strncpy -@memrcpy -memrcpy (THEOS) Copy one buffer into another in reverse sequence -#include -void *memrcpy(void *to,const void *from,size_t len); -See also: farcpy,memcpy,memccpy,memmove,strcpy,strdup,strmake,strncpy -@memset -memset (ANSI) Fill a buffer with a character -#include -void *memset(char *buffer,short character,size_t len); -See also: farset,strnfill,strset,strnset -@menu -menu (THEOS) Display a menu and wait for a selection -#include -short menu(const char **menu,short count); -See also: menu2 -@menu2 -menu2 (THEOS) Display a menu and wait for a selection -#include -short menu2(const char **menu,short count,short start,short display); -See also: menu -@menumsg -menumsg (+THEOS) Display a menu line a wait for a selection -#include <_stdlib.h> -short menumsg(char *msg,char *key,short timeout,short timeout_key); -@min -min (UNIX) Return the smaller of two integers -#include -short min(short a,short b); -@mkdir -mkdir (MSC) Create a directory -#include -short mkdir(const char *filename); -Set : errno,_errnum -See also: chdir,rmdir -@mktemp -mktemp (UNIX) Generate a temporary file name -#include -char *mktemp(const char *template); -See also: tmpnam,tmpfile,tmpnam -@mktime -mktime (MSC) Convert a time structure into a calendar time -#include -time_t mktime(struct tm *timeptr) -See also: asctime,ctime,gmtime,localtime,strftime,time -@modf -modf (ANSI) Separate integral and fractional part -#include -double modf(double x,double *ip); -See also: ip -@mouse -mouse (+THEOS) Compute mouse position and buttons for subsequent use -#include -short mouse(void); -See also: hasmouse, mousebutton, mouseclick, mousedisable, mouseenable, - mousemove, mousescale, mouseswap, mousetell, mousexy -@mousebutton -mousebutton (+THEOS) Return mouse buttons state -#include -short mousebutton(void); -See also: hasmouse, mouse, mouseclick, mousedisable, mouseenable, - mousemove, mousescale, mouseswap, mousetell, mousexy -@mouseclick -mouseclick (+THEOS) Set mouse click and dclick delay -#include -void mouseclick(long click); -See also: hasmouse, mouse, mousebutton, mousedisable, mouseenable, - mousemove, mousescale, mouseswap, mousetell, mousexy -@mousedisable -mousedisable (+THEOS) Disable the mouse -#include -void mousedisable(void); -See also: hasmouse, mouse, mousebutton, mouseclick, mouseenable, - mousemove, mousescale, mouseswap, mousetell, mousexy -@mouseenable -mouseenable (+THEOS) Initialise and enable the mouse -#include -void mouseenable(void); -See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, - mousemove, mousescale, mouseswap, mousetell, mousexy -@mousemove -mousemove (+THEOS) Move the mouse pointer -#include -void mousemove(short col, short row); -See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, - mousescale, mouseswap, mousetell, mousexy -@mousescale -mousescale (+THEOS) Set mouse sensitivity -#include -void mousescale(short scale); -See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, - mousemove, mouseswap, mousetell, mousexy -@mouseswap -mouseswap (+THEOS) Swap mouse left and right buttons -#include -void mouseswap(short flag); -See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, - mousemove, mousescale, mousetell, mousexy -@mousetell -mousetell (+THEOS) Read mouse swap flag and sensitivity -#include -void mousetell(long *click, short *scale); -See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, - mousemove, mousescale, mouseswap, mousexy -@mousexy -mousexy (+THEOS) Read mouse position -#include -void mousexy(short *col, short *row); -See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, - mousemove, mousescale, mouseswap, mousetell -@move -move (THEOS) Copy one buffer to another buffer in another memory segment -Obsolete function,use farcpy -@msalarm -msalarm (THEOS) Start a timer in milli seconds generating a signal interrupt -#include -long msalarm(long msecs); -See also: delay,alarm,signal -@msgclose -msgclose (THEOS) Close the system message file -#include -void msgclose(void); -See also: getmsg -@no_val -no_val (THEOS) Value of no answer -extern char yes_val; -@NULL -NULL (ANSI) Nul pointer type -#include -#define NULL ((void *)0) -@offsetof -offsetof (ANSI) Offset between the beginning of a structure and a member -#include -offsetof(nom_de_structure,nom_de_membre) -@open -open (UNIX) Open a file -#include -short open(const char *filename,short type,...); -Set : errno,_errnum -See also: close,creat,filelength,flush,lseek,_read,read,tell,_write,write -@opendir -opendir (+UNIX) Open a directory -#include -DIR* opendir(const char* fname); -See also: readdir,closedir,seekdir,telldir,rewinddir -Set : errno -@openhelp -openhelp (THEOS) Open the help file for a program -#include -FILE *openhelp(const char *name); -See also: fopen -@openmenu -openmenu (THEOS) Open the menu file for a program -#include -FILE *openmenu(const char *name); -See also: fopen -@orb -orb (THEOS) Or a byte in another memory segment -#include -void orb(void *ofs,unsigned seg,char mask); -See also: Other or functions -@orcs -orcs (THEOS) Or a byte in the code segment -#include -void orcs(void *ofs,char mask); -See also: Other or functions -@orl -orl (THEOS) Or a long in another memory segment -#include -void orl(void *ofs,unsigned seg,long mask); -See also: Other or functions -@orlcs -orlcs (THEOS) Or a long in the code segment -#include -void orlcs(void *ofs,long mask); -See also: Other or functions -@orw -orw (THEOS) Or a word in another memory segment -#include -void orw(void *ofs,unsigned seg,short mask); -See also: Other or functions -@orwcs -orwcs (THEOS) Or a word in the code segment -#include -void orwcs(void *ofs,short mask); -See also: Other or functions -@outb -outb (THEOS) Write a byte into an i/o port -#include -void outb(unsigned port,char byte); -See also: outd,outsb,outsd,outsw,outw -@outd -outd (THEOS) Write a long into an i/o port -#include -void outd(unsigned port,unsigned long dword); -See also: outb,outsb,outsd,outsw,outw -@outsb -outsb (THEOS) Write bytes into an i/o port -#include -void outsb(unsigned port,unsigned seg,void *offset,size_t len); -See also: outb,outd,outsd,outsw,outw -@outsd -outsd (THEOS) Write longs into an i/o port -#include -void outsd(unsigned port,unsigned seg,void *offset,size_t len); -See also: outb,outd,outsb,outsw,outw -@outsw -outsw (THEOS) Write words into an i/o port -#include -void outsw(unsigned port,unsigned seg,void *offset,size_t len); -See also: outb,outd,outsb,outsd,outw -@outw -outw (THEOS) Write a word into an i/o port -#include -void outw(unsigned port,unsigned word); -See also: outb,outd,outsb,outsd,outsw -@pagewait -pagewait (THEOS) Display the wait prompt and wait the a key -#include -short pagewait(void); -See also: getpl -@pause -pause (THEOS) Wait a state change on ii/o port 61 -void pause(char count); -@pcbsc -pcbsc (THEOS) Read or write char or words in the PCB of any process -#include <_sc.h> -long pcbsc(short type,void *ofs,void *arg); -Le premier PCB commence en PCBSTART,les PCB suivant sont consÉcutifs. Le -dernier PCB est suivi par un entier à 0xFFFF. Tout accÈs à une adresse plus -ÉlevÉe entraine un TRAP #13. - -type = 1 : lit un octet type = 2 : lit un mot de 16 bits -type = 0x8001 : Écrit un octet type = 0x8002 : Écrit un mot de 16 bits - -ofs pointe à l'intÉrieur de la table des PCB -arg valeur à Écrire si type = 0x8001 ou 0x8002 - -Lecture de l'État du PID 0 : status = pcbsc(1,PCBSTART,(void *) 0); -Lecture de la version de l'OS : ver = pcbsc(-1,-1,-1); -@peek -peek (THEOS) Return a byte from another memory segment -#include -unsigned peek(const void *ofs,unsigned seg); -See also: Other peek functions -@peekchar -peekchar (THEOS) ??? -#include <_sc.h> -void peekchar(short pid,short type); -@peekcs -peekcs (THEOS) Return a byte from the code segment -#include -unsigned peekcs(const void *ofs); -See also: Other peek functions -@peekfsa -peekfsa (THEOS) ??? -#include <_sc.h> -short peekfsa(void *ofs); -@peekl -peekl (THEOS) Return a long from another memory segment -#include -unsigned long peekl(const void *ofs,unsigned seg); -See also: Other peek functions -@peeklcs -peeklcs (THEOS) Return a long from the code segment -#include -unsigned long peeklcs(const void *ofs); -See also: Other peek functions -@peeklnuc -peeklnuc (THEOS) Return a long from the nucleus segment -#include -unsigned long peeklnuc(const void *ofs); -See also: Other peek functions -@peeklscr -peeklscr (THEOS) Return a long from the SCR segment -#include -unsigned long peeklscr(const void *ofs); -See also: Other peek functions -@peeknuc -peeknuc (THEOS) Return a byte from the nucleus segment -#include -unsigned peeknuc(const void *ofs); -See also: Other peek functions -@peekp -peekp (THEOS) Return a pointer from another memory segment -#include -void *peekp(const void *ofs,unsigned seg); -See also: Other peek functions -@peekpcs -peekpcs (THEOS) Return a pointer from the code segment -#include -void *peekpcs(const void *ofs); -See also: Other peek functions -@peekpnuc -peekpnuc (THEOS) Return a pointer from the nucleus segment -#include -void *peekpnuc(const void *ofs); -See also: Other peek functions -@peekpscr -peekpscr (THEOS) Return a pointer from the SCR segment -#include -void *peekpscr(const void *ofs); -See also: Other peek functions -@peekscr -peekscr (THEOS) Return a byte from the SCR segment -#include -unsigned peekscr(const void *ofs); -See also: Other peek functions -@peektib -peektib (THEOS) Get bytes in the TIB or RCR of any process -#include <_sc.h> -long peektib(short pid,void *ofs); -L'adressage du scr peut Çtre indiquÉ en ajoutant 0x8000 à l'offset -dans le scr. Ainsi : -peektib(pid,0x8000) Équivaut à peektib(pid,&TIB->scr.logonname[0]) -@peekw -peekw (THEOS) Return a word from another memory segment -#include -unsigned peekw(const void *ofs,unsigned seg); -See also: Other peek functions -@peekwcs -peekwcs (THEOS) Return a word from the code segment -#include -unsigned peekwcs(const void *ofs); -See also: Other peek functions -@peekwnuc -peekwnuc (THEOS) Return a word from the nucleus segment -#include -unsigned peekwnuc(const void *ofs); -See also: Other peek functions -@peekwscr -peekwscr (THEOS) Return a word from the SCR segment -#include -unsigned peekwscr(const void *ofs); -See also: Other peek functions -@perror -perror (ANSI) Display a program defined message with a message pointed by errno -#include -void perror(const char *string); -Set : errno -See also: errmsg,fperror,getmsg,strerror,syserr -@phy_addr -phy_addr (THEOS) Determine physical address of memory selector,lock and unlock -#include -unsigned long phy_addr(unsigned seg,void *offset,size_t len); -See also: getmem,putmem -@pipe -pipe (UNIX) Open an interprocess i/o channel -#include -short pipe(short filenum[2]); -See also: popen -@poke -poke (THEOS) Put a byte into another memory segment -#include -void poke(char val,void *ofs,unsigned seg); -See also: Other poke functions -@pokecs -pokecs (THEOS) Put a byte into the code segment -#include -void pokecs(char val,void *ofs); -See also: Other poke functions -@pokecsa -pokecsa (THEOS) Put a byte into the code segment -#include -void pokecsa(char val,void *ofs); -See also: Other poke functions -@pokel -pokel (THEOS) Put a long into another memory segment -#include -void pokel(long val,void *ofs,unsigned seg); -See also: Other poke functions -@pokelcs -pokelcs (THEOS) Put a long into the code segment -#include -void pokelcs(long val,void *ofs); -See also: Other poke functions -@pokelcsa -pokelcsa (THEOS) Put a long into the code segment -#include -void pokelcsa(long val,void *ofs); -See also: Other poke functions -@pokelscr -pokelscr (THEOS) Put a long into the SCR segment -#include -void pokelscr(long val,void *ofs); -See also: Other poke functions -@pokenuc -pokenuc (THEOS) Put a byte into the nucleus segment -#include -void pokenuc(short val,void *ofs); -See also: Other poke functions -@pokep -pokep (THEOS) Put a pointer into another memory segment -#include -void pokep(void *val,void *ofs,unsigned seg); -See also: Other poke functions -@pokepcs -pokepcs (THEOS) Put a pointer into the code segment -#include -void pokepcs(void *val,void *ofs); -See also: Other poke functions -@pokepcsa -pokepcsa (THEOS) Put a pointer into the code segment -#include -void pokepcsa(void *val,void *ofs); -See also: Other poke functions -@pokepscr -pokepscr (THEOS) Put a pointer into the SCR segment -#include -void pokepscr(void *val,void *ofs); -See also: Other poke functions -@pokescr -pokescr (THEOS) Put a byte into the SCR segment -#include -void pokescr(char val,void *ofs); -See also: Other poke functions -@pokeucb -pokeucb (THEOS) Put a byte into the UCB segment -#include -void pokeucb(short val,void *ofs); -See also: Other poke functions -@pokew -pokew (THEOS) Put a word into another memory segment -#include -void pokew(short val,void *ofs,unsigned seg); -See also: Other poke functions -@pokewcs -pokewcs (THEOS) Put a word into the code segment -#include -void pokewcs(short val,void *ofs); -See also: Other poke functions -@pokewcsa -pokewcsa (THEOS) Put a word into the code segment -#include -void pokewcsa(short val,void *ofs); -See also: Other poke functions -@pokewnuc -pokewnuc (THEOS) Put a word into the nucleus segment -#include -void pokewnuc(short val,void *ofs); -See also: Other poke functions -@pokewscr -pokewscr (THEOS) Put a word into the SCR segment -#include -void pokewscr(short val,void *ofs); -See also: Other poke functions -@pokewucb -pokewucb (THEOS) Put a word into the UCB segment -#include -void pokewucb(short val,void *ofs); -See also: Other poke functions -@popen -popen (UNIX) Open an interprocess i/o channel -#include -short popen(FILE **rd_pipe,FILE **wr_pipe); -See also: pipe -@popf -popf (THEOS) Pop flag register -#include -void popf(void); -See also: pushf -@pow -pow (ANSI) Compute a power of a number -#include -double pow(double z,double x); -Set : errno -@pragma -#pragma Sets compiler options -#pragma align 1 | 2 (default) | 4 -#pragma align struct | -struct (default) -#pragma char signed (default) | unsigned -#pragma field char | word (default) -#pragma float bcd | ieee (default) -#pragma float float (default) | double -#pragma int short (default) | long -#pragma library -#pragma prog version,priv[,mfg,serial][,"copyright"][,patchsize] -#pragma shift logical (default) | arithmetic -@pre_empt -pre_empt (THEOS) ??? -#include -void pre_empt(void); -@prime -prime (THEOS) Compute the smallest prime greater than or equal to a number -#include -unsigned prime(unsigned n); -See also: lprime -@printf -printf (ANSI) Format output -#include -short printf(const char *format,...); -See also: cprintf,fprintf,sprintf,vfprintf,vprintf,vsprintf -@pushf -pushf (THEOS) Push flag register -#include -void pushf(void); -@ptrdiff_t -ptrdiff_t (ANSI) Result type of the substraction of two pointers -#include -typedef long ptrdiff_t; -@putc -putc (ANSI) Write a character to a stream -#include -short putc(char c,FILE *fp); -See also: fputc,putchar -@putch -putch (MSC) Write a character to the console -#include -short putch(short c); -See also: fputc,putc,putchar -@putchar -putchar (ANSI) Write a character to standard output -#include -short putchar(short c); -@putenv -putenv (MSC) Set an environment variable -#include -short putenv(const char *s); -See also: getenv -@putmem -putmem (THEOS) Release memory allocated by getmem -#include -void putmem(unsigned seg); -See also: getmem -@putmsg -putmsg (THEOS) Display a message with parameter substitution -#include -void putmsg(const char *text,const char *arg[]); -See also: errbot,errmsg,getmsg,perror,syserr -@puts -puts (ANSI) Write a string to standard output -#include -void puts(const char *string); -See also: cputs,fputs -@putw -putw (ANSI) Write a word to a stream -#include -short putw(short word,FILE *fp); -See also: getw,fgetw,fputw -@qsort -qsort (ANSI) Sort arrays in memory -void qsort(const void **array,size_t nbr,size_t size, - short (*compar)(const void *,const void *)); -See also: bsearch,sort -@quitoff -quitoff (THEOS) Mask the system quit key -#include -void quitoff(void); -See also: quiton -@quiton -quiton (THEOS) Re-enable the system quit key -#include -void quiton(void); -See also: quitoff -@raise -raise (ANSI) Force a signal interrupt -#include -short raise(short sig); -See also: signal -@rand -rand (ANSI) Generate pseudo-random numbers -#include -short rand(void); -See also: srand -@rbrk -rbrk (THEOS) Internal function -@read -read (ANSI) Read data from a file -#include -short read(short fd,void *buffer,size_t n); -See also: close,creat,filelength,flush,lseek,open,_read,tell,_write,write -@readdir -readdir (+UNIX) Read a directory entry -#include -struct dirent* readdir(DIR*); -See also: opendir,closedir,seekdir,telldir,rewinddir -Set : errno -@readk -readk (THEOS) Read a record from an indexed or keyed file -#include -short readk(FILE *fp,const char *key,void *rec); -See also: deletek,readn,readp,writek -@readn -readn (THEOS) Read next record from an indexed or keyed file -#include -short readn(FILE *fp,char *key,void *rec); -See also: deletek,readk,readp,writek -@readp -readp (THEOS) Read previous record from an indexed or keyed file -#include -short readp(FILE *fp,char *key,void *rec); -See also: deletek,readk,readn,writek -@realloc -realloc (ANSI) Reallocate dynamic memory -#include -char *realloc(void *ptr,size_t size); -See also: calloc,free,malloc,max_alloc,tot_alloc -@reclock -reclock (THEOS) Try to lock a record in a file stream or direct file -#include -short reclock(FILE *fp,fpos_t pos); -See also: filelock,locking,recunlock,unlock -@recunlock -recunlock (THEOS) Try to lock a record in a file stream or direct file -#include -short recunlock(FILE *fp,fpos_t pos); -See also: filelock,locking,reclock,unlock -@regcmp -regcmp (UNIX) Compile a search pattern to be used by the regex search function -#include -char *regcmp(char *pattern,...); -See also: regex,strchr,strstr -@regex -regex (UNIX) Perform a search on a string using a pattern compiled by regcmp -#include -char *regex(char *cpattern,char *object,...); -See also: regcmp,strchr,strstr -@remote -remote (THEOS) Call a function in another code segment -#include -remote(unsigned ofs,unsigned seg,...); -@remove -remove (ANSI) Erase a file -#include -short remove(const char *filename); -Set : errno,_errnum -See also: unlink -@rename -rename (ANSI) Change the name of a file -#include -short rename(const char *old,const char *new); -Set : errno,_errnum -@rewind -rewind (ANSI) Reset file pointer -#include -short rewind(FILE *fp); -See also: fseek,fsetpos,seek -@rewinddir -rewinddir (+UNIX) Sets the directory entry location to the beginning -#include -void rewinddir(DIR*); -See also: opendir,closedir,readdir,telldir,seekdir -@rmdir -rmdir (MSC) Removes a directory -#include -short rmdir(const char*dirname); -Set : errno,_errnum -See also: remove,unlink -@round -round (+THEOS) Round a value to the nearest integer -#include <_math.h> -double round(double value, int position) -See also: ceil, floor -@rsema -rsema (THEOS) Return the status of a remote semaphore -#include -short rsema(short pid,short sema_nbr); -See also: rsemaname,rsemares,rsemaset,rsemawait,sema,semaphore,semares,semaset, - semawait -@rsemaname -rsemaname (THEOS) Return the number of a remote semaphore -#include -short rsemaname(short pid,char *name); -See also: rsema,rsemares,rsemaset,rsemawait,sema,semaphore,semares,semaset, - semawait -@rsemares -rsemares (THEOS) Reset a remote semaphore -#include -short rsemares(short pid,short sema_nbr); -See also: rsema,rsemaname,rsemaset,rsemawait,sema,semaphore,semares,semaset, - semawait -@rsemaset -rsemaset (THEOS) Set a remote semaphore -#include -short rsemaset(short pid,short sema_nbr); -See also: rsema,rsemaname,rsemares,rsemawait,sema,semaphore,semares,semaset, - semawait -@rsemawait -rsemawait (THEOS) Wait until a remote semaphore is set -#include -short rsemawait(short pid,short sema_nbr); -See also: rsema,rsemaname,rsemaset,rsemares,sema,semaphore,semares,semaset, - semawait -@sbrk -sbrk (THEOS) Increase a program's data space -void *sbrk(short increment); -@scanf -scanf (ANSI) Accept and format input -#include -short scanf(char *format,...); -See also: fscanf,sscanf -@schedint -schedint (THEOS) Set or reset an interrupt service routine vector -#include -void schedint(long num,short (*isr)()); -@sec -sec (THEOS) Calculate secant -#include -double sec(double x); -@sech -sech (THEOS) Calculate hyperbolic secant -#include -double sech(double x); -@seek -seek (ANSI) Change a stream position pointer -#include -short seek(FILE *fp,short pos,short base); -See also: fsetpos,rewind,seek -@seekdir -seekdir (+UNIX) Sets the directory entry location -#include -void seekdir(DIR*,long); -See also: opendir,closedir,readdir,telldir,rewinddir -@sema -sema (THEOS) Return the status of a semaphore -#include -short rsema(short pid,short sema_nbr); -See also: rsema,rsemaname,rsemares,rsemaset,rsemawait,semaphore,semares, - semaset,semawait -@semaphore -semaphore (THEOS) Return the number of a semaphore -#include -short semaphore(char *name); -See also: rsema,rsemaname,rsemares,rsemaset,rsemawait,sema,semares,semaset, - semawait -@semares -semares (THEOS) Reset a semaphore -#include -short semares(short pid,short sema_nbr); -See also: rsema,rsemaname,rsemares,rsemaset,rsemawait,sema,semaphore,semaset, - semawait -@semaset -semaset (THEOS) Set a semaphore -#include -short semaset(short pid,short sema_nbr); -See also: rsema,rsemaname,rsemares,rsemaset,rsemawait,sema,semaphore,semares, - semawait -@semawait -semawait (THEOS) Wait until a semaphore is set -#include -short semawait(short pid,short sema_nbr); -See also: rsema,rsemaname,rsemaset,rsemares,rsemawait,sema,semaphore,semares, - semaset -@setbuf -setbuf (ANSI) Allocate an i/o buffer for an open file -#include -void setbuf(FILE *fp,char *buffer); -See also: fbuf,setvbuf,vbuf -@setjmp -setjmp (ANSI) Save or restore the current execution environment for a longjmp -#include -short setjmp(jmp_buf env); -See also: longjmp -@setlocale -setlocale (ANSI) Change or return the current locale switches -#include -char *setlocale(short category,const char *locale); -See also: strcoll,strxfrm,is... and to... functions -@setprty -setprty (THEOS) Change the current process priority -#include -void setprty(short priority); -Set also: setslice,snu -@setvbuf -setvbuf (ANSI) Allocate an i/o buffer for an open file -#include -void setvbuf(FILE *fp,char *buffer,short mode,size_t len); -See also: fbuf,setbuf,vbuf -@sgetl -sgetl (THEOS) Retrieve a long integer stored with sputl -#include -long sgetl(char *buf); -See also: sputl -@shared -shared (THEOS) Define or access memory shared with other process -unsigned shared(char *name,size_t len); -See also: far...,getlimit,add...,and...,dec...,inc...,or...,peek...,poke..., - xor... -@sig_atomic_t -sig_atomic_t (ANSI) Used by signal -#include -typedef short sig_atomic_t; -@signal -signal (ANSI) Set the answer to an interrupt -#include -void *signal(short sig,void (*action()); -Set : errno -See also: alarm,msalarm,raise -@sin -sin (ANSI) Calculate sine -#include -double sin(double radian); -Set : errno -@sinh -sinh (ANSI) Calculate hyperbolic sine -#include -double sinh(double radian); -@size_t -size_t (ANSI) Result type of sizeof -#include -typedef unsigned long size_t; -@skipsp -skipsp (THEOS) Locate the next non-space character in a string -#include -char *skipsp(char *s); -See also: strpbrk -@sleep -sleep (UNIX) Suspend execution for a specified time -#include -void sleep(long msecs); -See also: alarm,clock,delay,msalarm,signal -@snu -snu (THEOS) Release any remaining time in this program's slice time -#include -void snu(void); -@sort -sort (THEOS) Sort an array in memory by rearranging an array of pointers -void sort(void **array,size_t nbr,short (*compar)(const void *,const void *)); -See also: qsort -@spawnl -spawnl (MSC) Spawn another program as a subtask -#include -short spawnl(short mode,const char *program,const char *arg,...,NULL); -Set : errno -See also: execl,execlp,execv,execvp,spawnlp,spawnv,spawnvp -@spawnlp -spawnlp (MSC) Spawn another program as a subtask -#include -short spawnlp(short mode,const char *path,const char *arg,...,NULL); -Set : errno -See also: execl,execlp,execv,execvp,fork,spawn,spawnv,spawnvp -@spawnv -spawnv (MSC) Spawn another program as a subtask -#include -short spawnv(short mode,const char *program,const char *arg[]); -Set : errno -See also: execl,execlp,execv,execvp,fork,spawn,spawnlp,spawnvp -@spawnvp -spawnvp (MSC) Spawn another program as a subtask -#include -short spawnvp(short mode,const char *program,const char *arg[]); -Set : errno -See also: execl,execlp,execv,execvp,fork,spawn,spawnlp,spawnv -@sprintf -sprintf (ANSI) Format output -#include -short sprintf(char *string,const char *format,...); -See also: cprintf,fprintf,printf,vfprintf,vprintf,vsprintf -@sputl -sputl (THEOS) Store a long in an hardware independent format -#include -long sputl(long l,char *buf); -See also: sgetl -@sqrt -sqrt (ANSI) Compute square root -#include -double sqrt(double z); -Set : errno -@srand -srand (ANSI) Seed pseudo-random number generator -#include -void srand(unsigned seed); -See also: rand -@sscanf -sscanf (ANSI) Format input from a string -#include -short sscanf(const char *string,const char *format,...); -@stat -stat (ANSI) Find file attributes -#include -short stat(char *file,struct stat *statptr); -Return : EOF or 0 -Set : errno - -struct stat { - dev_t st_dev; /* pÉriphÉrique */ - ino_t st_ino; /* numÉro d'Inode = 0 */ - mode_t st_mode; /* lsb = protections, msb = filestat */ - nlink_t st_nlink; /* nombre de links = 1 */ - uid_t st_uid; /* identificateur de propriÉtaire */ - gid_t st_gid; /* identificateur de groupe = st_uid */ - dev_t st_rdev; /* pÉriphÉrique physique */ - size_t st_size; /* taille du fichier en octets */ - time_t st_atime; /* date et heure de dernier accÈs ** */ - time_t st_mtime; /* date et heure de derniÈre modif ** */ - time_t st_ctime; /* date et heure de crÉation ** */ - unsigned short st_org; /* organisation : sÉq, key, ind, dir, prg */ - unsigned short st_rlen; /* largeur des enregistrements */ - unsigned short st_klen; /* largeur des clÉs */ - char st_grow; /* taux d'agrandissement */ -}; - -/* ** date de derniÈre modification */ -@std -std (THEOS) Set direction flag -#include -void std(void); -See also: cld -@sti -sti (THEOS) Set interrupt -#include -void sti(void); -See also: cli -@strcat -strcat (ANSI) Append one string to another -#include -char *strcat(char *to,const char *from); -See also: farcat,strncat -@strchr -strchr (ANSI) Locate the first occurence of a character in a string -#include -char *strchr(const char *string1,short c); -See also: farchr,memchr,strpbrk,strrchr,strstr -@strcmp -strcmp (ANSI) Compare two strings -#include -short strcmp(const char *string1,const char *string2); -See also: farcmp,fareq,memcmp,memeq,memicmp,streq,stricmp,strncmp,strneq, - strnicmp -@strcoll -strcoll (ANSI) Compare two strings according to the current collating sequence -#include -short strcoll(const char *s1, const char *s2); -See also: setlocale,strlwr,strupr,strxfrm -@strcpy -strcpy (ANSI) Copy one string into another -#include -char *strcpy(char *to,const char *from); -See also: farcpy,memccpy,memcpy,memmove,memrcpy,strdup,strmake,strncpy -@strcrypt -strcrypt (JMD) Crypt a string -#include <_string.h> -char *strcrypt(char *s); -@strcspn -strcspn (ANSI) Return length for which one string excludes characters in another -#include -unsigned short strcspn(const char *string1,const char *string2); -See also: strpbrk,strspn,strtok -@strdup -strdup (MSC) Makes a copy of a string in previously unallocated memory -#include -char *strdup(const char *from); -See also: farcpy,memccpy,memcpy,memmove,memrcpy,strcpy,strmake,strncpy -@strend -strend (THEOS) Locate the end of a string -#include -char *strend(const char *string); -@streq -streq (THEOS) Compare two strings for equality -#include -short streq(const char *string1,const char *string2); -See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,stricmp,strncmp,strneq, - strnicmp -@strerror -strerror (ANSI) Return a system message with the arguments pointed by _errarg -#include -char *strerror(short num); -See also: _errarg,errmsg,fperror,getmsg,perror,syserr -@strftime -strftime (ANSI) Convert a time structure into a formatted string -#include -size_t strftime(char *s,size_t len,const char *fmt,const struct tm *tp); -See also: asctime,ctime,gmtime,localtime,mktime,time -@stricmp -stricmp (MSC) Compare two buffers,ignoring the casemode of the characters -#include -short stricmp(const void *string1,const void *string2); -See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,streq,strncmp,strneq, - strnicmp -@strlen -strlen (ANSI) Return the length of a string -#include -short strlen(const char *string); -See also: farlen,strend -@strlwr -strlwr (MSC) Convert the alphabetic characters in a string to lower case -#include -char *strlwr(char *s); -See also: strupr,tolower,setlocale -@strmake -strmake (THEOS) Copy a memory buffer to a string,adding the nul terminator -#include -char *strmake(char *to,const char *from,size_t len); -See also: farcpy,memccpy,memcpy,memmove,memrcpy,strcpy,strdup,strncpy -@strncat -strncat (ANSI) Append one string onto another -#include -char *strncat(char *to,const char *from,size_t len); -See also: farcat,strcat -@strncmp -strncmp (ANSI) Compare two strings -#include -short strncmp(const char *string1,const char *string2,size_t len); -See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,streq,stricmp,strneq,strnicmp -@strncpy -strncpy (ANSI) Copy one string into another -#include -char *strncpy(char *to,const char *from,size_t len); -See also: farcpy,memccpy,memcpy,memmove,memrcpy,strcpy,strdup,strmake -@strneq -strneq (THEOS) Compare two strings for equality -#include -short strneq(const char *string1,const char *string2,size_t len); -See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,streq,stricmp,strncmp, - strnicmp -@strnfill -strnfill (THEOS) Fill a buffer with a character -#include -char *strnfill(char *buffer,size_t len,short character); -See also: farset,memset,strset,strnset -@strnicmp -strnicmp (MSC) Compare two buffers,ignoring the casemode of the characters -#include -short stricmp(const void *string1,const void *string2,size_t len); -See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,streq,stricmp,strncmp,strneq -@strnset -strnset (MSC) Fill a string with a character -void *strnset(char *buffer,short character,size_t len); -See also: farset,memset,strnfill,strset -@strpbrk -strpbrk (ANSI) Find first occurrence in a string of any character from another -#include -char *strpbrk(const char *string1,const char *string2); -See also: farchr,memchr,strchr,strrchr,strstr -@strrchr -strrchr (ANSI) Locate the last occurence of a character in a string -#include -char *strrchr(const char *string1,short c); -See also: farchr,memchr,strpbrk,strchr,strstr -@strsave -strsave (THEOS) See strdup -@strset -strset (MSC) Fill a string with a character -void *strset(char *buffer,short character); -See also: farset,memset,strnfill,strnset -@strspn -strspn (ANSI) Return length for which one string includes characters in another -#include -unsigned short strspn(const char *string1,const char *string2); -See also: strpbrk,strcspn,strtok -@strstr -strstr (ANSI) Locate the first occurence of one string within another -#include -char *strstr(const char *string1,const char *string2); -See also: farchr,memchr,strpbrk,strchr,strrchr -@strtod -strtod (ANSI) Convert string to floating point value -#include -double strtod(const char *s,char **es); -See also: atof,ftoa -@strtok -strtok (ANSI) Extract a token from a string -#include -char *strtok(char *string,char *delim); -See also: strcspn,srtrspn -@strtol -strtol (ANSI) Convert string in a specified base a to long integer -#include -double strtol(const char *s,char **es,short base); -See also: atol,ltoa,strtoul,ultoa -@strtoul -strtoul (ANSI) Convert string in a specified base a to unsigned long integer -#include -double strtoul(const char *s,char **es,short base); -See also: atol,ltoa,strtol,ultoa -@strupr -strupr (MSC) Convert the alphabetic characters in a string to upper case -#include -char *strupr(char *s); -See also: strlwr,tolower,setlocale -@strxfrm -strxfrm (ANSI) Convert a string according to the current collating sequence -#include -size_t strxfrm(char* to,char* from,size_t maxsize); -See also: setlocale,strcoll -@subb -subb (THEOS) Substract a value to a byte in another memory segment -#include -void subb(void *ofs,unsigned seg,char val); -See also: Other sub functions -@subcs -subcs (THEOS) Substract a value to a byte in the code segment -#include -void subcs(void *ofs,char val); -See also: Other sub functions -@subl -subl (THEOS) Substract a value to a long in another memory segment -#include -void subl(void *ofs,unsigned seg,long val); -See also: Other sub functions -@sublcs -sublcs (THEOS) Substract a value to a long in the code segment -#include -void sublcs(void *ofs,long val); -See also: Other sub functions -@subw -subw (THEOS) Substract a value to a word in another memory segment -#include -void subw(void *ofs,unsigned seg,short val); -See also: Other sub functions -@subwcs -subwcs (THEOS) Substract a value to a word in the code segment -#include -void subwcs(void *ofs,short val); -See also: Other sub functions -@suicide -suicide (THEOS) Kill the current sub-task -#include -void suicide(void); -See also: killtask -@swab -swab (THEOS) Swap a pair of bytes -#include -void swab(char *src,char *dest,unsigned nb); -@syserr -syserr (THEOS) Display a system message on stderr and exit the program -#include -void syserr(short rc,short num,char *arg[]); -See also: errmsg,exit,putmsg -@system -system (ANSI) Pass a command to the CSI shell for execution -#include -short system(const char *commandline); -@tan -tan (ANSI) Calculate tangent -#include -double tan(double radian); -@tanh -tanh (ANSI) Calculate hyperbolic cosine -#include -double tanh(double radian); -@tell -tell (MSC) Return current position of file's data pointer -#include -long tell(short filenum); -See also: close,creat,filelength,flush,lseek,open,_read,read,_write,write -@telldir -telldir (+UNIX) Return the current directory entry location -#include -long telldir(DIR*); -See also: opendir,closedir,readdir,seekdir,rewinddir -@tempnam -tempnam (ANSI) Generate a unique name for a temporary file -#include -char *tempnam(const char *directory,const char *name); -@termname -termname (+THEOS) Return the class name of a terminal or printer -#include <_stdio.h> -char* termname(int class); -See also: devname,termname,ttyname -@testarg -testarg (THEOS) Compare a string to a system keyword -#include -short testarg(char *arg,short keynbr); -See also: getkey,keyclose,matcharg -@testhead -testhead (THEOS) Control page heading and page wait for stdout -#include -void testhead(char *heading); -See also: datehdng,getll,getpl,pagewait -@testwild -testwild (THEOS) Test if a string include "wild cards" -#include -short testwild(char *s); -@tetd_t -tetd_t (MWC) Type to represent file time and date format -#include -typedef unsigned long tetd_t; -@tetd_to_tm -tetd_to_tm (MWC) Convert file time and date to system calendar format -#include -tm_t *tetd_to_tm(tetd_t time); -See also: tetd_to_time,time_to_tetd,tm_to_tetd -@tetd_to_time -tetd_to_time (MWC) Convert file time and date to a number of seconds -#include -time_t tetd_to_time(tetd_t time); -See also: tetd_to_tm,time_to_tetd,tm_to_tetd -@time -time (ANSI) Get current time in seconds since 01-01-1970 00:00:00 GMT -#include -time_t time(time_t *tp); -@time_t -time_t (ANSI) Type to represent time in seconds since 01-01-1970 00:00:00 GMT -#include -typedef long time_t; -@time_to_tetd -time_to_tetd (MWC) Convert a number of seconds to file time and date format -#include -tetd_t time_to_tetd(time_t t); -See also: tetd_to_tm,tetd_to_time,tm_to_tetd -@timeout -timeout (THEOS) Test if previous read failed because of a lock timeout -#include <_stdio.h> -short timeout(); -See also: lock_time -@timer -timer (THEOS) Set a semaphore on after a given time or a defined time of day -#include -void *timer(short sema_nbr,short type,long msec); -See also: alarm,msalarm,sema,semaphore,semares,semaset,semawait -@timezone -timezone (ANSI) Difference in seconds between GMT time and local time -#include -extern long timezone; -See also: daylight,tzset,tzname -@tm_to_tetd -tm_to_tetd (MWC) Convert system calendar format to file date and time -#include -tetd_t tm_to_tetd(tm_t *time); -See also: tetd_to_tm,tetd_to_time,time_to_tetd -@tmpfile -tmpfile (ANSI) Create and open a temporary file -#include -FILE *tmpfile(void); -See also: fopen,mktemp,lempnam,tmpnam -@tmpnam -tmpnam (ANSI) Generate a unique name for a temporary file -#include -char *tmpnam(char *name); -@toascii -#include -toascii (UNIX) Convert characters to ASCII -#include -short toascii(short c); -@toibmpc -toibmpc (+THEOS) Translate THEOS character to native IBM PC extended ASCII -#include -short toibmpc(short c); -See also: totheos -@tolower -tolower (ANSI) Convert characters to lower case -#include -short tolower(short c); -@topen -topen (THEOS) ??? -#include -FILE *topen(char *fname,char *mode,unsigned reclen,size_t blklen); -Set : _errnum -@tot_alloc -tot_alloc (THEOS) Compute the total amount of available memory -#include -size_t tot_alloc(void); -See also: calloc,free,malloc,max_alloc,realloc -@totheos -totheos (+THEOS) Translate IBM PC extended ASCII character to THEOS character -#include -short totheos(short c); -See also: toibmpc -@toupper -toupper (ANSI) Convert characters to upper case -#include -short toupper(short c); -@trim -trim (THEOS) Remove leading,trailing and multiple spaces -#include -char *trim(char *s); -@ttyname -ttyname (+UNIX) Return the name of the console physical device -#include <_stdio.h> -char* ttyname(FILE* stream); -See also: devname,termname,vdiname -@tzname -tzname (ANSI) Time zones names -#include -extern char *tzname[2]; -See also: daylight,timezone,tzset -@tzset -tzset (UNIX) Determine the time zone name for local time -#include -void tzset(void); -See also: daylight,timezone,tzname -@undef -#undef (ANSI) Undefine a manifest constant -#undef variable -@ungetc -ungetc (ANSI) Return character to input stream -#include -short ungetc(short c,FILE *fp); -See also: ungetch -@ungetch -ungetc (MSC) Return character to standard input -#include -short ungetch(short c); -See also: ungetc -@unlink -unlink (ANSI) Remove a file -#include -short unlink(const char *name); -Set : errno,_errnum -See also: remove -@unload -unload (THEOS) Unload a file from memory -#include -void unload(unsigned seg); -See also: load -@unlock -unlock (THEOS) Unlock a record -#include -void unlock(FILE *file); -See also: filelock,locking,reclock,recunlock -@unwait -unwait (THEOS) Awaken a program waiting for an interrupt -#include -void unwait(short pid); -See also: wait -@upcase -upcase (THEOS) See strupr -@utime -utime (+UNIX) Change the date and time of a file -#include -short utime(const char *filename,struct utimbuf *times); -Set : errno -See also: asctime,ctime,gmtime,localtime,stat,time -@utoa -utoa (THEOS) Convert an unsigned integer into an ASCII string -#include -char *utoa(char *s,unsigned i); -See also: ftoa,itoa,ltoa -@va_arg -va_arg (ANSI) Used to access erguments in a variable argument functions -#include -.... va_arg(va_list *arg_ptr,type); -See also: va_start,va_end -@va_end -va_end (ANSI) End variable argument processing -#include -void va_end(va_list *aptr); -See also: va_arg,va_start -@va_list -va_list (ANSI) Used in variable argument processing -#include -typedef long va_list[1]; -@va_start -va_start (ANSI) Start variable argument processing -#include -void va_start(va_list *arg_ptr,void *ptr); -See also: va_arg,va_end -@vdi -vdi (THEOS) Primitive access to the Virtual Device Interface -#include -void vdi(short vidnum,VDIPB *vdipb); -See also: vdiopen -@vdialpha -vdialpha( THEOS) Switch VDI to text mode -#include -void vdialpha(VDIPB *vdipb); -See also: vdigraph,vdiopen -@vdiarc -vdiarc (THEOS) Draw an arc -#include -void vdiarc(VDIPB *vdipb,short x,short y,short radius,short angle1,short angle2); -See also: vdicircle,vdiopen,vdipie -@vdibar -vdibar (THEOS) Draw a rectangle -#include -void vdibar(VDIPB *vdipb,short llx,short lly,short urx,short ury); -See also: vdiopen -@vdicircle -vdicircle (THEOS) Draw a circle -#include -void vdicircle(VDIPB *vdipb,short x,short y,short radius); -See also: vdiarc,vdiopen,vdipie -@vdiclear -vdiclear (THEOS) Clear the graphics page or perform a form feed -#include -void vdiarc(VDIPB *vdipb); -See also: vdiopen -@vdiclose -vdiclose (THEOS) Close a VDI file -#include -void vdiclose(VDIPB *vdipb); -See also: vdiopen -@vdigraph -vdigraph (THEOS) Swith to graphics mode -#include -void vdigraph(VDIPB *vdipb); -See also: vdialpha,vdiopen -@vdiline -vdiline (THEOS) Draw a line -#include -void vdiline(VDIPB *vdipb,short x1,short y1,short x2,short y2); -See also: vdiopen -@vdimark -vdimark (THEOS) Draw a marker -#include -void vdimark(VDIPB *vdipb,short x,short y); -See also: vdiopen -@vdiname -vdiname (+THEOS) Return the name of a VDI physical device -#include <_stdio.h> -char* vdiname(int vdiclass); -See also: devname,termname,ttyname -@vdiopen -vdiopen (THEOS) Open a graphics device -#include -VDIPB *vdiopen(short num); -See also: vdiclose -@vdipie -vdipie (THEOS) Draw a pie section -#include -void vdipie(VDIPB *vdipb,short x,short y,short radius,short angle1,short angle2); -See also: vdiarc,vdicircle,vdiopen -@vdisetfc -vdisetfc (THEOS) Set fill color -#include -void vdisetfc(VDIPB *vdipb,short color); -See also: vdibar,vdicircle,vdiopen,vdipie -@vdisetfs -vdisetfs (THEOS) Set fill style -#include -void vdisetfs(VDIPB *vdipb,short style); -See also: vdibar,vdicircle,vdiopen,vdipie -@vdisetlc -vdisetlc (THEOS) Set line color -#include -void vdisetlc(VDIPB *vdipb,short color); -See also: vdiarc,vdibar,vdicircle,vdiline,vdiopen,vdipie -@vdisetlh -vdisetlh (THEOS) Set line width or height -#include -void vdisetlh(VDIPB *vdipb,short size); -See also: vdiline,vdiopen -@vdisetls -vdisetls (THEOS) Set line style -#include -void vdisetls(VDIPB *vdipb,short style); -See also: vdiarc,vdibar,vdicircle,vdiline,vdiopen,vdipie -@vdisetmc -vdisetmc (THEOS) Set marker color -#include -void vdisetmc(VDIPB *vdipb,short color); -See also: vdimark,vdiopen -@vdisetmh -vdisetmh (THEOS) Set marker size or height -#include -void vdisetmh(VDIPB *vdipb,short size); -See also: vdimark,vdiopen -@vdisetms -vdisetms (THEOS) Set marker style -#include -void vdisetms(VDIPB *vdipb,short style); -See also: vdimark,vdiopen -@vdisetta -vdisetta (THEOS) Set text angle -#include -void vdisetta(VDIPB *vdipb,short color); -See also: vdiopen,vditext -@vdisettc -vdisettc (THEOS) Set text color -#include -void vdisettc(VDIPB *vdipb,short color); -See also: vdiopen,vditext -@vdisetth -vdisetth (THEOS) Set text size or height -#include -void vdisetth(VDIPB *vdipb,short size); -See also: vdiopen,vditext -@vdisettp -vdisettp (THEOS) Set text path -#include -void vdisettp(VDIPB *vdipb,short path); -See also: vdiopen,vditext -@vdisetts -vdisetts (THEOS) Set text style -#include -void vdisetts(VDIPB *vdipb,short style); -See also: vdiopen,vditext -@vditext -vditext (THEOS) Display a text string -#include -void vditext(VDIPB *vdipb,short x,short y,char *s); -See also: vdiopen -@vfprintf -vfprintf (ANSI) Print formatted output to a stream -#include -short vfprintf(const FILE *stream,const char *FORMAT,va_list arg); -See also: cprintf,fprintf,printf,sprintf,vprintf,vsprintf -@vprintf -vprintf (ANSI) Print formatted output to standard output -#include -short vprintf(const char *FORMAT,va_list arg); -See also: cprintf,fprintf,printf,sprintf,vfprintf,vsprintf -@vsprintf -vsprintf (ANSI) Print formatted output to a string -#include -short vsprintf(char *s,const char *FORMAT,va_list arg); -See also: cprintf,fprintf,printf,sprintf,vfprintf,vprintf -@wait (THEOS) Suspend a program until an interrupt occurs -#include -void wait(void); -See also: unwait -@write -write (ANSI) Write data to a file -#include -size_t write(short fd,void *buffer,size_t len); -See also: close,creat,filelength,flush,lseek,open,_read,read,tell,_write -@writek -writek (THEOS) Write a record to an indexed or keyed file -#include -short writek(FILE *fp,const char *key,const void *rec); -See also: deletek,readk,readn,readp -@xorb -xorb (THEOS) Xor a byte in another memory segment -#include -void xorb(void *ofs,unsigned seg,char mask); -See also: Other xor functions -@xorcs -xorcs (THEOS) Xor a byte in the code segment -#include -void xorcs(void *ofs,char mask); -See also: Other xor functions -@xorl -xorl (THEOS) Xor a long in another memory segment -#include -void xorl(void *ofs,unsigned seg,long mask); -See also: Other xor functions -@xorlcs -xorlcs (THEOS) Xor a long in the code segment -#include -void xorlcs(void *ofs,long mask); -See also: Other xor functions -@xorw -xorw (THEOS) Xor a word in another memory segment -#include -void xorw(void *ofs,unsigned seg,short mask); -See also: Other xor functions -@xorwcs -xorwcs (THEOS) Xor a word in the code segment -#include -void xorwcs(void *ofs,short mask); -See also: Other xor functions -#include <_time.h> -short _yday(short month,short day,short year); -See also: leapyear,_weekday -@yes_val -yes_val (THEOS) Value of yes answer -extern char yes_val; -@yesno -yesno (THEOS) Accept the answer yes or no according to the system keyword file -#include -short yesno(void); -See also: load_yn -@yield -yield (THEOS) See snu -@account -account (THEOS) Format of SYSTEM.ACCOUNT -#include -struct account { - char name[8]; /* [00] - logon id */ - char password[8]; /* [08] - password (spaces if none) */ - char id[2]; /* [10] - account number: - ascii-hex if 00-FE - else: 76543210-76543210 - *3210987 *6543210 - * = always set - if number >= 0x2000, - then synonym to account - & 0x1fff */ - char priv; /* [14] - privlege level */ - char mail_sw; /* [13] - you have mail */ - char abbrev_sw; /* [14] - CSI abbreviation switch */ - char stdsyn_sw; /* [15] - CSI synonym switch */ - char synonym[9]; /* [16] - CSI synonym fn______d */ - char rdy_sw; /* [1F] - CSI ready switch */ - char msg_sw; /* [20] - MSG switch */ - char break_chr[2]; /* [21] - break value (ascii-hex) */ - char work_drv; /* [23] - work drive code */ - char lang_code; /* [24] - default language code */ - char dec_is_comma; /* [25] - decimal is comma switch */ - char def_lib[19]; /* [26] - default library fn.ft:d */ - char mac_lib[9]; /* [39] - macro library fn______d */ - char obj_lib[9]; /* [42] - object library fn______d */ - char copy_lib[9]; /* [4B] - include library fn______d */ - char search[26]; /* [54] - search sequence */ - char cmd_lib[9]; /* [6E] - command library fn______d */ - char link_lib[9]; /* [77] - link library fn______d */ - char csi_case_sw; /* [80] - CSI lower case mode */ - char prompt[50]; /* [81] - CSI prompt */ -}; -@acb -acb (THEOS) Format of accseg in memory -#include -struct acb { - char name[8]; /* [00] - account name */ - short id; /* [08] - account number */ - char msgname[8]; /* [0A] - msg name */ -}; -@TERMINAL_FD -TERMINAL_FD (THEOS) Translate table used by international terminals -#include -struct TERMINAL_FD { - char type_code; - char terminal_name[25]; - near char *home; - near char *fon; - near char *foff; - near char *hon; - near char *hoff; - near char *right; - near char *left; - near char *down; - near char *ulon; - near char *clear; - near char *rvon; - near char *rvoff; - near char *dca; - near char *il; - near char *dl; - near char *setup; - near char *ic; - near char *dc; - near char *uloff; - near char *eol; - near char *eos; - near char *up; - near char *eu; - near char *bon; - near char *boff; - near char *mon; - near char *moff; - near char *color; - near char *koff; - near char *kon; - near char *son; - near char *soff; - near char *ISO_23; - near char *ISO_40; - near char *ISO_5B; - near char *ISO_5C; - near char *down_key; - near char *up_key; - near char *left_key; - near char *right_key; - near char *esc_key; - near char *top_key; - near char *bottom_key; - near char *delchar_key; - near char *page_fwd_key; - near char *page_bck_key; - near char *word_right_key; - near char *word_left_key; - near char *sch_fwd_key; - near char *sch_bck_key; - near char *again_key; - near char *file_key; - near char *erase_key; - near char *beg_line_key; - near char *end_line_key; - near char *case_key; - near char *save_key; - near char *quit_key; - near char *find_key; - near char *replace_key; - near char *del_left_key; - near char *transpose_key; - near char *ins_line_key; - near char *del_line_key; - near char *help_key; - near char *ulc; - near char *urc; - near char *lrc; - near char *llc; - near char *fwi; - near char *li; - near char *ri; - near char *ui; - near char *di; - near char *horiz; - near char *vert; - near char *rulc; - near char *rurc; - near char *rlrc; - near char *rllc; - near char *dulc; - near char *durc; - near char *dlrc; - near char *dllc; - near char *dfsi; - near char *dli; - near char *dri; - near char *dui; - near char *ddi; - near char *dhoriz; - near char *dvert; - near char *slave_enable; - near char *slave_disable; - near char *A_umlaut; - near char *a_umlaut; - near char *a_circumflex; - near char *a_grave; - near char *a_acute; - near char *E_acute; - near char *e_umlaut; - near char *e_circumflex; - near char *e_grave; - near char *e_acute; - near char *i_umlaut; - near char *i_circumflex; - near char *i_grave; - near char *i_acute; - near char *O_umlaut; - near char *o_umlaut; - near char *o_circumflex; - near char *o_grave; - near char *o_acute; - near char *U_umlaut; - near char *u_umlaut; - near char *u_circumflex; - near char *u_grave; - near char *u_acute; - near char *C_tail; - near char *c_tail; - near char *N_squiggle; - near char *n_squiggle; - near char *AE; - near char *ae; - near char *A_degree; - near char *a_degree; - near char *German_esset; - near char *invert_question; - near char *invert_exclaim; - near char *cent; - near char *english_pound; - near char *japenese_yen; - near char *spanish_pentada; - near char *dutch_guilder; - near char *one_quarter; - near char *one_half; - near char *y_umlaut; - near char *section; - near char *degree; - near char *bullet; - near char *A_umlaut_key; - near char *a_umlaut_key; - near char *a_circumflex_key; - near char *a_grave_key; - near char *a_acute_key; - near char *E_acute_key; - near char *e_umlaut_key; - near char *e_circumflex_key; - near char *e_grave_key; - near char *e_acute_key; - near char *i_umlaut_key; - near char *i_circumflex_key; - near char *i_grave_key; - near char *i_acute_key; - near char *O_umlaut_key; - near char *o_umlaut_key; - near char *o_circumflex_key; - near char *o_grave_key; - near char *o_acute_key; - near char *U_umlaut_key; - near char *u_umlaut_key; - near char *u_circumflex_key; - near char *u_grave_key; - near char *u_acute_key; - near char *C_tail_key; - near char *c_tail_key; - near char *N_squiggle_key; - near char *n_squiggle_key; - near char *AE_key; - near char *ae_key; - near char *A_degree_key; - near char *a_degree_key; - near char *German_esset_key; - near char *invert_question_key; - near char *invert_exclaim_key; - near char *cent_key; - near char *english_pound_key; - near char *japenese_yen_key; - near char *spanish_pentada_key; - near char *dutch_guilder_key; - near char *one_quarter_key; - near char *one_half_key; - near char *y_umlaut_key; - near char *section_key; - near char *degree_key; - near char *bullet_key; - near char *ISO_5D; - near char *ISO_5E; - near char *ISO_60; - near char *ISO_7B; - near char *ISO_7C; - near char *ISO_7D; - near char *ISO_7E; - near char *ISO_23_key; - near char *ISO_40_key; - near char *ISO_5B_key; - near char *ISO_5C_key; - near char *ISO_5D_key; - near char *ISO_5E_key; - near char *ISO_60_key; - near char *ISO_7B_key; - near char *ISO_7C_key; - near char *ISO_7D_key; - near char *ISO_7E_key; -}; -@TERMINAL_FE -TERMINAL_FE (THEOS) Translate table used by US terminals -#include -struct TERMINAL_FE { - char type_code; - char terminal_name[25]; - near char *home; - near char *fon; - near char *foff; - near char *hon; - near char *hoff; - near char *right; - near char *left; - near char *down; - near char *ulon; - near char *clear; - near char *rvon; - near char *rvoff; - near char *dca; - near char *il; - near char *dl; - near char *setup; - near char *ic; - near char *dc; - near char *uloff; - near char *eol; - near char *eos; - near char *up; - near char *eu; - near char *bon; - near char *boff; - near char *mon; - near char *moff; - near char *color; - near char *koff; - near char *kon; - near char *son; - near char *soff; - char filler[8]; - near char *down_key; - near char *up_key; - near char *left_key; - near char *right_key; - near char *esc_key; - near char *top_key; - near char *bottom_key; - near char *delchar_key; - near char *page_fwd_key; - near char *page_bck_key; - near char *word_right_key; - near char *word_left_key; - near char *sch_fwd_key; - near char *sch_bck_key; - near char *again_key; - near char *file_key; - near char *erase_key; - near char *beg_line_key; - near char *end_line_key; - near char *case_key; - near char *save_key; - near char *quit_key; - near char *find_key; - near char *replace_key; - near char *del_left_key; - near char *transpose_key; - near char *ins_line_key; - near char *del_line_key; - near char *help_key; - near char *ulc; - near char *urc; - near char *lrc; - near char *llc; - near char *fwi; - near char *li; - near char *ri; - near char *ui; - near char *di; - near char *horiz; - near char *vert; - near char *rulc; - near char *rurc; - near char *rlrc; - near char *rllc; - near char *dulc; - near char *durc; - near char *dlrc; - near char *dllc; - near char *dfsi; - near char *dli; - near char *dri; - near char *dui; - near char *ddi; - near char *dhoriz; - near char *dvert; - near char *slave_enable; - near char *slave_disable; -}; -@PRINTER_FC -PRINTER_FC (THEOS) Translate table used by printers -#include -struct PRINTER_FC { - char type_code; - char printer_name[25]; - near char *bold_on; - near char *bold_off; - near char *ul_on; - near char *ul_off; - near char *ital_on; - near char *ital_off; - near char *color_on; - near char *color_off; - near char *compress_on; - near char *compress_off; - near char *wide_on; - near char *wide_off; - near char *high_on; - near char *high_off; - near char *ulc; - near char *urc; - near char *lrc; - near char *llc; - near char *fwi; - near char *li; - near char *ri; - near char *ui; - near char *di; - near char *horiz; - near char *vert; - near char *rulc; - near char *rurc; - near char *rlrc; - near char *rllc; - near char *dulc; - near char *durc; - near char *dlrc; - near char *dllc; - near char *dfsi; - near char *dli; - near char *dri; - near char *dui; - near char *ddi; - near char *dhoriz; - near char *dvert; - near char *slave_enable; - near char *slave_disable; - near char *A_umlaut; - near char *a_umlaut; - near char *a_circumflex; - near char *a_grave; - near char *a_acute; - near char *E_acute; - near char *e_umlaut; - near char *e_circumflex; - near char *e_grave; - near char *e_acute; - near char *i_umlaut; - near char *i_circumflex; - near char *i_grave; - near char *i_acute; - near char *O_umlaut; - near char *o_umlaut; - near char *o_circumflex; - near char *o_grave; - near char *o_acute; - near char *U_umlaut; - near char *u_umlaut; - near char *u_circumflex; - near char *u_grave; - near char *u_acute; - near char *C_tail; - near char *c_tail; - near char *N_squiggle; - near char *n_squiggle; - near char *AE; - near char *ae; - near char *A_degree; - near char *a_degree; - near char *German_esset; - near char *invert_question; - near char *invert_exclaim; - near char *cent; - near char *english_pound; - near char *japenese_yen; - near char *spanish_pentada; - near char *dutch_guilder; - near char *one_quarter; - near char *one_half; - near char *y_umlaut; - near char *section; - near char *degree; - near char *bullet; - near char *ISO_23; - near char *ISO_40; - near char *ISO_5B; - near char *ISO_5C; - near char *ISO_5D; - near char *ISO_5E; - near char *ISO_60; - near char *ISO_7B; - near char *ISO_7C; - near char *ISO_7D; - near char *ISO_7E; -}; -@elt -elt (THEOS) Exclusive Lock Table -#include -struct elt { - void *lock_ofs; /* [00] - offset address */ - unsigned lock_seg; /* [04] - segment address */ - unsigned char lock_own; /* [06] - pid of owner */ - char lock_flag; /* [07] - set if waiting */ -}; - -#define ELT ((struct elt *)0) -#define ELTLEN 8 -#define ELTSEG 0x0078 -@fcb -fcb (THEOS) File Control Block -See FILE -@FILE -FILE (THEOS) File Control Block -#include -typedef struct fcb { - char _fst; /* [00] - 1 - file status: - 76543210 - ªªªªªªª£© = disk full on last write - ªªªªªª£©© = tape no HDR2 labels - ªªªªª£©©© = tape end of file - ªªªª£©©©© = printer needs close - ªªª£©©©©© = printer - ªª£©©©©©© = buffer has write data - ª£©©©©©©© = buffer allocated - £©©©©©©©© = opened */ - char _flub; /* [01] - 5 - logical unit,255 = null */ - short _faccess; /* [02] - 11 - access mode: - 111111 - 5432109876543210 - ªªªªªªªªªªªªªªª£© = input - ªªªªªªªªªªªªªª£©© = output - ªªªªªªªªªªªªª£©©© = lock - ªªªªªªªªªªªª£©©©© = temp file (erase) - ªªªªªªªªªªª£©©©©© = stream - ªªªªªªªªªª£©©©©©© = relative - ªªªªªªªªª£©©©©©©© = indexed - ªªªªªªªª£©©©©©©©© = keyed - ªªªªªªª£©©©©©©©©© = append mode - ªªªªªª£©©©©©©©©©© = private - ªªªªª£©©©©©©©©©©© = last prt FF - ªªªª£©©©©©©©©©©©© = pipe file - ªªª£©©©©©©©©©©©©© = printer pass-thru - ªª£©©©©©©©©©©©©©© = last prt FE - ª£©©©©©©©©©©©©©©© = lock writes - £©©©©©©©©©©©©©©©© = ix node rd/wr */ - short _freclen; /* [04] - 19 - record length */ - short _fkeylen; /* [06] - 27 - key length */ - char *_fbufbase; /* [08] - 801 - location of buffer */ - long _fbufsize; /* [0C] - 817 - buffer size */ - char *_fbufptr; /* [10] - 833 - next char position */ - long _fcount; /* [14] - 849 - number of chars left */ - long _floc; /* [18] - 865 - location next read or write */ - short _fsa; /* [1C] - 371 - slot number of fsa */ - char *_fnxtkey; /* [1E] - 889 - pointer to IX key storage */ - short _fnxt; /* [22] - 395 - type of IX key */ - long _fixnxt; /* [24] - 913 - disk address of IX key */ - char *_ftapefn; /* [28] - 929 - pointer to tape file name */ - char _filler[10]; /* [2C] - filler */ -} FILE; /* len of fcb = 54 bytes */ - -struct fcb_286 { - char _fst; /* [00] - 1 - file status: - 76543210 - ªªªªªªª£© = disk full on last write - ªªªªªª£©© = tape no HDR2 labels - ªªªªª£©©© = tape end of file - ªªªª£©©©© = printer needs close - ªªª£©©©©© = printer - ªª£©©©©©© = buffer has write data - ª£©©©©©©© = buffer allocated - £©©©©©©©© = opened */ - char _flub; /* [01] - 5 - logical unit,255 = null */ - short _faccess; /* [02] - 11 - access mode: - 111111 - 5432109876543210 - ªªªªªªªªª£© = input - ªªªªªªªª£©© = output - ªªªªªªª£©©© = lock - ªªªªªª£©©©© = temp file (erase) - ªªªªª£©©©©© = stream - ªªªª£©©©©©© = relative - ªªª£©©©©©©© = indexed - ªª£©©©©©©©© = keyed - ª£©©©©©©©©© = append mode - £©©©©©©©©©© = private */ - short _freclen; /* [04] - 19 - record length */ - short _fkeylen; /* [06] - 27 - key length */ - near char *_fbufbase; /* [08] - 35 - location of buffer */ - unsigned _fbufsize; /* [0A] - 43 - buffer size */ - near char *_fbufptr; /* [0C] - 51 - next char position */ - unsigned _fcount; /* [0E] - 59 - number of chars left */ - long _floc; /* [10] - 67 - location next read or write */ - short _fsa; /* [14] - 83 - slot number of fsa in nucleus */ -}; /* len of fcb_286 = 22 bytes */ -@fdb -fdb (THEOS) File Directory Block -#include -struct fdb { - char filename[8]; /* [00] - filename or member name */ - char filetype[8]; /* [08] - filetype */ - char filestat; /* [10] - file status: - 76543210 - 00000000 empty - 11111111 erased - 10000000 library - 01000000 sub directory - 00010000 normal stream - 00001000 relative - 00000100 keyed - 00000010 indexed - xxx00001 program - xxx = 000 8086 & 80286 real - xxx = 001 80286 protected - xxx = 010 80386 */ - unsigned short fileowner; /* [11] - owner id */ - char protect; /* [13] - protection code: - 76543210 - ªªªªªªª£© = read protect - ªªªªªª£©© = write protect - ªªªªª£©©© = execute protect - ªªªª£©©©© = erase protect - ªªª£©©©©© = shared read protect - ªª£©©©©©© = shared write protect - ª£©©©©©©© = shared execute protect - £©©©©©©©© = shared erase protect */ - union { - struct { - year : 6; /* years since 1986 [0-31] = [1986 - 2017] */ - month : 4; /* month [1 - 12] */ - day : 5; /* day [1 - 31] */ - hour : 5; /* hour [0 - 23] */ - min : 6; /* minute [0 - 59] */ - sec : 6; /* second [0 - 59] */ - } new; - struct { - char type; /* code 0=old,!0=new */ - year : 4; /* years since 1980 [0-15] = [1980 - 1995] */ - month : 4; /* month [1 - 12] */ - day : 5; /* day [1 - 31] */ - hour : 5; /* hour [0 - 23] */ - min : 6; /* minute [0 - 59] */ - : 0; - } old; - unsigned long datetime; - } filedate; /* [14] - date & time of last write */ - long filesize; /* [18] - file size in bytes */ - unsigned short reclen; /* [1C] - record length */ - unsigned short keylen; /* [1E] - key len */ - struct { - unsigned short ext_ct; /* [20] - sector count */ - char ext_addr[3]; /* [22] - sector address */ - } extlev1[5]; /* [20] - 5 level 1 extents */ - char extlev2a[3]; /* [39] - address of sector contain 51 exts */ - char extlev2b[3]; /* [3C] - address of sector contain 51 exts */ - char filegrow; /* [3F] - extent increase amount; - 0 = dynamic,chop at close - n = filesize/n,no chop */ -}; /* (fdb len = 64) */ -@fsa -fsa (THEOS) File Save Area -#include -struct fsa { - near struct diskucb *fsa_ucb; /* [00] - file ucb */ - long fsa_sect; /* [02] - fdb sector address */ - near struct fdb *fsa_ofs; /* [06] - fdb offset within sector */ - short fsa_count; /* [08] - open fcb count */ - char fsa_lock; /* [0A] - file locked: - 76543210 - ª£© deny read - £©© deny write */ - char fsa_write; /* [0B] - file modified if non zero */ - char fsa_temp; /* [0C] - erase at final close */ - char fsa_1[3]; /* [0D] - not used */ - char filestat; /* [10] - file status: - 0x10 normal stream - 0x08 direct - 0x04 keyed - 0x02 indexed */ - unsigned short fileowner; /* [11] - owner id */ - char protect; /* [13] - protection code: - 0x8? shared erase protect - 0x4? shared execute protect - 0x2? shared write protect - 0x1? shared read protect - 0x?8 erase protect - 0x?4 execute protect - 0x?2 write protect - 0x?1 read protect */ - union { - struct { - year : 6; /* years since 1986 [0 - 31] */ - month : 4; /* month [1 - 12] */ - day : 5; /* day [1 - 31] */ - hour : 5; /* hour [0 - 23] */ - min : 6; /* minute [0 - 59] */ - sec : 6; /* second [0 - 59] */ - } new; - struct { - char type; /* code 0=old,!0=new */ - year : 4; /* years since 1980 [0 - 15] */ - month : 4; /* month [1 - 12] */ - day : 5; /* day [1 - 31] */ - hour : 5; /* hour [0 - 23] */ - min : 6; /* minute [0 - 59] */ - : 0; - } old; - unsigned long datetime; - } filedate; /* [14] - date & time of last write */ - long filesize; /* [18] - file size in bytes */ - unsigned short reclen; /* [1C] - record length */ - unsigned short keylen; /* [1E] - key len */ - struct { - unsigned short ext_ct; /* [20] - sector count */ - char ext_addr[3]; /* [22] - sector address */ - } extlev1[5]; - char extlev2a[3]; /* [39] - addr of sector with 51 ext */ - char extlev2b[3]; /* [3C] - addr of sector with 51 ext */ - char filegrow; /* [3F] - extent growth factor */ -}; /* (fsa len = 64) */ - -#define FSASEG 0x0088 -@filedate -filedate (JMD) File's date and time structure -#include -typedef union filedate { /* date & time of last write */ - struct { - year : 6; /* years since 1986 [0-31] = [1986-2017] */ - month : 4; /* month [1-12] */ - day : 5; /* day [1-31] */ - hour : 5; /* hour [0-23] */ - min : 6; /* minute [0-59] */ - sec : 6; /* second [0-59] */ - } new; - struct { - type : 8; /* Type 0=old,!0=new */ - year : 4; /* years since 1980 [0-15] = [1980-1995] */ - month : 4; /* month [1-12] */ - day : 5; /* day [1-31] */ - hour : 5; /* hour [0-23] */ - min : 6; /* minute [0-59] */ - } old; - tetd_t datetime; -} FILEDATE; -@tetd_t -tetd_t (JMD) Packed file's date and time -#include -typedef unsigned long tetd_t; -@lconv -lconv (ANSI) Locale structure -#include -struct lconv { - char *decimal_point; - char *thousands_sep; - char *grouping; - char *int_curr_symbol; - char *currency_symbol; - char *mon_decimal_point; - char *mon_thousands_sep; - char *mon_grouping; - char *positive_sign; - char *negative_sign; - char int_frac_digits; - char frac_digits; - char p_cs_precedes; - char p_sep_by_space; - char n_cs_precedes; - char n_sep_by_space; - char p_sign_posn; - char n_sign_posn; -}; - -#define LC_ALL 31 -#define LC_COLLATE 1 -#define LC_CTYPE 2 -#define LC_NUMERIC 4 -#define LC_TIME 8 -#define LC_MONETARY 16 -@complex -complex (UNIX) Complex number -#include -struct complex { - double x; - double y; -}; -@nuc -nuc (THEOS) Nucleus data structure -#include -struct nuc { - char pad1[4]; /* [00] filler */ - struct { - char year; /* [04] year - 1900 */ - char month; /* [05] month (1 - 12) */ - char day; /* [06] day of month (1 - 31) */ - char hour; /* [07] hour of day (0 - 23) */ - char min; /* [08] minute of hour (0 - 59) */ - char sec; /* [09] second of minute (0 - 59) */ - } time_of_day; /* [04] system date & time */ - char dateopt; /* [0A] date option: */ - #define kanji 1 /* 16 bit Japanese Kanji */ - #define extime 2 /* external clock chip */ - #define exdate 4 /* external date chip */ - #define havusr 8 /* have USER module */ - #define aform 16 /* American MM/DD/YY */ - #define eform 32 /* European DD-MM-YY */ - #define iform 64 /* International YY.MM.DD */ - #define whist 128 /* write history records */ - char curpid; /* [0B] current process number */ - char cpu[4]; /* [0C] cpu */ - near char *curpcb; /* [10] current PCB pointer */ - unsigned short slice; /* [12] slice interval (msec) */ - near char *mstick; /* [14] address of msec tick */ - near char *snutick; /* [16] address of snu tick */ - unsigned short spoolseg; /* [18] DESPOOL segment */ - char version[5]; /* [1A] version number */ - char mfgnum; /* [1F] manufacturer number */ - unsigned short sernum; /* [20] serial number */ - long csisize; /* [22] SYSTEM.THEOS386.CSI filesize */ - struct { - unsigned short size; - char addr[3]; - } csiext[4]; /* [26] SYSTEM.THEOS386.CSI extent info */ - unsigned short csistack; /* [3A] SYSTEM.THEOS386.CSI stack len */ - char errmsg[3]; /* [3C] SYSTEM.THEOS386.MESSAGE extent info */ - unsigned short pdlseg; /* [3F] segment of PDL */ - unsigned pipenum; /* [41] next pipe number */ - char npxpid; /* [43] 80287/80387 owner pid */ - char slpcnt; /* [44] number of sleepers */ - char spdrv; /* [45] SYSTEM.SPOOLER drive */ - char sppid; /* [46] spooler pid */ - char snu_val[3]; /* [47] select next user */ - long cputime; /* [4A] time of day in msec (software) */ - short cache_seg; /* [4E] directory cache head segment */ - char srlo; /* [50] SunRiver */ - char public[26]; /* [51] public drive list A-Z */ - near char *rpb; /* [6B] RPB head seg address */ - char srhi; /* [6D] SunRiver */ - near char *rlt; /* [6E] RLT head offset address */ - unsigned pipe_hd; /* [70] PIPE head segment */ - near char *teb; /* [72] TEB head offset address */ - char tz[12]; /* [74] time zone info */ - unsigned short svdeb; /* [80] DEBUG386 use */ - long csicode; /* [82] SYSTEM.THEOS386.CSI code length */ - unsigned short msgseg; /* [86] SYSTEM.THEOS386.MESSAGE segment */ - char msgnum; /* [88] SYSTEM.THEOS386.MESSAGE suffix */ - char sync_pid; /* [89] process id of sync'er */ - unsigned short keyseg; /* [8A] SYSTEM.THEOS386.KEYWORD segment */ - char keynum; /* [8C] SYSTEM.THEOS386.KEYWORD suffix */ - char mca; /* [8D] cpu flags: */ - - #define MCA_BUS 1 - #define EISA_BUS 2 - #define ISA_BUS 32 - - #define CPU_286 64 - #define CPU_386 16 - #define CPU_486 4 - - #define FPU 8 - - #define MDOS_VER 128 - - unsigned mem_size; /* [8E] memory size at bootup */ - unsigned shmemseg; /* [90] shared memory segment */ - char sysname[16]; /* [92] system identification */ - unsigned short synseg; /* [A2] SYSTEM.THEOS386.SYNONYM segment */ - char synnum; /* [A4] SYSTEM.THEOS386.SYNONYM suffix */ - unsigned short devseg; /* [A5] SYSTEM.THEOS386.DEVNAMES segment */ - unsigned short gucb; /* [A7] VDI UCB segment address */ - char dflang; /* [A9] default language code */ - short cache_delay; /* [AA] cache write delay in .1 seconds */ - unsigned short accseg; /* [AC] ACCOUNT segment address */ - unsigned short csidata; /* [AE] SYSTEM.THEOS386.CSI data length */ - unsigned short csiheap; /* [B0] SYSTEM.THEOS386.CSI heap length */ - unsigned long pdbr; /* [B2] Page Descriptor Base reg */ - unsigned short ptseg; /* [B6] Page Table Selector */ - unsigned short v86seg; /* [B8] V86 Monitor segment */ - char v86pids[32]; /* [BA] V86 pid masks */ - unsigned char v86count; /* [DA] V86 Monitor count */ - char v86_inuse; /* [DB] set while loading V86 */ - unsigned short network; /* [DC] Network phantom pid */ - unsigned short ncb_seg; /* [DE] Network socket control block segment */ - short v86reserve; /* [E0] V86 reserve I/O segment */ - unsigned short flt_seg; /* [E2] File Lock Table */ - char copyright[28]; /* [E4] copyright notice */ - char ucb[1]; /* [100] Unit control blocks */ -}; -@pcb -pcb (THEOS) Process Control Block -#include -struct pcb { - unsigned short pstat; /* [00] - process status: */ - #define WAITING 0x00ff /* if non zero,waiting,else either \ - running or ready to run */ - #define W_INT 0x0001 /* set if waiting for interrupt */ - #define W_LOCK 0x0002 /* set if waiting for resource lock */ - #define W_SCREEN 0x0004 /* waiting for screen switch */ - #define SLEEPING 0x0008 /* set if sleeping */ - #define STOPPED 0x0010 /* set if stopped */ - #define W_PAUSE 0x0020 /* set if BREAK-S */ - #define W_SEMA 0x0040 /* set if waiting for semaphore */ - #define SR_PAGE 0x0100 /* set if need cntx swtch THEO+Grafx */ - #define MUST_COMPLETE 0x0200 /* set if task cannot be context - switched away */ - - unsigned short tib; /* [02] - TSS selector */ - - unsigned short pending; /* [04] - traps pending */ - #define QUITPEND 0x0001 /* set if BREAK-Q pending */ - #define CANPEND 0x0002 /* set if BREAK-C pending */ - #define ALRMPEND 0x0004 /* set if alarm pending */ - #define OVFPEND 0x0008 /* set if overflow/underflow pending */ - #define DIV0PEND 0x0010 /* set if divide by zero pending */ - #define FUNPEND 0x0020 /* set if function error pending */ - #define BOUNDPEN 0x0040 /* set if array bounds pending */ - #define FPEPEND 0x0080 /* set if floating point exception */ - #define SESSPEND 0x0200 /* set if need to switch sessions */ - #define FORCPEND 0x1000 /* set if FORCE pending */ - #define DEBPEND 0x2000 /* set if BREAK-D pending */ - #define KILLPEND 0x4000 /* set if kill syscall pending */ - #define STAGE 0x8000 /* set if staging the trap */ - - char taskprty; /* [06] - priority level */ - char tasklev; /* [07] - task level,0 == main task */ - unsigned long cputime; /* [08] - amount of CPU time */ - unsigned long sleeptime; /* [0C] - sleep time remain */ - near struct pcb *prtylink; /* [10] - link to next PID same prty */ - unsigned char taskfath; /* [12] - PID of parent task */ - char waitsema; /* [13] - semaphore if W_SEMA */ -}; -@pdl -pdl (THEOS) Public Device List -#include -struct pdl { - char ucbnum; /* ucb index */ - char pid; /* owner pid + 1 */ - short open_ct; /* number of opens */ -}; -@pipehdr -pipehdr (THEOS) PIPE control structure -#include -struct pipehdr { - unsigned pnext; /* fwd link to next pipe */ - unsigned pprev; /* back link to prev pipe */ - char pname[16]; /* pipe name (space pad) */ - char prd_ct; /* reader count */ - char pwr_ct; /* writer count */ - char prd_pid; /* pid of read waiter */ - char pwr_pid; /* pid of write waiter */ - unsigned psize; /* size of pipe buffer (exclude header) */ - unsigned pcount; /* number of chars in buffer */ - unsigned phead; /* read offset */ - unsigned ptail; /* write offset */ - char pbuf[]; /* pipe circular buffer */ -}; -@rlt -rlt (THEOS) Rocord Lock Table -#include -struct rlt { - short fsa_num; /* [00] - fsa number */ - unsigned char lockpid; /* [02] - locking pid plus one */ - long lockad; /* [03] - byte address */ - near struct rlt *fwd_rlt; /* [07] - fwd ptr to next */ -}; /* rlt len = 9 bytes */ -@scr -scr (THEOS) System Communication Region -#include -struct scr { - char logonname[8]; /* [00] - user name */ - unsigned short usernum; /* [08] - user number */ - char logdate[3]; /* [0A] - logon date */ - char logtime[3]; /* [0D] - logon time */ - unsigned char conmask; /* [10] - console mask: - 76543210 - ªªªªªªª£ = 1st char ctl is ok - ªªªªªª£© = suppress output if stack - ªªªªª£©© = stacked lines - ªªªª£©©© = no page wait - ªªª£©©©© = output suppress - ªª£©©©©© = inverted case - ª£©©©©©© = upper case - £©©©©©©© = echo mode */ - unsigned char csisw; /* [11] - csi switch: - 76543210 - ªªªªªªª£ = return from logon - ªªªªªª£© = execute csi command - ªªªªª£©© = from exec - ªªªª£©©© = nomsg - ªªª£©©©© = rdymsg - ªª£©©©©© = usersyn - ª£©©©©©© = stdsyn - £©©©©©©© = abbrev */ - unsigned char execsw; /* [12] - exec switch: - 76543210 - ªªªª£©©© = CSI lower case - ªªª£©©©© = error - ªª£©©©©© = noecho - ª£©©©©©© = trace - £©©©©©©© = ctl on */ - char pgmtime[3]; /* [13] - program start time */ - char pgmname[8]; /* [16] - program name */ - unsigned short execloc; /* [1E] - location in system.exec */ - near char *slofs; /* [20] - stacked line offset */ - unsigned short slseg; /* [22] - stacked line segment */ - near char *memhead; /* [24] - malloc head */ - char pipenr; /* [26] - next pipe number (0-25) */ - char privlev; /* [27] - privlege level */ - char lub[52]; /* [28] - lub table - unsigned short trapseg; /* [5C] - signal code segment */ - near void *quittrap; /* [5E] - break,q trap */ - near void *cantrap; /* [60] - break,c trap */ - near void *alrmtrap; /* [62] - alarm trap */ - near void *ovftrap; /* [64] - overflow/underflow trap */ - near void *div0trap; /* [66] - divide by zero trap */ - near void *funtrap; /* [68] - function argument trap */ - near void *boundtrap; /* [6A] - array bounds trap */ - near void *fpetrap; /* [6C] - floating point except trap */ - long cputimes; /* [6E] - cpu time start */ - char err_ext[3]; /* [72] - SYSTEM.THEOS.MESSAGE xtent */ - char workdrive; /* [75] - default work drive */ - char searchseq[26]; /* [76] - search sequence */ - unsigned char foreign; /* [90] - Foreign language switch - 76543210 - ªªªª.... = language code - ªªª£©©©© = not used - ªª£©©©©© = THEOS/Z80 style modify - ª£©©©©©© = no quit - £©©©©©©© = decimal is comma */ - char deflib[19]; /* [91] - default library */ - char cmdlib[9]; /* [A4] - cmd library */ - char maclib[9]; /* [AD] - macro library */ - char objlib[9]; /* [B6] - object library */ - char copylib[9]; /* [BF] - copy library */ - char linklib[9]; /* [C8] - link library */ - char synfile[9]; /* [D1] - synonym file */ - unsigned short comad; /* [DA] - BASIC286 common seg addr */ - char conbuf[8]; /* [DC] - console buffer (ungetch) */ - char tsb[16]; /* [E4] - tab set block */ - char cmdbuf[140]; /* [F4] - cmd storage */ - unsigned short quittraphi; /* [180] - high word */ - unsigned short cantraphi; /* [182] - high word */ - unsigned short alrmtraphi; /* [184] - high word */ - unsigned short ovftraphi; /* [186] - high word */ - unsigned short div0traphi; /* [188] - high word */ - unsigned short funtraphi; /* [18A] - high word */ - unsigned short boundtraphi; /* [18C] - high word */ - unsigned short fpetraphi; /* [18E] - high word */ - unsigned short memheadhi; /* [190] - high word */ - unsigned short cebphi; /* [192] - high word */ - unsigned short clev; /* [194] - call csi level */ - unsigned short cexec; /* [196] - execloc at call csi */ - near void *cebp; /* [198] - ebp at call csi */ - unsigned short cnlev; /* [19A] - next call csi level */ - char echo; /* [19C] - set if echoing */ - char echolub; /* [19D] - echo device */ - short echobuf; /* [19E] - buffer seg,if disk echo */ - short echofsa; /* [1A0] - fsa number */ - short echokl; /* [1A2] - offset if echo to spool */ - short echorl; /* [1A4] - page# if echo to spool */ - unsigned char echoct; /* [1A6] - buffer char ct */ - char loadtrap; /* [1A7] - debug trap on load */ - unsigned short snbseg; /* [1A8] - sema name block seg */ - char semaphor[8]; /* [1AA] - 64 semaphore bits */ - char sp_ll[4]; /* [1B2] - spool prt line len */ - char sp_pl[4]; /* [1B6] - spool prt page len */ - char sp_que[4]; /* [1BA] - spool prt que number */ - char sp_copies[4]; /* [1BE] - spool prt # copies */ - char sp_class[4]; /* [1C2] - spool prt class */ - char graphlub[4]; /* [1C6] - graphic lub number */ - unsigned short graphwork[4]; /* [1CA] - graphic work buffer */ - char graphdev[4]; /* [1D2] - graphic device number */ - char peeker; /* [1D6] - peeker pid number + 1 */ - char peekch; /* [1D7] - char to be peeked */ - char forcech; /* [1D8] - char from FORCE command */ - char cache_write_thru; /* [1D9] - set if write thru cache */ - unsigned short main_scr; /* [1DA] - alias to main task SCR */ - unsigned short main_data; /* [1DC] - alias to main task DATA */ - unsigned short atexit_ofshi; /* [1DE] - high word */ - char fill2[6]; /* [1E0] - filler */ - unsigned char lock_wait; /* [1E6] - seconds to wait for lock */ - unsigned char lock_remain; /* [1E7] - number seconds remain */ - char slave_ll; /* [1E8] - slave printer line length */ - char slave_pl; /* [1E9] - slave printer page length */ - char slave_ol; /* [1EA] - slave printer overflow */ - char slave_cl; /* [1EB] - slave printer cur line */ - char slave_cc; /* [1EC] - slave printer class code */ - unsigned short slave_seg; /* [1ED] - slave printer class seg */ - unsigned short environ_seg; /* [1EF] - segment of environment */ - near char *atexit_ofs; /* [1F1] - at exit offset */ - unsigned short atexit_seg; /* [1F3] - at exit segment */ - char csi_color[4]; /* [1F5] - normal crt color */ - unsigned cmdnum; /* [1F9] - command number */ - char fill3[5]; /* [1FB] - filler */ -}; /* length = 512 */ -@jmp_buf -jmp_buf (THEOS) Non-Local Jumps -#include -struct FarPointer { - void *ptr; - short seg; -}; - -typedef struct jmp_buf { - struct FarPointer _jmp_eip; /* return pointer */ - struct FarPointer _jmp_esp; /* stack pointer */ - void *_jmp_ebp; /* frame pointer */ - long _jmp_reg[3]; /* registers */ -} jmp_buf; -@tm -tm (ANSI) Date and time structure -#include -struct tm { - short tm_sec; /* seconds after the minute [0,60] */ - short tm_min; /* minutes after the hour [0,59] */ - short tm_hour; /* hours since midnight [0,23] */ - short tm_mday; /* day of the month [1,31] */ - short tm_mon; /* months since January [0,11] */ - short tm_year; /* years since 1900 */ - short tm_wday; /* days since Sunday [0,6] */ - short tm_yday; /* days since January 1 [0,365] */ - short tm_isdst; /* Daylight Savings Time flag */ -}; -@ucb -ucb (THEOS) Unit Control Block for character devices -#include -struct ucb { - unsigned short devaddr; /* [00] - memory address,offset always 0 */ - unsigned short iobuff1; /* [02] - i/o buffer 1 */ - char devnr; /* [04] - device number */ - char devunit; /* [05] - unit within device */ - unsigned short ubuf_ofs2; /* [06] - high ubuf_ofs pointer */ - char devtype; /* [08] - device type: - 76543210 - ªªªªª100 byte i/o - ªªªª£©©© = console - ªªª£©©©© = 2nd char of DCA - ªª£©©©©© = 3rd char of DCA - ª£©©©©©© = keyboard off - £©©©©©©© = 2nd char of BREAK */ - char devowner; /* [09] - owner process id */ - char classnr; /* [0A] - class number */ - char ll; /* [0B] - line length */ - char pl; /* [0C] - page length */ - char ol; /* [0D] - overflow lines */ - char baud; /* [0E] - baud rate: - 76543210 - xxxx.... If Sync option bit: - 0001.... BSC - 0010.... SDLC - 0011.... HDLC - 0100.... X.25 - 0101.... SNA - 0110.... GPIB - 0111.... thru 1111.... user defined - ....xxxx ASYNC baud rates: - 0 = no software baud - 1 = 56000 - 2 = 38400 - 3 = 110 - 4 = 135 - 5 = 150 - 6 = 300 - 7 = 600 - 8 = 1200 - 9 = 1800 - 10 = 2400 - 11 = 3600 - 12 = 4800 - 13 = 7200 - 14 = 9600 - 15 = 19200 - ....xxxx SYNC baud rates: - 1 = 1200 - 2 = 2400 - 3 = 4800 - 4 = 9600 - 5 = 19200 - 6 = 38400 - 7 = 48000 - 8 = 56000 - 9 = 64000 - 10 = 100000 - 11 = 200000 - 12 = 500000 - 13 = 800000 */ - char lfdly; /* [0F] - line feed delay */ - char ffdly; /* [10] - form feed delay */ - char option; /* [11] - option byte: - 76543210 - 00...... no parity - 01...... parity zero - 10...... parity odd - 11...... parity even - ..1..... synchronous - ...1.... alf - ....1... 8 bit words - .....001 dtr enable (1) - .....010 xon/xoff enable (2) - .....011 etx/ack enable (3) - .....100 cts enable (4) - .....101 xpc (5) */ - char curline; /* [12] - current line system use */ - char curcol; /* [13] - current column system use */ - unsigned short transeg; /* [14] - translate segment addr */ - near void *ubuf_ofs; /* [16] - user buffer offset */ - unsigned short ubuf_seg; /* [18] - user buffer segment */ - char scantmp; /* [1A] - scan code temporary */ - char prot_st; /* [1B] - protocol (XON/XOFF) status */ - char scan_st; /* [1C] - scan code status: - 76543210 - ªªªªªªª£© = shift - ªªªªªª£©© = compose - ªªªªª£©©© = ctl - ªªªª£©©©© = alt - ªªª£©©©©© = scroll lock - ªª£©©©©©© = num lock - ª£©©©©©©© = caps lock - £©©©©©©©© = Kanji mode */ - char brk_chr; /* [1D] - break character */ - short attrib; /* [1E] - system use (saves crt attribute) - 5432109876543210 - ªªªªªªªªªªªªªª£ = protect - ªªªªªªªªªªªªª£© = format - ªªªªªªªªªªªª£©© = reverse - ªªªªªªªªªªª£©©© = blink - ªªªªªªªªªª£©©©© = underline - ªªªªªªªªª£©©©©© = takes space - ªªªªªªªª£©©©©©© = last was attr - ªªªªªªª£©©©©©©© = caused newline - ªªªªªª£©©©©©©©© = slave prt attached - ªªªªª£©©©©©©©©© = slave prt enabled - ªªªª£©©©©©©©©©© = esc mode - ªªª£©©©©©©©©©©© = status mode - ªª£©©©©©©©©©©©© = status ignore - ª£©©©©©©©©©©©©© = last was prt cr - £©©©©©©©©©©©©©© = line graphic mode */ - /* ucb len = 32 */ -}; -@diskucb -diskucb (THEOS) Unit Control Block for disk devices -#include -struct diskucb { - unsigned short devaddr; /* [00] - memory address,offset always 0 */ - unsigned short iobuff1; /* [02] - i/o buffer 1 */ - char devnr; /* [04] - device number */ - char devunit; /* [05] - unit within device */ - unsigned short iobuff2; /* [06] - i/o buffer 2 */ - char devtype; /* [08] - device type: - 76543210 - .....001 = disk - ....1001 = disk,need label - .001.... = single density - .010.... = double density - .011.... = cyl0 = single,other dbl - .100.... = cyl0,hd0=128 other 256 - .101.... = 2048 byte sects - .110.... = 1024 byte sects - .111.... = 512 byte sects (IBM PC) - 0....... = removable volume - 1....... = fixed volume */ - char devowner; /* [09] - owner process id 0xff = public */ - char volname[8]; /* [0A] - volume id */ - unsigned short dirsize; /* [12] - directory size */ - short cyls; /* [14] - number of cylinders */ - char heads; /* [16] - number of heads */ - char sects; /* [17] - number of sectors */ - char hdldly; /* [18] - head load delay */ - char stpdly; /* [19] - step delay */ - char stsdly; /* [1A] - step settle delay */ - short curcyl; /* [1B] - current cylinder */ - char diskfill[3]; /* [1D] - work space 3 bytes */ - /* diskucb len = 32 */ -}; -@tapeucb -tapeucb (THEOS) Unit Control Block for tape devices -#include -struct tapeucb { - unsigned short devaddr; /* [00] - memory address,offset always 0 */ - unsigned short iobuff1; /* [02] - i/o buffer 1 */ - char devnr; /* [04] - device number */ - char devunit; /* [05] - unit within device */ - unsigned short iobuff2; /* [06] - i/o buffer 2 */ - char devtype; /* [08] - device type: - 76543210 - .....010 = tape */ - char devowner; /* [09] - owner process id */ - char volname[8]; /* [0A] - volume id */ - short blocknr; /* [12] - block count */ - short filenr; /* [14] - file number */ - short volnr; /* [16] - volume number */ - char devtrack; /* [18] - tape track or channel number */ - unsigned short iostat; /* [19] - status of last I/O */ - unsigned short rdlen; /* [1B] - length of last read */ - char tapefill[3]; /* [1D] - filler,tapeucb len = 32 */ -}; -@diskcntl -diskcntl (THEOS) Extended I/O structure for disk devices -#include -struct diskcntl { - short c_cmd; /* command code: - 0 = home heads to cylinder 0 - 1 = return drive status (MFG dependent) - 2 = read sectors - 3 = write sectors - 4 = format (MFG dependent) - 99 = land heads to safe landing zone */ - long c_sect; /* sector number */ - char *c_buf; /* buffer offset */ - unsigned short c_seg; /* buffer segment */ - short c_count; /* sector count */ - short c_cyl; /* cylinder number (format) */ - short c_head; /* head number (format) */ - short c_den; /* density (format) */ -}; -@bytecntl -bytecntl (THEOS) Extended I/O structure for character devices -#include -struct bytecntl { - short c_cmd; /* command code: - 1 = buffer status: - 76543210 - ª£© = TxBUF not full - £©© = RxBUF not empty - 2 = modem status: - 5432109876543210 - 111100001111ªªª£© = DSR - 111100001111ªª£©© = CTS - 111100001111ª£©©© = RI - 111100001111£©©©© = DCD - 3 = send break - 4 = use c_seg:c_buf input buffer: - struct { - short buf_len; - short buf_count; - short next_store; - short next_fetch; - char buf[buf_len]; - }; - 5 = raise DTR modem control - 6 = drop DTR modem control - 7 = raise RTS modem control - 8 = drop RTS modem control */ - short c_word1; - short c_word2; - char *c_buf; /* offset to buffer */ - unsigned short c_seg; /* selector for buffer */ -}; -@tapecntl -tapecntl (THEOS) Extended I/O structure for tape devices -#include -struct tapecntl { - short c_cmd; /* command code: - 1 = status: - 76543210 - ªªªª£© = BOT - ªªª£©© = EOT - ªª£©©© = Write Protect - ª£©©©© = Ready - £©©©©© = Streamer - 2 = rewind - 3 = rewind & unload - 4 = write tape mark - 7 = erase tape (format) - 8 = re-tension - 9 = get length of last read - 110 = read - 111 = write */ - unsigned short c_tseg; /* read/write segment */ - char *c_tbuf; /* read/write offset */ - unsigned short c_tlen; /* read/write length */ -}; -@utimbuf -utimbuf (UNIX) File time modification structure -#include -struct utimbuf { - time_t actime; - time_t modtime; -}; -@VDIPB -VDIPB (THEOS) Vdi Parameters Block -#include -typedef struct { - short *control; - short *intin; - short *ptsin; - short *intout; - short *ptsout; - short vdinum; - unsigned vdiseg; -} VDIPB; -@UBUFFER -UBUFFER (THEOS) User Buffering -#include <_ucb.h> -typedef struct ubuffer { - short buf_len; - volatile short buf_count; - volatile short next_store; - volatile short next_fetch; - char buf[]; -} UBUFFER; -@lub -lub (THEOS) Device Logical Unit Blocks Numbers -#include -enum lub { - ADISK,BDISK,CDISK,DDISK,EDISK,FDISK,GDISK,HDISK,IDISK,JDISK, - KDISK,LDISK,MDISK,NDISK,ODISK,PDISK,QDISK,RDISK,SDISK,TDISK, - UDISK,VDISK,WDISK,XDISK,YDISK,ZDISK, - CONI,CONO, - PRT1,PRT2,PRT3,PRT4, - COM1,COM2,COM3,COM4, - TAP1,TAP2,TAP3,TAP4, - COM5,COM6,COM7,COM8,COM9,COM10,COM11,COM12,COM13,COM14,COM15, - COM16 -}; -@ From 9c56a9194f99e64568c01040db8f69e21419a2b5 Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 10 Sep 2020 19:16:56 +0200 Subject: [PATCH 21/37] Delete c.idx --- cmd/c.idx | Bin 7836 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 cmd/c.idx diff --git a/cmd/c.idx b/cmd/c.idx deleted file mode 100644 index 0b6a27ca2041f5c5367957b97b401e95a54152d3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7836 zcmYkBd7u=FJqirl-5I(6y{ z0Oaz1l;$d4GoKXjs0dz?I7ta3+YE=bD(1A4{m@OSUKMwXQ7x8oB`?broXo?lUf)wP zzv^MD-d6ELKSOuRifi_cL$znyXNwd;6T zjb`X#tG<*Qo>wV2O)OF)@%g%Qx2N6|@jj9>YGi;>{RsIe$#9cWimi8`;<{d%;v>Z< z#c?}|7G=0jA$9RjfkGjVYj;v`Qw-{_6yRwK)K1x1wFW-1K<(lI)B-1|Vvk)&As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qiJYZ*QNU;8-W$1E$bwC?Z8HBxeA?Oiki4u#H{D#W+$J>Teha2{0%e?%u$JNFwkBwNhQv)6Ae&%(qIGm zlT?#!`fEks^?6{MH<@z7$>R-yCM%T*7Ee)Ra)j@QQq7)zvbJSBARxsDXQ}~Ne7&X# zSLFbKCCZ68K^-<-9Gpr_9AB|qmN-|PVH^#g_2SiPWCgB(X{U%T809kl{P#@>?GK+y zzrevW4e*}(dXV?0-uG0mD+m@-FRX zP>%Rd08fmWvY)TU{0n4`=;pxYE6Yyxfl_8O;w$IMHT;)`#hXEA3Y%lp#lp<1pi_SUUrn>rZw99u43Ejix%0+*6T5cK(78v_2PRLAV!xADKB zY8){8SwWWMbEkhWbK_$VSJ?>iSpr zZfC5(ja#=vGSy%1(k}mXRD}22i!LYjgqIIAItxp(>9-@_%se%2-``xN#*Rby7%oP6 l^0nmCCr& Date: Thu, 10 Sep 2020 19:17:27 +0200 Subject: [PATCH 22/37] Delete emacs.rc_curses --- cmd/emacs.rc_curses | 129 -------------------------------------------- 1 file changed, 129 deletions(-) delete mode 100644 cmd/emacs.rc_curses diff --git a/cmd/emacs.rc_curses b/cmd/emacs.rc_curses deleted file mode 100644 index 88be80c..0000000 --- a/cmd/emacs.rc_curses +++ /dev/null @@ -1,129 +0,0 @@ -; EMACS.RC: Standard MicroEMACS Startup program -; for MicroEMACS 3.13 and above -; (C)opyright 1987-99 by Daniel M Lawrence -; Last Update: 11/13/93 - -;set $discmd TRUE -write-message "[Setting up....]" -;set $debug TRUE - -; If you hate clocks or position counters, comment these -;set $timeflag TRUE -set $posflag TRUE -set $sscroll TRUE - -; Set Default Global modes - -add-global-mode "white" -add-global-mode "BLACK" - -; Bring up Online-help system - -store-procedure get-help - set $discmd FALSE - source ehelp.cmd - set $discmd TRUE -!endm - -macro-to-menu get-help "Help>MicroEmacs help" - -; Set up default modes - -add-mode "white" -add-mode "BLACK" - -store-procedure set-default-mode -; set $debug TRUE - set %rctmp &sri $cfname "." - !if &equ %rctmp 0 - !return - !endif - set %rctmp &mid $cfname &add %rctmp 1 5 - !if &or &seq %rctmp "c" &seq %rctmp "h" - add-mode "cmode" - delete-mode "theox" - set $hardtab 4 - kill-abbrevs - !endif - !if &or &seq %rctmp "cpp" &seq %rctmp "hpp" - add-mode "cmode" - delete-mode "theox" - set $hardtab 4 - kill-abbrevs - !endif - !if &seq %rctmp "b" - add-mode "cmode" - add-mode "abbrev" - delete-mode "theox" - set $hardtab 2 - execute-file babbrevs.cmd - !endif - !if &seq %rctmp "basic" - add-mode "cmode" - add-mode "abbrev" - add-mode "theox" - set $hardtab 2 - execute-file babbrevs.cmd - !endif - !if &or &seq %rctmp "mss" &seq %rctmp "txt" - add-mode "wrap" - delete-mode "cmode" - delete-mode "theox" - set $hardtab 8 - kill-abbrevs - !endif -!endm -set $readhook set-default-mode - -; ***** Rebind the Function key group - -bind-to-key search-forward FN1 -bind-to-key search-reverse FN2 -bind-to-key hunt-forward FN3 -bind-to-key hunt-backward FN4 -;bind-to-key toggle-fkeys FN5 -macro-to-key get-help FN6 -bind-to-key next-window FN7 -bind-to-key previous-window FN8 -bind-to-key exit-emacs FN9 -bind-to-key save-file FN0 - -store-procedure toggle-insert - !if &gre &mod $cmode 64 31 - delete-mode "over" - !else - add-mode "over" - !endif -!endm -macro-to-key toggle-insert FNC - -store-procedure convert-to-utf8 -; set $debug TRUE - set %cmode &band $cmode 16384 - !if &equ %cmode 16384 - unmark-buffer - filter-buffer "theoxutf" - delete-mode "theox" - !else - write-message "[File already uses Unicode character set]" - !endif - !force set $debug FALSE -!endm - -store-procedure convert-to-theox -; set $debug TRUE - set %cmode &band $cmode 16384 - !if &equ %cmode 0 - unmark-buffer - filter-buffer "utftheox" - add-mode "theox" - !else - write-message "[File already uses TheoX character set]" - !endif - !force set $debug FALSE -!endm - -macro-to-menu convert-to-utf8 "Modify>Convert to UTF-8" -macro-to-menu convert-to-theox "Modify>Convert to TheoX" - -execute-file tpage.cmd From 698bfda3662a30071b644148d4b5e050464c6412 Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 10 Sep 2020 19:17:45 +0200 Subject: [PATCH 23/37] Delete tpage.cmd --- cmd/tpage.cmd | 315 -------------------------------------------------- 1 file changed, 315 deletions(-) delete mode 100644 cmd/tpage.cmd diff --git a/cmd/tpage.cmd b/cmd/tpage.cmd deleted file mode 100644 index 36009b9..0000000 --- a/cmd/tpage.cmd +++ /dev/null @@ -1,315 +0,0 @@ -; TPAGE.CMD: TxBasic language MENU Page -; for MicroEMACS 3.9e and above -; - -; set up the "clean" procedure - -store-procedure clean - delete-buffer "[b-indent]" - delete-buffer "[b-indent-brace]" - delete-buffer "[b-check]" - delete-buffer "[b-compile]" - delete-buffer "[b-compile-release]" - delete-buffer "[b-compile-speed]" - delete-buffer "[b-compile-debug]" - delete-buffer "[b-compile-gdb]" - delete-buffer "[b-run]" - delete-buffer "[b-debug]" - delete-buffer "[b-gdb]" - delete-buffer "[b-new-if]" - delete-buffer "[b-new-switch]" - delete-buffer "[b-new-for]" - delete-buffer "[b-new-while]" - set $cmode %oldmode - set $gmode %oldgmode -!endm - -store-procedure b-indent -; set $debug TRUE - unmark-buffer - filter-buffer &cat "txf --unbrace --upper -i" $hardtab - !force set $debug FALSE -!endm - -store-procedure b-indent-brace -; set $debug TRUE - unmark-buffer - filter-buffer &cat "txf --brace --upper -i" $hardtab - !force set $debug FALSE -!endm - -store-procedure b-compile -; set $debug TRUE - !if %rcfkeys - !force toggle-fkeys - !endif - delete-other-windows - delete-buffer "[S-F9 prev error S-F10 next error]" - save-file - set %cfname $cfname - set %cmode &band $cmode 16384 - !if &equ %cmode 0 - !force pipe-command &cat &cat %command " --utf8 " $cfname - !else - !force pipe-command &cat %command $cfname - !endif - name-buffer "[S-F9 prev error S-F10 next error]" - end-of-file - !if &equ $curline 1 - !force delete-mode "VIEW" - insert-string &cat &cat %cfname " successfully " %work - unmark-buffer - !force 1 resize-window - add-mode "VIEW" - !force delete-mode "CMODE" - next-window - !else - beginning-of-file - !force 5 resize-window - add-mode "VIEW" - !force delete-mode "CMODE" - next-window - beginning-of-file - execute-procedure "b-next-error" - !endif - !force set $debug FALSE -!endm - -store-procedure b-check -; set $debug TRUE - set %command "mepipe txlint " - set %work "checked" - execute-procedure "b-compile" - !force set $debug FALSE -!endm - -store-procedure b-compile-release -; set $debug TRUE - set %command "mepipe txb -T -C" - set %work "compiled" - execute-procedure "b-compile" - !force set $debug FALSE -!endm - -store-procedure b-compile-speed -; set $debug TRUE - set %command "mepipe txb" - set %work "compiled" - execute-procedure "b-compile" - !force set $debug FALSE -!endm - -store-procedure b-compile-debug -; set $debug TRUE - set %command "mepipe txb -d -T" - set %work "compiled" - execute-procedure "b-compile" - !force set $debug FALSE -!endm - -store-procedure b-compile-gdb -; set $debug TRUE - set %command "mepipe txb -g -T -C" - set %work "compiled" - execute-procedure "b-compile" - !force set $debug FALSE -!endm - -store-procedure b-run -; set $debug TRUE - set %rctmp &sri $cfname "." - set %cfname &mid $cfname 1 &sub %rctmp 1 - shell-command &cat "merun ./" %cfname - !force set $debug FALSE -!endm - -store-procedure b-gdb -; set $debug TRUE - set %rctmp &sri $cfname "." - set %cfname &mid $cfname 1 &sub %rctmp 1 - shell-command &cat "gdb -tui ./" %cfname - !force set $debug FALSE -!endm - -store-procedure b-prev-error -; set $debug TRUE - delete-other-windows - split-current-window - select-buffer "[S-F9 prev error S-F10 next error]" - add-mode "VIEW" - !force 5 resize-window - beginning-of-line - !force search-reverse ", line " - !if &seq $status FALSE - write-message "[No more error]" - previous-window - !return - !endif - 7 forward-character - set-mark - end-of-word - set %line $region - previous-window - !force %line goto-line - !force set $debug FALSE -!endm - -store-procedure b-next-error -; set $debug TRUE - delete-other-windows - split-current-window - select-buffer "[S-F9 prev error S-F10 next error]" - add-mode "VIEW" - !force 5 resize-window - !force search-forward ", line " - !if &seq $status FALSE - write-message "[No more error]" - previous-window - !return - !endif - set-mark - end-of-word - set %line $region - previous-window - !force %line goto-line - !force set $debug FALSE -!endm - -store-procedure b-new-if - set %cond @"Logical expression: " -; set $debug TRUE - insert-string &cat "IF " %cond - newline-and-indent - newline-and-indent - insert-string "ELSE" - newline-and-indent - handle-tab - newline-and-indent - insert-string "IFEND" - newline-and-indent - delete-previous-character - 4 previous-line - handle-tab - end-of-line - !force set $debug FALSE -!endm - -store-procedure b-new-select - set %cond @"Expression: " -; set $debug TRUE - insert-string &cat "SELECT " %cond - newline-and-indent - newline-and-indent - insert-string "CASE" - newline-and-indent - handle-tab - newline-and-indent - insert-string "CEND" - newline-and-indent - delete-previous-character - 6 previous-line - end-of-line - !force set $debug FALSE -!endm - -; FOR NEXT -store-procedure b-new-for - set %cond @"Variable name: " -; set $debug TRUE - insert-string &cat &cat "FOR " %cond "=" - newline-and-indent - handle-tab - newline-and-indent - insert-string &cat "NEXT " %cond - 2 previous-line - end-of-line - !force set $debug FALSE -!endm - -; -; WHILE WEND -store-procedure b-new-while - set %cond @"Logical expression: " -; set $debug TRUE - insert-string &cat "WHILE " %cond - newline-and-indent - handle-tab - newline-and-indent - insert-string "WEND" - previous-line - end-of-line - !force set $debug FALSE -!endm - -store-procedure toggle-errors - !if %rcerrors - !goto rcfoff - !endif - -; toggle errors window on - save-window - 1 next-window - !if &sequal $cbufname "emacs.hlp" - delete-window - !endif - !if ¬ &sequal $cbufname "[S-F9 prev error S-F10 next error]" - 1 split-current-window - 1 select-buffer "[S-F9 prev error S-F10 next error]" - add-mode "red" - add-mode "WHITE" - !force 5 resize-window - 1 goto-line - !endif - set %rcfkeys TRUE - !force restore-window - !if &sequal $cbufname "[S-F9 prev error S-F10 next error]" - next-window - !endif - write-message "[Errors window ON]" - !return - - ;Toggle the error window off -*rcfoff - save-window - 1 next-window - !if &sequal "[S-F9 prev error S-F10 next error]" $cbufname - delete-window - !endif - !force restore-window - write-message "[Errors window OFF]" - set %rcerrors FALSE -!endm - -macro-to-key b-indent S-FN1 -macro-to-key b-indent-brace S-FN2 -macro-to-key b-check S-FN3 -macro-to-key b-compile-release S-FN4 -macro-to-key b-compile-speed S-FN5 -macro-to-key b-compile-debug S-FN6 -macro-to-key b-compile-gdb S-FN7 -macro-to-key b-run S-FN8 -macro-to-key b-prev-error S-FN9 -macro-to-key b-next-error S-FN0 - -macro-to-menu b-indent "TxBasic>Format b" -macro-to-menu b-indent-brace "TxBasic>Format w" -macro-to-menu b-check "TxBasic>Check" -macro-to-menu b-compile-release "TxBasic>Compile r" -macro-to-menu b-compile-speed "TxBasic>Compile for s" -macro-to-menu b-compile-debug "TxBasic>Compile for T" -macro-to-menu b-compile-gdb "TxBasic>Compile for g" -macro-to-menu b-run "TxBasic>Run" -macro-to-menu b-gdb "TxBasic>Run t" -macro-to-menu b-prev-error "TxBasic>Prev" -macro-to-menu b-next-error "TxBasic>Next" -macro-to-menu b-new-if "TxBasic>IF" -macro-to-menu b-new-select "TxBasic>SELECT" -macro-to-menu b-new-for "TxBasic>FOR" -macro-to-menu b-new-while "TxBasic>WHILE" - -; Set up CMODE -add-mode CMODE -add-global-mode CMODE -set $hardtab 5 - -write-message "[TxBasic perspective loaded]" From d068bd3f44ad13bea387a6c3008243d049d4a066 Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 10 Sep 2020 19:17:59 +0200 Subject: [PATCH 24/37] Delete tpage.cmd_nocurses --- cmd/tpage.cmd_nocurses | 269 ----------------------------------------- 1 file changed, 269 deletions(-) delete mode 100644 cmd/tpage.cmd_nocurses diff --git a/cmd/tpage.cmd_nocurses b/cmd/tpage.cmd_nocurses deleted file mode 100644 index 8625640..0000000 --- a/cmd/tpage.cmd_nocurses +++ /dev/null @@ -1,269 +0,0 @@ -; TPAGE.CMD: TxBasic language MENU Page -; for MicroEMACS 3.9e and above -; - -; set up the "clean" procedure -store-procedure clean - delete-buffer "[b-indent]" - delete-buffer "[b-indent-brace]" - delete-buffer "[b-check]" - delete-buffer "[b-compile]" - delete-buffer "[b-run]" - delete-buffer "[b-new-if]" - delete-buffer "[b-new-switch]" - delete-buffer "[b-new-for]" - delete-buffer "[b-new-while]" - set $cmode %oldmode - set $gmode %oldgmode -!endm - -; make sure the function key window is up - set %rcfkeys FALSE - toggle-fkeys - write-message "Loading..." - -; Write out the page instructions - save-window - 1 next-window - beginning-of-file - delete-mode "VIEW" - set $curcol 25 - overwrite-string " F1 indent source F2 indent with braces F11 convert to UTF-8" - next-line - set $curcol 25 - overwrite-string " F3 check syntax F4 compile F12 convert to TheoX" - next-line - set $curcol 25 - overwrite-string " F5 previous error F6 next error " - next-line - set $curcol 18 - overwrite-string "TXB " - set $curcol 25 - overwrite-string " F7 IF ELSE ENDIF F8 SELECT CASE CEND " - next-line - set $curcol 25 - overwrite-string " F9 FOR NEXT F10 WHILE WEND " - unmark-buffer - beginning-of-file - add-mode "VIEW" - !force restore-window - update-screen - -; - -store-procedure b-indent -; set $debug TRUE - unmark-buffer - filter-buffer &cat "txf --unbrace -i" $hardtab - !force set $debug FALSE -!endm - -store-procedure b-indent-brace -; set $debug TRUE - unmark-buffer - filter-buffer &cat "txf --brace -i" $hardtab - !force set $debug FALSE -!endm - -store-procedure b-check -; set $debug TRUE - !if %rcfkeys - !force toggle-fkeys - !endif - delete-other-windows - save-file - pipe-command &cat "txlint " $cfname - delete-buffer "[F5 prev error F6 next error]" - name-buffer "[F5 prev error F6 next error]" - add-mode "VIEW" - delete-mode "CMODE" - !force 5 resize-window - previous-window - !force set $debug FALSE -!endm - -store-procedure b-compile -; set $debug TRUE - !if %rcfkeys - !force toggle-fkeys - !endif - delete-other-windows - save-file - set %cfname $cfname - split-current-window - delete-buffer "[F5 prev error F6 next error]" - select-buffer "[F5 prev error F6 next error]" - add-mode "VIEW" - !force 5 resize-window - pipe-command &cat "txb " %cfname - !force set $debug FALSE -!endm - -store-procedure b-prev-error -; set $debug TRUE - delete-other-windows - split-current-window - select-buffer "[F5 prev error F6 next error]" - add-mode "VIEW" - !force 5 resize-window - beginning-of-line - !force search-reverse ", line " - !if &seq $status FALSE - write-message "[No more error]" - previous-window - !return - !endif - 7 forward-character - set-mark - end-of-word - set %line $region - previous-window - !force %line goto-line - !force set $debug FALSE -!endm - -store-procedure b-next-error -; set $debug TRUE - delete-other-windows - split-current-window - select-buffer "[F5 prev error F6 next error]" - add-mode "VIEW" - !force 5 resize-window - !force search-forward ", line " - !if &seq $status FALSE - write-message "[No more error]" - previous-window - !return - !endif - set-mark - end-of-word - set %line $region - previous-window - !force %line goto-line - !force set $debug FALSE -!endm - -store-procedure b-new-if - set %cond @"Logical expression: " -; set $debug TRUE - insert-string &cat "IF " %cond - newline-and-indent - newline-and-indent - insert-string "ELSE" - newline-and-indent - handle-tab - newline-and-indent - insert-string "IFEND" - newline-and-indent - delete-previous-character - 4 previous-line - handle-tab - end-of-line - !force set $debug FALSE -!endm - -store-procedure b-new-select - set %cond @"Expression: " -; set $debug TRUE - insert-string &cat "SELECT " %cond - newline-and-indent - newline-and-indent - insert-string "CASE" - newline-and-indent - handle-tab - newline-and-indent - insert-string "CEND" - newline-and-indent - delete-previous-character - 6 previous-line - end-of-line - !force set $debug FALSE -!endm - -; FOR NEXT -store-procedure b-new-for - set %cond @"Variable name: " -; set $debug TRUE - insert-string &cat &cat "FOR " %cond "=" - newline-and-indent - handle-tab - newline-and-indent - insert-string &cat "NEXT " %cond - 2 previous-line - end-of-line - !force set $debug FALSE -!endm - -; -; WHILE WEND -store-procedure b-new-while - set %cond @"Logical expression: " -; set $debug TRUE - insert-string &cat "WHILE " %cond - newline-and-indent - handle-tab - newline-and-indent - insert-string "WEND" - previous-line - end-of-line - !force set $debug FALSE -!endm - -store-procedure toggle-errors - !if %rcerrors - !goto rcfoff - !endif - -; toggle errors window on - save-window - 1 next-window - !if &sequal $cbufname "emacs.hlp" - delete-window - !endif - !if ¬ &sequal $cbufname "[F5 prev error F6 next error]" - 1 split-current-window - 1 select-buffer "[F5 prev error F6 next error]" - add-mode "red" - add-mode "WHITE" - !force 5 resize-window - 1 goto-line - !endif - set %rcfkeys TRUE - !force restore-window - !if &sequal $cbufname "[F5 prev error F6 next error]" - next-window - !endif - write-message "[Errors window ON]" - !return - - ;Toggle the error window off -*rcfoff - save-window - 1 next-window - !if &sequal "[F5 prev error F6 next error]" $cbufname - delete-window - !endif - !force restore-window - write-message "[Errors window OFF]" - set %rcerrors FALSE -!endm - -macro-to-key b-indent S-FN1 -macro-to-key b-indent-brace S-FN2 -macro-to-key b-check S-FN3 -macro-to-key b-compile S-FN4 -macro-to-key b-prev-error S-FN5 -macro-to-key b-next-error S-FN6 -macro-to-key b-new-if S-FN7 -macro-to-key b-new-select S-FN8 -macro-to-key b-new-for S-FN9 -macro-to-key b-new-while S-FN0 - -; Set up CMODE -set %oldmode $cmode -set %oldgmode $gmode -add-mode CMODE -add-global-mode CMODE -set $hardtab 5 - -write-message "[TxBasic MENU page loaded]" From 5126d0324eb79cc1cd13af8ecc7ffb141333ac22 Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 10 Sep 2020 19:19:31 +0200 Subject: [PATCH 25/37] SCO OpenServer 5 builder --- os5/cc/estruct.h | 1299 +++++++++++++++++++++++ os5/cc/makefile | 106 ++ os5/cc/uemacs_4.04/cdmt.config | 34 + os5/cc/uemacs_4.04/clean | 3 + os5/cc/uemacs_4.04/input/microema.cmpnt | 25 + os5/cc/uemacs_4.04/input/microema.pkg | 200 ++++ os5/cc/uemacs_4.04/input/microema.prd | 6 + os5/cc/uemacs_4.04/install | 1 + os5/cc/uemacs_4.04/makesso | 25 + os5/cc/uemacs_4.04/packem | 15 + os5/cc/uemacs_4.04/remove | 16 + os5/gcc/bin/emacs | Bin 0 -> 697260 bytes os5/gcc/estruct.h | 1299 +++++++++++++++++++++++ os5/gcc/makefile | 107 ++ 14 files changed, 3136 insertions(+) create mode 100644 os5/cc/estruct.h create mode 100644 os5/cc/makefile create mode 100644 os5/cc/uemacs_4.04/cdmt.config create mode 100644 os5/cc/uemacs_4.04/clean create mode 100644 os5/cc/uemacs_4.04/input/microema.cmpnt create mode 100644 os5/cc/uemacs_4.04/input/microema.pkg create mode 100644 os5/cc/uemacs_4.04/input/microema.prd create mode 100644 os5/cc/uemacs_4.04/install create mode 100644 os5/cc/uemacs_4.04/makesso create mode 100644 os5/cc/uemacs_4.04/packem create mode 100644 os5/cc/uemacs_4.04/remove create mode 100644 os5/gcc/bin/emacs create mode 100644 os5/gcc/estruct.h create mode 100644 os5/gcc/makefile diff --git a/os5/cc/estruct.h b/os5/cc/estruct.h new file mode 100644 index 0000000..9788585 --- /dev/null +++ b/os5/cc/estruct.h @@ -0,0 +1,1299 @@ +/* ESTRUCT: Structure and preprocesser defined for + MicroEMACS 4.00 + + (C)Copyright 1995 by Daniel Lawrence + written by Daniel Lawrence + based on code by Dave G. Conroy, + Steve Wilhite and George Jones +*/ + +#ifdef LATTICE +#undef LATTICE /* don't use their definitions...use ours */ +#endif +#ifdef MSDOS +#undef MSDOS +#endif +#ifdef WINNT +#undef WINNT +#endif +#ifdef LINUX +#undef LINUX +#endif +#ifdef AMIGA +#undef AMIGA +#endif +#ifdef EGA +#undef EGA +#endif +#ifdef CTRLZ +#undef CTRLZ +#endif + +/* Program Identification..... + + PROGNAME should always be MicroEMACS for a distribution + unmodified version. People using MicroEMACS as a shell + for other products should change this to reflect their + product. Macros can query this via the $progname variable +*/ + +#define PROGNAME "MicroEMACS" +#define VERSION "4.04" + +/* Machine/OS definitions */ +/* [Set one of these!!] */ + +#define AMIGA 0 /* AmigaDOS */ +#define AOSVS 0 /* Data General AOS/VS */ +#define AUX 0 /* Apple UNIX for Macintosh */ +#define AIX 0 /* IBM UNIX for various machines*/ +#define AVIION 0 /* Data General AViiON */ +#define BSD 0 /* UNIX BSD 4.2 and ULTRIX */ +#define FINDER 0 /* Macintosh OS */ +#define FREEBSD 0 /* FREEBSD 386 version 2 or + */ +#define HPUX8 0 /* HPUX HP 9000 ver 8 or less */ +#define HPUX9 0 /* HPUX HP 9000 ver 9 */ +#define LINUX 0 /* Linux */ +#define MPE 0 /* HP MPE/XL */ +#define MSDOS 0 /* MS-DOS */ +#define WINNT 0 /* MS-Win NT */ +#define OS2 0 /* Microsoft or IBM OS/2 */ +#define SMOS 0 /* Supermax UNIX System V */ +#define SUN 0 /* SUN v4.0 */ +#define TOS 0 /* ST520, TOS */ +#define USG 1 /* UNIX system V */ +#define VMS 0 /* VAX/VMS */ +#define WMCS 0 /* Wicat's MCS */ +#define XENIX 0 /* IBM-PC SCO XENIX */ + +/* Compiler definitions */ +/* [Set one of these!!] */ +#define ALCYON 0 /* ALCYON Atari ST compiler */ +#define AZTEC 0 /* Aztec C 4.00e ONLY for the amiga now... */ +#define DGC 0 /* Data General AOS/VS C... */ +#define GCC 0 /* the GNU C compiler */ +#define IC 0 /* Rational Systems Instant C */ +#define LATTICE 0 /* Lattice 2.14 through 3.0 compilers */ +#define MSC 0 /* MicroSoft C compile version 3 thru 7 */ +#define MWC 0 /* Mark Williams C */ +#define TURBO 0 /* Turbo C and Borland C++ under MSDOS */ +#define UNIX 1 /* a standard UNIX compiler (cc) */ +#define ZTC 0 /* Zortech C/C++ 1.02 thru 2.10 under MSDOS */ + +/* Machine stack growth direction. */ +/* [Set this to 1 if your machine stack grows UP!!!] */ +/* data general mv/eclipse series stack grows up. */ +/* dec vax series stack grows down... got it??? */ + +#define STACK_GROWS_UP 0 + +/* Debugging options */ +#define RAMSIZE 0 /* dynamic RAM memory usage tracking */ +#define RAMSHOW 0 /* auto dynamic RAM reporting */ +#define RAMTRCK 0 /* send debug info to MALLOC.DAT */ +#define DEBUG_SEARCH 0 /* pop some search info on patterns */ + +/* Special keyboard/network definitions */ + +#define ATKBD 0 /* AT-style keyboard with F11, F12 & grey keys */ +#define WANGPC 0 /* WangPC - mostly escape sequences */ +#define VT100 0 /* Handle VT100 style keypad - NOT VMS. */ +#define KEYPAD 0 /* VMS - turn on and off application */ + /* keypad automatically */ +#define XONDATA 0 /* VMS - set to force /NOTTSYNC/NOHOSTSY */ +#define RMSIO 0 /* VMS - skip the rotten C runtime and */ + /* use RMS directly */ +#define OPTMEM 0 /* VMS 5.0 and up - use a less standard */ + /* but more efficient memory allocator */ + +/* Terminal Output definitions */ +/* [Set one of these!!] */ + +#define ANSI 0 /* ANSI escape sequences */ +#define CURSES 0 /* Use CURSES */ +#define DASHER 0 /* DG Dasher 2xx/4xx crts */ +#define DG10 0 /* Data General system/10 */ +#define FMR 0 /* Fujitsu FMR series driver */ +#define HP110 0 /* HP110 screen driver */ +#define HP150 0 /* HP150 screen driver */ +#define I55 0 /* IBM PS55 DOS J4.0/V */ +#define IBMPC 0 /* IBM-PC CGA/MONO/EGA/VGA drvr */ +#define MAC 0 /* Macintosh */ +#define NEC 0 /* NEC-9801VM driver */ +#define OS2NPM 0 /* OS/2 non-Presentation Mgr. */ +#define SMG 0 /* SMG library on VMS */ +#define ST52 0 /* Atari 520/1040ST screen */ +#define TERMCAP 1 /* Use TERMCAP */ +#define TIPC 0 /* TI Profesional PC driver */ +#define VT52 0 /* VT52 terminal (Zenith). */ +#define NTCON 0 /* Windows NT console */ +#define XVT 0 /* XVT windowing system */ +#define Z309 0 /* Zenith 100 PC family driver */ + +/* Windowing system style (pick one) */ + +#define WINDOW_TEXT 1 /* [default] Text mode */ +#define WINDOW_MSWIN 0 /* MicroSoft Windows */ +#define WINDOW_MSWIN32 0 /* MicroSoft Windows 32 bit API */ +#define WINDOW_X 0 /* X/Unix */ + +/* Language text options (pick one) */ + +#define ENGLISH 1 /* [default] */ +#define FRENCH 0 +#define SPANISH 0 +#define GERMAN 0 +#define DUTCH 0 +#define PLATIN 0 /* Pig Latin */ +#define JAPAN 0 +#define LATIN 0 /* real Latin */ + +/* Configuration options */ + +#define TYPEAH 1 /* type ahead causes update to be skipped */ +#define LOGFLG 0 /* send all executed commands to EMACS.LOG */ +#define VISMAC 0 /* update display during keyboard macros */ +#define CTRLZ 0 /* add a ^Z at end of files under MSDOS only */ +#define CLEAN 0 /* de-alloc memory on exit */ +#define CALLED 0 /* is emacs a called subroutine? or stand alone */ + +#define REVSTA 1 /* Status line appears in reverse video */ +#define COLOR 1 /* color commands and windows */ + +#define FILOCK 0 /* file locking under unix BSD 4.2 */ +#define ISRCH 1 /* Incremental searches like ITS EMACS */ +#define FLABEL 0 /* function key label code [HP150] */ +#define CRYPT 1 /* file encryption enabled? */ +#define MAGIC 1 /* include regular expression matching? */ +#define MOUSE 0 /* Include routines for mouse actions */ +#define NOISY 1 /* Use a fancy BELL if it exists */ +#define CTAGS 1 /* include vi-like tagging? */ +#define SPEECH 0 /* spoken EMACS, for the sight impared [not ready] */ +#define VARARG 1 /* use varargs.h for mlwrite() */ + +#if XVT +#undef COLOR +#define COLOR 1 /* overide this to be TRUE for XVT always */ +#endif + +#define JMDEXT 1 /* enable J-M Dubois's extensions */ + +#if JMDEXT +#define BACKUP 1 /* backup previous file version */ +#define LIBHELP 1 /* help des fonctions de la bibliotheque C */ +#define NEWVARS 1 /* supplemental environment variables */ +#define DYNMSGS 1 /* dynamic load of messages */ +#endif + +/* Character set options */ +/* [Set one of these!!] */ +#define ASCII 1 /* always using ASCII char sequences for now */ +#define EBCDIC 0 /* later IBM mainfraim versions will use EBCDIC */ + +/* handle constant and voids properly */ + +#if VMS +#define CONST readonly +#define VOID void +#define NOSHARE noshare +#else +#if AOSVS +#define CONST $shared $align(1) /* fake a const */ +#define VOID +#define NOSHARE $low32k $align(1) /* attempt to optimize read/write vars. */ +#else + +#if __STDC__ || MSC || TURBO || GCC || (AMIGA && LATTICE) || USG +#define CONST const +#define VOID void +#define NOSHARE +#else +#define CONST +#if IC +#define VOID void +#else +#define VOID +#endif +#define NOSHARE +#endif + +#endif +#endif + +/* System dependant library redefinitions, structures and includes */ + +/* multibyte character support? */ + +#if NEC || FMR || I55 +#define DBCS 1 /* double byte character sets enabled */ +#define INSDEL 1 /* use insert/delete line display optimizations */ + +/* define DBCS prefix bytes */ +#define is2char(ch) (((ch&0xff) >= 0x81 && (ch&0xff) <= 0x9f) || ((ch&0xff) >=0xe0 && (ch&0xff) <= 0xfc)) + +#else +#define DBCS 0 +#define INSDEL 0 +#endif + +/* Can we catch the SIGWINCH (the window size change signal)? */ + +#if AIX || HPUX9 || LINUX +#define HANDLE_WINCH 1 +#else +#define HANDLE_WINCH 0 +#endif + +/* Prototypes in use? */ + +#if MSC || TURBO || IC || VMS || GCC || ZTC +#define PROTO 1 +#else +#define PROTO 0 +#endif + +/* the following define allows me to initialize unions... + otherwise we make them structures (like the keybinding table) */ + +#if __STDC__ || MSC || TURBO || IC || ZTC +#define ETYPE union +#else +#define ETYPE struct +#endif + +/* Instant C can't do stat()s. Arrrg. No file locking for you */ +#if IC && MSDOS +#undef FILOCK +#define FILOCK 0 +#endif + +/* Mark Williams/Atari has no standard or varargs or directory functions */ +#if TOS & MWC +#undef VARARG +#define VARARG 0 +#undef FILOCK +#define FILOCK 0 +#endif + +/* MS-Windows */ + +#if WINNT || WINDOW_MSWIN || WINDOW_MSWIN32 +#if WINDOW_MSWIN32 +#undef WINDOW_MSWIN +#define WINDOW_MSWIN 1 +#endif +#if WINDOW_MSWIN && WINNT +#undef WINDOW_MSWIN32 +#define WINDOW_MSWIN32 1 +#endif +#undef VOID /* windows.h will wind up defining this */ +#include /* --------- Huge include file here !!! ---------*/ +#if NTCON +#include +#include +#include +#endif + +#undef NEAR +#define NEAR +#define DNEAR +#if MSC || IC +#undef CDECL +#define CDECL __cdecl +#define DUMMYSZ 1 /* dummy size for unsized extern arrays to avoid + silly DGROUP fixup */ +#else +#if TURBO +#define DUMMYSZ /* nothing */ +#else +#define CDECL _cdecl /* ZTC */ +#define DUMMYSZ /* nothing */ +#endif +#endif + +#if WINNT +#define EXPORT /* Windows NT doesn't like this */ +#endif + +#if WINDOW_MSWIN +#undef TYPEAH +#define TYPEAH 0 /* typeahead is handled at the term driver level */ +#undef CALLED +#define CALLED 1 /* under MS Windows, "main" resides in the sys driver */ +#if MSC +#define EXPORT __export +#else +#define EXPORT _export /* Fine for TURBO and ZTC */ +#endif +#endif +#else + +/* neither Windows NT nor MS-Windows */ + +#define DUMMYSZ /* nothing */ + +#if MSDOS & (TURBO | MSC | TIPC) +#define NEAR +#define DNEAR +#define PASCAL pascal +#define CDECL cdecl +#else +#if MSDOS & ZTC +#define NEAR +#define DNEAR +#define PASCAL _pascal +#define CDECL _cdecl +#else +#define NEAR +#define DNEAR +#define PASCAL +#define CDECL +#endif +#endif + +#endif + +#if TURBO +#include +#include +#undef peek +#undef poke +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#endif + +#if IC +#include +#undef peek +#undef poke +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#endif + +#if LATTICE & MSDOS +/* you may have to remove this one definition with LATTICE version + 3.2 and above */ +#define unsigned +#endif + +#if IC +#define inp inportb +#define outp outportb +#define intdos(a, b) int86(33, a, b) +#endif + +#if AZTEC +#undef putc +#undef getc +#if MSDOS +#define getc a1getc +#define int86 sysint +#define intdos(a, b) sysint(33, a, b) +#define inp inportb +#define outp outportb +#else +#define getc agetc +#endif +#define putc aputc + +struct XREG { + unsigned ax,bx,cx,dx,si,di,ds,es; +}; + +struct HREG { + char al,ah,bl,bh,cl,ch,dl,dh,d1,d2,e1,e2; +}; + +union REGS { + struct XREG x; + struct HREG h; +}; + +struct SREGS { + unsigned cs, ss, ds, es; +}; +#endif + +#if MSDOS & MWC +#include +#define int86(a, b, c) intcall(b, c, a) +#define intdos(a, b) intcall(a, b, DOSINT) +#define inp(a) in(a) +#define outp(a, b) out(a, b) +#define movmem(a, b, c) memcpy(b, a, c) + +struct XREG { + unsigned int ax,bx,cx,dx,si,di,ds,es,flags; +}; + +struct HREG { + char al,ah,bl,bh,cl,ch,dl,dh; + unsigned int ds,es,flags; +}; + +union REGS { + struct XREG x; + struct HREG h; +}; +#endif + +#if MSDOS & MSC +#include +#include +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#define movmem(a, b, c) memcpy(b, a, c) +#define _strrev(a) strrev(a) +#endif + +#if MSDOS & LATTICE +#undef CPM +#undef LATTICE +#include +#undef CPM +#endif + +/* System V doesn't name this the same as others */ +#if USG | AIX | AUX | SUN | (OS2 & MSC) +#define movmem(a, b, c) memcpy(b, a, c) +#endif + +#if LINUX +#define movmem(a, b, c) memmove(b, a, c) +#endif + +/* this keeps VMS happy */ +#if VMS +#define getname xgetname +#define unlink(a) delete(a) +#endif + +/* some options for AOS/VS */ +#if AOSVS +#define ORMDNI 1 +#endif + +/* define some ability flags */ + +#if (IBMPC | Z309 | FMR | TIPC) & !(WINDOW_MSWIN | WINDOW_MSWIN32) +#define MEMMAP 1 +#else +#define MEMMAP 0 +#endif + +#if MSDOS | WINNT | OS2 | USG | LINUX | AIX | AUX | SMOS | HPUX8 | HPUX9 | BSD | FREEBSD | (TOS & MWC) | WMCS | SUN | MPE +#define ENVFUNC 1 +#else +#define ENVFUNC 0 +#endif + +#if AUX +#define RETCHAR '\n' +#else +#define RETCHAR '\r' +#endif + +#if THEOS +#define _CTYPE_NO_MACRO 1 +#define RET_CHAR '\n' +#else +#define RET_CHAR '\r' +#endif + +#if MPE +#define DIRSEPSTR "." +#define DIRSEPCHAR '.' +#else +#if TOS || MSDOS || WINNT || OS2 +#define DIRSEPSTR "\\" +#define DIRSEPCHAR '\\' +#define DRIVESEPCHAR ':' +#else +#define DIRSEPSTR "/" +#define DIRSEPCHAR '/' +#define DRIVESEPCHAR '\0' +#endif +#endif + +#if VARARG +#if (GCC == 0) && (USG || LINUX || AIX || AUX || BSD || FREEBSD || SUN || XENIX || HPUX8 || HPUX9 || AVIION || MPE) +#define VARG 1 +#define SARG 0 +#include +#else +#define VARG 0 +#define SARG 1 +#include +#endif +#endif + +#if ZTC +#include +#define movmem(a, b, c) memcpy(b, a, c) +#endif + +/* Emacs global flag bit definitions (for gflags) */ + +#define GFREAD 1 /* read first file in at startup */ +#define GFSDRAW 2 /* suppress a screen redraw */ +#define GFEXIT 4 /* exit from emacs pending */ + +/* internal constants */ + +#define NBINDS 300 /* max # of bound keys */ +#if AOSVS | VMS | WINNT | SUN | BSD | FREEBSD | USG | LINUX | ZENIX | HPUX8 | HPUX9 | OS2 +#define NFILEN 256 +#else +#define NFILEN 80 /* # of bytes, file name */ +#endif +#define NBUFN 128 /* # of bytes, buffer name */ +#define NLINE 256 /* # of bytes, input line */ +#define NSTRING 128 /* # of bytes, string buffers */ +#define NKBDM 4096 /* # of strokes, keyboard macro */ +#define NPAT 128 /* # of bytes, pattern */ +#define HUGE 1000 /* Huge number */ +#define NLOCKS 256 /* max # of file locks active */ +#define NCOLORS 16 /* number of supported colors */ +#define KBLOCK 250 /* sizeof kill buffer chunks */ +#define NRING 16 /* # of buffers in kill ring */ +#define NBLOCK 16 /* line block chunk size */ +#define NVSIZE 16 /* max #chars in a var name */ +#define NMARKS 16 /* number of marks */ +#define MAXSYM 32 /* max # chars in symbol to expand */ +#define MINFLEN 3 /* min # chars to match &func */ + +#define CTRL 0x0100 /* Control flag, or'ed in */ +#define META 0x0200 /* Meta flag, or'ed in */ +#define CTLX 0x0400 /* ^X flag, or'ed in */ +#define SPEC 0x0800 /* special key (function keys) */ +#define MOUS 0x1000 /* alternative input device (mouse) */ +#define SHFT 0x2000 /* shifted (for function keys) */ +#define ALTD 0x4000 /* ALT key... */ +#define MENU MOUS+SPEC /* menu selection (WINDOW_MSWIN) */ + +#define BINDNUL 0 /* not bound to anything */ +#define BINDFNC 1 /* key bound to a function */ +#define BINDBUF 2 /* key bound to a buffer */ + +#ifdef FALSE +#undef FALSE +#endif +#ifdef TRUE +#undef TRUE +#endif + +#define FALSE 0 /* False, no, bad, etc. */ +#define TRUE 1 /* True, yes, good, etc. */ +#define ABORT 2 /* Death, ^G, abort, etc. */ +#define FAILD 3 /* not-quite fatal false return */ + +#define STOP 0 /* keyboard macro not in use */ +#define PLAY 1 /* playing */ +#define RECORD 2 /* recording */ + +/* Completion types */ + +#define CMP_BUFFER 0 +#define CMP_COMMAND 1 +#define CMP_FILENAME 2 + +/* Directive definitions */ + +#define DIF 0 +#define DELSE 1 +#define DENDIF 2 +#define DGOTO 3 +#define DRETURN 4 +#define DENDM 5 +#define DWHILE 6 +#define DENDWHILE 7 +#define DBREAK 8 +#define DFORCE 9 + +#define NUMDIRS 10 + +/* + * PTBEG, PTEND, FORWARD, and REVERSE are all toggle-able values for + * routines that need directions. + */ +#define PTBEG 0 /* Leave the point at the beginning on search */ +#define PTEND 1 /* Leave the point at the end on search */ +#define FORWARD 0 /* do things in a forward direction */ +#define REVERSE 1 /* do things in a backwards direction */ + +#define FIOSUC 0 /* File I/O, success. */ +#define FIOFNF 1 /* File I/O, file not found. */ +#define FIOEOF 2 /* File I/O, end of file. */ +#define FIOERR 3 /* File I/O, error. */ +#define FIOMEM 4 /* File I/O, out of memory */ +#define FIOFUN 5 /* File I/O, eod of file/bad line*/ +#define FIODEL 6 /* Can't delete/rename file */ + +#if WINDOW_MSWIN +/* values for the fbusy flag */ +#define FREADING 1 /* file read in progress */ +#define FWRITING 2 /* file write in progress */ +/* if no file activity, the value FALSE is used */ +#endif + +#define CFCPCN 0x0001 /* Last command was C-P, C-N */ +#define CFKILL 0x0002 /* Last command was a kill */ +#define CFSRCH 0x0004 /* last command was a search */ +#define CFYANK 0x0008 /* last command was a yank */ + +#define SRNORM 0 /* end past, begin front */ +#define SRBEGIN 1 /* always at front */ +#define SREND 2 /* always one past end */ + +#define BELL 0x07 /* a bell character */ +#define TAB 0x09 /* a tab character */ + +#if USG | LINUX | AIX | AUX | SMOS | HPUX8 | HPUX9 | BSD | FREEBSD | SUN | XENIX | AVIION +#define PATHCHR ':' +#else +#if WMCS || MPE +#define PATHCHR ',' +#else +#define PATHCHR ';' +#endif +#endif + +#define INTWIDTH sizeof(int) * 3 +#define LONGWIDTH sizeof(long) * 3 + +/* Macro argument token types */ + +#define TKNUL 0 /* end-of-string */ +#define TKARG 1 /* interactive argument */ +#define TKBUF 2 /* buffer argument */ +#define TKVAR 3 /* user variables */ +#define TKENV 4 /* environment variables */ +#define TKFUN 5 /* function.... */ +#define TKDIR 6 /* directive */ +#define TKLBL 7 /* line label */ +#define TKLIT 8 /* numeric literal */ +#define TKSTR 9 /* quoted string literal */ +#define TKCMD 10 /* command name */ + +/* Internal defined functions */ + +#define nextab(a) (a - (a % tabsize)) + tabsize + +/* DIFCASE represents the integer difference between upper + and lower case letters. It is an xor-able value, which is + fortunate, since the relative positions of upper to lower + case letters is the opposite of ascii in ebcdic. +*/ + +#if ASCII +#define DIFCASE 0x20 +#else +#define DIFCASE 0x40 +#endif + +/* Dynamic RAM tracking and reporting redefinitions */ + +#if RAMSIZE +#define malloc allocate +#define free release +#else +#if VMS & OPTMEM +#define malloc VAXC$MALLOC_OPT +#define free VAXC$FREE_OPT +#define calloc VAXC$CALLOC_OPT +#define realloc VAXC$REALLOC_OPT +#define cfree VAXC$CFREE_OPT +#endif +#endif + +/* under MS Windows, we use dialog boxes to prompt the user for filenames */ +#if WINDOW_MSWIN +#define FILENAMEREPLY(p,b,nb) filenamedlg(p,b,nb,TRUE) +#else +#define FILENAMEREPLY(p,b,nb) mlreply(p,b,nb) +#endif + +/* formal parameters to procedures are stored as a linked list + of argument names using the following simple structure: +*/ + +typedef struct PARG { + struct PARG *next; /* ptr to next linked argument */ + char name[NVSIZE+1]; /* name of the argument */ +} PARG; + +/* UNDO definitions and types */ + +typedef int OPTYPE; /* type of operation being recorded/played back */ + +#define OP_CMND 1 /* beginning of command */ +#define OP_DELC 2 /* delete a single character */ +#define OP_INSC 3 /* insert a single character */ +#define OP_DSTR 4 /* delete a string of characters */ +#define OP_ISTR 5 /* insert a string of characters */ +#define OP_REPC 6 /* replace a character */ +#define OP_CPOS 7 /* set the cursor position */ + +/* object to be undone! */ + +typedef union OBJECT { + char obj_char; /* a character */ + char obj_string[1]; /* many characters */ + char *obj_sptr; /* a ptr to a character */ +} OBJECT; + +typedef struct UNDO_OBJ { + struct UNDO_OBJ *next; /* ptr to next undo object */ + OPTYPE type; /* type of operation */ + long line_num; /* line offset from buffer beginning */ + int offset; /* offset into that line */ + long count; /* repetitions? */ + OBJECT undo_obj; /* object to be undone */ +} UNDO_OBJ; + +/* + * There is a window structure allocated for every active display window. The + * windows are kept in a big list, in top to bottom screen order, with the + * listhead at "wheadp". Each window contains its own values of dot and mark. + * The flag field contains some bits that are set by commands to guide + * redisplay. Although this is a bit of a compromise in terms of decoupling, + * the full blown redisplay is just too expensive to run for every input + * character. + */ +typedef struct EWINDOW { + struct EWINDOW *w_wndp; /* Next window */ + struct BUFFER *w_bufp; /* Buffer displayed in window */ + struct LINE *w_linep; /* Top line in the window */ + struct LINE *w_dotp; /* Line containing "." */ + short w_doto; /* Byte offset for "." */ + struct LINE *w_markp[NMARKS]; /* Line containing "mark" */ + short w_marko[NMARKS]; /* Byte offset for "mark" */ + char w_toprow; /* Origin 0 top row of window */ + char w_ntrows; /* # of rows of text in window */ + char w_force; /* If NZ, forcing row. */ + char w_flag; /* Flags. */ +#if COLOR + char w_fcolor; /* current forground color */ + char w_bcolor; /* current background color */ +#endif + int w_fcol; /* first column displayed */ +} EWINDOW; + +#define WFFORCE 0x01 /* Window needs forced reframe */ +#define WFMOVE 0x02 /* Movement from line to line */ +#define WFEDIT 0x04 /* Editing within a line */ +#define WFHARD 0x08 /* Better to a full display */ +#define WFMODE 0x10 /* Update mode line. */ +#define WFCOLR 0x20 /* Needs a color change */ + +/* This structure holds the information about each line appearing on the + * video display. The redisplay module uses an array of virtual display + * lines. On systems that do not have direct access to display memory, + * there is also an array of physical display lines used to minimize + * video updating. In most cases, these two arrays are unique. If + * WINDOW_MSWIN is 1, there is a pair of such arrays in each ESCREEN + * structure. + */ + +typedef struct VIDEO { + int v_flag; /* Flags */ +#if COLOR + int v_fcolor; /* current forground color */ + int v_bcolor; /* current background color */ + int v_rfcolor; /* requested forground color */ + int v_rbcolor; /* requested background color */ +#endif + int v_left; /* left edge of reverse video */ + int v_right; /* right right of reverse video */ +#if INSDEL && MEMMAP == 0 + int v_rline; /* requested screen line # */ +#endif + char v_text[1]; /* Screen data. */ +} VIDEO; + +#define VFNEW 0x0001 /* contents not meaningful yet */ +#define VFCHG 0x0002 /* Changed flag */ +#define VFEXT 0x0004 /* extended (beyond column 80) */ +#define VFCOL 0x0008 /* color change requested */ + +/* + * This structure holds the information about each separate "screen" + * within the current editing session. On a character based system, these + * screens overlay each other, and can individually be brought to front. + * On a windowing system like MicroSoft Windows 3.0, OS/2, the Macintosh, + * Intuition, Sunview or X-windows, each screen is represented in an OS + * window. The terminolgy is wrong in emacs..... + * + * EMACS The outside World + * screen window + * window pane + */ + +typedef struct ESCREEN { + struct ESCREEN *s_next_screen; /* link to next screen in list */ + EWINDOW *s_first_window; /* head of linked list of windows */ + EWINDOW *s_cur_window; /* current window in this screen */ + char *s_screen_name; /* name of the current window */ + short s_roworg; /* row origin of stored screen */ + short s_colorg; /* column origin of stored screen */ + short s_nrow; /* row width of stored screen */ + short s_ncol; /* column origin of stored screen */ +#if WINDOW_MSWIN + VIDEO **s_virtual; /* virtual screen contents */ + VIDEO **s_physical; /* physical screen contents */ + HWND s_drvhandle; /* handle for the "term" driver */ +#endif +} ESCREEN; + +/* + * Text is kept in buffers. A buffer header, described below, exists for every + * buffer in the system. The buffers are kept in a big list, so that commands + * that search for a buffer by name can find the buffer header. There is a + * safe store for the dot and mark in the header, but this is only valid if + * the buffer is not being displayed (that is, if "b_nwnd" is 0). The text for + * the buffer is kept in a circularly linked list of lines, with a pointer to + * the header line in "b_linep". Buffers may be "Inactive" which means the + * files associated with them have not been read in yet. These get read in + * at "use buffer" time. + * Some buffers are really procedures and have a little extra information + * stored with them. + */ +typedef struct BUFFER { + struct BUFFER *b_bufp; /* Link to next BUFFER */ + struct LINE *b_dotp; /* Link to "." LINE structure */ + short b_doto; /* Offset of "." in above LINE */ + struct LINE *b_markp[NMARKS]; /* The same as the above two, */ + short b_marko[NMARKS]; /* but for the "mark" */ + int b_fcol; /* first col to display */ + struct LINE *b_linep; /* Link to the header LINE */ + struct LINE *b_topline; /* Link to narrowed top text */ + struct LINE *b_botline; /* Link to narrowed bottom text */ + char b_active; /* window activated flag */ + char b_nwnd; /* Count of windows on buffer */ + char b_exec; /* how many active executions */ + char b_flag; /* Flags */ + int b_mode; /* editor mode of this buffer */ + char b_fname[NFILEN]; /* File name */ + char b_bname[NBUFN]; /* Buffer name */ +#if CRYPT + char b_key[NPAT]; /* current encrypted key */ +#endif + int b_numargs; /* number of arguments to procedure */ + PARG *b_args; /* ptr to the first argument */ + UNDO_OBJ *undo_head; /* head of undo stack for buffer */ + long undo_count; /* # of undo operations stacked */ + long last_access; /* time of last access */ +} BUFFER; + +#define BFINVS 0x01 /* Internal invisable buffer */ +#define BFCHG 0x02 /* Changed since last write */ +#define BFTRUNC 0x04 /* buffer was truncated when read */ +#define BFNAROW 0x08 /* buffer has been narrowed */ +#if LIBHELP +#define BFERROR 0x40 /* Error file buffer */ +#define BFHELP 0x80 /* Buffer is a help buffer */ +#endif + +#define NOTPROC -1 /* buffer is not a procedure */ + +/* mode flags */ +#if JMDEXT +#if !THEOS +#define NUMMODES 15 /* # of defined modes */ +#else +#define NUMMODES 14 /* # of defined modes */ +#endif +#else +#define NUMMODES 11 /* # of defined modes */ +#endif + +#define MDWRAP 0x0001 /* word wrap */ +#define MDCMOD 0x0002 /* C indentation and fence match*/ +#define MDSPELL 0x0004 /* spell error parsing */ +#define MDEXACT 0x0008 /* Exact matching for searches */ +#define MDVIEW 0x0010 /* read-only buffer */ +#define MDOVER 0x0020 /* overwrite mode */ +#define MDMAGIC 0x0040 /* regular expresions in search */ +#define MDCRYPT 0x0080 /* encrytion mode active */ +#define MDASAVE 0x0100 /* auto-save mode */ +#define MDREPL 0x0200 /* replace mode */ +#define MDABBR 0x0400 /* abbreviation expansion mode */ +#if JMDEXT +#define MDNOBAK 0x0800 /* no auto backup */ +#define MDGRAF1 0x1000 /* single line graphics */ +#define MDGRAF2 0x2000 /* double line graphics */ +#if !THEOS +#define MDTHEOS 0x4000 /* THEOS character set */ +#endif +#endif + +/* + * The starting position of a region, and the size of the region in + * characters, is kept in a region structure. Used by the region commands. + */ +typedef struct { + struct LINE *r_linep; /* Origin LINE address. */ + short r_offset; /* Origin LINE offset. */ + long r_size; /* Length in characters. */ +} REGION; + +/* + * All text is kept in circularly linked lists of "LINE" structures. These + * begin at the header line (which is the blank line beyond the end of the + * buffer). This line is pointed to by the "BUFFER". Each line contains a the + * number of bytes in the line (the "used" size), the size of the text array, + * and the text. The end of line is not stored as a byte; it's implied. + */ +typedef struct LINE { + struct LINE *l_fp; /* Link to the next line */ + struct LINE *l_bp; /* Link to the previous line */ + short l_size; /* Allocated size */ + short l_used; /* Used size */ + char l_text[1]; /* A bunch of characters. */ +} LINE; + +#define lforw(lp) ((lp)->l_fp) +#define lback(lp) ((lp)->l_bp) +#if UNIX && (SUN || HPUX8 || HPUX9 || BSD || FREEBSD) +#define lgetc(lp, n) ((unsigned char)(lp)->l_text[(n)]) +#else +#define lgetc(lp, n) ((lp)->l_text[(n)]) +#endif +#define lputc(lp, n, c) ((lp)->l_text[(n)]=(c)) +#define lused(lp) ((lp)->l_used) +#define lsize(lp) ((lp)->l_size) +#define ltext(lp) ((lp)->l_text) + +/* This structure is used to hold a user variables name and its + current value. These are used for both the global and the + local symbol tables. +*/ + +typedef struct UVAR { + char u_name[NVSIZE + 1]; /* name of user variable */ + char *u_value; /* value (string) */ +} UVAR; + +#define VT_NONE 0 /* don't declare it if not found */ +#define VT_LOCAL 1 /* local to the current procedure */ +#define VT_GLOBAL 2 /* global to all procedures */ + +/* A UTABLE is a user variable table.... containing some header + information and an array of user variable names and definitions. + They are held together in a linked list, the last member of + the list being the global user variable table. +*/ + +typedef struct UTABLE { + struct UTABLE *next; /* ptr to next user variable table */ + int size; /* max number of variables in table */ + BUFFER *bufp; /* ptr to buffer holding procedure + assosiated with this symbol table. */ + UVAR uv[1]; /* list of variable names/definitions + in this variable table */ +} UTABLE; + +/* + * The editor communicates with the display using a high level interface. A + * "TERM" structure holds useful variables, and indirect pointers to routines + * that do useful operations. The low level get and put routines are here too. + * This lets a terminal, in addition to having non standard commands, have + * funny get and put character code too. The calls might get changed to + * "termp->t_field" style in the future, to make it possible to run more than + * one terminal type. + */ +#if PROTO +typedef struct { + short t_mrow; /* max number of rows allowable */ + short t_nrow; /* current number of rows used */ + short t_mcol; /* max Number of columns. */ + short t_ncol; /* current Number of columns. */ + short t_roworg; /* origin row (normally zero) */ + short t_colorg; /* origin column (normally zero)*/ + short t_margin; /* min margin for extended lines*/ + short t_scrsiz; /* size of scroll region " */ + int t_pause; /* # times thru update to pause */ + int (PASCAL NEAR *t_open)(void); /* Open terminal at the start.*/ + int (PASCAL NEAR *t_close)(void); /* Close terminal at end. */ + int (PASCAL NEAR *t_kopen)(void); /* Open keyboard */ + int (PASCAL NEAR *t_kclose)(void); /* Close keyboard */ + int (PASCAL NEAR *t_getchar)(void); /* Get character from keyboard. */ + int (PASCAL NEAR *t_putchar)(int); /* Put character to display.*/ + int (PASCAL NEAR *t_flush)(void); /* Flush output buffers. */ + int (PASCAL NEAR *t_move)(int, int);/* Move the cursor, origin 0.*/ + int (PASCAL NEAR *t_eeol)(void); /* Erase to end of line. */ + int (PASCAL NEAR *t_eeop)(void); /* Erase to end of page. */ + int (PASCAL NEAR *t_clrdesk)(void); /* Clear the page totally */ + int (PASCAL NEAR *t_beep)(void); /* Beep. */ + int (PASCAL NEAR *t_rev)(int); /* set reverse video state */ + int (PASCAL NEAR *t_rez)(char *); /* change screen resolution */ +#if COLOR + int (PASCAL NEAR *t_setfor)(int); /* set forground color */ + int (PASCAL NEAR *t_setback)(int); /* set background color */ +#endif +#if INSDEL + int (PASCAL NEAR *t_insline)(int); /* insert a screen line */ + int (PASCAL NEAR *t_delline)(int); /* delete a screen line */ +#endif +#if WINDOW_MSWIN + int (PASCAL NEAR *t_sleep)(int); /* go to sleep for a while */ + int (PASCAL NEAR *t_newscr)(ESCREEN *); /* create new screen display */ + int (PASCAL NEAR *t_delscr)(ESCREEN *); /* destroy screen display */ + int (PASCAL NEAR *t_selscr)(ESCREEN *); /* select screen display */ + int (PASCAL NEAR *t_sizscr)(ESCREEN *); /* resize screen display */ + int (PASCAL NEAR *t_topscr)(ESCREEN *); /* bring screen to top */ +#endif +} TERM; +#else /* TERM structure, no prototyping.*/ + +typedef struct { + short t_mrow; /* max number of rows allowable */ + short t_nrow; /* current number of rows used */ + short t_mcol; /* max Number of columns. */ + short t_ncol; /* current Number of columns. */ + short t_roworg; /* origin row (normally zero) */ + short t_colorg; /* origin column (normally zero)*/ + short t_margin; /* min margin for extended lines*/ + short t_scrsiz; /* size of scroll region " */ + int t_pause; /* # times thru update to pause */ + int (PASCAL NEAR *t_open)(); /* Open terminal at the start. */ + int (PASCAL NEAR *t_close)(); /* Close terminal at end. */ + int (PASCAL NEAR *t_kopen)(); /* Open keyboard */ + int (PASCAL NEAR *t_kclose)(); /* close keyboard */ + int (PASCAL NEAR *t_getchar)(); /* Get character from keyboard. */ + int (PASCAL NEAR *t_putchar)(); /* Put character to display. */ + int (PASCAL NEAR *t_flush)(); /* Flush output buffers. */ + int (PASCAL NEAR *t_move)(); /* Move the cursor, origin 0. */ + int (PASCAL NEAR *t_eeol)(); /* Erase to end of line. */ + int (PASCAL NEAR *t_eeop)(); /* Erase to end of page. */ + int (PASCAL NEAR *t_clrdesk)(); /* Clear the page totally */ + int (PASCAL NEAR *t_beep)(); /* Beep. */ + int (PASCAL NEAR *t_rev)(); /* set reverse video state */ + int (PASCAL NEAR *t_rez)(); /* change screen resolution */ +#if COLOR + int (PASCAL NEAR *t_setfor)(); /* set forground color */ + int (PASCAL NEAR *t_setback)(); /* set background color */ +#endif +#if INSDEL + int (PASCAL NEAR *t_insline)(); /* insert a screen line */ + int (PASCAL NEAR *t_delline)(); /* delete a screen line */ +#endif +#if WINDOW_MSWIN + int (PASCAL NEAR *t_sleep)(); /* go to sleep for a while */ + int (PASCAL NEAR *t_newscr)(); /* create new screen display */ + int (PASCAL NEAR *t_delscr)(); /* destroy screen display */ + int (PASCAL NEAR *t_selscr)(); /* select screen display */ + int (PASCAL NEAR *t_sizscr)(); /* resize screen display */ + int (PASCAL NEAR *t_topscr)(); /* bring screen to top */ +#endif +} TERM; +#endif + + +/* TEMPORARY macros for terminal I/O (to be placed in a machine + dependant place later) */ + +#define TTopen (*term.t_open) +#define TTclose (*term.t_close) +#define TTkopen (*term.t_kopen) +#define TTkclose (*term.t_kclose) +#define TTgetc (*term.t_getchar) +#define TTputc (*term.t_putchar) +#define TTflush (*term.t_flush) +#define TTmove (*term.t_move) +#define TTeeol (*term.t_eeol) +#define TTeeop (*term.t_eeop) +#define TTclrdesk (*term.t_clrdesk) +#define TTbeep (*term.t_beep) +#define TTrev (*term.t_rev) +#define TTrez (*term.t_rez) +#if COLOR +#define TTforg (*term.t_setfor) +#define TTbacg (*term.t_setback) +#endif + +/* Structure for the table of current key bindings */ + +ETYPE EPOINTER { + int (PASCAL NEAR *fp)(); /* C routine to invoke */ + BUFFER *buf; /* buffer to execute */ +}; + +typedef struct { + short k_code; /* Key code */ + short k_type; /* binding type (C function or EMACS buffer) */ + ETYPE EPOINTER k_ptr; /* ptr to thing to execute */ +} KEYTAB; + +/* structure for the name binding table */ + +typedef struct { + char *n_name; /* name of function key */ + int (PASCAL NEAR *n_func)(); /* function name is bound to */ +} NBIND; + +/* The editor holds deleted text chunks in the KILL buffer. The + kill buffer is logically a stream of ascii characters, however + due to its unpredicatable size, it gets implemented as a linked + list of chunks. (The d_ prefix is for "deleted" text, as k_ + was taken up by the keycode structure) +*/ + +typedef struct KILL { + struct KILL *d_next; /* link to next chunk, NULL if last */ + char d_chunk[KBLOCK]; /* deleted text */ +} KILL; + +/* When emacs's command interpetor needs to get a variable's name, + rather than it's value, it is passed back as a VDESC variable + description structure. The v_num field is a index into the + appropriate variable table. +*/ + +typedef struct VDESC { + int v_type; /* type of variable */ + int v_num; /* ordinal pointer to variable in list */ + UTABLE *v_ut; /* ptr to appropriate user table if user var */ +} VDESC; + +/* The !WHILE directive in the execution language needs to + stack references to pending whiles. These are stored linked + to each currently open procedure via a linked list of + the following structure +*/ + +typedef struct WHBLOCK { + LINE *w_begin; /* ptr to !while statement */ + LINE *w_end; /* ptr to the !endwhile statement*/ + int w_type; /* block type */ + struct WHBLOCK *w_next; /* next while */ +} WHBLOCK; + +#define BTWHILE 1 +#define BTBREAK 2 + +/* Abbreviations are short symbols that expand to longer strings + when typed into a buffer with no intervening whitespace or commands. + This structure grows dynamically as needed. +*/ + +typedef struct ABBREV { + struct ABBREV *ab_next; /* pointer to the next abbreviation */ + char ab_sym[MAXSYM + 1]; /* name to expand */ + char ab_exp[1]; /* string to expand to */ +} ABBREV; + +/* Search definitions... */ + +/* HICHAR - 1 is the largest character we will deal with. + * BMAPSIZE represents the number of bytes in the bitmap. + */ +#define HICHAR 256 +#define BMAPSIZE HICHAR >> 3 + +/* + * Jump table structures. + */ +typedef struct { + int jump; + int patlen; + int delta[HICHAR]; + char patrn[NPAT]; +} DELTA; + +#if MAGIC +/* + * Defines for the metacharacters in the regular expression + * search routines. MCNIL and GROUP are used in both search + * and replace metachar-arrays. + */ +#define MCNIL 0 /* Like the '\0' for strings.*/ +#define JMPTABLE 1 +#define LITSTRING 2 /* Literal string.*/ +#define LITCHAR 3 /* Literal character.*/ +#define ANY 4 /* Any character but the .*/ +#define CCL 5 +#define NCCL 6 +#define BOL 7 +#define EOL 8 +#define BOWRD 9 +#define EOWRD 10 +#define GRPBEG 11 /* Signal start of group.*/ +#define GRPEND 12 /* Signal end of group.*/ +#define GROUP 13 /* String of group match.*/ +#define DITTO 14 /* Replacement with match string.*/ + +#define CLOSURE 0x0100 /* An or-able value for a closure modifier.*/ +#define CLOSURE_1 0x0200 /* An or-able value for a closure modifier.*/ +#define ZEROONE 0x0400 /* An or-able value for a closure modifier.*/ + +#define ALLCLOS (CLOSURE | CLOSURE_1 | ZEROONE) +#define MASKCLO (~ALLCLOS) + +#define MC_ANY '.' /* 'Any' character (except newline).*/ +#define MC_CCL '[' /* Character class.*/ +#define MC_NCCL '^' /* Negate character class.*/ +#define MC_RCCL '-' /* Range in character class.*/ +#define MC_ECCL ']' /* End of character class.*/ +#define MC_BOL '^' /* Beginning of line.*/ +#define MC_EOL '$' /* End of line.*/ +#define MC_CLOSURE '*' /* Closure - zero to many characters match.*/ +#define MC_CLOSURE_1 '+' /* Closure - one to many characters match.*/ +#define MC_ZEROONE '?' /* Closure - zero to one characters match.*/ +#define MC_DITTO '&' /* Use matched string in replacement.*/ +#define MC_GRPBEG '(' /* Start of group (begun with a backslash).*/ +#define MC_GRPEND ')' /* End of group (begun with a backslash).*/ +#define MC_BOWRD '<' /* Beginning of word (begun with a backslash).*/ +#define MC_EOWRD '>' /* End of word (begun with a backslash).*/ +#define MC_ESC '\\' /* Escape - suppress meta-meaning.*/ + +#define MAXGROUPS 10 /* 1 + maximum # of r. e. groups. */ +#define BIT(n) (1 << (n)) /* An integer with one bit set.*/ + +/* Typedefs that define the bitmap type for searching (EBITMAP), + * the meta-character structure for MAGIC mode searching (MC), + * and the meta-character structure for MAGIC mode replacment (RMC). + */ +typedef char *EBITMAP; + +typedef struct { + short int mc_type; + union { + int lchar; + int group_no; + char *lstring; + DELTA *jmptable; + EBITMAP cclmap; + } u; +} MC; + +typedef struct { + short int mc_type; + union { + int group_no; + char *rstr; + } u; +} RMC; +#endif + +/* + This is the message which should be added to any "About MicroEMACS" + boxes on any of the machines with window managers. + + + ------------------------------------------ + | | + | MicroEMACS v4.xx | + | for the ............ | + | | + | Text Editor and Corrector | + | | + | written by Daniel M. Lawrence | + | [based on code by Dave Conroy] | + | | + | Send inquiries and donations to: | + | 617 New York St | + | Lafayette, IN 47901 | + | | + ------------------------------------------ +*/ diff --git a/os5/cc/makefile b/os5/cc/makefile new file mode 100644 index 0000000..4768581 --- /dev/null +++ b/os5/cc/makefile @@ -0,0 +1,106 @@ +# Unix makefile for +# MicroEMACS 3.12 +# (C)Copyright 1993 by Daniel Lawrence +# all rights reserved + +# modify the following lines with the proper relative directories + +# object file directory +OBJD = obj +# source file directory +SRCD = ../../src +# header file directory +HDIR = ../../h + +# options and arguments to the C compiler + +CFLAGS= -DSCO -I. -I$(HDIR) -O -dy -J -b elf + +# list of header files + +HFILES = estruct.h $(HDIR)/edef.h $(HDIR)/eproto.h $(HDIR)/elang.h + +#list of object files + +F1 = $(OBJD)/abbrev.o $(OBJD)/basic.o $(OBJD)/bind.o $(OBJD)/buffer.o +F2 = $(OBJD)/char.o $(OBJD)/crypt.o $(OBJD)/display.o $(OBJD)/dolock.o +F3 = $(OBJD)/eval.o $(OBJD)/exec.o $(OBJD)/file.o +F4 = $(OBJD)/fileio.o $(OBJD)/unix.o $(OBJD)/input.o $(OBJD)/keyboard.o +F5 = $(OBJD)/isearch.o $(OBJD)/libhelp.o $(OBJD)/line.o $(OBJD)/lock.o +F6 = $(OBJD)/main.o $(OBJD)/message.o $(OBJD)/mouse.o $(OBJD)/screen.o +F7 = $(OBJD)/random.o $(OBJD)/region.o $(OBJD)/search.o $(OBJD)/replace.o +F8 = $(OBJD)/tags.o $(OBJD)/undo.o $(OBJD)/window.o $(OBJD)/word.o + +# product list + +all: bin/emacs + +OFILES = $(F1) $(F2) $(F3) $(F4) $(F5) $(F6) $(F7) $(F8) + +bin/emacs: $(OFILES) + $(CC) $(CFLAGS) $(OFILES) -ltermcap -lc -ltinfo -o bin/emacs + +$(OBJD)/abbrev.o: $(SRCD)/abbrev.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/abbrev.o $(SRCD)/abbrev.c +$(OBJD)/basic.o: $(SRCD)/basic.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/basic.o $(SRCD)/basic.c +$(OBJD)/bind.o: $(SRCD)/bind.c $(HFILES) $(HDIR)/epath.h + $(CC) $(CFLAGS) -c -o $(OBJD)/bind.o $(SRCD)/bind.c +$(OBJD)/buffer.o: $(SRCD)/buffer.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/buffer.o $(SRCD)/buffer.c +$(OBJD)/char.o: $(SRCD)/char.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/char.o $(SRCD)/char.c +$(OBJD)/crypt.o: $(SRCD)/crypt.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/crypt.o $(SRCD)/crypt.c +$(OBJD)/cmdfix.o: $(SRCD)/cmdfix.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/cmdfix.o $(SRCD)/cmdfix.c +$(OBJD)/display.o: $(SRCD)/display.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/display.o $(SRCD)/display.c +$(OBJD)/dolock.o: $(SRCD)/dolock.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/dolock.o $(SRCD)/dolock.c +$(OBJD)/eval.o: $(SRCD)/eval.c $(HFILES) $(HDIR)/evar.h + $(CC) $(CFLAGS) -c -o $(OBJD)/eval.o $(SRCD)/eval.c +$(OBJD)/exec.o: $(SRCD)/exec.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/exec.o $(SRCD)/exec.c +$(OBJD)/file.o: $(SRCD)/file.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/file.o $(SRCD)/file.c +$(OBJD)/fileio.o: $(SRCD)/fileio.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/fileio.o $(SRCD)/fileio.c +$(OBJD)/input.o: $(SRCD)/input.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/input.o $(SRCD)/input.c +$(OBJD)/isearch.o: $(SRCD)/isearch.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/isearch.o $(SRCD)/isearch.c +$(OBJD)/keyboard.o: $(SRCD)/keyboard.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/keyboard.o $(SRCD)/keyboard.c +$(OBJD)/libhelp.o: $(SRCD)/libhelp.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/libhelp.o $(SRCD)/libhelp.c +$(OBJD)/line.o: $(SRCD)/line.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/line.o $(SRCD)/line.c +$(OBJD)/lock.o: $(SRCD)/lock.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/lock.o $(SRCD)/lock.c +$(OBJD)/main.o: $(SRCD)/main.c $(HFILES) $(HDIR)/efunc.h $(HDIR)/ebind.h + $(CC) $(CFLAGS) -c -o $(OBJD)/main.o $(SRCD)/main.c +$(OBJD)/message.o: $(SRCD)/message.c $(HFILES) $(HDIR)/epath.h + $(CC) $(CFLAGS) -c -o $(OBJD)/message.o $(SRCD)/message.c +$(OBJD)/mouse.o: $(SRCD)/mouse.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/mouse.o $(SRCD)/mouse.c +$(OBJD)/unix.o: $(SRCD)/unix.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/unix.o $(SRCD)/unix.c +$(OBJD)/random.o: $(SRCD)/random.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/random.o $(SRCD)/random.c +$(OBJD)/region.o: $(SRCD)/region.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/region.o $(SRCD)/region.c +$(OBJD)/screen.o: $(SRCD)/screen.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/screen.o $(SRCD)/screen.c +$(OBJD)/search.o: $(SRCD)/search.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/search.o $(SRCD)/search.c +$(OBJD)/replace.o: $(SRCD)/replace.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/replace.o $(SRCD)/replace.c +$(OBJD)/tags.o: $(SRCD)/tags.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/tags.o $(SRCD)/tags.c +$(OBJD)/undo.o: $(SRCD)/undo.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/undo.o $(SRCD)/undo.c +$(OBJD)/window.o: $(SRCD)/window.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/window.o $(SRCD)/window.c +$(OBJD)/word.o: $(SRCD)/word.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/word.o $(SRCD)/word.c diff --git a/os5/cc/uemacs_4.04/cdmt.config b/os5/cc/uemacs_4.04/cdmt.config new file mode 100644 index 0000000..9a650a9 --- /dev/null +++ b/os5/cc/uemacs_4.04/cdmt.config @@ -0,0 +1,34 @@ +MACROS: + +DEFAULT_EXEC_MODE = 0755 + +DEFAULT_FILE_MODE = 0644 +DEFAULT_FILE_OWNER = bin +DEFAULT_FILE_GROUP = bin + +DEFAULT_DIR_MODE = 0755 +DEFAULT_DIR_OWNER = bin +DEFAULT_DIR_GROUP = bin + +DEFAULT_FIFO_MODE = 0644 +DEFAULT_FIFO_OWNER = bin +DEFAULT_FIFO_GROUP = bin + +DEFAULT_DISTTREEROOT_SHARED = $CDMT_DIR +DEFAULT_DISTTREEROOT_CLIENT = $CDMT_DIR + +CONFIG: + removeFiles = FALSE + removalPrompt = FALSE + archiveMedia = FLOPPY + compress = TRUE + ssoDir = sso + +FLOPPY_MEDIA: + device = /dev/rfd0 + volumeSize = 8000 + distVendor = SCO + distVersion = 4.04 + distCode = JMD + paperLabel = "SCO Skunkware MicroEMACS 4.04" + diff --git a/os5/cc/uemacs_4.04/clean b/os5/cc/uemacs_4.04/clean new file mode 100644 index 0000000..fa68f18 --- /dev/null +++ b/os5/cc/uemacs_4.04/clean @@ -0,0 +1,3 @@ +#!/bin/sh + +rm -rf archives sso usr diff --git a/os5/cc/uemacs_4.04/input/microema.cmpnt b/os5/cc/uemacs_4.04/input/microema.cmpnt new file mode 100644 index 0000000..3b23c09 --- /dev/null +++ b/os5/cc/uemacs_4.04/input/microema.cmpnt @@ -0,0 +1,25 @@ + +COMP:JMD:MicroEMACS: +description = "MicroEMACS" +version = 4.04 +subpackages = MicroEMACS +required = MicroEMACS +dependencies = +distTreeRootSHARED = $MicroEMACS_DIR +distTreeRootCLIENT = $MicroEMACS_DIR +pkgFiles = $MicroEMACS_DIR/input/MicroEMACS.pkg + +FILE_DEFAULT: +mode = $DEFAULT_FILE_MODE +owner = $DEFAULT_FILE_OWNER +group = $DEFAULT_FILE_GROUP + +DIR_DEFAULT: +mode = $DEFAULT_DIR_MODE +owner = $DEFAULT_DIR_OWNER +group = $DEFAULT_DIR_GROUP + +FIFO_DEFAULT: +mode = $DEFAULT_FIFO_MODE +owner = $DEFAULT_FIFO_OWNER +group = $DEFAULT_FIFO_GROUP diff --git a/os5/cc/uemacs_4.04/input/microema.pkg b/os5/cc/uemacs_4.04/input/microema.pkg new file mode 100644 index 0000000..525a5ca --- /dev/null +++ b/os5/cc/uemacs_4.04/input/microema.pkg @@ -0,0 +1,200 @@ + +PKG:MicroEMACS: +description = "MicroEMACS package" +dependencies = +distTreeRootSHARED = $MicroEMACS_DIR +distTreeRootCLIENT = $MicroEMACS_DIR + +DIR:MicroEMACS:SHARED:.: +mode = 0755 +owner = bin +group = bin +flags = + +DIR:MicroEMACS:SHARED:usr: +mode = 0755 +owner = bin +group = bin +flags = + +DIR:MicroEMACS:SHARED:usr/local: +mode = 0755 +owner = bin +group = bin +flags = + +DIR:MicroEMACS:SHARED:usr/local/bin: +mode = 0755 +owner = bin +group = bin +flags = + +FILE:MicroEMACS:SHARED:usr/local/bin/me: +mode = 0755 +owner = bin +group = bin +flags = +exportPath = /usr/local/bin/me + +DIR:MicroEMACS:SHARED:usr/local/lib: +mode = 0755 +owner = bin +group = bin +flags = + +DIR:MicroEMACS:SHARED:usr/local/lib/emacs: +mode = 0755 +owner = bin +group = bin +flags = +exportPath = /usr/local/lib/emacs + +FILE:MicroEMACS:SHARED:usr/local/lib/emacs/bpage.cmd: +mode = 0644 +owner = bin +group = bin +flags = + +FILE:MicroEMACS:SHARED:usr/local/lib/emacs/cpage.cmd: +mode = 0644 +owner = bin +group = bin +flags = + +FILE:MicroEMACS:SHARED:usr/local/lib/emacs/cua.cmd: +mode = 0644 +owner = bin +group = bin +flags = + +FILE:MicroEMACS:SHARED:usr/local/lib/emacs/dev.cmd: +mode = 0644 +owner = bin +group = bin +flags = + +FILE:MicroEMACS:SHARED:usr/local/lib/emacs/ehelp.cmd: +mode = 0644 +owner = bin +group = bin +flags = + +FILE:MicroEMACS:SHARED:usr/local/lib/emacs/ehelp1.txt: +mode = 0644 +owner = bin +group = bin +flags = + +FILE:MicroEMACS:SHARED:usr/local/lib/emacs/ehelp2.txt: +mode = 0644 +owner = bin +group = bin +flags = + +FILE:MicroEMACS:SHARED:usr/local/lib/emacs/emacs.msg: +mode = 0644 +owner = bin +group = bin +flags = + +FILE:MicroEMACS:SHARED:usr/local/lib/emacs/emacs.rc: +mode = 0644 +owner = bin +group = bin +flags = + +FILE:MicroEMACS:SHARED:usr/local/lib/emacs/epage.cmd: +mode = 0644 +owner = bin +group = bin +flags = + +FILE:MicroEMACS:SHARED:usr/local/lib/emacs/error.cmd: +mode = 0644 +owner = bin +group = bin +flags = + +FILE:MicroEMACS:SHARED:usr/local/lib/emacs/filter.cmd: +mode = 0644 +owner = bin +group = bin +flags = + +FILE:MicroEMACS:SHARED:usr/local/lib/emacs/libc.hlp: +mode = 0644 +owner = bin +group = bin +flags = + +FILE:MicroEMACS:SHARED:usr/local/lib/emacs/lpage.cmd: +mode = 0644 +owner = bin +group = bin +flags = + +FILE:MicroEMACS:SHARED:usr/local/lib/emacs/mdi.cmd: +mode = 0644 +owner = bin +group = bin +flags = + +FILE:MicroEMACS:SHARED:usr/local/lib/emacs/mewin.cmd: +mode = 0644 +owner = bin +group = bin +flags = + +FILE:MicroEMACS:SHARED:usr/local/lib/emacs/newpage.cmd: +mode = 0644 +owner = bin +group = bin +flags = + +FILE:MicroEMACS:SHARED:usr/local/lib/emacs/opage.cmd: +mode = 0644 +owner = bin +group = bin +flags = + +FILE:MicroEMACS:SHARED:usr/local/lib/emacs/ppage.cmd: +mode = 0644 +owner = bin +group = bin +flags = + +FILE:MicroEMACS:SHARED:usr/local/lib/emacs/shell.cmd: +mode = 0644 +owner = bin +group = bin +flags = + +FILE:MicroEMACS:SHARED:usr/local/lib/emacs/wpage.cmd: +mode = 0644 +owner = bin +group = bin +flags = + +FILE:MicroEMACS:SHARED:usr/local/lib/emacs/.emacsmsg.english: +mode = 0644 +owner = bin +group = bin +flags = + +FILE:MicroEMACS:SHARED:usr/local/lib/emacs/.emacsmsg.french: +mode = 0644 +owner = bin +group = bin +flags = + +FILE:MicroEMACS:SHARED:usr/local/lib/emacs/.emacsrc: +mode = 0644 +owner = bin +group = bin +flags = + +FILE:MicroEMACS:SHARED:usr/local/lib/emacs/.emacsrc.linux: +mode = 0644 +owner = bin +group = bin +flags = diff --git a/os5/cc/uemacs_4.04/input/microema.prd b/os5/cc/uemacs_4.04/input/microema.prd new file mode 100644 index 0000000..05da115 --- /dev/null +++ b/os5/cc/uemacs_4.04/input/microema.prd @@ -0,0 +1,6 @@ +PROD:JMD:MicroEMACS: +description = "MicroEMACS" +version = 4.04 +packages = JMD:MicroEMACS +required = JMD:MicroEMACS +cmpntFiles = MicroEMACS.cmpnt diff --git a/os5/cc/uemacs_4.04/install b/os5/cc/uemacs_4.04/install new file mode 100644 index 0000000..09c7803 --- /dev/null +++ b/os5/cc/uemacs_4.04/install @@ -0,0 +1 @@ +custom -p JMD:MicroEMACS -i -z `pwd`/archives/FLOPPY diff --git a/os5/cc/uemacs_4.04/makesso b/os5/cc/uemacs_4.04/makesso new file mode 100644 index 0000000..26edd8a --- /dev/null +++ b/os5/cc/uemacs_4.04/makesso @@ -0,0 +1,25 @@ +: +# MakeSSO +# + +rm -rf archives sso + + CDMT_DIR=`pwd`; export CDMT_DIR + MicroEMACS_DIR=`pwd`; export MicroEMACS_DIR + cdmtParse + if test $? != 0 + then + exit 1 + fi + + cdmtCompress + if test $? != 0 + then + exit 1 + fi + + cdmtArchive + if test $? != 0 + then + exit 1 + fi diff --git a/os5/cc/uemacs_4.04/packem b/os5/cc/uemacs_4.04/packem new file mode 100644 index 0000000..a1b67e9 --- /dev/null +++ b/os5/cc/uemacs_4.04/packem @@ -0,0 +1,15 @@ +#!/bin/sh + +P=`pwd` +PKGTAR=`basename $P`-VOLS.tar +PKGDIST=`basename $P`-dist.tar.gz + +DIRS=usr +[ -d etc ] && DIRS="etc usr" +cd archives/FLOPPY +tar cf ../../$PKGTAR VOL* +cd ../.. +tar cf - $DIRS | /usr/local/bin/gzip -9 > $PKGDIST +[ -f $PKGTAR ] && rm -rf archives +[ -f $PKGDIST ] && rm -rf $DIRS +rm -rf sso diff --git a/os5/cc/uemacs_4.04/remove b/os5/cc/uemacs_4.04/remove new file mode 100644 index 0000000..ea6102a --- /dev/null +++ b/os5/cc/uemacs_4.04/remove @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Generic command-line Software Manger (custom) removal from +# media images. Based on the installation script by Phil Hollenback +# (philiph@sco.com) and Ron Record (rr@sco.com) +# + +# Set this to be the full pathname to the directory +# where your media images are: +VDIR=`pwd`/archives/FLOPPY +VOLS=$VDIR/VOL.000.000 + +component=`grep "component" < $VOLS | head -1 | cut -d= -f2 | cut -d: -f1` +package=`grep "component" < $VOLS | head -1 | cut -d= -f2 | cut -d: -f2` + +custom -p $component:$package -r diff --git a/os5/gcc/bin/emacs b/os5/gcc/bin/emacs new file mode 100644 index 0000000000000000000000000000000000000000..cac75a4ee540394fc5c27713cef512d9bcece467 GIT binary patch literal 697260 zcmc${eSB2awLg54Ou`TXGeA(3AVEPoS)?RzAgk|Kx~djX~-=HEDnJ$YgDFbDH3v zbd9F!ZSReVxh!XP~n2vvvkC^S`<+7CVFUxu`+&D@autG$0R9yrEJwJSfcbBX8M_ga z-ir|~G1IO?JP!fg6&}tq)9*pN#C%?eI0NBE1Y=~3jHQU~Mz|eev5}UF{!K;7r3kluDaS~-8BwO0 zHy!Z=ggg^wbgTJ1Cn3#YJ}*m1vmVL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ssJ_UznQFavw`y*OwB zHym~Yy>n2BQ!u8Y>Ept3#%>r)W@Pp3fFY^>|G`_}b97gVh4Tx(_3o*Eh* zDU_p@7t66=4|65_Z-#xM#e#Pk>#sT6;f45C6gB#2*lk(3RurA{rtR<|nW+-|iQ!tB zxmIScExc=quKyj|=|^J`7f$ps7V9l2kD%~a_Iv0(+u=uspJ_0(X}?T;vTy3_R6saQQZ$8*bZ+^G5({DJ{~I%*`4Tk9_9dkQi5xV-*WWCW|I0j)Ee*3V#c|H{W0fD zjeXL_P*m6be#YtE+Qm=mI;Ogp(86=z`SqU7IK9xl3sygCp7%i%#-pwcT^qV52Jj#; zlhl)_Rk!j}##zB`m&dDVTqc)Qw+h|rzvyODx|`75gid2Hrt(}$cMG~((BZnXW2&1^ z>25=J8#*Qn)Tm=QhQe|4e2dpIPVvbuYxO7|BxaI&0d=|`>K;vetTgmTU_Q5MFGKg| z-uQLSFH5mcK98qS*r(dF^Ig_ssd?6T=OIYzYF}es)Cr&Bg%mSp6FbqBZG6UK(|Ngs zhk6V>#a|q`0ZgpA=exQ_xA|AcV$x1cV=&#QOy45Dzj1n-s_yyzSflfC=kQ&r3Dp=( h`zbR@>!A%+A2Sz;DKXinOxMY!jdBy0MAmt|+y&ULE5`r; literal 0 HcmV?d00001 diff --git a/os5/gcc/estruct.h b/os5/gcc/estruct.h new file mode 100644 index 0000000..26ffa3e --- /dev/null +++ b/os5/gcc/estruct.h @@ -0,0 +1,1299 @@ +/* ESTRUCT: Structure and preprocesser defined for + MicroEMACS 4.00 + + (C)Copyright 1995 by Daniel Lawrence + written by Daniel Lawrence + based on code by Dave G. Conroy, + Steve Wilhite and George Jones +*/ + +#ifdef LATTICE +#undef LATTICE /* don't use their definitions...use ours */ +#endif +#ifdef MSDOS +#undef MSDOS +#endif +#ifdef WINNT +#undef WINNT +#endif +#ifdef LINUX +#undef LINUX +#endif +#ifdef AMIGA +#undef AMIGA +#endif +#ifdef EGA +#undef EGA +#endif +#ifdef CTRLZ +#undef CTRLZ +#endif + +/* Program Identification..... + + PROGNAME should always be MicroEMACS for a distribution + unmodified version. People using MicroEMACS as a shell + for other products should change this to reflect their + product. Macros can query this via the $progname variable +*/ + +#define PROGNAME "MicroEMACS" +#define VERSION "4.00" + +/* Machine/OS definitions */ +/* [Set one of these!!] */ + +#define AMIGA 0 /* AmigaDOS */ +#define AOSVS 0 /* Data General AOS/VS */ +#define AUX 0 /* Apple UNIX for Macintosh */ +#define AIX 0 /* IBM UNIX for various machines*/ +#define AVIION 0 /* Data General AViiON */ +#define BSD 0 /* UNIX BSD 4.2 and ULTRIX */ +#define FINDER 0 /* Macintosh OS */ +#define FREEBSD 0 /* FREEBSD 386 version 2 or + */ +#define HPUX8 0 /* HPUX HP 9000 ver 8 or less */ +#define HPUX9 0 /* HPUX HP 9000 ver 9 */ +#define LINUX 0 /* Linux */ +#define MPE 0 /* HP MPE/XL */ +#define MSDOS 0 /* MS-DOS */ +#define WINNT 0 /* MS-Win NT */ +#define OS2 0 /* Microsoft or IBM OS/2 */ +#define SMOS 0 /* Supermax UNIX System V */ +#define SUN 0 /* SUN v4.0 */ +#define TOS 0 /* ST520, TOS */ +#define USG 1 /* UNIX system V */ +#define VMS 0 /* VAX/VMS */ +#define WMCS 0 /* Wicat's MCS */ +#define XENIX 0 /* IBM-PC SCO XENIX */ + +/* Compiler definitions */ +/* [Set one of these!!] */ +#define ALCYON 0 /* ALCYON Atari ST compiler */ +#define AZTEC 0 /* Aztec C 4.00e ONLY for the amiga now... */ +#define DGC 0 /* Data General AOS/VS C... */ +#define GCC 0 /* the GNU C compiler */ +#define IC 0 /* Rational Systems Instant C */ +#define LATTICE 0 /* Lattice 2.14 through 3.0 compilers */ +#define MSC 0 /* MicroSoft C compile version 3 thru 7 */ +#define MWC 0 /* Mark Williams C */ +#define TURBO 0 /* Turbo C and Borland C++ under MSDOS */ +#define UNIX 1 /* a standard UNIX compiler (cc) */ +#define ZTC 0 /* Zortech C/C++ 1.02 thru 2.10 under MSDOS */ + +/* Machine stack growth direction. */ +/* [Set this to 1 if your machine stack grows UP!!!] */ +/* data general mv/eclipse series stack grows up. */ +/* dec vax series stack grows down... got it??? */ + +#define STACK_GROWS_UP 0 + +/* Debugging options */ +#define RAMSIZE 0 /* dynamic RAM memory usage tracking */ +#define RAMSHOW 0 /* auto dynamic RAM reporting */ +#define RAMTRCK 0 /* send debug info to MALLOC.DAT */ +#define DEBUG_SEARCH 0 /* pop some search info on patterns */ + +/* Special keyboard/network definitions */ + +#define ATKBD 0 /* AT-style keyboard with F11, F12 & grey keys */ +#define WANGPC 0 /* WangPC - mostly escape sequences */ +#define VT100 0 /* Handle VT100 style keypad - NOT VMS. */ +#define KEYPAD 0 /* VMS - turn on and off application */ + /* keypad automatically */ +#define XONDATA 0 /* VMS - set to force /NOTTSYNC/NOHOSTSY */ +#define RMSIO 0 /* VMS - skip the rotten C runtime and */ + /* use RMS directly */ +#define OPTMEM 0 /* VMS 5.0 and up - use a less standard */ + /* but more efficient memory allocator */ + +/* Terminal Output definitions */ +/* [Set one of these!!] */ + +#define ANSI 0 /* ANSI escape sequences */ +#define CURSES 0 /* Use CURSES */ +#define DASHER 0 /* DG Dasher 2xx/4xx crts */ +#define DG10 0 /* Data General system/10 */ +#define FMR 0 /* Fujitsu FMR series driver */ +#define HP110 0 /* HP110 screen driver */ +#define HP150 0 /* HP150 screen driver */ +#define I55 0 /* IBM PS55 DOS J4.0/V */ +#define IBMPC 0 /* IBM-PC CGA/MONO/EGA/VGA drvr */ +#define MAC 0 /* Macintosh */ +#define NEC 0 /* NEC-9801VM driver */ +#define OS2NPM 0 /* OS/2 non-Presentation Mgr. */ +#define SMG 0 /* SMG library on VMS */ +#define ST52 0 /* Atari 520/1040ST screen */ +#define TERMCAP 1 /* Use TERMCAP */ +#define TIPC 0 /* TI Profesional PC driver */ +#define VT52 0 /* VT52 terminal (Zenith). */ +#define NTCON 0 /* Windows NT console */ +#define XVT 0 /* XVT windowing system */ +#define Z309 0 /* Zenith 100 PC family driver */ + +/* Windowing system style (pick one) */ + +#define WINDOW_TEXT 1 /* [default] Text mode */ +#define WINDOW_MSWIN 0 /* MicroSoft Windows */ +#define WINDOW_MSWIN32 0 /* MicroSoft Windows 32 bit API */ +#define WINDOW_X 0 /* X/Unix */ + +/* Language text options (pick one) */ + +#define ENGLISH 1 /* [default] */ +#define FRENCH 0 +#define SPANISH 0 +#define GERMAN 0 +#define DUTCH 0 +#define PLATIN 0 /* Pig Latin */ +#define JAPAN 0 +#define LATIN 0 /* real Latin */ + +/* Configuration options */ + +#define TYPEAH 1 /* type ahead causes update to be skipped */ +#define LOGFLG 0 /* send all executed commands to EMACS.LOG */ +#define VISMAC 0 /* update display during keyboard macros */ +#define CTRLZ 0 /* add a ^Z at end of files under MSDOS only */ +#define CLEAN 0 /* de-alloc memory on exit */ +#define CALLED 0 /* is emacs a called subroutine? or stand alone */ + +#define REVSTA 1 /* Status line appears in reverse video */ +#define COLOR 1 /* color commands and windows */ + +#define FILOCK 0 /* file locking under unix BSD 4.2 */ +#define ISRCH 1 /* Incremental searches like ITS EMACS */ +#define FLABEL 0 /* function key label code [HP150] */ +#define CRYPT 1 /* file encryption enabled? */ +#define MAGIC 1 /* include regular expression matching? */ +#define MOUSE 1 /* Include routines for mouse actions */ +#define NOISY 1 /* Use a fancy BELL if it exists */ +#define CTAGS 1 /* include vi-like tagging? */ +#define SPEECH 0 /* spoken EMACS, for the sight impared [not ready] */ +#define VARARG 1 /* use varargs.h for mlwrite() */ + +#if XVT +#undef COLOR +#define COLOR 1 /* overide this to be TRUE for XVT always */ +#endif + +#define JMDEXT 1 /* enable J-M Dubois's extensions */ + +#if JMDEXT +#define BACKUP 1 /* backup previous file version */ +#define LIBHELP 1 /* help des fonctions de la bibliotheque C */ +#define NEWVARS 1 /* supplemental environment variables */ +#define DYNMSGS 1 /* dynamic load of messages */ +#endif + +/* Character set options */ +/* [Set one of these!!] */ +#define ASCII 1 /* always using ASCII char sequences for now */ +#define EBCDIC 0 /* later IBM mainfraim versions will use EBCDIC */ + +/* handle constant and voids properly */ + +#if VMS +#define CONST readonly +#define VOID void +#define NOSHARE noshare +#else +#if AOSVS +#define CONST $shared $align(1) /* fake a const */ +#define VOID +#define NOSHARE $low32k $align(1) /* attempt to optimize read/write vars. */ +#else + +#if __STDC__ || MSC || TURBO || GCC || (AMIGA && LATTICE) || USG +#define CONST const +#define VOID void +#define NOSHARE +#else +#define CONST +#if IC +#define VOID void +#else +#define VOID +#endif +#define NOSHARE +#endif + +#endif +#endif + +/* System dependant library redefinitions, structures and includes */ + +/* multibyte character support? */ + +#if NEC || FMR || I55 +#define DBCS 1 /* double byte character sets enabled */ +#define INSDEL 1 /* use insert/delete line display optimizations */ + +/* define DBCS prefix bytes */ +#define is2char(ch) (((ch&0xff) >= 0x81 && (ch&0xff) <= 0x9f) || ((ch&0xff) >=0xe0 && (ch&0xff) <= 0xfc)) + +#else +#define DBCS 0 +#define INSDEL 0 +#endif + +/* Can we catch the SIGWINCH (the window size change signal)? */ + +#if AIX || HPUX9 || LINUX +#define HANDLE_WINCH 1 +#else +#define HANDLE_WINCH 0 +#endif + +/* Prototypes in use? */ + +#if MSC || TURBO || IC || VMS || GCC || ZTC +#define PROTO 1 +#else +#define PROTO 0 +#endif + +/* the following define allows me to initialize unions... + otherwise we make them structures (like the keybinding table) */ + +#if __STDC__ || MSC || TURBO || IC || ZTC +#define ETYPE union +#else +#define ETYPE struct +#endif + +/* Instant C can't do stat()s. Arrrg. No file locking for you */ +#if IC && MSDOS +#undef FILOCK +#define FILOCK 0 +#endif + +/* Mark Williams/Atari has no standard or varargs or directory functions */ +#if TOS & MWC +#undef VARARG +#define VARARG 0 +#undef FILOCK +#define FILOCK 0 +#endif + +/* MS-Windows */ + +#if WINNT || WINDOW_MSWIN || WINDOW_MSWIN32 +#if WINDOW_MSWIN32 +#undef WINDOW_MSWIN +#define WINDOW_MSWIN 1 +#endif +#if WINDOW_MSWIN && WINNT +#undef WINDOW_MSWIN32 +#define WINDOW_MSWIN32 1 +#endif +#undef VOID /* windows.h will wind up defining this */ +#include /* --------- Huge include file here !!! ---------*/ +#if NTCON +#include +#include +#include +#endif + +#undef NEAR +#define NEAR +#define DNEAR +#if MSC || IC +#undef CDECL +#define CDECL __cdecl +#define DUMMYSZ 1 /* dummy size for unsized extern arrays to avoid + silly DGROUP fixup */ +#else +#if TURBO +#define DUMMYSZ /* nothing */ +#else +#define CDECL _cdecl /* ZTC */ +#define DUMMYSZ /* nothing */ +#endif +#endif + +#if WINNT +#define EXPORT /* Windows NT doesn't like this */ +#endif + +#if WINDOW_MSWIN +#undef TYPEAH +#define TYPEAH 0 /* typeahead is handled at the term driver level */ +#undef CALLED +#define CALLED 1 /* under MS Windows, "main" resides in the sys driver */ +#if MSC +#define EXPORT __export +#else +#define EXPORT _export /* Fine for TURBO and ZTC */ +#endif +#endif +#else + +/* neither Windows NT nor MS-Windows */ + +#define DUMMYSZ /* nothing */ + +#if MSDOS & (TURBO | MSC | TIPC) +#define NEAR +#define DNEAR +#define PASCAL pascal +#define CDECL cdecl +#else +#if MSDOS & ZTC +#define NEAR +#define DNEAR +#define PASCAL _pascal +#define CDECL _cdecl +#else +#define NEAR +#define DNEAR +#define PASCAL +#define CDECL +#endif +#endif + +#endif + +#if TURBO +#include +#include +#undef peek +#undef poke +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#endif + +#if IC +#include +#undef peek +#undef poke +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#endif + +#if LATTICE & MSDOS +/* you may have to remove this one definition with LATTICE version + 3.2 and above */ +#define unsigned +#endif + +#if IC +#define inp inportb +#define outp outportb +#define intdos(a, b) int86(33, a, b) +#endif + +#if AZTEC +#undef putc +#undef getc +#if MSDOS +#define getc a1getc +#define int86 sysint +#define intdos(a, b) sysint(33, a, b) +#define inp inportb +#define outp outportb +#else +#define getc agetc +#endif +#define putc aputc + +struct XREG { + unsigned ax,bx,cx,dx,si,di,ds,es; +}; + +struct HREG { + char al,ah,bl,bh,cl,ch,dl,dh,d1,d2,e1,e2; +}; + +union REGS { + struct XREG x; + struct HREG h; +}; + +struct SREGS { + unsigned cs, ss, ds, es; +}; +#endif + +#if MSDOS & MWC +#include +#define int86(a, b, c) intcall(b, c, a) +#define intdos(a, b) intcall(a, b, DOSINT) +#define inp(a) in(a) +#define outp(a, b) out(a, b) +#define movmem(a, b, c) memcpy(b, a, c) + +struct XREG { + unsigned int ax,bx,cx,dx,si,di,ds,es,flags; +}; + +struct HREG { + char al,ah,bl,bh,cl,ch,dl,dh; + unsigned int ds,es,flags; +}; + +union REGS { + struct XREG x; + struct HREG h; +}; +#endif + +#if MSDOS & MSC +#include +#include +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#define movmem(a, b, c) memcpy(b, a, c) +#define _strrev(a) strrev(a) +#endif + +#if MSDOS & LATTICE +#undef CPM +#undef LATTICE +#include +#undef CPM +#endif + +/* System V doesn't name this the same as others */ +#if USG | AIX | AUX | SUN | (OS2 & MSC) +#define movmem(a, b, c) memcpy(b, a, c) +#endif + +#if LINUX +#define movmem(a, b, c) memmove(b, a, c) +#endif + +/* this keeps VMS happy */ +#if VMS +#define getname xgetname +#define unlink(a) delete(a) +#endif + +/* some options for AOS/VS */ +#if AOSVS +#define ORMDNI 1 +#endif + +/* define some ability flags */ + +#if (IBMPC | Z309 | FMR | TIPC) & !(WINDOW_MSWIN | WINDOW_MSWIN32) +#define MEMMAP 1 +#else +#define MEMMAP 0 +#endif + +#if MSDOS | WINNT | OS2 | USG | LINUX | AIX | AUX | SMOS | HPUX8 | HPUX9 | BSD | FREEBSD | (TOS & MWC) | WMCS | SUN | MPE +#define ENVFUNC 1 +#else +#define ENVFUNC 0 +#endif + +#if AUX +#define RETCHAR '\n' +#else +#define RETCHAR '\r' +#endif + +#if THEOS +#define _CTYPE_NO_MACRO 1 +#define RET_CHAR '\n' +#else +#define RET_CHAR '\r' +#endif + +#if MPE +#define DIRSEPSTR "." +#define DIRSEPCHAR '.' +#else +#if TOS || MSDOS || WINNT || OS2 +#define DIRSEPSTR "\\" +#define DIRSEPCHAR '\\' +#define DRIVESEPCHAR ':' +#else +#define DIRSEPSTR "/" +#define DIRSEPCHAR '/' +#define DRIVESEPCHAR '\0' +#endif +#endif + +#if VARARG +#if (GCC == 0) && (USG || LINUX || AIX || AUX || BSD || FREEBSD || SUN || XENIX || HPUX8 || HPUX9 || AVIION || MPE) +#define VARG 1 +#define SARG 0 +#include +#else +#define VARG 0 +#define SARG 1 +#include +#endif +#endif + +#if ZTC +#include +#define movmem(a, b, c) memcpy(b, a, c) +#endif + +/* Emacs global flag bit definitions (for gflags) */ + +#define GFREAD 1 /* read first file in at startup */ +#define GFSDRAW 2 /* suppress a screen redraw */ +#define GFEXIT 4 /* exit from emacs pending */ + +/* internal constants */ + +#define NBINDS 300 /* max # of bound keys */ +#if AOSVS | VMS | WINNT | SUN | BSD | FREEBSD | USG | LINUX | ZENIX | HPUX8 | HPUX9 | OS2 +#define NFILEN 256 +#else +#define NFILEN 80 /* # of bytes, file name */ +#endif +#define NBUFN 128 /* # of bytes, buffer name */ +#define NLINE 256 /* # of bytes, input line */ +#define NSTRING 128 /* # of bytes, string buffers */ +#define NKBDM 4096 /* # of strokes, keyboard macro */ +#define NPAT 128 /* # of bytes, pattern */ +#define HUGE 1000 /* Huge number */ +#define NLOCKS 256 /* max # of file locks active */ +#define NCOLORS 16 /* number of supported colors */ +#define KBLOCK 250 /* sizeof kill buffer chunks */ +#define NRING 16 /* # of buffers in kill ring */ +#define NBLOCK 16 /* line block chunk size */ +#define NVSIZE 16 /* max #chars in a var name */ +#define NMARKS 16 /* number of marks */ +#define MAXSYM 32 /* max # chars in symbol to expand */ +#define MINFLEN 3 /* min # chars to match &func */ + +#define CTRL 0x0100 /* Control flag, or'ed in */ +#define META 0x0200 /* Meta flag, or'ed in */ +#define CTLX 0x0400 /* ^X flag, or'ed in */ +#define SPEC 0x0800 /* special key (function keys) */ +#define MOUS 0x1000 /* alternative input device (mouse) */ +#define SHFT 0x2000 /* shifted (for function keys) */ +#define ALTD 0x4000 /* ALT key... */ +#define MENU MOUS+SPEC /* menu selection (WINDOW_MSWIN) */ + +#define BINDNUL 0 /* not bound to anything */ +#define BINDFNC 1 /* key bound to a function */ +#define BINDBUF 2 /* key bound to a buffer */ + +#ifdef FALSE +#undef FALSE +#endif +#ifdef TRUE +#undef TRUE +#endif + +#define FALSE 0 /* False, no, bad, etc. */ +#define TRUE 1 /* True, yes, good, etc. */ +#define ABORT 2 /* Death, ^G, abort, etc. */ +#define FAILD 3 /* not-quite fatal false return */ + +#define STOP 0 /* keyboard macro not in use */ +#define PLAY 1 /* playing */ +#define RECORD 2 /* recording */ + +/* Completion types */ + +#define CMP_BUFFER 0 +#define CMP_COMMAND 1 +#define CMP_FILENAME 2 + +/* Directive definitions */ + +#define DIF 0 +#define DELSE 1 +#define DENDIF 2 +#define DGOTO 3 +#define DRETURN 4 +#define DENDM 5 +#define DWHILE 6 +#define DENDWHILE 7 +#define DBREAK 8 +#define DFORCE 9 + +#define NUMDIRS 10 + +/* + * PTBEG, PTEND, FORWARD, and REVERSE are all toggle-able values for + * routines that need directions. + */ +#define PTBEG 0 /* Leave the point at the beginning on search */ +#define PTEND 1 /* Leave the point at the end on search */ +#define FORWARD 0 /* do things in a forward direction */ +#define REVERSE 1 /* do things in a backwards direction */ + +#define FIOSUC 0 /* File I/O, success. */ +#define FIOFNF 1 /* File I/O, file not found. */ +#define FIOEOF 2 /* File I/O, end of file. */ +#define FIOERR 3 /* File I/O, error. */ +#define FIOMEM 4 /* File I/O, out of memory */ +#define FIOFUN 5 /* File I/O, eod of file/bad line*/ +#define FIODEL 6 /* Can't delete/rename file */ + +#if WINDOW_MSWIN +/* values for the fbusy flag */ +#define FREADING 1 /* file read in progress */ +#define FWRITING 2 /* file write in progress */ +/* if no file activity, the value FALSE is used */ +#endif + +#define CFCPCN 0x0001 /* Last command was C-P, C-N */ +#define CFKILL 0x0002 /* Last command was a kill */ +#define CFSRCH 0x0004 /* last command was a search */ +#define CFYANK 0x0008 /* last command was a yank */ + +#define SRNORM 0 /* end past, begin front */ +#define SRBEGIN 1 /* always at front */ +#define SREND 2 /* always one past end */ + +#define BELL 0x07 /* a bell character */ +#define TAB 0x09 /* a tab character */ + +#if USG | LINUX | AIX | AUX | SMOS | HPUX8 | HPUX9 | BSD | FREEBSD | SUN | XENIX | AVIION +#define PATHCHR ':' +#else +#if WMCS || MPE +#define PATHCHR ',' +#else +#define PATHCHR ';' +#endif +#endif + +#define INTWIDTH sizeof(int) * 3 +#define LONGWIDTH sizeof(long) * 3 + +/* Macro argument token types */ + +#define TKNUL 0 /* end-of-string */ +#define TKARG 1 /* interactive argument */ +#define TKBUF 2 /* buffer argument */ +#define TKVAR 3 /* user variables */ +#define TKENV 4 /* environment variables */ +#define TKFUN 5 /* function.... */ +#define TKDIR 6 /* directive */ +#define TKLBL 7 /* line label */ +#define TKLIT 8 /* numeric literal */ +#define TKSTR 9 /* quoted string literal */ +#define TKCMD 10 /* command name */ + +/* Internal defined functions */ + +#define nextab(a) (a - (a % tabsize)) + tabsize + +/* DIFCASE represents the integer difference between upper + and lower case letters. It is an xor-able value, which is + fortunate, since the relative positions of upper to lower + case letters is the opposite of ascii in ebcdic. +*/ + +#if ASCII +#define DIFCASE 0x20 +#else +#define DIFCASE 0x40 +#endif + +/* Dynamic RAM tracking and reporting redefinitions */ + +#if RAMSIZE +#define malloc allocate +#define free release +#else +#if VMS & OPTMEM +#define malloc VAXC$MALLOC_OPT +#define free VAXC$FREE_OPT +#define calloc VAXC$CALLOC_OPT +#define realloc VAXC$REALLOC_OPT +#define cfree VAXC$CFREE_OPT +#endif +#endif + +/* under MS Windows, we use dialog boxes to prompt the user for filenames */ +#if WINDOW_MSWIN +#define FILENAMEREPLY(p,b,nb) filenamedlg(p,b,nb,TRUE) +#else +#define FILENAMEREPLY(p,b,nb) mlreply(p,b,nb) +#endif + +/* formal parameters to procedures are stored as a linked list + of argument names using the following simple structure: +*/ + +typedef struct PARG { + struct PARG *next; /* ptr to next linked argument */ + char name[NVSIZE+1]; /* name of the argument */ +} PARG; + +/* UNDO definitions and types */ + +typedef int OPTYPE; /* type of operation being recorded/played back */ + +#define OP_CMND 1 /* beginning of command */ +#define OP_DELC 2 /* delete a single character */ +#define OP_INSC 3 /* insert a single character */ +#define OP_DSTR 4 /* delete a string of characters */ +#define OP_ISTR 5 /* insert a string of characters */ +#define OP_REPC 6 /* replace a character */ +#define OP_CPOS 7 /* set the cursor position */ + +/* object to be undone! */ + +typedef union OBJECT { + char obj_char; /* a character */ + char obj_string[1]; /* many characters */ + char *obj_sptr; /* a ptr to a character */ +} OBJECT; + +typedef struct UNDO_OBJ { + struct UNDO_OBJ *next; /* ptr to next undo object */ + OPTYPE type; /* type of operation */ + long line_num; /* line offset from buffer beginning */ + int offset; /* offset into that line */ + long count; /* repetitions? */ + OBJECT undo_obj; /* object to be undone */ +} UNDO_OBJ; + +/* + * There is a window structure allocated for every active display window. The + * windows are kept in a big list, in top to bottom screen order, with the + * listhead at "wheadp". Each window contains its own values of dot and mark. + * The flag field contains some bits that are set by commands to guide + * redisplay. Although this is a bit of a compromise in terms of decoupling, + * the full blown redisplay is just too expensive to run for every input + * character. + */ +typedef struct EWINDOW { + struct EWINDOW *w_wndp; /* Next window */ + struct BUFFER *w_bufp; /* Buffer displayed in window */ + struct LINE *w_linep; /* Top line in the window */ + struct LINE *w_dotp; /* Line containing "." */ + short w_doto; /* Byte offset for "." */ + struct LINE *w_markp[NMARKS]; /* Line containing "mark" */ + short w_marko[NMARKS]; /* Byte offset for "mark" */ + char w_toprow; /* Origin 0 top row of window */ + char w_ntrows; /* # of rows of text in window */ + char w_force; /* If NZ, forcing row. */ + char w_flag; /* Flags. */ +#if COLOR + char w_fcolor; /* current forground color */ + char w_bcolor; /* current background color */ +#endif + int w_fcol; /* first column displayed */ +} EWINDOW; + +#define WFFORCE 0x01 /* Window needs forced reframe */ +#define WFMOVE 0x02 /* Movement from line to line */ +#define WFEDIT 0x04 /* Editing within a line */ +#define WFHARD 0x08 /* Better to a full display */ +#define WFMODE 0x10 /* Update mode line. */ +#define WFCOLR 0x20 /* Needs a color change */ + +/* This structure holds the information about each line appearing on the + * video display. The redisplay module uses an array of virtual display + * lines. On systems that do not have direct access to display memory, + * there is also an array of physical display lines used to minimize + * video updating. In most cases, these two arrays are unique. If + * WINDOW_MSWIN is 1, there is a pair of such arrays in each ESCREEN + * structure. + */ + +typedef struct VIDEO { + int v_flag; /* Flags */ +#if COLOR + int v_fcolor; /* current forground color */ + int v_bcolor; /* current background color */ + int v_rfcolor; /* requested forground color */ + int v_rbcolor; /* requested background color */ +#endif + int v_left; /* left edge of reverse video */ + int v_right; /* right right of reverse video */ +#if INSDEL && MEMMAP == 0 + int v_rline; /* requested screen line # */ +#endif + char v_text[1]; /* Screen data. */ +} VIDEO; + +#define VFNEW 0x0001 /* contents not meaningful yet */ +#define VFCHG 0x0002 /* Changed flag */ +#define VFEXT 0x0004 /* extended (beyond column 80) */ +#define VFCOL 0x0008 /* color change requested */ + +/* + * This structure holds the information about each separate "screen" + * within the current editing session. On a character based system, these + * screens overlay each other, and can individually be brought to front. + * On a windowing system like MicroSoft Windows 3.0, OS/2, the Macintosh, + * Intuition, Sunview or X-windows, each screen is represented in an OS + * window. The terminolgy is wrong in emacs..... + * + * EMACS The outside World + * screen window + * window pane + */ + +typedef struct ESCREEN { + struct ESCREEN *s_next_screen; /* link to next screen in list */ + EWINDOW *s_first_window; /* head of linked list of windows */ + EWINDOW *s_cur_window; /* current window in this screen */ + char *s_screen_name; /* name of the current window */ + short s_roworg; /* row origin of stored screen */ + short s_colorg; /* column origin of stored screen */ + short s_nrow; /* row width of stored screen */ + short s_ncol; /* column origin of stored screen */ +#if WINDOW_MSWIN + VIDEO **s_virtual; /* virtual screen contents */ + VIDEO **s_physical; /* physical screen contents */ + HWND s_drvhandle; /* handle for the "term" driver */ +#endif +} ESCREEN; + +/* + * Text is kept in buffers. A buffer header, described below, exists for every + * buffer in the system. The buffers are kept in a big list, so that commands + * that search for a buffer by name can find the buffer header. There is a + * safe store for the dot and mark in the header, but this is only valid if + * the buffer is not being displayed (that is, if "b_nwnd" is 0). The text for + * the buffer is kept in a circularly linked list of lines, with a pointer to + * the header line in "b_linep". Buffers may be "Inactive" which means the + * files associated with them have not been read in yet. These get read in + * at "use buffer" time. + * Some buffers are really procedures and have a little extra information + * stored with them. + */ +typedef struct BUFFER { + struct BUFFER *b_bufp; /* Link to next BUFFER */ + struct LINE *b_dotp; /* Link to "." LINE structure */ + short b_doto; /* Offset of "." in above LINE */ + struct LINE *b_markp[NMARKS]; /* The same as the above two, */ + short b_marko[NMARKS]; /* but for the "mark" */ + int b_fcol; /* first col to display */ + struct LINE *b_linep; /* Link to the header LINE */ + struct LINE *b_topline; /* Link to narrowed top text */ + struct LINE *b_botline; /* Link to narrowed bottom text */ + char b_active; /* window activated flag */ + char b_nwnd; /* Count of windows on buffer */ + char b_exec; /* how many active executions */ + char b_flag; /* Flags */ + int b_mode; /* editor mode of this buffer */ + char b_fname[NFILEN]; /* File name */ + char b_bname[NBUFN]; /* Buffer name */ +#if CRYPT + char b_key[NPAT]; /* current encrypted key */ +#endif + int b_numargs; /* number of arguments to procedure */ + PARG *b_args; /* ptr to the first argument */ + UNDO_OBJ *undo_head; /* head of undo stack for buffer */ + long undo_count; /* # of undo operations stacked */ + long last_access; /* time of last access */ +} BUFFER; + +#define BFINVS 0x01 /* Internal invisable buffer */ +#define BFCHG 0x02 /* Changed since last write */ +#define BFTRUNC 0x04 /* buffer was truncated when read */ +#define BFNAROW 0x08 /* buffer has been narrowed */ +#if LIBHELP +#define BFERROR 0x40 /* Error file buffer */ +#define BFHELP 0x80 /* Buffer is a help buffer */ +#endif + +#define NOTPROC -1 /* buffer is not a procedure */ + +/* mode flags */ +#if JMDEXT +#if !THEOS +#define NUMMODES 15 /* # of defined modes */ +#else +#define NUMMODES 14 /* # of defined modes */ +#endif +#else +#define NUMMODES 11 /* # of defined modes */ +#endif + +#define MDWRAP 0x0001 /* word wrap */ +#define MDCMOD 0x0002 /* C indentation and fence match*/ +#define MDSPELL 0x0004 /* spell error parsing */ +#define MDEXACT 0x0008 /* Exact matching for searches */ +#define MDVIEW 0x0010 /* read-only buffer */ +#define MDOVER 0x0020 /* overwrite mode */ +#define MDMAGIC 0x0040 /* regular expresions in search */ +#define MDCRYPT 0x0080 /* encrytion mode active */ +#define MDASAVE 0x0100 /* auto-save mode */ +#define MDREPL 0x0200 /* replace mode */ +#define MDABBR 0x0400 /* abbreviation expansion mode */ +#if JMDEXT +#define MDNOBAK 0x0800 /* no auto backup */ +#define MDGRAF1 0x1000 /* single line graphics */ +#define MDGRAF2 0x2000 /* double line graphics */ +#if !THEOS +#define MDTHEOS 0x4000 /* THEOS character set */ +#endif +#endif + +/* + * The starting position of a region, and the size of the region in + * characters, is kept in a region structure. Used by the region commands. + */ +typedef struct { + struct LINE *r_linep; /* Origin LINE address. */ + short r_offset; /* Origin LINE offset. */ + long r_size; /* Length in characters. */ +} REGION; + +/* + * All text is kept in circularly linked lists of "LINE" structures. These + * begin at the header line (which is the blank line beyond the end of the + * buffer). This line is pointed to by the "BUFFER". Each line contains a the + * number of bytes in the line (the "used" size), the size of the text array, + * and the text. The end of line is not stored as a byte; it's implied. + */ +typedef struct LINE { + struct LINE *l_fp; /* Link to the next line */ + struct LINE *l_bp; /* Link to the previous line */ + short l_size; /* Allocated size */ + short l_used; /* Used size */ + char l_text[1]; /* A bunch of characters. */ +} LINE; + +#define lforw(lp) ((lp)->l_fp) +#define lback(lp) ((lp)->l_bp) +#if UNIX && (SUN || HPUX8 || HPUX9 || BSD || FREEBSD) +#define lgetc(lp, n) ((unsigned char)(lp)->l_text[(n)]) +#else +#define lgetc(lp, n) ((lp)->l_text[(n)]) +#endif +#define lputc(lp, n, c) ((lp)->l_text[(n)]=(c)) +#define lused(lp) ((lp)->l_used) +#define lsize(lp) ((lp)->l_size) +#define ltext(lp) ((lp)->l_text) + +/* This structure is used to hold a user variables name and its + current value. These are used for both the global and the + local symbol tables. +*/ + +typedef struct UVAR { + char u_name[NVSIZE + 1]; /* name of user variable */ + char *u_value; /* value (string) */ +} UVAR; + +#define VT_NONE 0 /* don't declare it if not found */ +#define VT_LOCAL 1 /* local to the current procedure */ +#define VT_GLOBAL 2 /* global to all procedures */ + +/* A UTABLE is a user variable table.... containing some header + information and an array of user variable names and definitions. + They are held together in a linked list, the last member of + the list being the global user variable table. +*/ + +typedef struct UTABLE { + struct UTABLE *next; /* ptr to next user variable table */ + int size; /* max number of variables in table */ + BUFFER *bufp; /* ptr to buffer holding procedure + assosiated with this symbol table. */ + UVAR uv[1]; /* list of variable names/definitions + in this variable table */ +} UTABLE; + +/* + * The editor communicates with the display using a high level interface. A + * "TERM" structure holds useful variables, and indirect pointers to routines + * that do useful operations. The low level get and put routines are here too. + * This lets a terminal, in addition to having non standard commands, have + * funny get and put character code too. The calls might get changed to + * "termp->t_field" style in the future, to make it possible to run more than + * one terminal type. + */ +#if PROTO +typedef struct { + short t_mrow; /* max number of rows allowable */ + short t_nrow; /* current number of rows used */ + short t_mcol; /* max Number of columns. */ + short t_ncol; /* current Number of columns. */ + short t_roworg; /* origin row (normally zero) */ + short t_colorg; /* origin column (normally zero)*/ + short t_margin; /* min margin for extended lines*/ + short t_scrsiz; /* size of scroll region " */ + int t_pause; /* # times thru update to pause */ + int (PASCAL NEAR *t_open)(void); /* Open terminal at the start.*/ + int (PASCAL NEAR *t_close)(void); /* Close terminal at end. */ + int (PASCAL NEAR *t_kopen)(void); /* Open keyboard */ + int (PASCAL NEAR *t_kclose)(void); /* Close keyboard */ + int (PASCAL NEAR *t_getchar)(void); /* Get character from keyboard. */ + int (PASCAL NEAR *t_putchar)(int); /* Put character to display.*/ + int (PASCAL NEAR *t_flush)(void); /* Flush output buffers. */ + int (PASCAL NEAR *t_move)(int, int);/* Move the cursor, origin 0.*/ + int (PASCAL NEAR *t_eeol)(void); /* Erase to end of line. */ + int (PASCAL NEAR *t_eeop)(void); /* Erase to end of page. */ + int (PASCAL NEAR *t_clrdesk)(void); /* Clear the page totally */ + int (PASCAL NEAR *t_beep)(void); /* Beep. */ + int (PASCAL NEAR *t_rev)(int); /* set reverse video state */ + int (PASCAL NEAR *t_rez)(char *); /* change screen resolution */ +#if COLOR + int (PASCAL NEAR *t_setfor)(int); /* set forground color */ + int (PASCAL NEAR *t_setback)(int); /* set background color */ +#endif +#if INSDEL + int (PASCAL NEAR *t_insline)(int); /* insert a screen line */ + int (PASCAL NEAR *t_delline)(int); /* delete a screen line */ +#endif +#if WINDOW_MSWIN + int (PASCAL NEAR *t_sleep)(int); /* go to sleep for a while */ + int (PASCAL NEAR *t_newscr)(ESCREEN *); /* create new screen display */ + int (PASCAL NEAR *t_delscr)(ESCREEN *); /* destroy screen display */ + int (PASCAL NEAR *t_selscr)(ESCREEN *); /* select screen display */ + int (PASCAL NEAR *t_sizscr)(ESCREEN *); /* resize screen display */ + int (PASCAL NEAR *t_topscr)(ESCREEN *); /* bring screen to top */ +#endif +} TERM; +#else /* TERM structure, no prototyping.*/ + +typedef struct { + short t_mrow; /* max number of rows allowable */ + short t_nrow; /* current number of rows used */ + short t_mcol; /* max Number of columns. */ + short t_ncol; /* current Number of columns. */ + short t_roworg; /* origin row (normally zero) */ + short t_colorg; /* origin column (normally zero)*/ + short t_margin; /* min margin for extended lines*/ + short t_scrsiz; /* size of scroll region " */ + int t_pause; /* # times thru update to pause */ + int (PASCAL NEAR *t_open)(); /* Open terminal at the start. */ + int (PASCAL NEAR *t_close)(); /* Close terminal at end. */ + int (PASCAL NEAR *t_kopen)(); /* Open keyboard */ + int (PASCAL NEAR *t_kclose)(); /* close keyboard */ + int (PASCAL NEAR *t_getchar)(); /* Get character from keyboard. */ + int (PASCAL NEAR *t_putchar)(); /* Put character to display. */ + int (PASCAL NEAR *t_flush)(); /* Flush output buffers. */ + int (PASCAL NEAR *t_move)(); /* Move the cursor, origin 0. */ + int (PASCAL NEAR *t_eeol)(); /* Erase to end of line. */ + int (PASCAL NEAR *t_eeop)(); /* Erase to end of page. */ + int (PASCAL NEAR *t_clrdesk)(); /* Clear the page totally */ + int (PASCAL NEAR *t_beep)(); /* Beep. */ + int (PASCAL NEAR *t_rev)(); /* set reverse video state */ + int (PASCAL NEAR *t_rez)(); /* change screen resolution */ +#if COLOR + int (PASCAL NEAR *t_setfor)(); /* set forground color */ + int (PASCAL NEAR *t_setback)(); /* set background color */ +#endif +#if INSDEL + int (PASCAL NEAR *t_insline)(); /* insert a screen line */ + int (PASCAL NEAR *t_delline)(); /* delete a screen line */ +#endif +#if WINDOW_MSWIN + int (PASCAL NEAR *t_sleep)(); /* go to sleep for a while */ + int (PASCAL NEAR *t_newscr)(); /* create new screen display */ + int (PASCAL NEAR *t_delscr)(); /* destroy screen display */ + int (PASCAL NEAR *t_selscr)(); /* select screen display */ + int (PASCAL NEAR *t_sizscr)(); /* resize screen display */ + int (PASCAL NEAR *t_topscr)(); /* bring screen to top */ +#endif +} TERM; +#endif + + +/* TEMPORARY macros for terminal I/O (to be placed in a machine + dependant place later) */ + +#define TTopen (*term.t_open) +#define TTclose (*term.t_close) +#define TTkopen (*term.t_kopen) +#define TTkclose (*term.t_kclose) +#define TTgetc (*term.t_getchar) +#define TTputc (*term.t_putchar) +#define TTflush (*term.t_flush) +#define TTmove (*term.t_move) +#define TTeeol (*term.t_eeol) +#define TTeeop (*term.t_eeop) +#define TTclrdesk (*term.t_clrdesk) +#define TTbeep (*term.t_beep) +#define TTrev (*term.t_rev) +#define TTrez (*term.t_rez) +#if COLOR +#define TTforg (*term.t_setfor) +#define TTbacg (*term.t_setback) +#endif + +/* Structure for the table of current key bindings */ + +ETYPE EPOINTER { + int (PASCAL NEAR *fp)(); /* C routine to invoke */ + BUFFER *buf; /* buffer to execute */ +}; + +typedef struct { + short k_code; /* Key code */ + short k_type; /* binding type (C function or EMACS buffer) */ + ETYPE EPOINTER k_ptr; /* ptr to thing to execute */ +} KEYTAB; + +/* structure for the name binding table */ + +typedef struct { + char *n_name; /* name of function key */ + int (PASCAL NEAR *n_func)(); /* function name is bound to */ +} NBIND; + +/* The editor holds deleted text chunks in the KILL buffer. The + kill buffer is logically a stream of ascii characters, however + due to its unpredicatable size, it gets implemented as a linked + list of chunks. (The d_ prefix is for "deleted" text, as k_ + was taken up by the keycode structure) +*/ + +typedef struct KILL { + struct KILL *d_next; /* link to next chunk, NULL if last */ + char d_chunk[KBLOCK]; /* deleted text */ +} KILL; + +/* When emacs's command interpetor needs to get a variable's name, + rather than it's value, it is passed back as a VDESC variable + description structure. The v_num field is a index into the + appropriate variable table. +*/ + +typedef struct VDESC { + int v_type; /* type of variable */ + int v_num; /* ordinal pointer to variable in list */ + UTABLE *v_ut; /* ptr to appropriate user table if user var */ +} VDESC; + +/* The !WHILE directive in the execution language needs to + stack references to pending whiles. These are stored linked + to each currently open procedure via a linked list of + the following structure +*/ + +typedef struct WHBLOCK { + LINE *w_begin; /* ptr to !while statement */ + LINE *w_end; /* ptr to the !endwhile statement*/ + int w_type; /* block type */ + struct WHBLOCK *w_next; /* next while */ +} WHBLOCK; + +#define BTWHILE 1 +#define BTBREAK 2 + +/* Abbreviations are short symbols that expand to longer strings + when typed into a buffer with no intervening whitespace or commands. + This structure grows dynamically as needed. +*/ + +typedef struct ABBREV { + struct ABBREV *ab_next; /* pointer to the next abbreviation */ + char ab_sym[MAXSYM + 1]; /* name to expand */ + char ab_exp[1]; /* string to expand to */ +} ABBREV; + +/* Search definitions... */ + +/* HICHAR - 1 is the largest character we will deal with. + * BMAPSIZE represents the number of bytes in the bitmap. + */ +#define HICHAR 256 +#define BMAPSIZE HICHAR >> 3 + +/* + * Jump table structures. + */ +typedef struct { + int jump; + int patlen; + int delta[HICHAR]; + char patrn[NPAT]; +} DELTA; + +#if MAGIC +/* + * Defines for the metacharacters in the regular expression + * search routines. MCNIL and GROUP are used in both search + * and replace metachar-arrays. + */ +#define MCNIL 0 /* Like the '\0' for strings.*/ +#define JMPTABLE 1 +#define LITSTRING 2 /* Literal string.*/ +#define LITCHAR 3 /* Literal character.*/ +#define ANY 4 /* Any character but the .*/ +#define CCL 5 +#define NCCL 6 +#define BOL 7 +#define EOL 8 +#define BOWRD 9 +#define EOWRD 10 +#define GRPBEG 11 /* Signal start of group.*/ +#define GRPEND 12 /* Signal end of group.*/ +#define GROUP 13 /* String of group match.*/ +#define DITTO 14 /* Replacement with match string.*/ + +#define CLOSURE 0x0100 /* An or-able value for a closure modifier.*/ +#define CLOSURE_1 0x0200 /* An or-able value for a closure modifier.*/ +#define ZEROONE 0x0400 /* An or-able value for a closure modifier.*/ + +#define ALLCLOS (CLOSURE | CLOSURE_1 | ZEROONE) +#define MASKCLO (~ALLCLOS) + +#define MC_ANY '.' /* 'Any' character (except newline).*/ +#define MC_CCL '[' /* Character class.*/ +#define MC_NCCL '^' /* Negate character class.*/ +#define MC_RCCL '-' /* Range in character class.*/ +#define MC_ECCL ']' /* End of character class.*/ +#define MC_BOL '^' /* Beginning of line.*/ +#define MC_EOL '$' /* End of line.*/ +#define MC_CLOSURE '*' /* Closure - zero to many characters match.*/ +#define MC_CLOSURE_1 '+' /* Closure - one to many characters match.*/ +#define MC_ZEROONE '?' /* Closure - zero to one characters match.*/ +#define MC_DITTO '&' /* Use matched string in replacement.*/ +#define MC_GRPBEG '(' /* Start of group (begun with a backslash).*/ +#define MC_GRPEND ')' /* End of group (begun with a backslash).*/ +#define MC_BOWRD '<' /* Beginning of word (begun with a backslash).*/ +#define MC_EOWRD '>' /* End of word (begun with a backslash).*/ +#define MC_ESC '\\' /* Escape - suppress meta-meaning.*/ + +#define MAXGROUPS 10 /* 1 + maximum # of r. e. groups. */ +#define BIT(n) (1 << (n)) /* An integer with one bit set.*/ + +/* Typedefs that define the bitmap type for searching (EBITMAP), + * the meta-character structure for MAGIC mode searching (MC), + * and the meta-character structure for MAGIC mode replacment (RMC). + */ +typedef char *EBITMAP; + +typedef struct { + short int mc_type; + union { + int lchar; + int group_no; + char *lstring; + DELTA *jmptable; + EBITMAP cclmap; + } u; +} MC; + +typedef struct { + short int mc_type; + union { + int group_no; + char *rstr; + } u; +} RMC; +#endif + +/* + This is the message which should be added to any "About MicroEMACS" + boxes on any of the machines with window managers. + + + ------------------------------------------ + | | + | MicroEMACS v4.xx | + | for the ............ | + | | + | Text Editor and Corrector | + | | + | written by Daniel M. Lawrence | + | [based on code by Dave Conroy] | + | | + | Send inquiries and donations to: | + | 617 New York St | + | Lafayette, IN 47901 | + | | + ------------------------------------------ +*/ diff --git a/os5/gcc/makefile b/os5/gcc/makefile new file mode 100644 index 0000000..e8271ed --- /dev/null +++ b/os5/gcc/makefile @@ -0,0 +1,107 @@ +# Unix makefile for +# MicroEMACS 3.12 +# (C)Copyright 1993 by Daniel Lawrence +# all rights reserved + +# modify the following lines with the proper relative directories + +# object file directory +OBJD = obj +# source file directory +SRCD = ../../src +# header file directory +HDIR = ../../h + +# options and arguments to the C compiler + +CC = gcc +CFLAGS= -O -I. -I$(HDIR) -g -D_STRICTNAME_H + +# list of header files + +HFILES = estruct.h $(HDIR)/edef.h $(HDIR)/efunc.h $(HDIR)/epath.h $(HDIR)/ebind.h $(HDIR)/eproto.h + +#list of object files + +F1 = $(OBJD)/abbrev.o $(OBJD)/basic.o $(OBJD)/bind.o $(OBJD)/buffer.o +F2 = $(OBJD)/char.o $(OBJD)/crypt.o $(OBJD)/display.o $(OBJD)/dolock.o +F3 = $(OBJD)/eval.o $(OBJD)/exec.o $(OBJD)/file.o $(OBJD)/keyboard.o +F4 = $(OBJD)/fileio.o $(OBJD)/unix.o $(OBJD)/input.o +F5 = $(OBJD)/isearch.o $(OBJD)/libhelp.o $(OBJD)/line.o $(OBJD)/lock.o +F6 = $(OBJD)/main.o $(OBJD)/message.o $(OBJD)/mouse.o $(OBJD)/screen.o +F7 = $(OBJD)/random.o $(OBJD)/region.o $(OBJD)/search.o $(OBJD)/replace.o +F8 = $(OBJD)/tags.o $(OBJD)/undo.o $(OBJD)/window.o $(OBJD)/word.o + +# product list + +all: bin/emacs + +OFILES = $(F1) $(F2) $(F3) $(F4) $(F5) $(F6) $(F7) $(F8) + +bin/emacs: $(OFILES) + $(CC) $(CFLAGS) $(OFILES) -ltermcap -lc -ltinfo -o bin/emacs + +$(OBJD)/abbrev.o: $(SRCD)/abbrev.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/abbrev.o $(SRCD)/abbrev.c +$(OBJD)/basic.o: $(SRCD)/basic.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/basic.o $(SRCD)/basic.c +$(OBJD)/bind.o: $(SRCD)/bind.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/bind.o $(SRCD)/bind.c +$(OBJD)/buffer.o: $(SRCD)/buffer.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/buffer.o $(SRCD)/buffer.c +$(OBJD)/char.o: $(SRCD)/char.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/char.o $(SRCD)/char.c +$(OBJD)/crypt.o: $(SRCD)/crypt.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/crypt.o $(SRCD)/crypt.c +$(OBJD)/cmdfix.o: $(SRCD)/cmdfix.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/cmdfix.o $(SRCD)/cmdfix.c +$(OBJD)/display.o: $(SRCD)/display.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/display.o $(SRCD)/display.c +$(OBJD)/dolock.o: $(SRCD)/dolock.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/dolock.o $(SRCD)/dolock.c +$(OBJD)/eval.o: $(SRCD)/eval.c $(HFILES) $(HDIR)/evar.h + $(CC) $(CFLAGS) -c -o $(OBJD)/eval.o $(SRCD)/eval.c +$(OBJD)/exec.o: $(SRCD)/exec.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/exec.o $(SRCD)/exec.c +$(OBJD)/file.o: $(SRCD)/file.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/file.o $(SRCD)/file.c +$(OBJD)/fileio.o: $(SRCD)/fileio.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/fileio.o $(SRCD)/fileio.c +$(OBJD)/input.o: $(SRCD)/input.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/input.o $(SRCD)/input.c +$(OBJD)/isearch.o: $(SRCD)/isearch.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/isearch.o $(SRCD)/isearch.c +$(OBJD)/keyboard.o: $(SRCD)/keyboard.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/keyboard.o $(SRCD)/keyboard.c +$(OBJD)/libhelp.o: $(SRCD)/libhelp.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/libhelp.o $(SRCD)/libhelp.c +$(OBJD)/line.o: $(SRCD)/line.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/line.o $(SRCD)/line.c +$(OBJD)/lock.o: $(SRCD)/lock.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/lock.o $(SRCD)/lock.c +$(OBJD)/main.o: $(SRCD)/main.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/main.o $(SRCD)/main.c +$(OBJD)/message.o: $(SRCD)/message.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/message.o $(SRCD)/message.c +$(OBJD)/mouse.o: $(SRCD)/mouse.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/mouse.o $(SRCD)/mouse.c +$(OBJD)/screen.o: $(SRCD)/screen.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/screen.o $(SRCD)/screen.c +$(OBJD)/unix.o: $(SRCD)/unix.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/unix.o $(SRCD)/unix.c +$(OBJD)/random.o: $(SRCD)/random.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/random.o $(SRCD)/random.c +$(OBJD)/region.o: $(SRCD)/region.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/region.o $(SRCD)/region.c +$(OBJD)/search.o: $(SRCD)/search.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/search.o $(SRCD)/search.c +$(OBJD)/replace.o: $(SRCD)/replace.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/replace.o $(SRCD)/replace.c +$(OBJD)/tags.o: $(SRCD)/tags.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/tags.o $(SRCD)/tags.c +$(OBJD)/undo.o: $(SRCD)/undo.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/undo.o $(SRCD)/undo.c +$(OBJD)/window.o: $(SRCD)/window.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/window.o $(SRCD)/window.c +$(OBJD)/word.o: $(SRCD)/word.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/word.o $(SRCD)/word.c From 4be97348c5304772112eb19c70820c9170c4c362 Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 10 Sep 2020 19:20:14 +0200 Subject: [PATCH 26/37] SCO UnixWare 7 builder --- uw7/cc/estruct.h | 1286 ++++++++++++++++++++++++++++++++++++++++++++++ uw7/cc/makefile | 106 ++++ uw7/gcc/makefile | 103 ++++ 3 files changed, 1495 insertions(+) create mode 100644 uw7/cc/estruct.h create mode 100644 uw7/cc/makefile create mode 100644 uw7/gcc/makefile diff --git a/uw7/cc/estruct.h b/uw7/cc/estruct.h new file mode 100644 index 0000000..5269b79 --- /dev/null +++ b/uw7/cc/estruct.h @@ -0,0 +1,1286 @@ +/* ESTRUCT: Structure and preprocesser defined for + MicroEMACS 4.00 + + (C)Copyright 1995 by Daniel Lawrence + written by Daniel Lawrence + based on code by Dave G. Conroy, + Steve Wilhite and George Jones +*/ + +#ifdef LATTICE +#undef LATTICE /* don't use their definitions...use ours */ +#endif +#ifdef MSDOS +#undef MSDOS +#endif +#ifdef WINNT +#undef WINNT +#endif +#ifdef LINUX +#undef LINUX +#endif +#ifdef AMIGA +#undef AMIGA +#endif +#ifdef EGA +#undef EGA +#endif +#ifdef CTRLZ +#undef CTRLZ +#endif + +/* Program Identification..... + + PROGNAME should always be MicroEMACS for a distribution + unmodified version. People using MicroEMACS as a shell + for other products should change this to reflect their + product. Macros can query this via the $progname variable +*/ + +#define PROGNAME "MicroEMACS" +#define VERSION "4.00" + +/* Machine/OS definitions */ +/* [Set one of these!!] */ + +#define AMIGA 0 /* AmigaDOS */ +#define AOSVS 0 /* Data General AOS/VS */ +#define AUX 0 /* Apple UNIX for Macintosh */ +#define AIX 0 /* IBM UNIX for various machines*/ +#define AVIION 0 /* Data General AViiON */ +#define BSD 0 /* UNIX BSD 4.2 and ULTRIX */ +#define FINDER 0 /* Macintosh OS */ +#define FREEBSD 0 /* FREEBSD 386 version 2 or + */ +#define HPUX8 0 /* HPUX HP 9000 ver 8 or less */ +#define HPUX9 0 /* HPUX HP 9000 ver 9 */ +#define LINUX 0 /* Linux */ +#define MPE 0 /* HP MPE/XL */ +#define MSDOS 0 /* MS-DOS */ +#define WINNT 0 /* MS-Win NT */ +#define OS2 0 /* Microsoft or IBM OS/2 */ +#define SMOS 0 /* Supermax UNIX System V */ +#define SUN 0 /* SUN v4.0 */ +#define TOS 0 /* ST520, TOS */ +#define USG 1 /* UNIX system V */ +#define VMS 0 /* VAX/VMS */ +#define WMCS 0 /* Wicat's MCS */ +#define XENIX 0 /* IBM-PC SCO XENIX */ + +/* Compiler definitions */ +/* [Set one of these!!] */ +#define ALCYON 0 /* ALCYON Atari ST compiler */ +#define AZTEC 0 /* Aztec C 4.00e ONLY for the amiga now... */ +#define DGC 0 /* Data General AOS/VS C... */ +#define GCC 0 /* the GNU C compiler */ +#define IC 0 /* Rational Systems Instant C */ +#define LATTICE 0 /* Lattice 2.14 through 3.0 compilers */ +#define MSC 0 /* MicroSoft C compile version 3 thru 7 */ +#define MWC 0 /* Mark Williams C */ +#define TURBO 0 /* Turbo C and Borland C++ under MSDOS */ +#define UNIX 1 /* a standard UNIX compiler (cc) */ +#define ZTC 0 /* Zortech C/C++ 1.02 thru 2.10 under MSDOS */ + +/* Machine stack growth direction. */ +/* [Set this to 1 if your machine stack grows UP!!!] */ +/* data general mv/eclipse series stack grows up. */ +/* dec vax series stack grows down... got it??? */ + +#define STACK_GROWS_UP 0 + +/* Debugging options */ +#define RAMSIZE 0 /* dynamic RAM memory usage tracking */ +#define RAMSHOW 0 /* auto dynamic RAM reporting */ +#define RAMTRCK 0 /* send debug info to MALLOC.DAT */ +#define DEBUG_SEARCH 0 /* pop some search info on patterns */ + +/* Special keyboard/network definitions */ + +#define ATKBD 0 /* AT-style keyboard with F11, F12 & grey keys */ +#define WANGPC 0 /* WangPC - mostly escape sequences */ +#define VT100 0 /* Handle VT100 style keypad - NOT VMS. */ +#define KEYPAD 0 /* VMS - turn on and off application */ + /* keypad automatically */ +#define XONDATA 0 /* VMS - set to force /NOTTSYNC/NOHOSTSY */ +#define RMSIO 0 /* VMS - skip the rotten C runtime and */ + /* use RMS directly */ +#define OPTMEM 0 /* VMS 5.0 and up - use a less standard */ + /* but more efficient memory allocator */ + +/* Terminal Output definitions */ +/* [Set one of these!!] */ + +#define ANSI 0 /* ANSI escape sequences */ +#define DASHER 0 /* DG Dasher 2xx/4xx crts */ +#define DG10 0 /* Data General system/10 */ +#define FMR 0 /* Fujitsu FMR series driver */ +#define HP110 0 /* HP110 screen driver */ +#define HP150 0 /* HP150 screen driver */ +#define I55 0 /* IBM PS55 DOS J4.0/V */ +#define IBMPC 0 /* IBM-PC CGA/MONO/EGA/VGA drvr */ +#define MAC 0 /* Macintosh */ +#define NEC 0 /* NEC-9801VM driver */ +#define OS2NPM 0 /* OS/2 non-Presentation Mgr. */ +#define SMG 0 /* SMG library on VMS */ +#define ST52 0 /* Atari 520/1040ST screen */ +#define TERMCAP 1 /* Use TERMCAP */ +#define TIPC 0 /* TI Profesional PC driver */ +#define VT52 0 /* VT52 terminal (Zenith). */ +#define NTCON 0 /* Windows NT console */ +#define XVT 0 /* XVT windowing system */ +#define Z309 0 /* Zenith 100 PC family driver */ + +/* Windowing system style (pick one) */ + +#define WINDOW_TEXT 1 /* [default] Text mode */ +#define WINDOW_MSWIN 0 /* MicroSoft Windows */ +#define WINDOW_MSWIN32 0 /* MicroSoft Windows 32 bit API */ +#define WINDOW_X 0 /* X/Unix */ + +/* Language text options (pick one) */ + +#define ENGLISH 1 /* [default] */ +#define FRENCH 0 +#define SPANISH 0 +#define GERMAN 0 +#define DUTCH 0 +#define PLATIN 0 /* Pig Latin */ +#define JAPAN 0 +#define LATIN 0 /* real Latin */ + +/* Configuration options */ + +#define TYPEAH 1 /* type ahead causes update to be skipped */ +#define LOGFLG 0 /* send all executed commands to EMACS.LOG */ +#define VISMAC 0 /* update display during keyboard macros */ +#define CTRLZ 0 /* add a ^Z at end of files under MSDOS only */ +#define CLEAN 0 /* de-alloc memory on exit */ +#define CALLED 0 /* is emacs a called subroutine? or stand alone */ + +#define REVSTA 1 /* Status line appears in reverse video */ +#define COLOR 1 /* color commands and windows */ + +#define FILOCK 0 /* file locking under unix BSD 4.2 */ +#define ISRCH 1 /* Incremental searches like ITS EMACS */ +#define FLABEL 0 /* function key label code [HP150] */ +#define CRYPT 1 /* file encryption enabled? */ +#define MAGIC 1 /* include regular expression matching? */ +#define MOUSE 1 /* Include routines for mouse actions */ +#define NOISY 1 /* Use a fancy BELL if it exists */ +#define CTAGS 1 /* include vi-like tagging? */ +#define SPEECH 0 /* spoken EMACS, for the sight impared [not ready] */ +#define VARARG 1 /* use varargs.h for mlwrite() */ + +#if XVT +#undef COLOR +#define COLOR 1 /* overide this to be TRUE for XVT always */ +#endif + +#define JMDEXT 1 /* enable J-M Dubois's extensions */ + +#if JMDEXT +#define BACKUP 1 /* backup previous file version */ +#define GRAPHIC 1 /* character conversion to graphics functions */ +#define LIBHELP 1 /* help des fonctions de la bibliotheque C */ + /* d'apres la version de Mark Williams */ +#define EXTKEYS 0 /* supplemental key bindings for DOS and ST520 */ +#define NEWVARS 1 /* supplemental environment variables */ +#define CETKEYS 0 /* use CET Basic compatible /etc/termcap */ +#define DYNMSGS 1 /* dynamic load of messages */ +#endif + +/* Character set options */ +/* [Set one of these!!] */ +#define ASCII 1 /* always using ASCII char sequences for now */ +#define EBCDIC 0 /* later IBM mainfraim versions will use EBCDIC */ + +/* handle constant and voids properly */ + +#if VMS +#define CONST readonly +#define VOID void +#define NOSHARE noshare +#else +#if AOSVS +#define CONST $shared $align(1) /* fake a const */ +#define VOID +#define NOSHARE $low32k $align(1) /* attempt to optimize read/write vars. */ +#else + +#if __STDC__ || MSC || TURBO || GCC || (AMIGA && LATTICE) || USG +#define CONST const +#define VOID void +#define NOSHARE +#else +#define CONST +#if IC +#define VOID void +#else +#define VOID +#endif +#define NOSHARE +#endif + +#endif +#endif + +/* System dependant library redefinitions, structures and includes */ + +/* multibyte character support? */ + +#if NEC || FMR || I55 +#define DBCS 1 /* double byte character sets enabled */ +#define INSDEL 1 /* use insert/delete line display optimizations */ + +/* define DBCS prefix bytes */ +#define is2char(ch) (((ch&0xff) >= 0x81 && (ch&0xff) <= 0x9f) || ((ch&0xff) >=0xe0 && (ch&0xff) <= 0xfc)) + +#else +#define DBCS 0 +#define INSDEL 0 +#endif + +/* Can we catch the SIGWINCH (the window size change signal)? */ + +#if AIX || HPUX9 || LINUX +#define HANDLE_WINCH 1 +#else +#define HANDLE_WINCH 0 +#endif + +/* Prototypes in use? */ + +#if MSC || TURBO || IC || VMS || GCC || ZTC +#define PROTO 1 +#else +#define PROTO 0 +#endif + +/* the following define allows me to initialize unions... + otherwise we make them structures (like the keybinding table) */ + +#if __STDC__ || MSC || TURBO || IC || ZTC +#define ETYPE union +#else +#define ETYPE struct +#endif + +/* Instant C can't do stat()s. Arrrg. No file locking for you */ +#if IC && MSDOS +#undef FILOCK +#define FILOCK 0 +#endif + +/* Mark Williams/Atari has no standard or varargs or directory functions */ +#if TOS & MWC +#undef VARARG +#define VARARG 0 +#undef FILOCK +#define FILOCK 0 +#endif + +/* MS-Windows */ + +#if WINNT || WINDOW_MSWIN || WINDOW_MSWIN32 +#if WINDOW_MSWIN32 +#undef WINDOW_MSWIN +#define WINDOW_MSWIN 1 +#endif +#if WINDOW_MSWIN && WINNT +#undef WINDOW_MSWIN32 +#define WINDOW_MSWIN32 1 +#endif +#undef VOID /* windows.h will wind up defining this */ +#include /* --------- Huge include file here !!! ---------*/ +#if NTCON +#include +#include +#include +#endif + +#undef NEAR +#define NEAR +#define DNEAR +#if MSC || IC +#undef CDECL +#define CDECL __cdecl +#define DUMMYSZ 1 /* dummy size for unsized extern arrays to avoid + silly DGROUP fixup */ +#else +#if TURBO +#define DUMMYSZ /* nothing */ +#else +#define CDECL _cdecl /* ZTC */ +#define DUMMYSZ /* nothing */ +#endif +#endif + +#if WINNT +#define EXPORT /* Windows NT doesn't like this */ +#endif + +#if WINDOW_MSWIN +#undef TYPEAH +#define TYPEAH 0 /* typeahead is handled at the term driver level */ +#undef CALLED +#define CALLED 1 /* under MS Windows, "main" resides in the sys driver */ +#if MSC +#define EXPORT __export +#else +#define EXPORT _export /* Fine for TURBO and ZTC */ +#endif +#endif +#else + +/* neither Windows NT nor MS-Windows */ + +#define DUMMYSZ /* nothing */ + +#if MSDOS & (TURBO | MSC | TIPC) +#define NEAR +#define DNEAR +#define PASCAL pascal +#define CDECL cdecl +#else +#if MSDOS & ZTC +#define NEAR +#define DNEAR +#define PASCAL _pascal +#define CDECL _cdecl +#else +#define NEAR +#define DNEAR +#define PASCAL +#define CDECL +#endif +#endif + +#endif + +#if TURBO +#include +#include +#undef peek +#undef poke +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#endif + +#if IC +#include +#undef peek +#undef poke +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#endif + +#if LATTICE & MSDOS +/* you may have to remove this one definition with LATTICE version + 3.2 and above */ +#define unsigned +#endif + +#if IC +#define inp inportb +#define outp outportb +#define intdos(a, b) int86(33, a, b) +#endif + +#if AZTEC +#undef putc +#undef getc +#if MSDOS +#define getc a1getc +#define int86 sysint +#define intdos(a, b) sysint(33, a, b) +#define inp inportb +#define outp outportb +#else +#define getc agetc +#endif +#define putc aputc + +struct XREG { + unsigned ax,bx,cx,dx,si,di,ds,es; +}; + +struct HREG { + char al,ah,bl,bh,cl,ch,dl,dh,d1,d2,e1,e2; +}; + +union REGS { + struct XREG x; + struct HREG h; +}; + +struct SREGS { + unsigned cs, ss, ds, es; +}; +#endif + +#if MSDOS & MWC +#include +#define int86(a, b, c) intcall(b, c, a) +#define intdos(a, b) intcall(a, b, DOSINT) +#define inp(a) in(a) +#define outp(a, b) out(a, b) +#define movmem(a, b, c) memcpy(b, a, c) + +struct XREG { + unsigned int ax,bx,cx,dx,si,di,ds,es,flags; +}; + +struct HREG { + char al,ah,bl,bh,cl,ch,dl,dh; + unsigned int ds,es,flags; +}; + +union REGS { + struct XREG x; + struct HREG h; +}; +#endif + +#if MSDOS & MSC +#include +#include +#define peek(a,b,c,d) movedata(a,b,FP_SEG(c),FP_OFF(c),d) +#define poke(a,b,c,d) movedata(FP_SEG(c),FP_OFF(c),a,b,d) +#define movmem(a, b, c) memcpy(b, a, c) +#define _strrev(a) strrev(a) +#endif + +#if MSDOS & LATTICE +#undef CPM +#undef LATTICE +#include +#undef CPM +#endif + +/* System V doesn't name this the same as others */ +#if USG | AIX | AUX | SUN | (OS2 & MSC) +#define movmem(a, b, c) memcpy(b, a, c) +#endif + +#if LINUX +#define movmem(a, b, c) memmove(b, a, c) +#endif + +/* this keeps VMS happy */ +#if VMS +#define getname xgetname +#define unlink(a) delete(a) +#endif + +/* some options for AOS/VS */ +#if AOSVS +#define ORMDNI 1 +#endif + +/* define some ability flags */ + +#if (IBMPC | Z309 | FMR | TIPC) & !(WINDOW_MSWIN | WINDOW_MSWIN32) +#define MEMMAP 1 +#else +#define MEMMAP 0 +#endif + +#if MSDOS | WINNT | OS2 | USG | LINUX | AIX | AUX | SMOS | HPUX8 | HPUX9 | BSD | FREEBSD | (TOS & MWC) | WMCS | SUN | MPE +#define ENVFUNC 1 +#else +#define ENVFUNC 0 +#endif + +#if AUX +#define RETCHAR '\n' +#else +#define RETCHAR '\r' +#endif + +#if MPE +#define DIRSEPSTR "." +#define DIRSEPCHAR '.' +#else +#if TOS || MSDOS || WINNT || OS2 +#define DIRSEPSTR "\\" +#define DIRSEPCHAR '\\' +#define DRIVESEPCHAR ':' +#else +#define DIRSEPSTR "/" +#define DIRSEPCHAR '/' +#define DRIVESEPCHAR '\0' +#endif +#endif + +#if VARARG +#if (GCC == 0) && (USG || LINUX || AIX || AUX || BSD || FREEBSD || SUN || XENIX || HPUX8 || HPUX9 || AVIION || MPE) +#define VARG 1 +#define SARG 0 +#include +#else +#define VARG 0 +#define SARG 1 +#include +#endif +#endif + +#if ZTC +#include +#define movmem(a, b, c) memcpy(b, a, c) +#endif + +/* Emacs global flag bit definitions (for gflags) */ + +#define GFREAD 1 /* read first file in at startup */ +#define GFSDRAW 2 /* suppress a screen redraw */ +#define GFEXIT 4 /* exit from emacs pending */ + +/* internal constants */ + +#define NBINDS 300 /* max # of bound keys */ +#if AOSVS | VMS | WINNT | SUN | BSD | FREEBSD | USG | LINUX | ZENIX | HPUX8 | HPUX9 | OS2 +#define NFILEN 256 +#else +#define NFILEN 80 /* # of bytes, file name */ +#endif +#define NBUFN 128 /* # of bytes, buffer name */ +#define NLINE 256 /* # of bytes, input line */ +#define NSTRING 128 /* # of bytes, string buffers */ +#define NKBDM 4096 /* # of strokes, keyboard macro */ +#define NPAT 128 /* # of bytes, pattern */ +#define HUGE 1000 /* Huge number */ +#define NLOCKS 256 /* max # of file locks active */ +#define NCOLORS 16 /* number of supported colors */ +#define KBLOCK 250 /* sizeof kill buffer chunks */ +#define NRING 16 /* # of buffers in kill ring */ +#define NBLOCK 16 /* line block chunk size */ +#define NVSIZE 16 /* max #chars in a var name */ +#define NMARKS 16 /* number of marks */ +#define MAXSYM 32 /* max # chars in symbol to expand */ +#define MINFLEN 3 /* min # chars to match &func */ + +#define CTRL 0x0100 /* Control flag, or'ed in */ +#define META 0x0200 /* Meta flag, or'ed in */ +#define CTLX 0x0400 /* ^X flag, or'ed in */ +#define SPEC 0x0800 /* special key (function keys) */ +#define MOUS 0x1000 /* alternative input device (mouse) */ +#define SHFT 0x2000 /* shifted (for function keys) */ +#define ALTD 0x4000 /* ALT key... */ +#define MENU MOUS+SPEC /* menu selection (WINDOW_MSWIN) */ + +#define BINDNUL 0 /* not bound to anything */ +#define BINDFNC 1 /* key bound to a function */ +#define BINDBUF 2 /* key bound to a buffer */ + +#ifdef FALSE +#undef FALSE +#endif +#ifdef TRUE +#undef TRUE +#endif + +#define FALSE 0 /* False, no, bad, etc. */ +#define TRUE 1 /* True, yes, good, etc. */ +#define ABORT 2 /* Death, ^G, abort, etc. */ +#define FAILD 3 /* not-quite fatal false return */ + +#define STOP 0 /* keyboard macro not in use */ +#define PLAY 1 /* playing */ +#define RECORD 2 /* recording */ + +/* Completion types */ + +#define CMP_BUFFER 0 +#define CMP_COMMAND 1 +#define CMP_FILENAME 2 + +/* Directive definitions */ + +#define DIF 0 +#define DELSE 1 +#define DENDIF 2 +#define DGOTO 3 +#define DRETURN 4 +#define DENDM 5 +#define DWHILE 6 +#define DENDWHILE 7 +#define DBREAK 8 +#define DFORCE 9 + +#define NUMDIRS 10 + +/* + * PTBEG, PTEND, FORWARD, and REVERSE are all toggle-able values for + * routines that need directions. + */ +#define PTBEG 0 /* Leave the point at the beginning on search */ +#define PTEND 1 /* Leave the point at the end on search */ +#define FORWARD 0 /* do things in a forward direction */ +#define REVERSE 1 /* do things in a backwards direction */ + +#define FIOSUC 0 /* File I/O, success. */ +#define FIOFNF 1 /* File I/O, file not found. */ +#define FIOEOF 2 /* File I/O, end of file. */ +#define FIOERR 3 /* File I/O, error. */ +#define FIOMEM 4 /* File I/O, out of memory */ +#define FIOFUN 5 /* File I/O, eod of file/bad line*/ +#define FIODEL 6 /* Can't delete/rename file */ + +#if WINDOW_MSWIN +/* values for the fbusy flag */ +#define FREADING 1 /* file read in progress */ +#define FWRITING 2 /* file write in progress */ +/* if no file activity, the value FALSE is used */ +#endif + +#define CFCPCN 0x0001 /* Last command was C-P, C-N */ +#define CFKILL 0x0002 /* Last command was a kill */ +#define CFSRCH 0x0004 /* last command was a search */ +#define CFYANK 0x0008 /* last command was a yank */ + +#define SRNORM 0 /* end past, begin front */ +#define SRBEGIN 1 /* always at front */ +#define SREND 2 /* always one past end */ + +#define BELL 0x07 /* a bell character */ +#define TAB 0x09 /* a tab character */ + +#if USG | LINUX | AIX | AUX | SMOS | HPUX8 | HPUX9 | BSD | FREEBSD | SUN | XENIX | AVIION +#define PATHCHR ':' +#else +#if WMCS || MPE +#define PATHCHR ',' +#else +#define PATHCHR ';' +#endif +#endif + +#define INTWIDTH sizeof(int) * 3 +#define LONGWIDTH sizeof(long) * 3 + +/* Macro argument token types */ + +#define TKNUL 0 /* end-of-string */ +#define TKARG 1 /* interactive argument */ +#define TKBUF 2 /* buffer argument */ +#define TKVAR 3 /* user variables */ +#define TKENV 4 /* environment variables */ +#define TKFUN 5 /* function.... */ +#define TKDIR 6 /* directive */ +#define TKLBL 7 /* line label */ +#define TKLIT 8 /* numeric literal */ +#define TKSTR 9 /* quoted string literal */ +#define TKCMD 10 /* command name */ + +/* Internal defined functions */ + +#define nextab(a) (a - (a % tabsize)) + tabsize + +/* DIFCASE represents the integer difference between upper + and lower case letters. It is an xor-able value, which is + fortunate, since the relative positions of upper to lower + case letters is the opposite of ascii in ebcdic. +*/ + +#if ASCII +#define DIFCASE 0x20 +#else +#define DIFCASE 0x40 +#endif + +/* Dynamic RAM tracking and reporting redefinitions */ + +#if RAMSIZE +#define malloc allocate +#define free release +#else +#if VMS & OPTMEM +#define malloc VAXC$MALLOC_OPT +#define free VAXC$FREE_OPT +#define calloc VAXC$CALLOC_OPT +#define realloc VAXC$REALLOC_OPT +#define cfree VAXC$CFREE_OPT +#endif +#endif + +/* under MS Windows, we use dialog boxes to prompt the user for filenames */ +#if WINDOW_MSWIN +#define FILENAMEREPLY(p,b,nb) filenamedlg(p,b,nb,TRUE) +#else +#define FILENAMEREPLY(p,b,nb) mlreply(p,b,nb) +#endif + +/* formal parameters to procedures are stored as a linked list + of argument names using the following simple structure: +*/ + +typedef struct PARG { + struct PARG *next; /* ptr to next linked argument */ + char name[NVSIZE+1]; /* name of the argument */ +} PARG; + +/* UNDO definitions and types */ + +typedef int OPTYPE; /* type of operation being recorded/played back */ + +#define OP_CMND 1 /* beginning of command */ +#define OP_DELC 2 /* delete a single character */ +#define OP_INSC 3 /* insert a single character */ +#define OP_DSTR 4 /* delete a string of characters */ +#define OP_ISTR 5 /* insert a string of characters */ +#define OP_REPC 6 /* replace a character */ +#define OP_CPOS 7 /* set the cursor position */ + +/* object to be undone! */ + +typedef union OBJECT { + char obj_char; /* a character */ + char obj_string[1]; /* many characters */ + char *obj_sptr; /* a ptr to a character */ +} OBJECT; + +typedef struct UNDO_OBJ { + struct UNDO_OBJ *next; /* ptr to next undo object */ + OPTYPE type; /* type of operation */ + long line_num; /* line offset from buffer beginning */ + int offset; /* offset into that line */ + long count; /* repetitions? */ + OBJECT undo_obj; /* object to be undone */ +} UNDO_OBJ; + +/* + * There is a window structure allocated for every active display window. The + * windows are kept in a big list, in top to bottom screen order, with the + * listhead at "wheadp". Each window contains its own values of dot and mark. + * The flag field contains some bits that are set by commands to guide + * redisplay. Although this is a bit of a compromise in terms of decoupling, + * the full blown redisplay is just too expensive to run for every input + * character. + */ +typedef struct EWINDOW { + struct EWINDOW *w_wndp; /* Next window */ + struct BUFFER *w_bufp; /* Buffer displayed in window */ + struct LINE *w_linep; /* Top line in the window */ + struct LINE *w_dotp; /* Line containing "." */ + short w_doto; /* Byte offset for "." */ + struct LINE *w_markp[NMARKS]; /* Line containing "mark" */ + short w_marko[NMARKS]; /* Byte offset for "mark" */ + char w_toprow; /* Origin 0 top row of window */ + char w_ntrows; /* # of rows of text in window */ + char w_force; /* If NZ, forcing row. */ + char w_flag; /* Flags. */ +#if COLOR + char w_fcolor; /* current forground color */ + char w_bcolor; /* current background color */ +#endif + int w_fcol; /* first column displayed */ +} EWINDOW; + +#define WFFORCE 0x01 /* Window needs forced reframe */ +#define WFMOVE 0x02 /* Movement from line to line */ +#define WFEDIT 0x04 /* Editing within a line */ +#define WFHARD 0x08 /* Better to a full display */ +#define WFMODE 0x10 /* Update mode line. */ +#define WFCOLR 0x20 /* Needs a color change */ + +/* This structure holds the information about each line appearing on the + * video display. The redisplay module uses an array of virtual display + * lines. On systems that do not have direct access to display memory, + * there is also an array of physical display lines used to minimize + * video updating. In most cases, these two arrays are unique. If + * WINDOW_MSWIN is 1, there is a pair of such arrays in each SCREEN + * structure. + */ + +typedef struct VIDEO { + int v_flag; /* Flags */ +#if COLOR + int v_fcolor; /* current forground color */ + int v_bcolor; /* current background color */ + int v_rfcolor; /* requested forground color */ + int v_rbcolor; /* requested background color */ +#endif + int v_left; /* left edge of reverse video */ + int v_right; /* right right of reverse video */ +#if INSDEL && MEMMAP == 0 + int v_rline; /* requested screen line # */ +#endif + char v_text[1]; /* Screen data. */ +} VIDEO; + +#define VFNEW 0x0001 /* contents not meaningful yet */ +#define VFCHG 0x0002 /* Changed flag */ +#define VFEXT 0x0004 /* extended (beyond column 80) */ +#define VFCOL 0x0008 /* color change requested */ + +/* + * This structure holds the information about each separate "screen" + * within the current editing session. On a character based system, these + * screens overlay each other, and can individually be brought to front. + * On a windowing system like MicroSoft Windows 3.0, OS/2, the Macintosh, + * Intuition, Sunview or X-windows, each screen is represented in an OS + * window. The terminolgy is wrong in emacs..... + * + * EMACS The outside World + * screen window + * window pane + */ + +typedef struct SCREEN { + struct SCREEN *s_next_screen; /* link to next screen in list */ + EWINDOW *s_first_window; /* head of linked list of windows */ + EWINDOW *s_cur_window; /* current window in this screen */ + char *s_screen_name; /* name of the current window */ + short s_roworg; /* row origin of stored screen */ + short s_colorg; /* column origin of stored screen */ + short s_nrow; /* row width of stored screen */ + short s_ncol; /* column origin of stored screen */ +#if WINDOW_MSWIN + VIDEO **s_virtual; /* virtual screen contents */ + VIDEO **s_physical; /* physical screen contents */ + HWND s_drvhandle; /* handle for the "term" driver */ +#endif +} SCREEN; + +/* + * Text is kept in buffers. A buffer header, described below, exists for every + * buffer in the system. The buffers are kept in a big list, so that commands + * that search for a buffer by name can find the buffer header. There is a + * safe store for the dot and mark in the header, but this is only valid if + * the buffer is not being displayed (that is, if "b_nwnd" is 0). The text for + * the buffer is kept in a circularly linked list of lines, with a pointer to + * the header line in "b_linep". Buffers may be "Inactive" which means the + * files associated with them have not been read in yet. These get read in + * at "use buffer" time. + * Some buffers are really procedures and have a little extra information + * stored with them. + */ +typedef struct BUFFER { + struct BUFFER *b_bufp; /* Link to next BUFFER */ + struct LINE *b_dotp; /* Link to "." LINE structure */ + short b_doto; /* Offset of "." in above LINE */ + struct LINE *b_markp[NMARKS]; /* The same as the above two, */ + short b_marko[NMARKS]; /* but for the "mark" */ + int b_fcol; /* first col to display */ + struct LINE *b_linep; /* Link to the header LINE */ + struct LINE *b_topline; /* Link to narrowed top text */ + struct LINE *b_botline; /* Link to narrowed bottom text */ + char b_active; /* window activated flag */ + char b_nwnd; /* Count of windows on buffer */ + char b_exec; /* how many active executions */ + char b_flag; /* Flags */ + int b_mode; /* editor mode of this buffer */ + char b_fname[NFILEN]; /* File name */ + char b_bname[NBUFN]; /* Buffer name */ +#if CRYPT + char b_key[NPAT]; /* current encrypted key */ +#endif + int b_numargs; /* number of arguments to procedure */ + PARG *b_args; /* ptr to the first argument */ + UNDO_OBJ *undo_head; /* head of undo stack for buffer */ + long undo_count; /* # of undo operations stacked */ + long last_access; /* time of last access */ +} BUFFER; + +#define BFINVS 0x01 /* Internal invisable buffer */ +#define BFCHG 0x02 /* Changed since last write */ +#define BFTRUNC 0x04 /* buffer was truncated when read */ +#define BFNAROW 0x08 /* buffer has been narrowed */ +#if LIBHELP +#define BFERROR 0x40 /* Error file buffer */ +#define BFHELP 0x80 /* Buffer is a help buffer */ +#endif + +#define NOTPROC -1 /* buffer is not a procedure */ + +/* mode flags */ +#if JMDEXT +#define NUMMODES 12 /* # of defined modes */ +#else +#define NUMMODES 11 /* # of defined modes */ +#endif + +#define MDWRAP 0x0001 /* word wrap */ +#define MDCMOD 0x0002 /* C indentation and fence match*/ +#define MDSPELL 0x0004 /* spell error parsing */ +#define MDEXACT 0x0008 /* Exact matching for searches */ +#define MDVIEW 0x0010 /* read-only buffer */ +#define MDOVER 0x0020 /* overwrite mode */ +#define MDMAGIC 0x0040 /* regular expresions in search */ +#define MDCRYPT 0x0080 /* encrytion mode active */ +#define MDASAVE 0x0100 /* auto-save mode */ +#define MDREPL 0x0200 /* replace mode */ +#define MDABBR 0x0400 /* abbreviation expansion mode */ +#if JMDEXT +#define MDNOBAK 0x0800 /* no auto backup */ +#endif + +/* + * The starting position of a region, and the size of the region in + * characters, is kept in a region structure. Used by the region commands. + */ +typedef struct { + struct LINE *r_linep; /* Origin LINE address. */ + short r_offset; /* Origin LINE offset. */ + long r_size; /* Length in characters. */ +} REGION; + +/* + * All text is kept in circularly linked lists of "LINE" structures. These + * begin at the header line (which is the blank line beyond the end of the + * buffer). This line is pointed to by the "BUFFER". Each line contains a the + * number of bytes in the line (the "used" size), the size of the text array, + * and the text. The end of line is not stored as a byte; it's implied. + */ +typedef struct LINE { + struct LINE *l_fp; /* Link to the next line */ + struct LINE *l_bp; /* Link to the previous line */ + short l_size; /* Allocated size */ + short l_used; /* Used size */ + char l_text[1]; /* A bunch of characters. */ +} LINE; + +#define lforw(lp) ((lp)->l_fp) +#define lback(lp) ((lp)->l_bp) +#if UNIX && (SUN || HPUX8 || HPUX9 || BSD || FREEBSD) +#define lgetc(lp, n) ((unsigned char)(lp)->l_text[(n)]) +#else +#define lgetc(lp, n) ((lp)->l_text[(n)]) +#endif +#define lputc(lp, n, c) ((lp)->l_text[(n)]=(c)) +#define lused(lp) ((lp)->l_used) +#define lsize(lp) ((lp)->l_size) +#define ltext(lp) ((lp)->l_text) + +/* This structure is used to hold a user variables name and its + current value. These are used for both the global and the + local symbol tables. +*/ + +typedef struct UVAR { + char u_name[NVSIZE + 1]; /* name of user variable */ + char *u_value; /* value (string) */ +} UVAR; + +#define VT_NONE 0 /* don't declare it if not found */ +#define VT_LOCAL 1 /* local to the current procedure */ +#define VT_GLOBAL 2 /* global to all procedures */ + +/* A UTABLE is a user variable table.... containing some header + information and an array of user variable names and definitions. + They are held together in a linked list, the last member of + the list being the global user variable table. +*/ + +typedef struct UTABLE { + struct UTABLE *next; /* ptr to next user variable table */ + int size; /* max number of variables in table */ + BUFFER *bufp; /* ptr to buffer holding procedure + assosiated with this symbol table. */ + UVAR uv[1]; /* list of variable names/definitions + in this variable table */ +} UTABLE; + +/* + * The editor communicates with the display using a high level interface. A + * "TERM" structure holds useful variables, and indirect pointers to routines + * that do useful operations. The low level get and put routines are here too. + * This lets a terminal, in addition to having non standard commands, have + * funny get and put character code too. The calls might get changed to + * "termp->t_field" style in the future, to make it possible to run more than + * one terminal type. + */ +#if PROTO +typedef struct { + short t_mrow; /* max number of rows allowable */ + short t_nrow; /* current number of rows used */ + short t_mcol; /* max Number of columns. */ + short t_ncol; /* current Number of columns. */ + short t_roworg; /* origin row (normally zero) */ + short t_colorg; /* origin column (normally zero)*/ + short t_margin; /* min margin for extended lines*/ + short t_scrsiz; /* size of scroll region " */ + int t_pause; /* # times thru update to pause */ + int (PASCAL NEAR *t_open)(void); /* Open terminal at the start.*/ + int (PASCAL NEAR *t_close)(void); /* Close terminal at end. */ + int (PASCAL NEAR *t_kopen)(void); /* Open keyboard */ + int (PASCAL NEAR *t_kclose)(void); /* Close keyboard */ + int (PASCAL NEAR *t_getchar)(void); /* Get character from keyboard. */ + int (PASCAL NEAR *t_putchar)(int); /* Put character to display.*/ + int (PASCAL NEAR *t_flush)(void); /* Flush output buffers. */ + int (PASCAL NEAR *t_move)(int, int);/* Move the cursor, origin 0.*/ + int (PASCAL NEAR *t_eeol)(void); /* Erase to end of line. */ + int (PASCAL NEAR *t_eeop)(void); /* Erase to end of page. */ + int (PASCAL NEAR *t_clrdesk)(void); /* Clear the page totally */ + int (PASCAL NEAR *t_beep)(void); /* Beep. */ + int (PASCAL NEAR *t_rev)(int); /* set reverse video state */ + int (PASCAL NEAR *t_rez)(char *); /* change screen resolution */ +#if COLOR + int (PASCAL NEAR *t_setfor)(int); /* set forground color */ + int (PASCAL NEAR *t_setback)(int); /* set background color */ +#endif +#if INSDEL + int (PASCAL NEAR *t_insline)(int); /* insert a screen line */ + int (PASCAL NEAR *t_delline)(int); /* delete a screen line */ +#endif +#if WINDOW_MSWIN + int (PASCAL NEAR *t_sleep)(int); /* go to sleep for a while */ + int (PASCAL NEAR *t_newscr)(SCREEN *); /* create new screen display */ + int (PASCAL NEAR *t_delscr)(SCREEN *); /* destroy screen display */ + int (PASCAL NEAR *t_selscr)(SCREEN *); /* select screen display */ + int (PASCAL NEAR *t_sizscr)(SCREEN *); /* resize screen display */ + int (PASCAL NEAR *t_topscr)(SCREEN *); /* bring screen to top */ +#endif +} TERM; +#else /* TERM structure, no prototyping.*/ + +typedef struct { + short t_mrow; /* max number of rows allowable */ + short t_nrow; /* current number of rows used */ + short t_mcol; /* max Number of columns. */ + short t_ncol; /* current Number of columns. */ + short t_roworg; /* origin row (normally zero) */ + short t_colorg; /* origin column (normally zero)*/ + short t_margin; /* min margin for extended lines*/ + short t_scrsiz; /* size of scroll region " */ + int t_pause; /* # times thru update to pause */ + int (PASCAL NEAR *t_open)(); /* Open terminal at the start. */ + int (PASCAL NEAR *t_close)(); /* Close terminal at end. */ + int (PASCAL NEAR *t_kopen)(); /* Open keyboard */ + int (PASCAL NEAR *t_kclose)(); /* close keyboard */ + int (PASCAL NEAR *t_getchar)(); /* Get character from keyboard. */ + int (PASCAL NEAR *t_putchar)(); /* Put character to display. */ + int (PASCAL NEAR *t_flush)(); /* Flush output buffers. */ + int (PASCAL NEAR *t_move)(); /* Move the cursor, origin 0. */ + int (PASCAL NEAR *t_eeol)(); /* Erase to end of line. */ + int (PASCAL NEAR *t_eeop)(); /* Erase to end of page. */ + int (PASCAL NEAR *t_clrdesk)(); /* Clear the page totally */ + int (PASCAL NEAR *t_beep)(); /* Beep. */ + int (PASCAL NEAR *t_rev)(); /* set reverse video state */ + int (PASCAL NEAR *t_rez)(); /* change screen resolution */ +#if COLOR + int (PASCAL NEAR *t_setfor)(); /* set forground color */ + int (PASCAL NEAR *t_setback)(); /* set background color */ +#endif +#if INSDEL + int (PASCAL NEAR *t_insline)(); /* insert a screen line */ + int (PASCAL NEAR *t_delline)(); /* delete a screen line */ +#endif +#if WINDOW_MSWIN + int (PASCAL NEAR *t_sleep)(); /* go to sleep for a while */ + int (PASCAL NEAR *t_newscr)(); /* create new screen display */ + int (PASCAL NEAR *t_delscr)(); /* destroy screen display */ + int (PASCAL NEAR *t_selscr)(); /* select screen display */ + int (PASCAL NEAR *t_sizscr)(); /* resize screen display */ + int (PASCAL NEAR *t_topscr)(); /* bring screen to top */ +#endif +} TERM; +#endif + + +/* TEMPORARY macros for terminal I/O (to be placed in a machine + dependant place later) */ + +#define TTopen (*term.t_open) +#define TTclose (*term.t_close) +#define TTkopen (*term.t_kopen) +#define TTkclose (*term.t_kclose) +#define TTgetc (*term.t_getchar) +#define TTputc (*term.t_putchar) +#define TTflush (*term.t_flush) +#define TTmove (*term.t_move) +#define TTeeol (*term.t_eeol) +#define TTeeop (*term.t_eeop) +#define TTclrdesk (*term.t_clrdesk) +#define TTbeep (*term.t_beep) +#define TTrev (*term.t_rev) +#define TTrez (*term.t_rez) +#if COLOR +#define TTforg (*term.t_setfor) +#define TTbacg (*term.t_setback) +#endif + +/* Structure for the table of current key bindings */ + +ETYPE EPOINTER { + int (PASCAL NEAR *fp)(); /* C routine to invoke */ + BUFFER *buf; /* buffer to execute */ +}; + +typedef struct { + short k_code; /* Key code */ + short k_type; /* binding type (C function or EMACS buffer) */ + ETYPE EPOINTER k_ptr; /* ptr to thing to execute */ +} KEYTAB; + +/* structure for the name binding table */ + +typedef struct { + char *n_name; /* name of function key */ + int (PASCAL NEAR *n_func)(); /* function name is bound to */ +} NBIND; + +/* The editor holds deleted text chunks in the KILL buffer. The + kill buffer is logically a stream of ascii characters, however + due to its unpredicatable size, it gets implemented as a linked + list of chunks. (The d_ prefix is for "deleted" text, as k_ + was taken up by the keycode structure) +*/ + +typedef struct KILL { + struct KILL *d_next; /* link to next chunk, NULL if last */ + char d_chunk[KBLOCK]; /* deleted text */ +} KILL; + +/* When emacs's command interpetor needs to get a variable's name, + rather than it's value, it is passed back as a VDESC variable + description structure. The v_num field is a index into the + appropriate variable table. +*/ + +typedef struct VDESC { + int v_type; /* type of variable */ + int v_num; /* ordinal pointer to variable in list */ + UTABLE *v_ut; /* ptr to appropriate user table if user var */ +} VDESC; + +/* The !WHILE directive in the execution language needs to + stack references to pending whiles. These are stored linked + to each currently open procedure via a linked list of + the following structure +*/ + +typedef struct WHBLOCK { + LINE *w_begin; /* ptr to !while statement */ + LINE *w_end; /* ptr to the !endwhile statement*/ + int w_type; /* block type */ + struct WHBLOCK *w_next; /* next while */ +} WHBLOCK; + +#define BTWHILE 1 +#define BTBREAK 2 + +/* Abbreviations are short symbols that expand to longer strings + when typed into a buffer with no intervening whitespace or commands. + This structure grows dynamically as needed. +*/ + +typedef struct ABBREV { + struct ABBREV *ab_next; /* pointer to the next abbreviation */ + char ab_sym[MAXSYM + 1]; /* name to expand */ + char ab_exp[1]; /* string to expand to */ +} ABBREV; + +/* Search definitions... */ + +/* HICHAR - 1 is the largest character we will deal with. + * BMAPSIZE represents the number of bytes in the bitmap. + */ +#define HICHAR 256 +#define BMAPSIZE HICHAR >> 3 + +/* + * Jump table structures. + */ +typedef struct { + int jump; + int patlen; + int delta[HICHAR]; + char patrn[NPAT]; +} DELTA; + +#if MAGIC +/* + * Defines for the metacharacters in the regular expression + * search routines. MCNIL and GROUP are used in both search + * and replace metachar-arrays. + */ +#define MCNIL 0 /* Like the '\0' for strings.*/ +#define JMPTABLE 1 +#define LITSTRING 2 /* Literal string.*/ +#define LITCHAR 3 /* Literal character.*/ +#define ANY 4 /* Any character but the .*/ +#define CCL 5 +#define NCCL 6 +#define BOL 7 +#define EOL 8 +#define BOWRD 9 +#define EOWRD 10 +#define GRPBEG 11 /* Signal start of group.*/ +#define GRPEND 12 /* Signal end of group.*/ +#define GROUP 13 /* String of group match.*/ +#define DITTO 14 /* Replacement with match string.*/ + +#define CLOSURE 0x0100 /* An or-able value for a closure modifier.*/ +#define CLOSURE_1 0x0200 /* An or-able value for a closure modifier.*/ +#define ZEROONE 0x0400 /* An or-able value for a closure modifier.*/ + +#define ALLCLOS (CLOSURE | CLOSURE_1 | ZEROONE) +#define MASKCLO (~ALLCLOS) + +#define MC_ANY '.' /* 'Any' character (except newline).*/ +#define MC_CCL '[' /* Character class.*/ +#define MC_NCCL '^' /* Negate character class.*/ +#define MC_RCCL '-' /* Range in character class.*/ +#define MC_ECCL ']' /* End of character class.*/ +#define MC_BOL '^' /* Beginning of line.*/ +#define MC_EOL '$' /* End of line.*/ +#define MC_CLOSURE '*' /* Closure - zero to many characters match.*/ +#define MC_CLOSURE_1 '+' /* Closure - one to many characters match.*/ +#define MC_ZEROONE '?' /* Closure - zero to one characters match.*/ +#define MC_DITTO '&' /* Use matched string in replacement.*/ +#define MC_GRPBEG '(' /* Start of group (begun with a backslash).*/ +#define MC_GRPEND ')' /* End of group (begun with a backslash).*/ +#define MC_BOWRD '<' /* Beginning of word (begun with a backslash).*/ +#define MC_EOWRD '>' /* End of word (begun with a backslash).*/ +#define MC_ESC '\\' /* Escape - suppress meta-meaning.*/ + +#define MAXGROUPS 10 /* 1 + maximum # of r. e. groups. */ +#define BIT(n) (1 << (n)) /* An integer with one bit set.*/ + +/* Typedefs that define the bitmap type for searching (EBITMAP), + * the meta-character structure for MAGIC mode searching (MC), + * and the meta-character structure for MAGIC mode replacment (RMC). + */ +typedef char *EBITMAP; + +typedef struct { + short int mc_type; + union { + int lchar; + int group_no; + char *lstring; + DELTA *jmptable; + EBITMAP cclmap; + } u; +} MC; + +typedef struct { + short int mc_type; + union { + int group_no; + char *rstr; + } u; +} RMC; +#endif + +/* + This is the message which should be added to any "About MicroEMACS" + boxes on any of the machines with window managers. + + + ------------------------------------------ + | | + | MicroEMACS v4.xx | + | for the ............ | + | | + | Text Editor and Corrector | + | | + | written by Daniel M. Lawrence | + | [based on code by Dave Conroy] | + | | + | Send inquiries and donations to: | + | 617 New York St | + | Lafayette, IN 47901 | + | | + ------------------------------------------ +*/ diff --git a/uw7/cc/makefile b/uw7/cc/makefile new file mode 100644 index 0000000..af1af4c --- /dev/null +++ b/uw7/cc/makefile @@ -0,0 +1,106 @@ +# Unix makefile for +# MicroEMACS 3.12 +# (C)Copyright 1993 by Daniel Lawrence +# all rights reserved + +# modify the following lines with the proper relative directories + +# object file directory +OBJD = obj +# source file directory +SRCD = ../../src +# header file directory +HDIR = ../../h + +# options and arguments to the C compiler + +CFLAGS= -I. -I$(HDIR) -O -J + +# list of header files + +HFILES = estruct.h $(HDIR)/edef.h $(HDIR)/eproto.h $(HDIR)/elang.h + +#list of object files + +F1 = $(OBJD)/abbrev.o $(OBJD)/basic.o $(OBJD)/bind.o $(OBJD)/buffer.o +F2 = $(OBJD)/char.o $(OBJD)/crypt.o $(OBJD)/display.o $(OBJD)/dolock.o +F3 = $(OBJD)/eval.o $(OBJD)/exec.o $(OBJD)/file.o $(OBJD)/keyboard.o +F4 = $(OBJD)/fileio.o $(OBJD)/unix.o $(OBJD)/input.o +F5 = $(OBJD)/isearch.o $(OBJD)/libhelp.o $(OBJD)/line.o $(OBJD)/lock.o +F6 = $(OBJD)/main.o $(OBJD)/message.o $(OBJD)/mouse.o $(OBJD)/screen.o +F7 = $(OBJD)/random.o $(OBJD)/region.o $(OBJD)/search.o $(OBJD)/replace.o +F8 = $(OBJD)/tags.o $(OBJD)/undo.o $(OBJD)/window.o $(OBJD)/word.o + +# product list + +all: bin/emacs + +OFILES = $(F1) $(F2) $(F3) $(F4) $(F5) $(F6) $(F7) $(F8) + +bin/emacs: $(OFILES) + $(CC) $(CFLAGS) $(OFILES) -s -ltermcap -lc -ltinfo -o bin/emacs + +$(OBJD)/abbrev.o: $(SRCD)/abbrev.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/abbrev.o $(SRCD)/abbrev.c +$(OBJD)/basic.o: $(SRCD)/basic.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/basic.o $(SRCD)/basic.c +$(OBJD)/bind.o: $(SRCD)/bind.c $(HFILES) $(HDIR)/epath.h + $(CC) $(CFLAGS) -c -Fo$(OBJD)/bind.o $(SRCD)/bind.c +$(OBJD)/buffer.o: $(SRCD)/buffer.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/buffer.o $(SRCD)/buffer.c +$(OBJD)/char.o: $(SRCD)/char.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/char.o $(SRCD)/char.c +$(OBJD)/crypt.o: $(SRCD)/crypt.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/crypt.o $(SRCD)/crypt.c +$(OBJD)/cmdfix.o: $(SRCD)/cmdfix.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/cmdfix.o $(SRCD)/cmdfix.c +$(OBJD)/display.o: $(SRCD)/display.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/display.o $(SRCD)/display.c +$(OBJD)/dolock.o: $(SRCD)/dolock.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/dolock.o $(SRCD)/dolock.c +$(OBJD)/eval.o: $(SRCD)/eval.c $(HFILES) $(HDIR)/evar.h + $(CC) $(CFLAGS) -c -Fo$(OBJD)/eval.o $(SRCD)/eval.c +$(OBJD)/exec.o: $(SRCD)/exec.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/exec.o $(SRCD)/exec.c +$(OBJD)/file.o: $(SRCD)/file.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/file.o $(SRCD)/file.c +$(OBJD)/fileio.o: $(SRCD)/fileio.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/fileio.o $(SRCD)/fileio.c +$(OBJD)/input.o: $(SRCD)/input.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/input.o $(SRCD)/input.c +$(OBJD)/isearch.o: $(SRCD)/isearch.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/isearch.o $(SRCD)/isearch.c +$(OBJD)/keyboard.o: $(SRCD)/keyboard.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/keyboard.o $(SRCD)/keyboard.c +$(OBJD)/libhelp.o: $(SRCD)/libhelp.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/libhelp.o $(SRCD)/libhelp.c +$(OBJD)/line.o: $(SRCD)/line.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/line.o $(SRCD)/line.c +$(OBJD)/lock.o: $(SRCD)/lock.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/lock.o $(SRCD)/lock.c +$(OBJD)/main.o: $(SRCD)/main.c $(HFILES) $(HDIR)/efunc.h $(HDIR)/ebind.h + $(CC) $(CFLAGS) -c -Fo$(OBJD)/main.o $(SRCD)/main.c +$(OBJD)/message.o: $(SRCD)/message.c $(HFILES) $(HDIR)/epath.h + $(CC) $(CFLAGS) -c -Fo$(OBJD)/message.o $(SRCD)/message.c +$(OBJD)/mouse.o: $(SRCD)/mouse.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/mouse.o $(SRCD)/mouse.c +$(OBJD)/unix.o: $(SRCD)/unix.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/unix.o $(SRCD)/unix.c +$(OBJD)/random.o: $(SRCD)/random.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/random.o $(SRCD)/random.c +$(OBJD)/region.o: $(SRCD)/region.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/region.o $(SRCD)/region.c +$(OBJD)/screen.o: $(SRCD)/screen.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/screen.o $(SRCD)/screen.c +$(OBJD)/search.o: $(SRCD)/search.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/search.o $(SRCD)/search.c +$(OBJD)/replace.o: $(SRCD)/replace.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/replace.o $(SRCD)/replace.c +$(OBJD)/tags.o: $(SRCD)/tags.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/tags.o $(SRCD)/tags.c +$(OBJD)/undo.o: $(SRCD)/undo.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/undo.o $(SRCD)/undo.c +$(OBJD)/window.o: $(SRCD)/window.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/window.o $(SRCD)/window.c +$(OBJD)/word.o: $(SRCD)/word.c $(HFILES) + $(CC) $(CFLAGS) -c -Fo$(OBJD)/word.o $(SRCD)/word.c diff --git a/uw7/gcc/makefile b/uw7/gcc/makefile new file mode 100644 index 0000000..3633acf --- /dev/null +++ b/uw7/gcc/makefile @@ -0,0 +1,103 @@ +# Unix makefile for +# MicroEMACS 3.12 +# (C)Copyright 1993 by Daniel Lawrence +# all rights reserved + +# modify the following lines with the proper relative directories + +# object file directory +OBJD = obj +# source file directory +SRCD = ../../src +# header file directory +HDIR = ../../h + +# options and arguments to the C compiler + +CC = gcc +CFLAGS= -O -I. -I$(HDIR) -g -D_STRICTNAME_H + +# list of header files + +HFILES = estruct.h $(HDIR)/edef.h $(HDIR)/efunc.h $(HDIR)/epath.h $(HDIR)/ebind.h $(HDIR)/eproto.h + +#list of object files + +F1 = $(OBJD)/abbrev.o $(OBJD)/basic.o $(OBJD)/bind.o $(OBJD)/buffer.o +F2 = $(OBJD)/char.o $(OBJD)/crypt.o $(OBJD)/display.o $(OBJD)/dolock.o +F3 = $(OBJD)/eval.o $(OBJD)/exec.o $(OBJD)/file.o $(OBJD)/keyboard.o +F4 = $(OBJD)/fileio.o $(OBJD)/unix.o $(OBJD)/input.o +F5 = $(OBJD)/isearch.o $(OBJD)/line.o $(OBJD)/lock.o +F6 = $(OBJD)/main.o $(OBJD)/mouse.o $(OBJD)/screen.o +F7 = $(OBJD)/random.o $(OBJD)/region.o $(OBJD)/search.o $(OBJD)/replace.o +F8 = $(OBJD)/tags.o $(OBJD)/undo.o $(OBJD)/window.o $(OBJD)/word.o + +# product list + +all: bin/emacs + +OFILES = $(F1) $(F2) $(F3) $(F4) $(F5) $(F6) $(F7) $(F8) + +bin/emacs: $(OFILES) + $(CC) $(CFLAGS) $(OFILES) -ltermcap -lc -lcurses -o bin/emacs + +$(OBJD)/abbrev.o: $(SRCD)/abbrev.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/abbrev.o $(SRCD)/abbrev.c +$(OBJD)/basic.o: $(SRCD)/basic.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/basic.o $(SRCD)/basic.c +$(OBJD)/bind.o: $(SRCD)/bind.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/bind.o $(SRCD)/bind.c +$(OBJD)/buffer.o: $(SRCD)/buffer.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/buffer.o $(SRCD)/buffer.c +$(OBJD)/char.o: $(SRCD)/char.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/char.o $(SRCD)/char.c +$(OBJD)/crypt.o: $(SRCD)/crypt.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/crypt.o $(SRCD)/crypt.c +$(OBJD)/cmdfix.o: $(SRCD)/cmdfix.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/cmdfix.o $(SRCD)/cmdfix.c +$(OBJD)/display.o: $(SRCD)/display.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/display.o $(SRCD)/display.c +$(OBJD)/dolock.o: $(SRCD)/dolock.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/dolock.o $(SRCD)/dolock.c +$(OBJD)/eval.o: $(SRCD)/eval.c $(HFILES) $(HDIR)/evar.h + $(CC) $(CFLAGS) -c -o $(OBJD)/eval.o $(SRCD)/eval.c +$(OBJD)/exec.o: $(SRCD)/exec.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/exec.o $(SRCD)/exec.c +$(OBJD)/file.o: $(SRCD)/file.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/file.o $(SRCD)/file.c +$(OBJD)/fileio.o: $(SRCD)/fileio.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/fileio.o $(SRCD)/fileio.c +$(OBJD)/input.o: $(SRCD)/input.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/input.o $(SRCD)/input.c +$(OBJD)/isearch.o: $(SRCD)/isearch.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/isearch.o $(SRCD)/isearch.c +$(OBJD)/keyboard.o: $(SRCD)/keyboard.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/keyboard.o $(SRCD)/keyboard.c +$(OBJD)/line.o: $(SRCD)/line.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/line.o $(SRCD)/line.c +$(OBJD)/lock.o: $(SRCD)/lock.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/lock.o $(SRCD)/lock.c +$(OBJD)/main.o: $(SRCD)/main.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/main.o $(SRCD)/main.c +$(OBJD)/mouse.o: $(SRCD)/mouse.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/mouse.o $(SRCD)/mouse.c +$(OBJD)/screen.o: $(SRCD)/screen.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/screen.o $(SRCD)/screen.c +$(OBJD)/unix.o: $(SRCD)/unix.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/unix.o $(SRCD)/unix.c +$(OBJD)/random.o: $(SRCD)/random.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/random.o $(SRCD)/random.c +$(OBJD)/region.o: $(SRCD)/region.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/region.o $(SRCD)/region.c +$(OBJD)/search.o: $(SRCD)/search.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/search.o $(SRCD)/search.c +$(OBJD)/replace.o: $(SRCD)/replace.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/replace.o $(SRCD)/replace.c +$(OBJD)/tags.o: $(SRCD)/tags.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/tags.o $(SRCD)/tags.c +$(OBJD)/undo.o: $(SRCD)/undo.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/undo.o $(SRCD)/undo.c +$(OBJD)/window.o: $(SRCD)/window.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/window.o $(SRCD)/window.c +$(OBJD)/word.o: $(SRCD)/word.c $(HFILES) + $(CC) $(CFLAGS) -c -o $(OBJD)/word.o $(SRCD)/word.c From e1c6f19c2336f88982e59f50f612eb70babb33c8 Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 10 Sep 2020 19:21:06 +0200 Subject: [PATCH 27/37] Startup script for curses version --- cmd_curses/emacs.rc_curses | 98 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 cmd_curses/emacs.rc_curses diff --git a/cmd_curses/emacs.rc_curses b/cmd_curses/emacs.rc_curses new file mode 100644 index 0000000..ee30c0e --- /dev/null +++ b/cmd_curses/emacs.rc_curses @@ -0,0 +1,98 @@ +; EMACS.RC: Standard MicroEMACS Startup program +; for MicroEMACS 3.13 and above +; (C)opyright 1987-99 by Daniel M Lawrence +; Last Update: 11/13/93 + +;set $discmd TRUE +write-message "[Setting up....]" +;set $debug TRUE + +; If you hate clocks or position counters, comment these +;set $timeflag TRUE +set $posflag TRUE +set $sscroll TRUE + +; Set Default Global modes + +add-global-mode "white" +add-global-mode "BLACK" + +; Bring up Online-help system + +store-procedure get-help + set $discmd FALSE + source ehelp.cmd + set $discmd TRUE +!endm + +macro-to-menu get-help "Help>MicroEmacs help" + +; Set up default modes + +add-mode "white" +add-mode "BLACK" + +store-procedure set-default-mode +; set $debug TRUE + set %rctmp &sri $cfname "." + !if &equ %rctmp 0 + !return + !endif + set %rctmp &mid $cfname &add %rctmp 1 5 + !if &or &seq %rctmp "c" &seq %rctmp "h" + add-mode "cmode" + delete-mode "theox" + set $hardtab 4 + kill-abbrevs + !endif + !if &or &seq %rctmp "cpp" &seq %rctmp "hpp" + add-mode "cmode" + delete-mode "theox" + set $hardtab 4 + kill-abbrevs + !endif + !if &seq %rctmp "b" + add-mode "cmode" + add-mode "abbrev" + delete-mode "theox" + set $hardtab 2 + execute-file babbrevs.cmd + !endif + !if &seq %rctmp "basic" + add-mode "cmode" + add-mode "abbrev" + add-mode "theox" + set $hardtab 2 + execute-file babbrevs.cmd + !endif + !if &or &seq %rctmp "mss" &seq %rctmp "txt" + add-mode "wrap" + delete-mode "cmode" + delete-mode "theox" + set $hardtab 8 + kill-abbrevs + !endif +!endm +set $readhook set-default-mode + +; ***** Rebind the Function key group + +bind-to-key search-forward FN1 +bind-to-key search-reverse FN2 +bind-to-key hunt-forward FN3 +bind-to-key hunt-backward FN4 +;bind-to-key toggle-fkeys FN5 +macro-to-key get-help FN6 +bind-to-key next-window FN7 +bind-to-key previous-window FN8 +bind-to-key exit-emacs FN9 +bind-to-key save-file FN0 + +store-procedure toggle-insert + !if &gre &mod $cmode 64 31 + delete-mode "over" + !else + add-mode "over" + !endif +!endm +macro-to-key toggle-insert FNC \ No newline at end of file From 41d910ebdb4f60855ddf6b48ae3eaadc0fbb5f39 Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 10 Sep 2020 19:21:57 +0200 Subject: [PATCH 28/37] Files for TxBasic IDE --- cmd_txb/babbrevs.cmd | 15 ++ cmd_txb/emacs.rc | 129 ++++++++++++++++++ cmd_txb/tpage.cmd | 317 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 461 insertions(+) create mode 100644 cmd_txb/babbrevs.cmd create mode 100644 cmd_txb/emacs.rc create mode 100644 cmd_txb/tpage.cmd diff --git a/cmd_txb/babbrevs.cmd b/cmd_txb/babbrevs.cmd new file mode 100644 index 0000000..8e4c9cc --- /dev/null +++ b/cmd_txb/babbrevs.cmd @@ -0,0 +1,15 @@ +;set $debug TRUE +add-abbrev DIR DIRECT +add-abbrev IND INDEXED +add-abbrev INP INPUT +add-abbrev LIN "LINPUT ~"~", using ~"~",a$" +add-abbrev MR "MAT READ #" +add-abbrev MRN "MAT READNEXT #" +add-abbrev MRP "MAT READPREV #" +add-abbrev MW "MAT WRITE #" +add-abbrev OTH "OTHERWISE" +add-abbrev OUT "OUTPUT" +add-abbrev SEQ "SEQUENTIAL" +add-abbrev W "WINDOW" +add-abbrev WNE "WHILE NOT EOF( +!force set $debug FALSE diff --git a/cmd_txb/emacs.rc b/cmd_txb/emacs.rc new file mode 100644 index 0000000..88be80c --- /dev/null +++ b/cmd_txb/emacs.rc @@ -0,0 +1,129 @@ +; EMACS.RC: Standard MicroEMACS Startup program +; for MicroEMACS 3.13 and above +; (C)opyright 1987-99 by Daniel M Lawrence +; Last Update: 11/13/93 + +;set $discmd TRUE +write-message "[Setting up....]" +;set $debug TRUE + +; If you hate clocks or position counters, comment these +;set $timeflag TRUE +set $posflag TRUE +set $sscroll TRUE + +; Set Default Global modes + +add-global-mode "white" +add-global-mode "BLACK" + +; Bring up Online-help system + +store-procedure get-help + set $discmd FALSE + source ehelp.cmd + set $discmd TRUE +!endm + +macro-to-menu get-help "Help>MicroEmacs help" + +; Set up default modes + +add-mode "white" +add-mode "BLACK" + +store-procedure set-default-mode +; set $debug TRUE + set %rctmp &sri $cfname "." + !if &equ %rctmp 0 + !return + !endif + set %rctmp &mid $cfname &add %rctmp 1 5 + !if &or &seq %rctmp "c" &seq %rctmp "h" + add-mode "cmode" + delete-mode "theox" + set $hardtab 4 + kill-abbrevs + !endif + !if &or &seq %rctmp "cpp" &seq %rctmp "hpp" + add-mode "cmode" + delete-mode "theox" + set $hardtab 4 + kill-abbrevs + !endif + !if &seq %rctmp "b" + add-mode "cmode" + add-mode "abbrev" + delete-mode "theox" + set $hardtab 2 + execute-file babbrevs.cmd + !endif + !if &seq %rctmp "basic" + add-mode "cmode" + add-mode "abbrev" + add-mode "theox" + set $hardtab 2 + execute-file babbrevs.cmd + !endif + !if &or &seq %rctmp "mss" &seq %rctmp "txt" + add-mode "wrap" + delete-mode "cmode" + delete-mode "theox" + set $hardtab 8 + kill-abbrevs + !endif +!endm +set $readhook set-default-mode + +; ***** Rebind the Function key group + +bind-to-key search-forward FN1 +bind-to-key search-reverse FN2 +bind-to-key hunt-forward FN3 +bind-to-key hunt-backward FN4 +;bind-to-key toggle-fkeys FN5 +macro-to-key get-help FN6 +bind-to-key next-window FN7 +bind-to-key previous-window FN8 +bind-to-key exit-emacs FN9 +bind-to-key save-file FN0 + +store-procedure toggle-insert + !if &gre &mod $cmode 64 31 + delete-mode "over" + !else + add-mode "over" + !endif +!endm +macro-to-key toggle-insert FNC + +store-procedure convert-to-utf8 +; set $debug TRUE + set %cmode &band $cmode 16384 + !if &equ %cmode 16384 + unmark-buffer + filter-buffer "theoxutf" + delete-mode "theox" + !else + write-message "[File already uses Unicode character set]" + !endif + !force set $debug FALSE +!endm + +store-procedure convert-to-theox +; set $debug TRUE + set %cmode &band $cmode 16384 + !if &equ %cmode 0 + unmark-buffer + filter-buffer "utftheox" + add-mode "theox" + !else + write-message "[File already uses TheoX character set]" + !endif + !force set $debug FALSE +!endm + +macro-to-menu convert-to-utf8 "Modify>Convert to UTF-8" +macro-to-menu convert-to-theox "Modify>Convert to TheoX" + +execute-file tpage.cmd diff --git a/cmd_txb/tpage.cmd b/cmd_txb/tpage.cmd new file mode 100644 index 0000000..91f5626 --- /dev/null +++ b/cmd_txb/tpage.cmd @@ -0,0 +1,317 @@ +; TPAGE.CMD: TxBasic language MENU Page +; for MicroEMACS 3.9e and above +; + +; set up the "clean" procedure + +store-procedure clean + delete-buffer "[b-indent]" + delete-buffer "[b-indent-brace]" + delete-buffer "[b-check]" + delete-buffer "[b-compile]" + delete-buffer "[b-compile-release]" + delete-buffer "[b-compile-speed]" + delete-buffer "[b-compile-debug]" + delete-buffer "[b-compile-gdb]" + delete-buffer "[b-run]" + delete-buffer "[b-debug]" + delete-buffer "[b-gdb]" + delete-buffer "[b-new-if]" + delete-buffer "[b-new-switch]" + delete-buffer "[b-new-for]" + delete-buffer "[b-new-while]" + set $cmode %oldmode + set $gmode %oldgmode +!endm + +store-procedure b-indent +; set $debug TRUE + unmark-buffer + filter-buffer &cat "txf --unbrace --upper -i" $hardtab + !force set $debug FALSE +!endm + +store-procedure b-indent-brace +; set $debug TRUE + unmark-buffer + filter-buffer &cat "txf --brace --upper -i" $hardtab + !force set $debug FALSE +!endm + +store-procedure b-compile +; set $debug TRUE + !if %rcfkeys + !force toggle-fkeys + !endif + delete-other-windows + delete-buffer "[S-F9 prev error S-F10 next error]" + save-file + set %cfname $cfname + set %cmode &band $cmode 16384 + !if &equ %cmode 0 + !force pipe-command &cat &cat %command " --utf8 " $cfname + !else + !force pipe-command &cat %command $cfname + !endif + name-buffer "[S-F9 prev error S-F10 next error]" + end-of-file + !if &equ $curline 1 + !force delete-mode "VIEW" + insert-string &cat &cat %cfname " successfully " %work + unmark-buffer + !force 1 resize-window + add-mode "VIEW" + !force delete-mode "CMODE" + next-window + !else + beginning-of-file + !force 5 resize-window + add-mode "VIEW" + !force delete-mode "CMODE" + next-window + beginning-of-file + execute-procedure "b-next-error" + !endif + !force set $debug FALSE +!endm + +store-procedure b-check +; set $debug TRUE + set %command "mepipe txlint " + set %work "checked" + execute-procedure "b-compile" + !force set $debug FALSE +!endm + +store-procedure b-compile-release +; set $debug TRUE + set %command "mepipe txb -T -C" + set %work "compiled" + execute-procedure "b-compile" + !force set $debug FALSE +!endm + +store-procedure b-compile-speed +; set $debug TRUE + set %command "mepipe txb" + set %work "compiled" + execute-procedure "b-compile" + !force set $debug FALSE +!endm + +store-procedure b-compile-debug +; set $debug TRUE + set %command "mepipe txb -d -T" + set %work "compiled" + execute-procedure "b-compile" + !force set $debug FALSE +!endm + +store-procedure b-compile-gdb +; set $debug TRUE + set %command "mepipe txb -g -T -C" + set %work "compiled" + execute-procedure "b-compile" + !force set $debug FALSE +!endm + +store-procedure b-run +; set $debug TRUE + set %rctmp &sri $cfname "." + set %cfname &mid $cfname 1 &sub %rctmp 1 + shell-command &cat "merun ./" %cfname + !force set $debug FALSE +!endm + +store-procedure b-gdb +; set $debug TRUE + set %rctmp &sri $cfname "." + set %cfname &mid $cfname 1 &sub %rctmp 1 + shell-command &cat "gdb -tui ./" %cfname + !force set $debug FALSE +!endm + +store-procedure b-prev-error +; set $debug TRUE + delete-other-windows + split-current-window + select-buffer "[S-F9 prev error S-F10 next error]" + add-mode "VIEW" + !force 5 resize-window + beginning-of-line + !force search-reverse ", line " + !if &seq $status FALSE + write-message "[No more error]" + previous-window + !return + !endif + 7 forward-character + set-mark + end-of-word + set %line $region + previous-window + !force %line goto-line + !force set $debug FALSE +!endm + +store-procedure b-next-error +; set $debug TRUE + delete-other-windows + split-current-window + select-buffer "[S-F9 prev error S-F10 next error]" + add-mode "VIEW" + !force 5 resize-window + !force search-forward ", line " + !if &seq $status FALSE + write-message "[No more error]" + previous-window + !return + !endif + set-mark + end-of-word + set %line $region + previous-window + !force %line goto-line + !force set $debug FALSE +!endm + +store-procedure b-new-if + set %cond @"Logical expression: " +; set $debug TRUE + insert-string &cat "IF " %cond + newline-and-indent + newline-and-indent + insert-string "ELSE" + newline-and-indent + handle-tab + newline-and-indent + insert-string "IFEND" + newline-and-indent + delete-previous-character + 4 previous-line + handle-tab + end-of-line + !force set $debug FALSE +!endm + +store-procedure b-new-select + set %cond @"Expression: " +; set $debug TRUE + insert-string &cat "SELECT " %cond + newline-and-indent + newline-and-indent + insert-string "CASE" + newline-and-indent + handle-tab + newline-and-indent + insert-string "CEND" + newline-and-indent + delete-previous-character + 6 previous-line + end-of-line + !force set $debug FALSE +!endm + +; FOR NEXT +store-procedure b-new-for + set %cond @"Variable name: " +; set $debug TRUE + insert-string &cat &cat "FOR " %cond "=" + newline-and-indent + handle-tab + newline-and-indent + insert-string &cat "NEXT " %cond + 2 previous-line + end-of-line + !force set $debug FALSE +!endm + +; +; WHILE WEND +store-procedure b-new-while + set %cond @"Logical expression: " +; set $debug TRUE + insert-string &cat "WHILE " %cond + newline-and-indent + handle-tab + newline-and-indent + insert-string "WEND" + previous-line + end-of-line + !force set $debug FALSE +!endm + +store-procedure toggle-errors + !if %rcerrors + !goto rcfoff + !endif + +; toggle errors window on + save-window + 1 next-window + !if &sequal $cbufname "emacs.hlp" + delete-window + !endif + !if ¬ &sequal $cbufname "[S-F9 prev error S-F10 next error]" + 1 split-current-window + 1 select-buffer "[S-F9 prev error S-F10 next error]" + add-mode "red" + add-mode "WHITE" + !force 5 resize-window + 1 goto-line + !endif + set %rcfkeys TRUE + !force restore-window + !if &sequal $cbufname "[S-F9 prev error S-F10 next error]" + next-window + !endif + write-message "[Errors window ON]" + !return + + ;Toggle the error window off +*rcfoff + save-window + 1 next-window + !if &sequal "[S-F9 prev error S-F10 next error]" $cbufname + delete-window + !endif + !force restore-window + write-message "[Errors window OFF]" + set %rcerrors FALSE +!endm + +macro-to-key b-indent S-FN1 +macro-to-key b-indent-brace S-FN2 +macro-to-key b-check S-FN3 +macro-to-key b-compile-release S-FN4 +macro-to-key b-compile-speed S-FN5 +macro-to-key b-compile-debug S-FN6 +macro-to-key b-compile-gdb S-FN7 +macro-to-key b-run S-FN8 +macro-to-key b-prev-error S-FN9 +macro-to-key b-next-error S-FN0 + +macro-to-menu b-indent "TxBasic>Format b" +macro-to-menu b-indent-brace "TxBasic>Format w" +macro-to-menu b-check "TxBasic>Check" +macro-to-menu b-compile-release "TxBasic>Compile r" +macro-to-menu b-compile-speed "TxBasic>Compile for s" +macro-to-menu b-compile-debug "TxBasic>Compile for T" +macro-to-menu b-compile-gdb "TxBasic>Compile for g" +macro-to-menu b-run "TxBasic>Run" +macro-to-menu b-gdb "TxBasic>Run t" +macro-to-menu b-prev-error "TxBasic>Prev" +macro-to-menu b-next-error "TxBasic>Next" +macro-to-menu b-new-if "TxBasic>IF" +macro-to-menu b-new-select "TxBasic>SELECT" +macro-to-menu b-new-for "TxBasic>FOR" +macro-to-menu b-new-while "TxBasic>WHILE" + +bind-to-key menu-drop FNb + +; Set up CMODE +add-mode CMODE +add-global-mode CMODE +set $hardtab 5 + +write-message "[TxBasic perspective loaded]" From b3367ffd4726f8fdcfc380064dca87e2eac5f963 Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 10 Sep 2020 19:25:36 +0200 Subject: [PATCH 29/37] Updated to version 5.11 --- h/ebind.h | 2 +- h/efunc.h | 5 +- h/eproto.h | 1843 +++++++++++++++++++++++++------------------------- h/evar.h | 32 +- h/mswin.h | 82 +-- h/resource.h | 8 +- 6 files changed, 986 insertions(+), 986 deletions(-) diff --git a/h/ebind.h b/h/ebind.h index a498fe2..4810048 100644 --- a/h/ebind.h +++ b/h/ebind.h @@ -37,7 +37,7 @@ NOSHARE KEYTAB keytab[NBINDS] = { {CTRL|'J', BINDFNC, { indent } }, {CTRL|'K', BINDFNC, { killtext } }, {CTRL|'L', BINDFNC, { uerefresh } }, - {CTRL|'M', BINDFNC, { new_line } }, + {CTRL|'M', BINDFNC, { uenewline } }, {CTRL|'N', BINDFNC, { forwline } }, {CTRL|'O', BINDFNC, { openline } }, {CTRL|'P', BINDFNC, { backline } }, diff --git a/h/efunc.h b/h/efunc.h index 4343d0a..770944b 100644 --- a/h/efunc.h +++ b/h/efunc.h @@ -188,6 +188,9 @@ NOSHARE NBIND names[] = { {"maximize-screen", maximizescreen}, #else {"maximize-screen", notavail}, +#endif +#if CURSES + {"menu-drop", menudrop}, #endif {"meta-prefix", uemeta}, #if WINDOW_MSWIN @@ -216,7 +219,7 @@ NOSHARE NBIND names[] = { {"move-window-up", mvupwind}, {"name-buffer", namebuffer}, {"narrow-to-region", narrow}, - {"newline", new_line}, + {"newline", uenewline}, {"newline-and-indent", indent}, {"next-buffer", nextbuffer}, {"next-line", forwline}, diff --git a/h/eproto.h b/h/eproto.h index 88d4882..75b9ee9 100644 --- a/h/eproto.h +++ b/h/eproto.h @@ -4,8 +4,6 @@ written by Daniel Lawrence based on code by Dave G. Conroy, Steve Wilhite and George Jones - - Unicode support by Jean-Michel Dubois */ #if LINUX @@ -40,7 +38,7 @@ extern int handlemenu(WINDOW* wmouse, int ypos, int xpos); #endif -#if WINDOW_MSWIN || CURSES +#if CURSES extern int bindtomenu (int f, int n); extern int macrotomenu (int f, int n); extern int unbindmenu (int f, int n); @@ -50,26 +48,29 @@ extern int menudrop(int f, int n); #endif #if WINDOW_MSWIN -extern char * fullpathname (char *PathName, int Nbuf); -extern int vtinitscr (ESCREEN *sp, int nrow, int ncol); -extern int vtsizescr (ESCREEN *sp, int nrow, int ncol); -extern int cutregion (int f, int n); -extern int clipregion (int f, int n); -extern int insertclip (int f, int n); -extern int helpengine (int f, int n); -extern int minimizescreen (int f, int n); -extern int maximizescreen (int f, int n); -extern int restorescreen (int f, int n); -extern int tilescreens (int f, int n); -extern int cascadescreens (int f, int n); -extern int execmenu (int f, int n); -extern int longop (int f); -extern int filenamedlg (char *prompt, char *buf, int nbuf, int fullpath); -extern int vtfreescr (ESCREEN *sp); -extern int unlist_screen(ESCREEN *sp); -extern int mlhistory(VOID); -extern int updscrollbars (ESCREEN *sp, char w_flag); -extern VOID vtscreen (ESCREEN *sp); +extern char * PASCAL fullpathname (char *PathName, int Nbuf); +extern int PASCAL NEAR vtinitscr (ESCREEN *sp, int nrow, int ncol); +extern int PASCAL NEAR vtsizescr (ESCREEN *sp, int nrow, int ncol); +extern int PASCAL cutregion (int f, int n); +extern int PASCAL clipregion (int f, int n); +extern int PASCAL insertclip (int f, int n); +extern int PASCAL helpengine (int f, int n); +extern int PASCAL minimizescreen (int f, int n); +extern int PASCAL maximizescreen (int f, int n); +extern int PASCAL restorescreen (int f, int n); +extern int PASCAL tilescreens (int f, int n); +extern int PASCAL cascadescreens (int f, int n); +extern int PASCAL bindtomenu (int f, int n); +extern int PASCAL macrotomenu (int f, int n); +extern int PASCAL unbindmenu (int f, int n); +extern int PASCAL execmenu (int f, int n); +extern int PASCAL longop (int f); +extern int PASCAL filenamedlg (char *prompt, char *buf, int nbuf, int fullpath); +extern int PASCAL NEAR vtfreescr (ESCREEN *sp); +extern int PASCAL NEAR unlist_screen(ESCREEN *sp); +extern int PASCAL mlhistory(VOID); +extern int PASCAL updscrollbars (ESCREEN *sp, char w_flag); +extern VOID PASCAL NEAR vtscreen (ESCREEN *sp); #endif #if WINXP @@ -95,102 +96,99 @@ VOID winch_vtresize(int rows, int cols); #endif #if DEBUG_SEARCH -int mc_list(int f, int n); -int rmc_list(int f, int n); -VOID mctype_cat(char pline[], int mc_type); +int PASCAL NEAR mc_list(int f, int n); +int PASCAL NEAR rmc_list(int f, int n); +VOID PASCAL NEAR mctype_cat(char pline[], int mc_type); #endif extern VOID undo_insert(OPTYPE op_type, long count, OBJECT op_erand); extern int undo_op(VOID); extern VOID undo_dump(VOID); extern VOID undo_zot(BUFFER *bp); -extern int undo(int f, int n); -extern int undo_delete(int f, int n); -extern int undo_list(int f, int n); +extern int PASCAL NEAR undo(int f, int n); +extern int PASCAL NEAR undo_delete(int f, int n); +extern int PASCAL NEAR undo_list(int f, int n); extern VOID *room(int); extern VOID *reroom(VOID *, int); -extern int ab_insert(char *sym, char *expansion); -extern char *ab_lookup(char *sym); -extern int ab_delete(char *sym); -extern int ab_clean(VOID); -extern BUFFER *bfind(CONST char *bname, int cflag, int bflag); -extern BUFFER *getcbuf(CONST char *prompt, char *defval, int createflag); -extern BUFFER *getdefb(VOID); -extern BUFFER *getoldb(VOID); -extern ESCREEN *init_screen(char *, BUFFER *); -extern ESCREEN *lookup_screen(char *scr_name); -extern ESCREEN *index_screen(int scr_num); -extern int screen_index(ESCREEN *sp); -extern int insert_screen(ESCREEN *sp); -extern int select_screen(ESCREEN *sp, int announce); -extern VOID free_screen(ESCREEN *sp); +extern int PASCAL NEAR ab_insert(char *sym, char *expansion); +extern char *PASCAL NEAR ab_lookup(char *sym); +extern int PASCAL NEAR ab_delete(char *sym); +extern int PASCAL NEAR ab_clean(VOID); +extern BUFFER *PASCAL NEAR bfind(CONST char *bname, int cflag, int bflag); +extern BUFFER *PASCAL NEAR getcbuf(CONST char *prompt, char *defval, int createflag); +extern BUFFER *PASCAL NEAR getdefb(VOID); +extern BUFFER *PASCAL NEAR getoldb(VOID); +extern ESCREEN *PASCAL NEAR init_screen(char *, BUFFER *); +extern ESCREEN *PASCAL NEAR lookup_screen(char *scr_name); +extern ESCREEN *PASCAL NEAR index_screen(int scr_num); +extern int PASCAL NEAR screen_index(ESCREEN *sp); +extern int PASCAL NEAR insert_screen(ESCREEN *sp); +extern int PASCAL NEAR select_screen(ESCREEN *sp, int announce); +extern VOID PASCAL NEAR free_screen(ESCREEN *sp); extern char *Eallocate(unsigned nbytes); extern char *dolock(CONST char *fname); extern char *getpath(char *filespec); extern char *gtname(char *filespec); -extern char *bytecopy(char *dst, CONST char *src, int maxlen); -extern char *cmdstr(int c, char *seq); -extern char *copystr(char *); -extern char *complete(CONST char *prompt, char *defval, int type, int maxlen); -extern char *envval(int i); -extern CONST char *fixnull(CONST char *s); -extern CONST char *flook(CONST char *fname, int hflag); -extern char *funval(int i); -extern char *getctext(char *rline); -extern char *getffile(char *fspec); -extern CONST char *getfname(KEYTAB *key); -extern char *getkill(VOID); -extern char *getnfile(VOID); -extern char *getreg(char *value); -extern CONST char *getval(char *token); -extern char *getwlist(char *buf); -extern CONST char *gtenv(CONST char *vname); -extern char *gtfilename(CONST char *prompt); -extern CONST char *gtfun(char *fname); -extern char *gtusr(char *vname); -extern char *int_asc(int i); -extern char *long_asc(long num); -extern CONST char *ltos(int val); -extern CONST char *makename(char *bname, CONST char *fname); -extern char *mklower(char *str); -extern char *mkupper(char *str); -extern char *namval(int index); -extern char *timeset(VOID); -extern char *token(char *src, char *tok, int size); -extern CONST char *transbind(CONST char *skey); -extern char *trimstr(char *s); -extern char *xlat(char *source, char *lookup, char *trans); +extern char *PASCAL NEAR bytecopy(char *dst, CONST char *src, int maxlen); +extern char *PASCAL NEAR cmdstr(int c, char *seq); +extern char *PASCAL NEAR copystr(char *); +extern char *PASCAL NEAR complete(CONST char *prompt, char *defval, int type, int maxlen); +extern char *PASCAL NEAR envval(int i); +extern CONST char *PASCAL NEAR fixnull(CONST char *s); +extern CONST char *PASCAL NEAR flook(CONST char *fname, int hflag); +extern char *PASCAL NEAR funval(int i); +extern char *PASCAL NEAR getctext(char *rline); +extern char *PASCAL NEAR getffile(char *fspec); +extern CONST char *PASCAL NEAR getfname(KEYTAB *key); +extern char *PASCAL NEAR getkill(VOID); +extern char *PASCAL NEAR getnfile(VOID); +extern char *PASCAL NEAR getreg(char *value); +extern CONST char *PASCAL NEAR getval(char *token); +extern char *PASCAL NEAR getwlist(char *buf); +extern CONST char *PASCAL NEAR gtenv(CONST char *vname); +extern char *PASCAL NEAR gtfilename(CONST char *prompt); +extern CONST char *PASCAL NEAR gtfun(char *fname); +extern char *PASCAL NEAR gtusr(char *vname); +extern char *PASCAL NEAR int_asc(int i); +extern char *PASCAL NEAR long_asc(long num); +extern CONST char *PASCAL NEAR ltos(int val); +extern CONST char *PASCAL NEAR makename(char *bname, CONST char *fname); +extern char *PASCAL NEAR mklower(char *str); +extern char *PASCAL NEAR mkupper(char *str); +extern char *PASCAL NEAR namval(int index); +extern char *PASCAL NEAR timeset(VOID); +extern char *PASCAL NEAR token(char *src, char *tok, int size); +extern CONST char *PASCAL NEAR transbind(CONST char *skey); +extern char *PASCAL NEAR trimstr(char *s); +extern char *PASCAL NEAR xlat(char *source, char *lookup, char *trans); extern char *undolock(CONST char *fname); -extern char *regtostr(char *buf, REGION *region); +extern char *PASCAL NEAR regtostr(char *buf, REGION *region); #if UTF8 -extern unsigned int chcase(unsigned int ch); -extern unsigned int lowerc(unsigned int ch); -extern unsigned int upperc(unsigned int ch); -extern int setlower(char *ch, char *val); -extern int setupper(char *ch, char *val); +extern unsigned int PASCAL NEAR chcase(unsigned int ch); +extern unsigned int PASCAL NEAR lowerc(unsigned int ch); +extern unsigned int PASCAL NEAR upperc(unsigned int ch); #else -extern unsigned int chcase(register unsigned int ch); -extern VOID initchars(VOID); -extern int lowerc(char ch); -extern int upperc(char ch); +extern unsigned int PASCAL NEAR chcase(register unsigned int ch); +extern int PASCAL NEAR lowerc(char ch); +extern int PASCAL NEAR upperc(char ch); #endif -extern int setlower(char *ch, char *val); -extern int setupper(char *ch, char *val); -extern int cycle_ring(int f, int n); +extern int PASCAL NEAR cycle_ring(int f, int n); +extern int PASCAL NEAR setlower(char *ch, char *val); +extern int PASCAL NEAR setupper(char *ch, char *val); #if ZTC || TURBO || IC -extern int (*fncmatch(char *fname))(int, int); -extern int (*getname(CONST char *prompt))(int, int); +extern int (PASCAL NEAR *PASCAL NEAR fncmatch(char *fname))(int, int); +extern int (PASCAL NEAR *PASCAL NEAR getname(char *prompt))(int, int); #else /* Sun (and others?) screwed up the prototyping.*/ #if THEOSC extern int *fncmatch(char* fname); extern int *getname(CONST char* fname); #else -extern int (*fncmatch(char *fname))(VOID); -extern int (*getname(CONST char *prompt))(VOID); +extern int (PASCAL NEAR *PASCAL NEAR fncmatch(char *fname))(VOID); +extern int (PASCAL NEAR *PASCAL NEAR getname(CONST char *prompt))(VOID); #endif #endif -extern int asc_int(char *st); +extern int PASCAL NEAR asc_int(char *st); extern VOID dolhello(VOID); extern int dspram(VOID); extern VOID lckerror(char *errstr); @@ -200,436 +198,435 @@ extern int lockchk(CONST char *fname); extern int lockrel(VOID); extern VOID mousehello(VOID); extern int nocrypt(VOID); -extern int absv(int x); -extern int add_abbrev(int f, int n); -extern int del_abbrev(int f, int n); -extern int kill_abbrevs(int f, int n); -extern int ins_abbrevs(int f, int n); -extern int def_abbrevs(int f, int n); -extern int addline(BUFFER *bp, CONST char *text); -extern int backhunt(int f, int n); -extern int backsearch(int f, int n); -extern int bktoshell(int f, int n); -extern int boundry(LINE *curline, int curoff, int dir); -extern int checknext(int chr, int dir); -extern int clear_ring(int f, int n); -extern int delins(int dlength, char *instr, int use_rmc); -extern int desfunc(int f, int n); -extern int dispvar(int f, int n); -extern int ueechochar(unsigned char c); -extern int echostring(char *, int, int); -extern int eq(register unsigned char bc, register unsigned char pc); -#if UTF8 -extern int weq(unsigned int bc, unsigned int pc); -#endif -extern long ernd(VOID); -extern int execkey(KEYTAB *key, int f, int n); -extern int fbound(DELTA *tbl, int jump, LINE **pcurline, int *pcuroff, int dir); -extern int fexist(char *fname); -extern int findcol(LINE *lp, int pos); -extern int fisearch(int f, int n); +extern int PASCAL NEAR absv(int x); +extern int PASCAL NEAR add_abbrev(int f, int n); +extern int PASCAL NEAR del_abbrev(int f, int n); +extern int PASCAL NEAR kill_abbrevs(int f, int n); +extern int PASCAL NEAR ins_abbrevs(int f, int n); +extern int PASCAL NEAR def_abbrevs(int f, int n); +extern int PASCAL NEAR addline(BUFFER *bp, CONST char *text); +extern int PASCAL NEAR backhunt(int f, int n); +extern int PASCAL NEAR backsearch(int f, int n); +extern int PASCAL NEAR bktoshell(int f, int n); +extern int PASCAL NEAR boundry(LINE *curline, int curoff, int dir); +extern int PASCAL NEAR checknext(int chr, int dir); +extern int PASCAL NEAR clear_ring(int f, int n); +extern int PASCAL NEAR delins(int dlength, char *instr, int use_rmc); +extern int PASCAL NEAR desfunc(int f, int n); +extern int PASCAL NEAR dispvar(int f, int n); +extern int PASCAL NEAR ueechochar(unsigned char c); +extern int PASCAL NEAR echostring(char *, int, int); +extern int PASCAL NEAR eq(register unsigned char bc, register unsigned char pc); +extern long PASCAL NEAR ernd(VOID); +extern int PASCAL NEAR execkey(KEYTAB *key, int f, int n); +extern int PASCAL NEAR fbound(DELTA *tbl, int jump, LINE **pcurline, int *pcuroff, int dir); +extern int PASCAL NEAR fexist(char *fname); +extern int PASCAL NEAR findcol(LINE *lp, int pos); +extern int PASCAL NEAR fisearch(int f, int n); #if FLABEL -extern int fnclabel(int f, int n); +extern int PASCAL NEAR fnclabel(int f, int n); #endif -extern int forwhunt(int f, int n); -extern int forwsearch(int f, int n); -extern int getcwnum(VOID); -extern int getgoal(LINE *dlp); -extern int getstring(unsigned char *buf, int nbuf, int eolchar); -extern int gettwnum(VOID); -extern int gettyp(CONST char *token); -extern int getkey(VOID); -extern int getwpos(VOID); -extern int get_char(VOID); -extern int global_var(int f, int n); +extern int PASCAL NEAR forwhunt(int f, int n); +extern int PASCAL NEAR forwsearch(int f, int n); +extern int PASCAL NEAR getcwnum(VOID); +extern int PASCAL NEAR getgoal(LINE *dlp); +extern int PASCAL NEAR getstring(unsigned char *buf, int nbuf, int eolchar); +extern int PASCAL NEAR gettwnum(VOID); +extern int PASCAL NEAR gettyp(CONST char *token); +extern int PASCAL NEAR getkey(VOID); +extern int PASCAL NEAR getwpos(VOID); +extern int PASCAL NEAR get_char(VOID); +extern int PASCAL NEAR global_var(int f, int n); #if DBCS -extern int is2byte(char *sp, char *cp); +extern int PASCAL NEAR is2byte(char *sp, char *cp); #endif #if UTF8 -extern int is_letter(unsigned int ch); -extern int is_lower(unsigned int ch); -extern int is_upper(unsigned int ch); +extern int PASCAL NEAR weq(unsigned int bc, unsigned int pc); +extern int PASCAL NEAR is_letter(unsigned int ch); +extern int PASCAL NEAR is_lower(unsigned int ch); +extern int PASCAL NEAR is_upper(unsigned int ch); #else -extern int is_letter(char ch); -extern int is_lower(char ch); -extern int is_upper(char ch); +extern int PASCAL NEAR is_letter(char ch); +extern int PASCAL NEAR is_lower(char ch); +extern int PASCAL NEAR is_upper(char ch); #endif -extern int is_num(char *st); -extern int isearch(int dir); -extern int kinsert(int back, char c); -extern int ldelnewline(VOID); -extern int linstr(CONST char *instr); -extern int liteq(LINE **curline, int *curpos, int direct, char *lstring); -extern int lnewline(VOID); -extern int local_var(int f, int n); -extern int lookup_color(char *sp); -extern int lover(CONST char *ostr); -extern int mcstr(VOID); -extern int mlprompt(CONST char *, char *, int); -extern int movelocalpoint(int n, int *pcuroff, LINE **pcurline); -extern int nextch(LINE **pcurline, int *pcuroff, int dir); -extern int pop(BUFFER *popbuffer); -extern int qreplace(int f, int n); -extern int readpattern(CONST char *prompt, char apat[], int srch); +extern int PASCAL NEAR is_num(char *st); +extern int PASCAL NEAR isearch(int dir); +extern int PASCAL NEAR kinsert(int back, char c); +extern int PASCAL NEAR ldelnewline(VOID); +extern int PASCAL NEAR linstr(CONST char *instr); +extern int PASCAL NEAR liteq(LINE **curline, int *curpos, int direct, char *lstring); +extern int PASCAL NEAR lnewline(VOID); +extern int PASCAL NEAR local_var(int f, int n); +extern int PASCAL NEAR lookup_color(char *sp); +extern int PASCAL NEAR lover(CONST char *ostr); +extern int PASCAL NEAR mlprompt(CONST char *, char *, int); +extern int PASCAL NEAR movelocalpoint(int n, int *pcuroff, LINE **pcurline); +extern int PASCAL NEAR nextch(LINE **pcurline, int *pcuroff, int dir); +extern int PASCAL NEAR pop(BUFFER *popbuffer); +extern int PASCAL NEAR qreplace(int f, int n); +extern int PASCAL NEAR readpattern(CONST char *prompt, char apat[], int srch); #if WINDOW_TEXT -extern VOID refresh_screen(ESCREEN *sp); +extern VOID PASCAL NEAR refresh_screen(ESCREEN *sp); #endif -extern int reglines(VOID); -extern int rename_screen(int f, int n); -extern int replaces(int kind, int f, int n); -extern int risearch(int f, int n); -extern int rmcstr(VOID); -extern int savematch(VOID); -extern int scanmore(int dir); +extern int PASCAL NEAR reglines(VOID); +extern int PASCAL NEAR rename_screen(int f, int n); +extern int PASCAL NEAR replaces(int kind, int f, int n); +extern int PASCAL NEAR risearch(int f, int n); +extern int PASCAL NEAR rmcstr(VOID); +extern int PASCAL NEAR savematch(VOID); +extern int PASCAL NEAR scanmore(int dir); #if MAGIC == 0 -extern int scanner(int direct, int beg_or_end, int repeats); +extern int PASCAL NEAR scanner(int direct, int beg_or_end, int repeats); #else -extern int amatch(MC *mcptr, int direct, LINE **pcwline, int *pcwoff); -extern int biteq(int bc, EBITMAP cclmap); -extern int cclmake(char **ppatptr, MC *mcptr); -extern int litmake(char **ppatptr, MC *mcptr); -extern int mceq(unsigned char bc, MC *mt); -extern int mcscanner(MC *mcpatrn, int direct, int beg_or_end, int repeats); -extern VOID setbit(int bc, EBITMAP cclmap); +extern int PASCAL NEAR amatch(MC *mcptr, int direct, LINE **pcwline, int *pcwoff); +extern int PASCAL NEAR biteq(int bc, EBITMAP cclmap); +extern int PASCAL NEAR cclmake(char **ppatptr, MC *mcptr); +extern int PASCAL NEAR litmake(char **ppatptr, MC *mcptr); +extern VOID PASCAL NEAR mcclear(VOID); +extern int PASCAL NEAR mceq(unsigned char bc, MC *mt); +extern int PASCAL NEAR mcscanner(MC *mcpatrn, int direct, int beg_or_end, int repeats); +extern int PASCAL NEAR mcstr(VOID); +extern VOID PASCAL NEAR setbit(int bc, EBITMAP cclmap); #endif -extern int setvar(int f, int n); -extern int sindex(CONST char *source, CONST char *pattern); -extern int srindex(CONST char* source, CONST char* pattern); -extern int sreplace(int f, int n); -extern int stol(char *val); +extern int PASCAL NEAR setvar(int f, int n); +extern int PASCAL NEAR sindex(CONST char *source, CONST char *pattern); +extern int PASCAL NEAR srindex(CONST char* source, CONST char* pattern); +extern int PASCAL NEAR sreplace(int f, int n); +extern int PASCAL NEAR stol(char *val); #if DBCS -extern int stopback(VOID); -extern int stopforw(VOID); +extern int PASCAL NEAR stopback(VOID); +extern int PASCAL NEAR stopforw(VOID); #endif -extern int svar(VDESC *var, char *value); -extern int tgetc(VOID); -extern int uneat(VOID); -extern VOID unlist_screen(ESCREEN *sp); -extern int upscreen(int f, int n); -extern int vtinit(VOID); -extern int yank(int f, int n); -extern int yank_pop(int f, int n); +extern int PASCAL NEAR svar(VDESC *var, char *value); +extern int PASCAL NEAR tgetc(VOID); +extern int PASCAL NEAR uneat(VOID); +extern VOID PASCAL NEAR unlist_screen(ESCREEN *sp); +extern int PASCAL NEAR upscreen(int f, int n); +extern int PASCAL NEAR vtinit(VOID); +extern int PASCAL NEAR yank(int f, int n); +extern int PASCAL NEAR yank_pop(int f, int n); extern int Erelease(char *mp); extern int set_key(KEYTAB *key, char *name); extern int xunlock(char *fname); extern KEYTAB *getbind(int c); -extern LINE *lalloc(int used); -extern LINE *mouseline(EWINDOW *wp, int row); -extern long getlinenum(BUFFER *bp, LINE *sline); -extern int addkey(char * seq, int fn); -extern int addkeymap(int f, int n); -extern int adjustmode(int kind, int global); -extern int anycb(VOID); -extern int apro(int f, int n); -extern int backchar(int f, int n); -extern int backdel(int f, int n); -extern int backline(int f, int n); -extern int backpage(register int f, register int n); -extern int backword(int f, int n); -extern int bclear(BUFFER *bp); +extern LINE *PASCAL NEAR lalloc(int used); +extern LINE *PASCAL NEAR mouseline(EWINDOW *wp, int row); +extern long PASCAL NEAR getlinenum(BUFFER *bp, LINE *sline); +extern int PASCAL NEAR addkey(unsigned char * seq, int fn); +extern int PASCAL NEAR addkeymap(int f, int n); +extern int PASCAL NEAR adjustmode(int kind, int global); +extern int PASCAL NEAR anycb(VOID); +extern int PASCAL NEAR apro(int f, int n); +extern int PASCAL NEAR backchar(int f, int n); +extern int PASCAL NEAR backdel(int f, int n); +extern int PASCAL NEAR backline(int f, int n); +extern int PASCAL NEAR backpage(register int f, register int n); +extern int PASCAL NEAR backword(int f, int n); +extern int PASCAL NEAR bclear(BUFFER *bp); #if THEOSC extern int binary(); #else -extern int binary(CONST char *key, char *(*tval)(), int tlength, int klength); +extern int PASCAL NEAR binary(CONST char *key, char *(PASCAL NEAR *tval)(), int tlength, int klength); #endif -extern int bindtokey(int f, int n); -extern int buildlist(int type, char *mstring); -extern int capword(int f, int n); -extern int cex(int f, int n); -extern int cinsert(VOID); -extern int clean(VOID); -extern int clrmes(int f, int n); -extern int copyregion(int f, int n); -extern int ctlxe(int f, int n); -extern int ctlxlp(int f, int n); -extern int ctlxrp(int f, int n); -extern int ctoec(int c); -extern int ctrlg(int f, int n); -extern int cycle_screens(int f, int n); -extern VOID dcline(int argc, char *argv[], int firstflag); -extern int deblank(int f, int n); -extern int debug(BUFFER *bp, char *eline, int *skipflag); -extern int delbword(int f, int n); -extern int delete_screen(int f, int n); -extern int delfword(int f, int n); -extern int delgmode(int f, int n); -extern int delmode(int f, int n); -extern int delwind(int f, int n); -extern int desc_abbrevs(int f, int n); -extern int desbind(int f, int n); -extern int deskey(int f, int n); -extern int desvars(int f, int n); -extern int detab(int f, int n); -extern int dobuf(BUFFER *bp); -extern int docmd(char *cline); -extern int dofile(CONST char *fname); -extern int ectoc(int c); -extern int edinit(char bname[]); -extern int editloop(VOID); -extern int endword(int f, int n); -extern int enlargewind(int f, int n); -extern int entab(int f, int n); -extern int execbuf(int f, int n); -extern int execcmd(int f, int n); -extern int execfile(int f, int n); -extern int execprg(int f, int n); -extern int execproc(int f, int n); -extern int execute(int c, int f, int n); -extern int ffclose(VOID); -extern int ffgetline(int *nbytes); -extern int ffputline(char buf[], int nbuf); -extern int ffropen(CONST char *fn); -extern int ffwopen(CONST char *fn, CONST char *mode); -extern int fileapp(int f, int n); -extern int find_screen(int f, int n); -extern int filefind(int f, int n); -extern int filename(int f, int n); -extern int fileread(int f, int n); -extern int filesave(int f, int n); -extern int filewrite(int f, int n); -extern int fillpara(int f, int n); -extern int uefilter(int f, int n); -extern VOID findvar(char *var, VDESC *vd, int size, int scope); -extern int fmatch(char ch); -extern int forwchar(int f, int n); -extern int forwdel(int f, int n); -extern int forwline(int f, int n); -extern int forwpage(int f, int n); -extern int forwword(int f, int n); -extern int getccol(int bflg); -extern int getcmd(VOID); -extern int getfence(int f, int n); -extern int getfile(char fname[], int lockfl); -extern int get_key(VOID); -extern int getregion(REGION *rp); -extern int gotobob(int f, int n); -extern int gotobol(int f, int n); -extern int gotobop(int f, int n); -extern int gotoeob(int f, int n); -extern int gotoeol(int f, int n); -extern int gotoeop(int f, int n); -extern int gotoline(int f, int n); -extern int gotomark(int f, int n); -extern int help(int f, int n); -extern int ifile(char fname[]); -extern int indent(int f, int n); -extern int indent_region(int f, int n); -extern int insbrace(int n, int c); -extern int insfile(int f, int n); -extern int inspound(VOID); -extern int insspace(int f, int n); -extern int inword(VOID); +extern int PASCAL NEAR bindtokey(int f, int n); +extern int PASCAL NEAR buildlist(int type, char *mstring); +extern int PASCAL NEAR capword(int f, int n); +extern int PASCAL NEAR cex(int f, int n); +extern int PASCAL NEAR cinsert(VOID); +extern int PASCAL NEAR clean(VOID); +extern int PASCAL NEAR clrmes(int f, int n); +extern int PASCAL NEAR copyregion(int f, int n); +extern int PASCAL NEAR ctlxe(int f, int n); +extern int PASCAL NEAR ctlxlp(int f, int n); +extern int PASCAL NEAR ctlxrp(int f, int n); +extern int PASCAL NEAR ctoec(int c); +extern int PASCAL NEAR ctrlg(int f, int n); +extern int PASCAL NEAR cycle_screens(int f, int n); +extern VOID PASCAL NEAR dcline(int argc, char *argv[], int firstflag); +extern int PASCAL NEAR deblank(int f, int n); +extern int PASCAL NEAR debug(BUFFER *bp, char *eline, int *skipflag); +extern int PASCAL NEAR delbword(int f, int n); +extern int PASCAL NEAR delete_screen(int f, int n); +extern int PASCAL NEAR delfword(int f, int n); +extern int PASCAL NEAR delgmode(int f, int n); +extern int PASCAL NEAR delmode(int f, int n); +extern int PASCAL NEAR delwind(int f, int n); +extern int PASCAL NEAR desc_abbrevs(int f, int n); +extern int PASCAL NEAR desbind(int f, int n); +extern int PASCAL NEAR deskey(int f, int n); +extern int PASCAL NEAR desvars(int f, int n); +extern int PASCAL NEAR detab(int f, int n); +extern int PASCAL NEAR dobuf(BUFFER *bp); +extern int PASCAL NEAR docmd(char *cline); +extern int PASCAL NEAR dofile(CONST char *fname); +extern int PASCAL NEAR ectoc(int c); +extern int PASCAL NEAR edinit(char bname[]); +extern int PASCAL NEAR editloop(VOID); +extern int PASCAL NEAR endword(int f, int n); +extern int PASCAL NEAR enlargewind(int f, int n); +extern int PASCAL NEAR entab(int f, int n); +extern int PASCAL NEAR execbuf(int f, int n); +extern int PASCAL NEAR execcmd(int f, int n); +extern int PASCAL NEAR execfile(int f, int n); +extern int PASCAL NEAR execprg(int f, int n); +extern int PASCAL NEAR execproc(int f, int n); +extern int PASCAL NEAR execute(int c, int f, int n); +extern int PASCAL NEAR ffclose(VOID); +extern int PASCAL NEAR ffgetline(int *nbytes); +extern int PASCAL NEAR ffputline(char buf[], int nbuf); +extern int PASCAL NEAR ffropen(CONST char *fn); +extern int PASCAL NEAR ffwopen(CONST char *fn, CONST char *mode); +extern int PASCAL NEAR fileapp(int f, int n); +extern int PASCAL NEAR find_screen(int f, int n); +extern int PASCAL NEAR filefind(int f, int n); +extern int PASCAL NEAR filename(int f, int n); +extern int PASCAL NEAR fileread(int f, int n); +extern int PASCAL NEAR filesave(int f, int n); +extern int PASCAL NEAR filewrite(int f, int n); +extern int PASCAL NEAR fillpara(int f, int n); +extern int PASCAL NEAR uefilter(int f, int n); +extern VOID PASCAL NEAR findvar(char *var, VDESC *vd, int size, int scope); +extern int PASCAL NEAR fmatch(char ch); +extern int PASCAL NEAR forwchar(int f, int n); +extern int PASCAL NEAR forwdel(int f, int n); +extern int PASCAL NEAR forwline(int f, int n); +extern int PASCAL NEAR forwpage(int f, int n); +extern int PASCAL NEAR forwword(int f, int n); +extern int PASCAL NEAR getccol(int bflg); +extern int PASCAL NEAR getcmd(VOID); +extern int PASCAL NEAR getfence(int f, int n); +extern int PASCAL NEAR getfile(char fname[], int lockfl); +extern int PASCAL NEAR get_key(VOID); +extern int PASCAL NEAR getregion(REGION *rp); +extern int PASCAL NEAR gotobob(int f, int n); +extern int PASCAL NEAR gotobol(int f, int n); +extern int PASCAL NEAR gotobop(int f, int n); +extern int PASCAL NEAR gotoeob(int f, int n); +extern int PASCAL NEAR gotoeol(int f, int n); +extern int PASCAL NEAR gotoeop(int f, int n); +extern int PASCAL NEAR gotoline(int f, int n); +extern int PASCAL NEAR gotomark(int f, int n); +extern int PASCAL NEAR help(int f, int n); +extern int PASCAL NEAR ifile(char fname[]); +extern int PASCAL NEAR indent(int f, int n); +extern int PASCAL NEAR indent_region(int f, int n); +extern int PASCAL NEAR insbrace(int n, int c); +extern int PASCAL NEAR insfile(int f, int n); +extern int PASCAL NEAR inspound(VOID); +extern int PASCAL NEAR insspace(int f, int n); +extern int PASCAL NEAR inword(VOID); #if UTF8 -extern int isinword(unsigned int c); +extern int PASCAL NEAR isinword(unsigned int c); #else -extern int isinword(char c); +extern int PASCAL NEAR isinword(char c); #endif -extern int ismodeline(EWINDOW *wp, int row); -extern int istring(int f, int n); -extern int killbuffer(int f, int n); -extern int killpara(int f, int n); -extern int killregion(int f, int n); -extern int killtext(int f, int n); -extern VOID lchange(register int flag); -extern int ldelete(long n, int kflag); -extern VOID lfree(LINE *lp); +extern int PASCAL NEAR ismodeline(EWINDOW *wp, int row); +extern int PASCAL NEAR istring(int f, int n); +extern int PASCAL NEAR killbuffer(int f, int n); +extern int PASCAL NEAR killpara(int f, int n); +extern int PASCAL NEAR killregion(int f, int n); +extern int PASCAL NEAR killtext(int f, int n); +extern VOID PASCAL NEAR lchange(register int flag); +extern int PASCAL NEAR ldelete(long n, int kflag); +extern VOID PASCAL NEAR lfree(LINE *lp); #if UTF8 -extern int ldelchar(long n, int kflag); -extern int linsert(int n, unsigned int c); +extern int PASCAL NEAR ldelchar(long n, int kflag); +extern int PASCAL NEAR linsert(int n, unsigned int c); #else -extern int linsert(int n, char c); +extern int PASCAL NEAR linsert(int n, char c); #endif -extern int listbuffers(int f, int n); -extern int list_screens(int f, int n); -extern int lowerregion(int f, int n); -extern int lowerword(int f, int n); +extern int PASCAL NEAR listbuffers(int f, int n); +extern int PASCAL NEAR list_screens(int f, int n); +extern int PASCAL NEAR lowerregion(int f, int n); +extern int PASCAL NEAR lowerword(int f, int n); #if UTF8 -extern int lowrite(unsigned int c); +extern int PASCAL NEAR lowrite(unsigned int c); #else -extern int lowrite(int c); +extern int PASCAL NEAR lowrite(int c); #endif -extern int macarg(char *tok); -extern int macrotokey(int f, int n); -extern int makelist(int iflag); -extern int movelocalpoint(); -extern int undolist(); -extern VOID mouse_screen(VOID); -extern int screenlist(int iflag); -extern int meexit(int status); -extern int uemeta(int f, int n); -extern int mlreply(CONST char *prompt, char *buf, int nbuf); -extern int mlyesno(CONST char *prompt); -extern int mouseoffset(EWINDOW *wp, LINE *lp, int col); -extern int movemd(int f, int n); -extern int movemu(int f, int n); -extern int mregdown(int f, int n); -extern int mmove(int f, int n); -extern int mregup(int f, int n); -extern int mvdnwind(int f, int n); -extern int mvupwind(int f, int n); -extern int namebuffer(int f, int n); -extern int namedcmd(int f, int n); -extern int narrow(int f, int n); -extern int new_line(int f, int n); -extern int new_col_org(int f, int n); -extern int new_row_org(int f, int n); -extern int newsize(int f, int n); -extern int newwidth(int f, int n); -extern int nextarg(CONST char *prompt, char *buffer, int size, int terminator); -extern int nextbuffer(int f, int n); -extern int nextdown(int f, int n); -extern int nextup(int f, int n); -extern int nextwind(int f, int n); -extern int nullproc(int f, int n); -extern int onlywind(int f, int n); -extern int openline(int f, int n); -extern VOID ostring(CONST char *s); -extern VOID outstring(CONST char *s); -extern int ovstring(int f, int n); -extern int pipecmd(int f, int n); -extern int popbuffer(int f, int n); -extern int prevwind(int f, int n); -extern int putctext(char *iline); -extern int putline(int row, int col, char buf[]); -extern int quickexit(int f, int n); -extern int quit(int f, int n); -extern int quote(int f, int n); -extern int rdonly(VOID); -extern int readin(CONST char *fname, int lockfl); -extern int uerefresh(int f, int n); -extern int remmark(int f, int n); -extern int reposition(int f, int n); -extern int resetkey(VOID); -extern int resize(int f, int n); -extern int resizm(int f, int n); -extern int resizm2(int f, int n); -extern int resterr(VOID); -extern int restwnd(int f, int n); -extern int savewnd(int f, int n); -extern int scwrite(int row, char *outstr, int forg, int bacg, +extern int PASCAL NEAR macarg(char *tok); +extern int PASCAL NEAR macrotokey(int f, int n); +extern int PASCAL NEAR makelist(int iflag); +extern int PASCAL NEAR movelocalpoint(); +extern int PASCAL NEAR undolist(); +extern VOID PASCAL NEAR mouse_screen(VOID); +extern int PASCAL NEAR screenlist(int iflag); +extern int PASCAL NEAR meexit(int status); +extern int PASCAL NEAR uemeta(int f, int n); +extern int PASCAL NEAR mlreply(CONST char *prompt, char *buf, int nbuf); +extern int PASCAL NEAR mlyesno(CONST char *prompt); +extern int PASCAL NEAR mouseoffset(EWINDOW *wp, LINE *lp, int col); +extern int PASCAL NEAR movemd(int f, int n); +extern int PASCAL NEAR movemu(int f, int n); +extern int PASCAL NEAR mregdown(int f, int n); +extern int PASCAL NEAR mmove(int f, int n); +extern int PASCAL NEAR mregup(int f, int n); +extern int PASCAL NEAR mvdnwind(int f, int n); +extern int PASCAL NEAR mvupwind(int f, int n); +extern int PASCAL NEAR namebuffer(int f, int n); +extern int PASCAL NEAR namedcmd(int f, int n); +extern int PASCAL NEAR narrow(int f, int n); +extern int PASCAL NEAR uenewline(int f, int n); +extern int PASCAL NEAR new_col_org(int f, int n); +extern int PASCAL NEAR new_row_org(int f, int n); +extern int PASCAL NEAR newsize(int f, int n); +extern int PASCAL NEAR newwidth(int f, int n); +extern int PASCAL NEAR nextarg(CONST char *prompt, char *buffer, int size, int terminator); +extern int PASCAL NEAR nextbuffer(int f, int n); +extern int PASCAL NEAR nextdown(int f, int n); +extern int PASCAL NEAR nextup(int f, int n); +extern int PASCAL NEAR nextwind(int f, int n); +extern int PASCAL NEAR nullproc(int f, int n); +extern int PASCAL NEAR onlywind(int f, int n); +extern int PASCAL NEAR openline(int f, int n); +extern VOID PASCAL NEAR ostring(CONST char *s); +extern VOID PASCAL NEAR outstring(CONST char *s); +extern int PASCAL NEAR ovstring(int f, int n); +extern int PASCAL NEAR pipecmd(int f, int n); +extern int PASCAL NEAR popbuffer(int f, int n); +extern int PASCAL NEAR prevwind(int f, int n); +extern int PASCAL NEAR putctext(char *iline); +extern int PASCAL NEAR putline(int row, int col, char buf[]); +extern int PASCAL NEAR quickexit(int f, int n); +extern int PASCAL NEAR quit(int f, int n); +extern int PASCAL NEAR quote(int f, int n); +extern int PASCAL NEAR rdonly(VOID); +extern int PASCAL NEAR readin(CONST char *fname, int lockfl); +extern int PASCAL NEAR uerefresh(int f, int n); +extern int PASCAL NEAR remmark(int f, int n); +extern int PASCAL NEAR reposition(int f, int n); +extern int PASCAL NEAR resetkey(VOID); +extern int PASCAL NEAR resize(int f, int n); +extern int PASCAL NEAR resizm(int f, int n); +extern int PASCAL NEAR resizm2(int f, int n); +extern int PASCAL NEAR resterr(VOID); +extern int PASCAL NEAR restwnd(int f, int n); +extern int PASCAL NEAR savewnd(int f, int n); +extern int PASCAL NEAR scwrite(int row, char *outstr, int forg, int bacg, int revleft, int revright); -extern int setccol(int pos); -extern int setekey(int f, int n); -extern int setfillcol(int f, int n); -extern int setgmode(int f, int n); -extern int setmark(int f, int n); -extern int setmod(int f, int n); -extern int setwlist(char *wclist); -extern int shellprog(char *cmd); -extern int showcpos(int f, int n); -extern int showfiles(int f, int n); -extern int listkeymaps(int f, int n); -extern int shrinkwind(int f, int n); -extern int spal(char *pstr); -extern int spawn(int f, int n); -extern int spawncli(int f, int n); -extern int splitwind(int f, int n); -extern int startup(char *sfname); -extern int storeproc(int f, int n); -extern int strinc(char *source, char *sub); -extern int swapmark(int f, int n); -extern int swbuffer(BUFFER *bp); -extern int uetab(int f, int n); -extern int trim(int f, int n); -extern int ttclose(VOID); -extern int ttflush(VOID); -extern int ttgetc(VOID); -extern int ttopen(VOID); -extern int ttputc(int c); -extern int twiddle(int f, int n); -extern int typahead(VOID); -extern int unarg(VOID); -extern int unbindchar(int c); -extern int unbindkey(int f, int n); -extern int undent_region(int f, int n); -extern int unmark(int f, int n); -extern int upperregion(int f, int n); -extern int upperword(int f, int n); -extern int usebuffer(int f, int n); -extern int viewfile(int f, int n); -extern VOID vteeol(VOID); -extern VOID vtmove(int row, int col); -extern VOID vtputc(int c); -extern VOID vttidy(VOID); -extern int widen(int f, int n); -extern int wordcount(int f, int n); -extern int wrapword(int f, int n); -extern int writemsg(int f, int n); -extern int writeout(char *fn, char *mode); -extern int zotbuf(BUFFER *bp); -extern unsigned int getckey(int mflag); -extern unsigned int stock(unsigned char *keyname); +extern int PASCAL NEAR setccol(int pos); +extern int PASCAL NEAR setekey(int f, int n); +extern int PASCAL NEAR setfillcol(int f, int n); +extern int PASCAL NEAR setgmode(int f, int n); +extern int PASCAL NEAR setmark(int f, int n); +extern int PASCAL NEAR setmod(int f, int n); +extern int PASCAL NEAR setwlist(char *wclist); +extern int PASCAL NEAR shellprog(char *cmd); +extern int PASCAL NEAR showcpos(int f, int n); +extern int PASCAL NEAR showfiles(int f, int n); +extern int PASCAL NEAR listkeymaps(int f, int n); +extern int PASCAL NEAR shrinkwind(int f, int n); +extern int PASCAL NEAR spal(char *pstr); +extern int PASCAL NEAR spawn(int f, int n); +extern int PASCAL NEAR spawncli(int f, int n); +extern int PASCAL NEAR splitwind(int f, int n); +extern int PASCAL NEAR startup(char *sfname); +extern int PASCAL NEAR storeproc(int f, int n); +extern int PASCAL NEAR strinc(char *source, char *sub); +extern int PASCAL NEAR swapmark(int f, int n); +extern int PASCAL NEAR swbuffer(BUFFER *bp); +extern int PASCAL NEAR uetab(int f, int n); +extern int PASCAL NEAR trim(int f, int n); +extern int PASCAL NEAR ttclose(VOID); +extern int PASCAL NEAR ttflush(VOID); +extern int PASCAL NEAR ttgetc(VOID); +extern int PASCAL NEAR ttopen(VOID); +extern int PASCAL NEAR ttputc(int c); +extern int PASCAL NEAR twiddle(int f, int n); +extern int PASCAL NEAR typahead(VOID); +extern int PASCAL NEAR unarg(VOID); +extern int PASCAL NEAR unbindchar(int c); +extern int PASCAL NEAR unbindkey(int f, int n); +extern int PASCAL NEAR undent_region(int f, int n); +extern int PASCAL NEAR unmark(int f, int n); +extern int PASCAL NEAR upperregion(int f, int n); +extern int PASCAL NEAR upperword(int f, int n); +extern int PASCAL NEAR usebuffer(int f, int n); +extern int PASCAL NEAR viewfile(int f, int n); +extern VOID PASCAL NEAR vteeol(VOID); +extern VOID PASCAL NEAR vtmove(int row, int col); +extern VOID PASCAL NEAR vtputc(int c); +extern VOID PASCAL NEAR vttidy(VOID); +extern int PASCAL NEAR widen(int f, int n); +extern int PASCAL NEAR wordcount(int f, int n); +extern int PASCAL NEAR wrapword(int f, int n); +extern int PASCAL NEAR writemsg(int f, int n); +extern int PASCAL NEAR writeout(char *fn, char *mode); +extern int PASCAL NEAR zotbuf(BUFFER *bp); +extern unsigned int PASCAL NEAR getckey(int mflag); +extern unsigned int PASCAL NEAR stock(unsigned char *keyname); #if VARARG && VARG #if GCC -extern VOID CDECL mlwrite(va_alist); +extern VOID CDECL NEAR mlwrite(va_alist); #else -extern VOID CDECL mlwrite(va_dcl); +extern VOID CDECL NEAR mlwrite(va_dcl); #endif /* GCC */ #else -extern VOID CDECL mlwrite(CONST char *fmt, ...); +extern VOID CDECL NEAR mlwrite(CONST char *fmt, ...); #endif -extern VOID ab_init(VOID); -extern VOID ab_save(char c); -extern VOID ab_expand(VOID); -extern VOID clist_buffer(char *name, int *cpos); -extern VOID clist_command(char *name, int *cpos); -extern VOID clist_file(char *name, int *cpos); -extern VOID comp_buffer(char *name, int *cpos); -extern VOID comp_command(char *name, int *cpos); +extern VOID PASCAL NEAR ab_init(VOID); +extern VOID PASCAL NEAR ab_save(char c); +extern VOID PASCAL NEAR ab_expand(VOID); +extern VOID PASCAL NEAR clist_buffer(char *name, int *cpos); +extern VOID PASCAL NEAR clist_command(char *name, int *cpos); +extern VOID PASCAL NEAR clist_file(char *name, int *cpos); +extern VOID PASCAL NEAR comp_buffer(char *name, int *cpos); +extern VOID PASCAL NEAR comp_command(char *name, int *cpos); #if !WINDOW_MSWIN -extern VOID comp_file(char *name, int *cpos); +extern VOID PASCAL NEAR comp_file(char *name, int *cpos); #endif -extern VOID ecrypt(char *bptr, unsigned len); -extern VOID errormesg(CONST char *mesg, BUFFER *bp, LINE *lp); -extern VOID flong_asc(char buf[], int width, long num); -extern VOID freewhile(WHBLOCK *wp); -extern VOID getdtime(char *ts); -extern VOID kdelete(VOID); -extern int lowercase(unsigned char *cp); -extern VOID mcclear(VOID); -extern VOID mlabort(CONST char *s); -extern VOID mlerase(VOID); -extern VOID mlferase(VOID); -extern VOID mlforce(CONST char *s); -extern VOID mlout(int c); -extern VOID mlputf(int s); -extern VOID mlputi(int i, int r); -extern VOID mlputli(long l, int r); -extern VOID mlputs(CONST char *s); -extern VOID mlrquery(VOID); -extern VOID modeline(EWINDOW *wp); -extern VOID movecursor(int row, int col); -extern VOID next_kill(VOID); -extern VOID pad(char *s, int len); -extern VOID reeat(int c); -extern VOID reframe(EWINDOW *wp); -extern VOID reform(char *para); -extern VOID rmcclear(VOID); -extern VOID setjtable(VOID); -extern VOID unbind_buf(BUFFER *bp); -extern VOID unqname(char *name); -extern VOID updall(EWINDOW *wp); -extern VOID update(int force); -extern VOID update_size(VOID); -extern VOID upddex(VOID); -extern VOID updext(VOID); -extern VOID updgar(VOID); -extern VOID updone(EWINDOW *wp); -extern VOID updpos(VOID); -extern VOID updupd(int force); -extern VOID upmode(VOID); +extern VOID PASCAL NEAR ecrypt(char *bptr, unsigned len); +extern VOID PASCAL NEAR errormesg(CONST char *mesg, BUFFER *bp, LINE *lp); +extern VOID PASCAL NEAR flong_asc(char buf[], int width, long num); +extern VOID PASCAL NEAR freewhile(WHBLOCK *wp); +extern VOID PASCAL NEAR getdtime(char *ts); +extern VOID PASCAL NEAR initchars(VOID); +extern VOID PASCAL NEAR kdelete(VOID); +extern int PASCAL NEAR lowercase(unsigned char *cp); +extern VOID PASCAL NEAR mlabort(CONST char *s); +extern VOID PASCAL NEAR mlerase(VOID); +extern VOID PASCAL NEAR mlferase(VOID); +extern VOID PASCAL NEAR mlforce(CONST char *s); +extern VOID PASCAL NEAR mlout(int c); +extern VOID PASCAL NEAR mlputf(int s); +extern VOID PASCAL NEAR mlputi(int i, int r); +extern VOID PASCAL NEAR mlputli(long l, int r); +extern VOID PASCAL NEAR mlputs(CONST char *s); +extern VOID PASCAL NEAR mlrquery(VOID); +extern VOID PASCAL NEAR modeline(EWINDOW *wp); +extern VOID PASCAL NEAR movecursor(int row, int col); +extern VOID PASCAL NEAR next_kill(VOID); +extern VOID PASCAL NEAR pad(char *s, int len); +extern VOID PASCAL NEAR reeat(int c); +extern VOID PASCAL NEAR reframe(EWINDOW *wp); +extern VOID PASCAL NEAR reform(char *para); +extern VOID PASCAL NEAR rmcclear(VOID); +extern VOID PASCAL NEAR setjtable(VOID); +extern VOID PASCAL NEAR unbind_buf(BUFFER *bp); +extern VOID PASCAL NEAR unqname(char *name); +extern VOID PASCAL NEAR updall(EWINDOW *wp); +extern VOID PASCAL NEAR update(int force); +extern VOID PASCAL NEAR update_size(VOID); +extern VOID PASCAL NEAR upddex(VOID); +extern VOID PASCAL NEAR updext(VOID); +extern VOID PASCAL NEAR updgar(VOID); +extern VOID PASCAL NEAR updone(EWINDOW *wp); +extern VOID PASCAL NEAR updpos(VOID); +extern VOID PASCAL NEAR updupd(int force); +extern VOID PASCAL NEAR upmode(VOID); extern int uppercase(unsigned char *cp); -extern VOID upwind(VOID); -extern VOID varinit(VOID); -extern VOID varclean(UTABLE *ut); -extern VOID uv_init(UTABLE *ut); -extern VOID uv_clean(UTABLE *ut); -extern VOID vtfree(VOID); +extern VOID PASCAL NEAR upwind(VOID); +extern VOID PASCAL NEAR varinit(VOID); +extern VOID PASCAL NEAR varclean(UTABLE *ut); +extern VOID PASCAL NEAR uv_init(UTABLE *ut); +extern VOID PASCAL NEAR uv_clean(UTABLE *ut); +extern VOID PASCAL NEAR vtfree(VOID); extern VOID cook(VOID); extern VOID qin(int ch); extern VOID qrep(int ch); -extern EWINDOW *mousewindow(int row); -extern int wpopup(BUFFER *popbuf); +extern EWINDOW *PASCAL NEAR mousewindow(int row); +extern int PASCAL NEAR wpopup(BUFFER *popbuf); #if LIBHELP extern int lookupword(int f, int n); /* Lookup a word... */ @@ -642,9 +639,9 @@ extern VOID initlook(char* lf); #endif #if CTAGS -extern int tagword(int f, int n); /* vi-like tagging */ -extern int retagword(int f, int n); /* Try again (if redefined) */ -extern int backtagword(int f, int n); /* return from tagged word */ +extern int PASCAL NEAR tagword(int f, int n); /* vi-like tagging */ +extern int PASCAL NEAR retagword(int f, int n); /* Try again (if redefined) */ +extern int PASCAL NEAR backtagword(int f, int n); /* return from tagged word */ #endif #if DYNMSGS @@ -706,9 +703,9 @@ extern VOID winch_new_size(); #endif #if DEBUG_SEARCH -int mc_list(); -int rmc_list(); -VOID mctype_cat(); +int PASCAL NEAR mc_list(); +int PASCAL NEAR rmc_list(); +VOID PASCAL NEAR mctype_cat(); #endif @@ -716,78 +713,75 @@ extern VOID undo_insert(); extern int undo_op(); extern VOID undo_dump(); extern VOID undo_zot(); -extern int undo(); -extern int undo_delete(); -extern int undo_list(); +extern int PASCAL NEAR undo(); +extern int PASCAL NEAR undo_delete(); +extern int PASCAL NEAR undo_list(); extern VOID *room(); extern VOID *reroom(); -extern int ab_insert(); -extern char *ab_lookup(); -extern int ab_delete(); -extern int ab_clean(); -extern BUFFER *bfind(); -extern BUFFER *getcbuf(); -extern BUFFER *getdefb(); -extern BUFFER *getoldb(); -extern ESCREEN *init_screen(); -extern ESCREEN *lookup_screen(); -extern ESCREEN *index_screen(); -extern int screen_index(); -extern int insert_screen(); -extern int select_screen(); -extern VOID free_screen(); +extern int PASCAL NEAR ab_insert(); +extern char *PASCAL NEAR ab_lookup(); +extern int PASCAL NEAR ab_delete(); +extern int PASCAL NEAR ab_clean(); +extern BUFFER *PASCAL NEAR bfind(); +extern BUFFER *PASCAL NEAR getcbuf(); +extern BUFFER *PASCAL NEAR getdefb(); +extern BUFFER *PASCAL NEAR getoldb(); +extern ESCREEN *PASCAL NEAR init_screen(); +extern ESCREEN *PASCAL NEAR lookup_screen(); +extern ESCREEN *PASCAL NEAR index_screen(); +extern int PASCAL NEAR screen_index(); +extern int PASCAL NEAR insert_screen(); +extern int PASCAL NEAR select_screen(); +extern int PASCAL NEAR free_screen(); extern char *Eallocate(); extern char *dolock(); extern char *getpath(); extern char *gtname(); -extern char *bytecopy(); -extern char *cmdstr(); -extern char *copystr(); -extern char *complete(); -extern char *envval(); -extern CONST char *fixnull(); -extern char *flook(); -extern char *funval(); -extern char *getctext(); -extern char *getffile(); -extern CONST char *getfname(); -extern char *getkill(); -extern char *getnfile(); -extern char *getreg(); -extern CONST char *getval(); -extern char *getwlist(); -extern CONST char *gtenv(); -extern char *gtfilename(); -extern CONST char *gtfun(); -extern char *gtusr(); -extern char *int_asc(); -extern char *long_asc(); -extern CONST char *ltos(); -extern char *makename(); -extern char *mklower(); -extern char *mkupper(); -extern char *namval(); -extern char *timeset(); -extern char *token(); -extern char *transbind(); -extern char *trimstr(); -extern char *xlat(); +extern char *PASCAL NEAR bytecopy(); +extern char *PASCAL NEAR cmdstr(); +extern char *PASCAL NEAR copystr(); +extern char *PASCAL NEAR complete(); +extern char *PASCAL NEAR envval(); +extern char *PASCAL NEAR fixnull(); +extern char *PASCAL NEAR flook(); +extern char *PASCAL NEAR funval(); +extern char *PASCAL NEAR getctext(); +extern char *PASCAL NEAR getffile(); +extern char *PASCAL NEAR getfname(); +extern char *PASCAL NEAR getkill(); +extern char *PASCAL NEAR getnfile(); +extern char *PASCAL NEAR getreg(); +extern char *PASCAL NEAR getval(); +extern char *PASCAL NEAR getwlist(); +extern char *PASCAL NEAR gtenv(); +extern char *PASCAL NEAR gtfilename(); +extern char *PASCAL NEAR gtfun(); +extern char *PASCAL NEAR gtusr(); +extern char *PASCAL NEAR int_asc(); +extern char *PASCAL NEAR long_asc(); +extern char *PASCAL NEAR ltos(); +extern char *PASCAL NEAR makename(); +extern char *PASCAL NEAR mklower(); +extern char *PASCAL NEAR mkupper(); +extern char *PASCAL NEAR namval(); +extern char *PASCAL NEAR timeset(); +extern char *PASCAL NEAR token(); +extern char *PASCAL NEAR transbind(); +extern char *PASCAL NEAR trimstr(); +extern char *PASCAL NEAR xlat(); extern char *undolock(); -extern char *regtostr(); -extern VOID initchars(); -extern int lowerc(); -extern int upperc(); -extern int setlower(); -extern int setupper(); +extern char *PASCAL NEAR regtostr(); +extern int PASCAL NEAR lowerc(); +extern int PASCAL NEAR upperc(); #if THEOSC extern int* fncmatch(); extern int* getname(); #else -extern int (*fncmatch())(); -extern int (*getname())(); +extern int (PASCAL NEAR *PASCAL NEAR fncmatch())(); +extern int (PASCAL NEAR *PASCAL NEAR getname())(); #endif -extern int asc_int(); +extern int PASCAL NEAR asc_int(); extern VOID dolhello(); extern int dspram(); extern VOID lckerror(); @@ -797,401 +791,404 @@ extern int lockchk(); extern int lockrel(); extern VOID mousehello(); extern int nocrypt(); -extern int absv(); -extern int add_abbrev(); -extern int del_abbrev(); -extern int kill_abbrevs(); -extern int ins_abbrevs(); -extern int def_abbrevs(); -extern int addkey(); -extern int addkeymap(); -extern int addline(); -extern int amatch(); -extern int backhunt(); -extern int backsearch(); -extern int biteq(); -extern int bktoshell(); -extern int boundry(); -extern int cclmake(); -extern int checknext(); -extern int clear_ring(); -extern int cycle_ring(); -extern int delins(); -extern int desfunc(); -extern int dispvar(); -extern int ueechochar(); -extern int echostring(); -extern int eq(); -extern long ernd(); -extern int execkey(); -extern int fbound(); -extern int fexist(); -extern int findcol(); -extern int fisearch(); +extern int PASCAL NEAR absv(); +extern int PASCAL NEAR add_abbrev(); +extern int PASCAL NEAR del_abbrev(); +extern int PASCAL NEAR kill_abbrevs(); +extern int PASCAL NEAR ins_abbrevs(); +extern int PASCAL NEAR def_abbrevs(); +extern int PASCAL NEAR addkey(); +extern int PASCAL NEAR addkeymap(); +extern int PASCAL NEAR addline(); +extern int PASCAL NEAR amatch(); +extern int PASCAL NEAR backhunt(); +extern int PASCAL NEAR backsearch(); +extern int PASCAL NEAR biteq(); +extern int PASCAL NEAR bktoshell(); +extern int PASCAL NEAR boundry(); +extern int PASCAL NEAR cclmake(); +extern int PASCAL NEAR checknext(); +extern int PASCAL NEAR clear_ring(); +extern int PASCAL NEAR cycle_ring(); +extern int PASCAL NEAR delins(); +extern int PASCAL NEAR desfunc(); +extern int PASCAL NEAR dispvar(); +extern int PASCAL NEAR ueechochar(); +extern int PASCAL NEAR echostring(); +extern int PASCAL NEAR eq(); +extern long PASCAL NEAR ernd(); +extern int PASCAL NEAR execkey(); +extern int PASCAL NEAR fbound(); +extern int PASCAL NEAR fexist(); +extern int PASCAL NEAR findcol(); +extern int PASCAL NEAR fisearch(); #if FLABEL -extern int fnclabel(); +extern int PASCAL NEAR fnclabel(); #endif -extern int forwhunt(); -extern int forwsearch(); -extern int getcwnum(); -extern int getgoal(); -extern int getstring(); -extern int gettwnum(); -extern int gettyp(); -extern int getkey(); -extern int getwpos(); -extern int get_char(); -extern int global_var(); +extern int PASCAL NEAR forwhunt(); +extern int PASCAL NEAR forwsearch(); +extern int PASCAL NEAR getcwnum(); +extern int PASCAL NEAR getgoal(); +extern int PASCAL NEAR getstring(); +extern int PASCAL NEAR gettwnum(); +extern int PASCAL NEAR gettyp(); +extern int PASCAL NEAR getkey(); +extern int PASCAL NEAR getwpos(); +extern int PASCAL NEAR get_char(); +extern int PASCAL NEAR global_var(); #if DBCS -extern int is2byte(); +extern int PASCAL NEAR is2byte(); #endif -extern int is_letter(); -extern int is_lower(); -extern int is_num(); -extern int isearch(); -extern int is_upper(); -extern int kinsert(); -extern int ldelnewline(); -extern int linstr(); -extern int liteq(); -extern int litmake(); -extern int lnewline(); -extern int local_var(); -extern int lookup_color(); -extern int lover(); -extern int mceq(); -extern int mcscanner(); -extern int mcstr(); -extern int mlprompt(); -extern int nextch(); -extern int pop(); -extern int qreplace(); -extern int readpattern(); +extern int PASCAL NEAR is_letter(); +extern int PASCAL NEAR is_lower(); +extern int PASCAL NEAR is_num(); +extern int PASCAL NEAR isearch(); +extern int PASCAL NEAR is_upper(); +extern int PASCAL NEAR kinsert(); +extern int PASCAL NEAR ldelnewline(); +extern int PASCAL NEAR linstr(); +extern int PASCAL NEAR liteq(); +extern int PASCAL NEAR litmake(); +extern int PASCAL NEAR lnewline(); +extern int PASCAL NEAR local_var(); +extern int PASCAL NEAR lookup_color(); +extern int PASCAL NEAR lover(); +extern int PASCAL NEAR mceq(); +extern int PASCAL NEAR mcscanner(); +extern int PASCAL NEAR mcstr(); +extern int PASCAL NEAR mlprompt(); +extern int PASCAL NEAR nextch(); +extern int PASCAL NEAR pop(); +extern int PASCAL NEAR qreplace(); +extern int PASCAL NEAR readpattern(); #if WINDOW_TEXT -extern VOID refresh_screen(); +extern VOID PASCAL NEAR refresh_screen(); #endif -extern int reglines(); -extern int rename_screen(); -extern int replaces(); -extern int risearch(); -extern int rmcstr(); -extern int savematch(); -extern int scanmore(); -extern int scanner(); -extern int setvar(); -extern int sindex(); -extern int srindex(); -extern int sreplace(); -extern int stol(); +extern int PASCAL NEAR reglines(); +extern int PASCAL NEAR rename_screen(); +extern int PASCAL NEAR replaces(); +extern int PASCAL NEAR risearch(); +extern int PASCAL NEAR rmcstr(); +extern int PASCAL NEAR savematch(); +extern int PASCAL NEAR scanmore(); +extern int PASCAL NEAR scanner(); +extern int PASCAL NEAR setlower(); +extern int PASCAL NEAR setlower(); +extern int PASCAL NEAR setupper(); +extern int PASCAL NEAR setvar(); +extern int PASCAL NEAR sindex(); +extern int PASCAL NEAR sreplace(); +extern int PASCAL NEAR stol(); #if DBCS -extern int stopback(); -extern int stopforw(); +extern int PASCAL NEAR stopback(); +extern int PASCAL NEAR stopforw(); #endif -extern int svar(); -extern int tgetc(); -extern int uneat(); -extern VOID unlist_screen(); -extern int upscreen(); -extern int vtinit(); -extern int yank(); -extern int yank_pop(); +extern int PASCAL NEAR svar(); +extern int PASCAL NEAR tgetc(); +extern int PASCAL NEAR uneat(); +extern VOID PASCAL NEAR unlist_screen(); +extern int PASCAL NEAR upscreen(); +extern int PASCAL NEAR vtinit(); +extern int PASCAL NEAR yank(); +extern int PASCAL NEAR yank_pop(); extern int Erelease(); extern int set_key(); extern int xunlock(); extern KEYTAB *getbind(); -extern LINE *lalloc(); -extern LINE *mouseline(); -extern long getlinenum(); -extern int adjustmode(); -extern int anycb(); -extern int apro(); -extern int backchar(); -extern int backdel(); -extern int backline(); -extern int backpage(); -extern int backword(); -extern int bclear(); -extern int binary(); -extern int bindtokey(); -extern int buildlist(); -extern int capword(); -extern int cex(); -extern int cinsert(); -extern int clean(); -extern int clrmes(); -extern int copyregion(); -extern int ctlxe(); -extern int ctlxlp(); -extern int ctlxrp(); -extern int ctoec(); -extern int ctrlg(); -extern int cycle_screens(); -extern VOID dcline(); -extern int deblank(); -extern int debug(); -extern int delbword(); -extern int delete_screen(); -extern int delfword(); -extern int delgmode(); -extern int delmode(); -extern int delwind(); -extern int desbind(); -extern int desc_abbrevs(); -extern int deskey(); -extern int desvars(); -extern int detab(); -extern int dobuf(); -extern int docmd(); -extern int dofile(); -extern int ectoc(); -extern int edinit(); -extern int editloop(); -extern int endword(); -extern int enlargewind(); -extern int entab(); -extern int execbuf(); -extern int execcmd(); -extern int execfile(); -extern int execprg(); -extern int execproc(); -extern int execute(); -extern int ffclose(); -extern int ffgetline(); -extern int ffputline(); -extern int ffropen(); -extern int ffwopen(); -extern int fileapp(); -extern int find_screen(); -extern int filefind(); -extern int filename(); -extern int fileread(); -extern int filesave(); -extern int filewrite(); -extern int fillpara(); -extern int uefilter(); -extern VOID findvar(); -extern int fmatch(); -extern int forwchar(); -extern int forwdel(); -extern int forwline(); -extern int forwpage(); -extern int forwword(); -extern int getccol(); -extern int getcmd(); -extern int getfence(); -extern int getfile(); -extern int get_key(); -extern int getregion(); -extern int gotobob(); -extern int gotobol(); -extern int gotobop(); -extern int gotoeob(); -extern int gotoeol(); -extern int gotoeop(); -extern int gotoline(); -extern int gotomark(); -extern int help(); -extern int ifile(); -extern int indent(); -extern int indent_region(); -extern int insbrace(); -extern int insfile(); -extern int inspound(); -extern int insspace(); -extern int inword(); -extern int isinword(); -extern int ismodeline(); -extern int istring(); -extern int killbuffer(); -extern int killpara(); -extern int killregion(); -extern int killtext(); -extern VOID lchange(); -extern int ldelete(); -extern VOID lfree(); -extern int ldelchar(); -extern int linsert(); -extern int listbuffers(); -extern int list_screens(); -extern int lowerregion(); -extern int lowerword(); -extern int lowrite(); -extern int macarg(); -extern int macrotokey(); -extern int makelist(); -extern int undolist(); -extern VOID mouse_screen(); -extern int screenlist(); -extern int meexit(); -extern int uemeta(); -extern int mlreply(); -extern int mlyesno(); -extern int mouseoffset(); -extern int movemd(); -extern int movemu(); -extern int mregdown(); -extern int mmove(); -extern int mregup(); -extern int mvdnwind(); -extern int mvupwind(); -extern int namebuffer(); -extern int namedcmd(); -extern int narrow(); -extern int new_line(); -extern int new_col_org(); -extern int new_row_org(); -extern int newsize(); -extern int newwidth(); -extern int nextarg(); -extern int nextbuffer(); -extern int nextdown(); -extern int nextup(); -extern int nextwind(); -extern int nullproc(); -extern int onlywind(); -extern int openline(); -extern VOID ostring(); -extern VOID outstring(); -extern int ovstring(); -extern int pipecmd(); -extern int popbuffer(); -extern int prevwind(); -extern int putctext(); -extern int putline(); -extern int quickexit(); -extern int quit(); -extern int quote(); -extern int rdonly(); -extern int readin(); -extern int uerefresh(); -extern int remmark(); -extern int reposition(); -extern int resetkey(); -extern int resize(); -extern int resizm(); -extern int resterr(); -extern int restwnd(); -extern int savewnd(); -extern int scwrite(); -extern int setccol(); -extern int setekey(); -extern int setfillcol(); -extern int setgmode(); -extern int setmark(); -extern int setmod(); -extern int setwlist(); -extern int shellprog(); -extern int showfiles(); -extern int listkeymaps(); -extern int showcpos(); -extern int shrinkwind(); -extern int spal(); -extern int spawn(); -extern int spawncli(); -extern int splitwind(); -extern int startup(); -extern int storeproc(); -extern int strinc(); -extern int swapmark(); -extern int swbuffer(); -extern int uetab(); -extern int trim(); -extern int ttclose(); -extern int ttflush(); -extern int ttgetc(); -extern int ttopen(); -extern int ttputc(); -extern int twiddle(); -extern int typahead(); -extern int unarg(); -extern int unbindchar(); -extern int unbindkey(); -extern int undent_region(); -extern int unmark(); -extern int upperregion(); -extern int upperword(); -extern int usebuffer(); -extern int viewfile(); -extern VOID vteeol(); -extern VOID vtmove(); -extern VOID vtputc(); -extern VOID vttidy(); -extern int widen(); -extern int wordcount(); -extern int wrapword(); -extern int writemsg(); -extern int writeout(); -extern int zotbuf(); -extern unsigned int chcase(); -extern unsigned int getckey(); -extern unsigned int stock(); -extern VOID CDECL mlwrite(); -extern VOID ab_init(); -extern VOID ab_save(); -extern VOID ab_expand(); -extern VOID clist_buffer(); -extern VOID clist_command(); -extern VOID clist_file(); -extern VOID comp_buffer(); -extern VOID comp_command(); -extern VOID comp_file(); -extern VOID ecrypt(); -extern VOID errormesg(); -extern VOID flong_asc(); -extern VOID freewhile(); -extern VOID getdtime(); -extern VOID kdelete(); -extern int lowercase(); -extern VOID mcclear(); -extern VOID mlabort(); -extern VOID mlerase(); -extern VOID mlferase(); -extern VOID mlforce(); -extern VOID mlout(); -extern VOID mlputf(); -extern VOID mlputi(); -extern VOID mlputli(); -extern VOID mlputs(); -extern VOID mlrquery(); -extern VOID modeline(); -extern VOID movecursor(); -extern VOID next_kill(); -extern VOID pad(); -extern VOID reeat(); -extern VOID reframe(); -extern VOID reform(); -extern VOID rmcclear(); -extern VOID setbit(); -extern VOID setjtable(); -extern VOID unbind_buf(); -extern VOID unqname(); -extern VOID updall(); -extern VOID update(); -extern VOID update_size(); -extern VOID upddex(); -extern VOID updext(); -extern VOID updgar(); -extern VOID updone(); -extern VOID updpos(); -extern VOID upmode(); -extern VOID updupd(); -extern int uppercase(); -extern VOID upwind(); -extern VOID varinit(); -extern VOID varclean(); -extern VOID uv_init(); -extern VOID uv_clean(); -extern VOID vtfree(); +extern LINE *PASCAL NEAR lalloc(); +extern LINE *PASCAL NEAR mouseline(); +extern long PASCAL NEAR getlinenum(); +extern int PASCAL NEAR adjustmode(); +extern int PASCAL NEAR anycb(); +extern int PASCAL NEAR apro(); +extern int PASCAL NEAR backchar(); +extern int PASCAL NEAR backdel(); +extern int PASCAL NEAR backline(); +extern int PASCAL NEAR backpage(); +extern int PASCAL NEAR backword(); +extern int PASCAL NEAR bclear(); +extern int PASCAL NEAR binary(); +extern int PASCAL NEAR bindtokey(); +extern int PASCAL NEAR buildlist(); +extern int PASCAL NEAR capword(); +extern int PASCAL NEAR cex(); +extern int PASCAL NEAR cinsert(); +extern int PASCAL NEAR clean(); +extern int PASCAL NEAR clrmes(); +extern int PASCAL NEAR copyregion(); +extern int PASCAL NEAR ctlxe(); +extern int PASCAL NEAR ctlxlp(); +extern int PASCAL NEAR ctlxrp(); +extern int PASCAL NEAR ctoec(); +extern int PASCAL NEAR ctrlg(); +extern int PASCAL NEAR cycle_screens(); +extern VOID PASCAL NEAR dcline(); +extern int PASCAL NEAR deblank(); +extern int PASCAL NEAR debug(); +extern int PASCAL NEAR delbword(); +extern int PASCAL NEAR delete_screen(); +extern int PASCAL NEAR delfword(); +extern int PASCAL NEAR delgmode(); +extern int PASCAL NEAR delmode(); +extern int PASCAL NEAR delwind(); +extern int PASCAL NEAR desbind(); +extern int PASCAL NEAR desc_abbrevs(); +extern int PASCAL NEAR deskey(); +extern int PASCAL NEAR desvars(); +extern int PASCAL NEAR detab(); +extern int PASCAL NEAR dobuf(); +extern int PASCAL NEAR docmd(); +extern int PASCAL NEAR dofile(); +extern int PASCAL NEAR ectoc(); +extern int PASCAL NEAR edinit(); +extern int PASCAL NEAR editloop(); +extern int PASCAL NEAR endword(); +extern int PASCAL NEAR enlargewind(); +extern int PASCAL NEAR entab(); +extern int PASCAL NEAR execbuf(); +extern int PASCAL NEAR execcmd(); +extern int PASCAL NEAR execfile(); +extern int PASCAL NEAR execprg(); +extern int PASCAL NEAR execproc(); +extern int PASCAL NEAR execute(); +extern int PASCAL NEAR ffclose(); +extern int PASCAL NEAR ffgetline(); +extern int PASCAL NEAR ffputline(); +extern int PASCAL NEAR ffropen(); +extern int PASCAL NEAR ffwopen(); +extern int PASCAL NEAR fileapp(); +extern int PASCAL NEAR find_screen(); +extern int PASCAL NEAR filefind(); +extern int PASCAL NEAR filename(); +extern int PASCAL NEAR fileread(); +extern int PASCAL NEAR filesave(); +extern int PASCAL NEAR filewrite(); +extern int PASCAL NEAR fillpara(); +extern int PASCAL NEAR uefilter(); +extern VOID PASCAL NEAR findvar(); +extern int PASCAL NEAR fmatch(); +extern int PASCAL NEAR forwchar(); +extern int PASCAL NEAR forwdel(); +extern int PASCAL NEAR forwline(); +extern int PASCAL NEAR forwpage(); +extern int PASCAL NEAR forwword(); +extern int PASCAL NEAR getccol(); +extern int PASCAL NEAR getcmd(); +extern int PASCAL NEAR getfence(); +extern int PASCAL NEAR getfile(); +extern int PASCAL NEAR get_key(); +extern int PASCAL NEAR getregion(); +extern int PASCAL NEAR gotobob(); +extern int PASCAL NEAR gotobol(); +extern int PASCAL NEAR gotobop(); +extern int PASCAL NEAR gotoeob(); +extern int PASCAL NEAR gotoeol(); +extern int PASCAL NEAR gotoeop(); +extern int PASCAL NEAR gotoline(); +extern int PASCAL NEAR gotomark(); +extern int PASCAL NEAR help(); +extern int PASCAL NEAR ifile(); +extern int PASCAL NEAR indent(); +extern int PASCAL NEAR indent_region(); +extern int PASCAL NEAR insbrace(); +extern int PASCAL NEAR insfile(); +extern int PASCAL NEAR inspound(); +extern int PASCAL NEAR insspace(); +extern int PASCAL NEAR inword(); +extern int PASCAL NEAR isinword(); +extern int PASCAL NEAR ismodeline(); +extern int PASCAL NEAR istring(); +extern int PASCAL NEAR killbuffer(); +extern int PASCAL NEAR killpara(); +extern int PASCAL NEAR killregion(); +extern int PASCAL NEAR killtext(); +extern VOID PASCAL NEAR lchange(); +extern int PASCAL NEAR ldelete(); +extern VOID PASCAL NEAR lfree(); +extern int PASCAL NEAR ldelchar(); +extern int PASCAL NEAR linsert(); +extern int PASCAL NEAR listbuffers(); +extern int PASCAL NEAR list_screens(); +extern int PASCAL NEAR lowerregion(); +extern int PASCAL NEAR lowerword(); +extern int PASCAL NEAR lowrite(); +extern int PASCAL NEAR macarg(); +extern int PASCAL NEAR macrotokey(); +extern int PASCAL NEAR makelist(); +extern int PASCAL NEAR undolist(); +extern VOID PASCAL NEAR mouse_screen(); +extern int PASCAL NEAR screenlist(); +extern int PASCAL NEAR meexit(); +extern int PASCAL NEAR uemeta(); +extern int PASCAL NEAR mlreply(); +extern int PASCAL NEAR mlyesno(); +extern int PASCAL NEAR mouseoffset(); +extern int PASCAL NEAR movemd(); +extern int PASCAL NEAR movemu(); +extern int PASCAL NEAR mregdown(); +extern int PASCAL NEAR mmove(); +extern int PASCAL NEAR mregup(); +extern int PASCAL NEAR mvdnwind(); +extern int PASCAL NEAR mvupwind(); +extern int PASCAL NEAR namebuffer(); +extern int PASCAL NEAR namedcmd(); +extern int PASCAL NEAR narrow(); +extern int PASCAL NEAR uenewline(); +extern int PASCAL NEAR new_col_org(); +extern int PASCAL NEAR new_row_org(); +extern int PASCAL NEAR newsize(); +extern int PASCAL NEAR newwidth(); +extern int PASCAL NEAR nextarg(); +extern int PASCAL NEAR nextbuffer(); +extern int PASCAL NEAR nextdown(); +extern int PASCAL NEAR nextup(); +extern int PASCAL NEAR nextwind(); +extern int PASCAL NEAR nullproc(); +extern int PASCAL NEAR onlywind(); +extern int PASCAL NEAR openline(); +extern VOID PASCAL NEAR ostring(); +extern VOID PASCAL NEAR outstring(); +extern int PASCAL NEAR ovstring(); +extern int PASCAL NEAR pipecmd(); +extern int PASCAL NEAR popbuffer(); +extern int PASCAL NEAR prevwind(); +extern int PASCAL NEAR putctext(); +extern int PASCAL NEAR putline(); +extern int PASCAL NEAR quickexit(); +extern int PASCAL NEAR quit(); +extern int PASCAL NEAR quote(); +extern int PASCAL NEAR rdonly(); +extern int PASCAL NEAR readin(); +extern int PASCAL NEAR uerefresh(); +extern int PASCAL NEAR remmark(); +extern int PASCAL NEAR reposition(); +extern int PASCAL NEAR resetkey(); +extern int PASCAL NEAR resize(); +extern int PASCAL NEAR resizm(); +extern int PASCAL NEAR resterr(); +extern int PASCAL NEAR restwnd(); +extern int PASCAL NEAR savewnd(); +extern int PASCAL NEAR scwrite(); +extern int PASCAL NEAR setccol(); +extern int PASCAL NEAR setekey(); +extern int PASCAL NEAR setfillcol(); +extern int PASCAL NEAR setgmode(); +extern int PASCAL NEAR setmark(); +extern int PASCAL NEAR setmod(); +extern int PASCAL NEAR setwlist(); +extern int PASCAL NEAR shellprog(); +extern int PASCAL NEAR showfiles(); +extern int PASCAL NEAR listkeymaps(); +extern int PASCAL NEAR showcpos(); +extern int PASCAL NEAR shrinkwind(); +extern int PASCAL NEAR spal(); +extern int PASCAL NEAR spawn(); +extern int PASCAL NEAR spawncli(); +extern int PASCAL NEAR splitwind(); +extern int PASCAL NEAR startup(); +extern int PASCAL NEAR storeproc(); +extern int PASCAL NEAR strinc(); +extern int PASCAL NEAR swapmark(); +extern int PASCAL NEAR swbuffer(); +extern int PASCAL NEAR uetab(); +extern int PASCAL NEAR trim(); +extern int PASCAL NEAR ttclose(); +extern int PASCAL NEAR ttflush(); +extern int PASCAL NEAR ttgetc(); +extern int PASCAL NEAR ttopen(); +extern int PASCAL NEAR ttputc(); +extern int PASCAL NEAR twiddle(); +extern int PASCAL NEAR typahead(); +extern int PASCAL NEAR unarg(); +extern int PASCAL NEAR unbindchar(); +extern int PASCAL NEAR unbindkey(); +extern int PASCAL NEAR undent_region(); +extern int PASCAL NEAR unmark(); +extern int PASCAL NEAR upperregion(); +extern int PASCAL NEAR upperword(); +extern int PASCAL NEAR usebuffer(); +extern int PASCAL NEAR viewfile(); +extern VOID PASCAL NEAR vteeol(); +extern VOID PASCAL NEAR vtmove(); +extern VOID PASCAL NEAR vtputc(); +extern VOID PASCAL NEAR vttidy(); +extern int PASCAL NEAR widen(); +extern int PASCAL NEAR wordcount(); +extern int PASCAL NEAR wrapword(); +extern int PASCAL NEAR writemsg(); +extern int PASCAL NEAR writeout(); +extern int PASCAL NEAR zotbuf(); +extern unsigned int PASCAL NEAR chcase(); +extern unsigned int PASCAL NEAR getckey(); +extern unsigned int PASCAL NEAR stock(); +extern VOID CDECL NEAR mlwrite(); +extern VOID PASCAL NEAR ab_init(); +extern VOID PASCAL NEAR ab_save(); +extern VOID PASCAL NEAR ab_expand(); +extern VOID PASCAL NEAR clist_buffer(); +extern VOID PASCAL NEAR clist_command(); +extern VOID PASCAL NEAR clist_file(); +extern VOID PASCAL NEAR comp_buffer(); +extern VOID PASCAL NEAR comp_command(); +extern VOID PASCAL NEAR comp_file(); +extern VOID PASCAL NEAR ecrypt(); +extern VOID PASCAL NEAR errormesg(); +extern VOID PASCAL NEAR flong_asc(); +extern VOID PASCAL NEAR freewhile(); +extern VOID PASCAL NEAR getdtime(); +extern VOID PASCAL NEAR initchars(); +extern VOID PASCAL NEAR kdelete(); +extern int PASCAL NEAR lowercase(); +extern VOID PASCAL NEAR mcclear(); +extern VOID PASCAL NEAR mlabort(); +extern VOID PASCAL NEAR mlerase(); +extern VOID PASCAL NEAR mlferase(); +extern VOID PASCAL NEAR mlforce(); +extern VOID PASCAL NEAR mlout(); +extern VOID PASCAL NEAR mlputf(); +extern VOID PASCAL NEAR mlputi(); +extern VOID PASCAL NEAR mlputli(); +extern VOID PASCAL NEAR mlputs(); +extern VOID PASCAL NEAR mlrquery(); +extern VOID PASCAL NEAR modeline(); +extern VOID PASCAL NEAR movecursor(); +extern VOID PASCAL NEAR next_kill(); +extern VOID PASCAL NEAR pad(); +extern VOID PASCAL NEAR reeat(); +extern VOID PASCAL NEAR reframe(); +extern VOID PASCAL NEAR reform(); +extern VOID PASCAL NEAR rmcclear(); +extern VOID PASCAL NEAR setbit(); +extern VOID PASCAL NEAR setjtable(); +extern VOID PASCAL NEAR unbind_buf(); +extern VOID PASCAL NEAR unqname(); +extern VOID PASCAL NEAR updall(); +extern VOID PASCAL NEAR update(); +extern VOID PASCAL NEAR update_size(); +extern VOID PASCAL NEAR upddex(); +extern VOID PASCAL NEAR updext(); +extern VOID PASCAL NEAR updgar(); +extern VOID PASCAL NEAR updone(); +extern VOID PASCAL NEAR updpos(); +extern VOID PASCAL NEAR upmode(); +extern VOID PASCAL NEAR updupd(); +extern int PASCAL NEAR uppercase(); +extern VOID PASCAL NEAR upwind(); +extern VOID PASCAL NEAR varinit(); +extern VOID PASCAL NEAR varclean(); +extern VOID PASCAL NEAR uv_init(); +extern VOID PASCAL NEAR uv_clean(); +extern VOID PASCAL NEAR vtfree(); extern VOID cook(); extern VOID qin(); extern VOID qrep(); -extern EWINDOW *mousewindow(); -extern int wpopup(); +extern EWINDOW *PASCAL NEAR mousewindow(); +extern int PASCAL NEAR wpopup(); #if CTAGS -extern int tagword(); /* vi-like tagging */ -extern int retagword(); /* Try again (if redefined) */ -extern int backtagword(); /* return from tagged word */ +extern int PASCAL NEAR tagword(); /* vi-like tagging */ +extern int PASCAL NEAR retagword(); /* Try again (if redefined) */ +extern int PASCAL NEAR backtagword(); /* return from tagged word */ #endif #if LIBHELP diff --git a/h/evar.h b/h/evar.h index 15fc081..c6d7459 100644 --- a/h/evar.h +++ b/h/evar.h @@ -16,7 +16,7 @@ NOSHARE char *envars[] = { "asave", /* # of chars between auto-saves */ "bufhook", /* enter buffer switch hook */ "cbflags", /* current buffer flags */ - "cbufname", /* current buffer name */ + "cbufname", /* current buffer name */ "cfname", /* current file name */ "class", /* screen class code */ "cmdhook", /* command loop hook */ @@ -26,19 +26,19 @@ NOSHARE char *envars[] = { "curcol", /* current column pos of cursor */ "curline", /* current line in file */ "curoffs", /* current offset in line */ - "curwidth", /* current screen width */ + "curwidth", /* current screen width */ "curwind", /* current window ordinal on current screen */ "cwline", /* current screen line in window */ "debug", /* macro debugging */ "deskcolor", /* desktop color */ - "diagflag", /* diagonal mouse movements enabled? */ + "diagflag", /* diagonal mouse movements enabled? */ "discmd", /* display commands on command line */ "disinp", /* display command line input characters */ - "disphigh", /* display high bit characters escaped */ - "dispundo", /* display undo depth on command line */ + "disphigh", /* display high bit characters escaped */ + "dispundo", /* display undo depth on command line */ "exbhook", /* exit buffer switch hook */ - "exithook", /* exiting emacs hook */ - "fcol", /* first displayed column in current window */ + "exithook", /* exiting emacs hook */ + "fcol", /* first displayed column in current window */ "fillcol", /* current fill column */ "flicker", /* flicker suppression */ "fmtlead", /* format command lead characters */ @@ -48,7 +48,7 @@ NOSHARE char *envars[] = { "hardtab", /* current hard tab size */ "hilight", /* region # to hilight (255 to turn off) */ "hjump", /* horizontal screen jump size */ - "hscrlbar", /* horizontal scroll bar flag */ + "hscrlbar", /* horizontal scroll bar flag */ "hscroll", /* horizontal scrolling flag */ "isterm", /* incremental-search terminator character */ "kill", /* kill buffer (read only) */ @@ -63,7 +63,7 @@ NOSHARE char *envars[] = { "mcol", /* mark column */ "mline", /* mark line */ "mmove", /* mouse moves events style */ - "modeflag", /* Mode lines displayed flag */ + "modeflag", /* Modelines displayed flag */ "msflag", /* activate mouse? */ "newscreen", /* new screen with new buffer? */ "numwind", /* number of windows on current screen */ @@ -79,7 +79,7 @@ NOSHARE char *envars[] = { "pid", /* process id */ "popflag", /* pop-up windows active? */ "popwait", /* user wait on end of pop-up window? */ - "posflag", /* display point position on mode line? */ + "posflag", /* display point position on modeline? */ "progname", /* returns current prog name - "MicroEMACS" */ "ram", /* ram in use by malloc */ "readhook", /* read file execution hook */ @@ -99,7 +99,7 @@ NOSHARE char *envars[] = { "sterm", /* search terminator character */ "syslang", /* system language */ "target", /* target for line moves */ - "time", /* date and time */ + "time", /* date and time */ "timeflag", /* display time? */ "tmpnam", /* temporary file name */ "tpause", /* length to pause for fences matching */ @@ -112,7 +112,7 @@ NOSHARE char *envars[] = { "writehook", /* write file hook */ "xpos", /* current mouse X position */ "yankflag", /* point placement at yanked/included text */ - "ypos", /* current mouse Y position */ + "ypos" /* current mouse Y position */ }; #define NEVARS sizeof(envars) / sizeof(char *) @@ -120,7 +120,7 @@ NOSHARE char *envars[] = { /* and its preprocessor definitions */ #define EVABBELL 0 -#define EVABCAP 1 +#define EVABCAP 1 #define EVABQUICK 2 #define EVACOUNT 3 #define EVASAVE 4 @@ -313,17 +313,17 @@ NOSHARE UFUNC funcs[] = { #define UFEXIST 16 #define UFFIND 17 #define UFGREATER 18 -#define UFGROUP 19 +#define UFGROUP 19 #define UFGTCMD 20 #define UFGTKEY 21 #define UFIND 22 -#define UFISNUM 23 +#define UFISNUM 23 #define UFLEFT 24 #define UFLENGTH 25 #define UFLESS 26 #define UFLOWER 27 #define UFMID 28 -#define UFMKCOL 29 +#define UFMKCOL 29 #define UFMKLINE 30 #define UFMOD 31 #define UFNEG 32 diff --git a/h/mswin.h b/h/mswin.h index 518cde1..e809022 100644 --- a/h/mswin.h +++ b/h/mswin.h @@ -157,51 +157,51 @@ void in_put (int event); int in_get (void); /* Windows-implementation specific functions */ -LONG EXPORT FAR ScrWndProc (HWND hWnd, UINT wMsg, WPARAM wParam, +LONG EXPORT FAR PASCAL ScrWndProc (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam); -LONG EXPORT FAR FrameWndProc (HWND hWnd, UINT wMsg, WPARAM wParam, +LONG EXPORT FAR PASCAL FrameWndProc (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam); -int FAR GetInput (void); -int FAR TakeANap (int t); +int FAR PASCAL GetInput (void); +int FAR PASCAL TakeANap (int t); -void FAR GenerateMenuSeq (UINT ID); -KEYTAB * FAR FindKeyBinding (void *Func); -void FAR InitMenuPopup (HMENU hMenu, LPARAM lParam); -BOOL FAR MenuCommand (WPARAM wParam, LPARAM lParam); -HMENU FAR GetScreenMenuHandle (void); +void FAR PASCAL GenerateMenuSeq (UINT ID); +KEYTAB * FAR PASCAL FindKeyBinding (void *Func); +void FAR PASCAL InitMenuPopup (HMENU hMenu, LPARAM lParam); +BOOL FAR PASCAL MenuCommand (WPARAM wParam, LPARAM lParam); +HMENU FAR PASCAL GetScreenMenuHandle (void); -BOOL FAR EatKey (UINT MsgCode, WPARAM wParam, LPARAM lParam); -void FAR MouseMessage (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam); -void FAR DropMessage (HWND hWnd, HANDLE hDrop); +BOOL FAR PASCAL EatKey (UINT MsgCode, WPARAM wParam, LPARAM lParam); +void FAR PASCAL MouseMessage (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam); +void FAR PASCAL DropMessage (HWND hWnd, HANDLE hDrop); -void FAR BuildCellMetrics (CellMetrics *cm, HFONT hFont); -void FAR InvalidateCells (HWND hWnd, int leftcol, int toprow, +void FAR PASCAL BuildCellMetrics (CellMetrics *cm, HFONT hFont); +void FAR PASCAL InvalidateCells (HWND hWnd, int leftcol, int toprow, int rightcol, int bottomrow); -void FAR MinimumClientSize (HWND hWnd, int NCols, int NRows, +void FAR PASCAL MinimumClientSize (HWND hWnd, int NCols, int NRows, int *Width, int *Height); -int FAR DisplayableRows (HWND hWnd, int Height, CellMetrics *cm); -int FAR DisplayableColumns (HWND hWnd, int Width, CellMetrics *cm); -void FAR EmacsCaret (BOOL Show); -void FAR MoveEmacsCaret (HWND hWnd, int col, int row); -void FAR ShowEmacsCaret (BOOL Show); -void FAR CellToClient (HWND hWnd, POINT Cell, LPPOINT Client); -void FAR ClientToCell (HWND hWnd, POINT Client, LPPOINT Cell); -void FAR GetMinMaxInfo (HWND hWnd, LPPOINT rgpt); -BOOL FAR ScrReSize (HWND hWnd, WPARAM wParam, WORD cx, WORD cy); -void FAR ScrPaint (HWND hWnd); -void FAR MLPaint (void); - -BOOL FAR InMessageLine (void); - -void FAR ClipboardCleanup (void); -void FAR ScrollMessage (HWND hWnd, UINT wMsg, WORD ScrlCode, int Pos); -void FAR ScrollBars (void); - -int FAR SetWorkingDir (void); - -void FAR InitializeFarStorage (void); -void FAR JettisonFarStorage (void); - -HFONT FAR SelectFont (HDC hDC, HFONT hFont); -BOOL FAR PickEmacsFont (void); -void FAR FontInit (void); +int FAR PASCAL DisplayableRows (HWND hWnd, int Height, CellMetrics *cm); +int FAR PASCAL DisplayableColumns (HWND hWnd, int Width, CellMetrics *cm); +void FAR PASCAL EmacsCaret (BOOL Show); +void FAR PASCAL MoveEmacsCaret (HWND hWnd, int col, int row); +void FAR PASCAL ShowEmacsCaret (BOOL Show); +void FAR PASCAL CellToClient (HWND hWnd, POINT Cell, LPPOINT Client); +void FAR PASCAL ClientToCell (HWND hWnd, POINT Client, LPPOINT Cell); +void FAR PASCAL GetMinMaxInfo (HWND hWnd, LPPOINT rgpt); +BOOL FAR PASCAL ScrReSize (HWND hWnd, WPARAM wParam, WORD cx, WORD cy); +void FAR PASCAL ScrPaint (HWND hWnd); +void FAR PASCAL MLPaint (void); + +BOOL FAR PASCAL InMessageLine (void); + +void FAR PASCAL ClipboardCleanup (void); +void FAR PASCAL ScrollMessage (HWND hWnd, UINT wMsg, WORD ScrlCode, int Pos); +void FAR PASCAL ScrollBars (void); + +int FAR PASCAL SetWorkingDir (void); + +void FAR PASCAL InitializeFarStorage (void); +void FAR PASCAL JettisonFarStorage (void); + +HFONT FAR PASCAL SelectFont (HDC hDC, HFONT hFont); +BOOL FAR PASCAL PickEmacsFont (void); +void FAR PASCAL FontInit (void); diff --git a/h/resource.h b/h/resource.h index af4c1ee..2b6eb9d 100644 --- a/h/resource.h +++ b/h/resource.h @@ -312,7 +312,7 @@ #define ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID 3 #define SW_SHOWMAXIMIZED 3 #define SW_MAXIMIZE 3 -#define SHOW_FULLESCREEN 3 +#define SHOW_FULLSCREEN 3 #define SW_PARENTOPENING 3 #define VK_CANCEL 0x03 #define WM_MOVE 0x0003 @@ -1157,7 +1157,7 @@ #define TVS_EX_EXCLUSIONCHECKBOXES 0x0100 #define TCS_BUTTONS 0x0100 #define MCS_NOSELCHANGEONNAV 0x0100 -#define IDM_FIND_ESCREEN 0x100 +#define IDM_FIND_SCREEN 0x100 #define WM_KEYUP 0x0101 #define IDM_NEWSIZE 0x101 #define WM_CHAR 0x0102 @@ -1167,7 +1167,7 @@ #define WM_SYSKEYDOWN 0x0104 #define IDM_FONT 0x104 #define WM_SYSKEYUP 0x0105 -#define IDM_RENAME_ESCREEN 0x105 +#define IDM_RENAME_SCREEN 0x105 #define WM_SYSCHAR 0x0106 #define WM_SYSDEADCHAR 0x0107 #define WM_UNICHAR 0x0109 @@ -1748,7 +1748,7 @@ #define SC_ARRANGE 0xF110 #define SC_RESTORE 0xF120 #define SC_TASKLIST 0xF130 -#define SC_ESCREENSAVE 0xF140 +#define SC_SCREENSAVE 0xF140 #define SC_HOTKEY 0xF150 #define SC_DEFAULT 0xF160 #define SC_MONITORPOWER 0xF170 From a473741b24f02bd0a3ac546437aa698275c54813 Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 10 Sep 2020 19:26:06 +0200 Subject: [PATCH 30/37] Delete emacs.rc_curses --- cmd_curses/emacs.rc_curses | 98 -------------------------------------- 1 file changed, 98 deletions(-) delete mode 100644 cmd_curses/emacs.rc_curses diff --git a/cmd_curses/emacs.rc_curses b/cmd_curses/emacs.rc_curses deleted file mode 100644 index ee30c0e..0000000 --- a/cmd_curses/emacs.rc_curses +++ /dev/null @@ -1,98 +0,0 @@ -; EMACS.RC: Standard MicroEMACS Startup program -; for MicroEMACS 3.13 and above -; (C)opyright 1987-99 by Daniel M Lawrence -; Last Update: 11/13/93 - -;set $discmd TRUE -write-message "[Setting up....]" -;set $debug TRUE - -; If you hate clocks or position counters, comment these -;set $timeflag TRUE -set $posflag TRUE -set $sscroll TRUE - -; Set Default Global modes - -add-global-mode "white" -add-global-mode "BLACK" - -; Bring up Online-help system - -store-procedure get-help - set $discmd FALSE - source ehelp.cmd - set $discmd TRUE -!endm - -macro-to-menu get-help "Help>MicroEmacs help" - -; Set up default modes - -add-mode "white" -add-mode "BLACK" - -store-procedure set-default-mode -; set $debug TRUE - set %rctmp &sri $cfname "." - !if &equ %rctmp 0 - !return - !endif - set %rctmp &mid $cfname &add %rctmp 1 5 - !if &or &seq %rctmp "c" &seq %rctmp "h" - add-mode "cmode" - delete-mode "theox" - set $hardtab 4 - kill-abbrevs - !endif - !if &or &seq %rctmp "cpp" &seq %rctmp "hpp" - add-mode "cmode" - delete-mode "theox" - set $hardtab 4 - kill-abbrevs - !endif - !if &seq %rctmp "b" - add-mode "cmode" - add-mode "abbrev" - delete-mode "theox" - set $hardtab 2 - execute-file babbrevs.cmd - !endif - !if &seq %rctmp "basic" - add-mode "cmode" - add-mode "abbrev" - add-mode "theox" - set $hardtab 2 - execute-file babbrevs.cmd - !endif - !if &or &seq %rctmp "mss" &seq %rctmp "txt" - add-mode "wrap" - delete-mode "cmode" - delete-mode "theox" - set $hardtab 8 - kill-abbrevs - !endif -!endm -set $readhook set-default-mode - -; ***** Rebind the Function key group - -bind-to-key search-forward FN1 -bind-to-key search-reverse FN2 -bind-to-key hunt-forward FN3 -bind-to-key hunt-backward FN4 -;bind-to-key toggle-fkeys FN5 -macro-to-key get-help FN6 -bind-to-key next-window FN7 -bind-to-key previous-window FN8 -bind-to-key exit-emacs FN9 -bind-to-key save-file FN0 - -store-procedure toggle-insert - !if &gre &mod $cmode 64 31 - delete-mode "over" - !else - add-mode "over" - !endif -!endm -macro-to-key toggle-insert FNC \ No newline at end of file From 8bfdbff37a61f803b0ba1cecdee0c2ee4ac7dae3 Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 10 Sep 2020 19:30:02 +0200 Subject: [PATCH 31/37] Files for TxBasic IDE --- cmd_txb/emacs.rc | 2 ++ cmd_txb/tpage.cmd | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd_txb/emacs.rc b/cmd_txb/emacs.rc index 88be80c..a9b8c63 100644 --- a/cmd_txb/emacs.rc +++ b/cmd_txb/emacs.rc @@ -88,6 +88,8 @@ bind-to-key previous-window FN8 bind-to-key exit-emacs FN9 bind-to-key save-file FN0 +bind-to-key menu-drop FNb + store-procedure toggle-insert !if &gre &mod $cmode 64 31 delete-mode "over" diff --git a/cmd_txb/tpage.cmd b/cmd_txb/tpage.cmd index 91f5626..36009b9 100644 --- a/cmd_txb/tpage.cmd +++ b/cmd_txb/tpage.cmd @@ -307,8 +307,6 @@ macro-to-menu b-new-select "TxBasic>SELECT" macro-to-menu b-new-for "TxBasic>FOR" macro-to-menu b-new-while "TxBasic>WHILE" -bind-to-key menu-drop FNb - ; Set up CMODE add-mode CMODE add-global-mode CMODE From 19805397eff6c41fcd17da3c7514c3715406fea4 Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 10 Sep 2020 19:31:13 +0200 Subject: [PATCH 32/37] Startup files for curses version --- cmd_curses/emacs.rc | 100 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 cmd_curses/emacs.rc diff --git a/cmd_curses/emacs.rc b/cmd_curses/emacs.rc new file mode 100644 index 0000000..b408ae8 --- /dev/null +++ b/cmd_curses/emacs.rc @@ -0,0 +1,100 @@ +; EMACS.RC: Standard MicroEMACS Startup program +; for MicroEMACS 3.13 and above +; (C)opyright 1987-99 by Daniel M Lawrence +; Last Update: 11/13/93 + +;set $discmd TRUE +write-message "[Setting up....]" +;set $debug TRUE + +; If you hate clocks or position counters, comment these +;set $timeflag TRUE +set $posflag TRUE +set $sscroll TRUE + +; Set Default Global modes + +add-global-mode "white" +add-global-mode "BLACK" + +; Bring up Online-help system + +store-procedure get-help + set $discmd FALSE + source ehelp.cmd + set $discmd TRUE +!endm + +macro-to-menu get-help "Help>MicroEmacs help" + +; Set up default modes + +add-mode "white" +add-mode "BLACK" + +store-procedure set-default-mode +; set $debug TRUE + set %rctmp &sri $cfname "." + !if &equ %rctmp 0 + !return + !endif + set %rctmp &mid $cfname &add %rctmp 1 5 + !if &or &seq %rctmp "c" &seq %rctmp "h" + add-mode "cmode" + delete-mode "theox" + set $hardtab 4 + kill-abbrevs + !endif + !if &or &seq %rctmp "cpp" &seq %rctmp "hpp" + add-mode "cmode" + delete-mode "theox" + set $hardtab 4 + kill-abbrevs + !endif + !if &seq %rctmp "b" + add-mode "cmode" + add-mode "abbrev" + delete-mode "theox" + set $hardtab 2 + execute-file babbrevs.cmd + !endif + !if &seq %rctmp "basic" + add-mode "cmode" + add-mode "abbrev" + add-mode "theox" + set $hardtab 2 + execute-file babbrevs.cmd + !endif + !if &or &seq %rctmp "mss" &seq %rctmp "txt" + add-mode "wrap" + delete-mode "cmode" + delete-mode "theox" + set $hardtab 8 + kill-abbrevs + !endif +!endm +set $readhook set-default-mode + +; ***** Rebind the Function key group + +bind-to-key search-forward FN1 +bind-to-key search-reverse FN2 +bind-to-key hunt-forward FN3 +bind-to-key hunt-backward FN4 +;bind-to-key toggle-fkeys FN5 +macro-to-key get-help FN6 +bind-to-key next-window FN7 +bind-to-key previous-window FN8 +bind-to-key exit-emacs FN9 +bind-to-key save-file FN0 + +bind-to-key menu-drop FNb + +store-procedure toggle-insert + !if &gre &mod $cmode 64 31 + delete-mode "over" + !else + add-mode "over" + !endif +!endm +macro-to-key toggle-insert FNC \ No newline at end of file From b456a5a0eb78ed02e0d15c53e780729d6457d3d5 Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 10 Sep 2020 19:35:05 +0200 Subject: [PATCH 33/37] Updated to version 5.11 Mainly UTF8 support --- src/abbrev.c | 28 ++-- src/aix.c | 1 - src/amigados.c | 10 +- src/ansi.c | 92 +++++------ src/aosvs.c | 10 +- src/basic.c | 38 ++--- src/bind.c | 56 ++++--- src/buffer.c | 30 ++-- src/char.c | 411 +++++++++++++++++++++++++------------------------ src/cmdfix.c | 6 +- src/crypt.c | 10 +- src/dg10.c | 62 ++++---- src/display.c | 106 ++++++------- src/eval.c | 90 +++++------ src/exec.c | 34 ++-- src/file.c | 32 ++-- src/fileio.c | 12 +- src/fmrdos.c | 40 ++--- src/history.c | 11 +- src/input.c | 51 +++--- src/isearch.c | 20 +-- src/keyboard.c | 24 +-- src/line.c | 74 +++++---- src/main.c | 61 ++++---- src/mouse.c | 24 +-- src/msdos.c | 42 ++--- src/mswdisp.c | 34 ++-- src/mswdrv.c | 86 +++++------ src/mswemacs.c | 30 ++-- src/mswexec.c | 20 +-- src/mswfile.c | 35 ++--- src/mswfont.c | 30 ++-- src/mswinput.c | 12 +- src/mswmenu.c | 50 +++--- src/mswsys.c | 46 +++--- src/necdos.c | 54 +++---- src/nt.c | 16 +- src/os2.c | 4 +- src/random.c | 69 +++++---- src/region.c | 24 +-- src/replace.c | 14 +- src/screen.c | 24 +-- src/search.c | 94 +++++------ src/tags.c | 8 +- src/tcap.c | 2 +- src/tos.c | 6 +- src/undo.c | 8 +- src/vms.c | 50 +++--- src/window.c | 54 +++---- src/wmcs.c | 2 +- src/word.c | 32 ++-- src/xp.c | 16 +- src/xpconio.c | 82 +++++----- src/xvt.c | 66 ++++---- src/xvtdos.c | 38 ++--- 55 files changed, 1200 insertions(+), 1181 deletions(-) diff --git a/src/abbrev.c b/src/abbrev.c index 2cdf496..4eca76c 100644 --- a/src/abbrev.c +++ b/src/abbrev.c @@ -9,7 +9,7 @@ #include "edef.h" #include "elang.h" -VOID ab_save(c) +VOID PASCAL NEAR ab_save(c) char c; /* character to add to current word buffer */ @@ -36,12 +36,12 @@ char c; /* character to add to current word buffer */ *ab_pos = 0; } -VOID ab_expand() +VOID PASCAL NEAR ab_expand() { char *exp; /* expansion of current symbol */ char c; /* current character to insert */ - + /* only in ABBREV mode, never in VIEW mode */ if ((curbp->b_mode & MDABBR) == 0 || (curbp->b_mode & MDVIEW) == MDVIEW) @@ -83,7 +83,7 @@ VOID ab_expand() /* add a new abbreviation */ -int add_abbrev(f, n) +int PASCAL NEAR add_abbrev(f, n) int f, n; /* numeric flag and argument */ @@ -114,7 +114,7 @@ int f, n; /* numeric flag and argument */ /* Delete a single abbreviation */ -int del_abbrev(f, n) +int PASCAL NEAR del_abbrev(f, n) int f, n; /* numeric flag and argument */ @@ -134,7 +134,7 @@ int f, n; /* numeric flag and argument */ /* Kill all abbreviations */ -int kill_abbrevs(f, n) +int PASCAL NEAR kill_abbrevs(f, n) int f, n; /* numeric flag and argument */ @@ -143,7 +143,7 @@ int f, n; /* numeric flag and argument */ return(ab_clean()); } -int desc_abbrevs(f, n) +int PASCAL NEAR desc_abbrevs(f, n) int f, n; /* numeric flag and argument */ @@ -192,7 +192,7 @@ int f, n; /* numeric flag and argument */ /* insert a list of all the current abbreviations into the current buffer */ -int ins_abbrevs(f, n) +int PASCAL NEAR ins_abbrevs(f, n) int f, n; /* numeric flag and argument */ @@ -217,7 +217,7 @@ int f, n; /* numeric flag and argument */ return(TRUE); } -int def_abbrevs(f, n) +int PASCAL NEAR def_abbrevs(f, n) int f,n; /* prefix flag and argument */ @@ -268,7 +268,7 @@ int f,n; /* prefix flag and argument */ return(TRUE); } -VOID ab_init() +VOID PASCAL NEAR ab_init() { ab_head = (ABBREV *)NULL; /* abbreviation list empty */ @@ -283,7 +283,7 @@ VOID ab_init() */ -int ab_insert(sym, expansion) +int PASCAL NEAR ab_insert(sym, expansion) char *sym; /* symbol to expand */ char *expansion; /* string to expand to */ @@ -355,7 +355,7 @@ char *expansion; /* string to expand to */ Return a NULL if it is not in the list */ -char *ab_lookup(sym) +char *PASCAL NEAR ab_lookup(sym) char *sym; /* name of the symbol to look up */ @@ -380,7 +380,7 @@ char *sym; /* name of the symbol to look up */ /* ab_delete: Delete from the abbreviation list */ -int ab_delete(sym) +int PASCAL NEAR ab_delete(sym) char *sym; @@ -419,7 +419,7 @@ char *sym; return(FALSE); } -int ab_clean() +int PASCAL NEAR ab_clean() { diff --git a/src/aix.c b/src/aix.c index 2d8e12a..559e2a2 100644 --- a/src/aix.c +++ b/src/aix.c @@ -121,7 +121,6 @@ int scnothing() #endif /* (AVVION || TERMIOS) */ #if CURSES #include /* Curses screen output */ -#undef EWINDOW /* Oh no! */ #endif /* CURSES */ /** Completion include files **/ diff --git a/src/amigados.c b/src/amigados.c index 7e75802..ff34e65 100644 --- a/src/amigados.c +++ b/src/amigados.c @@ -779,7 +779,7 @@ uefilter(f, n) /* return a system dependent string with the current time */ -char *timeset() +char *PASCAL NEAR timeset() { return(errorm); @@ -794,7 +794,7 @@ extern char *scdir(); /* do a wild card directory search (for file name completion) */ -char *getffile(fspec) +char *PASCAL NEAR getffile(fspec) char *fspec; /* pattern to match */ @@ -822,7 +822,7 @@ char *fspec; /* pattern to match */ return(getnfile()); } -char *getnfile() +char *PASCAL NEAR getnfile() { register char *sp; /* return from scdir */ @@ -837,7 +837,7 @@ char *getnfile() return(rbuf); } #else -char *getffile(fspec) +char *PASCAL NEAR getffile(fspec) char *fspec; /* file to match */ @@ -845,7 +845,7 @@ char *fspec; /* file to match */ return(NULL); } -char *getnfile() +char *PASCAL NEAR getnfile() { return(NULL); diff --git a/src/ansi.c b/src/ansi.c index 497a6b5..9a17895 100644 --- a/src/ansi.c +++ b/src/ansi.c @@ -16,17 +16,17 @@ #if ANSI #if PROTO -int fnclabel(int f, int n); -int readparam( int *v); -void dobbnmouse(void); -void docsi( int oh); -void ttputs(char *string); +int PASCAL NEAR fnclabel(int f, int n); +int PASCAL NEAR readparam( int *v); +void PASCAL NEAR dobbnmouse(void); +void PASCAL NEAR docsi( int oh); +void PASCAL NEAR ttputs(char *string); #else -int fnclabel(); -int readparam(); -void dobbnmouse(); -void docsi(); -void ttputs(); +int PASCAL NEAR fnclabel(); +int PASCAL NEAR readparam(); +void PASCAL NEAR dobbnmouse(); +void PASCAL NEAR docsi(); +void PASCAL NEAR ttputs(); #endif #if VMS @@ -57,22 +57,22 @@ extern NOSHARE TTCHAR orgchar; /* Original characteristics */ #define ESC 0x1B /* ESC character. */ /* Forward references. */ -extern int ansimove(); -extern int ansieeol(); -extern int ansieeop(); -extern int ansibeep(); -extern int ansiopen(); -extern int ansirev(); -extern int ansiclose(); -extern int ansikopen(); -extern int ansikclose(); -extern int ansicres(); -extern int ansiparm(); -extern int ansigetc(); +extern int PASCAL NEAR ansimove(); +extern int PASCAL NEAR ansieeol(); +extern int PASCAL NEAR ansieeop(); +extern int PASCAL NEAR ansibeep(); +extern int PASCAL NEAR ansiopen(); +extern int PASCAL NEAR ansirev(); +extern int PASCAL NEAR ansiclose(); +extern int PASCAL NEAR ansikopen(); +extern int PASCAL NEAR ansikclose(); +extern int PASCAL NEAR ansicres(); +extern int PASCAL NEAR ansiparm(); +extern int PASCAL NEAR ansigetc(); #if COLOR -extern int ansifcol(); -extern int ansibcol(); +extern int PASCAL NEAR ansifcol(); +extern int PASCAL NEAR ansibcol(); static int rev_state = FALSE; static int cfcolor = -1; /* current foreground color */ @@ -123,7 +123,7 @@ NOSHARE TERM term = { }; #if COLOR -ansifcol(color) /* set the current output color */ +PASCAL NEAR ansifcol(color) /* set the current output color */ int color; /* color to set */ @@ -155,7 +155,7 @@ int color; /* color to set */ cfcolor = color; } -ansibcol(color) /* set the current background color */ +PASCAL NEAR ansibcol(color) /* set the current background color */ int color; /* color to set */ @@ -174,7 +174,7 @@ int color; /* color to set */ } #endif -ansimove(row, col) +PASCAL NEAR ansimove(row, col) { ttputc(ESC); ttputc('['); @@ -184,14 +184,14 @@ ansimove(row, col) ttputc('H'); } -ansieeol() +PASCAL NEAR ansieeol() { ttputc(ESC); ttputc('['); ttputc('K'); } -ansieeop() +PASCAL NEAR ansieeop() { #if COLOR ansifcol(gfcolor); @@ -203,7 +203,7 @@ ansieeop() ttputc('J'); } -ansirev(state) /* change reverse video state */ +PASCAL NEAR ansirev(state) /* change reverse video state */ int state; /* TRUE = reverse, FALSE = normal */ @@ -228,16 +228,16 @@ int state; /* TRUE = reverse, FALSE = normal */ #endif } -ansicres() /* change screen resolution */ +PASCAL NEAR ansicres() /* change screen resolution */ { return(TRUE); } #if PROTO -spal(char *dummy) /* change pallette settings */ +PASCAL NEAR spal(char *dummy) /* change pallette settings */ #else -spal(dummy) /* change pallette settings */ +PASCAL NEAR spal(dummy) /* change pallette settings */ char *dummy; #endif @@ -246,13 +246,13 @@ char *dummy; /* none for now */ } -ansibeep() +PASCAL NEAR ansibeep() { ttputc(BEL); ttflush(); } -ansiparm(n) +PASCAL NEAR ansiparm(n) register int n; { register int q,r; @@ -268,7 +268,7 @@ register int n; ttputc((n%10) + '0'); } -ansiopen() +PASCAL NEAR ansiopen() { #if USG | AIX | AUX | HPUX8 | HPUX9 | BSD | SUN | XENIX register char *cp; @@ -312,7 +312,7 @@ ansiopen() #endif } -ansiclose() +PASCAL NEAR ansiclose() { #if COLOR @@ -342,12 +342,12 @@ ansiclose() ttclose(); } -ansikopen() /* open the keyboard (a noop here) */ +PASCAL NEAR ansikopen() /* open the keyboard (a noop here) */ { } -ansikclose() /* close the keyboard (a noop here) */ +PASCAL NEAR ansikclose() /* close the keyboard (a noop here) */ { } @@ -358,7 +358,7 @@ ansikclose() /* close the keyboard (a noop here) */ * * Nothing returned ***/ -void ttputs(string) +void PASCAL NEAR ttputs(string) char * string; /* String to write */ { if (string) @@ -378,7 +378,7 @@ static int inlen=0; NOSHARE int mouserow, mousecol; -int readparam( v) /* Read an ansi parameter */ +int PASCAL NEAR readparam( v) /* Read an ansi parameter */ int *v; /* Place to put parameter value */ { int ch; @@ -399,7 +399,7 @@ int *v; /* Place to put parameter value */ * * The 'x' in the arrays keypad[] and dec_fnkey[] are merely placeholders. */ -void docsi( oh) +void PASCAL NEAR docsi( oh) int oh; { static char crsr[4] = {'P', 'N', 'F', 'B'}; @@ -490,7 +490,7 @@ int oh; } } -void dobbnmouse() +void PASCAL NEAR dobbnmouse() { int params[ 5]; int i, ch; @@ -535,7 +535,7 @@ void dobbnmouse() * that come from function keys, mouse reports, and cursor location * reports, and return them using Emacs's coding of these events. */ -ansigetc() +PASCAL NEAR ansigetc() { int ch; @@ -572,11 +572,11 @@ ansigetc() } } #else - ansigetc() {return( ttgetc());} +PASCAL NEAR ansigetc() {return( ttgetc());} #endif #if FLABEL -int fnclabel(f, n) /* label a function key */ +int PASCAL NEAR fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument [unused] */ diff --git a/src/aosvs.c b/src/aosvs.c index dca5e92..7ee1f74 100644 --- a/src/aosvs.c +++ b/src/aosvs.c @@ -846,7 +846,7 @@ int uefilter(f, n) original version didn't work. modified idea of bill benedetto by doug rady. note the use of sys($ITIME, ...) instead of sys_itime() */ -char *timeset() +char *PASCAL NEAR timeset() { register char *sp; /* temp string pointer */ @@ -1357,7 +1357,7 @@ int f,n; /* default flag, numeric argument [unused] */ /* Change the current working directory */ -int chdirectory() +PASCAL NEAR int chdirectory() { #if CHDIR /* include this code? */ @@ -1846,11 +1846,11 @@ char gnfnrbuf[NFILEN]; /* return file buffer */ DIR *gnfndir; struct direct *gnfndirect; -char *getnfile(); +char PASCAL NEAR *getnfile(); /* do a template directory search (for file name completion) */ -char *getffile(fspec) +char *PASCAL NEAR getffile(fspec) char *fspec; /* pattern to match */ @@ -1893,7 +1893,7 @@ char *fspec; /* pattern to match */ return(getnfile()); } -char *getnfile() +char *PASCAL NEAR getnfile() { register int index; /* index into various strings */ diff --git a/src/basic.c b/src/basic.c index cecf0a0..2415e14 100644 --- a/src/basic.c +++ b/src/basic.c @@ -21,7 +21,7 @@ * beginning of the current line. * Trivial. */ -int gotobol(f, n) +int PASCAL NEAR gotobol(f, n) int f,n; /* argument flag and num */ @@ -36,7 +36,7 @@ int f,n; /* argument flag and num */ * location. Error if you try and move out of the buffer. Set the flag if the * line pointer for dot changes. */ -int backchar(f, n) +int PASCAL NEAR backchar(f, n) int f,n; /* prefix flag and argument */ @@ -86,7 +86,7 @@ int f,n; /* prefix flag and argument */ /* * Move the cursor to the end of the current line. Trivial. No errors. */ -int gotoeol(f, n) +int PASCAL NEAR gotoeol(f, n) int f,n; /* argument flag and num */ @@ -101,7 +101,7 @@ int f,n; /* argument flag and num */ * location, and move ".". Error if you try and move off the end of the * buffer. Set the flag if the line pointer for dot changes. */ -int forwchar(f, n) +int PASCAL NEAR forwchar(f, n) int f,n; /* prefix flag and argument */ @@ -148,7 +148,7 @@ int f,n; /* prefix flag and argument */ #endif } -int gotoline(f, n) /* move to a particular line. +int PASCAL NEAR gotoline(f, n) /* move to a particular line. argument (n) must be a positive integer for this to actually do anything */ @@ -183,7 +183,7 @@ int f,n; /* prefix flag and argument */ * considered to be hard motion; it really isn't if the original value of dot * is the same as the new value of dot. Normally bound to "M-<". */ -int gotobob(f, n) +int PASCAL NEAR gotobob(f, n) int f,n; /* argument flag and num */ @@ -199,7 +199,7 @@ int f,n; /* argument flag and num */ * (ZJ). The standard screen code does most of the hard parts of update. * Bound to "M->". */ -int gotoeob(f, n) +int PASCAL NEAR gotoeob(f, n) int f,n; /* argument flag and num */ @@ -260,7 +260,7 @@ int f,n; /* argument flag and num */ * alternate. Figure out the new line and call "movedot" to perform the * motion. No errors are possible. Bound to "C-P". */ -int backline(f, n) +int PASCAL NEAR backline(f, n) int f,n; /* argument flag and num */ @@ -299,7 +299,7 @@ int f,n; /* argument flag and num */ #endif } -int gotobop(f, n) /* go back to the beginning of the current paragraph +int PASCAL NEAR gotobop(f, n) /* go back to the beginning of the current paragraph here we look for a blank line or a character from $paralead to delimit the beginning of a paragraph or $fmtlead to delimit a line before the paragraph */ @@ -365,7 +365,7 @@ int f, n; /* default Flag & Numeric argument */ return(TRUE); } -int gotoeop(f, n) /* go forword to the end of the current paragraph +int PASCAL NEAR gotoeop(f, n) /* go forword to the end of the current paragraph looking for a member of $paralead or $fmtlead or a blank line to delimit the start of the next paragraph @@ -445,7 +445,7 @@ int f, n; /* default Flag & Numeric argument */ * Used by "C-N" and "C-P". */ -int getgoal(dlp) +int PASCAL NEAR getgoal(dlp) register LINE *dlp; @@ -499,7 +499,7 @@ register LINE *dlp; * is overlap between screens. This defaults to overlap value in ITS EMACS. * Because this zaps the top line in the window, we have to do a hard update. */ -int forwpage(f, n) +int PASCAL NEAR forwpage(f, n) int f,n; /* prefix flag and argument */ @@ -532,7 +532,7 @@ int f,n; /* prefix flag and argument */ * EMACS manual. Bound to "M-V". We do a hard update for exactly the same * reason. */ -int backpage(f, n) +int PASCAL NEAR backpage(f, n) register int f; register int n; @@ -564,7 +564,7 @@ register int n; * Set the mark in the current window to the value of "." in the window. No * errors are possible. Bound to "M-.". */ -int setmark(f, n) +int PASCAL NEAR setmark(f, n) int f,n; /* argument flag and num */ @@ -585,7 +585,7 @@ int f,n; /* argument flag and num */ * Remove the mark in the current window. * Bound to ^X */ -int remmark(f, n) +int PASCAL NEAR remmark(f, n) int f,n; /* argument flag and num */ @@ -608,7 +608,7 @@ int f,n; /* argument flag and num */ * that moves the mark about. The only possible error is "no mark". Bound to * "C-X C-X". */ -int swapmark(f, n) +int PASCAL NEAR swapmark(f, n) int f,n; /* argument flag and num */ @@ -641,7 +641,7 @@ int f,n; /* argument flag and num */ * the hard work gets done by the standard routine that moves the mark * about. The only possible error is "no mark". Bound to "M-^G". */ -int gotomark(f, n) +int PASCAL NEAR gotomark(f, n) int f, n; /* default and numeric args */ @@ -665,7 +665,7 @@ int f, n; /* default and numeric args */ #if DBCS /* advance a char if we are on the second byte of a DBCS character */ -int stopforw() +int PASCAL NEAR stopforw() { /* don't stop on the second byte of a 2 byte character */ @@ -677,7 +677,7 @@ int stopforw() /* retreat a char if we are on the second byte of a DBCS character */ -int stopback() +int PASCAL NEAR stopback() { /* don't stop on the second byte of a 2 byte character */ diff --git a/src/bind.c b/src/bind.c index ebbf351..8653976 100644 --- a/src/bind.c +++ b/src/bind.c @@ -13,7 +13,7 @@ #include "elang.h" #include "epath.h" -int help(f, n) /* give me some help!!!!! +int PASCAL NEAR help(f, n) /* give me some help!!!!! bring up a fake buffer and read the help file into it with view mode */ @@ -77,7 +77,7 @@ int f,n; /* prefix flag and argument */ return(TRUE); } -int deskey(f, n) /* describe the command for a certain key */ +int PASCAL NEAR deskey(f, n) /* describe the command for a certain key */ int f,n; /* prefix flag and argument */ @@ -107,13 +107,13 @@ int f,n; /* prefix flag and argument */ /* bindtokey: add a new key to the key binding table */ -int bindtokey(f, n) +int PASCAL NEAR bindtokey(f, n) int f, n; /* command arguments [IGNORED] */ { register unsigned int c;/* command key to bind */ - register int (*kfunc)();/* ptr to the requested function to bind to */ + register int (PASCAL NEAR *kfunc)();/* ptr to the requested function to bind to */ register KEYTAB *ktp; /* pointer into the command table */ register int found; /* matched command flag */ char outseq[80]; /* output buffer for keystroke sequence */ @@ -210,7 +210,7 @@ int f, n; /* command arguments [IGNORED] */ /* macrotokey: Bind a key to a macro in the key binding table */ -int macrotokey(f, n) +int PASCAL NEAR macrotokey(f, n) int f, n; /* command arguments [IGNORED] */ @@ -288,7 +288,7 @@ int f, n; /* command arguments [IGNORED] */ /* unbindkey: delete a key from the key binding table */ -int unbindkey(f, n) +int PASCAL NEAR unbindkey(f, n) int f, n; /* command arguments [IGNORED] */ @@ -316,7 +316,7 @@ int f, n; /* command arguments [IGNORED] */ return(TRUE); } -int unbindchar(c) +int PASCAL NEAR unbindchar(c) int c; /* command key to unbind */ @@ -363,7 +363,7 @@ int c; /* command key to unbind */ /* unbind all the keys bound to a buffer (which we can then delete */ -VOID unbind_buf(bp) +VOID PASCAL NEAR unbind_buf(bp) BUFFER *bp; /* buffer to unbind all keys connected to */ @@ -389,7 +389,7 @@ BUFFER *bp; /* buffer to unbind all keys connected to */ into it with view mode */ -int desbind(f, n) +int PASCAL NEAR desbind(f, n) int f,n; /* prefix flag and argument */ @@ -397,7 +397,7 @@ int f,n; /* prefix flag and argument */ return(buildlist(TRUE, "")); } -int apro(f, n) /* Apropos (List functions that match a substring) */ +int PASCAL NEAR apro(f, n) /* Apropos (List functions that match a substring) */ int f,n; /* prefix flag and argument */ @@ -413,7 +413,7 @@ int f,n; /* prefix flag and argument */ return(buildlist(FALSE, mstring)); } -int buildlist(type, mstring) /* build a binding list (limited or full) */ +int PASCAL NEAR buildlist(type, mstring) /* build a binding list (limited or full) */ int type; /* true = full list, false = partial list */ char *mstring; /* match string if a partial list */ @@ -549,7 +549,7 @@ char *mstring; /* match string if a partial list */ return(TRUE); } -int strinc(source, sub) /* does source include sub? */ +int PASCAL NEAR strinc(source, sub) /* does source include sub? */ char *source; /* string to search in */ char *sub; /* substring to look for */ @@ -585,7 +585,7 @@ char *sub; /* substring to look for */ /* get a command key sequence from the keyboard */ -unsigned int getckey(mflag) +unsigned int PASCAL NEAR getckey(mflag) int mflag; /* going for a meta sequence? */ @@ -609,7 +609,7 @@ int mflag; /* going for a meta sequence? */ /* execute the startup file */ -int startup(sfname) +int PASCAL NEAR startup(sfname) char *sfname; /* name of startup file (null if default) */ @@ -653,7 +653,7 @@ char *sfname; /* name of startup file (null if default) */ directories in table from EPATH.H */ -CONST char *flook(fname, hflag) +CONST char *PASCAL NEAR flook(fname, hflag) CONST char *fname; /* base file name to search for */ int hflag; /* Look in the HOME environment variable first? */ @@ -661,7 +661,7 @@ int hflag; /* Look in the HOME environment variable first? */ { register char *home; /* path to home directory */ register char *path; /* environmental PATH variable */ - register char *sp;/* pointer into path spec */ + register char *sp; /* pointer into path spec */ register int i; /* index */ static char fspec[NFILEN]; /* full path spec to search */ @@ -773,7 +773,7 @@ int hflag; /* Look in the HOME environment variable first? */ /* Change a key command to a string we can print out. * Return the string passed in. */ -char *cmdstr(c, seq) +char *PASCAL NEAR cmdstr(c, seq) int c; /* sequence to translate */ char *seq; /* destination string for sequence */ @@ -868,12 +868,12 @@ register int c; /* key to find what is bound to it */ associated with it */ -CONST char *getfname(key) +CONST char *PASCAL NEAR getfname(key) KEYTAB *key; /* key binding to return a name of */ { - int (*func)(); /* ptr to the requested function */ + int (PASCAL NEAR *func)(); /* ptr to the requested function */ register NBIND *nptr; /* pointer into the name binding table */ register BUFFER *bp; /* ptr to buffer to test */ register BUFFER *kbuf; /* ptr to requested buffer */ @@ -912,16 +912,14 @@ KEYTAB *key; /* key binding to return a name of */ any match or NULL if none */ #if MSC -int (*fncmatch(char *fname))(void) -#else -#if THEOS +int (PASCAL NEAR *PASCAL NEAR fncmatch(char *fname))(void) +#elif THEOS int *fncmatch(char *fname) #else -int (*fncmatch(fname))(void) +int (PASCAL NEAR *PASCAL NEAR fncmatch(fname))() char *fname; /* name to attempt to match */ #endif -#endif { int nval; @@ -932,7 +930,7 @@ char *fname; /* name to attempt to match */ return(names[nval].n_func); } -char *namval(index) +char *PASCAL NEAR namval(index) int index; /* index of name to fetch out of the name table */ @@ -958,7 +956,7 @@ int index; /* index of name to fetch out of the name table */ the ^A form. */ -unsigned int stock(keyname) +unsigned int PASCAL NEAR stock(keyname) unsigned char *keyname; /* name of key to translate to Command key form */ @@ -1030,7 +1028,7 @@ unsigned char *keyname; /* name of key to translate to Command key form */ return(c); } -CONST char *transbind(skey) /* string key name to binding name.... */ +CONST char *PASCAL NEAR transbind(skey) /* string key name to binding name.... */ CONST char *skey; /* name of key to get binding for */ @@ -1044,7 +1042,7 @@ CONST char *skey; /* name of key to get binding for */ return(bindname); } -int execkey(key, f, n) /* execute a function bound to a key */ +int PASCAL NEAR execkey(key, f, n) /* execute a function bound to a key */ KEYTAB *key; /* key to execute */ int f, n; /* agruments to C function */ @@ -1092,7 +1090,7 @@ KEYTAB *key; /* ptr to key to set */ char *name; /* name of function or buffer */ #endif { - int (*ktemp)(); /* temp function pointer to assign */ + int (PASCAL NEAR *ktemp)(); /* temp function pointer to assign */ register BUFFER *kmacro; /* ptr to buffer of macro to bind to key */ char bufn[NBUFN]; /* buffer to hold macro name */ diff --git a/src/buffer.c b/src/buffer.c index 5860719..83b3ae0 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -19,7 +19,7 @@ * if the use count is 0. Otherwise, they come * from some other window. */ -int usebuffer(f, n) +int PASCAL NEAR usebuffer(f, n) int f,n; /* prefix flag and argument */ @@ -41,7 +41,7 @@ int f,n; /* prefix flag and argument */ return(swbuffer(bp)); } -int nextbuffer(f, n) /* switch to the next buffer in the buffer list */ +int PASCAL NEAR nextbuffer(f, n) /* switch to the next buffer in the buffer list */ int f, n; /* default flag, numeric argument */ { @@ -66,7 +66,7 @@ int f, n; /* default flag, numeric argument */ return(status); } -int swbuffer(bp) /* make buffer BP current */ +int PASCAL NEAR swbuffer(bp) /* make buffer BP current */ BUFFER *bp; @@ -158,7 +158,7 @@ BUFFER *bp; * if the buffer has been changed). Then free the header * line and the buffer header. Bound to "C-X K". */ -int killbuffer(f, n) +int PASCAL NEAR killbuffer(f, n) int f,n; /* prefix flag and argument */ @@ -177,7 +177,7 @@ int f,n; /* prefix flag and argument */ /* Allow the user to pop up a buffer, like we do.... */ -int popbuffer(f, n) +int PASCAL NEAR popbuffer(f, n) int f, n; /* default and numeric arguments */ @@ -198,7 +198,7 @@ int f, n; /* default and numeric arguments */ return(pop(bp)); } -BUFFER *getdefb() /* get the default buffer for a use or kill */ +BUFFER *PASCAL NEAR getdefb() /* get the default buffer for a use or kill */ { BUFFER *bp; /* default buffer */ @@ -222,7 +222,7 @@ BUFFER *getdefb() /* get the default buffer for a use or kill */ return(bp); } -int zotbuf(bp) /* kill the buffer pointed to by bp */ +int PASCAL NEAR zotbuf(bp) /* kill the buffer pointed to by bp */ register BUFFER *bp; @@ -313,7 +313,7 @@ ask: if (mlreply(TEXT29, bufn, NBUFN) != TRUE) invisible buffers as well. */ -int listbuffers(f, n) +int PASCAL NEAR listbuffers(f, n) int f,n; /* prefix flag and argument */ @@ -334,7 +334,7 @@ int f,n; /* prefix flag and argument */ * is an error (if there is no memory). Iflag * indicates whether to list hidden buffers. */ -int makelist(iflag) +int PASCAL NEAR makelist(iflag) int iflag; /* list hidden buffer flag */ @@ -473,7 +473,7 @@ int iflag; /* list hidden buffer flag */ /* Translate a long to ascii form. Don't trust various systems ltoa() routines.. they aren't consistant */ -VOID flong_asc(buf, width, num) +VOID PASCAL NEAR flong_asc(buf, width, num) char buf[]; int width; @@ -500,7 +500,7 @@ long num; * Return FALSE if no buffers * have been changed. */ -int anycb() +int PASCAL NEAR anycb() { register BUFFER *bp; @@ -520,7 +520,7 @@ int anycb() * and the "cflag" is TRUE, create it. The "bflag" is * the settings for the flags in in buffer. */ -BUFFER *bfind(bname, cflag, bflag) +BUFFER *PASCAL NEAR bfind(bname, cflag, bflag) CONST register char *bname; /* name of buffer to find */ int cflag; /* create it if not found? */ @@ -610,7 +610,7 @@ int bflag; /* bit settings for a new buffer */ * that are required. Return TRUE if everything * looks good. */ -int bclear(bp) +int PASCAL NEAR bclear(bp) register BUFFER *bp; { register LINE *lp; @@ -636,7 +636,7 @@ register BUFFER *bp; return(TRUE); } -int unmark(f, n) /* unmark the current buffers change flag */ +int PASCAL NEAR unmark(f, n) /* unmark the current buffers change flag */ int f, n; /* unused command arguments */ @@ -650,7 +650,7 @@ int f, n; /* unused command arguments */ return(TRUE); } -BUFFER *getoldb() /* get the most ancient visited buffer */ +BUFFER *PASCAL NEAR getoldb() /* get the most ancient visited buffer */ { BUFFER *bp; /* current buffer */ diff --git a/src/char.c b/src/char.c index 1cf8214..29e72f3 100644 --- a/src/char.c +++ b/src/char.c @@ -14,100 +14,8 @@ #include "edef.h" #include "elang.h" -#if UTF8 - -/* is_letter() - Is the character a letter? We presume a letter must - be either in the upper or lower case tables (even if it gets - translated to itself). -*/ - -int is_letter(ch) - -unsigned int ch; - -{ - return(iswalpha(ch)); -} - -/* is_lower() - Is the character a lower case letter? This looks - in the lower to uppercase translation table. -*/ - -int is_lower(ch) - -unsigned int ch; - -{ - return(iswlower(ch)); -} - -/* is_upper() - Is the character a upper case letter? This looks - in the upper to lowercase translation table. -*/ - -int is_upper(ch) - -unsigned int ch; - -{ - return(iswupper(ch)); -} - - -/* chcase() - - Change the case of the current character. - First check lower and then upper. If it is not a letter, - it gets returned unchanged. -*/ - -unsigned int chcase(ch) -unsigned int ch; -{ - /* translate lower case */ - if (iswlower(ch)) - return(ToWUpper(ch)); - - /* translate upper case */ - if (iswupper(ch)) - return(ToWLower(ch)); - - /* let the rest pass */ - return(ch); -} - -#if PROTO -unsigned int upperc(unsigned int ch) /* return the upper case equivalant of a character */ -#else -int upperc(ch) /* return the upper case equivalant of a character */ - -unsigned int ch; /* character to get uppercase euivalant of */ -#endif -{ - if (iswlower(ch)) - return(ToWUpper(ch)); - else - return(ch); -} - -#if PROTO -unsigned int lowerc(unsigned int ch) /* return the lower case equivalant of a character */ -#else -unsigned int lowerc(ch) /* return the lower case equivalant of a character */ - -unsigned int ch; /* character to get lowercase equivalant of */ -#endif -{ - if (iswupper(ch)) - return(ToWLower(ch)); - else - return(ch); -} +#if ! UTF8 -#else /* is_letter() Is the character a letter? We presume a letter must @@ -115,7 +23,7 @@ unsigned int ch; /* character to get lowercase equivalant of */ translated to itself). */ -int is_letter(ch) +int PASCAL NEAR is_letter(ch) register char ch; @@ -128,7 +36,7 @@ register char ch; in the lower to uppercase translation table. */ -int is_lower(ch) +int PASCAL NEAR is_lower(ch) register char ch; @@ -141,7 +49,7 @@ register char ch; in the upper to lowercase translation table. */ -int is_upper(ch) +int PASCAL NEAR is_upper(ch) register char ch; @@ -156,7 +64,7 @@ register char ch; it gets returned unchanged. */ -unsigned int chcase(ch) +unsigned int PASCAL NEAR chcase(ch) register unsigned int ch; { /* translate lowercase */ @@ -171,10 +79,34 @@ register unsigned int ch; return(ch); } +/* change *cp to an upper case character */ + +VOID PASCAL NEAR uppercase(cp) + +unsigned char *cp; /* ptr to character to uppercase */ + +{ + /* translate uppercase */ + if (is_lower(*cp)) + *cp = lowcase[*cp & 255]; +} + +/* change *cp to an lower case character */ + +VOID PASCAL NEAR lowercase(cp) + +unsigned char *cp; /* ptr to character to lowercase */ + +{ + /* translate lowercase */ + if (is_upper(*cp)) + *cp = upcase[*cp & 255]; +} + #if PROTO -int upperc(char ch) /* return the upper case equivalant of a character */ +int PASCAL NEAR upperc(char ch) /* return the upper case equivalant of a character */ #else -int upperc(ch) /* return the upper case equivalant of a character */ +int PASCAL NEAR upperc(ch) /* return the upper case equivalant of a character */ unsigned char ch; /* character to get uppercase euivalant of */ #endif @@ -186,9 +118,9 @@ unsigned char ch; /* character to get uppercase euivalant of */ } #if PROTO -int lowerc(char ch) /* return the lower case equivalant of a character */ +int PASCAL NEAR lowerc(char ch) /* return the lower case equivalant of a character */ #else -int lowerc(ch) /* return the lower case equivalant of a character */ +int PASCAL NEAR lowerc(ch) /* return the lower case equivalant of a character */ unsigned char ch; /* character to get lowercase equivalant of */ #endif @@ -199,83 +131,7 @@ unsigned char ch; /* character to get lowercase equivalant of */ return(ch); } -#endif /* UTF8 */ - -/* change *cp to an upper case character */ - -int uppercase(cp) - -unsigned char *cp; /* ptr to character to uppercase */ - -{ -#if UTF8 - /* translate upper case */ - if (is_multibyte_utf8(*cp)) { - char utf8[6]; - size_t len = strlen((char*) cp); - unsigned int wc; - unsigned int bytes = utf8_to_unicode((char*) cp, 0, len, &wc); - - if (iswlower(wc)) { - wc = ToWUpper(wc); - /* it's a in place conversion, so do it only if the converted - * character has the same number of bytes as the original. */ - if (unicode_to_utf8(wc, utf8) == bytes) - memcpy(cp, utf8, bytes); - } - - return bytes; - } - - if (islower(*cp)) - *cp = toupper(*cp); -#else - /* translate uppercase */ - if (is_lower(*cp)) - *cp = lowcase[*cp & 255]; -#endif - return 1; -} - -/* change *cp to an lower case character */ - -int lowercase(cp) - -unsigned char* cp; /* ptr to character to lowercase */ - -{ -#if UTF8 - /* translate lower case */ - if (is_multibyte_utf8(*cp)) { - char utf8[6]; - size_t len = strlen((char*) cp); - unsigned int wc; - unsigned int bytes = utf8_to_unicode((char*) cp, 0, len, &wc); - - if (iswupper(wc)) { - wc = ToWLower(wc); - /* it's a in place conversion, so do it only if the converted - * character has the same number of bytes as the original. */ - if (unicode_to_utf8(wc, utf8) == bytes) - memcpy(cp, utf8, bytes); - } - - return bytes; - } - - if (isupper(*cp)) - *cp = tolower(*cp); -#else - /* translate lowercase */ - if (is_upper(*cp)) - *cp = upcase[*cp & 255]; -#endif - return 1; -} - -#if ! UTF8 - -VOID initchars() /* initialize the character upper/lower case tables */ +VOID PASCAL NEAR initchars() /* initialize the character upper/lower case tables */ { register int index; /* index into tables */ @@ -439,7 +295,7 @@ VOID initchars() /* initialize the character upper/lower case tables */ /* Set a character in the lowercase map */ -int setlower(ch, val) +int PASCAL NEAR setlower(ch, val) char *ch; /* ptr to character to set */ char *val; /* value to set it to */ @@ -450,7 +306,7 @@ char *val; /* value to set it to */ /* Set a character in the uppercase map */ -int setupper(ch, val) +int PASCAL NEAR setupper(ch, val) char *ch; /* ptr to character to set */ char *val; /* value to set it to */ @@ -483,11 +339,36 @@ char *our_str; } #endif /* (ZTC | TURBO | MSC) == 0 */ -#else +#if DBCS +/* is this character a 2 byte character prefix code? */ + +int PASCAL NEAR is2byte(sp, cp) + +char *sp; /* ptr to beginning of string containing character to test */ +char *cp; /* ptr to charactor to test */ + +{ + register char *cc; /* pointer to current character */ + + cc = sp; + while (*cc) { + if (cc > cp) + return(FALSE); + if (cc == cp) + return(is2char(*cp)); + if (is2char(*cc)) + ++cc; + ++cc; + } + return(FALSE); +} +#endif + +#else /* ! UTF8 */ /* Set a character in the lowercase map */ -int setlower(ch, val) +int PASCAL NEAR setlower(ch, val) char *ch; /* ptr to character to set */ char *val; /* value to set it to */ @@ -509,7 +390,7 @@ char *val; /* value to set it to */ /* Set a character in the uppercase map */ -int setupper(ch, val) +int PASCAL NEAR setupper(ch, val) char *ch; /* ptr to character to set */ char *val; /* value to set it to */ @@ -571,32 +452,158 @@ char *strrev(char *str) return str; } -#endif /* UTF8 */ +/* is_letter() + Is the character a letter? We presume a letter must + be either in the upper or lower case tables (even if it gets + translated to itself). +*/ -#if DBCS -/* is this character a 2 byte character prefix code? */ +int PASCAL NEAR is_letter(ch) -int is2byte(sp, cp) +unsigned int ch; -char *sp; /* ptr to beginning of string containing character to test */ -char *cp; /* ptr to charactor to test */ +{ + return(iswalpha(ch)); +} + +/* is_lower() + Is the character a lower case letter? This looks + in the lower to uppercase translation table. +*/ + +int PASCAL NEAR is_lower(ch) + +unsigned int ch; { - register char *cc; /* pointer to current character */ + return(iswlower(ch)); +} - cc = sp; - while (*cc) { - if (cc > cp) - return(FALSE); - if (cc == cp) - return(is2char(*cp)); - if (is2char(*cc)) - ++cc; - ++cc; - } - return(FALSE); +/* is_upper() + Is the character a upper case letter? This looks + in the upper to lowercase translation table. +*/ + +int PASCAL NEAR is_upper(ch) + +unsigned int ch; + +{ + return(iswupper(ch)); +} + +/* chcase() + + Change the case of the current character. + First check lower and then upper. If it is not a letter, + it gets returned unchanged. +*/ + +unsigned int PASCAL NEAR chcase(ch) +register unsigned int ch; +{ + /* translate lower case */ + if (iswlower(ch)) + return(ToWUpper(ch)); + + /* translate upper case */ + if (iswupper(ch)) + return(ToWLower(ch)); + + /* let the rest pass */ + return(ch); } + +#if PROTO +unsigned int upperc(unsigned int ch) /* return the upper case equivalant of a character */ +#else +int upperc(ch) /* return the upper case equivalant of a character */ + +unsigned int ch; /* character to get uppercase euivalant of */ +#endif +{ + if (iswlower(ch)) + return(ToWUpper(ch)); + else + return(ch); +} + +#if PROTO +unsigned int PASCAL NEAR lowerc(unsigned int ch) /* return the lower case equivalant of a character */ +#else +unsigned int PASCAL NEAR lowerc(ch) /* return the lower case equivalant of a character */ + +unsigned int ch; /* character to get lowercase equivalant of */ #endif +{ + if (iswupper(ch)) + return(ToWLower(ch)); + else + return(ch); +} + +/* change *cp to an upper case character */ + +int PASCAL NEAR uppercase(cp) + +unsigned char *cp; /* ptr to character to uppercase */ + +{ + /* translate upper case */ + if (is_multibyte_utf8(*cp)) { + char utf8[6]; + size_t len = strlen((char*) cp); + unsigned int wc; + unsigned int bytes = utf8_to_unicode((char*) cp, 0, len, &wc); + + if (iswlower(wc)) { + wc = ToWUpper(wc); + /* it's a in place conversion, so do it only if the converted + * character has the same number of bytes as the original. */ + if (unicode_to_utf8(wc, utf8) == bytes) + memcpy(cp, utf8, bytes); + } + + return bytes; + } + + if (islower(*cp)) + *cp = toupper(*cp); + + return 1; +} + +/* change *cp to an lower case character */ + +int PASCAL NEAR lowercase(cp) + +unsigned char* cp; /* ptr to character to lowercase */ + +{ + /* translate lower case */ + if (is_multibyte_utf8(*cp)) { + char utf8[6]; + size_t len = strlen((char*) cp); + unsigned int wc; + unsigned int bytes = utf8_to_unicode((char*) cp, 0, len, &wc); + + if (iswupper(wc)) { + wc = ToWLower(wc); + /* it's a in place conversion, so do it only if the converted + * character has the same number of bytes as the original. */ + if (unicode_to_utf8(wc, utf8) == bytes) + memcpy(cp, utf8, bytes); + } + + return bytes; + } + + if (isupper(*cp)) + *cp = tolower(*cp); + return 1; +} + +#endif /* ! UTF8 */ #if MDSLINE unsigned int theoxtosgraph(unsigned int c) @@ -681,4 +688,4 @@ unsigned int tosgraph(unsigned int c) return c; } -#endif +#endif /* MDSLINE */ diff --git a/src/cmdfix.c b/src/cmdfix.c index 780cae3..aff5f9f 100644 --- a/src/cmdfix.c +++ b/src/cmdfix.c @@ -13,7 +13,7 @@ #include #include "estruct.h" -fix(); +PASCAL fix(); /* Table of command key name changes */ @@ -87,7 +87,7 @@ char *trans[][2] = { "FNu", "FN^>", "FNv", "FN^V", "FNw", "FN^<", - "FN�", "FN^Z", + "FN„", "FN^Z", "set-fill-column", "set $fillcol", }; @@ -143,7 +143,7 @@ char *argv[]; /* text of command line arguments */ exit(0); } -fix(fname) +PASCAL fix(fname) char *fname; /* file to fix */ diff --git a/src/crypt.c b/src/crypt.c index a2bc67d..57b1d28 100644 --- a/src/crypt.c +++ b/src/crypt.c @@ -11,12 +11,12 @@ #if CRYPT #if PROTO -static int mod95(int); +static int PASCAL NEAR mod95(int); #else -static int mod95(); +static int PASCAL NEAR mod95(); #endif -int setekey(f, n) /* reset encryption key of current buffer */ +int PASCAL NEAR setekey(f, n) /* reset encryption key of current buffer */ int f; /* default flag */ int n; /* numeric argument */ @@ -140,7 +140,7 @@ int n; /* numeric argument */ * **********/ -VOID ecrypt(bptr, len) +VOID PASCAL NEAR ecrypt(bptr, len) register char *bptr; /* buffer of characters to be encrypted */ register unsigned len; /* number of characters in the buffer */ { @@ -202,7 +202,7 @@ register unsigned len; /* number of characters in the buffer */ return; } -static int mod95(val) +static int PASCAL NEAR mod95(val) register int val; diff --git a/src/dg10.c b/src/dg10.c index 69c885b..c6d7799 100644 --- a/src/dg10.c +++ b/src/dg10.c @@ -21,25 +21,25 @@ #define BEL 0x07 /* BEL character. */ #define ESC 30 /* DG10 ESC character. */ -extern ttopen(); /* Forward references. */ -extern ttgetc(); -extern ttputc(); -extern ttflush(); -extern ttclose(); -extern dg10kopen(); -extern dg10kclose(); -extern dg10move(); -extern dg10eeol(); -extern dg10eeop(); -extern dg10beep(); -extern dg10open(); -extern dg10rev(); -extern dg10close(); -extern dg10cres(); +extern PASCAL NEAR ttopen(); /* Forward references. */ +extern PASCAL NEAR ttgetc(); +extern PASCAL NEAR ttputc(); +extern PASCAL NEAR ttflush(); +extern PASCAL NEAR ttclose(); +extern PASCAL NEAR dg10kopen(); +extern PASCAL NEAR dg10kclose(); +extern PASCAL NEAR dg10move(); +extern PASCAL NEAR dg10eeol(); +extern PASCAL NEAR dg10eeop(); +extern PASCAL NEAR dg10beep(); +extern PASCAL NEAR dg10open(); +extern PASCAL NEAR dg10rev(); +extern PASCAL NEAR dg10close(); +extern PASCAL NEAR dg10cres(); #if COLOR -extern dg10fcol(); -extern dg10bcol(); +extern PASCAL NEAR dg10fcol(); +extern PASCAL NEAR dg10bcol(); int cfcolor = -1; /* current forground color */ int cbcolor = -1; /* current background color */ @@ -80,7 +80,7 @@ TERM term = { }; #if COLOR -dg10fcol(color) /* set the current output color */ +PASCAL NEAR dg10fcol(color) /* set the current output color */ int color; /* color to set */ @@ -93,7 +93,7 @@ int color; /* color to set */ cfcolor = color; } -dg10bcol(color) /* set the current background color */ +PASCAL NEAR dg10bcol(color) /* set the current background color */ int color; /* color to set */ @@ -107,19 +107,19 @@ int color; /* color to set */ } #endif -dg10move(row, col) +PASCAL NEAR dg10move(row, col) { ttputc(16); ttputc(col); ttputc(row); } -dg10eeol() +PASCAL NEAR dg10eeol() { ttputc(11); } -dg10eeop() +PASCAL NEAR dg10eeop() { #if COLOR dg10fcol(gfcolor); @@ -130,7 +130,7 @@ dg10eeop() ttputc(0106); } -dg10rev(state) /* change reverse video state */ +PASCAL NEAR dg10rev(state) /* change reverse video state */ int state; /* TRUE = reverse, FALSE = normal */ @@ -146,25 +146,25 @@ int state; /* TRUE = reverse, FALSE = normal */ #endif } -dg10cres() /* change screen resolution */ +PASCAL NEAR dg10cres() /* change screen resolution */ { return(TRUE); } -spal() /* change palette string */ +PASCAL NEAR spal() /* change palette string */ { /* Does nothing here */ } -dg10beep() +PASCAL NEAR dg10beep() { ttputc(BEL); ttflush(); } -dg10open() +PASCAL NEAR dg10open() { strcpy(sres, "NORMAL"); strcpy(os, "DG10); @@ -172,7 +172,7 @@ dg10open() ttopen(); } -dg10close() +PASCAL NEAR dg10close() { #if COLOR @@ -182,18 +182,18 @@ dg10close() ttclose(); } -dg10kopen() +PASCAL NEAR dg10kopen() { } -dg10kclose() +PASCAL NEAR dg10kclose() { } #if FLABEL -fnclabel(f, n) /* label a function key */ +PASCAL NEAR fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument [unused] */ diff --git a/src/display.c b/src/display.c index e6c9168..1e23a3a 100644 --- a/src/display.c +++ b/src/display.c @@ -29,14 +29,14 @@ static VIDEO **pscreen; /* Physical screen. */ #if PROTO #if MEMMAP -extern VOID update_line(int row, struct VIDEO *vp1); +extern VOID PASCAL NEAR update_line(int row, struct VIDEO *vp1); #else -extern VOID update_line(int row, struct VIDEO *vp1, struct VIDEO *vp2); +extern VOID PASCAL NEAR update_line(int row, struct VIDEO *vp1, struct VIDEO *vp2); #endif -extern VOID update_hilite(void); +extern VOID PASCAL NEAR update_hilite(void); #else -extern VOID update_line(); -extern VOID update_hilite(); +extern VOID PASCAL NEAR update_line(); +extern VOID PASCAL NEAR update_hilite(); #endif /* @@ -47,7 +47,7 @@ extern VOID update_hilite(); * redrawn on the first call to "update". */ -int vtinit() +int PASCAL NEAR vtinit() { register int i; register VIDEO *vp; @@ -133,7 +133,7 @@ int vtinit() #if CLEAN || WINDOW_MSWIN /* free up all the dynamically allocated video structures */ -VOID vtfree() +VOID PASCAL NEAR vtfree() { int i; for (i = 0; i < term.t_mrow; ++i) { @@ -153,7 +153,7 @@ VOID vtfree() /* vtscreen: map a screen into the Virtual Terminal system */ /* ======== */ -VOID vtscreen(ESCREEN *sp) +VOID PASCAL NEAR vtscreen(ESCREEN *sp) { TTflush(); term.t_roworg = sp->s_roworg; @@ -170,7 +170,7 @@ VOID vtscreen(ESCREEN *sp) /* vtinitscr: build a virtual terminal resource for a new screen */ /* ========= */ -int vtinitscr(ESCREEN *sp, int nrow, int ncol) +int PASCAL NEAR vtinitscr(ESCREEN *sp, int nrow, int ncol) /* returns TRUE if successful */ { @@ -200,7 +200,7 @@ int vtinitscr(ESCREEN *sp, int nrow, int ncol) /* vtfreescr: delete a virtual terminal resource for a dying screen */ /* ========= */ -vtfreescr(ESCREEN *sp) +VOID PASCAL NEAR vtfreescr(ESCREEN *sp) { vtscreen(sp); vtfree(); @@ -210,7 +210,7 @@ vtfreescr(ESCREEN *sp) /* vtsizescr: resize the virtual terminal resources */ /* ========= */ -int vtsizescr(ESCREEN *sp, int nrow, int ncol) +int PASCAL NEAR vtsizescr(ESCREEN *sp, int nrow, int ncol) /* returns TRUE if successful. Otherwise, the old VIDEO structures are preserved. */ @@ -260,7 +260,7 @@ int vtsizescr(ESCREEN *sp, int nrow, int ncol) * system prompt will be written in the line). Shut down the channel to the * terminal. */ -VOID vttidy(VOID) +VOID PASCAL NEAR vttidy(VOID) { mlerase(); movecursor(term.t_nrow, 0); @@ -274,7 +274,7 @@ VOID vttidy(VOID) * screen. There is no checking for nonsense values; this might be a good * idea during the early stages. */ -VOID vtmove(row, col) +VOID PASCAL NEAR vtmove(row, col) int row, col; @@ -290,7 +290,7 @@ int row, col; terminal buffers. Only column overflow is checked. */ -VOID vtputc(c) +VOID PASCAL NEAR vtputc(c) int c; @@ -356,7 +356,7 @@ int c; * Erase from the end of the software cursor to the end of the line on which * the software cursor is located. */ -VOID vteeol() +VOID PASCAL NEAR vteeol() { register VIDEO *vp; @@ -371,7 +371,7 @@ VOID vteeol() /* upscreen: user routine to force a screen update always finishes complete update */ -int upscreen(f, n) +int PASCAL NEAR upscreen(f, n) int f,n; /* prefix flag and argument */ @@ -387,7 +387,7 @@ int f,n; /* prefix flag and argument */ * correct for the current window. Third, make the virtual and physical * screens the same. */ -VOID update(force) +VOID PASCAL NEAR update(force) int force; /* force update past type ahead? */ @@ -528,7 +528,7 @@ int force; /* force update past type ahead? */ /* reframe: check to see if the cursor is on in the window and re-frame it if needed or wanted */ -VOID reframe(wp) +VOID PASCAL NEAR reframe(wp) EWINDOW *wp; @@ -630,7 +630,7 @@ EWINDOW *wp; /* hilite: in the current window, marks 10 and 11 are set and the area between them is on screen, hilite that area */ -VOID update_hilite() +VOID PASCAL NEAR update_hilite() { int first_line = 0; /* first screen line to highlight */ @@ -740,7 +740,7 @@ VOID update_hilite() vscreen[forline]->v_right = last_pos; /* adjust for shifted window */ - /* debbugged by jmd */ + /* fixed by jmd */ if (vscreen[forline]->v_left > curwp->w_fcol) vscreen[forline]->v_left -= curwp->w_fcol; else @@ -792,8 +792,6 @@ VOID update_hilite() return; } -/* updone: update the current line to the virtual screen */ - static void show_line(LINE *lp) { int i = 0, len = lused(lp); @@ -819,7 +817,9 @@ static void show_line(LINE *lp) #endif } -VOID updone(wp) +/* updone: update the current line to the virtual screen */ + +VOID PASCAL NEAR updone(wp) EWINDOW *wp; /* window to update current line in */ @@ -853,7 +853,7 @@ EWINDOW *wp; /* window to update current line in */ /* updall: update all the lines in a window on the virtual screen */ -VOID updall(wp) +VOID PASCAL NEAR updall(wp) EWINDOW *wp; /* window to update lines in */ @@ -900,7 +900,7 @@ EWINDOW *wp; /* window to update lines in */ /* updpos: update the position of the hardware cursor and handle extended lines. This is the only update for simple moves. */ -VOID updpos() +VOID PASCAL NEAR updpos() { register LINE *lp; @@ -950,7 +950,7 @@ VOID updpos() /* upddex: de-extend any line that derserves it */ -VOID upddex() +VOID PASCAL NEAR upddex() { register EWINDOW *wp; @@ -993,7 +993,7 @@ VOID upddex() /* updgar: if the screen is garbage, clear the physical screen and the virtual screen and force a full update */ -VOID updgar() +VOID PASCAL NEAR updgar() { register int i; @@ -1051,7 +1051,7 @@ VOID updgar() do the following things */ -VOID update_size() +VOID PASCAL NEAR update_size() { /* if we need the size update */ @@ -1078,9 +1078,9 @@ VOID update_size() */ #if PROTO -int pop(BUFFER *popbuf) +int PASCAL NEAR pop(BUFFER *popbuf) #else -int pop(popbuf) +int PASCAL NEAR pop(popbuf) BUFFER *popbuf; #endif @@ -1170,7 +1170,7 @@ BUFFER *popbuf; /* updupd: update the physical screen from the virtual screen */ -VOID updupd(force) +VOID PASCAL NEAR updupd(force) int force; /* forced update flag */ @@ -1202,7 +1202,7 @@ int force; /* forced update flag */ will be scrolled right or left to let the user see where the cursor is */ -VOID updext() +VOID PASCAL NEAR updext() { register int rcursor; /* real cursor location */ @@ -1235,7 +1235,7 @@ VOID updext() #if MEMMAP /* UPDATE_LINE: specific code for memory mapped displays */ -VOID update_line(row, vp) +VOID PASCAL NEAR update_line(row, vp) int row; /* row of screen to update */ struct VIDEO *vp; /* virtual screen image */ @@ -1257,7 +1257,7 @@ struct VIDEO *vp; /* virtual screen image */ vp->v_flag &= ~(VFCHG | VFCOL); } #else -VOID update_line(row, vp, pp) +VOID PASCAL NEAR update_line(row, vp, pp) int row; /* row of screen to update */ struct VIDEO *vp; /* virtual screen image */ @@ -1471,7 +1471,7 @@ struct VIDEO *pp; /* physical screen image */ * change the modeline format by hacking at this routine. Called by "update" * any time there is a dirty window. */ -VOID modeline(wp) +VOID PASCAL NEAR modeline(wp) EWINDOW *wp; /* window to update modeline for */ @@ -1667,7 +1667,7 @@ EWINDOW *wp; /* window to update modeline for */ } } -VOID getdtime(ts) /* get the current display time string */ +VOID PASCAL NEAR getdtime(ts) /* get the current display time string */ char *ts; @@ -1685,7 +1685,7 @@ char *ts; return; } -VOID upmode() /* update all the mode lines */ +VOID PASCAL NEAR upmode() /* update all the mode lines */ { register EWINDOW *wp; @@ -1712,7 +1712,7 @@ VOID upmode() /* update all the mode lines */ #endif } -VOID upwind() /* force hard updates on all windows */ +VOID PASCAL NEAR upwind() /* force hard updates on all windows */ { register EWINDOW *wp; @@ -1744,7 +1744,7 @@ VOID upwind() /* force hard updates on all windows */ * and column "col". The row and column arguments are origin 0. Optimize out * random calls. Update "ttrow" and "ttcol". */ -VOID movecursor(row, col) +VOID PASCAL NEAR movecursor(row, col) int row, col; @@ -1781,7 +1781,7 @@ int row, col; * immediately; the terminal buffer is flushed via a call to the flusher. */ -VOID mlferase() +VOID PASCAL NEAR mlferase() { register int save_discmd; @@ -1792,7 +1792,7 @@ VOID mlferase() discmd = save_discmd;; } -VOID mlerase() +VOID PASCAL NEAR mlerase() { int i; @@ -1829,7 +1829,7 @@ VOID mlerase() * flag TRUE. Don't write beyond the end of the current terminal width. */ -VOID mlout(c) +VOID PASCAL NEAR mlout(c) int c; /* character to write */ @@ -1863,7 +1863,7 @@ int c; /* character to write */ #if VARARG #if VARG -VOID CDECL mlwrite(va_alist) +VOID CDECL NEAR mlwrite(va_alist) va_dcl /* variable argument list arg1 = format string @@ -1970,11 +1970,11 @@ va_dcl /* variable argument list } #else #if PROTO -VOID CDECL mlwrite(CONST char *fmt, ...) +VOID CDECL NEAR mlwrite(CONST char *fmt, ...) /* char * fmt;*/ #else -VOID CDECL mlwrite() -CONST char *fmt; +VOID CDECL NEAR mlwrite() +char *fmt; #endif /* variable argument list @@ -2088,7 +2088,7 @@ CONST char *fmt; #define ADJUST(ptr, dtype) ptr += sizeof(dtype) #endif -VOID CDECL mlwrite(fmt) +VOID CDECL NEAR mlwrite(fmt) char *fmt; /* format string for output */ @@ -2181,7 +2181,7 @@ char *fmt; /* format string for output */ and for the write-message and clear-message-line commands */ -VOID mlforce(s) +VOID PASCAL NEAR mlforce(s) CONST char *s; /* string to force out */ @@ -2200,7 +2200,7 @@ CONST char *s; /* string to force out */ that does not like these kind of errors is used, so that the user can be offered to abort the application */ -VOID mlabort(s) +VOID PASCAL NEAR mlabort(s) CONST char *s; { mlforce(s); @@ -2213,7 +2213,7 @@ CONST char *s; * things will get screwed up a little. Supports UTF-8 now. */ -VOID mlputs(s) +VOID PASCAL NEAR mlputs(s) CONST char *s; @@ -2243,7 +2243,7 @@ CONST char *s; * Write out an integer, in the specified radix. Update the physical cursor * position. */ -VOID mlputi(i, r) +VOID PASCAL NEAR mlputi(i, r) int i, r; @@ -2269,7 +2269,7 @@ int i, r; /* * do the same except as a long integer. */ -VOID mlputli(l, r) +VOID PASCAL NEAR mlputli(l, r) long l; int r; @@ -2296,7 +2296,7 @@ int r; * write out a scaled integer with two decimal places */ -VOID mlputf(s) +VOID PASCAL NEAR mlputf(s) int s; /* scaled integer to output */ diff --git a/src/eval.c b/src/eval.c index 8ac558a..bd69c27 100644 --- a/src/eval.c +++ b/src/eval.c @@ -15,7 +15,7 @@ /* initialize the entries in one user variable table */ -VOID uv_init(ut) +VOID PASCAL NEAR uv_init(ut) UTABLE *ut; /* user variable table to initialize */ @@ -28,7 +28,7 @@ UTABLE *ut; /* user variable table to initialize */ } } -VOID varinit() /* initialize the global user variable table */ +VOID PASCAL NEAR varinit() /* initialize the global user variable table */ { /* allocate the global user variable table */ @@ -42,7 +42,7 @@ VOID varinit() /* initialize the global user variable table */ uv_init(uv_head); } -VOID uv_clean(ut) /* discard the contents of a user variable table */ +VOID PASCAL NEAR uv_clean(ut) /* discard the contents of a user variable table */ UTABLE *ut; /* ptr to table to clear */ @@ -55,7 +55,7 @@ UTABLE *ut; /* ptr to table to clear */ free(ut->uv[i].u_value); } -VOID varclean(ut) /* discard and clear all user variable tables */ +VOID PASCAL NEAR varclean(ut) /* discard and clear all user variable tables */ UTABLE *ut; /* table to clear */ @@ -71,7 +71,7 @@ UTABLE *ut; /* table to clear */ free(ut); } -CONST char *gtfun(fname) /* evaluate a function */ +CONST char *PASCAL NEAR gtfun(fname) /* evaluate a function */ char *fname; /* name of function to evaluate */ @@ -219,7 +219,8 @@ char *fname; /* name of function to evaluate */ return (int_asc(-1)); } return(int_asc(findcol(curwp->w_markp[arg], curwp->w_marko[arg]))); - case UFMKLINE: if ((arg = asc_int(arg1)) < 0 || arg >= NMARKS || curwp->w_markp[arg] == NULL) + case UFMKLINE: if ((arg = asc_int(arg1)) < 0 || arg >= NMARKS || + curwp->w_markp[arg] == NULL) { mlwrite(TEXT11, arg); return (int_asc(0)); @@ -237,11 +238,10 @@ char *fname; /* name of function to evaluate */ case UFOR: return(ltos(stol(arg1) || stol(arg2))); case UFREVERSE: return(strrev(bytecopy(result, arg1, NSTRING * 2))); case UFRIGHT: arg = asc_int(arg2); - if (arg > strlen(arg1)) arg = strlen(arg1); - - return(strcpy(result, &arg1[strlen(arg1) - arg])); + return(strcpy(result, + &arg1[strlen(arg1) - arg])); case UFRND: return(int_asc((int)(ernd() % (long)absv(asc_int(arg1))) + 1L)); case UFSEQUAL: return(ltos(strcmp(arg1, arg2) == 0)); case UFSGREAT: return(ltos(strcmp(arg1, arg2) > 0)); @@ -263,7 +263,7 @@ char *fname; /* name of function to evaluate */ return fixnull(NULL); } -char *gtusr(vname) /* look up a user var's value */ +char *PASCAL NEAR gtusr(vname) /* look up a user var's value */ char *vname; /* name of user variable to fetch */ @@ -307,7 +307,7 @@ next_ut: ut = ut->next; return ((char*) errorm); } -char *funval(i) +char *PASCAL NEAR funval(i) int i; @@ -315,7 +315,7 @@ int i; return(funcs[i].f_name); } -char *envval(i) +char *PASCAL NEAR envval(i) int i; @@ -323,13 +323,13 @@ int i; return(envars[i]); } -int binary(key, tval, tlength, klength) +int PASCAL NEAR binary(key, tval, tlength, klength) CONST char *key; /* key string to look for */ #if THEOSC long (*tval)(); #else -char *(*tval)(); /* ptr to function to fetch table value with */ +char *(PASCAL NEAR *tval)(); /* ptr to function to fetch table value with */ #endif int tlength; /* length of table to search */ int klength; /* maximum length of string to compare */ @@ -363,7 +363,7 @@ int klength; /* maximum length of string to compare */ return(-1); } -CONST char *gtenv(vname) +CONST char *PASCAL NEAR gtenv(vname) CONST char *vname; /* name of environment variable to retrieve */ @@ -520,7 +520,7 @@ CONST char *vname; /* name of environment variable to retrieve */ return fixnull(NULL); } -CONST char *fixnull(s) /* Don't return NULL pointers! */ +CONST char *PASCAL NEAR fixnull(s) /* Don't return NULL pointers! */ CONST char *s; @@ -533,7 +533,7 @@ CONST char *s; /* return some of the contents of the kill buffer */ -char *getkill() +char *PASCAL NEAR getkill() { register int size; /* max number of chars left to return */ @@ -598,7 +598,7 @@ char *getkill() return(value); } -char *trimstr(s) /* trim whitespace off the end of a string */ +char *PASCAL NEAR trimstr(s) /* trim whitespace off the end of a string */ char *s; /* string to trim */ @@ -612,7 +612,7 @@ char *s; /* string to trim */ return(s); } -int setvar(f, n) /* set a variable */ +int PASCAL NEAR setvar(f, n) /* set a variable */ int f; /* default flag */ int n; /* numeric arg (can overide prompted value) */ @@ -686,7 +686,7 @@ int n; /* numeric arg (can overide prompted value) */ return(status); } -int global_var(f, n) /* declare a global variable */ +int PASCAL NEAR global_var(f, n) /* declare a global variable */ int f; /* default flag */ int n; /* numeric arg (ignored here) */ @@ -745,7 +745,7 @@ int n; /* numeric arg (ignored here) */ return(status); } -int local_var(f, n) /* declare a local variable */ +int PASCAL NEAR local_var(f, n) /* declare a local variable */ int f; /* default flag */ int n; /* numeric arg (ignored here) */ @@ -806,7 +806,7 @@ int n; /* numeric arg (ignored here) */ /* find a variables type and name */ -VOID findvar(var, vd, size, scope) +VOID PASCAL NEAR findvar(var, vd, size, scope) char *var; /* name of var to get */ VDESC *vd; /* structure to hold type and ptr */ @@ -883,7 +883,7 @@ retvar: vd->v_num = vnum; return; } -int svar(var, value) /* set a variable */ +int PASCAL NEAR svar(var, value) /* set a variable */ VDESC *var; /* variable to set */ char *value; /* value to set to */ @@ -1169,7 +1169,7 @@ char *value; /* value to set to */ /* asc_int: ascii string to integer......This is too inconsistant to use the system's */ -int asc_int(st) +int PASCAL NEAR asc_int(st) char *st; @@ -1206,7 +1206,7 @@ char *st; /* int_asc: integer to ascii string.......... This is too inconsistant to use the system's */ -char *int_asc(i) +char *PASCAL NEAR int_asc(i) int i; /* integer to translate to a string */ @@ -1249,7 +1249,7 @@ int i; /* integer to translate to a string */ /* long_asc: long to ascii string.......... This is too inconsistant to use the system's */ -char *long_asc(num) +char *PASCAL NEAR long_asc(num) long num; /* integer to translate to a string */ @@ -1283,7 +1283,7 @@ long num; /* integer to translate to a string */ return(sp); } -int gettyp(token) /* find the type of a passed token */ +int PASCAL NEAR gettyp(token) /* find the type of a passed token */ CONST char *token; /* token to analyze */ @@ -1316,7 +1316,7 @@ CONST char *token; /* token to analyze */ } } -CONST char *getval(token) /* find the value of a token */ +CONST char *PASCAL NEAR getval(token) /* find the value of a token */ char *token; /* token to evaluate */ @@ -1391,7 +1391,7 @@ char *token; /* token to evaluate */ return fixnull(NULL); } -int stol(val) /* convert a string to a numeric logical */ +int PASCAL NEAR stol(val) /* convert a string to a numeric logical */ char *val; /* value to check for stol */ @@ -1406,7 +1406,7 @@ char *val; /* value to check for stol */ return((asc_int(val) != 0)); } -CONST char *ltos(val) /* numeric logical to string logical */ +CONST char *PASCAL NEAR ltos(val) /* numeric logical to string logical */ int val; /* value to translate */ @@ -1417,7 +1417,7 @@ int val; /* value to translate */ return(falsem); } -char *mkupper(str) /* make a string upper case */ +char *PASCAL NEAR mkupper(str) /* make a string upper case */ char *str; /* string to upper case */ @@ -1430,7 +1430,7 @@ char *str; /* string to upper case */ return(str); } -char *mklower(str) /* make a string lower case */ +char *PASCAL NEAR mklower(str) /* make a string lower case */ char *str; /* string to lower case */ @@ -1443,7 +1443,7 @@ char *str; /* string to lower case */ return(str); } -int absv(x) /* take the absolute value of an integer */ +int PASCAL NEAR absv(x) /* take the absolute value of an integer */ int x; @@ -1451,7 +1451,7 @@ int x; return(x < 0 ? -x : x); } -long ernd() /* returns a random integer */ +long PASCAL NEAR ernd() /* returns a random integer */ /* This function implements the "minimal standard" RNG from the paper "RNGs: Good Ones are Hard to Find" by Park and @@ -1468,7 +1468,7 @@ long ernd() /* returns a random integer */ return(seed); } -int sindex(source, pattern) /* find pattern within source */ +int PASCAL NEAR sindex(source, pattern) /* find pattern within source */ CONST char *source; /* source string to search */ CONST char *pattern; /* string to look for */ @@ -1539,7 +1539,7 @@ CONST char *pattern; /* string to look for */ /* Filter a string through a translation table */ -char *xlat(source, lookup, trans) +char *PASCAL NEAR xlat(source, lookup, trans) char *source; /* string to filter */ char *lookup; /* characters to translate */ @@ -1579,7 +1579,7 @@ xnext: ++sp; /* setwlist: Set an alternative list of character to be considered "in a word */ -int setwlist(wclist) +int PASCAL NEAR setwlist(wclist) char *wclist; /* list of characters to consider "in a word" */ @@ -1607,7 +1607,7 @@ char *wclist; /* list of characters to consider "in a word" */ /* getwlist: place in a buffer a list of characters considered "in a word" */ -char *getwlist(buf) +char *PASCAL NEAR getwlist(buf) char *buf; /* buffer to place list of characters */ @@ -1630,9 +1630,9 @@ char *buf; /* buffer to place list of characters */ /* is_num: ascii string is integer......This is too inconsistant to use the system's */ - -int is_num(st) - + +int PASCAL NEAR is_num(st) + char *st; { @@ -1664,7 +1664,7 @@ char *st; return(TRUE); } -int dispvar(f, n) /* display a variable's value */ +int PASCAL NEAR dispvar(f, n) /* display a variable's value */ int f; /* default flag */ int n; /* numeric arg (can overide prompted value) */ @@ -1714,7 +1714,7 @@ int n; /* numeric arg (can overide prompted value) */ of all the environment variables */ -int desvars(f, n) +int PASCAL NEAR desvars(f, n) int f,n; /* prefix flag and argument */ @@ -1822,7 +1822,7 @@ int f,n; /* prefix flag and argument */ names of all the functions */ -int desfunc(f, n) +int PASCAL NEAR desfunc(f, n) int f,n; /* prefix flag and argument */ @@ -1865,7 +1865,7 @@ int f,n; /* prefix flag and argument */ return(TRUE); } -VOID pad(s, len) /* pad a string to indicated length */ +VOID PASCAL NEAR pad(s, len) /* pad a string to indicated length */ char *s; /* string to add spaces to */ int len; /* wanted length of string */ diff --git a/src/exec.c b/src/exec.c index 511adca..1a834f3 100644 --- a/src/exec.c +++ b/src/exec.c @@ -11,12 +11,12 @@ /* namedcmd: execute a named command even if it is not bound */ -int namedcmd(f, n) +int PASCAL NEAR namedcmd(f, n) int f, n; /* command arguments [passed through to command executed] */ { - int (*kfunc)(); /* ptr to the function to execute */ + int (PASCAL NEAR *kfunc)(); /* ptr to the function to execute */ char buffer[NSTRING]; /* buffer to store function name */ int status; @@ -62,7 +62,7 @@ int f, n; /* command arguments [passed through to command executed] */ /* execcmd: Execute a command line command to be typed in by the user */ -int execcmd(f, n) +int PASCAL NEAR execcmd(f, n) int f, n; /* default Flag and Numeric argument */ @@ -89,14 +89,14 @@ int f, n; /* default Flag and Numeric argument */ */ -int docmd(cline) +int PASCAL NEAR docmd(cline) char *cline; /* command line to execute */ { register int f; /* default argument flag */ register int n; /* numeric repeat value */ - int (*fnc)();/* function to execute */ + int (PASCAL NEAR *fnc)();/* function to execute */ BUFFER *bp; /* buffer to execute */ int status; /* return status of function */ int oldcle; /* old contents of clexec flag */ @@ -177,7 +177,7 @@ char *cline; /* command line to execute */ return a pointer past the token */ -char *token(src, tok, size) +char *PASCAL NEAR token(src, tok, size) char *src, *tok; /* source string, destination token string */ int size; /* maximum size of token */ @@ -240,7 +240,7 @@ int size; /* maximum size of token */ return(src); } -int macarg(tok) /* get a macro line argument */ +int PASCAL NEAR macarg(tok) /* get a macro line argument */ char *tok; /* buffer to place argument */ @@ -257,7 +257,7 @@ char *tok; /* buffer to place argument */ /* nextarg: get the next argument */ -int nextarg(prompt, buffer, size, terminator) +int PASCAL NEAR nextarg(prompt, buffer, size, terminator) CONST char *prompt; /* prompt to use if we must be interactive */ char *buffer; /* buffer to put token into */ @@ -292,7 +292,7 @@ int terminator; /* terminating char to be used on interactive fetch */ /* storeproc: Set up a procedure buffer and flag to store all executed command lines there */ -int storeproc(f, n) +int PASCAL NEAR storeproc(f, n) int f; /* default flag */ int n; /* macro number to use */ @@ -363,7 +363,7 @@ int n; /* macro number to use */ /* execproc: Execute a procedure */ -int execproc(f, n) +int PASCAL NEAR execproc(f, n) int f, n; /* default flag and numeric arg */ @@ -397,7 +397,7 @@ int f, n; /* default flag and numeric arg */ /* execbuf: Execute the contents of a buffer of commands */ -int execbuf(f, n) +int PASCAL NEAR execbuf(f, n) int f, n; /* default flag and numeric arg */ @@ -438,7 +438,7 @@ int f, n; /* default flag and numeric arg */ *LBL01 */ -int dobuf(bp) +int PASCAL NEAR dobuf(bp) BUFFER *bp; /* buffer to execute */ @@ -945,7 +945,7 @@ freeut: uv_head = ut->next; /* errormesg: display a macro execution error along with the buffer and line currently being executed */ -VOID errormesg(mesg, bp, lp) +VOID PASCAL NEAR errormesg(mesg, bp, lp) CONST char *mesg; /* error message to display */ BUFFER *bp; /* buffer error occured in */ @@ -973,7 +973,7 @@ LINE *lp; /* line " */ if $debug == TRUE, The interactive debugger is invoked commands are listed out with the ? key */ -int debug(bp, eline, skipflag) +int PASCAL NEAR debug(bp, eline, skipflag) BUFFER *bp; /* buffer to execute */ char *eline; /* text of line to debug */ @@ -1101,7 +1101,7 @@ dinput: outline[term.t_ncol - 1] = 0; return(TRUE); } -VOID freewhile(wp) /* free a list of while block pointers */ +VOID PASCAL NEAR freewhile(wp) /* free a list of while block pointers */ WHBLOCK *wp; /* head of structure to free */ @@ -1112,7 +1112,7 @@ WHBLOCK *wp; /* head of structure to free */ } } -int execfile(f, n) /* execute a series of commands in a file */ +int PASCAL NEAR execfile(f, n) /* execute a series of commands in a file */ int f, n; /* default flag and numeric arg to pass on to file */ @@ -1163,7 +1163,7 @@ int f, n; /* default flag and numeric arg to pass on to file */ /* dofile: yank a file into a buffer and execute it if there are no errors, delete the buffer on exit */ -int dofile(fname) +int PASCAL NEAR dofile(fname) CONST char *fname; /* file name to execute */ diff --git a/src/file.c b/src/file.c index cbd93f2..1b31655 100644 --- a/src/file.c +++ b/src/file.c @@ -35,7 +35,7 @@ * "read a file into the current buffer" code. * Bound to "C-X C-R". */ -int fileread(f, n) +int PASCAL NEAR fileread(f, n) int f, n; /* default and numeric arguments (unused) */ @@ -62,7 +62,7 @@ int f, n; /* default and numeric arguments (unused) */ * "insert a file into the current buffer" code. * Bound to "C-X C-I". */ -int insfile(f, n) +int PASCAL NEAR insfile(f, n) int f,n; /* prefix flag and argument */ @@ -109,7 +109,7 @@ int f,n; /* prefix flag and argument */ * text, and switch to the new buffer. * Bound to C-X C-F. */ -int filefind(f, n) +int PASCAL NEAR filefind(f, n) int f,n; /* prefix flag and argument */ @@ -129,7 +129,7 @@ int f,n; /* prefix flag and argument */ return(getfile(fname, TRUE)); } -int viewfile(f, n) /* visit a file in VIEW mode */ +int PASCAL NEAR viewfile(f, n) /* visit a file in VIEW mode */ int f,n; /* prefix flag and argument */ @@ -156,7 +156,7 @@ int f,n; /* prefix flag and argument */ } #if CRYPT -int resetkey() /* reset the encryption key if needed */ +int PASCAL NEAR resetkey() /* reset the encryption key if needed */ { register int s; /* return status */ @@ -189,7 +189,7 @@ int resetkey() /* reset the encryption key if needed */ } #endif -int getfile(fname, lockfl) +int PASCAL NEAR getfile(fname, lockfl) char fname[]; /* file name to find */ int lockfl; /* check the file for locks? */ @@ -280,7 +280,7 @@ int lockfl; /* check the file for locks? */ and before it is read. */ -int readin(fname, lockfl) +int PASCAL NEAR readin(fname, lockfl) CONST char* fname; /* name of file to read */ int lockfl; /* check for file locks? */ @@ -415,7 +415,7 @@ int lockfl; /* check for file locks? */ * Returns a pointer into fname indicating the end of the file path; i.e., * 1 character BEYOND the path name. */ -CONST char *makename(bname, fname) +CONST char *PASCAL NEAR makename(bname, fname) char *bname; CONST char *fname; @@ -517,7 +517,7 @@ CONST char *fname; return(pathp); } -VOID unqname(name) /* make sure a buffer name is unique */ +VOID PASCAL NEAR unqname(name) /* make sure a buffer name is unique */ char *name; /* name to check on */ @@ -550,7 +550,7 @@ char *name; /* name to check on */ * and ^X^A for appending. */ -int filewrite(f, n) +int PASCAL NEAR filewrite(f, n) int f, n; /* emacs arguments */ @@ -577,7 +577,7 @@ int f, n; /* emacs arguments */ return(s); } -int fileapp(f, n) /* append file */ +int PASCAL NEAR fileapp(f, n) /* append file */ int f, n; /* emacs arguments */ @@ -606,7 +606,7 @@ int f, n; /* emacs arguments */ * name for the buffer. Bound to "C-X C-S". May * get called by "C-Z". */ -int filesave(f, n) +int PASCAL NEAR filesave(f, n) int f,n; /* prefix flag and argument */ @@ -746,7 +746,7 @@ extern char* backname(char* tname, CONST char* fn) * a user specifyable routine (in $writehook) can be run. */ -int writeout(fn, mode) +int PASCAL NEAR writeout(fn, mode) char *fn; /* name of file to write current buffer to */ char *mode; /* mode to open file (w = write a = append) */ @@ -936,7 +936,7 @@ char *mode; /* mode to open file (w = write a = append) */ * prompt if you wish. */ -int filename(f, n) +int PASCAL NEAR filename(f, n) int f,n; /* prefix flag and argument */ @@ -969,7 +969,7 @@ int f,n; /* prefix flag and argument */ * buffer, Called by insert file command. Return the final * status of the read. */ -int ifile(fname) +int PASCAL NEAR ifile(fname) char fname[]; { register LINE *lp0; @@ -1081,7 +1081,7 @@ char fname[]; names of all the files in a given directory */ -int showfiles(f, n) +int PASCAL NEAR showfiles(f, n) int f,n; /* prefix flag and argument */ diff --git a/src/fileio.c b/src/fileio.c index 82fdec6..ccd666c 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -28,7 +28,7 @@ char file_buffer[FILE_BUFSIZE]; */ #if !(VMS & RMSIO) /* if using RMS under VMS, the code */ /* is in VMS.C */ -int ffropen(fn) +int PASCAL NEAR ffropen(fn) CONST char *fn; { if ((ffp=fopen(fn, "r")) == NULL) @@ -51,7 +51,7 @@ CONST char *fn; * (cannot create). */ #if AOSVS == 0 -int ffwopen(fn, mode) +int PASCAL NEAR ffwopen(fn, mode) CONST char *fn; CONST char *mode; /* mode to open file for */ { @@ -91,7 +91,7 @@ CONST char *mode; /* mode to open file for */ /* * Close a file. Should look at the status in all systems. */ -int ffclose() +int PASCAL NEAR ffclose() { /* free this since we do not need it anymore */ if (fline) { @@ -124,7 +124,7 @@ int ffclose() * and the "nbuf" is its length, less the free newline. Return the status. * Check only at the newline. */ -int ffputline(buf, nbuf) +int PASCAL NEAR ffputline(buf, nbuf) char buf[]; int nbuf; @@ -183,7 +183,7 @@ int nbuf; * at the end of the file that don't have a newline present. Check for I/O * errors too. Return status. */ -int ffgetline(nbytes) +int PASCAL NEAR ffgetline(nbytes) int *nbytes; @@ -256,7 +256,7 @@ int *nbytes; } #endif -int fexist(fname) /* does exist on disk? */ +int PASCAL NEAR fexist(fname) /* does exist on disk? */ char *fname; /* file to check for existance */ diff --git a/src/fmrdos.c b/src/fmrdos.c index 0c327e1..e28d6ff 100644 --- a/src/fmrdos.c +++ b/src/fmrdos.c @@ -50,7 +50,7 @@ static int oldbut; /* Previous state of mouse buttons */ static int oldcol; /* previous x position of mouse */ static int oldrow; /* previous y position of mouse */ -execprog(char *cmd); +PASCAL NEAR execprog(char *cmd); /* input buffers and pointers */ @@ -98,7 +98,7 @@ int in_get() /* get an event from the input buffer */ * This function is called once to set up the terminal device streams. */ -ttopen() +PASCAL NEAR ttopen() { #if MOUSE @@ -165,7 +165,7 @@ int lines; /* # of vertical lines */ * interpreter. On VMS it puts the terminal back in a reasonable state. * Another no-operation on CPM. */ -ttclose() +PASCAL NEAR ttclose() { } @@ -176,7 +176,7 @@ ttclose() * MS-DOS (use the very very raw console output routine). */ -ttputc(c) +PASCAL NEAR ttputc(c) int c; @@ -194,7 +194,7 @@ int c; * Flush terminal buffer. Does real work where the terminal output is buffered * up. A no-operation on systems where byte at a time terminal I/O is done. */ -ttflush() +PASCAL NEAR ttflush() { } @@ -213,7 +213,7 @@ int doschar() /* call the dos to get a char */ * Read a character from the terminal, performing no editing and doing no echo * at all. Also mouse events are forced into the input stream here. */ -ttgetc() +PASCAL NEAR ttgetc() { register int c; /* character read */ @@ -346,7 +346,7 @@ checkmouse() keyboard buffer */ -typahead() +PASCAL NEAR typahead() { int flags; /* cpu flags from dos call */ @@ -384,7 +384,7 @@ typahead() * repaint. Bound to "^X C". */ -spawncli(f, n) +PASCAL NEAR spawncli(f, n) int f, n; @@ -407,7 +407,7 @@ int f, n; * character to be typed, then mark the screen as garbage so a full repaint is * done. Bound to "C-X !". */ -spawn(f, n) +PASCAL NEAR spawn(f, n) int f, n; @@ -441,7 +441,7 @@ int f, n; * done. Bound to "C-X $". */ -execprg(f, n) +PASCAL NEAR execprg(f, n) { register int s; @@ -471,7 +471,7 @@ execprg(f, n) * Pipe a one line command into a window * Bound to ^X @ */ -pipecmd(f, n) +PASCAL NEAR pipecmd(f, n) int f, n; @@ -559,7 +559,7 @@ int f, n; * filter a buffer through an external DOS program * Bound to ^X # */ -uefilter(f, n) +PASCAL NEAR uefilter(f, n) int f, n; @@ -639,7 +639,7 @@ extern int _doserrno; /* SHELLPROG: Execute a command in a subshell */ -shellprog(cmd) +PASCAL NEAR shellprog(cmd) char *cmd; /* Incoming command line to execute */ @@ -688,7 +688,7 @@ char *cmd; /* Incoming command line to execute */ #define CFLAG 1 #endif -execprog(cmd) +PASCAL NEAR execprog(cmd) char *cmd; /* Incoming command line to execute */ @@ -796,7 +796,7 @@ char *cmd; /* Incoming command line to execute */ /* return a system dependent string with the current time */ -char *timeset() +char *PASCAL NEAR timeset() { #if MWC | TURBO | IC | MSC @@ -870,7 +870,7 @@ char *fspec; /* pattern to match */ return(rbuf); } -char *getnfile() +char *PASCAL NEAR getnfile() { register int index; /* index into various strings */ @@ -899,7 +899,7 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *getffile(fspec) +char *PASCAL NEAR getffile(fspec) char *fspec; /* pattern to match */ @@ -948,7 +948,7 @@ char *fspec; /* pattern to match */ return(rbuf); } -char *getnfile() +char *PASCAL NEAR getnfile() { register int index; /* index into various strings */ @@ -969,7 +969,7 @@ char *getnfile() return(rbuf); } #else -char *getffile(fspec) +char *PASCAL NEAR getffile(fspec) char *fspec; /* file to match */ @@ -977,7 +977,7 @@ char *fspec; /* file to match */ return(NULL); } -char *getnfile() +char *PASCAL NEAR getnfile() { return(NULL); diff --git a/src/history.c b/src/history.c index c953f52..3cf658f 100644 --- a/src/history.c +++ b/src/history.c @@ -2580,13 +2580,18 @@ * - Added Unicode support with UTF-8 files * - Added Theos O.S. support (in 1988-1992) * - Added Cygwin support - * - Added ncurses display with drop down menus (Linux and Cygwin only) + * - Added ncurses display with drop down menus (Linux, XP and Cygwin only) + * - Added 'ue' prefix to filter, refresh, newline, echochar and meta to avoid conflicts with curses + * - Renamed SCREEN structure to ESCREEN to avoid conflicts with curses * - Added file backup (likely borrowed to Mark Williams) * - Added help on language keywords (currently for Theos C only) (borrowed to Mark Williams) * - Added semi-graphics character entry through numeric keypad * - Added dynamic load of messages from a file (in 1988-1992) - * - Removed all PASCAL NEAR - * - Some code cleanup + * - Some code cleanup and miscellaneous fixes + * 10 Sep 2020 + * - Added SCO OpenServer 5 and UnixWare 7 support (2001) + * - Added menudrop function bound to menu-drop to allow menu use without a mouse. + * Bound to F12 in tpage.cmd */ void history() diff --git a/src/input.c b/src/input.c index 6e21573..10f734e 100644 --- a/src/input.c +++ b/src/input.c @@ -61,7 +61,7 @@ extern struct passwd *getpwnam(); */ #if !WINDOW_MSWIN /* for MS Windows, mlyesno is defined in mswsys.c */ -int mlyesno(prompt) +int PASCAL NEAR mlyesno(prompt) CONST char *prompt; @@ -121,7 +121,7 @@ CONST char *prompt; * return. Handle erase, kill, and abort keys. */ -int mlreply(prompt, buf, nbuf) +int PASCAL NEAR mlreply(prompt, buf, nbuf) CONST char *prompt; char *buf; @@ -134,7 +134,7 @@ int nbuf; /* ectoc: expanded character to character collapse the CTRL and SPEC flags back into an ascii code */ -int ectoc(c) +int PASCAL NEAR ectoc(c) int c; @@ -151,7 +151,7 @@ int c; /* ctoec: character to extended character pull out the CTRL and SPEC prefixes (if possible) */ -int ctoec(c) +int PASCAL NEAR ctoec(c) int c; @@ -169,12 +169,12 @@ int c; */ #if MSC || GCC -int (*getname(CONST char *prompt))(void) +int (PASCAL NEAR *PASCAL NEAR getname(CONST char *prompt))(void) #else #if THEOS int *getname(CONST char* prompt) #else -int (*getname(CONST char* prompt))() +int (PASCAL NEAR *PASCAL NEAR getname(CONST char* prompt))() #endif CONST char *prompt; /* string to prompt with */ #endif @@ -195,7 +195,7 @@ CONST char *prompt; /* string to prompt with */ completion code. */ -BUFFER *getcbuf(prompt, defval, createflag) +BUFFER *PASCAL NEAR getcbuf(prompt, defval, createflag) CONST char *prompt; /* prompt to user on command line */ char *defval; /* default value to display to user */ @@ -211,7 +211,7 @@ int createflag; /* should this create a new buffer? */ return(bfind(sp, createflag, 0)); } -char *gtfilename(prompt) +char *PASCAL NEAR gtfilename(prompt) CONST char *prompt; /* prompt to user on command line */ @@ -247,7 +247,7 @@ CONST char *prompt; /* prompt to user on command line */ return(sp); } -char *complete(prompt, defval, type, maxlen) +char *PASCAL NEAR complete(prompt, defval, type, maxlen) CONST char *prompt; /* prompt to user on command line */ char *defval; /* default value to display to user */ @@ -510,7 +510,7 @@ int maxlen; /* maximum length of input field */ /* comp_command: Attempt a completion on a command name */ -VOID comp_command(name, cpos) +VOID PASCAL NEAR comp_command(name, cpos) char *name; /* command containing the current name to complete */ int *cpos; /* ptr to position of next character to insert */ @@ -591,7 +591,7 @@ int *cpos; /* ptr to position of next character to insert */ /* clist_command: Make a completion list based on a partial name */ -VOID clist_command(name, cpos) +VOID PASCAL NEAR clist_command(name, cpos) char *name; /* command containing the current name to complete */ int *cpos; /* ptr to position of next character to insert */ @@ -627,7 +627,7 @@ int *cpos; /* ptr to position of next character to insert */ /* comp_buffer: Attempt a completion on a buffer name */ -VOID comp_buffer(name, cpos) +VOID PASCAL NEAR comp_buffer(name, cpos) char *name; /* buffer containing the current name to complete */ int *cpos; /* ptr to position of next character to insert */ @@ -705,7 +705,7 @@ int *cpos; /* ptr to position of next character to insert */ /* clist_buffer: Make a completion list based on a partial buffer name */ -VOID clist_buffer(name, cpos) +VOID PASCAL NEAR clist_buffer(name, cpos) char *name; /* command containing the current name to complete */ int *cpos; /* ptr to position of next character to insert */ @@ -744,7 +744,7 @@ int *cpos; /* ptr to position of next character to insert */ #if !WINDOW_MSWIN /* comp_file: Attempt a completion on a file name */ -VOID comp_file(name, cpos) +VOID PASCAL NEAR comp_file(name, cpos) char *name; /* file containing the current name to complete */ int *cpos; /* ptr to position of next character to insert */ @@ -833,7 +833,7 @@ int *cpos; /* ptr to position of next character to insert */ /* clist_file: Make a completion list based on a partial file name */ -VOID clist_file(name, cpos) +VOID PASCAL NEAR clist_file(name, cpos) char *name; /* command containing the current name to complete */ int *cpos; /* ptr to position of next character to insert */ @@ -878,7 +878,7 @@ int *cpos; /* ptr to position of next character to insert */ #if THEOX int tgetcraw() #else -int tgetc() +int PASCAL NEAR tgetc() #endif { int c; /* fetched character */ @@ -910,6 +910,7 @@ int tgetc() /* fetch a character from the terminal driver */ c = TTgetc(); + } else { c = charpending; @@ -953,7 +954,7 @@ int tgetc() are the SPEC, MOUS and CTRL prefixes. */ -int get_key() +int PASCAL NEAR get_key() { int c; /* next input character */ @@ -1008,7 +1009,7 @@ int get_key() /* GETCMD: Get a command from the keyboard. Process all applicable prefix keys */ -int getcmd() +int PASCAL NEAR getcmd() { int c; /* fetched keystroke */ @@ -1039,7 +1040,7 @@ int getcmd() to specify the proper terminator. If the terminator is not a return(RET_CHAR), return will echo as "" */ -int getstring(buf, nbuf, eolchar) +int PASCAL NEAR getstring(buf, nbuf, eolchar) unsigned char *buf; int nbuf; @@ -1208,7 +1209,7 @@ int eolchar; return(0); } -VOID outstring(s) /* output a string of input characters */ +VOID PASCAL NEAR outstring(s) /* output a string of input characters */ CONST char *s; /* string to output */ @@ -1218,7 +1219,7 @@ CONST char *s; /* string to output */ mlout(*s++); } -VOID ostring(s) /* output a string of output characters */ +VOID PASCAL NEAR ostring(s) /* output a string of output characters */ CONST char *s; /* string to output */ @@ -1245,7 +1246,7 @@ CONST char *s; /* string to output */ * mlprompt -- Display a prompt [with optional default] and the * input terminator. */ -int mlprompt(prompt, dflt, iterm) +int PASCAL NEAR mlprompt(prompt, dflt, iterm) CONST char *prompt; char *dflt; int iterm; @@ -1286,9 +1287,9 @@ int iterm; } /* - * echostring -- Use echochar() to put out a string. Checks for NULL. + * echostring -- Use ueechochar() to put out a string. Checks for NULL. */ -int echostring(str, tcol, uptocol) +int PASCAL NEAR echostring(str, tcol, uptocol) char *str; /* characters to be echoed */ int tcol; /* column to be echoed in */ int uptocol; /* last column to be echoed in */ @@ -1323,7 +1324,7 @@ int uptocol; /* last column to be echoed in */ /* * Routine to echo i-search and message-prompting characters. */ -int ueechochar(c) +int PASCAL NEAR ueechochar(c) unsigned char c; /* character to be echoed */ diff --git a/src/isearch.c b/src/isearch.c index 809fb50..7fb15e5 100644 --- a/src/isearch.c +++ b/src/isearch.c @@ -57,7 +57,7 @@ static int cmd_reexecute = -1; /* > 0 if re-executing command */ * same code as the normal incremental search, as both can go both ways. */ -int risearch(f, n) +int PASCAL NEAR risearch(f, n) int f, n; /* prefix flag and argument */ { register int status; @@ -77,7 +77,7 @@ int f, n; /* prefix flag and argument */ /* Again, but for the forward direction */ -int fisearch(f, n) +int PASCAL NEAR fisearch(f, n) int f, n; { register int status; @@ -116,7 +116,7 @@ int f, n; * exists (or until the search is aborted). */ -int isearch(dir) +int PASCAL NEAR isearch(dir) int dir; @@ -131,7 +131,7 @@ int dir; int curoff; /* Current offset on entry */ int init_direction; /* The initial search direction */ KEYTAB *ktp; /* The command bound to the key */ - register int (*kfunc)(); /* ptr to the requested function to bind to */ + register int (PASCAL NEAR *kfunc)(); /* ptr to the requested function to bind to */ /* Set up the starting conditions */ @@ -317,7 +317,7 @@ int dir; * of the matched string for reverse searches. */ -int scanmore(dir) +int PASCAL NEAR scanmore(dir) int dir; /* direction to search */ { register int status; /* search status */ @@ -351,7 +351,7 @@ int dir; /* direction to search */ * If the compare fails, we return FALSE and call scanmore or something. */ -int checknext(chr, dir) +int PASCAL NEAR checknext(chr, dir) int chr; /* Next char to look for */ int dir; /* Search direction */ { @@ -422,7 +422,7 @@ int dir; /* Search direction */ * string, so just return the next character. */ -int get_char() +int PASCAL NEAR get_char() { int c; KEYTAB *key; @@ -480,7 +480,7 @@ int get_char() * Come here on the next term.t_getchar call: */ -int uneat() +int PASCAL NEAR uneat() { int c; @@ -490,7 +490,7 @@ int uneat() return (c); /* and return the last char */ } -VOID reeat(c) +VOID PASCAL NEAR reeat(c) int c; { if (eaten_char != -1) /* If we've already been here */ @@ -501,7 +501,7 @@ int c; } #else -int isearch(dir) +int PASCAL NEAR isearch(dir) int dir; { } diff --git a/src/keyboard.c b/src/keyboard.c index 44547ea..d9f15f0 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -240,9 +240,9 @@ typedef struct keyent { /* Key mapping entry */ /* Needed Prototype */ #if PROTO -extern int rec_seq(char *buf, char *bufstart, KEYENT *node); +extern int PASCAL NEAR rec_seq(char *buf, char *bufstart, KEYENT *node); #else -extern int rec_seq(); +extern int PASCAL NEAR rec_seq(); #endif /* some globals needed here */ @@ -255,9 +255,9 @@ static BUFFER *seqbuf; /* For the pop-up buffer */ * add-keymap "escape sequence" keyname */ #if PROTO -int addkeymap(int f, int n) +int PASCAL NEAR addkeymap(int f, int n) #else -int addkeymap( f, n) +int PASCAL NEAR addkeymap( f, n) int f; int n; #endif @@ -306,16 +306,16 @@ int n; ec = stock((unsigned char*) codeseq); ostring(codeseq); - return (addkey(esc_seq, ec)); /* Add to tree */ + return (addkey((unsigned char*) esc_seq, ec)); /* Add to tree */ } /* * list-keymappings */ #if PROTO -int listkeymaps(int f, int n) +int PASCAL NEAR listkeymaps(int f, int n) #else -int listkeymaps( f, n) +int PASCAL NEAR listkeymaps( f, n) int f; int n; #endif @@ -351,9 +351,9 @@ int n; * and their function name equivalents. */ #if PROTO -int rec_seq(char *buf, char *bufstart, KEYENT *node) +int PASCAL NEAR rec_seq(char *buf, char *bufstart, KEYENT *node) #else -int rec_seq( buf, bufstart, node) +int PASCAL NEAR rec_seq( buf, bufstart, node) char *buf; char *bufstart; KEYENT *node; @@ -396,10 +396,10 @@ KEYENT *node; * fn - Resulting keycode */ #if PROTO -int addkey(char * seq, int fn) +int PASCAL NEAR addkey(unsigned char * seq, int fn) #else -int addkey( seq, fn) -char * seq; +int PASCAL NEAR addkey( seq, fn) +unsigned char * seq; int fn; #endif { diff --git a/src/line.c b/src/line.c index 568368f..85f178e 100644 --- a/src/line.c +++ b/src/line.c @@ -30,7 +30,7 @@ static long last_size = -1L; /* last # of bytes yanked */ * line if no space. */ -LINE *lalloc(used) +LINE *PASCAL NEAR lalloc(used) register int used; @@ -62,7 +62,7 @@ register int used; * might be in. Release the memory. The buffers are updated too; the magic * conditions described in the above comments don't hold here. */ -VOID lfree(lp) +VOID PASCAL NEAR lfree(lp) register LINE *lp; { register BUFFER *bp; @@ -131,7 +131,7 @@ register LINE *lp; * displayed in more than 1 window we change EDIT t HARD. Set MODE if the * mode line needs to be updated (the "*" has to be set). */ -VOID lchange(flag) +VOID PASCAL NEAR lchange(flag) register int flag; { register EWINDOW *wp; @@ -160,7 +160,7 @@ register int flag; } } -int insspace(f, n) /* insert spaces forward into text */ +int PASCAL NEAR insspace(f, n) /* insert spaces forward into text */ int f, n; /* default flag and numeric argument */ @@ -177,10 +177,10 @@ int f, n; /* default flag and numeric argument */ */ #if PROTO -int linstr(CONST char *instr) +int PASCAL NEAR linstr(CONST char *instr) #else -int linstr( instr) -CONST char *instr; +int PASCAL NEAR linstr( instr) +char *instr; #endif { register int status; @@ -241,7 +241,15 @@ CONST char *instr; * well, and FALSE on errors. */ -static int linsert_byte(int n, unsigned char c) +#if PROTO +static int PASCAL NEAR linsert_byte(int n, unsigned char c) +#else +static int PASCAL NEAR linsert_byte(n, c) + +int n; +char c; +#endif + { register char *cp1; register char *cp2; @@ -353,18 +361,18 @@ static int linsert_byte(int n, unsigned char c) #if UTF8 #if PROTO -int linsert(int n, unsigned int c) +int PASCAL NEAR linsert(int n, unsigned int c) #else -int linsert(n, c) +int PASCAL NEAR linsert(n, c) int n; unsigned int c; #endif #else #if PROTO -int linsert(int n, char c) +int PASCAL NEAR linsert(int n, char c) #else -int linsert(n, c) +int PASCAL NEAR linsert(n, c) int n; char c; @@ -406,17 +414,17 @@ char c; */ #if UTF8 #if PROTO -int lowrite(unsigned int c) +int PASCAL NEAR lowrite(unsigned int c) #else -int lowrite(c) +int PASCAL NEAR lowrite(c) char c; /* character to overwrite on current position */ #endif /* PROTO */ #else #if PROTO -int lowrite(int c) +int PASCAL NEAR lowrite(int c) #else -int lowrite(c) +int PASCAL NEAR lowrite(c) int c; /* character to overwrite on current position */ #endif @@ -437,7 +445,7 @@ int c; /* character to overwrite on current position */ * lover -- Overwrite a string at the current point */ -int lover(ostr) +int PASCAL NEAR lover(ostr) CONST char *ostr; @@ -492,7 +500,7 @@ CONST char *ostr; * update of dot and mark is a bit easier then in the above case, because the * split forces more updating. */ -int lnewline() +int PASCAL NEAR lnewline() { register char *cp1; register char *cp2; @@ -619,7 +627,7 @@ should be put in the kill buffer. */ -int ldelete(n, kflag) +int PASCAL NEAR ldelete(n, kflag) long n; /* # of chars to delete */ int kflag; /* put killed text in kill buffer flag */ @@ -848,9 +856,9 @@ int kflag; /* put killed text in kill buffer flag */ */ #if PROTO -char *getctext(char *rline) +char *PASCAL NEAR getctext(char *rline) #else -char *getctext( rline) +char *PASCAL NEAR getctext( rline) char *rline; #endif @@ -877,7 +885,7 @@ char *rline; /* putctext: replace the current line with the passed in text */ -int putctext(iline) +int PASCAL NEAR putctext(iline) char *iline; /* contents of new line */ @@ -906,7 +914,7 @@ char *iline; /* contents of new line */ * about in memory. Return FALSE on error and TRUE if all looks ok. Called by * "ldelete" only. */ -int ldelnewline() +int PASCAL NEAR ldelnewline() { register char *cp1; register char *cp2; @@ -1022,9 +1030,9 @@ int ldelnewline() */ #if PROTO -int addline(BUFFER *bp, CONST char *text) +int PASCAL NEAR addline(BUFFER *bp, CONST char *text) #else -int addline(bp, text) +int PASCAL NEAR addline(bp, text) BUFFER *bp; /* buffer to add text to */ CONST char *text; /* line to add */ @@ -1062,7 +1070,7 @@ CONST char *text; /* line to add */ * in case the buffer has grown to immense size. No errors. */ -VOID kdelete() +VOID PASCAL NEAR kdelete() { KILL *kp; /* ptr to scan kill buffer chunk list */ @@ -1099,7 +1107,7 @@ VOID kdelete() what will be the new kill buffer */ -VOID next_kill() +VOID PASCAL NEAR next_kill() { /* advance to the next kill ring entry */ @@ -1117,9 +1125,9 @@ VOID next_kill() */ #if PROTO -int kinsert(int direct, char c) +int PASCAL NEAR kinsert(int direct, char c) #else -int kinsert(direct, c) +int PASCAL NEAR kinsert(direct, c) int direct; /* direction (FORWARD/REVERSE) to insert characters */ char c; /* character to insert in the kill buffer */ @@ -1208,7 +1216,7 @@ char c; /* character to insert in the kill buffer */ #define Char_insert(a) (a == RET_CHAR ? lnewline() : linsert(1, a)) #endif -int yank(f, n) +int PASCAL NEAR yank(f, n) int f,n; /* prefix flag and argument */ @@ -1290,7 +1298,7 @@ int f,n; /* prefix flag and argument */ return(TRUE); } -int cycle_ring(f, n) +int PASCAL NEAR cycle_ring(f, n) int f,n; /* prefix flag and argument */ @@ -1313,7 +1321,7 @@ int f,n; /* prefix flag and argument */ return TRUE; } -int yank_pop(f, n) +int PASCAL NEAR yank_pop(f, n) int f,n; /* prefix flag and argument */ @@ -1335,7 +1343,7 @@ int f,n; /* prefix flag and argument */ return(yank(FALSE, 1)); } -int clear_ring(f, n) +int PASCAL NEAR clear_ring(f, n) int f,n; /* prefix flag and argument */ diff --git a/src/main.c b/src/main.c index 10a6e02..802f2b8 100644 --- a/src/main.c +++ b/src/main.c @@ -204,7 +204,7 @@ char *argv[]; /* argument strings */ own used memory, otherwise we just exit. */ -clean() +VOID PASCAL NEAR clean() { register BUFFER *bp; /* buffer list pointer */ @@ -254,7 +254,7 @@ clean() /* Process a command line. May be called any time. */ -VOID dcline(argc, argv, firstflag) +VOID PASCAL NEAR dcline(argc, argv, firstflag) int argc; char *argv[]; @@ -504,7 +504,7 @@ int firstflag; /* is this the first time in? */ #if WINDOW_MSWIN #define GETBASEKEY getbasekey -static int getbasekey() +static int PASCAL NEAR getbasekey() { register int c; @@ -528,7 +528,7 @@ static int getbasekey() invented the "recursive-edit" function. */ -int editloop() +int PASCAL NEAR editloop() { register int c; /* command character */ @@ -542,14 +542,14 @@ int editloop() /* setup to process commands */ lastflag = 0; /* Fake last flags. */ - loop: +loop: /* if a macro error is pending, wait for a character */ if (exec_error) { #if WINDOW_MSWIN mlhistory(); #else mlforce(TEXT227); - /* "\n--- Press any key to Continue ---" */ +/* "\n--- Press any key to Continue ---" */ tgetc(); #endif sgarbf = TRUE; @@ -608,6 +608,7 @@ int editloop() discmd = TRUE; disinp = TRUE; c = GETBASEKEY(); + /* if there is something on the command line, clear it */ if (mpresf != FALSE) { mlerase(); @@ -631,7 +632,7 @@ int editloop() basec = c & ~META; /* strip meta char off if there */ if ((c & META) && ((basec >= '0' && basec <= '9') || basec == '-') && - (getbind(c) == NULL)) { + (getbind(c) == NULL)) { f = TRUE; /* there is a # arg */ n = 0; /* start with a zero default */ mflag = 1; /* current minus flag */ @@ -724,7 +725,7 @@ int editloop() * to read in a file by default, and we want the buffer name to be right. */ -int edinit(bname) +int PASCAL NEAR edinit(bname) char bname[]; /* name of buffer to initialize */ @@ -799,7 +800,7 @@ char bname[]; /* name of buffer to initialize */ * look at it. Return the status of command. */ -int execute(c, f, n) +int PASCAL NEAR execute(c, f, n) int c; /* key to execute */ int f; /* prefix argument flag */ @@ -937,12 +938,12 @@ int n; /* prefix value */ /* In ABBREV mode, if we are doing aggressive expansion and the current buffer is a symbol in the abbreviation table */ if (((curbp->b_mode & MDABBR) != 0) && - (ab_quick && (ab_lookup(ab_word) != NULL))) + (ab_quick && (ab_lookup(ab_word) != NULL))) ab_expand(); /* check for CMODE fence matching */ if ((c == '}' || c == ')' || c == ']') && - (curbp->b_mode & MDCMOD) != 0) + (curbp->b_mode & MDCMOD) != 0) fmatch(c); /* check auto-save mode */ @@ -961,7 +962,7 @@ int n; /* prefix value */ } TTbeep(); mlwrite(TEXT19); /* complain */ - /* "[Key not bound]" */ +/* "[Key not bound]" */ lastflag = 0; /* Fake last flags. */ return(FALSE); } @@ -972,7 +973,7 @@ has changed do a write on that buffer and exit emacs, otherwise simply exit. */ -int quickexit(f, n) +int PASCAL NEAR quickexit(f, n) int f, n; /* prefix flag and argument */ @@ -1011,16 +1012,16 @@ int f, n; /* prefix flag and argument */ * has been changed and not written out. Normally bound to "C-X C-C". */ -int quit(f, n) +int PASCAL NEAR quit(f, n) int f, n; /* prefix flag and argument */ { register int status; /* return status */ if (f != FALSE /* Argument forces it. */ - || anycb() == FALSE /* All buffers clean or user says it's OK. */ - || (status = mlyesno(TEXT104)) == TRUE) { - /* "Modified buffers exist. Leave anyway" */ + || anycb() == FALSE /* All buffers clean or user says it's OK. */ + || (status = mlyesno(TEXT104)) == TRUE) { +/* "Modified buffers exist. Leave anyway" */ #if FILOCK if (lockrel() != TRUE) { TTputc('\n'); @@ -1039,7 +1040,7 @@ int f, n; /* prefix flag and argument */ return(status); } -int meexit(status) +int PASCAL NEAR meexit(status) int status; /* return status of emacs */ { eexitflag = TRUE; /* flag a program exit */ @@ -1056,7 +1057,7 @@ int status; /* return status of emacs */ * return. */ -int ctlxlp(f, n) +int PASCAL NEAR ctlxlp(f, n) int f, n; /* prefix flag and argument */ @@ -1079,7 +1080,7 @@ int f, n; /* prefix flag and argument */ * routine. Set up the variables and return to the caller. */ -int ctlxrp(f, n) +int PASCAL NEAR ctlxrp(f, n) int f, n; /* prefix flag and argument */ @@ -1103,7 +1104,7 @@ int f, n; /* prefix flag and argument */ * command gets an error. Return TRUE if all ok, else FALSE. */ -int ctlxe(f, n) +int PASCAL NEAR ctlxe(f, n) int f, n; /* prefix flag and argument */ @@ -1127,7 +1128,7 @@ int f, n; /* prefix flag and argument */ * Sometimes called as a routine, to do general aborting of stuff. */ -int ctrlg(f, n) +int PASCAL NEAR ctrlg(f, n) int f, n; /* prefix flag and argument */ @@ -1142,7 +1143,7 @@ int f, n; /* prefix flag and argument */ /* tell the user that this command is illegal while we are in VIEW (read-only) mode */ -int rdonly() +int PASCAL NEAR rdonly() { TTbeep(); @@ -1151,7 +1152,7 @@ int rdonly() return(FALSE); } -int resterr() +int PASCAL NEAR resterr() { TTbeep(); @@ -1160,7 +1161,7 @@ int resterr() return(FALSE); } -int nullproc(f, n) /* user function that does NOTHING */ +int PASCAL NEAR nullproc(f, n) /* user function that does NOTHING */ int n, f; /* yes, these are default and never used.. but MUST be here */ @@ -1168,7 +1169,7 @@ int n, f; /* yes, these are default and never used.. but MUST be here */ return(TRUE); } -int uemeta(f, n) /* set META prefixing pending */ +int PASCAL NEAR uemeta(f, n) /* set META prefixing pending */ int f, n; /* prefix flag and argument */ @@ -1179,7 +1180,7 @@ int f, n; /* prefix flag and argument */ return(TRUE); } -int cex(f, n) /* set ^X prefixing pending */ +int PASCAL NEAR cex(f, n) /* set ^X prefixing pending */ int f, n; /* prefix flag and argument */ @@ -1190,7 +1191,7 @@ int f, n; /* prefix flag and argument */ return(TRUE); } -int unarg() /* dummy function for binding to universal-argument */ +int PASCAL NEAR unarg() /* dummy function for binding to universal-argument */ { return(TRUE); } @@ -1212,7 +1213,7 @@ int notavail() ALWAYS null terminate */ -char *bytecopy(dst, src, maxlen) +char *PASCAL NEAR bytecopy(dst, src, maxlen) char *dst; /* destination of copied string */ CONST char *src; /* source */ @@ -1232,7 +1233,7 @@ int maxlen; /* maximum length */ */ -char *copystr(sp) +char *PASCAL NEAR copystr(sp) char *sp; /* string to copy */ diff --git a/src/mouse.c b/src/mouse.c index bc47ced..031969b 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -30,7 +30,7 @@ NOSHARE int lastmcmd = MNONE; /* Last mouse command. */ * of the text). If the mouse points at text then dot is * moved to that location. */ -int movemd(f, n) +int PASCAL NEAR movemd(f, n) int f,n; /* prefix flag and argument */ @@ -103,7 +103,7 @@ int f,n; /* prefix flag and argument */ only if we are holding down the proper button */ -int mmove(f, n) +int PASCAL NEAR mmove(f, n) int f,n; /* prefix flag and argument */ @@ -163,7 +163,7 @@ int f,n; /* prefix flag and argument */ kill-region */ -int mregdown(f, n) +int PASCAL NEAR mregdown(f, n) int f,n; /* prefix flag and argument */ @@ -271,7 +271,7 @@ int f,n; /* prefix flag and argument */ 3: reset nclicks to 0 */ -int mregup(f, n) +int PASCAL NEAR mregup(f, n) int f,n; /* prefix flag and argument */ @@ -389,7 +389,7 @@ int f,n; /* prefix flag and argument */ * window scrolls. The code in this function is just * too complex! */ -int movemu(f, n) +int PASCAL NEAR movemu(f, n) int f,n; /* prefix flag and argument */ @@ -524,7 +524,7 @@ int f,n; /* prefix flag and argument */ * considered to be part of the window. */ -EWINDOW *mousewindow(row) +EWINDOW *PASCAL NEAR mousewindow(row) register int row; @@ -559,7 +559,7 @@ register int row; * text in the buffer. */ -LINE *mouseline(wp, row) +LINE *PASCAL NEAR mouseline(wp, row) register EWINDOW *wp; register int row; @@ -585,7 +585,7 @@ register int row; * LINE structure is pointed to by "lp". */ -int mouseoffset(wp, lp, col) +int PASCAL NEAR mouseoffset(wp, lp, col) register EWINDOW *wp; register LINE *lp; @@ -627,7 +627,7 @@ register int col; return(offset); } -VOID mouse_screen() +VOID PASCAL NEAR mouse_screen() { register ESCREEN *screen_ptr; /* screen to test mouse in */ @@ -660,7 +660,7 @@ VOID mouse_screen() } } -int ismodeline(wp, row) +int PASCAL NEAR ismodeline(wp, row) EWINDOW *wp; int row; @@ -682,7 +682,7 @@ int row; let emacs know about the newsize, and have him force a re-draw */ -int resizm(f, n) +int PASCAL NEAR resizm(f, n) int f, n; /* these are ignored... we get the new size info from the mouse driver */ @@ -717,7 +717,7 @@ int f, n; /* these are ignored... we get the new size info from return(TRUE); } -int resizm2(f, n) +int PASCAL NEAR resizm2(f, n) int f, n; /* these are ignored... we get the new size info from the mouse driver */ diff --git a/src/msdos.c b/src/msdos.c index d0159c5..3765a78 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -54,7 +54,7 @@ static int oldbut; /* Previous state of mouse buttons */ static int oldcol; /* previous x position of mouse */ static int oldrow; /* previous y position of mouse */ -int execprog(char *cmd); +int PASCAL NEAR execprog(char *cmd); /* input buffers and pointers */ @@ -102,7 +102,7 @@ int in_get() /* get an event from the input buffer */ * This function is called once to set up the terminal device streams. */ -int ttopen() +int PASCAL NEAR ttopen() { #if MOUSE @@ -183,7 +183,7 @@ int lines; /* # of vertical lines */ * interpreter. On VMS it puts the terminal back in a reasonable state. * Another no-operation on CPM. */ -int ttclose() +int PASCAL NEAR ttclose() { /* nothing here! */ } @@ -195,7 +195,7 @@ int ttclose() * MS-DOS (use the very very raw console output routine). */ -int ttputc(c) +int PASCAL NEAR ttputc(c) int c; @@ -213,7 +213,7 @@ int c; * Flush terminal buffer. Does real work where the terminal output is buffered * up. A no-operation on systems where byte at a time terminal I/O is done. */ -int ttflush() +int PASCAL NEAR ttflush() { } @@ -282,7 +282,7 @@ int doschar() /* call the dos to get a char */ * Read a character from the terminal, performing no editing and doing no echo * at all. Also mouse events are forced into the input stream here. */ -int ttgetc() +int PASCAL NEAR ttgetc() { register int c; /* character read */ @@ -416,7 +416,7 @@ checkmouse() keyboard buffer */ -int typahead() +int PASCAL NEAR typahead() { int flags; /* cpu flags from dos call */ @@ -454,7 +454,7 @@ int typahead() * repaint. Bound to "^X C". */ -int spawncli(f, n) +int PASCAL NEAR spawncli(f, n) int f, n; @@ -480,7 +480,7 @@ int f, n; * character to be typed, then mark the screen as garbage so a full repaint is * done. Bound to "C-X !". */ -int spawn(f, n) +int PASCAL NEAR spawn(f, n) int f, n; @@ -520,7 +520,7 @@ int f, n; * done. Bound to "C-X $". */ -int execprg(int f, int n) +int PASCAL NEAR execprg(f, n) { register int s; @@ -553,7 +553,7 @@ int execprg(int f, int n) * Pipe a one line command into a window * Bound to ^X @ */ -int pipecmd(f, n) +int PASCAL NEAR pipecmd(f, n) int f, n; @@ -643,7 +643,7 @@ int f, n; * filter a buffer through an external DOS program * Bound to ^X # */ -int uefilter(f, n) +int PASCAL NEAR uefilter(f, n) int f, n; @@ -726,7 +726,7 @@ extern int _doserrno; /* SHELLPROG: Execute a command in a subshell */ -int shellprog(cmd) +int PASCAL NEAR shellprog(cmd) char *cmd; /* Incoming command line to execute */ @@ -775,7 +775,7 @@ char *cmd; /* Incoming command line to execute */ #define CFLAG 1 #endif -int execprog(cmd) +int PASCAL NEAR execprog(cmd) char *cmd; /* Incoming command line to execute */ @@ -886,7 +886,7 @@ char *cmd; /* Incoming command line to execute */ /* return a system dependent string with the current time */ -char *timeset() +char *PASCAL NEAR timeset() { #if MWC | TURBO | IC | MSC | ZTC @@ -916,7 +916,7 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *getffile(fspec) +char *PASCAL NEAR getffile(fspec) char *fspec; /* pattern to match */ @@ -965,7 +965,7 @@ char *fspec; /* pattern to match */ return(rbuf); } -char *getnfile() +char *PASCAL NEAR getnfile() { register int index; /* index into various strings */ @@ -994,7 +994,7 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *getffile(fspec) +char *PASCAL NEAR getffile(fspec) char *fspec; /* pattern to match */ @@ -1043,7 +1043,7 @@ char *fspec; /* pattern to match */ return(rbuf); } -char *getnfile() +char *PASCAL NEAR getnfile() { register int index; /* index into various strings */ @@ -1064,7 +1064,7 @@ char *getnfile() return(rbuf); } #else -char *getffile(fspec) +char *PASCAL NEAR getffile(fspec) char *fspec; /* file to match */ @@ -1072,7 +1072,7 @@ char *fspec; /* file to match */ return(NULL); } -char *getnfile() +char *PASCAL NEAR getnfile() { return(NULL); diff --git a/src/mswdisp.c b/src/mswdisp.c index 3c50d81..e5e530b 100644 --- a/src/mswdisp.c +++ b/src/mswdisp.c @@ -77,7 +77,7 @@ static int CaretCol, CaretRow; /* caret position */ /* BuildCellMetrics: fills a CellMetrics structure from a font description */ /* ================ */ -void FAR BuildCellMetrics (CellMetrics *cm, HFONT hFont) +void FAR PASCAL BuildCellMetrics (CellMetrics *cm, HFONT hFont) { HDC hDC; TEXTMETRIC Metrics; @@ -107,7 +107,7 @@ void FAR BuildCellMetrics (CellMetrics *cm, HFONT hFont) /* InvalidateCells: marks character cells for repaint */ /* =============== */ -void FAR InvalidateCells (HWND hWnd, int leftcol, int toprow, +void FAR PASCAL InvalidateCells (HWND hWnd, int leftcol, int toprow, int rightcol, int bottomrow) { RECT Rect; /* used for Cell and Client coordinates */ @@ -144,7 +144,7 @@ void FAR InvalidateCells (HWND hWnd, int leftcol, int toprow, /* MinimumClientSize: computes the minimum client area size */ /* ================= */ -void FAR MinimumClientSize (HWND hWnd, int NCols, int NRows, +void FAR PASCAL MinimumClientSize (HWND hWnd, int NCols, int NRows, int *Width, int *Height) /* The values pointed by Height and Width are set to the smallest value @@ -159,7 +159,7 @@ void FAR MinimumClientSize (HWND hWnd, int NCols, int NRows, /* DisplayableRows: returns the number of rows displayable in the client area */ /* =============== */ -int FAR DisplayableRows (HWND hWnd, int Height, CellMetrics *cm) +int FAR PASCAL DisplayableRows (HWND hWnd, int Height, CellMetrics *cm) /* Heigh is the hypothetic heigh of the client area. If this parameter is 0, the real client area is measured. If it is negative, the @@ -187,7 +187,7 @@ int FAR DisplayableRows (HWND hWnd, int Height, CellMetrics *cm) /* DisplayableColumns: returns the number of columns displayable in the client area */ /* ================== */ -int FAR DisplayableColumns (HWND hWnd, int Width, CellMetrics *cm) +int FAR PASCAL DisplayableColumns (HWND hWnd, int Width, CellMetrics *cm) /* Width is the hypothetic width of the client area. If this parameter is 0, the real client area is measured. If it is negative, the @@ -214,7 +214,7 @@ int FAR DisplayableColumns (HWND hWnd, int Width, CellMetrics *cm) /* UpdateEmacsCaretPos: position the caret according to CaretCol/CaretRow */ /* =================== */ -static void UpdateEmacsCaretPos (void) +static void PASCAL UpdateEmacsCaretPos (void) { POINT pt; @@ -232,7 +232,7 @@ static void UpdateEmacsCaretPos (void) /* EmacsCaret: Creates or destroys the caret */ /* ========== */ -void FAR EmacsCaret (BOOL Show) +void FAR PASCAL EmacsCaret (BOOL Show) /* the Show parameter is TRUE if the caret should be created and FALSE if it should be destroyed */ @@ -272,7 +272,7 @@ void FAR EmacsCaret (BOOL Show) /* MoveEmacsCaret: updates the caret position */ /* ============== */ -void FAR MoveEmacsCaret (HWND hWnd, int col, int row) +void FAR PASCAL MoveEmacsCaret (HWND hWnd, int col, int row) { CaretCol = col; CaretRow = row; @@ -289,7 +289,7 @@ void FAR MoveEmacsCaret (HWND hWnd, int col, int row) /* ShowEmacsCaret: shows or hides the caret used by emacs */ /* ============== */ -void FAR ShowEmacsCaret (BOOL Show) +void FAR PASCAL ShowEmacsCaret (BOOL Show) /* this function is used to make the caret visible only when waiting for user input */ @@ -311,7 +311,7 @@ void FAR ShowEmacsCaret (BOOL Show) /* InMessageLine: non-zero if caret currently in the message line */ /* ============= */ -BOOL FAR InMessageLine (void) +BOOL FAR PASCAL InMessageLine (void) { return (hCaretWnd == hFrameWnd); } /* InMessageLine */ @@ -319,7 +319,7 @@ BOOL FAR InMessageLine (void) /* CellToClient: converts character cell coordinates into client coordinates */ /* ============ */ -void FAR CellToClient (HWND hWnd, POINT Cell, LPPOINT Client) +void FAR PASCAL CellToClient (HWND hWnd, POINT Cell, LPPOINT Client) /* The resulting Client coordinates indicate the upper left pixel one HalfLeadingY above the character cell */ @@ -339,7 +339,7 @@ void FAR CellToClient (HWND hWnd, POINT Cell, LPPOINT Client) /* ClientToCell: converts client coordinates into character cell coordinates */ /* ============ */ -void FAR ClientToCell (HWND hWnd, POINT Client, LPPOINT Cell) +void FAR PASCAL ClientToCell (HWND hWnd, POINT Client, LPPOINT Cell) /* The area associated with a Cell is the character cell itself, plus the HalfLeadingY-high areas above and under the cell */ @@ -371,7 +371,7 @@ void FAR ClientToCell (HWND hWnd, POINT Client, LPPOINT Cell) /* GetMinMaxInfo: processes the WM_GETMINMAXINFO message for a screen */ /* ============= */ -void FAR GetMinMaxInfo (HWND hWnd, LPPOINT rgpt) +void FAR PASCAL GetMinMaxInfo (HWND hWnd, LPPOINT rgpt) { if (InternalRequest) return; /* none of our business */ @@ -403,7 +403,7 @@ void FAR GetMinMaxInfo (HWND hWnd, LPPOINT rgpt) /* ScrReSize: processes the WM_SIZE message */ /* ========= */ -BOOL FAR ScrReSize (HWND hWnd, WPARAM wParam, WORD cx, WORD cy) +BOOL FAR PASCAL ScrReSize (HWND hWnd, WPARAM wParam, WORD cx, WORD cy) /* returns TRUE only if real resizing performed */ { @@ -444,7 +444,7 @@ BOOL FAR ScrReSize (HWND hWnd, WPARAM wParam, WORD cx, WORD cy) /* ScrPaint: processes WM_PAINT messages for emacs screens */ /* ======== */ -void FAR ScrPaint (HWND hWnd) +void FAR PASCAL ScrPaint (HWND hWnd) { ESCREEN *sp; PAINTSTRUCT ps; @@ -574,7 +574,7 @@ void FAR ScrPaint (HWND hWnd) /* MLPaint: processes WM_PAINT messages for the Message Line */ /* ======= */ -void FAR MLPaint (void) +void FAR PASCAL MLPaint (void) { PAINTSTRUCT ps; HANDLE hPrev, hPen; @@ -615,7 +615,7 @@ void FAR MLPaint (void) /* spal: set palette from $palette string */ /* ==== */ -spal (char *pstr) +PASCAL spal (char *pstr) { #if COLOR int pal; /* current palette position */ diff --git a/src/mswdrv.c b/src/mswdrv.c index 08ffdc6..ed9b371 100644 --- a/src/mswdrv.c +++ b/src/mswdrv.c @@ -23,28 +23,28 @@ /* terminal interface table entries */ -static int mswnop(); -static int mswopen(); -static int mswgetc(); -static int mswputc(); -static int mswflush(); -static int mswbeep(); -static int mswmove(); -static int msweeol(); -static int msweeop(); -static int mswbeep(); -static int mswrev(); -static int mswrez(); +static int PASCAL mswnop(); +static int PASCAL mswopen(); +static int PASCAL mswgetc(); +static int PASCAL mswputc(); +static int PASCAL mswflush(); +static int PASCAL mswbeep(); +static int PASCAL mswmove(); +static int PASCAL msweeol(); +static int PASCAL msweeop(); +static int PASCAL mswbeep(); +static int PASCAL mswrev(); +static int PASCAL mswrez(); #if COLOR -static int mswsetfor(); -static int mswsetback(); +static int PASCAL mswsetfor(); +static int PASCAL mswsetback(); #endif -static int mswsleep(); -static int mswnewscr(); -static int mswdelscr(); -static int mswselscr(); -static int mswsizscr(); -static int mswtopscr(); +static int PASCAL mswsleep(); +static int PASCAL mswnewscr(); +static int PASCAL mswdelscr(); +static int PASCAL mswselscr(); +static int PASCAL mswsizscr(); +static int PASCAL mswtopscr(); /* Standard terminal interface dispatch table. */ @@ -110,7 +110,7 @@ static int BackColor; /* background colors */ /* PushMLHist: store the last message line contents in the history */ /* ========== */ -static void PushMLHist (void) +static void PASCAL PushMLHist (void) { char *ml; int i, e; @@ -133,7 +133,7 @@ static void PushMLHist (void) /* MLHistDlgProc: dialog proc for the Message Line History */ /* ============= */ -int EXPORT FAR MLHistDlgProc (HWND hDlg, UINT wMsg, +int EXPORT FAR PASCAL MLHistDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) { switch (wMsg) { @@ -183,7 +183,7 @@ int EXPORT FAR MLHistDlgProc (HWND hDlg, UINT wMsg, core editor loop will pop up a dialog box showing up to MAXMLHIST-1 past messages */ -mlhistory (void) +void PASCAL mlhistory (void) { FARPROC ProcInstance; @@ -195,7 +195,7 @@ mlhistory (void) FreeProcInstance (ProcInstance); } /* mlhistory */ -static void ChangeUpdateRow (int newrow) +static void PASCAL ChangeUpdateRow (int newrow) /* Set UpdateRow to newrow, invalidating the changed cells in the previous update row */ { @@ -210,7 +210,7 @@ static void ChangeUpdateRow (int newrow) /* mswopen: initialize windows interface */ /* ======= */ -static int mswopen () +static int PASCAL mswopen () { static BOOL FirstTime = TRUE; @@ -235,7 +235,7 @@ static int mswopen () /* mswgetc: get character from keyboard (or mouse) */ /* ======= */ -static int mswgetc () +static int PASCAL mswgetc () { return GetInput (); } /* mswgetc */ @@ -244,7 +244,7 @@ static int mswgetc () /* mswputc: put character to display */ /* ======= */ -static int mswputc (c) +static int PASCAL mswputc (c) int c; /* character to write (or 0 for dummy write) */ { if (UpdateRow != CurrentRow) { @@ -288,7 +288,7 @@ int c; /* character to write (or 0 for dummy write) */ /* mswflush: update display from output buffer */ /* ======== */ -static int mswflush () +static int PASCAL mswflush () { ChangeUpdateRow (-1); if (!InternalRequest && (hIOWnd == hFrameWnd)) UpdateWindow (hIOWnd); @@ -303,7 +303,7 @@ static int mswflush () /* mswmove: move the cursor */ /* ======= */ -static int mswmove (int newrow, int newcol) +static int PASCAL mswmove (int newrow, int newcol) { /*-perform IO windows switching depending on the addressed row: if beyond the IO screen, the message line is addressed*/ @@ -333,7 +333,7 @@ static int mswmove (int newrow, int newcol) /* msweeol: erase to end of line */ /* ======= */ -static int msweeol () +static int PASCAL msweeol () { mswputc (0); /* ensure change of row is properly handled */ UpdateCol.leftmost = min(UpdateCol.leftmost,CurrentCol); @@ -354,7 +354,7 @@ static int msweeol () /* msweeop: erase to end of page */ /* ======= */ -static int msweeop () +static int PASCAL msweeop () { if (hIOWnd == hFrameWnd) { /* message line */ msweeol (); /* only one line here */ @@ -386,7 +386,7 @@ static int msweeop () /* mswbeep: sound a beep */ /* ======= */ -static int mswbeep () +static int PASCAL mswbeep () { MessageBeep (0); return 0; @@ -396,7 +396,7 @@ static int mswbeep () /* mswrev: set reverse video state */ /* ====== */ -static int mswrev (state) +static int PASCAL mswrev (state) int state; /* TRUE = reverse, FALSE = normal */ { /* nothing to do: the description of reverse video fields is kept @@ -408,7 +408,7 @@ int state; /* TRUE = reverse, FALSE = normal */ /* mswrez: change "resolution" */ /* ====== */ -static int mswrez (res) +static int PASCAL mswrez (res) char *res; { return TRUE; /* $SRES is read-only in MSWIN, but returning an @@ -419,7 +419,7 @@ char *res; /* mswsetfor: set foreground color */ /* ========= */ -static int mswsetfor (color) +static int PASCAL mswsetfor (color) int color; { ForgColor = color; @@ -429,7 +429,7 @@ int color; /* mswsetback: set background color */ /* ========== */ -static int mswsetback (color) +static int PASCAL mswsetback (color) int color; { BackColor = color; @@ -440,7 +440,7 @@ int color; /* mswsleep: wait a specified time (in ms) in an unobtrusive way */ /* ======== */ -static int mswsleep (int t) +static int PASCAL mswsleep (int t) { return TakeANap (t); } /* mswsleep */ @@ -448,7 +448,7 @@ static int mswsleep (int t) /* mswnewscr: create new MDI window for new screen */ /* ========= */ -static int mswnewscr (ESCREEN *sp) +static int PASCAL mswnewscr (ESCREEN *sp) /* called by screen.c after the screen structure has been allocated. The size of the screen will be determined by the window's size. returns TRUE if successful. */ @@ -501,7 +501,7 @@ static int mswnewscr (ESCREEN *sp) /* mswdelscr: destroys an MDI window for a disappearing screen */ /* ========= */ -static int mswdelscr (ESCREEN *sp) +static int PASCAL mswdelscr (ESCREEN *sp) /* called by screen.c before the screen structure is deallocated */ { if (sp->s_drvhandle == hIOWnd) mswflush (); @@ -513,7 +513,7 @@ static int mswdelscr (ESCREEN *sp) /* mswselscr: select a window/screen combination for the next IOs */ /* ========= */ -static int mswselscr (ESCREEN *sp) +static int PASCAL mswselscr (ESCREEN *sp) { hIOWnd = sp->s_drvhandle; IOScr = sp; @@ -522,7 +522,7 @@ static int mswselscr (ESCREEN *sp) /* mswsizscr: resize an MDI window to fit the associated screen */ /* ========= */ -static int mswsizscr (ESCREEN *sp) +static int PASCAL mswsizscr (ESCREEN *sp) /* called by Emacs when the screen's dimensions have been changed. A resize through the MS-Windows interface is handled by the ReSize function in mswdisp.c */ @@ -651,7 +651,7 @@ static int mswsizscr (ESCREEN *sp) /* mswtopscr: bring a screen's window to top. */ /* ========= */ -static int mswtopscr (ESCREEN *sp) +static int PASCAL mswtopscr (ESCREEN *sp) /* called by screen.c when selecting a screen for current */ { @@ -680,7 +680,7 @@ static int mswtopscr (ESCREEN *sp) /* mswnop: No Operation */ /* ====== */ -static int mswnop () +static int PASCAL mswnop () { return 0; } diff --git a/src/mswemacs.c b/src/mswemacs.c index d50e990..c4e2d05 100644 --- a/src/mswemacs.c +++ b/src/mswemacs.c @@ -28,7 +28,7 @@ static HANDLE hClipData = NULL; /* used by insertclip and /* CopyToClipboard: internal function to copy region to clipboard */ /* =============== */ -static BOOL CopyToClipboard (REGION *Region) +static BOOL PASCAL CopyToClipboard (REGION *Region) { long Size = 0L; HANDLE hData; @@ -101,7 +101,7 @@ static BOOL CopyToClipboard (REGION *Region) /* cutregion: move the current region to the clipboard */ /* ========= */ -int cutregion (int f, int n) +int PASCAL cutregion (int f, int n) { REGION Region; int Result; @@ -120,7 +120,7 @@ int cutregion (int f, int n) /* clipregion: copy the current region into the clipboard */ /* ========== */ -int clipregion (int f, int n) +int PASCAL clipregion (int f, int n) { REGION Region; int Result; @@ -133,7 +133,7 @@ int clipregion (int f, int n) /* insertclip: insert the clipboard contents at dot */ /* ========== */ -int insertclip (int f, int n) +int PASCAL insertclip (int f, int n) { BOOL Result = TRUE; char *Text, *TextHead; @@ -193,7 +193,7 @@ int insertclip (int f, int n) /* ClipboardCleanup: to be called if the user aborts during a longop */ /* ================ */ -void FAR ClipboardCleanup (void) +void FAR PASCAL ClipboardCleanup (void) { if (hClipData) { GlobalUnlock (hClipData); @@ -204,7 +204,7 @@ void FAR ClipboardCleanup (void) /* helpengine: invoke the MS-Windows help engine */ /* ========== */ -int helpengine (int f, int n) +int PASCAL helpengine (int f, int n) { char OldHelpFile [NFILEN]; char HelpKey [NLINE]; @@ -255,7 +255,7 @@ int helpengine (int f, int n) /* minimizescreen: turn the current screen into an icon */ /* ============== */ - minimizescreen (int f, int n) +void PASCAL minimizescreen (int f, int n) { BOOL nq; @@ -269,7 +269,7 @@ int helpengine (int f, int n) /* ForceMessage: do a SendMessage, forcing quiescent mode */ /* ============ */ -static ForceMessage (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam) +static void PASCAL ForceMessage (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam) { BOOL nq; @@ -282,7 +282,7 @@ static ForceMessage (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam) /* maximizescreen: maximize the current screen */ /* ============== */ - maximizescreen (int f, int n) +int PASCAL maximizescreen (int f, int n) { ForceMessage (hMDIClientWnd, WM_MDIMAXIMIZE, (UINT)first_screen->s_drvhandle, 0L); @@ -292,7 +292,7 @@ static ForceMessage (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam) /* restorescreen: restore the current screen from maximized/minimized state */ /* ============= */ - restorescreen (int f, int n) +int PASCAL restorescreen (int f, int n) { ForceMessage (hMDIClientWnd, WM_MDIRESTORE, (UINT)first_screen->s_drvhandle, 0L); @@ -302,7 +302,7 @@ static ForceMessage (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam) /* tilescreens: tile the non-iconized screens */ /* =========== */ - tilescreens (int f, int n) +int PASCAL tilescreens (int f, int n) /* without a numeric argument, tile horizontally. With a numeric argument of 1, tile vertically */ @@ -317,7 +317,7 @@ static ForceMessage (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam) /* cascadescreens: position the non-iconized screens in cascade */ /* ============== */ - cascadescreens (int f, int n) +int PASCAL cascadescreens (int f, int n) { ForceMessage (hMDIClientWnd, WM_MDICASCADE, 0, 0L); return TRUE; @@ -325,7 +325,7 @@ static ForceMessage (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam) /* ScrollMessage: handle WM_HSCROLL and WM_VSCROLL */ /* ============= */ -void FAR ScrollMessage (HWND hWnd, UINT wMsg, WORD ScrlCode, int Pos) +void FAR PASCAL ScrollMessage (HWND hWnd, UINT wMsg, WORD ScrlCode, int Pos) { int Delta; @@ -406,7 +406,7 @@ void FAR ScrollMessage (HWND hWnd, UINT wMsg, WORD ScrlCode, int Pos) /* ScrollBars: shows/hides, enables/disables scroll bars for all screens */ /* ========== */ -void FAR ScrollBars (void) +void FAR PASCAL ScrollBars (void) { static int VScroll = TRUE; @@ -444,7 +444,7 @@ void FAR ScrollBars (void) /* updscrollbars: updates the scroll bars for a screen */ /* ============= */ - updscrollbars (ESCREEN *sp, char w_flag) +void PASCAL updscrollbars (ESCREEN *sp, char w_flag) /* the w_flag is used to determine what needs updating: if the WFHARD bit is set, both scroll bars need an update. If the WFMOVE bit diff --git a/src/mswexec.c b/src/mswexec.c index 2ded057..e026f9d 100644 --- a/src/mswexec.c +++ b/src/mswexec.c @@ -29,7 +29,7 @@ static HWND hPrgWnd; /* window handle of the external program task */ /* HandleTimer: checks the existence of the external program window */ /* =========== */ -static void HandleTimer (HWND hDlg) +static void PASCAL HandleTimer (HWND hDlg) /* This function uses a 200ms timeout to check the existence of the window indicated by hPrgWnd. When that window handle becomes invalid, it is @@ -62,7 +62,7 @@ static void HandleTimer (HWND hDlg) /* WAITFORPRGDlgProc: dialog proc for WAITFORPRG dialog box */ /* ================= */ -int EXPORT FAR WAITFORPRGDlgProc (HWND hDlg, UINT wMsg, +int EXPORT FAR PASCAL WAITFORPRGDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) { switch (wMsg) { @@ -87,7 +87,7 @@ int EXPORT FAR WAITFORPRGDlgProc (HWND hDlg, UINT wMsg, /* LaunchPrgEnumProc: used by LaunchPrg */ /* ================= */ -BOOL EXPORT FAR LaunchPrgEnumProc (HWND hWnd, LPARAM lParam) +BOOL EXPORT FAR PASCAL LaunchPrgEnumProc (HWND hWnd, LPARAM lParam) /* this function sets hPrgWnd when it finds a window that matches the module instance handle passed in lParam */ @@ -104,7 +104,7 @@ BOOL EXPORT FAR LaunchPrgEnumProc (HWND hWnd, LPARAM lParam) /* LaunchPrg: launches and monitors an external program */ /* ========= */ -static BOOL LaunchPrg (char *Cmd, BOOL DOSApp, +static BOOL PASCAL LaunchPrg (char *Cmd, BOOL DOSApp, char *InFile, char *OutFile) /* Returns TRUE if all went well, FALSE if wait cancelled and FAILD if @@ -165,7 +165,7 @@ static BOOL LaunchPrg (char *Cmd, BOOL DOSApp, string) so that the shell terminates with that command. */ if (Cmd) { char ExecOption [10]; - + GetPrivateProfileString (ProgName, "ShellExecOption", " /c ", ExecOption, 10, IniFile); @@ -291,7 +291,7 @@ static BOOL LaunchPrg (char *Cmd, BOOL DOSApp, /* spawncli: launch DOS shell. Bound to ^X-C */ /* ======== */ -spawncli (int f, int n) +int PASCAL spawncli (int f, int n) { /*-don't allow this command if restricted */ if (restflag) return resterr(); @@ -302,7 +302,7 @@ spawncli (int f, int n) /* spawn: run a one-liner in a DOS box. Bound to ^X-! */ /* ===== */ -spawn (int f, int n) +int PASCAL spawn (int f, int n) { char Line[NLINE]; int Result; @@ -321,7 +321,7 @@ spawn (int f, int n) /* execprg: run another program with arguments. Bound to ^X-$ */ /* ======= */ -execprg (int f, int n) +int PASCAL execprg (int f, int n) { char Line[NLINE]; int Result; @@ -345,7 +345,7 @@ execprg (int f, int n) /* pipecmd: pipe a one-liner into a window. Bound to ^X-@ */ /* ======= */ -pipecmd (int f, int n) +int PASCAL pipecmd (int f, int n) /* this function fills a buffer named "command" with the output of the DOS one-liner. If the command buffer already exist, it is overwritten @@ -426,7 +426,7 @@ pipecmd (int f, int n) /* filter: filter a buffer through a DOS box. Bound to ^X-# */ /* ====== */ -uefilter(int f, int n) +int PASCAL uefilter(int f, int n) { char Line[NLINE]; char InFile[NFILEN]; diff --git a/src/mswfile.c b/src/mswfile.c index f310761..80878c7 100644 --- a/src/mswfile.c +++ b/src/mswfile.c @@ -58,11 +58,11 @@ static char StarName [FNAMELEN] = "*.*"; /* starname */ static PARAMS *Par; /* function prototypes */ -int EXPORT FAR FileDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, +int EXPORT FAR PASCAL FileDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam); static void CompletePath (char *s, char *FileName); static void UpdateAll (HWND hDlg, char *s); - + /* ChangeWorkingDir: sets the working dir to match the supplied path */ /* ================ */ @@ -104,7 +104,7 @@ static int ChangeWorkingDir (char * FilePath) /* SetWorkingDir: sets the working dir to the current window's path */ /* ============= */ -int FAR SetWorkingDir (void) +int FAR PASCAL SetWorkingDir (void) /* returns 0 if successful, -1 otherwise */ /* this function also sets the text of the Path displayed in the FILE @@ -120,7 +120,7 @@ int FAR SetWorkingDir (void) /* fullpathname: fully qualifies the given pathname */ /* ============ */ -char * fullpathname (char *PathName, int Nbuf) +char * PASCAL fullpathname (char *PathName, int Nbuf) /* the PathName argument is assumed to be at least Nbuf characters long. It is modified to contain the corresponding full pathname. The @@ -137,7 +137,7 @@ char * fullpathname (char *PathName, int Nbuf) /* filenamedlg: equivalent of mlreply, but specifically to get a filename */ /* =========== */ - filenamedlg (char *prompt, char *buf, int nbuf, int fullpath) +PASCAL filenamedlg (char *prompt, char *buf, int nbuf, int fullpath) { BOOL Result; #if JMDEXT @@ -195,7 +195,7 @@ char * fullpathname (char *PathName, int Nbuf) /* FileDlgOK: process OK in File Dialog */ /* ========= */ -static BOOL FileDlgOK (HWND hDlg) +static BOOL PASCAL FileDlgOK (HWND hDlg) /* this is a service function for FileDlgProc. It processes the OK case. The returned value is TRUE if the dialog box is ending, FALSE @@ -248,7 +248,7 @@ static BOOL FileDlgOK (HWND hDlg) } return FALSE; } /* FileDlgOK */ - + /* FileNameCompletion: process filename edit box for name completion */ /* ================== */ @@ -256,7 +256,7 @@ static BOOL FileDlgOK (HWND hDlg) attempt filename completion if a space is placed at the end of the edit field. Returns TRUE if filename completion was attempted and successful, FALSE otherwise. */ -static BOOL FileNameCompletion (HWND hDlg) +static BOOL PASCAL FileNameCompletion (HWND hDlg) { char s [NFILEN]; int i; @@ -310,7 +310,7 @@ static BOOL FileNameCompletion (HWND hDlg) /* FileDlgProc: Open file dialog function */ /* =========== */ -int EXPORT FAR FileDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, +int EXPORT FAR PASCAL FileDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) { char s [NFILEN]; /* all purpose */ @@ -450,7 +450,7 @@ int EXPORT FAR FileDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, } return FALSE; } /* FileDlgProc */ - + /* CompletePath: prepend Path to the FileName, result in s */ /* ============ */ @@ -484,8 +484,7 @@ static void UpdateAll (HWND hDlg, char *s) #endif } } /* UpdateAll */ - - + #endif // !JMDEXT #if TURBO | IC @@ -497,7 +496,7 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *getffile(fspec) +char *PASCAL getffile(fspec) char *fspec; /* pattern to match */ @@ -546,7 +545,7 @@ char *fspec; /* pattern to match */ return(rbuf); } -char *getnfile() +char *PASCAL getnfile() { register int index; /* index into various strings */ @@ -575,7 +574,7 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *getffile(fspec) +char *PASCAL getffile(fspec) char *fspec; /* pattern to match */ @@ -635,7 +634,7 @@ char *fspec; /* pattern to match */ return(rbuf); } -char *getnfile() +char *PASCAL getnfile() { register int index; /* index into various strings */ @@ -669,7 +668,7 @@ char *getnfile() return(rbuf); } #else -char *getffile(fspec) +char *PASCAL getffile(fspec) char *fspec; /* file to match */ @@ -677,7 +676,7 @@ char *fspec; /* file to match */ return(NULL); } -char *getnfile() +char *PASCAL getnfile() { return(NULL); diff --git a/src/mswfont.c b/src/mswfont.c index 1b7d3d3..1374e38 100644 --- a/src/mswfont.c +++ b/src/mswfont.c @@ -20,7 +20,7 @@ static char FaceName[LF_FACESIZE]; /* SelectFont: Selects the emacs-chosen font in the Device Context */ /* ========== */ -HFONT FAR SelectFont (HDC hDC, HFONT hFont) +HFONT FAR PASCAL SelectFont (HDC hDC, HFONT hFont) /* just like SelectObject, this function returns the previously selected font handle */ @@ -37,7 +37,7 @@ HFONT FAR SelectFont (HDC hDC, HFONT hFont) /* GetFontMetrics: retrieves the TEXTMETRIC and face name of a given font */ /* ============== */ -static void GetFontMetrics (HFONT hFont, TEXTMETRIC *Metrics, +static void PASCAL GetFontMetrics (HFONT hFont, TEXTMETRIC *Metrics, char *FaceName) /* If either Metrics of FaceName is NULL, the corresponding value is not returned. If not NULL, FaceName must point to a string containing at @@ -57,7 +57,7 @@ static void GetFontMetrics (HFONT hFont, TEXTMETRIC *Metrics, /* UpdateMaxRowCol: update the maximas displayed on the dialog box */ /* =============== */ -static void UpdateMaxRowCol (HWND hDlg, HFONT hFont) +static void PASCAL UpdateMaxRowCol (HWND hDlg, HFONT hFont) { CellMetrics cm; char text[17]; @@ -72,7 +72,7 @@ static void UpdateMaxRowCol (HWND hDlg, HFONT hFont) /* UpdateSample: Update the sample text displayed on the dialog box */ /* ============ */ -static void UpdateSample (HWND hDlg, HFONT hFont, +static void PASCAL UpdateSample (HWND hDlg, HFONT hFont, TEXTMETRIC *m, char *FaceName) { #define FONTSAMPLESIZE LF_FACESIZE+40+(26*3) @@ -105,7 +105,7 @@ static void UpdateSample (HWND hDlg, HFONT hFont, /* NewFont: creates a font matching the user's selections */ /* ======= */ -static void NewFont (HWND hDlg, BOOL TrustSizeEdit) +static void PASCAL NewFont (HWND hDlg, BOOL TrustSizeEdit) /* setting TrustSizeEdit to FALSE indicates that the contents of the ID_FONTSIZE edit box should not be used (this is used when this function is called for a size list-selection change, at which time @@ -162,7 +162,7 @@ static void NewFont (HWND hDlg, BOOL TrustSizeEdit) /* AddSize: Add a font size into the font size list (used by EnumSizesProc) */ /* ======= */ -static void AddSize (HWND hDlg, short int Height, short int Width) +static void PASCAL AddSize (HWND hDlg, short int Height, short int Width) { char ItemText[17]; int i; @@ -177,7 +177,7 @@ static void AddSize (HWND hDlg, short int Height, short int Width) /* EnumSizesProc: font enumeration function used by BuildSizeList */ /* ============= */ -int EXPORT FAR EnumSizesProc (LPLOGFONT lf, LPTEXTMETRIC tm, +int EXPORT FAR PASCAL EnumSizesProc (LPLOGFONT lf, LPTEXTMETRIC tm, short FontType, LPSTR Data) /* Data should point to a handle to the dialog box */ @@ -219,7 +219,7 @@ int EXPORT FAR EnumSizesProc (LPLOGFONT lf, LPTEXTMETRIC tm, /* BuildSizeList: initializes the FontSize list box */ /* ============= */ -static void BuildSizeList (HWND hDlg, TEXTMETRIC *Metrics) +static void PASCAL BuildSizeList (HWND hDlg, TEXTMETRIC *Metrics) /* This function initializes the FontSize list box with the sizes available for the face name currently selected in the Font list box. @@ -286,7 +286,7 @@ static void BuildSizeList (HWND hDlg, TEXTMETRIC *Metrics) /* AddFace: Adds a face to the FONT list box if it begets a proper font */ /* ======= */ -static void AddFace (HWND hDlg, char *CandidateFace) +static void PASCAL AddFace (HWND hDlg, char *CandidateFace) { BYTE CharSet; int From, At; /* indexes for list box searches */ @@ -336,7 +336,7 @@ static void AddFace (HWND hDlg, char *CandidateFace) /* EnumFacesProc: face enumeration function used by BuildFaceList */ /* ============= */ -int EXPORT FAR EnumFacesProc (LPLOGFONT lf, LPTEXTMETRIC tm, +int EXPORT FAR PASCAL EnumFacesProc (LPLOGFONT lf, LPTEXTMETRIC tm, short FontType, LPSTR Data) /* Data should point to a handle to the dialog box */ @@ -349,7 +349,7 @@ int EXPORT FAR EnumFacesProc (LPLOGFONT lf, LPTEXTMETRIC tm, /* BuildFaceList: initialize the FONT list box */ /* ============= */ -static void BuildFaceList (HWND hDlg, char *FaceName) +static void PASCAL BuildFaceList (HWND hDlg, char *FaceName) /* This function initializes the Font list box with fixed fonts matching the current charset selection and then selects an item */ @@ -379,7 +379,7 @@ static void BuildFaceList (HWND hDlg, char *FaceName) /* FontDlgProc: Emacs Font dialog box function */ /* =========== */ -int EXPORT FAR FontDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, +int EXPORT FAR PASCAL FontDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) { switch (wMsg) { @@ -517,7 +517,7 @@ int EXPORT FAR FontDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, /* ChangeFont: effects the font change on the screen & message line */ /* ========== */ -static void ChangeFont (void) +static void PASCAL ChangeFont (void) { ESCREEN *sp, *fsp; @@ -550,7 +550,7 @@ static void ChangeFont (void) /* PickEmacsFont: calls-up the FONTS dialog box */ /* ============= */ -BOOL FAR PickEmacsFont (void) +BOOL FAR PASCAL PickEmacsFont (void) /* returns TRUE is a new font has been picked */ { @@ -574,7 +574,7 @@ BOOL FAR PickEmacsFont (void) /* FontInit: initialize a font description from WIN.INI */ /* ======== */ -void FAR FontInit (void) +void FAR PASCAL FontInit (void) { LOGFONT lf; char text[20]; diff --git a/src/mswinput.c b/src/mswinput.c index f133b32..03a261e 100644 --- a/src/mswinput.c +++ b/src/mswinput.c @@ -90,16 +90,16 @@ int in_get (void) /* typahead: TRUE if there are typeahead characters in the input stream */ /* ======== */ -typahead (void) +int PASCAL typahead (void) { if (in_check()) return TRUE; else return FALSE; } /* typahead */ - + /* EatKey: processes WM_(SYS)KEYxxx and WM_(SYS/MENU)CHAR messages */ /* ====== */ -BOOL FAR EatKey (UINT MsgCode, WPARAM wParam, LPARAM lParam) +BOOL FAR PASCAL EatKey (UINT MsgCode, WPARAM wParam, LPARAM lParam) /* This function must be called for each WM_(SYS)KEYxxx or WM_(SYS/MENU)CHAR message. It returns TRUE if it has taken possesion @@ -224,7 +224,7 @@ BOOL FAR EatKey (UINT MsgCode, WPARAM wParam, LPARAM lParam) /* PutMouseMessage: feeds a mouse message into the in_put queue */ /* =============== */ -void PutMouseMessage (UINT wMsg, WPARAM wParam, POINT Position) +void PASCAL PutMouseMessage (UINT wMsg, WPARAM wParam, POINT Position) { char c; @@ -277,7 +277,7 @@ void PutMouseMessage (UINT wMsg, WPARAM wParam, POINT Position) /* MouseMessage: handles client area mouse messages */ /* ============ */ -void FAR MouseMessage (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam) +void FAR PASCAL MouseMessage (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam) { POINT Position; static POINT old_Position = {-1, -1};/* last position reported by movement */ @@ -334,7 +334,7 @@ void FAR MouseMessage (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam) /* DropMessage: handles WM_DROPFILES messages */ /* =========== */ -void FAR DropMessage (HWND hWnd, HDROP hDrop) +void FAR PASCAL DropMessage (HWND hWnd, HDROP hDrop) /* Generates a MS! keystroke. $xpos/$ypos contain the position where the files were dropped, or -1 (actually, 255) if the drop occurred diff --git a/src/mswmenu.c b/src/mswmenu.c index 60984d4..f17d437 100644 --- a/src/mswmenu.c +++ b/src/mswmenu.c @@ -182,7 +182,7 @@ static unsigned int meta_key = 0; /* for GetKeyText */ /* This function is called by the edit loop in main.c, when a MENU extended character is detected. */ -int execmenu (int f, int n) +int PASCAL execmenu (int f, int n) /* f, n: arguments to target function */ { register UINT ID; @@ -213,7 +213,7 @@ int execmenu (int f, int n) /* GenerateMenuSeq: send a menu sequence into the input stream */ /* =============== */ -void FAR GenerateMenuSeq (UINT ID) +void FAR PASCAL GenerateMenuSeq (UINT ID) { if (!in_room (5)) return; in_put (0); /* escape indicator */ @@ -225,7 +225,7 @@ void FAR GenerateMenuSeq (UINT ID) /* AboutDlgProc: About box dialog function */ /* ============ */ -int EXPORT FAR AboutDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, +int EXPORT FAR PASCAL AboutDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) { char s [50]; @@ -276,7 +276,7 @@ int EXPORT FAR AboutDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, /* SetCheck: puts a check mark in a check box */ /* ======== */ -void SetCheck (HWND hDlg, int BoxID) +void PASCAL SetCheck (HWND hDlg, int BoxID) { SendMessage (GetDlgItem (hDlg, BoxID), BM_SETCHECK, 1, 0L); } /* SetCheck */ @@ -284,7 +284,7 @@ void SetCheck (HWND hDlg, int BoxID) /* GetCheck: TRUE is the check box is checked */ /* ======== */ -BOOL GetCheck (HWND hDlg, int BoxID) +BOOL PASCAL GetCheck (HWND hDlg, int BoxID) { return (SendMessage (GetDlgItem (hDlg, BoxID), BM_GETCHECK, 0, 0L) != 0); } /* GetCheck */ @@ -295,7 +295,7 @@ BOOL GetCheck (HWND hDlg, int BoxID) /* must be invoked through DialogBoxParam, with LOWORD(dwInitParam) set to TRUE for global modes and FALSE for current buffer modes */ -int EXPORT FAR ModeDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, +int EXPORT FAR PASCAL ModeDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, LPARAM lParam) { char s[40+NBUFN]; @@ -372,7 +372,7 @@ int EXPORT FAR ModeDlgProc (HWND hDlg, UINT wMsg, WPARAM wParam, /* IsMenuSeparator: TRUE if the item is a separator */ /* =============== */ -static BOOL IsMenuSeparator (HMENU hMenu, int Position) +static BOOL PASCAL IsMenuSeparator (HMENU hMenu, int Position) { DWORD state; @@ -393,7 +393,7 @@ static BOOL IsMenuSeparator (HMENU hMenu, int Position) If the entry is neither an item nor a popup, an item id of 0 is returned */ -UINT GetMenuEntryID (HMENU hMenu, int Position) +UINT PASCAL GetMenuEntryID (HMENU hMenu, int Position) { UINT id; HMENU hSubMenu; @@ -414,7 +414,7 @@ UINT GetMenuEntryID (HMENU hMenu, int Position) /* If there is no match, the returned value point to the BINDNUL entry */ -KEYTAB * FAR FindKeyBinding (void *Func) +KEYTAB * FAR PASCAL FindKeyBinding (void *Func) { register KEYTAB *KTp; @@ -440,7 +440,7 @@ KEYTAB * FAR FindKeyBinding (void *Func) however, it looks them up. Therefore, these variables can be zeroed if there is a doubt about their validity */ -int GetKeyText (int Key, char *Text, int TextLength) +int PASCAL GetKeyText (int Key, char *Text, int TextLength) { int i; /* index in Text */ char c; @@ -552,7 +552,7 @@ int GetKeyText (int Key, char *Text, int TextLength) /* UpdateMenuItemText: sets the key binding info in a menu item */ /* ================== */ -void UpdateMenuItemText (HMENU hMenu, int Position, +void PASCAL UpdateMenuItemText (HMENU hMenu, int Position, MENUTAB *MTp) { KEYTAB *KTp; @@ -588,7 +588,7 @@ void UpdateMenuItemText (HMENU hMenu, int Position, /* here, we may gray menu entries that are invalid. We also try to display a key binding after each menu item */ -void FAR InitMenuPopup (HMENU hMenu, LPARAM lParam) +void FAR PASCAL InitMenuPopup (HMENU hMenu, LPARAM lParam) { int Position; int ItemCount; @@ -760,7 +760,7 @@ void FAR InitMenuPopup (HMENU hMenu, LPARAM lParam) /* SimulateExtendedKey: feed an extended key into the input stream */ /* =================== */ -static void SimulateExtendedKey (int ec) +static void PASCAL SimulateExtendedKey (int ec) { char prefix; @@ -786,7 +786,7 @@ static void SimulateExtendedKey (int ec) /* returns TRUE if the command has been recognized and FALSE otherwise */ -BOOL FAR MenuCommand (WPARAM wParam, LPARAM lParam) +BOOL FAR PASCAL MenuCommand (WPARAM wParam, LPARAM lParam) { FARPROC ProcInstance; #if WINXP @@ -926,7 +926,7 @@ BOOL FAR MenuCommand (WPARAM wParam, LPARAM lParam) /* GetScreenMenuHandle: returns the handle to the 'Screen' menu (for MDI mgt) */ /* =================== */ -HMENU FAR GetScreenMenuHandle (void) +HMENU FAR PASCAL GetScreenMenuHandle (void) { HMENU hBaseMenu; int Pos; @@ -943,7 +943,7 @@ HMENU FAR GetScreenMenuHandle (void) /* MenuEntryCount: count of menu entries, excluding the MDI buttons */ /* ============== */ -static int MenuEntryCount (HMENU hMenu) +static int PASCAL MenuEntryCount (HMENU hMenu) { int Count; @@ -967,7 +967,7 @@ static int MenuEntryCount (HMENU hMenu) /* MenuEntryOffset: position of the first non-MDI button menu entry */ /* =============== */ -static int MenuEntryOffset (HMENU hMenu) +static int PASCAL MenuEntryOffset (HMENU hMenu) { if (hMenu == GetMenu (hFrameWnd)) { #if WINXP @@ -989,7 +989,7 @@ static int MenuEntryOffset (HMENU hMenu) /* ParseMenu: parse a piece of menu path */ /* ========= */ -static BOOL ParseMenu (char *Name, char *Title, int *Posp) +static BOOL PASCAL ParseMenu (char *Name, char *Title, int *Posp) /* Puts the text part of the menu name in Title (at most MAXMENUTITLE characters including the \0) and the position number in *Posp. If no @@ -1029,7 +1029,7 @@ static BOOL ParseMenu (char *Name, char *Title, int *Posp) /* LocateMenu: locate a menu entry matching a piece of menu path */ /* ========== */ -static BOOL LocateMenu (char *Name, CURMENU *CM) +static BOOL PASCAL LocateMenu (char *Name, CURMENU *CM) /* The returned BOOL is TRUE if a matching menu entry was found, FALSE if no such entry was found and FAILD if a syntax problem was @@ -1089,7 +1089,7 @@ static BOOL LocateMenu (char *Name, CURMENU *CM) /* AddMenuEntry: add a menu entry (or, recursively, a cascade of entries) */ /* ============ */ -static BOOL AddMenuEntry (char *Name, UINT ID, CURMENU *CM, +static BOOL PASCAL AddMenuEntry (char *Name, UINT ID, CURMENU *CM, WORD *MenuType) /* the MenuType is a set of flags set returned by this function: MT_DUMMY indicates that the menu item is a mere separator, MT_MENUBAR @@ -1169,7 +1169,7 @@ static BOOL AddMenuEntry (char *Name, UINT ID, CURMENU *CM, /* AddMenuBinding: bind a menu item to an EPOINTER */ /* ============== */ -static BOOL AddMenuBinding (ETYPE EPOINTER eptr, WORD type) +static BOOL PASCAL AddMenuBinding (ETYPE EPOINTER eptr, WORD type) /* called by bindtomenu and macrotomenu, once the function or macro name has been parsed */ @@ -1251,7 +1251,7 @@ static BOOL AddMenuBinding (ETYPE EPOINTER eptr, WORD type) /* bindtomenu: bind a menu item to an emacs function */ /* ========== */ -bindtomenu (int f, int n) +int PASCAL bindtomenu (int f, int n) /* command arguments IGNORED */ { ETYPE EPOINTER e; @@ -1267,7 +1267,7 @@ bindtomenu (int f, int n) /* macrotomenu: bind a menu item to a macro (i.e. a buffer) */ /* =========== */ -macrotomenu (int f, int n) +int PASCAL macrotomenu (int f, int n) /* command arguments IGNORED */ { ETYPE EPOINTER e; @@ -1291,7 +1291,7 @@ macrotomenu (int f, int n) /* DeleteMenuBinding: remove a menu entry and its binding or sub-entries */ /* ================= */ -static BOOL DeleteMenuBinding (HMENU hMenu, int Pos) +static BOOL PASCAL DeleteMenuBinding (HMENU hMenu, int Pos) /* returns TRUE except when an attempt is made to delete the 'Screen' menu */ { @@ -1330,7 +1330,7 @@ static BOOL DeleteMenuBinding (HMENU hMenu, int Pos) /* unbindmenu: remove a menu entry */ /* ========== */ -unbindmenu (int f, int n) +int PASCAL unbindmenu (int f, int n) /* command arguments IGNORED */ { BOOL Result; diff --git a/src/mswsys.c b/src/mswsys.c index 30c62d5..5d025d6 100644 --- a/src/mswsys.c +++ b/src/mswsys.c @@ -62,13 +62,13 @@ static HCURSOR hRealHourglass; #endif /* prototypes */ -static void MessageLoop (BOOL WaitMode); -static BOOL UpdateCursor (HWND hWnd, WPARAM wParam, LPARAM lParam); -static void SetHourglass (BOOL hg); +static void PASCAL MessageLoop (BOOL WaitMode); +static BOOL PASCAL UpdateCursor (HWND hWnd, WPARAM wParam, LPARAM lParam); +static void PASCAL SetHourglass (BOOL hg); /* timeset: return a system-dependent time string */ /* ======= */ -char *timeset() +char *PASCAL timeset() { register char *sp; /* temp string pointer */ @@ -83,7 +83,7 @@ char *timeset() /* longop: to be called regularly while a long operation is in progress */ /* ======== */ -longop (int f) +PASCAL longop (int f) /* f is TRUE to set long operation status and FALSE to reset that status */ /* when a long operation is signaled at least twice, the hourglass @@ -125,7 +125,7 @@ longop (int f) /* mlyesno: ask a yes/no question */ /* ======= */ -mlyesno (char *prompt) +PASCAL mlyesno (char *prompt) /* This function replaces the mlyesno from input.c. Instead of asking a question on the message line, it pops up a message box */ @@ -139,7 +139,7 @@ mlyesno (char *prompt) /* mlabort: display a serious error message (proposes abort) */ /* ======= */ -VOID mlabort (char *s) +VOID PASCAL NEAR mlabort (char *s) { char text[NSTRING]; /* hopefully sufficient! */ @@ -159,7 +159,7 @@ VOID mlabort (char *s) /* WinInit: all the window initialization crap... */ /* ======= */ -BOOL FAR WinInit (LPSTR lpCmdLine, int nCmdShow) +BOOL FAR PASCAL WinInit (LPSTR lpCmdLine, int nCmdShow) /* returns FALSE if failed init */ { @@ -348,7 +348,7 @@ BOOL FAR WinInit (LPSTR lpCmdLine, int nCmdShow) /* SetFrameCaption: sets the frame window's text according to the app Id */ /* =============== */ -static void SetFrameCaption (void) +static void PASCAL SetFrameCaption (void) { char text[sizeof(PROGNAME) + sizeof(VERSION)+20]; char *t; @@ -369,7 +369,7 @@ static void SetFrameCaption (void) /* BroadcastEnumProc: used by EmacsBroadcast */ /* ================= */ -BOOL EXPORT FAR BroadcastEnumProc (HWND hWnd, LPARAM lParam) +BOOL EXPORT FAR PASCAL BroadcastEnumProc (HWND hWnd, LPARAM lParam) { char ClassName [sizeof(FrameClassName)*4+1]; UINT RetVal; @@ -397,7 +397,7 @@ BOOL EXPORT FAR BroadcastEnumProc (HWND hWnd, LPARAM lParam) /* EmacsBroadcast: send a broadcast message to all Emacs applications */ /* ============== */ -static DWORD EmacsBroadcast (DWORD MsgParam) +static DWORD PASCAL EmacsBroadcast (DWORD MsgParam) /* If MsgParam is not zero, the broadcast is sent as an EmacsBroadcastMsg to all the Emacs frame windows, except the one specified by hFrameWnd. @@ -423,7 +423,7 @@ static DWORD EmacsBroadcast (DWORD MsgParam) /* MDIClientSubProc: Subclassing window proc for the MDI Client window */ /* ================ */ -LONG EXPORT FAR MDIClientSubProc (HWND hWnd, UINT wMsg, WPARAM wParam, +LONG EXPORT FAR PASCAL MDIClientSubProc (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam) { switch (wMsg) { @@ -463,7 +463,7 @@ LONG EXPORT FAR MDIClientSubProc (HWND hWnd, UINT wMsg, WPARAM wParam, /* FrameInit: Frame window's WM_CREATE */ /* ========= */ -void FAR FrameInit (CREATESTRUCT *cs) +void FAR PASCAL FrameInit (CREATESTRUCT *cs) { RECT Rect; CLIENTCREATESTRUCT ccs; @@ -526,7 +526,7 @@ void FAR FrameInit (CREATESTRUCT *cs) /* CloseEmacs: handle WM_CLOSE of WM_QUERYENDSESSION messages */ /* ========== */ -static BOOL CloseEmacs (UINT wMsg) +static BOOL PASCAL CloseEmacs (UINT wMsg) /* returns TRUE if emacs should exit */ { @@ -558,7 +558,7 @@ static BOOL CloseEmacs (UINT wMsg) /* ScrWndProc: MDI child (screen) window function */ /* ========== */ -LONG EXPORT FAR ScrWndProc (HWND hWnd, UINT wMsg, WPARAM wParam, +LONG EXPORT FAR PASCAL ScrWndProc (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam) { switch (wMsg) { @@ -746,7 +746,7 @@ LONG EXPORT FAR ScrWndProc (HWND hWnd, UINT wMsg, WPARAM wParam, /* FrameWndProc: frame window function */ /* ============ */ -LONG EXPORT FAR FrameWndProc (HWND hWnd, UINT wMsg, WPARAM wParam, +LONG EXPORT FAR PASCAL FrameWndProc (HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam) { switch (wMsg) { @@ -935,7 +935,7 @@ LONG EXPORT FAR FrameWndProc (HWND hWnd, UINT wMsg, WPARAM wParam, /* WinMain: Application entry point */ /* ======= */ -int WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, +int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { hEmacsInstance = hInstance; @@ -962,7 +962,7 @@ int WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, /* ModifyCursor: forces a WM_SETCURSOR */ /* ============ */ -static void ModifyCursor (void) +static void PASCAL ModifyCursor (void) { POINT pt; @@ -973,7 +973,7 @@ static void ModifyCursor (void) /* MessageLoop: Main message loop */ /* =========== */ -static void MessageLoop (BOOL WaitMode) +static void PASCAL MessageLoop (BOOL WaitMode) /* If WaitMode is TRUE this function uses GetMessage the first time and PeekMessage after that, until the input queue is empty and there is @@ -1034,7 +1034,7 @@ static void MessageLoop (BOOL WaitMode) /* The returned value is the next character from the input stream */ -int FAR GetInput (void) +int FAR PASCAL GetInput (void) { if (!in_check ()) { ShowEmacsCaret (TRUE); @@ -1047,7 +1047,7 @@ int FAR GetInput (void) /* TakeANap: put emacs to sleep for a few milliseconds */ /* ======== */ -int FAR TakeANap (int t) +int FAR PASCAL TakeANap (int t) /* this function is used by mswsleep(). It returns TRUE unless the timer could not be created. Note that for a null time, it simply relinquishes the processor */ @@ -1077,7 +1077,7 @@ int FAR TakeANap (int t) /* UpdateCursor: sets the apropriate Emacs cursor shape */ /* ============ */ -static BOOL UpdateCursor (HWND hWnd, WPARAM wParam, LPARAM lParam) +static BOOL PASCAL UpdateCursor (HWND hWnd, WPARAM wParam, LPARAM lParam) /* this function should be called on each WM_SETCURSOR message, to display the appropriate cursor. It returns TRUE if all processing has @@ -1140,7 +1140,7 @@ static BOOL UpdateCursor (HWND hWnd, WPARAM wParam, LPARAM lParam) /* SetHourglass: sets or removes the hourglass cursor */ /* ============ */ -static void SetHourglass (BOOL hg) +static void PASCAL SetHourglass (BOOL hg) /* hg = TRUE sets the hourglass, hg = FALSE removes it */ { diff --git a/src/necdos.c b/src/necdos.c index 1d69f01..8dbbed0 100644 --- a/src/necdos.c +++ b/src/necdos.c @@ -50,7 +50,7 @@ static int nbuttons; /* number of buttons on the mouse */ static int oldright; /* old right button status */ static int oldleft; /* old left button status */ -execprog(char *cmd); +PASCAL NEAR execprog(char *cmd); /* input buffers and pointers */ @@ -98,7 +98,7 @@ int in_get() /* get an event from the input buffer */ * This function is called once to set up the terminal device streams. */ -ttopen() +PASCAL NEAR ttopen() { #if MOUSE @@ -185,7 +185,7 @@ int lines; /* # of vertical lines */ * interpreter. On VMS it puts the terminal back in a reasonable state. * Another no-operation on CPM. */ -ttclose() +PASCAL NEAR ttclose() { #if (HP150 == 0) & LATTICE /* restore the ctrl-break interrupt */ @@ -203,7 +203,7 @@ ttclose() * MS-DOS (use the very very raw console output routine). */ -ttputc(c) +PASCAL NEAR ttputc(c) int c; @@ -221,7 +221,7 @@ int c; * Flush terminal buffer. Does real work where the terminal output is buffered * up. A no-operation on systems where byte at a time terminal I/O is done. */ -ttflush() +PASCAL NEAR ttflush() { } @@ -248,7 +248,7 @@ int doschar() /* call the dos to get a char */ * Read a character from the terminal, performing no editing and doing no echo * at all. Also mouse events are forced into the input stream here. */ -ttgetc() +PASCAL NEAR ttgetc() { register int c; /* character read */ @@ -367,7 +367,7 @@ checkmouse() keyboard buffer */ -typahead() +PASCAL NEAR typahead() { int flags; /* cpu flags from dos call */ @@ -398,7 +398,7 @@ typahead() * repaint. Bound to "^X C". */ -spawncli(f, n) +PASCAL NEAR spawncli(f, n) int f, n; @@ -421,7 +421,7 @@ int f, n; * character to be typed, then mark the screen as garbage so a full repaint is * done. Bound to "C-X !". */ -spawn(f, n) +PASCAL NEAR spawn(f, n) int f, n; @@ -455,7 +455,7 @@ int f, n; * done. Bound to "C-X $". */ -execprg(f, n) +PASCAL NEAR execprg(f, n) { register int s; @@ -485,7 +485,7 @@ execprg(f, n) * Pipe a one line command into a window * Bound to ^X @ */ -pipecmd(f, n) +PASCAL NEAR pipecmd(f, n) int f, n; @@ -572,7 +572,7 @@ int f, n; * filter a buffer through an external DOS program * Bound to ^X # */ -uefilter(f, n) +PASCAL NEAR uefilter(f, n) int f, n; @@ -652,7 +652,7 @@ extern int _doserrno; /* SHELLPROG: Execute a command in a subshell */ -shellprog(cmd) +PASCAL NEAR shellprog(cmd) char *cmd; /* Incoming command line to execute */ @@ -701,7 +701,7 @@ char *cmd; /* Incoming command line to execute */ #define CFLAG 1 #endif -execprog(cmd) +PASCAL NEAR execprog(cmd) char *cmd; /* Incoming command line to execute */ @@ -736,7 +736,7 @@ char *cmd; /* Incoming command line to execute */ strcpy(&tail[1], cmd); strcat(&tail[1], "\r"); - /* look up the program on the path trying various extensions */ + /* look up the program on the path trying various extentions */ if ((sp = flook(prog, TRUE)) == NULL) if ((sp = flook(strcat(prog, ".exe"), TRUE)) == NULL) { strcpy(&prog[strlen(prog)-4], ".com"); @@ -807,9 +807,9 @@ char *cmd; /* Incoming command line to execute */ return((rval < 0) ? FALSE : TRUE); } -/* return a system dependent string with the current time */ +/* return a system dependant string with the current time */ -char *timeset() +char *PASCAL NEAR timeset() { #if MWC | TURBO | IC | MSC @@ -933,14 +933,14 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *getffile(fspec) +char *PASCAL NEAR getffile(fspec) char *fspec; /* pattern to match */ { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extension? */ + register int extflag; /* does the file have an extention? */ char fname[NFILEN]; /* file/path for DOS call */ /* first parse the file path off the file spec */ @@ -982,12 +982,12 @@ char *fspec; /* pattern to match */ return(rbuf); } -char *getnfile() +char *PASCAL NEAR getnfile() { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extension? */ + register int extflag; /* does the file have an extention? */ char fname[NFILEN]; /* file/path for DOS call */ /* and call for the first file */ @@ -1011,14 +1011,14 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *getffile(fspec) +char *PASCAL NEAR getffile(fspec) char *fspec; /* pattern to match */ { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extension? */ + register int extflag; /* does the file have an extention? */ char fname[NFILEN]; /* file/path for DOS call */ /* first parse the file path off the file spec */ @@ -1060,12 +1060,12 @@ char *fspec; /* pattern to match */ return(rbuf); } -char *getnfile() +char *PASCAL NEAR getnfile() { register int index; /* index into various strings */ register int point; /* index into other strings */ - register int extflag; /* does the file have an extension? */ + register int extflag; /* does the file have an extention? */ char fname[NFILEN]; /* file/path for DOS call */ /* and call for the first file */ @@ -1081,7 +1081,7 @@ char *getnfile() return(rbuf); } #else -char *getffile(fspec) +char *PASCAL NEAR getffile(fspec) char *fspec; /* file to match */ @@ -1089,7 +1089,7 @@ char *fspec; /* file to match */ return(NULL); } -char *getnfile() +char *PASCAL NEAR getnfile() { return(NULL); diff --git a/src/nt.c b/src/nt.c index ecc8311..5bd0888 100644 --- a/src/nt.c +++ b/src/nt.c @@ -33,7 +33,7 @@ * repaint. Bound to "^X C". The message at the start in VMS puts out a newline. * Under some (unknown) condition, you don't get one free when DCL starts up. */ -spawncli(f, n) +PASCAL NEAR spawncli(f, n) { /* don't allow this command if restricted */ if (restflag) @@ -54,7 +54,7 @@ spawncli(f, n) * character to be typed, then mark the screen as garbage so a full repaint is * done. Bound to "C-X !". */ -spawn(f, n) +PASCAL NEAR spawn(f, n) { register int s; char line[NLINE]; @@ -86,7 +86,7 @@ spawn(f, n) * done. Bound to "C-X $". */ -execprg(f, n) +PASCAL NEAR execprg(f, n) { register int s; char line[NLINE]; @@ -117,7 +117,7 @@ execprg(f, n) * We use a unique temporary file name so that multiple instances of * MicroEMACS don't try to use the same file. */ -pipecmd(f, n) +PASCAL NEAR pipecmd(f, n) { register EWINDOW *wp; /* pointer to new window */ register BUFFER *bp; /* pointer to buffer to zot */ @@ -206,7 +206,7 @@ pipecmd(f, n) * We use unique temporary file names so that multiple instances of * MicroEMACS don't try to use the same file. */ -uefilter(f, n) +PASCAL NEAR uefilter(f, n) { register int s; /* return status from CLI */ @@ -363,7 +363,7 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *getffile(fspec) +char *PASCAL NEAR getffile(fspec) char *fspec; /* pattern to match */ @@ -413,7 +413,7 @@ char *fspec; /* pattern to match */ return(rbuf); } -char *getnfile() +char *PASCAL NEAR getnfile() { /* and call for the next file */ @@ -431,7 +431,7 @@ char *getnfile() /* return a system dependent string with the current time */ -char *timeset() +char *PASCAL NEAR timeset() { register char *sp; /* temp string pointer */ diff --git a/src/os2.c b/src/os2.c index eb2a18c..0f9fbb0 100644 --- a/src/os2.c +++ b/src/os2.c @@ -376,7 +376,7 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *getffile(fspec) +char *PASCAL NEAR getffile(fspec) char *fspec; /* pattern to match */ @@ -428,7 +428,7 @@ char *fspec; /* pattern to match */ return(rbuf); } -char *getnfile() +char *PASCAL NEAR getnfile() { register int index; /* index into various strings */ diff --git a/src/random.c b/src/random.c index cb5f4b8..9cc46e3 100644 --- a/src/random.c +++ b/src/random.c @@ -3,6 +3,7 @@ * commands. There is no functional grouping here, for sure. * * Unicode support by Jean-Michel Dubois + * Theos port by Jean-Michel Dubois */ #include @@ -23,7 +24,7 @@ * Normally this is bound to "C-X =". */ -int showcpos(f, n) +int PASCAL NEAR showcpos(f, n) int f, n; /* prefix flag and argument */ @@ -127,7 +128,7 @@ int f, n; /* prefix flag and argument */ return(TRUE); } -long getlinenum(bp, sline) /* get the a line number */ +long PASCAL NEAR getlinenum(bp, sline) /* get the a line number */ BUFFER *bp; /* buffer to get current line from */ LINE *sline; /* line to search for */ @@ -156,7 +157,7 @@ LINE *sline; /* line to search for */ * Return current column. Stop at first non-blank given TRUE argument. */ -int getccol(bflg) +int PASCAL NEAR getccol(bflg) int bflg; { @@ -193,7 +194,7 @@ int bflg; /* findcol: Return display column in line at char position */ -int findcol(lp, pos) +int PASCAL NEAR findcol(lp, pos) LINE * lp; /* line to scan */ int pos; /* character offset */ @@ -236,7 +237,7 @@ int pos; /* character offset */ * Set current column. */ -int setccol(pos) +int PASCAL NEAR setccol(pos) int pos; /* position to set cursor */ { @@ -300,7 +301,7 @@ int pos; /* position to set cursor */ * to keep this working as it always has. */ -int twiddle(f, n) +int PASCAL NEAR twiddle(f, n) int f, n; /* prefix flag and argument */ @@ -355,7 +356,7 @@ int f, n; /* prefix flag and argument */ * function key is pressed, its symbolic MicroEMACS name gets inserted! */ -int quote(f, n) +int PASCAL NEAR quote(f, n) int f, n; /* prefix flag and argument */ { @@ -400,7 +401,7 @@ int f, n; /* prefix flag and argument */ * into "C-I" (in 10 bit code) already. Bound to "C-I". */ -int uetab(f, n) +int PASCAL NEAR uetab(f, n) int f, n; /* prefix flag and argument */ { @@ -415,7 +416,7 @@ int f, n; /* prefix flag and argument */ return (linsert(stabsize - (getccol(FALSE) % stabsize), ' ')); } -int detab(f, n) /* change tabs to spaces */ +int PASCAL NEAR detab(f, n) /* change tabs to spaces */ int f, n; /* default flag and numeric repeat count */ { @@ -464,7 +465,7 @@ int f, n; /* default flag and numeric repeat count */ } -int entab(f, n) /* change spaces to tabs where posible */ +int PASCAL NEAR entab(f, n) /* change spaces to tabs where posible */ int f, n; /* default flag and numeric repeat count */ { @@ -541,7 +542,7 @@ int f, n; /* default flag and numeric repeat count */ with no arguments, it trims the current region */ -int trim(f, n) +int PASCAL NEAR trim(f, n) int f, n; /* default flag and numeric repeat count */ { @@ -589,7 +590,7 @@ int f, n; /* default flag and numeric repeat count */ * procerssors. They even handle the looping. Normally this is bound to "C-O". */ -int openline(f, n) +int PASCAL NEAR openline(f, n) int f, n; /* prefix flag and argument */ { @@ -617,7 +618,7 @@ int f, n; /* prefix flag and argument */ * indentation as specified. */ -int new_line(f, n) +int PASCAL NEAR uenewline(f, n) int f, n; /* prefix flag and argument */ { @@ -652,7 +653,7 @@ int f, n; /* prefix flag and argument */ return(TRUE); } -int cinsert() /* insert a newline and indentation for C */ +int PASCAL NEAR cinsert() /* insert a newline and indentation for C */ { register char *cptr; /* string pointer into text to copy */ register int i; /* index into line to copy indent from */ @@ -713,7 +714,7 @@ int cinsert() /* insert a newline and indentation for C */ return(TRUE); } -int insbrace(n, c) /* insert a brace into the text here...we are in CMODE */ +int PASCAL NEAR insbrace(n, c) /* insert a brace into the text here...we are in CMODE */ int n; /* repeat count */ int c; /* brace to insert (always } for now) */ @@ -809,7 +810,7 @@ int c; /* brace to insert (always } for now) */ return(linsert(n, c)); } -int inspound() /* insert a # into the text here...we are in CMODE */ +int PASCAL NEAR inspound() /* insert a # into the text here...we are in CMODE */ { register int ch; /* last character before input */ @@ -844,7 +845,7 @@ int inspound() /* insert a # into the text here...we are in CMODE */ * ignored. */ -int deblank(f, n) +int PASCAL NEAR deblank(f, n) int f, n; /* prefix flag and argument */ { @@ -877,7 +878,7 @@ int f, n; /* prefix flag and argument */ * subcomands failed. Normally bound to "C-J". */ -int indent(f, n) +int PASCAL NEAR indent(f, n) int f, n; /* prefix flag and argument */ { @@ -925,7 +926,7 @@ int f, n; /* prefix flag and argument */ * of text if typed with a big argument. Normally bound to "C-D". */ -int forwdel(f, n) +int PASCAL NEAR forwdel(f, n) int f, n; /* prefix flag and argument */ @@ -958,7 +959,7 @@ int f, n; /* prefix flag and argument */ * both "RUBOUT" and "C-H". */ -int backdel(f, n) +int PASCAL NEAR backdel(f, n) int f, n; /* prefix flag and argument */ @@ -1002,7 +1003,7 @@ int f, n; /* prefix flag and argument */ * that number of newlines. Normally bound to "C-K". */ -int killtext(f, n) +int PASCAL NEAR killtext(f, n) int f, n; /* prefix flag and argument */ @@ -1050,35 +1051,35 @@ int f, n; /* prefix flag and argument */ return(ldelete(chunk, TRUE)); } -int setmod(f, n) /* prompt and set an editor mode */ +int PASCAL NEAR setmod(f, n) /* prompt and set an editor mode */ int f, n; /* default and argument */ { return(adjustmode(TRUE, FALSE)); } -int delmode(f, n) /* prompt and delete an editor mode */ +int PASCAL NEAR delmode(f, n) /* prompt and delete an editor mode */ int f, n; /* default and argument */ { return(adjustmode(FALSE, FALSE)); } -int setgmode(f, n) /* prompt and set a global editor mode */ +int PASCAL NEAR setgmode(f, n) /* prompt and set a global editor mode */ int f, n; /* default and argument */ { return(adjustmode(TRUE, TRUE)); } -int delgmode(f, n) /* prompt and delete a global editor mode */ +int PASCAL NEAR delgmode(f, n) /* prompt and delete a global editor mode */ int f, n; /* default and argument */ { return(adjustmode(FALSE, TRUE)); } -int adjustmode(kind, global) /* change the editor mode status */ +int PASCAL NEAR adjustmode(kind, global) /* change the editor mode status */ int kind; /* true = set, false = delete */ int global; /* true = global flag, false = current buffer flag */ @@ -1207,7 +1208,7 @@ int global; /* true = global flag, false = current buffer flag */ /* This function simply clears the message line, mainly for macro usage */ -int clrmes(f, n) +int PASCAL NEAR clrmes(f, n) int f, n; /* arguments ignored */ { @@ -1218,7 +1219,7 @@ int f, n; /* arguments ignored */ /* This function writes a string on the message line mainly for macro usage */ -int writemsg(f, n) +int PASCAL NEAR writemsg(f, n) int f, n; /* arguments ignored */ { @@ -1236,7 +1237,7 @@ int f, n; /* arguments ignored */ /* the cursor is moved to a matching fence */ -int getfence(f, n) +int PASCAL NEAR getfence(f, n) int f, n; /* not used */ { @@ -1356,9 +1357,9 @@ int f, n; /* not used */ on screen the cursor briefly lights there */ #if PROTO -int fmatch(char ch) +int PASCAL NEAR fmatch(char ch) #else -int fmatch(ch) +int PASCAL NEAR fmatch(ch) char ch; /* fence type to match against */ #endif @@ -1466,7 +1467,7 @@ char ch; /* fence type to match against */ /* ask for and insert a string into the current buffer at the current point */ -int istring(f, n) +int PASCAL NEAR istring(f, n) int f, n; /* ignored arguments */ @@ -1492,7 +1493,7 @@ int f, n; /* ignored arguments */ return(status); } -int ovstring(f, n) /* ask for and overwite a string into the current +int PASCAL NEAR ovstring(f, n) /* ask for and overwite a string into the current buffer at the current point */ int f, n; /* ignored arguments */ @@ -1518,7 +1519,7 @@ int f, n; /* ignored arguments */ return(status); } -int lookup_color(sp) +int PASCAL NEAR lookup_color(sp) char *sp; /* name to look up */ { diff --git a/src/region.c b/src/region.c index 31b3de5..1bc1840 100644 --- a/src/region.c +++ b/src/region.c @@ -17,7 +17,7 @@ used by the trim/entab/detab-region commands */ -int reglines() +int PASCAL NEAR reglines() { register LINE *linep; /* position while scanning */ @@ -53,7 +53,7 @@ int reglines() * Move "." to the start, and kill the characters. * Bound to "C-W". */ -int killregion(f, n) +int PASCAL NEAR killregion(f, n) int f,n; /* prefix flag and argument */ @@ -89,7 +89,7 @@ int f,n; /* prefix flag and argument */ * at all. This is a bit like a kill region followed * by a yank. Bound to "M-W". */ -int copyregion(f, n) +int PASCAL NEAR copyregion(f, n) int f,n; /* prefix flag and argument */ @@ -131,7 +131,7 @@ int f,n; /* prefix flag and argument */ * redisplay is done in all buffers. Bound to * "C-X C-L". */ -int lowerregion(f, n) +int PASCAL NEAR lowerregion(f, n) int f,n; /* prefix flag and argument */ @@ -215,7 +215,7 @@ int f,n; /* prefix flag and argument */ * redisplay is done in all buffers. Bound to * "C-X C-L". */ -int upperregion(f, n) +int PASCAL NEAR upperregion(f, n) int f,n; /* prefix flag and argument */ @@ -293,7 +293,7 @@ int f,n; /* prefix flag and argument */ the current buffer invisable and unchangable */ -int narrow(f, n) +int PASCAL NEAR narrow(f, n) int f,n; /* prefix flag and argument */ @@ -383,7 +383,7 @@ int f,n; /* prefix flag and argument */ /* widen-from-region (^X->) restores a narrowed region */ -int widen(f, n) +int PASCAL NEAR widen(f, n) int f,n; /* prefix flag and argument */ @@ -476,7 +476,7 @@ int f,n; /* prefix flag and argument */ * "ABORT" status; we might make this have the confirm thing later. */ -int getregion(rp) +int PASCAL NEAR getregion(rp) register REGION *rp; @@ -538,7 +538,7 @@ register REGION *rp; * It is assumed that the buffer size is at least one plus the * region size. */ -char *regtostr(buf, region) +char *PASCAL NEAR regtostr(buf, region) char *buf; REGION *region; @@ -568,7 +568,7 @@ REGION *region; return buf; } -char *getreg(value) /* return some of the contents of the current region */ +char *PASCAL NEAR getreg(value) /* return some of the contents of the current region */ char *value; @@ -586,7 +586,7 @@ char *value; } -int indent_region(f, n) /* indent a region n tab-stops */ +int PASCAL NEAR indent_region(f, n) /* indent a region n tab-stops */ int f,n; /* default flag and numeric repeat count */ @@ -625,7 +625,7 @@ int f,n; /* default flag and numeric repeat count */ return(TRUE); } -int undent_region(f, n) /* undent a region n tab-stops */ +int PASCAL NEAR undent_region(f, n) /* undent a region n tab-stops */ int f,n; /* default flag and numeric repeat count */ diff --git a/src/replace.c b/src/replace.c index 935ed75..93c130a 100644 --- a/src/replace.c +++ b/src/replace.c @@ -17,7 +17,7 @@ static char *oldpatmatch = NULL; /* allocated memory for un-do.*/ /* * sreplace -- Search and replace. */ -int sreplace(f, n) +int PASCAL NEAR sreplace(f, n) int f; /* default flag */ int n; /* # of repetitions wanted */ { @@ -27,7 +27,7 @@ int n; /* # of repetitions wanted */ /* * qreplace -- search and replace with query. */ -int qreplace(f, n) +int PASCAL NEAR qreplace(f, n) int f; /* default flag */ int n; /* # of repetitions wanted */ { @@ -38,7 +38,7 @@ int n; /* # of repetitions wanted */ * replaces -- Search for a string and replace it with another * string. Query might be enabled (according to kind). */ -int NEAR replaces(kind, f, n) +int PASCAL NEAR replaces(kind, f, n) int kind; /* Query enabled flag */ int f; /* default flag */ int n; /* # of repetitions wanted */ @@ -291,7 +291,7 @@ pprompt: mlrquery(); /* * mlrquery -- The prompt for query-replace-string. */ -VOID mlrquery() +VOID PASCAL NEAR mlrquery() { register int tcol; #if MAGIC @@ -334,7 +334,7 @@ VOID mlrquery() * then either insert the string directly, or make use of * replacement meta-array. */ -int delins(dlength, instr, use_rmc) +int PASCAL NEAR delins(dlength, instr, use_rmc) int dlength; char *instr; int use_rmc; @@ -384,7 +384,7 @@ int use_rmc; * the array is never actually created - we will just use the * character array rpat[] as the replacement string. */ -int rmcstr() +int PASCAL NEAR rmcstr() { RMC *rmcptr; char *patptr; @@ -502,7 +502,7 @@ int rmcstr() /* * rmcclear -- Free up any strings, and MCNIL the RMC array. */ -VOID rmcclear() +VOID PASCAL NEAR rmcclear() { register RMC *rmcptr; diff --git a/src/screen.c b/src/screen.c index a4b9c94..6882c81 100644 --- a/src/screen.c +++ b/src/screen.c @@ -32,7 +32,7 @@ char *msg; #if WINDOW_TEXT /* Redraw given screen and all screens behind it */ -VOID refresh_screen(sp) +VOID PASCAL NEAR refresh_screen(sp) ESCREEN *sp; /* screen image to refresh */ @@ -66,7 +66,7 @@ ESCREEN *sp; /* screen image to refresh */ to A-N on machines with an ALT key */ -int cycle_screens(f, n) +int PASCAL NEAR cycle_screens(f, n) int f,n; /* prefix flag and argument */ @@ -82,7 +82,7 @@ int f,n; /* prefix flag and argument */ return(select_screen(sp, TRUE)); } -int find_screen(f, n) +int PASCAL NEAR find_screen(f, n) int f,n; /* prefix flag and argument */ @@ -113,7 +113,7 @@ int f,n; /* prefix flag and argument */ return(select_screen(sp, TRUE)); } -VOID free_screen(sp) /* free all resouces associated with a screen */ +VOID PASCAL NEAR free_screen(sp) /* free all resouces associated with a screen */ ESCREEN *sp; /* screen to dump */ @@ -149,7 +149,7 @@ ESCREEN *sp; /* screen to dump */ free((char *) sp); } -VOID unlist_screen(sp) +VOID PASCAL NEAR unlist_screen(sp) ESCREEN *sp; /* screen to remove from the list */ { @@ -164,7 +164,7 @@ ESCREEN *sp; /* screen to remove from the list */ last_scr->s_next_screen = sp->s_next_screen; } -int delete_screen(f, n) +int PASCAL NEAR delete_screen(f, n) int f,n; /* prefix flag and argument */ @@ -202,7 +202,7 @@ int f,n; /* prefix flag and argument */ /* this function initializes a new screen.... */ -ESCREEN *init_screen(scr_name, scr_buf) +ESCREEN *PASCAL NEAR init_screen(scr_name, scr_buf) char *scr_name; /* screen name */ BUFFER *scr_buf; /* buffer to place in first window of screen */ @@ -294,7 +294,7 @@ BUFFER *scr_buf; /* buffer to place in first window of screen */ return(sp); } -ESCREEN *lookup_screen(scr_name) +ESCREEN *PASCAL NEAR lookup_screen(scr_name) char *scr_name; /* named screen to find */ @@ -317,7 +317,7 @@ char *scr_name; /* named screen to find */ return((ESCREEN *)NULL); } -int select_screen(sp, announce) +int PASCAL NEAR select_screen(sp, announce) ESCREEN *sp; /* ptr to screen to switch to */ int announce; /* announce the selection? */ @@ -396,7 +396,7 @@ int announce; /* announce the selection? */ Bound to "A-B". */ -int list_screens(f, n) +int PASCAL NEAR list_screens(f, n) int f,n; /* prefix flag and argument */ @@ -418,7 +418,7 @@ int f,n; /* prefix flag and argument */ * is an error (if there is no memory). Iflag * indicates whether to list hidden screens. */ -int screenlist(iflag) +int PASCAL NEAR screenlist(iflag) int iflag; /* list hidden screen flag */ @@ -492,7 +492,7 @@ int iflag; /* list hidden screen flag */ /* rename_screen: change the current screen's name */ -int rename_screen(f, n) +int PASCAL NEAR rename_screen(f, n) int f, n; /* default number and arguments */ diff --git a/src/search.c b/src/search.c index 6bbf29f..f53e613 100644 --- a/src/search.c +++ b/src/search.c @@ -33,9 +33,9 @@ static int o = 0; /* For longop() calls.*/ * the match string, and (perhaps) repaint the display. */ #if PROTO -int forwsearch(int f, int n) +int PASCAL NEAR forwsearch(int f, int n) #else -int forwsearch( f, n) +int PASCAL NEAR forwsearch( f, n) int f; int n; #endif @@ -66,9 +66,9 @@ int n; * and (perhaps) repaint the display. */ #if PROTO -int forwhunt(int f, int n) +int PASCAL NEAR forwhunt(int f, int n) #else -int forwhunt( f, n) +int PASCAL NEAR forwhunt( f, n) int f; int n; #endif @@ -137,9 +137,9 @@ int n; * (the last character that was matched). */ #if PROTO -int backsearch(int f, int n) +int PASCAL NEAR backsearch(int f, int n) #else -int backsearch( f, n) +int PASCAL NEAR backsearch( f, n) int f; int n; #endif @@ -171,9 +171,9 @@ int n; * (the last character that was matched). */ #if PROTO -int backhunt(int f, int n) +int PASCAL NEAR backhunt(int f, int n) #else -int backhunt( f, n) +int PASCAL NEAR backhunt( f, n) int f; int n; #endif @@ -242,9 +242,9 @@ int n; * and (perhaps) repaint the display. */ #if PROTO -int mcscanner(MC *mcpatrn, int direct, int beg_or_end, int repeats) +int PASCAL NEAR mcscanner(MC *mcpatrn, int direct, int beg_or_end, int repeats) #else -int mcscanner( mcpatrn, direct, beg_or_end, repeats) +int PASCAL NEAR mcscanner( mcpatrn, direct, beg_or_end, repeats) MC *mcpatrn; int direct; int beg_or_end; @@ -380,9 +380,9 @@ int repeats; * in Kernighan & Plauger's "Software Tools". */ #if PROTO -int NEAR amatch(MC *mcptr, int direct, LINE **pcwline, int *pcwoff) +int PASCAL NEAR amatch(MC *mcptr, int direct, LINE **pcwline, int *pcwoff) #else -int NEAR amatch( mcptr, direct, pcwline, pcwoff) +int PASCAL NEAR amatch( mcptr, direct, pcwline, pcwoff) MC *mcptr; int direct; LINE **pcwline; @@ -528,9 +528,9 @@ int *pcwoff; * Software-Practice and Experience, vol 10, 501-506 (1980) */ #if PROTO -int scanner(int direct, int beg_or_end, int repeats) +int PASCAL NEAR scanner(int direct, int beg_or_end, int repeats) #else -int scanner( direct, beg_or_end, repeats) +int PASCAL NEAR scanner( direct, beg_or_end, repeats) int direct; int beg_or_end; int repeats; @@ -649,9 +649,9 @@ fail:; /* continue to search */ * restrictions. */ #if PROTO -int NEAR fbound(DELTA *tbl, int jump, LINE **pcurline, int *pcuroff, int dir) +int PASCAL NEAR fbound(DELTA *tbl, int jump, LINE **pcurline, int *pcuroff, int dir) #else -int NEAR fbound( tbl, jump, pcurline, pcuroff, dir) +int PASCAL NEAR fbound( tbl, jump, pcurline, pcuroff, dir) DELTA *tbl; int jump; LINE **pcurline; @@ -723,9 +723,9 @@ int dir; * alone and return TRUE. Otherwise all went well, and return FALSE. */ #if PROTO -int movelocalpoint(int n, int *pcuroff, LINE **pcurline) +int PASCAL NEAR movelocalpoint(int n, int *pcuroff, LINE **pcurline) #else -int movelocalpoint( n, pcuroff, pcurline) +int PASCAL NEAR movelocalpoint( n, pcuroff, pcurline) int n; int *pcuroff; LINE **pcurline; @@ -914,7 +914,7 @@ DELTA *tbl; * purposes. The default for any character to jump is the * pattern length. */ -VOID setjtable() +VOID PASCAL NEAR setjtable() { make_delta((char*) pat, &deltapat); make_delta(strrev(strcpy((char *)tap, (char *)pat)), &tapatled); @@ -924,7 +924,7 @@ VOID setjtable() * eq -- Compare two characters. The "bc" comes from the buffer, "pc" * from the pattern. If we are not in EXACT mode, fold out the case. */ -int eq(bc, pc) +int PASCAL NEAR eq(bc, pc) register unsigned char bc; register unsigned char pc; { @@ -974,9 +974,9 @@ int weq(unsigned int bc, unsigned int pc) * string. */ #if PROTO -int readpattern(CONST char *prompt, char apat[], int srch) +int PASCAL NEAR readpattern(CONST char *prompt, char apat[], int srch) #else -int readpattern( prompt, apat, srch) +int PASCAL NEAR readpattern( prompt, apat, srch) CONST char *prompt; char apat[]; int srch; @@ -1021,7 +1021,7 @@ int srch; /* * savematch -- We found the pattern? Let's save it away. */ -int savematch() +int PASCAL NEAR savematch() { register int j; REGION tmpreg; @@ -1067,9 +1067,9 @@ int savematch() * FALSE depending on if a boundry is hit (ouch). */ #if PROTO -int boundry(LINE *curline, int curoff, int dir) +int PASCAL NEAR boundry(LINE *curline, int curoff, int dir) #else -int boundry( curline, curoff, dir) +int PASCAL NEAR boundry( curline, curoff, dir) LINE *curline; int curoff; int dir; @@ -1098,9 +1098,9 @@ int dir; * look at the character. */ #if PROTO -int nextch(LINE **pcurline, int *pcuroff, int dir) +int PASCAL NEAR nextch(LINE **pcurline, int *pcuroff, int dir) #else -int nextch( pcurline, pcuroff, dir) +int PASCAL NEAR nextch( pcurline, pcuroff, dir) LINE **pcurline; int *pcuroff; int dir; @@ -1160,9 +1160,9 @@ int dir; * Returns 0 (no match) or the number of characters matched. */ #if PROTO -int liteq(LINE **curline, int *curpos, int direct, char *lstring) +int PASCAL NEAR liteq(LINE **curline, int *curpos, int direct, char *lstring) #else -int liteq( curline, curpos, direct, lstring) +int PASCAL NEAR liteq( curline, curpos, direct, lstring) LINE **curline; int *curpos; int direct; @@ -1217,7 +1217,7 @@ char *lstring; * within the 64K limit. C compilers actually do very little * in the way of optimizing - they expect you to do that. */ -int mcstr() +int PASCAL NEAR mcstr() { MC *mcptr, *rtpcm; DELTA *tbl; @@ -1439,7 +1439,7 @@ int mcstr() /* * mcclear -- Free up any CCL bitmaps, and MCNIL the MC search arrays. */ -VOID mcclear() +VOID PASCAL NEAR mcclear() { register MC *mcptr; register int j; @@ -1494,9 +1494,9 @@ VOID mcclear() * too many functions with the 'match' name already. */ #if PROTO -int NEAR mceq(unsigned char bc, MC *mt) +int PASCAL NEAR mceq(unsigned char bc, MC *mt) #else -int NEAR mceq( bc, mt) +int PASCAL NEAR mceq( bc, mt) unsigned char bc; MC *mt; #endif @@ -1545,9 +1545,9 @@ MC *mt; * so that a loop may automatically increment with safety. */ #if PROTO -int NEAR cclmake(char **ppatptr, MC *mcptr) +int PASCAL NEAR cclmake(char **ppatptr, MC *mcptr) #else -int NEAR cclmake( ppatptr, mcptr) +int PASCAL NEAR cclmake( ppatptr, mcptr) char **ppatptr; MC *mcptr; #endif @@ -1642,9 +1642,9 @@ MC *mcptr; * you will also need to update this function! */ #if PROTO -int NEAR litmake(char **ppatptr, MC *mcptr) +int PASCAL NEAR litmake(char **ppatptr, MC *mcptr) #else -int NEAR litmake( ppatptr, mcptr) +int PASCAL NEAR litmake( ppatptr, mcptr) char **ppatptr; MC *mcptr; #endif @@ -1738,9 +1738,9 @@ MC *mcptr; * biteq -- is the character in the bitmap? */ #if PROTO -int NEAR biteq(int bc, EBITMAP cclmap) +int PASCAL NEAR biteq(int bc, EBITMAP cclmap) #else -int NEAR biteq( bc, cclmap) +int PASCAL NEAR biteq( bc, cclmap) int bc; EBITMAP cclmap; #endif @@ -1755,9 +1755,9 @@ EBITMAP cclmap; * setbit -- Set a bit (ON only) in the bitmap. */ #if PROTO -VOID setbit(int bc, EBITMAP cclmap) +VOID PASCAL NEAR setbit(int bc, EBITMAP cclmap) #else -VOID setbit( bc, cclmap) +VOID PASCAL NEAR setbit( bc, cclmap) int bc; EBITMAP cclmap; #endif @@ -1770,9 +1770,9 @@ EBITMAP cclmap; #if DEBUG_SEARCH #if PROTO -int mc_list(int f, int n) +int PASCAL NEAR mc_list(int f, int n) #else -int mc_list( f, n) +int PASCAL NEAR mc_list( f, n) int f; int n; #endif @@ -1888,9 +1888,9 @@ int n; } #if PROTO -int rmc_list(int f, int n) +int PASCAL NEAR rmc_list(int f, int n) #else -int rmc_list( f, n) +int PASCAL NEAR rmc_list( f, n) int f; int n; #endif @@ -1956,9 +1956,9 @@ int n; } #if PROTO -VOID mctype_cat(char pline[], int mc_type) +VOID PASCAL NEAR mctype_cat(char pline[], int mc_type) #else -VOID mctype_cat( pline, mc_type) +VOID PASCAL NEAR mctype_cat( pline, mc_type) char pline[]; int mc_type; #endif diff --git a/src/tags.c b/src/tags.c index d7d1934..4ba8db8 100644 --- a/src/tags.c +++ b/src/tags.c @@ -257,7 +257,7 @@ register char pattern[]; */ static int thisfile = FALSE; /* TRUE if curtp->t_fname equals*/ -/* curbp->fname when tagging */ + /* curbp->fname when tagging */ static int tagvalid = FALSE; /* TRUE if last tag was a succes*/ /* @@ -398,7 +398,7 @@ int retag; * '.' is preserved, and return information (= current filename) is saved. */ -extern int tagword(f, n) +extern int PASCAL NEAR tagword(f, n) int f, n; @@ -450,7 +450,7 @@ int f, n; * Note, retagword do not mess up the return information (tagf). */ -extern int retagword(f, n) +extern int PASCAL NEAR retagword(f, n) int f, n; @@ -471,7 +471,7 @@ int f, n; * we just swap mark with '.' . */ -extern int backtagword(f, n) +extern int PASCAL NEAR backtagword(f, n) int f, n; diff --git a/src/tcap.c b/src/tcap.c index fe27c10..0f1e9ad 100644 --- a/src/tcap.c +++ b/src/tcap.c @@ -435,7 +435,7 @@ int tcapgetc() it was generated by an escape sequence and should be SPECed. */ -int get1key() +int PASCAL NEAR get1key() { register int c; diff --git a/src/tos.c b/src/tos.c index 696189a..5cd4a4d 100644 --- a/src/tos.c +++ b/src/tos.c @@ -362,7 +362,7 @@ char *newname; /* new file name */ /* return a system dependent string with the current time */ -char *timeset() +char *PASCAL NEAR timeset() { register char *sp; /* temp string pointer */ @@ -382,7 +382,7 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *getffile(fspec) +char *PASCAL NEAR getffile(fspec) char *fspec; /* file to match */ @@ -432,7 +432,7 @@ char *fspec; /* file to match */ return(rbuf); } -char *getnfile() +char *PASCAL NEAR getnfile() { diff --git a/src/undo.c b/src/undo.c index c18ae49..98a7da2 100644 --- a/src/undo.c +++ b/src/undo.c @@ -202,7 +202,7 @@ BUFFER *bp; /* Undo last done command */ -int undo(f, n) +int PASCAL NEAR undo(f, n) int f,n; /* prefix flag and argument */ @@ -239,7 +239,7 @@ int f,n; /* prefix flag and argument */ /* delete current buffer's undo stack */ -int undo_delete(f, n) +int PASCAL NEAR undo_delete(f, n) int f,n; /* prefix flag and argument */ @@ -251,7 +251,7 @@ int f,n; /* prefix flag and argument */ /* pop up a list of the current buffer's undo stack */ -int undo_list(f, n) +int PASCAL NEAR undo_list(f, n) int f,n; /* prefix flag and argument */ @@ -263,7 +263,7 @@ int f,n; /* prefix flag and argument */ return(wpopup(ulistp)); } -int undolist() +int PASCAL NEAR undolist() { register char *cp1; /* scanning pointer into line to build */ diff --git a/src/vms.c b/src/vms.c index b72aad1..5248bff 100644 --- a/src/vms.c +++ b/src/vms.c @@ -477,7 +477,7 @@ ttopen() if (waitstr) short_time[ 0] = -asc_int( waitstr); } -ttclose() +PASCAL NEAR ttclose() { if (tolen > 0) { /* Buffer not empty, flush out last stuff */ @@ -493,7 +493,7 @@ ttclose() test( SYS$DASSGN( vms_iochan)); } -ttputc(int c) +PASCAL NEAR ttputc(int c) { tobuf[ tolen++] = c; if (tolen >= sizeof( tobuf)) @@ -504,7 +504,7 @@ ttputc(int c) } } -ttflush() +PASCAL NEAR ttflush() { /* I choose to ignore any flush requests if there is typeahead @@ -529,7 +529,7 @@ ttflush() Note that we also wake from hibernation if a character arrives, so this never causes an undue delay if the user it actually typing. */ -int grabnowait() +int PASCAL NEAR grabnowait() { if (tylen == 0) { /* Nothing immediately available, hibernate for a short time */ @@ -540,12 +540,12 @@ int grabnowait() return ((tylen == 0)? -1: ttgetc()); } -int grabwait() +int PASCAL NEAR grabwait() { return (ttgetc()); } -int ttgetc() +int PASCAL NEAR ttgetc() { register unsigned ret; @@ -581,7 +581,7 @@ int ttgetc() /* * Typahead - any characters pending? */ -int typahead() +int PASCAL NEAR typahead() { return( tylen != 0); } @@ -589,7 +589,7 @@ int typahead() /* * Shell out to DCL. */ -int spawncli(int f, int n) +int PASCAL NEAR spawncli(int f, int n) { register char *cp; @@ -608,7 +608,7 @@ int spawncli(int f, int n) /* * Spawn a command. */ -int spawn(int f, int n) +int PASCAL NEAR spawn(int f, int n) { register int s; char line[NLINE]; @@ -641,7 +641,7 @@ int spawn(int f, int n) * character to be typed, then mark the screen as garbage so a full repaint is * done. Bound to "C-X $". */ -int execprg(int f, int n) +int PASCAL NEAR execprg(int f, int n) { register int s; char line[NLINE]; @@ -666,7 +666,7 @@ int execprg(int f, int n) return(TRUE); } -int pipecmd() +int PASCAL NEAR pipecmd() { register int s; /* return status from CLI */ register EWINDOW *wp; /* pointer to new window */ @@ -733,7 +733,7 @@ int pipecmd() return(TRUE); } -int uefilter(int f, int n) +int PASCAL NEAR uefilter(int f, int n) { register int s; /* return status from CLI */ register BUFFER *bp; /* pointer to buffer to zot */ @@ -805,7 +805,7 @@ int uefilter(int f, int n) duplicated here. */ -char *timeset() +char *PASCAL NEAR timeset() { register char *sp; /* temp string pointer */ char buf[16]; /* time data buffer */ @@ -829,7 +829,7 @@ static struct dsc$descriptor rbuf_desc; /* descriptor for returned file name */ * Do a wild card directory search (for file name completion) * fspec is the pattern to match. */ -char *getffile(char *fspec) +char *PASCAL NEAR getffile(char *fspec) { register int index; /* index into various strings */ @@ -909,7 +909,7 @@ char *getffile(char *fspec) return(path); } -char *getnfile() +char *PASCAL NEAR getnfile() { register int index; /* index into various strings */ register int point; /* index into other strings */ @@ -999,7 +999,7 @@ ME$EDIT(struct dsc$descriptor *infile, struct dsc$descriptor *outfile) return( status); } -bktoshell(int f, int n) +PASCAL NEAR bktoshell(int f, int n) { /* Pause this process and wait for it to be woken up @@ -1094,7 +1094,7 @@ static struct RAB rab; /* a record access block */ /* * Open a file for reading. */ -ffropen(char *fn) +PASCAL NEAR ffropen(char *fn) { unsigned long status; @@ -1140,11 +1140,11 @@ ffropen(char *fn) } /* - * ffwopen(char *fn, char *mode) + * PASCAL NEAR ffwopen(char *fn, char *mode) * * fn = file name, mode = mode to open file. */ -ffwopen(char *fn, char *mode) +PASCAL NEAR ffwopen(char *fn, char *mode) { unsigned long status; @@ -1195,7 +1195,7 @@ ffwopen(char *fn, char *mode) /* * Close a file. Should look at the status in all systems. */ -ffclose() +PASCAL NEAR ffclose() { unsigned long status; @@ -1222,7 +1222,7 @@ ffclose() * and the "nbuf" is its length, less the free newline. Return the status. * Check only at the newline. */ -ffputline(char buf[], int nbuf) +PASCAL NEAR ffputline(char buf[], int nbuf) { register char *obuf=buf; @@ -1274,7 +1274,7 @@ ffputline(char buf[], int nbuf) * at the end of the file that don't have a newline present. Check for I/O * errors too. Return status. */ -ffgetline(nbytes) +PASCAL NEAR ffgetline(nbytes) int *nbytes; /* save our caller hassle, calc the line length */ @@ -1314,7 +1314,7 @@ int *nbytes; /* save our caller hassle, calc the line length */ * FUNCTION - addspec - utility function for expandargs ***********************************************************/ #define ADDSPEC_INCREMENT 10 -static void addspec(struct dsc$descriptor dsc, int *pargc, +static void PASCAL NEAR addspec(struct dsc$descriptor dsc, int *pargc, char ***pargv, int *pargcapacity) { char *s; @@ -1335,7 +1335,7 @@ static void addspec(struct dsc$descriptor dsc, int *pargc, * FUNCTION - expandargs - massage argc and argv to expand * wildcards by calling VMS. ***********************************************************/ -void expandargs(int *pargc, char ***pargv) +void PASCAL NEAR expandargs(int *pargc, char ***pargv) { int argc = *pargc; char **argv = *pargv; @@ -1384,7 +1384,7 @@ void expandargs(int *pargc, char ***pargv) } #else -vms_hello() +PASCAL NEAR vms_hello() { } #endif diff --git a/src/window.c b/src/window.c index 57c573a..4e801f8 100644 --- a/src/window.c +++ b/src/window.c @@ -15,7 +15,7 @@ * bottom. If it is 0 the window is centered (this is what the standard * redisplay code does). With no argument it defaults to 0. Bound to M-!. */ -int reposition(f, n) +int PASCAL NEAR reposition(f, n) int f, n; /* prefix flag and argument */ @@ -31,7 +31,7 @@ int f, n; /* prefix flag and argument */ * Refresh the screen. With no argument, it just does the refresh. With an * argument it recenters "." in the current window. Bound to "C-L". */ -int uerefresh(f, n) +int PASCAL NEAR uerefresh(f, n) int f, n; /* prefix flag and argument */ @@ -54,7 +54,7 @@ int f, n; /* prefix flag and argument */ * with an argument this command finds the th window from the top * */ -int nextwind(f, n) +int PASCAL NEAR nextwind(f, n) int f, n; /* default flag and numeric argument */ @@ -101,7 +101,7 @@ int f, n; /* default flag and numeric argument */ * current window. There arn't any errors, although the command does not do a * lot if there is 1 window. */ -int prevwind(f, n) +int PASCAL NEAR prevwind(f, n) int f,n; /* prefix flag and argument */ @@ -135,7 +135,7 @@ int f,n; /* prefix flag and argument */ * a new dot. We share the code by having "move down" just be an interface to * "move up". Magic. Bound to "C-X C-N". */ -int mvdnwind(f, n) +int PASCAL NEAR mvdnwind(f, n) int f, n; /* prefix flag and argument */ @@ -150,7 +150,7 @@ int f, n; /* prefix flag and argument */ * (this command does not really move "."; it moves the frame). Bound to * "C-X C-P". */ -int mvupwind(f, n) +int PASCAL NEAR mvupwind(f, n) int f, n; /* prefix flag and argument */ @@ -197,7 +197,7 @@ int f, n; /* prefix flag and argument */ * the buffer structures right if the distruction of a window makes a buffer * become undisplayed. */ -int onlywind(f, n) +int PASCAL NEAR onlywind(f, n) int f,n; /* prefix flag and argument */ @@ -381,7 +381,7 @@ int zaphelp(int f, int n) * or, if it is the top window, the window below. Bound to C-X 0. */ -int delwind(f,n) +int PASCAL NEAR delwind(f,n) int f, n; /* arguments are ignored for this command */ @@ -469,7 +469,7 @@ window. Bound to "C-X 2". */ -int splitwind(f, n) +int PASCAL NEAR splitwind(f, n) int f, n; /* default flag and numeric argument */ @@ -561,7 +561,7 @@ int f, n; /* default flag and numeric argument */ * all the hard work. You don't just set "force reframe" because dot would * move. Bound to "C-X Z". */ -int enlargewind(f, n) +int PASCAL NEAR enlargewind(f, n) int f,n; /* prefix flag and argument */ @@ -612,7 +612,7 @@ int f,n; /* prefix flag and argument */ * window descriptions. Ask the redisplay to do all the hard work. Bound to * "C-X C-Z". */ -int shrinkwind(f, n) +int PASCAL NEAR shrinkwind(f, n) int f,n; /* prefix flag and argument */ @@ -660,7 +660,7 @@ int f,n; /* prefix flag and argument */ /* Resize the current window to the requested size */ -int resize(f, n) +int PASCAL NEAR resize(f, n) int f, n; /* default flag and numeric argument */ @@ -685,9 +685,9 @@ int f, n; /* default flag and numeric argument */ */ #if PROTO -int wpopup(BUFFER *popbuf) +int PASCAL NEAR wpopup(BUFFER *popbuf) #else -int wpopup(popbuf) +int PASCAL NEAR wpopup(popbuf) BUFFER *popbuf; #endif @@ -706,7 +706,7 @@ BUFFER *popbuf; /* find the window to split */ if (wheadp->w_wndp == NULL /* Only 1 window */ - && splitwind(FALSE, 0) == FALSE) /* and it won't split */ + && splitwind(FALSE, 0) == FALSE) /* and it won't split */ return(FALSE); wp = wheadp; /* Find window to use */ while (wp!=NULL && wp == curwp) @@ -727,7 +727,7 @@ BUFFER *popbuf; ++popbuf->b_nwnd; } - setwin: wp = wheadp; +setwin: wp = wheadp; while (wp != NULL) { if (wp->w_bufp == popbuf) { wp->w_linep = lforw(popbuf->b_linep); @@ -746,7 +746,7 @@ BUFFER *popbuf; return(TRUE); } -int nextup(f, n) /* scroll the next window up (back) a page */ +int PASCAL NEAR nextup(f, n) /* scroll the next window up (back) a page */ int f, n; /* prefix flag and argument */ @@ -756,7 +756,7 @@ int f, n; /* prefix flag and argument */ return (prevwind(FALSE, 1)); } -int nextdown(f, n) /* scroll the next window down (forward) a page */ +int PASCAL NEAR nextdown(f, n) /* scroll the next window down (forward) a page */ int f, n; /* prefix flag and argument */ @@ -766,7 +766,7 @@ int f, n; /* prefix flag and argument */ return(prevwind(FALSE, 1)); } -int savewnd(f, n) /* save ptr to current window */ +int PASCAL NEAR savewnd(f, n) /* save ptr to current window */ int f, n; /* prefix flag and argument */ @@ -775,7 +775,7 @@ int f, n; /* prefix flag and argument */ return(TRUE); } -int restwnd(f, n) /* restore the saved screen */ +int PASCAL NEAR restwnd(f, n) /* restore the saved screen */ int f, n; /* prefix flag and argument */ @@ -799,7 +799,7 @@ int f, n; /* prefix flag and argument */ return(FALSE); } -int newsize(f, n) /* resize the screen, re-writing the screen */ +int PASCAL NEAR newsize(f, n) /* resize the screen, re-writing the screen */ int f; /* default flag */ int n; /* numeric argument */ @@ -910,7 +910,7 @@ int n; /* numeric argument */ return(TRUE); } -int newwidth(f, n) /* resize the screen, re-writing the screen */ +int PASCAL NEAR newwidth(f, n) /* resize the screen, re-writing the screen */ int f; /* default flag */ int n; /* numeric argument */ @@ -960,7 +960,7 @@ int n; /* numeric argument */ return(TRUE); } -int new_col_org(f, n) /* reposition the screen, re-writing the screen */ +int PASCAL NEAR new_col_org(f, n) /* reposition the screen, re-writing the screen */ int f; /* default flag */ int n; /* numeric argument */ @@ -987,7 +987,7 @@ int n; /* numeric argument */ return(TRUE); } -int new_row_org(f, n) /* reposition the screen, re-writing the screen */ +int PASCAL NEAR new_row_org(f, n) /* reposition the screen, re-writing the screen */ int f; /* default flag */ int n; /* numeric argument */ @@ -1015,7 +1015,7 @@ int n; /* numeric argument */ return(TRUE); } -int getwpos() /* get screen offset of current line in current window */ +int PASCAL NEAR getwpos() /* get screen offset of current line in current window */ { register int sline; /* screen line from top of window */ @@ -1033,7 +1033,7 @@ int getwpos() /* get screen offset of current line in current window */ return(sline); } -int getcwnum() /* get current window number */ +int PASCAL NEAR getcwnum() /* get current window number */ { register EWINDOW *wp; @@ -1049,7 +1049,7 @@ int getcwnum() /* get current window number */ } -int gettwnum() /* get total window count */ +int PASCAL NEAR gettwnum() /* get total window count */ { register EWINDOW *wp; diff --git a/src/wmcs.c b/src/wmcs.c index 0542dfc..3b876a6 100644 --- a/src/wmcs.c +++ b/src/wmcs.c @@ -355,7 +355,7 @@ uefilter(f, n) /* return a system dependent string with the current time */ -char *timeset() +char *PASCAL NEAR timeset() { register char *sp; /* temp string pointer */ diff --git a/src/word.c b/src/word.c index 61629a4..5111ab9 100644 --- a/src/word.c +++ b/src/word.c @@ -20,7 +20,7 @@ * left edge of the current window * Returns TRUE on success, FALSE on errors. */ -int wrapword(f, n) +int PASCAL NEAR wrapword(f, n) int f; /* default flag */ int n; /* numeric argument */ @@ -76,7 +76,7 @@ int n; /* numeric argument */ * performed by the "backchar" and "forwchar" routines. Error if you try to * move beyond the buffers. */ -int backword(f, n) +int PASCAL NEAR backword(f, n) int f,n; /* prefix flag and argument */ @@ -102,7 +102,7 @@ int f,n; /* prefix flag and argument */ * Move the cursor forward by the specified number of words. All of the motion * is done by "forwchar". Error if you try and move beyond the buffer's end. */ -int forwword(f, n) +int PASCAL NEAR forwword(f, n) int f,n; /* prefix flag and argument */ @@ -129,7 +129,7 @@ int f,n; /* prefix flag and argument */ * Move forward to the end of the nth next word. Error if you move past * the end of the buffer. */ -int endword(f, n) +int PASCAL NEAR endword(f, n) int f,n; /* prefix flag and argument */ @@ -157,7 +157,7 @@ int f,n; /* prefix flag and argument */ * convert any characters to upper case. Error if you try and move beyond the * end of the buffer. Bound to "M-U". */ -int upperword(f, n) +int PASCAL NEAR upperword(f, n) int f,n; /* prefix flag and argument */ @@ -224,7 +224,7 @@ int f,n; /* prefix flag and argument */ * convert characters to lower case. Error if you try and move over the end of * the buffer. Bound to "M-L". */ -int lowerword(f, n) +int PASCAL NEAR lowerword(f, n) int f,n; /* prefix flag and argument */ @@ -289,7 +289,7 @@ int f,n; /* prefix flag and argument */ * characters to lower case. Error if you try and move past the end of the * buffer. Bound to "M-C". */ -int capword(f, n) +int PASCAL NEAR capword(f, n) int f,n; /* prefix flag and argument */ @@ -391,7 +391,7 @@ int f,n; /* prefix flag and argument */ * command for the right number of characters. With a zero argument, just * kill one word and no whitespace. Bound to "M-D". */ -int delfword(f, n) +int PASCAL NEAR delfword(f, n) int f,n; /* prefix flag and argument */ @@ -487,7 +487,7 @@ int f,n; /* prefix flag and argument */ * counting the characters. When dot is finally moved to its resting place, * fire off the kill command. Bound to "M-Rubout" and to "M-Backspace". */ -int delbword(f, n) +int PASCAL NEAR delbword(f, n) int f,n; /* prefix flag and argument */ @@ -543,7 +543,7 @@ bckdel: if (forwchar(FALSE, size) == FALSE) * has been set by the user, use that instead */ -int inword() +int PASCAL NEAR inword() { #if UTF8 @@ -577,7 +577,7 @@ int inword() #if UTF8 -int isinword(unsigned int c) +int PASCAL NEAR isinword(unsigned int c) { /* if we are using the table.... */ if (wlflag) @@ -591,7 +591,7 @@ int isinword(unsigned int c) #else -int isinword(c) +int PASCAL NEAR isinword(c) char c; @@ -612,7 +612,7 @@ char c; #endif -int fillpara(f, n) /* Fill the current paragraph according to the +int PASCAL NEAR fillpara(f, n) /* Fill the current paragraph according to the current fill column */ int f, n; /* Default flag and Numeric argument */ @@ -710,7 +710,7 @@ int f, n; /* Default flag and Numeric argument */ return(status); } -VOID reform(para) /* reformat a paragraph as stored in a string */ +VOID PASCAL NEAR reform(para) /* reformat a paragraph as stored in a string */ char *para; /* string buffer containing paragraph */ @@ -758,7 +758,7 @@ char *para; /* string buffer containing paragraph */ } } -int killpara(f, n) /* delete n paragraphs starting with the current one */ +int PASCAL NEAR killpara(f, n) /* delete n paragraphs starting with the current one */ int f; /* default flag */ int n; /* # of paras to delete */ @@ -793,7 +793,7 @@ int n; /* # of paras to delete */ along with average word sizes, # of chars, etc, and report on them. */ -int wordcount(f, n) +int PASCAL NEAR wordcount(f, n) int f, n; /* ignored numeric arguments */ diff --git a/src/xp.c b/src/xp.c index 2f9eb6d..526a962 100644 --- a/src/xp.c +++ b/src/xp.c @@ -34,7 +34,7 @@ * repaint. Bound to "^X C". The message at the start in VMS puts out a newline. * Under some (unknown) condition, you don't get one free when DCL starts up. */ -spawncli(f, n) +int PASCAL NEAR spawncli(f, n) { /* don't allow this command if restricted */ if (restflag) @@ -55,7 +55,7 @@ spawncli(f, n) * character to be typed, then mark the screen as garbage so a full repaint is * done. Bound to "C-X !". */ -spawn(f, n) +int PASCAL NEAR spawn(f, n) { register int s; char line[NLINE]; @@ -87,7 +87,7 @@ spawn(f, n) * done. Bound to "C-X $". */ -execprg(f, n) +int PASCAL NEAR execprg(f, n) { register int s; char line[NLINE]; @@ -118,7 +118,7 @@ execprg(f, n) * We use a unique temporary file name so that multiple instances of * MicroEMACS don't try to use the same file. */ -pipecmd(f, n) +int PASCAL NEAR pipecmd(f, n) { register EWINDOW *wp; /* pointer to new window */ register BUFFER *bp; /* pointer to buffer to zot */ @@ -207,7 +207,7 @@ pipecmd(f, n) * We use unique temporary file names so that multiple instances of * MicroEMACS don't try to use the same file. */ -uefilter(f, n) +int PASCAL NEAR uefilter(f, n) { register int s; /* return status from CLI */ @@ -367,7 +367,7 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *getffile(fspec) +char *PASCAL NEAR getffile(fspec) char *fspec; /* pattern to match */ @@ -417,7 +417,7 @@ char *fspec; /* pattern to match */ return(rbuf); } -char *getnfile() +char *PASCAL NEAR getnfile() { /* and call for the next file */ @@ -435,7 +435,7 @@ char *getnfile() /* return a system dependent string with the current time */ -char *timeset() +char *PASCAL NEAR timeset() { register char *sp; /* temp string pointer */ diff --git a/src/xpconio.c b/src/xpconio.c index 35ebb5d..0c0edf5 100644 --- a/src/xpconio.c +++ b/src/xpconio.c @@ -33,26 +33,26 @@ /* Forward references. */ -ntmove(); -nteeol(); -nteeop(); -ntbeep(); -ntopen(); -ntclose(); -ntgetc(); -ntputc(); -ntflush(); -ntrev(); -ntkclose(); -ntkopen(); -ntcres(); -ntparm(); +PASCAL NEAR ntmove(); +PASCAL NEAR nteeol(); +PASCAL NEAR nteeop(); +PASCAL NEAR ntbeep(); +PASCAL NEAR ntopen(); +PASCAL NEAR ntclose(); +PASCAL NEAR ntgetc(); +PASCAL NEAR ntputc(); +PASCAL NEAR ntflush(); +PASCAL NEAR ntrev(); +PASCAL NEAR ntkclose(); +PASCAL NEAR ntkopen(); +PASCAL NEAR ntcres(); +PASCAL NEAR ntparm(); #if COLOR -ntfcol(); -ntbcol(); +PASCAL NEAR ntfcol(); +PASCAL NEAR ntbcol(); #endif -fnclabel(); -static WORD ntAttribute(void); +PASCAL NEAR fnclabel(); +static WORD NEAR ntAttribute(void); /* Screen buffer to write to. */ static CHAR_INFO ciScreenBuffer[NROW * NCOL]; @@ -173,7 +173,7 @@ int in_get() /* get an event from the input buffer */ /* Set the current foreground color. */ /*----------------------------------------------------------------------*/ -ntfcol( +PASCAL NEAR ntfcol( int color) /* color to set */ { cfcolor = ctrans[color]; @@ -184,14 +184,14 @@ ntfcol( /* Set the current background color. */ /*----------------------------------------------------------------------*/ -ntbcol( +PASCAL NEAR ntbcol( int color) /* color to set */ { cbcolor = ctrans[color]; } #endif -static void ntSetUpdateValues(void) +static void near ntSetUpdateValues(void) { if (ntrow < ntMin) ntMin = ntrow; @@ -210,7 +210,7 @@ static void ntSetUpdateValues(void) /* Move the cursor. */ /*----------------------------------------------------------------------*/ -ntmove( +PASCAL NEAR ntmove( int row, int col) { @@ -227,7 +227,7 @@ ntmove( /* Update the physical video buffer from the logical video buffer. */ /*----------------------------------------------------------------------*/ -ntflush(void) +PASCAL NEAR ntflush(void) { SMALL_RECT srWriteRegion; COORD coordUpdateBegin, coordBufferSize; @@ -265,7 +265,7 @@ ntflush(void) return(TRUE); } -static void MouseEvent(void) +static void near MouseEvent(void) { register int k; /* current bit/button of mouse */ @@ -348,7 +348,7 @@ static void MouseEvent(void) return(FALSE); } -static void WindowSizeEvent(void) +static void near WindowSizeEvent(void) { CONSOLE_SCREEN_BUFFER_INFO Console; @@ -367,7 +367,7 @@ static void WindowSizeEvent(void) /* handle the current keyboard event */ -static void KeyboardEvent() +static void near KeyboardEvent() { int c; /* ascii character to examine */ @@ -512,7 +512,7 @@ int PendingScreenResize() /* Get a character from the keyboard. */ /*----------------------------------------------------------------------*/ -ntgetc() +PASCAL NEAR ntgetc() { long dw; @@ -566,7 +566,7 @@ ttc: ntflush(); /* Returns true if a key has been pressed. */ /*----------------------------------------------------------------------*/ -typahead() +PASCAL NEAR typahead() { /* anything waiting in the input queue? */ @@ -577,7 +577,7 @@ typahead() } #endif -static WORD ntAttribute(void) +static WORD near ntAttribute(void) { return(revflag ? (cbcolor | (cfcolor << 4)) : ((cbcolor << 4) | cfcolor)); } @@ -594,7 +594,7 @@ static WORD ntAttribute(void) /* a problem. */ /*----------------------------------------------------------------------*/ -ntputc(int c) +PASCAL NEAR ntputc(int c) { WORD wScreenPos; @@ -631,7 +631,7 @@ ntputc(int c) /* Erase to end of line. */ /*----------------------------------------------------------------------*/ -nteeol() +PASCAL NEAR nteeol() { WORD wNum; WORD wScreenPos; @@ -662,7 +662,7 @@ nteeol() /* Erase to end of page. */ /*----------------------------------------------------------------------*/ -nteeop() +PASCAL NEAR nteeop() { WORD wNum; WORD wScreenPos; @@ -693,7 +693,7 @@ nteeop() /* Change reverse video state. */ /*----------------------------------------------------------------------*/ -ntrev(state) +PASCAL NEAR ntrev(state) int state; /* TRUE = reverse, FALSE = normal */ @@ -706,7 +706,7 @@ int state; /* TRUE = reverse, FALSE = normal */ /* Change the screen resolution. */ /*----------------------------------------------------------------------*/ -ntcres(char *res) /* name of desired video mode */ +PASCAL NEAR ntcres(char *res) /* name of desired video mode */ { return TRUE; } @@ -717,7 +717,7 @@ ntcres(char *res) /* name of desired video mode */ /* Change pallette settings. (Does nothing.) */ /*----------------------------------------------------------------------*/ -spal(char *dummy) +PASCAL NEAR spal(char *dummy) { return(TRUE); } @@ -727,7 +727,7 @@ spal(char *dummy) /* ntbeep() */ /*----------------------------------------------------------------------*/ -ntbeep() +PASCAL NEAR ntbeep() { Beep(750, 300); return(TRUE); @@ -737,7 +737,7 @@ ntbeep() /* ntopen() */ /*----------------------------------------------------------------------*/ -ntopen() +PASCAL NEAR ntopen() { CONSOLE_SCREEN_BUFFER_INFO Console; @@ -806,7 +806,7 @@ ntopen() /* Restore the original video settings. */ /*----------------------------------------------------------------------*/ -ntclose() +PASCAL NEAR ntclose() { /* reset the title on the window */ SetConsoleTitleA(chConsoleTitle); @@ -820,7 +820,7 @@ ntclose() /* Open the keyboard. */ /*----------------------------------------------------------------------*/ -ntkopen() +PASCAL NEAR ntkopen() { /* save the original console mode to restore on exit */ GetConsoleMode(hInput, &OldConsoleMode); @@ -841,7 +841,7 @@ ntkopen() /* Close the keyboard. */ /*----------------------------------------------------------------------*/ -ntkclose() +PASCAL NEAR ntkclose() { /* restore the console mode from entry */ SetConsoleMode(hInput, OldConsoleMode); @@ -849,7 +849,7 @@ ntkclose() } #if FLABEL -fnclabel(f, n) /* label a function key */ +PASCAL NEAR fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument [unused] */ diff --git a/src/xvt.c b/src/xvt.c index cf90923..b67f245 100644 --- a/src/xvt.c +++ b/src/xvt.c @@ -32,7 +32,7 @@ #include #include "uemacs.h" -int fnclabel(int f, int n); +int PASCAL NEAR fnclabel(int f, int n); #define NROW 25 /* Screen size. */ #define NCOL 80 /* Edit if you want to. */ @@ -43,21 +43,21 @@ int fnclabel(int f, int n); #define ESC 0x1B /* ESC character. */ /* Forward references. */ -extern int xvtmove(); -extern int xvteeol(); -extern int xvteeop(); -extern int xvtbeep(); -extern int xvtopen(); -extern int xvtrev(); -extern int xvtclose(); -extern int xvtkopen(); -extern int xvtkclose(); -extern int xvtcres(); -extern int xvtgetc(); -extern int xvtputc(); -extern int xvtflush(); -extern int xvtfcol(); -extern int xvtbcol(); +extern int PASCAL NEAR xvtmove(); +extern int PASCAL NEAR xvteeol(); +extern int PASCAL NEAR xvteeop(); +extern int PASCAL NEAR xvtbeep(); +extern int PASCAL NEAR xvtopen(); +extern int PASCAL NEAR xvtrev(); +extern int PASCAL NEAR xvtclose(); +extern int PASCAL NEAR xvtkopen(); +extern int PASCAL NEAR xvtkclose(); +extern int PASCAL NEAR xvtcres(); +extern int PASCAL NEAR xvtgetc(); +extern int PASCAL NEAR xvtputc(); +extern int PASCAL NEAR xvtflush(); +extern int PASCAL NEAR xvtfcol(); +extern int PASCAL NEAR xvtbcol(); static int rev_state = FALSE; static int cfcolor = -1; /* current foreground color */ @@ -450,7 +450,7 @@ char **argv; xvt_system(argc, argv, 0L, taskHandler, &config); } -xvtfcol(color) /* set the current output color */ +PASCAL NEAR xvtfcol(color) /* set the current output color */ int color; /* color to set */ @@ -462,7 +462,7 @@ int color; /* color to set */ cfcolor = color; } -xvtbcol(color) /* set the current background color */ +PASCAL NEAR xvtbcol(color) /* set the current background color */ int color; /* color to set */ @@ -474,14 +474,14 @@ int color; /* color to set */ cbcolor = color; } -xvtmove(row, col) +PASCAL NEAR xvtmove(row, col) { xvtflush(); xvt_row = row; xvt_col = col; } -xvteeol() +PASCAL NEAR xvteeol() { RCT rect; /* rectangle to use to clear to end of this line */ CBRUSH brush; /* brushed used for the clearing */ @@ -504,7 +504,7 @@ xvteeol() win_draw_rect(xvt_win, &rect); } -xvteeop() +PASCAL NEAR xvteeop() { RCT rect; /* rectangle to use to clear to end of this line */ CBRUSH brush; /* brushed used for the clearing */ @@ -538,7 +538,7 @@ xvteeop() win_draw_rect(xvt_win, &rect); } -xvtrev(state) /* change reverse video state */ +PASCAL NEAR xvtrev(state) /* change reverse video state */ int state; /* TRUE = reverse, FALSE = normal */ @@ -556,24 +556,24 @@ int state; /* TRUE = reverse, FALSE = normal */ } } -xvtcres() /* change screen resolution */ +PASCAL NEAR xvtcres() /* change screen resolution */ { return(TRUE); } -spal(char *dummy) /* change pallette settings */ +PASCAL NEAR spal(char *dummy) /* change pallette settings */ { /* none for now */ } -xvtbeep() +PASCAL NEAR xvtbeep() { xvt_beep(); } -xvtopen() +PASCAL NEAR xvtopen() { DRAW_CTOOLS dtool; @@ -614,7 +614,7 @@ xvtopen() ttopen(); } -xvtclose() +PASCAL NEAR xvtclose() { xvtfcol(7); @@ -622,13 +622,13 @@ xvtclose() ttclose(); } -xvtkopen() /* open the keyboard (a noop here) */ +PASCAL NEAR xvtkopen() /* open the keyboard (a noop here) */ { } -xvtkclose() /* close the keyboard (a noop here) */ +PASCAL NEAR xvtkclose() /* close the keyboard (a noop here) */ { xvtflush(); @@ -638,7 +638,7 @@ xvtkclose() /* close the keyboard (a noop here) */ * Read a character from the terminal, performing no editing and doing no echo * at all. Also mouse events are forced into the input stream here. */ -int xvtgetc() +int PASCAL NEAR xvtgetc() { xvtflush(); @@ -663,7 +663,7 @@ int xvtgetc() } } -int xvtflush() +int PASCAL NEAR xvtflush() { /* if there's nothing to flush */ @@ -679,7 +679,7 @@ int xvtflush() xvt_next = xvt_obuf; } -int xvtputc(c) +int PASCAL NEAR xvtputc(c) char c; /* character to write to the current xvt window */ @@ -701,7 +701,7 @@ char c; /* character to write to the current xvt window */ } #if FLABEL -int fnclabel(f, n) /* label a function key */ +int PASCAL NEAR fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument [unused] */ diff --git a/src/xvtdos.c b/src/xvtdos.c index 81b41e7..4cf0286 100644 --- a/src/xvtdos.c +++ b/src/xvtdos.c @@ -54,7 +54,7 @@ static int oldbut; /* Previous state of mouse buttons */ static int oldcol; /* previous x position of mouse */ static int oldrow; /* previous y position of mouse */ -int execprog(char *cmd); +int PASCAL NEAR execprog(char *cmd); /* input buffers and pointers */ @@ -102,7 +102,7 @@ int in_get() /* get an event from the input buffer */ * This function is called once to set up the terminal device streams. */ -int ttopen() +int PASCAL NEAR ttopen() { @@ -125,7 +125,7 @@ int ttopen() * interpreter. On VMS it puts the terminal back in a reasonable state. * Another no-operation on CPM. */ -int ttclose() +int PASCAL NEAR ttclose() { /* nothing here! */ } @@ -134,7 +134,7 @@ int ttclose() * Flush terminal buffer. Does real work where the terminal output is buffered * up. A no-operation on systems where byte at a time terminal I/O is done. */ -int ttflush() +int PASCAL NEAR ttflush() { } @@ -142,7 +142,7 @@ int ttflush() keyboard buffer */ -int typahead() +int PASCAL NEAR typahead() { return(in_check()); @@ -154,7 +154,7 @@ int typahead() * repaint. Bound to "^X C". */ -int spawncli(f, n) +int PASCAL NEAR spawncli(f, n) int f, n; @@ -180,7 +180,7 @@ int f, n; * character to be typed, then mark the screen as garbage so a full repaint is * done. Bound to "C-X !". */ -int spawn(f, n) +int PASCAL NEAR spawn(f, n) int f, n; @@ -220,7 +220,7 @@ int f, n; * done. Bound to "C-X $". */ -int execprg(f, n) +int PASCAL NEAR execprg(f, n) { register int s; @@ -253,7 +253,7 @@ int execprg(f, n) * Pipe a one line command into a window * Bound to ^X @ */ -int pipecmd(f, n) +int PASCAL NEAR pipecmd(f, n) int f, n; @@ -343,7 +343,7 @@ int f, n; * filter a buffer through an external DOS program * Bound to ^X # */ -int uefilter(f, n) +int PASCAL NEAR uefilter(f, n) int f, n; @@ -426,7 +426,7 @@ extern int _doserrno; /* SHELLPROG: Execute a command in a subshell */ -int shellprog(cmd) +int PASCAL NEAR shellprog(cmd) char *cmd; /* Incoming command line to execute */ @@ -475,7 +475,7 @@ char *cmd; /* Incoming command line to execute */ #define CFLAG 1 #endif -int execprog(cmd) +int PASCAL NEAR execprog(cmd) char *cmd; /* Incoming command line to execute */ @@ -586,7 +586,7 @@ char *cmd; /* Incoming command line to execute */ /* return a system dependent string with the current time */ -char *timeset() +char *PASCAL NEAR timeset() { #if MWC | TURBO | IC | MSC | ZTC @@ -616,7 +616,7 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *getffile(fspec) +char *PASCAL NEAR getffile(fspec) char *fspec; /* pattern to match */ @@ -665,7 +665,7 @@ char *fspec; /* pattern to match */ return(rbuf); } -char *getnfile() +char *PASCAL NEAR getnfile() { register int index; /* index into various strings */ @@ -694,7 +694,7 @@ char rbuf[NFILEN]; /* return file buffer */ /* do a wild card directory search (for file name completion) */ -char *getffile(fspec) +char *PASCAL NEAR getffile(fspec) char *fspec; /* pattern to match */ @@ -743,7 +743,7 @@ char *fspec; /* pattern to match */ return(rbuf); } -char *getnfile() +char *PASCAL NEAR getnfile() { register int index; /* index into various strings */ @@ -764,7 +764,7 @@ char *getnfile() return(rbuf); } #else -char *getffile(fspec) +char *PASCAL NEAR getffile(fspec) char *fspec; /* file to match */ @@ -772,7 +772,7 @@ char *fspec; /* file to match */ return(NULL); } -char *getnfile() +char *PASCAL NEAR getnfile() { return(NULL); From ef88490bf813fb5c5df989cad45cad440be3cea6 Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 10 Sep 2020 19:38:43 +0200 Subject: [PATCH 34/37] Put back PASCAL NEAR --- src/fmr.c | 86 ++++++++++++++++----------------- src/hp110.c | 66 ++++++++++++------------- src/hp150.c | 106 ++++++++++++++++++++-------------------- src/i55.c | 82 +++++++++++++++---------------- src/ibmpc.c | 130 ++++++++++++++++++++++++++------------------------ src/mswmem.c | 4 +- src/nec.c | 88 +++++++++++++++++----------------- src/ntconio.c | 84 ++++++++++++++++---------------- src/os2npm.c | 70 +++++++++++++-------------- src/smg.c | 20 ++++---- src/st52.c | 4 +- src/tipc.c | 72 ++++++++++++++-------------- src/z309.c | 76 ++++++++++++++--------------- 13 files changed, 446 insertions(+), 442 deletions(-) diff --git a/src/fmr.c b/src/fmr.c index dbbd314..cc80a1b 100644 --- a/src/fmr.c +++ b/src/fmr.c @@ -102,19 +102,19 @@ union REGS rg; /* cpu register for use of DOS calls */ struct SREGS sg; /* cpu segment registers */ #if PROTO -int fnclabel(int f, int n); -int readparam( int *v); -void dobbnmouse(void); -void docsi( int oh); -void ttputs(char *string); -void charwrite(int row, char *outstr, int forg, int left, int right); +int PASCAL NEAR fnclabel(int f, int n); +int PASCAL NEAR readparam( int *v); +void PASCAL NEAR dobbnmouse(void); +void PASCAL NEAR docsi( int oh); +void PASCAL NEAR ttputs(char *string); +void PASCAL NEAR charwrite(int row, char *outstr, int forg, int left, int right); #else -int fnclabel(); -int readparam(); -void dobbnmouse(); -void docsi(); -void ttputs(); -void charwrite(); +int PASCAL NEAR fnclabel(); +int PASCAL NEAR readparam(); +void PASCAL NEAR dobbnmouse(); +void PASCAL NEAR docsi(); +void PASCAL NEAR ttputs(); +void PASCAL NEAR charwrite(); #endif #define NROW 24 /* Screen size. */ @@ -126,24 +126,24 @@ void charwrite(); #define ESC 0x1B /* ESC character. */ /* Forward references. */ -extern int fmrmove(); -extern int fmreeol(); -extern int fmreeop(); -extern int fmrbeep(); -extern int fmropen(); -extern int fmrrev(); -extern int fmrclose(); -extern int fmrkopen(); -extern int fmrkclose(); -extern int fmrcres(); -extern int fmrparm(); +extern int PASCAL NEAR fmrmove(); +extern int PASCAL NEAR fmreeol(); +extern int PASCAL NEAR fmreeop(); +extern int PASCAL NEAR fmrbeep(); +extern int PASCAL NEAR fmropen(); +extern int PASCAL NEAR fmrrev(); +extern int PASCAL NEAR fmrclose(); +extern int PASCAL NEAR fmrkopen(); +extern int PASCAL NEAR fmrkclose(); +extern int PASCAL NEAR fmrcres(); +extern int PASCAL NEAR fmrparm(); unsigned int octype; /* original cursor type */ unsigned int ocraster; /* original cursor raster line limits */ #if COLOR -extern int fmrfcol(); -extern int fmrbcol(); +extern int PASCAL NEAR fmrfcol(); +extern int PASCAL NEAR fmrbcol(); static int cfcolor = -1; /* current forground color */ static int cbcolor = -1; /* current background color */ @@ -187,7 +187,7 @@ NOSHARE TERM term = { }; #if COLOR -fmrfcol(color) /* set the current output color */ +PASCAL NEAR fmrfcol(color) /* set the current output color */ int color; /* color to set */ @@ -201,7 +201,7 @@ int color; /* color to set */ cfcolor = color; } -fmrbcol(color) /* set the current background color */ +PASCAL NEAR fmrbcol(color) /* set the current background color */ int color; /* color to set */ @@ -218,7 +218,7 @@ int color; /* color to set */ } #endif -fmrmove(row, col) +PASCAL NEAR fmrmove(row, col) { ttputc(ESC); ttputc('['); @@ -228,14 +228,14 @@ fmrmove(row, col) ttputc('H'); } -fmreeol() +PASCAL NEAR fmreeol() { ttputc(ESC); ttputc('['); ttputc('K'); } -fmreeop() +PASCAL NEAR fmreeop() { #if COLOR fmrfcol(gfcolor); @@ -249,7 +249,7 @@ fmreeop() gds_erase(); /* dump the background colors */ } -fmrrev(state) /* change reverse video state */ +PASCAL NEAR fmrrev(state) /* change reverse video state */ int state; /* TRUE = reverse, FALSE = normal */ @@ -262,25 +262,25 @@ int state; /* TRUE = reverse, FALSE = normal */ fmrfcol(7); } -fmrcres() /* change screen resolution */ +PASCAL NEAR fmrcres() /* change screen resolution */ { return(TRUE); } -spal(char *dummy) /* change pallette settings */ +PASCAL NEAR spal(char *dummy) /* change pallette settings */ { /* none for now */ } -fmrbeep() +PASCAL NEAR fmrbeep() { ttputc(BEL); ttflush(); } -fmrparm(n) +PASCAL NEAR fmrparm(n) register int n; { register int q,r; @@ -296,7 +296,7 @@ register int n; ttputc((n%10) + '0'); } -fmropen() +PASCAL NEAR fmropen() { strcpy(sres, "NORMAL"); @@ -311,7 +311,7 @@ fmropen() gds_init(); /* initialize the GDS driver */ } -fmrclose() +PASCAL NEAR fmrclose() { #if COLOR @@ -322,7 +322,7 @@ fmrclose() ttclose(); } -fmrkopen() /* open the keyboard */ +PASCAL NEAR fmrkopen() /* open the keyboard */ { /* save the original function key definitions */ @@ -345,7 +345,7 @@ fmrkopen() /* open the keyboard */ upwind(); } -fmrkclose() /* close the keyboard (a noop here) */ +PASCAL NEAR fmrkclose() /* close the keyboard (a noop here) */ { setkeys(&functab); @@ -440,7 +440,7 @@ KEYDEF *ftable; /* table to set definitions from */ /* charwrite: write some chars directly out to the video */ -void charwrite(row, outstr, forg, left, right) +void PASCAL NEAR charwrite(row, outstr, forg, left, right) int row; /* row of screen to place outstr on */ char *outstr; /* string to write out (must be term.t_ncol long) */ @@ -448,7 +448,7 @@ int forg; /* forground color of string to write */ int left, right; /* limits of the reverse field area */ { - /* move to the beginning of the destination line */ + /* move to the begining of the destination line */ fmrmove(row, left); outstr += left; @@ -465,7 +465,7 @@ int left, right; /* limits of the reverse field area */ /* scwrite: write a line directly out to the video */ -scwrite(row, outstr, forg, bacg, left, right) +PASCAL NEAR scwrite(row, outstr, forg, bacg, left, right) int row; /* row of screen to place outstr on */ char *outstr; /* string to write out (must be term.t_ncol long) */ @@ -502,7 +502,7 @@ int left, right; /* limits of the reverse field area */ } #if FLABEL -int fnclabel(f, n) /* label a function key */ +int PASCAL NEAR fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument [unused] */ diff --git a/src/hp110.c b/src/hp110.c index 4e51584..c30a1e8 100644 --- a/src/hp110.c +++ b/src/hp110.c @@ -20,26 +20,26 @@ #define BEL 0x07 /* BEL character. */ #define ESC 0x1B /* ESC character. */ -extern ttopen(); /* Forward references. */ -extern ttgetc(); -extern ttputc(); -extern ttflush(); -extern ttclose(); -extern h110move(); -extern h110eeol(); -extern h110eeop(); -extern h110beep(); -extern h110open(); -extern h110rev(); -extern h110cres(); -extern h110close(); -extern h110kopen(); -extern h110kclose(); -extern h110parm(); +extern PASCAL NEAR ttopen(); /* Forward references. */ +extern PASCAL NEAR ttgetc(); +extern PASCAL NEAR ttputc(); +extern PASCAL NEAR ttflush(); +extern PASCAL NEAR ttclose(); +extern PASCAL NEAR h110move(); +extern PASCAL NEAR h110eeol(); +extern PASCAL NEAR h110eeop(); +extern PASCAL NEAR h110beep(); +extern PASCAL NEAR h110open(); +extern PASCAL NEAR h110rev(); +extern PASCAL NEAR h110cres(); +extern PASCAL NEAR h110close(); +extern PASCAL NEAR h110kopen(); +extern PASCAL NEAR h110kclose(); +extern PASCAL NEAR h110parm(); #if COLOR -extern h110fcol(); -extern h110bcol(); +extern PASCAL NEAR h110fcol(); +extern PASCAL NEAR h110bcol(); int cfcolor = -1; /* current forground color */ int cbcolor = -1; /* current background color */ @@ -78,7 +78,7 @@ TERM term = { }; #if COLOR -h110fcol(color) /* set the current output color */ +PASCAL NEAR h110fcol(color) /* set the current output color */ int color; /* color to set */ @@ -92,7 +92,7 @@ int color; /* color to set */ cfcolor = color; } -h110bcol(color) /* set the current background color */ +PASCAL NEAR h110bcol(color) /* set the current background color */ int color; /* color to set */ @@ -107,7 +107,7 @@ int color; /* color to set */ } #endif -h110move(row, col) +PASCAL NEAR h110move(row, col) { ttputc(ESC); ttputc('['); @@ -117,7 +117,7 @@ h110move(row, col) ttputc('H'); } -h110eeol() +PASCAL NEAR h110eeol() { ttputc(ESC); ttputc('['); @@ -125,7 +125,7 @@ h110eeol() ttputc('K'); } -h110eeop() +PASCAL NEAR h110eeop() { #if COLOR h110fcol(gfcolor); @@ -137,7 +137,7 @@ h110eeop() ttputc('J'); } -h110rev(state) /* change reverse video state */ +PASCAL NEAR h110rev(state) /* change reverse video state */ int state; /* TRUE = reverse, FALSE = normal */ @@ -162,25 +162,25 @@ int state; /* TRUE = reverse, FALSE = normal */ #endif } -h110cres() /* change screen resolution */ +PASCAL NEAR h110cres() /* change screen resolution */ { return(TRUE); } -spal() /* change pallette register */ +PASCAL NEAR spal() /* change pallette register */ { /* not here */ } -h110beep() +PASCAL NEAR h110beep() { ttputc(BEL); ttflush(); } -h110parm(n) +PASCAL NEAR h110parm(n) register int n; { register int q,r; @@ -196,7 +196,7 @@ register int n; ttputc((n%10) + '0'); } -h110open() +PASCAL NEAR h110open() { strcpy(sres, "15LINE"); strcpy(os, "MSDOS); @@ -204,7 +204,7 @@ h110open() ttopen(); } -h110close() +PASCAL NEAR h110close() { #if COLOR @@ -214,18 +214,18 @@ h110close() ttclose(); } -h110kopen() +PASCAL NEAR h110kopen() { } -h110kclose() +PASCAL NEAR h110kclose() { } #if FLABEL -fnclabel(f, n) /* label a function key */ +PASCAL NEAR fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument [unused] */ diff --git a/src/hp150.c b/src/hp150.c index 635539a..78da02d 100644 --- a/src/hp150.c +++ b/src/hp150.c @@ -23,34 +23,34 @@ #define BEL 0x07 /* BEL character. */ #define ESC 0x1B /* ESC character. */ -extern int openhp(); /* Forward references. */ -extern int NEAR hpflush(); -extern int closehp(); -extern int NEAR hp15kopen(); -extern int NEAR hp15kclose(); -extern int hp15move(); -extern int hp15eeol(); -extern int hp15eeop(); -extern int hp15beep(); -extern int NEAR gethpkey(); -extern int NEAR hp15rev(); -extern int NEAR hp15cres(); +extern int PASCAL NEAR openhp(); /* Forward references. */ +extern int PASCAL NEAR hpflush(); +extern int PASCAL NEAR closehp(); +extern int PASCAL NEAR hp15kopen(); +extern int PASCAL NEAR hp15kclose(); +extern int PASCAL NEAR hp15move(); +extern int PASCAL NEAR hp15eeol(); +extern int PASCAL NEAR hp15eeop(); +extern int PASCAL NEAR hp15beep(); +extern int PASCAL NEAR gethpkey(); +extern int PASCAL NEAR hp15rev(); +extern int PASCAL NEAR hp15cres(); #if COLOR -extern int NEAR hp15fcol(); -extern int NEAR hp15bcol(); +extern int PASCAL NEAR hp15fcol(); +extern int PASCAL NEAR hp15bcol(); #endif -hp15parm(); -rawon(); -rawoff(); -ckeyoff(); -ckeyon(); -agios(); -keycon(); -keycoff(); -defkey(); -undefkey(); -dsplbls(); +PASCAL NEAR hp15parm(); +PASCAL NEAR rawon(); +PASCAL NEAR rawoff(); +PASCAL NEAR ckeyoff(); +PASCAL NEAR ckeyon(); +PASCAL NEAR agios(); +PASCAL NEAR keycon(); +PASCAL NEAR keycoff(); +PASCAL NEAR defkey(); +PASCAL NEAR undefkey(); +PASCAL NEAR dsplbls(); /* Some needed locals */ @@ -91,7 +91,7 @@ TERM term = { #endif }; -hp15move(row, col) +PASCAL NEAR hp15move(row, col) { ttputc(ESC); ttputc('&'); @@ -102,25 +102,25 @@ hp15move(row, col) ttputc('R'); } -hpflush() +PASCAL NEAR hpflush() { } -hp15eeol() +PASCAL NEAR hp15eeol() { ttputc(ESC); ttputc('K'); } -hp15eeop() +PASCAL NEAR hp15eeop() { ttputc(ESC); ttputc('J'); } -hp15rev(status) /* change the reverse video status */ +PASCAL NEAR hp15rev(status) /* change the reverse video status */ int status; /* TRUE = on, FALSE = off */ @@ -131,25 +131,25 @@ int status; /* TRUE = on, FALSE = off */ ttputc((status != FALSE) ? 'B': '@'); } -hp15cres() /* change screen resolution */ +PASCAL NEAR hp15cres() /* change screen resolution */ { return(TRUE); } -spal() /* change pallette register */ +PASCAL NEAR spal() /* change pallette register */ { /* not here */ } -hp15beep() +PASCAL NEAR hp15beep() { ttputc(BEL); ttflush(); } -hp15parm(n) +PASCAL NEAR hp15parm(n) register int n; @@ -163,16 +163,16 @@ register int n; } #if COLOR -hp15fcol() /* we really can't do colors here, so just ignore it */ +PASCAL NEAR hp15fcol() /* we really can't do colors here, so just ignore it */ { } -hp15bcol() /* we really can't do colors here, so just ignore it */ +PASCAL NEAR hp15bcol() /* we really can't do colors here, so just ignore it */ { } #endif -gethpkey() /* get a key from the HP keyboard while in keycode mode */ +PASCAL NEAR gethpkey() /* get a key from the HP keyboard while in keycode mode */ { unsigned c; /* character to translate */ @@ -342,7 +342,7 @@ unsigned c; /* byte following a zero extended char byte */ return(sstate | c); } -openhp() /* open the HP150 screen for input */ +PASCAL NEAR openhp() /* open the HP150 screen for input */ { strcpy(sres, "NORMAL"); @@ -350,12 +350,12 @@ openhp() /* open the HP150 screen for input */ revexist = TRUE; } -closehp() /* close the HP150 screen for input */ +PASCAL NEAR closehp() /* close the HP150 screen for input */ { } -hp15kopen() /* open the HP150 keyboard for input */ +PASCAL NEAR hp15kopen() /* open the HP150 keyboard for input */ { /* define key charectoristics with AGIOS call (0, 40) */ @@ -374,7 +374,7 @@ hp15kopen() /* open the HP150 keyboard for input */ dsplbls(); } -hp15kclose() /* close the HP150 keyboard for input */ +PASCAL NEAR hp15kclose() /* close the HP150 keyboard for input */ { /* define key charectoristics with AGIOS call (0, 40) */ @@ -390,7 +390,7 @@ hp15kclose() /* close the HP150 keyboard for input */ keycoff(); } -rawon() /* put the HP150 keyboard into RAW mode */ +PASCAL NEAR rawon() /* put the HP150 keyboard into RAW mode */ { /* get the IO control info */ @@ -409,7 +409,7 @@ rawon() /* put the HP150 keyboard into RAW mode */ intdos(&r, &r); /* go fer it */ } -rawoff() /* put the HP150 keyboard into COOKED mode */ +PASCAL NEAR rawoff() /* put the HP150 keyboard into COOKED mode */ { /* get the IO control info */ @@ -428,7 +428,7 @@ rawoff() /* put the HP150 keyboard into COOKED mode */ intdos(&r, &r); /* go fer it */ } -ckeyoff() /* turn control-C trapping off */ +PASCAL NEAR ckeyoff() /* turn control-C trapping off */ { /* find the current state of the control break inturrupt */ @@ -446,7 +446,7 @@ ckeyoff() /* turn control-C trapping off */ } } -ckeyon() /* turn control-C trapping on */ +PASCAL NEAR ckeyon() /* turn control-C trapping on */ { if (break_flag == 1) { @@ -461,7 +461,7 @@ ckeyon() /* turn control-C trapping on */ #undef unsigned #endif -agios(buf, len) /* perform an AGIOS call */ +PASCAL NEAR agios(buf, len) /* perform an AGIOS call */ char *buf; /* sequence of bytes in command */ int len; /* length of command in bytes */ @@ -474,7 +474,7 @@ int len; /* length of command in bytes */ return(intdos(&r, &r)); /* do it */ } -keycon() /* turn keycode mode on */ +PASCAL NEAR keycon() /* turn keycode mode on */ { static char cmd[] = {43, 0, 1}; @@ -482,7 +482,7 @@ keycon() /* turn keycode mode on */ return(agios(&cmd[0], 3)); } -keycoff() /* turn keycode mode off */ +PASCAL NEAR keycoff() /* turn keycode mode off */ { static char cmd[] = {43, 0, 0}; @@ -490,7 +490,7 @@ keycoff() /* turn keycode mode off */ return(agios(&cmd[0], 3)); } -defkey() /* change all special keys to intercept mode */ +PASCAL NEAR defkey() /* change all special keys to intercept mode */ { static char cmd[] = {40, 0, 2, 0, 0xfe, 0}; @@ -498,7 +498,7 @@ defkey() /* change all special keys to intercept mode */ return(agios(&cmd[0], 6)); } -undefkey() /* change all special keys to intercept mode */ +PASCAL NEAR undefkey() /* change all special keys to intercept mode */ { static char cmd[] = {40, 0, 0, 0, 0xfe, 0}; @@ -506,7 +506,7 @@ undefkey() /* change all special keys to intercept mode */ return(agios(&cmd[0], 6)); } -dsplbls() /* display the application softkey labels on the screen */ +PASCAL NEAR dsplbls() /* display the application softkey labels on the screen */ { static char cmd[] = {11, 0}; @@ -515,7 +515,7 @@ dsplbls() /* display the application softkey labels on the screen */ } #if FLABEL -fnclabel(f, n) /* label a function key */ +PASCAL NEAR fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument */ @@ -575,7 +575,7 @@ force: cmd[4] = ptru.cstr[0]; } #endif #else -h15hello() +PASCAL NEAR h15hello() { } diff --git a/src/i55.c b/src/i55.c index 3baea8d..c89dba8 100644 --- a/src/i55.c +++ b/src/i55.c @@ -15,17 +15,17 @@ #if I55 #if PROTO -int fnclabel(int f, int n); -int readparam( int *v); -void dobbnmouse(void); -void docsi( int oh); -void ttputs(char *string); +int PASCAL NEAR fnclabel(int f, int n); +int PASCAL NEAR readparam( int *v); +void PASCAL NEAR dobbnmouse(void); +void PASCAL NEAR docsi( int oh); +void PASCAL NEAR ttputs(char *string); #else -int fnclabel(); -int readparam(); -void dobbnmouse(); -void docsi(); -void ttputs(); +int PASCAL NEAR fnclabel(); +int PASCAL NEAR readparam(); +void PASCAL NEAR dobbnmouse(); +void PASCAL NEAR docsi(); +void PASCAL NEAR ttputs(); #endif #define NROW 24 /* Screen size. */ @@ -37,22 +37,22 @@ void ttputs(); #define ESC 0x1B /* ESC character. */ /* Forward references. */ -extern int i55move(); -extern int i55eeol(); -extern int i55eeop(); -extern int i55beep(); -extern int i55open(); -extern int i55rev(); -extern int i55close(); -extern int i55kopen(); -extern int i55kclose(); -extern int i55cres(); -extern int i55parm(); -extern int i55getc(); +extern int PASCAL NEAR i55move(); +extern int PASCAL NEAR i55eeol(); +extern int PASCAL NEAR i55eeop(); +extern int PASCAL NEAR i55beep(); +extern int PASCAL NEAR i55open(); +extern int PASCAL NEAR i55rev(); +extern int PASCAL NEAR i55close(); +extern int PASCAL NEAR i55kopen(); +extern int PASCAL NEAR i55kclose(); +extern int PASCAL NEAR i55cres(); +extern int PASCAL NEAR i55parm(); +extern int PASCAL NEAR i55getc(); #if COLOR -extern int i55fcol(); -extern int i55bcol(); +extern int PASCAL NEAR i55fcol(); +extern int PASCAL NEAR i55bcol(); static int cfcolor = -1; /* current forground color */ static int cbcolor = -1; /* current background color */ @@ -92,7 +92,7 @@ NOSHARE TERM term = { }; #if COLOR -i55fcol(color) /* set the current output color */ +PASCAL NEAR i55fcol(color) /* set the current output color */ int color; /* color to set */ @@ -107,7 +107,7 @@ int color; /* color to set */ cfcolor = color; } -i55bcol(color) /* set the current background color */ +PASCAL NEAR i55bcol(color) /* set the current background color */ int color; /* color to set */ @@ -123,7 +123,7 @@ int color; /* color to set */ } #endif -i55move(row, col) +PASCAL NEAR i55move(row, col) { ttputc(ESC); ttputc('['); @@ -133,14 +133,14 @@ i55move(row, col) ttputc('H'); } -i55eeol() +PASCAL NEAR i55eeol() { ttputc(ESC); ttputc('['); ttputc('K'); } -i55eeop() +PASCAL NEAR i55eeop() { #if COLOR i55fcol(gfcolor); @@ -151,7 +151,7 @@ i55eeop() ttputc('J'); } -i55rev(state) /* change reverse video state */ +PASCAL NEAR i55rev(state) /* change reverse video state */ int state; /* TRUE = reverse, FALSE = normal */ @@ -176,16 +176,16 @@ int state; /* TRUE = reverse, FALSE = normal */ #endif } -i55cres() /* change screen resolution */ +PASCAL NEAR i55cres() /* change screen resolution */ { return(TRUE); } #if PROTO -spal(char *dummy) /* change pallette settings */ +PASCAL NEAR spal(char *dummy) /* change pallette settings */ #else -spal(dummy) /* change pallette settings */ +PASCAL NEAR spal(dummy) /* change pallette settings */ char *dummy; #endif @@ -194,13 +194,13 @@ char *dummy; /* none for now */ } -i55beep() +PASCAL NEAR i55beep() { ttputc(BEL); ttflush(); } -i55parm(n) +PASCAL NEAR i55parm(n) register int n; { register int q,r; @@ -216,7 +216,7 @@ register int n; ttputc((n%10) + '0'); } -i55open() +PASCAL NEAR i55open() { strcpy(sres, "NORMAL"); revexist = TRUE; @@ -228,7 +228,7 @@ i55open() #endif } -i55close() +PASCAL NEAR i55close() { #if COLOR @@ -242,24 +242,24 @@ i55close() ttclose(); } -i55kopen() /* open the keyboard (a noop here) */ +PASCAL NEAR i55kopen() /* open the keyboard (a noop here) */ { } -i55kclose() /* close the keyboard (a noop here) */ +PASCAL NEAR i55kclose() /* close the keyboard (a noop here) */ { } - i55getc() +PASCAL NEAR i55getc() { return(ttgetc()); } #if FLABEL -int fnclabel(f, n) /* label a function key */ +int PASCAL NEAR fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument [unused] */ diff --git a/src/ibmpc.c b/src/ibmpc.c index f756ac5..0b5d4c2 100644 --- a/src/ibmpc.c +++ b/src/ibmpc.c @@ -7,10 +7,10 @@ #define termdef 1 /* don't define "term" external */ -#include +#include #include "estruct.h" #include "eproto.h" -#include "edef.h" +#include "edef.h" #include "elang.h" #if IBMPC @@ -72,32 +72,32 @@ int desk_rows; /* number of rows on current desktop */ int desk_cols; /* number of cols on current desktop */ int break_flag; /* state of MSDOS control break processing */ -int ibmmove(int, int); -int ibmeeol(void); -int ibmputc(int); -int ibmeeop(void); -int ibmclrdesk(void); -int ibmrev(int); -int ibmcres(char*); -int spal(); -int ibmbeep(void); -int ibmopen(void); -int ibmclose(void); -int ibmkopen(void); -int ibmkclose(void); -int scinit(); -int screen_init(); -int getboard(); -int egaopen(); -int egaclose(); -int cga40_open(); -int cga40_close(); -int change_width(); -int fnclabel(); +int PASCAL NEAR ibmmove(); +int PASCAL NEAR ibmeeol(); +int PASCAL NEAR ibmputc(); +int PASCAL NEAR ibmeeop(); +int PASCAL NEAR ibmclrdesk(); +int PASCAL NEAR ibmrev(); +int PASCAL NEAR ibmcres(); +int PASCAL NEAR spal(); +int PASCAL NEAR ibmbeep(); +int PASCAL NEAR ibmopen(); +int PASCAL NEAR ibmclose(); +int PASCAL NEAR ibmkopen(); +int PASCAL NEAR ibmkclose(); +int PASCAL NEAR scinit(); +int PASCAL NEAR screen_init(); +int PASCAL NEAR getboard(); +int PASCAL NEAR egaopen(); +int PASCAL NEAR egaclose(); +int PASCAL NEAR cga40_open(); +int PASCAL NEAR cga40_close(); +int PASCAL NEAR change_width(); +int PASCAL NEAR fnclabel(); #if COLOR -int ibmfcol(int); -int ibmbcol(int); +int PASCAL NEAR ibmfcol(); +int PASCAL NEAR ibmbcol(); int cfcolor = -1; /* current forground color */ int cbcolor = -1; /* current background color */ int ctrans[] = /* ansi to ibm color translation table */ @@ -111,25 +111,25 @@ int ctrans[] = /* ansi to ibm color translation table */ */ TERM term = { NROW-1, - NROW-1, - NCOL, - NCOL, + NROW-1, + NCOL, + NCOL, 0, 0, MARGIN, SCRSIZ, NPAUSE, - ibmopen, - ibmclose, + ibmopen, + ibmclose, ibmkopen, ibmkclose, - ttgetc, + ttgetc, ibmputc, - ttflush, - ibmmove, - ibmeeol, - ibmeeop, - ibmclrdesk, - ibmbeep, + ttflush, + ibmmove, + ibmeeol, + ibmeeop, + ibmclrdesk, + ibmbeep, ibmrev, ibmcres #if COLOR @@ -139,20 +139,24 @@ TERM term = { }; #if COLOR -int ibmfcol(int color) /* set the current output color */ +int PASCAL NEAR ibmfcol(color) /* set the current output color */ + +int color; /* color to set */ { cfcolor = ctrans[color]; } -int ibmbcol(int color) /* set the current background color */ +int PASCAL NEAR ibmbcol(color) /* set the current background color */ + +int color; /* color to set */ { cbcolor = ctrans[color]; } #endif -int ibmmove(int row, int col) +int PASCAL NEAR ibmmove(row, col) { rg.h.ah = 2; /* set cursor position function code */ rg.h.dl = col + term.t_colorg; @@ -161,7 +165,7 @@ int ibmmove(int row, int col) int86(0x10, &rg, &rg); } -int ibmeeol(void) /* erase to the end of the line */ +int PASCAL NEAR ibmeeol() /* erase to the end of the line */ { unsigned int attr; /* attribute byte mask to place in RAM */ @@ -210,7 +214,7 @@ int ibmeeol(void) /* erase to the end of the line */ movmem(&sline[0], scptr[crow+term.t_roworg]+ccol+term.t_colorg, (term.t_ncol-ccol)*2); } -int ibmputc(ch) /* put a character at the current position in the +int PASCAL NEAR ibmputc(ch) /* put a character at the current position in the current colors */ int ch; @@ -299,7 +303,7 @@ int ch; #endif } -int ibmeeop(void) +int PASCAL NEAR ibmeeop() { rg.h.ah = 6; /* scroll page up function code */ @@ -326,7 +330,7 @@ int ibmeeop(void) int86(0x10, &rg, &rg); } -int ibmclrdesk(void) +int PASCAL NEAR ibmclrdesk() { int attr; /* attribute to fill screen with */ @@ -355,7 +359,7 @@ int ibmclrdesk(void) int86(0x10, &rg, &rg); } -int ibmrev(state) /* change reverse video state */ +int PASCAL NEAR ibmrev(state) /* change reverse video state */ int state; /* TRUE = reverse, FALSE = normal */ @@ -365,7 +369,7 @@ int state; /* TRUE = reverse, FALSE = normal */ extern dumpscreens(); -int ibmcres(res) /* change screen resolution */ +int PASCAL NEAR ibmcres(res) /* change screen resolution */ char *res; /* resolution to change to */ @@ -380,7 +384,7 @@ char *res; /* resolution to change to */ return(FALSE); } -int spal(mode) /* reset the pallette registers */ +int PASCAL NEAR spal(mode) /* reset the pallette registers */ char *mode; @@ -388,7 +392,7 @@ char *mode; /* nothin here now..... */ } -int ibmbeep(void) +int PASCAL NEAR ibmbeep() { #if MWC ttputc(BEL); @@ -401,7 +405,7 @@ int ibmbeep(void) #endif /* MWC */ } -int ibmopen(void) +int PASCAL NEAR ibmopen() { scinit(CDSENSE); revexist = TRUE; @@ -409,7 +413,7 @@ int ibmopen(void) ttopen(); } -int ibmclose(void) +int PASCAL NEAR ibmclose() { #if COLOR @@ -427,7 +431,7 @@ int ibmclose(void) ttclose(); } -int ibmkopen(void) /* open the keyboard */ +int PASCAL NEAR ibmkopen() /* open the keyboard */ { /* find the current state of the control break inturrupt */ @@ -445,7 +449,7 @@ int ibmkopen(void) /* open the keyboard */ } } -int ibmkclose(void) /* close the keyboard */ +int PASCAL NEAR ibmkclose() /* close the keyboard */ { if (break_flag == 1) { @@ -456,7 +460,7 @@ int ibmkclose(void) /* close the keyboard */ } } -int scinit(type) /* initialize the screen head pointers */ +int PASCAL NEAR scinit(type) /* initialize the screen head pointers */ int type; /* type of adapter to init for */ @@ -521,7 +525,7 @@ int type; /* type of adapter to init for */ return(TRUE); } -int screen_init(dtype, type) /* initialize the screen head pointers */ +int PASCAL NEAR screen_init(dtype, type) /* initialize the screen head pointers */ int dtype; /* original screen type (-1 if first time!) */ int type; /* new type of adapter to adjust screens for */ @@ -556,7 +560,7 @@ int type; /* new type of adapter to adjust screens for */ return(TRUE); } -int change_width(ncols) +int PASCAL NEAR change_width(ncols) int ncols; /* number of columns across */ @@ -589,7 +593,7 @@ int ncols; /* number of columns across */ VGA set to CGA EGAexist = TRUE VGAexist = TRUE */ -int getboard() +int PASCAL NEAR getboard() { int type; /* board type to return */ @@ -640,7 +644,7 @@ int getboard() return(type); } -int egaopen(mode) /* init the computer to work with the EGA or VGA */ +int PASCAL NEAR egaopen(mode) /* init the computer to work with the EGA or VGA */ int mode; /* mode to select [CDEGA/CDVGA] */ @@ -692,7 +696,7 @@ int mode; /* mode to select [CDEGA/CDVGA] */ outp(0x3d5, 6); } -int egaclose() +int PASCAL NEAR egaclose() { /* set the proper number of scan lines for CGA */ @@ -706,7 +710,7 @@ int egaclose() int86(16, &rg, &rg); } -int cga40_open() +int PASCAL NEAR cga40_open() { /* put the beast into 40 column mode */ @@ -714,7 +718,7 @@ int cga40_open() int86(16, &rg, &rg); } -int cga40_close() +int PASCAL NEAR cga40_close() { /* put the beast into 80 column mode */ @@ -724,7 +728,7 @@ int cga40_close() /* scwrite: write a line out to the physical screen */ -int scwrite(row, outstr, forg, bacg, revleft, revright) +int PASCAL NEAR scwrite(row, outstr, forg, bacg, revleft, revright) int row; /* row of screen to place outstr on */ char *outstr; /* string to write out (must be term.t_ncol long) */ @@ -779,7 +783,7 @@ int revright; /* first character of non-reverse video area */ } #if FLABEL -int fnclabel(f, n) /* label a function key */ +int PASCAL NEAR fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument [unused] */ diff --git a/src/mswmem.c b/src/mswmem.c index f8fbe92..b8e5ef4 100644 --- a/src/mswmem.c +++ b/src/mswmem.c @@ -359,7 +359,7 @@ void * CDECL realloc(void * oldblock, size_t size); /* InitializeFarStorage: start the suballocation mechanism */ /* ==================== */ -void FAR InitializeFarStorage (void) +void FAR PASCAL InitializeFarStorage (void) { #if SUBALLOC FarStorage = TRUE; @@ -369,7 +369,7 @@ void FAR InitializeFarStorage (void) /* JettisonFarStorage: Release all the global segments (quitting time) */ /* ================== */ -void FAR JettisonFarStorage (void) +void FAR PASCAL JettisonFarStorage (void) { #if SUBALLOC SEGHEADER *sp; diff --git a/src/nec.c b/src/nec.c index 6b840fd..9e8ce23 100644 --- a/src/nec.c +++ b/src/nec.c @@ -15,17 +15,17 @@ #include #if PROTO -int fnclabel(int f, int n); -int readparam( int *v); -void dobbnmouse(void); -void docsi( int oh); -void ttputs(char *string); +int PASCAL NEAR fnclabel(int f, int n); +int PASCAL NEAR readparam( int *v); +void PASCAL NEAR dobbnmouse(void); +void PASCAL NEAR docsi( int oh); +void PASCAL NEAR ttputs(char *string); #else -int fnclabel(); -int readparam(); -void dobbnmouse(); -void docsi(); -void ttputs(); +int PASCAL NEAR fnclabel(); +int PASCAL NEAR readparam(); +void PASCAL NEAR dobbnmouse(); +void PASCAL NEAR docsi(); +void PASCAL NEAR ttputs(); #endif #define NROW 24 /* Screen size. */ @@ -37,26 +37,26 @@ void ttputs(); #define ESC 0x1B /* ESC character. */ /* Forward references. */ -extern int necmove(); -extern int neceeol(); -extern int neceeop(); -extern int necbeep(); -extern int necopen(); -extern int necrev(); -extern int necclose(); -extern int neckopen(); -extern int neckclose(); -extern int neccres(); -extern int necparm(); -extern int necgetc(); +extern int PASCAL NEAR necmove(); +extern int PASCAL NEAR neceeol(); +extern int PASCAL NEAR neceeop(); +extern int PASCAL NEAR necbeep(); +extern int PASCAL NEAR necopen(); +extern int PASCAL NEAR necrev(); +extern int PASCAL NEAR necclose(); +extern int PASCAL NEAR neckopen(); +extern int PASCAL NEAR neckclose(); +extern int PASCAL NEAR neccres(); +extern int PASCAL NEAR necparm(); +extern int PASCAL NEAR necgetc(); #if INSDEL -extern int necins(); -extern int necdel(); +extern int PASCAL NEAR necins(); +extern int PASCAL NEAR necdel(); #endif #if COLOR -extern int necfcol(); -extern int necbcol(); +extern int PASCAL NEAR necfcol(); +extern int PASCAL NEAR necbcol(); static int cfcolor = -1; /* current forground color */ static int cbcolor = -1; /* current background color */ @@ -152,7 +152,7 @@ NOSHARE TERM term = { }; #if COLOR -necfcol(color) /* set the current output color */ +PASCAL NEAR necfcol(color) /* set the current output color */ int color; /* color to set */ @@ -166,7 +166,7 @@ int color; /* color to set */ cfcolor = color; } -necbcol(color) /* set the current background color */ +PASCAL NEAR necbcol(color) /* set the current background color */ int color; /* color to set */ @@ -184,7 +184,7 @@ int color; /* color to set */ #endif #if INSDEL -necins(lines) /* insert some screen lines */ +PASCAL NEAR necins(lines) /* insert some screen lines */ int lines; /* number of lines to insert */ @@ -197,7 +197,7 @@ int lines; /* number of lines to insert */ ttputc('L'); } -necdel(lines) /* delete some screen lines */ +PASCAL NEAR necdel(lines) /* delete some screen lines */ int lines; /* number of lines to delete */ @@ -211,7 +211,7 @@ int lines; /* number of lines to delete */ } #endif -necmove(row, col) +PASCAL NEAR necmove(row, col) { ttputc(ESC); ttputc('['); @@ -221,14 +221,14 @@ necmove(row, col) ttputc('H'); } -neceeol() +PASCAL NEAR neceeol() { ttputc(ESC); ttputc('['); ttputc('K'); } -neceeop() +PASCAL NEAR neceeop() { #if COLOR necfcol(gfcolor); @@ -239,7 +239,7 @@ neceeop() ttputc('J'); } -necrev(state) /* change reverse video state */ +PASCAL NEAR necrev(state) /* change reverse video state */ int state; /* TRUE = reverse, FALSE = normal */ @@ -264,25 +264,25 @@ int state; /* TRUE = reverse, FALSE = normal */ #endif } -neccres() /* change screen resolution */ +PASCAL NEAR neccres() /* change screen resolution */ { return(TRUE); } -spal(char *dummy) /* change pallette settings */ +PASCAL NEAR spal(char *dummy) /* change pallette settings */ { /* none for now */ } -necbeep() +PASCAL NEAR necbeep() { ttputc(BEL); ttflush(); } -necparm(n) +PASCAL NEAR necparm(n) register int n; { register int q,r; @@ -298,7 +298,7 @@ register int n; ttputc((n%10) + '0'); } -necopen() +PASCAL NEAR necopen() { strcpy(sres, "NORMAL"); revexist = TRUE; @@ -311,7 +311,7 @@ necopen() #endif } -necclose() +PASCAL NEAR necclose() { #if COLOR @@ -321,7 +321,7 @@ necclose() ttclose(); } -neckopen() /* open the keyboard (a noop here) */ +PASCAL NEAR neckopen() /* open the keyboard (a noop here) */ { #if FLABEL @@ -329,7 +329,7 @@ neckopen() /* open the keyboard (a noop here) */ #endif } -neckclose() /* close the keyboard (a noop here) */ +PASCAL NEAR neckclose() /* close the keyboard (a noop here) */ { #if FLABEL @@ -337,14 +337,14 @@ neckclose() /* close the keyboard (a noop here) */ #endif } -necgetc() +PASCAL NEAR necgetc() { return(ttgetc()); } #if FLABEL -int fnclabel(f, n) /* label a function key */ +int PASCAL NEAR fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument [unused] */ diff --git a/src/ntconio.c b/src/ntconio.c index 7a8956f..8a94a46 100644 --- a/src/ntconio.c +++ b/src/ntconio.c @@ -21,7 +21,7 @@ #include "elang.h" #if NTCON -#define NROW 80 /* Screen size. */ +#define NROW 80 /* Screen size. */ #define NCOL 132 /* Edit if you want to. */ #define MARGIN 8 /* size of minimim margin and */ #define SCRSIZ 64 /* scroll size for extended lines */ @@ -29,26 +29,26 @@ /* Forward references. */ -ntmove(); -nteeol(); -nteeop(); -ntbeep(); -ntopen(); -ntclose(); -ntgetc(); -ntputc(); -ntflush(); -ntrev(); -ntkclose(); -ntkopen(); -ntcres(); -ntparm(); +PASCAL NEAR ntmove(); +PASCAL NEAR nteeol(); +PASCAL NEAR nteeop(); +PASCAL NEAR ntbeep(); +PASCAL NEAR ntopen(); +PASCAL NEAR ntclose(); +PASCAL NEAR ntgetc(); +PASCAL NEAR ntputc(); +PASCAL NEAR ntflush(); +PASCAL NEAR ntrev(); +PASCAL NEAR ntkclose(); +PASCAL NEAR ntkopen(); +PASCAL NEAR ntcres(); +PASCAL NEAR ntparm(); #if COLOR -ntfcol(); -ntbcol(); +PASCAL NEAR ntfcol(); +PASCAL NEAR ntbcol(); #endif -fnclabel(); -static WORD ntAttribute(void); +PASCAL NEAR fnclabel(); +static WORD near ntAttribute(void); /* Screen buffer to write to. */ static CHAR_INFO ciScreenBuffer[NROW * NCOL]; @@ -163,7 +163,7 @@ int in_get() /* get an event from the input buffer */ /* Set the current foreground color. */ /*----------------------------------------------------------------------*/ -ntfcol( +PASCAL NEAR ntfcol( int color) /* color to set */ { cfcolor = ctrans[color]; @@ -174,14 +174,14 @@ ntfcol( /* Set the current background color. */ /*----------------------------------------------------------------------*/ -ntbcol( +PASCAL NEAR ntbcol( int color) /* color to set */ { cbcolor = ctrans[color]; } #endif -static void ntSetUpdateValues(void) +static void near ntSetUpdateValues(void) { if (ntrow < ntMin) ntMin = ntrow; @@ -200,7 +200,7 @@ static void ntSetUpdateValues(void) /* Move the cursor. */ /*----------------------------------------------------------------------*/ -ntmove( +PASCAL NEAR ntmove( int row, int col) { @@ -217,7 +217,7 @@ ntmove( /* Update the physical video buffer from the logical video buffer. */ /*----------------------------------------------------------------------*/ -ntflush(void) +PASCAL NEAR ntflush(void) { SMALL_RECT srWriteRegion; COORD coordUpdateBegin, coordBufferSize; @@ -255,7 +255,7 @@ ntflush(void) return(TRUE); } -static void MouseEvent(void) +static void near MouseEvent(void) { MOUSE_EVENT_RECORD *m_event; /* mouse event to decode */ @@ -338,7 +338,7 @@ static void MouseEvent(void) return(FALSE); } -static void WindowSizeEvent(void) +static void near WindowSizeEvent(void) { term.t_nrow = ir.Event.WindowBufferSizeEvent.dwSize.Y - 1; term.t_ncol = ir.Event.WindowBufferSizeEvent.dwSize.X; @@ -348,7 +348,7 @@ static void WindowSizeEvent(void) /* handle the current keyboard event */ -static void KeyboardEvent() +static void near KeyboardEvent() { int c; /* ascii character to examine */ @@ -476,7 +476,7 @@ static void KeyboardEvent() /* Get a character from the keyboard. */ /*----------------------------------------------------------------------*/ -ntgetc() +PASCAL NEAR ntgetc() { long dw; @@ -517,7 +517,7 @@ ttc: ntflush(); /* Returns true if a key has been pressed. */ /*----------------------------------------------------------------------*/ -typahead() +PASCAL NEAR typahead() { DWORD dwCount; /* number of pending keyboard events */ @@ -563,7 +563,7 @@ printf("UNKNOWN event pending\n"); } #endif -static WORD ntAttribute(void) +static WORD near ntAttribute(void) { return(revflag ? (cbcolor | (cfcolor << 4)) : ((cbcolor << 4) | cfcolor)); } @@ -580,7 +580,7 @@ static WORD ntAttribute(void) /* a problem. */ /*----------------------------------------------------------------------*/ -ntputc(int c) +PASCAL NEAR ntputc(int c) { WORD wScreenPos; @@ -613,7 +613,7 @@ ntputc(int c) /* Erase to end of line. */ /*----------------------------------------------------------------------*/ -nteeol() +PASCAL NEAR nteeol() { WORD wNum; WORD wScreenPos; @@ -640,7 +640,7 @@ nteeol() /* Erase to end of page. */ /*----------------------------------------------------------------------*/ -nteeop() +PASCAL NEAR nteeop() { WORD wNum; WORD wScreenPos; @@ -667,7 +667,7 @@ nteeop() /* Change reverse video state. */ /*----------------------------------------------------------------------*/ -ntrev(state) +PASCAL NEAR ntrev(state) int state; /* TRUE = reverse, FALSE = normal */ @@ -680,7 +680,7 @@ int state; /* TRUE = reverse, FALSE = normal */ /* Change the screen resolution. */ /*----------------------------------------------------------------------*/ -ntcres(char *res) /* name of desired video mode */ +PASCAL NEAR ntcres(char *res) /* name of desired video mode */ { return TRUE; } @@ -691,7 +691,7 @@ ntcres(char *res) /* name of desired video mode */ /* Change pallette settings. (Does nothing.) */ /*----------------------------------------------------------------------*/ -spal(char *dummy) +PASCAL NEAR spal(char *dummy) { return(TRUE); } @@ -701,7 +701,7 @@ spal(char *dummy) /* ntbeep() */ /*----------------------------------------------------------------------*/ -ntbeep() +PASCAL NEAR ntbeep() { // _beep(1200, 80); return(TRUE); @@ -711,7 +711,7 @@ ntbeep() /* ntopen() */ /*----------------------------------------------------------------------*/ -ntopen() +PASCAL NEAR ntopen() { CONSOLE_SCREEN_BUFFER_INFO Console; @@ -775,7 +775,7 @@ ntopen() /* Restore the original video settings. */ /*----------------------------------------------------------------------*/ -ntclose() +PASCAL NEAR ntclose() { /* reset the title on the window */ SetConsoleTitle(chConsoleTitle); @@ -789,7 +789,7 @@ ntclose() /* Open the keyboard. */ /*----------------------------------------------------------------------*/ -ntkopen() +PASCAL NEAR ntkopen() { /* save the original console mode to restore on exit */ GetConsoleMode(hInput, &OldConsoleMode); @@ -810,7 +810,7 @@ ntkopen() /* Close the keyboard. */ /*----------------------------------------------------------------------*/ -ntkclose() +PASCAL NEAR ntkclose() { /* restore the console mode from entry */ SetConsoleMode(hInput, OldConsoleMode); @@ -818,7 +818,7 @@ ntkclose() } #if FLABEL -fnclabel(f, n) /* label a function key */ +PASCAL NEAR fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument [unused] */ diff --git a/src/os2npm.c b/src/os2npm.c index edda2df..84a3eb9 100644 --- a/src/os2npm.c +++ b/src/os2npm.c @@ -54,23 +54,23 @@ char drvname[][8] = { /* names of video modes */ /* Forward references. */ -os2move(); -os2eeol(); -os2eeop(); -os2beep(); -os2open(); -os2close(); -os2getc(); -os2putc(); -os2flush(); -os2rev(); -os2kclose(); -os2kopen(); -os2cres(); -os2parm(); +PASCAL NEAR os2move(); +PASCAL NEAR os2eeol(); +PASCAL NEAR os2eeop(); +PASCAL NEAR os2beep(); +PASCAL NEAR os2open(); +PASCAL NEAR os2close(); +PASCAL NEAR os2getc(); +PASCAL NEAR os2putc(); +PASCAL NEAR os2flush(); +PASCAL NEAR os2rev(); +PASCAL NEAR os2kclose(); +PASCAL NEAR os2kopen(); +PASCAL NEAR os2cres(); +PASCAL NEAR os2parm(); #if COLOR -os2fcol(); -os2bcol(); +PASCAL NEAR os2fcol(); +PASCAL NEAR os2bcol(); #endif struct { /* Current screen attribute for ORing */ @@ -201,7 +201,7 @@ int in_get() /* get an event from the input buffer */ /* Set the current foreground color. */ /*----------------------------------------------------------------------*/ -os2fcol( +PASCAL NEAR os2fcol( int color) /* color to set */ { if (dtype != CDMONO) @@ -223,7 +223,7 @@ os2fcol( /* Set the current background color. */ /*----------------------------------------------------------------------*/ -os2bcol( +PASCAL NEAR os2bcol( int color) /* color to set */ { if (dtype != CDMONO) @@ -247,7 +247,7 @@ os2bcol( /* Move the cursor. */ /*----------------------------------------------------------------------*/ -os2move( +PASCAL NEAR os2move( int row, int col) { @@ -262,7 +262,7 @@ os2move( /* Update the physical video buffer from the logical video buffer. */ /*----------------------------------------------------------------------*/ -os2flush(void) +PASCAL NEAR os2flush(void) { if (lvbMin <= lvbMax) { /* did anything change? */ VioShowBuf(lvbMin * 2, (lvbMax - lvbMin + 1) * 2, 0); @@ -280,7 +280,7 @@ os2flush(void) /* input queue. /*----------------------------------------------------------------------*/ -os2char() +PASCAL NEAR os2char() { register c; /* extended key code for special keys */ KBDKEYINFO keyInfo; @@ -301,7 +301,7 @@ os2char() * Read a character from the terminal, performing no editing and doing no echo * at all. Also mouse events are forced into the input stream here. */ -os2getc() +PASCAL NEAR os2getc() { register int c; /* character read */ @@ -465,7 +465,7 @@ checkmouse() /* Returns true if a key has been pressed. */ /*----------------------------------------------------------------------*/ -typahead() +PASCAL NEAR typahead() { KBDKEYINFO kbdinfo; @@ -488,7 +488,7 @@ typahead() /* a problem. */ /*----------------------------------------------------------------------*/ -os2putc(int c) +PASCAL NEAR os2putc(int c) { USHORT cell; USHORT i; @@ -519,7 +519,7 @@ os2putc(int c) /* Erase to end of line. */ /*----------------------------------------------------------------------*/ -os2eeol() +PASCAL NEAR os2eeol() { USHORT cell = ' '; USHORT i; @@ -541,7 +541,7 @@ os2eeol() /* Erase to end of page. */ /*----------------------------------------------------------------------*/ -os2eeop() +PASCAL NEAR os2eeop() { USHORT cell = ' '; USHORT i; @@ -569,7 +569,7 @@ os2eeop() /* Change reverse video state. */ /*----------------------------------------------------------------------*/ -os2rev(state) +PASCAL NEAR os2rev(state) int state; /* TRUE = reverse, FALSE = normal */ @@ -582,7 +582,7 @@ int state; /* TRUE = reverse, FALSE = normal */ /* Change the screen resolution. */ /*----------------------------------------------------------------------*/ -os2cres(char *res) /* name of desired video mode */ +PASCAL NEAR os2cres(char *res) /* name of desired video mode */ { USHORT err; int type; /* video mode type */ @@ -630,7 +630,7 @@ os2cres(char *res) /* name of desired video mode */ /* Change pallette settings. (Does nothing.) */ /*----------------------------------------------------------------------*/ -spal(char *dummy) +PASCAL NEAR spal(char *dummy) { } @@ -639,7 +639,7 @@ spal(char *dummy) /* os2beep() */ /*----------------------------------------------------------------------*/ -os2beep() +PASCAL NEAR os2beep() { DosBeep(1200, 175); } @@ -652,7 +652,7 @@ os2beep() /* in use, we still use the current mode. */ /*----------------------------------------------------------------------*/ -os2open() +PASCAL NEAR os2open() { #if MOUSE PTRLOC mouse_pos; /* position to place mouse */ @@ -724,7 +724,7 @@ os2open() /* Restore the original video settings. */ /*----------------------------------------------------------------------*/ -os2close() +PASCAL NEAR os2close() { #if MOUSE /* close our use of the mouse */ @@ -743,7 +743,7 @@ os2close() /* Open the keyboard. */ /*----------------------------------------------------------------------*/ -os2kopen() +PASCAL NEAR os2kopen() { KBDINFO kbdInfo; @@ -764,13 +764,13 @@ os2kopen() /* Close the keyboard. */ /*----------------------------------------------------------------------*/ -os2kclose() +PASCAL NEAR os2kclose() { KbdSetStatus(&initial.kbdInfo, 0); /* restore original state */ } #if FLABEL -fnclabel(f, n) /* label a function key */ +PASCAL NEAR fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument [unused] */ diff --git a/src/smg.c b/src/smg.c index c5f57bd..9b523ce 100644 --- a/src/smg.c +++ b/src/smg.c @@ -433,16 +433,16 @@ static int * inbuft = inbuf; /* Tail of input buffer */ /* Forward references. */ -extern int smgmove(); -extern int smgeeol(); -extern int smgeeop(); -extern int smgbeep(); -extern int smgopen(); -extern int smgrev(); -extern int smgcres(); -extern int smgparm(); -extern int smggetc(); -extern int smgclose(); +extern int PASCAL NEAR smgmove(); +extern int PASCAL NEAR smgeeol(); +extern int PASCAL NEAR smgeeop(); +extern int PASCAL NEAR smgbeep(); +extern int PASCAL NEAR smgopen(); +extern int PASCAL NEAR smgrev(); +extern int PASCAL NEAR smgcres(); +extern int PASCAL NEAR smgparm(); +extern int PASCAL NEAR smggetc(); +extern int PASCAL NEAR smgclose(); /** Terminal dispatch table **/ NOSHARE TERM term = { diff --git a/src/st52.c b/src/st52.c index 1c5631e..1477247 100644 --- a/src/st52.c +++ b/src/st52.c @@ -732,8 +732,8 @@ stgetc() /* get a char from the keyboard */ 0, menu[1].ob_x, menu[1].ob_y, menu[1].ob_width, menu[1].ob_height, 0, 0, 0, 0, 0, /* enter/exit, x, y, w, h for rect 2 */ - mes, /* Buffer to receive message */ - /* Low and high order milliseconds of counter */ + mes, /* Buffer to receive mesasge */ + /* Low and high order miliseconds of counter */ 100, 0, &mx, &my, /* Mouse location */ &bstate, /* State of the mouse buttons */ diff --git a/src/tipc.c b/src/tipc.c index cd14385..b585f7f 100644 --- a/src/tipc.c +++ b/src/tipc.c @@ -190,25 +190,25 @@ #define WHITE 7+CHAR_ENABLE /* TI attribute for White */ -ttopen(); /* Forward references. */ -ttgetc(); -ttputc(); -ttflush(); -ttclose(); -timove(); -tieeol(); -tieeop(); -tibeep(); -tiopen(); -tikopen(); -tirev(); -ticres(); -ticlose(); -tikclose(); -tiputc(); -tifcol(); -tibcol(); -scinit(); +PASCAL NEAR ttopen(); /* Forward references. */ +PASCAL NEAR ttgetc(); +PASCAL NEAR ttputc(); +PASCAL NEAR ttflush(); +PASCAL NEAR ttclose(); +PASCAL NEAR timove(); +PASCAL NEAR tieeol(); +PASCAL NEAR tieeop(); +PASCAL NEAR tibeep(); +PASCAL NEAR tiopen(); +PASCAL NEAR tikopen(); +PASCAL NEAR tirev(); +PASCAL NEAR ticres(); +PASCAL NEAR ticlose(); +PASCAL NEAR tikclose(); +PASCAL NEAR tiputc(); +PASCAL NEAR tifcol(); +PASCAL NEAR tibcol(); +PASCAL NEAR scinit(); int revflag = FALSE; /* are we currently in rev video? */ int cfcolor = -1; /* current forground color */ @@ -277,7 +277,7 @@ TERM term = { extern union REGS rg; -tifcol(color) /* set the current output color */ +PASCAL NEAR tifcol(color) /* set the current output color */ int color; /* color to set */ { @@ -285,7 +285,7 @@ int color; /* color to set */ } -tibcol(color) /* set the current background color */ +PASCAL NEAR tibcol(color) /* set the current background color */ /* color to set */ int color; { @@ -293,7 +293,7 @@ int color; } -timove(row, col) +PASCAL NEAR timove(row, col) int row; int col; @@ -305,7 +305,7 @@ int col; } -tieeol() /* erase to the end of the line */ +PASCAL NEAR tieeol() /* erase to the end of the line */ { int i; /* loop variable */ @@ -329,7 +329,7 @@ tieeol() /* erase to the end of the line */ } -tiputc(ch) /* put a character at the current position */ +PASCAL NEAR tiputc(ch) /* put a character at the current position */ /* in the current colors */ int ch; { @@ -340,7 +340,7 @@ int ch; } -tieeop() /* Actually a clear screen */ +PASCAL NEAR tieeop() /* Actually a clear screen */ { rg.h.ah = 0x13; /* Clear Text Screen, Home Cursor and */ @@ -348,7 +348,7 @@ tieeop() /* Actually a clear screen */ } -tirev(state) /* change reverse video state */ +PASCAL NEAR tirev(state) /* change reverse video state */ int state; /* TRUE = reverse, FALSE = normal */ { @@ -356,7 +356,7 @@ int state; /* TRUE = reverse, FALSE = normal */ } -ticres() /* Change screen resolution. Should we add the */ +PASCAL NEAR ticres() /* Change screen resolution. Should we add the */ /* the 720x350 mode besides the normal 720x300 */ /* mode for those who can handle it? It really */ /* gains us nothing since we don't gain lines */ @@ -367,14 +367,14 @@ ticres() /* Change screen resolution. Should we add the */ } -tibeep() +PASCAL NEAR tibeep() { bdos(6, BEL, 0); } -tiopen() +PASCAL NEAR tiopen() { strcpy(sres, "NORMAL"); @@ -385,14 +385,14 @@ tiopen() } -tikopen() +PASCAL NEAR tikopen() { /* Does nothing */ } -ticlose() +PASCAL NEAR ticlose() { _fmemset(attradd, WHITE, 1); /* write normal attrbute to latch */ @@ -404,7 +404,7 @@ ticlose() } -tikclose() +PASCAL NEAR tikclose() { _fmemset(attradd, WHITE, 1); /* write normal attrbute to latch */ @@ -416,7 +416,7 @@ tikclose() } -scinit() /* initialize the screen head pointers to */ +PASCAL NEAR scinit() /* initialize the screen head pointers to */ /* logical screen */ { union { @@ -435,7 +435,7 @@ scinit() /* initialize the screen head pointers to */ } -scwrite(int row, char *outstr, int forg, int bacg, int revleft, int +PASCAL NEAR scwrite(int row, char *outstr, int forg, int bacg, int revleft, int /* write a line out */ { char *lnptr; /* Pointer to the destination line */ @@ -465,7 +465,7 @@ scwrite(int row, char *outstr, int forg, int bacg, int revleft, int } -spal(palette) /* change palette string */ +PASCAL NEAR spal(palette) /* change palette string */ char *palette; { @@ -524,7 +524,7 @@ char *palette; #if FLABEL -fnclabel(f, n) /* label a function key */ +PASCAL NEAR fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument [unused] */ diff --git a/src/z309.c b/src/z309.c index 5da7f61..c2c2a97 100644 --- a/src/z309.c +++ b/src/z309.c @@ -39,28 +39,28 @@ int *scptr[NROW]; /* pointer to screen lines */ int sline[NCOL]; /* screen line image */ extern union REGS rg; /* cpu register for use of DOS calls */ -extern ttopen(); /* Forward references. */ -extern ttgetc(); -extern ttputc(); -extern ttflush(); -extern ttclose(); -extern z309move(); -extern z309eeol(); -extern z309eeop(); -extern z309beep(); -extern z309open(); -extern z309rev(); -extern z309cres(); -extern z309close(); -extern z309putc(); -extern z309kopen(); -extern z309kclose(); -extern scinit(); -extern spal(); +extern PASCAL NEAR ttopen(); /* Forward references. */ +extern PASCAL NEAR ttgetc(); +extern PASCAL NEAR ttputc(); +extern PASCAL NEAR ttflush(); +extern PASCAL NEAR ttclose(); +extern PASCAL NEAR z309move(); +extern PASCAL NEAR z309eeol(); +extern PASCAL NEAR z309eeop(); +extern PASCAL NEAR z309beep(); +extern PASCAL NEAR z309open(); +extern PASCAL NEAR z309rev(); +extern PASCAL NEAR z309cres(); +extern PASCAL NEAR z309close(); +extern PASCAL NEAR z309putc(); +extern PASCAL NEAR z309kopen(); +extern PASCAL NEAR z309kclose(); +extern PASCAL NEAR scinit(); +extern PASCAL NEAR spal(); #if COLOR -extern z309fcol(); -extern z309bcol(); +extern PASCAL NEAR z309fcol(); +extern PASCAL NEAR z309bcol(); int cfcolor = -1; /* current forground color */ int cbcolor = -1; /* current background color */ @@ -103,7 +103,7 @@ TERM term = { extern union REGS rg; #if COLOR -z309fcol(color) /* set the current output color */ +PASCAL NEAR z309fcol(color) /* set the current output color */ int color; /* color to set */ @@ -111,7 +111,7 @@ int color; /* color to set */ cfcolor = ctrans[color]; } -z309bcol(color) /* set the current background color */ +PASCAL NEAR z309bcol(color) /* set the current background color */ int color; /* color to set */ @@ -119,7 +119,7 @@ int color; /* color to set */ cbcolor = ctrans[color]; } #endif -z309move(row, col) +PASCAL NEAR z309move(row, col) { rg.h.ah = 2; /* set cursor position function code */ rg.h.dl = col; @@ -128,7 +128,7 @@ z309move(row, col) int86(0x10, &rg, &rg); } -z309eeol() /* erase to the end of the line */ +PASCAL NEAR z309eeol() /* erase to the end of the line */ { int attr; /* attribute byte mask to place in RAM */ @@ -174,7 +174,7 @@ z309eeol() /* erase to the end of the line */ } -z309putc(ch) /* put a character at the current position in the +PASCAL NEAR z309putc(ch) /* put a character at the current position in the current colors */ int ch; @@ -193,7 +193,7 @@ int ch; int86(0x10, &rg, &rg); } -z309eeop() +PASCAL NEAR z309eeop() { int attr; /* attribute to fill screen with */ @@ -213,7 +213,7 @@ z309eeop() int86(0x10, &rg, &rg); } -z309rev(state) /* change reverse video state */ +PASCAL NEAR z309rev(state) /* change reverse video state */ int state; /* TRUE = reverse, FALSE = normal */ @@ -221,7 +221,7 @@ int state; /* TRUE = reverse, FALSE = normal */ /* This never gets used under the z309-PC driver */ } -z309cres(res) /* change screen resolution */ +PASCAL NEAR z309cres(res) /* change screen resolution */ char *res; /* resolution to change to */ @@ -236,7 +236,7 @@ char *res; /* resolution to change to */ return(FALSE); } -z309beep() +PASCAL NEAR z309beep() { #if MWC putcnb(BEL); @@ -245,14 +245,14 @@ z309beep() #endif } -z309open() +PASCAL NEAR z309open() { scinit(CDSENSE); revexist = TRUE; ttopen(); } -z309close() +PASCAL NEAR z309close() { rg.h.ah = 101; @@ -265,23 +265,23 @@ z309close() ttclose(); } -spal() /* reset the pallette registers */ +PASCAL NEAR spal() /* reset the pallette registers */ { /* nothin here now..... */ } -z309kopen() /* open the keyboard */ +PASCAL NEAR z309kopen() /* open the keyboard */ { } -z309kclose() /* close the keyboard */ +PASCAL NEAR z309kclose() /* close the keyboard */ { } -scinit(type) /* initialize the screen head pointers */ +PASCAL NEAR scinit(type) /* initialize the screen head pointers */ int type; /* type of adapter to init for */ @@ -316,7 +316,7 @@ int type; /* type of adapter to init for */ } } -scwrite(row, outstr, forg, bacg) /* write a line out*/ +PASCAL NEAR scwrite(row, outstr, forg, bacg) /* write a line out*/ int row; /* row of screen to place outstr on */ char *outstr; /* string to write out (must be term.t_ncol long) */ @@ -358,7 +358,7 @@ int bacg; /* background color */ } #if FLABEL -fnclabel(f, n) /* label a function key */ +PASCAL NEAR fnclabel(f, n) /* label a function key */ int f,n; /* default flag, numeric argument [unused] */ @@ -368,7 +368,7 @@ int f,n; /* default flag, numeric argument [unused] */ } #endif #else -z309hello() +PASCAL NEAR z309hello() { } #endif From 3a413e200fff037488ae7390c380188c0e739bed Mon Sep 17 00:00:00 2001 From: jmdubois Date: Thu, 10 Sep 2020 20:02:12 +0200 Subject: [PATCH 35/37] Language help files for Theos port --- libhelp/b.hlp | 4628 ++++++++++++++++++++++++++++++++++++++++++++++ libhelp/c.hlp | 4628 ++++++++++++++++++++++++++++++++++++++++++++++ libhelp/c.idx | Bin 0 -> 7836 bytes libhelp/exec.hlp | 112 ++ 4 files changed, 9368 insertions(+) create mode 100644 libhelp/b.hlp create mode 100644 libhelp/c.hlp create mode 100644 libhelp/c.idx create mode 100644 libhelp/exec.hlp diff --git a/libhelp/b.hlp b/libhelp/b.hlp new file mode 100644 index 0000000..4e89694 --- /dev/null +++ b/libhelp/b.hlp @@ -0,0 +1,4628 @@ +@_bios_keybrd +_bios_keybrd (MSVC) Return the keyboard status or keycode +#include +#include +unsigned short _bios_keybrd(unsigned short service) +See also: mapdoskey +@_errarg +_errarg (THEOS) Variable used by error message functions +#include +extern char *_errarg; +See also: strerror +@_errnum +_errnum (THEOS) External integer for return of error status +#include +extern short _errnum; +Functions setting _errnum: access,chdir,clearerr,diropen,erase,fclear,fclose, +fcreate,fopen and derivates,getmsg,mkdir,open,remove,rename,rmdir,topen,unlink +See also: errno,fperror +@_incrmem +_incrmem (THEOS) ??? +#include +char *_incrmem(size_t len); +@_mfg_get_date +_mfg_get_date (THEOS) Copy hardware date into the nuc structure +#include +void _mfg_get_date(void); +See also: _mfg_get_time,_mfg_put_date,_mfg_put_time +@_mfg_get_time +_mfg_get_time (THEOS) Copy hardware time into the nuc structure +#include +void _mfg_get_time(void); +See also: _mfg_get_date,_mfg_put_date,_mfg_put_time +@_mfg_init +_mfg_init (THEOS) Initialise system hardware +#include +long _mfg_init(long addr,long *store); +@_mfg_put_date +_mfg_put_date (THEOS) Copy date from the nuc structure to hardware +#include +void _mfg_put_date(void); +See also: _mfg_get_date,_mfg_get_time,_mfg_put_time +@_mfg_put_time +_mfg_put_time (THEOS) Copy time from the nuc structure to hardware +#include +void _mfg_put_time(void); +See also: _mfg_get_date,_mfg_get_time,_mfg_put_date +@_mfg_reserved +_mfg_reserved (THEOS) ??? +#include +void _mfg_reserved(void) +@_monthen +_monthen (THEOS) Return the number of days in a month +#include <_time.h> +short _monthen(short year,short month); +See also: leapyear,_yday +@_msec_off +_msec_off (THEOS) Turn off millisecond timing +#include +void _msec_off(void); +See also: msec_on +@_msec_on +_msec_on (THEOS) Turn on millisecond timing +#include +void _msec_on(void); +See also: msec_off +@_read +_read (THEOS) Read data from a file into any segment +#include +size_t _read(short fd,unsigned seg,void *buf,size_t len); +See also: close,creat,filelength,flush,lseek,open,read,tell,_write,write +@_rsvmem +_rsvmem (THEOS) ??? +#include +short *_rsvmem(long addr,long len,short code); +@_sched_int +_sched_int (THEOS) Schedule interrupt +#include +void _sched_int(short num,short (*addr)()); +@_set_slice +_set_slice (THEOS) Set the user time slice +#include +void _set_slice(short msec); +@_sema_isr +_sema_isr (THEOS) ??? +#include +_sema_isr(short pid,short num,short cmd); +@_setargv +_setargv (+THEOS) Expand wild cards argument to the list of matching files +#include <_stdlib.h> +short _setargv(short *pargc, char ***pargv); +Set : errno +@_sync +_sync (THEOS) Flush the cache +#include +void _sync(short code); +@_weekday +_weekday (THEOS) Return the number of the day in the week +#include <_time.h> +See also: leapyear,_monthen,_yday +@_write +_write (THEOS) Write data to a file from another memory segment +#include +size_t _write(short fd,unsigned seg,void *buf,size_t len); +See also: close,creat,filelength,flush,lseek,open,_read,read,tell,write +@_yday +_yday (THEOS) Return the number of days since the beginning of the year +@a64l +a64l (UNIX) Convert a number from a base-64 ASCII string to a long integer +#include +long a64l(const char *s); +See also: l64a +@abort +abort (ANSI) End program immediately +#include +void abort(void); +See also: exit +@abs +abs (ANSI) Return the absolute value of an integer +#include +short abs(short n); +See also: fabs +@access +access (UNIX) Check if a file can be accessed in a given mode +#include +short access(const char *filename,short mode); +mode : 0 existence, 1 execution, 2 write, 4 read +Set : errno,_errnum +See also: fperror,strerror +@acos +acos (ANSI) Calculate arc cosine +#include +double acos(double x); +@acot +acot (THEOS) Calculate arc cotangent +#include +double acot(double x); +@acsc +acsc (THEOS) Calculate arc cosecant +#include +double acsc(double x); +Set : errno +@addb +addb (THEOS) Add a value to a byte in another memory segment +#include +void addb(void *ofs,unsigned seg,char val); +See also: Other add functions +@addcs +addcs (THEOS) Add a value to a byte in the code segment +#include +void addcs(void *ofs,char val); +See also: Other add functions +@addl +addl (THEOS) Add a value to a long in another memory segment +#include +void addl(void *ofs,unsigned seg,long val); +See also: Other add functions +@addlcs +addlcs (THEOS) Add a value to a long in the code segment +#include +void addlcs(void *ofs,long val); +See also: Other add functions +@addw +addw (THEOS) Add a value to a word in another memory segment +#include +void addw(void *ofs,unsigned seg,short val); +See also: Other add functions +@addwcs +addwcs (THEOS) Add a value to a word in the code segment +#include +void addwcs(void *ofs,short val); +See also: Other add functions +@alarm +alarm (UNIX) Start a timer in seconds generating a signal interrupt +#include +short alarm(short secs); +See also: delay,msalarm,signal +@andb +andb (THEOS) And a value to a byte in another memory segment +#include +void andb(void *ofs,unsigned seg,char mask); +See also: Other and functions +@andcs +andcs (THEOS) And a value to a byte in the code segment +#include +void andcs(void *ofs,char mask); +See also: Other and functions +@andl +andl (THEOS) And a value to a long in another memory segment +#include +void andl(void *ofs,unsigned seg,long mask); +See also: Other and functions +@andlcs +andlcs (THEOS) And a value to a long in the code segment +#include +void andlcs(void *ofs,long mask); +See also: Other and functions +@andw +andw (THEOS) And a value to a word in another memory segment +#include +void andw(void *ofs,unsigned seg,short mask); +See also: Other and functions +@andwcs +andwcs (THEOS) And a value to a word in the code segment +#include +void andwcs(void *ofs,short mask); +See also: Other and functions +@asctime +asctime (ANSI) Convert time structure to ASCII string +#include +char *asctime(const struct tm *tmp); +See also: ctime,gmtime,localtime,mktime,strftime,time +@asec +asec (THEOS) Calculate arc secant +#include +double asec(double x); +Set : errno +@asin +asin (ANSI) Calculate inverse sine +#include +double asin(double x); +Set : errno +@assert +assert (ANSI) Check assertion at run time +#include +void assert(short expression); +@assert +#assert (ANSI) Check assertion at compile time +#assert expression +@at +at (THEOS) Position the cursor on the console +#include +void at(short x,short y); +See also: putch +@atan +atan (ANSI) Calculate inverse tangent +#include +double atan(double x); +@atan2 +atan2 (ANSI) Calculate inverse tangent +#include +double atan2(double num,double den); +Set : errno +@atexit +atexit (ANSI) Specifie a routine to call at normal exit time +#include +short atexit(void (*func)(void)); +See also: exit +@atof +atof (ANSI) Convert ASCII string to floating point +#include +double atof(const char *string); +See also: ftoa,strtod +@atoi +atoi (ANSI) Convert ASCII string to integer +#include +short atoi(const char *string); +Set : errno +See also: itoa +@atol +atol (ANSI) Convert ASCII string to long integer +#include +long atol(const char *string); +Set : errno +See also: ltoa,strtol,strtoul,ultoa +@bcd2ieee +bcd2ieee (THEOS) Convert a bcd floating point to ieee floating point +#include +void bcd2ieee(double *data); +See also: ieee2bcd +@bsearch +bsearch (ANSI) Perform a binary search in a sorted array +#include +void *bsearch(const void *key,const void *array,size_t nbr_mbr,size_t size, + short (*compar)(const void *,const void *)); +See also: lfind,lsearch,qsort +@c3tol +c3tol (ANSI) Convert a three byte integer to a long integer +#include +long c3tol(const void *c); +See also: l3tol,ltoc3,ltol3 +@cabs +cabs (UNIX) Complex absolute value function +#include +double cabs(struct complex z); +@callcsi +callcsi (THEOS) See system +@calloc +calloc (ANSI) Allocate dynamic memory +#include +char *calloc(size_t count,size_t size); +See also: free,malloc,memset,realloc +@cclose +cclose (+THEOS) Close a serial communication file +#include +short cclose(FILE *port) +See also: ccloseall,cgetc,cputc,csetbuf,csetvbuf,getrxcnt,isrxempty,istxfull +@ccloseall +ccloseall (+THEOS) Close all serial communication files +#include +short ccloseall(void) +See also: cclose,cgetc,cputc,csetbuf,csetvbuf,getrxcnt,isrxempty,istxfull +@ceil +ceil (UNIX) Return the smallest integer greater than or equal to a value +#include +double ceil(double z); +See also: floor, round +@cgetc +cgetc (+THEOS) Read a character from a communication file +#include +short cgetc(FILE *port); +See also: cclose,ccloseall,cputc,csetbuf,csetvbuf,getrxcnt,isrxempty,istxfull +@cgets +cgets (ANSI) Accept a string from the console +#include +char *cgets(char *buffer,short len); +See also: getch,fgets,gets +@chdir +chdir (UNIX) Change the current directory +#include +short chdir(const char *path); +Set : errno,_errnum +See also: mkdir,rmdir +@chgrow +chrow (+THEOS) Set the grow factor of file +#include <_io.h> +short chgrow(char *fname,short grow); +See also: filechange +@chlen +chlen (+THEOS) Change the record length and key length of a file +#include <_io.h> +short chlen(char *fname,unsigned short reclen,unsigned short keylen); +@chmod +chmod (+UNIX) Change protections of a file +#include <_io.h> +short chmod(const char *fname,short prot); +@chorg +chorg (+THEOS) Change the organization mode of a file +#include <_io.h> +short chorg(char *fname,unsigned short filestat); +@chown +chown (+UNIX) Change the owner of a file +#include <_io.h> +short chown(const char *fname,short uid,short gid); +@clearerr +clearerr (ANSI) Clear the end-of-file and error status of a file +#include +clearerr(FILE *fp); +Set : _errnum +See also: feof,ferror +@cld +cld (THEOS) Clear direction flag +#include +void cld(void); +See also: std +@cli +cli (THEOS) Clear interrupt +#include +void cli(void); +See also: sti +@clock +clock (ANSI) Get number of clock ticks since system boot +#include +clock_t clock(void); +See also: time +@clock_t +clock_t (ANSI) Type used for the number of clock ticks since system boot +#include +typedef long clock_t; +@close +close (UNIX) Close a file +#include +short close(short fd); +See also: creat,filelength,flush,lseek,open,_read,read,tell,_write,write +@closedir +closedir (+UNIX) Close the directory search +#include +void closedir(DIR*); +See also: opendir,readdir,seekdir,telldir,rewinddir +Set : errno +@con_tran +con_tran (THEOS) Test and translate system control codes +#include +short con_tran(struct ucb *ucb,short ch,unsigned seg,void *buf); +@conmask +conmask (THEOS) Set the console control mask +#include +void conmask(const char *s); +@conin +conin (THEOS) Read character from console +See getch +@conout +conout (THEOS) Display character on the console +See putch +@conrdy +conrdy (THEOS) Test if characters are available on the console +short conrdy(void); +@cos +cos (ANSI) Calculate cosine +#include +double cos(double radian); +Set : errno +@cosh +cosh (ANSI) Calculate hyperbolic cosine +#include +double cosh(double radian); +@cot +cot (THEOS) Calculate cotangent +#include +double cot(double radian); +@coth +coth (THEOS) Calculate hyperbolic cotangent +#include +double coth(double radian); +@cprintf +cprintf (MSC) Format and print text to the console +#include +short cprintf(const char *format,...); +Note: Floating point conversions are not supported +See also: fprintf,printf,sprintf,vfprintf,vprintf,vsprintf +@cputc +cputc (+THEOS) Write a character to a communication file +#include +void cputc(FILE *port,short c); +See also: cclose,ccloseall,cgetc,csetbuf,csetvbuf,getrxcnt,isrxempty,istxfull +@cputs +cputs (ANSI) Write a string to the console +#include +void cputs(const char *s); +See also: cprintf,fputs,printf,putch,puts +@creat +creat (UNIX) Create/truncate a file +#include +short creat(const char *filename,short mode); +See also: close,filelength,flush,lseek,open,_read,read,tell,write,_write +@crt +crt (THEOS) See putchar +@crtcolor +crtcolor (THEOS) Change the colors of subsequent displays on the console +#include +void crtcolor(short fg,short bg,short rfg,short rbg); +See also: hascolor,CLASSGEN command +@csc +csc (THEOS) Calculate cosecant +#include +double csc(double radian); +@csch +csch (THEOS) Calculate hyperbolic cosecant +#include +double csch(double radian); +@csetbuf +csetbuf (+THEOS) Allocate an i/o buffer for a user buffered file +#include +void csetbuf(FILE *port,UBUFFER *buffer); +See also: cclose,ccloseall,cgetc,cputc,csetvbuf,getrxcnt,isrxempty,istxfull +@csetvbuf +csetvbuf (+THEOS) Allocate an i/o buffer for a user buffered file +#include +short csetvbuf(FILE *port,UBUFFER *buffer,short mode,size_t size); +See also: cclose,ccloseall,cgetc,cputc,csetbuf,getrxcnt,isrxempty,istxfull +@csi +csi (THEOS) Execute a CSI command without returning to the current program +#include +void csi(const char *command); +See also: system +@ctime +ctime (ANSI) Convert system time to an ASCII string +#include +char *ctime(const time_t *timep); +See also: asctime,localtime,mktime,strftime,time +@cuserid +cuserid (THEOS) Return the account name currently logged +#include +char *cuserid(char *account); +See also: getlogin,getuid,logname +@datehdng +datehdng (THEOS) Internal function used by testhead +@daylight +daylight (ANSI) Variable indicating if daylight time is used +#include +extern short daylight; +See also: timezone,tzset,tzname +@dec +dec (THEOS) Decrement a byte in another memory segment +#include +void dec(void *ofs,unsigned seg); +See also: Other dec functions +@deccs +deccs (THEOS) Decrement a byte in the code segment +#include +void deccs(void *ofs); +See also: Other dec functions +@deccsl +deccsl (THEOS) Decrement a long in the code segment +#include +void deccsl(void *ofs); +See also: Other dec functions +@deccsw +deccsw (THEOS) Decrement a word in the code segment +#include +void deccsw(void *ofs); +See also: Other dec functions +@decl +decl (THEOS) Decrement a long in another memory segment +#include +void decl(void *ofs,unsigned seg); +See also: Other dec functions +@decw +decw (THEOS) Decrement a word in another memory segment +#include +void decw(void *ofs,unsigned seg); +See also: Other dec functions +@define +#define (ANSI) Define a variable as manifest constant +#define constant value +@delay +delay (THEOS) Suspend operation for a given time +#include +void delay(unsigned code); +See also: alarm,msalarm,sleep +@deletek +deletek (THEOS) Delete a record from on indexed or keyed file +#include +short deletek(FILE *file,const char *key); +See also: readk,readn,readp,writek +@devname +devname (+THEOS) Return the name of a physical device +#include <_stdio.h> +char* devname(int lub); +See also: termname,ttyname,vdiname +@devopen +devopen (THEOS) Open or close a device +#include <_sc.h> +void devopen(struct ucb *ucb,short cmd); +cmd = 0 : open. cmd = 1 : close +@difftime +difftime (ANSI) Return difference between two times +#include +double difftime(time_t newtime,time_t oldtime); +@dir_mount +dir_mount (THEOS) ??? +#include <_sc.h> +void dir_mount(struct diskucb *ucb); +@dir_rd +dir_rd (THEOS) Read a sector in the directory +#include +void dir_rd(struct diskucb *ucb,long sect,void *buf); +@dirclose +dirclose (THEOS) Close the directory search +#include +void dirclose(void); +See also: diropen,dirread,find_first,find_next +@diropen +diropen (THEOS) Open the directory search for files in the current account +#include +short diropen(const char *fn); +Set : _errnum +See also: dirclose,dirread,find_first,find_next +@dirread +dirread (THEOS) Find the next file in the directory +#include +char *dirread(void); +See also: dirclose,diropen,find_first,find_next +@disk_capacity +disk_capacity (THEOS) ??? +#include <_sc.h> +short disk_capacity(short lub,void *disk_struct); +@display +display (THEOS) Display a string on the console +See cputs +@div +div (ANSI) Return the quotient and remainder of the division of two integers +#include +div_t div(short numer,short denomin); +See also: ldiv +@div_t +div_t (ANSI) Used by div +#include +typedef struct {short quot,rem;} div_t; +@dup +dup (UNIX) Duplicate a file descriptor +#include +short dup(short fd); +Set : errno +See also: close,creat,open +@elif +#elif (ANSI) Include code conditionally +#elif (expression); +@else +#else (ANSI) Include code conditionally +#else +@endif +#endif (ANSI) End conditional inclusion of code +#endif +@erase +erase (THEOS) Erase an existing file +See remove +@errbot +errbot (THEOS) Display a system message at the bottom of the console +#include +short errbot(short num,const char *arg[],short c1,short c2,short c3,short c4); +See also: errmsg,putmsg,syserr,yesno +@errmsg +errmsg (THEOS) Display a system message on stderr +#include +void errmsg(short num,const char *arg[]); +See also: errbot,perror,putmsg,strerror,syserr +@errno +errno (ANSI) External integer for return of error status +#include +extern short errno; +Functions setting errno: access,acos,acsc,asec,asin,atan2,atoi,atol,chdir,cos, +dup,erase,fgetc,fputc,fstat,locking,log,log10,log2,mkdir,open,perror,pow,remove, +rename,rmdir,signal,sin,sqrt,stat,unlink,utime +See also: _errnum,perror +@execl +execl (UNIX) Transfer control to a new program +#include +void execl(const char *program,const char *arg0,...,const char *argn,NULL) +See also: execlp,execv,execvp,forktask,system +@execlp +execlp (UNIX) Transfer control to a new program +#include +void execlp(const char *program,const char *arg0,...,const char *argn,NULL) +See also: execl,execv,execvp,forktask,system +@execv +execv (UNIX) Transfer control to a new program +#include +void execv(const char *program,const char *arg[]); +See also: execl,execlp,execvp,forktask,system +@execvp +execvp (UNIX) Transfer control to a new program +#include +void execvp(const char *program,const char *arg[]); +See also: execl,execlp,execv,forktask,system +@exit +exit (ANSI) Terminate a program +#include +void exit(short status); +See also: abort,atexit,csi +@exp +exp (ANSI) Compute exponential function +#include +double exp(double z); +@fabs +fabs (ANSI) Compute absolute value +#include +double fabs(double z); +@farcat +farcat (THEOS) Concatenate strings from different memory segments +#include +void *farcat(unsigned tseg,char *to,unsigned fseg,const char *from); +See also: strcat +@farchr +farchr (THEOS) Locate the first occurence of a byte in a string +#include +void *farchr(unsigned seg,const void *ofs,short c); +See also: memchr,strpbrk,strchr,strrchr,strstr +@farcmp +farcmp (THEOS) Compare two buffers in different memory segments +#include +short farcmp(unsigned seg1,const void *ofs1,unsigned seg2,const void *ofs2, + size_t len); +See also: fareq,memcmp,memeq,memicmp,strcmp,streq,stricmp,strncmp,strneq, + strnicmp +@farcpy +farcpy (THEOS) Copy one buffer to another buffer in another memory segment +#include +short farcpy(unsigned tseg,void *to,unsigned fseg,const void *from,size_t len); +See also: farcpy,memccpy,memcpy,memmove,memrcpy,strdup,strmake,strncpy +@fareq +fareq (THEOS) Compare two string in different memory segments for equality +#include +short fareq(unsigned seg1,const void *ofs1,unsigned seg2,const void *ofs2); +See also: farcmp,memcmp,memeq,memicmp,strcmp,streq,stricmp,strncmp,strneq, + strnicmp +@farlen +farlen (THEOS) Return the length of a string in another memory segment +#include +size_t farlen(unsigned seg,const char *ofs); +See also: strlen +@farset +farset (THEOS) Initialize a buffer in another memory segment +#include +void *farset(unsigned seg,void *ofs,short c,size_t len); +See also: memset,strnfill,strnset,strset +@fbuf +fbuf (THEOS) Allocate an i/o buffer for an open file +#include +void fbuf(FILE *stream,void *buffer,size_t len); +See also: setbuf,setvbuf,vbuf +@fclear +fclear (+THEOS) Clear a direct,indexed or keyed file +#include <_stdio.h> +short fclear(char *fname); +Set : _errnum +@fclose +fclose (ANSI) Close a file +#include +short fclose(FILE *fp); +Set : _errnum +See also: fcloseall,fflush,flushall +@fcloseall +fcloseall (MSC) Close all the open files +#include +short fcloseall(void); +See also: fclose,fflush,flushall +@fcntl +fcntl (UNIX) Access to file control bloc +#include +short fcntl(FILE *stream,short type,size_t value); +See also: feof,fgetpos,fopen,fsetpos,ftell +@fcreate +fcreate (THEOS) Create an indexed,keyed or direct file +#include +short fcreate(const char *fname,const char *mode,short rlen,short klen,long size); +Set : _errnum +See also: creat,fopen,makelib +@fdopen +fdopen (UNIX) Return a stream pointer to a file opened by open,creat or pipe +#include +FILE *fdopen(short fd,const char *type); +See also: creat,fileno,open,pipe +@feof +feof (ANSI) Determine if a file's current position is at end-of-file +#include +short feof(FILE *fp); +@ferror +ferror (ANSI) Test an open file for its error status +#include +short ferror(FILE *fp); +See also: clearerr,feof,file_err,fperror +@fflush +fflush (ANSI) Write any data in a file's output buffer to the file +#include +short fflush(FILE *fp); +See also: flushall,fclose +@fgetc +fgetc (ANSI) Read one character from a stream +#include +short fgetc(FILE *fp); +Set : errno +See also: fgets,getch,getchar +@fgetl +fgetl (THEOS) Read a long integer from a stream +#include +long fgetl(FILE *fp); +See also: fgetc,fgetw,fputc,fputl,fputw +@fgetpos +fgetpos (ANSI) Get a file's current position pointer +#include +short fgetpos(FILE *fp,fpos_t *pos); +See also: fsetpos,ftell +@fgets +fgets (ANSI) Read a string from a stream up to a new line +#include +char *fgets(char *s,size_t n,FILE *fp); +See also: fgetsn,gets,keyin +@fgetsn +fgetsn (THEOS) Read a buffer from a stream +#include +char *fgetsn(char *s,size_t n,FILE *fp); +See also: fgets,gets,keyin +@fgetw +fgetw (THEOS) Read an integer from a stream +#include +short fgetw(FILE *fp); +See also: fgetc,fgetl,fputc,fputl,fputw +@fgrow +fgrow (THEOS) Set the grow factor of file +#include +short fgrow(FILE *fp,short grow); +See also: filechange +@file_err +file_err (THEOS) Test an open file and exit if error +#include +void file_err(FILE *fp); +See also: clearerr,feof,ferror,fperror,syserr +@filechange +filechange (THEOS) Change a file's directory entry (date,owner,protection...) +#include +short filechange(const char *fn,short type,size_t value); +See also: access,fgrow,utime +@filelength +filelength (+MSC) Return the current filelength +#include <_io.h> +size_t filelength(short fd); +See also: close,creat,flush,lseek,open,_read,read,tell,_write,write +@filelock +filelock (THEOS) Lock a region in a file +#include +short filelock(FILE *fp,short code,unsigned long from,unsigned long to); +See also: locking,reclock,recunlock,unlock +@fileno +fileno (UNIX) Get the file number of a open file +#include +short fileno(FILE *fp); +@find_first +find_first (MSC) Find first entry matching selection in the directory +short find_first(char *mask,void *diskfind); +See also: dirclose,diropen,dirread,find_next +@find_next +find_next (MSC) Find next entry matching selection in the directory +#include <_sc.h> +short find_next(void *diskfind); +See also: dirclose,diropen,dirread,find_first +@floor +floor (ANSI) Return the largest integer less than or equal to a value +#include +double floor(double z); +See also: ceil, round +@flush +flush (THEOS) Write any data in a file's output buffer to the file +#include +short flush(short filenum); +See also: close,creat,filelength,lseek,open,_read,read,tell,_write,write +@flushall +flushall (THEOS) Flush all the files opened for output +#include +short flushall(void); +See also: fflush +@fmod +fmod (ANSI) Return the remainder of a division +#include +double fmod(double x,double y); +@fopen +fopen (ANSI) Open a file +#include +FILE *fopen(const char *name,const char *type); +Set : _errnum +See also: access,freopen +@force +force (THEOS) Force another process to execute a command +#include +void force(short pid,char *cmd); +@fork +fork (UNIX) Spawn a sub-task in a free partition +#include +short fork(void); +See also: forktask,killtask,suicide +@forktask +forktask (UNIX) Spawn a sub-task in a given partition +short forktask(short pid); +See also: fork,killtask,suicide +@formask +formask (THEOS) Display disk format parameters and query +#include +void formask(void); +See also: formclear,formincr,formparm +@formclear +formclear (THEOS) Clear the disk directory +void formclear(struct diskucb *ucb,char *label,short dirct,short trkct, + short hdct,short sectct,short density); +See also: formask,formincr,formparm +@formincr +formincr (THEOS) Set disk format sectors interleave table +void formincr(short incr,short sects,short *lacetable); +See also: formask,formclear,formparm +@formparm +formparm (THEOS) Sets disk format parameters from command line +void formparm(short argc,char **argv); +See also: formask,formclear,formincr +@fperror +fperror (THEOS) Display the system message pointed by _errnum on stderr +#include +short fperror(); +See also: errmsg,file_err,perror,syserr +@fpos_t +fpos_t (ANSI) Used to represent the position in a file +#include +typedef long fpos_t; +@fprintf +fprintf (ANSI) Print formatted output to a stream +#include +short fprintf(FILE *fp,const char *format,...); +See also: cprintf,printf,sprintf,vfprintf,vprintf,vsprintf +@fputc +fputc (ANSI) Write a character to a stream +#include +short fputc(char c,FILE *fp); +Set : errno +See also: putc,putchar +@fputl +fputl (THEOS) Write a character to a stream +#include +long fputl(long l,FILE *fp); +See also: fgetc,fgetl,fgetw,fputc,fputw +@fputs +fputs (ANSI) Write a string to a stream +#include +short fputs(const char *string,FILE *fp); +See also: fputsn,fputsnl,puts +@fputsn +fputsn (THEOS) Write a buffer to a stream +#include +char *fputsn(const char *string,FILE *fp); +See also: fputs,fputsnl,puts +@fputsnl +fputsnl (ANSI) Write a buffer to a stream and append a newline +#include +short fputsnl(const char *string,FILE *fp); +See also: fputs,fputsn,puts +@fputw +fputw (THEOS) Write an integer to a stream +#include +short fputw(short word,FILE *fp); +@fread +fread (ANSI) Read data from file stream +#include +short fread(void *buffer,size_t size,size_t nitems,FILE *fp); +See also: fgets,fgetsn,fgetc,fgetl,fgetw +@free +free (ANSI) Return dynamic memory to free memory pool +#include +void free(void *ptr); +See also: calloc,malloc,realloc +@free_sel +free_sel (THEOS) Release a memory selector +#include +void free_sel(short sel); +See also: make_sel +@freopen +freopen (ANSI) Open a stream using an existing file stream pointer +#include +FILE *freopen(const char *filename,const char *type,FILE *fp); +See also: access,fdopen,fopen +@frexp +frexp (ANSI) Break a floating point into mantissa and exponent power of two +#include +double frexp(double x,short *ep); +See also: ldexp +@fscanf +fscanf (ANSI) Format input from a file stream +#include +short fscanf(FILE *fp,const char *format,...); +See also: scanf,sscanf +@fseek +fseek (ANSI) Change a stream position pointer +#include +short fseek(FILE *fp,fpos_t pos,short base); +See also: fsetpos,rewind,seek +@fsetpos +fsetpos (ANSI) Change a stream position pointer +#include +short fsetpos(FILE *fp,fpos_t pos); +See also: fseek,rewind,seek +@fsign +fsign (THEOS) Return the sign of a floating point value +#include +short fsign(double x); +@ftell +ftell (ANSI) Return current position of stream pointer +#include +long ftell(FILE *fp); +See also: fgetpos +@ftoa +ftoa (THEOS) Convert a floating point value to a string +#include +char *ftoa(char *s,double f); +See also: itoa,ltoa,utoa +@fwrite +fwrite (ANSI) Write data to a stream +#include +short fwrite(const void *buffer,size_t size,size_t n,FILE *fp); +See also: fputc,fputl,fputs,fputsn,fputsnl,fputw,putch +@gcd +gcd (THEOS) Return the greatest common divisor of two values +#include +double gcd(double x,double y); +@get_line +get_line (THEOS) Accept an edited line from the standard input +#include +char *get_line(char *line); +See also: gets +@get_sect +get_sect (THEOS) ??? +#include +struct fdb *get_sect(char *fn,char *buf,long *sect); +@getar +getar (THEOS) Internal function used by malloc +@getbp +getbp (THEOS) Return the value of the BP register +#include +void *getbp(void); +See also: getcs,getcsa,getds,getldt,gettib +@getc +getc (ANSI) Read a character from a stream +See fgetc +@getch +getch (MSC) Read a character from the console +#include +short getch(void); +See also: getc,getchar +@getchar +getchar (ANSI) Read character from the standard input +#include +short getchar(void); +See also: getc,getch +@getclass +getclass (THEOS) Return the console or printer class code +#include +short getclass(short lub); +@getcs +getcs (THEOS) Return the value of the CS register +#include +unsigned getcs(void); +See also: getbp,getcsa,getds,getldt,gettib +@getcsa +getcsa (THEOS) Return the value of the CS register +#include +unsigned getcsa(void); +See also: getbp,getcs,getds,getldt,gettib +@getcwd +getcwd (UNIX) Return the current directory name +#include +char *getcwd(char *s,size_t len); +@getdate +getdate (THEOS) Return the current system date +#include +char *getdate(char *buffer) +See also: gettime,time +@getdev +getdev (THEOS) Return the device or lub number of an open file +#include +short getdev(FILE *fp); +@getdevn +getdevn (+THEOS) Return the device or lub number of a device name +#include <_stdlib.h> +short getdevn(char *name); +@getds +getds (THEOS) Return the value of the DS register +#include +unsigned getds(void); +See also: getbp,getcs,getcsa,getldt,gettib +@getenv +getenv (ANSI) Read environmental variable +#include +char *getenv(const char *variable); +See also: getcwd,getlang,getlib,putenv +@getenvle +getenvle (THEOS) Internal function used by putenv +@getflag +getflag (THEOS) Get processor flag register +#include +long getflag(void); +@getfn +getfn (THEOS) Return the full pathname of a file +#include +char *getfn(char *fn); +See also: locate +@getkey +getkey (THEOS) Get a system keyword token +#include +short getkey(short keynum,char *s); +See also: keyclose,matcharg +@getlang +getlang (THEOS) Return the current language code for the partition +#include +short getlang(void); +See also: getenv +@getldt +getldt (THEOS) Return the Local Descriptor Table selector +#include +unsigned getldt(void); +See also: getbp,getcs,getcsa,getds,gettib +@getlib +getlib (THEOS) Return the default library name for the partition +#include +char *getlib(void); +See also: getcwd,getenv +@getlimit +getlimit (THEOS) Return the maximum address of a memory segment +#include +size_t getlimit(unsigned seg); +See also: getmem +@getll +getll (THEOS) Return the line length of the console or a printer +#include +short getll(short lub); +See also: getpl +@getlogin +getlogin (UNIX) Return the name of the account currently logged +#include +char *getlogin(void); +See also: cuserid,getuid,logname +@getlub +getlub (THEOS) Return the ucb number associated with a logical device +#include +short getlub(short lub); +See also: getucb +@getmem +getmem (THEOS) Allocate memory from the system pool +#include +unsigned getmem(size_t size,short table); +See also: calloc,malloc,putmem,shared +@getmsec +getmsec (THEOS) Return the current time of day to the nearest millisecond +#include +char *getmsec(char *s); +See also: gettime,ctime,time +@getmsg +getmsg (THEOS) Return a system message +#include +char *getmsg(short num); +Set : _errnum +See also: errbot,errmsg,putmsg,strerror,syserr +@getmsw +getmsw (THEOS) Get Machine Status Word +#include +long getmsw(void); +@getpid +getpid (UNIX) Return the process number +#include +short getpid(void); +See also: getppid +@getpl +getpl (THEOS) Return the page length of the console or a printer +#include +short getpl(short lub); +See also: getll +@getppid +getppid (UNIX) Return the parent partition number +#include +short getppid(void); +See also: getpid +@getpriv +getpriv (THEOS) Return the privilege level +#include +short getpriv(void); +@getprty +getprty (+THEOS) Return task priority +#include <_stdlib.h> +short getprty(); +See also: setprty +@getrxcnt +getrxcnt (+THEOS) Return the number of characters in the input buffer +#include +short getrxcnt(FILE *port); +See also: cclose,ccloseall,cgetc,cputc,csetbuf,csetvbuf,isrxempty,istxfull +@gets +gets (ANSI) Read string from the standard input +#include +char *gets(char *buffer); +See also: fgets,fgetsn,get_line,keyin +@gettib +gettib (THEOS) Return the Task Information Block selector +#include +unsigned gettib(void); +See also: getbp,getcs,getcsa,getds,getldt,tib +@gettime +gettime (THEOS) Return the current system time +#include +char *gettime(char *buffer); +See also: getdate,time +@getucb +getucb (THEOS) Return the address of the UCB associated with an attached device +#include +struct ucb *getucb(short lub); +See also: getlub +@getuid +getuid (UNIX) Return the number of the account currently logged +#include +short getuid(void); +See also: getlogin +@getver +getver (THEOS) Return the version number,name,serial number +#include +void getver(short code,char *str); +See also: getenv +@getvol +getvol (THEOS) Return a disk or tape volume label +#include +char *getvol(short lub); +@getw +getw (ANSI) Read a word from a file stream +See fgetw +@gmtime +gmtime (ANSI) Convert system time to calendar structure in GMT time +#include +struct tm *gmtime(const time_t *timep); +See also: asctime,ctime,localtime,mktime,strftime,time +@has +has (THEOS) Test if the console can display a character or an attribute +#include +short has(short c); +See also: hascolor +@hascolor +hascolor (THEOS) Test if the console can display colors +#include +short hascolor(void); +See also: crtcolor,has +@hasmouse +hasmouse (+THEOS) Test if a session mouse is available +#include +int hasmouse(void); +See also: mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@hypot +hypot (UNIX) Compute the length of the hypotenuse of a right triangle +#include +double hypot(double x,double y); +@i2tol +i2tol (THEOS) Convert two integers to a long integer +long i2tol(short i[2]); +Note: Not implemented in THEOS 386 C. +@ieee2bcd +ieee2bcd (THEOS) Convert an ieee floating point to bcd floating point +#include +void ieee2bcd(double *data) +See also: bcd2ieee +@if +#if (ANSI) Include code conditionally +#if (expression); +@ifdef +#ifdef (ANSI) Include code conditionally +#ifdef identifier +@ifndef +#ifndef (ANSI) Include code conditionally +#ifndef identifier +@inb +inb (THEOS) Read a byte from a i/o port +#include +unsigned inb(unsigned port); +See also: ind,insb,insd,insw,inw +@include +#include (ANSI) Copy a header file into a program +#include +#include "file.h" +@ind +ind (THEOS) Read a long from a i/o port +#include +unsigned long ind(unsigned port); +See also: inb,insb,insd,insw,inw +@insb +insb (THEOS) Read bytes from a i/o port +#include +void insb(unsigned port,unsigned seg,void *offset,size_t len); +See also: inb,ind,insd,insw,inw +@interrupt +interrupt (THEOS) Interrupt function declarator +void interrupt isr(void); +@insd +insd (THEOS) Read longs from a i/o port +#include +void insd(unsigned port,unsigned seg,void *offset,size_t len); +See also: inb,ind,insb,insw,inw +@insw +insw (THEOS) Read words from a i/o port +#include +void insw(unsigned port,unsigned seg,void *offset,size_t len); +See also: inb,ind,insb,insd,inw +@inw +inw (THEOS) Read a word on a i/o port +#include +unsigned inw(unsigned port); +See also: ind,insb,insd,insw,inw +@ioctl +ioctl (UNIX) Perform extended I/O control on devices +#include +short ioctl(FILE *fp,struct bytecntl *action); +short ioctl(FILE *fp,struct diskcntl *action); +short ioctl(FILE *fp,struct tapecntl *action); +@ip +ip (THEOS) Return the integral part of a value +#include +double ip(double x); +See also: modf +@inc +inc (THEOS) Increment a byte in another memory segment +#include +void inc(void *ofs,unsigned seg); +See also: Other inc functions +@inccs +inccs (THEOS) Increment a byte in the code segment +#include +void inccs(void *ofs); +See also: Other inc functions +@inccsl +inccsl (THEOS) Increment a long in the code segment +#include +void inccsl(void *ofs); +See also: Other inc functions +@inccsw +inccsw (THEOS) Increment a word in the code segment +#include +void inccsw(void *ofs); +See also: Other inc functions +@incl +incl (THEOS) Increment a long in another memory segment +#include +void incl(void *ofs,unsigned seg); +See also: Other inc functions +@incw +incw (THEOS) Increment a word in another memory segment +#include +void incw(void *ofs,unsigned seg); +See also: Other inc functions +@isalnum +isalnum (ANSI) Check if a character is a number or letter +#include +short isalnum(short c); +See also: setlocale +@isalpha +isalpha (ANSI) Check if a character is a letter +#include +short isalpha(short c); +See also: setlocale +@isascii +isascii (UNIX) Check if a character is an ASCII character +#include +short isascii(short c); +See also: setlocale +@isatty +isatty (UNIX) Check if an open file is a serial communication device +#include +short isatty(FILE *stream); +@iscntrl +iscntrl (ANSI) Check if a character is a control character +#include +short iscntrl(short c); +@iscomname +iscomname (+THEOS) Test if a file name is a valid com port name +#include <_stdlib.h> +short iscomname(char *filename); +@iscon +iscon (THEOS) Check if an open file is the console +#include +short iscon(FILE *stream); +@iscsym +iscsym (THEOS) Test if a character is alphabetic or an underscore +#include +short iscsym(short c); +See also: iscsymnum +@iscsymnum +iscsymnum (THEOS) Test if a character is alphanumeric or an underscore +#include +short iscsymnum(short c); +See also: iscsym +@isdigit +isdigit (ANSI) Check if a character is a decimal diqit +#include +short isdigit(short c); +@isdisp +isdisp (THEOS) Check if a character is displayable by most terminal +#include +short isdisp(short c); +See also: isgraph,isprint +@isfnsym +isfnsym (THEOS) Check if a character is valid for a file name +#include +short isfnsym(short c); +See also: issymbol,issymnum +@isgraph +isgraph (ANSI) Check if a character is visible when printed +#include +short isgraph(short c); +See also: setlocale +@ishex +ishex (THEOS) Check if a character is a hexadecimal digit +#include +short ishex(short c); +See also: isxdigit +@isinter +isinter (+THEOS) Check if a character is an international character +#include +short isinter(short c); +See also: isalpha +@islower +islower (ANSI) Check if a character is a lower-case letter +#include +short islower(short c); +See also: setlocale +@isoctal +isoctal (THEOS) Check if a character is an octal digit +#include +short isoctal(short c); +@isprint +isprint (ANSI) Check if a character is visible or is a space +#include +short isprint(short c); +See also: setlocale +@isprtname +isprtname (+THEOS) Test if a file name is a valid printer name +#include <_stdlib.h> +short isprtname(char *filename); +@ispunct +ispunct (ANSI) Check if a character is a punctuation mark +#include +short ispunct(short c); +See also: setlocale +@isrxempty +isrxempty (+THEOS) Test if an input buffer is empty +#include +short isrxempty(FILE *port); +See also: cclose,ccloseall,cgetc,cputc,csetbuf,csetvbuf,getrxcnt,istxfull +@issesdev +issesdev (+THEOS) Test if a device is session capable +#include <_stdlib.h> +short issesdev(FILE *fp); +@isspace +isspace (ANSI) Check if a character prints white space +#include +short isspace(short c); +@issymbol +issymbol (THEOS) Check if a character is a valid first character for a file name +#include +short issymbol(short c); +See also: issymnum +@issymnum +issymnum (THEOS) Check if a character is a valid character for a symbol +#include +short issymnum(short c); +See also: issymbol +@istapname +istapname (+THEOS) Test if a file name is a valid tape name +#include <_stdlib.h> +short istapname(char *filename); +@istxfull +istxfull (+THEOS) Test if an input buffer is empty +#include +short istxfull(FILE *port); +See also: cclose,ccloseall,cgetc,cputc,csetbuf,csetvbuf,getrxcnt,istxfull +@isupper +isupper (ANSI) Check if a character is an upper-case letter +#include +short isupper(short c); +See also: setlocale +@isv86 +isv86 (THEOS) Test if a process is running in Virtual 86 mode +short isv86(short pid); +@isxdigit +isxdigit (ANSI) Check if a charcter is an hexadecimal digit +#include +short isxdigit(short c); +See also: ishex +@itoa +itoa (THEOS) Convert an integer into an ASCII string +#include +char *itoa(char *s,short i); +See also: ftoa,ltoa,utoa +@keyclose +keyclose (THEOS) Close the keyword file used with getkey +#include +void keyclose(void); +See also: getkey,testarg +@keyin +keyin (THEOS) See cgets +@killtask +killtask (THEOS) Kill a subtask +#include +void killtask(short pid); +See also: fork,forktask,suicide +@l3tol +l3tol (UNIX) Convert three bytes integers to longs integers +#include +void l3tol(long *l,const char *c,short cnt); +See also: c3tol,ltoc3,ltol3 +@l64a +l64a (UNIX) Convert a long integer to a base-64 ASCII string +#include +char *l64a(long x); +See also: a64l +@labs +labs (ANSI) Return the absolute value of an long integer +#include +long labs(long l); +See also: abs,fabs +@ldeletek +ldeletek (THEOS) Delete a record from a direct access file +#include +short ldeletek(FILE *fp,const long *key); +See also: lreadk,lreadn,lwritek +@ldexp +ldexp (ANSI) Combine fraction and exponent +#include +double ldexp(double x,short exp); +See also: frexp +@ldiv +ldiv (ANSI) Return the quotient and remainder of the division of two longs +#include +ldiv_t ldiv(long numer,long denom) +@ldiv_t +ldiv_t (ANSI) used by ldiv +#include +typedef struct {long quot,rem;} ldiv_t; +See also: div +@leapyear +leapyear (THEOS) Indicate if a year is a leap year +#include +short leapyear(short year); +See also: _monthen,_yday +@lfind +lfind (MSC) Perform a linear search of an array +#include +void *lfind(const void *key,const void *array,size_t nbr_mbr,size_t size, + short (*compar)(const void *,const void *)); +See also: bsearch,lsearch,qsort +@line +#line (ANSI) Reset line numbering +#line number +#line number filename +@linput +linput (+THEOS) Accept a data field from the keyboard like BASIC LINPUT +#include <_stdlib.h> +short linput(char *case,char *before_msg,char *after_msg,char *input_var, + char *output_var,short length,short timeout,short timeout_key); +@load +load (THEOS) Load a program into memory +#include +unsigned load(const char *program,short type); +See also: unload +@load_yn +load_yn (THEOS) Initialise the yesno function +#include +void load_yn(void); +See also: yesno +@loc1 +loc1 (THEOS) Reserved variable for regex +#include +extern char *loc1; +@localtime +localtime (ANSI) Convert system time to calendar structure +#include +struct tm *localtime(time_t *timep); +See also: asctime,ctime,gmtime,mktime,strftime,time +@locate +locate (THEOS) Find a file on disk and return a copy of its FDB +#include +struct fdb *locate(const char *filename,char *buf,short *lub); +See also: getfn +@lock_time +lock_time (THEOS) Set the maximum lock time wait +#include <_stdlib.h> +void lock_time(unsigned char seconds); +See also: timeout +@locking +locking (MSC) Lock or unlock a record in a file +#include +short locking(FILE *fp,short mode,long size); +Set : errno +See also: filelock,reclock,recunlock,unlock +@lockres +lockres (THEOS) "Unlock" a byte in memory +#include +void lockres(void *ofs,unsigned seg); +See also: lockset +@lockset +lockset (THEOS) "Lock" a byte in memory +#include +void lockset(void *ofs,unsigned seg); +See also: lockres +@log +log (ANSI) Compute natural logarithm +#include +double log(double z); +Set : errno +See also: log10,log2 +@log10 +log10 (ANSI) Compute common logarithm +#include +double log10(double z); +Set : errno +See also: log,log2 +@log2 +log2 (THEOS) Compute base 2 logarithm +#include +double log2(double z); +Set : errno +See also: log,log10 +@logname +logname (UNIX) Return the account name currently logged +#include +char *logname(void); +See also: cuserid,getlogin,getuid +@longjmp +longjmp (ANSI) Return from a non-local goto +#include +short longjmp(jmp_buf env,short rval); +See also: setjmp +@lowcase +lowcase (THEOS) See strlwr +@lprime +lprime (+THEOS) Compute the smallest prime greater than or equal to a number +#include <_stdlib.h> +unsigned long lprime(unsigned long n); +See also: prime +@lreadk +lreadk (THEOS) Read a record from a direct access file +#include +short lreadk(FILE *fp,const long *key,void *rec); +See also: ldeletek,lreadn,lwritek +@lreadn +lreadn (THEOS) Read the next record from a direct access file +#include +short lreadn(FILE *fp,long *key,void *rec); +See also: ldeletek,lreadk,lwritek +@lsearch +lsearch (UNIX) Perform a linear search of an array,insert key if non existent +#include +void *lsearch(const void *key,const void *array,size_t nbr_mbr,size_t size, + short (*compar)(const void *,const void *)); +See also: bsearch,lfind,qsort +@lseek +lseek (UNIX) Set read/write position +#include +long lseek(short fd,short how,long where); +See also: close,creat,filelength,flush,open,_read,read,tell,_write,write +@ltoa +ltoa (THEOS) Convert an long integer into an ASCII string +#include +char *ltoa(char *s,short l); +See also: ftoa,itoa,utoa +@ltoc3 +ltoc3 (THEOS) Convert a long integer to a three byte integer +#include +long ltoc3(void *c,long l); +See also: c3tol,l3tol,ltol3 +@ltol3 +ltol3 (UNIX) Convert long integers to three byte integers +#include +long ltol3(void *c,const long *l,short cnt); +See also: c3tol,l3tol,ltoc3 +@lwritek +lwritek (THEOS) Write a record to a direct access file +#include +short lwritek(FILE *fp,const long *key,const void *rec); +See also: ldeletek,lreadk,lreadn +@make_sel +make_sel (THEOS) Create a memory selector +#include +void make_sel(short sel,size_t limit,unsigned long base,short int); +See also: free_sel +@makelib +makelib (THEOS) Create a library file +#include +unsigned makelib(const char *filename,short size); +See also: fcreate +@malloc +malloc (ANSI) Allocate dynamic memory +#include +char *malloc(size_t size); +@match +match (THEOS) Compare a string against a format mask +#include +short match(const char *string,const char *mask); +See also: strcmp,streq +@mapdoskey +mapdoskey (+THEOS) Convert THEOS keycodes to PC keycodes +#include +#include +unsigned short mapdoskey(unsigned short key); +See also: _bios_keybrd +@matcharg +matcharg (THEOS) Compare one string with another with abbreviation capability +#include +short matcharg(const char *string,const char *keyword,short min); +See also: strcmp,streq,strncmp,testarg +@max +max (UNIX) Return the larger of two integers +#include +short max(short a,short b); +@max_alloc +max_alloc (THEOS) Return the size of the larger memory bloc available +#include +size_t max_alloc(void); +See also: calloc,free,malloc,realloc,tot_alloc +@mem_grow +mem_grow (THEOS) ??? +#include +short mem_grow(short seg,long adjust); +@mem_ovly +mem_ovly (THEOS) Adjust the size of the data used by the program +#include +void mem_ovly(size_t size); +@memccpy +memccpy (UNIX) Copy a buffer into another for 'n' bytes or up to a character +#include +void *memcpy(void *to,const void *from,short c,size_t len); +See also: farcpy,memcpy,memmove,memrcpy,strcpy,strdup,strmake,strncpy +@memchr +memchr (ANSI) Locate the first occurrence of a byte in a buffer +#include +void *memchr(const void *buffer,unsigned character,size_t len); +See also: farchr,strpbrk,strchr,strrchr,strstr +@memcmp +memcmp (ANSI) Compare two buffers +#include +short memcmp(const void *buf1,const void *buf2,size_t len); +See also: farcmp,fareq,memeq,memicmp,strcmp,streq,stricmp,strncmp,strneq, + strnicmp +@memcpy +memcpy (ANSI) Copy one buffer into another +#include +void *memcpy(void *to,const void *from,size_t len); +See also: farcpy,memccpy,memmove,memrcpy,strcpy,strdup,strmake,strncpy +@memeq +memeq (THEOS) Compare two buffers for equality +#include +short memeq(const void *buf1,const void *buf2,size_t len); +See also: farcmp,fareq,memcmp,memicmp,strcmp,streq,stricmp,strncmp,strnicmp, + strneq +@memicmp +memicmp (MSC) Compare two buffers,ignoring the casemode of the characters +#include +short memicmp(const void *buf1,const void *buf2,size_t len); +See also: farcmp,fareq,memcmp,memeq,strcmp,streq,stricmp,strncmp,strneq,strnicmp +@memmove +memmove (ANSI) Copy one buffer into another with correct handling of overlapping +void *memmove(void *to,const void *from,size_t len); +See also: farcpy,memcpy,memccpy,memrcpy,strcpy,strdup,strmake,strncpy +@memrcpy +memrcpy (THEOS) Copy one buffer into another in reverse sequence +#include +void *memrcpy(void *to,const void *from,size_t len); +See also: farcpy,memcpy,memccpy,memmove,strcpy,strdup,strmake,strncpy +@memset +memset (ANSI) Fill a buffer with a character +#include +void *memset(char *buffer,short character,size_t len); +See also: farset,strnfill,strset,strnset +@menu +menu (THEOS) Display a menu and wait for a selection +#include +short menu(const char **menu,short count); +See also: menu2 +@menu2 +menu2 (THEOS) Display a menu and wait for a selection +#include +short menu2(const char **menu,short count,short start,short display); +See also: menu +@menumsg +menumsg (+THEOS) Display a menu line a wait for a selection +#include <_stdlib.h> +short menumsg(char *msg,char *key,short timeout,short timeout_key); +@min +min (UNIX) Return the smaller of two integers +#include +short min(short a,short b); +@mkdir +mkdir (MSC) Create a directory +#include +short mkdir(const char *filename); +Set : errno,_errnum +See also: chdir,rmdir +@mktemp +mktemp (UNIX) Generate a temporary file name +#include +char *mktemp(const char *template); +See also: tmpnam,tmpfile,tmpnam +@mktime +mktime (MSC) Convert a time structure into a calendar time +#include +time_t mktime(struct tm *timeptr) +See also: asctime,ctime,gmtime,localtime,strftime,time +@modf +modf (ANSI) Separate integral and fractional part +#include +double modf(double x,double *ip); +See also: ip +@mouse +mouse (+THEOS) Compute mouse position and buttons for subsequent use +#include +short mouse(void); +See also: hasmouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@mousebutton +mousebutton (+THEOS) Return mouse buttons state +#include +short mousebutton(void); +See also: hasmouse, mouse, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@mouseclick +mouseclick (+THEOS) Set mouse click and dclick delay +#include +void mouseclick(long click); +See also: hasmouse, mouse, mousebutton, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@mousedisable +mousedisable (+THEOS) Disable the mouse +#include +void mousedisable(void); +See also: hasmouse, mouse, mousebutton, mouseclick, mouseenable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@mouseenable +mouseenable (+THEOS) Initialise and enable the mouse +#include +void mouseenable(void); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@mousemove +mousemove (+THEOS) Move the mouse pointer +#include +void mousemove(short col, short row); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousescale, mouseswap, mousetell, mousexy +@mousescale +mousescale (+THEOS) Set mouse sensitivity +#include +void mousescale(short scale); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mouseswap, mousetell, mousexy +@mouseswap +mouseswap (+THEOS) Swap mouse left and right buttons +#include +void mouseswap(short flag); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mousetell, mousexy +@mousetell +mousetell (+THEOS) Read mouse swap flag and sensitivity +#include +void mousetell(long *click, short *scale); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousexy +@mousexy +mousexy (+THEOS) Read mouse position +#include +void mousexy(short *col, short *row); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousetell +@move +move (THEOS) Copy one buffer to another buffer in another memory segment +Obsolete function,use farcpy +@msalarm +msalarm (THEOS) Start a timer in milli seconds generating a signal interrupt +#include +long msalarm(long msecs); +See also: delay,alarm,signal +@msgclose +msgclose (THEOS) Close the system message file +#include +void msgclose(void); +See also: getmsg +@no_val +no_val (THEOS) Value of no answer +extern char yes_val; +@NULL +NULL (ANSI) Nul pointer type +#include +#define NULL ((void *)0) +@offsetof +offsetof (ANSI) Offset between the beginning of a structure and a member +#include +offsetof(nom_de_structure,nom_de_membre) +@open +open (UNIX) Open a file +#include +short open(const char *filename,short type,...); +Set : errno,_errnum +See also: close,creat,filelength,flush,lseek,_read,read,tell,_write,write +@opendir +opendir (+UNIX) Open a directory +#include +DIR* opendir(const char* fname); +See also: readdir,closedir,seekdir,telldir,rewinddir +Set : errno +@openhelp +openhelp (THEOS) Open the help file for a program +#include +FILE *openhelp(const char *name); +See also: fopen +@openmenu +openmenu (THEOS) Open the menu file for a program +#include +FILE *openmenu(const char *name); +See also: fopen +@orb +orb (THEOS) Or a byte in another memory segment +#include +void orb(void *ofs,unsigned seg,char mask); +See also: Other or functions +@orcs +orcs (THEOS) Or a byte in the code segment +#include +void orcs(void *ofs,char mask); +See also: Other or functions +@orl +orl (THEOS) Or a long in another memory segment +#include +void orl(void *ofs,unsigned seg,long mask); +See also: Other or functions +@orlcs +orlcs (THEOS) Or a long in the code segment +#include +void orlcs(void *ofs,long mask); +See also: Other or functions +@orw +orw (THEOS) Or a word in another memory segment +#include +void orw(void *ofs,unsigned seg,short mask); +See also: Other or functions +@orwcs +orwcs (THEOS) Or a word in the code segment +#include +void orwcs(void *ofs,short mask); +See also: Other or functions +@outb +outb (THEOS) Write a byte into an i/o port +#include +void outb(unsigned port,char byte); +See also: outd,outsb,outsd,outsw,outw +@outd +outd (THEOS) Write a long into an i/o port +#include +void outd(unsigned port,unsigned long dword); +See also: outb,outsb,outsd,outsw,outw +@outsb +outsb (THEOS) Write bytes into an i/o port +#include +void outsb(unsigned port,unsigned seg,void *offset,size_t len); +See also: outb,outd,outsd,outsw,outw +@outsd +outsd (THEOS) Write longs into an i/o port +#include +void outsd(unsigned port,unsigned seg,void *offset,size_t len); +See also: outb,outd,outsb,outsw,outw +@outsw +outsw (THEOS) Write words into an i/o port +#include +void outsw(unsigned port,unsigned seg,void *offset,size_t len); +See also: outb,outd,outsb,outsd,outw +@outw +outw (THEOS) Write a word into an i/o port +#include +void outw(unsigned port,unsigned word); +See also: outb,outd,outsb,outsd,outsw +@pagewait +pagewait (THEOS) Display the wait prompt and wait the a key +#include +short pagewait(void); +See also: getpl +@pause +pause (THEOS) Wait a state change on ii/o port 61 +void pause(char count); +@pcbsc +pcbsc (THEOS) Read or write char or words in the PCB of any process +#include <_sc.h> +long pcbsc(short type,void *ofs,void *arg); +Le premier PCB commence en PCBSTART,les PCB suivant sont cons�cutifs. Le +dernier PCB est suivi par un entier � 0xFFFF. Tout acc�s � une adresse plus +�lev�e entraine un TRAP #13. + +type = 1 : lit un octet type = 2 : lit un mot de 16 bits +type = 0x8001 : �crit un octet type = 0x8002 : �crit un mot de 16 bits + +ofs pointe � l'int�rieur de la table des PCB +arg valeur � �crire si type = 0x8001 ou 0x8002 + +Lecture de l'�tat du PID 0 : status = pcbsc(1,PCBSTART,(void *) 0); +Lecture de la version de l'OS : ver = pcbsc(-1,-1,-1); +@peek +peek (THEOS) Return a byte from another memory segment +#include +unsigned peek(const void *ofs,unsigned seg); +See also: Other peek functions +@peekchar +peekchar (THEOS) ??? +#include <_sc.h> +void peekchar(short pid,short type); +@peekcs +peekcs (THEOS) Return a byte from the code segment +#include +unsigned peekcs(const void *ofs); +See also: Other peek functions +@peekfsa +peekfsa (THEOS) ??? +#include <_sc.h> +short peekfsa(void *ofs); +@peekl +peekl (THEOS) Return a long from another memory segment +#include +unsigned long peekl(const void *ofs,unsigned seg); +See also: Other peek functions +@peeklcs +peeklcs (THEOS) Return a long from the code segment +#include +unsigned long peeklcs(const void *ofs); +See also: Other peek functions +@peeklnuc +peeklnuc (THEOS) Return a long from the nucleus segment +#include +unsigned long peeklnuc(const void *ofs); +See also: Other peek functions +@peeklscr +peeklscr (THEOS) Return a long from the SCR segment +#include +unsigned long peeklscr(const void *ofs); +See also: Other peek functions +@peeknuc +peeknuc (THEOS) Return a byte from the nucleus segment +#include +unsigned peeknuc(const void *ofs); +See also: Other peek functions +@peekp +peekp (THEOS) Return a pointer from another memory segment +#include +void *peekp(const void *ofs,unsigned seg); +See also: Other peek functions +@peekpcs +peekpcs (THEOS) Return a pointer from the code segment +#include +void *peekpcs(const void *ofs); +See also: Other peek functions +@peekpnuc +peekpnuc (THEOS) Return a pointer from the nucleus segment +#include +void *peekpnuc(const void *ofs); +See also: Other peek functions +@peekpscr +peekpscr (THEOS) Return a pointer from the SCR segment +#include +void *peekpscr(const void *ofs); +See also: Other peek functions +@peekscr +peekscr (THEOS) Return a byte from the SCR segment +#include +unsigned peekscr(const void *ofs); +See also: Other peek functions +@peektib +peektib (THEOS) Get bytes in the TIB or RCR of any process +#include <_sc.h> +long peektib(short pid,void *ofs); +L'adressage du scr peut �tre indiqu� en ajoutant 0x8000 � l'offset +dans le scr. Ainsi : +peektib(pid,0x8000) �quivaut � peektib(pid,&TIB->scr.logonname[0]) +@peekw +peekw (THEOS) Return a word from another memory segment +#include +unsigned peekw(const void *ofs,unsigned seg); +See also: Other peek functions +@peekwcs +peekwcs (THEOS) Return a word from the code segment +#include +unsigned peekwcs(const void *ofs); +See also: Other peek functions +@peekwnuc +peekwnuc (THEOS) Return a word from the nucleus segment +#include +unsigned peekwnuc(const void *ofs); +See also: Other peek functions +@peekwscr +peekwscr (THEOS) Return a word from the SCR segment +#include +unsigned peekwscr(const void *ofs); +See also: Other peek functions +@perror +perror (ANSI) Display a program defined message with a message pointed by errno +#include +void perror(const char *string); +Set : errno +See also: errmsg,fperror,getmsg,strerror,syserr +@phy_addr +phy_addr (THEOS) Determine physical address of memory selector,lock and unlock +#include +unsigned long phy_addr(unsigned seg,void *offset,size_t len); +See also: getmem,putmem +@pipe +pipe (UNIX) Open an interprocess i/o channel +#include +short pipe(short filenum[2]); +See also: popen +@poke +poke (THEOS) Put a byte into another memory segment +#include +void poke(char val,void *ofs,unsigned seg); +See also: Other poke functions +@pokecs +pokecs (THEOS) Put a byte into the code segment +#include +void pokecs(char val,void *ofs); +See also: Other poke functions +@pokecsa +pokecsa (THEOS) Put a byte into the code segment +#include +void pokecsa(char val,void *ofs); +See also: Other poke functions +@pokel +pokel (THEOS) Put a long into another memory segment +#include +void pokel(long val,void *ofs,unsigned seg); +See also: Other poke functions +@pokelcs +pokelcs (THEOS) Put a long into the code segment +#include +void pokelcs(long val,void *ofs); +See also: Other poke functions +@pokelcsa +pokelcsa (THEOS) Put a long into the code segment +#include +void pokelcsa(long val,void *ofs); +See also: Other poke functions +@pokelscr +pokelscr (THEOS) Put a long into the SCR segment +#include +void pokelscr(long val,void *ofs); +See also: Other poke functions +@pokenuc +pokenuc (THEOS) Put a byte into the nucleus segment +#include +void pokenuc(short val,void *ofs); +See also: Other poke functions +@pokep +pokep (THEOS) Put a pointer into another memory segment +#include +void pokep(void *val,void *ofs,unsigned seg); +See also: Other poke functions +@pokepcs +pokepcs (THEOS) Put a pointer into the code segment +#include +void pokepcs(void *val,void *ofs); +See also: Other poke functions +@pokepcsa +pokepcsa (THEOS) Put a pointer into the code segment +#include +void pokepcsa(void *val,void *ofs); +See also: Other poke functions +@pokepscr +pokepscr (THEOS) Put a pointer into the SCR segment +#include +void pokepscr(void *val,void *ofs); +See also: Other poke functions +@pokescr +pokescr (THEOS) Put a byte into the SCR segment +#include +void pokescr(char val,void *ofs); +See also: Other poke functions +@pokeucb +pokeucb (THEOS) Put a byte into the UCB segment +#include +void pokeucb(short val,void *ofs); +See also: Other poke functions +@pokew +pokew (THEOS) Put a word into another memory segment +#include +void pokew(short val,void *ofs,unsigned seg); +See also: Other poke functions +@pokewcs +pokewcs (THEOS) Put a word into the code segment +#include +void pokewcs(short val,void *ofs); +See also: Other poke functions +@pokewcsa +pokewcsa (THEOS) Put a word into the code segment +#include +void pokewcsa(short val,void *ofs); +See also: Other poke functions +@pokewnuc +pokewnuc (THEOS) Put a word into the nucleus segment +#include +void pokewnuc(short val,void *ofs); +See also: Other poke functions +@pokewscr +pokewscr (THEOS) Put a word into the SCR segment +#include +void pokewscr(short val,void *ofs); +See also: Other poke functions +@pokewucb +pokewucb (THEOS) Put a word into the UCB segment +#include +void pokewucb(short val,void *ofs); +See also: Other poke functions +@popen +popen (UNIX) Open an interprocess i/o channel +#include +short popen(FILE **rd_pipe,FILE **wr_pipe); +See also: pipe +@popf +popf (THEOS) Pop flag register +#include +void popf(void); +See also: pushf +@pow +pow (ANSI) Compute a power of a number +#include +double pow(double z,double x); +Set : errno +@pragma +#pragma Sets compiler options +#pragma align 1 | 2 (default) | 4 +#pragma align struct | -struct (default) +#pragma char signed (default) | unsigned +#pragma field char | word (default) +#pragma float bcd | ieee (default) +#pragma float float (default) | double +#pragma int short (default) | long +#pragma library +#pragma prog version,priv[,mfg,serial][,"copyright"][,patchsize] +#pragma shift logical (default) | arithmetic +@pre_empt +pre_empt (THEOS) ??? +#include +void pre_empt(void); +@prime +prime (THEOS) Compute the smallest prime greater than or equal to a number +#include +unsigned prime(unsigned n); +See also: lprime +@printf +printf (ANSI) Format output +#include +short printf(const char *format,...); +See also: cprintf,fprintf,sprintf,vfprintf,vprintf,vsprintf +@pushf +pushf (THEOS) Push flag register +#include +void pushf(void); +@ptrdiff_t +ptrdiff_t (ANSI) Result type of the substraction of two pointers +#include +typedef long ptrdiff_t; +@putc +putc (ANSI) Write a character to a stream +#include +short putc(char c,FILE *fp); +See also: fputc,putchar +@putch +putch (MSC) Write a character to the console +#include +short putch(short c); +See also: fputc,putc,putchar +@putchar +putchar (ANSI) Write a character to standard output +#include +short putchar(short c); +@putenv +putenv (MSC) Set an environment variable +#include +short putenv(const char *s); +See also: getenv +@putmem +putmem (THEOS) Release memory allocated by getmem +#include +void putmem(unsigned seg); +See also: getmem +@putmsg +putmsg (THEOS) Display a message with parameter substitution +#include +void putmsg(const char *text,const char *arg[]); +See also: errbot,errmsg,getmsg,perror,syserr +@puts +puts (ANSI) Write a string to standard output +#include +void puts(const char *string); +See also: cputs,fputs +@putw +putw (ANSI) Write a word to a stream +#include +short putw(short word,FILE *fp); +See also: getw,fgetw,fputw +@qsort +qsort (ANSI) Sort arrays in memory +void qsort(const void **array,size_t nbr,size_t size, + short (*compar)(const void *,const void *)); +See also: bsearch,sort +@quitoff +quitoff (THEOS) Mask the system quit key +#include +void quitoff(void); +See also: quiton +@quiton +quiton (THEOS) Re-enable the system quit key +#include +void quiton(void); +See also: quitoff +@raise +raise (ANSI) Force a signal interrupt +#include +short raise(short sig); +See also: signal +@rand +rand (ANSI) Generate pseudo-random numbers +#include +short rand(void); +See also: srand +@rbrk +rbrk (THEOS) Internal function +@read +read (ANSI) Read data from a file +#include +short read(short fd,void *buffer,size_t n); +See also: close,creat,filelength,flush,lseek,open,_read,tell,_write,write +@readdir +readdir (+UNIX) Read a directory entry +#include +struct dirent* readdir(DIR*); +See also: opendir,closedir,seekdir,telldir,rewinddir +Set : errno +@readk +readk (THEOS) Read a record from an indexed or keyed file +#include +short readk(FILE *fp,const char *key,void *rec); +See also: deletek,readn,readp,writek +@readn +readn (THEOS) Read next record from an indexed or keyed file +#include +short readn(FILE *fp,char *key,void *rec); +See also: deletek,readk,readp,writek +@readp +readp (THEOS) Read previous record from an indexed or keyed file +#include +short readp(FILE *fp,char *key,void *rec); +See also: deletek,readk,readn,writek +@realloc +realloc (ANSI) Reallocate dynamic memory +#include +char *realloc(void *ptr,size_t size); +See also: calloc,free,malloc,max_alloc,tot_alloc +@reclock +reclock (THEOS) Try to lock a record in a file stream or direct file +#include +short reclock(FILE *fp,fpos_t pos); +See also: filelock,locking,recunlock,unlock +@recunlock +recunlock (THEOS) Try to lock a record in a file stream or direct file +#include +short recunlock(FILE *fp,fpos_t pos); +See also: filelock,locking,reclock,unlock +@regcmp +regcmp (UNIX) Compile a search pattern to be used by the regex search function +#include +char *regcmp(char *pattern,...); +See also: regex,strchr,strstr +@regex +regex (UNIX) Perform a search on a string using a pattern compiled by regcmp +#include +char *regex(char *cpattern,char *object,...); +See also: regcmp,strchr,strstr +@remote +remote (THEOS) Call a function in another code segment +#include +remote(unsigned ofs,unsigned seg,...); +@remove +remove (ANSI) Erase a file +#include +short remove(const char *filename); +Set : errno,_errnum +See also: unlink +@rename +rename (ANSI) Change the name of a file +#include +short rename(const char *old,const char *new); +Set : errno,_errnum +@rewind +rewind (ANSI) Reset file pointer +#include +short rewind(FILE *fp); +See also: fseek,fsetpos,seek +@rewinddir +rewinddir (+UNIX) Sets the directory entry location to the beginning +#include +void rewinddir(DIR*); +See also: opendir,closedir,readdir,telldir,seekdir +@rmdir +rmdir (MSC) Removes a directory +#include +short rmdir(const char*dirname); +Set : errno,_errnum +See also: remove,unlink +@round +round (+THEOS) Round a value to the nearest integer +#include <_math.h> +double round(double value, int position) +See also: ceil, floor +@rsema +rsema (THEOS) Return the status of a remote semaphore +#include +short rsema(short pid,short sema_nbr); +See also: rsemaname,rsemares,rsemaset,rsemawait,sema,semaphore,semares,semaset, + semawait +@rsemaname +rsemaname (THEOS) Return the number of a remote semaphore +#include +short rsemaname(short pid,char *name); +See also: rsema,rsemares,rsemaset,rsemawait,sema,semaphore,semares,semaset, + semawait +@rsemares +rsemares (THEOS) Reset a remote semaphore +#include +short rsemares(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemaset,rsemawait,sema,semaphore,semares,semaset, + semawait +@rsemaset +rsemaset (THEOS) Set a remote semaphore +#include +short rsemaset(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemares,rsemawait,sema,semaphore,semares,semaset, + semawait +@rsemawait +rsemawait (THEOS) Wait until a remote semaphore is set +#include +short rsemawait(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemaset,rsemares,sema,semaphore,semares,semaset, + semawait +@sbrk +sbrk (THEOS) Increase a program's data space +void *sbrk(short increment); +@scanf +scanf (ANSI) Accept and format input +#include +short scanf(char *format,...); +See also: fscanf,sscanf +@schedint +schedint (THEOS) Set or reset an interrupt service routine vector +#include +void schedint(long num,short (*isr)()); +@sec +sec (THEOS) Calculate secant +#include +double sec(double x); +@sech +sech (THEOS) Calculate hyperbolic secant +#include +double sech(double x); +@seek +seek (ANSI) Change a stream position pointer +#include +short seek(FILE *fp,short pos,short base); +See also: fsetpos,rewind,seek +@seekdir +seekdir (+UNIX) Sets the directory entry location +#include +void seekdir(DIR*,long); +See also: opendir,closedir,readdir,telldir,rewinddir +@sema +sema (THEOS) Return the status of a semaphore +#include +short rsema(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemares,rsemaset,rsemawait,semaphore,semares, + semaset,semawait +@semaphore +semaphore (THEOS) Return the number of a semaphore +#include +short semaphore(char *name); +See also: rsema,rsemaname,rsemares,rsemaset,rsemawait,sema,semares,semaset, + semawait +@semares +semares (THEOS) Reset a semaphore +#include +short semares(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemares,rsemaset,rsemawait,sema,semaphore,semaset, + semawait +@semaset +semaset (THEOS) Set a semaphore +#include +short semaset(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemares,rsemaset,rsemawait,sema,semaphore,semares, + semawait +@semawait +semawait (THEOS) Wait until a semaphore is set +#include +short semawait(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemaset,rsemares,rsemawait,sema,semaphore,semares, + semaset +@setbuf +setbuf (ANSI) Allocate an i/o buffer for an open file +#include +void setbuf(FILE *fp,char *buffer); +See also: fbuf,setvbuf,vbuf +@setjmp +setjmp (ANSI) Save or restore the current execution environment for a longjmp +#include +short setjmp(jmp_buf env); +See also: longjmp +@setlocale +setlocale (ANSI) Change or return the current locale switches +#include +char *setlocale(short category,const char *locale); +See also: strcoll,strxfrm,is... and to... functions +@setprty +setprty (THEOS) Change the current process priority +#include +void setprty(short priority); +Set also: setslice,snu +@setvbuf +setvbuf (ANSI) Allocate an i/o buffer for an open file +#include +void setvbuf(FILE *fp,char *buffer,short mode,size_t len); +See also: fbuf,setbuf,vbuf +@sgetl +sgetl (THEOS) Retrieve a long integer stored with sputl +#include +long sgetl(char *buf); +See also: sputl +@shared +shared (THEOS) Define or access memory shared with other process +unsigned shared(char *name,size_t len); +See also: far...,getlimit,add...,and...,dec...,inc...,or...,peek...,poke..., + xor... +@sig_atomic_t +sig_atomic_t (ANSI) Used by signal +#include +typedef short sig_atomic_t; +@signal +signal (ANSI) Set the answer to an interrupt +#include +void *signal(short sig,void (*action()); +Set : errno +See also: alarm,msalarm,raise +@sin +sin (ANSI) Calculate sine +#include +double sin(double radian); +Set : errno +@sinh +sinh (ANSI) Calculate hyperbolic sine +#include +double sinh(double radian); +@size_t +size_t (ANSI) Result type of sizeof +#include +typedef unsigned long size_t; +@skipsp +skipsp (THEOS) Locate the next non-space character in a string +#include +char *skipsp(char *s); +See also: strpbrk +@sleep +sleep (UNIX) Suspend execution for a specified time +#include +void sleep(long msecs); +See also: alarm,clock,delay,msalarm,signal +@snu +snu (THEOS) Release any remaining time in this program's slice time +#include +void snu(void); +@sort +sort (THEOS) Sort an array in memory by rearranging an array of pointers +void sort(void **array,size_t nbr,short (*compar)(const void *,const void *)); +See also: qsort +@spawnl +spawnl (MSC) Spawn another program as a subtask +#include +short spawnl(short mode,const char *program,const char *arg,...,NULL); +Set : errno +See also: execl,execlp,execv,execvp,spawnlp,spawnv,spawnvp +@spawnlp +spawnlp (MSC) Spawn another program as a subtask +#include +short spawnlp(short mode,const char *path,const char *arg,...,NULL); +Set : errno +See also: execl,execlp,execv,execvp,fork,spawn,spawnv,spawnvp +@spawnv +spawnv (MSC) Spawn another program as a subtask +#include +short spawnv(short mode,const char *program,const char *arg[]); +Set : errno +See also: execl,execlp,execv,execvp,fork,spawn,spawnlp,spawnvp +@spawnvp +spawnvp (MSC) Spawn another program as a subtask +#include +short spawnvp(short mode,const char *program,const char *arg[]); +Set : errno +See also: execl,execlp,execv,execvp,fork,spawn,spawnlp,spawnv +@sprintf +sprintf (ANSI) Format output +#include +short sprintf(char *string,const char *format,...); +See also: cprintf,fprintf,printf,vfprintf,vprintf,vsprintf +@sputl +sputl (THEOS) Store a long in an hardware independent format +#include +long sputl(long l,char *buf); +See also: sgetl +@sqrt +sqrt (ANSI) Compute square root +#include +double sqrt(double z); +Set : errno +@srand +srand (ANSI) Seed pseudo-random number generator +#include +void srand(unsigned seed); +See also: rand +@sscanf +sscanf (ANSI) Format input from a string +#include +short sscanf(const char *string,const char *format,...); +@stat +stat (ANSI) Find file attributes +#include +short stat(char *file,struct stat *statptr); +Return : EOF or 0 +Set : errno + +struct stat { + dev_t st_dev; /* p�riph�rique */ + ino_t st_ino; /* num�ro d'Inode = 0 */ + mode_t st_mode; /* lsb = protections, msb = filestat */ + nlink_t st_nlink; /* nombre de links = 1 */ + uid_t st_uid; /* identificateur de propri�taire */ + gid_t st_gid; /* identificateur de groupe = st_uid */ + dev_t st_rdev; /* p�riph�rique physique */ + size_t st_size; /* taille du fichier en octets */ + time_t st_atime; /* date et heure de dernier acc�s ** */ + time_t st_mtime; /* date et heure de derni�re modif ** */ + time_t st_ctime; /* date et heure de cr�ation ** */ + unsigned short st_org; /* organisation : s�q, key, ind, dir, prg */ + unsigned short st_rlen; /* largeur des enregistrements */ + unsigned short st_klen; /* largeur des cl�s */ + char st_grow; /* taux d'agrandissement */ +}; + +/* ** date de derni�re modification */ +@std +std (THEOS) Set direction flag +#include +void std(void); +See also: cld +@sti +sti (THEOS) Set interrupt +#include +void sti(void); +See also: cli +@strcat +strcat (ANSI) Append one string to another +#include +char *strcat(char *to,const char *from); +See also: farcat,strncat +@strchr +strchr (ANSI) Locate the first occurence of a character in a string +#include +char *strchr(const char *string1,short c); +See also: farchr,memchr,strpbrk,strrchr,strstr +@strcmp +strcmp (ANSI) Compare two strings +#include +short strcmp(const char *string1,const char *string2); +See also: farcmp,fareq,memcmp,memeq,memicmp,streq,stricmp,strncmp,strneq, + strnicmp +@strcoll +strcoll (ANSI) Compare two strings according to the current collating sequence +#include +short strcoll(const char *s1, const char *s2); +See also: setlocale,strlwr,strupr,strxfrm +@strcpy +strcpy (ANSI) Copy one string into another +#include +char *strcpy(char *to,const char *from); +See also: farcpy,memccpy,memcpy,memmove,memrcpy,strdup,strmake,strncpy +@strcrypt +strcrypt (JMD) Crypt a string +#include <_string.h> +char *strcrypt(char *s); +@strcspn +strcspn (ANSI) Return length for which one string excludes characters in another +#include +unsigned short strcspn(const char *string1,const char *string2); +See also: strpbrk,strspn,strtok +@strdup +strdup (MSC) Makes a copy of a string in previously unallocated memory +#include +char *strdup(const char *from); +See also: farcpy,memccpy,memcpy,memmove,memrcpy,strcpy,strmake,strncpy +@strend +strend (THEOS) Locate the end of a string +#include +char *strend(const char *string); +@streq +streq (THEOS) Compare two strings for equality +#include +short streq(const char *string1,const char *string2); +See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,stricmp,strncmp,strneq, + strnicmp +@strerror +strerror (ANSI) Return a system message with the arguments pointed by _errarg +#include +char *strerror(short num); +See also: _errarg,errmsg,fperror,getmsg,perror,syserr +@strftime +strftime (ANSI) Convert a time structure into a formatted string +#include +size_t strftime(char *s,size_t len,const char *fmt,const struct tm *tp); +See also: asctime,ctime,gmtime,localtime,mktime,time +@stricmp +stricmp (MSC) Compare two buffers,ignoring the casemode of the characters +#include +short stricmp(const void *string1,const void *string2); +See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,streq,strncmp,strneq, + strnicmp +@strlen +strlen (ANSI) Return the length of a string +#include +short strlen(const char *string); +See also: farlen,strend +@strlwr +strlwr (MSC) Convert the alphabetic characters in a string to lower case +#include +char *strlwr(char *s); +See also: strupr,tolower,setlocale +@strmake +strmake (THEOS) Copy a memory buffer to a string,adding the nul terminator +#include +char *strmake(char *to,const char *from,size_t len); +See also: farcpy,memccpy,memcpy,memmove,memrcpy,strcpy,strdup,strncpy +@strncat +strncat (ANSI) Append one string onto another +#include +char *strncat(char *to,const char *from,size_t len); +See also: farcat,strcat +@strncmp +strncmp (ANSI) Compare two strings +#include +short strncmp(const char *string1,const char *string2,size_t len); +See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,streq,stricmp,strneq,strnicmp +@strncpy +strncpy (ANSI) Copy one string into another +#include +char *strncpy(char *to,const char *from,size_t len); +See also: farcpy,memccpy,memcpy,memmove,memrcpy,strcpy,strdup,strmake +@strneq +strneq (THEOS) Compare two strings for equality +#include +short strneq(const char *string1,const char *string2,size_t len); +See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,streq,stricmp,strncmp, + strnicmp +@strnfill +strnfill (THEOS) Fill a buffer with a character +#include +char *strnfill(char *buffer,size_t len,short character); +See also: farset,memset,strset,strnset +@strnicmp +strnicmp (MSC) Compare two buffers,ignoring the casemode of the characters +#include +short stricmp(const void *string1,const void *string2,size_t len); +See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,streq,stricmp,strncmp,strneq +@strnset +strnset (MSC) Fill a string with a character +void *strnset(char *buffer,short character,size_t len); +See also: farset,memset,strnfill,strset +@strpbrk +strpbrk (ANSI) Find first occurrence in a string of any character from another +#include +char *strpbrk(const char *string1,const char *string2); +See also: farchr,memchr,strchr,strrchr,strstr +@strrchr +strrchr (ANSI) Locate the last occurence of a character in a string +#include +char *strrchr(const char *string1,short c); +See also: farchr,memchr,strpbrk,strchr,strstr +@strsave +strsave (THEOS) See strdup +@strset +strset (MSC) Fill a string with a character +void *strset(char *buffer,short character); +See also: farset,memset,strnfill,strnset +@strspn +strspn (ANSI) Return length for which one string includes characters in another +#include +unsigned short strspn(const char *string1,const char *string2); +See also: strpbrk,strcspn,strtok +@strstr +strstr (ANSI) Locate the first occurence of one string within another +#include +char *strstr(const char *string1,const char *string2); +See also: farchr,memchr,strpbrk,strchr,strrchr +@strtod +strtod (ANSI) Convert string to floating point value +#include +double strtod(const char *s,char **es); +See also: atof,ftoa +@strtok +strtok (ANSI) Extract a token from a string +#include +char *strtok(char *string,char *delim); +See also: strcspn,srtrspn +@strtol +strtol (ANSI) Convert string in a specified base a to long integer +#include +double strtol(const char *s,char **es,short base); +See also: atol,ltoa,strtoul,ultoa +@strtoul +strtoul (ANSI) Convert string in a specified base a to unsigned long integer +#include +double strtoul(const char *s,char **es,short base); +See also: atol,ltoa,strtol,ultoa +@strupr +strupr (MSC) Convert the alphabetic characters in a string to upper case +#include +char *strupr(char *s); +See also: strlwr,tolower,setlocale +@strxfrm +strxfrm (ANSI) Convert a string according to the current collating sequence +#include +size_t strxfrm(char* to,char* from,size_t maxsize); +See also: setlocale,strcoll +@subb +subb (THEOS) Substract a value to a byte in another memory segment +#include +void subb(void *ofs,unsigned seg,char val); +See also: Other sub functions +@subcs +subcs (THEOS) Substract a value to a byte in the code segment +#include +void subcs(void *ofs,char val); +See also: Other sub functions +@subl +subl (THEOS) Substract a value to a long in another memory segment +#include +void subl(void *ofs,unsigned seg,long val); +See also: Other sub functions +@sublcs +sublcs (THEOS) Substract a value to a long in the code segment +#include +void sublcs(void *ofs,long val); +See also: Other sub functions +@subw +subw (THEOS) Substract a value to a word in another memory segment +#include +void subw(void *ofs,unsigned seg,short val); +See also: Other sub functions +@subwcs +subwcs (THEOS) Substract a value to a word in the code segment +#include +void subwcs(void *ofs,short val); +See also: Other sub functions +@suicide +suicide (THEOS) Kill the current sub-task +#include +void suicide(void); +See also: killtask +@swab +swab (THEOS) Swap a pair of bytes +#include +void swab(char *src,char *dest,unsigned nb); +@syserr +syserr (THEOS) Display a system message on stderr and exit the program +#include +void syserr(short rc,short num,char *arg[]); +See also: errmsg,exit,putmsg +@system +system (ANSI) Pass a command to the CSI shell for execution +#include +short system(const char *commandline); +@tan +tan (ANSI) Calculate tangent +#include +double tan(double radian); +@tanh +tanh (ANSI) Calculate hyperbolic cosine +#include +double tanh(double radian); +@tell +tell (MSC) Return current position of file's data pointer +#include +long tell(short filenum); +See also: close,creat,filelength,flush,lseek,open,_read,read,_write,write +@telldir +telldir (+UNIX) Return the current directory entry location +#include +long telldir(DIR*); +See also: opendir,closedir,readdir,seekdir,rewinddir +@tempnam +tempnam (ANSI) Generate a unique name for a temporary file +#include +char *tempnam(const char *directory,const char *name); +@termname +termname (+THEOS) Return the class name of a terminal or printer +#include <_stdio.h> +char* termname(int class); +See also: devname,termname,ttyname +@testarg +testarg (THEOS) Compare a string to a system keyword +#include +short testarg(char *arg,short keynbr); +See also: getkey,keyclose,matcharg +@testhead +testhead (THEOS) Control page heading and page wait for stdout +#include +void testhead(char *heading); +See also: datehdng,getll,getpl,pagewait +@testwild +testwild (THEOS) Test if a string include "wild cards" +#include +short testwild(char *s); +@tetd_t +tetd_t (MWC) Type to represent file time and date format +#include +typedef unsigned long tetd_t; +@tetd_to_tm +tetd_to_tm (MWC) Convert file time and date to system calendar format +#include +tm_t *tetd_to_tm(tetd_t time); +See also: tetd_to_time,time_to_tetd,tm_to_tetd +@tetd_to_time +tetd_to_time (MWC) Convert file time and date to a number of seconds +#include +time_t tetd_to_time(tetd_t time); +See also: tetd_to_tm,time_to_tetd,tm_to_tetd +@time +time (ANSI) Get current time in seconds since 01-01-1970 00:00:00 GMT +#include +time_t time(time_t *tp); +@time_t +time_t (ANSI) Type to represent time in seconds since 01-01-1970 00:00:00 GMT +#include +typedef long time_t; +@time_to_tetd +time_to_tetd (MWC) Convert a number of seconds to file time and date format +#include +tetd_t time_to_tetd(time_t t); +See also: tetd_to_tm,tetd_to_time,tm_to_tetd +@timeout +timeout (THEOS) Test if previous read failed because of a lock timeout +#include <_stdio.h> +short timeout(); +See also: lock_time +@timer +timer (THEOS) Set a semaphore on after a given time or a defined time of day +#include +void *timer(short sema_nbr,short type,long msec); +See also: alarm,msalarm,sema,semaphore,semares,semaset,semawait +@timezone +timezone (ANSI) Difference in seconds between GMT time and local time +#include +extern long timezone; +See also: daylight,tzset,tzname +@tm_to_tetd +tm_to_tetd (MWC) Convert system calendar format to file date and time +#include +tetd_t tm_to_tetd(tm_t *time); +See also: tetd_to_tm,tetd_to_time,time_to_tetd +@tmpfile +tmpfile (ANSI) Create and open a temporary file +#include +FILE *tmpfile(void); +See also: fopen,mktemp,lempnam,tmpnam +@tmpnam +tmpnam (ANSI) Generate a unique name for a temporary file +#include +char *tmpnam(char *name); +@toascii +#include +toascii (UNIX) Convert characters to ASCII +#include +short toascii(short c); +@toibmpc +toibmpc (+THEOS) Translate THEOS character to native IBM PC extended ASCII +#include +short toibmpc(short c); +See also: totheos +@tolower +tolower (ANSI) Convert characters to lower case +#include +short tolower(short c); +@topen +topen (THEOS) ??? +#include +FILE *topen(char *fname,char *mode,unsigned reclen,size_t blklen); +Set : _errnum +@tot_alloc +tot_alloc (THEOS) Compute the total amount of available memory +#include +size_t tot_alloc(void); +See also: calloc,free,malloc,max_alloc,realloc +@totheos +totheos (+THEOS) Translate IBM PC extended ASCII character to THEOS character +#include +short totheos(short c); +See also: toibmpc +@toupper +toupper (ANSI) Convert characters to upper case +#include +short toupper(short c); +@trim +trim (THEOS) Remove leading,trailing and multiple spaces +#include +char *trim(char *s); +@ttyname +ttyname (+UNIX) Return the name of the console physical device +#include <_stdio.h> +char* ttyname(FILE* stream); +See also: devname,termname,vdiname +@tzname +tzname (ANSI) Time zones names +#include +extern char *tzname[2]; +See also: daylight,timezone,tzset +@tzset +tzset (UNIX) Determine the time zone name for local time +#include +void tzset(void); +See also: daylight,timezone,tzname +@undef +#undef (ANSI) Undefine a manifest constant +#undef variable +@ungetc +ungetc (ANSI) Return character to input stream +#include +short ungetc(short c,FILE *fp); +See also: ungetch +@ungetch +ungetc (MSC) Return character to standard input +#include +short ungetch(short c); +See also: ungetc +@unlink +unlink (ANSI) Remove a file +#include +short unlink(const char *name); +Set : errno,_errnum +See also: remove +@unload +unload (THEOS) Unload a file from memory +#include +void unload(unsigned seg); +See also: load +@unlock +unlock (THEOS) Unlock a record +#include +void unlock(FILE *file); +See also: filelock,locking,reclock,recunlock +@unwait +unwait (THEOS) Awaken a program waiting for an interrupt +#include +void unwait(short pid); +See also: wait +@upcase +upcase (THEOS) See strupr +@utime +utime (+UNIX) Change the date and time of a file +#include +short utime(const char *filename,struct utimbuf *times); +Set : errno +See also: asctime,ctime,gmtime,localtime,stat,time +@utoa +utoa (THEOS) Convert an unsigned integer into an ASCII string +#include +char *utoa(char *s,unsigned i); +See also: ftoa,itoa,ltoa +@va_arg +va_arg (ANSI) Used to access erguments in a variable argument functions +#include +.... va_arg(va_list *arg_ptr,type); +See also: va_start,va_end +@va_end +va_end (ANSI) End variable argument processing +#include +void va_end(va_list *aptr); +See also: va_arg,va_start +@va_list +va_list (ANSI) Used in variable argument processing +#include +typedef long va_list[1]; +@va_start +va_start (ANSI) Start variable argument processing +#include +void va_start(va_list *arg_ptr,void *ptr); +See also: va_arg,va_end +@vdi +vdi (THEOS) Primitive access to the Virtual Device Interface +#include +void vdi(short vidnum,VDIPB *vdipb); +See also: vdiopen +@vdialpha +vdialpha( THEOS) Switch VDI to text mode +#include +void vdialpha(VDIPB *vdipb); +See also: vdigraph,vdiopen +@vdiarc +vdiarc (THEOS) Draw an arc +#include +void vdiarc(VDIPB *vdipb,short x,short y,short radius,short angle1,short angle2); +See also: vdicircle,vdiopen,vdipie +@vdibar +vdibar (THEOS) Draw a rectangle +#include +void vdibar(VDIPB *vdipb,short llx,short lly,short urx,short ury); +See also: vdiopen +@vdicircle +vdicircle (THEOS) Draw a circle +#include +void vdicircle(VDIPB *vdipb,short x,short y,short radius); +See also: vdiarc,vdiopen,vdipie +@vdiclear +vdiclear (THEOS) Clear the graphics page or perform a form feed +#include +void vdiarc(VDIPB *vdipb); +See also: vdiopen +@vdiclose +vdiclose (THEOS) Close a VDI file +#include +void vdiclose(VDIPB *vdipb); +See also: vdiopen +@vdigraph +vdigraph (THEOS) Swith to graphics mode +#include +void vdigraph(VDIPB *vdipb); +See also: vdialpha,vdiopen +@vdiline +vdiline (THEOS) Draw a line +#include +void vdiline(VDIPB *vdipb,short x1,short y1,short x2,short y2); +See also: vdiopen +@vdimark +vdimark (THEOS) Draw a marker +#include +void vdimark(VDIPB *vdipb,short x,short y); +See also: vdiopen +@vdiname +vdiname (+THEOS) Return the name of a VDI physical device +#include <_stdio.h> +char* vdiname(int vdiclass); +See also: devname,termname,ttyname +@vdiopen +vdiopen (THEOS) Open a graphics device +#include +VDIPB *vdiopen(short num); +See also: vdiclose +@vdipie +vdipie (THEOS) Draw a pie section +#include +void vdipie(VDIPB *vdipb,short x,short y,short radius,short angle1,short angle2); +See also: vdiarc,vdicircle,vdiopen +@vdisetfc +vdisetfc (THEOS) Set fill color +#include +void vdisetfc(VDIPB *vdipb,short color); +See also: vdibar,vdicircle,vdiopen,vdipie +@vdisetfs +vdisetfs (THEOS) Set fill style +#include +void vdisetfs(VDIPB *vdipb,short style); +See also: vdibar,vdicircle,vdiopen,vdipie +@vdisetlc +vdisetlc (THEOS) Set line color +#include +void vdisetlc(VDIPB *vdipb,short color); +See also: vdiarc,vdibar,vdicircle,vdiline,vdiopen,vdipie +@vdisetlh +vdisetlh (THEOS) Set line width or height +#include +void vdisetlh(VDIPB *vdipb,short size); +See also: vdiline,vdiopen +@vdisetls +vdisetls (THEOS) Set line style +#include +void vdisetls(VDIPB *vdipb,short style); +See also: vdiarc,vdibar,vdicircle,vdiline,vdiopen,vdipie +@vdisetmc +vdisetmc (THEOS) Set marker color +#include +void vdisetmc(VDIPB *vdipb,short color); +See also: vdimark,vdiopen +@vdisetmh +vdisetmh (THEOS) Set marker size or height +#include +void vdisetmh(VDIPB *vdipb,short size); +See also: vdimark,vdiopen +@vdisetms +vdisetms (THEOS) Set marker style +#include +void vdisetms(VDIPB *vdipb,short style); +See also: vdimark,vdiopen +@vdisetta +vdisetta (THEOS) Set text angle +#include +void vdisetta(VDIPB *vdipb,short color); +See also: vdiopen,vditext +@vdisettc +vdisettc (THEOS) Set text color +#include +void vdisettc(VDIPB *vdipb,short color); +See also: vdiopen,vditext +@vdisetth +vdisetth (THEOS) Set text size or height +#include +void vdisetth(VDIPB *vdipb,short size); +See also: vdiopen,vditext +@vdisettp +vdisettp (THEOS) Set text path +#include +void vdisettp(VDIPB *vdipb,short path); +See also: vdiopen,vditext +@vdisetts +vdisetts (THEOS) Set text style +#include +void vdisetts(VDIPB *vdipb,short style); +See also: vdiopen,vditext +@vditext +vditext (THEOS) Display a text string +#include +void vditext(VDIPB *vdipb,short x,short y,char *s); +See also: vdiopen +@vfprintf +vfprintf (ANSI) Print formatted output to a stream +#include +short vfprintf(const FILE *stream,const char *FORMAT,va_list arg); +See also: cprintf,fprintf,printf,sprintf,vprintf,vsprintf +@vprintf +vprintf (ANSI) Print formatted output to standard output +#include +short vprintf(const char *FORMAT,va_list arg); +See also: cprintf,fprintf,printf,sprintf,vfprintf,vsprintf +@vsprintf +vsprintf (ANSI) Print formatted output to a string +#include +short vsprintf(char *s,const char *FORMAT,va_list arg); +See also: cprintf,fprintf,printf,sprintf,vfprintf,vprintf +@wait (THEOS) Suspend a program until an interrupt occurs +#include +void wait(void); +See also: unwait +@write +write (ANSI) Write data to a file +#include +size_t write(short fd,void *buffer,size_t len); +See also: close,creat,filelength,flush,lseek,open,_read,read,tell,_write +@writek +writek (THEOS) Write a record to an indexed or keyed file +#include +short writek(FILE *fp,const char *key,const void *rec); +See also: deletek,readk,readn,readp +@xorb +xorb (THEOS) Xor a byte in another memory segment +#include +void xorb(void *ofs,unsigned seg,char mask); +See also: Other xor functions +@xorcs +xorcs (THEOS) Xor a byte in the code segment +#include +void xorcs(void *ofs,char mask); +See also: Other xor functions +@xorl +xorl (THEOS) Xor a long in another memory segment +#include +void xorl(void *ofs,unsigned seg,long mask); +See also: Other xor functions +@xorlcs +xorlcs (THEOS) Xor a long in the code segment +#include +void xorlcs(void *ofs,long mask); +See also: Other xor functions +@xorw +xorw (THEOS) Xor a word in another memory segment +#include +void xorw(void *ofs,unsigned seg,short mask); +See also: Other xor functions +@xorwcs +xorwcs (THEOS) Xor a word in the code segment +#include +void xorwcs(void *ofs,short mask); +See also: Other xor functions +#include <_time.h> +short _yday(short month,short day,short year); +See also: leapyear,_weekday +@yes_val +yes_val (THEOS) Value of yes answer +extern char yes_val; +@yesno +yesno (THEOS) Accept the answer yes or no according to the system keyword file +#include +short yesno(void); +See also: load_yn +@yield +yield (THEOS) See snu +@account +account (THEOS) Format of SYSTEM.ACCOUNT +#include +struct account { + char name[8]; /* [00] - logon id */ + char password[8]; /* [08] - password (spaces if none) */ + char id[2]; /* [10] - account number: + ascii-hex if 00-FE + else: 76543210-76543210 + *3210987 *6543210 + * = always set + if number >= 0x2000, + then synonym to account + & 0x1fff */ + char priv; /* [14] - privlege level */ + char mail_sw; /* [13] - you have mail */ + char abbrev_sw; /* [14] - CSI abbreviation switch */ + char stdsyn_sw; /* [15] - CSI synonym switch */ + char synonym[9]; /* [16] - CSI synonym fn______d */ + char rdy_sw; /* [1F] - CSI ready switch */ + char msg_sw; /* [20] - MSG switch */ + char break_chr[2]; /* [21] - break value (ascii-hex) */ + char work_drv; /* [23] - work drive code */ + char lang_code; /* [24] - default language code */ + char dec_is_comma; /* [25] - decimal is comma switch */ + char def_lib[19]; /* [26] - default library fn.ft:d */ + char mac_lib[9]; /* [39] - macro library fn______d */ + char obj_lib[9]; /* [42] - object library fn______d */ + char copy_lib[9]; /* [4B] - include library fn______d */ + char search[26]; /* [54] - search sequence */ + char cmd_lib[9]; /* [6E] - command library fn______d */ + char link_lib[9]; /* [77] - link library fn______d */ + char csi_case_sw; /* [80] - CSI lower case mode */ + char prompt[50]; /* [81] - CSI prompt */ +}; +@acb +acb (THEOS) Format of accseg in memory +#include +struct acb { + char name[8]; /* [00] - account name */ + short id; /* [08] - account number */ + char msgname[8]; /* [0A] - msg name */ +}; +@TERMINAL_FD +TERMINAL_FD (THEOS) Translate table used by international terminals +#include +struct TERMINAL_FD { + char type_code; + char terminal_name[25]; + near char *home; + near char *fon; + near char *foff; + near char *hon; + near char *hoff; + near char *right; + near char *left; + near char *down; + near char *ulon; + near char *clear; + near char *rvon; + near char *rvoff; + near char *dca; + near char *il; + near char *dl; + near char *setup; + near char *ic; + near char *dc; + near char *uloff; + near char *eol; + near char *eos; + near char *up; + near char *eu; + near char *bon; + near char *boff; + near char *mon; + near char *moff; + near char *color; + near char *koff; + near char *kon; + near char *son; + near char *soff; + near char *ISO_23; + near char *ISO_40; + near char *ISO_5B; + near char *ISO_5C; + near char *down_key; + near char *up_key; + near char *left_key; + near char *right_key; + near char *esc_key; + near char *top_key; + near char *bottom_key; + near char *delchar_key; + near char *page_fwd_key; + near char *page_bck_key; + near char *word_right_key; + near char *word_left_key; + near char *sch_fwd_key; + near char *sch_bck_key; + near char *again_key; + near char *file_key; + near char *erase_key; + near char *beg_line_key; + near char *end_line_key; + near char *case_key; + near char *save_key; + near char *quit_key; + near char *find_key; + near char *replace_key; + near char *del_left_key; + near char *transpose_key; + near char *ins_line_key; + near char *del_line_key; + near char *help_key; + near char *ulc; + near char *urc; + near char *lrc; + near char *llc; + near char *fwi; + near char *li; + near char *ri; + near char *ui; + near char *di; + near char *horiz; + near char *vert; + near char *rulc; + near char *rurc; + near char *rlrc; + near char *rllc; + near char *dulc; + near char *durc; + near char *dlrc; + near char *dllc; + near char *dfsi; + near char *dli; + near char *dri; + near char *dui; + near char *ddi; + near char *dhoriz; + near char *dvert; + near char *slave_enable; + near char *slave_disable; + near char *A_umlaut; + near char *a_umlaut; + near char *a_circumflex; + near char *a_grave; + near char *a_acute; + near char *E_acute; + near char *e_umlaut; + near char *e_circumflex; + near char *e_grave; + near char *e_acute; + near char *i_umlaut; + near char *i_circumflex; + near char *i_grave; + near char *i_acute; + near char *O_umlaut; + near char *o_umlaut; + near char *o_circumflex; + near char *o_grave; + near char *o_acute; + near char *U_umlaut; + near char *u_umlaut; + near char *u_circumflex; + near char *u_grave; + near char *u_acute; + near char *C_tail; + near char *c_tail; + near char *N_squiggle; + near char *n_squiggle; + near char *AE; + near char *ae; + near char *A_degree; + near char *a_degree; + near char *German_esset; + near char *invert_question; + near char *invert_exclaim; + near char *cent; + near char *english_pound; + near char *japenese_yen; + near char *spanish_pentada; + near char *dutch_guilder; + near char *one_quarter; + near char *one_half; + near char *y_umlaut; + near char *section; + near char *degree; + near char *bullet; + near char *A_umlaut_key; + near char *a_umlaut_key; + near char *a_circumflex_key; + near char *a_grave_key; + near char *a_acute_key; + near char *E_acute_key; + near char *e_umlaut_key; + near char *e_circumflex_key; + near char *e_grave_key; + near char *e_acute_key; + near char *i_umlaut_key; + near char *i_circumflex_key; + near char *i_grave_key; + near char *i_acute_key; + near char *O_umlaut_key; + near char *o_umlaut_key; + near char *o_circumflex_key; + near char *o_grave_key; + near char *o_acute_key; + near char *U_umlaut_key; + near char *u_umlaut_key; + near char *u_circumflex_key; + near char *u_grave_key; + near char *u_acute_key; + near char *C_tail_key; + near char *c_tail_key; + near char *N_squiggle_key; + near char *n_squiggle_key; + near char *AE_key; + near char *ae_key; + near char *A_degree_key; + near char *a_degree_key; + near char *German_esset_key; + near char *invert_question_key; + near char *invert_exclaim_key; + near char *cent_key; + near char *english_pound_key; + near char *japenese_yen_key; + near char *spanish_pentada_key; + near char *dutch_guilder_key; + near char *one_quarter_key; + near char *one_half_key; + near char *y_umlaut_key; + near char *section_key; + near char *degree_key; + near char *bullet_key; + near char *ISO_5D; + near char *ISO_5E; + near char *ISO_60; + near char *ISO_7B; + near char *ISO_7C; + near char *ISO_7D; + near char *ISO_7E; + near char *ISO_23_key; + near char *ISO_40_key; + near char *ISO_5B_key; + near char *ISO_5C_key; + near char *ISO_5D_key; + near char *ISO_5E_key; + near char *ISO_60_key; + near char *ISO_7B_key; + near char *ISO_7C_key; + near char *ISO_7D_key; + near char *ISO_7E_key; +}; +@TERMINAL_FE +TERMINAL_FE (THEOS) Translate table used by US terminals +#include +struct TERMINAL_FE { + char type_code; + char terminal_name[25]; + near char *home; + near char *fon; + near char *foff; + near char *hon; + near char *hoff; + near char *right; + near char *left; + near char *down; + near char *ulon; + near char *clear; + near char *rvon; + near char *rvoff; + near char *dca; + near char *il; + near char *dl; + near char *setup; + near char *ic; + near char *dc; + near char *uloff; + near char *eol; + near char *eos; + near char *up; + near char *eu; + near char *bon; + near char *boff; + near char *mon; + near char *moff; + near char *color; + near char *koff; + near char *kon; + near char *son; + near char *soff; + char filler[8]; + near char *down_key; + near char *up_key; + near char *left_key; + near char *right_key; + near char *esc_key; + near char *top_key; + near char *bottom_key; + near char *delchar_key; + near char *page_fwd_key; + near char *page_bck_key; + near char *word_right_key; + near char *word_left_key; + near char *sch_fwd_key; + near char *sch_bck_key; + near char *again_key; + near char *file_key; + near char *erase_key; + near char *beg_line_key; + near char *end_line_key; + near char *case_key; + near char *save_key; + near char *quit_key; + near char *find_key; + near char *replace_key; + near char *del_left_key; + near char *transpose_key; + near char *ins_line_key; + near char *del_line_key; + near char *help_key; + near char *ulc; + near char *urc; + near char *lrc; + near char *llc; + near char *fwi; + near char *li; + near char *ri; + near char *ui; + near char *di; + near char *horiz; + near char *vert; + near char *rulc; + near char *rurc; + near char *rlrc; + near char *rllc; + near char *dulc; + near char *durc; + near char *dlrc; + near char *dllc; + near char *dfsi; + near char *dli; + near char *dri; + near char *dui; + near char *ddi; + near char *dhoriz; + near char *dvert; + near char *slave_enable; + near char *slave_disable; +}; +@PRINTER_FC +PRINTER_FC (THEOS) Translate table used by printers +#include +struct PRINTER_FC { + char type_code; + char printer_name[25]; + near char *bold_on; + near char *bold_off; + near char *ul_on; + near char *ul_off; + near char *ital_on; + near char *ital_off; + near char *color_on; + near char *color_off; + near char *compress_on; + near char *compress_off; + near char *wide_on; + near char *wide_off; + near char *high_on; + near char *high_off; + near char *ulc; + near char *urc; + near char *lrc; + near char *llc; + near char *fwi; + near char *li; + near char *ri; + near char *ui; + near char *di; + near char *horiz; + near char *vert; + near char *rulc; + near char *rurc; + near char *rlrc; + near char *rllc; + near char *dulc; + near char *durc; + near char *dlrc; + near char *dllc; + near char *dfsi; + near char *dli; + near char *dri; + near char *dui; + near char *ddi; + near char *dhoriz; + near char *dvert; + near char *slave_enable; + near char *slave_disable; + near char *A_umlaut; + near char *a_umlaut; + near char *a_circumflex; + near char *a_grave; + near char *a_acute; + near char *E_acute; + near char *e_umlaut; + near char *e_circumflex; + near char *e_grave; + near char *e_acute; + near char *i_umlaut; + near char *i_circumflex; + near char *i_grave; + near char *i_acute; + near char *O_umlaut; + near char *o_umlaut; + near char *o_circumflex; + near char *o_grave; + near char *o_acute; + near char *U_umlaut; + near char *u_umlaut; + near char *u_circumflex; + near char *u_grave; + near char *u_acute; + near char *C_tail; + near char *c_tail; + near char *N_squiggle; + near char *n_squiggle; + near char *AE; + near char *ae; + near char *A_degree; + near char *a_degree; + near char *German_esset; + near char *invert_question; + near char *invert_exclaim; + near char *cent; + near char *english_pound; + near char *japenese_yen; + near char *spanish_pentada; + near char *dutch_guilder; + near char *one_quarter; + near char *one_half; + near char *y_umlaut; + near char *section; + near char *degree; + near char *bullet; + near char *ISO_23; + near char *ISO_40; + near char *ISO_5B; + near char *ISO_5C; + near char *ISO_5D; + near char *ISO_5E; + near char *ISO_60; + near char *ISO_7B; + near char *ISO_7C; + near char *ISO_7D; + near char *ISO_7E; +}; +@elt +elt (THEOS) Exclusive Lock Table +#include +struct elt { + void *lock_ofs; /* [00] - offset address */ + unsigned lock_seg; /* [04] - segment address */ + unsigned char lock_own; /* [06] - pid of owner */ + char lock_flag; /* [07] - set if waiting */ +}; + +#define ELT ((struct elt *)0) +#define ELTLEN 8 +#define ELTSEG 0x0078 +@fcb +fcb (THEOS) File Control Block +See FILE +@FILE +FILE (THEOS) File Control Block +#include +typedef struct fcb { + char _fst; /* [00] - 1 - file status: + 76543210 + ��������� = disk full on last write + ��������� = tape no HDR2 labels + ��������� = tape end of file + ��������� = printer needs close + ��������� = printer + ��������� = buffer has write data + ��������� = buffer allocated + ��������� = opened */ + char _flub; /* [01] - 5 - logical unit,255 = null */ + short _faccess; /* [02] - 11 - access mode: + 111111 + 5432109876543210 + ����������������� = input + ����������������� = output + ����������������� = lock + ����������������� = temp file (erase) + ����������������� = stream + ����������������� = relative + ����������������� = indexed + ����������������� = keyed + ����������������� = append mode + ����������������� = private + ����������������� = last prt FF + ����������������� = pipe file + ����������������� = printer pass-thru + ����������������� = last prt FE + ����������������� = lock writes + ����������������� = ix node rd/wr */ + short _freclen; /* [04] - 19 - record length */ + short _fkeylen; /* [06] - 27 - key length */ + char *_fbufbase; /* [08] - 801 - location of buffer */ + long _fbufsize; /* [0C] - 817 - buffer size */ + char *_fbufptr; /* [10] - 833 - next char position */ + long _fcount; /* [14] - 849 - number of chars left */ + long _floc; /* [18] - 865 - location next read or write */ + short _fsa; /* [1C] - 371 - slot number of fsa */ + char *_fnxtkey; /* [1E] - 889 - pointer to IX key storage */ + short _fnxt; /* [22] - 395 - type of IX key */ + long _fixnxt; /* [24] - 913 - disk address of IX key */ + char *_ftapefn; /* [28] - 929 - pointer to tape file name */ + char _filler[10]; /* [2C] - filler */ +} FILE; /* len of fcb = 54 bytes */ + +struct fcb_286 { + char _fst; /* [00] - 1 - file status: + 76543210 + ��������� = disk full on last write + ��������� = tape no HDR2 labels + ��������� = tape end of file + ��������� = printer needs close + ��������� = printer + ��������� = buffer has write data + ��������� = buffer allocated + ��������� = opened */ + char _flub; /* [01] - 5 - logical unit,255 = null */ + short _faccess; /* [02] - 11 - access mode: + 111111 + 5432109876543210 + ����������� = input + ����������� = output + ����������� = lock + ����������� = temp file (erase) + ����������� = stream + ����������� = relative + ����������� = indexed + ����������� = keyed + ����������� = append mode + ����������� = private */ + short _freclen; /* [04] - 19 - record length */ + short _fkeylen; /* [06] - 27 - key length */ + near char *_fbufbase; /* [08] - 35 - location of buffer */ + unsigned _fbufsize; /* [0A] - 43 - buffer size */ + near char *_fbufptr; /* [0C] - 51 - next char position */ + unsigned _fcount; /* [0E] - 59 - number of chars left */ + long _floc; /* [10] - 67 - location next read or write */ + short _fsa; /* [14] - 83 - slot number of fsa in nucleus */ +}; /* len of fcb_286 = 22 bytes */ +@fdb +fdb (THEOS) File Directory Block +#include +struct fdb { + char filename[8]; /* [00] - filename or member name */ + char filetype[8]; /* [08] - filetype */ + char filestat; /* [10] - file status: + 76543210 + 00000000 empty + 11111111 erased + 10000000 library + 01000000 sub directory + 00010000 normal stream + 00001000 relative + 00000100 keyed + 00000010 indexed + xxx00001 program + xxx = 000 8086 & 80286 real + xxx = 001 80286 protected + xxx = 010 80386 */ + unsigned short fileowner; /* [11] - owner id */ + char protect; /* [13] - protection code: + 76543210 + ��������� = read protect + ��������� = write protect + ��������� = execute protect + ��������� = erase protect + ��������� = shared read protect + ��������� = shared write protect + ��������� = shared execute protect + ��������� = shared erase protect */ + union { + struct { + year : 6; /* years since 1986 [0-31] = [1986 - 2017] */ + month : 4; /* month [1 - 12] */ + day : 5; /* day [1 - 31] */ + hour : 5; /* hour [0 - 23] */ + min : 6; /* minute [0 - 59] */ + sec : 6; /* second [0 - 59] */ + } new; + struct { + char type; /* code 0=old,!0=new */ + year : 4; /* years since 1980 [0-15] = [1980 - 1995] */ + month : 4; /* month [1 - 12] */ + day : 5; /* day [1 - 31] */ + hour : 5; /* hour [0 - 23] */ + min : 6; /* minute [0 - 59] */ + : 0; + } old; + unsigned long datetime; + } filedate; /* [14] - date & time of last write */ + long filesize; /* [18] - file size in bytes */ + unsigned short reclen; /* [1C] - record length */ + unsigned short keylen; /* [1E] - key len */ + struct { + unsigned short ext_ct; /* [20] - sector count */ + char ext_addr[3]; /* [22] - sector address */ + } extlev1[5]; /* [20] - 5 level 1 extents */ + char extlev2a[3]; /* [39] - address of sector contain 51 exts */ + char extlev2b[3]; /* [3C] - address of sector contain 51 exts */ + char filegrow; /* [3F] - extent increase amount; + 0 = dynamic,chop at close + n = filesize/n,no chop */ +}; /* (fdb len = 64) */ +@fsa +fsa (THEOS) File Save Area +#include +struct fsa { + near struct diskucb *fsa_ucb; /* [00] - file ucb */ + long fsa_sect; /* [02] - fdb sector address */ + near struct fdb *fsa_ofs; /* [06] - fdb offset within sector */ + short fsa_count; /* [08] - open fcb count */ + char fsa_lock; /* [0A] - file locked: + 76543210 + ��� deny read + ��� deny write */ + char fsa_write; /* [0B] - file modified if non zero */ + char fsa_temp; /* [0C] - erase at final close */ + char fsa_1[3]; /* [0D] - not used */ + char filestat; /* [10] - file status: + 0x10 normal stream + 0x08 direct + 0x04 keyed + 0x02 indexed */ + unsigned short fileowner; /* [11] - owner id */ + char protect; /* [13] - protection code: + 0x8? shared erase protect + 0x4? shared execute protect + 0x2? shared write protect + 0x1? shared read protect + 0x?8 erase protect + 0x?4 execute protect + 0x?2 write protect + 0x?1 read protect */ + union { + struct { + year : 6; /* years since 1986 [0 - 31] */ + month : 4; /* month [1 - 12] */ + day : 5; /* day [1 - 31] */ + hour : 5; /* hour [0 - 23] */ + min : 6; /* minute [0 - 59] */ + sec : 6; /* second [0 - 59] */ + } new; + struct { + char type; /* code 0=old,!0=new */ + year : 4; /* years since 1980 [0 - 15] */ + month : 4; /* month [1 - 12] */ + day : 5; /* day [1 - 31] */ + hour : 5; /* hour [0 - 23] */ + min : 6; /* minute [0 - 59] */ + : 0; + } old; + unsigned long datetime; + } filedate; /* [14] - date & time of last write */ + long filesize; /* [18] - file size in bytes */ + unsigned short reclen; /* [1C] - record length */ + unsigned short keylen; /* [1E] - key len */ + struct { + unsigned short ext_ct; /* [20] - sector count */ + char ext_addr[3]; /* [22] - sector address */ + } extlev1[5]; + char extlev2a[3]; /* [39] - addr of sector with 51 ext */ + char extlev2b[3]; /* [3C] - addr of sector with 51 ext */ + char filegrow; /* [3F] - extent growth factor */ +}; /* (fsa len = 64) */ + +#define FSASEG 0x0088 +@filedate +filedate (JMD) File's date and time structure +#include +typedef union filedate { /* date & time of last write */ + struct { + year : 6; /* years since 1986 [0-31] = [1986-2017] */ + month : 4; /* month [1-12] */ + day : 5; /* day [1-31] */ + hour : 5; /* hour [0-23] */ + min : 6; /* minute [0-59] */ + sec : 6; /* second [0-59] */ + } new; + struct { + type : 8; /* Type 0=old,!0=new */ + year : 4; /* years since 1980 [0-15] = [1980-1995] */ + month : 4; /* month [1-12] */ + day : 5; /* day [1-31] */ + hour : 5; /* hour [0-23] */ + min : 6; /* minute [0-59] */ + } old; + tetd_t datetime; +} FILEDATE; +@tetd_t +tetd_t (JMD) Packed file's date and time +#include +typedef unsigned long tetd_t; +@lconv +lconv (ANSI) Locale structure +#include +struct lconv { + char *decimal_point; + char *thousands_sep; + char *grouping; + char *int_curr_symbol; + char *currency_symbol; + char *mon_decimal_point; + char *mon_thousands_sep; + char *mon_grouping; + char *positive_sign; + char *negative_sign; + char int_frac_digits; + char frac_digits; + char p_cs_precedes; + char p_sep_by_space; + char n_cs_precedes; + char n_sep_by_space; + char p_sign_posn; + char n_sign_posn; +}; + +#define LC_ALL 31 +#define LC_COLLATE 1 +#define LC_CTYPE 2 +#define LC_NUMERIC 4 +#define LC_TIME 8 +#define LC_MONETARY 16 +@complex +complex (UNIX) Complex number +#include +struct complex { + double x; + double y; +}; +@nuc +nuc (THEOS) Nucleus data structure +#include +struct nuc { + char pad1[4]; /* [00] filler */ + struct { + char year; /* [04] year - 1900 */ + char month; /* [05] month (1 - 12) */ + char day; /* [06] day of month (1 - 31) */ + char hour; /* [07] hour of day (0 - 23) */ + char min; /* [08] minute of hour (0 - 59) */ + char sec; /* [09] second of minute (0 - 59) */ + } time_of_day; /* [04] system date & time */ + char dateopt; /* [0A] date option: */ + #define kanji 1 /* 16 bit Japanese Kanji */ + #define extime 2 /* external clock chip */ + #define exdate 4 /* external date chip */ + #define havusr 8 /* have USER module */ + #define aform 16 /* American MM/DD/YY */ + #define eform 32 /* European DD-MM-YY */ + #define iform 64 /* International YY.MM.DD */ + #define whist 128 /* write history records */ + char curpid; /* [0B] current process number */ + char cpu[4]; /* [0C] cpu */ + near char *curpcb; /* [10] current PCB pointer */ + unsigned short slice; /* [12] slice interval (msec) */ + near char *mstick; /* [14] address of msec tick */ + near char *snutick; /* [16] address of snu tick */ + unsigned short spoolseg; /* [18] DESPOOL segment */ + char version[5]; /* [1A] version number */ + char mfgnum; /* [1F] manufacturer number */ + unsigned short sernum; /* [20] serial number */ + long csisize; /* [22] SYSTEM.THEOS386.CSI filesize */ + struct { + unsigned short size; + char addr[3]; + } csiext[4]; /* [26] SYSTEM.THEOS386.CSI extent info */ + unsigned short csistack; /* [3A] SYSTEM.THEOS386.CSI stack len */ + char errmsg[3]; /* [3C] SYSTEM.THEOS386.MESSAGE extent info */ + unsigned short pdlseg; /* [3F] segment of PDL */ + unsigned pipenum; /* [41] next pipe number */ + char npxpid; /* [43] 80287/80387 owner pid */ + char slpcnt; /* [44] number of sleepers */ + char spdrv; /* [45] SYSTEM.SPOOLER drive */ + char sppid; /* [46] spooler pid */ + char snu_val[3]; /* [47] select next user */ + long cputime; /* [4A] time of day in msec (software) */ + short cache_seg; /* [4E] directory cache head segment */ + char srlo; /* [50] SunRiver */ + char public[26]; /* [51] public drive list A-Z */ + near char *rpb; /* [6B] RPB head seg address */ + char srhi; /* [6D] SunRiver */ + near char *rlt; /* [6E] RLT head offset address */ + unsigned pipe_hd; /* [70] PIPE head segment */ + near char *teb; /* [72] TEB head offset address */ + char tz[12]; /* [74] time zone info */ + unsigned short svdeb; /* [80] DEBUG386 use */ + long csicode; /* [82] SYSTEM.THEOS386.CSI code length */ + unsigned short msgseg; /* [86] SYSTEM.THEOS386.MESSAGE segment */ + char msgnum; /* [88] SYSTEM.THEOS386.MESSAGE suffix */ + char sync_pid; /* [89] process id of sync'er */ + unsigned short keyseg; /* [8A] SYSTEM.THEOS386.KEYWORD segment */ + char keynum; /* [8C] SYSTEM.THEOS386.KEYWORD suffix */ + char mca; /* [8D] cpu flags: */ + + #define MCA_BUS 1 + #define EISA_BUS 2 + #define ISA_BUS 32 + + #define CPU_286 64 + #define CPU_386 16 + #define CPU_486 4 + + #define FPU 8 + + #define MDOS_VER 128 + + unsigned mem_size; /* [8E] memory size at bootup */ + unsigned shmemseg; /* [90] shared memory segment */ + char sysname[16]; /* [92] system identification */ + unsigned short synseg; /* [A2] SYSTEM.THEOS386.SYNONYM segment */ + char synnum; /* [A4] SYSTEM.THEOS386.SYNONYM suffix */ + unsigned short devseg; /* [A5] SYSTEM.THEOS386.DEVNAMES segment */ + unsigned short gucb; /* [A7] VDI UCB segment address */ + char dflang; /* [A9] default language code */ + short cache_delay; /* [AA] cache write delay in .1 seconds */ + unsigned short accseg; /* [AC] ACCOUNT segment address */ + unsigned short csidata; /* [AE] SYSTEM.THEOS386.CSI data length */ + unsigned short csiheap; /* [B0] SYSTEM.THEOS386.CSI heap length */ + unsigned long pdbr; /* [B2] Page Descriptor Base reg */ + unsigned short ptseg; /* [B6] Page Table Selector */ + unsigned short v86seg; /* [B8] V86 Monitor segment */ + char v86pids[32]; /* [BA] V86 pid masks */ + unsigned char v86count; /* [DA] V86 Monitor count */ + char v86_inuse; /* [DB] set while loading V86 */ + unsigned short network; /* [DC] Network phantom pid */ + unsigned short ncb_seg; /* [DE] Network socket control block segment */ + short v86reserve; /* [E0] V86 reserve I/O segment */ + unsigned short flt_seg; /* [E2] File Lock Table */ + char copyright[28]; /* [E4] copyright notice */ + char ucb[1]; /* [100] Unit control blocks */ +}; +@pcb +pcb (THEOS) Process Control Block +#include +struct pcb { + unsigned short pstat; /* [00] - process status: */ + #define WAITING 0x00ff /* if non zero,waiting,else either \ + running or ready to run */ + #define W_INT 0x0001 /* set if waiting for interrupt */ + #define W_LOCK 0x0002 /* set if waiting for resource lock */ + #define W_SCREEN 0x0004 /* waiting for screen switch */ + #define SLEEPING 0x0008 /* set if sleeping */ + #define STOPPED 0x0010 /* set if stopped */ + #define W_PAUSE 0x0020 /* set if BREAK-S */ + #define W_SEMA 0x0040 /* set if waiting for semaphore */ + #define SR_PAGE 0x0100 /* set if need cntx swtch THEO+Grafx */ + #define MUST_COMPLETE 0x0200 /* set if task cannot be context + switched away */ + + unsigned short tib; /* [02] - TSS selector */ + + unsigned short pending; /* [04] - traps pending */ + #define QUITPEND 0x0001 /* set if BREAK-Q pending */ + #define CANPEND 0x0002 /* set if BREAK-C pending */ + #define ALRMPEND 0x0004 /* set if alarm pending */ + #define OVFPEND 0x0008 /* set if overflow/underflow pending */ + #define DIV0PEND 0x0010 /* set if divide by zero pending */ + #define FUNPEND 0x0020 /* set if function error pending */ + #define BOUNDPEN 0x0040 /* set if array bounds pending */ + #define FPEPEND 0x0080 /* set if floating point exception */ + #define SESSPEND 0x0200 /* set if need to switch sessions */ + #define FORCPEND 0x1000 /* set if FORCE pending */ + #define DEBPEND 0x2000 /* set if BREAK-D pending */ + #define KILLPEND 0x4000 /* set if kill syscall pending */ + #define STAGE 0x8000 /* set if staging the trap */ + + char taskprty; /* [06] - priority level */ + char tasklev; /* [07] - task level,0 == main task */ + unsigned long cputime; /* [08] - amount of CPU time */ + unsigned long sleeptime; /* [0C] - sleep time remain */ + near struct pcb *prtylink; /* [10] - link to next PID same prty */ + unsigned char taskfath; /* [12] - PID of parent task */ + char waitsema; /* [13] - semaphore if W_SEMA */ +}; +@pdl +pdl (THEOS) Public Device List +#include +struct pdl { + char ucbnum; /* ucb index */ + char pid; /* owner pid + 1 */ + short open_ct; /* number of opens */ +}; +@pipehdr +pipehdr (THEOS) PIPE control structure +#include +struct pipehdr { + unsigned pnext; /* fwd link to next pipe */ + unsigned pprev; /* back link to prev pipe */ + char pname[16]; /* pipe name (space pad) */ + char prd_ct; /* reader count */ + char pwr_ct; /* writer count */ + char prd_pid; /* pid of read waiter */ + char pwr_pid; /* pid of write waiter */ + unsigned psize; /* size of pipe buffer (exclude header) */ + unsigned pcount; /* number of chars in buffer */ + unsigned phead; /* read offset */ + unsigned ptail; /* write offset */ + char pbuf[]; /* pipe circular buffer */ +}; +@rlt +rlt (THEOS) Rocord Lock Table +#include +struct rlt { + short fsa_num; /* [00] - fsa number */ + unsigned char lockpid; /* [02] - locking pid plus one */ + long lockad; /* [03] - byte address */ + near struct rlt *fwd_rlt; /* [07] - fwd ptr to next */ +}; /* rlt len = 9 bytes */ +@scr +scr (THEOS) System Communication Region +#include +struct scr { + char logonname[8]; /* [00] - user name */ + unsigned short usernum; /* [08] - user number */ + char logdate[3]; /* [0A] - logon date */ + char logtime[3]; /* [0D] - logon time */ + unsigned char conmask; /* [10] - console mask: + 76543210 + �������� = 1st char ctl is ok + �������� = suppress output if stack + �������� = stacked lines + �������� = no page wait + �������� = output suppress + �������� = inverted case + �������� = upper case + �������� = echo mode */ + unsigned char csisw; /* [11] - csi switch: + 76543210 + �������� = return from logon + �������� = execute csi command + �������� = from exec + �������� = nomsg + �������� = rdymsg + �������� = usersyn + �������� = stdsyn + �������� = abbrev */ + unsigned char execsw; /* [12] - exec switch: + 76543210 + �������� = CSI lower case + �������� = error + �������� = noecho + �������� = trace + �������� = ctl on */ + char pgmtime[3]; /* [13] - program start time */ + char pgmname[8]; /* [16] - program name */ + unsigned short execloc; /* [1E] - location in system.exec */ + near char *slofs; /* [20] - stacked line offset */ + unsigned short slseg; /* [22] - stacked line segment */ + near char *memhead; /* [24] - malloc head */ + char pipenr; /* [26] - next pipe number (0-25) */ + char privlev; /* [27] - privlege level */ + char lub[52]; /* [28] - lub table + unsigned short trapseg; /* [5C] - signal code segment */ + near void *quittrap; /* [5E] - break,q trap */ + near void *cantrap; /* [60] - break,c trap */ + near void *alrmtrap; /* [62] - alarm trap */ + near void *ovftrap; /* [64] - overflow/underflow trap */ + near void *div0trap; /* [66] - divide by zero trap */ + near void *funtrap; /* [68] - function argument trap */ + near void *boundtrap; /* [6A] - array bounds trap */ + near void *fpetrap; /* [6C] - floating point except trap */ + long cputimes; /* [6E] - cpu time start */ + char err_ext[3]; /* [72] - SYSTEM.THEOS.MESSAGE xtent */ + char workdrive; /* [75] - default work drive */ + char searchseq[26]; /* [76] - search sequence */ + unsigned char foreign; /* [90] - Foreign language switch + 76543210 + ����.... = language code + �������� = not used + �������� = THEOS/Z80 style modify + �������� = no quit + �������� = decimal is comma */ + char deflib[19]; /* [91] - default library */ + char cmdlib[9]; /* [A4] - cmd library */ + char maclib[9]; /* [AD] - macro library */ + char objlib[9]; /* [B6] - object library */ + char copylib[9]; /* [BF] - copy library */ + char linklib[9]; /* [C8] - link library */ + char synfile[9]; /* [D1] - synonym file */ + unsigned short comad; /* [DA] - BASIC286 common seg addr */ + char conbuf[8]; /* [DC] - console buffer (ungetch) */ + char tsb[16]; /* [E4] - tab set block */ + char cmdbuf[140]; /* [F4] - cmd storage */ + unsigned short quittraphi; /* [180] - high word */ + unsigned short cantraphi; /* [182] - high word */ + unsigned short alrmtraphi; /* [184] - high word */ + unsigned short ovftraphi; /* [186] - high word */ + unsigned short div0traphi; /* [188] - high word */ + unsigned short funtraphi; /* [18A] - high word */ + unsigned short boundtraphi; /* [18C] - high word */ + unsigned short fpetraphi; /* [18E] - high word */ + unsigned short memheadhi; /* [190] - high word */ + unsigned short cebphi; /* [192] - high word */ + unsigned short clev; /* [194] - call csi level */ + unsigned short cexec; /* [196] - execloc at call csi */ + near void *cebp; /* [198] - ebp at call csi */ + unsigned short cnlev; /* [19A] - next call csi level */ + char echo; /* [19C] - set if echoing */ + char echolub; /* [19D] - echo device */ + short echobuf; /* [19E] - buffer seg,if disk echo */ + short echofsa; /* [1A0] - fsa number */ + short echokl; /* [1A2] - offset if echo to spool */ + short echorl; /* [1A4] - page# if echo to spool */ + unsigned char echoct; /* [1A6] - buffer char ct */ + char loadtrap; /* [1A7] - debug trap on load */ + unsigned short snbseg; /* [1A8] - sema name block seg */ + char semaphor[8]; /* [1AA] - 64 semaphore bits */ + char sp_ll[4]; /* [1B2] - spool prt line len */ + char sp_pl[4]; /* [1B6] - spool prt page len */ + char sp_que[4]; /* [1BA] - spool prt que number */ + char sp_copies[4]; /* [1BE] - spool prt # copies */ + char sp_class[4]; /* [1C2] - spool prt class */ + char graphlub[4]; /* [1C6] - graphic lub number */ + unsigned short graphwork[4]; /* [1CA] - graphic work buffer */ + char graphdev[4]; /* [1D2] - graphic device number */ + char peeker; /* [1D6] - peeker pid number + 1 */ + char peekch; /* [1D7] - char to be peeked */ + char forcech; /* [1D8] - char from FORCE command */ + char cache_write_thru; /* [1D9] - set if write thru cache */ + unsigned short main_scr; /* [1DA] - alias to main task SCR */ + unsigned short main_data; /* [1DC] - alias to main task DATA */ + unsigned short atexit_ofshi; /* [1DE] - high word */ + char fill2[6]; /* [1E0] - filler */ + unsigned char lock_wait; /* [1E6] - seconds to wait for lock */ + unsigned char lock_remain; /* [1E7] - number seconds remain */ + char slave_ll; /* [1E8] - slave printer line length */ + char slave_pl; /* [1E9] - slave printer page length */ + char slave_ol; /* [1EA] - slave printer overflow */ + char slave_cl; /* [1EB] - slave printer cur line */ + char slave_cc; /* [1EC] - slave printer class code */ + unsigned short slave_seg; /* [1ED] - slave printer class seg */ + unsigned short environ_seg; /* [1EF] - segment of environment */ + near char *atexit_ofs; /* [1F1] - at exit offset */ + unsigned short atexit_seg; /* [1F3] - at exit segment */ + char csi_color[4]; /* [1F5] - normal crt color */ + unsigned cmdnum; /* [1F9] - command number */ + char fill3[5]; /* [1FB] - filler */ +}; /* length = 512 */ +@jmp_buf +jmp_buf (THEOS) Non-Local Jumps +#include +struct FarPointer { + void *ptr; + short seg; +}; + +typedef struct jmp_buf { + struct FarPointer _jmp_eip; /* return pointer */ + struct FarPointer _jmp_esp; /* stack pointer */ + void *_jmp_ebp; /* frame pointer */ + long _jmp_reg[3]; /* registers */ +} jmp_buf; +@tm +tm (ANSI) Date and time structure +#include +struct tm { + short tm_sec; /* seconds after the minute [0,60] */ + short tm_min; /* minutes after the hour [0,59] */ + short tm_hour; /* hours since midnight [0,23] */ + short tm_mday; /* day of the month [1,31] */ + short tm_mon; /* months since January [0,11] */ + short tm_year; /* years since 1900 */ + short tm_wday; /* days since Sunday [0,6] */ + short tm_yday; /* days since January 1 [0,365] */ + short tm_isdst; /* Daylight Savings Time flag */ +}; +@ucb +ucb (THEOS) Unit Control Block for character devices +#include +struct ucb { + unsigned short devaddr; /* [00] - memory address,offset always 0 */ + unsigned short iobuff1; /* [02] - i/o buffer 1 */ + char devnr; /* [04] - device number */ + char devunit; /* [05] - unit within device */ + unsigned short ubuf_ofs2; /* [06] - high ubuf_ofs pointer */ + char devtype; /* [08] - device type: + 76543210 + �����100 byte i/o + �������� = console + �������� = 2nd char of DCA + �������� = 3rd char of DCA + �������� = keyboard off + �������� = 2nd char of BREAK */ + char devowner; /* [09] - owner process id */ + char classnr; /* [0A] - class number */ + char ll; /* [0B] - line length */ + char pl; /* [0C] - page length */ + char ol; /* [0D] - overflow lines */ + char baud; /* [0E] - baud rate: + 76543210 + xxxx.... If Sync option bit: + 0001.... BSC + 0010.... SDLC + 0011.... HDLC + 0100.... X.25 + 0101.... SNA + 0110.... GPIB + 0111.... thru 1111.... user defined + ....xxxx ASYNC baud rates: + 0 = no software baud + 1 = 56000 + 2 = 38400 + 3 = 110 + 4 = 135 + 5 = 150 + 6 = 300 + 7 = 600 + 8 = 1200 + 9 = 1800 + 10 = 2400 + 11 = 3600 + 12 = 4800 + 13 = 7200 + 14 = 9600 + 15 = 19200 + ....xxxx SYNC baud rates: + 1 = 1200 + 2 = 2400 + 3 = 4800 + 4 = 9600 + 5 = 19200 + 6 = 38400 + 7 = 48000 + 8 = 56000 + 9 = 64000 + 10 = 100000 + 11 = 200000 + 12 = 500000 + 13 = 800000 */ + char lfdly; /* [0F] - line feed delay */ + char ffdly; /* [10] - form feed delay */ + char option; /* [11] - option byte: + 76543210 + 00...... no parity + 01...... parity zero + 10...... parity odd + 11...... parity even + ..1..... synchronous + ...1.... alf + ....1... 8 bit words + .....001 dtr enable (1) + .....010 xon/xoff enable (2) + .....011 etx/ack enable (3) + .....100 cts enable (4) + .....101 xpc (5) */ + char curline; /* [12] - current line system use */ + char curcol; /* [13] - current column system use */ + unsigned short transeg; /* [14] - translate segment addr */ + near void *ubuf_ofs; /* [16] - user buffer offset */ + unsigned short ubuf_seg; /* [18] - user buffer segment */ + char scantmp; /* [1A] - scan code temporary */ + char prot_st; /* [1B] - protocol (XON/XOFF) status */ + char scan_st; /* [1C] - scan code status: + 76543210 + ��������� = shift + ��������� = compose + ��������� = ctl + ��������� = alt + ��������� = scroll lock + ��������� = num lock + ��������� = caps lock + ��������� = Kanji mode */ + char brk_chr; /* [1D] - break character */ + short attrib; /* [1E] - system use (saves crt attribute) + 5432109876543210 + ��������������� = protect + ��������������� = format + ��������������� = reverse + ��������������� = blink + ��������������� = underline + ��������������� = takes space + ��������������� = last was attr + ��������������� = caused newline + ��������������� = slave prt attached + ��������������� = slave prt enabled + ��������������� = esc mode + ��������������� = status mode + ��������������� = status ignore + ��������������� = last was prt cr + ��������������� = line graphic mode */ + /* ucb len = 32 */ +}; +@diskucb +diskucb (THEOS) Unit Control Block for disk devices +#include +struct diskucb { + unsigned short devaddr; /* [00] - memory address,offset always 0 */ + unsigned short iobuff1; /* [02] - i/o buffer 1 */ + char devnr; /* [04] - device number */ + char devunit; /* [05] - unit within device */ + unsigned short iobuff2; /* [06] - i/o buffer 2 */ + char devtype; /* [08] - device type: + 76543210 + .....001 = disk + ....1001 = disk,need label + .001.... = single density + .010.... = double density + .011.... = cyl0 = single,other dbl + .100.... = cyl0,hd0=128 other 256 + .101.... = 2048 byte sects + .110.... = 1024 byte sects + .111.... = 512 byte sects (IBM PC) + 0....... = removable volume + 1....... = fixed volume */ + char devowner; /* [09] - owner process id 0xff = public */ + char volname[8]; /* [0A] - volume id */ + unsigned short dirsize; /* [12] - directory size */ + short cyls; /* [14] - number of cylinders */ + char heads; /* [16] - number of heads */ + char sects; /* [17] - number of sectors */ + char hdldly; /* [18] - head load delay */ + char stpdly; /* [19] - step delay */ + char stsdly; /* [1A] - step settle delay */ + short curcyl; /* [1B] - current cylinder */ + char diskfill[3]; /* [1D] - work space 3 bytes */ + /* diskucb len = 32 */ +}; +@tapeucb +tapeucb (THEOS) Unit Control Block for tape devices +#include +struct tapeucb { + unsigned short devaddr; /* [00] - memory address,offset always 0 */ + unsigned short iobuff1; /* [02] - i/o buffer 1 */ + char devnr; /* [04] - device number */ + char devunit; /* [05] - unit within device */ + unsigned short iobuff2; /* [06] - i/o buffer 2 */ + char devtype; /* [08] - device type: + 76543210 + .....010 = tape */ + char devowner; /* [09] - owner process id */ + char volname[8]; /* [0A] - volume id */ + short blocknr; /* [12] - block count */ + short filenr; /* [14] - file number */ + short volnr; /* [16] - volume number */ + char devtrack; /* [18] - tape track or channel number */ + unsigned short iostat; /* [19] - status of last I/O */ + unsigned short rdlen; /* [1B] - length of last read */ + char tapefill[3]; /* [1D] - filler,tapeucb len = 32 */ +}; +@diskcntl +diskcntl (THEOS) Extended I/O structure for disk devices +#include +struct diskcntl { + short c_cmd; /* command code: + 0 = home heads to cylinder 0 + 1 = return drive status (MFG dependent) + 2 = read sectors + 3 = write sectors + 4 = format (MFG dependent) + 99 = land heads to safe landing zone */ + long c_sect; /* sector number */ + char *c_buf; /* buffer offset */ + unsigned short c_seg; /* buffer segment */ + short c_count; /* sector count */ + short c_cyl; /* cylinder number (format) */ + short c_head; /* head number (format) */ + short c_den; /* density (format) */ +}; +@bytecntl +bytecntl (THEOS) Extended I/O structure for character devices +#include +struct bytecntl { + short c_cmd; /* command code: + 1 = buffer status: + 76543210 + ��� = TxBUF not full + ��� = RxBUF not empty + 2 = modem status: + 5432109876543210 + 111100001111����� = DSR + 111100001111����� = CTS + 111100001111����� = RI + 111100001111����� = DCD + 3 = send break + 4 = use c_seg:c_buf input buffer: + struct { + short buf_len; + short buf_count; + short next_store; + short next_fetch; + char buf[buf_len]; + }; + 5 = raise DTR modem control + 6 = drop DTR modem control + 7 = raise RTS modem control + 8 = drop RTS modem control */ + short c_word1; + short c_word2; + char *c_buf; /* offset to buffer */ + unsigned short c_seg; /* selector for buffer */ +}; +@tapecntl +tapecntl (THEOS) Extended I/O structure for tape devices +#include +struct tapecntl { + short c_cmd; /* command code: + 1 = status: + 76543210 + ������ = BOT + ������ = EOT + ������ = Write Protect + ������ = Ready + ������ = Streamer + 2 = rewind + 3 = rewind & unload + 4 = write tape mark + 7 = erase tape (format) + 8 = re-tension + 9 = get length of last read + 110 = read + 111 = write */ + unsigned short c_tseg; /* read/write segment */ + char *c_tbuf; /* read/write offset */ + unsigned short c_tlen; /* read/write length */ +}; +@utimbuf +utimbuf (UNIX) File time modification structure +#include +struct utimbuf { + time_t actime; + time_t modtime; +}; +@VDIPB +VDIPB (THEOS) Vdi Parameters Block +#include +typedef struct { + short *control; + short *intin; + short *ptsin; + short *intout; + short *ptsout; + short vdinum; + unsigned vdiseg; +} VDIPB; +@UBUFFER +UBUFFER (THEOS) User Buffering +#include <_ucb.h> +typedef struct ubuffer { + short buf_len; + volatile short buf_count; + volatile short next_store; + volatile short next_fetch; + char buf[]; +} UBUFFER; +@lub +lub (THEOS) Device Logical Unit Blocks Numbers +#include +enum lub { + ADISK,BDISK,CDISK,DDISK,EDISK,FDISK,GDISK,HDISK,IDISK,JDISK, + KDISK,LDISK,MDISK,NDISK,ODISK,PDISK,QDISK,RDISK,SDISK,TDISK, + UDISK,VDISK,WDISK,XDISK,YDISK,ZDISK, + CONI,CONO, + PRT1,PRT2,PRT3,PRT4, + COM1,COM2,COM3,COM4, + TAP1,TAP2,TAP3,TAP4, + COM5,COM6,COM7,COM8,COM9,COM10,COM11,COM12,COM13,COM14,COM15, + COM16 +}; +@ diff --git a/libhelp/c.hlp b/libhelp/c.hlp new file mode 100644 index 0000000..acbbeca --- /dev/null +++ b/libhelp/c.hlp @@ -0,0 +1,4628 @@ +@_bios_keybrd +_bios_keybrd (MSVC) Return the keyboard status or keycode +#include +#include +unsigned short _bios_keybrd(unsigned short service) +See also: mapdoskey +@_errarg +_errarg (THEOS) Variable used by error message functions +#include +extern char *_errarg; +See also: strerror +@_errnum +_errnum (THEOS) External integer for return of error status +#include +extern short _errnum; +Functions setting _errnum: access,chdir,clearerr,diropen,erase,fclear,fclose, +fcreate,fopen and derivates,getmsg,mkdir,open,remove,rename,rmdir,topen,unlink +See also: errno,fperror +@_incrmem +_incrmem (THEOS) ??? +#include +char *_incrmem(size_t len); +@_mfg_get_date +_mfg_get_date (THEOS) Copy hardware date into the nuc structure +#include +void _mfg_get_date(void); +See also: _mfg_get_time,_mfg_put_date,_mfg_put_time +@_mfg_get_time +_mfg_get_time (THEOS) Copy hardware time into the nuc structure +#include +void _mfg_get_time(void); +See also: _mfg_get_date,_mfg_put_date,_mfg_put_time +@_mfg_init +_mfg_init (THEOS) Initialise system hardware +#include +long _mfg_init(long addr,long *store); +@_mfg_put_date +_mfg_put_date (THEOS) Copy date from the nuc structure to hardware +#include +void _mfg_put_date(void); +See also: _mfg_get_date,_mfg_get_time,_mfg_put_time +@_mfg_put_time +_mfg_put_time (THEOS) Copy time from the nuc structure to hardware +#include +void _mfg_put_time(void); +See also: _mfg_get_date,_mfg_get_time,_mfg_put_date +@_mfg_reserved +_mfg_reserved (THEOS) ??? +#include +void _mfg_reserved(void) +@_monthen +_monthen (THEOS) Return the number of days in a month +#include <_time.h> +short _monthen(short year,short month); +See also: leapyear,_yday +@_msec_off +_msec_off (THEOS) Turn off millisecond timing +#include +void _msec_off(void); +See also: msec_on +@_msec_on +_msec_on (THEOS) Turn on millisecond timing +#include +void _msec_on(void); +See also: msec_off +@_read +_read (THEOS) Read data from a file into any segment +#include +size_t _read(short fd,unsigned seg,void *buf,size_t len); +See also: close,creat,filelength,flush,lseek,open,read,tell,_write,write +@_rsvmem +_rsvmem (THEOS) ??? +#include +short *_rsvmem(long addr,long len,short code); +@_sched_int +_sched_int (THEOS) Schedule interrupt +#include +void _sched_int(short num,short (*addr)()); +@_set_slice +_set_slice (THEOS) Set the user time slice +#include +void _set_slice(short msec); +@_sema_isr +_sema_isr (THEOS) ??? +#include +_sema_isr(short pid,short num,short cmd); +@_setargv +_setargv (+THEOS) Expand wild cards argument to the list of matching files +#include <_stdlib.h> +short _setargv(short *pargc, char ***pargv); +Set : errno +@_sync +_sync (THEOS) Flush the cache +#include +void _sync(short code); +@_weekday +_weekday (THEOS) Return the number of the day in the week +#include <_time.h> +See also: leapyear,_monthen,_yday +@_write +_write (THEOS) Write data to a file from another memory segment +#include +size_t _write(short fd,unsigned seg,void *buf,size_t len); +See also: close,creat,filelength,flush,lseek,open,_read,read,tell,write +@_yday +_yday (THEOS) Return the number of days since the beginning of the year +@a64l +a64l (UNIX) Convert a number from a base-64 ASCII string to a long integer +#include +long a64l(const char *s); +See also: l64a +@abort +abort (ANSI) End program immediately +#include +void abort(void); +See also: exit +@abs +abs (ANSI) Return the absolute value of an integer +#include +short abs(short n); +See also: fabs +@access +access (UNIX) Check if a file can be accessed in a given mode +#include +short access(const char *filename,short mode); +mode : 0 existence, 1 execution, 2 write, 4 read +Set : errno,_errnum +See also: fperror,strerror +@acos +acos (ANSI) Calculate arc cosine +#include +double acos(double x); +@acot +acot (THEOS) Calculate arc cotangent +#include +double acot(double x); +@acsc +acsc (THEOS) Calculate arc cosecant +#include +double acsc(double x); +Set : errno +@addb +addb (THEOS) Add a value to a byte in another memory segment +#include +void addb(void *ofs,unsigned seg,char val); +See also: Other add functions +@addcs +addcs (THEOS) Add a value to a byte in the code segment +#include +void addcs(void *ofs,char val); +See also: Other add functions +@addl +addl (THEOS) Add a value to a long in another memory segment +#include +void addl(void *ofs,unsigned seg,long val); +See also: Other add functions +@addlcs +addlcs (THEOS) Add a value to a long in the code segment +#include +void addlcs(void *ofs,long val); +See also: Other add functions +@addw +addw (THEOS) Add a value to a word in another memory segment +#include +void addw(void *ofs,unsigned seg,short val); +See also: Other add functions +@addwcs +addwcs (THEOS) Add a value to a word in the code segment +#include +void addwcs(void *ofs,short val); +See also: Other add functions +@alarm +alarm (UNIX) Start a timer in seconds generating a signal interrupt +#include +short alarm(short secs); +See also: delay,msalarm,signal +@andb +andb (THEOS) And a value to a byte in another memory segment +#include +void andb(void *ofs,unsigned seg,char mask); +See also: Other and functions +@andcs +andcs (THEOS) And a value to a byte in the code segment +#include +void andcs(void *ofs,char mask); +See also: Other and functions +@andl +andl (THEOS) And a value to a long in another memory segment +#include +void andl(void *ofs,unsigned seg,long mask); +See also: Other and functions +@andlcs +andlcs (THEOS) And a value to a long in the code segment +#include +void andlcs(void *ofs,long mask); +See also: Other and functions +@andw +andw (THEOS) And a value to a word in another memory segment +#include +void andw(void *ofs,unsigned seg,short mask); +See also: Other and functions +@andwcs +andwcs (THEOS) And a value to a word in the code segment +#include +void andwcs(void *ofs,short mask); +See also: Other and functions +@asctime +asctime (ANSI) Convert time structure to ASCII string +#include +char *asctime(const struct tm *tmp); +See also: ctime,gmtime,localtime,mktime,strftime,time +@asec +asec (THEOS) Calculate arc secant +#include +double asec(double x); +Set : errno +@asin +asin (ANSI) Calculate inverse sine +#include +double asin(double x); +Set : errno +@assert +assert (ANSI) Check assertion at run time +#include +void assert(short expression); +@assert +#assert (ANSI) Check assertion at compile time +#assert expression +@at +at (THEOS) Position the cursor on the console +#include +void at(short x,short y); +See also: putch +@atan +atan (ANSI) Calculate inverse tangent +#include +double atan(double x); +@atan2 +atan2 (ANSI) Calculate inverse tangent +#include +double atan2(double num,double den); +Set : errno +@atexit +atexit (ANSI) Specifie a routine to call at normal exit time +#include +short atexit(void (*func)(void)); +See also: exit +@atof +atof (ANSI) Convert ASCII string to floating point +#include +double atof(const char *string); +See also: ftoa,strtod +@atoi +atoi (ANSI) Convert ASCII string to integer +#include +short atoi(const char *string); +Set : errno +See also: itoa +@atol +atol (ANSI) Convert ASCII string to long integer +#include +long atol(const char *string); +Set : errno +See also: ltoa,strtol,strtoul,ultoa +@bcd2ieee +bcd2ieee (THEOS) Convert a bcd floating point to ieee floating point +#include +void bcd2ieee(double *data); +See also: ieee2bcd +@bsearch +bsearch (ANSI) Perform a binary search in a sorted array +#include +void *bsearch(const void *key,const void *array,size_t nbr_mbr,size_t size, + short (*compar)(const void *,const void *)); +See also: lfind,lsearch,qsort +@c3tol +c3tol (ANSI) Convert a three byte integer to a long integer +#include +long c3tol(const void *c); +See also: l3tol,ltoc3,ltol3 +@cabs +cabs (UNIX) Complex absolute value function +#include +double cabs(struct complex z); +@callcsi +callcsi (THEOS) See system +@calloc +calloc (ANSI) Allocate dynamic memory +#include +char *calloc(size_t count,size_t size); +See also: free,malloc,memset,realloc +@cclose +cclose (+THEOS) Close a serial communication file +#include +short cclose(FILE *port) +See also: ccloseall,cgetc,cputc,csetbuf,csetvbuf,getrxcnt,isrxempty,istxfull +@ccloseall +ccloseall (+THEOS) Close all serial communication files +#include +short ccloseall(void) +See also: cclose,cgetc,cputc,csetbuf,csetvbuf,getrxcnt,isrxempty,istxfull +@ceil +ceil (UNIX) Return the smallest integer greater than or equal to a value +#include +double ceil(double z); +See also: floor, round +@cgetc +cgetc (+THEOS) Read a character from a communication file +#include +short cgetc(FILE *port); +See also: cclose,ccloseall,cputc,csetbuf,csetvbuf,getrxcnt,isrxempty,istxfull +@cgets +cgets (ANSI) Accept a string from the console +#include +char *cgets(char *buffer,short len); +See also: getch,fgets,gets +@chdir +chdir (UNIX) Change the current directory +#include +short chdir(const char *path); +Set : errno,_errnum +See also: mkdir,rmdir +@chgrow +chrow (+THEOS) Set the grow factor of file +#include <_io.h> +short chgrow(char *fname,short grow); +See also: filechange +@chlen +chlen (+THEOS) Change the record length and key length of a file +#include <_io.h> +short chlen(char *fname,unsigned short reclen,unsigned short keylen); +@chmod +chmod (+UNIX) Change protections of a file +#include <_io.h> +short chmod(const char *fname,short prot); +@chorg +chorg (+THEOS) Change the organization mode of a file +#include <_io.h> +short chorg(char *fname,unsigned short filestat); +@chown +chown (+UNIX) Change the owner of a file +#include <_io.h> +short chown(const char *fname,short uid,short gid); +@clearerr +clearerr (ANSI) Clear the end-of-file and error status of a file +#include +clearerr(FILE *fp); +Set : _errnum +See also: feof,ferror +@cld +cld (THEOS) Clear direction flag +#include +void cld(void); +See also: std +@cli +cli (THEOS) Clear interrupt +#include +void cli(void); +See also: sti +@clock +clock (ANSI) Get number of clock ticks since system boot +#include +clock_t clock(void); +See also: time +@clock_t +clock_t (ANSI) Type used for the number of clock ticks since system boot +#include +typedef long clock_t; +@close +close (UNIX) Close a file +#include +short close(short fd); +See also: creat,filelength,flush,lseek,open,_read,read,tell,_write,write +@closedir +closedir (+UNIX) Close the directory search +#include +void closedir(DIR*); +See also: opendir,readdir,seekdir,telldir,rewinddir +Set : errno +@con_tran +con_tran (THEOS) Test and translate system control codes +#include +short con_tran(struct ucb *ucb,short ch,unsigned seg,void *buf); +@conmask +conmask (THEOS) Set the console control mask +#include +void conmask(const char *s); +@conin +conin (THEOS) Read character from console +See getch +@conout +conout (THEOS) Display character on the console +See putch +@conrdy +conrdy (THEOS) Test if characters are available on the console +short conrdy(void); +@cos +cos (ANSI) Calculate cosine +#include +double cos(double radian); +Set : errno +@cosh +cosh (ANSI) Calculate hyperbolic cosine +#include +double cosh(double radian); +@cot +cot (THEOS) Calculate cotangent +#include +double cot(double radian); +@coth +coth (THEOS) Calculate hyperbolic cotangent +#include +double coth(double radian); +@cprintf +cprintf (MSC) Format and print text to the console +#include +short cprintf(const char *format,...); +Note: Floating point conversions are not supported +See also: fprintf,printf,sprintf,vfprintf,vprintf,vsprintf +@cputc +cputc (+THEOS) Write a character to a communication file +#include +void cputc(FILE *port,short c); +See also: cclose,ccloseall,cgetc,csetbuf,csetvbuf,getrxcnt,isrxempty,istxfull +@cputs +cputs (ANSI) Write a string to the console +#include +void cputs(const char *s); +See also: cprintf,fputs,printf,putch,puts +@creat +creat (UNIX) Create/truncate a file +#include +short creat(const char *filename,short mode); +See also: close,filelength,flush,lseek,open,_read,read,tell,write,_write +@crt +crt (THEOS) See putchar +@crtcolor +crtcolor (THEOS) Change the colors of subsequent displays on the console +#include +void crtcolor(short fg,short bg,short rfg,short rbg); +See also: hascolor,CLASSGEN command +@csc +csc (THEOS) Calculate cosecant +#include +double csc(double radian); +@csch +csch (THEOS) Calculate hyperbolic cosecant +#include +double csch(double radian); +@csetbuf +csetbuf (+THEOS) Allocate an i/o buffer for a user buffered file +#include +void csetbuf(FILE *port,UBUFFER *buffer); +See also: cclose,ccloseall,cgetc,cputc,csetvbuf,getrxcnt,isrxempty,istxfull +@csetvbuf +csetvbuf (+THEOS) Allocate an i/o buffer for a user buffered file +#include +short csetvbuf(FILE *port,UBUFFER *buffer,short mode,size_t size); +See also: cclose,ccloseall,cgetc,cputc,csetbuf,getrxcnt,isrxempty,istxfull +@csi +csi (THEOS) Execute a CSI command without returning to the current program +#include +void csi(const char *command); +See also: system +@ctime +ctime (ANSI) Convert system time to an ASCII string +#include +char *ctime(const time_t *timep); +See also: asctime,localtime,mktime,strftime,time +@cuserid +cuserid (THEOS) Return the account name currently logged +#include +char *cuserid(char *account); +See also: getlogin,getuid,logname +@datehdng +datehdng (THEOS) Internal function used by testhead +@daylight +daylight (ANSI) Variable indicating if daylight time is used +#include +extern short daylight; +See also: timezone,tzset,tzname +@dec +dec (THEOS) Decrement a byte in another memory segment +#include +void dec(void *ofs,unsigned seg); +See also: Other dec functions +@deccs +deccs (THEOS) Decrement a byte in the code segment +#include +void deccs(void *ofs); +See also: Other dec functions +@deccsl +deccsl (THEOS) Decrement a long in the code segment +#include +void deccsl(void *ofs); +See also: Other dec functions +@deccsw +deccsw (THEOS) Decrement a word in the code segment +#include +void deccsw(void *ofs); +See also: Other dec functions +@decl +decl (THEOS) Decrement a long in another memory segment +#include +void decl(void *ofs,unsigned seg); +See also: Other dec functions +@decw +decw (THEOS) Decrement a word in another memory segment +#include +void decw(void *ofs,unsigned seg); +See also: Other dec functions +@define +#define (ANSI) Define a variable as manifest constant +#define constant value +@delay +delay (THEOS) Suspend operation for a given time +#include +void delay(unsigned code); +See also: alarm,msalarm,sleep +@deletek +deletek (THEOS) Delete a record from on indexed or keyed file +#include +short deletek(FILE *file,const char *key); +See also: readk,readn,readp,writek +@devname +devname (+THEOS) Return the name of a physical device +#include <_stdio.h> +char* devname(int lub); +See also: termname,ttyname,vdiname +@devopen +devopen (THEOS) Open or close a device +#include <_sc.h> +void devopen(struct ucb *ucb,short cmd); +cmd = 0 : open. cmd = 1 : close +@difftime +difftime (ANSI) Return difference between two times +#include +double difftime(time_t newtime,time_t oldtime); +@dir_mount +dir_mount (THEOS) ??? +#include <_sc.h> +void dir_mount(struct diskucb *ucb); +@dir_rd +dir_rd (THEOS) Read a sector in the directory +#include +void dir_rd(struct diskucb *ucb,long sect,void *buf); +@dirclose +dirclose (THEOS) Close the directory search +#include +void dirclose(void); +See also: diropen,dirread,find_first,find_next +@diropen +diropen (THEOS) Open the directory search for files in the current account +#include +short diropen(const char *fn); +Set : _errnum +See also: dirclose,dirread,find_first,find_next +@dirread +dirread (THEOS) Find the next file in the directory +#include +char *dirread(void); +See also: dirclose,diropen,find_first,find_next +@disk_capacity +disk_capacity (THEOS) ??? +#include <_sc.h> +short disk_capacity(short lub,void *disk_struct); +@display +display (THEOS) Display a string on the console +See cputs +@div +div (ANSI) Return the quotient and remainder of the division of two integers +#include +div_t div(short numer,short denomin); +See also: ldiv +@div_t +div_t (ANSI) Used by div +#include +typedef struct {short quot,rem;} div_t; +@dup +dup (UNIX) Duplicate a file descriptor +#include +short dup(short fd); +Set : errno +See also: close,creat,open +@elif +#elif (ANSI) Include code conditionally +#elif (expression); +@else +#else (ANSI) Include code conditionally +#else +@endif +#endif (ANSI) End conditional inclusion of code +#endif +@erase +erase (THEOS) Erase an existing file +See remove +@errbot +errbot (THEOS) Display a system message at the bottom of the console +#include +short errbot(short num,const char *arg[],short c1,short c2,short c3,short c4); +See also: errmsg,putmsg,syserr,yesno +@errmsg +errmsg (THEOS) Display a system message on stderr +#include +void errmsg(short num,const char *arg[]); +See also: errbot,perror,putmsg,strerror,syserr +@errno +errno (ANSI) External integer for return of error status +#include +extern short errno; +Functions setting errno: access,acos,acsc,asec,asin,atan2,atoi,atol,chdir,cos, +dup,erase,fgetc,fputc,fstat,locking,log,log10,log2,mkdir,open,perror,pow,remove, +rename,rmdir,signal,sin,sqrt,stat,unlink,utime +See also: _errnum,perror +@execl +execl (UNIX) Transfer control to a new program +#include +void execl(const char *program,const char *arg0,...,const char *argn,NULL) +See also: execlp,execv,execvp,forktask,system +@execlp +execlp (UNIX) Transfer control to a new program +#include +void execlp(const char *program,const char *arg0,...,const char *argn,NULL) +See also: execl,execv,execvp,forktask,system +@execv +execv (UNIX) Transfer control to a new program +#include +void execv(const char *program,const char *arg[]); +See also: execl,execlp,execvp,forktask,system +@execvp +execvp (UNIX) Transfer control to a new program +#include +void execvp(const char *program,const char *arg[]); +See also: execl,execlp,execv,forktask,system +@exit +exit (ANSI) Terminate a program +#include +void exit(short status); +See also: abort,atexit,csi +@exp +exp (ANSI) Compute exponential function +#include +double exp(double z); +@fabs +fabs (ANSI) Compute absolute value +#include +double fabs(double z); +@farcat +farcat (THEOS) Concatenate strings from different memory segments +#include +void *farcat(unsigned tseg,char *to,unsigned fseg,const char *from); +See also: strcat +@farchr +farchr (THEOS) Locate the first occurence of a byte in a string +#include +void *farchr(unsigned seg,const void *ofs,short c); +See also: memchr,strpbrk,strchr,strrchr,strstr +@farcmp +farcmp (THEOS) Compare two buffers in different memory segments +#include +short farcmp(unsigned seg1,const void *ofs1,unsigned seg2,const void *ofs2, + size_t len); +See also: fareq,memcmp,memeq,memicmp,strcmp,streq,stricmp,strncmp,strneq, + strnicmp +@farcpy +farcpy (THEOS) Copy one buffer to another buffer in another memory segment +#include +short farcpy(unsigned tseg,void *to,unsigned fseg,const void *from,size_t len); +See also: farcpy,memccpy,memcpy,memmove,memrcpy,strdup,strmake,strncpy +@fareq +fareq (THEOS) Compare two string in different memory segments for equality +#include +short fareq(unsigned seg1,const void *ofs1,unsigned seg2,const void *ofs2); +See also: farcmp,memcmp,memeq,memicmp,strcmp,streq,stricmp,strncmp,strneq, + strnicmp +@farlen +farlen (THEOS) Return the length of a string in another memory segment +#include +size_t farlen(unsigned seg,const char *ofs); +See also: strlen +@farset +farset (THEOS) Initialize a buffer in another memory segment +#include +void *farset(unsigned seg,void *ofs,short c,size_t len); +See also: memset,strnfill,strnset,strset +@fbuf +fbuf (THEOS) Allocate an i/o buffer for an open file +#include +void fbuf(FILE *stream,void *buffer,size_t len); +See also: setbuf,setvbuf,vbuf +@fclear +fclear (+THEOS) Clear a direct,indexed or keyed file +#include <_stdio.h> +short fclear(char *fname); +Set : _errnum +@fclose +fclose (ANSI) Close a file +#include +short fclose(FILE *fp); +Set : _errnum +See also: fcloseall,fflush,flushall +@fcloseall +fcloseall (MSC) Close all the open files +#include +short fcloseall(void); +See also: fclose,fflush,flushall +@fcntl +fcntl (UNIX) Access to file control bloc +#include +short fcntl(FILE *stream,short type,size_t value); +See also: feof,fgetpos,fopen,fsetpos,ftell +@fcreate +fcreate (THEOS) Create an indexed,keyed or direct file +#include +short fcreate(const char *fname,const char *mode,short rlen,short klen,long size); +Set : _errnum +See also: creat,fopen,makelib +@fdopen +fdopen (UNIX) Return a stream pointer to a file opened by open,creat or pipe +#include +FILE *fdopen(short fd,const char *type); +See also: creat,fileno,open,pipe +@feof +feof (ANSI) Determine if a file's current position is at end-of-file +#include +short feof(FILE *fp); +@ferror +ferror (ANSI) Test an open file for its error status +#include +short ferror(FILE *fp); +See also: clearerr,feof,file_err,fperror +@fflush +fflush (ANSI) Write any data in a file's output buffer to the file +#include +short fflush(FILE *fp); +See also: flushall,fclose +@fgetc +fgetc (ANSI) Read one character from a stream +#include +short fgetc(FILE *fp); +Set : errno +See also: fgets,getch,getchar +@fgetl +fgetl (THEOS) Read a long integer from a stream +#include +long fgetl(FILE *fp); +See also: fgetc,fgetw,fputc,fputl,fputw +@fgetpos +fgetpos (ANSI) Get a file's current position pointer +#include +short fgetpos(FILE *fp,fpos_t *pos); +See also: fsetpos,ftell +@fgets +fgets (ANSI) Read a string from a stream up to a new line +#include +char *fgets(char *s,size_t n,FILE *fp); +See also: fgetsn,gets,keyin +@fgetsn +fgetsn (THEOS) Read a buffer from a stream +#include +char *fgetsn(char *s,size_t n,FILE *fp); +See also: fgets,gets,keyin +@fgetw +fgetw (THEOS) Read an integer from a stream +#include +short fgetw(FILE *fp); +See also: fgetc,fgetl,fputc,fputl,fputw +@fgrow +fgrow (THEOS) Set the grow factor of file +#include +short fgrow(FILE *fp,short grow); +See also: filechange +@file_err +file_err (THEOS) Test an open file and exit if error +#include +void file_err(FILE *fp); +See also: clearerr,feof,ferror,fperror,syserr +@filechange +filechange (THEOS) Change a file's directory entry (date,owner,protection...) +#include +short filechange(const char *fn,short type,size_t value); +See also: access,fgrow,utime +@filelength +filelength (+MSC) Return the current filelength +#include <_io.h> +size_t filelength(short fd); +See also: close,creat,flush,lseek,open,_read,read,tell,_write,write +@filelock +filelock (THEOS) Lock a region in a file +#include +short filelock(FILE *fp,short code,unsigned long from,unsigned long to); +See also: locking,reclock,recunlock,unlock +@fileno +fileno (UNIX) Get the file number of a open file +#include +short fileno(FILE *fp); +@find_first +find_first (MSC) Find first entry matching selection in the directory +short find_first(char *mask,void *diskfind); +See also: dirclose,diropen,dirread,find_next +@find_next +find_next (MSC) Find next entry matching selection in the directory +#include <_sc.h> +short find_next(void *diskfind); +See also: dirclose,diropen,dirread,find_first +@floor +floor (ANSI) Return the largest integer less than or equal to a value +#include +double floor(double z); +See also: ceil, round +@flush +flush (THEOS) Write any data in a file's output buffer to the file +#include +short flush(short filenum); +See also: close,creat,filelength,lseek,open,_read,read,tell,_write,write +@flushall +flushall (THEOS) Flush all the files opened for output +#include +short flushall(void); +See also: fflush +@fmod +fmod (ANSI) Return the remainder of a division +#include +double fmod(double x,double y); +@fopen +fopen (ANSI) Open a file +#include +FILE *fopen(const char *name,const char *type); +Set : _errnum +See also: access,freopen +@force +force (THEOS) Force another process to execute a command +#include +void force(short pid,char *cmd); +@fork +fork (UNIX) Spawn a sub-task in a free partition +#include +short fork(void); +See also: forktask,killtask,suicide +@forktask +forktask (UNIX) Spawn a sub-task in a given partition +short forktask(short pid); +See also: fork,killtask,suicide +@formask +formask (THEOS) Display disk format parameters and query +#include +void formask(void); +See also: formclear,formincr,formparm +@formclear +formclear (THEOS) Clear the disk directory +void formclear(struct diskucb *ucb,char *label,short dirct,short trkct, + short hdct,short sectct,short density); +See also: formask,formincr,formparm +@formincr +formincr (THEOS) Set disk format sectors interleave table +void formincr(short incr,short sects,short *lacetable); +See also: formask,formclear,formparm +@formparm +formparm (THEOS) Sets disk format parameters from command line +void formparm(short argc,char **argv); +See also: formask,formclear,formincr +@fperror +fperror (THEOS) Display the system message pointed by _errnum on stderr +#include +short fperror(); +See also: errmsg,file_err,perror,syserr +@fpos_t +fpos_t (ANSI) Used to represent the position in a file +#include +typedef long fpos_t; +@fprintf +fprintf (ANSI) Print formatted output to a stream +#include +short fprintf(FILE *fp,const char *format,...); +See also: cprintf,printf,sprintf,vfprintf,vprintf,vsprintf +@fputc +fputc (ANSI) Write a character to a stream +#include +short fputc(char c,FILE *fp); +Set : errno +See also: putc,putchar +@fputl +fputl (THEOS) Write a character to a stream +#include +long fputl(long l,FILE *fp); +See also: fgetc,fgetl,fgetw,fputc,fputw +@fputs +fputs (ANSI) Write a string to a stream +#include +short fputs(const char *string,FILE *fp); +See also: fputsn,fputsnl,puts +@fputsn +fputsn (THEOS) Write a buffer to a stream +#include +char *fputsn(const char *string,FILE *fp); +See also: fputs,fputsnl,puts +@fputsnl +fputsnl (ANSI) Write a buffer to a stream and append a newline +#include +short fputsnl(const char *string,FILE *fp); +See also: fputs,fputsn,puts +@fputw +fputw (THEOS) Write an integer to a stream +#include +short fputw(short word,FILE *fp); +@fread +fread (ANSI) Read data from file stream +#include +short fread(void *buffer,size_t size,size_t nitems,FILE *fp); +See also: fgets,fgetsn,fgetc,fgetl,fgetw +@free +free (ANSI) Return dynamic memory to free memory pool +#include +void free(void *ptr); +See also: calloc,malloc,realloc +@free_sel +free_sel (THEOS) Release a memory selector +#include +void free_sel(short sel); +See also: make_sel +@freopen +freopen (ANSI) Open a stream using an existing file stream pointer +#include +FILE *freopen(const char *filename,const char *type,FILE *fp); +See also: access,fdopen,fopen +@frexp +frexp (ANSI) Break a floating point into mantissa and exponent power of two +#include +double frexp(double x,short *ep); +See also: ldexp +@fscanf +fscanf (ANSI) Format input from a file stream +#include +short fscanf(FILE *fp,const char *format,...); +See also: scanf,sscanf +@fseek +fseek (ANSI) Change a stream position pointer +#include +short fseek(FILE *fp,fpos_t pos,short base); +See also: fsetpos,rewind,seek +@fsetpos +fsetpos (ANSI) Change a stream position pointer +#include +short fsetpos(FILE *fp,fpos_t pos); +See also: fseek,rewind,seek +@fsign +fsign (THEOS) Return the sign of a floating point value +#include +short fsign(double x); +@ftell +ftell (ANSI) Return current position of stream pointer +#include +long ftell(FILE *fp); +See also: fgetpos +@ftoa +ftoa (THEOS) Convert a floating point value to a string +#include +char *ftoa(char *s,double f); +See also: itoa,ltoa,utoa +@fwrite +fwrite (ANSI) Write data to a stream +#include +short fwrite(const void *buffer,size_t size,size_t n,FILE *fp); +See also: fputc,fputl,fputs,fputsn,fputsnl,fputw,putch +@gcd +gcd (THEOS) Return the greatest common divisor of two values +#include +double gcd(double x,double y); +@get_line +get_line (THEOS) Accept an edited line from the standard input +#include +char *get_line(char *line); +See also: gets +@get_sect +get_sect (THEOS) ??? +#include +struct fdb *get_sect(char *fn,char *buf,long *sect); +@getar +getar (THEOS) Internal function used by malloc +@getbp +getbp (THEOS) Return the value of the BP register +#include +void *getbp(void); +See also: getcs,getcsa,getds,getldt,gettib +@getc +getc (ANSI) Read a character from a stream +See fgetc +@getch +getch (MSC) Read a character from the console +#include +short getch(void); +See also: getc,getchar +@getchar +getchar (ANSI) Read character from the standard input +#include +short getchar(void); +See also: getc,getch +@getclass +getclass (THEOS) Return the console or printer class code +#include +short getclass(short lub); +@getcs +getcs (THEOS) Return the value of the CS register +#include +unsigned getcs(void); +See also: getbp,getcsa,getds,getldt,gettib +@getcsa +getcsa (THEOS) Return the value of the CS register +#include +unsigned getcsa(void); +See also: getbp,getcs,getds,getldt,gettib +@getcwd +getcwd (UNIX) Return the current directory name +#include +char *getcwd(char *s,size_t len); +@getdate +getdate (THEOS) Return the current system date +#include +char *getdate(char *buffer) +See also: gettime,time +@getdev +getdev (THEOS) Return the device or lub number of an open file +#include +short getdev(FILE *fp); +@getdevn +getdevn (+THEOS) Return the device or lub number of a device name +#include <_stdlib.h> +short getdevn(char *name); +@getds +getds (THEOS) Return the value of the DS register +#include +unsigned getds(void); +See also: getbp,getcs,getcsa,getldt,gettib +@getenv +getenv (ANSI) Read environmental variable +#include +char *getenv(const char *variable); +See also: getcwd,getlang,getlib,putenv +@getenvle +getenvle (THEOS) Internal function used by putenv +@getflag +getflag (THEOS) Get processor flag register +#include +long getflag(void); +@getfn +getfn (THEOS) Return the full pathname of a file +#include +char *getfn(char *fn); +See also: locate +@getkey +getkey (THEOS) Get a system keyword token +#include +short getkey(short keynum,char *s); +See also: keyclose,matcharg +@getlang +getlang (THEOS) Return the current language code for the partition +#include +short getlang(void); +See also: getenv +@getldt +getldt (THEOS) Return the Local Descriptor Table selector +#include +unsigned getldt(void); +See also: getbp,getcs,getcsa,getds,gettib +@getlib +getlib (THEOS) Return the default library name for the partition +#include +char *getlib(void); +See also: getcwd,getenv +@getlimit +getlimit (THEOS) Return the maximum address of a memory segment +#include +size_t getlimit(unsigned seg); +See also: getmem +@getll +getll (THEOS) Return the line length of the console or a printer +#include +short getll(short lub); +See also: getpl +@getlogin +getlogin (UNIX) Return the name of the account currently logged +#include +char *getlogin(void); +See also: cuserid,getuid,logname +@getlub +getlub (THEOS) Return the ucb number associated with a logical device +#include +short getlub(short lub); +See also: getucb +@getmem +getmem (THEOS) Allocate memory from the system pool +#include +unsigned getmem(size_t size,short table); +See also: calloc,malloc,putmem,shared +@getmsec +getmsec (THEOS) Return the current time of day to the nearest millisecond +#include +char *getmsec(char *s); +See also: gettime,ctime,time +@getmsg +getmsg (THEOS) Return a system message +#include +char *getmsg(short num); +Set : _errnum +See also: errbot,errmsg,putmsg,strerror,syserr +@getmsw +getmsw (THEOS) Get Machine Status Word +#include +long getmsw(void); +@getpid +getpid (UNIX) Return the process number +#include +short getpid(void); +See also: getppid +@getpl +getpl (THEOS) Return the page length of the console or a printer +#include +short getpl(short lub); +See also: getll +@getppid +getppid (UNIX) Return the parent partition number +#include +short getppid(void); +See also: getpid +@getpriv +getpriv (THEOS) Return the privilege level +#include +short getpriv(void); +@getprty +getprty (+THEOS) Return task priority +#include <_stdlib.h> +short getprty(); +See also: setprty +@getrxcnt +getrxcnt (+THEOS) Return the number of characters in the input buffer +#include +short getrxcnt(FILE *port); +See also: cclose,ccloseall,cgetc,cputc,csetbuf,csetvbuf,isrxempty,istxfull +@gets +gets (ANSI) Read string from the standard input +#include +char *gets(char *buffer); +See also: fgets,fgetsn,get_line,keyin +@gettib +gettib (THEOS) Return the Task Information Block selector +#include +unsigned gettib(void); +See also: getbp,getcs,getcsa,getds,getldt,tib +@gettime +gettime (THEOS) Return the current system time +#include +char *gettime(char *buffer); +See also: getdate,time +@getucb +getucb (THEOS) Return the address of the UCB associated with an attached device +#include +struct ucb *getucb(short lub); +See also: getlub +@getuid +getuid (UNIX) Return the number of the account currently logged +#include +short getuid(void); +See also: getlogin +@getver +getver (THEOS) Return the version number,name,serial number +#include +void getver(short code,char *str); +See also: getenv +@getvol +getvol (THEOS) Return a disk or tape volume label +#include +char *getvol(short lub); +@getw +getw (ANSI) Read a word from a file stream +See fgetw +@gmtime +gmtime (ANSI) Convert system time to calendar structure in GMT time +#include +struct tm *gmtime(const time_t *timep); +See also: asctime,ctime,localtime,mktime,strftime,time +@has +has (THEOS) Test if the console can display a character or an attribute +#include +short has(short c); +See also: hascolor +@hascolor +hascolor (THEOS) Test if the console can display colors +#include +short hascolor(void); +See also: crtcolor,has +@hasmouse +hasmouse (+THEOS) Test if a session mouse is available +#include +int hasmouse(void); +See also: mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@hypot +hypot (UNIX) Compute the length of the hypotenuse of a right triangle +#include +double hypot(double x,double y); +@i2tol +i2tol (THEOS) Convert two integers to a long integer +long i2tol(short i[2]); +Note: Not implemented in THEOS 386 C. +@ieee2bcd +ieee2bcd (THEOS) Convert an ieee floating point to bcd floating point +#include +void ieee2bcd(double *data) +See also: bcd2ieee +@if +#if (ANSI) Include code conditionally +#if (expression); +@ifdef +#ifdef (ANSI) Include code conditionally +#ifdef identifier +@ifndef +#ifndef (ANSI) Include code conditionally +#ifndef identifier +@inb +inb (THEOS) Read a byte from a i/o port +#include +unsigned inb(unsigned port); +See also: ind,insb,insd,insw,inw +@include +#include (ANSI) Copy a header file into a program +#include +#include "file.h" +@ind +ind (THEOS) Read a long from a i/o port +#include +unsigned long ind(unsigned port); +See also: inb,insb,insd,insw,inw +@insb +insb (THEOS) Read bytes from a i/o port +#include +void insb(unsigned port,unsigned seg,void *offset,size_t len); +See also: inb,ind,insd,insw,inw +@interrupt +interrupt (THEOS) Interrupt function declarator +void interrupt isr(void); +@insd +insd (THEOS) Read longs from a i/o port +#include +void insd(unsigned port,unsigned seg,void *offset,size_t len); +See also: inb,ind,insb,insw,inw +@insw +insw (THEOS) Read words from a i/o port +#include +void insw(unsigned port,unsigned seg,void *offset,size_t len); +See also: inb,ind,insb,insd,inw +@inw +inw (THEOS) Read a word on a i/o port +#include +unsigned inw(unsigned port); +See also: ind,insb,insd,insw,inw +@ioctl +ioctl (UNIX) Perform extended I/O control on devices +#include +short ioctl(FILE *fp,struct bytecntl *action); +short ioctl(FILE *fp,struct diskcntl *action); +short ioctl(FILE *fp,struct tapecntl *action); +@ip +ip (THEOS) Return the integral part of a value +#include +double ip(double x); +See also: modf +@inc +inc (THEOS) Increment a byte in another memory segment +#include +void inc(void *ofs,unsigned seg); +See also: Other inc functions +@inccs +inccs (THEOS) Increment a byte in the code segment +#include +void inccs(void *ofs); +See also: Other inc functions +@inccsl +inccsl (THEOS) Increment a long in the code segment +#include +void inccsl(void *ofs); +See also: Other inc functions +@inccsw +inccsw (THEOS) Increment a word in the code segment +#include +void inccsw(void *ofs); +See also: Other inc functions +@incl +incl (THEOS) Increment a long in another memory segment +#include +void incl(void *ofs,unsigned seg); +See also: Other inc functions +@incw +incw (THEOS) Increment a word in another memory segment +#include +void incw(void *ofs,unsigned seg); +See also: Other inc functions +@isalnum +isalnum (ANSI) Check if a character is a number or letter +#include +short isalnum(short c); +See also: setlocale +@isalpha +isalpha (ANSI) Check if a character is a letter +#include +short isalpha(short c); +See also: setlocale +@isascii +isascii (UNIX) Check if a character is an ASCII character +#include +short isascii(short c); +See also: setlocale +@isatty +isatty (UNIX) Check if an open file is a serial communication device +#include +short isatty(FILE *stream); +@iscntrl +iscntrl (ANSI) Check if a character is a control character +#include +short iscntrl(short c); +@iscomname +iscomname (+THEOS) Test if a file name is a valid com port name +#include <_stdlib.h> +short iscomname(char *filename); +@iscon +iscon (THEOS) Check if an open file is the console +#include +short iscon(FILE *stream); +@iscsym +iscsym (THEOS) Test if a character is alphabetic or an underscore +#include +short iscsym(short c); +See also: iscsymnum +@iscsymnum +iscsymnum (THEOS) Test if a character is alphanumeric or an underscore +#include +short iscsymnum(short c); +See also: iscsym +@isdigit +isdigit (ANSI) Check if a character is a decimal diqit +#include +short isdigit(short c); +@isdisp +isdisp (THEOS) Check if a character is displayable by most terminal +#include +short isdisp(short c); +See also: isgraph,isprint +@isfnsym +isfnsym (THEOS) Check if a character is valid for a file name +#include +short isfnsym(short c); +See also: issymbol,issymnum +@isgraph +isgraph (ANSI) Check if a character is visible when printed +#include +short isgraph(short c); +See also: setlocale +@ishex +ishex (THEOS) Check if a character is a hexadecimal digit +#include +short ishex(short c); +See also: isxdigit +@isinter +isinter (+THEOS) Check if a character is an international character +#include +short isinter(short c); +See also: isalpha +@islower +islower (ANSI) Check if a character is a lower-case letter +#include +short islower(short c); +See also: setlocale +@isoctal +isoctal (THEOS) Check if a character is an octal digit +#include +short isoctal(short c); +@isprint +isprint (ANSI) Check if a character is visible or is a space +#include +short isprint(short c); +See also: setlocale +@isprtname +isprtname (+THEOS) Test if a file name is a valid printer name +#include <_stdlib.h> +short isprtname(char *filename); +@ispunct +ispunct (ANSI) Check if a character is a punctuation mark +#include +short ispunct(short c); +See also: setlocale +@isrxempty +isrxempty (+THEOS) Test if an input buffer is empty +#include +short isrxempty(FILE *port); +See also: cclose,ccloseall,cgetc,cputc,csetbuf,csetvbuf,getrxcnt,istxfull +@issesdev +issesdev (+THEOS) Test if a device is session capable +#include <_stdlib.h> +short issesdev(FILE *fp); +@isspace +isspace (ANSI) Check if a character prints white space +#include +short isspace(short c); +@issymbol +issymbol (THEOS) Check if a character is a valid first character for a file name +#include +short issymbol(short c); +See also: issymnum +@issymnum +issymnum (THEOS) Check if a character is a valid character for a symbol +#include +short issymnum(short c); +See also: issymbol +@istapname +istapname (+THEOS) Test if a file name is a valid tape name +#include <_stdlib.h> +short istapname(char *filename); +@istxfull +istxfull (+THEOS) Test if an input buffer is empty +#include +short istxfull(FILE *port); +See also: cclose,ccloseall,cgetc,cputc,csetbuf,csetvbuf,getrxcnt,istxfull +@isupper +isupper (ANSI) Check if a character is an upper-case letter +#include +short isupper(short c); +See also: setlocale +@isv86 +isv86 (THEOS) Test if a process is running in Virtual 86 mode +short isv86(short pid); +@isxdigit +isxdigit (ANSI) Check if a charcter is an hexadecimal digit +#include +short isxdigit(short c); +See also: ishex +@itoa +itoa (THEOS) Convert an integer into an ASCII string +#include +char *itoa(char *s,short i); +See also: ftoa,ltoa,utoa +@keyclose +keyclose (THEOS) Close the keyword file used with getkey +#include +void keyclose(void); +See also: getkey,testarg +@keyin +keyin (THEOS) See cgets +@killtask +killtask (THEOS) Kill a subtask +#include +void killtask(short pid); +See also: fork,forktask,suicide +@l3tol +l3tol (UNIX) Convert three bytes integers to longs integers +#include +void l3tol(long *l,const char *c,short cnt); +See also: c3tol,ltoc3,ltol3 +@l64a +l64a (UNIX) Convert a long integer to a base-64 ASCII string +#include +char *l64a(long x); +See also: a64l +@labs +labs (ANSI) Return the absolute value of an long integer +#include +long labs(long l); +See also: abs,fabs +@ldeletek +ldeletek (THEOS) Delete a record from a direct access file +#include +short ldeletek(FILE *fp,const long *key); +See also: lreadk,lreadn,lwritek +@ldexp +ldexp (ANSI) Combine fraction and exponent +#include +double ldexp(double x,short exp); +See also: frexp +@ldiv +ldiv (ANSI) Return the quotient and remainder of the division of two longs +#include +ldiv_t ldiv(long numer,long denom) +@ldiv_t +ldiv_t (ANSI) used by ldiv +#include +typedef struct {long quot,rem;} ldiv_t; +See also: div +@leapyear +leapyear (THEOS) Indicate if a year is a leap year +#include +short leapyear(short year); +See also: _monthen,_yday +@lfind +lfind (MSC) Perform a linear search of an array +#include +void *lfind(const void *key,const void *array,size_t nbr_mbr,size_t size, + short (*compar)(const void *,const void *)); +See also: bsearch,lsearch,qsort +@line +#line (ANSI) Reset line numbering +#line number +#line number filename +@linput +linput (+THEOS) Accept a data field from the keyboard like BASIC LINPUT +#include <_stdlib.h> +short linput(char *case,char *before_msg,char *after_msg,char *input_var, + char *output_var,short length,short timeout,short timeout_key); +@load +load (THEOS) Load a program into memory +#include +unsigned load(const char *program,short type); +See also: unload +@load_yn +load_yn (THEOS) Initialise the yesno function +#include +void load_yn(void); +See also: yesno +@loc1 +loc1 (THEOS) Reserved variable for regex +#include +extern char *loc1; +@localtime +localtime (ANSI) Convert system time to calendar structure +#include +struct tm *localtime(time_t *timep); +See also: asctime,ctime,gmtime,mktime,strftime,time +@locate +locate (THEOS) Find a file on disk and return a copy of its FDB +#include +struct fdb *locate(const char *filename,char *buf,short *lub); +See also: getfn +@lock_time +lock_time (THEOS) Set the maximum lock time wait +#include <_stdlib.h> +void lock_time(unsigned char seconds); +See also: timeout +@locking +locking (MSC) Lock or unlock a record in a file +#include +short locking(FILE *fp,short mode,long size); +Set : errno +See also: filelock,reclock,recunlock,unlock +@lockres +lockres (THEOS) "Unlock" a byte in memory +#include +void lockres(void *ofs,unsigned seg); +See also: lockset +@lockset +lockset (THEOS) "Lock" a byte in memory +#include +void lockset(void *ofs,unsigned seg); +See also: lockres +@log +log (ANSI) Compute natural logarithm +#include +double log(double z); +Set : errno +See also: log10,log2 +@log10 +log10 (ANSI) Compute common logarithm +#include +double log10(double z); +Set : errno +See also: log,log2 +@log2 +log2 (THEOS) Compute base 2 logarithm +#include +double log2(double z); +Set : errno +See also: log,log10 +@logname +logname (UNIX) Return the account name currently logged +#include +char *logname(void); +See also: cuserid,getlogin,getuid +@longjmp +longjmp (ANSI) Return from a non-local goto +#include +short longjmp(jmp_buf env,short rval); +See also: setjmp +@lowcase +lowcase (THEOS) See strlwr +@lprime +lprime (+THEOS) Compute the smallest prime greater than or equal to a number +#include <_stdlib.h> +unsigned long lprime(unsigned long n); +See also: prime +@lreadk +lreadk (THEOS) Read a record from a direct access file +#include +short lreadk(FILE *fp,const long *key,void *rec); +See also: ldeletek,lreadn,lwritek +@lreadn +lreadn (THEOS) Read the next record from a direct access file +#include +short lreadn(FILE *fp,long *key,void *rec); +See also: ldeletek,lreadk,lwritek +@lsearch +lsearch (UNIX) Perform a linear search of an array,insert key if non existent +#include +void *lsearch(const void *key,const void *array,size_t nbr_mbr,size_t size, + short (*compar)(const void *,const void *)); +See also: bsearch,lfind,qsort +@lseek +lseek (UNIX) Set read/write position +#include +long lseek(short fd,short how,long where); +See also: close,creat,filelength,flush,open,_read,read,tell,_write,write +@ltoa +ltoa (THEOS) Convert an long integer into an ASCII string +#include +char *ltoa(char *s,short l); +See also: ftoa,itoa,utoa +@ltoc3 +ltoc3 (THEOS) Convert a long integer to a three byte integer +#include +long ltoc3(void *c,long l); +See also: c3tol,l3tol,ltol3 +@ltol3 +ltol3 (UNIX) Convert long integers to three byte integers +#include +long ltol3(void *c,const long *l,short cnt); +See also: c3tol,l3tol,ltoc3 +@lwritek +lwritek (THEOS) Write a record to a direct access file +#include +short lwritek(FILE *fp,const long *key,const void *rec); +See also: ldeletek,lreadk,lreadn +@make_sel +make_sel (THEOS) Create a memory selector +#include +void make_sel(short sel,size_t limit,unsigned long base,short int); +See also: free_sel +@makelib +makelib (THEOS) Create a library file +#include +unsigned makelib(const char *filename,short size); +See also: fcreate +@malloc +malloc (ANSI) Allocate dynamic memory +#include +char *malloc(size_t size); +@match +match (THEOS) Compare a string against a format mask +#include +short match(const char *string,const char *mask); +See also: strcmp,streq +@mapdoskey +mapdoskey (+THEOS) Convert THEOS keycodes to PC keycodes +#include +#include +unsigned short mapdoskey(unsigned short key); +See also: _bios_keybrd +@matcharg +matcharg (THEOS) Compare one string with another with abbreviation capability +#include +short matcharg(const char *string,const char *keyword,short min); +See also: strcmp,streq,strncmp,testarg +@max +max (UNIX) Return the larger of two integers +#include +short max(short a,short b); +@max_alloc +max_alloc (THEOS) Return the size of the larger memory bloc available +#include +size_t max_alloc(void); +See also: calloc,free,malloc,realloc,tot_alloc +@mem_grow +mem_grow (THEOS) ??? +#include +short mem_grow(short seg,long adjust); +@mem_ovly +mem_ovly (THEOS) Adjust the size of the data used by the program +#include +void mem_ovly(size_t size); +@memccpy +memccpy (UNIX) Copy a buffer into another for 'n' bytes or up to a character +#include +void *memcpy(void *to,const void *from,short c,size_t len); +See also: farcpy,memcpy,memmove,memrcpy,strcpy,strdup,strmake,strncpy +@memchr +memchr (ANSI) Locate the first occurrence of a byte in a buffer +#include +void *memchr(const void *buffer,unsigned character,size_t len); +See also: farchr,strpbrk,strchr,strrchr,strstr +@memcmp +memcmp (ANSI) Compare two buffers +#include +short memcmp(const void *buf1,const void *buf2,size_t len); +See also: farcmp,fareq,memeq,memicmp,strcmp,streq,stricmp,strncmp,strneq, + strnicmp +@memcpy +memcpy (ANSI) Copy one buffer into another +#include +void *memcpy(void *to,const void *from,size_t len); +See also: farcpy,memccpy,memmove,memrcpy,strcpy,strdup,strmake,strncpy +@memeq +memeq (THEOS) Compare two buffers for equality +#include +short memeq(const void *buf1,const void *buf2,size_t len); +See also: farcmp,fareq,memcmp,memicmp,strcmp,streq,stricmp,strncmp,strnicmp, + strneq +@memicmp +memicmp (MSC) Compare two buffers,ignoring the casemode of the characters +#include +short memicmp(const void *buf1,const void *buf2,size_t len); +See also: farcmp,fareq,memcmp,memeq,strcmp,streq,stricmp,strncmp,strneq,strnicmp +@memmove +memmove (ANSI) Copy one buffer into another with correct handling of overlapping +void *memmove(void *to,const void *from,size_t len); +See also: farcpy,memcpy,memccpy,memrcpy,strcpy,strdup,strmake,strncpy +@memrcpy +memrcpy (THEOS) Copy one buffer into another in reverse sequence +#include +void *memrcpy(void *to,const void *from,size_t len); +See also: farcpy,memcpy,memccpy,memmove,strcpy,strdup,strmake,strncpy +@memset +memset (ANSI) Fill a buffer with a character +#include +void *memset(char *buffer,short character,size_t len); +See also: farset,strnfill,strset,strnset +@menu +menu (THEOS) Display a menu and wait for a selection +#include +short menu(const char **menu,short count); +See also: menu2 +@menu2 +menu2 (THEOS) Display a menu and wait for a selection +#include +short menu2(const char **menu,short count,short start,short display); +See also: menu +@menumsg +menumsg (+THEOS) Display a menu line a wait for a selection +#include <_stdlib.h> +short menumsg(char *msg,char *key,short timeout,short timeout_key); +@min +min (UNIX) Return the smaller of two integers +#include +short min(short a,short b); +@mkdir +mkdir (MSC) Create a directory +#include +short mkdir(const char *filename); +Set : errno,_errnum +See also: chdir,rmdir +@mktemp +mktemp (UNIX) Generate a temporary file name +#include +char *mktemp(const char *template); +See also: tmpnam,tmpfile,tmpnam +@mktime +mktime (MSC) Convert a time structure into a calendar time +#include +time_t mktime(struct tm *timeptr) +See also: asctime,ctime,gmtime,localtime,strftime,time +@modf +modf (ANSI) Separate integral and fractional part +#include +double modf(double x,double *ip); +See also: ip +@mouse +mouse (+THEOS) Compute mouse position and buttons for subsequent use +#include +short mouse(void); +See also: hasmouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@mousebutton +mousebutton (+THEOS) Return mouse buttons state +#include +short mousebutton(void); +See also: hasmouse, mouse, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@mouseclick +mouseclick (+THEOS) Set mouse click and dclick delay +#include +void mouseclick(long click); +See also: hasmouse, mouse, mousebutton, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@mousedisable +mousedisable (+THEOS) Disable the mouse +#include +void mousedisable(void); +See also: hasmouse, mouse, mousebutton, mouseclick, mouseenable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@mouseenable +mouseenable (+THEOS) Initialise and enable the mouse +#include +void mouseenable(void); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, + mousemove, mousescale, mouseswap, mousetell, mousexy +@mousemove +mousemove (+THEOS) Move the mouse pointer +#include +void mousemove(short col, short row); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousescale, mouseswap, mousetell, mousexy +@mousescale +mousescale (+THEOS) Set mouse sensitivity +#include +void mousescale(short scale); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mouseswap, mousetell, mousexy +@mouseswap +mouseswap (+THEOS) Swap mouse left and right buttons +#include +void mouseswap(short flag); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mousetell, mousexy +@mousetell +mousetell (+THEOS) Read mouse swap flag and sensitivity +#include +void mousetell(long *click, short *scale); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousexy +@mousexy +mousexy (+THEOS) Read mouse position +#include +void mousexy(short *col, short *row); +See also: hasmouse, mouse, mousebutton, mouseclick, mousedisable, mouseenable, + mousemove, mousescale, mouseswap, mousetell +@move +move (THEOS) Copy one buffer to another buffer in another memory segment +Obsolete function,use farcpy +@msalarm +msalarm (THEOS) Start a timer in milli seconds generating a signal interrupt +#include +long msalarm(long msecs); +See also: delay,alarm,signal +@msgclose +msgclose (THEOS) Close the system message file +#include +void msgclose(void); +See also: getmsg +@no_val +no_val (THEOS) Value of no answer +extern char yes_val; +@NULL +NULL (ANSI) Nul pointer type +#include +#define NULL ((void *)0) +@offsetof +offsetof (ANSI) Offset between the beginning of a structure and a member +#include +offsetof(nom_de_structure,nom_de_membre) +@open +open (UNIX) Open a file +#include +short open(const char *filename,short type,...); +Set : errno,_errnum +See also: close,creat,filelength,flush,lseek,_read,read,tell,_write,write +@opendir +opendir (+UNIX) Open a directory +#include +DIR* opendir(const char* fname); +See also: readdir,closedir,seekdir,telldir,rewinddir +Set : errno +@openhelp +openhelp (THEOS) Open the help file for a program +#include +FILE *openhelp(const char *name); +See also: fopen +@openmenu +openmenu (THEOS) Open the menu file for a program +#include +FILE *openmenu(const char *name); +See also: fopen +@orb +orb (THEOS) Or a byte in another memory segment +#include +void orb(void *ofs,unsigned seg,char mask); +See also: Other or functions +@orcs +orcs (THEOS) Or a byte in the code segment +#include +void orcs(void *ofs,char mask); +See also: Other or functions +@orl +orl (THEOS) Or a long in another memory segment +#include +void orl(void *ofs,unsigned seg,long mask); +See also: Other or functions +@orlcs +orlcs (THEOS) Or a long in the code segment +#include +void orlcs(void *ofs,long mask); +See also: Other or functions +@orw +orw (THEOS) Or a word in another memory segment +#include +void orw(void *ofs,unsigned seg,short mask); +See also: Other or functions +@orwcs +orwcs (THEOS) Or a word in the code segment +#include +void orwcs(void *ofs,short mask); +See also: Other or functions +@outb +outb (THEOS) Write a byte into an i/o port +#include +void outb(unsigned port,char byte); +See also: outd,outsb,outsd,outsw,outw +@outd +outd (THEOS) Write a long into an i/o port +#include +void outd(unsigned port,unsigned long dword); +See also: outb,outsb,outsd,outsw,outw +@outsb +outsb (THEOS) Write bytes into an i/o port +#include +void outsb(unsigned port,unsigned seg,void *offset,size_t len); +See also: outb,outd,outsd,outsw,outw +@outsd +outsd (THEOS) Write longs into an i/o port +#include +void outsd(unsigned port,unsigned seg,void *offset,size_t len); +See also: outb,outd,outsb,outsw,outw +@outsw +outsw (THEOS) Write words into an i/o port +#include +void outsw(unsigned port,unsigned seg,void *offset,size_t len); +See also: outb,outd,outsb,outsd,outw +@outw +outw (THEOS) Write a word into an i/o port +#include +void outw(unsigned port,unsigned word); +See also: outb,outd,outsb,outsd,outsw +@pagewait +pagewait (THEOS) Display the wait prompt and wait the a key +#include +short pagewait(void); +See also: getpl +@pause +pause (THEOS) Wait a state change on ii/o port 61 +void pause(char count); +@pcbsc +pcbsc (THEOS) Read or write char or words in the PCB of any process +#include <_sc.h> +long pcbsc(short type,void *ofs,void *arg); +Le premier PCB commence en PCBSTART,les PCB suivant sont consÉcutifs. Le +dernier PCB est suivi par un entier à 0xFFFF. Tout accÈs à une adresse plus +ÉlevÉe entraine un TRAP #13. + +type = 1 : lit un octet type = 2 : lit un mot de 16 bits +type = 0x8001 : Écrit un octet type = 0x8002 : Écrit un mot de 16 bits + +ofs pointe à l'intÉrieur de la table des PCB +arg valeur à Écrire si type = 0x8001 ou 0x8002 + +Lecture de l'État du PID 0 : status = pcbsc(1,PCBSTART,(void *) 0); +Lecture de la version de l'OS : ver = pcbsc(-1,-1,-1); +@peek +peek (THEOS) Return a byte from another memory segment +#include +unsigned peek(const void *ofs,unsigned seg); +See also: Other peek functions +@peekchar +peekchar (THEOS) ??? +#include <_sc.h> +void peekchar(short pid,short type); +@peekcs +peekcs (THEOS) Return a byte from the code segment +#include +unsigned peekcs(const void *ofs); +See also: Other peek functions +@peekfsa +peekfsa (THEOS) ??? +#include <_sc.h> +short peekfsa(void *ofs); +@peekl +peekl (THEOS) Return a long from another memory segment +#include +unsigned long peekl(const void *ofs,unsigned seg); +See also: Other peek functions +@peeklcs +peeklcs (THEOS) Return a long from the code segment +#include +unsigned long peeklcs(const void *ofs); +See also: Other peek functions +@peeklnuc +peeklnuc (THEOS) Return a long from the nucleus segment +#include +unsigned long peeklnuc(const void *ofs); +See also: Other peek functions +@peeklscr +peeklscr (THEOS) Return a long from the SCR segment +#include +unsigned long peeklscr(const void *ofs); +See also: Other peek functions +@peeknuc +peeknuc (THEOS) Return a byte from the nucleus segment +#include +unsigned peeknuc(const void *ofs); +See also: Other peek functions +@peekp +peekp (THEOS) Return a pointer from another memory segment +#include +void *peekp(const void *ofs,unsigned seg); +See also: Other peek functions +@peekpcs +peekpcs (THEOS) Return a pointer from the code segment +#include +void *peekpcs(const void *ofs); +See also: Other peek functions +@peekpnuc +peekpnuc (THEOS) Return a pointer from the nucleus segment +#include +void *peekpnuc(const void *ofs); +See also: Other peek functions +@peekpscr +peekpscr (THEOS) Return a pointer from the SCR segment +#include +void *peekpscr(const void *ofs); +See also: Other peek functions +@peekscr +peekscr (THEOS) Return a byte from the SCR segment +#include +unsigned peekscr(const void *ofs); +See also: Other peek functions +@peektib +peektib (THEOS) Get bytes in the TIB or RCR of any process +#include <_sc.h> +long peektib(short pid,void *ofs); +L'adressage du scr peut Çtre indiquÉ en ajoutant 0x8000 à l'offset +dans le scr. Ainsi : +peektib(pid,0x8000) Équivaut à peektib(pid,&TIB->scr.logonname[0]) +@peekw +peekw (THEOS) Return a word from another memory segment +#include +unsigned peekw(const void *ofs,unsigned seg); +See also: Other peek functions +@peekwcs +peekwcs (THEOS) Return a word from the code segment +#include +unsigned peekwcs(const void *ofs); +See also: Other peek functions +@peekwnuc +peekwnuc (THEOS) Return a word from the nucleus segment +#include +unsigned peekwnuc(const void *ofs); +See also: Other peek functions +@peekwscr +peekwscr (THEOS) Return a word from the SCR segment +#include +unsigned peekwscr(const void *ofs); +See also: Other peek functions +@perror +perror (ANSI) Display a program defined message with a message pointed by errno +#include +void perror(const char *string); +Set : errno +See also: errmsg,fperror,getmsg,strerror,syserr +@phy_addr +phy_addr (THEOS) Determine physical address of memory selector,lock and unlock +#include +unsigned long phy_addr(unsigned seg,void *offset,size_t len); +See also: getmem,putmem +@pipe +pipe (UNIX) Open an interprocess i/o channel +#include +short pipe(short filenum[2]); +See also: popen +@poke +poke (THEOS) Put a byte into another memory segment +#include +void poke(char val,void *ofs,unsigned seg); +See also: Other poke functions +@pokecs +pokecs (THEOS) Put a byte into the code segment +#include +void pokecs(char val,void *ofs); +See also: Other poke functions +@pokecsa +pokecsa (THEOS) Put a byte into the code segment +#include +void pokecsa(char val,void *ofs); +See also: Other poke functions +@pokel +pokel (THEOS) Put a long into another memory segment +#include +void pokel(long val,void *ofs,unsigned seg); +See also: Other poke functions +@pokelcs +pokelcs (THEOS) Put a long into the code segment +#include +void pokelcs(long val,void *ofs); +See also: Other poke functions +@pokelcsa +pokelcsa (THEOS) Put a long into the code segment +#include +void pokelcsa(long val,void *ofs); +See also: Other poke functions +@pokelscr +pokelscr (THEOS) Put a long into the SCR segment +#include +void pokelscr(long val,void *ofs); +See also: Other poke functions +@pokenuc +pokenuc (THEOS) Put a byte into the nucleus segment +#include +void pokenuc(short val,void *ofs); +See also: Other poke functions +@pokep +pokep (THEOS) Put a pointer into another memory segment +#include +void pokep(void *val,void *ofs,unsigned seg); +See also: Other poke functions +@pokepcs +pokepcs (THEOS) Put a pointer into the code segment +#include +void pokepcs(void *val,void *ofs); +See also: Other poke functions +@pokepcsa +pokepcsa (THEOS) Put a pointer into the code segment +#include +void pokepcsa(void *val,void *ofs); +See also: Other poke functions +@pokepscr +pokepscr (THEOS) Put a pointer into the SCR segment +#include +void pokepscr(void *val,void *ofs); +See also: Other poke functions +@pokescr +pokescr (THEOS) Put a byte into the SCR segment +#include +void pokescr(char val,void *ofs); +See also: Other poke functions +@pokeucb +pokeucb (THEOS) Put a byte into the UCB segment +#include +void pokeucb(short val,void *ofs); +See also: Other poke functions +@pokew +pokew (THEOS) Put a word into another memory segment +#include +void pokew(short val,void *ofs,unsigned seg); +See also: Other poke functions +@pokewcs +pokewcs (THEOS) Put a word into the code segment +#include +void pokewcs(short val,void *ofs); +See also: Other poke functions +@pokewcsa +pokewcsa (THEOS) Put a word into the code segment +#include +void pokewcsa(short val,void *ofs); +See also: Other poke functions +@pokewnuc +pokewnuc (THEOS) Put a word into the nucleus segment +#include +void pokewnuc(short val,void *ofs); +See also: Other poke functions +@pokewscr +pokewscr (THEOS) Put a word into the SCR segment +#include +void pokewscr(short val,void *ofs); +See also: Other poke functions +@pokewucb +pokewucb (THEOS) Put a word into the UCB segment +#include +void pokewucb(short val,void *ofs); +See also: Other poke functions +@popen +popen (UNIX) Open an interprocess i/o channel +#include +short popen(FILE **rd_pipe,FILE **wr_pipe); +See also: pipe +@popf +popf (THEOS) Pop flag register +#include +void popf(void); +See also: pushf +@pow +pow (ANSI) Compute a power of a number +#include +double pow(double z,double x); +Set : errno +@pragma +#pragma Sets compiler options +#pragma align 1 | 2 (default) | 4 +#pragma align struct | -struct (default) +#pragma char signed (default) | unsigned +#pragma field char | word (default) +#pragma float bcd | ieee (default) +#pragma float float (default) | double +#pragma int short (default) | long +#pragma library +#pragma prog version,priv[,mfg,serial][,"copyright"][,patchsize] +#pragma shift logical (default) | arithmetic +@pre_empt +pre_empt (THEOS) ??? +#include +void pre_empt(void); +@prime +prime (THEOS) Compute the smallest prime greater than or equal to a number +#include +unsigned prime(unsigned n); +See also: lprime +@printf +printf (ANSI) Format output +#include +short printf(const char *format,...); +See also: cprintf,fprintf,sprintf,vfprintf,vprintf,vsprintf +@pushf +pushf (THEOS) Push flag register +#include +void pushf(void); +@ptrdiff_t +ptrdiff_t (ANSI) Result type of the substraction of two pointers +#include +typedef long ptrdiff_t; +@putc +putc (ANSI) Write a character to a stream +#include +short putc(char c,FILE *fp); +See also: fputc,putchar +@putch +putch (MSC) Write a character to the console +#include +short putch(short c); +See also: fputc,putc,putchar +@putchar +putchar (ANSI) Write a character to standard output +#include +short putchar(short c); +@putenv +putenv (MSC) Set an environment variable +#include +short putenv(const char *s); +See also: getenv +@putmem +putmem (THEOS) Release memory allocated by getmem +#include +void putmem(unsigned seg); +See also: getmem +@putmsg +putmsg (THEOS) Display a message with parameter substitution +#include +void putmsg(const char *text,const char *arg[]); +See also: errbot,errmsg,getmsg,perror,syserr +@puts +puts (ANSI) Write a string to standard output +#include +void puts(const char *string); +See also: cputs,fputs +@putw +putw (ANSI) Write a word to a stream +#include +short putw(short word,FILE *fp); +See also: getw,fgetw,fputw +@qsort +qsort (ANSI) Sort arrays in memory +void qsort(const void **array,size_t nbr,size_t size, + short (*compar)(const void *,const void *)); +See also: bsearch,sort +@quitoff +quitoff (THEOS) Mask the system quit key +#include +void quitoff(void); +See also: quiton +@quiton +quiton (THEOS) Re-enable the system quit key +#include +void quiton(void); +See also: quitoff +@raise +raise (ANSI) Force a signal interrupt +#include +short raise(short sig); +See also: signal +@rand +rand (ANSI) Generate pseudo-random numbers +#include +short rand(void); +See also: srand +@rbrk +rbrk (THEOS) Internal function +@read +read (ANSI) Read data from a file +#include +short read(short fd,void *buffer,size_t n); +See also: close,creat,filelength,flush,lseek,open,_read,tell,_write,write +@readdir +readdir (+UNIX) Read a directory entry +#include +struct dirent* readdir(DIR*); +See also: opendir,closedir,seekdir,telldir,rewinddir +Set : errno +@readk +readk (THEOS) Read a record from an indexed or keyed file +#include +short readk(FILE *fp,const char *key,void *rec); +See also: deletek,readn,readp,writek +@readn +readn (THEOS) Read next record from an indexed or keyed file +#include +short readn(FILE *fp,char *key,void *rec); +See also: deletek,readk,readp,writek +@readp +readp (THEOS) Read previous record from an indexed or keyed file +#include +short readp(FILE *fp,char *key,void *rec); +See also: deletek,readk,readn,writek +@realloc +realloc (ANSI) Reallocate dynamic memory +#include +char *realloc(void *ptr,size_t size); +See also: calloc,free,malloc,max_alloc,tot_alloc +@reclock +reclock (THEOS) Try to lock a record in a file stream or direct file +#include +short reclock(FILE *fp,fpos_t pos); +See also: filelock,locking,recunlock,unlock +@recunlock +recunlock (THEOS) Try to lock a record in a file stream or direct file +#include +short recunlock(FILE *fp,fpos_t pos); +See also: filelock,locking,reclock,unlock +@regcmp +regcmp (UNIX) Compile a search pattern to be used by the regex search function +#include +char *regcmp(char *pattern,...); +See also: regex,strchr,strstr +@regex +regex (UNIX) Perform a search on a string using a pattern compiled by regcmp +#include +char *regex(char *cpattern,char *object,...); +See also: regcmp,strchr,strstr +@remote +remote (THEOS) Call a function in another code segment +#include +remote(unsigned ofs,unsigned seg,...); +@remove +remove (ANSI) Erase a file +#include +short remove(const char *filename); +Set : errno,_errnum +See also: unlink +@rename +rename (ANSI) Change the name of a file +#include +short rename(const char *old,const char *new); +Set : errno,_errnum +@rewind +rewind (ANSI) Reset file pointer +#include +short rewind(FILE *fp); +See also: fseek,fsetpos,seek +@rewinddir +rewinddir (+UNIX) Sets the directory entry location to the beginning +#include +void rewinddir(DIR*); +See also: opendir,closedir,readdir,telldir,seekdir +@rmdir +rmdir (MSC) Removes a directory +#include +short rmdir(const char*dirname); +Set : errno,_errnum +See also: remove,unlink +@round +round (+THEOS) Round a value to the nearest integer +#include <_math.h> +double round(double value, int position) +See also: ceil, floor +@rsema +rsema (THEOS) Return the status of a remote semaphore +#include +short rsema(short pid,short sema_nbr); +See also: rsemaname,rsemares,rsemaset,rsemawait,sema,semaphore,semares,semaset, + semawait +@rsemaname +rsemaname (THEOS) Return the number of a remote semaphore +#include +short rsemaname(short pid,char *name); +See also: rsema,rsemares,rsemaset,rsemawait,sema,semaphore,semares,semaset, + semawait +@rsemares +rsemares (THEOS) Reset a remote semaphore +#include +short rsemares(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemaset,rsemawait,sema,semaphore,semares,semaset, + semawait +@rsemaset +rsemaset (THEOS) Set a remote semaphore +#include +short rsemaset(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemares,rsemawait,sema,semaphore,semares,semaset, + semawait +@rsemawait +rsemawait (THEOS) Wait until a remote semaphore is set +#include +short rsemawait(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemaset,rsemares,sema,semaphore,semares,semaset, + semawait +@sbrk +sbrk (THEOS) Increase a program's data space +void *sbrk(short increment); +@scanf +scanf (ANSI) Accept and format input +#include +short scanf(char *format,...); +See also: fscanf,sscanf +@schedint +schedint (THEOS) Set or reset an interrupt service routine vector +#include +void schedint(long num,short (*isr)()); +@sec +sec (THEOS) Calculate secant +#include +double sec(double x); +@sech +sech (THEOS) Calculate hyperbolic secant +#include +double sech(double x); +@seek +seek (ANSI) Change a stream position pointer +#include +short seek(FILE *fp,short pos,short base); +See also: fsetpos,rewind,seek +@seekdir +seekdir (+UNIX) Sets the directory entry location +#include +void seekdir(DIR*,long); +See also: opendir,closedir,readdir,telldir,rewinddir +@sema +sema (THEOS) Return the status of a semaphore +#include +short rsema(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemares,rsemaset,rsemawait,semaphore,semares, + semaset,semawait +@semaphore +semaphore (THEOS) Return the number of a semaphore +#include +short semaphore(char *name); +See also: rsema,rsemaname,rsemares,rsemaset,rsemawait,sema,semares,semaset, + semawait +@semares +semares (THEOS) Reset a semaphore +#include +short semares(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemares,rsemaset,rsemawait,sema,semaphore,semaset, + semawait +@semaset +semaset (THEOS) Set a semaphore +#include +short semaset(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemares,rsemaset,rsemawait,sema,semaphore,semares, + semawait +@semawait +semawait (THEOS) Wait until a semaphore is set +#include +short semawait(short pid,short sema_nbr); +See also: rsema,rsemaname,rsemaset,rsemares,rsemawait,sema,semaphore,semares, + semaset +@setbuf +setbuf (ANSI) Allocate an i/o buffer for an open file +#include +void setbuf(FILE *fp,char *buffer); +See also: fbuf,setvbuf,vbuf +@setjmp +setjmp (ANSI) Save or restore the current execution environment for a longjmp +#include +short setjmp(jmp_buf env); +See also: longjmp +@setlocale +setlocale (ANSI) Change or return the current locale switches +#include +char *setlocale(short category,const char *locale); +See also: strcoll,strxfrm,is... and to... functions +@setprty +setprty (THEOS) Change the current process priority +#include +void setprty(short priority); +Set also: setslice,snu +@setvbuf +setvbuf (ANSI) Allocate an i/o buffer for an open file +#include +void setvbuf(FILE *fp,char *buffer,short mode,size_t len); +See also: fbuf,setbuf,vbuf +@sgetl +sgetl (THEOS) Retrieve a long integer stored with sputl +#include +long sgetl(char *buf); +See also: sputl +@shared +shared (THEOS) Define or access memory shared with other process +unsigned shared(char *name,size_t len); +See also: far...,getlimit,add...,and...,dec...,inc...,or...,peek...,poke..., + xor... +@sig_atomic_t +sig_atomic_t (ANSI) Used by signal +#include +typedef short sig_atomic_t; +@signal +signal (ANSI) Set the answer to an interrupt +#include +void *signal(short sig,void (*action()); +Set : errno +See also: alarm,msalarm,raise +@sin +sin (ANSI) Calculate sine +#include +double sin(double radian); +Set : errno +@sinh +sinh (ANSI) Calculate hyperbolic sine +#include +double sinh(double radian); +@size_t +size_t (ANSI) Result type of sizeof +#include +typedef unsigned long size_t; +@skipsp +skipsp (THEOS) Locate the next non-space character in a string +#include +char *skipsp(char *s); +See also: strpbrk +@sleep +sleep (UNIX) Suspend execution for a specified time +#include +void sleep(long msecs); +See also: alarm,clock,delay,msalarm,signal +@snu +snu (THEOS) Release any remaining time in this program's slice time +#include +void snu(void); +@sort +sort (THEOS) Sort an array in memory by rearranging an array of pointers +void sort(void **array,size_t nbr,short (*compar)(const void *,const void *)); +See also: qsort +@spawnl +spawnl (MSC) Spawn another program as a subtask +#include +short spawnl(short mode,const char *program,const char *arg,...,NULL); +Set : errno +See also: execl,execlp,execv,execvp,spawnlp,spawnv,spawnvp +@spawnlp +spawnlp (MSC) Spawn another program as a subtask +#include +short spawnlp(short mode,const char *path,const char *arg,...,NULL); +Set : errno +See also: execl,execlp,execv,execvp,fork,spawn,spawnv,spawnvp +@spawnv +spawnv (MSC) Spawn another program as a subtask +#include +short spawnv(short mode,const char *program,const char *arg[]); +Set : errno +See also: execl,execlp,execv,execvp,fork,spawn,spawnlp,spawnvp +@spawnvp +spawnvp (MSC) Spawn another program as a subtask +#include +short spawnvp(short mode,const char *program,const char *arg[]); +Set : errno +See also: execl,execlp,execv,execvp,fork,spawn,spawnlp,spawnv +@sprintf +sprintf (ANSI) Format output +#include +short sprintf(char *string,const char *format,...); +See also: cprintf,fprintf,printf,vfprintf,vprintf,vsprintf +@sputl +sputl (THEOS) Store a long in an hardware independent format +#include +long sputl(long l,char *buf); +See also: sgetl +@sqrt +sqrt (ANSI) Compute square root +#include +double sqrt(double z); +Set : errno +@srand +srand (ANSI) Seed pseudo-random number generator +#include +void srand(unsigned seed); +See also: rand +@sscanf +sscanf (ANSI) Format input from a string +#include +short sscanf(const char *string,const char *format,...); +@stat +stat (ANSI) Find file attributes +#include +short stat(char *file,struct stat *statptr); +Return : EOF or 0 +Set : errno + +struct stat { + dev_t st_dev; /* pÉriphÉrique */ + ino_t st_ino; /* numÉro d'Inode = 0 */ + mode_t st_mode; /* lsb = protections, msb = filestat */ + nlink_t st_nlink; /* nombre de links = 1 */ + uid_t st_uid; /* identificateur de propriÉtaire */ + gid_t st_gid; /* identificateur de groupe = st_uid */ + dev_t st_rdev; /* pÉriphÉrique physique */ + size_t st_size; /* taille du fichier en octets */ + time_t st_atime; /* date et heure de dernier accÈs ** */ + time_t st_mtime; /* date et heure de derniÈre modif ** */ + time_t st_ctime; /* date et heure de crÉation ** */ + unsigned short st_org; /* organisation : sÉq, key, ind, dir, prg */ + unsigned short st_rlen; /* largeur des enregistrements */ + unsigned short st_klen; /* largeur des clÉs */ + char st_grow; /* taux d'agrandissement */ +}; + +/* ** date de derniÈre modification */ +@std +std (THEOS) Set direction flag +#include +void std(void); +See also: cld +@sti +sti (THEOS) Set interrupt +#include +void sti(void); +See also: cli +@strcat +strcat (ANSI) Append one string to another +#include +char *strcat(char *to,const char *from); +See also: farcat,strncat +@strchr +strchr (ANSI) Locate the first occurence of a character in a string +#include +char *strchr(const char *string1,short c); +See also: farchr,memchr,strpbrk,strrchr,strstr +@strcmp +strcmp (ANSI) Compare two strings +#include +short strcmp(const char *string1,const char *string2); +See also: farcmp,fareq,memcmp,memeq,memicmp,streq,stricmp,strncmp,strneq, + strnicmp +@strcoll +strcoll (ANSI) Compare two strings according to the current collating sequence +#include +short strcoll(const char *s1, const char *s2); +See also: setlocale,strlwr,strupr,strxfrm +@strcpy +strcpy (ANSI) Copy one string into another +#include +char *strcpy(char *to,const char *from); +See also: farcpy,memccpy,memcpy,memmove,memrcpy,strdup,strmake,strncpy +@strcrypt +strcrypt (JMD) Crypt a string +#include <_string.h> +char *strcrypt(char *s); +@strcspn +strcspn (ANSI) Return length for which one string excludes characters in another +#include +unsigned short strcspn(const char *string1,const char *string2); +See also: strpbrk,strspn,strtok +@strdup +strdup (MSC) Makes a copy of a string in previously unallocated memory +#include +char *strdup(const char *from); +See also: farcpy,memccpy,memcpy,memmove,memrcpy,strcpy,strmake,strncpy +@strend +strend (THEOS) Locate the end of a string +#include +char *strend(const char *string); +@streq +streq (THEOS) Compare two strings for equality +#include +short streq(const char *string1,const char *string2); +See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,stricmp,strncmp,strneq, + strnicmp +@strerror +strerror (ANSI) Return a system message with the arguments pointed by _errarg +#include +char *strerror(short num); +See also: _errarg,errmsg,fperror,getmsg,perror,syserr +@strftime +strftime (ANSI) Convert a time structure into a formatted string +#include +size_t strftime(char *s,size_t len,const char *fmt,const struct tm *tp); +See also: asctime,ctime,gmtime,localtime,mktime,time +@stricmp +stricmp (MSC) Compare two buffers,ignoring the casemode of the characters +#include +short stricmp(const void *string1,const void *string2); +See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,streq,strncmp,strneq, + strnicmp +@strlen +strlen (ANSI) Return the length of a string +#include +short strlen(const char *string); +See also: farlen,strend +@strlwr +strlwr (MSC) Convert the alphabetic characters in a string to lower case +#include +char *strlwr(char *s); +See also: strupr,tolower,setlocale +@strmake +strmake (THEOS) Copy a memory buffer to a string,adding the nul terminator +#include +char *strmake(char *to,const char *from,size_t len); +See also: farcpy,memccpy,memcpy,memmove,memrcpy,strcpy,strdup,strncpy +@strncat +strncat (ANSI) Append one string onto another +#include +char *strncat(char *to,const char *from,size_t len); +See also: farcat,strcat +@strncmp +strncmp (ANSI) Compare two strings +#include +short strncmp(const char *string1,const char *string2,size_t len); +See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,streq,stricmp,strneq,strnicmp +@strncpy +strncpy (ANSI) Copy one string into another +#include +char *strncpy(char *to,const char *from,size_t len); +See also: farcpy,memccpy,memcpy,memmove,memrcpy,strcpy,strdup,strmake +@strneq +strneq (THEOS) Compare two strings for equality +#include +short strneq(const char *string1,const char *string2,size_t len); +See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,streq,stricmp,strncmp, + strnicmp +@strnfill +strnfill (THEOS) Fill a buffer with a character +#include +char *strnfill(char *buffer,size_t len,short character); +See also: farset,memset,strset,strnset +@strnicmp +strnicmp (MSC) Compare two buffers,ignoring the casemode of the characters +#include +short stricmp(const void *string1,const void *string2,size_t len); +See also: farcmp,fareq,memcmp,memeq,memicmp,strcmp,streq,stricmp,strncmp,strneq +@strnset +strnset (MSC) Fill a string with a character +void *strnset(char *buffer,short character,size_t len); +See also: farset,memset,strnfill,strset +@strpbrk +strpbrk (ANSI) Find first occurrence in a string of any character from another +#include +char *strpbrk(const char *string1,const char *string2); +See also: farchr,memchr,strchr,strrchr,strstr +@strrchr +strrchr (ANSI) Locate the last occurence of a character in a string +#include +char *strrchr(const char *string1,short c); +See also: farchr,memchr,strpbrk,strchr,strstr +@strsave +strsave (THEOS) See strdup +@strset +strset (MSC) Fill a string with a character +void *strset(char *buffer,short character); +See also: farset,memset,strnfill,strnset +@strspn +strspn (ANSI) Return length for which one string includes characters in another +#include +unsigned short strspn(const char *string1,const char *string2); +See also: strpbrk,strcspn,strtok +@strstr +strstr (ANSI) Locate the first occurence of one string within another +#include +char *strstr(const char *string1,const char *string2); +See also: farchr,memchr,strpbrk,strchr,strrchr +@strtod +strtod (ANSI) Convert string to floating point value +#include +double strtod(const char *s,char **es); +See also: atof,ftoa +@strtok +strtok (ANSI) Extract a token from a string +#include +char *strtok(char *string,char *delim); +See also: strcspn,srtrspn +@strtol +strtol (ANSI) Convert string in a specified base a to long integer +#include +double strtol(const char *s,char **es,short base); +See also: atol,ltoa,strtoul,ultoa +@strtoul +strtoul (ANSI) Convert string in a specified base a to unsigned long integer +#include +double strtoul(const char *s,char **es,short base); +See also: atol,ltoa,strtol,ultoa +@strupr +strupr (MSC) Convert the alphabetic characters in a string to upper case +#include +char *strupr(char *s); +See also: strlwr,tolower,setlocale +@strxfrm +strxfrm (ANSI) Convert a string according to the current collating sequence +#include +size_t strxfrm(char* to,char* from,size_t maxsize); +See also: setlocale,strcoll +@subb +subb (THEOS) Substract a value to a byte in another memory segment +#include +void subb(void *ofs,unsigned seg,char val); +See also: Other sub functions +@subcs +subcs (THEOS) Substract a value to a byte in the code segment +#include +void subcs(void *ofs,char val); +See also: Other sub functions +@subl +subl (THEOS) Substract a value to a long in another memory segment +#include +void subl(void *ofs,unsigned seg,long val); +See also: Other sub functions +@sublcs +sublcs (THEOS) Substract a value to a long in the code segment +#include +void sublcs(void *ofs,long val); +See also: Other sub functions +@subw +subw (THEOS) Substract a value to a word in another memory segment +#include +void subw(void *ofs,unsigned seg,short val); +See also: Other sub functions +@subwcs +subwcs (THEOS) Substract a value to a word in the code segment +#include +void subwcs(void *ofs,short val); +See also: Other sub functions +@suicide +suicide (THEOS) Kill the current sub-task +#include +void suicide(void); +See also: killtask +@swab +swab (THEOS) Swap a pair of bytes +#include +void swab(char *src,char *dest,unsigned nb); +@syserr +syserr (THEOS) Display a system message on stderr and exit the program +#include +void syserr(short rc,short num,char *arg[]); +See also: errmsg,exit,putmsg +@system +system (ANSI) Pass a command to the CSI shell for execution +#include +short system(const char *commandline); +@tan +tan (ANSI) Calculate tangent +#include +double tan(double radian); +@tanh +tanh (ANSI) Calculate hyperbolic cosine +#include +double tanh(double radian); +@tell +tell (MSC) Return current position of file's data pointer +#include +long tell(short filenum); +See also: close,creat,filelength,flush,lseek,open,_read,read,_write,write +@telldir +telldir (+UNIX) Return the current directory entry location +#include +long telldir(DIR*); +See also: opendir,closedir,readdir,seekdir,rewinddir +@tempnam +tempnam (ANSI) Generate a unique name for a temporary file +#include +char *tempnam(const char *directory,const char *name); +@termname +termname (+THEOS) Return the class name of a terminal or printer +#include <_stdio.h> +char* termname(int class); +See also: devname,termname,ttyname +@testarg +testarg (THEOS) Compare a string to a system keyword +#include +short testarg(char *arg,short keynbr); +See also: getkey,keyclose,matcharg +@testhead +testhead (THEOS) Control page heading and page wait for stdout +#include +void testhead(char *heading); +See also: datehdng,getll,getpl,pagewait +@testwild +testwild (THEOS) Test if a string include "wild cards" +#include +short testwild(char *s); +@tetd_t +tetd_t (MWC) Type to represent file time and date format +#include +typedef unsigned long tetd_t; +@tetd_to_tm +tetd_to_tm (MWC) Convert file time and date to system calendar format +#include +tm_t *tetd_to_tm(tetd_t time); +See also: tetd_to_time,time_to_tetd,tm_to_tetd +@tetd_to_time +tetd_to_time (MWC) Convert file time and date to a number of seconds +#include +time_t tetd_to_time(tetd_t time); +See also: tetd_to_tm,time_to_tetd,tm_to_tetd +@time +time (ANSI) Get current time in seconds since 01-01-1970 00:00:00 GMT +#include +time_t time(time_t *tp); +@time_t +time_t (ANSI) Type to represent time in seconds since 01-01-1970 00:00:00 GMT +#include +typedef long time_t; +@time_to_tetd +time_to_tetd (MWC) Convert a number of seconds to file time and date format +#include +tetd_t time_to_tetd(time_t t); +See also: tetd_to_tm,tetd_to_time,tm_to_tetd +@timeout +timeout (THEOS) Test if previous read failed because of a lock timeout +#include <_stdio.h> +short timeout(); +See also: lock_time +@timer +timer (THEOS) Set a semaphore on after a given time or a defined time of day +#include +void *timer(short sema_nbr,short type,long msec); +See also: alarm,msalarm,sema,semaphore,semares,semaset,semawait +@timezone +timezone (ANSI) Difference in seconds between GMT time and local time +#include +extern long timezone; +See also: daylight,tzset,tzname +@tm_to_tetd +tm_to_tetd (MWC) Convert system calendar format to file date and time +#include +tetd_t tm_to_tetd(tm_t *time); +See also: tetd_to_tm,tetd_to_time,time_to_tetd +@tmpfile +tmpfile (ANSI) Create and open a temporary file +#include +FILE *tmpfile(void); +See also: fopen,mktemp,lempnam,tmpnam +@tmpnam +tmpnam (ANSI) Generate a unique name for a temporary file +#include +char *tmpnam(char *name); +@toascii +#include +toascii (UNIX) Convert characters to ASCII +#include +short toascii(short c); +@toibmpc +toibmpc (+THEOS) Translate THEOS character to native IBM PC extended ASCII +#include +short toibmpc(short c); +See also: totheos +@tolower +tolower (ANSI) Convert characters to lower case +#include +short tolower(short c); +@topen +topen (THEOS) ??? +#include +FILE *topen(char *fname,char *mode,unsigned reclen,size_t blklen); +Set : _errnum +@tot_alloc +tot_alloc (THEOS) Compute the total amount of available memory +#include +size_t tot_alloc(void); +See also: calloc,free,malloc,max_alloc,realloc +@totheos +totheos (+THEOS) Translate IBM PC extended ASCII character to THEOS character +#include +short totheos(short c); +See also: toibmpc +@toupper +toupper (ANSI) Convert characters to upper case +#include +short toupper(short c); +@trim +trim (THEOS) Remove leading,trailing and multiple spaces +#include +char *trim(char *s); +@ttyname +ttyname (+UNIX) Return the name of the console physical device +#include <_stdio.h> +char* ttyname(FILE* stream); +See also: devname,termname,vdiname +@tzname +tzname (ANSI) Time zones names +#include +extern char *tzname[2]; +See also: daylight,timezone,tzset +@tzset +tzset (UNIX) Determine the time zone name for local time +#include +void tzset(void); +See also: daylight,timezone,tzname +@undef +#undef (ANSI) Undefine a manifest constant +#undef variable +@ungetc +ungetc (ANSI) Return character to input stream +#include +short ungetc(short c,FILE *fp); +See also: ungetch +@ungetch +ungetc (MSC) Return character to standard input +#include +short ungetch(short c); +See also: ungetc +@unlink +unlink (ANSI) Remove a file +#include +short unlink(const char *name); +Set : errno,_errnum +See also: remove +@unload +unload (THEOS) Unload a file from memory +#include +void unload(unsigned seg); +See also: load +@unlock +unlock (THEOS) Unlock a record +#include +void unlock(FILE *file); +See also: filelock,locking,reclock,recunlock +@unwait +unwait (THEOS) Awaken a program waiting for an interrupt +#include +void unwait(short pid); +See also: wait +@upcase +upcase (THEOS) See strupr +@utime +utime (+UNIX) Change the date and time of a file +#include +short utime(const char *filename,struct utimbuf *times); +Set : errno +See also: asctime,ctime,gmtime,localtime,stat,time +@utoa +utoa (THEOS) Convert an unsigned integer into an ASCII string +#include +char *utoa(char *s,unsigned i); +See also: ftoa,itoa,ltoa +@va_arg +va_arg (ANSI) Used to access erguments in a variable argument functions +#include +.... va_arg(va_list *arg_ptr,type); +See also: va_start,va_end +@va_end +va_end (ANSI) End variable argument processing +#include +void va_end(va_list *aptr); +See also: va_arg,va_start +@va_list +va_list (ANSI) Used in variable argument processing +#include +typedef long va_list[1]; +@va_start +va_start (ANSI) Start variable argument processing +#include +void va_start(va_list *arg_ptr,void *ptr); +See also: va_arg,va_end +@vdi +vdi (THEOS) Primitive access to the Virtual Device Interface +#include +void vdi(short vidnum,VDIPB *vdipb); +See also: vdiopen +@vdialpha +vdialpha( THEOS) Switch VDI to text mode +#include +void vdialpha(VDIPB *vdipb); +See also: vdigraph,vdiopen +@vdiarc +vdiarc (THEOS) Draw an arc +#include +void vdiarc(VDIPB *vdipb,short x,short y,short radius,short angle1,short angle2); +See also: vdicircle,vdiopen,vdipie +@vdibar +vdibar (THEOS) Draw a rectangle +#include +void vdibar(VDIPB *vdipb,short llx,short lly,short urx,short ury); +See also: vdiopen +@vdicircle +vdicircle (THEOS) Draw a circle +#include +void vdicircle(VDIPB *vdipb,short x,short y,short radius); +See also: vdiarc,vdiopen,vdipie +@vdiclear +vdiclear (THEOS) Clear the graphics page or perform a form feed +#include +void vdiarc(VDIPB *vdipb); +See also: vdiopen +@vdiclose +vdiclose (THEOS) Close a VDI file +#include +void vdiclose(VDIPB *vdipb); +See also: vdiopen +@vdigraph +vdigraph (THEOS) Swith to graphics mode +#include +void vdigraph(VDIPB *vdipb); +See also: vdialpha,vdiopen +@vdiline +vdiline (THEOS) Draw a line +#include +void vdiline(VDIPB *vdipb,short x1,short y1,short x2,short y2); +See also: vdiopen +@vdimark +vdimark (THEOS) Draw a marker +#include +void vdimark(VDIPB *vdipb,short x,short y); +See also: vdiopen +@vdiname +vdiname (+THEOS) Return the name of a VDI physical device +#include <_stdio.h> +char* vdiname(int vdiclass); +See also: devname,termname,ttyname +@vdiopen +vdiopen (THEOS) Open a graphics device +#include +VDIPB *vdiopen(short num); +See also: vdiclose +@vdipie +vdipie (THEOS) Draw a pie section +#include +void vdipie(VDIPB *vdipb,short x,short y,short radius,short angle1,short angle2); +See also: vdiarc,vdicircle,vdiopen +@vdisetfc +vdisetfc (THEOS) Set fill color +#include +void vdisetfc(VDIPB *vdipb,short color); +See also: vdibar,vdicircle,vdiopen,vdipie +@vdisetfs +vdisetfs (THEOS) Set fill style +#include +void vdisetfs(VDIPB *vdipb,short style); +See also: vdibar,vdicircle,vdiopen,vdipie +@vdisetlc +vdisetlc (THEOS) Set line color +#include +void vdisetlc(VDIPB *vdipb,short color); +See also: vdiarc,vdibar,vdicircle,vdiline,vdiopen,vdipie +@vdisetlh +vdisetlh (THEOS) Set line width or height +#include +void vdisetlh(VDIPB *vdipb,short size); +See also: vdiline,vdiopen +@vdisetls +vdisetls (THEOS) Set line style +#include +void vdisetls(VDIPB *vdipb,short style); +See also: vdiarc,vdibar,vdicircle,vdiline,vdiopen,vdipie +@vdisetmc +vdisetmc (THEOS) Set marker color +#include +void vdisetmc(VDIPB *vdipb,short color); +See also: vdimark,vdiopen +@vdisetmh +vdisetmh (THEOS) Set marker size or height +#include +void vdisetmh(VDIPB *vdipb,short size); +See also: vdimark,vdiopen +@vdisetms +vdisetms (THEOS) Set marker style +#include +void vdisetms(VDIPB *vdipb,short style); +See also: vdimark,vdiopen +@vdisetta +vdisetta (THEOS) Set text angle +#include +void vdisetta(VDIPB *vdipb,short color); +See also: vdiopen,vditext +@vdisettc +vdisettc (THEOS) Set text color +#include +void vdisettc(VDIPB *vdipb,short color); +See also: vdiopen,vditext +@vdisetth +vdisetth (THEOS) Set text size or height +#include +void vdisetth(VDIPB *vdipb,short size); +See also: vdiopen,vditext +@vdisettp +vdisettp (THEOS) Set text path +#include +void vdisettp(VDIPB *vdipb,short path); +See also: vdiopen,vditext +@vdisetts +vdisetts (THEOS) Set text style +#include +void vdisetts(VDIPB *vdipb,short style); +See also: vdiopen,vditext +@vditext +vditext (THEOS) Display a text string +#include +void vditext(VDIPB *vdipb,short x,short y,char *s); +See also: vdiopen +@vfprintf +vfprintf (ANSI) Print formatted output to a stream +#include +short vfprintf(const FILE *stream,const char *FORMAT,va_list arg); +See also: cprintf,fprintf,printf,sprintf,vprintf,vsprintf +@vprintf +vprintf (ANSI) Print formatted output to standard output +#include +short vprintf(const char *FORMAT,va_list arg); +See also: cprintf,fprintf,printf,sprintf,vfprintf,vsprintf +@vsprintf +vsprintf (ANSI) Print formatted output to a string +#include +short vsprintf(char *s,const char *FORMAT,va_list arg); +See also: cprintf,fprintf,printf,sprintf,vfprintf,vprintf +@wait (THEOS) Suspend a program until an interrupt occurs +#include +void wait(void); +See also: unwait +@write +write (ANSI) Write data to a file +#include +size_t write(short fd,void *buffer,size_t len); +See also: close,creat,filelength,flush,lseek,open,_read,read,tell,_write +@writek +writek (THEOS) Write a record to an indexed or keyed file +#include +short writek(FILE *fp,const char *key,const void *rec); +See also: deletek,readk,readn,readp +@xorb +xorb (THEOS) Xor a byte in another memory segment +#include +void xorb(void *ofs,unsigned seg,char mask); +See also: Other xor functions +@xorcs +xorcs (THEOS) Xor a byte in the code segment +#include +void xorcs(void *ofs,char mask); +See also: Other xor functions +@xorl +xorl (THEOS) Xor a long in another memory segment +#include +void xorl(void *ofs,unsigned seg,long mask); +See also: Other xor functions +@xorlcs +xorlcs (THEOS) Xor a long in the code segment +#include +void xorlcs(void *ofs,long mask); +See also: Other xor functions +@xorw +xorw (THEOS) Xor a word in another memory segment +#include +void xorw(void *ofs,unsigned seg,short mask); +See also: Other xor functions +@xorwcs +xorwcs (THEOS) Xor a word in the code segment +#include +void xorwcs(void *ofs,short mask); +See also: Other xor functions +#include <_time.h> +short _yday(short month,short day,short year); +See also: leapyear,_weekday +@yes_val +yes_val (THEOS) Value of yes answer +extern char yes_val; +@yesno +yesno (THEOS) Accept the answer yes or no according to the system keyword file +#include +short yesno(void); +See also: load_yn +@yield +yield (THEOS) See snu +@account +account (THEOS) Format of SYSTEM.ACCOUNT +#include +struct account { + char name[8]; /* [00] - logon id */ + char password[8]; /* [08] - password (spaces if none) */ + char id[2]; /* [10] - account number: + ascii-hex if 00-FE + else: 76543210-76543210 + *3210987 *6543210 + * = always set + if number >= 0x2000, + then synonym to account + & 0x1fff */ + char priv; /* [14] - privlege level */ + char mail_sw; /* [13] - you have mail */ + char abbrev_sw; /* [14] - CSI abbreviation switch */ + char stdsyn_sw; /* [15] - CSI synonym switch */ + char synonym[9]; /* [16] - CSI synonym fn______d */ + char rdy_sw; /* [1F] - CSI ready switch */ + char msg_sw; /* [20] - MSG switch */ + char break_chr[2]; /* [21] - break value (ascii-hex) */ + char work_drv; /* [23] - work drive code */ + char lang_code; /* [24] - default language code */ + char dec_is_comma; /* [25] - decimal is comma switch */ + char def_lib[19]; /* [26] - default library fn.ft:d */ + char mac_lib[9]; /* [39] - macro library fn______d */ + char obj_lib[9]; /* [42] - object library fn______d */ + char copy_lib[9]; /* [4B] - include library fn______d */ + char search[26]; /* [54] - search sequence */ + char cmd_lib[9]; /* [6E] - command library fn______d */ + char link_lib[9]; /* [77] - link library fn______d */ + char csi_case_sw; /* [80] - CSI lower case mode */ + char prompt[50]; /* [81] - CSI prompt */ +}; +@acb +acb (THEOS) Format of accseg in memory +#include +struct acb { + char name[8]; /* [00] - account name */ + short id; /* [08] - account number */ + char msgname[8]; /* [0A] - msg name */ +}; +@TERMINAL_FD +TERMINAL_FD (THEOS) Translate table used by international terminals +#include +struct TERMINAL_FD { + char type_code; + char terminal_name[25]; + near char *home; + near char *fon; + near char *foff; + near char *hon; + near char *hoff; + near char *right; + near char *left; + near char *down; + near char *ulon; + near char *clear; + near char *rvon; + near char *rvoff; + near char *dca; + near char *il; + near char *dl; + near char *setup; + near char *ic; + near char *dc; + near char *uloff; + near char *eol; + near char *eos; + near char *up; + near char *eu; + near char *bon; + near char *boff; + near char *mon; + near char *moff; + near char *color; + near char *koff; + near char *kon; + near char *son; + near char *soff; + near char *ISO_23; + near char *ISO_40; + near char *ISO_5B; + near char *ISO_5C; + near char *down_key; + near char *up_key; + near char *left_key; + near char *right_key; + near char *esc_key; + near char *top_key; + near char *bottom_key; + near char *delchar_key; + near char *page_fwd_key; + near char *page_bck_key; + near char *word_right_key; + near char *word_left_key; + near char *sch_fwd_key; + near char *sch_bck_key; + near char *again_key; + near char *file_key; + near char *erase_key; + near char *beg_line_key; + near char *end_line_key; + near char *case_key; + near char *save_key; + near char *quit_key; + near char *find_key; + near char *replace_key; + near char *del_left_key; + near char *transpose_key; + near char *ins_line_key; + near char *del_line_key; + near char *help_key; + near char *ulc; + near char *urc; + near char *lrc; + near char *llc; + near char *fwi; + near char *li; + near char *ri; + near char *ui; + near char *di; + near char *horiz; + near char *vert; + near char *rulc; + near char *rurc; + near char *rlrc; + near char *rllc; + near char *dulc; + near char *durc; + near char *dlrc; + near char *dllc; + near char *dfsi; + near char *dli; + near char *dri; + near char *dui; + near char *ddi; + near char *dhoriz; + near char *dvert; + near char *slave_enable; + near char *slave_disable; + near char *A_umlaut; + near char *a_umlaut; + near char *a_circumflex; + near char *a_grave; + near char *a_acute; + near char *E_acute; + near char *e_umlaut; + near char *e_circumflex; + near char *e_grave; + near char *e_acute; + near char *i_umlaut; + near char *i_circumflex; + near char *i_grave; + near char *i_acute; + near char *O_umlaut; + near char *o_umlaut; + near char *o_circumflex; + near char *o_grave; + near char *o_acute; + near char *U_umlaut; + near char *u_umlaut; + near char *u_circumflex; + near char *u_grave; + near char *u_acute; + near char *C_tail; + near char *c_tail; + near char *N_squiggle; + near char *n_squiggle; + near char *AE; + near char *ae; + near char *A_degree; + near char *a_degree; + near char *German_esset; + near char *invert_question; + near char *invert_exclaim; + near char *cent; + near char *english_pound; + near char *japenese_yen; + near char *spanish_pentada; + near char *dutch_guilder; + near char *one_quarter; + near char *one_half; + near char *y_umlaut; + near char *section; + near char *degree; + near char *bullet; + near char *A_umlaut_key; + near char *a_umlaut_key; + near char *a_circumflex_key; + near char *a_grave_key; + near char *a_acute_key; + near char *E_acute_key; + near char *e_umlaut_key; + near char *e_circumflex_key; + near char *e_grave_key; + near char *e_acute_key; + near char *i_umlaut_key; + near char *i_circumflex_key; + near char *i_grave_key; + near char *i_acute_key; + near char *O_umlaut_key; + near char *o_umlaut_key; + near char *o_circumflex_key; + near char *o_grave_key; + near char *o_acute_key; + near char *U_umlaut_key; + near char *u_umlaut_key; + near char *u_circumflex_key; + near char *u_grave_key; + near char *u_acute_key; + near char *C_tail_key; + near char *c_tail_key; + near char *N_squiggle_key; + near char *n_squiggle_key; + near char *AE_key; + near char *ae_key; + near char *A_degree_key; + near char *a_degree_key; + near char *German_esset_key; + near char *invert_question_key; + near char *invert_exclaim_key; + near char *cent_key; + near char *english_pound_key; + near char *japenese_yen_key; + near char *spanish_pentada_key; + near char *dutch_guilder_key; + near char *one_quarter_key; + near char *one_half_key; + near char *y_umlaut_key; + near char *section_key; + near char *degree_key; + near char *bullet_key; + near char *ISO_5D; + near char *ISO_5E; + near char *ISO_60; + near char *ISO_7B; + near char *ISO_7C; + near char *ISO_7D; + near char *ISO_7E; + near char *ISO_23_key; + near char *ISO_40_key; + near char *ISO_5B_key; + near char *ISO_5C_key; + near char *ISO_5D_key; + near char *ISO_5E_key; + near char *ISO_60_key; + near char *ISO_7B_key; + near char *ISO_7C_key; + near char *ISO_7D_key; + near char *ISO_7E_key; +}; +@TERMINAL_FE +TERMINAL_FE (THEOS) Translate table used by US terminals +#include +struct TERMINAL_FE { + char type_code; + char terminal_name[25]; + near char *home; + near char *fon; + near char *foff; + near char *hon; + near char *hoff; + near char *right; + near char *left; + near char *down; + near char *ulon; + near char *clear; + near char *rvon; + near char *rvoff; + near char *dca; + near char *il; + near char *dl; + near char *setup; + near char *ic; + near char *dc; + near char *uloff; + near char *eol; + near char *eos; + near char *up; + near char *eu; + near char *bon; + near char *boff; + near char *mon; + near char *moff; + near char *color; + near char *koff; + near char *kon; + near char *son; + near char *soff; + char filler[8]; + near char *down_key; + near char *up_key; + near char *left_key; + near char *right_key; + near char *esc_key; + near char *top_key; + near char *bottom_key; + near char *delchar_key; + near char *page_fwd_key; + near char *page_bck_key; + near char *word_right_key; + near char *word_left_key; + near char *sch_fwd_key; + near char *sch_bck_key; + near char *again_key; + near char *file_key; + near char *erase_key; + near char *beg_line_key; + near char *end_line_key; + near char *case_key; + near char *save_key; + near char *quit_key; + near char *find_key; + near char *replace_key; + near char *del_left_key; + near char *transpose_key; + near char *ins_line_key; + near char *del_line_key; + near char *help_key; + near char *ulc; + near char *urc; + near char *lrc; + near char *llc; + near char *fwi; + near char *li; + near char *ri; + near char *ui; + near char *di; + near char *horiz; + near char *vert; + near char *rulc; + near char *rurc; + near char *rlrc; + near char *rllc; + near char *dulc; + near char *durc; + near char *dlrc; + near char *dllc; + near char *dfsi; + near char *dli; + near char *dri; + near char *dui; + near char *ddi; + near char *dhoriz; + near char *dvert; + near char *slave_enable; + near char *slave_disable; +}; +@PRINTER_FC +PRINTER_FC (THEOS) Translate table used by printers +#include +struct PRINTER_FC { + char type_code; + char printer_name[25]; + near char *bold_on; + near char *bold_off; + near char *ul_on; + near char *ul_off; + near char *ital_on; + near char *ital_off; + near char *color_on; + near char *color_off; + near char *compress_on; + near char *compress_off; + near char *wide_on; + near char *wide_off; + near char *high_on; + near char *high_off; + near char *ulc; + near char *urc; + near char *lrc; + near char *llc; + near char *fwi; + near char *li; + near char *ri; + near char *ui; + near char *di; + near char *horiz; + near char *vert; + near char *rulc; + near char *rurc; + near char *rlrc; + near char *rllc; + near char *dulc; + near char *durc; + near char *dlrc; + near char *dllc; + near char *dfsi; + near char *dli; + near char *dri; + near char *dui; + near char *ddi; + near char *dhoriz; + near char *dvert; + near char *slave_enable; + near char *slave_disable; + near char *A_umlaut; + near char *a_umlaut; + near char *a_circumflex; + near char *a_grave; + near char *a_acute; + near char *E_acute; + near char *e_umlaut; + near char *e_circumflex; + near char *e_grave; + near char *e_acute; + near char *i_umlaut; + near char *i_circumflex; + near char *i_grave; + near char *i_acute; + near char *O_umlaut; + near char *o_umlaut; + near char *o_circumflex; + near char *o_grave; + near char *o_acute; + near char *U_umlaut; + near char *u_umlaut; + near char *u_circumflex; + near char *u_grave; + near char *u_acute; + near char *C_tail; + near char *c_tail; + near char *N_squiggle; + near char *n_squiggle; + near char *AE; + near char *ae; + near char *A_degree; + near char *a_degree; + near char *German_esset; + near char *invert_question; + near char *invert_exclaim; + near char *cent; + near char *english_pound; + near char *japenese_yen; + near char *spanish_pentada; + near char *dutch_guilder; + near char *one_quarter; + near char *one_half; + near char *y_umlaut; + near char *section; + near char *degree; + near char *bullet; + near char *ISO_23; + near char *ISO_40; + near char *ISO_5B; + near char *ISO_5C; + near char *ISO_5D; + near char *ISO_5E; + near char *ISO_60; + near char *ISO_7B; + near char *ISO_7C; + near char *ISO_7D; + near char *ISO_7E; +}; +@elt +elt (THEOS) Exclusive Lock Table +#include +struct elt { + void *lock_ofs; /* [00] - offset address */ + unsigned lock_seg; /* [04] - segment address */ + unsigned char lock_own; /* [06] - pid of owner */ + char lock_flag; /* [07] - set if waiting */ +}; + +#define ELT ((struct elt *)0) +#define ELTLEN 8 +#define ELTSEG 0x0078 +@fcb +fcb (THEOS) File Control Block +See FILE +@FILE +FILE (THEOS) File Control Block +#include +typedef struct fcb { + char _fst; /* [00] - 1 - file status: + 76543210 + ªªªªªªª£© = disk full on last write + ªªªªªª£©© = tape no HDR2 labels + ªªªªª£©©© = tape end of file + ªªªª£©©©© = printer needs close + ªªª£©©©©© = printer + ªª£©©©©©© = buffer has write data + ª£©©©©©©© = buffer allocated + £©©©©©©©© = opened */ + char _flub; /* [01] - 5 - logical unit,255 = null */ + short _faccess; /* [02] - 11 - access mode: + 111111 + 5432109876543210 + ªªªªªªªªªªªªªªª£© = input + ªªªªªªªªªªªªªª£©© = output + ªªªªªªªªªªªªª£©©© = lock + ªªªªªªªªªªªª£©©©© = temp file (erase) + ªªªªªªªªªªª£©©©©© = stream + ªªªªªªªªªª£©©©©©© = relative + ªªªªªªªªª£©©©©©©© = indexed + ªªªªªªªª£©©©©©©©© = keyed + ªªªªªªª£©©©©©©©©© = append mode + ªªªªªª£©©©©©©©©©© = private + ªªªªª£©©©©©©©©©©© = last prt FF + ªªªª£©©©©©©©©©©©© = pipe file + ªªª£©©©©©©©©©©©©© = printer pass-thru + ªª£©©©©©©©©©©©©©© = last prt FE + ª£©©©©©©©©©©©©©©© = lock writes + £©©©©©©©©©©©©©©©© = ix node rd/wr */ + short _freclen; /* [04] - 19 - record length */ + short _fkeylen; /* [06] - 27 - key length */ + char *_fbufbase; /* [08] - 801 - location of buffer */ + long _fbufsize; /* [0C] - 817 - buffer size */ + char *_fbufptr; /* [10] - 833 - next char position */ + long _fcount; /* [14] - 849 - number of chars left */ + long _floc; /* [18] - 865 - location next read or write */ + short _fsa; /* [1C] - 371 - slot number of fsa */ + char *_fnxtkey; /* [1E] - 889 - pointer to IX key storage */ + short _fnxt; /* [22] - 395 - type of IX key */ + long _fixnxt; /* [24] - 913 - disk address of IX key */ + char *_ftapefn; /* [28] - 929 - pointer to tape file name */ + char _filler[10]; /* [2C] - filler */ +} FILE; /* len of fcb = 54 bytes */ + +struct fcb_286 { + char _fst; /* [00] - 1 - file status: + 76543210 + ªªªªªªª£© = disk full on last write + ªªªªªª£©© = tape no HDR2 labels + ªªªªª£©©© = tape end of file + ªªªª£©©©© = printer needs close + ªªª£©©©©© = printer + ªª£©©©©©© = buffer has write data + ª£©©©©©©© = buffer allocated + £©©©©©©©© = opened */ + char _flub; /* [01] - 5 - logical unit,255 = null */ + short _faccess; /* [02] - 11 - access mode: + 111111 + 5432109876543210 + ªªªªªªªªª£© = input + ªªªªªªªª£©© = output + ªªªªªªª£©©© = lock + ªªªªªª£©©©© = temp file (erase) + ªªªªª£©©©©© = stream + ªªªª£©©©©©© = relative + ªªª£©©©©©©© = indexed + ªª£©©©©©©©© = keyed + ª£©©©©©©©©© = append mode + £©©©©©©©©©© = private */ + short _freclen; /* [04] - 19 - record length */ + short _fkeylen; /* [06] - 27 - key length */ + near char *_fbufbase; /* [08] - 35 - location of buffer */ + unsigned _fbufsize; /* [0A] - 43 - buffer size */ + near char *_fbufptr; /* [0C] - 51 - next char position */ + unsigned _fcount; /* [0E] - 59 - number of chars left */ + long _floc; /* [10] - 67 - location next read or write */ + short _fsa; /* [14] - 83 - slot number of fsa in nucleus */ +}; /* len of fcb_286 = 22 bytes */ +@fdb +fdb (THEOS) File Directory Block +#include +struct fdb { + char filename[8]; /* [00] - filename or member name */ + char filetype[8]; /* [08] - filetype */ + char filestat; /* [10] - file status: + 76543210 + 00000000 empty + 11111111 erased + 10000000 library + 01000000 sub directory + 00010000 normal stream + 00001000 relative + 00000100 keyed + 00000010 indexed + xxx00001 program + xxx = 000 8086 & 80286 real + xxx = 001 80286 protected + xxx = 010 80386 */ + unsigned short fileowner; /* [11] - owner id */ + char protect; /* [13] - protection code: + 76543210 + ªªªªªªª£© = read protect + ªªªªªª£©© = write protect + ªªªªª£©©© = execute protect + ªªªª£©©©© = erase protect + ªªª£©©©©© = shared read protect + ªª£©©©©©© = shared write protect + ª£©©©©©©© = shared execute protect + £©©©©©©©© = shared erase protect */ + union { + struct { + year : 6; /* years since 1986 [0-31] = [1986 - 2017] */ + month : 4; /* month [1 - 12] */ + day : 5; /* day [1 - 31] */ + hour : 5; /* hour [0 - 23] */ + min : 6; /* minute [0 - 59] */ + sec : 6; /* second [0 - 59] */ + } new; + struct { + char type; /* code 0=old,!0=new */ + year : 4; /* years since 1980 [0-15] = [1980 - 1995] */ + month : 4; /* month [1 - 12] */ + day : 5; /* day [1 - 31] */ + hour : 5; /* hour [0 - 23] */ + min : 6; /* minute [0 - 59] */ + : 0; + } old; + unsigned long datetime; + } filedate; /* [14] - date & time of last write */ + long filesize; /* [18] - file size in bytes */ + unsigned short reclen; /* [1C] - record length */ + unsigned short keylen; /* [1E] - key len */ + struct { + unsigned short ext_ct; /* [20] - sector count */ + char ext_addr[3]; /* [22] - sector address */ + } extlev1[5]; /* [20] - 5 level 1 extents */ + char extlev2a[3]; /* [39] - address of sector contain 51 exts */ + char extlev2b[3]; /* [3C] - address of sector contain 51 exts */ + char filegrow; /* [3F] - extent increase amount; + 0 = dynamic,chop at close + n = filesize/n,no chop */ +}; /* (fdb len = 64) */ +@fsa +fsa (THEOS) File Save Area +#include +struct fsa { + near struct diskucb *fsa_ucb; /* [00] - file ucb */ + long fsa_sect; /* [02] - fdb sector address */ + near struct fdb *fsa_ofs; /* [06] - fdb offset within sector */ + short fsa_count; /* [08] - open fcb count */ + char fsa_lock; /* [0A] - file locked: + 76543210 + ª£© deny read + £©© deny write */ + char fsa_write; /* [0B] - file modified if non zero */ + char fsa_temp; /* [0C] - erase at final close */ + char fsa_1[3]; /* [0D] - not used */ + char filestat; /* [10] - file status: + 0x10 normal stream + 0x08 direct + 0x04 keyed + 0x02 indexed */ + unsigned short fileowner; /* [11] - owner id */ + char protect; /* [13] - protection code: + 0x8? shared erase protect + 0x4? shared execute protect + 0x2? shared write protect + 0x1? shared read protect + 0x?8 erase protect + 0x?4 execute protect + 0x?2 write protect + 0x?1 read protect */ + union { + struct { + year : 6; /* years since 1986 [0 - 31] */ + month : 4; /* month [1 - 12] */ + day : 5; /* day [1 - 31] */ + hour : 5; /* hour [0 - 23] */ + min : 6; /* minute [0 - 59] */ + sec : 6; /* second [0 - 59] */ + } new; + struct { + char type; /* code 0=old,!0=new */ + year : 4; /* years since 1980 [0 - 15] */ + month : 4; /* month [1 - 12] */ + day : 5; /* day [1 - 31] */ + hour : 5; /* hour [0 - 23] */ + min : 6; /* minute [0 - 59] */ + : 0; + } old; + unsigned long datetime; + } filedate; /* [14] - date & time of last write */ + long filesize; /* [18] - file size in bytes */ + unsigned short reclen; /* [1C] - record length */ + unsigned short keylen; /* [1E] - key len */ + struct { + unsigned short ext_ct; /* [20] - sector count */ + char ext_addr[3]; /* [22] - sector address */ + } extlev1[5]; + char extlev2a[3]; /* [39] - addr of sector with 51 ext */ + char extlev2b[3]; /* [3C] - addr of sector with 51 ext */ + char filegrow; /* [3F] - extent growth factor */ +}; /* (fsa len = 64) */ + +#define FSASEG 0x0088 +@filedate +filedate (JMD) File's date and time structure +#include +typedef union filedate { /* date & time of last write */ + struct { + year : 6; /* years since 1986 [0-31] = [1986-2017] */ + month : 4; /* month [1-12] */ + day : 5; /* day [1-31] */ + hour : 5; /* hour [0-23] */ + min : 6; /* minute [0-59] */ + sec : 6; /* second [0-59] */ + } new; + struct { + type : 8; /* Type 0=old,!0=new */ + year : 4; /* years since 1980 [0-15] = [1980-1995] */ + month : 4; /* month [1-12] */ + day : 5; /* day [1-31] */ + hour : 5; /* hour [0-23] */ + min : 6; /* minute [0-59] */ + } old; + tetd_t datetime; +} FILEDATE; +@tetd_t +tetd_t (JMD) Packed file's date and time +#include +typedef unsigned long tetd_t; +@lconv +lconv (ANSI) Locale structure +#include +struct lconv { + char *decimal_point; + char *thousands_sep; + char *grouping; + char *int_curr_symbol; + char *currency_symbol; + char *mon_decimal_point; + char *mon_thousands_sep; + char *mon_grouping; + char *positive_sign; + char *negative_sign; + char int_frac_digits; + char frac_digits; + char p_cs_precedes; + char p_sep_by_space; + char n_cs_precedes; + char n_sep_by_space; + char p_sign_posn; + char n_sign_posn; +}; + +#define LC_ALL 31 +#define LC_COLLATE 1 +#define LC_CTYPE 2 +#define LC_NUMERIC 4 +#define LC_TIME 8 +#define LC_MONETARY 16 +@complex +complex (UNIX) Complex number +#include +struct complex { + double x; + double y; +}; +@nuc +nuc (THEOS) Nucleus data structure +#include +struct nuc { + char pad1[4]; /* [00] filler */ + struct { + char year; /* [04] year - 1900 */ + char month; /* [05] month (1 - 12) */ + char day; /* [06] day of month (1 - 31) */ + char hour; /* [07] hour of day (0 - 23) */ + char min; /* [08] minute of hour (0 - 59) */ + char sec; /* [09] second of minute (0 - 59) */ + } time_of_day; /* [04] system date & time */ + char dateopt; /* [0A] date option: */ + #define kanji 1 /* 16 bit Japanese Kanji */ + #define extime 2 /* external clock chip */ + #define exdate 4 /* external date chip */ + #define havusr 8 /* have USER module */ + #define aform 16 /* American MM/DD/YY */ + #define eform 32 /* European DD-MM-YY */ + #define iform 64 /* International YY.MM.DD */ + #define whist 128 /* write history records */ + char curpid; /* [0B] current process number */ + char cpu[4]; /* [0C] cpu */ + near char *curpcb; /* [10] current PCB pointer */ + unsigned short slice; /* [12] slice interval (msec) */ + near char *mstick; /* [14] address of msec tick */ + near char *snutick; /* [16] address of snu tick */ + unsigned short spoolseg; /* [18] DESPOOL segment */ + char version[5]; /* [1A] version number */ + char mfgnum; /* [1F] manufacturer number */ + unsigned short sernum; /* [20] serial number */ + long csisize; /* [22] SYSTEM.THEOS386.CSI filesize */ + struct { + unsigned short size; + char addr[3]; + } csiext[4]; /* [26] SYSTEM.THEOS386.CSI extent info */ + unsigned short csistack; /* [3A] SYSTEM.THEOS386.CSI stack len */ + char errmsg[3]; /* [3C] SYSTEM.THEOS386.MESSAGE extent info */ + unsigned short pdlseg; /* [3F] segment of PDL */ + unsigned pipenum; /* [41] next pipe number */ + char npxpid; /* [43] 80287/80387 owner pid */ + char slpcnt; /* [44] number of sleepers */ + char spdrv; /* [45] SYSTEM.SPOOLER drive */ + char sppid; /* [46] spooler pid */ + char snu_val[3]; /* [47] select next user */ + long cputime; /* [4A] time of day in msec (software) */ + short cache_seg; /* [4E] directory cache head segment */ + char srlo; /* [50] SunRiver */ + char public[26]; /* [51] public drive list A-Z */ + near char *rpb; /* [6B] RPB head seg address */ + char srhi; /* [6D] SunRiver */ + near char *rlt; /* [6E] RLT head offset address */ + unsigned pipe_hd; /* [70] PIPE head segment */ + near char *teb; /* [72] TEB head offset address */ + char tz[12]; /* [74] time zone info */ + unsigned short svdeb; /* [80] DEBUG386 use */ + long csicode; /* [82] SYSTEM.THEOS386.CSI code length */ + unsigned short msgseg; /* [86] SYSTEM.THEOS386.MESSAGE segment */ + char msgnum; /* [88] SYSTEM.THEOS386.MESSAGE suffix */ + char sync_pid; /* [89] process id of sync'er */ + unsigned short keyseg; /* [8A] SYSTEM.THEOS386.KEYWORD segment */ + char keynum; /* [8C] SYSTEM.THEOS386.KEYWORD suffix */ + char mca; /* [8D] cpu flags: */ + + #define MCA_BUS 1 + #define EISA_BUS 2 + #define ISA_BUS 32 + + #define CPU_286 64 + #define CPU_386 16 + #define CPU_486 4 + + #define FPU 8 + + #define MDOS_VER 128 + + unsigned mem_size; /* [8E] memory size at bootup */ + unsigned shmemseg; /* [90] shared memory segment */ + char sysname[16]; /* [92] system identification */ + unsigned short synseg; /* [A2] SYSTEM.THEOS386.SYNONYM segment */ + char synnum; /* [A4] SYSTEM.THEOS386.SYNONYM suffix */ + unsigned short devseg; /* [A5] SYSTEM.THEOS386.DEVNAMES segment */ + unsigned short gucb; /* [A7] VDI UCB segment address */ + char dflang; /* [A9] default language code */ + short cache_delay; /* [AA] cache write delay in .1 seconds */ + unsigned short accseg; /* [AC] ACCOUNT segment address */ + unsigned short csidata; /* [AE] SYSTEM.THEOS386.CSI data length */ + unsigned short csiheap; /* [B0] SYSTEM.THEOS386.CSI heap length */ + unsigned long pdbr; /* [B2] Page Descriptor Base reg */ + unsigned short ptseg; /* [B6] Page Table Selector */ + unsigned short v86seg; /* [B8] V86 Monitor segment */ + char v86pids[32]; /* [BA] V86 pid masks */ + unsigned char v86count; /* [DA] V86 Monitor count */ + char v86_inuse; /* [DB] set while loading V86 */ + unsigned short network; /* [DC] Network phantom pid */ + unsigned short ncb_seg; /* [DE] Network socket control block segment */ + short v86reserve; /* [E0] V86 reserve I/O segment */ + unsigned short flt_seg; /* [E2] File Lock Table */ + char copyright[28]; /* [E4] copyright notice */ + char ucb[1]; /* [100] Unit control blocks */ +}; +@pcb +pcb (THEOS) Process Control Block +#include +struct pcb { + unsigned short pstat; /* [00] - process status: */ + #define WAITING 0x00ff /* if non zero,waiting,else either \ + running or ready to run */ + #define W_INT 0x0001 /* set if waiting for interrupt */ + #define W_LOCK 0x0002 /* set if waiting for resource lock */ + #define W_SCREEN 0x0004 /* waiting for screen switch */ + #define SLEEPING 0x0008 /* set if sleeping */ + #define STOPPED 0x0010 /* set if stopped */ + #define W_PAUSE 0x0020 /* set if BREAK-S */ + #define W_SEMA 0x0040 /* set if waiting for semaphore */ + #define SR_PAGE 0x0100 /* set if need cntx swtch THEO+Grafx */ + #define MUST_COMPLETE 0x0200 /* set if task cannot be context + switched away */ + + unsigned short tib; /* [02] - TSS selector */ + + unsigned short pending; /* [04] - traps pending */ + #define QUITPEND 0x0001 /* set if BREAK-Q pending */ + #define CANPEND 0x0002 /* set if BREAK-C pending */ + #define ALRMPEND 0x0004 /* set if alarm pending */ + #define OVFPEND 0x0008 /* set if overflow/underflow pending */ + #define DIV0PEND 0x0010 /* set if divide by zero pending */ + #define FUNPEND 0x0020 /* set if function error pending */ + #define BOUNDPEN 0x0040 /* set if array bounds pending */ + #define FPEPEND 0x0080 /* set if floating point exception */ + #define SESSPEND 0x0200 /* set if need to switch sessions */ + #define FORCPEND 0x1000 /* set if FORCE pending */ + #define DEBPEND 0x2000 /* set if BREAK-D pending */ + #define KILLPEND 0x4000 /* set if kill syscall pending */ + #define STAGE 0x8000 /* set if staging the trap */ + + char taskprty; /* [06] - priority level */ + char tasklev; /* [07] - task level,0 == main task */ + unsigned long cputime; /* [08] - amount of CPU time */ + unsigned long sleeptime; /* [0C] - sleep time remain */ + near struct pcb *prtylink; /* [10] - link to next PID same prty */ + unsigned char taskfath; /* [12] - PID of parent task */ + char waitsema; /* [13] - semaphore if W_SEMA */ +}; +@pdl +pdl (THEOS) Public Device List +#include +struct pdl { + char ucbnum; /* ucb index */ + char pid; /* owner pid + 1 */ + short open_ct; /* number of opens */ +}; +@pipehdr +pipehdr (THEOS) PIPE control structure +#include +struct pipehdr { + unsigned pnext; /* fwd link to next pipe */ + unsigned pprev; /* back link to prev pipe */ + char pname[16]; /* pipe name (space pad) */ + char prd_ct; /* reader count */ + char pwr_ct; /* writer count */ + char prd_pid; /* pid of read waiter */ + char pwr_pid; /* pid of write waiter */ + unsigned psize; /* size of pipe buffer (exclude header) */ + unsigned pcount; /* number of chars in buffer */ + unsigned phead; /* read offset */ + unsigned ptail; /* write offset */ + char pbuf[]; /* pipe circular buffer */ +}; +@rlt +rlt (THEOS) Rocord Lock Table +#include +struct rlt { + short fsa_num; /* [00] - fsa number */ + unsigned char lockpid; /* [02] - locking pid plus one */ + long lockad; /* [03] - byte address */ + near struct rlt *fwd_rlt; /* [07] - fwd ptr to next */ +}; /* rlt len = 9 bytes */ +@scr +scr (THEOS) System Communication Region +#include +struct scr { + char logonname[8]; /* [00] - user name */ + unsigned short usernum; /* [08] - user number */ + char logdate[3]; /* [0A] - logon date */ + char logtime[3]; /* [0D] - logon time */ + unsigned char conmask; /* [10] - console mask: + 76543210 + ªªªªªªª£ = 1st char ctl is ok + ªªªªªª£© = suppress output if stack + ªªªªª£©© = stacked lines + ªªªª£©©© = no page wait + ªªª£©©©© = output suppress + ªª£©©©©© = inverted case + ª£©©©©©© = upper case + £©©©©©©© = echo mode */ + unsigned char csisw; /* [11] - csi switch: + 76543210 + ªªªªªªª£ = return from logon + ªªªªªª£© = execute csi command + ªªªªª£©© = from exec + ªªªª£©©© = nomsg + ªªª£©©©© = rdymsg + ªª£©©©©© = usersyn + ª£©©©©©© = stdsyn + £©©©©©©© = abbrev */ + unsigned char execsw; /* [12] - exec switch: + 76543210 + ªªªª£©©© = CSI lower case + ªªª£©©©© = error + ªª£©©©©© = noecho + ª£©©©©©© = trace + £©©©©©©© = ctl on */ + char pgmtime[3]; /* [13] - program start time */ + char pgmname[8]; /* [16] - program name */ + unsigned short execloc; /* [1E] - location in system.exec */ + near char *slofs; /* [20] - stacked line offset */ + unsigned short slseg; /* [22] - stacked line segment */ + near char *memhead; /* [24] - malloc head */ + char pipenr; /* [26] - next pipe number (0-25) */ + char privlev; /* [27] - privlege level */ + char lub[52]; /* [28] - lub table + unsigned short trapseg; /* [5C] - signal code segment */ + near void *quittrap; /* [5E] - break,q trap */ + near void *cantrap; /* [60] - break,c trap */ + near void *alrmtrap; /* [62] - alarm trap */ + near void *ovftrap; /* [64] - overflow/underflow trap */ + near void *div0trap; /* [66] - divide by zero trap */ + near void *funtrap; /* [68] - function argument trap */ + near void *boundtrap; /* [6A] - array bounds trap */ + near void *fpetrap; /* [6C] - floating point except trap */ + long cputimes; /* [6E] - cpu time start */ + char err_ext[3]; /* [72] - SYSTEM.THEOS.MESSAGE xtent */ + char workdrive; /* [75] - default work drive */ + char searchseq[26]; /* [76] - search sequence */ + unsigned char foreign; /* [90] - Foreign language switch + 76543210 + ªªªª.... = language code + ªªª£©©©© = not used + ªª£©©©©© = THEOS/Z80 style modify + ª£©©©©©© = no quit + £©©©©©©© = decimal is comma */ + char deflib[19]; /* [91] - default library */ + char cmdlib[9]; /* [A4] - cmd library */ + char maclib[9]; /* [AD] - macro library */ + char objlib[9]; /* [B6] - object library */ + char copylib[9]; /* [BF] - copy library */ + char linklib[9]; /* [C8] - link library */ + char synfile[9]; /* [D1] - synonym file */ + unsigned short comad; /* [DA] - BASIC286 common seg addr */ + char conbuf[8]; /* [DC] - console buffer (ungetch) */ + char tsb[16]; /* [E4] - tab set block */ + char cmdbuf[140]; /* [F4] - cmd storage */ + unsigned short quittraphi; /* [180] - high word */ + unsigned short cantraphi; /* [182] - high word */ + unsigned short alrmtraphi; /* [184] - high word */ + unsigned short ovftraphi; /* [186] - high word */ + unsigned short div0traphi; /* [188] - high word */ + unsigned short funtraphi; /* [18A] - high word */ + unsigned short boundtraphi; /* [18C] - high word */ + unsigned short fpetraphi; /* [18E] - high word */ + unsigned short memheadhi; /* [190] - high word */ + unsigned short cebphi; /* [192] - high word */ + unsigned short clev; /* [194] - call csi level */ + unsigned short cexec; /* [196] - execloc at call csi */ + near void *cebp; /* [198] - ebp at call csi */ + unsigned short cnlev; /* [19A] - next call csi level */ + char echo; /* [19C] - set if echoing */ + char echolub; /* [19D] - echo device */ + short echobuf; /* [19E] - buffer seg,if disk echo */ + short echofsa; /* [1A0] - fsa number */ + short echokl; /* [1A2] - offset if echo to spool */ + short echorl; /* [1A4] - page# if echo to spool */ + unsigned char echoct; /* [1A6] - buffer char ct */ + char loadtrap; /* [1A7] - debug trap on load */ + unsigned short snbseg; /* [1A8] - sema name block seg */ + char semaphor[8]; /* [1AA] - 64 semaphore bits */ + char sp_ll[4]; /* [1B2] - spool prt line len */ + char sp_pl[4]; /* [1B6] - spool prt page len */ + char sp_que[4]; /* [1BA] - spool prt que number */ + char sp_copies[4]; /* [1BE] - spool prt # copies */ + char sp_class[4]; /* [1C2] - spool prt class */ + char graphlub[4]; /* [1C6] - graphic lub number */ + unsigned short graphwork[4]; /* [1CA] - graphic work buffer */ + char graphdev[4]; /* [1D2] - graphic device number */ + char peeker; /* [1D6] - peeker pid number + 1 */ + char peekch; /* [1D7] - char to be peeked */ + char forcech; /* [1D8] - char from FORCE command */ + char cache_write_thru; /* [1D9] - set if write thru cache */ + unsigned short main_scr; /* [1DA] - alias to main task SCR */ + unsigned short main_data; /* [1DC] - alias to main task DATA */ + unsigned short atexit_ofshi; /* [1DE] - high word */ + char fill2[6]; /* [1E0] - filler */ + unsigned char lock_wait; /* [1E6] - seconds to wait for lock */ + unsigned char lock_remain; /* [1E7] - number seconds remain */ + char slave_ll; /* [1E8] - slave printer line length */ + char slave_pl; /* [1E9] - slave printer page length */ + char slave_ol; /* [1EA] - slave printer overflow */ + char slave_cl; /* [1EB] - slave printer cur line */ + char slave_cc; /* [1EC] - slave printer class code */ + unsigned short slave_seg; /* [1ED] - slave printer class seg */ + unsigned short environ_seg; /* [1EF] - segment of environment */ + near char *atexit_ofs; /* [1F1] - at exit offset */ + unsigned short atexit_seg; /* [1F3] - at exit segment */ + char csi_color[4]; /* [1F5] - normal crt color */ + unsigned cmdnum; /* [1F9] - command number */ + char fill3[5]; /* [1FB] - filler */ +}; /* length = 512 */ +@jmp_buf +jmp_buf (THEOS) Non-Local Jumps +#include +struct FarPointer { + void *ptr; + short seg; +}; + +typedef struct jmp_buf { + struct FarPointer _jmp_eip; /* return pointer */ + struct FarPointer _jmp_esp; /* stack pointer */ + void *_jmp_ebp; /* frame pointer */ + long _jmp_reg[3]; /* registers */ +} jmp_buf; +@tm +tm (ANSI) Date and time structure +#include +struct tm { + short tm_sec; /* seconds after the minute [0,60] */ + short tm_min; /* minutes after the hour [0,59] */ + short tm_hour; /* hours since midnight [0,23] */ + short tm_mday; /* day of the month [1,31] */ + short tm_mon; /* months since January [0,11] */ + short tm_year; /* years since 1900 */ + short tm_wday; /* days since Sunday [0,6] */ + short tm_yday; /* days since January 1 [0,365] */ + short tm_isdst; /* Daylight Savings Time flag */ +}; +@ucb +ucb (THEOS) Unit Control Block for character devices +#include +struct ucb { + unsigned short devaddr; /* [00] - memory address,offset always 0 */ + unsigned short iobuff1; /* [02] - i/o buffer 1 */ + char devnr; /* [04] - device number */ + char devunit; /* [05] - unit within device */ + unsigned short ubuf_ofs2; /* [06] - high ubuf_ofs pointer */ + char devtype; /* [08] - device type: + 76543210 + ªªªªª100 byte i/o + ªªªª£©©© = console + ªªª£©©©© = 2nd char of DCA + ªª£©©©©© = 3rd char of DCA + ª£©©©©©© = keyboard off + £©©©©©©© = 2nd char of BREAK */ + char devowner; /* [09] - owner process id */ + char classnr; /* [0A] - class number */ + char ll; /* [0B] - line length */ + char pl; /* [0C] - page length */ + char ol; /* [0D] - overflow lines */ + char baud; /* [0E] - baud rate: + 76543210 + xxxx.... If Sync option bit: + 0001.... BSC + 0010.... SDLC + 0011.... HDLC + 0100.... X.25 + 0101.... SNA + 0110.... GPIB + 0111.... thru 1111.... user defined + ....xxxx ASYNC baud rates: + 0 = no software baud + 1 = 56000 + 2 = 38400 + 3 = 110 + 4 = 135 + 5 = 150 + 6 = 300 + 7 = 600 + 8 = 1200 + 9 = 1800 + 10 = 2400 + 11 = 3600 + 12 = 4800 + 13 = 7200 + 14 = 9600 + 15 = 19200 + ....xxxx SYNC baud rates: + 1 = 1200 + 2 = 2400 + 3 = 4800 + 4 = 9600 + 5 = 19200 + 6 = 38400 + 7 = 48000 + 8 = 56000 + 9 = 64000 + 10 = 100000 + 11 = 200000 + 12 = 500000 + 13 = 800000 */ + char lfdly; /* [0F] - line feed delay */ + char ffdly; /* [10] - form feed delay */ + char option; /* [11] - option byte: + 76543210 + 00...... no parity + 01...... parity zero + 10...... parity odd + 11...... parity even + ..1..... synchronous + ...1.... alf + ....1... 8 bit words + .....001 dtr enable (1) + .....010 xon/xoff enable (2) + .....011 etx/ack enable (3) + .....100 cts enable (4) + .....101 xpc (5) */ + char curline; /* [12] - current line system use */ + char curcol; /* [13] - current column system use */ + unsigned short transeg; /* [14] - translate segment addr */ + near void *ubuf_ofs; /* [16] - user buffer offset */ + unsigned short ubuf_seg; /* [18] - user buffer segment */ + char scantmp; /* [1A] - scan code temporary */ + char prot_st; /* [1B] - protocol (XON/XOFF) status */ + char scan_st; /* [1C] - scan code status: + 76543210 + ªªªªªªª£© = shift + ªªªªªª£©© = compose + ªªªªª£©©© = ctl + ªªªª£©©©© = alt + ªªª£©©©©© = scroll lock + ªª£©©©©©© = num lock + ª£©©©©©©© = caps lock + £©©©©©©©© = Kanji mode */ + char brk_chr; /* [1D] - break character */ + short attrib; /* [1E] - system use (saves crt attribute) + 5432109876543210 + ªªªªªªªªªªªªªª£ = protect + ªªªªªªªªªªªªª£© = format + ªªªªªªªªªªªª£©© = reverse + ªªªªªªªªªªª£©©© = blink + ªªªªªªªªªª£©©©© = underline + ªªªªªªªªª£©©©©© = takes space + ªªªªªªªª£©©©©©© = last was attr + ªªªªªªª£©©©©©©© = caused newline + ªªªªªª£©©©©©©©© = slave prt attached + ªªªªª£©©©©©©©©© = slave prt enabled + ªªªª£©©©©©©©©©© = esc mode + ªªª£©©©©©©©©©©© = status mode + ªª£©©©©©©©©©©©© = status ignore + ª£©©©©©©©©©©©©© = last was prt cr + £©©©©©©©©©©©©©© = line graphic mode */ + /* ucb len = 32 */ +}; +@diskucb +diskucb (THEOS) Unit Control Block for disk devices +#include +struct diskucb { + unsigned short devaddr; /* [00] - memory address,offset always 0 */ + unsigned short iobuff1; /* [02] - i/o buffer 1 */ + char devnr; /* [04] - device number */ + char devunit; /* [05] - unit within device */ + unsigned short iobuff2; /* [06] - i/o buffer 2 */ + char devtype; /* [08] - device type: + 76543210 + .....001 = disk + ....1001 = disk,need label + .001.... = single density + .010.... = double density + .011.... = cyl0 = single,other dbl + .100.... = cyl0,hd0=128 other 256 + .101.... = 2048 byte sects + .110.... = 1024 byte sects + .111.... = 512 byte sects (IBM PC) + 0....... = removable volume + 1....... = fixed volume */ + char devowner; /* [09] - owner process id 0xff = public */ + char volname[8]; /* [0A] - volume id */ + unsigned short dirsize; /* [12] - directory size */ + short cyls; /* [14] - number of cylinders */ + char heads; /* [16] - number of heads */ + char sects; /* [17] - number of sectors */ + char hdldly; /* [18] - head load delay */ + char stpdly; /* [19] - step delay */ + char stsdly; /* [1A] - step settle delay */ + short curcyl; /* [1B] - current cylinder */ + char diskfill[3]; /* [1D] - work space 3 bytes */ + /* diskucb len = 32 */ +}; +@tapeucb +tapeucb (THEOS) Unit Control Block for tape devices +#include +struct tapeucb { + unsigned short devaddr; /* [00] - memory address,offset always 0 */ + unsigned short iobuff1; /* [02] - i/o buffer 1 */ + char devnr; /* [04] - device number */ + char devunit; /* [05] - unit within device */ + unsigned short iobuff2; /* [06] - i/o buffer 2 */ + char devtype; /* [08] - device type: + 76543210 + .....010 = tape */ + char devowner; /* [09] - owner process id */ + char volname[8]; /* [0A] - volume id */ + short blocknr; /* [12] - block count */ + short filenr; /* [14] - file number */ + short volnr; /* [16] - volume number */ + char devtrack; /* [18] - tape track or channel number */ + unsigned short iostat; /* [19] - status of last I/O */ + unsigned short rdlen; /* [1B] - length of last read */ + char tapefill[3]; /* [1D] - filler,tapeucb len = 32 */ +}; +@diskcntl +diskcntl (THEOS) Extended I/O structure for disk devices +#include +struct diskcntl { + short c_cmd; /* command code: + 0 = home heads to cylinder 0 + 1 = return drive status (MFG dependent) + 2 = read sectors + 3 = write sectors + 4 = format (MFG dependent) + 99 = land heads to safe landing zone */ + long c_sect; /* sector number */ + char *c_buf; /* buffer offset */ + unsigned short c_seg; /* buffer segment */ + short c_count; /* sector count */ + short c_cyl; /* cylinder number (format) */ + short c_head; /* head number (format) */ + short c_den; /* density (format) */ +}; +@bytecntl +bytecntl (THEOS) Extended I/O structure for character devices +#include +struct bytecntl { + short c_cmd; /* command code: + 1 = buffer status: + 76543210 + ª£© = TxBUF not full + £©© = RxBUF not empty + 2 = modem status: + 5432109876543210 + 111100001111ªªª£© = DSR + 111100001111ªª£©© = CTS + 111100001111ª£©©© = RI + 111100001111£©©©© = DCD + 3 = send break + 4 = use c_seg:c_buf input buffer: + struct { + short buf_len; + short buf_count; + short next_store; + short next_fetch; + char buf[buf_len]; + }; + 5 = raise DTR modem control + 6 = drop DTR modem control + 7 = raise RTS modem control + 8 = drop RTS modem control */ + short c_word1; + short c_word2; + char *c_buf; /* offset to buffer */ + unsigned short c_seg; /* selector for buffer */ +}; +@tapecntl +tapecntl (THEOS) Extended I/O structure for tape devices +#include +struct tapecntl { + short c_cmd; /* command code: + 1 = status: + 76543210 + ªªªª£© = BOT + ªªª£©© = EOT + ªª£©©© = Write Protect + ª£©©©© = Ready + £©©©©© = Streamer + 2 = rewind + 3 = rewind & unload + 4 = write tape mark + 7 = erase tape (format) + 8 = re-tension + 9 = get length of last read + 110 = read + 111 = write */ + unsigned short c_tseg; /* read/write segment */ + char *c_tbuf; /* read/write offset */ + unsigned short c_tlen; /* read/write length */ +}; +@utimbuf +utimbuf (UNIX) File time modification structure +#include +struct utimbuf { + time_t actime; + time_t modtime; +}; +@VDIPB +VDIPB (THEOS) Vdi Parameters Block +#include +typedef struct { + short *control; + short *intin; + short *ptsin; + short *intout; + short *ptsout; + short vdinum; + unsigned vdiseg; +} VDIPB; +@UBUFFER +UBUFFER (THEOS) User Buffering +#include <_ucb.h> +typedef struct ubuffer { + short buf_len; + volatile short buf_count; + volatile short next_store; + volatile short next_fetch; + char buf[]; +} UBUFFER; +@lub +lub (THEOS) Device Logical Unit Blocks Numbers +#include +enum lub { + ADISK,BDISK,CDISK,DDISK,EDISK,FDISK,GDISK,HDISK,IDISK,JDISK, + KDISK,LDISK,MDISK,NDISK,ODISK,PDISK,QDISK,RDISK,SDISK,TDISK, + UDISK,VDISK,WDISK,XDISK,YDISK,ZDISK, + CONI,CONO, + PRT1,PRT2,PRT3,PRT4, + COM1,COM2,COM3,COM4, + TAP1,TAP2,TAP3,TAP4, + COM5,COM6,COM7,COM8,COM9,COM10,COM11,COM12,COM13,COM14,COM15, + COM16 +}; +@ diff --git a/libhelp/c.idx b/libhelp/c.idx new file mode 100644 index 0000000000000000000000000000000000000000..0b6a27ca2041f5c5367957b97b401e95a54152d3 GIT binary patch literal 7836 zcmYkBd7u=FJqirl-5I(6y{ z0Oaz1l;$d4GoKXjs0dz?I7ta3+YE=bD(1A4{m@OSUKMwXQ7x8oB`?broXo?lUf)wP zzv^MD-d6ELKSOuRifi_cL$znyXNwd;6T zjb`X#tG<*Qo>wV2O)OF)@%g%Qx2N6|@jj9>YGi;>{RsIe$#9cWimi8`;<{d%;v>Z< z#c?}|7G=0jA$9RjfkGjVYj;v`Qw-{_6yRwK)K1x1wFW-1K<(lI)B-1|Vvk)&As@2B z0G%i8s#1XU7O0)Sn`#a0v%3LmzYqyl#H-OZFCTRK&LXDEPR-K!CvmfxKH7;d`Ek$HYiICvnTT_XmL6nMDCQ z2a%k7iW?Pzz)gKTZaH!>xr2T;h*A$<^`H|3cyM1jJU_s(`w=)nU3_jS#iISGl?#4? zzJrBINz}j+Q7uEoU{Yw}Ma2{y zhln>VW1&KZ*GyZ+VTaNaC!Fv_?0lGTjU({7r4(l!PK`??!%jyCWjNHdZWKfbJ`{tq z^0?vJmhlq>FU!}82uFzMWpy#;c8cNSBWZQ^Ts@Lh<6Q9z73|!iY*?cEoWfcXiEVuX<-A~9;Ir4TMaaD@EB2we&}JbV!-v+>u3=JFY_u`rd$sl zhMzHGMXyIOKkM_tezB;%oN$a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#=vGSy%1(k}mXRD}22i!LYjgqIIAItxp(>9-@_%se%2-``xN#*Rby7%oP6 l^0nmCCr& exÉcuter le sous-programme label. +@continue +&continue repartir du dÉbut de la boucle. +@control +&control autocr nn entrÉe automatique au bout de nn car. +&control case u|l|m modifier la casse du clavier. +&control nostack ne pas afficher les entrÉes de la pile. +&control notrace ne pas afficher les lignes exÉcutÉes. +&control off ne pas afficher les commandes csi. +&control on afficher les commandes csi. +&control prompt afficher avant une saisie. +&control stack afficher les entrÉes de la pile. +&control trace afficher les lignes exÉcutÉes. + note: &control peut Çtre suivi de plusieurs options. +@crt +&crt xx,yy positionner le curseur. +&crt atriboff dÉbut d'attribut vidÉo. +&crt atribon fin d'attribut vidÉo. +&crt bell sonnerie. +&crt clear effacer l'Écran. +&crt down descendre d'une ligne. +&crt eol effacer la fin de la ligne. +&crt eos effacer la fin de l'Écran. +&crt left reculer d'un caractÈre. +&crt right avancer d'un caractÈre. +&crt up monter d'une ligne. +@esc +&esc [o|p|w] [on|off] simuler la frappe de sÉquences escape. +@end +&end fin de &begstack, &begtype, &menu +@error +&error en cas d'erreur exÉcuter . +@for +&for variable = expression-debut, expression-fin +@next +&next fin de boucle &for ... &next +@goto +&goto label continuer à la ligne