| 1 |
/* |
/* |
| 2 |
* Copyright (C) 1994-1998 T. Teranishi |
* (C) 2020 TeraTerm Project |
|
* (C) 2005-2020 TeraTerm Project |
|
| 3 |
* All rights reserved. |
* All rights reserved. |
| 4 |
* |
* |
| 5 |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
| 38 |
#include "tttypes.h" |
#include "tttypes.h" |
| 39 |
#include "ttftypes.h" |
#include "ttftypes.h" |
| 40 |
#include "ftdlg.h" |
#include "ftdlg.h" |
|
#include "protodlg.h" |
|
| 41 |
#include "ttwinman.h" |
#include "ttwinman.h" |
| 42 |
#include "commlib.h" |
#include "commlib.h" |
| 43 |
#include "ttcommon.h" |
#include "ttcommon.h" |
|
#include "ttdde.h" |
|
| 44 |
#include "ttlib.h" |
#include "ttlib.h" |
| 45 |
#include "dlglib.h" |
#include "dlglib.h" |
| 46 |
#include "vtterm.h" |
#include "vtterm.h" |
|
#include "win16api.h" |
|
| 47 |
#include "ftlib.h" |
#include "ftlib.h" |
| 48 |
#include "buffer.h" |
#include "buffer.h" |
| 49 |
#include "helpid.h" |
#include "helpid.h" |
| 52 |
#include "codeconv.h" |
#include "codeconv.h" |
| 53 |
|
|
| 54 |
#include "filesys_log_res.h" |
#include "filesys_log_res.h" |
|
|
|
| 55 |
#include "filesys.h" |
#include "filesys.h" |
| 56 |
|
|
| 57 |
#define FS_BRACKET_NONE 0 |
#if 0 |
| 58 |
#define FS_BRACKET_START 1 |
typedef struct { |
| 59 |
#define FS_BRACKET_END 2 |
HWND HMainWin; |
| 60 |
|
HWND HWin; |
| 61 |
|
WORD OpId; |
| 62 |
|
char DlgCaption[40]; |
| 63 |
|
|
| 64 |
static PFileVar LogVar = NULL; |
char FullName[MAX_PATH]; |
| 65 |
PFileVar SendVar = NULL; |
int DirLen; |
|
PFileVar FileVar = NULL; |
|
|
static PCHAR ProtoVar = NULL; |
|
|
static int ProtoId; |
|
| 66 |
|
|
| 67 |
BOOL FileLog = FALSE; |
int NumFname, FNCount; |
| 68 |
BOOL BinLog = FALSE; |
HANDLE FnStrMemHandle; |
| 69 |
static BOOL FileRetrySend, FileRetryEcho, FileCRSend, FileReadEOF, BinaryMode; |
PCHAR FnStrMem; |
| 70 |
static BYTE FileByte; |
int FnPtr; |
| 71 |
|
|
| 72 |
#define FILE_SEND_BUF_SIZE 8192 |
BOOL FileOpen; |
| 73 |
struct FileSendHandler { |
HANDLE FileHandle; |
| 74 |
CHAR buf[FILE_SEND_BUF_SIZE]; |
LONG FileSize, ByteCount; |
| 75 |
int pos; |
BOOL OverWrite; |
| 76 |
int end; |
|
| 77 |
}; |
BOOL LogFlag; |
| 78 |
static struct FileSendHandler FileSendHandler; |
HANDLE LogFile; |
| 79 |
static int FileDlgRefresh; |
WORD LogState; |
| 80 |
|
WORD LogCount; |
| 81 |
|
|
| 82 |
|
BOOL Success; |
| 83 |
|
BOOL NoMsg; |
| 84 |
|
|
| 85 |
|
char LogDefaultPath[MAX_PATH]; |
| 86 |
|
BOOL HideDialog; |
| 87 |
|
|
| 88 |
|
BYTE LogLineBuf[16]; |
| 89 |
|
int FlushLogLineBuf; |
| 90 |
|
|
| 91 |
|
int ProgStat; |
| 92 |
|
|
| 93 |
static int FileBracketMode = FS_BRACKET_NONE; |
DWORD StartTime; |
|
static int FileBracketPtr = 0; |
|
|
static char BracketStartStr[] = "\033[200~"; |
|
|
static char BracketEndStr[] = "\033[201~"; |
|
|
|
|
|
static BOOL FSend = FALSE; |
|
|
|
|
|
static HMODULE HTTFILE = NULL; |
|
|
static int TTFILECount = 0; |
|
|
|
|
|
PGetSetupFname GetSetupFname; |
|
|
static PGetTransFname GetTransFname; |
|
|
PGetMultiFname GetMultiFname; |
|
|
PGetGetFname GetGetFname; |
|
|
PSetFileVar SetFileVar; |
|
|
PGetXFname GetXFname; |
|
|
PProtoInit ProtoInit; |
|
|
static PProtoParse ProtoParse; |
|
|
PProtoTimeOutProc ProtoTimeOutProc; |
|
|
PProtoCancel ProtoCancel; |
|
|
PTTFILESetUILanguageFile TTFILESetUILanguageFile; |
|
|
PTTFILESetFileSendFilter TTFILESetFileSendFilter; |
|
|
|
|
|
#define IdGetSetupFname 1 |
|
|
#define IdGetTransFname 2 |
|
|
#define IdGetMultiFname 3 |
|
|
#define IdGetGetFname 4 |
|
|
#define IdSetFileVar 5 |
|
|
#define IdGetXFname 6 |
|
|
|
|
|
#define IdProtoInit 7 |
|
|
#define IdProtoParse 8 |
|
|
#define IdProtoTimeOutProc 9 |
|
|
#define IdProtoCancel 10 |
|
| 94 |
|
|
| 95 |
#define IdTTFILESetUILanguageFile 11 |
// log rotate |
| 96 |
#define IdTTFILESetFileSendFilter 12 |
int RotateMode; // enum rotate_mode RotateMode; |
| 97 |
|
LONG RotateSize; |
| 98 |
|
int RotateStep; |
| 99 |
|
|
| 100 |
|
HANDLE LogThread; |
| 101 |
|
DWORD LogThreadId; |
| 102 |
|
|
| 103 |
|
DWORD FileMtime; |
| 104 |
|
HANDLE LogThreadEvent; |
| 105 |
|
} TFileVar_; |
| 106 |
|
typedef TFileVar_ *PFileVar_; |
| 107 |
|
|
| 108 |
|
#define PFileVar PFileVar_ |
| 109 |
|
#define TFileVar TFileVar_ |
| 110 |
|
#endif |
| 111 |
|
|
| 112 |
|
static PFileVar LogVar = NULL; |
| 113 |
|
|
| 114 |
|
BOOL FileLog = FALSE; |
| 115 |
|
BOOL BinLog = FALSE; |
| 116 |
|
|
| 117 |
/* |
/* |
| 118 |
Line Head flag for timestamping |
Line Head flag for timestamping |
| 131 |
#define WM_DPC_LOGTHREAD_SEND (WM_APP + 1) |
#define WM_DPC_LOGTHREAD_SEND (WM_APP + 1) |
| 132 |
|
|
| 133 |
static void CloseFileSync(PFileVar ptr); |
static void CloseFileSync(PFileVar ptr); |
| 134 |
|
static void FileTransEnd_(WORD OpId); |
| 135 |
|
|
| 136 |
|
|
|
BOOL LoadTTFILE(void) |
|
|
{ |
|
|
BOOL Err; |
|
|
|
|
|
if (HTTFILE != NULL) |
|
|
{ |
|
|
TTFILECount++; |
|
|
return TRUE; |
|
|
} |
|
|
else |
|
|
TTFILECount = 0; |
|
|
|
|
|
HTTFILE = LoadHomeDLL("TTPFILE.DLL"); |
|
|
if (HTTFILE == NULL) |
|
|
return FALSE; |
|
|
|
|
|
Err = FALSE; |
|
|
|
|
|
GetSetupFname = (PGetSetupFname)GetProcAddress(HTTFILE, |
|
|
MAKEINTRESOURCE(IdGetSetupFname)); |
|
|
if (GetSetupFname==NULL) |
|
|
Err = TRUE; |
|
|
|
|
|
GetTransFname = (PGetTransFname)GetProcAddress(HTTFILE, |
|
|
MAKEINTRESOURCE(IdGetTransFname)); |
|
|
if (GetTransFname==NULL) |
|
|
Err = TRUE; |
|
|
|
|
|
GetMultiFname = (PGetMultiFname)GetProcAddress(HTTFILE, |
|
|
MAKEINTRESOURCE(IdGetMultiFname)); |
|
|
if (GetMultiFname==NULL) |
|
|
Err = TRUE; |
|
|
|
|
|
GetGetFname = (PGetGetFname)GetProcAddress(HTTFILE, |
|
|
MAKEINTRESOURCE(IdGetGetFname)); |
|
|
if (GetGetFname==NULL) |
|
|
Err = TRUE; |
|
|
|
|
|
SetFileVar = (PSetFileVar)GetProcAddress(HTTFILE, |
|
|
MAKEINTRESOURCE(IdSetFileVar)); |
|
|
if (SetFileVar==NULL) |
|
|
Err = TRUE; |
|
|
|
|
|
GetXFname = (PGetXFname)GetProcAddress(HTTFILE, |
|
|
MAKEINTRESOURCE(IdGetXFname)); |
|
|
if (GetXFname==NULL) |
|
|
Err = TRUE; |
|
|
|
|
|
ProtoInit = (PProtoInit)GetProcAddress(HTTFILE, |
|
|
MAKEINTRESOURCE(IdProtoInit)); |
|
|
if (ProtoInit==NULL) |
|
|
Err = TRUE; |
|
|
|
|
|
ProtoParse = (PProtoParse)GetProcAddress(HTTFILE, |
|
|
MAKEINTRESOURCE(IdProtoParse)); |
|
|
if (ProtoParse==NULL) |
|
|
Err = TRUE; |
|
|
|
|
|
ProtoTimeOutProc = (PProtoTimeOutProc)GetProcAddress(HTTFILE, |
|
|
MAKEINTRESOURCE(IdProtoTimeOutProc)); |
|
|
if (ProtoTimeOutProc==NULL) |
|
|
Err = TRUE; |
|
|
|
|
|
ProtoCancel = (PProtoCancel)GetProcAddress(HTTFILE, |
|
|
MAKEINTRESOURCE(IdProtoCancel)); |
|
|
if (ProtoCancel==NULL) |
|
|
Err = TRUE; |
|
|
|
|
|
TTFILESetUILanguageFile = (PTTFILESetUILanguageFile)GetProcAddress(HTTFILE, |
|
|
MAKEINTRESOURCE(IdTTFILESetUILanguageFile)); |
|
|
if (TTFILESetUILanguageFile==NULL) { |
|
|
Err = TRUE; |
|
|
} |
|
|
else { |
|
|
TTFILESetUILanguageFile(ts.UILanguageFile); |
|
|
} |
|
|
|
|
|
TTFILESetFileSendFilter = (PTTFILESetFileSendFilter)GetProcAddress(HTTFILE, |
|
|
MAKEINTRESOURCE(IdTTFILESetFileSendFilter)); |
|
|
if (TTFILESetFileSendFilter==NULL) { |
|
|
Err = TRUE; |
|
|
} |
|
|
else { |
|
|
TTFILESetFileSendFilter(ts.FileSendFilter); |
|
|
} |
|
|
|
|
|
if (Err) |
|
|
{ |
|
|
FreeLibrary(HTTFILE); |
|
|
HTTFILE = NULL; |
|
|
return FALSE; |
|
|
} |
|
|
else { |
|
|
TTFILECount = 1; |
|
|
return TRUE; |
|
|
} |
|
|
} |
|
|
|
|
|
BOOL FreeTTFILE(void) |
|
|
{ |
|
|
if (TTFILECount==0) |
|
|
return FALSE; |
|
|
TTFILECount--; |
|
|
if (TTFILECount>0) |
|
|
return TRUE; |
|
|
if (HTTFILE!=NULL) |
|
|
{ |
|
|
FreeLibrary(HTTFILE); |
|
|
HTTFILE = NULL; |
|
|
} |
|
|
return TRUE; |
|
|
} |
|
|
|
|
| 137 |
static PFileTransDlg FLogDlg = NULL; |
static PFileTransDlg FLogDlg = NULL; |
|
static PFileTransDlg SendDlg = NULL; |
|
|
static PProtoDlg PtDlg = NULL; |
|
| 138 |
|
|
| 139 |
static BOOL OpenFTDlg(PFileVar fv) |
static BOOL OpenFTDlg_(PFileVar fv) |
| 140 |
{ |
{ |
| 141 |
PFileTransDlg FTDlg; |
PFileTransDlg FTDlg; |
| 142 |
|
|
| 156 |
FTDlg->RefreshNum(); |
FTDlg->RefreshNum(); |
| 157 |
} |
} |
| 158 |
|
|
| 159 |
if (fv->OpId==OpLog) |
// if (fv->OpId==OpLog) |
| 160 |
FLogDlg = FTDlg; /* Log */ |
FLogDlg = FTDlg; /* Log */ |
| 161 |
|
#if 0 |
| 162 |
else |
else |
| 163 |
SendDlg = FTDlg; /* File send */ |
SendDlg = FTDlg; /* File send */ |
| 164 |
|
#endif |
| 165 |
|
|
| 166 |
fv->StartTime = GetTickCount(); |
fv->StartTime = GetTickCount(); |
| 167 |
|
|
| 170 |
|
|
| 171 |
static void ShowFTDlg(WORD OpId) |
static void ShowFTDlg(WORD OpId) |
| 172 |
{ |
{ |
| 173 |
if (OpId == OpLog) { |
// if (OpId == OpLog) |
| 174 |
|
{ |
| 175 |
if (FLogDlg != NULL) { |
if (FLogDlg != NULL) { |
| 176 |
FLogDlg->ShowWindow(SW_SHOWNORMAL); |
FLogDlg->ShowWindow(SW_SHOWNORMAL); |
| 177 |
SetForegroundWindow(FLogDlg->GetSafeHwnd()); |
SetForegroundWindow(FLogDlg->GetSafeHwnd()); |
| 178 |
} |
} |
| 179 |
} |
} |
| 180 |
|
#if 0 |
| 181 |
else { |
else { |
| 182 |
if (SendDlg != NULL) { |
if (SendDlg != NULL) { |
| 183 |
SendDlg->ShowWindow(SW_SHOWNORMAL); |
SendDlg->ShowWindow(SW_SHOWNORMAL); |
| 184 |
SetForegroundWindow(SendDlg->GetSafeHwnd()); |
SetForegroundWindow(SendDlg->GetSafeHwnd()); |
| 185 |
} |
} |
| 186 |
} |
} |
| 187 |
|
#endif |
| 188 |
} |
} |
| 189 |
|
|
| 190 |
BOOL NewFileVar(PFileVar *fv) |
static BOOL NewFileVar_(PFileVar *fv) |
| 191 |
{ |
{ |
| 192 |
if ((*fv)==NULL) |
if ((*fv)==NULL) |
| 193 |
{ |
{ |
| 212 |
return ((*fv)!=NULL); |
return ((*fv)!=NULL); |
| 213 |
} |
} |
| 214 |
|
|
| 215 |
void FreeFileVar(PFileVar *fv) |
static void FreeFileVar_(PFileVar *fv) |
| 216 |
{ |
{ |
| 217 |
if ((*fv)!=NULL) |
if ((*fv)!=NULL) |
| 218 |
{ |
{ |
| 752 |
FileLog = FALSE; |
FileLog = FALSE; |
| 753 |
if (! CreateBinBuf()) |
if (! CreateBinBuf()) |
| 754 |
{ |
{ |
| 755 |
FileTransEnd(OpLog); |
FileTransEnd_(OpLog); |
| 756 |
return FALSE; |
return FALSE; |
| 757 |
} |
} |
| 758 |
} |
} |
| 761 |
FileLog = TRUE; |
FileLog = TRUE; |
| 762 |
if (! CreateLogBuf()) |
if (! CreateLogBuf()) |
| 763 |
{ |
{ |
| 764 |
FileTransEnd(OpLog); |
FileTransEnd_(OpLog); |
| 765 |
return FALSE; |
return FALSE; |
| 766 |
} |
} |
| 767 |
} |
} |
| 809 |
MessageBox(NULL, msg, "Tera Term: File open error", MB_OK | MB_ICONERROR); |
MessageBox(NULL, msg, "Tera Term: File open error", MB_OK | MB_ICONERROR); |
| 810 |
} |
} |
| 811 |
|
|
| 812 |
FileTransEnd(OpLog); |
FileTransEnd_(OpLog); |
| 813 |
return FALSE; |
return FALSE; |
| 814 |
} |
} |
| 815 |
LogVar->ByteCount = 0; |
LogVar->ByteCount = 0; |
| 828 |
LogVar->ByteCount = size; |
LogVar->ByteCount = size; |
| 829 |
} |
} |
| 830 |
|
|
| 831 |
if (! OpenFTDlg(LogVar)) { |
if (! OpenFTDlg_(LogVar)) { |
| 832 |
FileTransEnd(OpLog); |
FileTransEnd_(OpLog); |
| 833 |
return FALSE; |
return FALSE; |
| 834 |
} |
} |
| 835 |
|
|
| 1253 |
cv.BCount = 0; |
cv.BCount = 0; |
| 1254 |
} |
} |
| 1255 |
|
|
| 1256 |
void FileSendStart(void) |
static void FileTransEnd_(WORD OpId) |
|
{ |
|
|
LONG Option = 0; |
|
|
|
|
|
if (! cv.Ready || FSend) return; |
|
|
if (cv.ProtoFlag) |
|
|
{ |
|
|
FreeFileVar(&SendVar); |
|
|
return; |
|
|
} |
|
|
|
|
|
if (! LoadTTFILE()) |
|
|
return; |
|
|
if (! NewFileVar(&SendVar)) |
|
|
{ |
|
|
FreeTTFILE(); |
|
|
return; |
|
|
} |
|
|
SendVar->OpId = OpSendFile; |
|
|
|
|
|
FSend = TRUE; |
|
|
|
|
|
if (strlen(&(SendVar->FullName[SendVar->DirLen])) == 0) { |
|
|
char FileDirExpanded[MAX_PATH]; |
|
|
ExpandEnvironmentStrings(ts.FileDir, FileDirExpanded, sizeof(FileDirExpanded)); |
|
|
if (ts.TransBin) |
|
|
Option |= LOGDLG_BINARY; |
|
|
SendVar->FullName[0] = 0; |
|
|
if (! (*GetTransFname)(SendVar, FileDirExpanded, GTF_SEND, &Option)) { |
|
|
FileTransEnd(OpSendFile); |
|
|
return; |
|
|
} |
|
|
ts.TransBin = CheckFlag(Option, LOGDLG_BINARY); |
|
|
} |
|
|
else |
|
|
(*SetFileVar)(SendVar); |
|
|
|
|
|
SendVar->FileHandle = CreateFile(SendVar->FullName, GENERIC_READ, FILE_SHARE_READ, NULL, |
|
|
OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL); |
|
|
SendVar->FileOpen = (SendVar->FileHandle != INVALID_HANDLE_VALUE); |
|
|
if (! SendVar->FileOpen) |
|
|
{ |
|
|
FileTransEnd(OpSendFile); |
|
|
return; |
|
|
} |
|
|
SendVar->ByteCount = 0; |
|
|
SendVar->FileSize = GetFSize(SendVar->FullName); |
|
|
|
|
|
TalkStatus = IdTalkFile; |
|
|
FileRetrySend = FALSE; |
|
|
FileRetryEcho = FALSE; |
|
|
FileCRSend = FALSE; |
|
|
FileReadEOF = FALSE; |
|
|
FileSendHandler.pos = 0; |
|
|
FileSendHandler.end = 0; |
|
|
FileDlgRefresh = 0; |
|
|
|
|
|
if (BracketedPasteMode()) { |
|
|
FileBracketMode = FS_BRACKET_START; |
|
|
FileBracketPtr = 0; |
|
|
BinaryMode = TRUE; |
|
|
} |
|
|
else { |
|
|
FileBracketMode = FS_BRACKET_NONE; |
|
|
BinaryMode = ts.TransBin; |
|
|
} |
|
|
|
|
|
if (! OpenFTDlg(SendVar)) |
|
|
FileTransEnd(OpSendFile); |
|
|
} |
|
|
|
|
|
void FileTransEnd(WORD OpId) |
|
| 1257 |
/* OpId = 0: close Log and FileSend |
/* OpId = 0: close Log and FileSend |
| 1258 |
OpLog: close Log |
OpLog: close Log |
| 1259 |
OpSendFile: close FileSend */ |
OpSendFile: close FileSend */ |
| 1267 |
FLogDlg->DestroyWindow(); |
FLogDlg->DestroyWindow(); |
| 1268 |
FLogDlg = NULL; |
FLogDlg = NULL; |
| 1269 |
} |
} |
| 1270 |
FreeFileVar(&LogVar); |
FreeFileVar_(&LogVar); |
| 1271 |
FreeLogBuf(); |
FreeLogBuf(); |
| 1272 |
FreeBinBuf(); |
FreeBinBuf(); |
| 1273 |
FreeTTFILE(); |
FreeTTFILE(); |
| 1274 |
} |
} |
| 1275 |
|
|
| 1276 |
|
#if 0 |
| 1277 |
if (((OpId==0) || (OpId==OpSendFile)) && FSend) |
if (((OpId==0) || (OpId==OpSendFile)) && FSend) |
| 1278 |
{ |
{ |
| 1279 |
FSend = FALSE; |
FSend = FALSE; |
| 1283 |
SendDlg->DestroyWindow(); |
SendDlg->DestroyWindow(); |
| 1284 |
SendDlg = NULL; |
SendDlg = NULL; |
| 1285 |
} |
} |
| 1286 |
FreeFileVar(&SendVar); |
FreeFileVar_(&SendVar); |
| 1287 |
FreeTTFILE(); |
FreeTTFILE(); |
| 1288 |
} |
} |
| 1289 |
|
#endif |
| 1290 |
|
|
| 1291 |
EndDdeCmnd(0); |
// EndDdeCmnd(0); |
|
} |
|
|
|
|
|
void FileTransPause(WORD OpId, BOOL Pause) |
|
|
{ |
|
|
if (Pause) { |
|
|
cv.FilePause |= OpId; |
|
|
} |
|
|
else { |
|
|
cv.FilePause &= ~OpId; |
|
|
} |
|
|
} |
|
|
|
|
|
int FSOut1(BYTE b) |
|
|
{ |
|
|
if (BinaryMode) |
|
|
return CommBinaryOut(&cv,(PCHAR)&b,1); |
|
|
else if ((b>=0x20) || (b==0x09) || (b==0x0A) || (b==0x0D)) |
|
|
return CommTextOut(&cv,(PCHAR)&b,1); |
|
|
else |
|
|
return 1; |
|
|
} |
|
|
|
|
|
int FSEcho1(BYTE b) |
|
|
{ |
|
|
if (BinaryMode) |
|
|
return CommBinaryEcho(&cv,(PCHAR)&b,1); |
|
|
else |
|
|
return CommTextEcho(&cv,(PCHAR)&b,1); |
|
|
} |
|
|
|
|
|
// 以下の時はこちらの関数を使う |
|
|
// - BinaryMode == true |
|
|
// - FileBracketMode == false |
|
|
// - cv.TelFlag == false |
|
|
// - ts.LocalEcho == 0 |
|
|
void FileSendBinayBoost(void) |
|
|
{ |
|
|
WORD c, fc; |
|
|
LONG BCOld; |
|
|
DWORD read_bytes; |
|
|
|
|
|
if ((SendDlg == NULL) || |
|
|
((cv.FilePause & OpSendFile) != 0)) |
|
|
return; |
|
|
|
|
|
BCOld = SendVar->ByteCount; |
|
|
|
|
|
if (FileRetrySend) |
|
|
{ |
|
|
c = CommRawOut(&cv, &(FileSendHandler.buf[FileSendHandler.pos]), |
|
|
FileSendHandler.end - FileSendHandler.pos); |
|
|
FileSendHandler.pos += c; |
|
|
FileRetrySend = (FileSendHandler.end != FileSendHandler.pos); |
|
|
if (FileRetrySend) |
|
|
return; |
|
|
} |
|
|
|
|
|
do { |
|
|
if (FileSendHandler.pos == FileSendHandler.end) { |
|
|
ReadFile(SendVar->FileHandle, &(FileSendHandler.buf[0]), sizeof(FileSendHandler.buf), &read_bytes, NULL); |
|
|
fc = LOWORD(read_bytes); |
|
|
FileSendHandler.pos = 0; |
|
|
FileSendHandler.end = fc; |
|
|
} else { |
|
|
fc = FileSendHandler.end - FileSendHandler.end; |
|
|
} |
|
|
|
|
|
if (fc != 0) |
|
|
{ |
|
|
c = CommRawOut(&cv, &(FileSendHandler.buf[FileSendHandler.pos]), |
|
|
FileSendHandler.end - FileSendHandler.pos); |
|
|
FileSendHandler.pos += c; |
|
|
FileRetrySend = (FileSendHandler.end != FileSendHandler.pos); |
|
|
SendVar->ByteCount = SendVar->ByteCount + c; |
|
|
if (FileRetrySend) |
|
|
{ |
|
|
if (SendVar->ByteCount != BCOld) |
|
|
SendDlg->RefreshNum(); |
|
|
return; |
|
|
} |
|
|
} |
|
|
FileDlgRefresh = SendVar->ByteCount; |
|
|
SendDlg->RefreshNum(); |
|
|
BCOld = SendVar->ByteCount; |
|
|
if (fc != 0) |
|
|
return; |
|
|
} while (fc != 0); |
|
|
|
|
|
FileTransEnd(OpSendFile); |
|
| 1292 |
} |
} |
| 1293 |
|
|
|
void FileSend(void) |
|
|
{ |
|
|
WORD c, fc; |
|
|
LONG BCOld; |
|
|
DWORD read_bytes; |
|
|
|
|
|
if (cv.PortType == IdSerial && ts.FileSendHighSpeedMode && |
|
|
BinaryMode && !FileBracketMode && !cv.TelFlag && |
|
|
(ts.LocalEcho == 0) && (ts.Baud >= 115200)) { |
|
|
return FileSendBinayBoost(); |
|
|
} |
|
|
|
|
|
if ((SendDlg==NULL) || |
|
|
((cv.FilePause & OpSendFile) !=0)) |
|
|
return; |
|
|
|
|
|
BCOld = SendVar->ByteCount; |
|
|
|
|
|
if (FileRetrySend) |
|
|
{ |
|
|
FileRetryEcho = (ts.LocalEcho>0); |
|
|
c = FSOut1(FileByte); |
|
|
FileRetrySend = (c==0); |
|
|
if (FileRetrySend) |
|
|
return; |
|
|
} |
|
|
|
|
|
if (FileRetryEcho) |
|
|
{ |
|
|
c = FSEcho1(FileByte); |
|
|
FileRetryEcho = (c==0); |
|
|
if (FileRetryEcho) |
|
|
return; |
|
|
} |
|
|
|
|
|
do { |
|
|
if (FileBracketMode == FS_BRACKET_START) { |
|
|
FileByte = BracketStartStr[FileBracketPtr++]; |
|
|
fc = 1; |
|
|
|
|
|
if (FileBracketPtr >= sizeof(BracketStartStr) - 1) { |
|
|
FileBracketMode = FS_BRACKET_END; |
|
|
FileBracketPtr = 0; |
|
|
BinaryMode = ts.TransBin; |
|
|
} |
|
|
} |
|
|
else if (! FileReadEOF) { |
|
|
ReadFile(SendVar->FileHandle, &FileByte, 1, &read_bytes, NULL); |
|
|
fc = LOWORD(read_bytes); |
|
|
SendVar->ByteCount = SendVar->ByteCount + fc; |
|
|
|
|
|
if (FileCRSend && (fc==1) && (FileByte==0x0A)) { |
|
|
ReadFile(SendVar->FileHandle, &FileByte, 1, &read_bytes, NULL); |
|
|
fc = LOWORD(read_bytes); |
|
|
SendVar->ByteCount = SendVar->ByteCount + fc; |
|
|
} |
|
|
} |
|
|
else { |
|
|
fc = 0; |
|
|
} |
|
|
|
|
|
if (fc == 0 && FileBracketMode == FS_BRACKET_END) { |
|
|
FileReadEOF = TRUE; |
|
|
FileByte = BracketEndStr[FileBracketPtr++]; |
|
|
fc = 1; |
|
|
BinaryMode = TRUE; |
|
|
|
|
|
if (FileBracketPtr >= sizeof(BracketEndStr) - 1) { |
|
|
FileBracketMode = FS_BRACKET_NONE; |
|
|
FileBracketPtr = 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (fc!=0) |
|
|
{ |
|
|
c = FSOut1(FileByte); |
|
|
FileCRSend = (ts.TransBin==0) && (FileByte==0x0D); |
|
|
FileRetrySend = (c==0); |
|
|
if (FileRetrySend) |
|
|
{ |
|
|
if (SendVar->ByteCount != BCOld) |
|
|
SendDlg->RefreshNum(); |
|
|
return; |
|
|
} |
|
|
if (ts.LocalEcho>0) |
|
|
{ |
|
|
c = FSEcho1(FileByte); |
|
|
FileRetryEcho = (c==0); |
|
|
if (FileRetryEcho) |
|
|
return; |
|
|
} |
|
|
} |
|
|
if ((fc==0) || ((SendVar->ByteCount % 100 == 0) && (FileBracketPtr == 0))) { |
|
|
SendDlg->RefreshNum(); |
|
|
BCOld = SendVar->ByteCount; |
|
|
if (fc!=0) |
|
|
return; |
|
|
} |
|
|
} while (fc!=0); |
|
|
|
|
|
FileTransEnd(OpSendFile); |
|
|
} |
|
| 1294 |
|
|
| 1295 |
/** |
/** |
| 1296 |
* ログをポーズする |
* ログをポーズする |
| 1303 |
FileTransPause(OpLog, Pause); |
FileTransPause(OpLog, Pause); |
| 1304 |
} |
} |
| 1305 |
|
|
|
static BOOL OpenProtoDlg(PFileVar fv, int IdProto, int Mode, WORD Opt1, WORD Opt2) |
|
|
{ |
|
|
int vsize; |
|
|
PProtoDlg pd; |
|
|
|
|
|
ProtoId = IdProto; |
|
|
|
|
|
switch (ProtoId) { |
|
|
case PROTO_KMT: |
|
|
vsize = sizeof(TKmtVar); |
|
|
break; |
|
|
case PROTO_XM: |
|
|
vsize = sizeof(TXVar); |
|
|
break; |
|
|
case PROTO_YM: |
|
|
vsize = sizeof(TYVar); |
|
|
break; |
|
|
case PROTO_ZM: |
|
|
vsize = sizeof(TZVar); |
|
|
break; |
|
|
case PROTO_BP: |
|
|
vsize = sizeof(TBPVar); |
|
|
break; |
|
|
case PROTO_QV: |
|
|
vsize = sizeof(TQVVar); |
|
|
break; |
|
|
default: |
|
|
vsize = 0; |
|
|
assert(FALSE); |
|
|
break; |
|
|
} |
|
|
ProtoVar = (PCHAR)malloc(vsize); |
|
|
if (ProtoVar==NULL) |
|
|
return FALSE; |
|
|
|
|
|
switch (ProtoId) { |
|
|
case PROTO_KMT: |
|
|
((PKmtVar)ProtoVar)->KmtMode = Mode; |
|
|
break; |
|
|
case PROTO_XM: |
|
|
((PXVar)ProtoVar)->XMode = Mode; |
|
|
((PXVar)ProtoVar)->XOpt = Opt1; |
|
|
((PXVar)ProtoVar)->TextFlag = 1 - (Opt2 & 1); |
|
|
break; |
|
|
case PROTO_YM: |
|
|
((PYVar)ProtoVar)->YMode = Mode; |
|
|
((PYVar)ProtoVar)->YOpt = Opt1; |
|
|
break; |
|
|
case PROTO_ZM: |
|
|
((PZVar)ProtoVar)->BinFlag = (Opt1 & 1) != 0; |
|
|
((PZVar)ProtoVar)->ZMode = Mode; |
|
|
break; |
|
|
case PROTO_BP: |
|
|
((PBPVar)ProtoVar)->BPMode = Mode; |
|
|
break; |
|
|
case PROTO_QV: |
|
|
((PQVVar)ProtoVar)->QVMode = Mode; |
|
|
break; |
|
|
} |
|
|
|
|
|
pd = new CProtoDlg(); |
|
|
if (pd==NULL) |
|
|
{ |
|
|
free(ProtoVar); |
|
|
ProtoVar = NULL; |
|
|
return FALSE; |
|
|
} |
|
|
pd->Create(hInst, HVTWin, fv, &ts); |
|
|
|
|
|
(*ProtoInit)(ProtoId,FileVar,ProtoVar,&cv,&ts); |
|
|
|
|
|
PtDlg = pd; |
|
|
return TRUE; |
|
|
} |
|
|
|
|
|
static void CloseProtoDlg(void) |
|
|
{ |
|
|
if (PtDlg!=NULL) |
|
|
{ |
|
|
PtDlg->DestroyWindow(); |
|
|
PtDlg = NULL; |
|
|
|
|
|
::KillTimer(FileVar->HMainWin,IdProtoTimer); |
|
|
if ((ProtoId==PROTO_QV) && |
|
|
(((PQVVar)ProtoVar)->QVMode==IdQVSend)) |
|
|
CommTextOut(&cv,"\015",1); |
|
|
if (FileVar->LogFlag) |
|
|
CloseHandle(FileVar->LogFile); |
|
|
FileVar->LogFile = 0; |
|
|
if (ProtoVar!=NULL) |
|
|
{ |
|
|
free(ProtoVar); |
|
|
ProtoVar = NULL; |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
static BOOL ProtoStart(void) |
|
|
{ |
|
|
if (cv.ProtoFlag) |
|
|
return FALSE; |
|
|
if (FSend) |
|
|
{ |
|
|
FreeFileVar(&FileVar); |
|
|
return FALSE; |
|
|
} |
|
|
|
|
|
if (! LoadTTFILE()) |
|
|
return FALSE; |
|
|
NewFileVar(&FileVar); |
|
|
|
|
|
if (FileVar==NULL) |
|
|
{ |
|
|
FreeTTFILE(); |
|
|
return FALSE; |
|
|
} |
|
|
cv.ProtoFlag = TRUE; |
|
|
return TRUE; |
|
|
} |
|
|
|
|
|
void ProtoEnd(void) |
|
|
{ |
|
|
if (! cv.ProtoFlag) |
|
|
return; |
|
|
cv.ProtoFlag = FALSE; |
|
|
|
|
|
/* Enable transmit delay (serial port) */ |
|
|
cv.DelayFlag = TRUE; |
|
|
TalkStatus = IdTalkKeyb; |
|
|
|
|
|
CloseProtoDlg(); |
|
|
|
|
|
if ((FileVar!=NULL) && FileVar->Success) |
|
|
EndDdeCmnd(1); |
|
|
else |
|
|
EndDdeCmnd(0); |
|
|
|
|
|
FreeTTFILE(); |
|
|
FreeFileVar(&FileVar); |
|
|
} |
|
|
|
|
|
/** |
|
|
* OnIdle()#teraterm.cppからコールされる |
|
|
* cv.ProtoFlag が 0 以外のとき |
|
|
* @retval 0 continue |
|
|
* 1/2 ActiveWin(グローバル変数)の値(IdVT=1/IdTek=2) |
|
|
* 注 今のところ捨てられている |
|
|
*/ |
|
|
int ProtoDlgParse(void) |
|
|
{ |
|
|
int P; |
|
|
|
|
|
P = ActiveWin; |
|
|
if (PtDlg==NULL) |
|
|
return P; |
|
|
|
|
|
if ((*ProtoParse)(ProtoId,FileVar,ProtoVar,&cv)) |
|
|
P = 0; /* continue */ |
|
|
else { |
|
|
CommSend(&cv); |
|
|
ProtoEnd(); |
|
|
} |
|
|
return P; |
|
|
} |
|
|
|
|
|
void ProtoDlgTimeOut(void) |
|
|
{ |
|
|
if (PtDlg!=NULL) |
|
|
(*ProtoTimeOutProc)(ProtoId,FileVar,ProtoVar,&cv); |
|
|
} |
|
|
|
|
|
void ProtoDlgCancel(void) |
|
|
{ |
|
|
if ((PtDlg!=NULL) && |
|
|
(*ProtoCancel)(ProtoId,FileVar,ProtoVar,&cv)) |
|
|
ProtoEnd(); |
|
|
} |
|
|
|
|
|
void KermitStart(int mode) |
|
|
{ |
|
|
WORD w; |
|
|
|
|
|
if (! ProtoStart()) |
|
|
return; |
|
|
|
|
|
switch (mode) { |
|
|
case IdKmtSend: |
|
|
FileVar->OpId = OpKmtSend; |
|
|
if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0) |
|
|
{ |
|
|
char FileDirExpanded[MAX_PATH]; |
|
|
ExpandEnvironmentStrings(ts.FileDir, FileDirExpanded, sizeof(FileDirExpanded)); |
|
|
if (!(*GetMultiFname)(FileVar, FileDirExpanded, GMF_KERMIT, &w) || |
|
|
(FileVar->NumFname==0)) |
|
|
{ |
|
|
ProtoEnd(); |
|
|
return; |
|
|
} |
|
|
} |
|
|
else |
|
|
(*SetFileVar)(FileVar); |
|
|
break; |
|
|
case IdKmtReceive: |
|
|
FileVar->OpId = OpKmtRcv; |
|
|
break; |
|
|
case IdKmtGet: |
|
|
FileVar->OpId = OpKmtSend; |
|
|
if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0) |
|
|
{ |
|
|
if (! (*GetGetFname)(FileVar->HMainWin,FileVar) || |
|
|
(strlen(FileVar->FullName)==0)) |
|
|
{ |
|
|
ProtoEnd(); |
|
|
return; |
|
|
} |
|
|
} |
|
|
else |
|
|
(*SetFileVar)(FileVar); |
|
|
break; |
|
|
case IdKmtFinish: |
|
|
FileVar->OpId = OpKmtFin; |
|
|
break; |
|
|
default: |
|
|
ProtoEnd(); |
|
|
return; |
|
|
} |
|
|
TalkStatus = IdTalkQuiet; |
|
|
|
|
|
/* disable transmit delay (serial port) */ |
|
|
cv.DelayFlag = FALSE; |
|
|
|
|
|
if (! OpenProtoDlg(FileVar,PROTO_KMT,mode,0,0)) |
|
|
ProtoEnd(); |
|
|
} |
|
|
|
|
|
void XMODEMStart(int mode) |
|
|
{ |
|
|
LONG Option; |
|
|
int tmp; |
|
|
|
|
|
if (! ProtoStart()) |
|
|
return; |
|
|
|
|
|
if (mode==IdXReceive) |
|
|
FileVar->OpId = OpXRcv; |
|
|
else |
|
|
FileVar->OpId = OpXSend; |
|
|
|
|
|
if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0) |
|
|
{ |
|
|
char FileDirExpanded[MAX_PATH]; |
|
|
ExpandEnvironmentStrings(ts.FileDir, FileDirExpanded, sizeof(FileDirExpanded)); |
|
|
Option = MAKELONG(ts.XmodemBin,ts.XmodemOpt); |
|
|
if (! (*GetXFname)(FileVar->HMainWin, |
|
|
mode==IdXReceive,&Option,FileVar,FileDirExpanded)) |
|
|
{ |
|
|
ProtoEnd(); |
|
|
return; |
|
|
} |
|
|
tmp = HIWORD(Option); |
|
|
if (mode == IdXReceive) { |
|
|
if (IsXoptCRC(tmp)) { |
|
|
if (IsXopt1k(ts.XmodemOpt)) { |
|
|
ts.XmodemOpt = Xopt1kCRC; |
|
|
} |
|
|
else { |
|
|
ts.XmodemOpt = XoptCRC; |
|
|
} |
|
|
} |
|
|
else { |
|
|
if (IsXopt1k(ts.XmodemOpt)) { |
|
|
ts.XmodemOpt = Xopt1kCksum; |
|
|
} |
|
|
else { |
|
|
ts.XmodemOpt = XoptCheck; |
|
|
} |
|
|
} |
|
|
ts.XmodemBin = LOWORD(Option); |
|
|
} |
|
|
else { |
|
|
if (IsXopt1k(tmp)) { |
|
|
if (IsXoptCRC(ts.XmodemOpt)) { |
|
|
ts.XmodemOpt = Xopt1kCRC; |
|
|
} |
|
|
else { |
|
|
ts.XmodemOpt = Xopt1kCksum; |
|
|
} |
|
|
} |
|
|
else { |
|
|
if (IsXoptCRC(ts.XmodemOpt)) { |
|
|
ts.XmodemOpt = XoptCRC; |
|
|
} |
|
|
else { |
|
|
ts.XmodemOpt = XoptCheck; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
else |
|
|
(*SetFileVar)(FileVar); |
|
|
|
|
|
if (mode==IdXReceive) |
|
|
FileVar->FileHandle = _lcreat(FileVar->FullName,0); |
|
|
else |
|
|
FileVar->FileHandle = _lopen(FileVar->FullName,OF_READ); |
|
|
|
|
|
FileVar->FileOpen = FileVar->FileHandle != INVALID_HANDLE_VALUE; |
|
|
if (! FileVar->FileOpen) |
|
|
{ |
|
|
ProtoEnd(); |
|
|
return; |
|
|
} |
|
|
TalkStatus = IdTalkQuiet; |
|
|
|
|
|
/* disable transmit delay (serial port) */ |
|
|
cv.DelayFlag = FALSE; |
|
|
|
|
|
if (! OpenProtoDlg(FileVar,PROTO_XM,mode, |
|
|
ts.XmodemOpt,ts.XmodemBin)) |
|
|
ProtoEnd(); |
|
|
} |
|
|
|
|
|
void YMODEMStart(int mode) |
|
|
{ |
|
|
WORD Opt; |
|
|
|
|
|
if (! ProtoStart()) |
|
|
return; |
|
|
|
|
|
if (mode==IdYSend) |
|
|
{ |
|
|
char FileDirExpanded[MAX_PATH]; |
|
|
ExpandEnvironmentStrings(ts.FileDir, FileDirExpanded, sizeof(FileDirExpanded)); |
|
|
|
|
|
// ファイル転送時のオプションは"Yopt1K"に決め打ち。 |
|
|
// TODO: "Yopt1K", "YoptG", "YoptSingle"を区別したいならば、IDD_FOPTを拡張する必要あり。 |
|
|
Opt = Yopt1K; |
|
|
FileVar->OpId = OpYSend; |
|
|
if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0) |
|
|
{ |
|
|
if (! (*GetMultiFname)(FileVar,FileDirExpanded,GMF_Y,&Opt) || |
|
|
(FileVar->NumFname==0)) |
|
|
{ |
|
|
ProtoEnd(); |
|
|
return; |
|
|
} |
|
|
//ts.XmodemBin = Opt; |
|
|
} |
|
|
else |
|
|
(*SetFileVar)(FileVar); |
|
|
} |
|
|
else { |
|
|
FileVar->OpId = OpYRcv; |
|
|
// ファイル転送時のオプションは"Yopt1K"に決め打ち。 |
|
|
Opt = Yopt1K; |
|
|
(*SetFileVar)(FileVar); |
|
|
} |
|
|
|
|
|
TalkStatus = IdTalkQuiet; |
|
|
|
|
|
/* disable transmit delay (serial port) */ |
|
|
cv.DelayFlag = FALSE; |
|
|
|
|
|
if (! OpenProtoDlg(FileVar,PROTO_YM,mode,Opt,0)) |
|
|
ProtoEnd(); |
|
|
} |
|
|
|
|
|
void ZMODEMStart(int mode) |
|
|
{ |
|
|
WORD Opt; |
|
|
|
|
|
if (! ProtoStart()) |
|
|
return; |
|
|
|
|
|
if (mode == IdZSend || mode == IdZAutoS) |
|
|
{ |
|
|
Opt = ts.XmodemBin; |
|
|
FileVar->OpId = OpZSend; |
|
|
if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0) |
|
|
{ |
|
|
char FileDirExpanded[MAX_PATH]; |
|
|
ExpandEnvironmentStrings(ts.FileDir, FileDirExpanded, sizeof(FileDirExpanded)); |
|
|
if (! (*GetMultiFname)(FileVar,FileDirExpanded,GMF_Z,&Opt) || |
|
|
(FileVar->NumFname==0)) |
|
|
{ |
|
|
if (mode == IdZAutoS) { |
|
|
CommRawOut(&cv, "\030\030\030\030\030\030\030\030\b\b\b\b\b\b\b\b\b\b", 18); |
|
|
} |
|
|
ProtoEnd(); |
|
|
return; |
|
|
} |
|
|
ts.XmodemBin = Opt; |
|
|
} |
|
|
else |
|
|
(*SetFileVar)(FileVar); |
|
|
} |
|
|
else /* IdZReceive or IdZAutoR */ |
|
|
FileVar->OpId = OpZRcv; |
|
|
|
|
|
TalkStatus = IdTalkQuiet; |
|
|
|
|
|
/* disable transmit delay (serial port) */ |
|
|
cv.DelayFlag = FALSE; |
|
|
|
|
|
if (! OpenProtoDlg(FileVar,PROTO_ZM,mode,Opt,0)) |
|
|
ProtoEnd(); |
|
|
} |
|
|
|
|
|
void BPStart(int mode) |
|
|
{ |
|
|
LONG Option = 0; |
|
|
|
|
|
if (! ProtoStart()) |
|
|
return; |
|
|
if (mode==IdBPSend) |
|
|
{ |
|
|
FileVar->OpId = OpBPSend; |
|
|
if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0) |
|
|
{ |
|
|
char FileDirExpanded[MAX_PATH]; |
|
|
ExpandEnvironmentStrings(ts.FileDir, FileDirExpanded, sizeof(FileDirExpanded)); |
|
|
FileVar->FullName[0] = 0; |
|
|
if (! (*GetTransFname)(FileVar, FileDirExpanded, GTF_BP, &Option)) |
|
|
{ |
|
|
ProtoEnd(); |
|
|
return; |
|
|
} |
|
|
} |
|
|
else |
|
|
(*SetFileVar)(FileVar); |
|
|
} |
|
|
else /* IdBPReceive or IdBPAuto */ |
|
|
FileVar->OpId = OpBPRcv; |
|
|
|
|
|
TalkStatus = IdTalkQuiet; |
|
|
|
|
|
/* disable transmit delay (serial port) */ |
|
|
cv.DelayFlag = FALSE; |
|
|
|
|
|
if (! OpenProtoDlg(FileVar,PROTO_BP,mode,0,0)) |
|
|
ProtoEnd(); |
|
|
} |
|
|
|
|
|
void QVStart(int mode) |
|
|
{ |
|
|
WORD W; |
|
|
|
|
|
if (! ProtoStart()) |
|
|
return; |
|
|
|
|
|
if (mode==IdQVSend) |
|
|
{ |
|
|
FileVar->OpId = OpQVSend; |
|
|
if (strlen(&(FileVar->FullName[FileVar->DirLen]))==0) |
|
|
{ |
|
|
char FileDirExpanded[MAX_PATH]; |
|
|
ExpandEnvironmentStrings(ts.FileDir, FileDirExpanded, sizeof(FileDirExpanded)); |
|
|
if (! (*GetMultiFname)(FileVar,FileDirExpanded,GMF_QV, &W) || |
|
|
(FileVar->NumFname==0)) |
|
|
{ |
|
|
ProtoEnd(); |
|
|
return; |
|
|
} |
|
|
} |
|
|
else |
|
|
(*SetFileVar)(FileVar); |
|
|
} |
|
|
else |
|
|
FileVar->OpId = OpQVRcv; |
|
|
|
|
|
TalkStatus = IdTalkQuiet; |
|
|
|
|
|
/* disable transmit delay (serial port) */ |
|
|
cv.DelayFlag = FALSE; |
|
|
|
|
|
if (! OpenProtoDlg(FileVar,PROTO_QV,mode,0,0)) |
|
|
ProtoEnd(); |
|
|
} |
|
|
|
|
| 1306 |
/** |
/** |
| 1307 |
* ログローテートの設定 |
* ログローテートの設定 |
| 1308 |
* ログのサイズが<size>バイトを超えていれば、ローテーションするよう設定する |
* ログのサイズが<size>バイトを超えていれば、ローテーションするよう設定する |
| 1394 |
void FLogClose(void) |
void FLogClose(void) |
| 1395 |
{ |
{ |
| 1396 |
if (LogVar != NULL) |
if (LogVar != NULL) |
| 1397 |
FileTransEnd(OpLog); |
FileTransEnd_(OpLog); |
| 1398 |
} |
} |
| 1399 |
|
|
| 1400 |
BOOL FLogOpen(const char *fname) |
BOOL FLogOpen(const char *fname) |
| 1401 |
{ |
{ |
| 1402 |
BOOL ret; |
BOOL ret; |
| 1403 |
|
|
| 1404 |
if ((LogVar==NULL) && !NewFileVar(&LogVar)) { |
if (LogVar != NULL) { |
| 1405 |
return FALSE; |
return FALSE; |
| 1406 |
} |
} |
| 1407 |
|
|