Develop and Download Open Source Software

Browse CVS Repository

Diff of /ttssh2/teraterm/source/teraterm/filesys.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.1.1 by yutakakn, Mon Nov 15 14:43:41 2004 UTC revision 1.3 by yutakakn, Sat May 7 09:49:24 2005 UTC
# Line 224  void FreeFileVar(PFileVar *fv) Line 224  void FreeFileVar(PFileVar *fv)
224  extern "C" {  extern "C" {
225  void LogStart()  void LogStart()
226  {  {
227    LONG Option;          LONG Option;
228    
229    if ((FileLog) || (BinLog)) return;          if ((FileLog) || (BinLog)) return;
230    
231    if (! LoadTTFILE()) return;          if (! LoadTTFILE()) return;
232    if (! NewFileVar(&LogVar))          if (! NewFileVar(&LogVar))
233    {          {
234      FreeTTFILE();                  FreeTTFILE();
235      return;                  return;
236    }          }
237    LogVar->OpId = OpLog;          LogVar->OpId = OpLog;
238    
239    if (strlen(&(LogVar->FullName[LogVar->DirLen]))==0)          if (strlen(&(LogVar->FullName[LogVar->DirLen]))==0)
240    {          {
241      Option = MAKELONG(ts.TransBin,ts.Append);                  // 0x1000 = plain text (2005.2.20 yutaka)
242      if (! (*GetTransFname)(LogVar, ts.FileDir, GTF_LOG, &Option))                  // teraterm.iniの設定を見てからデフォルトオプションを決める。(2005.5.7 yutaka)
243      {                  Option = MAKELONG(ts.TransBin,ts.Append | (0x1000 * ts.LogTypePlainText));
244        FreeFileVar(&LogVar);                  if (! (*GetTransFname)(LogVar, ts.FileDir, GTF_LOG, &Option))
245        FreeTTFILE();                  {
246        return;                          FreeFileVar(&LogVar);
247      }                          FreeTTFILE();
248      ts.TransBin = LOWORD(Option);                          return;
249      ts.Append = HIWORD(Option);                  }
250    }                  ts.TransBin = LOWORD(Option);
251    else                  ts.Append = HIWORD(Option);
     (*SetFileVar)(LogVar);  
252    
253    if (ts.TransBin > 0)                  if (ts.Append & 0x1000) {
254    {                          ts.LogTypePlainText = 1;
255      BinLog = TRUE;                  } else {
256      FileLog = FALSE;                          ts.LogTypePlainText = 0;
257      if (! CreateBinBuf())                  }
258      {                  ts.Append &= 0x1; // 1bitにマスクする
       FileTransEnd(OpLog);  
       return;  
     }  
   }  
   else {  
     BinLog = FALSE;  
     FileLog = TRUE;  
     if (! CreateLogBuf())  
     {  
       FileTransEnd(OpLog);  
       return;  
     }  
   }  
   cv.LStart = cv.LogPtr;  
   cv.LCount = 0;  
259    
260    HelpId = HlpFileLog;          }
261    if (ts.Append > 0)          else
262    {                  (*SetFileVar)(LogVar);
     LogVar->FileHandle = _lopen(LogVar->FullName,OF_WRITE);  
     if (LogVar->FileHandle>0)  
       _llseek(LogVar->FileHandle,0,2);  
     else  
       LogVar->FileHandle = _lcreat(LogVar->FullName,0);  
   }  
   else  
     LogVar->FileHandle = _lcreat(LogVar->FullName,0);  
   LogVar->FileOpen = (LogVar->FileHandle>0);  
   if (! LogVar->FileOpen)  
   {  
     FileTransEnd(OpLog);  
     return;  
   }  
   LogVar->ByteCount = 0;  
263    
264    if (! OpenFTDlg(LogVar))          if (ts.TransBin > 0)
265      FileTransEnd(OpLog);          {
266                    BinLog = TRUE;
267                    FileLog = FALSE;
268                    if (! CreateBinBuf())
269                    {
270                            FileTransEnd(OpLog);
271                            return;
272                    }
273            }
274            else {
275                    BinLog = FALSE;
276                    FileLog = TRUE;
277                    if (! CreateLogBuf())
278                    {
279                            FileTransEnd(OpLog);
280                            return;
281                    }
282            }
283            cv.LStart = cv.LogPtr;
284            cv.LCount = 0;
285    
286            HelpId = HlpFileLog;
287            if (ts.Append > 0)
288            {
289                    LogVar->FileHandle = _lopen(LogVar->FullName,OF_WRITE);
290                    if (LogVar->FileHandle>0)
291                            _llseek(LogVar->FileHandle,0,2);
292                    else
293                            LogVar->FileHandle = _lcreat(LogVar->FullName,0);
294            }
295            else
296                    LogVar->FileHandle = _lcreat(LogVar->FullName,0);
297            LogVar->FileOpen = (LogVar->FileHandle>0);
298            if (! LogVar->FileOpen)
299            {
300                    FileTransEnd(OpLog);
301                    return;
302            }
303            LogVar->ByteCount = 0;
304    
305            if (! OpenFTDlg(LogVar))
306                    FileTransEnd(OpLog);
307  }  }
308  }  }
309    
# Line 1063  void QVStart(int mode) Line 1073  void QVStart(int mode)
1073      ProtoEnd();      ProtoEnd();
1074  }  }
1075  }  }
1076    
1077    /*
1078     * $Log$
1079     * Revision 1.3  2005/05/07 09:49:24  yutakakn
1080     * teraterm.iniに LogTypePlainText を追加した。
1081     *
1082     * Revision 1.2  2005/02/20 14:51:29  yutakakn
1083     * ログファイルの種別に"plain text"を追加。このオプションが有効の場合は、ログファイルに
1084     * ASCII非表示文字の採取をしない。
1085     *
1086     * 現在、無視するキャラクタは以下のとおり。
1087     *  ・BS
1088     *  ・ASCII(0x00-0x1f)のうち非表示なもの
1089     *
1090     * ただし、例外として以下のものはログ採取対象。
1091     *  ・HT
1092     *  ・CR
1093     *  ・LF
1094     *
1095     */

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.3

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26