Skip to content
Snippets Groups Projects
Commit 94beec20 authored by rswindell's avatar rswindell
Browse files

Eliminate compile warnings/errors.

Created stub functions for Win32 API conio implementation (for non-Borland
Win32 builds).
parent e55f0b7e
No related branches found
No related tags found
No related merge requests found
#include <windows.h> /* INPUT_RECORD, etc. */ #include <windows.h> /* INPUT_RECORD, etc. */
#include <stdio.h> /* stdin */ #include <stdio.h> /* stdin */
#include "conio.h" #include "conio.h"
#define CIOLIB_NO_MACROS
#include "ciolib.h" #include "ciolib.h"
#include "keys.h" #include "keys.h"
...@@ -40,7 +41,7 @@ int win32_kbhit(void) ...@@ -40,7 +41,7 @@ int win32_kbhit(void)
return(0); return(0);
} }
int win32_getch() int win32_getch(void)
{ {
char str[128]; char str[128];
INPUT_RECORD input; INPUT_RECORD input;
...@@ -128,7 +129,7 @@ int win32_getche(void) ...@@ -128,7 +129,7 @@ int win32_getche(void)
if(ansi_nextchar) if(ansi_nextchar)
return(ansi_getch()); return(ansi_getch());
#endif #endif
ch=ansi_getch(); ch=win32_getch();
if(ch) if(ch)
putch(ch); putch(ch);
return(ch); return(ch);
...@@ -138,7 +139,7 @@ int win32_initciolib(long inmode) ...@@ -138,7 +139,7 @@ int win32_initciolib(long inmode)
{ {
DWORD conmode; DWORD conmode;
if(!isatty(stdin)) if(!isatty(fileno(stdin)))
return(0); return(0);
textmode(inmode); textmode(inmode);
if(!GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), &conmode)) if(!GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), &conmode))
...@@ -177,4 +178,96 @@ void textmode(int mode) ...@@ -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 #endif
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
extern "C" { extern "C" {
#endif #endif
int win32_kbhit(void); int win32_kbhit(void);
int win32_getch(); int win32_getch(void);
int win32_getche(void); int win32_getche(void);
int win32_getmouse(struct cio_mouse_event *mevent); int win32_getmouse(struct cio_mouse_event *mevent);
int win32_hidemouse(void); int win32_hidemouse(void);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment