-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
49,122 additions
and
1,610 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
struct _iobuf { | ||
void * _Placeholder; | ||
}; | ||
|
||
|
||
void *GetStdHandle(unsigned long nStdHandle); | ||
int GetConsoleMode(void * hConsoleHandle, unsigned long * lpMode); | ||
int SetConsoleMode(void * hConsoleHandle, unsigned long dwMode); | ||
int SetConsoleOutputCP(unsigned int wCodePageID); | ||
|
||
unsigned char enable_vt_mode(void) | ||
{ | ||
unsigned long mode = 0; | ||
void * h_out = GetStdHandle(((unsigned long) -11)); | ||
if (h_out != ((void *)(long) -1) && GetConsoleMode(h_out, &mode) != 0 && SetConsoleMode(h_out, mode = 4) != 0 && SetConsoleOutputCP(65001) != 0) | ||
{ | ||
return 1; | ||
} | ||
return 0; | ||
} | ||
|
||
int _kbhit(void); | ||
|
||
int c_kbhit(void) | ||
{ | ||
return _kbhit(); | ||
} | ||
|
||
int _getch(void); | ||
|
||
int c_getch(void) | ||
{ | ||
return _getch(); | ||
} | ||
|
||
int puts(char * _Buffer); | ||
int fflush(struct _iobuf * _Stream); | ||
struct _iobuf *__acrt_iob_func(unsigned int _Ix); | ||
|
||
void c_clrscr() | ||
{ | ||
puts("\x1b[2J\x1b[1;1H"); | ||
fflush((__acrt_iob_func(1))); | ||
} | ||
|
Oops, something went wrong.