From 94beec200ea6ac88a8e39b2160ec3119fa421101 Mon Sep 17 00:00:00 2001 From: rswindell <> Date: Tue, 10 Aug 2004 00:18:01 +0000 Subject: [PATCH] Eliminate compile warnings/errors. Created stub functions for Win32 API conio implementation (for non-Borland Win32 builds). --- src/conio/win32cio.c | 99 ++++++++++++++++++++++++++++++++++++++++++-- src/conio/win32cio.h | 2 +- 2 files changed, 97 insertions(+), 4 deletions(-) diff --git a/src/conio/win32cio.c b/src/conio/win32cio.c index 62d63fbbe0..fac67c83c5 100644 --- a/src/conio/win32cio.c +++ b/src/conio/win32cio.c @@ -1,6 +1,7 @@ #include <windows.h> /* INPUT_RECORD, etc. */ #include <stdio.h> /* stdin */ #include "conio.h" +#define CIOLIB_NO_MACROS #include "ciolib.h" #include "keys.h" @@ -40,7 +41,7 @@ int win32_kbhit(void) return(0); } -int win32_getch() +int win32_getch(void) { char str[128]; INPUT_RECORD input; @@ -128,7 +129,7 @@ int win32_getche(void) if(ansi_nextchar) return(ansi_getch()); #endif - ch=ansi_getch(); + ch=win32_getch(); if(ch) putch(ch); return(ch); @@ -138,7 +139,7 @@ int win32_initciolib(long inmode) { DWORD conmode; - if(!isatty(stdin)) + if(!isatty(fileno(stdin))) return(0); textmode(inmode); if(!GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), &conmode)) @@ -177,4 +178,96 @@ void textmode(int mode) { } +void clreol(void) +{ +} + +void clrscr(void) +{ +} + +void delline(void) +{ +} + + +int gettext(int left, int top, int right, int bottom, void* buf) +{ + return 1; +} + +void gettextinfo(struct text_info* info) +{ +} + + +void gotoxy(int x, int y) +{ +} + + +void highvideo(void) +{ +} + + +void insline(void) +{ +} + + +void lowvideo(void) +{ +} + + +int movetext(int left, int top, int right, int bottom, int destleft, int desttop) +{ + return 1; +} + + +void normvideo(void) +{ +} + + +int puttext(int left, int top, int right, int bottom, void* buf) +{ + return 1; +} + + +void textattr(int newattr) +{ +} + + +void textbackground(int newcolor) +{ +} + + +void textcolor(int newcolor) +{ +} + +void window(int left, int top, int right, int bottom) +{ +} + +void _setcursortype(int type) +{ +} + +int wherex(void) +{ + return 0; +} + +int wherey(void) +{ + return 0; +} + #endif diff --git a/src/conio/win32cio.h b/src/conio/win32cio.h index 8498fc0b51..3cb3b33bbc 100644 --- a/src/conio/win32cio.h +++ b/src/conio/win32cio.h @@ -5,7 +5,7 @@ extern "C" { #endif int win32_kbhit(void); -int win32_getch(); +int win32_getch(void); int win32_getche(void); int win32_getmouse(struct cio_mouse_event *mevent); int win32_hidemouse(void); -- GitLab