diff options
Diffstat (limited to 'terms.c')
-rw-r--r-- | terms.c | 85 |
1 files changed, 84 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $Id: terms.c,v 1.55 2006/04/07 13:21:12 inu Exp $ */ +/* $Id: terms.c,v 1.57 2007/05/30 04:44:00 inu Exp $ */ /* * An original curses library for EUC-kanji by Akinori ITO, December 1989 * revised by Akinori ITO, January 1995 @@ -15,7 +15,11 @@ #ifdef HAVE_SYS_SELECT_H #include <sys/select.h> #endif +#ifndef __MINGW32_VERSION #include <sys/ioctl.h> +#else +#include <winsock.h> +#endif /* __MINGW32_VERSION */ #ifdef USE_MOUSE #ifdef USE_GPM #include <gpm.h> @@ -287,6 +291,42 @@ typedef struct sgttyb TerminalMode; #define MODEFLAG(d) ((d).sg_flags) #endif /* HAVE_SGTTY_H */ +#ifdef __MINGW32_VERSION +/* dummy struct */ +typedef unsigned char cc_t; +typedef unsigned int speed_t; +typedef unsigned int tcflag_t; + +#define NCCS 32 +struct termios + { + tcflag_t c_iflag; /* input mode flags */ + tcflag_t c_oflag; /* output mode flags */ + tcflag_t c_cflag; /* control mode flags */ + tcflag_t c_lflag; /* local mode flags */ + cc_t c_line; /* line discipline */ + cc_t c_cc[NCCS]; /* control characters */ + speed_t c_ispeed; /* input speed */ + speed_t c_ospeed; /* output speed */ + }; +typedef struct termios TerminalMode; +#define TerminalSet(fd,x) (0) +#define TerminalGet(fd,x) (0) +#define MODEFLAG(d) (0) + +/* dummy defines */ +#define SIGHUP (0) +#define SIGQUIT (0) +#define ECHO (0) +#define ISIG (0) +#define VEOF (0) +#define ICANON (0) +#define IXON (0) +#define IXOFF (0) + +char *ttyname(int); +#endif /* __MINGW32_VERSION */ + #define MAX_LINE 200 #define MAX_COLUMN 400 @@ -511,6 +551,7 @@ set_tty(void) void ttymode_set(int mode, int imode) { +#ifndef __MINGW32_VERSION TerminalMode ioval; TerminalGet(tty, &ioval); @@ -525,11 +566,13 @@ ttymode_set(int mode, int imode) printf("Error occured while set %x: errno=%d\n", mode, errno); reset_exit(SIGNAL_ARGLIST); } +#endif } void ttymode_reset(int mode, int imode) { +#ifndef __MINGW32_VERSION TerminalMode ioval; TerminalGet(tty, &ioval); @@ -544,6 +587,7 @@ ttymode_reset(int mode, int imode) printf("Error occured while reset %x: errno=%d\n", mode, errno); reset_exit(SIGNAL_ARGLIST); } +#endif /* __MINGW32_VERSION */ } #ifndef HAVE_SGTTY_H @@ -1292,7 +1336,9 @@ refresh(void) * (COLS-1,LINES-1). */ #if !defined(USE_BG_COLOR) || defined(__CYGWIN__) +#ifdef __CYGWIN__ if (isWinConsole) +#endif if (line == LINES - 1 && col == COLS - 1) break; #endif /* !defined(USE_BG_COLOR) || defined(__CYGWIN__) */ @@ -2172,3 +2218,40 @@ touch_cursor() #endif } #endif + +#ifdef __MINGW32_VERSION + +int tgetent(char *bp, char *name) +{ + return 0; +} + +int tgetnum(char *id) +{ + return -1; +} + +int tgetflag(char *id) +{ + return 0; +} + +char *tgetstr(char *id, char **area) +{ + id = ""; +} + +char *tgoto(char *cap, int col, int row) +{ +} + +int tputs(char *str, int affcnt, int (*putc)(char)) +{ +} + +char *ttyname(int tty) +{ + return "CON"; +} + +#endif /* __MINGW32_VERSION */ |