ReactOS 0.4.15-dev-7842-g558ab78
tnconfig.cpp
Go to the documentation of this file.
1
2//Telnet Win32 : an ANSI telnet client.
3//Copyright (C) 1998-2000 Paul Brannan
4//Copyright (C) 1998 I.Ioannou
5//Copyright (C) 1997 Brad Johnson
6//
7//This program is free software; you can redistribute it and/or
8//modify it under the terms of the GNU General Public License
9//as published by the Free Software Foundation; either version 2
10//of the License, or (at your option) any later version.
11//
12//This program is distributed in the hope that it will be useful,
13//but WITHOUT ANY WARRANTY; without even the implied warranty of
14//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15//GNU General Public License for more details.
16//
17//You should have received a copy of the GNU General Public License
18//along with this program; if not, write to the Free Software
19//Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20//
21//I.Ioannou
22//roryt@hol.gr
23//
25
26// tnconfig.cpp
27// Written by Paul Brannan <pbranna@clemson.edu>
28// Last modified August 30, 1998
29//
30// This is a class designed for use with Brad Johnson's Console Telnet
31// see the file tnconfig.h for more information
32
33#include "precomp.h"
34
35#include <locale.h>
36#include <io.h>
37#include <sys/stat.h>
38
39// Turn off the "forcing value to bool 'true' or 'false'" warning
40#ifdef _MSC_VER
41#pragma warning(disable: 4800)
42#endif
43
44// This is the ini variable that is used for everybody
46
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}
114
116 if(aliases) {
117 for(int j = 0; j < alias_total; j++) delete[] aliases[j];
118 delete[] aliases;
119 }
120}
121
127
128enum {
181
182 MAX_INI_VARS // must be last
184
186 const char *name; // variable name
187 const char *section; // name of ini file section the variable is in
188 enum ini_data_type data_type; // type of data
189 void *ini_data; // pointer to data
190 int max_size; // max size if string
191};
192
193// Note: default values are set in the constructor, TConfig()
195
196enum {
205
206 MAX_INI_GROUPS // Must be last
208
210
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}
281
282void TConfig::init(char *dirname, char *execname) {
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}
318
319// Alias support (Paul Brannan 1/1/99)
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}
365
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}
378
379bool find_alias(const char *alias_name) {
380 return false;
381}
382
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}
392
393// Paul Brannan 9/3/98
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}
424
425// Paul Brannan 9/3/98
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}
438
439// Ioannou : The index in the while causes segfaults if there is no match
440// changes to for(), and strcmp to stricmp (prompt gives rong names)
441
442bool TConfig::set_value(const char *var, const char *value) {
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}
467
468int TConfig::print_value(const char *var) {
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}
514
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}
525
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}
542
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}
595
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}
617
618// Modified not to use getopt() by Paul Brannan 12/17/98
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}
681
682void TConfig::set_string(char *dest, const char *src, const int length) {
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}
693
694// Ioannou : ignore case for true or on
695
696void TConfig::set_bool(bool *boolval, const char *str) {
697 if(!stricmp(str, "true")) *boolval = true;
698 else if(!stricmp(str, "on")) *boolval = true;
699 else *boolval = (bool)atoi(str);
700}
701
static int argc
Definition: ServiceArgs.c:12
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
Definition: utclib.c:427
#define stat
Definition: acwin.h:99
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_CONFIG
Definition: resource.h:19
#define MSG_NOINI
Definition: resource.h:20
#define MSG_BADVAL
Definition: resource.h:21
#define MSG_USAGE
Definition: resource.h:5
static INT max_size
Definition: history.c:51
r l[0]
Definition: byte_order.h:168
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
void print_groups()
Definition: tnconfig.cpp:426
void set_string(char *dest, const char *src, const int length)
Definition: tnconfig.cpp:682
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
TConfig()
Definition: tnconfig.cpp:47
bool eightbit_ansi
Definition: tnconfig.h:145
~TConfig()
Definition: tnconfig.cpp:115
bool lock_linewrap
Definition: tnconfig.h:152
bool disable_break
Definition: tnconfig.h:147
void init_vars()
Definition: tnconfig.cpp:515
bool set_value(const char *var, const char *value)
Definition: tnconfig.cpp:442
char escape_key[2]
Definition: tnconfig.h:179
void init_aliases()
Definition: tnconfig.cpp:320
int ulblink_fg
Definition: tnconfig.h:167
void set_bool(bool *boolval, const char *str)
Definition: tnconfig.cpp:696
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
bool ctrlbreak_as_ctrlc
Definition: tnconfig.h:158
bool script_enable
Definition: tnconfig.h:192
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
bool Process_Params(int argc, char *argv[])
Definition: tnconfig.cpp:619
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
void redir_init()
Definition: tnconfig.cpp:596
int buffer_size
Definition: tnconfig.h:159
char scriptname[MAX_PATH *2]
Definition: tnconfig.h:191
int window_width
Definition: tnconfig.h:156
int output_redir
Definition: tnconfig.h:142
void init(char *dirname, char *exename)
Definition: tnconfig.cpp:282
char netpipe[MAX_PATH *2]
Definition: tnconfig.h:195
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
void print_vars()
Definition: tnconfig.cpp:383
void keyfile_init()
Definition: tnconfig.cpp:543
void print_aliases()
Definition: tnconfig.cpp:366
char dumpfile[MAX_PATH *2]
Definition: tnconfig.h:136
int alias_total
Definition: tnconfig.h:204
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 iopipe[MAX_PATH *2]
Definition: tnconfig.h:196
char exename[MAX_PATH]
Definition: tnconfig.h:133
char scroll_mode[8]
Definition: tnconfig.h:186
int print_value(const char *var)
Definition: tnconfig.cpp:468
void inifile_init()
Definition: tnconfig.cpp:526
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define stricmp(_String1, _String2)
Definition: compat.h:24
#define MAX_PATH
Definition: compat.h:34
GLdouble s
Definition: gl.h:2039
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLdouble GLdouble t
Definition: gl.h:2047
GLsizeiptr size
Definition: glext.h:5919
GLenum src
Definition: glext.h:6340
GLuint buffer
Definition: glext.h:5915
const GLubyte * c
Definition: glext.h:8905
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
GLfloat GLfloat p
Definition: glext.h:8902
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
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
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
#define LC_CTYPE
Definition: locale.h:19
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
_CRTIMP char *__cdecl itoa(_In_ int _Val, _Pre_notnull_ _Post_z_ char *_DstBuf, _In_ int _Radix)
_CRTIMP void __cdecl _searchenv(_In_z_ const char *_Filename, _In_z_ const char *_EnvVar, _Pre_notnull_ _Post_z_ char *_ResultPath)
_Check_return_ char *__cdecl getenv(_In_z_ const char *_VarName)
#define c
Definition: ke_i.h:80
__cdecl __MINGW_NOTHROW char * dirname(char *)
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
const char * var
Definition: shader.c:5666
static char * dest
Definition: rtl.c:135
int k
Definition: mpi.c:3369
#define argv
Definition: mplay32.c:18
#define bool
Definition: nsiface.idl:72
const WCHAR * str
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
const char * name
Definition: tnconfig.cpp:186
void * ini_data
Definition: tnconfig.cpp:189
enum ini_data_type data_type
Definition: tnconfig.cpp:188
const char * section
Definition: tnconfig.cpp:187
Definition: name.c:39
Definition: parser.c:56
Definition: stat.h:55
#define max(a, b)
Definition: svc.c:63
bool find_alias(const char *alias_name)
Definition: tnconfig.cpp:379
TConfig ini
Definition: tnconfig.cpp:45
ini_data_type
Definition: tnconfig.cpp:122
@ INI_BOOL
Definition: tnconfig.cpp:125
@ INI_STRING
Definition: tnconfig.cpp:123
@ INI_INT
Definition: tnconfig.cpp:124
@ SCRIPTING
Definition: tnconfig.cpp:203
@ PIPES
Definition: tnconfig.cpp:204
@ COLORS
Definition: tnconfig.cpp:199
@ MOUSE
Definition: tnconfig.cpp:200
@ TERMINAL
Definition: tnconfig.cpp:198
@ SCROLLBACK
Definition: tnconfig.cpp:202
@ PRINTER
Definition: tnconfig.cpp:201
@ MAX_INI_GROUPS
Definition: tnconfig.cpp:206
@ KEYBOARD
Definition: tnconfig.cpp:197
char * ini_groups[MAX_INI_GROUPS]
Definition: tnconfig.cpp:209
@ WINDOW_HEIGHT
Definition: tnconfig.cpp:150
@ INPUT_REDIR
Definition: tnconfig.cpp:134
@ KEYBOARD_PASTE
Definition: tnconfig.cpp:173
@ TERM
Definition: tnconfig.cpp:133
@ NETPIPE
Definition: tnconfig.cpp:179
@ BUFFER_SIZE
Definition: tnconfig.cpp:153
@ LOCK_LINEWRAP
Definition: tnconfig.cpp:145
@ SCROLL_MODE
Definition: tnconfig.cpp:174
@ IOPIPE
Definition: tnconfig.cpp:180
@ SCROLL_BG
Definition: tnconfig.cpp:163
@ FAST_WRITE
Definition: tnconfig.cpp:146
@ UNDERLINE_BG
Definition: tnconfig.cpp:157
@ PRINTER_NAME
Definition: tnconfig.cpp:167
@ STRIP_REDIR
Definition: tnconfig.cpp:136
@ NORMAL_FG
Definition: tnconfig.cpp:162
@ SCRIPT_ENABLE
Definition: tnconfig.cpp:178
@ OUTPUT_REDIR
Definition: tnconfig.cpp:135
@ DIAL_KEY
Definition: tnconfig.cpp:171
@ DUMPFILE
Definition: tnconfig.cpp:131
@ DISABLE_BREAK
Definition: tnconfig.cpp:140
@ NORMAL_BG
Definition: tnconfig.cpp:161
@ ULBLINK_BG
Definition: tnconfig.cpp:159
@ SCROLL_ENABLE
Definition: tnconfig.cpp:176
@ KEYFILE
Definition: tnconfig.cpp:130
@ WRAP_LINE
Definition: tnconfig.cpp:144
@ SCROLLBACK_KEY
Definition: tnconfig.cpp:170
@ SET_TITLE
Definition: tnconfig.cpp:154
@ DO_BEEP
Definition: tnconfig.cpp:142
@ TERM_WIDTH
Definition: tnconfig.cpp:147
@ MAX_INI_VARS
Definition: tnconfig.cpp:182
@ DEFAULT_CONFIG
Definition: tnconfig.cpp:132
@ WINDOW_WIDTH
Definition: tnconfig.cpp:149
@ WIDE_ENABLE
Definition: tnconfig.cpp:151
@ ULBLINK_FG
Definition: tnconfig.cpp:160
@ PRESERVE_COLORS
Definition: tnconfig.cpp:143
@ SCRIPTNAME
Definition: tnconfig.cpp:177
@ BLINK_FG
Definition: tnconfig.cpp:156
@ SCROLL_SIZE
Definition: tnconfig.cpp:175
@ BLINK_BG
Definition: tnconfig.cpp:155
@ TERM_HEIGHT
Definition: tnconfig.cpp:148
@ ENABLE_MOUSE
Definition: tnconfig.cpp:168
@ CTRLBREAK_AS_CTRLC
Definition: tnconfig.cpp:152
@ STATUS_FG
Definition: tnconfig.cpp:166
@ EIGHTBIT_ANSI
Definition: tnconfig.cpp:138
@ SCROLL_FG
Definition: tnconfig.cpp:164
@ INIFILE
Definition: tnconfig.cpp:129
@ SPEAKER_BEEP
Definition: tnconfig.cpp:141
@ UNDERLINE_FG
Definition: tnconfig.cpp:158
@ ESCAPE_KEY
Definition: tnconfig.cpp:169
@ DSTRBKSP
Definition: tnconfig.cpp:137
@ STATUS_BG
Definition: tnconfig.cpp:165
@ ALT_ERASE
Definition: tnconfig.cpp:172
@ VT100_MODE
Definition: tnconfig.cpp:139
ini_variable ini_varlist[MAX_INI_VARS]
Definition: tnconfig.cpp:194
#define ENV_TELNET_REDIR
Definition: tnconfig.h:21
#define ENV_OUTPUT_REDIR
Definition: tnconfig.h:23
#define ENV_TELNET_INI
Definition: tnconfig.h:24
#define ENV_TELNET_CFG
Definition: tnconfig.h:20
#define ENV_INPUT_REDIR
Definition: tnconfig.h:22
int printit(const char *it)
Definition: tnerror.cpp:58
int printm(LPTSTR szModule, BOOL fSystem, DWORD dwMessageId,...)
Definition: tnerror.cpp:84
#define setlocale(n, s)
Definition: locale.h:46
Definition: pdh_main.c:94
static GLenum _GLUfuncptr fn
Definition: wgl_font.c:159
#define GetPrivateProfileSectionNames
Definition: winbase.h:3769
#define GetPrivateProfileInt
Definition: winbase.h:3767
#define GetPrivateProfileString
Definition: winbase.h:3770
_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
#define strnicmp
Definition: xmlstorage.h:206