ReactOS 0.4.15-dev-5667-ged97270
pref.c
Go to the documentation of this file.
1/* pref.c
2 *
3 * Copyright (c) 1992-2001 by Mike Gleason.
4 * All rights reserved.
5 *
6 */
7
8#include "syshdrs.h"
9
10#ifdef ncftp
11#include "progress.h"
12#endif
13
14#include "pref.h"
15#include "util.h"
16
17/* How many times they've run this program. */
18extern int gNumProgramRuns;
19
20/* Their $PAGER. */
21char gPager[128];
22
23/* These correspond to the various timeouts from LibNcFTP. */
25
26/* Active or passive FTP? (PORT or PASV?) Or both? */
28
29/* When the destination file already exists, resume transfer or ask user? */
31
32/* "Save a bookmark to this site before closing?" */
34
35/* Should we update the bookmark for the user? */
37
38/* "Save your password with the bookmark?" */
40
42
43/* Number of seconds between connection attempts. */
45
46/* Some messages we only want to bug the user about once, ever. */
48
49/* Tune the size of the socket buffer using SO_RCVBUF or SO_SNDBUF? */
51
52/* Size of the user log before we trim it. 0 means do not log at all. */
54
55/* Use ASCII mode automatically for files with these extensions. */
56char gAutoAscii[512];
57
58#ifdef ncftp
59/* Which meter to use. */
61#endif
62
63/* Allow us to plug our other products? */
65
66/* Do we need to save the prefs, or can we skip it? */
68
69extern FTPLibraryInfo gLib;
71extern char gOurDirectoryPath[], gUser[], gVersion[];
72
74 { "anonopen", PREFOBSELETE },
75 { "anonpass", SetAnonPass, kPrefOptObselete },
76 { "anon-password", SetAnonPass, 1 },
77 { "auto-ascii", SetAutoAscii, 1 },
78 { "auto-resume", SetAutoResume, 1 },
79 { "autosave-bookmark-changes", SetAutoSaveChangesToExistingBookmarks, 1 },
80 { "blank-lines", PREFOBSELETE },
81 { "confirm-close", SetConfirmClose, 1 },
82 { "connect-timeout", SetConnTimeout, 1 },
83 { "control-timeout", SetCtrlTimeout, 1 },
84 { "logsize", SetLogSize, 1 },
85 { "maxbookmarks", PREFOBSELETE },
86 { "one-time-messages-seen", SetOneTimeMessages, 0 },
87 { "pager", SetPager, 1 },
88 { "passive", SetPassive, 1 },
89 { "progress-meter", SetProgressMeter, 1 },
90 { "redial-delay", SetRedialDelay, 1 },
91 { "remote-msgs", PREFOBSELETE },
92 { "restore-lcwd", PREFOBSELETE },
93 { "save-passwords", SetSavePasswords, 1 },
94 { "show-trailing-space", PREFOBSELETE },
95 { "show-status-in-xterm-titlebar", SetXtTitle, 1 },
96#ifdef SO_RCVBUF
97 { "so-bufsize", SetSOBufsize, 1 },
98#endif
99 { "startup-lcwd", PREFOBSELETE },
100 { "startup-msgs", PREFOBSELETE },
101 { "timeout", PREFOBSELETE },
102 { "total-runs", PREFOBSELETE },
103 { "total-xfer-hundredths-of-seconds", PREFOBSELETE },
104 { "total-xfer-kbytes", PREFOBSELETE },
105 { "trace", PREFOBSELETE },
106 { "utime", PREFOBSELETE },
107 { "visual", PREFOBSELETE },
108 { "xfer-timeout", SetXferTimeout, 1 },
109 { "yes-i-know-about-NcFTPd", SetNoAds, 1 },
111};
112
113int gNumPrefOpts = ((int)(sizeof(gPrefOpts) / sizeof(PrefOpt)) - 1);
114
115
116
117void
118SetAnonPass(int UNUSED(t), const char *const val, FILE *const fp)
119{
121 if (fp != NULL) {
123 } else {
125 }
126} /* SetAnonPass */
127
128
129
130void
131SetAutoAscii(int UNUSED(t), const char *const val, FILE *const fp)
132{
134 if (fp != NULL) {
135 (void) fprintf(fp, "%s", gAutoAscii);
136 } else {
138 if ((gAutoAscii[0] == '\0') || (ISTREQ(gAutoAscii, "no")) || (ISTREQ(gAutoAscii, "off")) || (ISTREQ(gAutoAscii, "false"))) {
140 } else {
142 }
143 }
144} /* SetAutoAscii */
145
146
147
148void
149SetAutoResume(int UNUSED(t), const char *const val, FILE *const fp)
150{
152 if (fp != NULL) {
153 (void) fprintf(fp, "%s", YESNO(gAutoResume));
154 } else {
156 }
157} /* SetAutoResume */
158
159
160
161void
162SetAutoSaveChangesToExistingBookmarks(int UNUSED(t), const char *const val, FILE *const fp)
163{
165 if (fp != NULL) {
167 } else {
169 }
170} /* SetAutoSaveChangesToExistingBookmarks */
171
172
173
174void
175SetConfirmClose(int UNUSED(t), const char *const val, FILE *const fp)
176{
178 if (fp != NULL) {
179 (void) fprintf(fp, "%s", YESNO(gConfirmClose));
180 } else {
182 }
183} /* SetConfirmClose */
184
185
186
187void
188SetConnTimeout(int UNUSED(t), const char *const val, FILE *const fp)
189{
191 if (fp != NULL) {
192 (void) fprintf(fp, "%d", gConnTimeout);
193 } else {
195 }
196} /* SetConnTimeout */
197
198
199
200void
201SetCtrlTimeout(int UNUSED(t), const char *const val, FILE *const fp)
202{
204 if (fp != NULL) {
205 (void) fprintf(fp, "%d", gCtrlTimeout);
206 } else {
208 }
209} /* SetCtrlTimeout */
210
211
212
213void
214SetLogSize(int UNUSED(t), const char *const val, FILE *const fp)
215{
217 if (fp != NULL) {
218 (void) fprintf(fp, "%d", gMaxLogSize);
219 } else {
221 }
222} /* SetLogSize */
223
224
225
226void
227SetNoAds(int UNUSED(t), const char *const val, FILE *const fp)
228{
230 if (fp != NULL) {
231 (void) fprintf(fp, "%s", YESNO(gDoNotDisplayAds));
232 } else {
234 }
235} /* SetNoAds */
236
237
238
239void
240SetOneTimeMessages(int UNUSED(t), const char *const val, FILE *const fp)
241{
243 if (fp != NULL) {
244 (void) fprintf(fp, "%s", gOneTimeMessagesSeen);
245 } else {
247 }
248} /* SetOneTimeMessages */
249
250
251
252void
253SetPager(int UNUSED(t), const char *const val, FILE *const fp)
254{
256 if (fp != NULL) {
257 (void) fprintf(fp, "%s", gPager);
258 } else {
260 }
261} /* SetPager */
262
263
264
265void
266SetPassive(int UNUSED(t), const char *const val, FILE *const fp)
267{
268 int m;
269
271 if (fp != NULL) {
273 if (m == kSendPortMode) {
274 (void) fprintf(fp, "%s", "off");
275 } else if (m == kPassiveMode) {
276 (void) fprintf(fp, "%s", "on");
277 } else {
278 (void) fprintf(fp, "%s", "optional");
279 }
280 } else {
281 if (gFwDataPortMode >= 0) {
283 return;
284 }
285 if (ISTRNEQ(val, "opt", 3))
287 else if (ISTREQ(val, "on"))
289 else if ((int) isdigit(val[0]))
291 else
294 }
295} /* SetPassive */
296
297
298
299#ifdef ncftp
300void
301SetProgressMeter(int UNUSED(t), const char *const val, FILE *const fp)
302{
304 if (fp != NULL) {
305 if (gProgressMeter == PrStatBar) {
306 (void) fprintf(fp, "%s", "2 (statbar)");
307 } else if (gProgressMeter == PrPhilBar) {
308 (void) fprintf(fp, "%s", "1 (philbar)");
309 } else {
310 (void) fprintf(fp, "%s", "0 (simple)");
311 }
312 } else {
313 if ((val[0] == '0') || (ISTRNEQ(val, "simple", 6)))
315 else if ((val[0] == '1') || (ISTRNEQ(val, "phil", 4)))
317 else
320 }
321} /* SetProgressMeter */
322#else
323void
324SetProgressMeter(int UNUSED(t), const char *const UNUSED(val), FILE *const UNUSED(fp))
325{
329} /* SetProgressMeter */
330#endif
331
332
333
334void
335SetRedialDelay(int UNUSED(t), const char *const val, FILE *const fp)
336{
337 int i;
338
340 if (fp != NULL) {
341 (void) fprintf(fp, "%d", gRedialDelay);
342 } else {
343 i = atoi(val);
344 if (i < 10)
345 i = 10;
347 }
348} /* SetRedialDelay */
349
350
351
352void
353SetSavePasswords(int UNUSED(t), const char *const val, FILE *const fp)
354{
356 if (fp != NULL) {
357 if (gSavePasswords < 0)
358 (void) fprintf(fp, "%s", "ask");
359 else
360 (void) fprintf(fp, "%s", YESNO(gSavePasswords));
361 } else {
362 if (ISTREQ(val, "ask"))
363 gSavePasswords = -1;
364 else
366 }
367} /* SetSavePasswords */
368
369
370
371void
372SetSOBufsize(int UNUSED(t), const char *const val, FILE *const fp)
373{
375 if (fp != NULL) {
376 (void) fprintf(fp, "%d", gSOBufsize);
377 if (gSOBufsize <= 0)
378 (void) fprintf(fp, "%s", " (use system default)");
379 } else {
381 }
382} /* SetSOBufsize */
383
384
385
386
387void
388SetXferTimeout(int UNUSED(t), const char *const val, FILE *const fp)
389{
391 if (fp != NULL) {
392 (void) fprintf(fp, "%d", gXferTimeout);
393 } else {
395 }
396} /* SetXferTimeout */
397
398
399
400void
401SetXtTitle(int UNUSED(t), const char *const val, FILE *const fp)
402{
404 if (fp != NULL) {
405 (void) fprintf(fp, "%s", YESNO(gMaySetXtermTitle));
406 } else {
408 }
409} /* SetXtTitle */
410
411
412
413
414static void
416{
417 PrefOpt *p = &gPrefOpts[t];
418
419 (void) printf("%-30s ", p->varname);
420 if (p->proc != (PrefProc) 0)
421 (*p->proc)(t, NULL, stdout);
422 (void) printf("\n");
423} /* Show1 */
424
425
426
427
428/* Modify or display the program's configuration. */
429void
430Set(const char *const tok1, const char *const tok2)
431{
432 int t;
433
434 if ((tok1 == NULL) || (ISTREQ(tok1, "all"))) {
435 /* Show all. */
436 for (t=0; t<gNumPrefOpts; t++) {
437 if (gPrefOpts[t].visible == kPrefOptVisible)
438 Show1(t);
439 }
440 } else if (tok2 == NULL) {
441 /* Show one. */
442 for (t=0; t<gNumPrefOpts; t++) {
443 if (ISTREQ(tok1, gPrefOpts[t].varname)) {
444 if (gPrefOpts[t].visible == kPrefOptObselete) {
445 (void) printf("The \"%s\" option is obselete or not implemented.\n", tok1);
446 } else {
447 Show1(t);
448 }
449 break;
450 }
451 }
452 if (t >= gNumPrefOpts) {
453 (void) printf("Unknown option \"%s\" -- try \"show all\" to list available options.\n", tok1);
454 }
455 } else {
456 /* Set one. */
457 for (t=0; t<gNumPrefOpts; t++) {
458 if (ISTREQ(tok1, gPrefOpts[t].varname)) {
459 if (gPrefOpts[t].visible == kPrefOptObselete) {
460 (void) printf("The \"%s\" option is obselete or not implemented.\n", tok1);
461 } else if (gPrefOpts[t].proc != (PrefProc) 0) {
462 (*gPrefOpts[t].proc)(t, tok2, NULL);
463 gPrefsDirty++;
464 }
465 break;
466 }
467 }
468 if (t >= gNumPrefOpts) {
469 (void) printf("Unknown option \"%s\" -- try \"show all\" to list available options.\n", tok1);
470 }
471 }
472} /* Set */
473
474
475
476int
477HasSeenOneTimeMessage(const char *const msg)
478{
479 char buf[256];
480 char *a, *b;
481
483 for (a = buf; (b = strtok(a, ",\n")) != NULL; a = NULL) {
484 if (strcmp(msg, b) == 0)
485 return (1);
486 }
487 return (0);
488} /* HasSeenOneTimeMessage */
489
490
491
492
493void
494SetSeenOneTimeMessage(const char *const msg)
495{
496 gPrefsDirty++;
497 if (gOneTimeMessagesSeen[0] == '\0')
499 else {
502 }
503} /* SetSeenOneTimeMessage */
504
505
506
507int
508OneTimeMessage(const char *const msg)
509{
511 return (0);
513 return (1);
514} /* OneTimeMessage */
515
516
517
518
519void
521{
522 char line[1024];
523 char *tok1, *tok2;
524 int t;
525
526 line[sizeof(line) - 1] = '\0';
527 while (fgets(line, sizeof(line) - 1, fp) != NULL) {
528 tok1 = strtok(line, " =\t\r\n");
529 if ((tok1 == NULL) || (tok1[0] == '#'))
530 continue;
531 tok2 = strtok(NULL, "\r\n");
532 if (tok2 == NULL)
533 continue;
534
535 for (t=0; t<gNumPrefOpts; t++) {
536 if (ISTREQ(tok1, gPrefOpts[t].varname)) {
537 if (gPrefOpts[t].visible == kPrefOptObselete) {
538 /* Probably converting an
539 * old 2.4.2 file.
540 */
541 gPrefsDirty++;
542 } else if (gPrefOpts[t].proc != (PrefProc) 0) {
543 (*gPrefOpts[t].proc)(t, tok2, NULL);
544 }
545 }
546 }
547 }
548} /* ProcessPrefsFile */
549
550
551
552
553/* Read the saved configuration settings from a preferences file. */
554void
556{
557 FILE *fp;
558 char pathName[256];
559
560 /* As with the firewall preference file, there can be
561 * site-wide preferences and user-specific preferences.
562 * The user pref file is of course kept in the user's
563 * NcFTP home directory.
564 *
565 * The way we do this is we first look for a global
566 * preferences file. We then process the user's pref
567 * file, which could override the global prefs. Finally,
568 * we open a "global fixed" prefs file which then
569 * overrides anything the user may have done.
570 */
571
573 if (fp != NULL) {
574 /* Opened the global (but user-overridable) prefs file. */
576 (void) fclose(fp);
577 }
578
579 if (gOurDirectoryPath[0] != '\0') {
580 (void) OurDirectoryPath(pathName, sizeof(pathName), kPrefFileName);
581
582 fp = fopen(pathName, FOPEN_READ_TEXT);
583 if (fp == NULL) {
584 /* Try loading the version 2 prefs.
585 * There will be options we no longer recognize, but
586 * we'd like to import the prefs when possible.
587 */
588 gPrefsDirty++;
589 (void) OurDirectoryPath(pathName, sizeof(pathName), kPrefFileNameV2);
590 fp = fopen(pathName, FOPEN_READ_TEXT);
591 }
592
593 if (fp == NULL) {
594 /* Write a new one when we're done. */
595 gPrefsDirty++;
596 } else {
597 /* Opened the preferences file. */
599 (void) fclose(fp);
600 }
601 }
602
604 if (fp != NULL) {
605 /* Opened the global (and not overridable) prefs file. */
607 (void) fclose(fp);
608 }
609} /* LoadPrefs */
610
611
612
613
614/* Initialize the configuration settings, in case the user does not set them. */
615void
617{
618 char *tok1;
619
620 /* Set default values. */
621 gPager[0] = '\0';
623 gXferTimeout = 3600;
624 gConnTimeout = 20;
625 gCtrlTimeout = 135;
628 gAutoResume = 0;
629 gSOBufsize = 0;
630 gMaxLogSize = 10240;
631 gConfirmClose = 1;
634 STRNCPY(gAutoAscii, "|.txt|.asc|.html|.htm|.css|.xml|.ini|.sh|.pl|.hqx|.cfg|.c|.h|.cpp|.hpp|.bat|.m3u|.pls|");
635
636 /* PLEASE do not change the default from 0, and please
637 * don't hack out the portion in main.c which displays
638 * a plug every 7th time you run the program. This is
639 * not much to ask for all the work I've put into this
640 * since 1991.
641 */
643
644#if (defined(WIN32) || defined(_WINDOWS)) && defined(_CONSOLE)
646#else
648#endif
649
650 gSavePasswords = -1;
651#ifdef ncftp
653#endif
654
655 tok1 = getenv("PAGER");
656 if ((tok1 != NULL) && (tok1[0] != '\0')) {
657#ifdef HAVE_STRSTR
658 /* I prefer "less", but it doesn't work well here
659 * because it clears the screen after it finishes,
660 * and the default at EOF is to stay in less
661 * instead of exiting.
662 */
663 if (strstr(gPager, "less") != NULL)
664 (void) STRNCPY(gPager, "more");
665 else
666 (void) STRNCPY(gPager, tok1);
667#else
668 (void) STRNCPY(gPager, tok1);
669#endif
670 } else {
671 (void) STRNCPY(gPager, "more");
672 }
673} /* InitPrefs */
674
675
676
677
678/* After reading the preferences, do some additional initialization. */
679void
681{
682 if (gLib.defaultAnonPassword[0] == '\0') {
684 gPrefsDirty++;
685 }
686 if (gFwDataPortMode >= 0)
688} /* PostInitPrefs */
689
690
691
692
693/* Write the configuration settings to a preferences file. */
694void
696{
697 char pathName[256];
698 char pathName2[256];
699 char tName[32];
700 int t;
701 FILE *fp;
702
703 if (gPrefsDirty == 0)
704 return; /* Don't need to save -- no changes made. */
705
706 (void) OurDirectoryPath(pathName, sizeof(pathName), kPrefFileName);
707
708 (void) sprintf(tName, "tpref%06u.txt", (unsigned int) getpid());
709 (void) OurDirectoryPath(pathName2, sizeof(pathName2), tName);
710
711 fp = fopen(pathName2, FOPEN_WRITE_TEXT);
712 if (fp == NULL) {
713 perror("could not save preferences file");
714 } else {
715 (void) fprintf(fp, "%s", "# NcFTP 3 preferences file\n# This file is loaded and overwritten each time NcFTP is run.\n#\n");
716 for (t=0; t<gNumPrefOpts; t++) {
717 if (gPrefOpts[t].visible != kPrefOptObselete) {
718 (void) fprintf(fp, "%s=", gPrefOpts[t].varname);
719 (*gPrefOpts[t].proc)(t, NULL, fp);
720 (void) fprintf(fp, "\n");
721 }
722 }
723 (void) fclose(fp);
724 (void) unlink(pathName);
725 if (rename(pathName2, pathName) < 0) {
726 perror("could not finish saving preferences file");
727 (void) unlink(pathName2);
728 };
729 }
730} /* SavePrefs */
731
732
733
734/* This maintains the little counter file that is used by version 3.0
735 * to do things based on how many times the program was run.
736 */
737void
739{
740 FILE *fp;
741 struct stat st;
742 char pathName[256];
743 char line[256];
744
745 gNumProgramRuns = 0;
746
747 /* Don't create in root directory. */
748 if (gOurDirectoryPath[0] != '\0') {
749 (void) OurDirectoryPath(pathName, sizeof(pathName), kFirstFileName);
750
751 if ((stat(pathName, &st) < 0) && (errno == ENOENT)) {
752 gNumProgramRuns = 1;
753 gPrefsDirty++;
754
755 /* Create a blank one. */
756 fp = fopen(pathName, FOPEN_WRITE_TEXT);
757 if (fp == NULL)
758 return;
759 (void) fprintf(fp, "# NcFTP uses this file to mark that you have run it before, and that you do not\n# need any special first-time instructions or setup.\n#\nruns=%d\n", gNumProgramRuns);
760 (void) fclose(fp);
761 } else {
762 fp = fopen(pathName, FOPEN_READ_TEXT);
763 if (fp != NULL) {
764 while (fgets(line, sizeof(line) - 1, fp) != NULL) {
765 if (strncmp(line, "runs=", 5) == 0) {
766 (void) sscanf(line + 5, "%d",
768 break;
769 }
770 }
771 (void) fclose(fp);
772 }
773
774 /* Increment the count of program runs. */
776 if (gNumProgramRuns == 1)
777 gPrefsDirty++;
778
779 /* Race condition between other ncftp processes.
780 * This isn't a big deal because this counter isn't
781 * critical.
782 */
783
784 fp = fopen(pathName, FOPEN_WRITE_TEXT);
785 if (fp != NULL) {
786 (void) fprintf(fp, "# NcFTP uses this file to mark that you have run it before, and that you do not\n# need any special first-time instructions or setup.\n#\nruns=%d\n", gNumProgramRuns);
787 (void) fclose(fp);
788 }
789 }
790 }
791} /* CheckForNewV3User */
#define STRNCAT(d, s)
Definition: Strn.h:48
#define ENOENT
Definition: acclib.h:79
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
#define isdigit(c)
Definition: acclib.h:68
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
char * strtok(char *String, const char *Delimiters)
Definition: utclib.c:338
#define stat
Definition: acwin.h:99
#define msg(x)
Definition: auth_time.c:54
#define STRNCPY(dst, src, n)
Definition: rdesktop.h:168
#define UNUSED(x)
Definition: btrfs_drv.h:82
#define NULL
Definition: types.h:112
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define printf
Definition: freeldr.h:94
GLdouble GLdouble t
Definition: gl.h:2047
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLuint GLfloat * val
Definition: glext.h:7180
GLfloat GLfloat p
Definition: glext.h:8902
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
const GLfloat * m
Definition: glext.h:10848
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define stdout
Definition: stdio.h:99
_CRTIMP void __cdecl perror(_In_opt_z_ const char *_ErrMsg)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP char *__cdecl fgets(_Out_writes_z_(_MaxCount) char *_Buf, _In_ int _MaxCount, _Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
_Check_return_ char *__cdecl getenv(_In_z_ const char *_VarName)
#define a
Definition: ke_i.h:78
#define b
Definition: ke_i.h:79
#define unlink
Definition: syshdrs.h:54
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ISTREQ(a, b)
Definition: util.h:33
#define ISTRNEQ(a, b, s)
Definition: util.h:34
FTPProgressMeterProc gProgressMeter
void PrStatBar(const FTPCIPtr cip, int mode)
Definition: progress.c:203
void PrSizeAndRateMeter(const FTPCIPtr cip, int mode)
Definition: progress.c:72
void PrPhilBar(const FTPCIPtr cip, int mode)
Definition: progress.c:348
int StrToBool(const char *const s)
Definition: util.c:748
char * OurDirectoryPath(char *const dst, const size_t siz, const char *const fname)
Definition: util.c:486
#define YESNO(i)
Definition: util.h:28
#define sprintf(buf, format,...)
Definition: sprintf.c:55
#define FOPEN_READ_TEXT
Definition: syshdrs.h:82
#define FOPEN_WRITE_TEXT
Definition: syshdrs.h:83
#define kDefaultRedialDelay
Definition: ncftp.h:342
#define kSendPortMode
Definition: ncftp.h:295
void FTPInitializeAnonPassword(const FTPLIPtr)
Definition: open.c:81
#define kPassiveMode
Definition: ncftp.h:296
#define kFallBackToSendPortMode
Definition: ncftp.h:297
void(* FTPProgressMeterProc)(const FTPCIPtr, int)
Definition: ncftp.h:125
#define LIBNCFTP_USE_VAR(a)
Definition: ncftp.h:521
static BOOL Set
Definition: pageheap.c:10
static HANDLE proc()
Definition: pdb.c:34
int gSOBufsize
Definition: pref.c:50
int gPrefsDirty
Definition: pref.c:67
FTPConnectionInfo gConn
Definition: main.c:37
void SetSeenOneTimeMessage(const char *const msg)
Definition: pref.c:494
void SetSOBufsize(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:372
void SetAnonPass(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:118
void ProcessPrefsFile(FILE *const fp)
Definition: pref.c:520
void SetSavePasswords(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:353
char gPager[128]
Definition: pref.c:21
void SetPassive(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:266
void SetConnTimeout(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:188
int gAutoResume
Definition: pref.c:30
int gMaySetXtermTitle
Definition: pref.c:41
void SetOneTimeMessages(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:240
void SetLogSize(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:214
int gConnTimeout
Definition: pref.c:24
FTPLibraryInfo gLib
Definition: main.c:36
void SetProgressMeter(int UNUSED(t), const char *const UNUSED(val), FILE *const UNUSED(fp))
Definition: pref.c:324
void SetRedialDelay(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:335
char gOneTimeMessagesSeen[256]
Definition: pref.c:47
static void Show1(int t)
Definition: pref.c:415
int gConfirmClose
Definition: pref.c:33
int gSavePasswords
Definition: pref.c:39
int gNumProgramRuns
Definition: preffw.c:14
void SetAutoResume(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:149
void LoadPrefs(void)
Definition: pref.c:555
int gMaxLogSize
Definition: pref.c:53
PrefOpt gPrefOpts[]
Definition: pref.c:73
void SetPager(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:253
void SetCtrlTimeout(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:201
int gNumPrefOpts
Definition: pref.c:113
char gUser[]
Definition: pref.c:71
int gDataPortMode
Definition: preffw.c:26
void SetAutoAscii(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:131
int gAutoSaveChangesToExistingBookmarks
Definition: pref.c:36
char gAutoAscii[512]
Definition: pref.c:56
void CheckForNewV3User(void)
Definition: pref.c:738
char gVersion[]
Definition: pref.c:71
int HasSeenOneTimeMessage(const char *const msg)
Definition: pref.c:477
void SavePrefs(void)
Definition: pref.c:695
void SetConfirmClose(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:175
void SetXtTitle(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:401
int gXferTimeout
Definition: pref.c:24
int gFwDataPortMode
Definition: pref.c:27
int gRedialDelay
Definition: pref.c:44
void SetXferTimeout(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:388
void SetAutoSaveChangesToExistingBookmarks(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:162
int gDoNotDisplayAds
Definition: pref.c:64
void SetNoAds(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:227
int OneTimeMessage(const char *const msg)
Definition: pref.c:508
void PostInitPrefs(void)
Definition: pref.c:680
void InitPrefs(void)
Definition: pref.c:616
char gOurDirectoryPath[]
Definition: util.c:17
int gCtrlTimeout
Definition: pref.c:24
#define kGlobalFixedPrefFileName
Definition: pref.h:22
void(* PrefProc)(int i, const char *const, FILE *const fp)
Definition: pref.h:30
#define PREFOBSELETE
Definition: pref.h:41
#define kPrefOptVisible
Definition: pref.h:39
#define kPrefOptObselete
Definition: pref.h:37
#define kPrefOptInvisible
Definition: pref.h:38
#define kFirstFileName
Definition: pref.h:25
#define kPrefFileNameV2
Definition: pref.h:24
#define kPrefFileName
Definition: pref.h:23
#define kGlobalPrefFileName
Definition: pref.h:21
#define errno
Definition: errno.h:18
_Check_return_ int __cdecl rename(_In_z_ const char *_OldFilename, _In_z_ const char *_NewFilename)
#define memset(x, y, z)
Definition: compat.h:39
unsigned int xferTimeout
Definition: ncftp.h:141
unsigned int connTimeout
Definition: ncftp.h:142
size_t dataSocketRBufSize
Definition: ncftp.h:230
int dataPortMode
Definition: ncftp.h:152
FTPProgressMeterProc progress
Definition: ncftp.h:198
const char * asciiFilenameExtensions
Definition: ncftp.h:246
size_t dataSocketSBufSize
Definition: ncftp.h:231
unsigned int ctrlTimeout
Definition: ncftp.h:143
char defaultAnonPassword[80]
Definition: ncftp.h:121
Definition: pref.h:31
PrefProc proc
Definition: pref.h:33
Definition: parser.c:49
Definition: stat.h:55
#define getpid
Definition: wintirpc.h:52