ReactOS  0.4.14-dev-614-gbfd8a84
screen.c
Go to the documentation of this file.
1 /*
2  * SCREEN.C - screen internal command.
3  *
4  * clone from 4nt msgbox command
5  *
6  * 30 Aug 1999
7  * started - Paolo Pantaleo <paolopan@freemail.it>
8  *
9  * 30-Apr-2005 (Magnus Olsen <magnus@greatlord.com>)
10  * Remove all hardcoded strings in En.rc
11  *
12  */
13 
14 #include "precomp.h"
15 
16 #ifdef INCLUDE_CMD_SCREEN
17 
19 {
20  SHORT x, y;
21  SHORT maxx, maxy;
22  BOOL bSkipText = FALSE;
23 
24  if (_tcsncmp(param, _T("/?"), 2) == 0)
25  {
27  return 0;
28  }
29 
30  nErrorLevel = 0;
31 
32  /* Retrieve the screen dimensions */
34 
35  /* Get row */
36  while (_istspace(*param))
37  param++;
38 
39  if (!*param)
40  {
42  return 1;
43  }
44 
45  y = _ttoi(param);
46  if (y < 0 || y > (maxy-1))
47  {
49  return 1;
50  }
51 
52  /* Get column */
53  if (!(param = _tcschr(param, _T(' '))))
54  {
56  return 1;
57  }
58 
59  while (_istspace(*param))
60  param++;
61 
62  if (!*param)
63  {
65  return 1;
66  }
67 
68  x = _ttoi(param);
69  if (x < 0 || x > (maxx-1))
70  {
72  return 1;
73  }
74 
75  /* Get text */
76  if (!(param = _tcschr(param, _T(' '))))
77  {
78  bSkipText = TRUE;
79  }
80  else
81  {
82  while (_istspace(*param))
83  param++;
84 
85  if (!*param)
86  bSkipText = TRUE;
87  }
88 
89  bIgnoreEcho = TRUE;
90 
91  if (bSkipText)
92  x = 0;
93 
94  SetCursorXY(x, y);
95 
96  if (!bSkipText)
98 
99  return 0;
100 }
101 
102 #endif /* INCLUDE_CMD_SCREEN */
INT nErrorLevel
Definition: cmd.c:157
#define TRUE
Definition: types.h:120
BOOL bIgnoreEcho
Definition: cmd.c:155
#define ConErrResPuts(uID)
Definition: console.h:39
#define STRING_SCREEN_COL
Definition: resource.h:211
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
VOID ConOutResPaging(BOOL StartPaging, UINT resID)
Definition: console.c:182
#define STRING_SCREEN_HELP
Definition: resource.h:167
int32_t INT
Definition: typedefs.h:56
CHAR * LPTSTR
Definition: xmlstorage.h:192
SHORT maxy
Definition: cmdinput.c:116
unsigned int BOOL
Definition: ntddk_ex.h:94
short SHORT
Definition: pedump.c:59
VOID error_req_param_missing(VOID)
Definition: error.c:108
INT CommandScreen(LPTSTR param)
Definition: screen.c:18
_TCHAR * _tcschr(const _TCHAR *s, _XINT c)
Definition: tcschr.h:4
#define _T(x)
Definition: vfdio.h:22
GLfloat param
Definition: glext.h:5796
VOID GetScreenSize(PSHORT maxx, PSHORT maxy)
Definition: console.c:236
int CDECL _ttoi(const _TCHAR *str)
Definition: atoi.c:10
VOID SetCursorXY(SHORT x, SHORT y)
Definition: console.c:191
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define ConOutResPuts(uID)
Definition: console.h:36
#define _istspace
Definition: tchar.h:1504
SHORT maxx
Definition: cmdinput.c:115
int _tcsncmp(const _TCHAR *s1, const _TCHAR *s2, size_t n)
Definition: tcsncmp.h:9
#define STRING_SCREEN_ROW
Definition: resource.h:212
VOID ConOutPuts(LPTSTR szText)
Definition: tee.c:27