/*     Bed a Binary EDitor for Linux and for Rxvt running under Linux.       */
/*     Copyright (C) 1998  Jaap Korthals Altes <jkaltes@hetnet.nl>      */
/*                                                                           */
/*     Bed is free software; you can redistribute it and/or modify           */
/*     it under the terms of the GNU General Public License as published by  */
/*     the Free Software Foundation; either version 2 of the License, or     */
/*     (at your option) any later version.                                   */
/*                                                                           */
/*     Bed is distributed in the hope that it will be useful,                */
/*     but WITHOUT ANY WARRANTY; without even the implied warranty of        */
/*     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         */
/*     GNU General Public License for more details.                          */
/*                                                                           */
/*     You should have received a copy of the GNU General Public License     */
/*     along with bed; if not, write to the Free Software                    */
/*     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.             */
/*                                                                           */
/* Sun Dec  6 18:34:27 1998                                                  */

#ifndef FAKED_H
#define FAKED_H
#undef prodefname
#undef prodef
#define prodefname(name,proc) int proc(void);
#define prodef(proc)	int proc(void);
#include "mainprocedures.h"
#undef prodefname
#undef prodef
int getselbuf(char **buf); 
int putselbuf(char *buf,int len);

/* Returns length of selection and puts start position in start. 
* start has to point to an OFFTYPE */
OFFTYPE Editor::getselregion(OFFTYPE *start); 

OFFTYPE Editor::getselect(void) ;
OFFTYPE Editor::setselect(OFFTYPE pos) ;
#define putselect( pos) setselect(pos) 


#define SEARCH_REGEX 4 //search regex
#define SEARCH_FORWARD 1 //search forward 
#define SEARCH_CASE 2 // search case sensitive
#define SEARCH_BOUNDARY 8 //search on boundary

int Editor::searchtype(int newtype) ;

	int searchregex(short yes);
	int searchforward(short yes);
	int searchcase(short yes) ;
	int searchonboundary(short yes) ;
	int searchedge(short yes) ;
	OFFTYPE dosearch(char *ant,int len);
	OFFTYPE dosearch(OFFTYPE pos,char *ant,int len);
	int topos(OFFTYPE pos) ;
	int toborderpos(OFFTYPE pos) ;

char *getbuf(void); 
int screensize(void);
BLOCKTYPE blocksize(void);

int geteditpos(void); 
OFFTYPE getfilepos(void); 
char *getfilename(char *buf);

void filesup(void) ;
int toscreen(void) ;
void erefresh(void);

OFFTYPE getmem(OFFTYPE pos,char *buf,OFFTYPE len);
OFFTYPE putmem(OFFTYPE pos,char *buf,OFFTYPE len);

int Editor::proceskeyonce(void) ;

int extendfile(int len) ;
int forcetruncate(void) ;
int filetruncate(OFFTYPE newlast) ;

int getmode(DataType type,int len,int order) ;
ScreenPart *activemode(void);

OFFTYPE filesize(void) ; 
int save(void) ; 
 int saveaser(const char *ant) ;
 int savesel(const char *ant) ;

int Editor::playmacrofile(const char *);
int Editor::playmacro(char *buf,int len);

int message(char *format ...) ;
int getkeyinput(char *format ...) ;
int inputget(char *answer,const char *format,...) ;

int installpart(ScreenPart *part) ;
int installpart(ScreenPart *sub,int separ);
int addfilter(Filter *fil);

static int (Editor::*Editor::dynproc[])(void) ;
static char *Editor::dynprocnames[];
static int Editor::dynprocnr;

int shouldreinit;
int modechanged(void) ;
int Editor::saveshownname(const char *ant) ;
int Editor::readshownname(const char *ant) ;
int Editor::proconname(char *str) ;
ScreenPart *Editor::replacepart(ScreenPart *part,int pos=-1) ;
#endif


