/*<Header>==============================================================
*
*	FILE MANAGER / "EIN_FL03.C"
*
*		[ EIN(tm) project : ファイル操作補助関数群 ]
*
*	COPYRIGHT  Nam  1994, All rights reserved.
*
*-----------------------------------------------------------------------
*	V1.0L01α	94.07.07/Nam	プロトタイプ
*</Header>==============================================================*/
#include	<stdio.h>
#include 	<stdlib.h>
#include 	<string.h>
#include	<snd.h>
#include	<winb.h>
#include	<te.h>
#include	<fntb.h>
#include	<gui.h>

#define	EIN_FILE
#include	"..\eintm.h"

#ifndef NOERR
#define	NOERR	(0)
#endif
#ifndef ERROR
#define	ERROR	(1)
#endif

/* from EIN_ASM1.ASM */
extern void		EIN_setVector( unsigned long * );
extern void		EIN_resetVector( unsigned long * );

/*<Func>================================================================
*	int		EIN_getDiskFree( int drv )
*
*	【概  要】	指定ドライブの空き容量を返します。
*
*	【機  能】	通常の'FM_getDiskFreeSize()'と同様に使用できます。
*				int24hハンドラをフックしているので、ドライブにアクセス
*				できなかった場合でもシェルのアラートを出しません。
*
*	【入  力】
*				drv		:	容量を調べたいドライブ番号(英大文字)
*							[例] size = EIN_getDiskFree('A');
*								 size = EIN_getDiskFree( EIN_fnameDrv("E:\\"));
*
*	【出  力】
*
*	【関数値】	>=0			正常終了(byte数)
*				< 0			異常終了(ドライブにアクセス不可)
*
*	【注  意】	
*
*	【参  照】	
*
*-----------------------------------------------------------------------
*	V11L10	1994.07.07/Nam
*</Func>==============================================================*/
int		EIN_getDiskFree( int drv )
{
	unsigned long	vect[3];	/* int24hハンドラの退避用 */
	register int		ret;

	EIN_setVector( vect );		/* int24をフック */
	ret = FM_GetDiskFreeSize( drv );
	EIN_resetVector( vect );	/* int24ハンドラを復帰 */

	return ret;
}

