Revise header files formatting.

Finish tagging BBINDABLE functions.
Modify forward-character to handle combined Unicode.
Bump up version number and set default program name as 'ue'.
This commit is contained in:
Renaud 2021-08-13 11:06:58 +08:00
parent 50b727bf7f
commit b4d69118f5
36 changed files with 1493 additions and 1506 deletions

View File

@ -1,8 +1,8 @@
/* basic.h -- basic commands for cursor movement in active window */ /* basic.h -- basic commands for cursor movement in active window */
#ifndef _BASIC_H_ #ifndef _BASIC_H_
# define _BASIC_H_ #define _BASIC_H_
# include "names.h" #include "names.h" /* BINDABLE() */
/* $overlap is the size of the line overlap when kbd calls page forw/back /* $overlap is the size of the line overlap when kbd calls page forw/back
if 0, page will move by 2/3 of the window size (1/3 page overlap) if 0, page will move by 2/3 of the window size (1/3 page overlap)

4
bind.h
View File

@ -1,9 +1,8 @@
/* bind.h -- bindable functions dealing with name and key bindings */ /* bind.h -- bindable functions dealing with name and key bindings */
#ifndef _BIND_H_ #ifndef _BIND_H_
#define _BIND_H_ #define _BIND_H_
#include "names.h" #include "names.h" /* BINDABLE() */
/* Bindable uEMACS functions */ /* Bindable uEMACS functions */
BINDABLE( apro) ; BINDABLE( apro) ;
@ -19,5 +18,4 @@ int startup( const char *fname) ;
const char *transbind( char *skey) ; /* by string representation of key */ const char *transbind( char *skey) ; /* by string representation of key */
#endif #endif
/* end of bind.h */ /* end of bind.h */

View File

@ -2,13 +2,13 @@
#ifndef _BINDABLE_H_ #ifndef _BINDABLE_H_
#define _BINDABLE_H_ #define _BINDABLE_H_
#include "names.h" #include "names.h" /* BINDABLE() */
/* functions that can be bound to keys or procedure names */ /* functions that can be bound to keys or procedure names */
BBINDABLE( ctlxe) ; BBINDABLE( ctlxe) ;
BBINDABLE( ctlxlp) ; BBINDABLE( ctlxlp) ;
BBINDABLE( ctlxrp) ; BBINDABLE( ctlxrp) ;
BINDABLE( ctrlg) ; /* ABORT */ BINDABLE( ctrlg) ; /* ABORT */
BINDABLE( quickexit) ; BINDABLE( quickexit) ;
BINDABLE( quit) ; BINDABLE( quit) ;

View File

@ -1,9 +1,9 @@
/* buffer.h -- buffer type and functions */ /* buffer.h -- buffer type and functions */
#ifndef _BUFFER_H_ #ifndef _BUFFER_H_
# define _BUFFER_H_ #define _BUFFER_H_
#include "line.h" #include "line.h" /* line_p */
#include "names.h" #include "names.h" /* BINDABLE() */
/* Text is kept in buffers. A buffer header, described below, exists for /* 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 every buffer in the system. The buffers are kept in a big list, so that

View File

@ -1,9 +1,7 @@
/* defines.h -- */ /* defines.h -- */
#ifndef __DEFINES_H__ #ifndef __DEFINES_H__
#define __DEFINES_H__ #define __DEFINES_H__
/* Must define one of /* Must define one of
USG | BSD USG | BSD
*/ */
@ -16,5 +14,4 @@
#define NSTRING 128 /* # of bytes, string buffers */ #define NSTRING 128 /* # of bytes, string buffers */
#endif #endif
/* end of defines.h */ /* end of defines.h */

View File

@ -1,19 +1,19 @@
/* display.h -- display functionality */ /* display.h -- display functionality */
#ifndef _DISPLAY_H_ #ifndef _DISPLAY_H_
# define _DISPLAY_H_ #define _DISPLAY_H_
# include <stdarg.h> #include <stdarg.h>
# include "estruct.h" #include "estruct.h"
# include "names.h" /* BINDABLE() */ #include "names.h" /* BINDABLE() */
# include "utf8.h" /* unicode_t */ #include "utf8.h" /* unicode_t */
extern int mpresf ; /* Stuff in message line */ extern int mpresf ; /* Stuff in message line */
extern int scrollcount ; /* number of lines to scroll */ extern int scrollcount ; /* number of lines to scroll */
extern int discmd ; /* display command flag */ extern int discmd ; /* display command flag */
extern int disinp ; /* display input characters (echo) */ extern int disinp ; /* display input characters (echo) */
extern int gfcolor ; /* global forgrnd color (white) */ extern int gfcolor ; /* global forgrnd color (white) */
extern int gbcolor ; /* global backgrnd color (black) */ extern int gbcolor ; /* global backgrnd color (black) */
/* Bindable functions */ /* Bindable functions */
BINDABLE( upscreen) ; BINDABLE( upscreen) ;
@ -37,13 +37,14 @@ void echos( const char *s) ;
void rubout( void) ; void rubout( void) ;
void getscreensize( int *widthp, int *heightp) ; void getscreensize( int *widthp, int *heightp) ;
# if UNIX #if UNIX
# include <signal.h> # include <signal.h>
# ifdef SIGWINCH # ifdef SIGWINCH
extern int chg_width, chg_height ; extern int chg_width, chg_height ;
void sizesignal( int signr) ; void sizesignal( int signr) ;
# endif
# endif # endif
#endif
#endif #endif
/* end of display.h */ /* end of display.h */

155
estruct.h
View File

@ -1,19 +1,17 @@
/* estruct.h -- */ /* estruct.h -- */
#ifndef _ESTRUCT_H_ #ifndef _ESTRUCT_H_
#define _ESTRUCT_H_ #define _ESTRUCT_H_
/* Structure and preprocessor defines /* Structure and preprocessor defines
* *
* written by Dave G. Conroy * written by Dave G. Conroy
* modified by Steve Wilhite, George Jones * modified by Steve Wilhite, George Jones
* substantially modified by Daniel Lawrence * substantially modified by Daniel Lawrence
* modified by Petri Kutvonen * modified by Petri Kutvonen
*/ */
#ifdef MSDOS
#ifdef MSDOS # undef MSDOS
#undef MSDOS
#endif #endif
/* Machine/OS definitions. */ /* Machine/OS definitions. */
@ -22,121 +20,116 @@
/* Make an intelligent guess about the target system. */ /* Make an intelligent guess about the target system. */
#if defined(BSD) || defined(sun) || defined(ultrix) || defined(__osf__) # if defined(BSD) || defined(sun) || defined(ultrix) || defined(__osf__)
#ifndef BSD # ifndef BSD
#define BSD 1 /* Berkeley UNIX */ # define BSD 1 /* Berkeley UNIX */
#endif # endif
#else # else
#define BSD 0 # define BSD 0
#endif # endif
#if defined(SVR4) || defined(__linux__) /* ex. SunOS 5.3 */ # if defined(SVR4) || defined(__linux__) /* ex. SunOS 5.3 */
#define SVR4 1 # define SVR4 1
#define SYSV 1 # define SYSV 1
#undef BSD # undef BSD
#endif # endif
#if defined(SYSV) || defined(u3b2) || defined(_AIX) || (defined(i386) && defined(unix)) || defined( __unix__) # if defined(SYSV) || defined(u3b2) || defined(_AIX) || (defined(i386) && defined(unix)) || defined( __unix__)
#define USG 1 /* System V UNIX */ # define USG 1 /* System V UNIX */
#else # else
#define USG 0 # define USG 0
#endif # endif
#else #else
# define BSD 0 /* UNIX BSD 4.2 and ULTRIX */ # define BSD 0 /* UNIX BSD 4.2 and ULTRIX */
# define USG 1 /* UNIX system V */ # define USG 1 /* UNIX system V */
#endif /*autoconf */ #endif /*autoconf || BSD || SYSV */
#define MSDOS 0 /* MS-DOS */ #define MSDOS 0 /* MS-DOS */
/* Compiler definitions */ /* Compiler definitions */
#ifndef AUTOCONF #ifndef AUTOCONF
# define UNIX 1 /* a random UNIX compiler */ # define UNIX 1 /* a random UNIX compiler */
#else #else
# define UNIX (BSD | USG) # define UNIX (BSD | USG)
#endif /*autoconf */ #endif /*autoconf */
/* Debugging options */ /* Debugging options */
#define RAMSIZE 0 /* dynamic RAM memory usage tracking */ #define RAMSIZE 0 /* dynamic RAM memory usage tracking */
#if RAMSIZE #if RAMSIZE
#define RAMSHOW 1 /* auto dynamic RAM reporting */ # define RAMSHOW 1 /* auto dynamic RAM reporting */
#endif #endif
#ifndef AUTOCONF #ifndef AUTOCONF
/* Terminal Output definitions */ /* Terminal Output definitions */
# define TERMCAP 0 /* Use TERMCAP */ # define TERMCAP 0 /* Use TERMCAP */
# define IBMPC 1 /* IBM-PC CGA/MONO/EGA driver */ # define IBMPC 1 /* IBM-PC CGA/MONO/EGA driver */
#else #else
# define TERMCAP UNIX # define TERMCAP UNIX
# define IBMPC MSDOS # define IBMPC MSDOS
#endif /* Autoconf. */ #endif /* Autoconf. */
/* Configuration options */ /* Configuration options */
#define VISMAC 0 /* update display during keyboard macros */ #define VISMAC 0 /* update display during keyboard macros */
#ifndef AUTOCONF
#define COLOR 1 /* color commands and windows */
#define FILOCK 0 /* file locking under unix BSD 4.2 */
#ifndef AUTOCONF
# define COLOR 1 /* color commands and windows */
# define FILOCK 0 /* file locking under unix BSD 4.2 */
#else #else
# define COLOR MSDOS
#define COLOR MSDOS # ifdef SVR4
#ifdef SVR4 # define FILOCK 1
#define FILOCK 1 # else
#else # define FILOCK BSD
#define FILOCK BSD # endif
#endif
#endif /* Autoconf. */ #endif /* Autoconf. */
#define CLEAN 0 /* de-alloc memory on exit */ #define CLEAN 0 /* de-alloc memory on exit */
#ifndef AUTOCONF #ifndef AUTOCONF
# define XONXOFF 0 /* don't disable XON-XOFF flow control P.K. */ # define XONXOFF 0 /* don't disable XON-XOFF flow control P.K. */
#else #else
# define XONXOFF UNIX # define XONXOFF UNIX
#endif /* Autoconf. */ #endif /* Autoconf. */
#define PKCODE 1 /* include my extensions P.K., define always */ #define PKCODE 1 /* include my extensions P.K., define always */
#define SCROLLCODE 1 /* scrolling code P.K. */ #define SCROLLCODE 1 /* scrolling code P.K. */
/* Define some ability flags. */ /* Define some ability flags. */
#if IBMPC #if IBMPC
#define MEMMAP 1 # define MEMMAP 1
#else #else
#define MEMMAP 0 # define MEMMAP 0
#endif #endif
#if USG | BSD #if USG | BSD
# define ENVFUNC 1 # define ENVFUNC 1
#else #else
# define ENVFUNC 0 # define ENVFUNC 0
#endif #endif
/* Dynamic RAM tracking and reporting redefinitions */ /* Dynamic RAM tracking and reporting redefinitions */
#if RAMSIZE #if RAMSIZE
#include <stdlib.h> # include <stdlib.h>
void *allocate( size_t size) ; void *allocate( size_t size) ;
void release( void *ptr) ; void release( void *ptr) ;
#define malloc allocate # define malloc allocate
#define free release # define free release
#endif #endif
/* De-allocate memory always on exit (if the operating system or /* De-allocate memory always on exit (if the operating system or
main program can not main program can not
*/ */
#if CLEAN #if CLEAN
#define exit(a) cexit(a) # define exit(a) cexit(a)
void cexit( int status) ; void cexit( int status) ;
#endif #endif
#endif #endif
/* end of estruct.h */ /* end of estruct.h */

14
eval.h
View File

@ -1,14 +1,13 @@
/* eval.h -- variables and operands evaluation */ /* eval.h -- variables and operands evaluation */
#ifndef _EVAL_H_ #ifndef _EVAL_H_
# define _EVAL_H_ #define _EVAL_H_
#include "names.h" #include "names.h"
#define DEBUGM 1 /* $debug triggers macro debugging */ #define DEBUGM 1 /* $debug triggers macro debugging */
#if DEBUGM
# if DEBUGM int mdbugout( char *fmt, ...) ;
int mdbugout( char *fmt, ...) ; #endif
# endif
extern int macbug ; /* macro debuging flag */ extern int macbug ; /* macro debuging flag */
extern int cmdstatus ; /* last command status */ extern int cmdstatus ; /* last command status */
@ -25,9 +24,8 @@ char *mklower( char *str) ;
/* Bindable functions */ /* Bindable functions */
TBINDABLE( clrmes) ; TBINDABLE( clrmes) ;
BINDABLE( setvar) ; BINDABLE( setvar) ;
BINDABLE( writemsg) ; BINDABLE( writemsg) ;
#endif #endif
/* end of eval.h */ /* end of eval.h */

3
exec.h
View File

@ -1,6 +1,6 @@
/* exec.h -- bindable functions to execute functions, macros and procedures */ /* exec.h -- bindable functions to execute functions, macros and procedures */
#ifndef _EXEC_H_ #ifndef _EXEC_H_
# define _EXEC_H_ #define _EXEC_H_
#include "names.h" #include "names.h"
@ -61,5 +61,4 @@ BINDABLE( cbuf39) ;
BINDABLE( cbuf40) ; BINDABLE( cbuf40) ;
#endif #endif
/* end of exec.h */ /* end of exec.h */

View File

@ -1,20 +1,19 @@
/* execute.h -- */ /* execute.h -- */
#ifndef _EXECUTE_H_
#define _EXECUTE_H_
#define CFENCE 1 /* fence matching in CMODE */ #include "names.h" /* BINDABLE() */
#include "names.h" /* key code */
extern int gasave ; /* global ASAVE size */
extern int gacount ; /* count until next ASAVE */
extern int gasave ; /* global ASAVE size */
extern int gacount ; /* count until next ASAVE */
int execute( unsigned keycode, int f, int n) ; int execute( unsigned keycode, int f, int n) ;
void kbd_loop( void) ; void kbd_loop( void) ;
#define CFENCE 1 /* fence matching in CMODE */
#if CFENCE #if CFENCE
BINDABLE( getfence) ; BINDABLE( getfence) ;
#endif #endif
#endif
/* end of execute.h */ /* end of execute.h */

10
file.h
View File

@ -1,13 +1,12 @@
/* file.h -- file centric commands */ /* file.h -- file centric commands */
#ifndef _FILE_H_ #ifndef _FILE_H_
#define _FILE_H_ #define _FILE_H_
#include "buffer.h" #include "buffer.h" /* bname_t */
#include "names.h" #include "names.h" /* BINDABLE() */
extern boolean restflag ; /* restricted use? */ extern boolean restflag ; /* restricted use? */
boolean resterr( void) ; /* restricted error message */ boolean resterr( void) ; /* restricted error message */
/* Bindable functions */ /* Bindable functions */
BINDABLE( filefind) ; BINDABLE( filefind) ;
@ -25,5 +24,4 @@ void unqname( char *name) ;
int writeout( const char *fn) ; int writeout( const char *fn) ;
#endif #endif
/* end of file.h */ /* end of file.h */

View File

@ -1,12 +1,13 @@
/* fileio.h -- file primitives */
#ifndef _FILEIO_H_ #ifndef _FILEIO_H_
#define _FILEIO_H_ #define _FILEIO_H_
typedef enum { typedef enum {
FIOSUC, /* File I/O, success. */ FIOSUC, /* File I/O, success. */
FIOFNF, /* File I/O, file not found. */ FIOFNF, /* File I/O, file not found. */
FIOEOF, /* File I/O, end of file. */ FIOEOF, /* File I/O, end of file. */
FIOERR, /* File I/O, error. */ FIOERR, /* File I/O, error. */
FIOMEM /* File I/O, out of memory */ FIOMEM /* File I/O, out of memory */
} fio_code ; } fio_code ;
#define FTYPE_NONE 0 #define FTYPE_NONE 0
@ -21,10 +22,10 @@ typedef enum {
#define FCODE_EXTND 0x82 #define FCODE_EXTND 0x82
#define FCODE_MIXED 0x83 #define FCODE_MIXED 0x83
extern char *fline ; /* dynamic return line */ extern char *fline ; /* dynamic return line */
extern int ftype ; extern int ftype ;
extern int fcode ; /* encoding type */ extern int fcode ; /* encoding type */
extern int fpayload ; /* actual length of fline content */ extern int fpayload ; /* actual length of fline content */
fio_code ffclose( void) ; fio_code ffclose( void) ;
fio_code ffgetline( void) ; fio_code ffgetline( void) ;
@ -33,3 +34,4 @@ fio_code ffropen( const char *fn) ;
fio_code ffwopen( const char *fn) ; fio_code ffwopen( const char *fn) ;
#endif #endif
/* end of fileio.h */

11
flook.h
View File

@ -1,8 +1,11 @@
#include "retcode.h" /* flook.h -- */
#ifndef _FLOOK_H_
#define _FLOOK_H_
#include "retcode.h" /* boolean */
#define rcfname pathname[ 0] #define rcfname pathname[ 0]
#define hlpfname pathname[ 1] #define hlpfname pathname[ 1]
extern const char *pathname[] ; extern const char *pathname[] ;
@ -10,3 +13,5 @@ extern const char *pathname[] ;
boolean fexist( const char *fname) ; boolean fexist( const char *fname) ;
char *flook( const char *fname, boolean hflag) ; char *flook( const char *fname, boolean hflag) ;
#endif
/* end of flook.h */

30
input.h
View File

@ -1,25 +1,26 @@
/* input.h -- */
#ifndef _INPUT_H_ #ifndef _INPUT_H_
#define _INPUT_H_ #define _INPUT_H_
#include "names.h" #include "names.h" /* nbind_p */
typedef enum { typedef enum {
STOP, PLAY, RECORD STOP, PLAY, RECORD
} kbdstate ; } kbdstate ;
extern kbdstate kbdmode ; /* current keyboard macro mode */ extern kbdstate kbdmode ; /* current keyboard macro mode */
extern int lastkey ; /* last keystoke */ extern int lastkey ; /* last keystoke */
extern int kbdrep ; /* number of repetitions */ extern int kbdrep ; /* number of repetitions */
extern int kbdm[] ; /* Holds kayboard macro data */ extern int kbdm[] ; /* Holds kayboard macro data */
extern int *kbdptr ; /* current position in keyboard buf */ extern int *kbdptr ; /* current position in keyboard buf */
extern int *kbdend ; /* ptr to end of the keyboard */ extern int *kbdend ; /* ptr to end of the keyboard */
extern int metac ; /* current meta character */ extern int metac ; /* current meta character */
extern int ctlxc ; /* current control X prefix char */ extern int ctlxc ; /* current control X prefix char */
extern int reptc ; /* current universal repeat char */ extern int reptc ; /* current universal repeat char */
extern int abortc ; /* current abort command char */ extern int abortc ; /* current abort command char */
extern const int nlc ; /* end of input char */ extern const int nlc ; /* end of input char */
void ue_system( const char *cmd) ; void ue_system( const char *cmd) ;
@ -28,7 +29,7 @@ int newmlarg( char **outbufref, const char *prompt, int size) ;
int newmlargt( char **outbufref, const char *prompt, int size) ; int newmlargt( char **outbufref, const char *prompt, int size) ;
int ectoc( int c) ; int ectoc( int c) ;
/* Get a command name from the command line or interactively */ /* Get a command binding from the command line or interactively */
nbind_p getname( void) ; nbind_p getname( void) ;
int tgetc( void) ; int tgetc( void) ;
@ -37,3 +38,4 @@ int getcmd( void) ;
int getstring( const char *prompt, char *buf, int nbuf, int eolchar) ; int getstring( const char *prompt, char *buf, int nbuf, int eolchar) ;
#endif #endif
/* end of input.h */

43
isa.h
View File

@ -1,34 +1,32 @@
/* isa.h -- isletter, islower, isupper, flipcase */ /* isa.h -- isletter, islower, isupper, flipcase */
#ifndef __ISA_H__ #ifndef __ISA_H__
#define __ISA_H__ #define __ISA_H__
#define NATIONL 0 /* if 1, interpret [,],\,{,},| as characters P.K. */ #ifdef islower
# undef islower
#ifdef islower
#undef islower
#endif #endif
#ifdef isupper #ifdef isupper
#undef isupper # undef isupper
#endif #endif
#if NATIONL #define NATIONL 0 /* if 1, interpret [,],\,{,},| as characters P.K. */
#define LASTUL ']' #if NATIONL
#define LASTLL '}' # define LASTUL ']'
# define LASTLL '}'
#else #else
#define LASTUL 'Z' # define LASTUL 'Z'
#define LASTLL 'z' # define LASTLL 'z'
#endif #endif
#define isletter(c) __isxletter((0xFF & (c))) #define isletter(c) __isxletter((0xFF & (c)))
#define islower(c) isxlower((0xFF & (c))) #define islower(c) isxlower((0xFF & (c)))
#define isupper(c) isxupper((0xFF & (c))) #define isupper(c) isxupper((0xFF & (c)))
#define __isxletter(c) (('a' <= c && LASTLL >= c) || ('A' <= c && LASTUL >= c) || (192<=c /* && c<=255 */)) #define __isxletter(c) (('a' <= c && LASTLL >= c) || \
#define isxlower(c) (('a' <= c && LASTLL >= c) || (224 <= c && 252 >= c)) ('A' <= c && LASTUL >= c) || (192<=c /* && c<=255 */))
#define isxupper(c) (('A' <= c && LASTUL >= c) || (192 <= c && 220 >= c)) #define isxlower(c) (('a' <= c && LASTLL >= c) || (224 <= c && 252 >= c))
#define isxupper(c) (('A' <= c && LASTUL >= c) || (192 <= c && 220 >= c))
/* DIFCASE represents the integer difference between upper and lower /* DIFCASE represents the integer difference between upper and lower
case letters. It is an xor-able value, which is fortunate, since the case letters. It is an xor-able value, which is fortunate, since the
@ -36,9 +34,8 @@
ascii in ebcdic. ascii in ebcdic.
*/ */
#define DIFCASE 0x20 /* ASCII 'a' - 'A' */ #define DIFCASE 0x20 /* ASCII 'a' - 'A' */
#define flipcase( c) ((c) ^ DIFCASE) /* Toggle the case of a letter. */ #define flipcase( c) ((c) ^ DIFCASE) /* Toggle the case of a letter. */
#endif /* __ISA_H__ */
#endif
/* end of isa.h */ /* end of isa.h */

View File

@ -2,7 +2,7 @@
#ifndef __ISEARCH_H__ #ifndef __ISEARCH_H__
#define __ISEARCH_H__ #define __ISEARCH_H__
# include "names.h" /* BINDABLE */ #include "names.h" /* BINDABLE */
BINDABLE( risearch) ; BINDABLE( risearch) ;
BINDABLE( fisearch) ; BINDABLE( fisearch) ;

1106
line.c

File diff suppressed because it is too large Load Diff

41
line.h
View File

@ -1,26 +1,24 @@
/* line.h -- line centric interface */ /* line.h -- line centric interface */
#ifndef _LINE_H_ #ifndef _LINE_H_
#define _LINE_H_ #define _LINE_H_
#include "names.h" #include "names.h"
#include "utf8.h" #include "utf8.h"
/* /* All text is kept in circularly linked lists of "struct line" structures.
* All text is kept in circularly linked lists of "struct line" structures. These begin at the header line (which is the blank line beyond the end
* These begin at the header line (which is the blank line beyond the end of the buffer). This line is pointed to by the "struct buffer". Each
* of the buffer). This line is pointed to by the "struct buffer". Each line contains a number of bytes in the line (the "used" size), the size
* line contains a 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
* of the text array, and the text. The end of line is not stored as a byte; it's implied. Future additions will include update hints, and a
* byte; it's implied. Future additions will include update hints, and a list of marks into the line.
* list of marks into the line.
*/ */
typedef struct line { typedef struct line {
struct line *l_fp ; /* Forward link to the next line */ struct line *l_fp ; /* Forward link to the next line */
struct line *l_bp ; /* Backward link to the previous line */ struct line *l_bp ; /* Backward link to the previous line */
int l_size ; /* Allocated size */ int l_size ; /* Allocated size */
int l_used ; /* Used size */ int l_used ; /* Used size */
char l_text[ 1] ; /* A bunch of characters */ char l_text[ 1] ; /* A bunch of characters */
} *line_p ; } *line_p ;
#define lforw(lp) ((lp)->l_fp) #define lforw(lp) ((lp)->l_fp)
@ -29,15 +27,15 @@ typedef struct line {
#define lputc(lp, n, c) ((lp)->l_text[(n)]=(c)) #define lputc(lp, n, c) ((lp)->l_text[(n)]=(c))
#define llength(lp) ((lp)->l_used) #define llength(lp) ((lp)->l_used)
extern int tabwidth ; /* Map to $tab, default to 8, can be set to [1, .. */ extern int tabwidth ; /* Map to $tab, default to 8, can be set to [1, .. */
char *getkill( void) ; char *getkill( void) ;
/* Bindable functions */ /* Bindable functions */
boolean backchar( int f, int n) ; BBINDABLE( backchar) ;
boolean forwchar( int f, int n) ; BBINDABLE( forwchar) ;
BINDABLE( insspace) ; BINDABLE( insspace) ;
BINDABLE( yank) ; BINDABLE( yank) ;
void lfree( line_p lp) ; void lfree( line_p lp) ;
void lchange( int flag) ; void lchange( int flag) ;
@ -54,8 +52,7 @@ void kdelete( void) ;
int kinsert( int c) ; int kinsert( int c) ;
line_p lalloc( int minsize) ; /* Allocate a line of at least minsize chars. */ line_p lalloc( int minsize) ; /* Allocate a line of at least minsize chars. */
boolean rdonly( void) ; /* Read Only error message */ boolean rdonly( void) ; /* Read Only error message */
#endif /* _LINE_H_ */
#endif
/* end of line.h */ /* end of line.h */

7
lock.h
View File

@ -1,18 +1,15 @@
/* lock.h -- */ /* lock.h -- */
#ifndef _LOCK_H_ #ifndef _LOCK_H_
#define _LOCK_H_ #define _LOCK_H_
#include "estruct.h" #include "estruct.h"
#if BSD | SVR4 #if BSD | SVR4
int lockchk( const char *fname) ; int lockchk( const char *fname) ;
int lockrel( void) ; int lockrel( void) ;
int lock( const char *fname) ; int lock( const char *fname) ;
int unlock( const char *fname) ; int unlock( const char *fname) ;
#endif
#endif #endif
#endif
/* end of lock.h */ /* end of lock.h */

View File

@ -1,5 +1,4 @@
/* mlout.h -- message line output interface */ /* mlout.h -- message line output interface */
#ifndef __MLOUT_H__ #ifndef __MLOUT_H__
#define __MLOUT_H__ #define __MLOUT_H__
@ -8,8 +7,7 @@
extern void (*mloutfmt)( const char *, ...) ; extern void (*mloutfmt)( const char *, ...) ;
void mloutstr( const char *str) ; void mloutstr( const char *str) ;
boolean mloutfail( const char *msg) ; /* output with BELL and return FALSE */ boolean mloutfail( const char *msg) ; /* output with BELL and return FALSE */
#endif /* __MLOUT_H__ */
#endif
/* end of mlout.h */ /* end of mlout.h */

16
names.h
View File

@ -1,20 +1,20 @@
/* names.h -- mapping of functions to names and keys */ /* names.h -- mapping of functions to names and keys */
#ifndef _NAMES_H_ #ifndef _NAMES_H_
# define _NAMES_H_ #define _NAMES_H_
#include "retcode.h" #include "retcode.h"
#define CTL_ 0x01000000 /* Control flag, or'ed in */ #define CTL_ 0x01000000 /* Control flag, or'ed in */
#define META 0x02000000 /* Meta flag, or'ed in */ #define META 0x02000000 /* Meta flag, or'ed in */
#define CTLX 0x04000000 /* ^X flag, or'ed in */ #define CTLX 0x04000000 /* ^X flag, or'ed in */
#define SPEC 0x08000000 /* special key (function keys) */ #define SPEC 0x08000000 /* special key (function keys) */
#define PRFXMASK 0x0F000000 /* prefix mask */ #define PRFXMASK 0x0F000000 /* prefix mask */
/* Bindable uEMACS function pointer type and definition template */ /* Bindable uEMACS function pointer type and definition template */
#define BINDABLE( fname) int fname( boolean f, int n) #define BINDABLE( fname) int fname( boolean f, int n)
#define BBINDABLE( fname) boolean fname( boolean f, int n) #define BBINDABLE( fname) boolean fname( boolean f, int n)
#define TBINDABLE BBINDABLE #define TBINDABLE BBINDABLE
typedef BINDABLE( (*fnp_t)) ; typedef BINDABLE( (*fnp_t)) ;
@ -46,7 +46,7 @@ extern kbind_p keytab ; /* key bind to functions table */
boolean init_bindings( void) ; boolean init_bindings( void) ;
kbind_p setkeybinding( unsigned key, nbind_p nbp) ; kbind_p setkeybinding( unsigned key, nbind_p nbp) ;
boolean delkeybinding( unsigned key) ; boolean delkeybinding( unsigned key) ;
kbind_p getkeybinding( unsigned key) ; /* look up by key code */ kbind_p getkeybinding( unsigned key) ; /* look up by key code */
/* find a name to function association in the name to function mapping table */ /* find a name to function association in the name to function mapping table */
nbind_p fncmatch( char *name) ; /* look up by name */ nbind_p fncmatch( char *name) ; /* look up by name */

View File

@ -1,17 +1,13 @@
/* pklock.h -- */ /* pklock.h -- */
#ifndef _PKLOCK_H_ #ifndef _PKLOCK_H_
#define _PKLOCK_H_ #define _PKLOCK_H_
#include "estruct.h" #include "estruct.h"
#if (FILOCK && BSD) || SVR4 #if (FILOCK && BSD) || SVR4
char *dolock( const char *fname) ; char *dolock( const char *fname) ;
char *undolock( const char *fname) ; char *undolock( const char *fname) ;
#endif #endif
#endif #endif
/* end of pklock.h */ /* end of pklock.h */

1116
random.c

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,18 @@
/* random.h -- various commands */ /* random.h -- various commands */
#ifndef _RANDOM_H_ #ifndef _RANDOM_H_
#define _RANDOM_H_ #define _RANDOM_H_
#include "names.h" #include "names.h"
/* Command flags */ /* Command flags */
#define CFCPCN 0x0001 /* Flag that last command was C-P, C-N */ #define CFCPCN 0x0001 /* Flag that last command was C-P, C-N */
#define CFKILL 0x0002 /* Flag that last command was a kill */ #define CFKILL 0x0002 /* Flag that last command was a kill */
extern int thisflag ; /* Flags, this command */ extern int thisflag ; /* Flags, this command */
extern int lastflag ; /* Flags, last command */ extern int lastflag ; /* Flags, last command */
extern int fillcol ; /* Fill column */ extern int fillcol ; /* Fill column */
extern boolean hardtab ; /* Use hard tab instead of soft tab */ extern boolean hardtab ; /* Use hard tab instead of soft tab */
int getcline( void) ; int getcline( void) ;
@ -21,28 +20,27 @@ int getccol( int bflg) ;
boolean setccol( int pos) ; boolean setccol( int pos) ;
/* Bindable functions */ /* Bindable functions */
BINDABLE( setfillcol) ; BINDABLE( setfillcol) ;
BINDABLE( showcpos) ; BINDABLE( showcpos) ;
boolean twiddle( int f, int n) ; BBINDABLE( twiddle) ;
BINDABLE( quote) ; BINDABLE( quote) ;
BINDABLE( insert_tab) ; BINDABLE( insert_tab) ;
BINDABLE( detab) ; BINDABLE( detab) ;
BINDABLE( entab) ; BINDABLE( entab) ;
BINDABLE( trim) ; BINDABLE( trim) ;
BINDABLE( openline) ; BINDABLE( openline) ;
BINDABLE( insert_newline) ; BINDABLE( insert_newline) ;
BINDABLE( deblank) ; BINDABLE( deblank) ;
BINDABLE( indent) ; BINDABLE( indent) ;
BINDABLE( forwdel) ; BINDABLE( forwdel) ;
BINDABLE( backdel) ; BINDABLE( backdel) ;
BINDABLE( killtext) ; BINDABLE( killtext) ;
BINDABLE( setemode) ; BINDABLE( setemode) ;
BINDABLE( delmode) ; BINDABLE( delmode) ;
BINDABLE( setgmode) ; BINDABLE( setgmode) ;
BINDABLE( delgmode) ; BINDABLE( delgmode) ;
BINDABLE( istring) ; BINDABLE( istring) ;
BINDABLE( ovstring) ; BINDABLE( ovstring) ;
#endif #endif
/* end of random.h */ /* end of random.h */

View File

@ -4,14 +4,13 @@
#include "line.h" #include "line.h"
/* /* The starting position of a region, and the size of the region in
* 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.
* characters, is kept in a region structure. Used by the region commands.
*/ */
typedef struct { typedef struct {
line_p r_linep ; /* Origin struct line address. */ line_p r_linep ; /* Origin struct line address. */
int r_offset ; /* Origin struct line offset. */ int r_offset ; /* Origin struct line offset. */
long r_size ; /* Length in characters. */ long r_size ; /* Length in characters. */
} region_t ; } region_t ;
typedef region_t *region_p ; typedef region_t *region_p ;
@ -25,5 +24,4 @@ BINDABLE( upperregion) ;
int getregion( region_p rp) ; int getregion( region_p rp) ;
#endif #endif
/* end of region.h */ /* end of region.h */

View File

@ -1,20 +1,23 @@
/* retcode.h -- */
#ifndef __RETCODE_H__ #ifndef __RETCODE_H__
#define __RETCODE_H__ #define __RETCODE_H__
#ifdef FALSE #ifdef FALSE
#error "FALSE shouldn't be defined" # error "FALSE shouldn't be defined"
#undef FALSE # undef FALSE
#endif #endif
#ifdef TRUE
#error "TRUE shouldn't be defined" #ifdef TRUE
#undef TRUE # error "TRUE shouldn't be defined"
# undef TRUE
#endif #endif
typedef enum { typedef enum {
FALSE, /* 0, false, no, bad, etc. */ FALSE, /* 0, false, no, bad, etc. */
TRUE /* 1, true, yes, good, etc. */ TRUE /* 1, true, yes, good, etc. */
} boolean ; } boolean ;
#define ABORT 2 /* 2, death, ^G, abort, etc. */ #define ABORT 2 /* 2, death, ^G, abort, etc. */
#endif #endif
/* end of retcode.h */

View File

@ -1,40 +1,38 @@
/* search.h -- */ /* search.h -- */
#ifndef _SEARCH_H_ #ifndef _SEARCH_H_
#define _SEARCH_H_ #define _SEARCH_H_
#define MAGIC 1 /* include regular expression matching? */ #include "line.h" /* line_p */
#include "names.h" /* BINDABLE() */
#include "line.h" typedef char spat_t[ 128] ; /* search pattern type */
#define NPAT sizeof( spat_t) /* # of bytes, pattern */
typedef char spat_t[ 128] ; /* search pattern type */
#define NPAT sizeof( spat_t) /* # of bytes, pattern */
extern unsigned int matchlen ; extern unsigned int matchlen ;
extern char *patmatch ; extern char *patmatch ;
extern spat_t pat ; /* Search pattern */ extern spat_t pat ; /* Search pattern */
extern spat_t tap ; /* Reversed pattern array. */ extern spat_t tap ; /* Reversed pattern array. */
extern spat_t rpat ; /* replacement pattern */ extern spat_t rpat ; /* replacement pattern */
/* /*
* PTBEG, PTEND, FORWARD, and REVERSE are all toggle-able values for * PTBEG, PTEND, FORWARD, and REVERSE are all toggle-able values for
* the scan routines. * the scan routines.
*/ */
#define PTBEG 0 /* Leave the point at the beginning on search */ #define PTBEG 0 /* Leave the point at the beginning on search */
#define PTEND 1 /* Leave the point at the end on search */ #define PTEND 1 /* Leave the point at the end on search */
#define FORWARD 0 /* forward direction */ #define FORWARD 0 /* forward direction */
#define REVERSE 1 /* backwards direction */ #define REVERSE 1 /* backwards direction */
int scanner( const char *patrn, int direct, int beg_or_end) ; int scanner( const char *patrn, int direct, int beg_or_end) ;
/* Bindable functions */ /* Bindable functions */
BINDABLE( forwsearch) ;
BINDABLE( forwhunt) ;
BINDABLE( backsearch) ;
BINDABLE( backhunt) ; BINDABLE( backhunt) ;
BINDABLE( sreplace) ; BINDABLE( backsearch) ;
BINDABLE( forwhunt) ;
BINDABLE( forwsearch) ;
BINDABLE( qreplace) ; BINDABLE( qreplace) ;
BINDABLE( sreplace) ;
int eq( unsigned char bc, unsigned char pc) ; int eq( unsigned char bc, unsigned char pc) ;
void savematch( void) ; void savematch( void) ;
@ -45,11 +43,11 @@ int boundary( line_p curline, int curoff, int dir) ;
void setprompt( char *tpat, unsigned tpat_size, char *prompt, char *apat) ; void setprompt( char *tpat, unsigned tpat_size, char *prompt, char *apat) ;
#define MAGIC 1 /* include regular expression matching? */
#if MAGIC #if MAGIC
void mcclear( void) ; void mcclear( void) ;
void rmcclear( void) ; void rmcclear( void) ;
#endif #endif
#endif #endif
/* end of search.h */ /* end of search.h */

View File

@ -1,6 +1,8 @@
/* spawn.h -- various operating system access commands */ /* spawn.h -- various operating system access commands */
#ifndef _SPAWN_H_
#define _SPAWN_H_
#include "names.h" #include "names.h" /* BINDABLE() */
/* Bindable functions */ /* Bindable functions */
BINDABLE( spawncli) ; BINDABLE( spawncli) ;
@ -12,4 +14,5 @@ BINDABLE( filter_buffer) ;
void rtfrmshell( void) ; void rtfrmshell( void) ;
#endif
/* end of spawn.h */ /* end of spawn.h */

View File

@ -1,14 +1,12 @@
/* terminal.h -- */
#ifndef __TERMINAL_H__ #ifndef __TERMINAL_H__
#define __TERMINAL_H__ #define __TERMINAL_H__
#include "defines.h" /* COLOR, SCROLLCODE */
#include "defines.h" /* COLOR, SCROLLCODE */
#include "retcode.h" #include "retcode.h"
#include "utf8.h" #include "utf8.h"
/* The editor communicates with the display using a high level interface. A
/*
* The editor communicates with the display using a high level interface. A
* "TERM" structure holds useful variables, and indirect pointers to routines * "TERM" structure holds useful variables, and indirect pointers to routines
* that do useful operations. The low level get and put routines are here too. * 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 * This lets a terminal, in addition to having non standard commands, have
@ -17,69 +15,71 @@
* one terminal type. * one terminal type.
*/ */
struct terminal { struct terminal {
const short t_maxrow ; /* max number of rows allowable */ const short t_maxrow ; /* max number of rows allowable */
const short t_maxcol ; /* max number of columns allowable */ const short t_maxcol ; /* max number of columns allowable */
short t_mrow ; /* max number of rows displayable */ short t_mrow ; /* max number of rows displayable */
short t_nrow ; /* current number of rows displayed */ short t_nrow ; /* current number of rows displayed */
short t_mcol ; /* max number of rows displayable */ short t_mcol ; /* max number of rows displayable */
short t_ncol ; /* current number of columns displayed */ short t_ncol ; /* current number of columns displayed */
short t_margin; /* min margin for extended lines */ short t_margin; /* min margin for extended lines */
short t_scrsiz; /* size of scroll region " */ short t_scrsiz; /* size of scroll region " */
int t_pause; /* # times thru update to pause */ int t_pause; /* # times thru update to pause */
void (*t_open)(void); /* Open terminal at the start. */ void (*t_open)(void); /* Open terminal at the start. */
void (*t_close)(void); /* Close terminal at end. */ void (*t_close)(void); /* Close terminal at end. */
void (*t_kopen)(void); /* Open keyboard */ void (*t_kopen)(void); /* Open keyboard */
void (*t_kclose)(void); /* close keyboard */ void (*t_kclose)(void); /* close keyboard */
int (*t_getchar)(void); /* Get character from keyboard. */ int (*t_getchar)(void); /* Get character from keyboard. */
int (*t_putchar)( unicode_t) ; /* Put character to display. */ int (*t_putchar)( unicode_t) ; /* Put character to display. */
void (*t_flush) (void); /* Flush output buffers. */ void (*t_flush) (void); /* Flush output buffers. */
void (*t_move)(int, int);/* Move the cursor, origin 0. */ void (*t_move)(int, int);/* Move the cursor, origin 0. */
void (*t_eeol)(void); /* Erase to end of line. */ void (*t_eeol)(void); /* Erase to end of line. */
void (*t_eeop)(void); /* Erase to end of page. */ void (*t_eeop)(void); /* Erase to end of page. */
void (*t_beep)(void); /* Beep. */ void (*t_beep)(void); /* Beep. */
void (*t_rev)(int); /* set reverse video state */ void (*t_rev)(int); /* set reverse video state */
int (*t_rez)(char *); /* change screen resolution */ int (*t_rez)(char *); /* change screen resolution */
#if COLOR #if COLOR
int (*t_setfor) (); /* set forground color */ int (*t_setfor) (); /* set forground color */
int (*t_setback) (); /* set background color */ int (*t_setback) (); /* set background color */
#endif #endif
#if SCROLLCODE #if SCROLLCODE
void (*t_scroll)(int, int,int); /* scroll a region of the screen */ void (*t_scroll)(int, int,int); /* scroll a region of the screen */
#endif #endif
}; };
/* TEMPORARY macros for terminal I/O (to be placed in a machine /* TEMPORARY macros for terminal I/O (to be placed in a machine dependant
dependant place later) */ place later)
*/
#define TTopen (*term.t_open) #define TTopen (*term.t_open)
#define TTclose (*term.t_close) #define TTclose (*term.t_close)
#define TTkopen (*term.t_kopen) #define TTkopen (*term.t_kopen)
#define TTkclose (*term.t_kclose) #define TTkclose (*term.t_kclose)
#define TTgetc (*term.t_getchar) #define TTgetc (*term.t_getchar)
#define TTputc (*term.t_putchar) #define TTputc (*term.t_putchar)
#define TTflush (*term.t_flush) #define TTflush (*term.t_flush)
#define TTmove (*term.t_move) #define TTmove (*term.t_move)
#define TTeeol (*term.t_eeol) #define TTeeol (*term.t_eeol)
#define TTeeop (*term.t_eeop) #define TTeeop (*term.t_eeop)
#define TTbeep (*term.t_beep) #define TTbeep (*term.t_beep)
#define TTrev (*term.t_rev) #define TTrev (*term.t_rev)
#define TTrez (*term.t_rez) #define TTrez (*term.t_rez)
#if COLOR #if COLOR
#define TTforg (*term.t_setfor) #define TTforg (*term.t_setfor)
#define TTbacg (*term.t_setback) #define TTbacg (*term.t_setback)
#endif #endif
/* Terminal table defined only in term.c */ /* Terminal table defined only in term.c */
extern struct terminal term ; extern struct terminal term ;
extern int ttrow ; /* Row location of HW cursor */ extern int ttrow ; /* Row location of HW cursor */
extern int ttcol ; /* Column location of HW cursor */ extern int ttcol ; /* Column location of HW cursor */
extern boolean eolexist ; /* does clear to EOL exist? */ extern boolean eolexist ; /* does clear to EOL exist? */
extern boolean revexist ; /* does reverse video exist? */ extern boolean revexist ; /* does reverse video exist? */
extern boolean sgarbf ; /* State of screen unknown */ extern boolean sgarbf ; /* State of screen unknown */
extern char sres[] ; /* Current screen resolution. */ extern char sres[] ; /* Current screen resolution. */
/* NORMAL, CGA, EGA, VGA */ /* NORMAL, CGA, EGA, VGA */
#endif #endif
/* end of terminal.h */

View File

@ -1,14 +1,15 @@
/* termio.h -- */
#ifndef _TERMIO_H_ #ifndef _TERMIO_H_
#define _TERMIO_H_ #define _TERMIO_H_
#include "utf8.h" #include "utf8.h"
#define TYPEAH 1 /* type ahead causes update to be skipped */ #define TYPEAH 1 /* type ahead causes update to be skipped */
#define HUGE 1000 /* Huge number (for row/col) */ #define HUGE 1000 /* Huge number (for row/col) */
extern int ttrow ; /* Row location of HW cursor */ extern int ttrow ; /* Row location of HW cursor */
extern int ttcol ; /* Column location of HW cursor */ extern int ttcol ; /* Column location of HW cursor */
void ttopen( void) ; void ttopen( void) ;
void ttclose( void) ; void ttclose( void) ;
@ -18,3 +19,4 @@ int ttgetc( void) ;
int typahead( void) ; int typahead( void) ;
#endif #endif
/* end of termio.h */

6
utf8.h
View File

@ -1,5 +1,6 @@
#ifndef UTF8_H /* utf8.h -- */
#define UTF8_H #ifndef _UTF8_H_
#define _UTF8_H_
typedef unsigned int unicode_t ; typedef unsigned int unicode_t ;
@ -10,3 +11,4 @@ unsigned utf8_revdelta( unsigned char *buf, unsigned pos) ;
unsigned unicode_to_utf8( unicode_t c, char *utf8) ; unsigned unicode_to_utf8( unicode_t c, char *utf8) ;
#endif #endif
/* end of utf8.h */

7
util.h
View File

@ -1,9 +1,10 @@
/* util.h -- utility functions */ /* util.h -- utility functions */
#ifndef UTIL_H_ #ifndef _UTIL_H_
# define UTIL_H_ #define _UTIL_H_
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
void mystrscpy( char *dst, const char *src, int size) ; void mystrscpy( char *dst, const char *src, int size) ;
#endif /* UTIL_H_ */ #endif
/* end of util.h */ /* end of util.h */

View File

@ -1,16 +1,18 @@
#ifndef VERSION_H_ /* version.h -- name and version strings */
#define VERSION_H_ #ifndef _VERSION_H_
#define _VERSION_H_
#ifdef PROGRAM #ifdef PROGRAM
# define _QUOTE( s) #s # define _QUOTE( s) #s
# define QUOTE( s) _QUOTE( s) # define QUOTE( s) _QUOTE( s)
# define PROGRAM_NAME QUOTE(PROGRAM) # define PROGRAM_NAME QUOTE(PROGRAM)
#else #else
# define PROGRAM_NAME "em" # define PROGRAM_NAME "ue"
#endif #endif
#define PROGRAM_NAME_UTF8 "µEMACS" #define PROGRAM_NAME_UTF8 "µEMACS"
#define VERSION "4.2.4" #define VERSION "4.2.5"
#endif /* VERSION_H_ */ #endif
/* end of version.h */

View File

@ -2,9 +2,9 @@
#ifndef _WINDOW_H_ #ifndef _WINDOW_H_
#define _WINDOW_H_ #define _WINDOW_H_
#include "defines.h" /* COLOR, SCROLLCODE */ #include "defines.h" /* COLOR, SCROLLCODE */
#include "buffer.h" /* buffer_p, line_p */ #include "buffer.h" /* buffer_p, line_p */
#include "names.h" /* BINDABLE() */ #include "names.h" /* BINDABLE() */
/* There is a window structure allocated for every active display window. /* 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 windows are kept in a big list, in top to bottom screen order, with
@ -15,40 +15,40 @@
every input character. every input character.
*/ */
typedef struct window { typedef struct window {
struct window *w_wndp; /* Next window */ struct window *w_wndp; /* Next window */
buffer_p w_bufp ; /* Buffer displayed in window */ buffer_p w_bufp ; /* Buffer displayed in window */
line_p w_linep ; /* Top line in the window */ line_p w_linep ; /* Top line in the window */
line_p w_dotp ; /* Line containing "." */ line_p w_dotp ; /* Line containing "." */
line_p w_markp ; /* Line containing "mark" */ line_p w_markp ; /* Line containing "mark" */
int w_doto ; /* Byte offset for "." */ int w_doto ; /* Byte offset for "." */
int w_marko ; /* Byte offset for "mark" */ int w_marko ; /* Byte offset for "mark" */
int w_toprow ; /* Origin 0 top row of window */ int w_toprow ; /* Origin 0 top row of window */
int w_ntrows ; /* # of rows of text in window */ int w_ntrows ; /* # of rows of text in window */
char w_force ; /* If NZ, forcing row. */ char w_force ; /* If NZ, forcing row. */
char w_flag ; /* Flags. */ char w_flag ; /* Flags. */
# if COLOR #if COLOR
char w_fcolor ; /* current forground color */ char w_fcolor ; /* current forground color */
char w_bcolor ; /* current background color */ char w_bcolor ; /* current background color */
# endif #endif
} *window_p ; } *window_p ;
extern window_p curwp ; /* Current window */ extern window_p curwp ; /* Current window */
extern window_p wheadp ; /* Head of list of windows */ extern window_p wheadp ; /* Head of list of windows */
/* curwbyte return the byte after the dot in current window */ /* curwbyte return the byte after the dot in current window */
#define curwbyte() lgetc( curwp->w_dotp, curwp->w_doto) #define curwbyte() lgetc( curwp->w_dotp, curwp->w_doto)
#define WFFORCE 0x01 /* Window needs forced reframe */ #define WFFORCE 0x01 /* Window needs forced reframe */
#define WFMOVE 0x02 /* Movement from line to line */ #define WFMOVE 0x02 /* Movement from line to line */
#define WFEDIT 0x04 /* Editing within a line */ #define WFEDIT 0x04 /* Editing within a line */
#define WFHARD 0x08 /* Better to a full display */ #define WFHARD 0x08 /* Better to a full display */
#define WFMODE 0x10 /* Update mode line. */ #define WFMODE 0x10 /* Update mode line. */
#define WFCOLR 0x20 /* Needs a color change */ #define WFCOLR 0x20 /* Needs a color change */
# if SCROLLCODE #if SCROLLCODE
# define WFKILLS 0x40 /* something was deleted */ # define WFKILLS 0x40 /* something was deleted */
# define WFINS 0x80 /* something was inserted */ # define WFINS 0x80 /* something was inserted */
# endif #endif
/* Bindable functions */ /* Bindable functions */
BINDABLE( delwind) ; BINDABLE( delwind) ;

1
word.h
View File

@ -21,5 +21,4 @@ BINDABLE( killpara) ;
BINDABLE( wordcount) ; BINDABLE( wordcount) ;
#endif #endif
/* end of word.h */ /* end of word.h */

View File

@ -1,10 +1,12 @@
/* wrapper.h -- */
#ifndef WRAPPER_H_ #ifndef WRAPPER_H_
#define WRAPPER_H_ #define WRAPPER_H_
#include <stdlib.h> #include <stdlib.h> /* size_t */
void xmkstemp( char *fname_template) ; void xmkstemp( char *fname_template) ;
void *xmalloc( size_t size) ; void *xmalloc( size_t size) ;
#endif /* WRAPPER_H_ */ #endif
/* end of wrapper.h */