home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 1
/
GoldFishApril1994_CD1.img
/
d0xx
/
d084
/
ed
/
move.c
< prev
next >
Wrap
C/C++ Source or Header
|
1987-06-28
|
831b
|
48 lines
/*
* Copyright 1987 Brian Beattie Rights Reserved.
*
* Permission to copy and/or distribute granted under the
* following conditions:
*
* 1). No charge may be made other than resonable charges
* for reproduction.
*
* 2). This notice must remain intact.
*
* 3). No further restrictions may be added.
*
*/
#include <stdio.h>
#include "tools.h"
#include "ed.h"
move(num)
int num;
{
LINE *k0, *k1, *k2, *k3;
if(line1 <= 0 || line1 <= num && num <= line2)
return( ERR );
k0 = getptr(prevln(line1));
k1 = getptr(line1);
k2 = getptr(line2);
k3 = getptr(nextln(line2));
relink(k0, k3, k0, k3);
if(num > line1)
{
curln = num;
num += line2-line1+1;
} else
curln = num + (line2 - line1 + 1);
k0 = getptr(num);
k3 = getptr(nextln(num));
relink(k0, k1, k2, k3);
relink(k2, k3, k0, k1);
return( 1 );
}