home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 2001 January
/
VPR0101A.BIN
/
OLS
/
TAR32053
/
tar32053.exe
/
SRC
/
TAR32.C
< prev
next >
Wrap
C/C++ Source or Header
|
1999-05-23
|
21KB
|
848 lines
/* tar32.cpp */
/* -> tar32.c */
#ifdef __cplusplus
extern "C"{
#endif
#include "defconf.h"
#ifdef DLL
#include <wtypes.h>
#include <time.h>
#include "tar32.h"
#include <mbstring.h>
#include "version.h"
#include "ioctrl.h"
#include "defs.h"
#include "main.h"
#include <stdio.h>
#include "tar.h"
#include <stdlib.h>
#include "misc.h"
#include "archio.h"
#include <sys/stat.h>
#include "tardir.h"
#include <fcntl.h> /* _O_BINARY */
#include <winuser.h>
#include "nkf.h"
/* #include "tarwin.h" */
#include "tarmsg.h"
#include "dlgconf.h"
#include "dllmain.h"
#include "gzip.h"
#undef head
/*#include "gzip.h"*/
/* Compression methods (see algorithm.doc) */
#define STORED 0
#define COMPRESSED 1
#define PACKED 2
#define LZHED 3
#define BZIP2ED 4 /* added by tsuneo (1998/04/02) */
/* methods 4 to 7 reserved */
#define DEFLATED 8
#define MAX_METHODS 9
#define NO_COMP 100
extern int method; /* compression method */
static INDIVIDUALINFO Minfo; /* init at FindFirst */
static HEADER Mhead; /* Setted by Find Next. Use at GetWriteTime ,etc..*/
static char *Margv[10000]; /* Save _szWildName at FindFirst.use at FindNext */
static char *MargvStr=NULL; /* Save _szWildName at FindFirst.use at FindNext */
static int SumdwOriginalSize; /* init at OpenArchive */
static int SumdwCompressedSize; /* init at OpenArchive */
static char MArcFileName[1000]; /* init at OpenArchive */
static int MFirstSearch; /* flag of the first call of findfirst */
static int MFindEnd; /* end mark of tarfindfirst/tarfindnext */
static int MFindCount; /* counter of findfirst/next */
static ARCH_FILE *March_fp; /* handle of archive(gzip/bzip2/normal) */
#if 0
typedef struct TAR32_FIND_HANDLE_{
INDIVIDUALINFO info; /* init at FindFirst */
HEADER head; /* Setted by Find Next. Use at GetWriteTime ,etc..*/
char *argv[10000]; /* Save _szWildName at FindFirst.use at FindNext */
char *argvStr=NULL; /* Save _szWildName at FindFirst.use at FindNext */
int SumdwOriginalSize; /* init at OpenArchive */
int SumdwCompressedSize; /* init at OpenArchive */
char ArcFileName[1000]; /* init at OpenArchive */
int FirstSearch; /* flag of the first call of findfirst */
int FindEnd; /* end mark of tarfindfirst/tarfindnext */
int FindCount; /* counter of findfirst/next */
ARCH_FILE *arch_fp; /* handle of archive(gzip/bzip2/normal) */
}TAR32_FIND_HANDLE;
#endif
static BOOL flagInProcess = FALSE; /* use only PreAPI/PostAPI/GetRunning */
/* static BOOL flagBackGroundMode = FALSE;
static BOOL flagCursorMode = FALSE;
*/
static void PreAPI(void){flagInProcess=TRUE;}
static void PostAPI(void){flagInProcess=FALSE;}
static int GetRunning(void){return flagInProcess;}
HWND api_hwnd=0; /* ウインドウのハンドル*/
WORD WINAPI _export TarGetVersion(VOID)
{
WORD ver;
VS_FIXEDFILEINFO *verinfo;
HRSRC res;
HGLOBAL hres;
res = FindResource(application_instance,MAKEINTRESOURCE(VS_VERSION_INFO),RT_VERSION);
hres = LoadResource(application_instance,res);
verinfo = (VS_FIXEDFILEINFO *)((char *)LockResource(hres) + 40);
ver = (WORD)((verinfo->dwFileVersionMS >> 16) * 100 + (verinfo->dwFileVersionMS & 0xffff));
return ver;
}
BOOL WINAPI _export TarGetRunning(VOID)
{
return GetRunning();
}
BOOL WINAPI _export TarGetBackGroundMode(VOID)/* NO IMPLEMENT:return FALSE */
{
/* return flagBackGroundMode();*/
return FALSE;
}
BOOL WINAPI _export TarSetBackGroundMode(const BOOL _BackGroundMode)/* NO IMPLEMENT:return FALSE */
{
/*flagBackGroundMode = bBackGroundMode;
return TRUE;*/
return FALSE;
}
BOOL WINAPI _export TarGetCursorMode(VOID)/* NO IMPLEMENT:return FALSE */
{
return FALSE;
}
BOOL WINAPI _export TarSetCursorMode(const BOOL _CursorMode)/* NO IMPLEMENT:return FALSE */
{
return FALSE;
}
WORD WINAPI _export TarGetCursorInterval(VOID)/* NO IMPLEMENT:return 80 */
{
return 80;
}
BOOL WINAPI _export TarSetCursorInterval(const WORD _Interval)/* NO IMPLEMENT:return FALSE */
{
return FALSE;
}
int WINAPI _export Tar(const HWND _hwnd, LPCSTR _szCmdLine,
LPSTR _szOutput, const DWORD _dwSize)
{
int argc;
char *argv[10000];
int ret;
char *argvstr;
api_hwnd=_hwnd;
PreAPI();
argv[0]="tar";
argvstr=splitCmdLine(&argc,argv+1,_szCmdLine);
argc++;
ioctrl_output_init(_szOutput,_dwSize);
ret=tar_main(argc,argv);
free(argvstr);
PostAPI();
/*MessageBox(api_hwnd,"Tar()TarMsgEnd(pre)","tar32.dll debug",0);*/
TarMsgEnd();
/*MessageBox(api_hwnd,"Tar()TarMsgEnd(post)","tar32.dll debug",0);*/
return ret-1;
}
/* NO IMPLEMENT:return -1 */
int WINAPI _export TarExtractMem(const HWND _hwndParent,
LPCSTR _szCmdLine, LPBYTE _lpBuffer, const DWORD _dwSize,
time_t *_lpTime, LPWORD _lpwAttr, LPDWORD _lpdwWriteSize)
{
return -1;
}
/* NO IMPLEMENT:return -1 */
int WINAPI _export TarCompressMem(const HWND _hwndParent,
LPCSTR _szCmdLine, const LPBYTE _lpBuffer, const DWORD _dwSize,
const time_t *_lpTime, const LPWORD _lpwAttr,
LPDWORD _lpdwWriteSize)
{
return -1;
}
/* File Existans Check Only */
BOOL WINAPI _export TarCheckArchive(LPCSTR _szFileName, const int _iMode)
{
if((int)TarGetArchiveType(_szFileName)>0){
return TRUE;
}else{
return FALSE;
}
/*
FILE *fp;
if((fp=fopen(_szFileName,"r"))==NULL){
return FALSE;
}
fclose(fp);
return TRUE;
*/
}
int WINAPI _export TarGetArchiveType(LPCSTR _szFileName)
{
int return_value;
extern int gzip_flag; /* main.c */
int archive_method=-1;
int access_method=0;
int crccheck=0;
unsigned int sum;
HEADER *phead;
ARCH_FILE *arch_fp;
return_value=setjmp(start_env);
if(return_value!=0){
return -1;
}
ioctrl_output_init_test();
static_init_all();
// Archives[0]=_szFileName;
Archives[0]=NULL;
Archives[1]=NULL;
_fmode = O_BINARY;
if((arch_fp = open_arch((char*)_szFileName, "r"))==NULL){
return -1;
}
if(read_arch(arch_fp, TBLOCK, (char **)&phead) == TBLOCK){
sum=strtol(phead->dbuf.chksum,NULL,8);
if(sum == compsum(phead)){
crccheck=1;
}
}
access_method=get_access_method();
close_arch(arch_fp/*'t'*/);arch_fp=NULL;
switch(crccheck){
case 1:
switch(access_method){
case DEFLATED:
archive_method=ARCHIVETYPE_TARGZ;break;
case COMPRESSED:
archive_method=ARCHIVETYPE_TARZ;break;
case BZIP2ED:
archive_method=ARCHIVETYPE_TARBZ2;break;
case NO_COMP:
archive_method=ARCHIVETYPE_TAR;break;
default:
break;
}
break;
case 0:
switch(access_method){
case DEFLATED:
archive_method=ARCHIVETYPE_GZ;break;
case COMPRESSED:
archive_method=ARCHIVETYPE_Z;break;
case BZIP2ED:
archive_method=ARCHIVETYPE_BZ2;break;
default:
break;
}
}
return archive_method;
}
/* NO IMPLEMENT:return FALSE */
BOOL WINAPI _export TarConfigDialog(const HWND _hwnd, LPSTR _lpszComBuffer,
const int _iMode)
{
int ret;
PreAPI();
api_hwnd=_hwnd;
static_init_all();
ret=config_dialog(_hwnd,_lpszComBuffer,_iMode);
PostAPI();
return ret;
/*
int r;
char NkfVersion[100];
char message[1000];
strcpy(message,"TAR32.DLL version " DLL_VERSION_STR);
#ifdef USE_NKF_DLL
GetNkfVersion(NkfVersion);
if(strcmp(NkfVersion,"")==0){
strcat(message,"\n(NKF32.DLL not found)");
}else{
strcat(message,"\n(NKF32.DLL version ");
strcat(message,NkfVersion);
strcat(message,")");
}
#endif
r=MessageBox(_hwnd,message,"TAR32.DLLの設定",MB_OK);
return TRUE;
*/
}
int WINAPI _export TarGetFileCount(LPCSTR _szArcFile)
{
HARC harc;
int ret;
int count = 0;
harc = TarOpenArchive(NULL,_szArcFile,0);
if(harc==0){return 0;}
ret = TarFindFirst(harc,"",NULL);
while(ret==0){
count++;
ret = TarFindNext(harc,NULL);
}
TarCloseArchive(harc);
return count;
}
#if 0
void SetHARC(HARC *harc)
{
arch_SetAfd((int)(harc-(void *)NULL));
}
HARC GetHARC(void)
{
return (HARC)((void*)NULL+arch_GetAfd());
}
#endif
HARC WINAPI _export TarOpenArchive(const HWND _hwnd, LPCSTR _szFileName,
const DWORD _dwMode)
{
int return_value;
extern int gzip_flag; /* main.c */
// TAR32_FIND_HANDLE *find_handle;
api_hwnd=_hwnd;
return_value=setjmp(start_env);
if(return_value!=0){
return NULL;
}
ioctrl_output_init_test();
static_init_all();
strcpy(MArcFileName,_szFileName);
// Archives[0]=MArcFileName;
Archives[0]=NULL;
Archives[1]=NULL;
if(_dwMode & M_CHECK_ALL_PATH){
OPTION_check_all_path=1;
}else{
OPTION_check_all_path=0;
}
if(_dwMode & M_BAR_WINDOW_OFF){
OPTION_display_dialog=0;
}else{
OPTION_display_dialog=1;
}
_fmode = O_BINARY;
March_fp = open_arch(MArcFileName, "r");
SumdwOriginalSize=0;
SumdwCompressedSize=0;
#if 0
harc = GlobalAlloc(...);
find_handle = GlobalLock(harc);
//if((find_handle = malloc(sizeof(*find_handle)))==NULL){
// return NULL;
//}
memset(find_handle,0,sizeof(*find_handle));
find_handle->hwnd = _hwnd;
strcpy(find_handle->ArcFileName,_szFileName);
find_handle->arch_fp = March_fp;
find_handle->SumdwOriginalSize = 0;
find_handle->SumdwCompressSize = 0;
GlobalUnlock(harc(find_handle?));
return harc;
#endif
return /* GetHARC()*/ (HARC)1;
}
int WINAPI _export TarCloseArchive(HARC _harc)
{
int return_value;
/* HEADER *head;*/
return_value=setjmp(start_env);
if(return_value!=0){
return return_value;
}
/* SetARC(_harc);*/
if(MargvStr!=NULL){
free(MargvStr);
MargvStr=NULL;
}
close_arch(March_fp/*'t'*/);March_fp = NULL;
return 0;
}
WORD GetARCDate(time_t ti)
{
struct tm *tm;
tm=localtime(&ti);
return (((unsigned)tm->tm_year-(unsigned)80)<<9)+((tm->tm_mon+1)<<5)+(tm->tm_mday);
}
WORD GetARCTime(time_t ti)
{
struct tm *tm;
tm=localtime(&ti);
return ((tm->tm_hour)<<11)+((tm->tm_min)<<5)+((tm->tm_sec)/2);
}
/* headからinfoへ変換する。fnameはdecode_dir(_e)で得られた値。*/
/* 早い話がhead->dbuf.nameのこと。*/
void HeaderToIndividualInfo(INDIVIDUALINFO *info,HEADER *head,char *fname)
{
time_t ti;
unsigned short st_mode;
info->dwOriginalSize=strtol(head->dbuf.size,NULL,8);
info->dwCompressedSize=0;
info->dwCRC=head->dbuf.magic[0]*256+head->dbuf.magic[1];
info->uFlag=0;
info->uOSType=(UINT)-1;
if(info->dwOriginalSize==0){
info->wRatio=0;
}else{
info->wRatio=(WORD)(((float)info->dwCompressedSize/(float)info->dwOriginalSize)*1000);
}
ti=strtol(head->dbuf.mtime,NULL,8);
info->wDate=GetARCDate(ti);
info->wTime=GetARCTime(ti);
// strcpy(info->szFileName,fname/* head->dbuf.name*/);
strncpy2(info->szFileName,fname,sizeof(info->szFileName));
/* strcpy(info->szAttribute,"????") *//* strtol(block0->dbuf.mode,NULL,8)*/;
st_mode=(unsigned short)strtol(head->dbuf.mode,NULL,8);
info->szAttribute[0]='?'; /* Archive */
info->szAttribute[1]='?'; /* System */
info->szAttribute[2]=(st_mode & _S_IREAD) ? '-' : 'H'; /* Hide */
info->szAttribute[3]=(st_mode & _S_IWRITE) ? '-' : 'R'; /* Read Only*/
info->szAttribute[4]='\0';
switch(get_access_method()){
case NO_COMP:
strcpy(info->szMode,"-tar-");break;
case DEFLATED:
strcpy(info->szMode,"-tgz-");break;
case COMPRESSED:
strcpy(info->szMode,"-taz-");break;
case BZIP2ED:
strcpy(info->szMode,"tar.bz2");break;
default:
strcpy(info->szMode,"-???-");break;
}
}
int SetIndividualInfoForNotTar(INDIVIDUALINFO *info,int fd,char *arcfname,int method,int time_stamp,char *fname)
{
int ti;
extern int get_gunzip_fname(char *unpackfn,char *packfn); /* in archio.c */
struct stat stat;
memset(info,0,sizeof(*info));
if(*fname){
strcpy(info->szFileName,fname);
}else{
char *ptr;
get_gunzip_fname(info->szFileName,arcfname);
if((ptr=_mbsrchr(info->szFileName,'/')) || (ptr=_mbsrchr(info->szFileName,'\\'))){
memmove(info->szFileName,ptr+1,strlen(ptr+1)+1);
}
}
strcpy(info->szAttribute,"????");
if(method == COMPRESSED){
strcpy(info->szMode,"-z-");
}else if(method == DEFLATED){
strcpy(info->szMode,"-gz-");
}else if(method == BZIP2ED){
strcpy(info->szMode,"-bz2-");
}else{
strcpy(info->szMode,"-???-");
}
if(time_stamp){
ti = time_stamp;
}else{
ti = time(NULL);
}
info->wDate = GetARCDate(ti);
info->wTime = GetARCTime(ti);
if(fd!=0 && fd!=-1){
fstat(fd,&stat);
info->dwOriginalSize = stat.st_size;
}
return 0;
}
int WINAPI _export TarFindFirst(HARC _harc, LPCSTR _szWildName,
INDIVIDUALINFO *_lpSubInfo)
{
int r;
int argc;
MargvStr=splitCmdLine(&argc,Margv,_szWildName);
MFirstSearch = 1;
MFindEnd = 0;
MFindCount = 0;
r=TarFindNext(_harc,_lpSubInfo);
return r;
}
int WINAPI _export TarFindNext(HARC _harc, INDIVIDUALINFO *_lpSubInfo)
{
int return_value,api_return_value;
/* HEADER *head=Mhead;*/
/*int argc;*/
int longlink=0;
char longlink_name[FNAME_BUF];
HEADER *head;
int crccheck=0;
if(MFindEnd){return -1;}
/* どうもうまくダイアログが表示されない。
しかも時間がかかるのでやめようかな。 */
//tarwin_executing_dialog_display();
// MessageBox(api_hwnd,"TarFindNext","TAR32.DLL",0);
return_value=setjmp(start_env);
if(return_value!=0){
api_return_value=-1;
goto endfunc; /* 後処理へ... */
}
/* SetHARC(_harc);*/
/* get from function do_t() at main.c */
while(read_arch(March_fp, TBLOCK, (char **)&head) == TBLOCK) {
char type;
struct stat statbuf;
char name[FNAME_BUF];
/*HEADER *head=Mhead;*/
crccheck = ((unsigned)strtol(head->dbuf.chksum,NULL,8) == compsum(head));
if(crccheck == 0){break;}
if (eofblock(head->dummy))
break;
MFirstSearch = 0;
/* write(fileno(stderr),head,TBLOCK);*/
type = decode_dir(name, &statbuf, head);
if(type=='e'){
api_return_value=-1;
goto endfunc; /* 後処理へ... */
}
if (longlink){
strcpy(name,longlink_name);
longlink = 0;
}
if (type == VOLTYPE)
check_vol(name, &statbuf);
Current_file_name = name;
Current_file_mode = statbuf.st_mode;
Current_file_mtime = statbuf.st_mtime;
Current_file_size = Current_file_left = statbuf.st_size;
Mhead = *head;
switch (type) {
case LNKTYPE:
case SYMTYPE:
break;
case LONGLINK:
/* 100文字以上の長いファイル名の場合はそのデータ領域にファイル名が、
次のデータ領域にファイルの中味がある。
そのため、continueで次のファイルを読みに行く。*/
longlink = 1;
read_longlink_name(March_fp, statbuf.st_size,longlink_name);
continue;
default:
skip_file(March_fp);
break;
}
if(TarMsgFileBegin(head,Current_file_name,Current_file_name)==-1){
break;
}
Current_file_left = 0;
if(main_match(name, Margv)) {
/* added next 4 line for Get Dll info */
HeaderToIndividualInfo(&Minfo,&Mhead,name);
if(_lpSubInfo){*_lpSubInfo = Minfo;}
SumdwOriginalSize+=Minfo.dwOriginalSize;
SumdwCompressedSize+=Minfo.dwCompressedSize;
MFindCount ++;
api_return_value=0;goto endfunc;
}
}
MFindEnd =1;
/* for gzip only file */
if(MFirstSearch && MFindCount==0){
int access_method = get_access_method();
MFirstSearch = 0;
if(access_method == DEFLATED || access_method == BZIP2ED || access_method == COMPRESSED){
if(crccheck==0/*false(not tar)*/){
SetIndividualInfoForNotTar(&Minfo
,arch_GetAfd()
,MArcFileName
,access_method
,gzip_time_stamp
,gzip_filename);
if(_lpSubInfo){*_lpSubInfo = Minfo;}
memset(&Mhead,0,sizeof(Mhead));
MFindCount = 1;
api_return_value = 0;
goto endfunc;
}
}
}
api_return_value=-1;
endfunc:
TarMsgEnd();
return api_return_value;
}
int WINAPI _export TarGetArcFileName(HARC _harc, LPSTR _lpBuffer,
const int _nSize)
{
strncpy2(_lpBuffer,MArcFileName,_nSize);
return 0;
}
/* NO IMPLEMENT:return -1: */
DWORD WINAPI _export TarGetArcFileSize(HARC _harc)
{
struct stat buf;
int fh,result;
fh=arch_GetAfd();
result=fstat(fh,&buf);
if(result!=0){return (DWORD)-1;}
return buf.st_size;
}
DWORD WINAPI _export TarGetArcOriginalSize(HARC _harc)
{
return SumdwOriginalSize;
}
DWORD WINAPI _export TarGetArcCompressedSize(HARC _harc)
{
return SumdwCompressedSize;
}
WORD WINAPI _export TarGetArcRatio(HARC _harc)
{
if (SumdwOriginalSize==0){
return 0;
}else{
return (WORD)(((float)SumdwCompressedSize/(float)SumdwOriginalSize)*1000);
}
}
/* NO IMPLEMENT:return -1: */
WORD WINAPI _export TarGetArcDate(HARC _harc)
{
struct stat buf;
int fh,result;
fh=arch_GetAfd();
result=fstat(fh,&buf);
if(result!=0){return (WORD)-1;}
return GetARCDate(buf.st_mtime);
}
/* NO IMPLEMENT:return -1: */
WORD WINAPI _export TarGetArcTime(HARC _harc)
{
struct stat buf;
int fh,result;
fh=arch_GetAfd();
result=fstat(fh,&buf);
if(result!=0){return (WORD)-1;}
return GetARCTime(buf.st_mtime);
}
/* NO IMPLEMENT:return -1: */
UINT WINAPI _export TarGetArcOSType(HARC _harc)
{
return (WORD)-1;
}
int WINAPI _export TarGetFileName(HARC _harc, LPSTR _lpBuffer,
const int _nSize)
{
strncpy2(_lpBuffer,Minfo.szFileName,_nSize);
return 0;
}
int WINAPI _export TarGetMethod(HARC _harc, LPSTR _lpBuffer,
const int _nSize)
{
if(_nSize>=4){
strncpy(_lpBuffer,Minfo.szMode+1,3);
_lpBuffer[3]='\0';
return 0;
}else{
return -1;
}
}
DWORD WINAPI _export TarGetOriginalSize(HARC _harc)
{
return Minfo.dwOriginalSize;
}
DWORD WINAPI _export TarGetCompressedSize(HARC _harc)
{
return Minfo.dwCompressedSize;
}
WORD WINAPI _export TarGetRatio(HARC _harc)
{
return Minfo.wRatio;
}
WORD WINAPI _export TarGetDate(HARC _harc)
{
return Minfo.wDate;
}
WORD WINAPI _export TarGetTime(HARC _harc)
{
return Minfo.wTime;
}
DWORD WINAPI _export TarGetWriteTime(HARC _harc)
{
return strtol(Mhead.dbuf.mtime,NULL,8);
}
DWORD WINAPI _export TarGetAccessTime(HARC _harc)
{
return strtol(Mhead.dbuf.atime,NULL,8);
}
DWORD WINAPI _export TarGetCreateTime(HARC _harc)
{
return strtol(Mhead.dbuf.ctime,NULL,8);
}
DWORD WINAPI _export TarGetCRC(HARC _harc)
{
return Minfo.dwCRC;
}
int WINAPI _export TarGetAttribute(HARC _harc)
{
unsigned short st_mode;
st_mode=(unsigned short)strtol(Mhead.dbuf.mode,NULL,8);
return
(st_mode & _S_IWRITE)*FA_RDONLY /* Read Only */
+(st_mode & _S_IREAD)*FA_HIDDEN /* Hidden */
+(st_mode & 0)*FA_SYSTEM /* System File */
+(st_mode & 0)*FA_LABEL /* volume label */
+(st_mode & _S_IFDIR)*FA_DIREC /* Directory */
+(st_mode & 0)*FA_ARCH; /* Archive Attribute */
}
UINT WINAPI _export TarGetOSType(HARC _harc)
{
return Minfo.uOSType;
}
BOOL WINAPI _export TarQueryFunctionList(const int _iFunction)
{
int r;
switch( _iFunction){
case ISARC :r=TRUE;break;
case ISARC_GET_VERSION :r=TRUE;break;
case ISARC_GET_CURSOR_INTERVAL :r=FALSE;break;
case ISARC_SET_CURSOR_INTERVAL :r=FALSE;break;
case ISARC_GET_BACK_GROUND_MODE :r=FALSE;break;
case ISARC_SET_BACK_GROUND_MODE :r=FALSE;break;
case ISARC_GET_CURSOR_MODE :r=FALSE;break;
case ISARC_SET_CURSOR_MODE :r=FALSE;break;
case ISARC_GET_RUNNING :r=TRUE;break;
case ISARC_CHECK_ARCHIVE :r=TRUE;break;
case ISARC_CONFIG_DIALOG :r=TRUE;break;
case ISARC_GET_FILE_COUNT :r=TRUE;break;
case ISARC_QUERY_FUNCTION_LIST :r=TRUE;break;
case ISARC_HOUT :r=FALSE;break;
case ISARC_STRUCTOUT :r=TRUE;break;
case ISARC_GET_ARC_FILE_INFO :r=TRUE;break;
case ISARC_OPEN_ARCHIVE :r=TRUE;break;
case ISARC_CLOSE_ARCHIVE :r=TRUE;break;
case ISARC_FIND_FIRST :r=TRUE;break;
case ISARC_FIND_NEXT :r=TRUE;break;
case ISARC_EXTRACT :r=FALSE;break;
case ISARC_ADD :r=FALSE;break;
case ISARC_MOVE :r=FALSE;break;
case ISARC_DELETE :r=FALSE;break;
case ISARC_GET_ARC_FILE_NAME :r=TRUE;break;
case ISARC_GET_ARC_FILE_SIZE :r=TRUE;break;
case ISARC_GET_ARC_ORIGINAL_SIZE :r=TRUE;break;
case ISARC_GET_ARC_COMPRESSED_SIZE :r=FALSE;break;
case ISARC_GET_ARC_RATIO :r=FALSE;break;
case ISARC_GET_ARC_DATE :r=TRUE;break;
case ISARC_GET_ARC_TIME :r=TRUE;break;
case ISARC_GET_ARC_OS_TYPE :r=FALSE;break;
case ISARC_GET_ARC_IS_SFX_FILE :r=FALSE;break;
case ISARC_GET_FILE_NAME :r=TRUE;break;
case ISARC_GET_ORIGINAL_SIZE :r=TRUE;break;
case ISARC_GET_COMPRESSED_SIZE :r=FALSE;break;
case ISARC_GET_RATIO :r=FALSE;break;
case ISARC_GET_DATE :r=TRUE;break;
case ISARC_GET_TIME :r=TRUE;break;
case ISARC_GET_CRC :r=TRUE;break;
case ISARC_GET_ATTRIBUTE :r=TRUE;break;
case ISARC_GET_OS_TYPE :r=FALSE;break;
case ISARC_GET_METHOD :r=FALSE;break;
case ISARC_GET_WRITE_TIME :r=TRUE;break;
case ISARC_GET_CREATE_TIME :r=TRUE;break;
case ISARC_GET_ACCESS_TIME :r=TRUE;break;
default:
r=FALSE;
break;
}
return r;
}
BOOL WINAPI _export TarSetOwnerWindow(const HWND _hwnd)
{
OwnerWindow = _hwnd;
return TRUE;
}
BOOL WINAPI _export TarClearOwnerWindow(void)
{
OwnerWindow = NULL;
return TRUE;
}
BOOL WINAPI _export TarSetOwnerWindowEx(HWND _hwnd,ARCHIVERPROC *_lpArcProc)
{
OwnerWindow = _hwnd;
ArchiverProc = _lpArcProc;
return TRUE;
}
BOOL WINAPI _export TarKillOwnerWindowEx(HWND _hwnd)
{
OwnerWindow = NULL;
ArchiverProc = NULL;
return TRUE;
}
#endif /* DLL */
#ifdef __cplusplus
}
#endif