Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygentnconfig.h
Go to the documentation of this file.
00001 // Tnconfig.h 00002 // Written by Paul Brannan <pbranna@clemson.edu> 00003 // 00004 // This is a class designed for use with Brad Johnson's Console Telnet 00005 // It reads an ini file and keeps the settings for later retrieval. 00006 // It does not store any information about the current settings, only default 00007 // or recommended settings. 00008 00009 #pragma once 00010 00011 // Ioannou 2 June 98: Borland needs them - quick hack 00012 #ifdef __BORLANDC__ 00013 #define bool BOOL 00014 #define true TRUE 00015 #define false FALSE 00016 #endif // __BORLANDC__ 00017 00018 #include "tnerror.h" 00019 00020 #define ENV_TELNET_CFG "TELNET_CFG" 00021 #define ENV_TELNET_REDIR "TELNET_REDIR" 00022 #define ENV_INPUT_REDIR "TELNET_INPUT_REDIR" 00023 #define ENV_OUTPUT_REDIR "TENLET_OUTPUT_REDIR" 00024 #define ENV_TELNET_INI "TELNET_INI" 00025 00026 class TConfig { 00027 public: 00028 TConfig(); 00029 ~TConfig(); 00030 00031 // Miscellaneous strings 00032 const char *get_startdir() const {return startdir;} 00033 const char *get_exename() const {return exename;} 00034 const char *get_keyfile() const {return keyfile;} 00035 const char *get_inifile() const {return inifile;} 00036 const char *get_dumpfile() const {return dumpfile;} 00037 const char *get_term() const {return term;} 00038 const char *get_printer_name() const {return printer_name;} 00039 const char *get_default_config() const {return default_config;} 00040 00041 // Terminal settings 00042 int get_input_redir() const {return input_redir;} 00043 int get_output_redir() const {return output_redir;} 00044 bool get_strip_redir() const {return strip_redir;} 00045 bool get_dstrbksp() const {return dstrbksp;} 00046 bool get_eightbit_ansi() const {return eightbit_ansi;} 00047 bool get_vt100_mode() const {return vt100_mode;} 00048 bool get_disable_break() const {return disable_break;} 00049 bool get_speaker_beep() const {return speaker_beep;} 00050 bool get_do_beep() const {return do_beep;} 00051 bool get_preserve_colors() const {return preserve_colors;} 00052 bool get_wrapline() const {return wrapline;} 00053 bool get_fast_write() const {return fast_write;} 00054 bool get_lock_linewrap() const {return lock_linewrap;} 00055 bool get_set_title() const { return set_title;} 00056 int get_term_width() const {return term_width;} 00057 int get_term_height() const {return term_height;} 00058 int get_window_width() const {return window_width;} 00059 int get_window_height() const {return window_height;} 00060 bool get_wide_enable() const {return wide_enable;} 00061 bool get_control_break_as_c() const {return ctrlbreak_as_ctrlc;} 00062 int get_buffer_size() const {return buffer_size;} 00063 00064 // Colors 00065 int get_blink_bg() const {return blink_bg;} 00066 int get_blink_fg() const {return blink_fg;} 00067 int get_underline_bg() const {return underline_bg;} 00068 int get_underline_fg() const {return underline_fg;} 00069 int get_ulblink_bg() const {return ulblink_bg;} 00070 int get_ulblink_fg() const {return ulblink_fg;} 00071 int get_normal_bg() const {return normal_bg;} 00072 int get_normal_fg() const {return normal_fg;} 00073 int get_scroll_bg() const {return scroll_bg;} 00074 int get_scroll_fg() const {return scroll_fg;} 00075 int get_status_bg() const {return status_bg;} 00076 int get_status_fg() const {return status_fg;} 00077 00078 // Mouse 00079 bool get_enable_mouse() const {return enable_mouse;} 00080 00081 // Keyboard 00082 char get_escape_key() const {return escape_key[0];} 00083 char get_scrollback_key() const {return scrollback_key[0];} 00084 char get_dial_key() const {return dial_key[0];} 00085 bool get_alt_erase() const {return alt_erase;} 00086 bool get_keyboard_paste() const {return keyboard_paste;} 00087 00088 // Scrollback 00089 const char *get_scroll_mode() const {return scroll_mode;} 00090 bool get_scroll_enable() const {return scroll_enable;} 00091 int get_scroll_size() const {return scroll_size;} 00092 00093 // Scripting 00094 const char *get_scriptname() const {return scriptname;} 00095 bool get_script_enable() const {return script_enable;} 00096 00097 // Pipes 00098 const char *get_netpipe() const {return netpipe;} 00099 const char *get_iopipe() const {return iopipe;} 00100 00101 // Host configuration 00102 const char *get_host() const {return host;} 00103 const char *get_port() const {return port;} 00104 00105 // Initialization 00106 void init(char *dirname, char *exename); 00107 bool Process_Params(int argc, char *argv[]); 00108 00109 // Ini variables 00110 void print_vars(); 00111 void print_vars(char *s); 00112 void print_groups(); 00113 bool set_value(const char *var, const char *value); 00114 int print_value(const char *var); 00115 00116 // Aliases 00117 void print_aliases(); 00118 bool find_alias(const char *alias_name); 00119 00120 private: 00121 00122 void inifile_init(); 00123 void keyfile_init(); 00124 void redir_init(); 00125 void init_varlist(); 00126 void init_vars(); 00127 void init_aliases(); 00128 void set_string(char *dest, const char *src, const int length); 00129 void set_bool(bool *boolval, const char *str); 00130 00131 // Miscellaneous strings 00132 char startdir[MAX_PATH]; 00133 char exename[MAX_PATH]; 00134 char keyfile[MAX_PATH*2]; 00135 char inifile[MAX_PATH*2]; 00136 char dumpfile[MAX_PATH*2]; 00137 char printer_name[MAX_PATH*2]; 00138 char term[128]; 00139 char default_config[128]; 00140 00141 // Terminal 00142 int input_redir, output_redir; 00143 bool strip_redir; 00144 bool dstrbksp; 00145 bool eightbit_ansi; 00146 bool vt100_mode; 00147 bool disable_break; 00148 bool speaker_beep; 00149 bool do_beep; 00150 bool preserve_colors; 00151 bool wrapline; 00152 bool lock_linewrap; 00153 bool fast_write; 00154 bool set_title; 00155 int term_width, term_height; 00156 int window_width, window_height; 00157 bool wide_enable; 00158 bool ctrlbreak_as_ctrlc; 00159 int buffer_size; 00160 00161 // Colors 00162 int blink_bg; 00163 int blink_fg; 00164 int underline_bg; 00165 int underline_fg; 00166 int ulblink_bg; 00167 int ulblink_fg; 00168 int normal_bg; 00169 int normal_fg; 00170 int scroll_bg; 00171 int scroll_fg; 00172 int status_bg; 00173 int status_fg; 00174 00175 // Mouse 00176 bool enable_mouse; 00177 00178 // Keyboard 00179 char escape_key[2]; 00180 char scrollback_key[2]; 00181 char dial_key[2]; 00182 bool alt_erase; 00183 bool keyboard_paste; 00184 00185 // Scrollback 00186 char scroll_mode[8]; 00187 bool scroll_enable; 00188 int scroll_size; 00189 00190 // Scripting 00191 char scriptname[MAX_PATH*2]; 00192 bool script_enable; 00193 00194 // Pipes 00195 char netpipe[MAX_PATH*2]; 00196 char iopipe[MAX_PATH*2]; 00197 00198 // Host configration 00199 char host[128]; 00200 const char *port; 00201 00202 // Aliases 00203 char **aliases; 00204 int alias_total; 00205 00206 }; 00207 00208 extern TConfig ini; Generated on Fri May 25 2012 04:15:34 for ReactOS by
1.7.6.1
|