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 */
#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
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 */
#ifndef _BIND_H_
#define _BIND_H_
#include "names.h"
#include "names.h" /* BINDABLE() */
/* Bindable uEMACS functions */
BINDABLE( apro) ;
@ -19,5 +18,4 @@ int startup( const char *fname) ;
const char *transbind( char *skey) ; /* by string representation of key */
#endif
/* end of bind.h */

View File

@ -2,7 +2,7 @@
#ifndef _BINDABLE_H_
#define _BINDABLE_H_
#include "names.h"
#include "names.h" /* BINDABLE() */
/* functions that can be bound to keys or procedure names */
BBINDABLE( ctlxe) ;

View File

@ -1,9 +1,9 @@
/* buffer.h -- buffer type and functions */
#ifndef _BUFFER_H_
# define _BUFFER_H_
#define _BUFFER_H_
#include "line.h"
#include "names.h"
#include "line.h" /* line_p */
#include "names.h" /* BINDABLE() */
/* 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

View File

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

View File

@ -1,12 +1,12 @@
/* display.h -- display functionality */
#ifndef _DISPLAY_H_
# define _DISPLAY_H_
#define _DISPLAY_H_
# include <stdarg.h>
#include <stdarg.h>
# include "estruct.h"
# include "names.h" /* BINDABLE() */
# include "utf8.h" /* unicode_t */
#include "estruct.h"
#include "names.h" /* BINDABLE() */
#include "utf8.h" /* unicode_t */
extern int mpresf ; /* Stuff in message line */
extern int scrollcount ; /* number of lines to scroll */
@ -37,13 +37,14 @@ void echos( const char *s) ;
void rubout( void) ;
void getscreensize( int *widthp, int *heightp) ;
# if UNIX
#if UNIX
# include <signal.h>
# ifdef SIGWINCH
extern int chg_width, chg_height ;
extern int chg_width, chg_height ;
void sizesignal( int signr) ;
# endif
void sizesignal( int signr) ;
# endif
#endif
#endif
/* end of display.h */

View File

@ -1,5 +1,4 @@
/* estruct.h -- */
#ifndef _ESTRUCT_H_
#define _ESTRUCT_H_
@ -11,9 +10,8 @@
* modified by Petri Kutvonen
*/
#ifdef MSDOS
#undef MSDOS
# undef MSDOS
#endif
/* Machine/OS definitions. */
@ -22,30 +20,30 @@
/* Make an intelligent guess about the target system. */
#if defined(BSD) || defined(sun) || defined(ultrix) || defined(__osf__)
#ifndef BSD
#define BSD 1 /* Berkeley UNIX */
#endif
#else
#define BSD 0
#endif
# if defined(BSD) || defined(sun) || defined(ultrix) || defined(__osf__)
# ifndef BSD
# define BSD 1 /* Berkeley UNIX */
# endif
# else
# define BSD 0
# endif
#if defined(SVR4) || defined(__linux__) /* ex. SunOS 5.3 */
#define SVR4 1
#define SYSV 1
#undef BSD
#endif
# if defined(SVR4) || defined(__linux__) /* ex. SunOS 5.3 */
# define SVR4 1
# define SYSV 1
# undef BSD
# endif
#if defined(SYSV) || defined(u3b2) || defined(_AIX) || (defined(i386) && defined(unix)) || defined( __unix__)
#define USG 1 /* System V UNIX */
#else
#define USG 0
#endif
# if defined(SYSV) || defined(u3b2) || defined(_AIX) || (defined(i386) && defined(unix)) || defined( __unix__)
# define USG 1 /* System V UNIX */
# else
# define USG 0
# endif
#else
# define BSD 0 /* UNIX BSD 4.2 and ULTRIX */
# define USG 1 /* UNIX system V */
#endif /*autoconf */
#endif /*autoconf || BSD || SYSV */
#define MSDOS 0 /* MS-DOS */
@ -60,7 +58,7 @@
#define RAMSIZE 0 /* dynamic RAM memory usage tracking */
#if RAMSIZE
#define RAMSHOW 1 /* auto dynamic RAM reporting */
# define RAMSHOW 1 /* auto dynamic RAM reporting */
#endif
#ifndef AUTOCONF
@ -77,19 +75,15 @@
#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 */
# define COLOR 1 /* color commands and windows */
# define FILOCK 0 /* file locking under unix BSD 4.2 */
#else
#define COLOR MSDOS
#ifdef SVR4
#define FILOCK 1
#else
#define FILOCK BSD
#endif
# define COLOR MSDOS
# ifdef SVR4
# define FILOCK 1
# else
# define FILOCK BSD
# endif
#endif /* Autoconf. */
#define CLEAN 0 /* de-alloc memory on exit */
@ -106,9 +100,9 @@
/* Define some ability flags. */
#if IBMPC
#define MEMMAP 1
# define MEMMAP 1
#else
#define MEMMAP 0
# define MEMMAP 0
#endif
#if USG | BSD
@ -120,11 +114,11 @@
/* Dynamic RAM tracking and reporting redefinitions */
#if RAMSIZE
#include <stdlib.h>
void *allocate( size_t size) ;
void release( void *ptr) ;
#define malloc allocate
#define free release
# include <stdlib.h>
void *allocate( size_t size) ;
void release( void *ptr) ;
# define malloc allocate
# define free release
#endif
/* De-allocate memory always on exit (if the operating system or
@ -132,11 +126,10 @@ void release( void *ptr) ;
*/
#if CLEAN
#define exit(a) cexit(a)
# define exit(a) cexit(a)
void cexit( int status) ;
void cexit( int status) ;
#endif
#endif
/* end of estruct.h */

14
eval.h
View File

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

3
exec.h
View File

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

View File

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

6
file.h
View File

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

View File

@ -1,3 +1,4 @@
/* fileio.h -- file primitives */
#ifndef _FILEIO_H_
#define _FILEIO_H_
@ -33,3 +34,4 @@ fio_code ffropen( const char *fn) ;
fio_code ffwopen( const char *fn) ;
#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 hlpfname pathname[ 1]
@ -10,3 +13,5 @@ extern const char *pathname[] ;
boolean fexist( const char *fname) ;
char *flook( const char *fname, boolean hflag) ;
#endif
/* end of flook.h */

View File

@ -1,7 +1,8 @@
/* input.h -- */
#ifndef _INPUT_H_
#define _INPUT_H_
#include "names.h"
#include "names.h" /* nbind_p */
typedef enum {
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 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) ;
int tgetc( void) ;
@ -37,3 +38,4 @@ int getcmd( void) ;
int getstring( const char *prompt, char *buf, int nbuf, int eolchar) ;
#endif
/* end of input.h */

23
isa.h
View File

@ -1,32 +1,30 @@
/* isa.h -- isletter, islower, isupper, flipcase */
#ifndef __ISA_H__
#define __ISA_H__
#define NATIONL 0 /* if 1, interpret [,],\,{,},| as characters P.K. */
#ifdef islower
#undef islower
# undef islower
#endif
#ifdef isupper
#undef isupper
# undef isupper
#endif
#define NATIONL 0 /* if 1, interpret [,],\,{,},| as characters P.K. */
#if NATIONL
#define LASTUL ']'
#define LASTLL '}'
# define LASTUL ']'
# define LASTLL '}'
#else
#define LASTUL 'Z'
#define LASTLL 'z'
# define LASTUL 'Z'
# define LASTLL 'z'
#endif
#define isletter(c) __isxletter((0xFF & (c)))
#define islower(c) isxlower((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 isxupper(c) (('A' <= c && LASTUL >= c) || (192 <= c && 220 >= c))
@ -39,6 +37,5 @@
#define DIFCASE 0x20 /* ASCII 'a' - 'A' */
#define flipcase( c) ((c) ^ DIFCASE) /* Toggle the case of a letter. */
#endif /* __ISA_H__ */
#endif
/* end of isa.h */

View File

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

48
line.c
View File

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

27
line.h
View File

@ -1,19 +1,17 @@
/* line.h -- line centric interface */
#ifndef _LINE_H_
#define _LINE_H_
#include "names.h"
#include "utf8.h"
/*
* 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
* 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
* 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
* list of marks into the line.
/* 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
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
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
list of marks into the line.
*/
typedef struct line {
struct line *l_fp ; /* Forward link to the next line */
@ -34,10 +32,10 @@ extern int tabwidth ; /* Map to $tab, default to 8, can be set to [1, .. */
char *getkill( void) ;
/* Bindable functions */
boolean backchar( int f, int n) ;
boolean forwchar( int f, int n) ;
BINDABLE( insspace) ;
BINDABLE( yank) ;
BBINDABLE( backchar) ;
BBINDABLE( forwchar) ;
BINDABLE( insspace) ;
BINDABLE( yank) ;
void lfree( line_p lp) ;
void lchange( int flag) ;
@ -56,6 +54,5 @@ line_p lalloc( int minsize) ; /* Allocate a line of at least minsize chars. */
boolean rdonly( void) ; /* Read Only error message */
#endif /* _LINE_H_ */
#endif
/* end of line.h */

5
lock.h
View File

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

View File

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

View File

@ -1,6 +1,6 @@
/* names.h -- mapping of functions to names and keys */
#ifndef _NAMES_H_
# define _NAMES_H_
#define _NAMES_H_
#include "retcode.h"

View File

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

View File

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

View File

@ -1,5 +1,4 @@
/* random.h -- various commands */
#ifndef _RANDOM_H_
#define _RANDOM_H_
@ -21,28 +20,27 @@ int getccol( int bflg) ;
boolean setccol( int pos) ;
/* Bindable functions */
BINDABLE( setfillcol) ;
BINDABLE( showcpos) ;
boolean twiddle( int f, int n) ;
BINDABLE( quote) ;
BINDABLE( insert_tab) ;
BINDABLE( detab) ;
BINDABLE( entab) ;
BINDABLE( trim) ;
BINDABLE( openline) ;
BINDABLE( insert_newline) ;
BINDABLE( deblank) ;
BINDABLE( indent) ;
BINDABLE( forwdel) ;
BINDABLE( backdel) ;
BINDABLE( killtext) ;
BINDABLE( setemode) ;
BINDABLE( delmode) ;
BINDABLE( setgmode) ;
BINDABLE( delgmode) ;
BINDABLE( istring) ;
BINDABLE( ovstring) ;
BINDABLE( setfillcol) ;
BINDABLE( showcpos) ;
BBINDABLE( twiddle) ;
BINDABLE( quote) ;
BINDABLE( insert_tab) ;
BINDABLE( detab) ;
BINDABLE( entab) ;
BINDABLE( trim) ;
BINDABLE( openline) ;
BINDABLE( insert_newline) ;
BINDABLE( deblank) ;
BINDABLE( indent) ;
BINDABLE( forwdel) ;
BINDABLE( backdel) ;
BINDABLE( killtext) ;
BINDABLE( setemode) ;
BINDABLE( delmode) ;
BINDABLE( setgmode) ;
BINDABLE( delgmode) ;
BINDABLE( istring) ;
BINDABLE( ovstring) ;
#endif
/* end of random.h */

View File

@ -4,9 +4,8 @@
#include "line.h"
/*
* 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.
/* 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 {
line_p r_linep ; /* Origin struct line address. */
@ -25,5 +24,4 @@ BINDABLE( upperregion) ;
int getregion( region_p rp) ;
#endif
/* end of region.h */

View File

@ -1,13 +1,15 @@
/* retcode.h -- */
#ifndef __RETCODE_H__
#define __RETCODE_H__
#ifdef FALSE
#error "FALSE shouldn't be defined"
#undef FALSE
# error "FALSE shouldn't be defined"
# undef FALSE
#endif
#ifdef TRUE
#error "TRUE shouldn't be defined"
#undef TRUE
# error "TRUE shouldn't be defined"
# undef TRUE
#endif
typedef enum {
@ -18,3 +20,4 @@ typedef enum {
#define ABORT 2 /* 2, death, ^G, abort, etc. */
#endif
/* end of retcode.h */

View File

@ -1,11 +1,9 @@
/* search.h -- */
#ifndef _SEARCH_H_
#define _SEARCH_H_
#define MAGIC 1 /* include regular expression matching? */
#include "line.h"
#include "line.h" /* line_p */
#include "names.h" /* BINDABLE() */
typedef char spat_t[ 128] ; /* search pattern type */
#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) ;
/* Bindable functions */
BINDABLE( forwsearch) ;
BINDABLE( forwhunt) ;
BINDABLE( backsearch) ;
BINDABLE( backhunt) ;
BINDABLE( sreplace) ;
BINDABLE( backsearch) ;
BINDABLE( forwhunt) ;
BINDABLE( forwsearch) ;
BINDABLE( qreplace) ;
BINDABLE( sreplace) ;
int eq( unsigned char bc, unsigned char pc) ;
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) ;
#define MAGIC 1 /* include regular expression matching? */
#if MAGIC
void mcclear( void) ;
void rmcclear( void) ;
#endif
#endif
/* end of search.h */

View File

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

View File

@ -1,14 +1,12 @@
/* terminal.h -- */
#ifndef __TERMINAL_H__
#define __TERMINAL_H__
#include "defines.h" /* COLOR, SCROLLCODE */
#include "retcode.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
* 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
@ -48,8 +46,9 @@ struct terminal {
#endif
};
/* TEMPORARY macros for terminal I/O (to be placed in a machine
dependant place later) */
/* 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)
@ -83,3 +82,4 @@ extern char sres[] ; /* Current screen resolution. */
/* NORMAL, CGA, EGA, VGA */
#endif
/* end of terminal.h */

View File

@ -1,3 +1,4 @@
/* termio.h -- */
#ifndef _TERMIO_H_
#define _TERMIO_H_
@ -18,3 +19,4 @@ int ttgetc( void) ;
int typahead( void) ;
#endif
/* end of termio.h */

6
utf8.h
View File

@ -1,5 +1,6 @@
#ifndef UTF8_H
#define UTF8_H
/* utf8.h -- */
#ifndef _UTF8_H_
#define _UTF8_H_
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) ;
#endif
/* end of utf8.h */

7
util.h
View File

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

View File

@ -1,16 +1,18 @@
#ifndef VERSION_H_
#define VERSION_H_
/* version.h -- name and version strings */
#ifndef _VERSION_H_
#define _VERSION_H_
#ifdef PROGRAM
# define _QUOTE( s) #s
# define QUOTE( s) _QUOTE( s)
# define PROGRAM_NAME QUOTE(PROGRAM)
#else
# define PROGRAM_NAME "em"
# define PROGRAM_NAME "ue"
#endif
#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

@ -26,10 +26,10 @@ typedef struct window {
int w_ntrows ; /* # of rows of text in window */
char w_force ; /* If NZ, forcing row. */
char w_flag ; /* Flags. */
# if COLOR
#if COLOR
char w_fcolor ; /* current forground color */
char w_bcolor ; /* current background color */
# endif
#endif
} *window_p ;
extern window_p curwp ; /* Current window */
@ -45,10 +45,10 @@ extern window_p wheadp ; /* Head of list of windows */
#define WFMODE 0x10 /* Update mode line. */
#define WFCOLR 0x20 /* Needs a color change */
# if SCROLLCODE
#if SCROLLCODE
# define WFKILLS 0x40 /* something was deleted */
# define WFINS 0x80 /* something was inserted */
# endif
#endif
/* Bindable functions */
BINDABLE( delwind) ;

1
word.h
View File

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

View File

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