1 /* pref.h 2 * 3 * Copyright (c) 1992-2001 by Mike Gleason. 4 * All rights reserved. 5 * 6 */ 7 8 #if defined(WIN32) || defined(_WINDOWS) 9 # define kFirewallPrefFileName "firewall.txt" 10 # define kGlobalFirewallPrefFileName "..\\..\\firewall.txt" 11 # define kGlobalFixedFirewallPrefFileName "..\\..\\firewall_fixed.txt" 12 # define kGlobalPrefFileName "..\\..\\prefs_v3.txt" 13 # define kGlobalFixedPrefFileName "..\\..\\prefs_v3_fixed.txt" 14 # define kPrefFileName "prefs_v3.txt" 15 # define kPrefFileNameV2 "prefs" 16 # define kFirstFileName "init_v3.txt" 17 #else 18 # define kFirewallPrefFileName "firewall" 19 # define kGlobalFirewallPrefFileName "/etc/ncftp.firewall" 20 # define kGlobalFixedFirewallPrefFileName "/etc/ncftp.firewall.fixed" 21 # define kGlobalPrefFileName "/etc/ncftp.prefs_v3" 22 # define kGlobalFixedPrefFileName "/etc/ncftp.prefs_v3.fixed" 23 # define kPrefFileName "prefs_v3" 24 # define kPrefFileNameV2 "prefs" 25 # define kFirstFileName "init_v3" 26 #endif 27 28 #define kOpenSelectedBookmarkFileName "bm2open" 29 30 typedef void (*PrefProc)(int i, const char *const, FILE *const fp); 31 typedef struct PrefOpt { 32 const char *varname; 33 PrefProc proc; 34 int visible; 35 } PrefOpt; 36 37 #define kPrefOptObselete (-1) 38 #define kPrefOptInvisible 0 39 #define kPrefOptVisible 1 40 41 #define PREFOBSELETE (PrefProc) 0, kPrefOptObselete, 42 43 /* pref.c */ 44 void SetAnonPass(int, const char *const, FILE *const); 45 void SetAutoAscii(int t, const char *const val, FILE *const fp); 46 void SetAutoResume(int, const char *const, FILE *const); 47 void SetAutoSaveChangesToExistingBookmarks(int t, const char *const val, FILE *const fp); 48 void SetConfirmClose(int, const char *const, FILE *const); 49 void SetConnTimeout(int, const char *const, FILE *const); 50 void SetCtrlTimeout(int, const char *const, FILE *const); 51 void SetLogSize(int t, const char *const val, FILE *const fp); 52 void SetNoAds(int t, const char *const val, FILE *const fp); 53 void SetOneTimeMessages(int t, const char *const val, FILE *const); 54 void SetPager(int, const char *const, FILE *const); 55 void SetPassive(int, const char *const, FILE *const); 56 void SetProgressMeter(int, const char *const, FILE *const); 57 void SetRedialDelay(int t, const char *const val, FILE *const fp); 58 void SetSavePasswords(int, const char *const, FILE *const); 59 void SetSOBufsize(int t, const char *const val, FILE *const fp); 60 void SetXferTimeout(int, const char *const, FILE *const); 61 void SetXtTitle(int, const char *const, FILE *const); 62 void Set(const char *const, const char *const); 63 void ProcessPrefsFile(FILE *const fp); 64 void LoadPrefs(void); 65 void InitPrefs(void); 66 void PostInitPrefs(void); 67 void SavePrefs(void); 68 void WriteDefaultFirewallPrefs(FILE *); 69 void ProcessFirewallPrefFile(FILE *); 70 void LoadFirewallPrefs(int); 71 void CheckForNewV3User(void); 72 int HasSeenOneTimeMessage(const char *const msg); 73 void SetSeenOneTimeMessage(const char *const msg); 74 int OneTimeMessage(const char *const msg); 75