61TParser(RefConsole, RefKeyTrans, RefScroller, RefNetwork, RefCharmap) {
132 if(TextAttrib >= 30) {
133 if(TextAttrib <= 37) {
136 }
else if((TextAttrib >= 40) && (TextAttrib <= 47)) {
235#define FLAG_DOLLAR 0x0001
236#define FLAG_QMARK 0x0002
237#define FLAG_GREATER 0x0004
238#define FLAG_LESS 0x0008
239#define FLAG_EXCLAM 0x0010
240#define FLAG_AMPERSAND 0x0020
241#define FLAG_SLASH 0x0040
242#define FLAG_EQUAL 0x0080
243#define FLAG_QUOTE 0x0100
244#define FLAG_OTHER 0x8000
258 const int nParam = 10;
259 int iParam[nParam] = {1, 0, 0, 0, 0};
260 int iCurrentParam = 0;
262 int missing_param = 0;
265 while ((tmpc = *pszBuffer) <=
'?') {
267 if(tmpc <
'0' || tmpc >
'9') {
271 if(*(pszBuffer - 1) ==
'[') missing_param = iCurrentParam+1;
302 iParam[iCurrentParam] =
strtoul(pszBuffer, &pszBuffer, 10);
303 if (iCurrentParam < nParam)
310 switch ((
unsigned char)*pszBuffer++) {
313 if(iParam[0] == 0) iParam[0] = 1;
317 if(iParam[0] == 0) iParam[0] = 1;
323 if(iParam[0] == 0) iParam[0] = 1;
340 if(iParam[0] == 0) iParam[0] = 1;
346 if(iParam[0] == 0) iParam[0] = 1;
371 if (iCurrentParam < 1)
381 if (iCurrentParam < 2 || iParam[1] < 1)
387 if ( iCurrentParam < 1 ) iParam[0] = 0;
399 if (iCurrentParam < 1)
420 for (
int i = 1;
i <= iParam[0];
i++)
461 for (
int i = 1;
i <= iParam[0];
i++ )
472 for(
int j = 0;
x > 0 &&
j < iParam[0];
j++)
490 if ( iParam[0] > 149 ) iParam[0] = 149;
502 if (iCurrentParam < 1)
511 if (iCurrentParam < 1)
538 for (
int i = 0;
i < iCurrentParam;
i++) {
609 if (iCurrentParam < 1)
631 for (
int i = 0;
i < iCurrentParam;
i++) {
701 if(iCurrentParam == 0) {
704 for(
int i = 0;
i < iCurrentParam;
i++)
710 if (iCurrentParam == 1 && iParam[0]==5) {
715 if (iCurrentParam == 1 && iParam[0]==6){
719 char szCursorReport[40] =
"\x1B[";
722 &szCursorReport[
strlen(szCursorReport)], 10);
723 strcat(szCursorReport,
";");
725 &szCursorReport[
strlen(szCursorReport)], 10);
726 strcat(szCursorReport,
"R");
749 if (iCurrentParam < 1) {
754 if (iCurrentParam >1) {
811 const int nParam = 10;
812 int iParam[nParam] = {1, 0, 0, 0, 0};
813 int iCurrentParam = 0;
817 while ((tmpc = *pszBuffer) <=
'?') {
818 if(tmpc <
'0' || tmpc >
'9') {
828 iParam[iCurrentParam] =
strtoul(pszBuffer, &pszBuffer, 10);
829 if (iCurrentParam < nParam)
836 switch ((
unsigned char)*pszBuffer++) {
839 if (iCurrentParam < 2 )
841 if (iParam[0] <= 15 && iParam[1] <= 15)
848 if (iCurrentParam < 2 )
859 sRepeat[0] = (
char)iParam[0];
865 for(
int y=yi;
y<=yf;++
y)
868 for(
int x=xi;
x<=xf;++
x)
885 int diff = (iParam[0]-1)-
y;
920 if ((pszBufferEnd - pszBuffer) < 2)
929 switch (*pszBuffer++) {
994 if ((pszBufferEnd - pszBuffer) >= 2){
1032 if(pszBuffer < pszBufferEnd) {
1033 switch(*pszBuffer++) {
1059 if (pszBuffer < pszBufferEnd) {
1069 if (pszBuffer < pszBufferEnd) {
1080 if (pszBuffer < pszBufferEnd) {
1090 pszChar = pszBuffer;
1091 while ((pszChar < pszBufferEnd) && (*pszChar <=
'?'))
1093 if (pszChar == pszBufferEnd)
1104 pszChar = pszBuffer;
1105 while ((pszChar < pszBufferEnd) && (*pszChar <=
'?'))
1107 if (pszChar == pszBufferEnd)
1132 while (pszHead < pszTail) {
1147 pszTail - pszHead, &
Result,
NULL)) pszResult = pszHead;
1148 pszResult = pszHead +
Result;
1154 if (pszResult == pszHead)
break;
1155 pszHead = pszResult;
1166 char *pszBuf = pszHead;
1168 while(pszHead < pszTail) {
1170 switch(*(pszHead++)) {
1181 *(pszBuf++) = *(pszHead - 1);
1185 switch(*(pszHead++)) {
1186 case 'Y': pszHead += 2;
break;
1190 case '%': pszHead++;
break;
1192 while((pszHead < pszTail) && (*pszHead <
'?'))
1199 *(pszBuf++) = *(pszHead++);
1207 while(pszBuf <= pszTail) *pszBuf++ =
' ';
1218 unsigned char tmpc = *(
unsigned char *)pszBuffer;
1237 const long CTRL_ACTION = 0x0d00ff81;
1238 const long CTRL_ALWAYS = 0x0800f501;
1239 if(!(((
print_ctrl?CTRL_ALWAYS:CTRL_ACTION)>>tmpc)&1)) {
1339 char *pszCurrent = pszBuffer;
1341 if(pszBuffer < pszCurrent) pszBuffer = pszCurrent;
1344 char* pszCurrent = pszBuffer + 1;
1347 while ((pszCurrent < pszBufferEnd) && (!
iscntrl(*pszCurrent))) {
1350 *pszCurrent |= 0x80 ;
1364 pszCurrent - pszBuffer);
1367 pszCurrent - pszBuffer);
1377 if ((pszBufferEnd - pszBuffer) < 4)
1381 tmpChar = pszBuffer;
1382 if ( *tmpChar == 27 ) {
1384 if ( *tmpChar ==
'[' ) {
1386 if ( *tmpChar ==
'4' ) {
1388 if ( *tmpChar ==
'i' ) {
1433 while ( pszHead < pszTail ) {
1435 switch ( *(pszHead++) ) {
1445 switch ( *(pszHead++) ) {
1453 case '%': pszHead++;
break;
1455 while ( (pszHead < pszTail) && (*pszHead <
'?') )
char * strcat(char *DstString, const char *SrcString)
UINT32 strtoul(const char *String, char **Terminator, UINT32 Base)
ACPI_SIZE strlen(const char *String)
#define MAX_TAB_POSITIONS
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
void unset_ext_mode(DWORD mode)
void set_ext_mode(DWORD mode)
char * ParseANSIBuffer(char *pszBuffer, char *pszBufferEnd)
void ConSetCursorPos(int x, int y)
char * ParseEscapeANSI(char *pszBuffer, char *pszBufferEnd)
char * ParseBuffer(char *pszBuffer, char *pszBufferEnd)
void ConSetAttribute(unsigned char wAttr)
char * PrintBuffer(char *pszBuffer, char *pszBufferEnd)
static int StripBuffer(char *pszBuffer, char *pszBufferEnd, int width)
TANSIParser(TConsole &Console, KeyTranslator &RefKeyTrans, TScroller &RefScroller, TNetwork &NetHandler, TCharmap &RefCharmap)
int tab_stops[MAX_TAB_POSITIONS]
unsigned char iSavedAttributes
char * ParseEscapeMTE(char *pszBuffer, char *pszBufferEnd)
char * ParseEscape(char *pszBuffer, char *pszBufferEnd)
char * PrintGoodChars(char *pszHead, char *pszTail)
const char * GetTerminalID()
void setmap(char mapchar)
void translate_buffer(char *start, char *end)
int get_normal_fg() const
bool get_strip_redir() const
const char * get_printer_name() const
int get_output_redir() const
bool get_vt100_mode() const
int get_normal_bg() const
bool get_wide_enable() const
bool get_dstrbksp() const
bool get_eightbit_ansi() const
const char * get_dumpfile() const
bool get_fast_write() const
bool get_scroll_enable() const
void SetWindowSize(int width, int height)
void setDefaultFg(unsigned char u)
void ClearLine(char c=' ')
void setLineWrap(bool bEnabled)
void SetCursorPosition(int x, int y)
unsigned long WriteCtrlChar(char c)
void InsertCharacter(int numchar)
void ScrollDown(int iStartRow, int iEndRow, int bUp)
void SetScroll(int start, int end)
unsigned long WriteCtrlString(const char *pszString, unsigned long cbString)
unsigned long WriteString(const char *pszString, unsigned long cbString)
void SetBackground(unsigned char wAttrib)
void ClearEOScreen(char c=' ')
void DeleteCharacter(int numchar)
void ClearBOScreen(char c=' ')
unsigned long WriteStringFast(const char *pszString, unsigned long cbString)
unsigned char GetAttrib()
void ClearBOLine(char c=' ')
void setDefaultBg(unsigned char u)
void SetCursorSize(int pct)
void SetRawCursorPosition(int x, int y)
void MoveCursorPosition(int x, int y)
void SetForeground(unsigned char wAttrib)
void SetAttrib(unsigned char wAttr)
void ClearScreen(char c=' ')
void ClearEOLine(char c=' ')
void set_line_mode(BOOL b)
void set_local_echo(BOOL b)
int WriteString(const char *str, const int length)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLint GLint GLsizei width
GLenum GLuint GLenum GLsizei const GLchar * buf
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
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
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
_Check_return_ _CRTIMP int __cdecl iscntrl(_In_ int _C)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl putc(_In_ int _Ch, _Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP int __cdecl fputc(_In_ int _Ch, _Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP size_t __cdecl fwrite(_In_reads_bytes_(_Size *_Count) const void *_Str, _In_ size_t _Size, _In_ size_t _Count, _Inout_ FILE *_File)
_CRTIMP char *__cdecl itoa(_In_ int _Val, _Pre_notnull_ _Post_z_ char *_DstBuf, _In_ int _Radix)
#define STD_OUTPUT_HANDLE
_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