X-Git-Url: https://git.josue.xyz/?p=VSoRC%2F.git;a=blobdiff_plain;f=node_modules%2Fnode-pty%2Fdeps%2Fwinpty%2Fmisc%2FFormatChar.h;fp=node_modules%2Fnode-pty%2Fdeps%2Fwinpty%2Fmisc%2FFormatChar.h;h=aade488f9e26b23ea15e9d3730ba818f8aab1c7c;hp=0000000000000000000000000000000000000000;hb=e79e4a5a87f3e84f7c1777f10a954453a69bf540;hpb=4339da12467b75fb8b6ca831f4bf0081c485ed2c diff --git a/node_modules/node-pty/deps/winpty/misc/FormatChar.h b/node_modules/node-pty/deps/winpty/misc/FormatChar.h new file mode 100644 index 0000000..aade488 --- /dev/null +++ b/node_modules/node-pty/deps/winpty/misc/FormatChar.h @@ -0,0 +1,21 @@ +#include +#include +#include + +static inline void formatChar(char *str, char ch) +{ + // Print some common control codes. + switch (ch) { + case '\r': strcpy(str, "CR "); break; + case '\n': strcpy(str, "LF "); break; + case ' ': strcpy(str, "SP "); break; + case 27: strcpy(str, "^[ "); break; + case 3: strcpy(str, "^C "); break; + default: + if (isgraph(ch)) + sprintf(str, "%c ", ch); + else + sprintf(str, "%02x ", ch); + break; + } +}