mirror of
https://github.com/rfivet/uemacs.git
synced 2024-12-18 15:26:23 -05:00
Extract struct buffer and struct window from estruct.h.
This commit is contained in:
parent
39e23cb169
commit
87cd40ce6a
2
basic.c
2
basic.c
@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include "buffer.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
#include "estruct.h"
|
#include "estruct.h"
|
||||||
#include "edef.h"
|
#include "edef.h"
|
||||||
@ -22,6 +23,7 @@
|
|||||||
#include "line.h"
|
#include "line.h"
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
#include "utf8.h"
|
#include "utf8.h"
|
||||||
|
#include "window.h"
|
||||||
#include "word.h"
|
#include "word.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
/* bindable.h -- implements bindable.c */
|
/* bindable.h -- implements bindable.c */
|
||||||
#include "bindable.h"
|
#include "bindable.h"
|
||||||
|
|
||||||
|
#include "defines.h"
|
||||||
#include "buffer.h"
|
#include "buffer.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
#include "edef.h"
|
#include "edef.h"
|
||||||
|
4
buffer.c
4
buffer.c
@ -14,12 +14,12 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include "defines.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
#include "estruct.h"
|
/* #include "estruct.h" */
|
||||||
#include "edef.h"
|
#include "edef.h"
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "line.h"
|
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
|
||||||
|
|
||||||
|
58
buffer.h
58
buffer.h
@ -1,7 +1,63 @@
|
|||||||
#ifndef _BUFFER_H_
|
#ifndef _BUFFER_H_
|
||||||
#define _BUFFER_H_
|
#define _BUFFER_H_
|
||||||
|
|
||||||
#include "estruct.h"
|
#include "crypt.h"
|
||||||
|
#include "line.h"
|
||||||
|
|
||||||
|
#define NFILEN 80 /* # of bytes, file name */
|
||||||
|
#define NBUFN 16 /* # of bytes, buffer name */
|
||||||
|
#define NPAT 128 /* # of bytes, pattern */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Text is kept in buffers. A buffer header, described below, exists for every
|
||||||
|
* buffer in the system. The buffers are kept in a big list, so that commands
|
||||||
|
* that search for a buffer by name can find the buffer header. There is a
|
||||||
|
* safe store for the dot and mark in the header, but this is only valid if
|
||||||
|
* the buffer is not being displayed (that is, if "b_nwnd" is 0). The text for
|
||||||
|
* the buffer is kept in a circularly linked list of lines, with a pointer to
|
||||||
|
* the header line in "b_linep".
|
||||||
|
* Buffers may be "Inactive" which means the files associated with them
|
||||||
|
* have not been read in yet. These get read in at "use buffer" time.
|
||||||
|
*/
|
||||||
|
struct buffer {
|
||||||
|
struct buffer *b_bufp; /* Link to next struct buffer */
|
||||||
|
struct line *b_dotp; /* Link to "." struct line structure */
|
||||||
|
struct line *b_markp; /* The same as the above two, */
|
||||||
|
struct line *b_linep; /* Link to the header struct line */
|
||||||
|
int b_doto; /* Offset of "." in above struct line */
|
||||||
|
int b_marko; /* but for the "mark" */
|
||||||
|
int b_mode; /* editor mode of this buffer */
|
||||||
|
char b_active; /* window activated flag */
|
||||||
|
char b_nwnd; /* Count of windows on buffer */
|
||||||
|
char b_flag; /* Flags */
|
||||||
|
char b_fname[NFILEN]; /* File name */
|
||||||
|
char b_bname[NBUFN]; /* Buffer name */
|
||||||
|
#if CRYPT
|
||||||
|
char b_key[NPAT]; /* current encrypted key */
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
#define BFINVS 0x01 /* Internal invisable buffer */
|
||||||
|
#define BFCHG 0x02 /* Changed since last write */
|
||||||
|
#define BFTRUNC 0x04 /* buffer was truncated when read */
|
||||||
|
|
||||||
|
/* mode flags */
|
||||||
|
#define NUMMODES 11 /* # of defined modes */
|
||||||
|
|
||||||
|
#define MDWRAP 0x0001 /* word wrap */
|
||||||
|
#define MDCMOD 0x0002 /* C indentation and fence match */
|
||||||
|
#define MDSPELL 0x0004 /* spell error parcing */
|
||||||
|
#define MDEXACT 0x0008 /* Exact matching for searches */
|
||||||
|
#define MDVIEW 0x0010 /* read-only buffer */
|
||||||
|
#define MDOVER 0x0020 /* overwrite mode */
|
||||||
|
#define MDMAGIC 0x0040 /* regular expresions in search */
|
||||||
|
#if CRYPT
|
||||||
|
#define MDCRYPT 0x0080 /* encrytion mode active */
|
||||||
|
#endif
|
||||||
|
#define MDASAVE 0x0100 /* auto-save mode */
|
||||||
|
#define MDUTF8 0x0200 /* utf8 mode */
|
||||||
|
#define MDDOS 0x0400 /* CRLF eol mode */
|
||||||
|
|
||||||
|
|
||||||
int usebuffer( int f, int n) ;
|
int usebuffer( int f, int n) ;
|
||||||
int nextbuffer( int f, int n) ;
|
int nextbuffer( int f, int n) ;
|
||||||
|
2
crypt.c
2
crypt.c
@ -1,7 +1,5 @@
|
|||||||
/* crypt.c -- implements crypt.h */
|
/* crypt.c -- implements crypt.h */
|
||||||
|
|
||||||
#include "defines.h"
|
|
||||||
|
|
||||||
#include "crypt.h"
|
#include "crypt.h"
|
||||||
|
|
||||||
/* CRYPT.C
|
/* CRYPT.C
|
||||||
|
6
crypt.h
6
crypt.h
@ -1,9 +1,9 @@
|
|||||||
#ifndef _CRYPT_H_
|
#ifndef _CRYPT_H_
|
||||||
#define _CRYPT_H_
|
#define _CRYPT_H_
|
||||||
|
|
||||||
#ifndef CRYPT
|
#define CRYPT 1 /* file encryption enabled? */
|
||||||
#error CRYPT should be defined
|
|
||||||
#elif CRYPT
|
#if CRYPT
|
||||||
void myencrypt( char *bptr, unsigned len) ;
|
void myencrypt( char *bptr, unsigned len) ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
|
/* Must define one of
|
||||||
|
VMS | V7 | USG | BSD | MSDOS
|
||||||
|
*/
|
||||||
#define USG 1
|
#define USG 1
|
||||||
|
|
||||||
#define CRYPT 1 /* file encryption enabled? */
|
|
||||||
|
|
||||||
#define NSTRING 128 /* # of bytes, string buffers */
|
#define NSTRING 128 /* # of bytes, string buffers */
|
||||||
|
|
||||||
#define PKCODE 1
|
#define PKCODE 1
|
||||||
|
#define SCROLLCODE 1 /* scrolling code P.K. */
|
||||||
#define ENVFUNC 1
|
#define ENVFUNC 1
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "buffer.h"
|
||||||
#include "estruct.h"
|
#include "estruct.h"
|
||||||
#include "edef.h"
|
#include "edef.h"
|
||||||
#include "line.h"
|
#include "line.h"
|
||||||
|
13
edef.h
13
edef.h
@ -10,6 +10,7 @@
|
|||||||
#ifndef EDEF_H_
|
#ifndef EDEF_H_
|
||||||
#define EDEF_H_
|
#define EDEF_H_
|
||||||
|
|
||||||
|
#include "buffer.h"
|
||||||
#include "estruct.h"
|
#include "estruct.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -67,7 +68,17 @@ extern int kused; /* # of bytes used in KB */
|
|||||||
extern struct window *swindow; /* saved window pointer */
|
extern struct window *swindow; /* saved window pointer */
|
||||||
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 kbdmode; /* current keyboard macro mode */
|
|
||||||
|
#if 0
|
||||||
|
#define STOP 0 /* keyboard macro not in use */
|
||||||
|
#define PLAY 1 /* playing */
|
||||||
|
#define RECORD 2 /* recording */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
STOP, PLAY, RECORD
|
||||||
|
} kbdstate ;
|
||||||
|
extern kbdstate kbdmode ; /* current keyboard macro mode */
|
||||||
extern int kbdrep; /* number of repetitions */
|
extern int kbdrep; /* number of repetitions */
|
||||||
extern int restflag; /* restricted use? */
|
extern int restflag; /* restricted use? */
|
||||||
extern int lastkey; /* last keystoke */
|
extern int lastkey; /* last keystoke */
|
||||||
|
94
estruct.h
94
estruct.h
@ -158,7 +158,9 @@
|
|||||||
#define ISRCH 1 /* Incremental searches like ITS EMACS */
|
#define ISRCH 1 /* Incremental searches like ITS EMACS */
|
||||||
#define WORDPRO 1 /* Advanced word processing features */
|
#define WORDPRO 1 /* Advanced word processing features */
|
||||||
#define APROP 1 /* Add code for Apropos command */
|
#define APROP 1 /* Add code for Apropos command */
|
||||||
|
#if 0
|
||||||
#define CRYPT 1 /* file encryption enabled? */
|
#define CRYPT 1 /* file encryption enabled? */
|
||||||
|
#endif
|
||||||
#define MAGIC 1 /* include regular expression matching? */
|
#define MAGIC 1 /* include regular expression matching? */
|
||||||
#define AEDIT 1 /* advanced editing options: en/detabbing */
|
#define AEDIT 1 /* advanced editing options: en/detabbing */
|
||||||
#define PROC 1 /* named procedures */
|
#define PROC 1 /* named procedures */
|
||||||
@ -251,9 +253,11 @@
|
|||||||
|
|
||||||
#include "retcode.h"
|
#include "retcode.h"
|
||||||
|
|
||||||
|
#if 0
|
||||||
#define STOP 0 /* keyboard macro not in use */
|
#define STOP 0 /* keyboard macro not in use */
|
||||||
#define PLAY 1 /* playing */
|
#define PLAY 1 /* playing */
|
||||||
#define RECORD 2 /* recording */
|
#define RECORD 2 /* recording */
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Directive definitions */
|
/* Directive definitions */
|
||||||
|
|
||||||
@ -384,96 +388,6 @@
|
|||||||
int cexit( int status) ;
|
int cexit( int status) ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
* There is a window structure allocated for every active display window. The
|
|
||||||
* windows are kept in a big list, in top to bottom screen order, with the
|
|
||||||
* listhead at "wheadp". Each window contains its own values of dot and mark.
|
|
||||||
* The flag field contains some bits that are set by commands to guide
|
|
||||||
* redisplay. Although this is a bit of a compromise in terms of decoupling,
|
|
||||||
* the full blown redisplay is just too expensive to run for every input
|
|
||||||
* character.
|
|
||||||
*/
|
|
||||||
struct window {
|
|
||||||
struct window *w_wndp; /* Next window */
|
|
||||||
struct buffer *w_bufp; /* Buffer displayed in window */
|
|
||||||
struct line *w_linep; /* Top line in the window */
|
|
||||||
struct line *w_dotp; /* Line containing "." */
|
|
||||||
struct line *w_markp; /* Line containing "mark" */
|
|
||||||
int w_doto; /* Byte offset for "." */
|
|
||||||
int w_marko; /* Byte offset for "mark" */
|
|
||||||
char w_toprow; /* Origin 0 top row of window */
|
|
||||||
char w_ntrows; /* # of rows of text in window */
|
|
||||||
char w_force; /* If NZ, forcing row. */
|
|
||||||
char w_flag; /* Flags. */
|
|
||||||
#if COLOR
|
|
||||||
char w_fcolor; /* current forground color */
|
|
||||||
char w_bcolor; /* current background color */
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
#define WFFORCE 0x01 /* Window needs forced reframe */
|
|
||||||
#define WFMOVE 0x02 /* Movement from line to line */
|
|
||||||
#define WFEDIT 0x04 /* Editing within a line */
|
|
||||||
#define WFHARD 0x08 /* Better to a full display */
|
|
||||||
#define WFMODE 0x10 /* Update mode line. */
|
|
||||||
#define WFCOLR 0x20 /* Needs a color change */
|
|
||||||
|
|
||||||
#if SCROLLCODE
|
|
||||||
#define WFKILLS 0x40 /* something was deleted */
|
|
||||||
#define WFINS 0x80 /* something was inserted */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Text is kept in buffers. A buffer header, described below, exists for every
|
|
||||||
* buffer in the system. The buffers are kept in a big list, so that commands
|
|
||||||
* that search for a buffer by name can find the buffer header. There is a
|
|
||||||
* safe store for the dot and mark in the header, but this is only valid if
|
|
||||||
* the buffer is not being displayed (that is, if "b_nwnd" is 0). The text for
|
|
||||||
* the buffer is kept in a circularly linked list of lines, with a pointer to
|
|
||||||
* the header line in "b_linep".
|
|
||||||
* Buffers may be "Inactive" which means the files associated with them
|
|
||||||
* have not been read in yet. These get read in at "use buffer" time.
|
|
||||||
*/
|
|
||||||
struct buffer {
|
|
||||||
struct buffer *b_bufp; /* Link to next struct buffer */
|
|
||||||
struct line *b_dotp; /* Link to "." struct line structure */
|
|
||||||
struct line *b_markp; /* The same as the above two, */
|
|
||||||
struct line *b_linep; /* Link to the header struct line */
|
|
||||||
int b_doto; /* Offset of "." in above struct line */
|
|
||||||
int b_marko; /* but for the "mark" */
|
|
||||||
int b_mode; /* editor mode of this buffer */
|
|
||||||
char b_active; /* window activated flag */
|
|
||||||
char b_nwnd; /* Count of windows on buffer */
|
|
||||||
char b_flag; /* Flags */
|
|
||||||
char b_fname[NFILEN]; /* File name */
|
|
||||||
char b_bname[NBUFN]; /* Buffer name */
|
|
||||||
#if CRYPT
|
|
||||||
char b_key[NPAT]; /* current encrypted key */
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
#define BFINVS 0x01 /* Internal invisable buffer */
|
|
||||||
#define BFCHG 0x02 /* Changed since last write */
|
|
||||||
#define BFTRUNC 0x04 /* buffer was truncated when read */
|
|
||||||
|
|
||||||
/* mode flags */
|
|
||||||
#define NUMMODES 11 /* # of defined modes */
|
|
||||||
|
|
||||||
#define MDWRAP 0x0001 /* word wrap */
|
|
||||||
#define MDCMOD 0x0002 /* C indentation and fence match */
|
|
||||||
#define MDSPELL 0x0004 /* spell error parcing */
|
|
||||||
#define MDEXACT 0x0008 /* Exact matching for searches */
|
|
||||||
#define MDVIEW 0x0010 /* read-only buffer */
|
|
||||||
#define MDOVER 0x0020 /* overwrite mode */
|
|
||||||
#define MDMAGIC 0x0040 /* regular expresions in search */
|
|
||||||
#if CRYPT
|
|
||||||
#define MDCRYPT 0x0080 /* encrytion mode active */
|
|
||||||
#endif
|
|
||||||
#define MDASAVE 0x0100 /* auto-save mode */
|
|
||||||
#define MDUTF8 0x0200 /* utf8 mode */
|
|
||||||
#define MDDOS 0x0400 /* CRLF eol mode */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 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.
|
||||||
|
1
exec.c
1
exec.c
@ -22,6 +22,7 @@
|
|||||||
#include "flook.h"
|
#include "flook.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "line.h"
|
#include "line.h"
|
||||||
|
#include "window.h"
|
||||||
|
|
||||||
/* directive name table:
|
/* directive name table:
|
||||||
This holds the names of all the directives.... */
|
This holds the names of all the directives.... */
|
||||||
|
1
exec.h
1
exec.h
@ -1,6 +1,7 @@
|
|||||||
#ifndef _EXEC_H_
|
#ifndef _EXEC_H_
|
||||||
#define _EXEC_H_
|
#define _EXEC_H_
|
||||||
|
|
||||||
|
#include "buffer.h"
|
||||||
#include "estruct.h"
|
#include "estruct.h"
|
||||||
|
|
||||||
int namedcmd( int f, int n) ;
|
int namedcmd( int f, int n) ;
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include "random.h"
|
#include "random.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
|
#include "window.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is the general command execution routine. It handles the fake binding
|
* This is the general command execution routine. It handles the fake binding
|
||||||
|
2
file.c
2
file.c
@ -1,6 +1,5 @@
|
|||||||
/* file.c -- implements file.h */
|
/* file.c -- implements file.h */
|
||||||
|
|
||||||
#include "estruct.h"
|
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
|
|
||||||
/* file.c
|
/* file.c
|
||||||
@ -17,6 +16,7 @@
|
|||||||
|
|
||||||
#include "buffer.h"
|
#include "buffer.h"
|
||||||
#include "crypt.h"
|
#include "crypt.h"
|
||||||
|
#include "defines.h"
|
||||||
#include "estruct.h"
|
#include "estruct.h"
|
||||||
#include "edef.h"
|
#include "edef.h"
|
||||||
#include "execute.h"
|
#include "execute.h"
|
||||||
|
7
file.h
7
file.h
@ -1,11 +1,12 @@
|
|||||||
#ifndef _FILE_H_
|
#ifndef _FILE_H_
|
||||||
#define _FILE_H_
|
#define _FILE_H_
|
||||||
|
|
||||||
|
#include "crypt.h"
|
||||||
#include "retcode.h"
|
#include "retcode.h"
|
||||||
|
|
||||||
#ifndef CRYPT
|
#if CRYPT
|
||||||
#error CRYPT should be defined.
|
#include "buffer.h"
|
||||||
#elif CRYPT
|
|
||||||
void cryptbufferkey( struct buffer *bp) ;
|
void cryptbufferkey( struct buffer *bp) ;
|
||||||
int set_encryption_key( int f, int n) ;
|
int set_encryption_key( int f, int n) ;
|
||||||
#endif
|
#endif
|
||||||
|
5
fileio.c
5
fileio.c
@ -1,6 +1,5 @@
|
|||||||
/* fileio.c -- implements fileio.h */
|
/* fileio.c -- implements fileio.h */
|
||||||
|
|
||||||
#include "defines.h"
|
|
||||||
#include "fileio.h"
|
#include "fileio.h"
|
||||||
|
|
||||||
/* FILEIO.C
|
/* FILEIO.C
|
||||||
@ -15,9 +14,9 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#if CRYPT
|
#include "defines.h"
|
||||||
#include "crypt.h"
|
|
||||||
|
|
||||||
|
#if CRYPT
|
||||||
boolean is_crypted ; /* currently encrypting? */
|
boolean is_crypted ; /* currently encrypting? */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
8
fileio.h
8
fileio.h
@ -1,7 +1,7 @@
|
|||||||
#ifndef _FILEIO_H_
|
#ifndef _FILEIO_H_
|
||||||
#define _FILEIO_H_
|
#define _FILEIO_H_
|
||||||
|
|
||||||
#include "retcode.h"
|
#include "crypt.h"
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
FIOSUC, /* File I/O, success. */
|
FIOSUC, /* File I/O, success. */
|
||||||
@ -18,9 +18,9 @@ typedef enum {
|
|||||||
#define FTYPE_MAC 4
|
#define FTYPE_MAC 4
|
||||||
/* FTYPE_MIXED [ 3, 5, 6, 7] */
|
/* FTYPE_MIXED [ 3, 5, 6, 7] */
|
||||||
|
|
||||||
#ifndef CRYPT
|
#if CRYPT
|
||||||
#error CRYPT should be defined.
|
#include "retcode.h"
|
||||||
#elif CRYPT
|
|
||||||
extern boolean is_crypted ; /* currently encrypting? */
|
extern boolean is_crypted ; /* currently encrypting? */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
#include "estruct.h"
|
#include "crypt.h"
|
||||||
|
#include "defines.h"
|
||||||
|
|
||||||
|
/* #include "estruct.h" */
|
||||||
#include "edef.h"
|
#include "edef.h"
|
||||||
|
|
||||||
/* initialized global definitions */
|
/* initialized global definitions */
|
||||||
@ -79,7 +82,7 @@ int kused = KBLOCK; /* # of bytes used in kill buffer */
|
|||||||
struct window *swindow = NULL; /* saved window pointer */
|
struct window *swindow = NULL; /* saved window pointer */
|
||||||
int *kbdptr; /* current position in keyboard buf */
|
int *kbdptr; /* current position in keyboard buf */
|
||||||
int *kbdend = &kbdm[0]; /* ptr to end of the keyboard */
|
int *kbdend = &kbdm[0]; /* ptr to end of the keyboard */
|
||||||
int kbdmode = STOP; /* current keyboard macro mode */
|
kbdstate kbdmode = STOP; /* current keyboard macro mode */
|
||||||
int kbdrep = 0; /* number of repetitions */
|
int kbdrep = 0; /* number of repetitions */
|
||||||
int restflag = FALSE; /* restricted use? */
|
int restflag = FALSE; /* restricted use? */
|
||||||
int lastkey = 0; /* last keystoke */
|
int lastkey = 0; /* last keystoke */
|
||||||
|
@ -27,13 +27,14 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "basic.h"
|
#include "basic.h"
|
||||||
|
#include "buffer.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
#include "estruct.h"
|
#include "estruct.h"
|
||||||
#include "edef.h"
|
#include "edef.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "line.h"
|
#include "line.h"
|
||||||
#include "search.h"
|
#include "search.h"
|
||||||
|
#include "window.h"
|
||||||
|
|
||||||
static int isearch( int f, int n) ;
|
static int isearch( int f, int n) ;
|
||||||
static int checknext( char chr, char *patrn, int dir) ;
|
static int checknext( char chr, char *patrn, int dir) ;
|
||||||
|
2
line.c
2
line.c
@ -18,8 +18,10 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include "buffer.h"
|
||||||
#include "edef.h"
|
#include "edef.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
#include "window.h"
|
||||||
|
|
||||||
#define BLOCK_SIZE 16 /* Line block chunk size. */
|
#define BLOCK_SIZE 16 /* Line block chunk size. */
|
||||||
|
|
||||||
|
3
log.c
3
log.c
@ -1,8 +1,5 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
#include "retcode.h"
|
|
||||||
|
|
||||||
|
|
||||||
static void logdump( const char *buf, ...) {
|
static void logdump( const char *buf, ...) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1
main.c
1
main.c
@ -74,6 +74,7 @@
|
|||||||
#include "search.h"
|
#include "search.h"
|
||||||
#include "termio.h"
|
#include "termio.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
#include "window.h"
|
||||||
|
|
||||||
/* For MSDOS, increase the default stack space. */
|
/* For MSDOS, increase the default stack space. */
|
||||||
#if MSDOS & TURBO
|
#if MSDOS & TURBO
|
||||||
|
2
random.c
2
random.c
@ -12,6 +12,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "basic.h"
|
#include "basic.h"
|
||||||
|
#include "buffer.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
#include "estruct.h"
|
#include "estruct.h"
|
||||||
#include "edef.h"
|
#include "edef.h"
|
||||||
@ -20,6 +21,7 @@
|
|||||||
#include "line.h"
|
#include "line.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "search.h"
|
#include "search.h"
|
||||||
|
#include "window.h"
|
||||||
|
|
||||||
int tabsize; /* Tab size (0: use real tabs) */
|
int tabsize; /* Tab size (0: use real tabs) */
|
||||||
|
|
||||||
|
2
region.c
2
region.c
@ -12,10 +12,12 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include "buffer.h"
|
||||||
#include "estruct.h"
|
#include "estruct.h"
|
||||||
#include "edef.h"
|
#include "edef.h"
|
||||||
#include "line.h"
|
#include "line.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
#include "window.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Kill the region. Ask "getregion"
|
* Kill the region. Ask "getregion"
|
||||||
|
2
search.c
2
search.c
@ -63,12 +63,14 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "basic.h"
|
#include "basic.h"
|
||||||
|
#include "buffer.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
#include "estruct.h"
|
#include "estruct.h"
|
||||||
#include "edef.h"
|
#include "edef.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "line.h"
|
#include "line.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
#include "window.h"
|
||||||
|
|
||||||
#if defined(MAGIC)
|
#if defined(MAGIC)
|
||||||
/*
|
/*
|
||||||
|
2
spawn.c
2
spawn.c
@ -11,6 +11,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "defines.h"
|
||||||
|
|
||||||
#include "buffer.h"
|
#include "buffer.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
#include "estruct.h"
|
#include "estruct.h"
|
||||||
|
3
window.c
3
window.c
@ -12,8 +12,9 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "basic.h"
|
#include "basic.h"
|
||||||
|
#include "buffer.h"
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
#include "estruct.h"
|
/* #include "estruct.h" */
|
||||||
#include "edef.h"
|
#include "edef.h"
|
||||||
#include "execute.h"
|
#include "execute.h"
|
||||||
#include "line.h"
|
#include "line.h"
|
||||||
|
42
window.h
42
window.h
@ -1,7 +1,47 @@
|
|||||||
#ifndef _WINDOW_H_
|
#ifndef _WINDOW_H_
|
||||||
#define _WINDOW_H_
|
#define _WINDOW_H_
|
||||||
|
|
||||||
#include "estruct.h"
|
#include "defines.h" /* COLOR, SCROLLCODE */
|
||||||
|
#include "buffer.h" /* buffer, line */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* There is a window structure allocated for every active display window. The
|
||||||
|
* windows are kept in a big list, in top to bottom screen order, with the
|
||||||
|
* listhead at "wheadp". Each window contains its own values of dot and mark.
|
||||||
|
* The flag field contains some bits that are set by commands to guide
|
||||||
|
* redisplay. Although this is a bit of a compromise in terms of decoupling,
|
||||||
|
* the full blown redisplay is just too expensive to run for every input
|
||||||
|
* character.
|
||||||
|
*/
|
||||||
|
struct window {
|
||||||
|
struct window *w_wndp; /* Next window */
|
||||||
|
struct buffer *w_bufp; /* Buffer displayed in window */
|
||||||
|
struct line *w_linep; /* Top line in the window */
|
||||||
|
struct line *w_dotp; /* Line containing "." */
|
||||||
|
struct line *w_markp; /* Line containing "mark" */
|
||||||
|
int w_doto; /* Byte offset for "." */
|
||||||
|
int w_marko; /* Byte offset for "mark" */
|
||||||
|
char w_toprow; /* Origin 0 top row of window */
|
||||||
|
char w_ntrows; /* # of rows of text in window */
|
||||||
|
char w_force; /* If NZ, forcing row. */
|
||||||
|
char w_flag; /* Flags. */
|
||||||
|
#if COLOR
|
||||||
|
char w_fcolor; /* current forground color */
|
||||||
|
char w_bcolor; /* current background color */
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
#define WFFORCE 0x01 /* Window needs forced reframe */
|
||||||
|
#define WFMOVE 0x02 /* Movement from line to line */
|
||||||
|
#define WFEDIT 0x04 /* Editing within a line */
|
||||||
|
#define WFHARD 0x08 /* Better to a full display */
|
||||||
|
#define WFMODE 0x10 /* Update mode line. */
|
||||||
|
#define WFCOLR 0x20 /* Needs a color change */
|
||||||
|
|
||||||
|
#if SCROLLCODE
|
||||||
|
#define WFKILLS 0x40 /* something was deleted */
|
||||||
|
#define WFINS 0x80 /* something was inserted */
|
||||||
|
#endif
|
||||||
|
|
||||||
int reposition( int f, int n);
|
int reposition( int f, int n);
|
||||||
int redraw( int f, int n) ;
|
int redraw( int f, int n) ;
|
||||||
|
2
word.c
2
word.c
@ -13,12 +13,14 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "basic.h"
|
#include "basic.h"
|
||||||
|
#include "buffer.h"
|
||||||
#include "estruct.h"
|
#include "estruct.h"
|
||||||
#include "edef.h"
|
#include "edef.h"
|
||||||
#include "line.h"
|
#include "line.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "random.h"
|
#include "random.h"
|
||||||
#include "region.h"
|
#include "region.h"
|
||||||
|
#include "window.h"
|
||||||
|
|
||||||
/* Word wrap on n-spaces. Back-over whatever precedes the point on the current
|
/* Word wrap on n-spaces. Back-over whatever precedes the point on the current
|
||||||
* line and stop on the first word-break or the beginning of the line. If we
|
* line and stop on the first word-break or the beginning of the line. If we
|
||||||
|
Loading…
Reference in New Issue
Block a user