/*
 * CONSLIB : Consoleライブラリ：メインヘッダー
 * Copyright(C) 1997-1999 Eiichiro Ito, Yasuhiro Mizukoshi
 *
 * 1997/07/11:Eiichiro Ito
 *  (1) 作成開始
 * 修正履歴
 * 1998/02/15:Yasuhiro Mizukoshi
 *  (1) ESCシーケンス対応
 * 1998/02/19:Eiichiro Ito
 *  (1) 画面更新ロジック修正
 *
 */
#define		STRICT
#include	<windows.h>

#define		ClassName		TEXT("ConsApp")
#define		EXCEPTION_QUIT	(1)
#define		ATTR_NONE		0x00
#define		ATTR_INVERT		0x01

#ifdef __cplusplus
extern "C" {
#endif

BOOL	Kbhit( void ) ;
TCHAR	Getch( void ) ;
LPTSTR	Cgets( LPTSTR buf ) ;
int		CgetsVT( char *buf, int len ) ;
void	Putch( TCHAR c ) ;
void	Cputs( LPCTSTR buf ) ;
void	CputsVT( LPCTSTR buf ) ;
void	ResetTerminal( void ) ;
void	Cls( void ) ;
void	GetWH( LPDWORD w, LPDWORD h ) ;
void	GetCurPos( LPDWORD col, LPDWORD line ) ;
void	SetCurPos( DWORD col, DWORD line ) ;
void	SetCaret( void ) ;
void	ClearEol( void ) ;
void	ScrollUp( DWORD from, DWORD to ) ;
void	ScrollDown( DWORD from, DWORD to ) ;
DWORD	GetIndex( HWND hWnd ) ;
BOOL	SwitchClient( DWORD index ) ;
BOOL	SleepWithBreak( DWORD msec ) ;
void	ResetBreak( void ) ;
void	SendBreak( void ) ;
BOOL	ExecuteProcess( LPCTSTR cmd, LPTSTR arg ) ;
void	Exit( int code ) ;

void	cmdline2args( LPTSTR cmdline, LPDWORD argc, LPTSTR *argv, LPBOOL quote, LPTSTR args ) ;
void	chop_quote( LPTSTR dst ) ;
void	catdir( LPTSTR body, LPCTSTR adddir, LPTSTR pPrevDir ) ;
void	rel2absdir( LPTSTR dst, DWORD chDst, LPCTSTR src ) ;
BOOL	is_dir( LPCTSTR path ) ;
BOOL	is_file( LPCTSTR path ) ;
BOOL	UpDir( LPTSTR dir ) ;
BOOL	SetEnvVar( LPCTSTR name, LPCTSTR value ) ;
DWORD	GetEnvVar( LPCTSTR name, LPTSTR value, DWORD size ) ;
void	ExpandEnvVar( LPTSTR buf ) ;
void	ExpandVar( LPTSTR ptr, LPCTSTR var, LPCTSTR arg ) ;
void	PrintEnvVar( LPCTSTR name ) ;
void	ClearUndefEnvVar( LPTSTR src ) ;
BOOL	SetCurDir( LPCTSTR dir ) ;
DWORD	GetCurDir( DWORD size, LPTSTR buf ) ;
LPTSTR	_wcsistr( LPCTSTR org, LPCTSTR find ) ;
DWORD	GetConsoleVer( void ) ;
void	SetAttr( BYTE c ) ;

extern	HINSTANCE	hInst ;
extern	HWND		hMainWnd ;
extern	DWORD		Argc ;
extern	LPTSTR		Argv[] ;
extern	BOOL		Quote[] ;
extern	LPTSTR		CmdLine ;
extern	HWND		hServer ;

extern	TCHAR		AppName[] ;

int		Main( DWORD argc, LPTSTR argv[] ) ;

#ifdef __cplusplus
} ;
#endif
