/*
	sub.h
*/


void	page_menu(), page_edit();

int getfsize(char *fname);
int resetfattr(char *fname);
bool fexist(char *fname);

char	*trans_fname_ext(char *fname, char *newext);
		// ファイル名 fname の拡張子を newext に置き換えたファイル名を返す
void add_fname_ext(char *buf, char *fname, char *newext);
		// ファイル名 fname に拡張子が無い場合、newext を拡張子として加える

int		cbuf_init();
void	cbuf_clear();
char	*cbuf_adrs(int x, int y);
int		cbuf_getlinesize();
int		cbuf_mix(int c0, int rate, int maxconc);
#define	cbuf2conc(a)	((a)+1)
#define	conc2cbuf(a)	((a)==0?0:(a)-1)

void 	scrollForCsr(int xlen,int ylen);
void	limitCsrPos();	// カーソルの座標の制限処理

#define	AREA_BOX		0
#define	AREA_POLYGON	1

int		area_init();
int		area_input(int type);
		// type  0=AREA_BOX  1=AREA_POLYGON
		// 返値: 0=承認  1=取消
bool	area_chkxy(int x, int y);	// (x,y) が領域指定されているかを調べる
bool	area_chkxy2(int x,int y);	// (x,y)-(x+1,y+1)が領域指定されているか
void	area_getboundxy(int *x1, int *y1, int *x2, int *y2);
int		area_chkxylen(int x,int xmax,int y,bool nega);
// (x,y) から右に何ドット連続して指定されているかを調べる(or 0)
// nega: 働きを逆にする(領域指定されていない点の連続数を求める)
void	area_drawbound();

void ARTsetintvector( void );
void ARTresetintvector( void );

int mathtbl_init(void);
deci atan512(deci theta);

void hline_func(int x1, int x2, int y, void func(int x1, int x2, int y)!);
