ReactOS  0.4.14-dev-599-g2d4d3f5
tnmain.cpp File Reference
#include "precomp.h"
#include "tnmain.h"
Include dependency graph for tnmain.cpp:

Go to the source code of this file.

Classes

struct  command
 

Macros

#define MAX_PARM_COUNT   3
 
#define MAX_TOKEN_COUNT   (MAX_PARM_COUNT+2)
 
#define HISTLENGTH   25
 

Enumerations

enum  {
  BAD_USAGE = -3, EMPTY_LINE = -2, INVALID_CMD = -1, __FIRST_COMMAND = 0,
  OPEN = __FIRST_COMMAND, CLOSE, KEYS, QUIT,
  HELP, HELP2, K_LOAD, K_SWITCH,
  K_DISPLAY, SET, SUSPEND, FASTQUIT,
  CMD_HISTORY, CLEAR_HISTORY, ALIASES, __COMMAND_LIST_SIZE
}
 

Functions

int telCommandLine (Telnet &MyConnection)
 
void waitforkey ()
 
struct cmdHistorycfgets (char *buf, unsigned int length, struct cmdHistory *cmdhist)
 
int main (int ArgC, char *ArgV[])
 
static int cmdMatch (const char *cmd, const char *token, int tokenLen, int minM)
 
static void printUsage (int cmd)
 
int tokenizeCommand (char *szCommand, int &argc, char **argv)
 

Variables

command cmdList [__COMMAND_LIST_SIZE]
 

Macro Definition Documentation

◆ HISTLENGTH

#define HISTLENGTH   25

◆ MAX_PARM_COUNT

#define MAX_PARM_COUNT   3

Definition at line 463 of file tnmain.cpp.

◆ MAX_TOKEN_COUNT

#define MAX_TOKEN_COUNT   (MAX_PARM_COUNT+2)

Definition at line 464 of file tnmain.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
BAD_USAGE 
EMPTY_LINE 
INVALID_CMD 
__FIRST_COMMAND 
OPEN 
CLOSE 
KEYS 
QUIT 
HELP 
HELP2 
K_LOAD 
K_SWITCH 
K_DISPLAY 
SET 
SUSPEND 
FASTQUIT 
CMD_HISTORY 
CLEAR_HISTORY 
ALIASES 
__COMMAND_LIST_SIZE 

Definition at line 396 of file tnmain.cpp.

396  {
397  BAD_USAGE = -3,
398  EMPTY_LINE = -2,
399  INVALID_CMD = -1,
400  __FIRST_COMMAND = 0,
401 
403  CLOSE,
404  KEYS,
405  QUIT,
406  HELP,
407  HELP2, // there is way for synonims
408  K_LOAD, // subcommand of 'keys'
409  K_SWITCH, // subcommand of 'keys'
410  K_DISPLAY, // subcommand of 'keys'
411 
412  SET, // Paul Brannan 5/30/98
413 
414  SUSPEND,
415  FASTQUIT, // Thomas Briggs 8/11/98
416  CMD_HISTORY, // crn@ozemail.com.au
417  CLEAR_HISTORY, // crn@ozemail.com.au
418 
419  ALIASES, // Paul Brannan 1/1/99
420 
421  __COMMAND_LIST_SIZE // must be last
422 };
Definition: tnmain.cpp:405
Definition: tnmain.cpp:402
Definition: tnmain.cpp:404
Definition: tnmain.cpp:406
Definition: tnmain.cpp:412

Function Documentation

◆ cfgets()

struct cmdHistory* cfgets ( char buf,
unsigned int  length,
struct cmdHistory cmdhist 
)

Definition at line 69 of file tnmain.cpp.

69  {
70 
72  unsigned int current=0, cursor =0, iEraseLength=0, i;
73  char chr;
74  char temp[2];
75  char temp1[80];
76 
77  INPUT_RECORD InputRecord;
78  BOOL done = FALSE;
79 
80  temp[1] = 0;
81  buf[0] = '\0';
82 
83  if(!ini.get_input_redir()) {
84  while (!done) {
85  DWORD dwInput;
86  int MustRefresh = 0;
87  WaitForSingleObject( hConsole, INFINITE );
88  if (!ReadConsoleInput(hConsole, &InputRecord, 1, &dwInput)){
89  done = TRUE;
90  continue;
91  }
92  MustRefresh = 0;
93  if (InputRecord.EventType == KEY_EVENT &&
94  InputRecord.Event.KeyEvent.bKeyDown ) {
95 
96  if(InputRecord.Event.KeyEvent.dwControlKeyState &
98 
99  switch(InputRecord.Event.KeyEvent.wVirtualKeyCode) {
100  case 'D': // Thomas Briggs 8/11/98
101  buf[0] = '\04';
102  buf[1] = '\0';
103  current = 1;
104  done = true;
105  continue;
106  case 'U': // Paul Brannan 8/11/98
107  buf[0] = '\0';
108  current = 0;
109  cursor = 0;
110  MustRefresh = 1;
111  break;
112  }
113  }
114 
115  switch (InputRecord.Event.KeyEvent.wVirtualKeyCode) {
116  case VK_UP:
117  // crn@ozemail.com.au
118  if (cmdhist != NULL) {
119  if (!strcmp(buf, ""))
120  strncpy(buf, cmdhist->cmd, 79);
121  else if (cmdhist->prev != NULL) {
122  cmdhist = cmdhist->prev;
123  strncpy(buf, cmdhist->cmd, 79);
124  }
125  current = strlen(buf);
126  }
128  MustRefresh = 1;
129  break;
130  case VK_DOWN:
131  // crn@ozemail.com.au
132  if (cmdhist != NULL) {
133  if (cmdhist->next != NULL) {
134  cmdhist = cmdhist->next;
135  strncpy(buf, cmdhist->cmd, 79);
136  } else {
137  strncpy(buf, "", 79);
138  }
139  current = strlen(buf);
140  }
142  MustRefresh = 1;
143  break;
144  case VK_RIGHT: //crn@ozemail.com.au (added ctrl+arrow)
145  if (cursor < current) {
146  if (InputRecord.Event.KeyEvent.dwControlKeyState &
148  unsigned int j, k;
149  for (j = cursor; j <= current; j++)
150  {
151  if (buf[j + 1] == ' ' || (j + 1) == current)
152  break;
153  for (k = ++j; k <= current; k++)
154  {
155  if (buf[k] != ' ' || k == current) {
156  cursor = k == current ? --k : k;
157  break;
158  }
159  }
160  }
161  } else
162  cursor++;
163  MustRefresh = 1;
164  break;
165  }
166  case VK_LEFT: //crn@ozemail.com.au (added ctrl+arrow)
167  if (cursor > 0) {
168  if(InputRecord.Event.KeyEvent.dwControlKeyState &
170  int j, k;
171  for (j = cursor; j >= 0; j--)
172  {
173  if (buf[j - 1] != ' ')
174  break;
175  for (k = --j; k >= 0; k--)
176  {
177  if (buf[k] == ' ' || k == 0) {
178  cursor = !k ? k : ++k;
179  break;
180  }
181  }
182  }
183  } else
184  cursor--;
185  MustRefresh = 1;
186  break;
187  }
188  case VK_HOME:
189  if (cursor>0) cursor = 0;
190  MustRefresh = 1;
191  break;
192  case VK_END:
193  if (cursor<current) cursor = current;
194  MustRefresh = 1;
195  break;
196  case VK_DELETE:
197  if (current > 0 && current > cursor) {
198  strcpy(&buf[cursor],&buf[cursor+1]);
199  current--;
200  buf[current] = 0;
201  printit("\r");
202  for (i = 0; i < current+strlen("telnet>")+1 ;i++)
203  printit(" ");
204  }
205  MustRefresh = 1;
206  break;
207  case VK_BACK:
208  if (cursor > 0 ) {
209  strcpy(&buf[cursor-1],&buf[cursor]);
210  current--;
211  cursor--;
212  buf[current] = 0;
213  printit("\r");
214  for (i = 0; i < current+strlen("telnet>")+1 ;i++)
215  printit(" ");
216  }
217  MustRefresh = 1;
218  break;
219 
220  default:
221  chr = InputRecord.Event.KeyEvent.uChar.AsciiChar;
222  if (chr == '\r') {
223  done = TRUE;
224  continue;
225  }
226  if (current >= length-1){
227  done = TRUE;
228  continue;
229  }
230  if ( isprint (chr) ){
231  strncpy(temp1,&buf[cursor],79);
232  strncpy(&buf[cursor+1],temp1,79-(cursor+1));
233  buf[cursor++]=chr;
234  current++;
235  buf[current] = 0;
236  MustRefresh = 1;
237  }
238  break;
239  }
240  if (MustRefresh == 1)
241  {
242  printit("\rtelnet");
243  for (i = 0; i <= iEraseLength ;i++)
244  printit(" ");
245  printit("\rtelnet>");
246  printit(buf);
247  iEraseLength = strlen(buf);
248  for (i = 0; i < current-cursor; i++)
249  printit("\b");
250  }
251  }
252  }
253  buf[current] = 0;
254  if (strcmp(buf, "")) {
255  if (cmdhist == NULL) {
256  cmdhist = new struct cmdHistory;
257  if (cmdhist == NULL) {
258  printit ("\nUnable to allocate memory for history buffer -- use the \"flush\" command to clear the buffer.\n");
259  return cmdhist;
260  }
261  strncpy(cmdhist->cmd, buf, 79);
262  cmdhist->next = NULL;
263  cmdhist->prev = NULL;
264  } else {
265  while (cmdhist->next != NULL) // move to the end of the list
266  cmdhist = cmdhist->next;
267  cmdhist->next = new struct cmdHistory;
268  if (cmdhist->next == NULL) {
269  printit ("\nUnable to allocate memory for history buffer -- use the \"flush\" command to clear the buffer.\n");
270  return cmdhist;
271  }
272  cmdhist->next->prev = cmdhist; // previous is where we are now
273  cmdhist = cmdhist->next;
274  strncpy(cmdhist->cmd, buf, 79);
275  cmdhist->next = NULL;
276  }
277  while (cmdhist->next)
278  cmdhist = cmdhist->next;
279  }
280  return cmdhist;
282  } else {
283  WaitForSingleObject( hConsole, INFINITE );
284  DWORD dwInput;
285  DWORD OldMode;
286  GetConsoleMode(hConsole, &OldMode);
287  SetConsoleMode(hConsole,
288  OldMode &~ (ENABLE_ECHO_INPUT | ENABLE_LINE_INPUT) );
289  while (ReadFile(hConsole, &chr, 1, &dwInput, NULL)) {
290  if (chr == '\r') {
291  temp[0] = chr;
292  printit(&temp[0]);
293  break;
294  }
295  if (chr == '\b' && current > 0) {
296  current--;
297  printit("\b \b");
298  }
299  if (current >= length-1){
300  break;
301  }
302  if ( isprint (chr) ){
303  temp[0] = chr;
304  printit(&temp[0]);
305  buf[current++]=chr;
306  }
307  }
308  buf[current] = 0;
309  SetConsoleMode(hConsole, OldMode);
310  return NULL;
311  }
312 }
#define TRUE
Definition: types.h:120
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
Definition: utclib.c:427
BOOL WINAPI GetConsoleMode(HANDLE hConsoleHandle, LPDWORD lpMode)
Definition: console.c:1571
DWORD dwControlKeyState
Definition: wincon.h:233
#define VK_LEFT
Definition: winuser.h:2199
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
Definition: console.c:152
union _KEY_EVENT_RECORD::@3176 uChar
#define VK_DOWN
Definition: winuser.h:2202
char cmd[80]
Definition: tnmain.h:14
union _INPUT_RECORD::@3177 Event
struct cmdHistory * prev
Definition: tnmain.h:16
WORD wVirtualKeyCode
Definition: wincon.h:227
#define ENABLE_ECHO_INPUT
Definition: wincon.h:77
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
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
#define VK_HOME
Definition: winuser.h:2198
#define VK_UP
Definition: winuser.h:2200
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ReadConsoleInput
Definition: wincon.h:766
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleMode(HANDLE hConsoleHandle, DWORD dwMode)
Definition: console.c:1608
#define KEY_EVENT
Definition: wincon.h:122
smooth NULL
Definition: ftsmooth.c:416
#define STD_INPUT_HANDLE
Definition: winbase.h:264
#define VK_DELETE
Definition: winuser.h:2208
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
TConfig ini
Definition: tnconfig.cpp:45
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
KEY_EVENT_RECORD KeyEvent
Definition: wincon.h:263
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ENABLE_LINE_INPUT
Definition: wincon.h:76
int printit(const char *it)
Definition: tnerror.cpp:58
struct cmdHistory * next
Definition: tnmain.h:15
#define LEFT_CTRL_PRESSED
Definition: wincon.h:134
int get_input_redir() const
Definition: tnconfig.h:42
#define VK_BACK
Definition: winuser.h:2173
int chr(char *serport)
Definition: gdblib.c:152
#define VK_RIGHT
Definition: winuser.h:2201
const char cursor[]
Definition: icontest.c:13
static calc_node_t temp
Definition: rpn_ieee.c:38
WORD EventType
Definition: wincon.h:261
#define isprint(c)
Definition: acclib.h:73
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define RIGHT_CTRL_PRESSED
Definition: wincon.h:133
#define INFINITE
Definition: serial.h:102
BOOL WINAPI ReadFile(IN HANDLE hFile, IN LPVOID lpBuffer, IN DWORD nNumberOfBytesToRead, OUT LPDWORD lpNumberOfBytesRead OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:123
int k
Definition: mpi.c:3369
#define VK_END
Definition: winuser.h:2197
struct task_struct * current
Definition: linux.c:32

Referenced by telCommandLine().

◆ cmdMatch()

static int cmdMatch ( const char cmd,
const char token,
int  tokenLen,
int  minM 
)
static

Definition at line 466 of file tnmain.cpp.

466  {
467  if ( tokenLen < minM ) return 0;
468  // The (unsigned) gets rid of a compiler warning (Paul Brannan 5/25/98)
469  if ( (unsigned)tokenLen > strlen(cmd) ) return 0;
470  if ( strcmp(cmd,token) == 0 ) return 1;
471 
472  int i;
473  for ( i = 0; i < minM; i++ ) if ( cmd[i] != token[i] ) return 0;
474 
475  for ( i = minM; i < tokenLen; i++ ) if ( cmd[i] != token[i] ) return 0;
476 
477  return 1;
478 };
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
Definition: ftp_var.h:139
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 token
Definition: glfuncs.h:210
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469

Referenced by tokenizeCommand().

◆ main()

int main ( int  ArgC,
char ArgV[] 
)

Definition at line 317 of file tnmain.cpp.

317  {
318 
319  CONSOLE_SCREEN_BUFFER_INFO ConsoleScreenBufferInfo;
322  &ConsoleScreenBufferInfo
323  );
324 
325  char *k;
326  char startdir[MAX_PATH*2];
327  char exename[MAX_PATH];
328 
329  // strncpy(startdir, ArgV[0],MAX_PATH);
330  // This should be more accurate than using argv[0] (Paul Brannan 9/16/98)
331  GetModuleFileName(NULL, startdir, sizeof(startdir));
332 
333  // Get the current console title so it can be set later
334  // ("Pedro A. Aranda Gutiérrez" <paag@coppi.tid.es>)
335  TCHAR ConsoleTitle[255];
336  GetConsoleTitle(ConsoleTitle, sizeof(ConsoleTitle));
337 
338  k = strrchr(startdir, '\\');
339  if (k == NULL){ // if the \ character is not found...
340  strcpy(exename, startdir);
341  strcpy(startdir,""); // set the path to nothing
342  } else {
343  // end the string after the last '\' to get rid of the file name
344  strcpy(exename, k+1);
345  k[1] = 0;
346  }
347 
350 
351  // set up the ini class
352  ini.init(startdir, exename);
353 
354  // Process the command line arguments and connect to a host if necessary
355  if(ini.Process_Params(ArgC, ArgV)) {
356  const char *szHost = ini.get_host();
357  const char *strPort = ini.get_port();
358  if(!*szHost) {
359  Telnet MyConnection;
360  while(telCommandLine(MyConnection));
361  } else {
362  Telnet MyConnection;
363  if(MyConnection.Open(szHost, strPort) == TNPROMPT) {
364  // still connected
365  printit("\n");
366  telCommandLine(MyConnection);
367  }
368  }
369  }
371 
372  if(ini.get_term_width() != -1 || ini.get_term_height() != -1) {
374  GetStdHandle(STD_OUTPUT_HANDLE), // handle of console screen buffer
375  ConsoleScreenBufferInfo.dwSize // new size in character rows and cols.
376  );
378  GetStdHandle(STD_OUTPUT_HANDLE), // handle of console screen buffer
379  TRUE, // coordinate type flag
380  &ConsoleScreenBufferInfo.srWindow // address of new window rectangle
381  );
382  }
384  GetStdHandle(STD_OUTPUT_HANDLE), // handle of console screen buffer
385  ConsoleScreenBufferInfo.wAttributes // text and background colors
386  );
387 
388  // Restore the original console title
389  // ("Pedro A. Aranda Gutiérrez" <paag@coppi.tid.es>)
390  SetConsoleTitle(ConsoleTitle);
391 
392  return 0;
393 }
#define TRUE
Definition: types.h:120
bool Process_Params(int argc, char *argv[])
Definition: tnconfig.cpp:619
#define MSG_COPYRIGHT
Definition: resource.h:3
#define MSG_COPYRIGHT_1
Definition: resource.h:4
int get_term_width() const
Definition: tnconfig.h:56
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
Definition: console.c:152
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
int Open(const char *szHost, const char *strPort="23")
Definition: tnclass.cpp:160
BOOL WINAPI DECLSPEC_HOTPATCH SetConsoleScreenBufferSize(HANDLE hConsoleOutput, COORD dwSize)
Definition: console.c:1857
smooth NULL
Definition: ftsmooth.c:416
#define GetConsoleTitle
Definition: wincon.h:763
const char * get_host() const
Definition: tnconfig.h:102
Definition: tnclass.h:16
BOOL WINAPI GetConsoleScreenBufferInfo(IN HANDLE hConsoleOutput, OUT PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo)
Definition: console.c:544
TConfig ini
Definition: tnconfig.cpp:45
BOOL WINAPI SetConsoleTextAttribute(IN HANDLE hConsoleOutput, IN WORD wAttributes)
Definition: console.c:621
char TCHAR
Definition: xmlstorage.h:189
#define MAX_PATH
Definition: compat.h:26
int printit(const char *it)
Definition: tnerror.cpp:58
#define GetModuleFileName
Definition: winbase.h:3665
void init(char *dirname, char *exename)
Definition: tnconfig.cpp:282
int get_term_height() const
Definition: tnconfig.h:57
const char * get_port() const
Definition: tnconfig.h:103
int printm(LPTSTR szModule, BOOL fSystem, DWORD dwMessageId,...)
Definition: tnerror.cpp:84
#define STD_OUTPUT_HANDLE
Definition: winbase.h:265
int telCommandLine(Telnet &MyConnection)
Definition: tnmain.cpp:567
#define SetConsoleTitle
Definition: wincon.h:771
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
BOOL WINAPI SetConsoleWindowInfo(HANDLE hConsoleOutput, BOOL bAbsolute, CONST SMALL_RECT *lpConsoleWindow)
Definition: console.c:1972
static char * exename
Definition: process.c:101
Definition: tncon.h:16
int k
Definition: mpi.c:3369

◆ printUsage()

static void printUsage ( int  cmd)
static

Definition at line 480 of file tnmain.cpp.

480  {
481  if ( cmdList[cmd].usage != NULL ) {
483  return;
484  };
485  if ( cmdList[cmd].isSubCmd >= 0 ) {
486  printUsage(cmdList[cmd].isSubCmd);
487  return;
488  }
490 };
Definition: ftp_var.h:139
smooth NULL
Definition: ftsmooth.c:416
int printit(const char *it)
Definition: tnerror.cpp:58
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
int printm(LPTSTR szModule, BOOL fSystem, DWORD dwMessageId,...)
Definition: tnerror.cpp:84
#define MSG_BADUSAGE
Definition: resource.h:27
static void printUsage(int cmd)
Definition: tnmain.cpp:480
command cmdList[__COMMAND_LIST_SIZE]
Definition: tnmain.cpp:435

Referenced by tokenizeCommand().

◆ telCommandLine()

int telCommandLine ( Telnet MyConnection)

Definition at line 567 of file tnmain.cpp.

567  {
568 #define HISTLENGTH 25
569  int i, retval;
570  char* Parms[MAX_PARM_COUNT];
571  char szCommand[80];
572  int bDone = 0;
573  char *extitle, *newtitle;
574  struct cmdHistory *cmdhist;
575  cmdhist = NULL;
576 
577  // printit("\n"); // crn@ozemail.com.au 14/12/98
578  while (!bDone){
579  // printit("\n"); // Paul Brannan 5/25/98
580  printit( "telnet>");
581  cmdhist = cfgets (szCommand, 79, cmdhist);
582  printit( "\n");
583 
584  strlwr(szCommand); // convert command line to lower
585  // i = sscanf(szCommand,"%80s %80s %80s %80s", szCmd, szArg1, szArg2, szArg3);
586  switch ( tokenizeCommand(szCommand, i, Parms) ) {
587  case BAD_USAGE: break;
588  case EMPTY_LINE:
589  if(MyConnection.Resume() == TNPROMPT) {
590  printit("\n");
591  break;
592  }
593  else
594  return 1;
595  case INVALID_CMD:
596  printm(0, FALSE, MSG_INVCMD);
597  break;
598  case OPEN:
599  if (i == 1)
600  retval = MyConnection.Open(Parms[0], "23");
601  else
602  retval = MyConnection.Open(Parms[0], Parms[1]);
603  if(retval != TNNOCON && retval != TNPROMPT) return 1;
604  if(retval == TNPROMPT) printit("\n");
605  break;
606  case CLOSE:
607  MyConnection.Close();
608  break;
609  case FASTQUIT: // Thomas Briggs 8/11/98
610  case QUIT:
611  MyConnection.Close();
612  bDone = 1;
613  break;
614  case HELP:
615  case HELP2:
616  printm(0, FALSE, MSG_HELP);
617  printm(0, FALSE, MSG_HELP_1);
618  break;
619  // case KEYS: we should never get it
620  case K_LOAD:
621  if ( i == 1 ) {
622  // Ioannou : changed to ini.get_keyfile()
623  if(MyConnection.LoadKeyMap( ini.get_keyfile(), Parms[0]) != 1)
624  printit("Error loading keymap.\n");
625  break;
626  };
627  if(MyConnection.LoadKeyMap( Parms[1], Parms[0]) != 1)
628  printit("Error loading keymap.\n");
629  break;
630  case K_DISPLAY:
631  MyConnection.DisplayKeyMap();
632  break;
633  case K_SWITCH:
634  MyConnection.SwitchKeyMap(atoi(Parms[0]));
635  break;
636 
637  // Paul Brannan 5/30/98
638  case SET:
639  if(i == 0) {
640  printit("Available groups:\n"); // Print out groups
641  ini.print_groups(); // (Paul Brannan 9/3/98)
642  } else if(i == 1) {
643  ini.print_vars(Parms[0]);
644  } else if(i >= 2) {
645  ini.set_value(Parms[0], Parms[1]);
646  // FIX ME !!! Ioannou: here we must call the parser routine for
647  // wrap line, not the ini.set_value
648  // something like Parser.ConLineWrap(Wrap_Line);
649  }
650  break;
651 
652  case SUSPEND: // Thomas Briggs 8/11/98
653 
654  // remind the user we're suspended -crn@ozemail.com.au 15/12/98
655  extitle = new char[128];
656  GetConsoleTitle (extitle, 128);
657 
658  newtitle = new char[128+sizeof("[suspended]")];
659  strcpy(newtitle, extitle);
660  strncat(newtitle, "[suspended]", 128+sizeof("[suspended]"));
661  if(ini.get_set_title()) SetConsoleTitle (newtitle);
662  delete[] newtitle;
663 
664  if (getenv("comspec") == NULL) {
665  switch (GetWin32Version()) {
666  case 2: // 'cmd' is faster than 'command' in NT -crn@ozemail.com.au
667  system ("cmd");
668  break;
669  default:
670  system ("command");
671  break;
672  }
673  } else {
674  system(getenv("comspec"));
675  }
676 
677  if(ini.get_set_title()) SetConsoleTitle (extitle);
678  delete[] extitle;
680 
681  break;
682 
683  case CMD_HISTORY: //crn@ozemail.com.au
684  if (cmdhist != NULL) {
685  while (cmdhist->prev != NULL)
686  cmdhist = cmdhist->prev; //rewind
687  printf ("Command history:\n");
688  while (1) {
689  printf ("\t%s\n", cmdhist->cmd);
690 
691  if (cmdhist->next != NULL)
692  cmdhist = cmdhist->next;
693  else
694  break;
695  }
696  } else
697  printf ("No command history available.\n");
698 
699  break;
700 
701  case CLEAR_HISTORY: //crn@ozemail.com.au
702  if (cmdhist != NULL) {
703  while (cmdhist->next != NULL)
704  cmdhist = cmdhist->next; //fast forward
705  while (cmdhist->prev != NULL) {
706  cmdhist = cmdhist->prev;
707  delete cmdhist->next;
708  }
709  delete cmdhist;
710  cmdhist = NULL;
711  printf ("Command history cleared.\n");
712  } else
713  printf ("No command history available.\n");
714 
715  case ALIASES: // Paul Brannan 1/1/99
716  ini.print_aliases();
717  break;
718 
719  default: // paranoik
720  printm(0, FALSE, MSG_INVCMD);
721  break;
722  }
723 
724  }
725 
726  return 0;
727 }
int LoadKeyMap(const char *file, const char *name)
Definition: tnclass.cpp:139
Definition: tnmain.cpp:405
bool set_value(const char *var, const char *value)
Definition: tnconfig.cpp:442
int SwitchKeyMap(int)
Definition: tnclass.cpp:149
char * strncat(char *DstString, const char *SrcString, ACPI_SIZE Count)
Definition: utclib.c:605
#define MSG_INVCMD
Definition: resource.h:9
struct cmdHistory * cfgets(char *buf, unsigned int length, struct cmdHistory *cmdhist)
Definition: tnmain.cpp:69
char cmd[80]
Definition: tnmain.h:14
void print_groups()
Definition: tnconfig.cpp:426
Definition: tnmain.cpp:402
int Open(const char *szHost, const char *strPort="23")
Definition: tnclass.cpp:160
struct cmdHistory * prev
Definition: tnmain.h:16
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
smooth NULL
Definition: ftsmooth.c:416
#define MSG_HELP
Definition: resource.h:7
Definition: tncon.h:15
#define GetConsoleTitle
Definition: wincon.h:763
int __cdecl system(_In_opt_z_ const char *_Command)
TConfig ini
Definition: tnconfig.cpp:45
Definition: tnmain.cpp:406
int printit(const char *it)
Definition: tnerror.cpp:58
struct cmdHistory * next
Definition: tnmain.h:15
#define MAX_PARM_COUNT
Definition: tnmain.cpp:463
const char * get_keyfile() const
Definition: tnconfig.h:34
int printm(LPTSTR szModule, BOOL fSystem, DWORD dwMessageId,...)
Definition: tnerror.cpp:84
int GetWin32Version(void)
Definition: tnmisc.cpp:98
int Resume()
Definition: tnclass.cpp:259
void DisplayKeyMap()
Definition: tnclass.cpp:145
_CRTIMP char *__cdecl strlwr(_Inout_z_ char *_Str)
void print_vars()
Definition: tnconfig.cpp:383
_Check_return_ char *__cdecl getenv(_In_z_ const char *_VarName)
int Close()
Definition: tnclass.cpp:226
#define MSG_HELP_1
Definition: resource.h:8
#define SetConsoleTitle
Definition: wincon.h:771
bool get_set_title() const
Definition: tnconfig.h:55
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
Definition: tnmain.cpp:412
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
int tokenizeCommand(char *szCommand, int &argc, char **argv)
Definition: tnmain.cpp:492
void print_aliases()
Definition: tnconfig.cpp:366
Definition: tncon.h:16
#define printf
Definition: config.h:203

Referenced by main().

◆ tokenizeCommand()

int tokenizeCommand ( char szCommand,
int argc,
char **  argv 
)

Definition at line 492 of file tnmain.cpp.

492  {
493  char* tokens[MAX_TOKEN_COUNT];
494  char* p;
495  int args = 0;
496 
497  if(!szCommand || !*szCommand) return EMPTY_LINE;
498 
499  // Removed strtok to handle tokens with spaces; this is handled with
500  // quotes. (Paul Brannan 3/18/99)
501  char *token_start = szCommand;
502  for(p = szCommand;; p++) {
503  if(*p == '\"') {
504  char *tmp = p;
505  for(p++; *p != '\"' && *p != 0; p++); // Find the next quote
506  if(*p != 0) strcpy(p, p + 1); // Remove quote#2
507  strcpy(tmp, tmp + 1); // Remove quote#1
508  }
509  if(*p == 0 || *p == ' ' || *p == '\t') {
510  tokens[args] = token_start;
511  args++;
512  if(args >= MAX_TOKEN_COUNT) break; // Break if too many args
513  token_start = p + 1;
514  if(*p == 0) break;
515  *p = 0;
516  }
517  }
518  // while ( (p = strtok((args?NULL:szCommand), " \t")) != NULL && args < MAX_TOKEN_COUNT ) {
519  // tokens[args] = p;
520  // args++;
521  // };
522 
523  if ( !args ) return EMPTY_LINE;
524  argc = args - 1;
525  args = 0;
526  int curCmd = -1;
527  int ok = -1;
528  while ( ok < 0 ) {
529  int tokenLen = strlen(tokens[args]);
530  int match = 0;
531  for ( int i = 0; i<__COMMAND_LIST_SIZE; i++ ) {
532  if ( cmdMatch(cmdList[i].cmd, tokens[args], tokenLen, cmdList[i].minLen) ) {
533  if (argc < cmdList[i].minParms || argc > cmdList[i].maxParms) {
534  printUsage(i);
535  return BAD_USAGE;
536  };
537  if ( cmdList[i].haveSubCmd && curCmd == cmdList[i].isSubCmd) {
538  curCmd = i;
539  args++;
540  argc--;
541  match = 1;
542  break;
543  };
544  if ( curCmd == cmdList[i].isSubCmd ) {
545  ok = i;
546  match = 1;
547  break;
548  };
549  printUsage(i);
550  return BAD_USAGE;
551  };
552  };
553  if ( !match ) {
554  if ( curCmd < 0 ) return INVALID_CMD;
555  printUsage(curCmd);
556  return -3;
557  };
558  };
559 
560  for ( int i = 0; i<argc; i++ ) {
561  argv[i] = tokens[i+args+1];
562  };
563  return ok;
564 
565 };
#define MAX_TOKEN_COUNT
Definition: tnmain.cpp:464
static int argc
Definition: ServiceArgs.c:12
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
Definition: ftp_var.h:139
Definition: match.c:28
#define argv
Definition: mplay32.c:18
Definition: match.c:390
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
static int cmdMatch(const char *cmd, const char *token, int tokenLen, int minM)
Definition: tnmain.cpp:466
static void printUsage(int cmd)
Definition: tnmain.cpp:480
#define ok(value,...)
Definition: atltest.h:57
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
GLfloat GLfloat p
Definition: glext.h:8902
#define args
Definition: format.c:66
command cmdList[__COMMAND_LIST_SIZE]
Definition: tnmain.cpp:435

Referenced by telCommandLine().

◆ waitforkey()

void waitforkey ( )

Definition at line 51 of file tnmain.cpp.

51  {
53  INPUT_RECORD InputRecord;
54  DWORD dwInput;
55  BOOL done = FALSE;
56  while (!done){
57  WaitForSingleObject( hConsole, INFINITE );
58  if (!ReadConsoleInput(hConsole, &InputRecord, 1, &dwInput)){
59  done = TRUE;
60  continue;
61  }
62  if (InputRecord.EventType == KEY_EVENT &&
63  InputRecord.Event.KeyEvent.bKeyDown )
64  done = TRUE;
65  }
66 }
#define TRUE
Definition: types.h:120
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
Definition: console.c:152
union _INPUT_RECORD::@3177 Event
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ReadConsoleInput
Definition: wincon.h:766
#define KEY_EVENT
Definition: wincon.h:122
#define STD_INPUT_HANDLE
Definition: winbase.h:264
KEY_EVENT_RECORD KeyEvent
Definition: wincon.h:263
unsigned long DWORD
Definition: ntddk_ex.h:95
WORD EventType
Definition: wincon.h:261
#define INFINITE
Definition: serial.h:102

Variable Documentation

◆ cmdList

Initial value:
= {
{"open", 1, 1, 2, -1, 0, "o[pen] host [port]\n"},
{"close", 2, 0, 0, -1, 0, NULL},
{"keys", 2, 1, 3, -1, 1, "ke[ys] l[oad] keymapname [file]\n"
"ke[ys] d[isplay]\n"
"ke[ys] s[witch] number\n"},
{"quit", 1, 0, 0, -1, 0, NULL},
{"?", 1, 0, 0, -1, 0, NULL},
{"help", 1, 0, 0, -1, 0, NULL},
{"load", 1, 1, 2, KEYS, 0, NULL},
{"switch", 1, 1, 1, KEYS, 0, NULL},
{"display", 1, 0, 0, KEYS, 0, NULL},
{"set", 3, 0, 2, -1, 0, "set will display available groups.\n"
"set groupname will display all variables/values in a group.\n"
"set [variable [value]] will set variable to value.\n"},
{"z", 1, 0, 0, -1, 0, "suspend telnet\n"},
{"\04", 1, 0, 0, -1, 0, NULL},
{"history", 2, 0, 0, -1, 0, "show command history"},
{"flush", 2, 0, 0, -1, 0, "flush history buffer"},
{"aliases", 5, 0, 0, -1, 0, NULL}
}
Definition: tnmain.cpp:404
smooth NULL
Definition: ftsmooth.c:416

Definition at line 435 of file tnmain.cpp.

Referenced by printUsage(), and tokenizeCommand().