ReactOS  0.4.13-dev-257-gfabbd7c
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. */
18 extern int gNumProgramRuns;
19 
20 /* Their $PAGER. */
21 char gPager[128];
22 
23 /* These correspond to the various timeouts from LibNcFTP. */
25 
26 /* Active or passive FTP? (PORT or PASV?) Or both? */
27 extern int gDataPortMode, gFwDataPortMode;
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. */
56 char 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? */
67 int gPrefsDirty = 0;
68 
69 extern FTPLibraryInfo gLib;
71 extern 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 },
110  { NULL, (PrefProc) 0, kPrefOptInvisible, },
111 };
112 
113 int gNumPrefOpts = ((int)(sizeof(gPrefOpts) / sizeof(PrefOpt)) - 1);
114 
115 
116 
117 void
118 SetAnonPass(int UNUSED(t), const char *const val, FILE *const fp)
119 {
121  if (fp != NULL) {
122  (void) fprintf(fp, "%s", gLib.defaultAnonPassword);
123  } else {
125  }
126 } /* SetAnonPass */
127 
128 
129 
130 void
131 SetAutoAscii(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 
148 void
149 SetAutoResume(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 
161 void
162 SetAutoSaveChangesToExistingBookmarks(int UNUSED(t), const char *const val, FILE *const fp)
163 {
165  if (fp != NULL) {
167  } else {
169  }
170 } /* SetAutoSaveChangesToExistingBookmarks */
171 
172 
173 
174 void
175 SetConfirmClose(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 
187 void
188 SetConnTimeout(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 
200 void
201 SetCtrlTimeout(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 
213 void
214 SetLogSize(int UNUSED(t), const char *const val, FILE *const fp)
215 {
217  if (fp != NULL) {
218  (void) fprintf(fp, "%d", gMaxLogSize);
219  } else {
220  gMaxLogSize = atoi(val);
221  }
222 } /* SetLogSize */
223 
224 
225 
226 void
227 SetNoAds(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 
239 void
240 SetOneTimeMessages(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 
252 void
253 SetPager(int UNUSED(t), const char *const val, FILE *const fp)
254 {
256  if (fp != NULL) {
257  (void) fprintf(fp, "%s", gPager);
258  } else {
259  (void) STRNCPY(gPager, val);
260  }
261 } /* SetPager */
262 
263 
264 
265 void
266 SetPassive(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
300 void
301 SetProgressMeter(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
323 void
324 SetProgressMeter(int UNUSED(t), const char *const UNUSED(val), FILE *const UNUSED(fp))
325 {
328  LIBNCFTP_USE_VAR(fp);
329 } /* SetProgressMeter */
330 #endif
331 
332 
333 
334 void
335 SetRedialDelay(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;
346  gRedialDelay = atoi(val);
347  }
348 } /* SetRedialDelay */
349 
350 
351 
352 void
353 SetSavePasswords(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 
371 void
372 SetSOBufsize(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 
387 void
388 SetXferTimeout(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 
400 void
401 SetXtTitle(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 
414 static void
415 Show1(int t)
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. */
429 void
430 Set(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 
476 int
477 HasSeenOneTimeMessage(const char *const msg)
478 {
479  char buf[256];
480  char *a, *b;
481 
482  memcpy(buf, gOneTimeMessagesSeen, sizeof(buf));
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 
493 void
494 SetSeenOneTimeMessage(const char *const msg)
495 {
496  gPrefsDirty++;
497  if (gOneTimeMessagesSeen[0] == '\0')
499  else {
502  }
503 } /* SetSeenOneTimeMessage */
504 
505 
506 
507 int
508 OneTimeMessage(const char *const msg)
509 {
511  return (0);
513  return (1);
514 } /* OneTimeMessage */
515 
516 
517 
518 
519 void
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. */
554 void
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. */
575  ProcessPrefsFile(fp);
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. */
598  ProcessPrefsFile(fp);
599  (void) fclose(fp);
600  }
601  }
602 
604  if (fp != NULL) {
605  /* Opened the global (and not overridable) prefs file. */
606  ProcessPrefsFile(fp);
607  (void) fclose(fp);
608  }
609 } /* LoadPrefs */
610 
611 
612 
613 
614 /* Initialize the configuration settings, in case the user does not set them. */
615 void
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  */
642  gDoNotDisplayAds = 0;
643 
644 #if (defined(WIN32) || defined(_WINDOWS)) && defined(_CONSOLE)
645  gMaySetXtermTitle = 1;
646 #else
647  gMaySetXtermTitle = 0;
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. */
679 void
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. */
694 void
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  */
737 void
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",
767  &gNumProgramRuns);
768  break;
769  }
770  }
771  (void) fclose(fp);
772  }
773 
774  /* Increment the count of program runs. */
775  gNumProgramRuns++;
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 kFirstFileName
Definition: pref.h:25
#define kPrefOptVisible
Definition: pref.h:39
void SetPager(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:253
unsigned int ctrlTimeout
Definition: ncftp.h:143
void SetRedialDelay(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:335
int gNumProgramRuns
Definition: preffw.c:14
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
const char * asciiFilenameExtensions
Definition: ncftp.h:246
PrefOpt gPrefOpts[]
Definition: pref.c:73
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
void SetNoAds(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:227
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
FTPLibraryInfo gLib
Definition: main.c:36
int gAutoSaveChangesToExistingBookmarks
Definition: pref.c:36
GLdouble GLdouble t
Definition: gl.h:2047
#define unlink
Definition: syshdrs.h:54
char * OurDirectoryPath(char *const dst, const size_t siz, const char *const fname)
Definition: util.c:486
#define ISTRNEQ(a, b, s)
Definition: util.h:34
int gMaxLogSize
Definition: pref.c:53
void SetConnTimeout(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:188
FTPConnectionInfo gConn
Definition: main.c:37
#define STRNCPY(dst, src, n)
Definition: rdesktop.h:168
#define FOPEN_WRITE_TEXT
Definition: syshdrs.h:83
#define kPassiveMode
Definition: ncftp.h:296
int gConfirmClose
Definition: pref.c:33
static HANDLE proc()
Definition: pdb.c:32
int errno
FTPProgressMeterProc progress
Definition: ncftp.h:198
void PrSizeAndRateMeter(const FTPCIPtr cip, int mode)
Definition: progress.c:72
void SavePrefs(void)
Definition: pref.c:695
#define LIBNCFTP_USE_VAR(a)
Definition: ncftp.h:521
#define kGlobalPrefFileName
Definition: pref.h:21
char gUser[]
Definition: util.c:14
const GLfloat * m
Definition: glext.h:10848
#define kDefaultRedialDelay
Definition: ncftp.h:342
FILE * stdout
#define ISTREQ(a, b)
Definition: util.h:33
void FTPInitializeAnonPassword(const FTPLIPtr)
Definition: open.c:81
size_t dataSocketSBufSize
Definition: ncftp.h:231
#define sprintf(buf, format,...)
Definition: sprintf.c:55
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
int OneTimeMessage(const char *const msg)
Definition: pref.c:508
_Check_return_ int __cdecl rename(_In_z_ const char *_OldFilename, _In_z_ const char *_NewFilename)
void SetAutoAscii(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:131
_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,...)
#define a
Definition: ke_i.h:78
#define kSendPortMode
Definition: ncftp.h:295
void SetSavePasswords(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:353
void PrPhilBar(const FTPCIPtr cip, int mode)
Definition: progress.c:348
void SetSeenOneTimeMessage(const char *const msg)
Definition: pref.c:494
smooth NULL
Definition: ftsmooth.c:416
#define kPrefFileName
Definition: pref.h:23
Definition: parser.c:48
#define UNUSED(x)
Definition: btrfs_drv.h:81
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
void SetAnonPass(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:118
#define kFallBackToSendPortMode
Definition: ncftp.h:297
void SetXtTitle(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:401
#define isdigit(c)
Definition: acclib.h:68
#define b
Definition: ke_i.h:79
GLuint GLfloat * val
Definition: glext.h:7180
#define FOPEN_READ_TEXT
Definition: syshdrs.h:82
#define STRNCAT(d, s)
Definition: Strn.h:48
#define YESNO(i)
Definition: util.h:28
void ProcessPrefsFile(FILE *const fp)
Definition: pref.c:520
int gDataPortMode
Definition: preffw.c:26
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
_CRTIMP int __cdecl getpid(void)
void(* FTPProgressMeterProc)(const FTPCIPtr, int)
Definition: ncftp.h:125
FTPProgressMeterProc gProgressMeter
void CheckForNewV3User(void)
Definition: pref.c:738
void SetLogSize(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:214
int gRedialDelay
Definition: pref.c:44
char defaultAnonPassword[80]
Definition: ncftp.h:121
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
void SetPassive(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:266
PrefProc proc
Definition: pref.h:33
static void Show1(int t)
Definition: pref.c:415
void SetProgressMeter(int UNUSED(t), const char *const UNUSED(val), FILE *const UNUSED(fp))
Definition: pref.c:324
void SetConfirmClose(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:175
char line[200]
Definition: main.c:97
unsigned int xferTimeout
Definition: ncftp.h:141
#define kGlobalFixedPrefFileName
Definition: pref.h:22
Definition: stat.h:55
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
int gFwDataPortMode
Definition: preffw.c:31
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
#define kPrefFileNameV2
Definition: pref.h:24
char gAutoAscii[512]
Definition: pref.c:56
size_t dataSocketRBufSize
Definition: ncftp.h:230
int HasSeenOneTimeMessage(const char *const msg)
Definition: pref.c:477
int gDoNotDisplayAds
Definition: pref.c:64
int gConnTimeout
Definition: pref.c:24
void LoadPrefs(void)
Definition: pref.c:555
Definition: pref.h:31
void SetAutoSaveChangesToExistingBookmarks(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:162
_Check_return_opt_ _CRTIMP char *__cdecl fgets(_Out_writes_z_(_MaxCount) char *_Buf, _In_ int _MaxCount, _Inout_ FILE *_File)
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
Definition: stat.h:345
_Check_return_ char *__cdecl getenv(_In_z_ const char *_VarName)
void Set(const char *const tok1, const char *const tok2)
Definition: pref.c:430
int StrToBool(const char *const s)
Definition: util.c:748
int gSOBufsize
Definition: pref.c:50
char gPager[128]
Definition: pref.c:21
void PrStatBar(const FTPCIPtr cip, int mode)
Definition: progress.c:203
#define PREFOBSELETE
Definition: pref.h:41
Definition: arc.h:46
char gVersion[]
Definition: init.c:22
void SetCtrlTimeout(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:201
char * strtok(char *String, const char *Delimiters)
Definition: utclib.c:338
int gNumPrefOpts
Definition: pref.c:113
int gMaySetXtermTitle
Definition: pref.c:41
int gXferTimeout
Definition: pref.c:24
void SetSOBufsize(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:372
#define msg(x)
Definition: auth_time.c:54
char gOneTimeMessagesSeen[256]
Definition: pref.c:47
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
int gPrefsDirty
Definition: pref.c:67
char gOurDirectoryPath[]
Definition: util.c:17
#define kPrefOptObselete
Definition: pref.h:37
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
struct PrefOpt PrefOpt
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
void SetOneTimeMessages(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:240
GLfloat GLfloat p
Definition: glext.h:8902
void(* PrefProc)(int i, const char *const, FILE *const fp)
Definition: pref.h:30
void SetXferTimeout(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:388
#define memset(x, y, z)
Definition: compat.h:39
unsigned int connTimeout
Definition: ncftp.h:142
int gSavePasswords
Definition: pref.c:39
void InitPrefs(void)
Definition: pref.c:616
void SetAutoResume(int UNUSED(t), const char *const val, FILE *const fp)
Definition: pref.c:149
void PostInitPrefs(void)
Definition: pref.c:680
int dataPortMode
Definition: ncftp.h:152
int gAutoResume
Definition: pref.c:30
#define printf
Definition: config.h:203
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
int gCtrlTimeout
Definition: pref.c:24
#define kPrefOptInvisible
Definition: pref.h:38