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

Fixed errors and warnings reported by Microsoft C++.

We're going to need Win32 API implementations of conio functions here.
parent f0fe938b
No related branches found
No related tags found
No related merge requests found
#include <windows.h> /* INPUT_RECORD, etc. */
#include <stdio.h> /* stdin */
#include "conio.h"
#include "ciolib.h"
#include "keys.h"
......@@ -5,8 +7,8 @@
static struct cio_mouse_event cio_last_button_press;
static struct cio_mouse_event last_mouse_click;
int lastch=0;
int domouse=0;
static int lastch=0;
static int domouse=0;
int win32_kbhit(void)
{
......@@ -122,8 +124,10 @@ int win32_getche(void)
{
int ch;
#if 0 /* what is this? */
if(ansi_nextchar)
return(ansi_getch());
#endif
ch=ansi_getch();
if(ch)
putch(ch);
......@@ -132,9 +136,11 @@ int win32_getche(void)
int win32_initciolib(long inmode)
{
DWORD conmode;
if(!isatty(stdin))
return(0);
textmode(mode);
textmode(inmode);
if(!GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), &conmode))
return(0);
conmode&=~ENABLE_PROCESSED_INPUT;
......@@ -142,12 +148,13 @@ int win32_initciolib(long inmode)
if(!SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), conmode))
return(0);
cio_api.mouse=1;
memset(&uifc_last_button_press,0,sizeof(uifc_last_button_press));
memset(&cio_last_button_press,0,sizeof(cio_last_button_press));
memset(&last_mouse_click,0,sizeof(last_mouse_click));
return(1);
}
int win32_getmouse(struct cio_mouse_event *mevent) {
int win32_getmouse(struct cio_mouse_event *mevent)
{
memcpy(mevent,&last_mouse_click,sizeof(last_mouse_click));
return(0);
}
......@@ -163,3 +170,11 @@ int win32_showmouse(void)
domouse=1;
return(0);
}
#if !defined(__BORLANDC__)
void textmode(int mode)
{
}
#endif
......@@ -4,9 +4,47 @@
#ifdef __cplusplus
extern "C" {
#endif
int win32_kbhit(void)
int win32_getch()
int win32_getche(void)
int win32_kbhit(void);
int win32_getch();
int win32_getche(void);
int win32_getmouse(struct cio_mouse_event *mevent);
int win32_hidemouse(void);
int win32_showmouse(void);
#if !defined(__BORLANDC__)
void clreol(void);
void clrscr(void);
void delline(void);
int gettext(int left, int top, int right, int bottom, void*);
void gettextinfo(struct text_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);
void normvideo(void);
int puttext(int left, int top, int right, int bottom, void*);
void textattr(int newattr);
void textbackground(int newcolor);
void textcolor(int newcolor);
void textmode(int newmode);
void window(int left, int top, int right, int bottom);
void _setcursortype(int);
char* cgets(char*);
int cprintf(const char*, ...);
int cputs(const char*);
int cscanf(const char*, ... );
int getch(void);
int getche(void);
char* getpass(const char*);
int kbhit(void);
int putch(int);
int ungetch(int);
int wherex(void);
int wherey(void);
#endif
#ifdef __cplusplus
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment