aboutsummaryrefslogtreecommitdiffstats
path: root/terms.c
diff options
context:
space:
mode:
authorDai Sato <satodai@w3m.jp>2007-05-23 15:06:05 +0000
committerDai Sato <satodai@w3m.jp>2007-05-23 15:06:05 +0000
commit3c7e9b27c1db068e9b29e5ffa3a74dea449a0c9a (patch)
tree3aa5dcb2c9d7db6bc81a56a82c160e5a93173071 /terms.c
parentfix comments. (diff)
downloadw3m-3c7e9b27c1db068e9b29e5ffa3a74dea449a0c9a.tar.gz
w3m-3c7e9b27c1db068e9b29e5ffa3a74dea449a0c9a.zip
[w3m-dev 04155] fix for minpw.
Diffstat (limited to '')
-rw-r--r--terms.c83
1 files changed, 82 insertions, 1 deletions
diff --git a/terms.c b/terms.c
index b57add2..4975c0f 100644
--- a/terms.c
+++ b/terms.c
@@ -1,4 +1,4 @@
-/* $Id: terms.c,v 1.55 2006/04/07 13:21:12 inu Exp $ */
+/* $Id: terms.c,v 1.56 2007/05/23 15:06:06 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
@@ -2172,3 +2216,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 */