diff --git a/ansi.c b/ansi.c index 80589c6..8e70757 100644 --- a/ansi.c +++ b/ansi.c @@ -56,7 +56,7 @@ int cbcolor = -1; /* current background color */ * Standard terminal interface dispatch table. Most of the fields point into * "termio" code. */ -TERM term = { +struct terminal term = { #if PKCODE MROW - 1, #else diff --git a/edef.h b/edef.h index ddabd50..00fba15 100644 --- a/edef.h +++ b/edef.h @@ -1,4 +1,4 @@ -/* EDEF.H +/* edef.h * * Global variable definitions * @@ -7,17 +7,19 @@ * greatly modified by Daniel Lawrence * modified by Petri Kutvonen */ +#ifndef EDEF_H_ +#define EDEF_H_ -/* some global fuction declarations */ #include #include +/* Some global fuction declarations. */ typedef int (*fn_t)(int, int); struct video; -/* initialized global external declarations */ +/* Initialized global external declarations. */ extern int fillcol; /* Fill column */ extern short kbdm[]; /* Holds kayboard macro data */ @@ -33,7 +35,7 @@ extern char *modename[]; /* text names of modes */ extern char *mode2name[]; /* text names of modes */ extern char modecode[]; /* letters to represent modes */ extern struct key_tab keytab[]; /* key bind to functions table */ -extern struct name_bind names[]; /* name to function table */ +extern struct name_bind names[];/* name to function table */ extern int gmode; /* global editor mode */ extern int gflags; /* global control flag */ extern int gfcolor; /* global forgrnd color (white) */ @@ -96,7 +98,7 @@ extern int justflag; /* justify, don't fill */ extern int overlap; /* line overlap in forw/back page */ extern int scrollcount; /* number of lines to scroll */ -/* uninitialized global external declarations */ +/* Uninitialized global external declarations. */ extern int currow; /* Cursor row */ extern int curcol; /* Cursor column */ @@ -105,17 +107,18 @@ extern int lastflag; /* Flags, last command */ extern int curgoal; /* Goal for C-P, C-N */ extern window_t *curwp; /* Current window */ extern struct buffer *curbp; /* Current buffer */ -extern window_t *wheadp; /* Head of list of windows */ +extern window_t *wheadp; /* Head of list of windows */ extern struct buffer *bheadp; /* Head of list of buffers */ extern struct buffer *blistp; /* Buffer for C-X C-B */ -extern struct buffer *bfind(char *bname, int cflag, int bflag); /* Lookup a buffer by name */ -extern window_t *wpopup(void); /* Pop up window creation */ -extern struct line *lalloc(int); /* Allocate a line */ -extern char sres[NBUFN]; /* current screen resolution */ -extern char pat[]; /* Search pattern */ -extern char tap[]; /* Reversed pattern array. */ -extern char rpat[]; /* replacement pattern */ +/* Lookup a buffer by name. */ +extern struct buffer *bfind(char *bname, int cflag, int bflag); +extern window_t *wpopup(void); /* Pop up window creation. */ +extern struct line *lalloc(int); /* Allocate a line. */ +extern char sres[NBUFN]; /* Current screen resolution. */ +extern char pat[]; /* Search pattern. */ +extern char tap[]; /* Reversed pattern array. */ +extern char rpat[]; /* Replacement pattern. */ extern unsigned int matchlen; extern unsigned int mlenold; @@ -126,17 +129,19 @@ extern int matchoff; #if MAGIC extern short int magical; extern short int rmagical; -extern MC mcpat[NPAT]; /* the magic pattern */ -extern MC tapcm[NPAT]; /* the reversed magic pattern */ -extern RMC rmcpat[NPAT]; /* the replacement magic array */ +extern MC mcpat[NPAT]; /* The magic pattern. */ +extern MC tapcm[NPAT]; /* The reversed magic patterni. */ +extern RMC rmcpat[NPAT]; /* The replacement magic array. */ #endif -extern char *dname[]; /* directive name table */ +extern char *dname[]; /* Directive name table. */ #if DEBUGM -/* vars needed for macro debugging output */ -extern char outline[]; /* global string to hold debug line text */ +/* Vars needed for macro debugging output. */ +extern char outline[]; /* Global string to hold debug line text. */ #endif -/* terminal table defined only in TERM.C */ -extern TERM term; /* Terminal information. */ +/* Terminal table defined only in term.c */ +extern struct terminal term; + +#endif /* EDEF_H_ */ diff --git a/estruct.h b/estruct.h index 616c4c6..f14d97a 100644 --- a/estruct.h +++ b/estruct.h @@ -546,7 +546,7 @@ struct line { * "termp->t_field" style in the future, to make it possible to run more than * one terminal type. */ -typedef struct { +struct terminal { short t_mrow; /* max number of rows allowable */ short t_nrow; /* current number of rows used */ short t_mcol; /* max Number of columns. */ @@ -574,7 +574,7 @@ typedef struct { #if SCROLLCODE void (*t_scroll)(int, int,int); /* scroll a region of the screen */ #endif -} TERM; +}; /* TEMPORARY macros for terminal I/O (to be placed in a machine dependant place later) */ diff --git a/ibmpc.c b/ibmpc.c index dc8ff1e..53b9149 100644 --- a/ibmpc.c +++ b/ibmpc.c @@ -99,7 +99,7 @@ int ctrans[] = /* ansi to ibm color translation table */ * Standard terminal interface dispatch table. Most of the fields point into * "termio" code. */ -TERM term = { +struct terminal term = { NROW - 1, NROW - 1, NCOL, diff --git a/tcap.c b/tcap.c index ca87368..68e8b1a 100644 --- a/tcap.c +++ b/tcap.c @@ -75,8 +75,8 @@ static int term_init_ok = 0; static char *CS, *DL, *AL, *SF, *SR; #endif -TERM term = { - 0, /* these four values are set dynamically at open time */ +struct terminal term = { + 0, /* These four values are set dynamically at open time. */ 0, 0, 0, diff --git a/vmsvt.c b/vmsvt.c index e84add7..9593f9d 100644 --- a/vmsvt.c +++ b/vmsvt.c @@ -46,7 +46,7 @@ static int termtype; #if SCROLLCODE -#define SMG$K_SCROLL_FORWARD 561 /* from sys$library:smgtrmptr.h */ +#define SMG$K_SCROLL_FORWARD 561 /* from sys$library:smgtrmptr.h */ #define SMG$K_SCROLL_REVERSE 562 #define SMG$K_SET_SCROLL_REGION 572 @@ -55,7 +55,7 @@ static char *scroll_forward, *scroll_reverse; #endif /* Dispatch table. All hard fields just point into the terminal I/O code. */ -TERM term = { +struct terminal term = { #if PKCODE MAXROW, #else diff --git a/vt52.c b/vt52.c index 0d59d4c..594171f 100644 --- a/vt52.c +++ b/vt52.c @@ -1,4 +1,4 @@ -/* VT52.C +/* vt52.c * * The routines in this file * provide support for VT52 style terminals @@ -43,17 +43,16 @@ extern int vt52cres(); extern int vt52kopen(); extern int vt52kclose(); -#if COLOR +#if COLOR extern int vt52fcol(); extern int vt52bcol(); #endif /* - * Dispatch table. All the - * hard fields just point into the - * terminal I/O code. + * Dispatch table. + * All the hard fields just point into the terminal I/O code. */ -TERM term = { +struct terminal term = { NROW - 1, NROW - 1, NCOL,