scfgxfr1.c 34 KB
Newer Older
rswindell's avatar
rswindell committed
1
2
/* scfgxfr1.c */

3
4
5
6
7
8
/* $Id$ */

/****************************************************************************
 * @format.tab-size 4		(Plain Text/Source Code File Header)			*
 * @format.use-tabs true	(see http://www.synchro.net/ptsc_hdr.html)		*
 *																			*
9
 * Copyright 2003 Rob Swindell - http://www.synchro.net/copyright.html		*
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 *																			*
 * This program is free software; you can redistribute it and/or			*
 * modify it under the terms of the GNU General Public License				*
 * as published by the Free Software Foundation; either version 2			*
 * of the License, or (at your option) any later version.					*
 * See the GNU General Public License for more details: gpl.txt or			*
 * http://www.fsf.org/copyleft/gpl.html										*
 *																			*
 * Anonymous FTP access to the most recent released source is available at	*
 * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net	*
 *																			*
 * Anonymous CVS access to the development source and modification history	*
 * is available at cvs.synchro.net:/cvsroot/sbbs, example:					*
 * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login			*
 *     (just hit return, no password is necessary)							*
 * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src		*
 *																			*
 * For Synchronet coding style and modification guidelines, see				*
 * http://www.synchro.net/source.html										*
 *																			*
 * You are encouraged to submit any modifications (preferably in Unix diff	*
 * format) via e-mail to mods@synchro.net									*
 *																			*
 * Note: If this box doesn't appear square, then you need to fix your tabs.	*
 ****************************************************************************/
rswindell's avatar
rswindell committed
35
36
37
38
39

#include "scfg.h"

void xfer_opts()
{
40
41
	char	str[128],done;
	int		i,j,l;
rswindell's avatar
rswindell committed
42
	static int xfr_dflt;
43
44
45
46
47
48
49
50
51
52
53
54
55
	static int fextr_dflt;
	static int fextr_opt;
	static int fview_dflt;
	static int fview_opt;
	static int ftest_dflt;
	static int ftest_opt;
	static int fcomp_dflt;
	static int fcomp_opt;
	static int prot_dflt;
	static int prot_opt;
	static int dlevent_dflt;
	static int dlevent_opt;
	static int altpath_dflt;
rswindell's avatar
rswindell committed
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
	static fextr_t savfextr;
	static fview_t savfview;
	static ftest_t savftest;
	static fcomp_t savfcomp;
	static prot_t savprot;
	static dlevent_t savdlevent;
	static char savaltpath[LEN_DIR+1];

while(1) {
	i=0;
	sprintf(opt[i++],"%-33.33s%uk","Min Bytes Free Disk Space"
		,cfg.min_dspace);
	sprintf(opt[i++],"%-33.33s%u","Max Files in Batch UL Queue"
		,cfg.max_batup);
	sprintf(opt[i++],"%-33.33s%u","Max Files in Batch DL Queue"
		,cfg.max_batdn);
	sprintf(opt[i++],"%-33.33s%u","Max Users in User Transfers"
		,cfg.max_userxfer);
	sprintf(opt[i++],"%-33.33s%u%%","Default Credit on Upload"
		,cfg.cdt_up_pct);
	sprintf(opt[i++],"%-33.33s%u%%","Default Credit on Download"
		,cfg.cdt_dn_pct);
	if(cfg.leech_pct)
		sprintf(str,"%u%% after %u seconds"
			,cfg.leech_pct,cfg.leech_sec);
	else
		strcpy(str,"Disabled");
83
84
    sprintf(opt[i++],"%-33.33s%s","Long Filenames in Listings"
        ,cfg.file_misc&FM_NO_LFN ? "No":"Yes");
rswindell's avatar
rswindell committed
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
	sprintf(opt[i++],"%-33.33s%s","Leech Protocol Detection",str);
	strcpy(opt[i++],"Viewable Files...");
	strcpy(opt[i++],"Testable Files...");
	strcpy(opt[i++],"Download Events...");
	strcpy(opt[i++],"Extractable Files...");
	strcpy(opt[i++],"Compressable Files...");
	strcpy(opt[i++],"Transfer Protocols...");
	strcpy(opt[i++],"Alternate File Paths...");
	opt[i][0]=0;
	SETHELP(WHERE);
/*
File Transfer Configuration:

This menu has options and sub-menus that pertain specifically to the
file transfer section of the BBS.
*/
101
	switch(uifc.list(WIN_ORG|WIN_ACT|WIN_CHE,0,0,72,&xfr_dflt,0
rswindell's avatar
rswindell committed
102
103
104
105
106
		,"File Transfer Configuration",opt)) {
		case -1:
			i=save_changes(WIN_MID);
			if(i==-1)
				break;
107
			if(!i) {
rswindell's avatar
rswindell committed
108
				write_file_cfg(&cfg,backup_level);
109
                refresh_cfg(&cfg);
110
            }
rswindell's avatar
rswindell committed
111
112
113
114
115
116
117
118
119
            return;
		case 0:
			SETHELP(WHERE);
/*
Minimum Kilobytes Free Disk Space to Allow Uploads:

This is the minimum free space in a file directory to allow user
uploads.
*/
120
			uifc.input(WIN_MID,0,0
rswindell's avatar
rswindell committed
121
				,"Minimum Kilobytes Free Disk Space to Allow Uploads"
122
				,ultoa(cfg.min_dspace,tmp,10),5,K_EDIT|K_NUMBER);
rswindell's avatar
rswindell committed
123
124
125
126
127
128
129
130
131
132
			cfg.min_dspace=atoi(tmp);
			break;
		case 1:
			SETHELP(WHERE);
/*
Maximum Files in Batch Upload Queue:

This is the maximum number of files that can be placed in the batch
upload queue.
*/
133
			uifc.input(WIN_MID,0,0,"Maximum Files in Batch Upload Queue"
134
				,ultoa(cfg.max_batup,tmp,10),5,K_EDIT|K_NUMBER);
rswindell's avatar
rswindell committed
135
136
137
138
139
140
141
142
143
144
			cfg.max_batup=atoi(tmp);
            break;
		case 2:
			SETHELP(WHERE);
/*
Maximum Files in Batch Download Queue:

This is the maximum number of files that can be placed in the batch
download queue.
*/
145
			uifc.input(WIN_MID,0,0,"Maximum Files in Batch Download Queue"
146
				,ultoa(cfg.max_batdn,tmp,10),5,K_EDIT|K_NUMBER);
rswindell's avatar
rswindell committed
147
148
149
150
151
152
153
154
155
156
			cfg.max_batdn=atoi(tmp);
            break;
		case 3:
			SETHELP(WHERE);
/*
Maximum Destination Users in User to User Transfer:

This is the maximum number of users allowed in the destination user list
of a user to user upload.
*/
157
			uifc.input(WIN_MID,0,0
rswindell's avatar
rswindell committed
158
				,"Maximum Destination Users in User to User Transfers"
159
				,ultoa(cfg.max_userxfer,tmp,10),5,K_EDIT|K_NUMBER);
rswindell's avatar
rswindell committed
160
161
162
163
164
165
166
167
168
169
			cfg.max_userxfer=atoi(tmp);
			break;
		case 4:
SETHELP(WHERE);
/*
Default Percentage of Credits to Credit Uploader on Upload:

This is the default setting that will be used when new file
directories are created.
*/
170
			uifc.input(WIN_MID,0,0
rswindell's avatar
rswindell committed
171
				,"Default Percentage of Credits to Credit Uploader on Upload"
172
				,ultoa(cfg.cdt_up_pct,tmp,10),4,K_EDIT|K_NUMBER);
rswindell's avatar
rswindell committed
173
174
175
176
177
178
179
180
181
182
			cfg.cdt_up_pct=atoi(tmp);
			break;
		case 5:
SETHELP(WHERE);
/*
Default Percentage of Credits to Credit Uploader on Download:

This is the default setting that will be used when new file
directories are created.
*/
183
			uifc.input(WIN_MID,0,0
rswindell's avatar
rswindell committed
184
				,"Default Percentage of Credits to Credit Uploader on Download"
185
				,ultoa(cfg.cdt_dn_pct,tmp,10),4,K_EDIT|K_NUMBER);
rswindell's avatar
rswindell committed
186
187
			cfg.cdt_dn_pct=atoi(tmp);
			break;
188
189
190
191
192
193
194
195
196
197
198
199
200
        case 6:
            strcpy(opt[0],"Yes");
            strcpy(opt[1],"No");
            opt[2][0]=0;
            i=0;
            SETHELP(WHERE);
/*
Long Filenames in File Listings:

If you want long filenames to be displayed in the BBS file listings, set
this option to Yes. Note: This feature requires Windows 98, Windows 2000
or later.
*/
201
            i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
202
203
204
                ,"Long Filenames in Listings (Win98/Win2K)",opt);
            if(!i && cfg.file_misc&FM_NO_LFN) {
                cfg.file_misc&=~FM_NO_LFN;
205
                uifc.changes=1;
206
207
            } else if(i==1 && !(cfg.file_misc&FM_NO_LFN)) {
                cfg.file_misc|=FM_NO_LFN;
208
                uifc.changes=1;
209
210
211
212
            }
            break;

		case 7:
rswindell's avatar
rswindell committed
213
214
215
216
217
218
219
220
221
222
223
			SETHELP(WHERE);
/*
Leech Protocol Detection Percentage:

This value is the sensitivity of the leech protocol detection feature of
Synchronet. If the transfer is apparently unsuccessful, but the transfer
time was at least this percentage of the estimated transfer time (based
on the estimated CPS of the connection result code), then a leech
protocol error is issued and the user's leech download counter is
incremented. Setting this value to 0 disables leech protocol detection.
*/
224
			uifc.input(WIN_MID|WIN_SAV,0,0
rswindell's avatar
rswindell committed
225
				,"Leech Protocol Detection Percentage (0=Disabled)"
226
				,ultoa(cfg.leech_pct,tmp,10),3,K_EDIT|K_NUMBER);
rswindell's avatar
rswindell committed
227
228
229
230
231
232
233
234
235
236
237
238
			cfg.leech_pct=atoi(tmp);
			if(!cfg.leech_pct)
				break;
			SETHELP(WHERE);
/*
Leech Protocol Minimum Time (in Seconds):

This option allows you to adjust the sensitivity of the leech protocol
detection feature. This value is the minimum length of transfer time
(in seconds) that must elapse before an aborted tranfser will be
considered a possible leech attempt.
*/
239
			uifc.input(WIN_MID,0,0
rswindell's avatar
rswindell committed
240
				,"Leech Protocol Minimum Time (in Seconds)"
241
				,ultoa(cfg.leech_sec,tmp,10),3,K_EDIT|K_NUMBER);
rswindell's avatar
rswindell committed
242
243
			cfg.leech_sec=atoi(tmp);
			break;
244
		case 8: 	/* Viewable file types */
rswindell's avatar
rswindell committed
245
246
247
248
249
250
			while(1) {
				for(i=0;i<cfg.total_fviews && i<MAX_OPTS;i++)
					sprintf(opt[i],"%-3.3s  %-40s",cfg.fview[i]->ext,cfg.fview[i]->cmd);
				opt[i][0]=0;
				i=WIN_ACT|WIN_SAV;	/* save cause size can change */
				if(cfg.total_fviews<MAX_OPTS)
251
					i|=WIN_INS|WIN_XTR;
rswindell's avatar
rswindell committed
252
253
254
255
256
257
258
259
260
261
262
263
				if(cfg.total_fviews)
					i|=WIN_DEL|WIN_GET;
				if(savfview.cmd[0])
					i|=WIN_PUT;
				SETHELP(WHERE);
/*
Viewable File Types:

This is a list of file types that have content information that can be
viewed through the execution of an external program. Here are a couple of
command line examples for a few file types.
*/
264
				i=uifc.list(i,0,0,50,&fview_dflt,NULL,"Viewable File Types",opt);
rswindell's avatar
rswindell committed
265
266
267
268
				if(i==-1)
					break;
				if((i&MSK_ON)==MSK_DEL) {
					i&=MSK_OFF;
deuce's avatar
deuce committed
269
					free(cfg.fview[i]);
rswindell's avatar
rswindell committed
270
271
272
273
					cfg.total_fviews--;
					while(i<cfg.total_fviews) {
						cfg.fview[i]=cfg.fview[i+1];
						i++; }
274
					uifc.changes=1;
rswindell's avatar
rswindell committed
275
276
277
					continue; }
				if((i&MSK_ON)==MSK_INS) {
					i&=MSK_OFF;
deuce's avatar
deuce committed
278
					if((cfg.fview=(fview_t **)realloc(cfg.fview
rswindell's avatar
rswindell committed
279
280
281
282
283
284
						,sizeof(fview_t *)*(cfg.total_fviews+1)))==NULL) {
						errormsg(WHERE,ERR_ALLOC,nulstr,cfg.total_fviews+1);
						cfg.total_fviews=0;
						bail(1);
						continue; }
					if(!cfg.total_fviews) {
deuce's avatar
deuce committed
285
						if((cfg.fview[0]=(fview_t *)malloc(
rswindell's avatar
rswindell committed
286
287
288
289
290
							sizeof(fview_t)))==NULL) {
							errormsg(WHERE,ERR_ALLOC,nulstr,sizeof(fview_t));
							continue; }
						memset(cfg.fview[0],0,sizeof(fview_t));
						strcpy(cfg.fview[0]->ext,"ZIP");
291
						strcpy(cfg.fview[0]->cmd,"%@unzip -vq %s"); }
rswindell's avatar
rswindell committed
292
293
294
					else {
						for(j=cfg.total_fviews;j>i;j--)
							cfg.fview[j]=cfg.fview[j-1];
deuce's avatar
deuce committed
295
						if((cfg.fview[i]=(fview_t *)malloc(
rswindell's avatar
rswindell committed
296
297
298
							sizeof(fview_t)))==NULL) {
							errormsg(WHERE,ERR_ALLOC,nulstr,sizeof(fview_t));
							continue; }
299
300
301
302
303
						if(i>=cfg.total_fviews)
							j=i-1;
						else
							j=i+1;
						*cfg.fview[i]=*cfg.fview[j]; }
rswindell's avatar
rswindell committed
304
					cfg.total_fviews++;
305
					uifc.changes=1;
rswindell's avatar
rswindell committed
306
307
308
309
310
311
312
313
					continue; }
				if((i&MSK_ON)==MSK_GET) {
					i&=MSK_OFF;
					savfview=*cfg.fview[i];
					continue; }
				if((i&MSK_ON)==MSK_PUT) {
					i&=MSK_OFF;
					*cfg.fview[i]=savfview;
314
					uifc.changes=1;
rswindell's avatar
rswindell committed
315
316
317
318
319
320
321
322
323
324
325
					continue; }
				done=0;
				while(!done) {
					j=0;
					sprintf(opt[j++],"%-22.22s%s","File Extension"
						,cfg.fview[i]->ext);
					sprintf(opt[j++],"%-22.22s%-40s","Command Line"
						,cfg.fview[i]->cmd);
					sprintf(opt[j++],"%-22.22s%s","Access Requirements"
						,cfg.fview[i]->arstr);
					opt[j][0]=0;
326
					switch(uifc.list(WIN_RHT|WIN_BOT|WIN_SAV|WIN_ACT,0,0,0,&fview_opt,0
rswindell's avatar
rswindell committed
327
328
329
330
331
						,"Viewable File Type",opt)) {
						case -1:
							done=1;
							break;
						case 0:
332
							uifc.input(WIN_MID|WIN_SAV,0,0
rswindell's avatar
rswindell committed
333
								,"Viewable File Type Extension"
334
								,cfg.fview[i]->ext,sizeof(cfg.fview[i]->ext)-1,K_EDIT);
rswindell's avatar
rswindell committed
335
336
							break;
						case 1:
337
							uifc.input(WIN_MID|WIN_SAV,0,0
338
339
								,"Command"
								,cfg.fview[i]->cmd,sizeof(cfg.fview[i]->cmd)-1,K_EDIT);
rswindell's avatar
rswindell committed
340
341
342
343
344
345
346
							break;
						case 2:
							sprintf(str,"Viewable File Type %s"
								,cfg.fview[i]->ext);
							getar(str,cfg.fview[i]->arstr);
                            break; } } }
            break;
347
		case 9:    /* Testable file types */
rswindell's avatar
rswindell committed
348
349
350
351
352
353
			while(1) {
				for(i=0;i<cfg.total_ftests && i<MAX_OPTS;i++)
					sprintf(opt[i],"%-3.3s  %-40s",cfg.ftest[i]->ext,cfg.ftest[i]->cmd);
				opt[i][0]=0;
				i=WIN_ACT|WIN_SAV;	/* save cause size can change */
				if(cfg.total_ftests<MAX_OPTS)
354
					i|=WIN_INS|WIN_XTR;
rswindell's avatar
rswindell committed
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
				if(cfg.total_ftests)
					i|=WIN_DEL|WIN_GET;
				if(savftest.cmd[0])
					i|=WIN_PUT;
				SETHELP(WHERE);
/*
Testable File Types:

This is a list of file types that will have a command line executed to
test the file integrity upon their upload. The file types are specified
by extension and if one file extension is listed more than once, each
command line will be executed. The command lines must return a DOS error
code of 0 (no error) in order for the file to pass the test. This method
of file testing upon upload is also known as an upload event. This test
or event, can do more than just test the file, it can perform any
function that the sysop wishes. Such as adding comments to an archived
file, or extracting an archive and performing a virus scan. While the
external program is executing, a text string is displayed to the user.
This working string can be set for each file type and command line
listed.
*/
376
				i=uifc.list(i,0,0,50,&ftest_dflt,NULL,"Testable File Types",opt);
rswindell's avatar
rswindell committed
377
378
379
380
				if(i==-1)
					break;
				if((i&MSK_ON)==MSK_DEL) {
					i&=MSK_OFF;
deuce's avatar
deuce committed
381
					free(cfg.ftest[i]);
rswindell's avatar
rswindell committed
382
383
384
385
					cfg.total_ftests--;
					while(i<cfg.total_ftests) {
						cfg.ftest[i]=cfg.ftest[i+1];
						i++; }
386
					uifc.changes=1;
rswindell's avatar
rswindell committed
387
388
389
					continue; }
				if((i&MSK_ON)==MSK_INS) {
					i&=MSK_OFF;
deuce's avatar
deuce committed
390
					if((cfg.ftest=(ftest_t **)realloc(cfg.ftest
rswindell's avatar
rswindell committed
391
392
393
394
395
396
						,sizeof(ftest_t *)*(cfg.total_ftests+1)))==NULL) {
						errormsg(WHERE,ERR_ALLOC,nulstr,cfg.total_ftests+1);
						cfg.total_ftests=0;
						bail(1);
						continue; }
					if(!cfg.total_ftests) {
deuce's avatar
deuce committed
397
						if((cfg.ftest[0]=(ftest_t *)malloc(
rswindell's avatar
rswindell committed
398
399
400
401
402
							sizeof(ftest_t)))==NULL) {
							errormsg(WHERE,ERR_ALLOC,nulstr,sizeof(ftest_t));
							continue; }
						memset(cfg.ftest[0],0,sizeof(ftest_t));
						strcpy(cfg.ftest[0]->ext,"ZIP");
403
						strcpy(cfg.ftest[0]->cmd,"%@unzip -tqq %f");
rswindell's avatar
rswindell committed
404
405
406
407
408
						strcpy(cfg.ftest[0]->workstr,"Testing ZIP Integrity..."); }
					else {

						for(j=cfg.total_ftests;j>i;j--)
							cfg.ftest[j]=cfg.ftest[j-1];
deuce's avatar
deuce committed
409
						if((cfg.ftest[i]=(ftest_t *)malloc(
rswindell's avatar
rswindell committed
410
411
412
							sizeof(ftest_t)))==NULL) {
							errormsg(WHERE,ERR_ALLOC,nulstr,sizeof(ftest_t));
							continue; }
413
414
415
416
417
						if(i>=cfg.total_ftests)
							j=i-1;
						else
							j=i+1;
						*cfg.ftest[i]=*cfg.ftest[j]; }
rswindell's avatar
rswindell committed
418
					cfg.total_ftests++;
419
					uifc.changes=1;
rswindell's avatar
rswindell committed
420
421
422
423
424
425
426
427
					continue; }
				if((i&MSK_ON)==MSK_GET) {
					i&=MSK_OFF;
					savftest=*cfg.ftest[i];
					continue; }
				if((i&MSK_ON)==MSK_PUT) {
					i&=MSK_OFF;
					*cfg.ftest[i]=savftest;
428
					uifc.changes=1;
rswindell's avatar
rswindell committed
429
430
431
432
433
434
435
436
437
438
439
440
441
					continue; }
				done=0;
				while(!done) {
					j=0;
					sprintf(opt[j++],"%-22.22s%s","File Extension"
						,cfg.ftest[i]->ext);
					sprintf(opt[j++],"%-22.22s%-40s","Command Line"
						,cfg.ftest[i]->cmd);
					sprintf(opt[j++],"%-22.22s%s","Working String"
						,cfg.ftest[i]->workstr);
					sprintf(opt[j++],"%-22.22s%s","Access Requirements"
						,cfg.ftest[i]->arstr);
					opt[j][0]=0;
442
					switch(uifc.list(WIN_RHT|WIN_BOT|WIN_SAV|WIN_ACT,0,0,0,&ftest_opt,0
rswindell's avatar
rswindell committed
443
444
445
446
447
						,"Testable File Type",opt)) {
						case -1:
							done=1;
							break;
						case 0:
448
							uifc.input(WIN_MID|WIN_SAV,0,0
rswindell's avatar
rswindell committed
449
								,"Testable File Type Extension"
450
								,cfg.ftest[i]->ext,sizeof(cfg.ftest[i]->ext)-1,K_EDIT);
rswindell's avatar
rswindell committed
451
452
							break;
						case 1:
453
							uifc.input(WIN_MID|WIN_SAV,0,0
454
455
								,"Command"
								,cfg.ftest[i]->cmd,sizeof(cfg.ftest[i]->cmd)-1,K_EDIT);
rswindell's avatar
rswindell committed
456
457
							break;
						case 2:
458
							uifc.input(WIN_MID|WIN_SAV,0,0
rswindell's avatar
rswindell committed
459
								,"Working String"
460
								,cfg.ftest[i]->workstr,sizeof(cfg.ftest[i]->workstr)-1,K_EDIT|K_MSG);
rswindell's avatar
rswindell committed
461
462
463
464
465
466
							break;
						case 3:
							sprintf(str,"Testable File Type %s",cfg.ftest[i]->ext);
							getar(str,cfg.ftest[i]->arstr);
							break; } } }
			break;
467
		case 10:    /* Download Events */
rswindell's avatar
rswindell committed
468
469
470
471
472
473
			while(1) {
				for(i=0;i<cfg.total_dlevents && i<MAX_OPTS;i++)
					sprintf(opt[i],"%-3.3s  %-40s",cfg.dlevent[i]->ext,cfg.dlevent[i]->cmd);
				opt[i][0]=0;
				i=WIN_ACT|WIN_SAV;	/* save cause size can change */
				if(cfg.total_dlevents<MAX_OPTS)
474
					i|=WIN_INS|WIN_XTR;
rswindell's avatar
rswindell committed
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
				if(cfg.total_dlevents)
					i|=WIN_DEL|WIN_GET;
				if(savdlevent.cmd[0])
					i|=WIN_PUT;
				SETHELP(WHERE);
/*
Download Events:

This is a list of file types that will have a command line executed to
perform an event upon their download (e.g. trigger a download event).
The file types are specified by extension and if one file extension
is listed more than once, each command line will be executed. The
command lines must return a DOS error code of 0 (no error) in order
for the file to pass the test. This test or event, can do more than
just test the file, it can perform any function that the sysop wishes.
Such as adding comments to an archived file, or extracting an archive
and performing a virus scan. While the external program is executing,
a text string is displayed to the user. This working string can be set
for each file type and command line listed.
*/
495
				i=uifc.list(i,0,0,50,&dlevent_dflt,NULL,"Download Events",opt);
rswindell's avatar
rswindell committed
496
497
498
499
				if(i==-1)
					break;
				if((i&MSK_ON)==MSK_DEL) {
					i&=MSK_OFF;
deuce's avatar
deuce committed
500
					free(cfg.dlevent[i]);
rswindell's avatar
rswindell committed
501
502
503
504
					cfg.total_dlevents--;
					while(i<cfg.total_dlevents) {
						cfg.dlevent[i]=cfg.dlevent[i+1];
						i++; }
505
					uifc.changes=1;
rswindell's avatar
rswindell committed
506
507
508
					continue; }
				if((i&MSK_ON)==MSK_INS) {
					i&=MSK_OFF;
deuce's avatar
deuce committed
509
					if((cfg.dlevent=(dlevent_t **)realloc(cfg.dlevent
rswindell's avatar
rswindell committed
510
511
512
513
514
515
						,sizeof(dlevent_t *)*(cfg.total_dlevents+1)))==NULL) {
						errormsg(WHERE,ERR_ALLOC,nulstr,cfg.total_dlevents+1);
						cfg.total_dlevents=0;
						bail(1);
						continue; }
					if(!cfg.total_dlevents) {
deuce's avatar
deuce committed
516
						if((cfg.dlevent[0]=(dlevent_t *)malloc(
rswindell's avatar
rswindell committed
517
518
519
520
521
							sizeof(dlevent_t)))==NULL) {
							errormsg(WHERE,ERR_ALLOC,nulstr,sizeof(dlevent_t));
							continue; }
						memset(cfg.dlevent[0],0,sizeof(dlevent_t));
						strcpy(cfg.dlevent[0]->ext,"ZIP");
522
						strcpy(cfg.dlevent[0]->cmd,"%@zip -z %f < %zzipmsg.txt");
rswindell's avatar
rswindell committed
523
524
525
526
527
						strcpy(cfg.dlevent[0]->workstr,"Adding ZIP Comment..."); }
					else {

						for(j=cfg.total_dlevents;j>i;j--)
							cfg.dlevent[j]=cfg.dlevent[j-1];
deuce's avatar
deuce committed
528
						if((cfg.dlevent[i]=(dlevent_t *)malloc(
rswindell's avatar
rswindell committed
529
530
531
							sizeof(dlevent_t)))==NULL) {
							errormsg(WHERE,ERR_ALLOC,nulstr,sizeof(dlevent_t));
							continue; }
532
533
534
535
536
						if(i>=cfg.total_dlevents)
							j=i-1;
						else
							j=i+1;
						*cfg.dlevent[i]=*cfg.dlevent[j]; }
rswindell's avatar
rswindell committed
537
					cfg.total_dlevents++;
538
					uifc.changes=1;
rswindell's avatar
rswindell committed
539
540
541
542
543
544
545
546
					continue; }
				if((i&MSK_ON)==MSK_GET) {
					i&=MSK_OFF;
					savdlevent=*cfg.dlevent[i];
					continue; }
				if((i&MSK_ON)==MSK_PUT) {
					i&=MSK_OFF;
					*cfg.dlevent[i]=savdlevent;
547
					uifc.changes=1;
rswindell's avatar
rswindell committed
548
549
550
551
552
553
554
555
556
557
558
559
560
					continue; }
				done=0;
				while(!done) {
					j=0;
					sprintf(opt[j++],"%-22.22s%s","File Extension"
						,cfg.dlevent[i]->ext);
					sprintf(opt[j++],"%-22.22s%-40s","Command Line"
						,cfg.dlevent[i]->cmd);
					sprintf(opt[j++],"%-22.22s%s","Working String"
						,cfg.dlevent[i]->workstr);
					sprintf(opt[j++],"%-22.22s%s","Access Requirements"
						,cfg.dlevent[i]->arstr);
					opt[j][0]=0;
561
					switch(uifc.list(WIN_RHT|WIN_BOT|WIN_SAV|WIN_ACT,0,0,0,&dlevent_opt,0
rswindell's avatar
rswindell committed
562
563
564
565
566
						,"Download Event",opt)) {
						case -1:
							done=1;
							break;
						case 0:
567
							uifc.input(WIN_MID|WIN_SAV,0,0
rswindell's avatar
rswindell committed
568
								,"Download Event Extension"
569
								,cfg.dlevent[i]->ext,sizeof(cfg.dlevent[i]->ext)-1,K_EDIT);
rswindell's avatar
rswindell committed
570
571
							break;
						case 1:
572
							uifc.input(WIN_MID|WIN_SAV,0,0
573
574
								,"Command"
								,cfg.dlevent[i]->cmd,sizeof(cfg.dlevent[i]->cmd)-1,K_EDIT);
rswindell's avatar
rswindell committed
575
576
							break;
						case 2:
577
							uifc.input(WIN_MID|WIN_SAV,0,0
rswindell's avatar
rswindell committed
578
								,"Working String"
579
								,cfg.dlevent[i]->workstr,sizeof(cfg.dlevent[i]->workstr)-1,K_EDIT|K_MSG);
rswindell's avatar
rswindell committed
580
581
582
583
584
585
							break;
						case 3:
							sprintf(str,"Download Event %s",cfg.dlevent[i]->ext);
							getar(str,cfg.dlevent[i]->arstr);
							break; } } }
            break;
586
		case 11:	 /* Extractable file types */
rswindell's avatar
rswindell committed
587
588
589
590
591
592
593
            while(1) {
				for(i=0;i<cfg.total_fextrs && i<MAX_OPTS;i++)
                    sprintf(opt[i],"%-3.3s  %-40s"
                        ,cfg.fextr[i]->ext,cfg.fextr[i]->cmd);
				opt[i][0]=0;
                i=WIN_ACT|WIN_SAV;  /* save cause size can change */
				if(cfg.total_fextrs<MAX_OPTS)
594
                    i|=WIN_INS|WIN_XTR;
rswindell's avatar
rswindell committed
595
596
597
598
599
600
601
602
603
604
605
606
607
                if(cfg.total_fextrs)
                    i|=WIN_DEL|WIN_GET;
				if(savfextr.cmd[0])
                    i|=WIN_PUT;
                SETHELP(WHERE);
/*
Extractable File Types:

This is a list of archive file types that can be extracted to the temp
directory by an external program. The file types are specified by their
extension. For each file type you must specify the command line used to
extract the file(s).
*/
608
				i=uifc.list(i,0,0,50,&fextr_dflt,NULL,"Extractable File Types",opt);
rswindell's avatar
rswindell committed
609
610
611
612
                if(i==-1)
                    break;
				if((i&MSK_ON)==MSK_DEL) {
					i&=MSK_OFF;
deuce's avatar
deuce committed
613
                    free(cfg.fextr[i]);
rswindell's avatar
rswindell committed
614
615
616
617
                    cfg.total_fextrs--;
                    while(i<cfg.total_fextrs) {
                        cfg.fextr[i]=cfg.fextr[i+1];
                        i++; }
618
                    uifc.changes=1;
rswindell's avatar
rswindell committed
619
620
621
                    continue; }
				if((i&MSK_ON)==MSK_INS) {
					i&=MSK_OFF;
deuce's avatar
deuce committed
622
					if((cfg.fextr=(fextr_t **)realloc(cfg.fextr
rswindell's avatar
rswindell committed
623
624
625
626
627
628
						,sizeof(fextr_t *)*(cfg.total_fextrs+1)))==NULL) {
						errormsg(WHERE,ERR_ALLOC,nulstr,cfg.total_fextrs+1);
						cfg.total_fextrs=0;
						bail(1);
						continue; }
                    if(!cfg.total_fextrs) {
deuce's avatar
deuce committed
629
                        if((cfg.fextr[0]=(fextr_t *)malloc(
rswindell's avatar
rswindell committed
630
631
632
633
634
                            sizeof(fextr_t)))==NULL) {
                            errormsg(WHERE,ERR_ALLOC,nulstr,sizeof(fextr_t));
                            continue; }
						memset(cfg.fextr[0],0,sizeof(fextr_t));
                        strcpy(cfg.fextr[0]->ext,"ZIP");
635
                        strcpy(cfg.fextr[0]->cmd,"%@unzip -Cojqq %f %s -d %g"); }
rswindell's avatar
rswindell committed
636
637
638
639
                    else {

                        for(j=cfg.total_fextrs;j>i;j--)
                            cfg.fextr[j]=cfg.fextr[j-1];
deuce's avatar
deuce committed
640
                        if((cfg.fextr[i]=(fextr_t *)malloc(
rswindell's avatar
rswindell committed
641
642
643
                            sizeof(fextr_t)))==NULL) {
                            errormsg(WHERE,ERR_ALLOC,nulstr,sizeof(fextr_t));
                            continue; }
644
645
646
647
648
						if(i>=cfg.total_fextrs)
							j=i-1;
						else
							j=i+1;
                        *cfg.fextr[i]=*cfg.fextr[j]; }
rswindell's avatar
rswindell committed
649
                    cfg.total_fextrs++;
650
                    uifc.changes=1;
rswindell's avatar
rswindell committed
651
652
653
654
655
656
657
658
                    continue; }
				if((i&MSK_ON)==MSK_GET) {
					i&=MSK_OFF;
                    savfextr=*cfg.fextr[i];
                    continue; }
				if((i&MSK_ON)==MSK_PUT) {
					i&=MSK_OFF;
                    *cfg.fextr[i]=savfextr;
659
                    uifc.changes=1;
rswindell's avatar
rswindell committed
660
661
662
663
664
665
666
667
668
669
670
                    continue; }
				done=0;
				while(!done) {
					j=0;
					sprintf(opt[j++],"%-22.22s%s","File Extension"
						,cfg.fextr[i]->ext);
					sprintf(opt[j++],"%-22.22s%-40s","Command Line"
						,cfg.fextr[i]->cmd);
					sprintf(opt[j++],"%-22.22s%s","Access Requirements"
						,cfg.fextr[i]->arstr);
					opt[j][0]=0;
671
					switch(uifc.list(WIN_RHT|WIN_BOT|WIN_SAV|WIN_ACT,0,0,0,&fextr_opt,0
rswindell's avatar
rswindell committed
672
673
674
675
676
						,"Extractable File Type",opt)) {
						case -1:
							done=1;
							break;
						case 0:
677
							uifc.input(WIN_MID|WIN_SAV,0,0
rswindell's avatar
rswindell committed
678
								,"Extractable File Type Extension"
679
								,cfg.fextr[i]->ext,sizeof(cfg.fextr[i]->ext)-1,K_EDIT);
rswindell's avatar
rswindell committed
680
681
							break;
						case 1:
682
							uifc.input(WIN_MID|WIN_SAV,0,0
683
684
								,"Command"
								,cfg.fextr[i]->cmd,sizeof(cfg.fextr[i]->cmd)-1,K_EDIT);
rswindell's avatar
rswindell committed
685
686
687
688
689
690
691
							break;
						case 2:
							sprintf(str,"Extractable File Type %s"
								,cfg.fextr[i]->ext);
							getar(str,cfg.fextr[i]->arstr);
                            break; } } }
            break;
692
		case 12:	 /* Compressable file types */
rswindell's avatar
rswindell committed
693
694
695
696
697
698
			while(1) {
				for(i=0;i<cfg.total_fcomps && i<MAX_OPTS;i++)
					sprintf(opt[i],"%-3.3s  %-40s",cfg.fcomp[i]->ext,cfg.fcomp[i]->cmd);
				opt[i][0]=0;
				i=WIN_ACT|WIN_SAV;	/* save cause size can change */
				if(cfg.total_fcomps<MAX_OPTS)
699
					i|=WIN_INS|WIN_XTR;
rswindell's avatar
rswindell committed
700
701
702
703
704
705
706
707
708
709
710
711
				if(cfg.total_fcomps)
					i|=WIN_DEL|WIN_GET;
				if(savfcomp.cmd[0])
					i|=WIN_PUT;
				SETHELP(WHERE);
/*
Compressable File Types:

This is a list of compression methods available for different file types.
These will be used for items such as creating QWK packets, temporary
files from the transfer section, and more.
*/
712
				i=uifc.list(i,0,0,50,&fcomp_dflt,NULL,"Compressable File Types",opt);
rswindell's avatar
rswindell committed
713
714
715
716
				if(i==-1)
					break;
				if((i&MSK_ON)==MSK_DEL) {
					i&=MSK_OFF;
deuce's avatar
deuce committed
717
					free(cfg.fcomp[i]);
rswindell's avatar
rswindell committed
718
719
720
721
					cfg.total_fcomps--;
					while(i<cfg.total_fcomps) {
						cfg.fcomp[i]=cfg.fcomp[i+1];
						i++; }
722
					uifc.changes=1;
rswindell's avatar
rswindell committed
723
724
725
					continue; }
				if((i&MSK_ON)==MSK_INS) {
					i&=MSK_OFF;
deuce's avatar
deuce committed
726
					if((cfg.fcomp=(fcomp_t **)realloc(cfg.fcomp
rswindell's avatar
rswindell committed
727
728
729
730
731
732
						,sizeof(fcomp_t *)*(cfg.total_fcomps+1)))==NULL) {
						errormsg(WHERE,ERR_ALLOC,nulstr,cfg.total_fcomps+1);
						cfg.total_fcomps=0;
						bail(1);
						continue; }
					if(!cfg.total_fcomps) {
deuce's avatar
deuce committed
733
						if((cfg.fcomp[0]=(fcomp_t *)malloc(
rswindell's avatar
rswindell committed
734
735
736
737
738
							sizeof(fcomp_t)))==NULL) {
							errormsg(WHERE,ERR_ALLOC,nulstr,sizeof(fcomp_t));
							continue; }
						memset(cfg.fcomp[0],0,sizeof(fcomp_t));
						strcpy(cfg.fcomp[0]->ext,"ZIP");
739
						strcpy(cfg.fcomp[0]->cmd,"%@zip -jD %f %s"); }
rswindell's avatar
rswindell committed
740
741
742
					else {
						for(j=cfg.total_fcomps;j>i;j--)
							cfg.fcomp[j]=cfg.fcomp[j-1];
deuce's avatar
deuce committed
743
						if((cfg.fcomp[i]=(fcomp_t *)malloc(
rswindell's avatar
rswindell committed
744
745
746
							sizeof(fcomp_t)))==NULL) {
							errormsg(WHERE,ERR_ALLOC,nulstr,sizeof(fcomp_t));
							continue; }
747
748
749
750
751
						if(i>=cfg.total_fcomps)
							j=i-1;
						else
							j=i+1;
						*cfg.fcomp[i]=*cfg.fcomp[j]; }
rswindell's avatar
rswindell committed
752
					cfg.total_fcomps++;
753
					uifc.changes=1;
rswindell's avatar
rswindell committed
754
755
756
757
758
759
760
761
					continue; }
				if((i&MSK_ON)==MSK_GET) {
					i&=MSK_OFF;
					savfcomp=*cfg.fcomp[i];
					continue; }
				if((i&MSK_ON)==MSK_PUT) {
					i&=MSK_OFF;
					*cfg.fcomp[i]=savfcomp;
762
					uifc.changes=1;
rswindell's avatar
rswindell committed
763
764
765
766
767
768
769
770
771
772
773
					continue; }
				done=0;
				while(!done) {
					j=0;
					sprintf(opt[j++],"%-22.22s%s","File Extension"
						,cfg.fcomp[i]->ext);
					sprintf(opt[j++],"%-22.22s%-40s","Command Line"
						,cfg.fcomp[i]->cmd);
					sprintf(opt[j++],"%-22.22s%s","Access Requirements"
						,cfg.fcomp[i]->arstr);
					opt[j][0]=0;
774
					switch(uifc.list(WIN_RHT|WIN_BOT|WIN_SAV|WIN_ACT,0,0,0,&fcomp_opt,0
rswindell's avatar
rswindell committed
775
776
777
778
779
						,"Compressable File Type",opt)) {
						case -1:
							done=1;
							break;
						case 0:
780
							uifc.input(WIN_MID|WIN_SAV,0,0
rswindell's avatar
rswindell committed
781
								,"Compressable File Type Extension"
782
								,cfg.fcomp[i]->ext,sizeof(cfg.fcomp[i]->ext)-1,K_EDIT);
rswindell's avatar
rswindell committed
783
784
							break;
						case 1:
785
							uifc.input(WIN_MID|WIN_SAV,0,0
786
787
								,"Command"
								,cfg.fcomp[i]->cmd,sizeof(cfg.fcomp[i]->cmd)-1,K_EDIT);
rswindell's avatar
rswindell committed
788
789
790
791
792
793
794
							break;
						case 2:
							sprintf(str,"Compressable File Type %s"
								,cfg.fcomp[i]->ext);
							getar(str,cfg.fcomp[i]->arstr);
                            break; } } }
            break;
795
		case 13:	/* Transfer protocols */
rswindell's avatar
rswindell committed
796
797
			while(1) {
				for(i=0;i<cfg.total_prots && i<MAX_OPTS;i++)
798
799
					sprintf(opt[i],"%c  %s"
						,cfg.prot[i]->mnemonic,cfg.prot[i]->name);
rswindell's avatar
rswindell committed
800
801
802
				opt[i][0]=0;
				i=WIN_ACT|WIN_SAV;	/* save cause size can change */
				if(cfg.total_prots<MAX_OPTS)
803
					i|=WIN_INS|WIN_XTR;
rswindell's avatar
rswindell committed
804
805
806
807
808
809
810
811
812
813
814
815
				if(cfg.total_prots)
					i|=WIN_DEL|WIN_GET;
				if(savprot.mnemonic)
					i|=WIN_PUT;
				SETHELP(WHERE);
/*
File Transfer Protocols:

This is a list of file transfer protocols that can be used to transfer
files either to or from a remote user. For each protocol, you can
specify the mnemonic (hot-key) to use to specify that protocol, the
command line to use for uploads, downloads, batch uploads, batch
816
817
818
819
820
821
downloads, bi-directional file transfers, support of DSZLOG, and (for
*nix only) if it uses socket I/O or the more common stdio.

If the protocol doesn't support a certain method of transfer, or you
don't wish it to be available for a certain method of transfer, leave
the command line for that method blank.
rswindell's avatar
rswindell committed
822
*/
823
				i=uifc.list(i,0,0,50,&prot_dflt,NULL,"File Transfer Protocols",opt);
rswindell's avatar
rswindell committed
824
825
826
827
				if(i==-1)
					break;
				if((i&MSK_ON)==MSK_DEL) {
					i&=MSK_OFF;
deuce's avatar
deuce committed
828
					free(cfg.prot[i]);
rswindell's avatar
rswindell committed
829
830
831
832
					cfg.total_prots--;
					while(i<cfg.total_prots) {
						cfg.prot[i]=cfg.prot[i+1];
						i++; }
833
					uifc.changes=1;
rswindell's avatar
rswindell committed
834
835
836
					continue; }
				if((i&MSK_ON)==MSK_INS) {
					i&=MSK_OFF;
deuce's avatar
deuce committed
837
					if((cfg.prot=(prot_t **)realloc(cfg.prot
rswindell's avatar
rswindell committed
838
839
840
841
842
843
						,sizeof(prot_t *)*(cfg.total_prots+1)))==NULL) {
						errormsg(WHERE,ERR_ALLOC,nulstr,cfg.total_prots+1);
						cfg.total_prots=0;
						bail(1);
						continue; }
					if(!cfg.total_prots) {
deuce's avatar
deuce committed
844
						if((cfg.prot[0]=(prot_t *)malloc(
rswindell's avatar
rswindell committed
845
846
847
848
							sizeof(prot_t)))==NULL) {
							errormsg(WHERE,ERR_ALLOC,nulstr,sizeof(prot_t));
							continue; }
						memset(cfg.prot[0],0,sizeof(prot_t));
849
850
						cfg.prot[0]->mnemonic='?';
					} else {
rswindell's avatar
rswindell committed
851
852
						for(j=cfg.total_prots;j>i;j--)
							cfg.prot[j]=cfg.prot[j-1];
deuce's avatar
deuce committed
853
						if((cfg.prot[i]=(prot_t *)malloc(
rswindell's avatar
rswindell committed
854
855
856
							sizeof(prot_t)))==NULL) {
							errormsg(WHERE,ERR_ALLOC,nulstr,sizeof(prot_t));
							continue; }
857
858
859
860
861
						if(i>=cfg.total_prots)
							j=i-1;
						else
							j=i+1;
						*cfg.prot[i]=*cfg.prot[j]; }
rswindell's avatar
rswindell committed
862
					cfg.total_prots++;
863
					uifc.changes=1;
rswindell's avatar
rswindell committed
864
865
866
867
868
869
870
871
					continue; }
				if((i&MSK_ON)==MSK_GET) {
					i&=MSK_OFF;
					savprot=*cfg.prot[i];
					continue; }
				if((i&MSK_ON)==MSK_PUT) {
					i&=MSK_OFF;
					*cfg.prot[i]=savprot;
872
					uifc.changes=1;
rswindell's avatar
rswindell committed
873
874
875
876
					continue; }
				done=0;
				while(!done) {
					j=0;
877
					sprintf(opt[j++],"%-30.30s%c","Mnemonic (Command Key)"
rswindell's avatar
rswindell committed
878
						,cfg.prot[i]->mnemonic);
879
					sprintf(opt[j++],"%-30.30s%-40s","Protocol Name"
rswindell's avatar
rswindell committed
880
						,cfg.prot[i]->name);
881
					sprintf(opt[j++],"%-30.30s%-40s","Access Requirements"
rswindell's avatar
rswindell committed
882
						,cfg.prot[i]->arstr);
883
					sprintf(opt[j++],"%-30.30s%-40s","Upload Command Line"
rswindell's avatar
rswindell committed
884
						,cfg.prot[i]->ulcmd);
885
					sprintf(opt[j++],"%-30.30s%-40s","Download Command Line"
rswindell's avatar
rswindell committed
886
						,cfg.prot[i]->dlcmd);
887
					sprintf(opt[j++],"%-30.30s%-40s","Batch Upload Command Line"
rswindell's avatar
rswindell committed
888
						,cfg.prot[i]->batulcmd);
889
					sprintf(opt[j++],"%-30.30s%-40s","Batch Download Command Line"
rswindell's avatar
rswindell committed
890
						,cfg.prot[i]->batdlcmd);
891
					sprintf(opt[j++],"%-30.30s%-40s","Bi-dir Command Line"
rswindell's avatar
rswindell committed
892
						,cfg.prot[i]->bicmd);
893
894
895
					sprintf(opt[j++],"%-30.30s%s",   "Native (32-bit) Executable"
						,cfg.prot[i]->misc&PROT_NATIVE ? "Yes" : "No");
					sprintf(opt[j++],"%-30.30s%s",	 "Supports DSZLOG"
rswindell's avatar
rswindell committed
896
						,cfg.prot[i]->misc&PROT_DSZLOG ? "Yes":"No");
897
898
					sprintf(opt[j++],"%-30.30s%s",	 "Socket I/O"
						,cfg.prot[i]->misc&PROT_SOCKET ? "Yes":"No");
rswindell's avatar
rswindell committed
899
					opt[j][0]=0;
900
					switch(uifc.list(WIN_RHT|WIN_BOT|WIN_SAV|WIN_ACT,0,0,70,&prot_opt,0
rswindell's avatar
rswindell committed
901
902
903
904
905
906
907
						,"File Transfer Protocol",opt)) {
						case -1:
							done=1;
							break;
						case 0:
							str[0]=cfg.prot[i]->mnemonic;
							str[1]=0;
908
							uifc.input(WIN_MID|WIN_SAV,0,0
rswindell's avatar
rswindell committed
909
910
911
912
913
914
								,"Mnemonic (Command Key)"
								,str,1,K_UPPER|K_EDIT);
							if(str[0])
								cfg.prot[i]->mnemonic=str[0];
							break;
						case 1:
915
							uifc.input(WIN_MID|WIN_SAV,0,0
rswindell's avatar
rswindell committed
916
								,"Protocol Name"
917
								,cfg.prot[i]->name,sizeof(cfg.prot[i]->name)-1,K_EDIT);
rswindell's avatar
rswindell committed
918
919
920
921
922
923
                            break;
						case 2:
							sprintf(str,"Protocol %s",cfg.prot[i]->name);
							getar(str,cfg.prot[i]->arstr);
							break;
						case 3:
924
							uifc.input(WIN_MID|WIN_SAV,0,0
925
926
								,"Command"
								,cfg.prot[i]->ulcmd,sizeof(cfg.prot[i]->ulcmd)-1,K_EDIT);
rswindell's avatar
rswindell committed
927
928
							break;
						case 4:
929
							uifc.input(WIN_MID|WIN_SAV,0,0
930
931
								,"Command"
								,cfg.prot[i]->dlcmd,sizeof(cfg.prot[i]->dlcmd)-1,K_EDIT);
rswindell's avatar
rswindell committed
932
933
                            break;
						case 5:
934
							uifc.input(WIN_MID|WIN_SAV,0,0
935
936
								,"Command"
								,cfg.prot[i]->batulcmd,sizeof(cfg.prot[i]->batulcmd)-1,K_EDIT);
rswindell's avatar
rswindell committed
937
938
                            break;
						case 6:
939
							uifc.input(WIN_MID|WIN_SAV,0,0
940
941
								,"Command"
								,cfg.prot[i]->batdlcmd,sizeof(cfg.prot[i]->batdlcmd)-1,K_EDIT);
rswindell's avatar
rswindell committed
942
943
                            break;
						case 7:
944
							uifc.input(WIN_MID|WIN_SAV,0,0
945
946
								,"Command"
								,cfg.prot[i]->bicmd,sizeof(cfg.prot[i]->bicmd)-1,K_EDIT);
rswindell's avatar
rswindell committed
947
948
                            break;
						case 8:
949
950
951
952
953
954
955
956
957
958
959
960
961
962
							l=cfg.prot[i]->misc&PROT_NATIVE ? 0:1;
							strcpy(opt[0],"Yes");
							strcpy(opt[1],"No");
							opt[2][0]=0;
							l=uifc.list(WIN_MID|WIN_SAV,0,0,0,&l,0
								,"Native (32-bit) Executable",opt);
							if((l==0 && !(cfg.prot[i]->misc&PROT_NATIVE))
								|| (l==1 && cfg.prot[i]->misc&PROT_NATIVE)) {
								cfg.prot[i]->misc^=PROT_NATIVE;
								uifc.changes=1; 
							}
							break; 
						case 9:
							l=cfg.prot[i]->misc&PROT_DSZLOG ? 0:1;
rswindell's avatar
rswindell committed
963
964
965
							strcpy(opt[0],"Yes");
							strcpy(opt[1],"No");
							opt[2][0]=0;
966
							l=uifc.list(WIN_MID|WIN_SAV,0,0,0,&l,0
rswindell's avatar
rswindell committed
967
								,"Uses DSZLOG",opt);
968
969
970
971
972
							if((l==0 && !(cfg.prot[i]->misc&PROT_DSZLOG))
								|| (l==1 && cfg.prot[i]->misc&PROT_DSZLOG)) {
								cfg.prot[i]->misc^=PROT_DSZLOG;
								uifc.changes=1; 
							}
973
							break; 
974
975
976
977
978
979
980
981
982
983
984
985
986
						case 10:
							l=cfg.prot[i]->misc&PROT_SOCKET ? 0:1l;
							strcpy(opt[0],"Yes");
							strcpy(opt[1],"No");
							opt[2][0]=0;
							l=uifc.list(WIN_MID|WIN_SAV,0,0,0,&l,0
								,"Uses Socket I/O",opt);
							if((l==0 && !(cfg.prot[i]->misc&PROT_SOCKET))
								|| (l==1 && cfg.prot[i]->misc&PROT_SOCKET)) {
								cfg.prot[i]->misc^=PROT_SOCKET;
								uifc.changes=1; 
							}
							break; 
987
988
989
					} 
				} 
			}
rswindell's avatar
rswindell committed
990
			break;
991
		case 14:	/* Alternate file paths */
rswindell's avatar
rswindell committed
992
993
994
995
996
997
			while(1) {
				for(i=0;i<cfg.altpaths;i++)
					sprintf(opt[i],"%3d: %-40s",i+1,cfg.altpath[i]);
				opt[i][0]=0;
				i=WIN_ACT|WIN_SAV;	/* save cause size can change */
				if((int)cfg.altpaths<MAX_OPTS)
998
					i|=WIN_INS|WIN_XTR;
rswindell's avatar
rswindell committed
999
1000
				if(cfg.altpaths)
					i|=WIN_DEL|WIN_GET;
For faster browsing, not all history is shown. View entire blame