mirror of
https://github.com/rfivet/uemacs.git
synced 2025-11-23 11:41:15 -05:00
First cut at turning things into proper modern ANSI C
Hey! Real declarations!
This commit is contained in:
71
basic.c
71
basic.c
@@ -18,7 +18,7 @@
|
||||
* beginning of the current line.
|
||||
* Trivial.
|
||||
*/
|
||||
gotobol(f, n)
|
||||
int gotobol(int f, int n)
|
||||
{
|
||||
curwp->w_doto = 0;
|
||||
return (TRUE);
|
||||
@@ -30,8 +30,7 @@ gotobol(f, n)
|
||||
* location. Error if you try and move out of the buffer. Set the flag if the
|
||||
* line pointer for dot changes.
|
||||
*/
|
||||
backchar(f, n)
|
||||
register int n;
|
||||
int backchar(int f, int n)
|
||||
{
|
||||
register LINE *lp;
|
||||
|
||||
@@ -53,7 +52,7 @@ register int n;
|
||||
/*
|
||||
* Move the cursor to the end of the current line. Trivial. No errors.
|
||||
*/
|
||||
gotoeol(f, n)
|
||||
int gotoeol(int f, int n)
|
||||
{
|
||||
curwp->w_doto = llength(curwp->w_dotp);
|
||||
return (TRUE);
|
||||
@@ -65,8 +64,7 @@ gotoeol(f, n)
|
||||
* 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.
|
||||
*/
|
||||
forwchar(f, n)
|
||||
register int n;
|
||||
int forwchar(int f, int n)
|
||||
{
|
||||
if (n < 0)
|
||||
return (backchar(f, -n));
|
||||
@@ -83,10 +81,14 @@ register int n;
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
gotoline(f, n)
|
||||
{ /* move to a particular line.
|
||||
argument (n) must be a positive integer for
|
||||
this to actually do anything */
|
||||
/*
|
||||
* move to a particular line.
|
||||
*
|
||||
* argument (n) must be a positive integer for
|
||||
* this to actually do anything
|
||||
*/
|
||||
int gotoline(int f, int n)
|
||||
{
|
||||
register int status; /* status return */
|
||||
char arg[NSTRING]; /* buffer to hold argument */
|
||||
|
||||
@@ -114,7 +116,7 @@ gotoline(f, n)
|
||||
* considered to be hard motion; it really isn't if the original value of dot
|
||||
* is the same as the new value of dot. Normally bound to "M-<".
|
||||
*/
|
||||
gotobob(f, n)
|
||||
int gotobob(int f, int n)
|
||||
{
|
||||
curwp->w_dotp = lforw(curbp->b_linep);
|
||||
curwp->w_doto = 0;
|
||||
@@ -127,7 +129,7 @@ gotobob(f, n)
|
||||
* (ZJ). The standard screen code does most of the hard parts of update.
|
||||
* Bound to "M->".
|
||||
*/
|
||||
gotoeob(f, n)
|
||||
int gotoeob(int f, int n)
|
||||
{
|
||||
curwp->w_dotp = curbp->b_linep;
|
||||
curwp->w_doto = 0;
|
||||
@@ -141,7 +143,7 @@ gotoeob(f, n)
|
||||
* controls how the goal column is set. Bound to "C-N". No errors are
|
||||
* possible.
|
||||
*/
|
||||
forwline(f, n)
|
||||
int forwline(int f, int n)
|
||||
{
|
||||
register LINE *dlp;
|
||||
|
||||
@@ -178,7 +180,7 @@ forwline(f, n)
|
||||
* alternate. Figure out the new line and call "movedot" to perform the
|
||||
* motion. No errors are possible. Bound to "C-P".
|
||||
*/
|
||||
backline(f, n)
|
||||
int backline(int f, int n)
|
||||
{
|
||||
register LINE *dlp;
|
||||
|
||||
@@ -211,12 +213,14 @@ backline(f, n)
|
||||
}
|
||||
|
||||
#if WORDPRO
|
||||
gotobop(f, n)
|
||||
/* go back to the beginning of the current paragraph
|
||||
here we look for a <NL><NL> or <NL><TAB> or <NL><SPACE>
|
||||
combination to delimit the beginning of a paragraph */
|
||||
int f, n; /* default Flag & Numeric argument */
|
||||
|
||||
/*
|
||||
* go back to the beginning of the current paragraph
|
||||
* here we look for a <NL><NL> or <NL><TAB> or <NL><SPACE>
|
||||
* combination to delimit the beginning of a paragraph
|
||||
*
|
||||
* int f, n; default Flag & Numeric argument
|
||||
*/
|
||||
int gotobop(int f, int n)
|
||||
{
|
||||
register int suc; /* success of last backchar */
|
||||
|
||||
@@ -256,12 +260,14 @@ int f, n; /* default Flag & Numeric argument */
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
gotoeop(f, n)
|
||||
/* go forword to the end of the current paragraph
|
||||
here we look for a <NL><NL> or <NL><TAB> or <NL><SPACE>
|
||||
combination to delimit the beginning of a paragraph */
|
||||
int f, n; /* default Flag & Numeric argument */
|
||||
|
||||
/*
|
||||
* go forword to the end of the current paragraph
|
||||
* here we look for a <NL><NL> or <NL><TAB> or <NL><SPACE>
|
||||
* combination to delimit the beginning of a paragraph
|
||||
*
|
||||
* int f, n; default Flag & Numeric argument
|
||||
*/
|
||||
int gotoeop(int f, int n)
|
||||
{
|
||||
register int suc; /* success of last backchar */
|
||||
|
||||
@@ -312,8 +318,7 @@ int f, n; /* default Flag & Numeric argument */
|
||||
* column, return the best choice for the offset. The offset is returned.
|
||||
* Used by "C-N" and "C-P".
|
||||
*/
|
||||
getgoal(dlp)
|
||||
register LINE *dlp;
|
||||
int getgoal(LINE *dlp)
|
||||
{
|
||||
register int c;
|
||||
register int col;
|
||||
@@ -344,8 +349,7 @@ register LINE *dlp;
|
||||
* the overlap; this value is the default overlap value in ITS EMACS. Because
|
||||
* this zaps the top line in the display window, we have to do a hard update.
|
||||
*/
|
||||
forwpage(f, n)
|
||||
register int n;
|
||||
int forwpage(int f, int n)
|
||||
{
|
||||
register LINE *lp;
|
||||
|
||||
@@ -387,8 +391,7 @@ register int n;
|
||||
* EMACS manual. Bound to "M-V". We do a hard update for exactly the same
|
||||
* reason.
|
||||
*/
|
||||
backpage(f, n)
|
||||
register int n;
|
||||
int backpage(int f, int n)
|
||||
{
|
||||
register LINE *lp;
|
||||
|
||||
@@ -428,7 +431,7 @@ register int n;
|
||||
* Set the mark in the current window to the value of "." in the window. No
|
||||
* errors are possible. Bound to "M-.".
|
||||
*/
|
||||
setmark(f, n)
|
||||
int setmark(int f, int n)
|
||||
{
|
||||
curwp->w_markp = curwp->w_dotp;
|
||||
curwp->w_marko = curwp->w_doto;
|
||||
@@ -442,7 +445,7 @@ setmark(f, n)
|
||||
* that moves the mark about. The only possible error is "no mark". Bound to
|
||||
* "C-X C-X".
|
||||
*/
|
||||
swapmark(f, n)
|
||||
int swapmark(int f, int n)
|
||||
{
|
||||
register LINE *odotp;
|
||||
register int odoto;
|
||||
|
||||
Reference in New Issue
Block a user