ReactOS 0.4.15-dev-8419-g7f0e8a3
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;
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
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:158
BOOL bIgnoreEcho
Definition: cmd.c:155
VOID error_req_param_missing(VOID)
Definition: error.c:110
VOID SetCursorXY(SHORT x, SHORT y)
Definition: console.c:191
VOID ConOutResPaging(BOOL StartPaging, UINT resID)
Definition: console.c:182
VOID GetScreenSize(PSHORT maxx, PSHORT maxy)
Definition: console.c:236
#define ConErrResPuts(uID)
Definition: console.h:38
#define ConOutPuts(szStr)
Definition: console.h:29
#define STRING_SCREEN_HELP
Definition: resource.h:169
#define STRING_SCREEN_COL
Definition: resource.h:213
#define STRING_SCREEN_ROW
Definition: resource.h:214
INT CommandScreen(LPTSTR param)
Definition: screen.c:18
SHORT maxx
Definition: cmdinput.c:115
SHORT maxy
Definition: cmdinput.c:116
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLfloat param
Definition: glext.h:5796
#define _istspace
Definition: tchar.h:1504
#define _tcsncmp
Definition: tchar.h:1428
#define _tcschr
Definition: tchar.h:1406
short SHORT
Definition: pedump.c:59
#define ConOutResPuts(uID)
Definition: replace.h:28
int32_t INT
Definition: typedefs.h:58
#define _T(x)
Definition: vfdio.h:22
#define _ttoi
Definition: xmlstorage.h:195
CHAR * LPTSTR
Definition: xmlstorage.h:192