static void cursorToLeft(struct current *current)
{
- COORD pos = { 0, (SHORT)current->y };
+ COORD pos;
DWORD n;
+ pos.X = 0;
+ pos.Y = (SHORT)current->y;
+
FillConsoleOutputAttribute(current->outh,
FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN, current->cols, pos, &n);
current->x = 0;
static int outputChars(struct current *current, const char *buf, int len)
{
- COORD pos = { (SHORT)current->x, (SHORT)current->y };
+ COORD pos;
DWORD n;
+ pos.X = (SHORT)current->x;
+ pos.Y = (SHORT)current->y;
+
WriteConsoleOutputCharacter(current->outh, buf, len, pos, &n);
current->x += len;
return 0;
static void outputControlChar(struct current *current, char ch)
{
- COORD pos = { (SHORT)current->x, (SHORT)current->y };
+ COORD pos;
DWORD n;
+ pos.X = (SHORT) current->x;
+ pos.Y = (SHORT) current->y;
+
FillConsoleOutputAttribute(current->outh, BACKGROUND_INTENSITY, 2, pos, &n);
outputChars(current, "^", 1);
outputChars(current, &ch, 1);
static void eraseEol(struct current *current)
{
- COORD pos = { (SHORT)current->x, (SHORT)current->y };
+ COORD pos;
DWORD n;
+ pos.X = (SHORT) current->x;
+ pos.Y = (SHORT) current->y;
+
FillConsoleOutputCharacter(current->outh, ' ', current->cols - current->x, pos, &n);
}
static void setCursorPos(struct current *current, int x)
{
- COORD pos = { (SHORT)x, (SHORT)current->y };
+ COORD pos;
+
+ pos.X = (SHORT)x;
+ pos.Y = (SHORT) current->y;
SetConsoleCursorPosition(current->outh, pos);
current->x = x;