[w3m-dev 04155] fix for minpw.

This commit is contained in:
Dai Sato
2007-05-23 15:06:05 +00:00
parent a7d4566c50
commit 3c7e9b27c1
14 changed files with 243 additions and 20 deletions
+5 -4
View File
@@ -1,7 +1,8 @@
2007-05-23 NOKUBI Takatsugu <knok@daionet.gr.jp> 2007-05-23 NOKUBI Takatsugu <knok@daionet.gr.jp>
* [w3m-dev 04155] w3m mingw patch
* [w3m-dev 04246] Re: road to 0.5.2 * config.h, configure.ac, etc.c, file.c, ftp.c, indep.c, istream.c,
* configure.ac: delete nsl and dl for cross building. local.c, main.c, rc.c, terms.c, url.c: fix for minpw, except for
deleting nsl and dl from configure.ac.
* configure: regenerated. * configure: regenerated.
2007-05-23 Hiroyuki Ito <ZXB01226@nifty.com> 2007-05-23 Hiroyuki Ito <ZXB01226@nifty.com>
@@ -8850,4 +8851,4 @@ a * [w3m-dev 03276] compile error on EWS4800
* release-0-2-1 * release-0-2-1
* import w3m-0.2.1 * import w3m-0.2.1
$Id: ChangeLog,v 1.986 2007/05/23 13:15:36 inu Exp $ $Id: ChangeLog,v 1.987 2007/05/23 15:06:05 inu Exp $
+14
View File
@@ -166,9 +166,15 @@ typedef RETSIGTYPE MySignalHandler;
#define SIGNAL_RETURN @SIGNAL_RETURN@ #define SIGNAL_RETURN @SIGNAL_RETURN@
#ifdef HAVE_SIGSETJMP #ifdef HAVE_SIGSETJMP
#ifdef __MINGW32_VERSION
# define SETJMP(env) setjmp(env)
# define LONGJMP(env,val) longjmp(env, val)
# define JMP_BUF jmp_buf
#else
# define SETJMP(env) sigsetjmp(env,1) # define SETJMP(env) sigsetjmp(env,1)
# define LONGJMP(env,val) siglongjmp(env,val) # define LONGJMP(env,val) siglongjmp(env,val)
# define JMP_BUF sigjmp_buf # define JMP_BUF sigjmp_buf
#endif /* __MINGW32_VERSION */
#else #else
# define SETJMP(env) setjmp(env) # define SETJMP(env) setjmp(env)
# define LONGJMP(env,val) longjmp(env) # define LONGJMP(env,val) longjmp(env)
@@ -233,4 +239,12 @@ typedef RETSIGTYPE MySignalHandler;
#define BUNZIP2_NAME "bunzip2" #define BUNZIP2_NAME "bunzip2"
#define INFLATE_NAME "inflate" #define INFLATE_NAME "inflate"
#ifdef __MINGW32_VERSION
#define SIGKILL SIGTERM
#define S_IXGRP 0
#define S_IXOTH 0
#define S_IRWXG 0
#define S_IRWXO 0
#endif /* __MINGW32_VERSION */
#endif /* CONFIG_H_SEEN */ #endif /* CONFIG_H_SEEN */
Vendored
+2 -2
View File
@@ -6220,7 +6220,7 @@ cat >>confdefs.h <<_ACEOF
_ACEOF _ACEOF
for lib in bsd BSD 44bsd socket dld for lib in bsd BSD 44bsd socket nsl dld dl
do do
lib=$lib lib=$lib
{ echo "$as_me:$LINENO: checking for -l$lib" >&5 { echo "$as_me:$LINENO: checking for -l$lib" >&5
@@ -8072,7 +8072,7 @@ _ACEOF
case "$host_os" in case "$host_os" in
*cygwin*|*os2-emx*) *cygwin*|*os2-emx*|*mingw*)
cat >>confdefs.h <<\_ACEOF cat >>confdefs.h <<\_ACEOF
#define USE_BINMODE_STREAM 1 #define USE_BINMODE_STREAM 1
_ACEOF _ACEOF
+2 -2
View File
@@ -82,7 +82,7 @@ AC_W3M_MAILER
AC_W3M_EXT_BROWSER AC_W3M_EXT_BROWSER
dnl Checks for ext libs dnl Checks for ext libs
for lib in bsd BSD 44bsd socket dld for lib in bsd BSD 44bsd socket nsl dld dl
do do
AC_W3M_EXTLIBS($lib) AC_W3M_EXTLIBS($lib)
done done
@@ -109,7 +109,7 @@ AC_DEFINE(AUXBIN_TARGETS, "$AUXBIN_TARGETS")
AC_SUBST(USE_BINMODE_STREAM) AC_SUBST(USE_BINMODE_STREAM)
case "$host_os" in case "$host_os" in
*cygwin*|*os2-emx*) *cygwin*|*os2-emx*|*mingw*)
AC_DEFINE(USE_BINMODE_STREAM) AC_DEFINE(USE_BINMODE_STREAM)
;; ;;
esac esac
+25 -1
View File
@@ -1,6 +1,8 @@
/* $Id: etc.c,v 1.80 2006/04/07 13:21:11 inu Exp $ */ /* $Id: etc.c,v 1.81 2007/05/23 15:06:05 inu Exp $ */
#include "fm.h" #include "fm.h"
#ifndef __MINGW32_VERSION
#include <pwd.h> #include <pwd.h>
#endif
#include "myctype.h" #include "myctype.h"
#include "html.h" #include "html.h"
#include "local.h" #include "local.h"
@@ -1310,9 +1312,13 @@ romanAlphabet(int n)
static void static void
reset_signals(void) reset_signals(void)
{ {
#ifdef SIGHUP
mySignal(SIGHUP, SIG_DFL); /* terminate process */ mySignal(SIGHUP, SIG_DFL); /* terminate process */
#endif
mySignal(SIGINT, SIG_DFL); /* terminate process */ mySignal(SIGINT, SIG_DFL); /* terminate process */
#ifdef SIGQUIT
mySignal(SIGQUIT, SIG_DFL); /* terminate process */ mySignal(SIGQUIT, SIG_DFL); /* terminate process */
#endif
mySignal(SIGTERM, SIG_DFL); /* terminate process */ mySignal(SIGTERM, SIG_DFL); /* terminate process */
mySignal(SIGILL, SIG_DFL); /* create core image */ mySignal(SIGILL, SIG_DFL); /* create core image */
mySignal(SIGIOT, SIG_DFL); /* create core image */ mySignal(SIGIOT, SIG_DFL); /* create core image */
@@ -1355,8 +1361,10 @@ setup_child(int child, int i, int f)
{ {
reset_signals(); reset_signals();
mySignal(SIGINT, SIG_IGN); mySignal(SIGINT, SIG_IGN);
#ifndef __MINGW32_VERSION
if (!child) if (!child)
SETPGRP(); SETPGRP();
#endif /* __MINGW32_VERSION */
close_tty(); close_tty();
close_all_fds_except(i, f); close_all_fds_except(i, f);
QuietMessage = TRUE; QuietMessage = TRUE;
@@ -1364,6 +1372,7 @@ setup_child(int child, int i, int f)
TrapSignal = FALSE; TrapSignal = FALSE;
} }
#ifndef __MINGW32_VERSION
pid_t pid_t
open_pipe_rw(FILE ** fr, FILE ** fw) open_pipe_rw(FILE ** fr, FILE ** fw)
{ {
@@ -1421,6 +1430,7 @@ open_pipe_rw(FILE ** fr, FILE ** fw)
err0: err0:
return (pid_t) - 1; return (pid_t) - 1;
} }
#endif /* __MINGW32_VERSION */
void void
myExec(char *command) myExec(char *command)
@@ -1433,6 +1443,7 @@ myExec(char *command)
void void
mySystem(char *command, int background) mySystem(char *command, int background)
{ {
#ifndef __MINGW32_VERSION
if (background) { if (background) {
#ifndef __EMX__ #ifndef __EMX__
flush_tty(); flush_tty();
@@ -1447,6 +1458,7 @@ mySystem(char *command, int background)
#endif #endif
} }
else else
#endif /* __MINGW32_VERSION */
system(command); system(command);
} }
@@ -1516,6 +1528,13 @@ myEditor(char *cmd, char *file, int line)
return tmp; return tmp;
} }
#ifdef __MINGW32_VERSION
char *
expandName(char *name)
{
return getenv("HOME");
}
#else
char * char *
expandName(char *name) expandName(char *name)
{ {
@@ -1559,6 +1578,7 @@ expandName(char *name)
rest: rest:
return name; return name;
} }
#endif
char * char *
file_to_url(char *file) file_to_url(char *file)
@@ -1898,7 +1918,11 @@ mymktime(char *timestr)
#ifdef INET6 #ifdef INET6
#include <sys/socket.h> #include <sys/socket.h>
#endif /* INET6 */ #endif /* INET6 */
#ifndef __MINGW32_VERSION
#include <netdb.h> #include <netdb.h>
#else
#include <winsock.h>
#endif
char * char *
FQDN(char *host) FQDN(char *host)
{ {
+15 -1
View File
@@ -1,4 +1,4 @@
/* $Id: file.c,v 1.253 2007/05/23 13:07:44 inu Exp $ */ /* $Id: file.c,v 1.254 2007/05/23 15:06:05 inu Exp $ */
#include "fm.h" #include "fm.h"
#include <sys/types.h> #include <sys/types.h>
#include "myctype.h" #include "myctype.h"
@@ -1602,9 +1602,17 @@ getAuthCookie(struct http_auth *hauth, char *auth_header,
getpassphrase(proxy ? "Proxy Password: " : getpassphrase(proxy ? "Proxy Password: " :
"Password: ")); "Password: "));
#else #else
#ifndef __MINGW32_VERSION
*pwd = Strnew_charp((char *) *pwd = Strnew_charp((char *)
getpass(proxy ? "Proxy Password: " : getpass(proxy ? "Proxy Password: " :
"Password: ")); "Password: "));
#else
term_raw();
*pwd = Strnew_charp((char *)
inputLine(proxy ? "Proxy Password: " :
"Password: ", NULL, IN_PASSWORD));
term_cbreak();
#endif /* __MINGW32_VERSION */
#endif #endif
} }
} }
@@ -7901,6 +7909,7 @@ _MoveFile(char *path1, char *path2)
int int
_doFileCopy(char *tmpf, char *defstr, int download) _doFileCopy(char *tmpf, char *defstr, int download)
{ {
#ifndef __MINGW32_VERSION
Str msg; Str msg;
Str filen; Str filen;
char *p, *q = NULL; char *p, *q = NULL;
@@ -8007,6 +8016,7 @@ _doFileCopy(char *tmpf, char *defstr, int download)
if (PreserveTimestamp && !is_pipe && !stat(tmpf, &st)) if (PreserveTimestamp && !is_pipe && !stat(tmpf, &st))
setModtime(p, st.st_mtime); setModtime(p, st.st_mtime);
} }
#endif /* __MINGW32_VERSION */
return 0; return 0;
} }
@@ -8021,6 +8031,7 @@ doFileMove(char *tmpf, char *defstr)
int int
doFileSave(URLFile uf, char *defstr) doFileSave(URLFile uf, char *defstr)
{ {
#ifndef __MINGW32_VERSION
Str msg; Str msg;
Str filen; Str filen;
char *p, *q; char *p, *q;
@@ -8117,6 +8128,7 @@ doFileSave(URLFile uf, char *defstr)
if (PreserveTimestamp && uf.modtime != -1) if (PreserveTimestamp && uf.modtime != -1)
setModtime(p, uf.modtime); setModtime(p, uf.modtime);
} }
#endif /* __MINGW32_VERSION */
return 0; return 0;
} }
@@ -8187,6 +8199,7 @@ inputAnswer(char *prompt)
static void static void
uncompress_stream(URLFile *uf, char **src) uncompress_stream(URLFile *uf, char **src)
{ {
#ifndef __MINGW32_VERSION
pid_t pid1; pid_t pid1;
FILE *f1; FILE *f1;
char *expand_cmd = GUNZIP_CMDNAME; char *expand_cmd = GUNZIP_CMDNAME;
@@ -8270,6 +8283,7 @@ uncompress_stream(URLFile *uf, char **src)
} }
UFhalfclose(uf); UFhalfclose(uf);
uf->stream = newFileStream(f1, (void (*)())fclose); uf->stream = newFileStream(f1, (void (*)())fclose);
#endif /* __MINGW32_VERSION */
} }
static FILE * static FILE *
+18 -1
View File
@@ -1,6 +1,8 @@
/* $Id: ftp.c,v 1.37 2006/04/07 13:21:11 inu Exp $ */ /* $Id: ftp.c,v 1.38 2007/05/23 15:06:05 inu Exp $ */
#include <stdio.h> #include <stdio.h>
#ifndef __MINGW32_VERSION
#include <pwd.h> #include <pwd.h>
#endif /* __MINGW32_VERSION */
#include <Str.h> #include <Str.h>
#include <signal.h> #include <signal.h>
#include <setjmp.h> #include <setjmp.h>
@@ -14,10 +16,14 @@
#include <malloc.h> #include <malloc.h>
#endif /* DEBUG */ #endif /* DEBUG */
#ifndef __MINGW32_VERSION
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <netdb.h> #include <netdb.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#else
#include <winsock.h>
#endif /* __MINGW32_VERSION */
typedef struct _FTP { typedef struct _FTP {
char *host; char *host;
@@ -371,7 +377,14 @@ openFTPStream(ParsedURL *pu, URLFile *uf)
term_cbreak(); term_cbreak();
} }
else { else {
#ifndef __MINGW32_VERSION
pwd = Strnew_charp((char *)getpass("Password: ")); pwd = Strnew_charp((char *)getpass("Password: "));
#else
term_raw();
pwd = Strnew_charp(inputLine("Password: ", NULL, IN_PASSWORD));
pwd = Str_conv_to_system(pwd);
term_cbreak();
#endif /* __MINGW32_VERSION */
} }
add_auth_cookie_flag = TRUE; add_auth_cookie_flag = TRUE;
} }
@@ -380,8 +393,12 @@ openFTPStream(ParsedURL *pu, URLFile *uf)
else if (ftppasswd != NULL && *ftppasswd != '\0') else if (ftppasswd != NULL && *ftppasswd != '\0')
pass = ftppasswd; pass = ftppasswd;
else { else {
#ifndef __MINGW32_VERSION
struct passwd *mypw = getpwuid(getuid()); struct passwd *mypw = getpwuid(getuid());
tmp = Strnew_charp(mypw ? mypw->pw_name : "anonymous"); tmp = Strnew_charp(mypw ? mypw->pw_name : "anonymous");
#else
tmp = Strnew_charp("anonymous");
#endif __MINGW32_VERSION
Strcat_char(tmp, '@'); Strcat_char(tmp, '@');
pass = tmp->ptr; pass = tmp->ptr;
} }
+7 -3
View File
@@ -1,7 +1,9 @@
/* $Id: indep.c,v 1.37 2006/04/07 13:21:11 inu Exp $ */ /* $Id: indep.c,v 1.38 2007/05/23 15:06:05 inu Exp $ */
#include "fm.h" #include "fm.h"
#include <stdio.h> #include <stdio.h>
#ifndef __MINGW32_VERSION
#include <pwd.h> #include <pwd.h>
#endif /* __MINGW32_VERSION */
#include <sys/param.h> #include <sys/param.h>
#include <sys/types.h> #include <sys/types.h>
#include <stdlib.h> #include <stdlib.h>
@@ -225,6 +227,7 @@ expandPath(char *name)
p = name; p = name;
if (*p == '~') { if (*p == '~') {
p++; p++;
#ifndef __MINGW32_VERSION
if (IS_ALPHA(*p)) { if (IS_ALPHA(*p)) {
char *q = strchr(p, '/'); char *q = strchr(p, '/');
if (q) { /* ~user/dir... */ if (q) { /* ~user/dir... */
@@ -238,8 +241,9 @@ expandPath(char *name)
if (!passent) if (!passent)
goto rest; goto rest;
extpath = Strnew_charp(passent->pw_dir); extpath = Strnew_charp(passent->pw_dir);
} } else
else if (*p == '/' || *p == '\0') { /* ~/dir... or ~ */ #endif /* __MINGW32_VERSION */
if (*p == '/' || *p == '\0') { /* ~/dir... or ~ */
extpath = Strnew_charp(getenv("HOME")); extpath = Strnew_charp(getenv("HOME"));
} }
else else
+12 -1
View File
@@ -1,4 +1,4 @@
/* $Id: istream.c,v 1.25 2006/04/07 13:21:11 inu Exp $ */ /* $Id: istream.c,v 1.26 2007/05/23 15:06:05 inu Exp $ */
#include "fm.h" #include "fm.h"
#include "myctype.h" #include "myctype.h"
#include "istream.h" #include "istream.h"
@@ -6,6 +6,9 @@
#ifdef USE_SSL #ifdef USE_SSL
#include <openssl/x509v3.h> #include <openssl/x509v3.h>
#endif #endif
#ifdef __MINGW32_VERSION
#include <winsock.h>
#endif
#define uchar unsigned char #define uchar unsigned char
@@ -617,13 +620,21 @@ ssl_get_certificate(SSL * ssl, char *hostname)
static void static void
basic_close(int *handle) basic_close(int *handle)
{ {
#ifdef __MINGW32_VERSION
closesocket(*(int *)handle);
#else
close(*(int *)handle); close(*(int *)handle);
#endif
} }
static int static int
basic_read(int *handle, char *buf, int len) basic_read(int *handle, char *buf, int len)
{ {
#ifdef __MINGW32_VERSION
return recv(*(int *)handle, buf, len, 0);
#else
return read(*(int *)handle, buf, len); return read(*(int *)handle, buf, len);
#endif
} }
static void static void
+11 -1
View File
@@ -1,4 +1,4 @@
/* $Id: local.c,v 1.34 2007/04/19 12:07:04 inu Exp $ */ /* $Id: local.c,v 1.35 2007/05/23 15:06:05 inu Exp $ */
#include "fm.h" #include "fm.h"
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
@@ -16,6 +16,10 @@
#include "local.h" #include "local.h"
#include "hash.h" #include "hash.h"
#ifdef __MINGW32_VERSION
#include <winsock.h>
#endif
#define CGIFN_NORMAL 0 #define CGIFN_NORMAL 0
#define CGIFN_LIBDIR 1 #define CGIFN_LIBDIR 1
#define CGIFN_CGIBIN 2 #define CGIFN_CGIBIN 2
@@ -194,8 +198,10 @@ check_local_cgi(char *file, int status)
return -1; return -1;
if (S_ISDIR(st.st_mode)) if (S_ISDIR(st.st_mode))
return -1; return -1;
#ifndef __MINGW32_VERSION
if ((st.st_uid == geteuid() && (st.st_mode & S_IXUSR)) || (st.st_gid == getegid() && (st.st_mode & S_IXGRP)) || (st.st_mode & S_IXOTH)) /* executable */ if ((st.st_uid == geteuid() && (st.st_mode & S_IXUSR)) || (st.st_gid == getegid() && (st.st_mode & S_IXGRP)) || (st.st_mode & S_IXOTH)) /* executable */
return 0; return 0;
#endif
return -1; return -1;
} }
@@ -354,6 +360,9 @@ localcgi_post(char *uri, char *qstr, FormList *request, char *referer)
pid_t pid; pid_t pid;
char *file = uri, *name = uri, *path_info = NULL, *tmpf = NULL; char *file = uri, *name = uri, *path_info = NULL, *tmpf = NULL;
#ifdef __MINGW32_VERSION
return NULL;
#else
status = cgi_filename(uri, &file, &name, &path_info); status = cgi_filename(uri, &file, &name, &path_info);
if (check_local_cgi(file, status) < 0) if (check_local_cgi(file, status) < 0)
return NULL; return NULL;
@@ -413,4 +422,5 @@ localcgi_post(char *uri, char *qstr, FormList *request, char *referer)
file, mybasename(file), strerror(errno)); file, mybasename(file), strerror(errno));
exit(1); exit(1);
return NULL; return NULL;
#endif
} }
+35 -1
View File
@@ -1,4 +1,4 @@
/* $Id: main.c,v 1.254 2007/05/23 12:34:20 inu Exp $ */ /* $Id: main.c,v 1.255 2007/05/23 15:06:05 inu Exp $ */
#define MAINPROGRAM #define MAINPROGRAM
#include "fm.h" #include "fm.h"
#include <signal.h> #include <signal.h>
@@ -24,6 +24,12 @@ extern int do_getch();
#endif /* defined(USE_GPM) || defined(USE_SYSMOUSE) */ #endif /* defined(USE_GPM) || defined(USE_SYSMOUSE) */
#endif #endif
#ifdef __MINGW32_VERSION
#include <winsock.h>
WSADATA WSAData;
#endif
#define DSTR_LEN 256 #define DSTR_LEN 256
Hist *LoadHist; Hist *LoadHist;
@@ -64,7 +70,11 @@ static char *MarkString = NULL;
static char *SearchString = NULL; static char *SearchString = NULL;
int (*searchRoutine) (Buffer *, char *); int (*searchRoutine) (Buffer *, char *);
#ifndef __MINGW32_VERSION
JMP_BUF IntReturn; JMP_BUF IntReturn;
#else
_JBTYPE IntReturn[_JBLEN];
#endif /* __MINGW32_VERSION */
static void delBuffer(Buffer *buf); static void delBuffer(Buffer *buf);
static void cmd_loadfile(char *path); static void cmd_loadfile(char *path);
@@ -753,6 +763,23 @@ main(int argc, char **argv, char **envp)
sock_init(); sock_init();
#endif #endif
#ifdef __MINGW32_VERSION
{
int err;
WORD wVerReq;
wVerReq = MAKEWORD(1, 1);
err = WSAStartup(wVerReq, &WSAData);
if (err != 0)
{
fprintf(stderr, "Can't find winsock\n");
return 1;
}
_fmode = _O_BINARY;
}
#endif
FirstTab = NULL; FirstTab = NULL;
LastTab = NULL; LastTab = NULL;
nTab = 0; nTab = 0;
@@ -5727,6 +5754,9 @@ w3m_exit(int i)
disconnectFTP(); disconnectFTP();
#ifdef USE_NNTP #ifdef USE_NNTP
disconnectNews(); disconnectNews();
#endif
#ifdef __MINGW32_VERSION
WSACleanup();
#endif #endif
exit(i); exit(i);
} }
@@ -6452,7 +6482,9 @@ download_action(struct parsed_tagarg *arg)
for (; arg; arg = arg->next) { for (; arg; arg = arg->next) {
if (!strncmp(arg->arg, "stop", 4)) { if (!strncmp(arg->arg, "stop", 4)) {
pid = (pid_t) atoi(&arg->arg[4]); pid = (pid_t) atoi(&arg->arg[4]);
#ifndef __MINGW32_VERSION
kill(pid, SIGKILL); kill(pid, SIGKILL);
#endif
} }
else if (!strncmp(arg->arg, "ok", 2)) else if (!strncmp(arg->arg, "ok", 2))
pid = (pid_t) atoi(&arg->arg[2]); pid = (pid_t) atoi(&arg->arg[2]);
@@ -6486,7 +6518,9 @@ stopDownload(void)
for (d = FirstDL; d != NULL; d = d->next) { for (d = FirstDL; d != NULL; d = d->next) {
if (d->ok) if (d->ok)
continue; continue;
#ifndef __MINGW32_VERSION
kill(d->pid, SIGKILL); kill(d->pid, SIGKILL);
#endif
unlink(d->lock); unlink(d->lock);
} }
} }
+5 -1
View File
@@ -1,4 +1,4 @@
/* $Id: rc.c,v 1.105 2007/05/23 13:07:44 inu Exp $ */ /* $Id: rc.c,v 1.106 2007/05/23 15:06:06 inu Exp $ */
/* /*
* Initialization file etc. * Initialization file etc.
*/ */
@@ -1126,7 +1126,11 @@ do_mkdir(const char *dir, long mode)
return mkdir(abs, mode); return mkdir(abs, mode);
} }
#else /* not __EMX__ */ #else /* not __EMX__ */
#ifdef __MINGW32_VERSION
#define do_mkdir(dir,mode) mkdir(dir)
#else
#define do_mkdir(dir,mode) mkdir(dir,mode) #define do_mkdir(dir,mode) mkdir(dir,mode)
#endif /* not __MINW32_VERSION */
#endif /* not __EMX__ */ #endif /* not __EMX__ */
void void
+82 -1
View File
@@ -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 * An original curses library for EUC-kanji by Akinori ITO, December 1989
* revised by Akinori ITO, January 1995 * revised by Akinori ITO, January 1995
@@ -15,7 +15,11 @@
#ifdef HAVE_SYS_SELECT_H #ifdef HAVE_SYS_SELECT_H
#include <sys/select.h> #include <sys/select.h>
#endif #endif
#ifndef __MINGW32_VERSION
#include <sys/ioctl.h> #include <sys/ioctl.h>
#else
#include <winsock.h>
#endif /* __MINGW32_VERSION */
#ifdef USE_MOUSE #ifdef USE_MOUSE
#ifdef USE_GPM #ifdef USE_GPM
#include <gpm.h> #include <gpm.h>
@@ -287,6 +291,42 @@ typedef struct sgttyb TerminalMode;
#define MODEFLAG(d) ((d).sg_flags) #define MODEFLAG(d) ((d).sg_flags)
#endif /* HAVE_SGTTY_H */ #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_LINE 200
#define MAX_COLUMN 400 #define MAX_COLUMN 400
@@ -511,6 +551,7 @@ set_tty(void)
void void
ttymode_set(int mode, int imode) ttymode_set(int mode, int imode)
{ {
#ifndef __MINGW32_VERSION
TerminalMode ioval; TerminalMode ioval;
TerminalGet(tty, &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); printf("Error occured while set %x: errno=%d\n", mode, errno);
reset_exit(SIGNAL_ARGLIST); reset_exit(SIGNAL_ARGLIST);
} }
#endif
} }
void void
ttymode_reset(int mode, int imode) ttymode_reset(int mode, int imode)
{ {
#ifndef __MINGW32_VERSION
TerminalMode ioval; TerminalMode ioval;
TerminalGet(tty, &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); printf("Error occured while reset %x: errno=%d\n", mode, errno);
reset_exit(SIGNAL_ARGLIST); reset_exit(SIGNAL_ARGLIST);
} }
#endif /* __MINGW32_VERSION */
} }
#ifndef HAVE_SGTTY_H #ifndef HAVE_SGTTY_H
@@ -2172,3 +2216,40 @@ touch_cursor()
#endif #endif
} }
#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 */
+10 -1
View File
@@ -1,10 +1,14 @@
/* $Id: url.c,v 1.94 2006/12/10 10:49:23 inu Exp $ */ /* $Id: url.c,v 1.95 2007/05/23 15:06:06 inu Exp $ */
#include "fm.h" #include "fm.h"
#ifndef __MINGW32_VERSION
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <netdb.h> #include <netdb.h>
#else
#include <winsock.h>
#endif /* __MINGW32_VERSION */
#include <signal.h> #include <signal.h>
#include <setjmp.h> #include <setjmp.h>
@@ -31,6 +35,11 @@
#define write(a,b,c) write_s(a,b,c) #define write(a,b,c) write_s(a,b,c)
#endif /* __WATT32__ */ #endif /* __WATT32__ */
#ifdef __MINGW32_VERSION
#define write(a,b,c) send(a,b,c, 0)
#define close(fd) closesocket(fd)
#endif
#ifdef INET6 #ifdef INET6
/* see rc.c, "dns_order" and dnsorders[] */ /* see rc.c, "dns_order" and dnsorders[] */
int ai_family_order_table[7][3] = { int ai_family_order_table[7][3] = {