/*	PF -- printer filter
*/
/*
*	global header
*
*	92.11.14.	Ogochan	V1.0 create & release
*/

#define	VERSION		"1.8"

#include	"code.h"

typedef	struct	PrinterControl_S	{
	char	*name;
	void	(*SelectCodeset)(word);
	void	(*NewPage)(Bool);
	void	(*Init)(void);
	void	(*NewLine)(void);
	void	(*PrintSBCS)(Char);
	void	(*PrintDBCS)(Char);
	void	(*SetPaper)(struct PrinterControl_S *);
	int		LinePitch
	,		PitchSBCS
	,		PitchDBCS
	,		PageLength
	,		PageWidth
	,		PageLines
	,		LineLength
	,		LineColumns
	,		TopMargineInLines
	,		LeftMargine
	,		TabWidth;
	Bool	fPrintPageHeader;
}	PrinterControl;

typedef	struct	tm		tTime;

typedef	struct	{
	char	*name;
	void	(*Help)(void);
	PrinterControl	*(*Select)(char *,
							   int,int,int,int,int,int,int,int,int,int,Bool);
}	PrinterClass;

/*	driver.c	*/
	extern	Bool	PrintChar(int);
	extern	void	UnGetChar(int);
	extern	int		GetChar(FILE *);
	extern	int		PrintString(char *);
/*	code.c		*/
	extern	void	AnalyzeESC(void);
	extern	int		IsMulti(int,int);
	extern	void	ToJis(char *,char *,int);
	extern	void	JisToSJIS(char *,char *);
	extern	void	JisToEUC(char *,char *);
/*	printer.c	*/
	extern	void	InitPrinter(PrinterControl *);
	extern	void	NewLine(PrinterControl *);
	extern	void	NewPage(PrinterControl *,Bool);

	extern	void	CheckLayout(PrinterControl *);
	extern	void	DoTab(PrinterControl *);
	extern	void	DoPrint(PrinterControl *,Char);
/*	prtdef.c	*/
	extern	PrinterControl	*SetPrinterType(char *,
											int,int,int,int,int,int,int,int,int,int,Bool);

	extern	void	NOP(void);
	extern	void	PrintSBCS_Direct(Char);
	extern	void	PrintDBCS_Direct(Char);

#ifdef	GLOBAL
#undef	GLOBAL
#endif
#ifdef	MAIN
#define	GLOBAL
#else
#define	GLOBAL	extern
#endif

GLOBAL	STREAM	*stInput;
GLOBAL	char	*fnInput;
GLOBAL	Bool	fNewLine;
GLOBAL	int		InputEncode;
GLOBAL	int		cPage
		,		cLine;

extern	PrinterClass	*Printers[];
