Develop and Download Open Source Software

Browse Subversion Repository

Diff of /trunk/teraterm/teraterm/filesys_log.cpp

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

revision 5383 by doda, Thu Sep 5 06:17:54 2013 UTC revision 5392 by yutakapon, Sun Sep 29 15:30:39 2013 UTC
# Line 22  Line 22 
22  #include "filesys.h"  #include "filesys.h"
23  #include "ftlib.h"  #include "ftlib.h"
24    
25    #include "buffer.h"
26    
27  #include <io.h>  #include <io.h>
28  #include <process.h>  #include <process.h>
29    
# Line 438  BOOL LogStart() Line 440  BOOL LogStart()
440          LONG Option;          LONG Option;
441          char *logdir;          char *logdir;
442          unsigned tid;          unsigned tid;
443            DWORD ofs, size, written_size;
444            char buf[512];
445    
446          if ((FileLog) || (BinLog)) return FALSE;          if ((FileLog) || (BinLog)) return FALSE;
447    
# Line 468  BOOL LogStart() Line 472  BOOL LogStart()
472                  // 0x1000 = plain text (2005.2.20 yutaka)                  // 0x1000 = plain text (2005.2.20 yutaka)
473                  // 0x2000 = timestamp (2006.7.23 maya)                  // 0x2000 = timestamp (2006.7.23 maya)
474                  // 0x4000 = hide file transfer dialog (2008.1.30 maya)                  // 0x4000 = hide file transfer dialog (2008.1.30 maya)
475                    // 0x8000 = All buffer included in first (2013.9.29 yutaka)
476                  // teraterm.iniの設定を見てからデフォルトオプションを決める。(2005.5.7 yutaka)                  // teraterm.iniの設定を見てからデフォルトオプションを決める。(2005.5.7 yutaka)
477                  Option = MAKELONG(ts.LogBinary,                  Option = MAKELONG(ts.LogBinary,
478                                    ts.Append |                                    ts.Append |
479                                    (0x1000 * ts.LogTypePlainText) |                                    (0x1000 * ts.LogTypePlainText) |
480                                    (0x2000 * ts.LogTimestamp) |                                    (0x2000 * ts.LogTimestamp) |
481                                    (0x4000 * ts.LogHideDialog));                                    (0x4000 * ts.LogHideDialog) |
482                                      (0x8000 * ts.LogAllBuffIncludedInFirst)                                        
483                                                      );
484    
485                  // ログのデフォルトファイル名を設定 (2006.8.28 maya)                  // ログのデフォルトファイル名を設定 (2006.8.28 maya)
486                  strncat_s(LogVar->FullName, sizeof(LogVar->FullName), ts.LogDefaultName, _TRUNCATE);                  strncat_s(LogVar->FullName, sizeof(LogVar->FullName), ts.LogDefaultName, _TRUNCATE);
# Line 513  BOOL LogStart() Line 520  BOOL LogStart()
520                          ts.LogHideDialog = 0;                          ts.LogHideDialog = 0;
521                  }                  }
522    
523                    if (ts.Append & 0x8000) {
524                            ts.LogAllBuffIncludedInFirst = 1;
525                    }
526                    else {
527                            ts.LogAllBuffIncludedInFirst = 0;
528                    }
529    
530                  ts.Append &= 0x1; // 1bitにマスクする                  ts.Append &= 0x1; // 1bitにマスクする
531    
532          }          }
# Line 622  BOOL LogStart() Line 636  BOOL LogStart()
636          LogVar->LogThread = (HANDLE)_beginthreadex(NULL, 0, DeferredLogWriteThread, LogVar, 0, &tid);          LogVar->LogThread = (HANDLE)_beginthreadex(NULL, 0, DeferredLogWriteThread, LogVar, 0, &tid);
637          LogVar->LogThreadId = tid;          LogVar->LogThreadId = tid;
638    
639            // 現在バッファにあるデータをすべて書き出してから、
640            // ログ採取を開始する。
641            // (2013.9.29 yutaka)
642            if (ts.LogAllBuffIncludedInFirst) {
643                    for (ofs = 0 ;  ; ofs++ ) {
644                            size = BuffGetAnyLineData(ofs, buf, sizeof(buf));
645                            if (size == -1)
646                                    break;
647                            WriteFile((HANDLE)LogVar->FileHandle, buf, size, &written_size, NULL);
648                            WriteFile((HANDLE)LogVar->FileHandle, "\r\n", 2, &written_size, NULL);
649                    }
650            }
651    
652          return TRUE;          return TRUE;
653  }  }
654  }  }

Legend:
Removed from v.5383  
changed lines
  Added in v.5392

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