[ttssh2-commit] [10496] TGetHNRec を別ファイルに移動した

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2023年 1月 16日 (月) 00:06:51 JST


Revision: 10496
          https://osdn.net/projects/ttssh2/scm/svn/commits/10496
Author:   zmatsuo
Date:     2023-01-16 00:06:50 +0900 (Mon, 16 Jan 2023)
Log Message:
-----------
TGetHNRec を別ファイルに移動した

- TGetHNRec 構造体は主にプラグインで使用
- HostNameMaxLength(ホスト名長 = コマンドライン長)を移動

Modified Paths:
--------------
    trunk/teraterm/common/ttplugin.h
    trunk/teraterm/common/tttypes.h
    trunk/teraterm/teraterm/ttdialog.h
    trunk/teraterm/teraterm/ttplug.h
    trunk/teraterm/teraterm/ttwinman.c
    trunk/teraterm/teraterm/ttwinman.h
    trunk/teraterm/teraterm/vtwin.cpp
    trunk/teraterm/ttpdlg/ttdlg.h

Added Paths:
-----------
    trunk/teraterm/common/hostname_rec.h

-------------- next part --------------
Copied: trunk/teraterm/common/hostname_rec.h (from rev 10495, trunk/teraterm/teraterm/ttwinman.h)
===================================================================
--- trunk/teraterm/common/hostname_rec.h	                        (rev 0)
+++ trunk/teraterm/common/hostname_rec.h	2023-01-15 15:06:50 UTC (rev 10496)
@@ -0,0 +1,58 @@
+/*
+ * (C) 2023- TeraTerm Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// \x83R\x83}\x83\x93\x83h\x83\x89\x83C\x83\x93\x8Dő咷
+// (TGetHNRec.HostName\x82̊m\x95ۍςݕ\xB6\x8E\x9A\x92\xB7)
+//
+#define HostNameMaxLength 1024
+//#define HostNameMaxLength 80
+
+/* GetHostName dialog record */
+typedef struct {
+	PCHAR SetupFN; // setup file name
+	const wchar_t *SetupFNW;
+	WORD PortType; // TCPIP/Serial
+	wchar_t *HostName; // host name
+	WORD Telnet; // non-zero: enable telnet
+	WORD TelPort; // default TCP port# for telnet
+	WORD TCPPort; // TCP port #
+	WORD ProtocolFamily; // Protocol Family (AF_INET/AF_INET6/AF_UNSPEC)
+	WORD ComPort; // serial port #
+	WORD MaxComPort; // max serial port #
+} TGetHNRec;
+typedef TGetHNRec *PGetHNRec;
+
+#ifdef __cplusplus
+}
+#endif

Modified: trunk/teraterm/common/ttplugin.h
===================================================================
--- trunk/teraterm/common/ttplugin.h	2023-01-15 15:06:39 UTC (rev 10495)
+++ trunk/teraterm/common/ttplugin.h	2023-01-15 15:06:50 UTC (rev 10496)
@@ -32,6 +32,7 @@
 #include "ttwsk.h"
 #include "ttsetup.h"
 #include "ttfileio.h"
+#include "hostname_rec.h"
 
 // \x83v\x83\x89\x83O\x83C\x83\x93\x82̃o\x81[\x83W\x83\x87\x83\x93
 #define TTVERSION (WORD)500	/* version 5.00 */

Modified: trunk/teraterm/common/tttypes.h
===================================================================
--- trunk/teraterm/common/tttypes.h	2023-01-15 15:06:39 UTC (rev 10495)
+++ trunk/teraterm/common/tttypes.h	2023-01-15 15:06:50 UTC (rev 10496)
@@ -74,8 +74,10 @@
 #define IdCyan    6
 #define IdFore    7
 
+#if 0
 #define HostNameMaxLength 1024
 //#define HostNameMaxLength 80
+#endif
 #define ProtocolFamilyMaxLength 80
 
   /* internal WM_USER messages */
@@ -715,22 +717,6 @@
 #define IdFlowNone 3
 #define IdFlowHardDsrDtr 4  // DSR/DTR(hardware flow)
 
-
-/* GetHostName dialog record */
-typedef struct {
-	PCHAR SetupFN; // setup file name
-	const wchar_t *SetupFNW;
-	WORD PortType; // TCPIP/Serial
-	wchar_t *HostName; // host name
-	WORD Telnet; // non-zero: enable telnet
-	WORD TelPort; // default TCP port# for telnet
-	WORD TCPPort; // TCP port #
-	WORD ProtocolFamily; // Protocol Family (AF_INET/AF_INET6/AF_UNSPEC)
-	WORD ComPort; // serial port #
-	WORD MaxComPort; // max serial port #
-} TGetHNRec;
-typedef TGetHNRec *PGetHNRec;
-
 /* Control Characters */
 
 #define NUL  0x00

Modified: trunk/teraterm/teraterm/ttdialog.h
===================================================================
--- trunk/teraterm/teraterm/ttdialog.h	2023-01-15 15:06:39 UTC (rev 10495)
+++ trunk/teraterm/teraterm/ttdialog.h	2023-01-15 15:06:50 UTC (rev 10496)
@@ -28,6 +28,9 @@
  */
 
 /* TERATERM.EXE, TTDLG interface */
+
+#include "hostname_rec.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif

Modified: trunk/teraterm/teraterm/ttplug.h
===================================================================
--- trunk/teraterm/teraterm/ttplug.h	2023-01-15 15:06:39 UTC (rev 10495)
+++ trunk/teraterm/teraterm/ttplug.h	2023-01-15 15:06:50 UTC (rev 10496)
@@ -30,6 +30,8 @@
 #ifndef __TTPLUG_H
 #define __TTPLUG_H
 
+#include "hostname_rec.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif

Modified: trunk/teraterm/teraterm/ttwinman.c
===================================================================
--- trunk/teraterm/teraterm/ttwinman.c	2023-01-15 15:06:39 UTC (rev 10495)
+++ trunk/teraterm/teraterm/ttwinman.c	2023-01-15 15:06:50 UTC (rev 10496)
@@ -86,8 +86,9 @@
  *    | +------------- displays TCP port number
  *    +--------------- displays speed of serial port
  */
-void ChangeTitle()
+void ChangeTitle(void)
 {
+#define HostNameMaxLength 1024	// \x83z\x83X\x83g\x96\xBC\x8Dő咷  TODO \x95ʂ̍ő咷\x8A or \x8Dő咷\x90\xA7\x8C\xC0\x82\xF0\x82Ȃ\xAD\x82\xB7
 	wchar_t TempTitle[HostNameMaxLength + TitleBuffSize * 2 + 1]; // \x83o\x83b\x83t\x83@\x8Ag\x92\xA3
 	wchar_t TempTitleWithRemote[TitleBuffSize * 2];
 

Modified: trunk/teraterm/teraterm/ttwinman.h
===================================================================
--- trunk/teraterm/teraterm/ttwinman.h	2023-01-15 15:06:39 UTC (rev 10495)
+++ trunk/teraterm/teraterm/ttwinman.h	2023-01-15 15:06:50 UTC (rev 10496)
@@ -34,7 +34,7 @@
 
 /* prototypes */
 void VTActivate();
-void ChangeTitle();
+void ChangeTitle(void);
 void SwitchMenu();
 void SwitchTitleBar();
 HMODULE LoadHomeDLL(const wchar_t *DLLname);

Modified: trunk/teraterm/teraterm/vtwin.cpp
===================================================================
--- trunk/teraterm/teraterm/vtwin.cpp	2023-01-15 15:06:39 UTC (rev 10495)
+++ trunk/teraterm/teraterm/vtwin.cpp	2023-01-15 15:06:50 UTC (rev 10496)
@@ -3509,6 +3509,7 @@
 	}
 
 	wchar_t hostname[HostNameMaxLength];
+	hostname[0] = 0;
 	TGetHNRec GetHNRec; /* record for dialog box */
 	GetHNRec.SetupFN = ts.SetupFName;
 	GetHNRec.SetupFNW = ts.SetupFNameW;

Modified: trunk/teraterm/ttpdlg/ttdlg.h
===================================================================
--- trunk/teraterm/ttpdlg/ttdlg.h	2023-01-15 15:06:39 UTC (rev 10495)
+++ trunk/teraterm/ttpdlg/ttdlg.h	2023-01-15 15:06:50 UTC (rev 10496)
@@ -28,6 +28,7 @@
 
 #include "teraterm.h"
 #include "tttypes.h"
+#include "hostname_rec.h"
 
 BOOL WINAPI _SetupTerminal(HWND WndParent, PTTSet ts);
 BOOL WINAPI _SetupWin(HWND WndParent, PTTSet ts);


ttssh2-commit メーリングリストの案内
Back to archive index