ReactOS  0.4.15-dev-439-g292f67a
echo.c File Reference
#include "precomp.h"
Include dependency graph for echo.c:

Go to the source code of this file.

Functions

BOOL OnOffCommand (LPTSTR param, LPBOOL flag, INT message)
 
INT CommandEcho (LPTSTR param)
 
INT CommandEchos (LPTSTR param)
 
INT CommandEchoerr (LPTSTR param)
 
INT CommandEchoserr (LPTSTR param)
 

Function Documentation

◆ CommandEcho()

INT CommandEcho ( LPTSTR  param)

Definition at line 65 of file echo.c.

66 {
67  LPTSTR p1;
68 
69  TRACE ("CommandEcho: '%s'\n", debugstr_aw(param));
70 
71  /* skip all spaces for the check of '/?', 'ON' and 'OFF' */
72  p1 = param;
73  while(_istspace(*p1))
74  p1++;
75 
76  if (!_tcsncmp (p1, _T("/?"), 2))
77  {
79  return 0;
80  }
81 
83  {
84  /* skip the first character */
85  ConOutPuts(param + 1);
86  ConOutChar(_T('\n'));
87  }
88  return 0;
89 }
#define TRUE
Definition: types.h:120
VOID ConOutChar(TCHAR c)
Definition: console.c:123
#define debugstr_aw
Definition: precomp.h:43
BOOL bEcho
Definition: batch.c:68
VOID ConOutResPaging(BOOL StartPaging, UINT resID)
Definition: console.c:182
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define STRING_ECHO_HELP5
Definition: resource.h:124
#define STRING_ECHO_HELP4
Definition: resource.h:123
#define _T(x)
Definition: vfdio.h:22
#define TRACE(s)
Definition: solgame.cpp:4
GLfloat param
Definition: glext.h:5796
BOOL OnOffCommand(LPTSTR param, LPBOOL flag, INT message)
Definition: echo.c:32
#define _istspace
Definition: tchar.h:1504
int _tcsncmp(const _TCHAR *s1, const _TCHAR *s2, size_t n)
Definition: tcsncmp.h:9
VOID ConOutPuts(LPTSTR szText)
Definition: tee.c:27

◆ CommandEchoerr()

INT CommandEchoerr ( LPTSTR  param)

Definition at line 106 of file echo.c.

107 {
108  TRACE ("CommandEchoerr: '%s'\n", debugstr_aw(param));
109 
110  if (!_tcsncmp (param, _T("/?"), 2))
111  {
113  return 0;
114  }
115 
116  ConErrPuts (param);
117  return 0;
118 }
#define STRING_ECHO_HELP2
Definition: resource.h:121
#define debugstr_aw
Definition: precomp.h:43
#define _T(x)
Definition: vfdio.h:22
#define TRACE(s)
Definition: solgame.cpp:4
GLfloat param
Definition: glext.h:5796
VOID ConErrPuts(LPTSTR szText)
Definition: tee.c:59
#define ConOutResPuts(uID)
Definition: console.h:36
int _tcsncmp(const _TCHAR *s1, const _TCHAR *s2, size_t n)
Definition: tcsncmp.h:9

◆ CommandEchos()

INT CommandEchos ( LPTSTR  param)

Definition at line 91 of file echo.c.

92 {
93  TRACE ("CommandEchos: '%s'\n", debugstr_aw(param));
94 
95  if (!_tcsncmp (param, _T("/?"), 2))
96  {
98  return 0;
99  }
100 
101  ConOutPrintf (_T("%s"), param);
102  return 0;
103 }
#define debugstr_aw
Definition: precomp.h:43
#define ConOutPrintf(szStr,...)
Definition: console.h:42
#define _T(x)
Definition: vfdio.h:22
#define TRACE(s)
Definition: solgame.cpp:4
GLfloat param
Definition: glext.h:5796
#define STRING_ECHO_HELP1
Definition: resource.h:120
#define ConOutResPuts(uID)
Definition: console.h:36
int _tcsncmp(const _TCHAR *s1, const _TCHAR *s2, size_t n)
Definition: tcsncmp.h:9

◆ CommandEchoserr()

INT CommandEchoserr ( LPTSTR  param)

Definition at line 121 of file echo.c.

122 {
123  TRACE ("CommandEchoserr: '%s'\n", debugstr_aw(param));
124 
125  if (!_tcsncmp (param, _T("/?"), 2))
126  {
128  return 0;
129  }
130 
131  ConErrPrintf (_T("%s"), param);
132  return 0;
133 }
#define STRING_ECHO_HELP3
Definition: resource.h:122
#define debugstr_aw
Definition: precomp.h:43
VOID ConErrPrintf(LPTSTR szFormat,...)
Definition: tee.c:36
#define _T(x)
Definition: vfdio.h:22
#define TRACE(s)
Definition: solgame.cpp:4
GLfloat param
Definition: glext.h:5796
#define ConOutResPuts(uID)
Definition: console.h:36
int _tcsncmp(const _TCHAR *s1, const _TCHAR *s2, size_t n)
Definition: tcsncmp.h:9

◆ OnOffCommand()

BOOL OnOffCommand ( LPTSTR  param,
LPBOOL  flag,
INT  message 
)

Definition at line 32 of file echo.c.

33 {
34  TCHAR *p2;
35  if (_tcsnicmp(param, D_OFF, sizeof(D_OFF)/sizeof(TCHAR) - 1) == 0)
36  {
37  p2 = param + sizeof(D_OFF)/sizeof(TCHAR) - 1;
38  while (_istspace(*p2))
39  p2++;
40  if (*p2 == _T('\0'))
41  {
42  *flag = FALSE;
43  return TRUE;
44  }
45  }
46  else if (_tcsnicmp(param, D_ON, sizeof(D_ON)/sizeof(TCHAR) - 1) == 0)
47  {
48  p2 = param + sizeof(D_ON)/sizeof(TCHAR) - 1;
49  while (_istspace(*p2))
50  p2++;
51  if (*p2 == _T('\0'))
52  {
53  *flag = TRUE;
54  return TRUE;
55  }
56  }
57  else if (*param == _T('\0'))
58  {
60  return TRUE;
61  }
62  return FALSE;
63 }
Definition: tftpd.h:59
#define TRUE
Definition: types.h:120
#define _tcsnicmp
Definition: xmlstorage.h:207
#define D_OFF
Definition: cmd.h:38
char TCHAR
Definition: xmlstorage.h:189
#define _T(x)
Definition: vfdio.h:22
GLfloat param
Definition: glext.h:5796
#define D_ON
Definition: cmd.h:37
#define ConOutResPrintf(uID,...)
Definition: console.h:48
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
#define _istspace
Definition: tchar.h:1504

Referenced by cmd_verify(), and CommandEcho().