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

@ -2,7 +2,7 @@
#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,7 +2,7 @@
#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) ;

View File

@ -2,8 +2,8 @@
#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

@ -45,5 +45,6 @@ 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 */

View File

@ -1,5 +1,4 @@
/* estruct.h -- */ /* estruct.h -- */
#ifndef _ESTRUCT_H_ #ifndef _ESTRUCT_H_
#define _ESTRUCT_H_ #define _ESTRUCT_H_
@ -11,7 +10,6 @@
* modified by Petri Kutvonen * modified by Petri Kutvonen
*/ */
#ifdef MSDOS #ifdef MSDOS
# undef MSDOS # undef MSDOS
#endif #endif
@ -45,7 +43,7 @@
#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 */
@ -77,19 +75,15 @@
#define VISMAC 0 /* update display during keyboard macros */ #define VISMAC 0 /* update display during keyboard macros */
#ifndef AUTOCONF #ifndef AUTOCONF
# define COLOR 1 /* color commands and windows */ # define COLOR 1 /* color commands and windows */
# define FILOCK 0 /* file locking under unix BSD 4.2 */ # 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 */
@ -138,5 +132,4 @@ void cexit( int status) ;
#endif #endif
#endif #endif
/* end of estruct.h */ /* end of estruct.h */

2
eval.h
View File

@ -5,7 +5,6 @@
#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
@ -29,5 +28,4 @@ BINDABLE( setvar) ;
BINDABLE( writemsg) ; BINDABLE( writemsg) ;
#endif #endif
/* end of eval.h */ /* end of eval.h */

1
exec.h
View File

@ -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 gasave ; /* global ASAVE size */
extern int gacount ; /* count until next ASAVE */ 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 */

6
file.h
View File

@ -1,10 +1,9 @@
/* 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 */
@ -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,3 +1,4 @@
/* fileio.h -- file primitives */
#ifndef _FILEIO_H_ #ifndef _FILEIO_H_
#define _FILEIO_H_ #define _FILEIO_H_
@ -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 */

View File

@ -1,5 +1,8 @@
#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]
@ -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 */

View File

@ -1,7 +1,8 @@
/* 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
@ -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 */

11
isa.h
View File

@ -1,11 +1,7 @@
/* 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 #ifdef islower
# undef islower # undef islower
#endif #endif
@ -14,6 +10,7 @@
# undef isupper # undef isupper
#endif #endif
#define NATIONL 0 /* if 1, interpret [,],\,{,},| as characters P.K. */
#if NATIONL #if NATIONL
# define LASTUL ']' # define LASTUL ']'
# define LASTLL '}' # define LASTLL '}'
@ -26,7 +23,8 @@
#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) || \
('A' <= c && LASTUL >= c) || (192<=c /* && c<=255 */))
#define isxlower(c) (('a' <= c && LASTLL >= c) || (224 <= c && 252 >= c)) #define isxlower(c) (('a' <= c && LASTLL >= c) || (224 <= c && 252 >= c))
#define isxupper(c) (('A' <= c && LASTUL >= c) || (192 <= c && 220 >= c)) #define isxupper(c) (('A' <= c && LASTUL >= c) || (192 <= c && 220 >= c))
@ -39,6 +37,5 @@
#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 */

48
line.c
View File

@ -84,22 +84,20 @@ char *getkill( void) {
return value; return value;
} }
/*
* Move the cursor backwards by "n" characters. If "n" is less than zero call /* Move the cursor backwards by "n" characters. If "n" is less than zero
* "forwchar" to actually do the move. Otherwise compute the new cursor call "forwchar" to actually do the move. Otherwise compute the new
* location. Error if you try and move out of the buffer. Set the flag if the cursor location. Error if you try and move out of the buffer. Set the
* line pointer for dot changes. flag if the line pointer for dot changes.
*/ */
boolean backchar( int f, int n) { BBINDABLE( backchar) {
assert( f == TRUE || (f == FALSE && n == 1)) ; assert( f == TRUE || n == 1) ;
if( n < 0) if( n < 0)
return forwchar( f, -n) ; return forwchar( f, -n) ;
while( n--) { while( n--) {
if( curwp->w_doto == 0) { /* at beginning of line */ if( curwp->w_doto == 0) { /* at beginning of line */
line_p lp ; line_p lp = lback( curwp->w_dotp) ;
lp = lback( curwp->w_dotp) ;
if( lp == curbp->b_linep) /* at beginning of buffer */ if( lp == curbp->b_linep) /* at beginning of buffer */
return FALSE ; return FALSE ;
@ -107,9 +105,7 @@ boolean backchar( int f, int n) {
curwp->w_doto = llength( lp) ; curwp->w_doto = llength( lp) ;
curwp->w_flag |= WFMOVE ; curwp->w_flag |= WFMOVE ;
} else { } else {
unsigned pos ; unsigned pos = curwp->w_doto -= 1 ;
pos = curwp->w_doto -= 1 ;
if( pos > 0) if( pos > 0)
curwp->w_doto -= utf8_revdelta( (unsigned char *) &( (curwp->w_dotp)->l_text[ pos]), pos) ; curwp->w_doto -= utf8_revdelta( (unsigned char *) &( (curwp->w_dotp)->l_text[ pos]), pos) ;
} }
@ -118,14 +114,14 @@ boolean backchar( int f, int n) {
return TRUE ; return TRUE ;
} }
/*
* Move the cursor forwards by "n" characters. If "n" is less than zero call /* Move the cursor forwards by "n" characters. If "n" is less than zero
* "backchar" to actually do the move. Otherwise compute the new cursor call "backchar" to actually do the move. Otherwise compute the new
* location, and move ".". Error if you try and move off the end of the cursor location, and move ".". Error if you try and move off the end of
* buffer. Set the flag if the line pointer for dot changes. the buffer. Set the flag if the line pointer for dot changes.
*/ */
boolean forwchar( int f, int n) { BBINDABLE( forwchar) {
assert( f == TRUE || (f == FALSE && n == 1)) ; assert( f == TRUE || n == 1) ;
if( n < 0) if( n < 0)
return backchar( f, -n) ; return backchar( f, -n) ;
@ -140,10 +136,18 @@ boolean forwchar( int f, int n) {
curwp->w_flag |= WFMOVE ; curwp->w_flag |= WFMOVE ;
} else { } else {
unicode_t unc ; unicode_t unc ;
unsigned bytes ;
bytes = utf8_to_unicode( curwp->w_dotp->l_text, curwp->w_doto, len, &unc) ; curwp->w_doto += utf8_to_unicode( curwp->w_dotp->l_text,
curwp->w_doto, len, &unc) ;
/* check if next char is null width unicode */
while( curwp->w_doto != len) {
unsigned bytes = utf8_to_unicode( curwp->w_dotp->l_text,
curwp->w_doto, len, &unc) ;
if( utf8_width( unc) == 0)
curwp->w_doto += bytes ; curwp->w_doto += bytes ;
else
break ;
}
} }
} }

23
line.h
View File

@ -1,19 +1,17 @@
/* 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 */
@ -34,8 +32,8 @@ 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) ;
@ -56,6 +54,5 @@ 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 */

5
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__
@ -10,6 +9,5 @@ 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 */

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 */

View File

@ -1,12 +1,10 @@
/* random.c -- implements random.h */ /* random.c -- implements random.h */
#include "random.h" #include "random.h"
/* random.c /* This file contains the command processing functions for a number of
* random commands. There is no functional grouping here, for sure.
* This file contains the command processing functions for a number of
* random commands. There is no functional grouping here, for sure. Modified by Petri Kutvonen
*
* Modified by Petri Kutvonen
*/ */
#include <assert.h> #include <assert.h>
@ -212,14 +210,15 @@ boolean setccol( int pos) {
return col >= pos; return col >= pos;
} }
/*
* Twiddle the two characters on either side of dot. If dot is at the end of /* Twiddle the two characters on either side of dot. If dot is at the end
* the line twiddle the two characters before it. Return with an error if dot of the line twiddle the two characters before it. Return with an error
* is at the beginning of line; it seems to be a bit pointless to make this if dot is at the beginning of line; it seems to be a bit pointless to
* work. This fixes up a very common typo with a single stroke. Normally bound make this work. This fixes up a very common typo with a single stroke.
* to "C-T". This always works within a line, so "WFEDIT" is good enough. Normally bound to "C-T". This always works within a line, so "WFEDIT"
is good enough.
*/ */
boolean twiddle( int f, int n) { BBINDABLE( twiddle) {
unicode_t c ; unicode_t c ;
boolean eof_f = FALSE ; boolean eof_f = FALSE ;
@ -751,8 +750,8 @@ BINDABLE( delgmode) {
return adjustmode( FALSE, TRUE) ; return adjustmode( FALSE, TRUE) ;
} }
/*
* change the editor mode status /* change the editor mode status
* *
* int kind; true = set, false = delete * int kind; true = set, false = delete
* int global; true = global flag, false = current buffer flag * int global; true = global flag, false = current buffer flag
@ -859,21 +858,20 @@ static int iovstring( int f, int n, const char *prompt, int (*fun)( char *)) {
return status ; return status ;
} }
/*
* ask for and insert a string into the current /* ask for and insert a string into the current buffer at the current point
* buffer at the current point
* int f, n; ignored arguments
* int f, n; ignored arguments
*/ */
BINDABLE( istring) { BINDABLE( istring) {
return iovstring( f, n, "insert-string<META>: ", linstr) ; return iovstring( f, n, "insert-string<META>: ", linstr) ;
} }
/*
* ask for and overwite a string into the current /* ask for and overwite a string into the current buffer at the current
* buffer at the current point point
*
* int f, n; ignored arguments int f, n; ignored arguments
*/ */
BINDABLE( ovstring) { BINDABLE( ovstring) {
return iovstring( f, n, "overwrite-string<META>: ", lover) ; return iovstring( f, n, "overwrite-string<META>: ", lover) ;

View File

@ -1,5 +1,4 @@
/* random.h -- various commands */ /* random.h -- various commands */
#ifndef _RANDOM_H_ #ifndef _RANDOM_H_
#define _RANDOM_H_ #define _RANDOM_H_
@ -23,7 +22,7 @@ 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) ;
@ -44,5 +43,4 @@ BINDABLE( istring) ;
BINDABLE( ovstring) ; BINDABLE( ovstring) ;
#endif #endif
/* end of random.h */ /* end of random.h */

View File

@ -4,9 +4,8 @@
#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. */
@ -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,3 +1,4 @@
/* retcode.h -- */
#ifndef __RETCODE_H__ #ifndef __RETCODE_H__
#define __RETCODE_H__ #define __RETCODE_H__
@ -5,6 +6,7 @@
# error "FALSE shouldn't be defined" # error "FALSE shouldn't be defined"
# undef FALSE # undef FALSE
#endif #endif
#ifdef TRUE #ifdef TRUE
# error "TRUE shouldn't be defined" # error "TRUE shouldn't be defined"
# undef TRUE # undef TRUE
@ -18,3 +20,4 @@ typedef enum {
#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,11 +1,9 @@
/* 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 */ typedef char spat_t[ 128] ; /* search pattern type */
#define NPAT sizeof( spat_t) /* # of bytes, pattern */ #define NPAT sizeof( spat_t) /* # of bytes, pattern */
@ -29,12 +27,12 @@ extern spat_t rpat ; /* replacement pattern */
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
@ -48,8 +46,9 @@ struct terminal {
#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)
@ -83,3 +82,4 @@ extern char sres[] ; /* Current screen resolution. */
/* NORMAL, CGA, EGA, VGA */ /* NORMAL, CGA, EGA, VGA */
#endif #endif
/* end of terminal.h */

View File

@ -1,3 +1,4 @@
/* termio.h -- */
#ifndef _TERMIO_H_ #ifndef _TERMIO_H_
#define _TERMIO_H_ #define _TERMIO_H_
@ -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 */

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 */