ReactOS  0.4.12-dev-36-g472787f
tnconfig.cpp
Go to the documentation of this file.
1 //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 
61  dstrbksp = FALSE;
63  vt100_mode = FALSE;
66  do_beep = TRUE;
68  wrapline = TRUE;
70  fast_write = TRUE;
72  alt_erase = FALSE;
75  set_title = 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, "]");
98  strcpy(scrollback_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 
126 };
127 
128 enum {
181 
182  MAX_INI_VARS // must be last
183 };
184 
185 struct ini_variable {
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 
196 enum {
205 
206  MAX_INI_GROUPS // Must be last
207 };
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 
282 void 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];
358  strcpy(aliases[alias_total], tmp);
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 
379 bool 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
394 void TConfig::print_vars(char *s) {
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 
442 bool 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,
452  ini_varlist[j].max_size);
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 
468 int 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);
496  printit(buffer);
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) {
519  GetPrivateProfileString(ini_varlist[j].section, ini_varlist[j].name, "",
520  buffer, sizeof(buffer), inifile);
521  if(*buffer != 0) set_value(ini_varlist[j].name, buffer);
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) {
601  if((p = getenv(ENV_INPUT_REDIR))) input_redir = atoi(p);
602  if((p = getenv(ENV_OUTPUT_REDIR))) output_redir = atoi(p);
603  } else {
605  "Telnet_Redir", 0, inifile);
606  input_redir = GetPrivateProfileInt("Terminal",
607  "Input_Redir", input_redir, inifile);
608  output_redir = GetPrivateProfileInt("Terminal",
609  "Output_Redir", output_redir, inifile);
610  }
611  if ((input_redir > 1) || (output_redir > 1))
612  setlocale(LC_CTYPE,"");
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
619 bool TConfig::Process_Params(int argc, char *argv[]) {
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':
637  set_string(dumpfile, optarg, sizeof(dumpfile));
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
648  printm(0, FALSE, MSG_USAGE_1);
649  return FALSE;
650  }
651  optarg[j] = 0;
652  if(!set_value(optarg, &optarg[j+1]))
653  printm(0, FALSE, MSG_BADVAL, optarg);
654  }
655  break;
656  default:
657  printm(0, FALSE, MSG_USAGE); // print a usage message
658  printm(0, FALSE, MSG_USAGE_1);
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 
682 void 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 
696 void 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 
int scroll_bg
Definition: tnconfig.h:170
void redir_init()
Definition: tnconfig.cpp:596
bool enable_mouse
Definition: tnconfig.h:176
int window_width
Definition: tnconfig.h:156
void inifile_init()
Definition: tnconfig.cpp:526
static int argc
Definition: ServiceArgs.c:12
#define LC_CTYPE
Definition: locale.h:27
#define max(a, b)
Definition: svc.c:63
bool preserve_colors
Definition: tnconfig.h:150
GLenum GLclampf GLint GLenum GLuint GLenum GLenum GLsizei GLenum const GLvoid GLfloat GLfloat GLfloat GLfloat GLclampd GLint 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 GLboolean GLboolean GLboolean GLint GLenum GLsizei const GLvoid GLenum GLint GLenum GLint GLint GLsizei GLint GLenum GLint GLint GLint GLint GLsizei GLenum GLsizei const GLuint GLboolean GLenum GLenum GLint GLsizei GLenum GLsizei GLenum const GLvoid GLboolean const GLboolean GLenum const GLdouble const GLfloat const GLdouble const GLfloat GLenum GLint GLint GLint GLint GLint GLint j
Definition: glfuncs.h:98
bool set_value(const char *var, const char *value)
Definition: tnconfig.cpp:442
Definition: get.c:139
#define TRUE
Definition: types.h:120
bool Process_Params(int argc, char *argv[])
Definition: tnconfig.cpp:619
char keyfile[MAX_PATH *2]
Definition: tnconfig.h:134
const char * name
Definition: tnconfig.cpp:186
int blink_bg
Definition: tnconfig.h:162
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
char escape_key[2]
Definition: tnconfig.h:179
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
void init_varlist()
Definition: tnconfig.cpp:211
static GLenum _GLUfuncptr fn
Definition: wgl_font.c:159
_Check_return_ _CRTIMP int __cdecl strnicmp(_In_z_ const char *_Str1, _In_z_ const char *_Str, _In_ size_t _MaxCount)
int optind
Definition: getopt.c:47
GLuint GLuint GLsizei count
Definition: gl.h:1545
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
Definition: utclib.c:427
const char * port
Definition: tnconfig.h:200
int alias_total
Definition: tnconfig.h:204
GLdouble GLdouble t
Definition: gl.h:2047
__cdecl __MINGW_NOTHROW char * dirname(char *)
#define ENV_TELNET_INI
Definition: tnconfig.h:24
GLuint buffer
Definition: glext.h:5915
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
Definition: parser.c:55
void print_groups()
Definition: tnconfig.cpp:426
#define MSG_USAGE
Definition: resource.h:5
static char ** argv
Definition: ServiceArgs.c:11
ini_variable ini_varlist[MAX_INI_VARS]
Definition: tnconfig.cpp:194
#define ENV_OUTPUT_REDIR
Definition: tnconfig.h:23
int status_bg
Definition: tnconfig.h:172
#define MSG_USAGE_1
Definition: resource.h:6
int ulblink_bg
Definition: tnconfig.h:166
GLuint const GLubyte GLvoid * src
Definition: s_context.h:57
void * ini_data
Definition: tnconfig.cpp:189
GLenum GLclampf GLint i
Definition: glfuncs.h:14
#define ENV_TELNET_REDIR
Definition: tnconfig.h:21
char netpipe[MAX_PATH *2]
Definition: tnconfig.h:195
char startdir[MAX_PATH]
Definition: tnconfig.h:132
bool wide_enable
Definition: tnconfig.h:157
#define MSG_NOINI
Definition: resource.h:20
char ** aliases
Definition: tnconfig.h:203
char exename[MAX_PATH]
Definition: tnconfig.h:133
char * ini_groups[MAX_INI_GROUPS]
Definition: tnconfig.cpp:209
static INT max_size
Definition: history.c:51
bool find_alias(const char *alias_name)
const WCHAR * str
int status_fg
Definition: tnconfig.h:173
smooth NULL
Definition: ftsmooth.c:416
char inifile[MAX_PATH *2]
Definition: tnconfig.h:135
_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:426
char scroll_mode[8]
Definition: tnconfig.h:186
bool eightbit_ansi
Definition: tnconfig.h:145
int term_height
Definition: tnconfig.h:155
#define GetPrivateProfileSectionNames
Definition: winbase.h:3648
_Check_return_ _CRTIMP int __cdecl stricmp(_In_z_ const char *_Str1, _In_z_ const char *_Str2)
typedef bool(CARDLIBPROC *pCanDragProc)(CardRegion &stackobj
r l[0]
Definition: byte_order.h:167
TConfig ini
Definition: tnconfig.cpp:45
bool do_beep
Definition: tnconfig.h:149
void keyfile_init()
Definition: tnconfig.cpp:543
int output_redir
Definition: tnconfig.h:142
_CRTIMP char *__cdecl itoa(_In_ int _Val, _Pre_notnull_ _Post_z_ char *_DstBuf, _In_ int _Radix)
#define MSG_CONFIG
Definition: resource.h:19
GLsizeiptr size
Definition: glext.h:5919
GLenum GLclampf GLint GLenum GLuint GLenum GLenum GLsizei GLenum const GLvoid GLfloat GLfloat GLfloat GLfloat GLclampd GLint 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 GLboolean GLboolean GLboolean GLint GLenum GLsizei const GLvoid GLenum GLint GLenum GLint GLint GLsizei GLint GLenum GLint GLint GLint GLint GLsizei GLenum GLsizei const GLuint GLboolean flag
Definition: glfuncs.h:72
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
char default_config[128]
Definition: tnconfig.h:139
#define MAX_PATH
Definition: compat.h:26
char host[128]
Definition: tnconfig.h:199
GLfloat CONST GLvector4f CONST GLfloat GLvector4f * dest
Definition: m_xform.h:122
char dumpfile[MAX_PATH *2]
Definition: tnconfig.h:136
bool lock_linewrap
Definition: tnconfig.h:152
int underline_fg
Definition: tnconfig.h:165
int printit(const char *it)
Definition: tnerror.cpp:58
bool script_enable
Definition: tnconfig.h:192
int term_width
Definition: tnconfig.h:155
bool alt_erase
Definition: tnconfig.h:182
bool fast_write
Definition: tnconfig.h:153
bool keyboard_paste
Definition: tnconfig.h:183
bool disable_break
Definition: tnconfig.h:147
~TConfig()
Definition: tnconfig.cpp:115
int input_redir
Definition: tnconfig.h:142
#define ENV_INPUT_REDIR
Definition: tnconfig.h:22
bool ctrlbreak_as_ctrlc
Definition: tnconfig.h:158
void init(char *dirname, char *exename)
Definition: tnconfig.cpp:282
Definition: stat.h:55
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLdouble s
Definition: gl.h:2039
int printm(LPTSTR szModule, BOOL fSystem, DWORD dwMessageId,...)
Definition: tnerror.cpp:84
void init_vars()
Definition: tnconfig.cpp:515
char printer_name[MAX_PATH *2]
Definition: tnconfig.h:137
bool strip_redir
Definition: tnconfig.h:143
bool set_title
Definition: tnconfig.h:154
const char * section
Definition: tnconfig.cpp:187
int buffer_size
Definition: tnconfig.h:159
#define ENV_TELNET_CFG
Definition: tnconfig.h:20
void print_vars()
Definition: tnconfig.cpp:383
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
Definition: stat.h:345
#define MSG_DUMPFILE
Definition: resource.h:18
int window_height
Definition: tnconfig.h:156
_Check_return_ char *__cdecl getenv(_In_z_ const char *_VarName)
char scrollback_key[2]
Definition: tnconfig.h:180
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
#define GetPrivateProfileString
Definition: winbase.h:3649
_CRTIMP void __cdecl _searchenv(_In_z_ const char *_Filename, _In_z_ const char *_EnvVar, _Pre_notnull_ _Post_z_ char *_ResultPath)
const char * optarg
Definition: getopt.c:49
bool vt100_mode
Definition: tnconfig.h:146
int underline_bg
Definition: tnconfig.h:164
int scroll_fg
Definition: tnconfig.h:171
char iopipe[MAX_PATH *2]
Definition: tnconfig.h:196
TConfig()
Definition: tnconfig.cpp:47
void set_bool(bool *boolval, const char *str)
Definition: tnconfig.cpp:696
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
Definition: name.c:36
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
char dial_key[2]
Definition: tnconfig.h:181
#define c
Definition: ke_i.h:80
bool wrapline
Definition: tnconfig.h:151
bool scroll_enable
Definition: tnconfig.h:187
int blink_fg
Definition: tnconfig.h:163
int ulblink_fg
Definition: tnconfig.h:167
#define setlocale(n, s)
Definition: locale.h:46
int print_value(const char *var)
Definition: tnconfig.cpp:468
#define MSG_BADVAL
Definition: resource.h:21
void set_string(char *dest, const char *src, const int length)
Definition: tnconfig.cpp:682
int scroll_size
Definition: tnconfig.h:188
void print_aliases()
Definition: tnconfig.cpp:366
GLfloat GLfloat p
Definition: glext.h:8902
ini_data_type
Definition: tnconfig.cpp:122
int k
Definition: mpi.c:3369
int normal_bg
Definition: tnconfig.h:168
char scriptname[MAX_PATH *2]
Definition: tnconfig.h:191
char term[128]
Definition: tnconfig.h:138
void init_aliases()
Definition: tnconfig.cpp:320
int normal_fg
Definition: tnconfig.h:169
bool speaker_beep
Definition: tnconfig.h:148
#define GetPrivateProfileInt
Definition: winbase.h:3646
bool dstrbksp
Definition: tnconfig.h:144