ReactOS 0.4.15-dev-7918-g2a2556c
TConfig Class Reference

#include <tnconfig.h>

Collaboration diagram for TConfig:

Public Member Functions

 TConfig ()
 
 ~TConfig ()
 
const charget_startdir () const
 
const charget_exename () const
 
const charget_keyfile () const
 
const charget_inifile () const
 
const charget_dumpfile () const
 
const charget_term () const
 
const charget_printer_name () const
 
const charget_default_config () const
 
int get_input_redir () const
 
int get_output_redir () const
 
bool get_strip_redir () const
 
bool get_dstrbksp () const
 
bool get_eightbit_ansi () const
 
bool get_vt100_mode () const
 
bool get_disable_break () const
 
bool get_speaker_beep () const
 
bool get_do_beep () const
 
bool get_preserve_colors () const
 
bool get_wrapline () const
 
bool get_fast_write () const
 
bool get_lock_linewrap () const
 
bool get_set_title () const
 
int get_term_width () const
 
int get_term_height () const
 
int get_window_width () const
 
int get_window_height () const
 
bool get_wide_enable () const
 
bool get_control_break_as_c () const
 
int get_buffer_size () const
 
int get_blink_bg () const
 
int get_blink_fg () const
 
int get_underline_bg () const
 
int get_underline_fg () const
 
int get_ulblink_bg () const
 
int get_ulblink_fg () const
 
int get_normal_bg () const
 
int get_normal_fg () const
 
int get_scroll_bg () const
 
int get_scroll_fg () const
 
int get_status_bg () const
 
int get_status_fg () const
 
bool get_enable_mouse () const
 
char get_escape_key () const
 
char get_scrollback_key () const
 
char get_dial_key () const
 
bool get_alt_erase () const
 
bool get_keyboard_paste () const
 
const charget_scroll_mode () const
 
bool get_scroll_enable () const
 
int get_scroll_size () const
 
const charget_scriptname () const
 
bool get_script_enable () const
 
const charget_netpipe () const
 
const charget_iopipe () const
 
const charget_host () const
 
const charget_port () const
 
void init (char *dirname, char *exename)
 
bool Process_Params (int argc, char *argv[])
 
void print_vars ()
 
void print_vars (char *s)
 
void print_groups ()
 
bool set_value (const char *var, const char *value)
 
int print_value (const char *var)
 
void print_aliases ()
 
bool find_alias (const char *alias_name)
 

Private Member Functions

void inifile_init ()
 
void keyfile_init ()
 
void redir_init ()
 
void init_varlist ()
 
void init_vars ()
 
void init_aliases ()
 
void set_string (char *dest, const char *src, const int length)
 
void set_bool (bool *boolval, const char *str)
 

Private Attributes

char startdir [MAX_PATH]
 
char exename [MAX_PATH]
 
char keyfile [MAX_PATH *2]
 
char inifile [MAX_PATH *2]
 
char dumpfile [MAX_PATH *2]
 
char printer_name [MAX_PATH *2]
 
char term [128]
 
char default_config [128]
 
int input_redir
 
int output_redir
 
bool strip_redir
 
bool dstrbksp
 
bool eightbit_ansi
 
bool vt100_mode
 
bool disable_break
 
bool speaker_beep
 
bool do_beep
 
bool preserve_colors
 
bool wrapline
 
bool lock_linewrap
 
bool fast_write
 
bool set_title
 
int term_width
 
int term_height
 
int window_width
 
int window_height
 
bool wide_enable
 
bool ctrlbreak_as_ctrlc
 
int buffer_size
 
int blink_bg
 
int blink_fg
 
int underline_bg
 
int underline_fg
 
int ulblink_bg
 
int ulblink_fg
 
int normal_bg
 
int normal_fg
 
int scroll_bg
 
int scroll_fg
 
int status_bg
 
int status_fg
 
bool enable_mouse
 
char escape_key [2]
 
char scrollback_key [2]
 
char dial_key [2]
 
bool alt_erase
 
bool keyboard_paste
 
char scroll_mode [8]
 
bool scroll_enable
 
int scroll_size
 
char scriptname [MAX_PATH *2]
 
bool script_enable
 
char netpipe [MAX_PATH *2]
 
char iopipe [MAX_PATH *2]
 
char host [128]
 
const charport
 
char ** aliases
 
int alias_total
 

Detailed Description

Definition at line 26 of file tnconfig.h.

Constructor & Destructor Documentation

◆ TConfig()

TConfig::TConfig ( )

Definition at line 47 of file tnconfig.cpp.

47 {
48 // set all default values
49 startdir[0] = '\0';
50 keyfile[0] = '\0';
51 inifile[0] = '\0';
52 dumpfile[0] = '\0';
53 term[0] = '\0';
54 default_config[0] = '\0';
55 strcpy(printer_name, "LPT1");
56
57 input_redir = 0;
58 output_redir = 0;
60
66 do_beep = TRUE;
68 wrapline = TRUE;
76
77 blink_bg = -1;
78 blink_fg = 2;
79 underline_bg = -1;
80 underline_fg = 3;
81 ulblink_bg = -1;
82 ulblink_fg = 1;
83 normal_bg = -1;
84 normal_fg = -1;
85 scroll_bg = 0;
86 scroll_fg = 7;
87 status_bg = 1;
88 status_fg = 15;
89
90 buffer_size = 2048;
91
92 term_width = -1;
93 term_height = -1;
94 window_width = -1;
95 window_height = -1;
96
97 strcpy(escape_key, "]");
99 strcpy(dial_key, "\\");
100 strcpy(default_config, "ANSI");
101 strcpy(term, "ansi");
102
103 strcpy(scroll_mode, "DUMP");
104 scroll_size=32000;
106
107 host[0] = '\0';
108 port = "23";
109
110 init_varlist();
111
112 aliases = NULL;
113}
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
int blink_fg
Definition: tnconfig.h:163
int underline_fg
Definition: tnconfig.h:165
int ulblink_bg
Definition: tnconfig.h:166
int blink_bg
Definition: tnconfig.h:162
char host[128]
Definition: tnconfig.h:199
int normal_fg
Definition: tnconfig.h:169
bool dstrbksp
Definition: tnconfig.h:144
bool alt_erase
Definition: tnconfig.h:182
char startdir[MAX_PATH]
Definition: tnconfig.h:132
bool eightbit_ansi
Definition: tnconfig.h:145
bool lock_linewrap
Definition: tnconfig.h:152
bool disable_break
Definition: tnconfig.h:147
char escape_key[2]
Definition: tnconfig.h:179
int ulblink_fg
Definition: tnconfig.h:167
bool strip_redir
Definition: tnconfig.h:143
int normal_bg
Definition: tnconfig.h:168
int scroll_fg
Definition: tnconfig.h:171
int underline_bg
Definition: tnconfig.h:164
void init_varlist()
Definition: tnconfig.cpp:211
char keyfile[MAX_PATH *2]
Definition: tnconfig.h:134
int status_bg
Definition: tnconfig.h:172
bool enable_mouse
Definition: tnconfig.h:176
char ** aliases
Definition: tnconfig.h:203
int status_fg
Definition: tnconfig.h:173
int term_height
Definition: tnconfig.h:155
bool fast_write
Definition: tnconfig.h:153
char default_config[128]
Definition: tnconfig.h:139
char term[128]
Definition: tnconfig.h:138
bool scroll_enable
Definition: tnconfig.h:187
int term_width
Definition: tnconfig.h:155
bool speaker_beep
Definition: tnconfig.h:148
int buffer_size
Definition: tnconfig.h:159
int window_width
Definition: tnconfig.h:156
int output_redir
Definition: tnconfig.h:142
char scrollback_key[2]
Definition: tnconfig.h:180
int scroll_size
Definition: tnconfig.h:188
bool preserve_colors
Definition: tnconfig.h:150
char inifile[MAX_PATH *2]
Definition: tnconfig.h:135
int input_redir
Definition: tnconfig.h:142
int scroll_bg
Definition: tnconfig.h:170
char dial_key[2]
Definition: tnconfig.h:181
bool wide_enable
Definition: tnconfig.h:157
char dumpfile[MAX_PATH *2]
Definition: tnconfig.h:136
int window_height
Definition: tnconfig.h:156
bool do_beep
Definition: tnconfig.h:149
bool wrapline
Definition: tnconfig.h:151
char printer_name[MAX_PATH *2]
Definition: tnconfig.h:137
bool vt100_mode
Definition: tnconfig.h:146
const char * port
Definition: tnconfig.h:200
bool keyboard_paste
Definition: tnconfig.h:183
bool set_title
Definition: tnconfig.h:154
char scroll_mode[8]
Definition: tnconfig.h:186
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117

◆ ~TConfig()

TConfig::~TConfig ( )

Definition at line 115 of file tnconfig.cpp.

115 {
116 if(aliases) {
117 for(int j = 0; j < alias_total; j++) delete[] aliases[j];
118 delete[] aliases;
119 }
120}
int alias_total
Definition: tnconfig.h:204
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 GLint GLint j
Definition: glfuncs.h:250

Member Function Documentation

◆ find_alias()

bool TConfig::find_alias ( const char alias_name)

◆ get_alt_erase()

bool TConfig::get_alt_erase ( ) const
inline

Definition at line 85 of file tnconfig.h.

85{return alt_erase;}

Referenced by FindClosestKey().

◆ get_blink_bg()

int TConfig::get_blink_bg ( ) const
inline

Definition at line 65 of file tnconfig.h.

65{return blink_bg;}

Referenced by TConsole::BlinkOff(), TConsole::BlinkOn(), and TConsole::UnderlineOff().

◆ get_blink_fg()

int TConfig::get_blink_fg ( ) const
inline

Definition at line 66 of file tnconfig.h.

66{return blink_fg;}

Referenced by TConsole::BlinkOff(), TConsole::BlinkOn(), and TConsole::UnderlineOff().

◆ get_buffer_size()

int TConfig::get_buffer_size ( ) const
inline

Definition at line 62 of file tnconfig.h.

62{return buffer_size;}

Referenced by TTelnetHandler::TTelnetHandler().

◆ get_control_break_as_c()

bool TConfig::get_control_break_as_c ( ) const
inline

Definition at line 61 of file tnconfig.h.

61{return ctrlbreak_as_ctrlc;}
bool ctrlbreak_as_ctrlc
Definition: tnconfig.h:158

Referenced by ControlEventHandler(), and Telnet::Open().

◆ get_default_config()

const char * TConfig::get_default_config ( ) const
inline

Definition at line 39 of file tnconfig.h.

39{return default_config;}

Referenced by Telnet::DoInit().

◆ get_dial_key()

char TConfig::get_dial_key ( ) const
inline

Definition at line 84 of file tnconfig.h.

84{return dial_key[0];}

Referenced by TMapLoader::LoadKeyMap().

◆ get_disable_break()

bool TConfig::get_disable_break ( ) const
inline

Definition at line 48 of file tnconfig.h.

48{return disable_break;}

Referenced by Telnet::Close(), and Telnet::Open().

◆ get_do_beep()

bool TConfig::get_do_beep ( ) const
inline

Definition at line 50 of file tnconfig.h.

50{return do_beep;}

Referenced by TConsole::Beep().

◆ get_dstrbksp()

bool TConfig::get_dstrbksp ( ) const
inline

Definition at line 45 of file tnconfig.h.

45{return dstrbksp;}

Referenced by TANSIParser::ParseANSIBuffer().

◆ get_dumpfile()

const char * TConfig::get_dumpfile ( ) const
inline

Definition at line 36 of file tnconfig.h.

36{return dumpfile;}

Referenced by TANSIParser::TANSIParser().

◆ get_eightbit_ansi()

bool TConfig::get_eightbit_ansi ( ) const
inline

Definition at line 46 of file tnconfig.h.

46{return eightbit_ansi;}

Referenced by TANSIParser::ParseANSIBuffer().

◆ get_enable_mouse()

bool TConfig::get_enable_mouse ( ) const
inline

Definition at line 79 of file tnconfig.h.

79{return enable_mouse;}

Referenced by telProcessConsole().

◆ get_escape_key()

char TConfig::get_escape_key ( ) const
inline

Definition at line 82 of file tnconfig.h.

82{return escape_key[0];}

Referenced by Telnet::Connect(), and TMapLoader::LoadKeyMap().

◆ get_exename()

const char * TConfig::get_exename ( ) const
inline

Definition at line 33 of file tnconfig.h.

33{return exename;}
char exename[MAX_PATH]
Definition: tnconfig.h:133

Referenced by Telnet::NewProcess().

◆ get_fast_write()

bool TConfig::get_fast_write ( ) const
inline

Definition at line 53 of file tnconfig.h.

53{return fast_write;}

Referenced by TANSIParser::TANSIParser(), and TCharmap::TCharmap().

◆ get_host()

const char * TConfig::get_host ( ) const
inline

Definition at line 102 of file tnconfig.h.

102{return host;}

Referenced by main().

◆ get_inifile()

const char * TConfig::get_inifile ( ) const
inline

Definition at line 35 of file tnconfig.h.

35{return inifile;}

◆ get_input_redir()

int TConfig::get_input_redir ( ) const
inline

Definition at line 42 of file tnconfig.h.

42{return input_redir;}

Referenced by cfgets(), and telProcessConsole().

◆ get_iopipe()

const char * TConfig::get_iopipe ( ) const
inline

Definition at line 99 of file tnconfig.h.

99{return iopipe;}
char iopipe[MAX_PATH *2]
Definition: tnconfig.h:196

◆ get_keyboard_paste()

bool TConfig::get_keyboard_paste ( ) const
inline

Definition at line 86 of file tnconfig.h.

86{return keyboard_paste;}

Referenced by do_op().

◆ get_keyfile()

const char * TConfig::get_keyfile ( ) const
inline

Definition at line 34 of file tnconfig.h.

34{return keyfile;}

Referenced by Telnet::DoInit(), and telCommandLine().

◆ get_lock_linewrap()

bool TConfig::get_lock_linewrap ( ) const
inline

Definition at line 54 of file tnconfig.h.

54{return lock_linewrap;}

Referenced by TConsole::setLineWrap().

◆ get_netpipe()

const char * TConfig::get_netpipe ( ) const
inline

Definition at line 98 of file tnconfig.h.

98{return netpipe;}
char netpipe[MAX_PATH *2]
Definition: tnconfig.h:195

Referenced by Telnet::Open().

◆ get_normal_bg()

int TConfig::get_normal_bg ( ) const
inline

Definition at line 71 of file tnconfig.h.

71{return normal_bg;}

Referenced by TANSIParser::ConSetAttribute(), TMouse::doMouse(), and TConsole::TConsole().

◆ get_normal_fg()

int TConfig::get_normal_fg ( ) const
inline

Definition at line 72 of file tnconfig.h.

72{return normal_fg;}

Referenced by TANSIParser::ConSetAttribute(), TMouse::doMouse(), and TConsole::TConsole().

◆ get_output_redir()

int TConfig::get_output_redir ( ) const
inline

Definition at line 43 of file tnconfig.h.

43{return output_redir;}

Referenced by TANSIParser::ParseBuffer(), and printit().

◆ get_port()

const char * TConfig::get_port ( ) const
inline

Definition at line 103 of file tnconfig.h.

103{return port;}

Referenced by main().

◆ get_preserve_colors()

bool TConfig::get_preserve_colors ( ) const
inline

Definition at line 51 of file tnconfig.h.

51{return preserve_colors;}

Referenced by TConsole::Normal().

◆ get_printer_name()

const char * TConfig::get_printer_name ( ) const
inline

Definition at line 38 of file tnconfig.h.

38{return printer_name;}

Referenced by TANSIParser::ParseEscapeANSI().

◆ get_script_enable()

bool TConfig::get_script_enable ( ) const
inline

Definition at line 95 of file tnconfig.h.

95{return script_enable;}
bool script_enable
Definition: tnconfig.h:192

◆ get_scriptname()

const char * TConfig::get_scriptname ( ) const
inline

Definition at line 94 of file tnconfig.h.

94{return scriptname;}
char scriptname[MAX_PATH *2]
Definition: tnconfig.h:191

◆ get_scroll_bg()

int TConfig::get_scroll_bg ( ) const
inline

Definition at line 73 of file tnconfig.h.

73{return scroll_bg;}

Referenced by TScroller::ScrollBack().

◆ get_scroll_enable()

bool TConfig::get_scroll_enable ( ) const
inline

Definition at line 90 of file tnconfig.h.

90{return scroll_enable;}

Referenced by TANSIParser::ParseBuffer().

◆ get_scroll_fg()

int TConfig::get_scroll_fg ( ) const
inline

Definition at line 74 of file tnconfig.h.

74{return scroll_fg;}

Referenced by TScroller::ScrollBack().

◆ get_scroll_mode()

const char * TConfig::get_scroll_mode ( ) const
inline

Definition at line 89 of file tnconfig.h.

89{return scroll_mode;}

Referenced by TScroller::TScroller().

◆ get_scroll_size()

int TConfig::get_scroll_size ( ) const
inline

Definition at line 91 of file tnconfig.h.

91{return scroll_size;}

◆ get_scrollback_key()

char TConfig::get_scrollback_key ( ) const
inline

Definition at line 83 of file tnconfig.h.

83{return scrollback_key[0];}

Referenced by TMapLoader::LoadKeyMap().

◆ get_set_title()

bool TConfig::get_set_title ( ) const
inline

Definition at line 55 of file tnconfig.h.

55{ return set_title;}

Referenced by telCommandLine(), and Telnet::telSetConsoleTitle().

◆ get_speaker_beep()

bool TConfig::get_speaker_beep ( ) const
inline

Definition at line 49 of file tnconfig.h.

49{return speaker_beep;}

Referenced by TConsole::Beep().

◆ get_startdir()

const char * TConfig::get_startdir ( ) const
inline

Definition at line 32 of file tnconfig.h.

32{return startdir;}

Referenced by Telnet::DoInit(), and Telnet::NewProcess().

◆ get_status_bg()

int TConfig::get_status_bg ( ) const
inline

Definition at line 75 of file tnconfig.h.

75{return status_bg;}

Referenced by TScroller::ScrollBack().

◆ get_status_fg()

int TConfig::get_status_fg ( ) const
inline

Definition at line 76 of file tnconfig.h.

76{return status_fg;}

Referenced by TScroller::ScrollBack().

◆ get_strip_redir()

bool TConfig::get_strip_redir ( ) const
inline

Definition at line 44 of file tnconfig.h.

44{return strip_redir;}

Referenced by TANSIParser::ParseBuffer().

◆ get_term()

const char * TConfig::get_term ( ) const
inline

Definition at line 37 of file tnconfig.h.

37{return term;}

Referenced by TTelnetHandler::ParseIAC().

◆ get_term_height()

int TConfig::get_term_height ( ) const
inline

Definition at line 57 of file tnconfig.h.

57{return term_height;}

Referenced by main(), and TConsole::TConsole().

◆ get_term_width()

int TConfig::get_term_width ( ) const
inline

Definition at line 56 of file tnconfig.h.

56{return term_width;}

Referenced by main(), and TConsole::TConsole().

◆ get_ulblink_bg()

int TConfig::get_ulblink_bg ( ) const
inline

Definition at line 69 of file tnconfig.h.

69{return ulblink_bg;}

Referenced by TConsole::UlBlinkOn().

◆ get_ulblink_fg()

int TConfig::get_ulblink_fg ( ) const
inline

Definition at line 70 of file tnconfig.h.

70{return ulblink_fg;}

Referenced by TConsole::UlBlinkOn().

◆ get_underline_bg()

int TConfig::get_underline_bg ( ) const
inline

Definition at line 67 of file tnconfig.h.

67{return underline_bg;}

Referenced by TConsole::UnderlineOn().

◆ get_underline_fg()

int TConfig::get_underline_fg ( ) const
inline

Definition at line 68 of file tnconfig.h.

68{return underline_fg;}

Referenced by TConsole::UnderlineOn().

◆ get_vt100_mode()

bool TConfig::get_vt100_mode ( ) const
inline

Definition at line 47 of file tnconfig.h.

47{return vt100_mode;}

Referenced by TANSIParser::ParseEscape(), TConsole::WriteString(), and TConsole::WriteStringFast().

◆ get_wide_enable()

bool TConfig::get_wide_enable ( ) const
inline

Definition at line 60 of file tnconfig.h.

60{return wide_enable;}

Referenced by TANSIParser::ParseEscapeANSI().

◆ get_window_height()

int TConfig::get_window_height ( ) const
inline

Definition at line 59 of file tnconfig.h.

59{return window_height;}

◆ get_window_width()

int TConfig::get_window_width ( ) const
inline

Definition at line 58 of file tnconfig.h.

58{return window_width;}

◆ get_wrapline()

bool TConfig::get_wrapline ( ) const
inline

Definition at line 52 of file tnconfig.h.

52{return wrapline;}

Referenced by TConsole::getLineWrap().

◆ inifile_init()

void TConfig::inifile_init ( )
private

Definition at line 526 of file tnconfig.cpp.

526 {
527 // B. K. Oxley 9/16/98
528 char* env_telnet_ini = getenv (ENV_TELNET_INI);
529 if (env_telnet_ini && *env_telnet_ini) {
530 strncpy (inifile, env_telnet_ini, sizeof(inifile));
531 return;
532 }
533
535 if (sizeof(inifile) >= strlen(inifile)+strlen("telnet.ini")) {
536 strcat(inifile,"telnet.ini"); // add the default filename to the path
537 } else {
538 // if there is not enough room set the path to nothing
539 strcpy(inifile,"");
540 }
541}
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
Definition: utclib.c:427
_Check_return_ char *__cdecl getenv(_In_z_ const char *_VarName)
#define ENV_TELNET_INI
Definition: tnconfig.h:24

Referenced by init().

◆ init()

void TConfig::init ( char dirname,
char exename 
)

Definition at line 282 of file tnconfig.cpp.

282 {
283 // Copy temporary dirname to permanent startdir
284 strncpy(startdir, dirname, sizeof(startdir));
285 startdir[sizeof(startdir) - 1] = 0;
286
287 // Copy temp execname to permanent exename (Thomas Briggs 12/7/98)
288 strncpy(exename, execname, sizeof(exename));
289 exename[sizeof(exename) - 1] = 0;
290
291 // Initialize INI file
292 inifile_init();
293
294 // Initialize redir
295 // Note that this must be done early, so error messages will be printed
296 // properly
297 redir_init();
298
299 // Initialize aliases (Paul Brannan 1/1/99)
300 init_aliases();
301
302 // Make sure the file that we're trying to work with exists
303 int iResult = access(inifile, 04);
304
305 // Thomas Briggs 9/14/98
306 if( iResult == 0 )
307 // Tell the user what file we are reading
308 // We cannot print any messages before initializing telnet_redir
310 else
311 // Tell the user that the file doesn't exist, but later read the
312 // file anyway simply to populate the defaults
314
315 init_vars(); // Initialize misc. vars
316 keyfile_init(); // Initialize keyfile
317}
#define MSG_CONFIG
Definition: resource.h:19
#define MSG_NOINI
Definition: resource.h:20
void init_vars()
Definition: tnconfig.cpp:515
void init_aliases()
Definition: tnconfig.cpp:320
void redir_init()
Definition: tnconfig.cpp:596
void keyfile_init()
Definition: tnconfig.cpp:543
void inifile_init()
Definition: tnconfig.cpp:526
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
__cdecl __MINGW_NOTHROW char * dirname(char *)
int printm(LPTSTR szModule, BOOL fSystem, DWORD dwMessageId,...)
Definition: tnerror.cpp:84

Referenced by main().

◆ init_aliases()

void TConfig::init_aliases ( )
private

Definition at line 320 of file tnconfig.cpp.

320 {
321 char *buffer;
322 alias_total = 0;
323
324 // Find the correct buffer size
325 // FIX ME!! some implementations of Mingw32 don't have a
326 // GetPrivateProfileSecionNames function. What do we do about this?
327#ifndef __MINGW32__
328 {
329 int size=1024, Result = 0;
330 for(;;) {
331 buffer = new char[size];
333 if(Result < size - 2) break;
334 size *= 2;
335 delete[] buffer;
336 }
337 }
338#else
339 return;
340#endif
341
342 // Find the maximum number of aliases
343 int max = 0;
344 char *tmp;
345 for(tmp = buffer; *tmp != 0; tmp += strlen(tmp) + 1)
346 max++;
347
348 aliases = new char*[max];
349
350 // Load the aliases into an array
351 for(tmp = buffer; *tmp != 0; tmp += strlen(tmp) + 1) {
352 int flag = 0;
353 for(int j = 0; j < MAX_INI_GROUPS; j++) {
354 if(!stricmp(ini_groups[j], tmp)) flag = 1;
355 }
356 if(!flag) {
357 aliases[alias_total] = new char[strlen(tmp)+1];
359 alias_total++;
360 }
361 }
362
363 delete[] buffer;
364}
#define stricmp(_String1, _String2)
Definition: compat.h:24
GLsizeiptr size
Definition: glext.h:5919
GLuint buffer
Definition: glext.h:5915
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 flag
Definition: glfuncs.h:52
#define max(a, b)
Definition: svc.c:63
@ MAX_INI_GROUPS
Definition: tnconfig.cpp:206
char * ini_groups[MAX_INI_GROUPS]
Definition: tnconfig.cpp:209
#define GetPrivateProfileSectionNames
Definition: winbase.h:3834
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409

Referenced by init().

◆ init_varlist()

void TConfig::init_varlist ( )
private

Definition at line 211 of file tnconfig.cpp.

211 {
212 static const ini_variable static_ini_varlist[MAX_INI_VARS] = {
213 {"Inifile", NULL, INI_STRING, &inifile, sizeof(inifile)},
214 {"Keyfile", "Keyboard", INI_STRING, &keyfile, sizeof(keyfile)},
215 {"Dumpfile", "Terminal", INI_STRING, &dumpfile, sizeof(dumpfile)},
216 {"Default_Config","Keyboard", INI_STRING, &default_config, sizeof(default_config)},
217 {"Term", "Terminal", INI_STRING, &term, sizeof(term)},
218 {"Input_Redir", "Terminal", INI_INT, &input_redir, 0},
219 {"Output_Redir","Terminal", INI_INT, &output_redir, 0},
220 {"Strip_Redir", "Terminal", INI_BOOL, &strip_redir, 0},
221 {"Destructive_Backspace","Terminal",INI_BOOL, &dstrbksp, 0},
222 {"EightBit_Ansi","Terminal", INI_BOOL, &eightbit_ansi, 0},
223 {"VT100_Mode", "Terminal", INI_BOOL, &vt100_mode, 0},
224 {"Disable_Break","Terminal", INI_BOOL, &disable_break, 0},
225 {"Speaker_Beep","Terminal", INI_BOOL, &speaker_beep, 0},
226 {"Beep", "Terminal", INI_BOOL, &do_beep, 0},
227 {"Preserve_Colors","Terminal", INI_BOOL, &preserve_colors, 0},
228 {"Wrap_Line", "Terminal", INI_BOOL, &wrapline, 0},
229 {"Lock_linewrap","Terminal", INI_BOOL, &lock_linewrap, 0},
230 {"Fast_Write", "Terminal", INI_BOOL, &fast_write, 0},
231 {"Term_Width", "Terminal", INI_INT, &term_width, 0},
232 {"Term_Height", "Terminal", INI_INT, &term_height, 0},
233 {"Window_Width","Terminal", INI_INT, &window_width, 0},
234 {"Window_Height","Terminal", INI_INT, &window_height, 0},
235 {"Wide_Enable", "Terminal", INI_BOOL, &wide_enable, 0},
236 {"Ctrlbreak_as_Ctrlc","Keyboard", INI_BOOL, &ctrlbreak_as_ctrlc, 0},
237 {"Buffer_Size", "Terminal", INI_INT, &buffer_size, 0},
238 {"Set_Title", "Terminal", INI_BOOL, &set_title, 0},
239 {"Blink_bg", "Colors", INI_INT, &blink_bg, 0},
240 {"Blink_fg", "Colors", INI_INT, &blink_fg, 0},
241 {"Underline_bg","Colors", INI_INT, &underline_bg, 0},
242 {"Underline_fg","Colors", INI_INT, &underline_fg, 0},
243 {"UlBlink_bg", "Colors", INI_INT, &ulblink_bg, 0},
244 {"UlBlink_fg", "Colors", INI_INT, &ulblink_fg, 0},
245 {"Normal_bg", "Colors", INI_INT, &normal_bg, 0},
246 {"Normal_fg", "Colors", INI_INT, &normal_fg, 0},
247 {"Scroll_bg", "Colors", INI_INT, &scroll_bg, 0},
248 {"Scroll_fg", "Colors", INI_INT, &scroll_fg, 0},
249 {"Status_bg", "Colors", INI_INT, &status_bg, 0},
250 {"Status_fg", "Colors", INI_INT, &status_fg, 0},
251 {"Enable_Mouse","Mouse", INI_BOOL, &enable_mouse, 0},
252 {"Printer_Name","Printer", INI_STRING, &printer_name, sizeof(printer_name)},
253 {"Escape_Key", "Keyboard", INI_STRING, &escape_key, 1},
254 {"Scrollback_Key","Keyboard", INI_STRING, &scrollback_key, 1},
255 {"Dial_Key", "Keyboard", INI_STRING, &dial_key, 1},
256 {"Alt_Erase", "Keyboard", INI_BOOL, &alt_erase, 0},
257 {"Keyboard_Paste","Keyboard", INI_BOOL, &keyboard_paste, 0},
258 {"Scroll_Mode", "Scrollback", INI_STRING, &scroll_mode, sizeof(scroll_mode)},
259 {"Scroll_Size", "Scrollback", INI_INT, &scroll_size, 0},
260 {"Scroll_Enable","Scrollback", INI_BOOL, &scroll_enable, 0},
261 {"Scriptname", "Scripting", INI_STRING, &scriptname, sizeof(scriptname)},
262 {"Script_enable","Scripting", INI_BOOL, &script_enable, 0},
263 {"Netpipe", "Pipes", INI_STRING, &netpipe, sizeof(netpipe)},
264 {"Iopipe", "Pipes", INI_STRING, &iopipe, sizeof(iopipe)}
265 };
266
267 static const char *static_ini_groups[MAX_INI_GROUPS] = {
268 "Keyboard",
269 "Terminal",
270 "Colors",
271 "Mouse",
272 "Printer",
273 "Scrollback",
274 "Scripting",
275 "Pipes"
276 };
277
278 memcpy(ini_varlist, static_ini_varlist, sizeof(ini_varlist));
279 memcpy(ini_groups, static_ini_groups, sizeof(ini_groups));
280}
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
@ INI_BOOL
Definition: tnconfig.cpp:125
@ INI_STRING
Definition: tnconfig.cpp:123
@ INI_INT
Definition: tnconfig.cpp:124
@ MAX_INI_VARS
Definition: tnconfig.cpp:182
ini_variable ini_varlist[MAX_INI_VARS]
Definition: tnconfig.cpp:194

Referenced by TConfig().

◆ init_vars()

void TConfig::init_vars ( )
private

Definition at line 515 of file tnconfig.cpp.

515 {
516 char buffer[4096];
517 for(int j = 0; j < MAX_INI_VARS; j++) {
518 if(ini_varlist[j].section != NULL) {
520 buffer, sizeof(buffer), inifile);
522 }
523 }
524}
bool set_value(const char *var, const char *value)
Definition: tnconfig.cpp:442
Definition: name.c:39
Definition: parser.c:56
#define GetPrivateProfileString
Definition: winbase.h:3835

Referenced by init().

◆ keyfile_init()

void TConfig::keyfile_init ( )
private

Definition at line 543 of file tnconfig.cpp.

543 {
544 // check to see if there is a key config file environment variable.
545 char *k;
546 if ((k = getenv(ENV_TELNET_CFG)) == NULL){
547 // if there is no environment variable
548 GetPrivateProfileString("Keyboard", "Keyfile", "", keyfile,
549 sizeof(keyfile), inifile);
550 if(keyfile == 0 || *keyfile == 0) {
551 // and there is no profile string
553 if (sizeof(keyfile) >= strlen(keyfile)+strlen("telnet.cfg")) {
554 struct stat buf;
555
556 strcat(keyfile,"telnet.cfg"); // add the default filename to the path
557 if(stat(keyfile, &buf) != 0) {
558 char *s = keyfile + strlen(keyfile) - strlen("telnet.cfg");
559 strcpy(s, "keys.cfg");
560 }
561 } else {
562 // if there is not enough room set the path to nothing
563 strcpy(keyfile,"");
564 }
565
566 // Vassili Bourdo (vassili_bourdo@softhome.net)
567 } else {
568 // check that keyfile really exists
569 if( access(keyfile,04) == -1 ) {
570 //it does not...
571 char pathbuf[MAX_PATH], *fn;
572 //substitute keyfile path with startdir path
573 if((fn = strrchr(keyfile,'\\'))) strcpy(keyfile,fn);
574 strcat(strcpy(pathbuf,startdir),keyfile);
575 //check that startdir\keyfile does exist
576 if( access(pathbuf,04) == -1 ) {
577 //it does not...
578 //so, look for it in all paths
579 _searchenv(keyfile, "PATH", pathbuf);
580 if( *pathbuf == 0 ) //no luck - revert it to INI file value
581 GetPrivateProfileString("Keyboard", "Keyfile", "",
582 keyfile, sizeof(keyfile), inifile);
583 } else {
584 strcpy(keyfile, pathbuf);
585 }
586 }
587 }
589
590 } else {
591 // set the keyfile to the value of the environment variable
592 strncpy(keyfile, k, sizeof(keyfile));
593 }
594}
#define stat
Definition: acwin.h:99
#define MAX_PATH
Definition: compat.h:34
GLdouble s
Definition: gl.h:2039
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
_CRTIMP void __cdecl _searchenv(_In_z_ const char *_Filename, _In_z_ const char *_EnvVar, _Pre_notnull_ _Post_z_ char *_ResultPath)
int k
Definition: mpi.c:3369
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
Definition: stat.h:55
#define ENV_TELNET_CFG
Definition: tnconfig.h:20
static GLenum _GLUfuncptr fn
Definition: wgl_font.c:159

Referenced by init().

◆ print_aliases()

void TConfig::print_aliases ( )

Definition at line 366 of file tnconfig.cpp.

366 {
367 for(int j = 0; j < alias_total; j++) {
368 char alias_name[20];
369 set_string(alias_name, aliases[j], sizeof(alias_name));
370 for(unsigned int i = strlen(alias_name); i < sizeof(alias_name) - 1; i++)
371 alias_name[i] = ' ';
372 alias_name[sizeof(alias_name) - 1] = 0;
373 printit(alias_name);
374 if((j % 4) == 3) printit("\n");
375 }
376 printit("\n");
377}
void set_string(char *dest, const char *src, const int length)
Definition: tnconfig.cpp:682
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 printit(const char *it)
Definition: tnerror.cpp:58

Referenced by telCommandLine().

◆ print_groups()

void TConfig::print_groups ( )

Definition at line 426 of file tnconfig.cpp.

426 {
427 for(int j = 0; j < MAX_INI_GROUPS; j++) {
428 char group_name[20];
429 set_string(group_name, ini_groups[j], sizeof(group_name));
430 for(unsigned int i = strlen(group_name); i < sizeof(group_name) - 1; i++)
431 group_name[i] = ' ';
432 group_name[sizeof(group_name) - 1] = 0;
433 printit(group_name);
434 if((j % 4) == 3) printit("\n");
435 }
436 printit("\n");
437}

Referenced by telCommandLine().

◆ print_value()

int TConfig::print_value ( const char var)

Definition at line 468 of file tnconfig.cpp.

468 {
469 //int j = 0;
470 //while(strcmp(var, ini_varlist[j].name) && j < MAX_INI_VARS) j++;
471 int Result = 0;
472 for (int j = 0; j < MAX_INI_VARS; j++)
473 {
474 if (stricmp(var, ini_varlist[j].name) == 0)
475 {
476 char var_name[25];
477 set_string(var_name, var, sizeof(var_name));
478 for(unsigned int i = strlen(var_name); i < sizeof(var_name) - 1; i++)
479 var_name[i] = ' ';
480 var_name[sizeof(var_name) - 1] = 0;
481 Result = sizeof(var_name);
482
483 printit(var_name);
484 printit("\t");
485 Result = Result / 8 + 8;
486
487 switch(ini_varlist[j].data_type) {
488 case INI_STRING:
489 printit((char *)ini_varlist[j].ini_data);
490 Result += strlen((char *)ini_varlist[j].ini_data);
491 break;
492 case INI_INT:
493 char buffer[20]; // this may not be safe
494 // Ioannou : Paul this was _itoa, but Borland needs itoa !!
495 itoa(*(int *)ini_varlist[j].ini_data, buffer, 10);
497 Result += strlen(buffer);
498 break;
499 case INI_BOOL:
500 if(*(bool *)ini_varlist[j].ini_data == true) {
501 printit("on");
502 Result += 2;
503 } else {
504 printit("off");
505 Result += 3;
506 }
507 }
508 // printit("\n");
509 j = MAX_INI_VARS;
510 }
511 }
512 return Result;
513}
_CRTIMP char *__cdecl itoa(_In_ int _Val, _Pre_notnull_ _Post_z_ char *_DstBuf, _In_ int _Radix)
const char * var
Definition: shader.c:5666

Referenced by print_vars().

◆ print_vars() [1/2]

void TConfig::print_vars ( )

Definition at line 383 of file tnconfig.cpp.

383 {
384 int j;
385 for(j = 0; j < MAX_INI_VARS; j++) {
386 if(print_value(ini_varlist[j].name) > 40) printit("\n");
387 else if(j % 2) printit("\n");
388 else printit("\t");
389 }
390 if(j % 2) printit("\n");
391}
int print_value(const char *var)
Definition: tnconfig.cpp:468

Referenced by print_vars(), and telCommandLine().

◆ print_vars() [2/2]

void TConfig::print_vars ( char s)

Definition at line 394 of file tnconfig.cpp.

394 {
395 if(!strnicmp(s, "all", 3)) { // Print out all vars
396 print_vars();
397 return;
398 }
399
400 // See if the group exists
401 int j;
402 for(j = 0; j < MAX_INI_GROUPS; j++)
403 if(!stricmp(ini_groups[j], s)) break;
404 // If not, print out the value of the variable by that name
405 if(j == MAX_INI_GROUPS) {
406 print_value(s);
407 printit("\n");
408 return;
409 }
410
411 // Print out the vars in the given group
412 int count = 0;
413 for(j = 0; j < MAX_INI_VARS; j++) {
414 if(ini_varlist[j].section == NULL) continue;
415 if(!stricmp(ini_varlist[j].section, s)) {
416 if(print_value(ini_varlist[j].name) > 40) printit("\n");
417 else if(count % 2) printit("\n");
418 else printit("\t");
419 count++;
420 }
421 }
422 if(count % 2) printit("\n");
423}
void print_vars()
Definition: tnconfig.cpp:383
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define strnicmp
Definition: xmlstorage.h:206

◆ Process_Params()

bool TConfig::Process_Params ( int  argc,
char argv[] 
)

Definition at line 619 of file tnconfig.cpp.

619 {
620 int optind = 1;
621 char *optarg = argv[optind];
622 char c;
623
624 while(optind < argc) {
625 if(argv[optind][0] != '-') break;
626
627 // getopt
628 c = argv[optind][1];
629 if(argv[optind][2] == 0)
630 optarg = argv[++optind];
631 else
632 optarg = &argv[optind][2];
633 optind++;
634
635 switch(c) {
636 case 'd':
639 break;
640 // added support for setting options on the command-line
641 // (Paul Brannan 7/31/98)
642 case '-':
643 {
644 int j;
645 for(j = 0; optarg[j] != ' ' && optarg[j] != '=' && optarg[j] != 0; j++);
646 if(optarg == 0) {
647 printm(0, FALSE, MSG_USAGE); // print a usage message
649 return FALSE;
650 }
651 optarg[j] = 0;
652 if(!set_value(optarg, &optarg[j+1]))
654 }
655 break;
656 default:
657 printm(0, FALSE, MSG_USAGE); // print a usage message
659 return FALSE;
660 }
661 }
662 if(optind < argc)
663 set_string(host, argv[optind++], sizeof(host)-1);
664 if(!strnicmp(host, "telnet://", 9)) {
665 // we have a URL to parse
666 char *s, *t;
667
668 for(s = host+9, t = host; *s != 0; *(t++) = *(s++));
669 *t = 0;
670 for(s = host; *s != ':' && *s != 0; s++);
671 if(*s != 0) {
672 *(s++) = 0;
673 port = s;
674 }
675 }
676 if(optind < argc)
677 port = argv[optind++];
678
679 return TRUE;
680}
static int argc
Definition: ServiceArgs.c:12
const char * optarg
Definition: getopt.c:49
int optind
Definition: getopt.c:47
#define MSG_USAGE_1
Definition: resource.h:6
#define MSG_DUMPFILE
Definition: resource.h:18
#define MSG_BADVAL
Definition: resource.h:21
#define MSG_USAGE
Definition: resource.h:5
GLdouble GLdouble t
Definition: gl.h:2047
const GLubyte * c
Definition: glext.h:8905
#define c
Definition: ke_i.h:80
#define argv
Definition: mplay32.c:18

Referenced by main().

◆ redir_init()

void TConfig::redir_init ( )
private

Definition at line 596 of file tnconfig.cpp.

596 {
597 // check to see if the environment variable 'TELNET_REDIR' is not 0;
598 char* p = getenv(ENV_TELNET_REDIR);
599 if (p) {
603 } else {
605 "Telnet_Redir", 0, inifile);
607 "Input_Redir", input_redir, inifile);
609 "Output_Redir", output_redir, inifile);
610 }
611 if ((input_redir > 1) || (output_redir > 1))
613 // tell isprint() to not ignore local characters, if the environment
614 // variable "LANG" has a valid value (e.g. LANG=de for german characters)
615 // and the file LOCALE.BLL is installed somewhere along the PATH.
616}
GLfloat GLfloat p
Definition: glext.h:8902
#define LC_CTYPE
Definition: locale.h:19
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
#define ENV_TELNET_REDIR
Definition: tnconfig.h:21
#define ENV_OUTPUT_REDIR
Definition: tnconfig.h:23
#define ENV_INPUT_REDIR
Definition: tnconfig.h:22
#define setlocale(n, s)
Definition: locale.h:46
#define GetPrivateProfileInt
Definition: winbase.h:3832

Referenced by init().

◆ set_bool()

void TConfig::set_bool ( bool boolval,
const char str 
)
private

Definition at line 696 of file tnconfig.cpp.

696 {
697 if(!stricmp(str, "true")) *boolval = true;
698 else if(!stricmp(str, "on")) *boolval = true;
699 else *boolval = (bool)atoi(str);
700}
#define bool
Definition: nsiface.idl:72
const WCHAR * str

Referenced by set_value().

◆ set_string()

void TConfig::set_string ( char dest,
const char src,
const int  length 
)
private

Definition at line 682 of file tnconfig.cpp.

682 {
683 int l = length;
684 strncpy(dest, src, l);
685 // dest[length-1] = '\0';
686 // Ioannou : this messes strings - is this really needed ?
687 // The target string, dest, might not be null-terminated
688 // if the length of src is length or more.
689 // it should be dest[length] = '\0' for strings with length 1
690 // (Escape_string etc), but doesn't work with others (like host).
691 // dest is long enough to avoid this in all the tested cases
692}
r l[0]
Definition: byte_order.h:168
GLenum src
Definition: glext.h:6340
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
static char * dest
Definition: rtl.c:135

Referenced by print_aliases(), print_groups(), print_value(), Process_Params(), and set_value().

◆ set_value()

bool TConfig::set_value ( const char var,
const char value 
)

Definition at line 442 of file tnconfig.cpp.

442 {
443 //int j = 0;
444 //while(strcmp(var, ini_varlist[j].name) && j < MAX_INI_VARS) j++;
445 for (int j = 0; j < MAX_INI_VARS; j++)
446 {
447 if (stricmp(var, ini_varlist[j].name) == 0)
448 {
449 switch(ini_varlist[j].data_type) {
450 case INI_STRING:
451 set_string((char *)ini_varlist[j].ini_data, value,
453 break;
454 case INI_INT:
455 *(int *)ini_varlist[j].ini_data = atoi(value);
456 break;
457 case INI_BOOL:
458 set_bool((bool *)ini_varlist[j].ini_data, value);
459 break;
460 }
461 // j = MAX_INI_VARS;
462 return TRUE;
463 }
464 }
465 return FALSE;
466}
static INT max_size
Definition: history.c:51
void set_bool(bool *boolval, const char *str)
Definition: tnconfig.cpp:696
Definition: pdh_main.c:94

Referenced by init_vars(), Process_Params(), TConsole::setLineWrap(), and telCommandLine().

Member Data Documentation

◆ alias_total

int TConfig::alias_total
private

Definition at line 204 of file tnconfig.h.

Referenced by init_aliases(), print_aliases(), and ~TConfig().

◆ aliases

char** TConfig::aliases
private

Definition at line 203 of file tnconfig.h.

Referenced by init_aliases(), print_aliases(), TConfig(), and ~TConfig().

◆ alt_erase

bool TConfig::alt_erase
private

Definition at line 182 of file tnconfig.h.

Referenced by get_alt_erase(), init_varlist(), and TConfig().

◆ blink_bg

int TConfig::blink_bg
private

Definition at line 162 of file tnconfig.h.

Referenced by get_blink_bg(), init_varlist(), and TConfig().

◆ blink_fg

int TConfig::blink_fg
private

Definition at line 163 of file tnconfig.h.

Referenced by get_blink_fg(), init_varlist(), and TConfig().

◆ buffer_size

int TConfig::buffer_size
private

Definition at line 159 of file tnconfig.h.

Referenced by get_buffer_size(), init_varlist(), and TConfig().

◆ ctrlbreak_as_ctrlc

bool TConfig::ctrlbreak_as_ctrlc
private

Definition at line 158 of file tnconfig.h.

Referenced by get_control_break_as_c(), and init_varlist().

◆ default_config

char TConfig::default_config[128]
private

Definition at line 139 of file tnconfig.h.

Referenced by get_default_config(), init_varlist(), and TConfig().

◆ dial_key

char TConfig::dial_key[2]
private

Definition at line 181 of file tnconfig.h.

Referenced by get_dial_key(), init_varlist(), and TConfig().

◆ disable_break

bool TConfig::disable_break
private

Definition at line 147 of file tnconfig.h.

Referenced by get_disable_break(), init_varlist(), and TConfig().

◆ do_beep

bool TConfig::do_beep
private

Definition at line 149 of file tnconfig.h.

Referenced by get_do_beep(), init_varlist(), and TConfig().

◆ dstrbksp

bool TConfig::dstrbksp
private

Definition at line 144 of file tnconfig.h.

Referenced by get_dstrbksp(), init_varlist(), and TConfig().

◆ dumpfile

char TConfig::dumpfile[MAX_PATH *2]
private

Definition at line 136 of file tnconfig.h.

Referenced by get_dumpfile(), init_varlist(), Process_Params(), and TConfig().

◆ eightbit_ansi

bool TConfig::eightbit_ansi
private

Definition at line 145 of file tnconfig.h.

Referenced by get_eightbit_ansi(), init_varlist(), and TConfig().

◆ enable_mouse

bool TConfig::enable_mouse
private

Definition at line 176 of file tnconfig.h.

Referenced by get_enable_mouse(), init_varlist(), and TConfig().

◆ escape_key

char TConfig::escape_key[2]
private

Definition at line 179 of file tnconfig.h.

Referenced by get_escape_key(), init_varlist(), and TConfig().

◆ exename

char TConfig::exename[MAX_PATH]
private

Definition at line 133 of file tnconfig.h.

Referenced by get_exename(), and init().

◆ fast_write

bool TConfig::fast_write
private

Definition at line 153 of file tnconfig.h.

Referenced by get_fast_write(), init_varlist(), and TConfig().

◆ host

char TConfig::host[128]
private

Definition at line 199 of file tnconfig.h.

Referenced by get_host(), Process_Params(), and TConfig().

◆ inifile

char TConfig::inifile[MAX_PATH *2]
private

◆ input_redir

int TConfig::input_redir
private

Definition at line 142 of file tnconfig.h.

Referenced by get_input_redir(), init_varlist(), redir_init(), and TConfig().

◆ iopipe

char TConfig::iopipe[MAX_PATH *2]
private

Definition at line 196 of file tnconfig.h.

Referenced by get_iopipe(), and init_varlist().

◆ keyboard_paste

bool TConfig::keyboard_paste
private

Definition at line 183 of file tnconfig.h.

Referenced by get_keyboard_paste(), init_varlist(), and TConfig().

◆ keyfile

char TConfig::keyfile[MAX_PATH *2]
private

Definition at line 134 of file tnconfig.h.

Referenced by get_keyfile(), init_varlist(), keyfile_init(), and TConfig().

◆ lock_linewrap

bool TConfig::lock_linewrap
private

Definition at line 152 of file tnconfig.h.

Referenced by get_lock_linewrap(), init_varlist(), and TConfig().

◆ netpipe

char TConfig::netpipe[MAX_PATH *2]
private

Definition at line 195 of file tnconfig.h.

Referenced by get_netpipe(), and init_varlist().

◆ normal_bg

int TConfig::normal_bg
private

Definition at line 168 of file tnconfig.h.

Referenced by get_normal_bg(), init_varlist(), and TConfig().

◆ normal_fg

int TConfig::normal_fg
private

Definition at line 169 of file tnconfig.h.

Referenced by get_normal_fg(), init_varlist(), and TConfig().

◆ output_redir

int TConfig::output_redir
private

Definition at line 142 of file tnconfig.h.

Referenced by get_output_redir(), init_varlist(), redir_init(), and TConfig().

◆ port

const char* TConfig::port
private

Definition at line 200 of file tnconfig.h.

Referenced by get_port(), Process_Params(), and TConfig().

◆ preserve_colors

bool TConfig::preserve_colors
private

Definition at line 150 of file tnconfig.h.

Referenced by get_preserve_colors(), init_varlist(), and TConfig().

◆ printer_name

char TConfig::printer_name[MAX_PATH *2]
private

Definition at line 137 of file tnconfig.h.

Referenced by get_printer_name(), init_varlist(), and TConfig().

◆ script_enable

bool TConfig::script_enable
private

Definition at line 192 of file tnconfig.h.

Referenced by get_script_enable(), and init_varlist().

◆ scriptname

char TConfig::scriptname[MAX_PATH *2]
private

Definition at line 191 of file tnconfig.h.

Referenced by get_scriptname(), and init_varlist().

◆ scroll_bg

int TConfig::scroll_bg
private

Definition at line 170 of file tnconfig.h.

Referenced by get_scroll_bg(), init_varlist(), and TConfig().

◆ scroll_enable

bool TConfig::scroll_enable
private

Definition at line 187 of file tnconfig.h.

Referenced by get_scroll_enable(), init_varlist(), and TConfig().

◆ scroll_fg

int TConfig::scroll_fg
private

Definition at line 171 of file tnconfig.h.

Referenced by get_scroll_fg(), init_varlist(), and TConfig().

◆ scroll_mode

char TConfig::scroll_mode[8]
private

Definition at line 186 of file tnconfig.h.

Referenced by get_scroll_mode(), init_varlist(), and TConfig().

◆ scroll_size

int TConfig::scroll_size
private

Definition at line 188 of file tnconfig.h.

Referenced by get_scroll_size(), init_varlist(), and TConfig().

◆ scrollback_key

char TConfig::scrollback_key[2]
private

Definition at line 180 of file tnconfig.h.

Referenced by get_scrollback_key(), init_varlist(), and TConfig().

◆ set_title

bool TConfig::set_title
private

Definition at line 154 of file tnconfig.h.

Referenced by get_set_title(), init_varlist(), and TConfig().

◆ speaker_beep

bool TConfig::speaker_beep
private

Definition at line 148 of file tnconfig.h.

Referenced by get_speaker_beep(), init_varlist(), and TConfig().

◆ startdir

char TConfig::startdir[MAX_PATH]
private

Definition at line 132 of file tnconfig.h.

Referenced by get_startdir(), inifile_init(), init(), keyfile_init(), and TConfig().

◆ status_bg

int TConfig::status_bg
private

Definition at line 172 of file tnconfig.h.

Referenced by get_status_bg(), init_varlist(), and TConfig().

◆ status_fg

int TConfig::status_fg
private

Definition at line 173 of file tnconfig.h.

Referenced by get_status_fg(), init_varlist(), and TConfig().

◆ strip_redir

bool TConfig::strip_redir
private

Definition at line 143 of file tnconfig.h.

Referenced by get_strip_redir(), init_varlist(), and TConfig().

◆ term

char TConfig::term[128]
private

Definition at line 138 of file tnconfig.h.

Referenced by get_term(), init_varlist(), and TConfig().

◆ term_height

int TConfig::term_height
private

Definition at line 155 of file tnconfig.h.

Referenced by get_term_height(), init_varlist(), and TConfig().

◆ term_width

int TConfig::term_width
private

Definition at line 155 of file tnconfig.h.

Referenced by get_term_width(), init_varlist(), and TConfig().

◆ ulblink_bg

int TConfig::ulblink_bg
private

Definition at line 166 of file tnconfig.h.

Referenced by get_ulblink_bg(), init_varlist(), and TConfig().

◆ ulblink_fg

int TConfig::ulblink_fg
private

Definition at line 167 of file tnconfig.h.

Referenced by get_ulblink_fg(), init_varlist(), and TConfig().

◆ underline_bg

int TConfig::underline_bg
private

Definition at line 164 of file tnconfig.h.

Referenced by get_underline_bg(), init_varlist(), and TConfig().

◆ underline_fg

int TConfig::underline_fg
private

Definition at line 165 of file tnconfig.h.

Referenced by get_underline_fg(), init_varlist(), and TConfig().

◆ vt100_mode

bool TConfig::vt100_mode
private

Definition at line 146 of file tnconfig.h.

Referenced by get_vt100_mode(), init_varlist(), and TConfig().

◆ wide_enable

bool TConfig::wide_enable
private

Definition at line 157 of file tnconfig.h.

Referenced by get_wide_enable(), init_varlist(), and TConfig().

◆ window_height

int TConfig::window_height
private

Definition at line 156 of file tnconfig.h.

Referenced by get_window_height(), init_varlist(), and TConfig().

◆ window_width

int TConfig::window_width
private

Definition at line 156 of file tnconfig.h.

Referenced by get_window_width(), init_varlist(), and TConfig().

◆ wrapline

bool TConfig::wrapline
private

Definition at line 151 of file tnconfig.h.

Referenced by get_wrapline(), init_varlist(), and TConfig().


The documentation for this class was generated from the following files: