version 1.18, 2005/08/09 00:53:48 |
version 1.19, 2005/11/18 20:56:53 |
|
|
|
|
#include "def.h" |
#include "def.h" |
|
|
static int getregion(REGION *); |
static int getregion(struct region *); |
static int setsize(REGION *, RSIZE); |
static int setsize(struct region *, RSIZE); |
|
|
/* |
/* |
* Kill the region. Ask "getregion" to figure out the bounds of the region. |
* Kill the region. Ask "getregion" to figure out the bounds of the region. |
|
|
killregion(int f, int n) |
killregion(int f, int n) |
{ |
{ |
int s; |
int s; |
REGION region; |
struct region region; |
|
|
if ((s = getregion(®ion)) != TRUE) |
if ((s = getregion(®ion)) != TRUE) |
return (s); |
return (s); |
|
|
int |
int |
copyregion(int f, int n) |
copyregion(int f, int n) |
{ |
{ |
LINE *linep; |
struct line *linep; |
REGION region; |
struct region region; |
int loffs; |
int loffs; |
int s; |
int s; |
|
|
|
|
int |
int |
lowerregion(int f, int n) |
lowerregion(int f, int n) |
{ |
{ |
LINE *linep; |
struct line *linep; |
REGION region; |
struct region region; |
int loffs, c, s; |
int loffs, c, s; |
|
|
if (curbp->b_flag & BFREADONLY) { |
if (curbp->b_flag & BFREADONLY) { |
|
|
int |
int |
upperregion(int f, int n) |
upperregion(int f, int n) |
{ |
{ |
LINE *linep; |
struct line *linep; |
REGION region; |
struct region region; |
int loffs, c, s; |
int loffs, c, s; |
|
|
if (curbp->b_flag & BFREADONLY) { |
if (curbp->b_flag & BFREADONLY) { |
|
|
* because I might add a "if regions is big, ask before clobbering" flag. |
* because I might add a "if regions is big, ask before clobbering" flag. |
*/ |
*/ |
static int |
static int |
getregion(REGION *rp) |
getregion(struct region *rp) |
{ |
{ |
LINE *flp, *blp; |
struct line *flp, *blp; |
long fsize, bsize; |
long fsize, bsize; |
|
|
if (curwp->w_markp == NULL) { |
if (curwp->w_markp == NULL) { |
|
|
* Set size, and check for overflow. |
* Set size, and check for overflow. |
*/ |
*/ |
static int |
static int |
setsize(REGION *rp, RSIZE size) |
setsize(struct region *rp, RSIZE size) |
{ |
{ |
rp->r_size = size; |
rp->r_size = size; |
if (rp->r_size != size) { |
if (rp->r_size != size) { |
|
|
int |
int |
prefixregion(int f, int n) |
prefixregion(int f, int n) |
{ |
{ |
LINE *first, *last; |
struct line *first, *last; |
REGION region; |
struct region region; |
char *prefix = prefix_string; |
char *prefix = prefix_string; |
int nline; |
int nline; |
int s; |
int s; |
|
|
#endif /* PREFIXREGION */ |
#endif /* PREFIXREGION */ |
|
|
int |
int |
region_get_data(REGION *reg, char *buf, int len) |
region_get_data(struct region *reg, char *buf, int len) |
{ |
{ |
int i, off; |
int i, off; |
LINE *lp; |
struct line *lp; |
|
|
off = reg->r_offset; |
off = reg->r_offset; |
lp = reg->r_linep; |
lp = reg->r_linep; |