mirror of
https://github.com/rfivet/uemacs.git
synced 2024-12-18 07:16:23 -05:00
More ANSI'fication
Next up: enabling "-Wall" in the makefile. Not because it's ready, but because it gets easier to track where we are in the process..
This commit is contained in:
parent
de0961e007
commit
e3ca2a12cf
5
bind.c
5
bind.c
@ -12,8 +12,6 @@
|
||||
#include "edef.h"
|
||||
#include "epath.h"
|
||||
|
||||
extern int meta(), cex(), unarg(), ctrlg(); /* dummy prefix binding functions */
|
||||
|
||||
int help(int f, int n)
|
||||
{ /* give me some help!!!!
|
||||
bring up a fake buffer and read the help file
|
||||
@ -60,7 +58,6 @@ int deskey(int f, int n)
|
||||
register int c; /* key to describe */
|
||||
register char *ptr; /* string pointer to scan output strings */
|
||||
char outseq[NSTRING]; /* output buffer for command sequence */
|
||||
int (*getbind()) ();
|
||||
|
||||
/* prompt the user to type us a key to describe */
|
||||
mlwrite(": describe-key ");
|
||||
@ -94,7 +91,6 @@ int bindtokey(int f, int n)
|
||||
register KEYTAB *ktp; /* pointer into the command table */
|
||||
register int found; /* matched command flag */
|
||||
char outseq[80]; /* output buffer for keystroke sequence */
|
||||
int (*getname()) ();
|
||||
|
||||
/* prompt the user to type in a key to bind */
|
||||
mlwrite(": bind-to-key ");
|
||||
@ -710,7 +706,6 @@ char *transbind(char *skey)
|
||||
{
|
||||
char *bindname;
|
||||
unsigned int stock();
|
||||
int (*getbind()) ();
|
||||
|
||||
bindname = getfname(getbind(stock(skey)));
|
||||
if (bindname == NULL)
|
||||
|
96
buffer.c
96
buffer.c
@ -19,7 +19,7 @@
|
||||
* if the use count is 0. Otherwise, they come
|
||||
* from some other window.
|
||||
*/
|
||||
usebuffer(f, n)
|
||||
int usebuffer(int f, int n)
|
||||
{
|
||||
register BUFFER *bp;
|
||||
register int s;
|
||||
@ -32,9 +32,12 @@ usebuffer(f, n)
|
||||
return (swbuffer(bp));
|
||||
}
|
||||
|
||||
nextbuffer(f, n)
|
||||
/* switch to the next buffer in the buffer list */
|
||||
int f, n; /* default flag, numeric argument */
|
||||
/*
|
||||
* switch to the next buffer in the buffer list
|
||||
*
|
||||
* int f, n; default flag, numeric argument
|
||||
*/
|
||||
int nextbuffer(int f, int n)
|
||||
{
|
||||
register BUFFER *bp; /* eligable buffer to switch to */
|
||||
register BUFFER *bbp; /* eligable buffer to switch to */
|
||||
@ -69,10 +72,10 @@ int f, n; /* default flag, numeric argument */
|
||||
return (swbuffer(bp));
|
||||
}
|
||||
|
||||
swbuffer(bp)
|
||||
/* make buffer BP current */
|
||||
BUFFER *bp;
|
||||
|
||||
/*
|
||||
* make buffer BP current
|
||||
*/
|
||||
int swbuffer(BUFFER *bp)
|
||||
{
|
||||
register WINDOW *wp;
|
||||
|
||||
@ -125,7 +128,7 @@ BUFFER *bp;
|
||||
* if the buffer has been changed). Then free the header
|
||||
* line and the buffer header. Bound to "C-X K".
|
||||
*/
|
||||
killbuffer(f, n)
|
||||
int killbuffer(int f, int n)
|
||||
{
|
||||
register BUFFER *bp;
|
||||
register int s;
|
||||
@ -140,10 +143,10 @@ killbuffer(f, n)
|
||||
return (zotbuf(bp));
|
||||
}
|
||||
|
||||
zotbuf(bp)
|
||||
/* kill the buffer pointed to by bp */
|
||||
register BUFFER *bp;
|
||||
|
||||
/*
|
||||
* kill the buffer pointed to by bp
|
||||
*/
|
||||
int zotbuf(BUFFER *bp)
|
||||
{
|
||||
register BUFFER *bp1;
|
||||
register BUFFER *bp2;
|
||||
@ -171,10 +174,12 @@ register BUFFER *bp;
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
namebuffer(f, n)
|
||||
/* Rename the current buffer */
|
||||
int f, n; /* default Flag & Numeric arg */
|
||||
|
||||
/*
|
||||
* Rename the current buffer
|
||||
*
|
||||
* int f, n; default Flag & Numeric arg
|
||||
*/
|
||||
int namebuffer(int f, int n)
|
||||
{
|
||||
register BUFFER *bp; /* pointer to scan through all buffers */
|
||||
char bufn[NBUFN]; /* buffer to hold buffer name */
|
||||
@ -202,16 +207,16 @@ int f, n; /* default Flag & Numeric arg */
|
||||
}
|
||||
|
||||
/*
|
||||
List all of the active buffers. First update the special
|
||||
buffer that holds the list. Next make sure at least 1
|
||||
window is displaying the buffer list, splitting the screen
|
||||
if this is what it takes. Lastly, repaint all of the
|
||||
windows that are displaying the list. Bound to "C-X C-B".
|
||||
A numeric argument forces it to list invisable buffers as
|
||||
well.
|
||||
*/
|
||||
|
||||
listbuffers(f, n)
|
||||
* List all of the active buffers. First update the special
|
||||
* buffer that holds the list. Next make sure at least 1
|
||||
* window is displaying the buffer list, splitting the screen
|
||||
* if this is what it takes. Lastly, repaint all of the
|
||||
* windows that are displaying the list. Bound to "C-X C-B".
|
||||
*
|
||||
* A numeric argument forces it to list invisible buffers as
|
||||
* well.
|
||||
*/
|
||||
int listbuffers(int f, int n)
|
||||
{
|
||||
register WINDOW *wp;
|
||||
register BUFFER *bp;
|
||||
@ -254,13 +259,12 @@ listbuffers(f, n)
|
||||
* by the list buffers command. Return TRUE
|
||||
* if everything works. Return FALSE if there
|
||||
* is an error (if there is no memory). Iflag
|
||||
* indecates weather to list hidden buffers.
|
||||
* indicates wether to list hidden buffers.
|
||||
*
|
||||
* int iflag; list hidden buffer flag
|
||||
*/
|
||||
#define MAXLINE MAXCOL
|
||||
makelist(iflag)
|
||||
|
||||
int iflag; /* list hidden buffer flag */
|
||||
|
||||
int makelist(int iflag)
|
||||
{
|
||||
register char *cp1;
|
||||
register char *cp2;
|
||||
@ -368,12 +372,7 @@ int iflag; /* list hidden buffer flag */
|
||||
return (TRUE); /* All done */
|
||||
}
|
||||
|
||||
ltoa(buf, width, num)
|
||||
|
||||
char buf[];
|
||||
int width;
|
||||
long num;
|
||||
|
||||
void ltoa(char *buf, int width, long num)
|
||||
{
|
||||
buf[width] = 0; /* End of string. */
|
||||
while (num >= 10) { /* Conditional digits. */
|
||||
@ -392,8 +391,7 @@ long num;
|
||||
* on the end. Return TRUE if it worked and
|
||||
* FALSE if you ran out of room.
|
||||
*/
|
||||
addline(text)
|
||||
char *text;
|
||||
int addline(char *text)
|
||||
{
|
||||
register LINE *lp;
|
||||
register int i;
|
||||
@ -423,7 +421,7 @@ char *text;
|
||||
* Return FALSE if no buffers
|
||||
* have been changed.
|
||||
*/
|
||||
anycb()
|
||||
int anycb(void)
|
||||
{
|
||||
register BUFFER *bp;
|
||||
|
||||
@ -444,8 +442,7 @@ anycb()
|
||||
* and the "cflag" is TRUE, create it. The "bflag" is
|
||||
* the settings for the flags in in buffer.
|
||||
*/
|
||||
BUFFER *bfind(bname, cflag, bflag)
|
||||
register char *bname;
|
||||
BUFFER *bfind(char *bname, int cflag, int bflag)
|
||||
{
|
||||
register BUFFER *bp;
|
||||
register BUFFER *sb; /* buffer to insert after */
|
||||
@ -513,8 +510,7 @@ register char *bname;
|
||||
* that are required. Return TRUE if everything
|
||||
* looks good.
|
||||
*/
|
||||
bclear(bp)
|
||||
register BUFFER *bp;
|
||||
int bclear(BUFFER *bp)
|
||||
{
|
||||
register LINE *lp;
|
||||
register int s;
|
||||
@ -533,10 +529,12 @@ register BUFFER *bp;
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
unmark(f, n)
|
||||
/* unmark the current buffers change flag */
|
||||
int f, n; /* unused command arguments */
|
||||
|
||||
/*
|
||||
* unmark the current buffers change flag
|
||||
*
|
||||
* int f, n; unused command arguments
|
||||
*/
|
||||
int unmark(int f, int n)
|
||||
{
|
||||
curbp->b_flag &= ~BFCHG;
|
||||
curwp->w_flag |= WFMODE;
|
||||
|
21
edef.h
21
edef.h
@ -17,9 +17,6 @@ typedef int (*fn_t)(int, int);
|
||||
|
||||
struct VIDEO;
|
||||
|
||||
char *flook();
|
||||
char *getctext();
|
||||
char *getfname();
|
||||
char *getval();
|
||||
char *gtenv();
|
||||
char *gtfun();
|
||||
@ -29,9 +26,6 @@ char *ltos();
|
||||
char *mklower();
|
||||
char *mkupper();
|
||||
char *token();
|
||||
char *transbind();
|
||||
unsigned int getckey();
|
||||
unsigned int stock();
|
||||
|
||||
#ifdef maindef
|
||||
|
||||
@ -535,3 +529,18 @@ extern char *getfname(fn_t);
|
||||
extern fn_t fncmatch(char *);
|
||||
extern unsigned int stock(char *keyname);
|
||||
extern char *transbind(char *skey);
|
||||
|
||||
/* buffer.c */
|
||||
extern int usebuffer(int f, int n);
|
||||
extern int nextbuffer(int f, int n);
|
||||
extern int swbuffer(BUFFER *bp);
|
||||
extern int killbuffer(int f, int n);
|
||||
extern int zotbuf(BUFFER *bp);
|
||||
extern int namebuffer(int f, int n);
|
||||
extern int listbuffers(int f, int n);
|
||||
extern int makelist(int iflag);
|
||||
extern void ltoa(char *buf, int width, long num);
|
||||
extern int addline(char *text);
|
||||
extern int anycb(void);
|
||||
extern int bclear(BUFFER *bp);
|
||||
extern int unmark(int f, int n);
|
||||
|
Loading…
Reference in New Issue
Block a user