ttpfile/ttfile_proto.cpp 削除
@@ -191,8 +191,6 @@ | ||
191 | 191 | ../ttpfile/kermit.h |
192 | 192 | ../ttpfile/quickvan.c |
193 | 193 | ../ttpfile/quickvan.h |
194 | - ../ttpfile/ttfile_proto.cpp | |
195 | - ../ttpfile/ttfile_proto.h | |
196 | 194 | ../ttpfile/xmodem.c |
197 | 195 | ../ttpfile/xmodem.h |
198 | 196 | ../ttpfile/ymodem.c |
@@ -57,7 +57,6 @@ | ||
57 | 57 | |
58 | 58 | #include "filesys.h" |
59 | 59 | #include "filesys_proto.h" |
60 | -#include "ttfile_proto.h" | |
61 | 60 | #include "tt_res.h" |
62 | 61 | #include "filesys_win32.h" |
63 | 62 |
@@ -263,6 +262,15 @@ | ||
263 | 262 | *pfv = NULL; |
264 | 263 | } |
265 | 264 | |
265 | +static int _ProtoSetOpt(PFileVarProto fv, int request, ...) | |
266 | +{ | |
267 | + va_list ap; | |
268 | + va_start(ap, request); | |
269 | + int r = fv->SetOptV(fv, request, ap); | |
270 | + va_end(ap); | |
271 | + return r; | |
272 | +} | |
273 | + | |
266 | 274 | static BOOL OpenProtoDlg(PFileVarProto fv, int IdProto, int Mode, WORD Opt1, WORD Opt2) |
267 | 275 | { |
268 | 276 | PProtoDlg pd; |
@@ -745,7 +753,8 @@ | ||
745 | 753 | if (PtDlg==NULL) |
746 | 754 | return P; |
747 | 755 | |
748 | - if (_ProtoParse(ProtoId,FileVar,&cv)) | |
756 | + PFileVarProto fv = FileVar; | |
757 | + if (fv->Parse(fv, &cv)) | |
749 | 758 | P = 0; /* continue */ |
750 | 759 | else { |
751 | 760 | CommSend(&cv); |
@@ -756,15 +765,19 @@ | ||
756 | 765 | |
757 | 766 | void ProtoDlgTimeOut(void) |
758 | 767 | { |
759 | - if (PtDlg!=NULL) | |
760 | - _ProtoTimeOutProc(ProtoId,FileVar,&cv); | |
768 | + if (PtDlg!=NULL) { | |
769 | + PFileVarProto fv = FileVar; | |
770 | + fv->TimeOutProc(fv, &cv); | |
771 | + } | |
761 | 772 | } |
762 | 773 | |
763 | 774 | void ProtoDlgCancel(void) |
764 | 775 | { |
765 | - if ((PtDlg!=NULL) && | |
766 | - _ProtoCancel(ProtoId,FileVar,&cv)) | |
776 | + if (PtDlg!=NULL) { | |
777 | + PFileVarProto fv = FileVar; | |
778 | + fv->Cancel(fv, &cv); | |
767 | 779 | ProtoEnd(); |
780 | + } | |
768 | 781 | } |
769 | 782 | |
770 | 783 | static INT_PTR CALLBACK GetFnDlg(HWND Dialog, UINT Message, WPARAM wParam, LPARAM lParam) |
@@ -1,72 +0,0 @@ | ||
1 | -project(ttpfile) | |
2 | - | |
3 | -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/") | |
4 | - | |
5 | -set(COMMON_SRC | |
6 | - ../common/dlglib.h | |
7 | - ../common/ttlib.h | |
8 | - ../common/ttlib.c | |
9 | - ../common/win16api.h | |
10 | - ) | |
11 | - | |
12 | -source_group( | |
13 | - "common" | |
14 | - FILES | |
15 | - ${COMMON_SRC} | |
16 | - ) | |
17 | - | |
18 | -set(SRC | |
19 | - bplus.c | |
20 | - bplus.h | |
21 | - ftlib.c | |
22 | - ftlib.h | |
23 | - kermit.c | |
24 | - kermit.h | |
25 | - quickvan.c | |
26 | - quickvan.h | |
27 | - ttfile.c | |
28 | - xmodem.c | |
29 | - xmodem.h | |
30 | - ymodem.c | |
31 | - ymodem.h | |
32 | - zmodem.c | |
33 | - zmodem.h | |
34 | - file_res.h | |
35 | - ttpfile-version.rc | |
36 | - ttpfile.rc | |
37 | - ttpfile.def | |
38 | - ${COMMON_SRC} | |
39 | - ) | |
40 | - | |
41 | -include_directories( | |
42 | - ../common | |
43 | - ) | |
44 | - | |
45 | -add_library( | |
46 | - ttpfile SHARED | |
47 | - ${SRC} | |
48 | - ) | |
49 | - | |
50 | -if(MINGW) | |
51 | - set_target_properties( | |
52 | - ttpfile | |
53 | - PROPERTIES PREFIX "" | |
54 | - SUFFIX ".dll" | |
55 | - ) | |
56 | -endif() | |
57 | - | |
58 | -target_link_libraries( | |
59 | - ttpfile | |
60 | - PRIVATE | |
61 | - common_static | |
62 | - ttpcmn | |
63 | - # | |
64 | - gdi32 | |
65 | - comdlg32 | |
66 | - ) | |
67 | - | |
68 | -install( | |
69 | - TARGETS ttpfile | |
70 | - RUNTIME | |
71 | - DESTINATION . | |
72 | - ) |
@@ -1,43 +0,0 @@ | ||
1 | -/* | |
2 | - * (C) 2020 TeraTerm Project | |
3 | - * All rights reserved. | |
4 | - * | |
5 | - * Redistribution and use in source and binary forms, with or without | |
6 | - * modification, are permitted provided that the following conditions | |
7 | - * are met: | |
8 | - * | |
9 | - * 1. Redistributions of source code must retain the above copyright | |
10 | - * notice, this list of conditions and the following disclaimer. | |
11 | - * 2. Redistributions in binary form must reproduce the above copyright | |
12 | - * notice, this list of conditions and the following disclaimer in the | |
13 | - * documentation and/or other materials provided with the distribution. | |
14 | - * 3. The name of the author may not be used to endorse or promote products | |
15 | - * derived from this software without specific prior written permission. | |
16 | - * | |
17 | - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR | |
18 | - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
19 | - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
20 | - * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, | |
21 | - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
22 | - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
23 | - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
24 | - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
25 | - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
26 | - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
27 | - */ | |
28 | - | |
29 | -#include "filesys_proto.h" | |
30 | - | |
31 | -#ifdef __cplusplus | |
32 | -extern "C" { | |
33 | -#endif | |
34 | - | |
35 | -void _ProtoInit(int Proto, PFileVarProto fv, PComVar cv, PTTSet ts); | |
36 | -BOOL _ProtoParse(int Proto, PFileVarProto fv, PComVar cv); | |
37 | -void _ProtoTimeOutProc(int Proto, PFileVarProto fv, PComVar cv); | |
38 | -BOOL _ProtoCancel(int Proto, PFileVarProto fv, PComVar cv); | |
39 | -int _ProtoSetOpt(PFileVarProto fv, int request, ...); | |
40 | - | |
41 | -#ifdef __cplusplus | |
42 | -} | |
43 | -#endif |
@@ -1,166 +0,0 @@ | ||
1 | -/* | |
2 | - * Copyright (C) 1994-1998 T. Teranishi | |
3 | - * (C) 2005-2020 TeraTerm Project | |
4 | - * All rights reserved. | |
5 | - * | |
6 | - * Redistribution and use in source and binary forms, with or without | |
7 | - * modification, are permitted provided that the following conditions | |
8 | - * are met: | |
9 | - * | |
10 | - * 1. Redistributions of source code must retain the above copyright | |
11 | - * notice, this list of conditions and the following disclaimer. | |
12 | - * 2. Redistributions in binary form must reproduce the above copyright | |
13 | - * notice, this list of conditions and the following disclaimer in the | |
14 | - * documentation and/or other materials provided with the distribution. | |
15 | - * 3. The name of the author may not be used to endorse or promote products | |
16 | - * derived from this software without specific prior written permission. | |
17 | - * | |
18 | - * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR | |
19 | - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | |
20 | - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |
21 | - * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, | |
22 | - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | |
23 | - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
24 | - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
25 | - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
26 | - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | |
27 | - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
28 | - */ | |
29 | - | |
30 | -/* TTFILE.DLL, file transfer, VT window printing */ | |
31 | -#include "teraterm.h" | |
32 | -#include "tttypes.h" | |
33 | -#include "ttftypes.h" | |
34 | -#include <direct.h> | |
35 | -#include <commdlg.h> | |
36 | -#include <string.h> | |
37 | - | |
38 | -#include "ttlib.h" | |
39 | -#include "ftlib.h" | |
40 | -#include "dlglib.h" | |
41 | -#include "kermit.h" | |
42 | -#include "xmodem.h" | |
43 | -#include "ymodem.h" | |
44 | -#include "zmodem.h" | |
45 | -#include "bplus.h" | |
46 | -#include "quickvan.h" | |
47 | - | |
48 | -#include "filesys_proto.h" | |
49 | -#include "ttfile_proto.h" | |
50 | - | |
51 | -#include <stdlib.h> | |
52 | -#include <stdio.h> | |
53 | -#include <io.h> | |
54 | -#include <assert.h> | |
55 | - | |
56 | -#if 0 | |
57 | -void _ProtoInit(int Proto, PFileVarProto fv, PComVar cv, PTTSet ts) | |
58 | -{ | |
59 | - switch (Proto) { | |
60 | - case PROTO_KMT: | |
61 | - fv->Init(fv,cv,ts); | |
62 | - break; | |
63 | - case PROTO_XM: | |
64 | - fv->Init(fv,cv,ts); | |
65 | - break; | |
66 | - case PROTO_YM: | |
67 | - fv->Init(fv,cv,ts); | |
68 | - break; | |
69 | - case PROTO_ZM: | |
70 | - fv->Init(fv,cv,ts); | |
71 | - break; | |
72 | - case PROTO_BP: | |
73 | - fv->Init(fv,cv,ts); | |
74 | - break; | |
75 | - case PROTO_QV: | |
76 | - fv->Init(fv,cv,ts); | |
77 | - break; | |
78 | - } | |
79 | -} | |
80 | -#endif | |
81 | - | |
82 | -BOOL _ProtoParse(int Proto, PFileVarProto fv, PComVar cv) | |
83 | -{ | |
84 | - BOOL Ok; | |
85 | - | |
86 | - Ok = FALSE; | |
87 | - switch (Proto) { | |
88 | - case PROTO_KMT: | |
89 | - Ok = fv->Parse(fv,cv); | |
90 | - break; | |
91 | - case PROTO_XM: | |
92 | - Ok = fv->Parse(fv, cv); | |
93 | - break; | |
94 | - case PROTO_YM: | |
95 | - Ok = fv->Parse(fv, cv); | |
96 | - break; | |
97 | - case PROTO_ZM: | |
98 | - Ok = fv->Parse(fv, cv); | |
99 | - break; | |
100 | - case PROTO_BP: | |
101 | - Ok = fv->Parse(fv, cv); | |
102 | - break; | |
103 | - case PROTO_QV: | |
104 | - Ok = fv->Parse(fv,cv); | |
105 | - break; | |
106 | - } | |
107 | - return Ok; | |
108 | -} | |
109 | - | |
110 | -void _ProtoTimeOutProc(int Proto, PFileVarProto fv, PComVar cv) | |
111 | -{ | |
112 | - switch (Proto) { | |
113 | - case PROTO_KMT: | |
114 | - fv->TimeOutProc(fv,cv); | |
115 | - break; | |
116 | - case PROTO_XM: | |
117 | - fv->TimeOutProc(fv,cv); | |
118 | - break; | |
119 | - case PROTO_YM: | |
120 | - fv->TimeOutProc(fv,cv); | |
121 | - break; | |
122 | - case PROTO_ZM: | |
123 | - fv->TimeOutProc(fv, cv); | |
124 | - break; | |
125 | - case PROTO_BP: | |
126 | - fv->TimeOutProc(fv, cv); | |
127 | - break; | |
128 | - case PROTO_QV: | |
129 | - fv->TimeOutProc(fv,cv); | |
130 | - break; | |
131 | - } | |
132 | -} | |
133 | - | |
134 | -BOOL _ProtoCancel(int Proto, PFileVarProto fv, PComVar cv) | |
135 | -{ | |
136 | - switch (Proto) { | |
137 | - case PROTO_KMT: | |
138 | - fv->Cancel(fv,cv); | |
139 | - break; | |
140 | - case PROTO_XM: | |
141 | - fv->Cancel(fv,cv); | |
142 | - break; | |
143 | - case PROTO_YM: | |
144 | - fv->Cancel(fv,cv); | |
145 | - break; | |
146 | - case PROTO_ZM: | |
147 | - fv->Cancel(fv, cv); | |
148 | - break; | |
149 | - case PROTO_BP: | |
150 | - fv->Cancel(fv, cv); | |
151 | - break; | |
152 | - case PROTO_QV: | |
153 | - fv->Cancel(fv,cv); | |
154 | - break; | |
155 | - } | |
156 | - return TRUE; | |
157 | -} | |
158 | - | |
159 | -int _ProtoSetOpt(PFileVarProto fv, int request, ...) | |
160 | -{ | |
161 | - va_list ap; | |
162 | - va_start(ap, request); | |
163 | - int r = fv->SetOptV(fv, request, ap); | |
164 | - va_end(ap); | |
165 | - return r; | |
166 | -} |