home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d1xx
/
d166
/
stevie.lha
/
Stevie
/
source
/
dec.c
< prev
next >
Wrap
C/C++ Source or Header
|
1988-11-22
|
765b
|
32 lines
/*
* STEVIE - Simply Try this Editor for VI Enthusiasts
*
* Code Contributions By : Tim Thompson twitch!tjt
* Tony Andrews onecom!wldrdg!tony
* G. R. (Fred) Walter watmath!watcgl!grwalter
*/
#include "stevie.h"
/*
* dec(p)
*
* Decrement the line pointer 'p' crossing line boundaries as necessary. Return
* 1 when crossing a line, -1 when at start of file, 0 otherwise.
*/
int
dec(lp)
LPTR *lp;
{
if (lp->index > 0) { /* still within line */
lp->index--;
return 0;
}
if (lp->linep->prev != NULL) { /* there is a prior line */
lp->linep = lp->linep->prev;
lp->index = strlen(lp->linep->s);
return 1;
}
return -1; /* at start of file */
}