aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ChangeLog267
-rw-r--r--Makefile.in6
-rw-r--r--Str.h4
-rw-r--r--acinclude.m460
-rw-r--r--aclocal.m460
-rw-r--r--anchor.c7
-rwxr-xr-xconfig.guess574
-rw-r--r--config.h.in9
-rwxr-xr-xconfig.sub89
-rwxr-xr-xconfigure166
-rw-r--r--configure.ac185
-rw-r--r--debian/changelog12
-rw-r--r--debian/compat1
-rw-r--r--debian/control2
-rwxr-xr-xdebian/rules4
-rw-r--r--display.c6
-rw-r--r--doc-jp/FAQ.html5
-rw-r--r--doc-jp/MANUAL.html1
-rw-r--r--doc-jp/keymap.default1
-rw-r--r--doc/FAQ.html6
-rw-r--r--doc/keymap.default1
-rw-r--r--etc.c2
-rw-r--r--file.c312
-rw-r--r--fm.h11
-rw-r--r--ftp.c2
-rw-r--r--functable.tab153
-rw-r--r--html.h3
-rw-r--r--indep.c2
-rw-r--r--islang.c2
-rw-r--r--istream.c2
-rw-r--r--keybind.c4
-rw-r--r--keybind_lynx.c4
-rw-r--r--libwc/Makefile.in2
-rw-r--r--libwc/charset.c10
-rw-r--r--libwc/detect.c2
-rw-r--r--local.c2
-rw-r--r--mailcap.c9
-rw-r--r--main.c84
-rw-r--r--menu.c6
-rw-r--r--parsetagx.c37
-rw-r--r--po/ja.po46
-rw-r--r--po/w3m.pot46
-rw-r--r--proto.h2
-rw-r--r--rc.c53
-rwxr-xr-xscripts/w3mmail.cgi.in3
-rw-r--r--scripts/w3mman/w3mman.1.in11
-rw-r--r--scripts/w3mman/w3mman.in5
-rw-r--r--scripts/w3mman/w3mman2html.cgi.in47
-rw-r--r--table.c15
-rw-r--r--terms.c37
-rw-r--r--terms.h6
-rw-r--r--url.c9
-rw-r--r--version.c.in4
-rw-r--r--w3mbookmark.c20
-rw-r--r--w3mimg/fb/fb_gdkpixbuf.c112
-rw-r--r--w3mimg/fb/fb_img.h3
-rw-r--r--w3mimg/fb/fb_imlib2.c8
-rw-r--r--w3mimg/fb/fb_w3mimg.c6
-rw-r--r--w3mimg/x11/x11_w3mimg.c124
59 files changed, 1922 insertions, 750 deletions
diff --git a/ChangeLog b/ChangeLog
index c729364..b9b626e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,268 @@
+2006-06-12 Dai Sato <satodai@w3m.jp>
+
+ * another fix for [w3m-dev-en 01067] Some more patches
+ * file.c (loadBuffer): avoid decoding when dump_extra option is specified.
+
+2006-06-10 Dai Sato <satodai@w3m.jp>
+
+ * fix for [w3m-dev-en 01067] Some more patches
+ * file.c (loadGeneralFile): avoid decoding when dump_extra option is specified.
+
+2006-06-10 Dai Sato <satodai@w3m.jp>
+
+ * [w3m-dev 03992] Change to display progress status when dump_extra option is specified
+ * file.c (loadHTMLstream): Show progress status when dump_extra option is specified.
+
+2006-06-07 Dai Sato <satodai@w3m.jp>
+
+ * [w3m-dev 04129] handling newlines in form values
+ * parsetagx.c: don't delete newlines in hidden values.
+
+2006-05-29 Dai Sato <satodai@w3m.jp>
+
+ * [w3m-dev-en 01067] Some more patches
+ * file.c, html.h, url.c: decode content-encoding in all situations.
+
+2006-05-29 Dai Sato <satodai@w3m.jp>
+
+ * [w3m-dev-en 01067] Some more patches
+ * main.c: delete calls to GC from wrap_GC_warn_proc to avoid deadlocks.
+
+2006-05-29 Dai Sato <satodai@w3m.jp>
+
+ * [w3m-dev-en 01067] Some more patches
+ * main.c: fix unsafe usages of SIGWINCH handler.
+
+2006-05-29 Dai Sato <satodai@w3m.jp>
+
+ * [w3m-dev-en 01067] Some more patches
+ * keybind(_lynx).c, doc(-jp)/keymap.default: add SHIFT-TAB as a default binding for PREV_LINK.
+
+2006-04-08 Dai Sato <satodai@w3m.jp>
+
+ * [w3m-dev 04154] Unclosed textarea in table
+ * table.c: close textarea when table related tags found.
+
+2006-04-08 Dai Sato <satodai@w3m.jp>
+
+ * [w3m-dev 04153] NEXT_LINK error
+ * anchor.c, filc.c, fm.h: check A tag in HTMLlineproc2body().
+
+2006-04-08 Dai Sato <satodai@w3m.jp>
+
+ * [w3m-dev 04152] [PATCH] Add more explanation for the usage of the option setting panel.
+ * doc(-jp)/FAQ.html, doc-jp/MANUAL.html: add explanations for .w3m/config and -o option.
+
+2006-04-08 Dai Sato <satodai@w3m.jp>
+
+ * [w3m-dev 04150] vi-prec_num
+ * main.c: fix vi_prec_num switching.
+
+2006-04-08 Dai Sato <satodai@w3m.jp>
+
+ * [w3m-dev 04146] disable HAVE_LANGINFO_CODESET on cygwin
+ * configure.ac: avoid AM_LANGINFO_CODESET check for Cygwin.
+
+2006-04-07 Dai Sato <satodai@w3m.jp>
+
+ * [w3m-dev-en 01060] Some patches
+ * file.c, fm.h, rc.c: Introduce option show_cookie and set it TRUE by default. If set to FALSE received cookies will not be shown.
+ * This fixes Debian bug #253547: w3m: Too slow receiving cookies.
+
+2006-04-07 Dai Sato <satodai@w3m.jp>
+
+ * [w3m-dev-en 01060] Some patches
+ * parsetagx.c: Replace '\n' (newline) with ' ' (space) in attributes of html tags instead of ignoring them.
+ * Fixes Debian bug #326167: w3m: new lines in hidden form fields are stripped
+
+2006-04-07 Dai Sato <satodai@w3m.jp>
+
+ * [w3m-dev-en 01060] Some patches
+ * scripts/w3mman/w3mman*.in: Add w3mman -l <file> command line argument for viewing of local man files.
+ * Fixes Debian bug #138805: w3mman -l doesn't work.
+
+2006-04-07 Dai Sato <satodai@w3m.jp>
+
+ * [w3m-dev-en 01060] Some patches
+ * libwc/detect.c: Use the hint instead of US_ASCII in wc_auto_detect.
+ * Fixes Debian bug #291735: w3m shouldn't "simplify" page's charset
+
+2006-04-07 Dai Sato <satodai@w3m.jp>
+
+ * [w3m-dev-en 01060] Some patches
+ * Str.h, table.c: Use Strnew_charp() instead of the wrong Strnew().
+ * Fixes SF bug #895351 Strnew called with argument in table.c.
+
+2006-02-10 Dai Sato <satodai@w3m.jp>
+
+ * http://dog.w3m.jp/bbs/spool/until200602.html#20060210153135@keijiwan
+ * url.c: replace pclose passed to localcgi_post/get() with fclose in openURL()
+
+2006-02-09 Dai Sato <satodai@w3m.jp>
+
+ * http://vimrc.hp.infoseek.co.jp/w3m-pclose.html
+ * file.c: replace pclose with fclose in the end of uncompress_stream()
+
+2005-02-27 Fumitoshi UKAI <ukai@debian.or.jp>
+
+ * configure.ac: rename from configure.in. this is for autoconf2.50
+
+2005-02-27 NOMIYA Masaru <nomiya@ttmy.ne.jp>
+
+ * [w3m-dev 04143] Patch for OS/2
+ * config.h.in: ifdef HAVE_SETPGRP
+ * configure.in: define USE_BINMODE_STREAM for *os2-emx*
+ * islang.c: ULONG -> unsigned long
+ * main.c: ULONG -> unsigned long
+
+2005-02-15 Fumitoshi UKAI <ukai@debian.or.jp>
+
+ * [w3m-dev-en 01045] From newbie: problem with w3m-0.5.1 installation
+ * acinclude.m4 (AC_W3M_SSL): define USE_SSL after ssl library found
+
+2005-01-19 Kiyokazu SUTO <suto@ks-and-ks.ne.jp>
+
+ * [w3m-dev 04133] mouse_end() should preced reset_tty()?
+ * terms.c (reset_exit): mouse_end() should precede reset_tty()
+
+2005-01-05 Kiyokazu SUTO <suto@ks-and-ks.ne.jp>
+
+ * [w3m-dev 04130] [w3m-dev 04131] [w3m-dev 04132] Multiple challeges in *-Authenticate header
+ * file.c (skip_auth_token): added
+ (extract_auth_val): ',' is end of token
+ (extract_auth_param): use skip_auth_token
+ (AuthDigestCred): parse qop and calc cnonce correctly
+ (findAuthentication): use skip_auth_token
+
+2004-11-09 Fumitoshi UKAI <ukai@debian.or.jp>
+
+ * w3mimg/fb/fb_gdkpixbuf.c (fb_image_load):
+ fix unused variable `i'
+ * w3mimg/x11/x11_w3mimg.c (x11_load_image):
+ ditto
+
+2004-11-09 Hiroyuki Ito <ZXB01226@nifty.com>
+
+ * [w3m-dev 04128] Re: w3mimgdisplay
+ * acinclude.m4 (AC_W3M_IMAGE): check not yes
+ * aclocal.m4, configure: regen
+ * w3mimg/fb/fb_gdkpixbuf.c (fb_image_load):
+ fb_image_fill in case GDK_PIXBUF_FRAME_DISPOSE
+ * w3mimg/x11/x11_w3mimg.c (get_animation_size):
+ return n
+ (x11_load_image):
+ fill in case GDK_PIXBUF_FRAME_DISPOSE
+
+2004-11-05 Hiroyuki Ito <ZXB01226@nifty.com>
+
+ * [w3m-dev 04117] Re: start attribute and value attribute on ordered lists
+ * file.c (HTMLtagproc1): allow negative value for start attr
+
+2004-10-14 Fumitoshi UKAI <ukai@debian.or.jp>
+
+ * Bug#276246: w3m's locale parsing should at least see '@euro' modifier
+ * config.h (HAVE_LANGINFO_CODESET): added
+ * configure.in (AM_LANGINFO_CODESET): added
+ * libwc/charset.c: #include <langinfo.h>
+ (wc_charset_to_ces): use nl_langinfo(CODESET)
+
+2004-09-30 Hiroyuki Ito <ZXB01226@nifty.com>
+
+ * [w3m-dev 04108] PIPE_BUF
+ * main.c (pipeBuf): set buf->currentURL.file to prevent
+ segfault by "PIPE_BUF cat;VIEW SOURCE;"
+
+2004-08-31 SAKAI Kiyotaka <ksakai@kso.netwk.ntt-at.co.jp>
+
+ * [w3m-dev 04104] w3mmail.cgi
+ * scripts/w3mmail.cgi.in: strip ^M
+
+2004-08-17 Hiroyuki Ito <ZXB01226@nifty.com>
+
+ * [w3m-dev 04099] Re: w3m-img gtk2
+ * w3mimg/fb/fb_gdkpixbuf.c (fb_image_load): fix resize bug
+
+2004-08-06 Hiroyuki Ito <ZXB01226@nifty.com>
+
+ * [w3m-dev 04097] Re: w3m-img gtk2
+ * w3mimg/fb/fb_gdkpixbuf.c (draw): no need bg
+ (get_animation_size): use GTimeVal
+ (fb_image_load): use GTimeVal
+ fix for animation
+ * w3mimg/x11/x11_w3mimg.c (get_animation_size): use GTimeVal
+ (x11_load_image): use GTimeVal
+ fix for animation
+
+2004-08-05 Fumitoshi UKAI <ukai@debian.or.jp>
+
+ * [w3m-dev 04096] w3m-img gtk2
+ * acinclude.m4 (AC_W3M_IMAGE): add USE_GTK2
+ add --with-imagelib=gtk2
+ * aclocal.m4 config.guess config.sub configure: regen
+ * config.h.in: add USE_GTK2
+ * w3mimg/fb/fb_gdkpixbuf.c: support USE_GTK2
+ * w3mimg/fb/fb_img.h: add fb_image_init()
+ * w3mimg/fb/fb_imlib2.h: fb_image_init() stub
+ * w3mimg/fb/fb_w3mimg.c: call fb_image_init()
+ * w3mimg/x11/x11_w3mimg.c: support USE_GTK2
+
+2004-08-03 WATANABE Katsuyuki <knabe@sannet.ne.jp>
+
+ * [w3m-dev 04095] build fix when configure with --enable-messagel10n
+ * main.c (main): locale and textdomain initialization if ENABLE_NLS
+ * menu.c (initMenu): use _() instead of gettext()
+ * rc.c (show_params): use _() instead of gettext()
+
+2004-07-18 WATANABE Katsuyuki <knabe@sannet.ne.jp>
+
+ * [w3m-dev 04094] Re: option panel: gettextize select list
+ * rc.c (load_option_panel): don't gettext&wc_conv colorstr
+ several times
+
+2004-07-16 WATANABE Katsuyuki <knabe@sannet.ne.jp>
+
+ * [w3m-dev 04093] bookmark charset
+ * add global variable: BookmarkCharset.
+ * main.c:adBmark(): remove condition LANG = JA.
+ * main.c: buffername encode by BookmarkCharset when add bookmark.
+ * main.c: BookmarkCharset pass to w3mbookmark.
+ * w3mbookmark.c: ditto.
+
+2004-07-16 WATANABE Katsuyuki <knabe@sannet.ne.jp>
+
+ * [w3m-dev 04092] remove __CYGWIN__ && LANG == JA
+ * remove condition LANG == JA && __CYGWIN__
+ * cygwin_mouse_btn_swapped enabled when before 1.5.x
+
+2004-07-16 WATANABE Katsuyuki <knabe@sannet.ne.jp>
+
+ * [w3m-dev 04091] option panel: gettextize select list
+ * rc.c: gettextize option select list.
+ * rc.c: add gettextize message.
+ * po/w3m.pot: ditto.
+ * po/ja.po: ditto.
+
+2004-07-14 Fumitoshi UKAI <ukai@debian.or.jp>
+
+ * Debian Bug#259053
+ * doc/FAQ.html, doc-jp/FAQ.html: ~/.mailcap -> ~/.w3m/mailcap
+
+2004-05-11 Fumitoshi UKAI <ukai@debian.or.jp>
+
+ * based on [w3m-dev 04079]
+ SAKAI Kiyotaka <ksakai@kso.netwk.ntt-at.co.jp>
+ * Makefile.in: (libwc/libwc.a): always make in libwc subdir
+ (w3mimg/w3mimg.a): always make in w3mimg subdir
+
+2004-05-03 Fumitoshi UKAI <ukai@debian.or.jp>
+
+ * [w3m-dev-en 01007]
+ * libwc/Makefile.in (CFLAGS): need @CPPFLAGS@
+
+2004-05-03 Fumitoshi UKAI <ukai@debian.or.jp>
+
+ * version.c.in: cvs version
+
2004-04-29 Fumitoshi UKAI <ukai@debian.or.jp>
* w3m 0.5.1
@@ -8483,4 +8748,4 @@ a * [w3m-dev 03276] compile error on EWS4800
* release-0-2-1
* import w3m-0.2.1
-$Id: ChangeLog,v 1.924 2004/04/28 18:19:22 ukai Exp $
+$Id: ChangeLog,v 1.968 2006/06/12 11:51:59 inu Exp $
diff --git a/Makefile.in b/Makefile.in
index 6f29477..2110530 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -182,7 +182,8 @@ $(INFLATE): inflate.o $(ALIB)
inflate.o: inflate.c
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/inflate.c
-libwc/libwc.a:
+libwc/libwc.a: libwc
+libwc:
(cd libwc && $(MAKE) CC='$(CC0)' OPTS='$(OPTS)')
dummy.o: entity.c
@@ -194,7 +195,8 @@ $(IMGDISPLAY): w3mimgdisplay.o $(ALIB) w3mimg/w3mimg.a
w3mimgdisplay.o: w3mimgdisplay.c w3mimg/w3mimg.h
$(CC) $(CFLAGS) $(IMGCFLAGS) -o $@ -c $(srcdir)/w3mimgdisplay.c
-w3mimg/w3mimg.a:
+w3mimg/w3mimg.a: w3mimg
+w3mimg:
(cd w3mimg && $(MAKE) CC="$(CC0)" OPTS="$(OPTS)")
po:
diff --git a/Str.h b/Str.h
index af0b2de..f345c74 100644
--- a/Str.h
+++ b/Str.h
@@ -1,4 +1,4 @@
-/* $Id: Str.h,v 1.5 2003/01/20 15:30:19 ukai Exp $ */
+/* $Id: Str.h,v 1.6 2006/04/07 13:35:35 inu Exp $ */
/*
* String manipulation library for Boehm GC
*
@@ -28,7 +28,7 @@ typedef struct _Str {
int area_size;
} *Str;
-Str Strnew();
+Str Strnew(void);
Str Strnew_size(int);
Str Strnew_charp(char *);
Str Strnew_charp_n(char *, int);
diff --git a/acinclude.m4 b/acinclude.m4
index dfa9692..e10b7ed 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -486,7 +486,6 @@ AC_ARG_WITH(ssl,
[with_ssl="yes"])
AC_MSG_RESULT($with_ssl)
if test x"$with_ssl" != xno; then
- AC_DEFINE(USE_SSL)
PKG_CHECK_MODULES(SSL, openssl,,[
AC_MSG_CHECKING(for SSL library/header)
test x"$with_ssl" = xyes && with_ssl="/usr/openssl /usr/ssl /usr /usr/local/openssl /usr/local/ssl /usr/local"
@@ -512,6 +511,7 @@ if test x"$with_ssl" != xno; then
[$SSL_LIBS -lcrypto])
if test x"$w3m_ssl" = xfound; then
+ AC_DEFINE(USE_SSL)
AC_MSG_CHECKING(if SSL certificate verify is enabled)
AC_ARG_ENABLE(sslverify,
[ --disable-sslverify verify SSL certificate],,
@@ -573,6 +573,7 @@ AC_DEFUN([AC_W3M_IMAGE],
INSTALL_W3MIMGDISPLAY='${INSTALL_PROGRAM}'
AC_DEFINE(INSTALL_W3MIMGDISPLAY, $INSTALL_W3MIMGDISPLAY)
AC_SUBST(USE_GDKPIXBUF)
+ AC_SUBST(USE_GTK2)
AC_SUBST(USE_IMLIB)
AC_SUBST(USE_IMLIB2)
AC_SUBST(IMGTARGETS)
@@ -618,16 +619,17 @@ AC_DEFUN([AC_W3M_IMAGE],
AC_ARG_WITH(imagelib,
[ --with-imagelib=IMAGELIBS image library
IMAGELIBS may be space separeted list of:
- gdk-pixbuf imlib imlib2],,
+ gtk2 gdk-pixbuf imlib imlib2],,
[with_imagelib="yes"])
if test x"$with_imagelib" = xyes; then
- with_imagelib="gdk-pixbuf imlib imlib2"
+ with_imagelib="gtk2 gdk-pixbuf imlib imlib2"
fi
AC_MSG_RESULT($with_imagelib)
with_imlib=no
with_imlib2=no
with_gdkpixbuf=no
+ with_gtk2=no
for imagelib in $with_imagelib
do
case "$imagelib" in
@@ -646,15 +648,31 @@ AC_DEFUN([AC_W3M_IMAGE],
if test x"$GDKPIXBUF_CONFIG" = x; then
GDKPIXBUF_CONFIG=gdk-pixbuf-config
fi;;
+ gtk2)
+ with_gtk2="yes"
+ if test x"$PKG_CONFIG" = x; then
+ PKG_CONFIG=pkg-config
+ else
+ PKG_CONFIG=:
+ fi;;
esac
done
IMGTARGETS=""
- if test x"$with_gdkpixbuf" = xyes; then
+ if test x"$with_gtk2" = xyes; then
AC_W3M_CHECK_VER([GdkPixbuf],
+ [`$PKG_CONFIG --modversion gdk-pixbuf-2.0 2>/dev/null`],
+ 2, 0, 0,
+ [have_gdkpixbuf="yes"; have_gtk2="yes"],
+ [have_gdkpixbuf="no"; have_gtk2="no"])
+ fi
+ if test x"$with_gdkpixbuf" = xyes; then
+ if test x"$have_gdkpixbuf" != xyes; then
+ AC_W3M_CHECK_VER([GdkPixbuf],
[`$GDKPIXBUF_CONFIG --version 2>/dev/null`],
0, 16, 0,
[have_gdkpixbuf="yes"],
[have_gdkpixbuf="no"])
+ fi
fi
if test x"$with_imlib" = xyes; then
AC_W3M_CHECK_VER([Imlib],
@@ -671,46 +689,64 @@ AC_DEFUN([AC_W3M_IMAGE],
[have_imlib2="no"])
fi
if test x"$x11" = xyes; then
- if test x"$have_gdkpixbuf" = xyes; then
+ if test x"$have_gtk2" = xyes; then
AC_DEFINE(USE_W3MIMG_X11)
+ IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
+ IMGTARGETS="x11"
AC_DEFINE(USE_GDKPIXBUF)
+ AC_DEFINE(USE_GTK2)
+ IMGX11CFLAGS="`${PKG_CONFIG} --cflags gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0 gtk+-2.0`"
+ IMGX11LDFLAGS="`${PKG_CONFIG} --libs gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0 gtk+-2.0`"
+ elif test x"$have_gdkpixbuf" = xyes; then
+ AC_DEFINE(USE_W3MIMG_X11)
IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
+ IMGTARGETS="x11"
+ AC_DEFINE(USE_GDKPIXBUF)
IMGX11CFLAGS="`${GDKPIXBUF_CONFIG} --cflags`"
IMGX11LDFLAGS="`${GDKPIXBUF_CONFIG} --libs` -lgdk_pixbuf_xlib"
- IMGTARGETS="x11"
elif test x"$have_imlib" = xyes; then
AC_DEFINE(USE_W3MIMG_X11)
- AC_DEFINE(USE_IMLIB)
IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
+ IMGTARGETS="x11"
+ AC_DEFINE(USE_IMLIB)
IMGX11CFLAGS="`${IMLIB_CONFIG} --cflags`"
IMGX11LDFLAGS="`${IMLIB_CONFIG} --libs`"
IMGTARGETS="x11"
elif test x"$have_imlib2" = xyes; then
AC_DEFINE(USE_W3MIMG_X11)
- AC_DEFINE(USE_IMLIB2)
IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
+ IMGTARGETS="x11"
+ AC_DEFINE(USE_IMLIB2)
IMGX11CFLAGS="`${IMLIB2_CONFIG} --cflags`"
IMGX11LDFLAGS="`${IMLIB2_CONFIG} --libs`"
- IMGTARGETS="x11"
else
AC_MSG_WARN([unable to build w3mimgdisplay with X11 support])
fi
fi
if test x"$fb" = xyes; then
- if test x"$have_gdkpixbuf" = xyes; then
+ if test x"$have_gtk2" = xyes; then
AC_DEFINE(USE_W3MIMG_FB)
+ IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
+ IMGTARGETS="${IMGTARGETS} fb"
AC_DEFINE(USE_GDKPIXBUF)
+ AC_DEFINE(USE_GTK2)
+ IMGFBCFLAGS="`${PKG_CONFIG} --cflags gdk-pixbuf-2.0 gtk+-2.0`"
+ IMGFBLDFLAGS="`${PKG_CONFIG} --libs gdk-pixbuf-2.0 gtk+-2.0`"
+ elif test x"$have_gdkpixbuf" = xyes; then
+ AC_DEFINE(USE_W3MIMG_FB)
IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
+ IMGTARGETS="${IMGTARGETS} fb"
+ AC_DEFINE(USE_GDKPIXBUF)
IMGFBCFLAGS="`${GDKPIXBUF_CONFIG} --cflags`"
IMGFBLDFLAGS="`${GDKPIXBUF_CONFIG} --libs`"
- IMGTARGETS="${IMGTARGETS} fb"
elif test x"$have_imlib2" = xyes; then
AC_DEFINE(USE_W3MIMG_FB)
+ IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
+ IMGTARGETS="${IMGTARGETS} fb"
AC_DEFINE(USE_IMLIB2)
IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
IMGFBCFLAGS="`${IMLIB2_CONFIG} --cflags`"
IMGFBLDFLAGS="`${IMLIB2_CONFIG} --libs`"
- IMGTARGETS="${IMGTARGETS} fb"
else
AC_MSG_WARN([unable to build w3mimgdisplay with FB support])
fi
diff --git a/aclocal.m4 b/aclocal.m4
index 4e5529c..957a741 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -498,7 +498,6 @@ AC_ARG_WITH(ssl,
[with_ssl="yes"])
AC_MSG_RESULT($with_ssl)
if test x"$with_ssl" != xno; then
- AC_DEFINE(USE_SSL)
PKG_CHECK_MODULES(SSL, openssl,,[
AC_MSG_CHECKING(for SSL library/header)
test x"$with_ssl" = xyes && with_ssl="/usr/openssl /usr/ssl /usr /usr/local/openssl /usr/local/ssl /usr/local"
@@ -524,6 +523,7 @@ if test x"$with_ssl" != xno; then
[$SSL_LIBS -lcrypto])
if test x"$w3m_ssl" = xfound; then
+ AC_DEFINE(USE_SSL)
AC_MSG_CHECKING(if SSL certificate verify is enabled)
AC_ARG_ENABLE(sslverify,
[ --disable-sslverify verify SSL certificate],,
@@ -585,6 +585,7 @@ AC_DEFUN([AC_W3M_IMAGE],
INSTALL_W3MIMGDISPLAY='${INSTALL_PROGRAM}'
AC_DEFINE(INSTALL_W3MIMGDISPLAY, $INSTALL_W3MIMGDISPLAY)
AC_SUBST(USE_GDKPIXBUF)
+ AC_SUBST(USE_GTK2)
AC_SUBST(USE_IMLIB)
AC_SUBST(USE_IMLIB2)
AC_SUBST(IMGTARGETS)
@@ -630,16 +631,17 @@ AC_DEFUN([AC_W3M_IMAGE],
AC_ARG_WITH(imagelib,
[ --with-imagelib=IMAGELIBS image library
IMAGELIBS may be space separeted list of:
- gdk-pixbuf imlib imlib2],,
+ gtk2 gdk-pixbuf imlib imlib2],,
[with_imagelib="yes"])
if test x"$with_imagelib" = xyes; then
- with_imagelib="gdk-pixbuf imlib imlib2"
+ with_imagelib="gtk2 gdk-pixbuf imlib imlib2"
fi
AC_MSG_RESULT($with_imagelib)
with_imlib=no
with_imlib2=no
with_gdkpixbuf=no
+ with_gtk2=no
for imagelib in $with_imagelib
do
case "$imagelib" in
@@ -658,15 +660,31 @@ AC_DEFUN([AC_W3M_IMAGE],
if test x"$GDKPIXBUF_CONFIG" = x; then
GDKPIXBUF_CONFIG=gdk-pixbuf-config
fi;;
+ gtk2)
+ with_gtk2="yes"
+ if test x"$PKG_CONFIG" = x; then
+ PKG_CONFIG=pkg-config
+ else
+ PKG_CONFIG=:
+ fi;;
esac
done
IMGTARGETS=""
- if test x"$with_gdkpixbuf" = xyes; then
+ if test x"$with_gtk2" = xyes; then
AC_W3M_CHECK_VER([GdkPixbuf],
+ [`$PKG_CONFIG --modversion gdk-pixbuf-2.0 2>/dev/null`],
+ 2, 0, 0,
+ [have_gdkpixbuf="yes"; have_gtk2="yes"],
+ [have_gdkpixbuf="no"; have_gtk2="no"])
+ fi
+ if test x"$with_gdkpixbuf" = xyes; then
+ if test x"$have_gdkpixbuf" != xyes; then
+ AC_W3M_CHECK_VER([GdkPixbuf],
[`$GDKPIXBUF_CONFIG --version 2>/dev/null`],
0, 16, 0,
[have_gdkpixbuf="yes"],
[have_gdkpixbuf="no"])
+ fi
fi
if test x"$with_imlib" = xyes; then
AC_W3M_CHECK_VER([Imlib],
@@ -683,46 +701,64 @@ AC_DEFUN([AC_W3M_IMAGE],
[have_imlib2="no"])
fi
if test x"$x11" = xyes; then
- if test x"$have_gdkpixbuf" = xyes; then
+ if test x"$have_gtk2" = xyes; then
AC_DEFINE(USE_W3MIMG_X11)
+ IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
+ IMGTARGETS="x11"
AC_DEFINE(USE_GDKPIXBUF)
+ AC_DEFINE(USE_GTK2)
+ IMGX11CFLAGS="`${PKG_CONFIG} --cflags gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0 gtk+-2.0`"
+ IMGX11LDFLAGS="`${PKG_CONFIG} --libs gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0 gtk+-2.0`"
+ elif test x"$have_gdkpixbuf" = xyes; then
+ AC_DEFINE(USE_W3MIMG_X11)
IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
+ IMGTARGETS="x11"
+ AC_DEFINE(USE_GDKPIXBUF)
IMGX11CFLAGS="`${GDKPIXBUF_CONFIG} --cflags`"
IMGX11LDFLAGS="`${GDKPIXBUF_CONFIG} --libs` -lgdk_pixbuf_xlib"
- IMGTARGETS="x11"
elif test x"$have_imlib" = xyes; then
AC_DEFINE(USE_W3MIMG_X11)
- AC_DEFINE(USE_IMLIB)
IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
+ IMGTARGETS="x11"
+ AC_DEFINE(USE_IMLIB)
IMGX11CFLAGS="`${IMLIB_CONFIG} --cflags`"
IMGX11LDFLAGS="`${IMLIB_CONFIG} --libs`"
IMGTARGETS="x11"
elif test x"$have_imlib2" = xyes; then
AC_DEFINE(USE_W3MIMG_X11)
- AC_DEFINE(USE_IMLIB2)
IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
+ IMGTARGETS="x11"
+ AC_DEFINE(USE_IMLIB2)
IMGX11CFLAGS="`${IMLIB2_CONFIG} --cflags`"
IMGX11LDFLAGS="`${IMLIB2_CONFIG} --libs`"
- IMGTARGETS="x11"
else
AC_MSG_WARN([unable to build w3mimgdisplay with X11 support])
fi
fi
if test x"$fb" = xyes; then
- if test x"$have_gdkpixbuf" = xyes; then
+ if test x"$have_gtk2" = xyes; then
AC_DEFINE(USE_W3MIMG_FB)
+ IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
+ IMGTARGETS="${IMGTARGETS} fb"
AC_DEFINE(USE_GDKPIXBUF)
+ AC_DEFINE(USE_GTK2)
+ IMGFBCFLAGS="`${PKG_CONFIG} --cflags gdk-pixbuf-2.0 gtk+-2.0`"
+ IMGFBLDFLAGS="`${PKG_CONFIG} --libs gdk-pixbuf-2.0 gtk+-2.0`"
+ elif test x"$have_gdkpixbuf" = xyes; then
+ AC_DEFINE(USE_W3MIMG_FB)
IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
+ IMGTARGETS="${IMGTARGETS} fb"
+ AC_DEFINE(USE_GDKPIXBUF)
IMGFBCFLAGS="`${GDKPIXBUF_CONFIG} --cflags`"
IMGFBLDFLAGS="`${GDKPIXBUF_CONFIG} --libs`"
- IMGTARGETS="${IMGTARGETS} fb"
elif test x"$have_imlib2" = xyes; then
AC_DEFINE(USE_W3MIMG_FB)
+ IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
+ IMGTARGETS="${IMGTARGETS} fb"
AC_DEFINE(USE_IMLIB2)
IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
IMGFBCFLAGS="`${IMLIB2_CONFIG} --cflags`"
IMGFBLDFLAGS="`${IMLIB2_CONFIG} --libs`"
- IMGTARGETS="${IMGTARGETS} fb"
else
AC_MSG_WARN([unable to build w3mimgdisplay with FB support])
fi
diff --git a/anchor.c b/anchor.c
index 5211048..27bbd56 100644
--- a/anchor.c
+++ b/anchor.c
@@ -1,4 +1,4 @@
-/* $Id: anchor.c,v 1.30 2003/09/26 17:59:51 ukai Exp $ */
+/* $Id: anchor.c,v 1.33 2006/04/08 11:33:16 inu Exp $ */
#include "fm.h"
#include "myctype.h"
#include "regex.h"
@@ -175,6 +175,8 @@ searchAnchor(AnchorList *al, char *str)
return NULL;
for (i = 0; i < al->nanchor; i++) {
a = &al->anchors[i];
+ if (a->hseq < 0)
+ continue;
if (!strcmp(a->url, str))
return a;
}
@@ -471,6 +473,7 @@ putHmarker(HmarkerList *ml, int line, int pos, int seq)
}
ml->marks[seq].line = line;
ml->marks[seq].pos = pos;
+ ml->marks[seq].invalid = 0;
return ml;
}
@@ -778,7 +781,7 @@ link_list_panel(Buffer *buf)
al = buf->href;
for (i = 0; i < al->nanchor; i++) {
a = &al->anchors[i];
- if (a->slave)
+ if (a->hseq < 0 || a->slave)
continue;
parseURL2(a->url, &pu, baseURL(buf));
p = parsedURL2Str(&pu)->ptr;
diff --git a/config.guess b/config.guess
index 45bee13..c38553d 100755
--- a/config.guess
+++ b/config.guess
@@ -3,7 +3,7 @@
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-timestamp='2005-04-22'
+timestamp='2006-02-23'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -17,13 +17,15 @@ timestamp='2005-04-22'
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
+
# Originally written by Per Bothner <per@bothner.com>.
# Please send patches to <config-patches@gnu.org>. Submit a context
# diff and a properly formatted ChangeLog entry.
@@ -66,11 +68,11 @@ Try \`$me --help' for more information."
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
- echo "$timestamp" ; exit 0 ;;
+ echo "$timestamp" ; exit ;;
--version | -v )
- echo "$version" ; exit 0 ;;
+ echo "$version" ; exit ;;
--help | --h* | -h )
- echo "$usage"; exit 0 ;;
+ echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
@@ -104,7 +106,7 @@ set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
@@ -123,7 +125,7 @@ case $CC_FOR_BUILD,$HOST_CC,$CC in
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ;'
+esac ; set_cc_for_build= ;'
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
@@ -196,55 +198,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
- exit 0 ;;
- amd64:OpenBSD:*:*)
- echo x86_64-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- amiga:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- cats:OpenBSD:*:*)
- echo arm-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- hp300:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- luna88k:OpenBSD:*:*)
- echo m88k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mac68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- macppc:OpenBSD:*:*)
- echo powerpc-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme88k:OpenBSD:*:*)
- echo m88k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvmeppc:OpenBSD:*:*)
- echo powerpc-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sgi:OpenBSD:*:*)
- echo mips64-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sun3:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:OpenBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ exit ;;
*:ekkoBSD:*:*)
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
+ *:SolidBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ exit ;;
macppc:MirBSD:*:*)
echo powerppc-unknown-mirbsd${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:MirBSD:*:*)
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
*4.0)
@@ -297,40 +267,43 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit 0 ;;
+ exit ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
# of the specific Alpha model?
echo alpha-pc-interix
- exit 0 ;;
+ exit ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
- exit 0 ;;
+ exit ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
- exit 0;;
+ exit ;;
*:[Aa]miga[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-amigaos
- exit 0 ;;
+ exit ;;
*:[Mm]orph[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-morphos
- exit 0 ;;
+ exit ;;
*:OS/390:*:*)
echo i370-ibm-openedition
- exit 0 ;;
+ exit ;;
*:z/VM:*:*)
echo s390-ibm-zvmoe
- exit 0 ;;
+ exit ;;
*:OS400:*:*)
echo powerpc-ibm-os400
- exit 0 ;;
+ exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
- exit 0;;
+ exit ;;
+ arm:riscos:*:*|arm:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
- exit 0;;
+ exit ;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
@@ -338,32 +311,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
else
echo pyramid-pyramid-bsd
fi
- exit 0 ;;
+ exit ;;
NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
- exit 0 ;;
+ exit ;;
DRS?6000:unix:4.0:6*)
echo sparc-icl-nx6
- exit 0 ;;
+ exit ;;
DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7 && exit 0 ;;
+ sparc) echo sparc-icl-nx7; exit ;;
esac ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
+ exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
+ exit ;;
i86pc:SunOS:5.*:*)
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
+ exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
+ exit ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
Series*|S4*)
@@ -372,10 +345,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit 0 ;;
+ exit ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
@@ -387,10 +360,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo sparc-sun-sunos${UNAME_RELEASE}
;;
esac
- exit 0 ;;
+ exit ;;
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
@@ -401,40 +374,40 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
- exit 0 ;;
+ exit ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
@@ -458,32 +431,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
exit (-1);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c \
- && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
- && exit 0
+ $CC_FOR_BUILD -o $dummy $dummy.c &&
+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`$dummy $dummyarg` &&
+ { echo "$SYSTEM_NAME"; exit; }
echo mips-mips-riscos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
- exit 0 ;;
+ exit ;;
Motorola:*:4.3:PL8-*)
echo powerpc-harris-powermax
- exit 0 ;;
+ exit ;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
echo powerpc-harris-powermax
- exit 0 ;;
+ exit ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
- exit 0 ;;
+ exit ;;
m88k:CX/UX:7*:*)
echo m88k-harris-cxux7
- exit 0 ;;
+ exit ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
- exit 0 ;;
+ exit ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
- exit 0 ;;
+ exit ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
@@ -499,29 +473,29 @@ EOF
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
- exit 0 ;;
+ exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
- exit 0 ;;
+ exit ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
- exit 0 ;;
+ exit ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3
- exit 0 ;;
+ exit ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
- exit 0 ;;
+ exit ;;
*:IRIX*:*:*)
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit 0 ;;
+ exit ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
echo i386-ibm-aix
- exit 0 ;;
+ exit ;;
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
@@ -529,7 +503,7 @@ EOF
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit 0 ;;
+ exit ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
eval $set_cc_for_build
@@ -544,14 +518,18 @@ EOF
exit(0);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
- echo rs6000-ibm-aix3.2.5
+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
else
echo rs6000-ibm-aix3.2
fi
- exit 0 ;;
+ exit ;;
*:AIX:*:[45])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
@@ -565,28 +543,28 @@ EOF
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit 0 ;;
+ exit ;;
*:AIX:*:*)
echo rs6000-ibm-aix
- exit 0 ;;
+ exit ;;
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
- exit 0 ;;
+ exit ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit 0 ;; # report: romp-ibm BSD 4.3
+ exit ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
- exit 0 ;;
+ exit ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
- exit 0 ;;
+ exit ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
- exit 0 ;;
+ exit ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
- exit 0 ;;
+ exit ;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "${UNAME_MACHINE}" in
@@ -648,9 +626,19 @@ EOF
esac
if [ ${HP_ARCH} = "hppa2.0w" ]
then
- # avoid double evaluation of $set_cc_for_build
- test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
+ eval $set_cc_for_build
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep __LP64__ >/dev/null
then
HP_ARCH="hppa2.0w"
else
@@ -658,11 +646,11 @@ EOF
fi
fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit 0 ;;
+ exit ;;
ia64:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ia64-hp-hpux${HPUX_REV}
- exit 0 ;;
+ exit ;;
3050*:HI-UX:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
@@ -690,161 +678,177 @@ EOF
exit (0);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
echo unknown-hitachi-hiuxwe2
- exit 0 ;;
+ exit ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
echo hppa1.1-hp-bsd
- exit 0 ;;
+ exit ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
- exit 0 ;;
+ exit ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
- exit 0 ;;
+ exit ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
- exit 0 ;;
+ exit ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
- exit 0 ;;
+ exit ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk
else
echo ${UNAME_MACHINE}-unknown-osf1
fi
- exit 0 ;;
+ exit ;;
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
- exit 0 ;;
+ exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
- exit 0 ;;
+ exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
- exit 0 ;;
+ exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
- exit 0 ;;
+ exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
- exit 0 ;;
+ exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
- exit 0 ;;
+ exit ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
*:UNICOS/mp:*:*)
echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit 0 ;;
+ exit ;;
5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit 0 ;;
+ exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:FreeBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit 0 ;;
+ case ${UNAME_MACHINE} in
+ pc98)
+ echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
- exit 0 ;;
+ exit ;;
i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
- exit 0 ;;
+ exit ;;
+ i*:MSYS_NT-*:*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
- exit 0 ;;
- x86:Interix*:[34]*)
- echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
- exit 0 ;;
+ exit ;;
+ x86:Interix*:[345]*)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+ EM64T:Interix*:[345]*)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
- exit 0 ;;
+ exit ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386?
echo i586-pc-interix
- exit 0 ;;
+ exit ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
- exit 0 ;;
- amd64:CYGWIN*:*:*)
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
echo x86_64-unknown-cygwin
- exit 0 ;;
+ exit ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
- exit 0 ;;
+ exit ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
+ exit ;;
*:GNU:*:*)
# the GNU system
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit 0 ;;
+ exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
- exit 0 ;;
+ exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
- exit 0 ;;
+ exit ;;
arm*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
cris:Linux:*:*)
echo cris-axis-linux-gnu
- exit 0 ;;
+ exit ;;
crisv32:Linux:*:*)
echo crisv32-axis-linux-gnu
- exit 0 ;;
+ exit ;;
frv:Linux:*:*)
echo frv-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
mips:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
@@ -861,8 +865,12 @@ EOF
#endif
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^CPU/{
+ s: ::g
+ p
+ }'`"
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
mips64:Linux:*:*)
eval $set_cc_for_build
@@ -880,15 +888,22 @@ EOF
#endif
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^CPU/{
+ s: ::g
+ p
+ }'`"
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
+ or32:Linux:*:*)
+ echo or32-unknown-linux-gnu
+ exit ;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
ppc64:Linux:*:*)
echo powerpc64-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
@@ -902,7 +917,7 @@ EOF
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
- exit 0 ;;
+ exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
@@ -910,25 +925,28 @@ EOF
PA8*) echo hppa2.0-unknown-linux-gnu ;;
*) echo hppa-unknown-linux-gnu ;;
esac
- exit 0 ;;
+ exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
- exit 0 ;;
+ exit ;;
sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-gnu
+ exit ;;
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
@@ -946,15 +964,15 @@ EOF
;;
a.out-i386-linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit 0 ;;
+ exit ;;
coff-i386)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
- exit 0 ;;
+ exit ;;
"")
# Either a pre-BFD a.out linker (linux-gnuoldld) or
# one that does not give us useful --help.
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
- exit 0 ;;
+ exit ;;
esac
# Determine whether the default compiler is a.out or elf
eval $set_cc_for_build
@@ -971,7 +989,7 @@ EOF
LIBC=gnulibc1
# endif
#else
- #ifdef __INTEL_COMPILER
+ #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__sun)
LIBC=gnu
#else
LIBC=gnuaout
@@ -981,16 +999,23 @@ EOF
LIBC=dietlibc
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
- test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
- test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^LIBC/{
+ s: ::g
+ p
+ }'`"
+ test x"${LIBC}" != x && {
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ exit
+ }
+ test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
echo i386-sequent-sysv4
- exit 0 ;;
+ exit ;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
@@ -998,27 +1023,27 @@ EOF
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit 0 ;;
+ exit ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
- exit 0 ;;
+ exit ;;
i*86:XTS-300:*:STOP)
echo ${UNAME_MACHINE}-unknown-stop
- exit 0 ;;
+ exit ;;
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
- exit 0 ;;
- i*86:syllable:*:*)
+ exit ;;
+ i*86:syllable:*:*)
echo ${UNAME_MACHINE}-pc-syllable
- exit 0 ;;
+ exit ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit 0 ;;
+ exit ;;
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
@@ -1026,15 +1051,16 @@ EOF
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
fi
- exit 0 ;;
- i*86:*:5:[78]*)
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit 0 ;;
+ exit ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
@@ -1052,73 +1078,73 @@ EOF
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
- exit 0 ;;
+ exit ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i386.
echo i386-pc-msdosdjgpp
- exit 0 ;;
+ exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
- exit 0 ;;
+ exit ;;
paragon:*:*:*)
echo i860-intel-osf1
- exit 0 ;;
+ exit ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi
- exit 0 ;;
+ exit ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
- exit 0 ;;
+ exit ;;
mc68k:UNIX:SYSTEM5:3.51m)
echo m68k-convergent-sysv
- exit 0 ;;
+ exit ;;
M680?0:D-NIX:5.3:*)
echo m68k-diab-dnix
- exit 0 ;;
+ exit ;;
M68*:*:R3V[5678]*:*)
- test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4 && exit 0 ;;
+ && { echo i486-ncr-sysv4; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
- exit 0 ;;
+ exit ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
- exit 0 ;;
+ exit ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
- exit 0 ;;
+ exit ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
@@ -1126,73 +1152,72 @@ EOF
else
echo ns32k-sni-sysv
fi
- exit 0 ;;
+ exit ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4
- exit 0 ;;
+ exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm
echo hppa1.1-stratus-sysv4
- exit 0 ;;
+ exit ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
- exit 0 ;;
+ exit ;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
echo ${UNAME_MACHINE}-stratus-vos
- exit 0 ;;
+ exit ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
echo hppa1.1-stratus-vos
- exit 0 ;;
+ exit ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
- exit 0 ;;
+ exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
fi
- exit 0 ;;
+ exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
- exit 0 ;;
+ exit ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
echo powerpc-apple-beos
- exit 0 ;;
+ exit ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
- exit 0 ;;
+ exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
case $UNAME_PROCESSOR in
- *86) UNAME_PROCESSOR=i686 ;;
unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = "x86"; then
@@ -1200,25 +1225,25 @@ EOF
UNAME_MACHINE=pc
fi
echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:QNX:*:4*)
echo i386-pc-qnx
- exit 0 ;;
+ exit ;;
NSE-?:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
NSR-?:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
- exit 0 ;;
+ exit ;;
BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv
- exit 0 ;;
+ exit ;;
DS/*:UNIX_System_V:*:*)
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
@@ -1229,41 +1254,47 @@ EOF
UNAME_MACHINE="$cputype"
fi
echo ${UNAME_MACHINE}-unknown-plan9
- exit 0 ;;
+ exit ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
- exit 0 ;;
+ exit ;;
*:TENEX:*:*)
echo pdp10-unknown-tenex
- exit 0 ;;
+ exit ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
echo pdp10-dec-tops20
- exit 0 ;;
+ exit ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
echo pdp10-xkl-tops20
- exit 0 ;;
+ exit ;;
*:TOPS-20:*:*)
echo pdp10-unknown-tops20
- exit 0 ;;
+ exit ;;
*:ITS:*:*)
echo pdp10-unknown-its
- exit 0 ;;
+ exit ;;
SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:DragonFly:*:*)
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit 0 ;;
+ exit ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
case "${UNAME_MACHINE}" in
- A*) echo alpha-dec-vms && exit 0 ;;
- I*) echo ia64-dec-vms && exit 0 ;;
- V*) echo vax-dec-vms && exit 0 ;;
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
esac ;;
*:XENIX:*:SysV)
echo i386-pc-xenix
- exit 0 ;;
+ exit ;;
+ i*86:skyos:*:*)
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ exit ;;
+ i*86:rdos:*:*)
+ echo ${UNAME_MACHINE}-pc-rdos
+ exit ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
@@ -1295,7 +1326,7 @@ main ()
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix"); exit (0);
+ printf ("arm-acorn-riscix\n"); exit (0);
#endif
#if defined (hp300) && !defined (hpux)
@@ -1384,11 +1415,12 @@ main ()
}
EOF
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
# Apollos put the system type in the environment.
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
# Convex versions that predate uname can use getsysinfo(1)
@@ -1397,22 +1429,22 @@ then
case `getsysinfo -f cpu_type` in
c1*)
echo c1-convex-bsd
- exit 0 ;;
+ exit ;;
c2*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
- exit 0 ;;
+ exit ;;
c34*)
echo c34-convex-bsd
- exit 0 ;;
+ exit ;;
c38*)
echo c38-convex-bsd
- exit 0 ;;
+ exit ;;
c4*)
echo c4-convex-bsd
- exit 0 ;;
+ exit ;;
esac
fi
diff --git a/config.h.in b/config.h.in
index a9ad24b..09283fa 100644
--- a/config.h.in
+++ b/config.h.in
@@ -72,6 +72,7 @@
#undef W3MIMGDISPLAY_SETUID
#undef USE_IMLIB
#undef USE_GDKPIXBUF
+#undef USE_GTK2
#undef USE_IMLIB2
#undef USE_XFACE
#undef USE_DICT
@@ -141,14 +142,18 @@ typedef long clen_t;
#undef HAVE_CHDIR
#undef HAVE_SETPGRP
#undef HAVE_SETLOCALE
+#undef HAVE_LANGINFO_CODESET
#undef SETPGRP_VOID
+#ifdef HAVE_SETPGRP
#ifdef SETPGRP_VOID
#define SETPGRP() setpgrp()
#else
#define SETPGRP() setpgrp(0,0)
#endif
-
+#else /* no HAVE_SETPGRP; OS/2 EMX */
+#define SETPGRP() setpgid(0, 0)
+#endif
#undef HAVE_FLOAT_H
#undef HAVE_SYS_SELECT_H
@@ -193,10 +198,8 @@ typedef RETSIGTYPE MySignalHandler;
#if defined( __CYGWIN__ )
#define SUPPORT_NETBIOS_SHARE 1
-#if LANG == JA
#define SUPPORT_WIN9X_CONSOLE_MBCS 1
#endif
-#endif
#if defined(__DJGPP__)
#define DEFAULT_TERM "dosansi"
diff --git a/config.sub b/config.sub
index 87a1ee4..ad9f395 100755
--- a/config.sub
+++ b/config.sub
@@ -3,7 +3,7 @@
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-timestamp='2005-04-22'
+timestamp='2006-02-23'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -21,14 +21,15 @@ timestamp='2005-04-22'
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
+
# Please send patches to <config-patches@gnu.org>. Submit a context
# diff and a properly formatted ChangeLog entry.
#
@@ -83,11 +84,11 @@ Try \`$me --help' for more information."
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
- echo "$timestamp" ; exit 0 ;;
+ echo "$timestamp" ; exit ;;
--version | -v )
- echo "$version" ; exit 0 ;;
+ echo "$version" ; exit ;;
--help | --h* | -h )
- echo "$usage"; exit 0 ;;
+ echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
@@ -99,7 +100,7 @@ while test $# -gt 0 ; do
*local*)
# First pass through any local machine types.
echo $1
- exit 0;;
+ exit ;;
* )
break ;;
@@ -118,8 +119,9 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
- nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \
- kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@@ -170,6 +172,10 @@ case $os in
-hiux*)
os=-hiuxwe2
;;
+ -sco6)
+ os=-sco5v6
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
-sco5)
os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -186,6 +192,10 @@ case $os in
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
+ -sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -238,7 +248,7 @@ case $basic_machine in
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
- | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \
+ | m32r | m32rle | m68000 | m68k | m88k | maxq | mb | microblaze | mcore \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@@ -247,6 +257,7 @@ case $basic_machine in
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa64 | mipsisa64el \
@@ -255,13 +266,15 @@ case $basic_machine in
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
+ | mt \
| msp430 \
+ | nios | nios2 \
| ns16k | ns32k \
- | openrisc | or32 \
+ | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
- | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b \
@@ -273,6 +286,9 @@ case $basic_machine in
| z8k)
basic_machine=$basic_machine-unknown
;;
+ m32c)
+ basic_machine=$basic_machine-unknown
+ ;;
m6811 | m68hc11 | m6812 | m68hc12)
# Motorola 68HC11/12.
basic_machine=$basic_machine-unknown
@@ -280,6 +296,9 @@ case $basic_machine in
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
+ ms1)
+ basic_machine=mt-unknown
+ ;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
@@ -321,6 +340,7 @@ case $basic_machine in
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa64-* | mipsisa64el-* \
@@ -329,14 +349,16 @@ case $basic_machine in
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
+ | mt-* \
| msp430-* \
+ | nios-* | nios2-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
- | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
| sparclite-* \
@@ -351,6 +373,8 @@ case $basic_machine in
| ymp-* \
| z8k-*)
;;
+ m32c-*)
+ ;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
@@ -686,6 +710,9 @@ case $basic_machine in
basic_machine=i386-pc
os=-msdos
;;
+ ms1-*)
+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ ;;
mvs)
basic_machine=i370-ibm
os=-mvs
@@ -761,9 +788,8 @@ case $basic_machine in
basic_machine=hppa1.1-oki
os=-proelf
;;
- or32 | or32-*)
+ openrisc | openrisc-*)
basic_machine=or32-unknown
- os=-coff
;;
os400)
basic_machine=powerpc-ibm
@@ -794,6 +820,12 @@ case $basic_machine in
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
@@ -850,6 +882,10 @@ case $basic_machine in
basic_machine=i586-unknown
os=-pw32
;;
+ rdos)
+ basic_machine=i386-pc
+ os=-rdos
+ ;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
@@ -1089,12 +1125,9 @@ case $basic_machine in
we32k)
basic_machine=we32k-att
;;
- sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
+ sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
- sh64)
- basic_machine=sh64-unknown
- ;;
sparc | sparcv8 | sparcv9 | sparcv9b)
basic_machine=sparc-sun
;;
@@ -1168,20 +1201,23 @@ case $os in
| -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -openbsd* | -solidbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku* | -rdos*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1199,7 +1235,7 @@ case $os in
os=`echo $os | sed -e 's|nto|nto-qnx|'`
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;;
-mac*)
@@ -1388,6 +1424,9 @@ case $basic_machine in
*-be)
os=-beos
;;
+ *-haiku)
+ os=-haiku
+ ;;
*-ibm)
os=-aix
;;
@@ -1559,7 +1598,7 @@ case $basic_machine in
esac
echo $basic_machine$os
-exit 0
+exit
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
diff --git a/configure b/configure
index a535f1e..0607e3a 100755
--- a/configure
+++ b/configure
@@ -310,7 +310,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS PACKAGE VERSION W3M W3M_LANG AWK CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S SET_MAKE RANLIB ac_ct_RANLIB PERL NKF MAN build build_cpu build_vendor build_os host host_cpu host_vendor host_os W3M_TARGET W3M_LIBS USE_M17N USE_UNICODE WCTARGET WCCFLAGS DISPLAY_CHARSET SYSTEM_CHARSET DOCUMENT_CHARSET POSUBST POLANG MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE LIBICONV LTLIBICONV INTLLIBS LIBINTL LTLIBINTL POSUB INTLTARGET NLSTARGET USE_COLOR USE_ANSI_COLOR USE_BG_COLOR USE_IMAGE USE_W3MIMG_X11 USE_W3MIMG_FB W3MIMGDISPLAY_SETUID INSTALL_W3MIMGDISPLAY USE_GDKPIXBUF USE_IMLIB USE_IMLIB2 IMGTARGETS IMGOBJS IMGX11CFLAGS IMGX11LDFLAGS IMGFBCFLAGS IMGFBLDFLAGS USE_XFACE uncompface KEYMAP_FILE HELP_FILE KEYBIND USE_MENU USE_MOUSE USE_HISTORY USE_ALARM USE_COOKIE USE_DIGEST_AUTH USE_NNTP USE_GOPHER USE_DICT USE_HELP_CGI USE_EXTERNAL_URI_LOADER USE_W3MMAILER USE_MIGEMO DEF_MIGEMO_COMMAND DEF_EDITOR DEF_MAILER DEF_EXT_BROWSER INET6 HAVE_OLD_SS_FAMILY USE_SSL USE_SSL_VERIFY PKG_CONFIG SSL_CFLAGS SSL_LIBS USE_W3M USE_SYSMOUSE AUXBIN_TARGETS EGREP USE_BINMODE_STREAM HAVE_SYS_ERRLIST HAVE_SIGSETJMP RETSIGTYPE SIGNAL_RETURN HELP_DIR RC_DIR DOCDIRS CURRENT_VERSION LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS PACKAGE VERSION W3M W3M_LANG AWK CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S SET_MAKE RANLIB ac_ct_RANLIB PERL NKF MAN build build_cpu build_vendor build_os host host_cpu host_vendor host_os W3M_TARGET W3M_LIBS USE_M17N USE_UNICODE WCTARGET WCCFLAGS DISPLAY_CHARSET SYSTEM_CHARSET DOCUMENT_CHARSET POSUBST POLANG MKINSTALLDIRS USE_NLS MSGFMT GMSGFMT XGETTEXT MSGMERGE LIBICONV LTLIBICONV INTLLIBS LIBINTL LTLIBINTL POSUB INTLTARGET NLSTARGET USE_COLOR USE_ANSI_COLOR USE_BG_COLOR USE_IMAGE USE_W3MIMG_X11 USE_W3MIMG_FB W3MIMGDISPLAY_SETUID INSTALL_W3MIMGDISPLAY USE_GDKPIXBUF USE_GTK2 USE_IMLIB USE_IMLIB2 IMGTARGETS IMGOBJS IMGX11CFLAGS IMGX11LDFLAGS IMGFBCFLAGS IMGFBLDFLAGS USE_XFACE uncompface KEYMAP_FILE HELP_FILE KEYBIND USE_MENU USE_MOUSE USE_HISTORY USE_ALARM USE_COOKIE USE_DIGEST_AUTH USE_NNTP USE_GOPHER USE_DICT USE_HELP_CGI USE_EXTERNAL_URI_LOADER USE_W3MMAILER USE_MIGEMO DEF_MIGEMO_COMMAND DEF_EDITOR DEF_MAILER DEF_EXT_BROWSER INET6 HAVE_OLD_SS_FAMILY USE_SSL USE_SSL_VERIFY PKG_CONFIG SSL_CFLAGS SSL_LIBS USE_W3M USE_SYSMOUSE AUXBIN_TARGETS EGREP USE_BINMODE_STREAM HAVE_SYS_ERRLIST HAVE_SIGSETJMP RETSIGTYPE SIGNAL_RETURN HELP_DIR RC_DIR DOCDIRS CURRENT_VERSION LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -888,7 +888,7 @@ Optional Packages:
--without-libintl-prefix don't search for libintl in includedir and libdir
--with-imagelib=IMAGELIBS image library
IMAGELIBS may be space separeted list of:
- gdk-pixbuf imlib imlib2
+ gtk2 gdk-pixbuf imlib imlib2
--with-migemo=MIGEMO_COMMAND migemo command
--with-editor=EDITOR default editor (/usr/bin/vi)
--with-mailer=MAILER default mailer (/usr/bin/mail)
@@ -4982,6 +4982,7 @@ _ACEOF
+
echo "$as_me:$LINENO: checking if image is enabled" >&5
echo $ECHO_N "checking if image is enabled... $ECHO_C" >&6
# Check whether --enable-image or --disable-image was given.
@@ -5038,13 +5039,14 @@ else
with_imagelib="yes"
fi;
if test x"$with_imagelib" = xyes; then
- with_imagelib="gdk-pixbuf imlib imlib2"
+ with_imagelib="gtk2 gdk-pixbuf imlib imlib2"
fi
echo "$as_me:$LINENO: result: $with_imagelib" >&5
echo "${ECHO_T}$with_imagelib" >&6
with_imlib=no
with_imlib2=no
with_gdkpixbuf=no
+ with_gtk2=no
for imagelib in $with_imagelib
do
case "$imagelib" in
@@ -5063,11 +5065,40 @@ echo "${ECHO_T}$with_imagelib" >&6
if test x"$GDKPIXBUF_CONFIG" = x; then
GDKPIXBUF_CONFIG=gdk-pixbuf-config
fi;;
+ gtk2)
+ with_gtk2="yes"
+ if test x"$PKG_CONFIG" = x; then
+ PKG_CONFIG=pkg-config
+ else
+ PKG_CONFIG=:
+ fi;;
esac
done
IMGTARGETS=""
+ if test x"$with_gtk2" = xyes; then
+ version="`$PKG_CONFIG --modversion gdk-pixbuf-2.0 2>/dev/null`"
+ if test x"$version" != x; then
+ echo "$as_me:$LINENO: checking GdkPixbuf version" >&5
+echo $ECHO_N "checking GdkPixbuf version... $ECHO_C" >&6
+ echo "$as_me:$LINENO: result: $version" >&5
+echo "${ECHO_T}$version" >&6
+ set -- `echo "$version" | sed 's/[^0-9]/ /g'`
+ if test "$1" -ne "2" -o "$2" -lt "0" || test "$2" -eq "0" -a "$3" -lt "0"; then
+ { echo "$as_me:$LINENO: WARNING: GdkPixbuf is too old. Install GdkPixbuf (version >= 2.0.0)" >&5
+echo "$as_me: WARNING: GdkPixbuf is too old. Install GdkPixbuf (version >= 2.0.0)" >&2;}
+ have_gdkpixbuf="no"; have_gtk2="no"
+ else
+ have_gdkpixbuf="yes"; have_gtk2="yes"
+ fi
+ else
+ { echo "$as_me:$LINENO: WARNING: GdkPixbuf is not installed. Install GdkPixbuf (version >= 2.0.0)" >&5
+echo "$as_me: WARNING: GdkPixbuf is not installed. Install GdkPixbuf (version >= 2.0.0)" >&2;}
+ have_gdkpixbuf="no"; have_gtk2="no"
+ fi
+ fi
if test x"$with_gdkpixbuf" = xyes; then
- version="`$GDKPIXBUF_CONFIG --version 2>/dev/null`"
+ if test x"$have_gdkpixbuf" != xyes; then
+ version="`$GDKPIXBUF_CONFIG --version 2>/dev/null`"
if test x"$version" != x; then
echo "$as_me:$LINENO: checking GdkPixbuf version" >&5
echo $ECHO_N "checking GdkPixbuf version... $ECHO_C" >&6
@@ -5086,6 +5117,7 @@ echo "$as_me: WARNING: GdkPixbuf is too old. Install GdkPixbuf (version >= 0.16.
echo "$as_me: WARNING: GdkPixbuf is not installed. Install GdkPixbuf (version >= 0.16.0)" >&2;}
have_gdkpixbuf="no"
fi
+ fi
fi
if test x"$with_imlib" = xyes; then
version="`$IMLIB_CONFIG --version 2>/dev/null`"
@@ -5130,29 +5162,47 @@ echo "$as_me: WARNING: Imlib2 is not installed. Install Imlib2 (version >= 1.0.
fi
fi
if test x"$x11" = xyes; then
- if test x"$have_gdkpixbuf" = xyes; then
+ if test x"$have_gtk2" = xyes; then
cat >>confdefs.h <<\_ACEOF
#define USE_W3MIMG_X11 1
_ACEOF
+ IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
+ IMGTARGETS="x11"
cat >>confdefs.h <<\_ACEOF
#define USE_GDKPIXBUF 1
_ACEOF
+ cat >>confdefs.h <<\_ACEOF
+#define USE_GTK2 1
+_ACEOF
+
+ IMGX11CFLAGS="`${PKG_CONFIG} --cflags gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0 gtk+-2.0`"
+ IMGX11LDFLAGS="`${PKG_CONFIG} --libs gdk-pixbuf-2.0 gdk-pixbuf-xlib-2.0 gtk+-2.0`"
+ elif test x"$have_gdkpixbuf" = xyes; then
+ cat >>confdefs.h <<\_ACEOF
+#define USE_W3MIMG_X11 1
+_ACEOF
+
IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
+ IMGTARGETS="x11"
+ cat >>confdefs.h <<\_ACEOF
+#define USE_GDKPIXBUF 1
+_ACEOF
+
IMGX11CFLAGS="`${GDKPIXBUF_CONFIG} --cflags`"
IMGX11LDFLAGS="`${GDKPIXBUF_CONFIG} --libs` -lgdk_pixbuf_xlib"
- IMGTARGETS="x11"
elif test x"$have_imlib" = xyes; then
cat >>confdefs.h <<\_ACEOF
#define USE_W3MIMG_X11 1
_ACEOF
+ IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
+ IMGTARGETS="x11"
cat >>confdefs.h <<\_ACEOF
#define USE_IMLIB 1
_ACEOF
- IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
IMGX11CFLAGS="`${IMLIB_CONFIG} --cflags`"
IMGX11LDFLAGS="`${IMLIB_CONFIG} --libs`"
IMGTARGETS="x11"
@@ -5161,38 +5211,57 @@ _ACEOF
#define USE_W3MIMG_X11 1
_ACEOF
+ IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
+ IMGTARGETS="x11"
cat >>confdefs.h <<\_ACEOF
#define USE_IMLIB2 1
_ACEOF
- IMGOBJS="$IMGOBJS x11/x11_w3mimg.o"
IMGX11CFLAGS="`${IMLIB2_CONFIG} --cflags`"
IMGX11LDFLAGS="`${IMLIB2_CONFIG} --libs`"
- IMGTARGETS="x11"
else
{ echo "$as_me:$LINENO: WARNING: unable to build w3mimgdisplay with X11 support" >&5
echo "$as_me: WARNING: unable to build w3mimgdisplay with X11 support" >&2;}
fi
fi
if test x"$fb" = xyes; then
- if test x"$have_gdkpixbuf" = xyes; then
+ if test x"$have_gtk2" = xyes; then
cat >>confdefs.h <<\_ACEOF
#define USE_W3MIMG_FB 1
_ACEOF
+ IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
+ IMGTARGETS="${IMGTARGETS} fb"
cat >>confdefs.h <<\_ACEOF
#define USE_GDKPIXBUF 1
_ACEOF
+ cat >>confdefs.h <<\_ACEOF
+#define USE_GTK2 1
+_ACEOF
+
+ IMGFBCFLAGS="`${PKG_CONFIG} --cflags gdk-pixbuf-2.0 gtk+-2.0`"
+ IMGFBLDFLAGS="`${PKG_CONFIG} --libs gdk-pixbuf-2.0 gtk+-2.0`"
+ elif test x"$have_gdkpixbuf" = xyes; then
+ cat >>confdefs.h <<\_ACEOF
+#define USE_W3MIMG_FB 1
+_ACEOF
+
IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
+ IMGTARGETS="${IMGTARGETS} fb"
+ cat >>confdefs.h <<\_ACEOF
+#define USE_GDKPIXBUF 1
+_ACEOF
+
IMGFBCFLAGS="`${GDKPIXBUF_CONFIG} --cflags`"
IMGFBLDFLAGS="`${GDKPIXBUF_CONFIG} --libs`"
- IMGTARGETS="${IMGTARGETS} fb"
elif test x"$have_imlib2" = xyes; then
cat >>confdefs.h <<\_ACEOF
#define USE_W3MIMG_FB 1
_ACEOF
+ IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
+ IMGTARGETS="${IMGTARGETS} fb"
cat >>confdefs.h <<\_ACEOF
#define USE_IMLIB2 1
_ACEOF
@@ -5200,7 +5269,6 @@ _ACEOF
IMGOBJS="$IMGOBJS fb/fb_w3mimg.o fb/fb.o fb/fb_img.o"
IMGFBCFLAGS="`${IMLIB2_CONFIG} --cflags`"
IMGFBLDFLAGS="`${IMLIB2_CONFIG} --libs`"
- IMGTARGETS="${IMGTARGETS} fb"
else
{ echo "$as_me:$LINENO: WARNING: unable to build w3mimgdisplay with FB support" >&5
echo "$as_me: WARNING: unable to build w3mimgdisplay with FB support" >&2;}
@@ -5986,10 +6054,6 @@ fi;
echo "$as_me:$LINENO: result: $with_ssl" >&5
echo "${ECHO_T}$with_ssl" >&6
if test x"$with_ssl" != xno; then
- cat >>confdefs.h <<\_ACEOF
-#define USE_SSL 1
-_ACEOF
-
succeeded=no
@@ -6177,6 +6241,10 @@ fi
if test x"$w3m_ssl" = xfound; then
+ cat >>confdefs.h <<\_ACEOF
+#define USE_SSL 1
+_ACEOF
+
echo "$as_me:$LINENO: checking if SSL certificate verify is enabled" >&5
echo $ECHO_N "checking if SSL certificate verify is enabled... $ECHO_C" >&6
# Check whether --enable-sslverify or --disable-sslverify was given.
@@ -7362,7 +7430,7 @@ _ACEOF
case "$host_os" in
- *cygwin*)
+ *cygwin*|*os2-emx*)
cat >>confdefs.h <<\_ACEOF
#define USE_BINMODE_STREAM 1
_ACEOF
@@ -9939,6 +10007,69 @@ _ACEOF
fi
+ echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5
+echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
+if test "${am_cv_langinfo_codeset+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <langinfo.h>
+int
+main ()
+{
+char* cs = nl_langinfo(CODESET);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ am_cv_langinfo_codeset=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+am_cv_langinfo_codeset=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5
+echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
+ if test $am_cv_langinfo_codeset = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LANGINFO_CODESET 1
+_ACEOF
+
+ fi
+
+
echo "$as_me:$LINENO: checking for sys_errlist" >&5
echo $ECHO_N "checking for sys_errlist... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
@@ -10864,6 +10995,7 @@ s,@USE_W3MIMG_FB@,$USE_W3MIMG_FB,;t t
s,@W3MIMGDISPLAY_SETUID@,$W3MIMGDISPLAY_SETUID,;t t
s,@INSTALL_W3MIMGDISPLAY@,$INSTALL_W3MIMGDISPLAY,;t t
s,@USE_GDKPIXBUF@,$USE_GDKPIXBUF,;t t
+s,@USE_GTK2@,$USE_GTK2,;t t
s,@USE_IMLIB@,$USE_IMLIB,;t t
s,@USE_IMLIB2@,$USE_IMLIB2,;t t
s,@IMGTARGETS@,$IMGTARGETS,;t t
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..586989e
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,185 @@
+dnl w3m autoconf
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(w3m, 0.5.1, ukai@debian.or.jp)
+PACKAGE=w3m
+VERSION=0.5.1
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
+AC_SUBST(PACKAGE)
+AC_SUBST(VERSION)
+
+AC_SUBST(W3M)
+W3M=w3m
+AC_DEFINE(W3M, w3m)
+
+AC_SUBST(W3M_LANG)
+W3M_LANG=${LC_ALL:-$LANG}
+dnl AM_INIT_AUTOMAKE(w3m, 0.4)
+AC_CONFIG_HEADER(config.h)
+dnl Checks for programs.
+dnl AC_PROG_CXX
+AC_PROG_AWK
+AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_INSTALL
+AC_PROG_LN_S
+AC_PROG_MAKE_SET
+AC_PROG_RANLIB
+AC_PATH_PROGS(PERL, perl, /usr/local/bin/perl)
+AC_PATH_PROGS(NKF, nkf, /usr/local/bin/nkf)
+AC_PATH_PROGS(MAN, man, /usr/bin/man)
+AC_CANONICAL_HOST
+
+AC_EXEEXT
+AC_SUBST(EXEEXT)
+
+AUXBIN_TARGETS=
+
+AC_SUBST(W3M_TARGET)
+AC_SUBST(W3M_LIBS)
+W3M_TARGET=$target
+AC_DEFINE_UNQUOTED(W3M_TARGET, $W3M_TARGET)
+
+AC_W3M_M17N
+if test x$enable_messagel10n = xno; then
+ AM_GNU_GETTEXT([external])
+fi
+
+NLSTARGET=""
+if test x"$USE_NLS" = xyes; then
+ NLSTARGET="po"
+fi
+AC_SUBST(INTLTARGET)
+AC_SUBST(NLSTARGET)
+
+AC_W3M_COLOR
+AC_W3M_ANSI_COLOR
+AC_W3M_BG_COLOR
+
+AC_W3M_IMAGE
+if test x"$enable_image" != xno; then
+ AUXBIN_TARGETS="$AUXBIN_TARGETS w3mimgdisplay\$(EXT)"
+ AC_W3M_XFACE
+fi
+
+AC_W3M_KEYMAP
+AC_W3M_MENU
+AC_W3M_MOUSE
+AC_W3M_HISTORY
+AC_W3M_ALARM
+
+AC_W3M_COOKIE
+AC_W3M_DIGEST_AUTH
+AC_W3M_NNTP
+AC_W3M_GOPHER
+
+AC_W3M_DICT
+AC_W3M_HELP_CGI
+AC_W3M_EXTERNAL_URI_LOADER
+AC_W3M_W3MMAILER
+AC_W3M_MIGEMO
+AC_W3M_EDITOR
+AC_W3M_MAILER
+AC_W3M_EXT_BROWSER
+
+dnl Checks for ext libs
+for lib in bsd BSD 44bsd socket nsl dld dl
+do
+ AC_W3M_EXTLIBS($lib)
+done
+
+AC_W3M_IPv6
+AC_W3M_SSL
+
+dnl Checks for libraries.
+AC_CHECK_FUNC(sqrt,,[AC_CHECK_LIB(m, sqrt)])
+if test x"$enable_mouse" = xyes; then
+ AC_SUBST(USE_W3M)
+ AC_CHECK_LIB(gpm, Gpm_Open, [AC_DEFINE(USE_GPM)
+ W3M_LIBS="$W3M_LIBS -lgpm"])
+ AC_SUBST(USE_SYSMOUSE)
+ AC_TRY_CPP([#include <machine/console.h>
+ MOUSE_GETINFO], [AC_DEFINE(USE_SYSMOUSE)])
+fi
+AC_SUBST(AUXBIN_TARGETS)
+AC_W3M_TERMLIB
+AC_W3M_GC
+AC_CHECK_LIB(z, zError, [AUXBIN_TARGETS="$AUXBIN_TARGETS inflate\$(EXT)"])
+
+AC_DEFINE(AUXBIN_TARGETS, "$AUXBIN_TARGETS")
+
+AC_SUBST(USE_BINMODE_STREAM)
+case "$host_os" in
+ *cygwin*|*os2-emx*)
+ AC_DEFINE(USE_BINMODE_STREAM)
+ ;;
+esac
+
+AC_HEADER_DIRENT
+AC_HEADER_STDC
+AC_HEADER_SYS_WAIT
+dnl AC_CHECK_HEADERS(fcntl.h malloc.h sgtty.h strings.h sys/ioctl.h sys/time.h termio.h unistd.h setjmp.h)
+AC_CHECK_HEADER(termios.h, [AC_DEFINE(HAVE_TERMIOS_H)],
+ [AC_CHECK_HEADER(termio.h, [AC_DEFINE(HAVE_TERMIO_H)],
+ [AC_CHECK_HEADER(sgtty.h, [AC_DEFINE(HAVE_SGTTY_H)])])])
+AC_CHECK_HEADER([float.h], [AC_DEFINE(HAVE_FLOAT_H)])
+AC_CHECK_HEADER([sys/select.h], [AC_DEFINE(HAVE_SYS_SELECT_H)])
+AC_CHECK_HEADER([locale.h], [AC_DEFINE(HAVE_LOCALE_H)])
+AC_CHECK_HEADER([stdint.h], [AC_DEFINE(HAVE_STDINT_H)])
+AC_CHECK_HEADER([inttypes.h], [AC_DEFINE(HAVE_INTTYPES_H)])
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+dnl AC_C_CONST
+dnl AC_C_INLINE
+dnl AC_TYPE_PID_T
+dnl AC_TYPE_SIZE_T
+dnl AC_HEADER_TIME
+dnl AC_STRUCT_TM
+AC_CHECK_SIZEOF(long long, 0)
+
+dnl Checks for library functions.
+dnl AC_FUNC_ALLOCA
+dnl AC_PROG_GCC_TRADITIONAL
+dnl AC_FUNC_MEMCMP
+dnl AC_FUNC_MMAP
+dnl AC_FUNC_SETVBUF_REVERSED
+dnl AC_FUNC_VPRINTF
+AC_CHECK_FUNCS(strcasecmp strcasestr strchr memcpy strerror bcopy setpgrp chdir getcwd getwd readlink setenv putenv strtoll stroq atoll atoq symlink readlink lstat srand48 srandom getpassphrase waitpid setlocale)
+AC_FUNC_STRFTIME
+AC_FUNC_WAIT3
+AC_FUNC_SETPGRP
+case "$host_os" in
+ *cygwin*)
+ ;;
+ *)
+ AM_LANGINFO_CODESET
+ ;;
+esac
+AC_W3M_SYS_ERRLIST
+AC_W3M_SIGSETJMP
+AC_W3M_SIGNAL
+
+AC_SUBST(HELP_DIR)
+HELP_DIR="$datadir/$PACKAGE"
+AC_DEFINE(HELP_DIR, "$HELP_DIR")
+AC_SUBST(RC_DIR)
+RC_DIR="~/.$PACKAGE"
+AC_DEFINE(RC_DIR, "$RC_DIR")
+AC_SUBST(DOCDIRS)
+DOCDIRS="doc:en_English doc-jp:ja_Japanese"
+AC_DEFINE_UNQUOTED(DOCDIRS, "$DOCDIRS")
+
+AC_W3M_VERSION
+AC_OUTPUT([Makefile posubst po/Makefile.in \
+scripts/Makefile scripts/dirlist.cgi \
+scripts/w3mhelp.cgi \
+scripts/w3mmail.cgi scripts/xface2xpm \
+scripts/multipart/Makefile scripts/multipart/multipart.cgi \
+scripts/w3mman/Makefile scripts/w3mman/w3mman scripts/w3mman/w3mman.1 \
+scripts/w3mman/w3mman2html.cgi \
+libwc/Makefile \
+w3mimg/Makefile w3mimg/fb/Makefile w3mimg/x11/Makefile \
+w3mhelp-w3m_en.html w3mhelp-w3m_ja.html \
+w3mhelp-lynx_en.html w3mhelp-lynx_ja.html])
+
+chmod +x posubst
diff --git a/debian/changelog b/debian/changelog
index fb6e283..5e43af3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+w3m (0.5.1-5) unstable; urgency=low
+
+ * fix FTBFS on GNU/kFreeBSD (due to unsatisfied Build-Depends on libgpmg1-dev)
+ closes: Bug#377793
+ * debian/rules: DEB_BUILD_GNU_SYSTEM should be linux-gnu, instead of linux
+ so that w3m-img works on fbdev
+ closes: Bug#376240
+ * change default accept: line
+ closes: Bug#374296
+
+ -- Fumitoshi UKAI <ukai@debian.or.jp> Mon, 7 Aug 2006 11:37:48 +0900
+
w3m (0.5.1-4) unstable; urgency=low
* GCC 4.0 C++ ABI change.
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..b8626c4
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+4
diff --git a/debian/control b/debian/control
index f36955f..1755648 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: w3m
Section: text
Priority: standard
Maintainer: Fumitoshi UKAI <ukai@debian.or.jp>
-Build-Depends: libgc-dev, libncurses5-dev, libgpmg1-dev [!hurd-i386], zlib1g-dev, libssl-dev, debhelper (>= 3.0.0), gawk | awk, libgdk-pixbuf-dev (>= 0.22.0-5), autotools-dev
+Build-Depends: libgc-dev, libncurses5-dev, libgpmg1-dev [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386], zlib1g-dev, libssl-dev, debhelper (>= 4.0.0), gawk | awk, libgdk-pixbuf-dev (>= 0.22.0-5), autotools-dev
Standards-Version: 3.6.1
Package: w3m
diff --git a/debian/rules b/debian/rules
index 428fbff..179c5c7 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,9 +6,7 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
-export DH_COMPAT=3
-
-ifeq ($(DEB_BUILD_GNU_SYSTEM),linux)
+ifeq ($(DEB_BUILD_GNU_SYSTEM),linux-gnu)
DEVS=x11,fb+s
else
DEVS=x11
diff --git a/display.c b/display.c
index 507f22b..addcaeb 100644
--- a/display.c
+++ b/display.c
@@ -1,4 +1,4 @@
-/* $Id: display.c,v 1.68 2003/09/26 17:59:51 ukai Exp $ */
+/* $Id: display.c,v 1.69 2004/07/15 16:32:38 ukai Exp $ */
#include <signal.h>
#include "fm.h"
@@ -433,11 +433,11 @@ displayBuffer(Buffer *buf, int mode)
scroll(n);
}
else if (n < 0 && n > -buf->LINES) {
-#if defined(__CYGWIN__) && LANG == JA
+#if 0 /* defined(__CYGWIN__) */
move(LASTLINE + n + 1, 0);
clrtoeolx();
refresh();
-#endif /* defined(__CYGWIN__) && LANG == JA */
+#endif /* defined(__CYGWIN__) */
rscroll(-n);
}
redrawNLine(buf, n);
diff --git a/doc-jp/FAQ.html b/doc-jp/FAQ.html
index e40689b..e16a986 100644
--- a/doc-jp/FAQ.html
+++ b/doc-jp/FAQ.html
@@ -199,7 +199,7 @@ w3mを起動すると,字が見えなくなります.<p>
<p>
<dt>画像のビューアを変えたいんだけど,どうするの?
<dd>初期設定では画像を見るのに xv を使うようになっていますが,これを
-例えば display に変える場合は,~/.mailcap または /etc/mailcap に次のよ
+例えば display に変える場合は,~/.w3m/mailcap または /etc/mailcap に次のよ
うな記述を入れます.
<p>
<pre>
@@ -222,6 +222,9 @@ application/x-dvi; xdvi %s
<dl>
<dt>設定ファイルはどこにあるの?
<dd>~/.w3m ディレクトリの下の config です.
+オプション設定パネルで変更できると記述されているオプションの値を
+このファイルで変更すると,w3m の挙動を調整できます.
+オプションの名前と値を空白で区切ったものを 1 行に 1 組ずつ書いて設定します.
<p>
<dt>~/.w3m の下に w3mXXXXXX のようなファイルがたくさんあるけど,何?
<dd>WWWサーバからファイルを読んでいるときに,それを一時的に保存する
diff --git a/doc-jp/MANUAL.html b/doc-jp/MANUAL.html
index 9dab5d9..0b24619 100644
--- a/doc-jp/MANUAL.html
+++ b/doc-jp/MANUAL.html
@@ -97,6 +97,7 @@ HTMLファイルのソースを表示する
<dd>折り返しサーチを使うかどうかを切りかえる.
<dt>-o option=value
<dd>オプションを指定する.
+オプションの名前や値は,~/.w3m/config で指定するものと同じ.
<dt>-no-proxy
<dd>プロキシを利用しない.
<dt>-pauth user:pass
diff --git a/doc-jp/keymap.default b/doc-jp/keymap.default
index c57bcea..0ecf14f 100644
--- a/doc-jp/keymap.default
+++ b/doc-jp/keymap.default
@@ -132,6 +132,7 @@ keymap LEFT MOVE_LEFT
keymap M-[E MENU
keymap M-[L MENU
+keymap M-[Z PREV_LINK
keymap M-[1~ BEGIN
keymap M-[2~ MENU
diff --git a/doc/FAQ.html b/doc/FAQ.html
index 6973e2e..50478e3 100644
--- a/doc/FAQ.html
+++ b/doc/FAQ.html
@@ -239,7 +239,7 @@ from the server each time it accesses it. If possible, use a cache server.
(if you are using netscape).
<p>
<dt><h3>How do I change the default image viewer?</h3>
-<dd>By default w3m uses xv to view images. If you want to change it into, let's say, 'display', add the following line to ~/.mailcap or /etc/mailcap.
+<dd>By default w3m uses xv to view images. If you want to change it into, let's say, 'display', add the following line to ~/.w3m/mailcap or /etc/mailcap.
<p>
<pre>
image/*; display %s
@@ -270,6 +270,10 @@ with Ctrl-u. What to do?</h3>
<dl>
<dt><h3>What is w3m's configuration file?</h3>
<dd>It is ~/.w3m/config.
+With this file, you can adjust w3m's behavior by changing values of options
+that are described to be varied with the option setting panel.
+Each line contains setting for one option, which is a pair of an option name
+and its value with a space as a separator.
<p>
<dt><h3>What are these w3mxxxx files in my ~/.w3m directory for?</h3>
<dd>These are temporary files used by w3m when reading documents from a
diff --git a/doc/keymap.default b/doc/keymap.default
index c57bcea..0ecf14f 100644
--- a/doc/keymap.default
+++ b/doc/keymap.default
@@ -132,6 +132,7 @@ keymap LEFT MOVE_LEFT
keymap M-[E MENU
keymap M-[L MENU
+keymap M-[Z PREV_LINK
keymap M-[1~ BEGIN
keymap M-[2~ MENU
diff --git a/etc.c b/etc.c
index bed8292..5a6315e 100644
--- a/etc.c
+++ b/etc.c
@@ -1,4 +1,4 @@
-/* $Id: etc.c,v 1.78 2004/04/16 18:47:19 ukai Exp $ */
+/* $Id: etc.c,v 1.80 2006/04/07 13:21:11 inu Exp $ */
#include "fm.h"
#include <pwd.h>
#include "myctype.h"
diff --git a/file.c b/file.c
index 18346e9..d6d415d 100644
--- a/file.c
+++ b/file.c
@@ -1,4 +1,4 @@
-/* $Id: file.c,v 1.235 2004/04/16 18:47:19 ukai Exp $ */
+/* $Id: file.c,v 1.246 2006/06/12 11:51:59 inu Exp $ */
#include "fm.h"
#include <sys/types.h>
#include "myctype.h"
@@ -748,6 +748,7 @@ readHeader(URLFile *uf, Buffer *newBuf, int thru, ParsedURL *pu)
if (uf->compression != CMP_NOCOMPRESS)
break;
}
+ uf->content_encoding = uf->compression;
}
#ifdef USE_COOKIE
else if (use_cookie && accept_cookie &&
@@ -836,13 +837,15 @@ readHeader(URLFile *uf, Buffer *newBuf, int thru, ParsedURL *pu)
}
if (pu && name->length > 0) {
int err;
- if (flag & COO_SECURE)
- disp_message_nsec("Received a secured cookie", FALSE, 1,
+ if (show_cookie) {
+ if (flag & COO_SECURE)
+ disp_message_nsec("Received a secured cookie", FALSE, 1,
TRUE, FALSE);
- else
- disp_message_nsec(Sprintf("Received cookie: %s=%s",
+ else
+ disp_message_nsec(Sprintf("Received cookie: %s=%s",
name->ptr, value->ptr)->ptr,
FALSE, 1, TRUE, FALSE);
+ }
err =
add_cookie(pu, name, value, expires, domain, path, flag,
comment, version, port, commentURL);
@@ -874,10 +877,12 @@ readHeader(URLFile *uf, Buffer *newBuf, int thru, ParsedURL *pu)
emsg =
"This cookie was rejected to prevent security violation.";
record_err_message(emsg);
- disp_message_nsec(emsg, FALSE, 1, TRUE, FALSE);
+ if (show_cookie)
+ disp_message_nsec(emsg, FALSE, 1, TRUE, FALSE);
}
else
- disp_message_nsec(Sprintf
+ if (show_cookie)
+ disp_message_nsec(Sprintf
("Accepting invalid cookie: %s=%s",
name->ptr, value->ptr)->ptr, FALSE,
1, TRUE, FALSE);
@@ -972,7 +977,59 @@ struct http_auth {
HRequest *hr, FormList *request);
};
-#define TOKEN_PAT "[^][()<>@,;:\\\"/?={} \t\001-\037\177]*"
+enum {
+ AUTHCHR_NUL,
+ AUTHCHR_SEP,
+ AUTHCHR_TOKEN,
+};
+
+static int
+skip_auth_token(char **pp)
+{
+ char *p;
+ int first = AUTHCHR_NUL, typ;
+
+ for (p = *pp ;; ++p) {
+ switch (*p) {
+ case '\0':
+ goto endoftoken;
+ default:
+ if ((unsigned char)*p > 037) {
+ typ = AUTHCHR_TOKEN;
+ break;
+ }
+ /* thru */
+ case '\177':
+ case '[':
+ case ']':
+ case '(':
+ case ')':
+ case '<':
+ case '>':
+ case '@':
+ case ';':
+ case ':':
+ case '\\':
+ case '"':
+ case '/':
+ case '?':
+ case '=':
+ case ' ':
+ case '\t':
+ case ',':
+ typ = AUTHCHR_SEP;
+ break;
+ }
+
+ if (!first)
+ first = typ;
+ else if (first != typ)
+ break;
+ }
+endoftoken:
+ *pp = p;
+ return first;
+}
static Str
extract_auth_val(char **q)
@@ -993,12 +1050,13 @@ extract_auth_val(char **q)
}
if (!quoted) {
switch (*qq) {
+ case '[':
+ case ']':
case '(':
case ')':
case '<':
case '>':
case '@':
- case ',':
case ';':
case ':':
case '\\':
@@ -1009,6 +1067,7 @@ extract_auth_val(char **q)
case ' ':
case '\t':
qq++;
+ case ',':
goto end_token;
default:
if (*qq <= 037 || *qq == 0177) {
@@ -1022,11 +1081,6 @@ extract_auth_val(char **q)
Strcat_char(val, *qq++);
}
end_token:
- if (*qq != '\0') {
- SKIP_BLANKS(qq);
- if (*qq == ',')
- qq++;
- }
*q = (char *)qq;
return val;
}
@@ -1058,10 +1112,7 @@ static char *
extract_auth_param(char *q, struct auth_param *auth)
{
struct auth_param *ap;
- char *q0;
- Regex re_token;
-
- newRegex(TOKEN_PAT, FALSE, &re_token, NULL);
+ char *p;
for (ap = auth; ap->name != NULL; ap++) {
ap->val = NULL;
@@ -1070,26 +1121,41 @@ extract_auth_param(char *q, struct auth_param *auth)
while (*q != '\0') {
SKIP_BLANKS(q);
for (ap = auth; ap->name != NULL; ap++) {
- if (strncasecmp(q, ap->name, strlen(ap->name)) == 0) {
- q += strlen(ap->name);
- SKIP_BLANKS(q);
- if (*q != '=')
+ size_t len;
+
+ len = strlen(ap->name);
+ if (strncasecmp(q, ap->name, len) == 0 &&
+ (IS_SPACE(q[len]) || q[len] == '=')) {
+ p = q + len;
+ SKIP_BLANKS(p);
+ if (*p != '=')
return q;
- q++;
+ q = p + 1;
ap->val = extract_auth_val(&q);
break;
}
}
if (ap->name == NULL) {
/* skip unknown param */
- if (RegexMatch(&re_token, q, -1, TRUE) == 0)
- return q;
- MatchedPosition(&re_token, &q0, &q);
+ int token_type;
+ p = q;
+ if ((token_type = skip_auth_token(&q)) == AUTHCHR_TOKEN &&
+ (IS_SPACE(*q) || *q == '=')) {
+ SKIP_BLANKS(q);
+ if (*q != '=')
+ return p;
+ q++;
+ extract_auth_val(&q);
+ }
+ else
+ return p;
+ }
+ if (*q != '\0') {
SKIP_BLANKS(q);
- if (*q != '=')
- return q;
- q++;
- extract_auth_val(&q);
+ if (*q == ',')
+ q++;
+ else
+ break;
}
}
return q;
@@ -1157,6 +1223,12 @@ digest_hex(char *p)
return tmp;
}
+enum {
+ QOP_NONE,
+ QOP_AUTH,
+ QOP_AUTH_INT,
+};
+
static Str
AuthDigestCred(struct http_auth *ha, Str uname, Str pw, ParsedURL *pu,
HRequest *hr, FormList *request)
@@ -1168,11 +1240,50 @@ AuthDigestCred(struct http_auth *ha, Str uname, Str pw, ParsedURL *pu,
Str algorithm = qstr_unquote(get_auth_param(ha->param, "algorithm"));
Str nonce = qstr_unquote(get_auth_param(ha->param, "nonce"));
- Str cnonce = qstr_unquote(get_auth_param(ha->param, "cnonce"));
+ Str cnonce /* = qstr_unquote(get_auth_param(ha->param, "cnonce")) */;
+ /* cnonce is what client should generate. */
Str qop = qstr_unquote(get_auth_param(ha->param, "qop"));
- if (cnonce == NULL)
- cnonce = Strnew_charp("cnonce"); /* XXX */
+ static union {
+ int r[4];
+ char s[sizeof(int) * 4];
+ } cnonce_seed;
+ int qop_i = QOP_NONE;
+
+ cnonce_seed.r[0] = rand();
+ cnonce_seed.r[1] = rand();
+ cnonce_seed.r[2] = rand();
+ MD5(cnonce_seed.s, sizeof(cnonce_seed.s), md5);
+ cnonce = digest_hex(md5);
+ cnonce_seed.r[3]++;
+
+ if (qop) {
+ char *p;
+ size_t i;
+
+ p = qop->ptr;
+ SKIP_BLANKS(p);
+
+ for (;;) {
+ if ((i = strcspn(p, " \t,")) > 0) {
+ if (i == sizeof("auth-int") - sizeof("") && !strncasecmp(p, "auth-int", i)) {
+ if (qop_i < QOP_AUTH_INT)
+ qop_i = QOP_AUTH_INT;
+ }
+ else if (i == sizeof("auth") - sizeof("") && !strncasecmp(p, "auth", i)) {
+ if (qop_i < QOP_AUTH)
+ qop_i = QOP_AUTH;
+ }
+ }
+
+ if (p[i]) {
+ p += i + 1;
+ SKIP_BLANKS(p);
+ }
+ else
+ break;
+ }
+ }
/* A1 = unq(username-value) ":" unq(realm-value) ":" passwd */
tmp = Strnew_m_charp(uname->ptr, ":",
@@ -1204,28 +1315,34 @@ AuthDigestCred(struct http_auth *ha, Str uname, Str pw, ParsedURL *pu,
/* A2 = Method ":" digest-uri-value */
tmp = Strnew_m_charp(HTTPrequestMethod(hr)->ptr, ":", uri->ptr, NULL);
- if (qop && (strcasecmp(qop->ptr, "auth-int") == 0)) {
+ if (qop_i == QOP_AUTH_INT) {
/* A2 = Method ":" digest-uri-value ":" H(entity-body) */
- Str ebody = Strnew();
if (request && request->body) {
- FILE *fp = fopen(request->body, "r");
- if (fp != NULL) {
- int c;
- while ((c = fgetc(fp)) != EOF)
- Strcat_char(ebody, c);
- fclose(fp);
+ if (request->method == FORM_METHOD_POST && request->enctype == FORM_ENCTYPE_MULTIPART) {
+ FILE *fp = fopen(request->body, "r");
+ if (fp != NULL) {
+ Str ebody;
+ ebody = Strfgetall(fp);
+ MD5(ebody->ptr, strlen(ebody->ptr), md5);
+ }
+ else {
+ MD5("", 0, md5);
+ }
+ }
+ else {
+ MD5(request->body, request->length, md5);
}
}
- MD5(ebody->ptr, strlen(ebody->ptr), md5);
- ebody = digest_hex(md5);
- Strcat_m_charp(tmp, ":", ebody->ptr, NULL);
+ else {
+ MD5("", 0, md5);
+ }
+ Strcat_char(tmp, ':');
+ Strcat(tmp, digest_hex(md5));
}
MD5(tmp->ptr, strlen(tmp->ptr), md5);
a2buf = digest_hex(md5);
- if (qop &&
- (strcasecmp(qop->ptr, "auth") == 0
- || strcasecmp(qop->ptr, "auth-int") == 0)) {
+ if (qop_i >= QOP_AUTH) {
/* request-digest = <"> < KD ( H(A1), unq(nonce-value)
* ":" nc-value
* ":" unq(cnonce-value)
@@ -1238,7 +1355,7 @@ AuthDigestCred(struct http_auth *ha, Str uname, Str pw, ParsedURL *pu,
tmp = Strnew_m_charp(a1buf->ptr, ":", qstr_unquote(nonce)->ptr,
":", nc,
":", qstr_unquote(cnonce)->ptr,
- ":", qstr_unquote(qop)->ptr,
+ ":", qop_i == QOP_AUTH ? "auth" : "auth-int",
":", a2buf->ptr, NULL);
MD5(tmp->ptr, strlen(tmp->ptr), md5);
rd = digest_hex(md5);
@@ -1279,10 +1396,13 @@ AuthDigestCred(struct http_auth *ha, Str uname, Str pw, ParsedURL *pu,
if ((s = get_auth_param(ha->param, "opaque")) != NULL)
Strcat_m_charp(tmp, ", opaque=", s->ptr, NULL);
- if (qop) {
+ if (qop_i >= QOP_AUTH) {
Strcat_m_charp(tmp, ", qop=",
- get_auth_param(ha->param, "qop")->ptr, NULL);
+ qop_i == QOP_AUTH ? "auth" : "auth-int",
+ NULL);
/* XXX how to count? */
+ /* Since nonce is unique up to each *-Authenticate and w3m does not re-use *-Authenticate: headers,
+ nonce-count should be always "00000001". */
Strcat_m_charp(tmp, ", nc=", nc, NULL);
}
@@ -1344,12 +1464,9 @@ static struct http_auth *
findAuthentication(struct http_auth *hauth, Buffer *buf, char *auth_field)
{
struct http_auth *ha;
- int len = strlen(auth_field);
+ int len = strlen(auth_field), slen;
TextListItem *i;
char *p0, *p;
- Regex re_token;
-
- newRegex(TOKEN_PAT, FALSE, &re_token, NULL);
bzero(hauth, sizeof(struct http_auth));
for (i = buf->document_header->first; i != NULL; i = i->next) {
@@ -1358,29 +1475,30 @@ findAuthentication(struct http_auth *hauth, Buffer *buf, char *auth_field)
SKIP_BLANKS(p);
p0 = p;
for (ha = &www_auth[0]; ha->scheme != NULL; ha++) {
- if (strncasecmp(p, ha->scheme, strlen(ha->scheme)) == 0) {
+ slen = strlen(ha->scheme);
+ if (strncasecmp(p, ha->scheme, slen) == 0) {
+ p += slen;
+ SKIP_BLANKS(p);
if (hauth->pri < ha->pri) {
*hauth = *ha;
- p += strlen(ha->scheme);
- SKIP_BLANKS(p);
p = extract_auth_param(p, hauth->param);
break;
}
else {
/* weak auth */
- p += strlen(ha->scheme);
- SKIP_BLANKS(p);
p = extract_auth_param(p, none_auth_param);
}
}
}
if (p0 == p) {
/* all unknown auth failed */
- if (RegexMatch(&re_token, p0, -1, TRUE) == 0)
- return NULL;
- MatchedPosition(&re_token, &p0, &p);
- SKIP_BLANKS(p);
- p = extract_auth_param(p, none_auth_param);
+ int token_type;
+ if ((token_type = skip_auth_token(&p)) == AUTHCHR_TOKEN && IS_SPACE(*p)) {
+ SKIP_BLANKS(p);
+ p = extract_auth_param(p, none_auth_param);
+ }
+ else
+ break;
}
}
}
@@ -1893,6 +2011,27 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,
status = HTST_NORMAL;
goto load_doc;
}
+#ifdef AUTH_DEBUG
+ if ((p = checkHeader(t_buf, "WWW-Authenticate:")) != NULL) {
+ /* Authentication needed */
+ struct http_auth hauth;
+ if (findAuthentication(&hauth, t_buf, "WWW-Authenticate:") != NULL
+ && (realm = get_auth_param(hauth.param, "realm")) != NULL) {
+ auth_pu = &pu;
+ getAuthCookie(&hauth, "Authorization:", extra_header,
+ auth_pu, &hr, request, &uname, &pwd);
+ if (uname == NULL) {
+ /* abort */
+ TRAP_OFF;
+ goto page_loaded;
+ }
+ UFclose(&f);
+ add_auth_cookie_flag = 1;
+ status = HTST_NORMAL;
+ goto load_doc;
+ }
+ }
+#endif /* defined(AUTH_DEBUG) */
t = checkContentType(t_buf);
if (t == NULL)
t = "text/plain";
@@ -1987,7 +2126,10 @@ loadGeneralFile(char *path, ParsedURL *volatile current, char *referer,
return NO_BUFFER;
}
- if (f.compression != CMP_NOCOMPRESS) {
+ if ((f.content_encoding != CMP_NOCOMPRESS) && !(w3m_dump & DUMP_EXTRA)) {
+ uncompress_stream(&f, &pu.real_file);
+ }
+ else if (f.compression != CMP_NOCOMPRESS) {
if (!(w3m_dump & DUMP_SOURCE) &&
(w3m_dump & ~DUMP_FRAME || is_text_type(t)
|| searchExtViewer(t))) {
@@ -4180,7 +4322,7 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
}
PUSH_ENV(cmd);
if (cmd == HTML_UL || cmd == HTML_OL) {
- if (parsedtag_get_value(tag, ATTR_START, &count) && count > 0) {
+ if (parsedtag_get_value(tag, ATTR_START, &count)) {
envs[h_env->envc].count = count - 1;
}
}
@@ -4239,6 +4381,8 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
count = atoi(p);
if (count > 0)
envs[h_env->envc].count = count;
+ else
+ envs[h_env->envc].count = 0;
}
switch (envs[h_env->envc].env) {
case HTML_UL:
@@ -4272,7 +4416,7 @@ HTMLtagproc1(struct parsed_tag *tag, struct html_feed_environ *h_env)
case HTML_OL:
if (parsedtag_get_value(tag, ATTR_TYPE, &p))
envs[h_env->envc].type = (int)*p;
- switch (envs[h_env->envc].type) {
+ switch ((envs[h_env->envc].count > 0)? envs[h_env->envc].type: '1') {
case 'i':
num = romanNumeral(envs[h_env->envc].count);
break;
@@ -5145,6 +5289,17 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
buf->hmarklist =
putHmarker(buf->hmarklist, currentLn(buf),
pos, hseq - 1);
+ else if (hseq < 0) {
+ int h = -hseq - 1;
+ if (buf->hmarklist &&
+ h < buf->hmarklist->nmark &&
+ buf->hmarklist->marks[h].invalid) {
+ buf->hmarklist->marks[h].pos = pos;
+ buf->hmarklist->marks[h].line = currentLn(buf);
+ buf->hmarklist->marks[h].invalid = 0;
+ hseq = -hseq;
+ }
+ }
if (id && idFrame)
idFrame->body->nameList =
putAnchor(idFrame->body->nameList, id, NULL,
@@ -5164,8 +5319,12 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
a_href->end.line = currentLn(buf);
a_href->end.pos = pos;
if (a_href->start.line == a_href->end.line &&
- a_href->start.pos == a_href->end.pos)
+ a_href->start.pos == a_href->end.pos) {
+ if (buf->hmarklist &&
+ a_href->hseq < buf->hmarklist->nmark)
+ buf->hmarklist->marks[a_href->hseq].invalid = 1;
a_href->hseq = -1;
+ }
a_href = NULL;
}
break;
@@ -6602,6 +6761,8 @@ loadHTMLstream(URLFile *f, Buffer *newBuf, FILE * src, int internal)
if (src)
Strfputs(lineBuf2, src);
linelen += lineBuf2->length;
+ if (w3m_dump & DUMP_EXTRA)
+ printf("W3m-in-progress: %s\n", convert_size2(linelen, current_content_length, TRUE));
if (w3m_dump & DUMP_SOURCE)
continue;
showProgress(&linelen, &trbyte);
@@ -6854,6 +7015,8 @@ loadBuffer(URLFile *uf, Buffer *volatile newBuf)
if (src)
Strfputs(lineBuf2, src);
linelen += lineBuf2->length;
+ if (w3m_dump & DUMP_EXTRA)
+ printf("W3m-in-progress: %s\n", convert_size2(linelen, current_content_length, TRUE));
if (w3m_dump & DUMP_SOURCE)
continue;
showProgress(&linelen, &trbyte);
@@ -7659,6 +7822,7 @@ doFileSave(URLFile uf, char *defstr)
char *p, *q;
pid_t pid;
char *lock;
+ char *tmpf = NULL;
#if !(defined(HAVE_SYMLINK) && defined(HAVE_LSTAT))
FILE *f;
#endif
@@ -7699,6 +7863,11 @@ doFileSave(URLFile uf, char *defstr)
flush_tty();
pid = fork();
if (!pid) {
+ if (uf.content_encoding != CMP_NOCOMPRESS) {
+ uncompress_stream(&uf, &tmpf);
+ if (tmpf)
+ unlink(tmpf);
+ }
setup_child(FALSE, 0, UFfileno(&uf));
if (!save2tmp(uf, p) && PreserveTimestamp && uf.modtime != -1)
setModtime(p, uf.modtime);
@@ -7731,6 +7900,11 @@ doFileSave(URLFile uf, char *defstr)
printf("Can't save. Load file and %s are identical.", p);
return -1;
}
+ if (uf.content_encoding != CMP_NOCOMPRESS) {
+ uncompress_stream(&uf, &tmpf);
+ if (tmpf)
+ unlink(tmpf);
+ }
if (save2tmp(uf, p) < 0) {
/* FIXME: gettextize? */
printf("Can't save to %s\n", p);
@@ -7891,7 +8065,7 @@ uncompress_stream(URLFile *uf, char **src)
uf->scheme = SCM_LOCAL;
}
UFhalfclose(uf);
- uf->stream = newFileStream(f1, (void (*)())pclose);
+ uf->stream = newFileStream(f1, (void (*)())fclose);
}
static FILE *
diff --git a/fm.h b/fm.h
index 6b45d3a..bd8d65b 100644
--- a/fm.h
+++ b/fm.h
@@ -1,4 +1,4 @@
-/* $Id: fm.h,v 1.125 2004/04/16 18:47:19 ukai Exp $ */
+/* $Id: fm.h,v 1.131 2006/04/08 11:33:16 inu Exp $ */
/*
* w3m: WWW wo Miru utility
*
@@ -336,6 +336,7 @@ typedef struct _Line {
typedef struct {
int line;
int pos;
+ int invalid;
} BufferPoint;
#ifdef USE_IMAGE
@@ -759,11 +760,11 @@ typedef struct http_request {
*/
extern int LINES, COLS;
-#if defined(__CYGWIN__) && LANG == JA
+#if defined(__CYGWIN__)
extern int LASTLINE;
-#else /* not defined(__CYGWIN__) || LANG != JA */
+#else /* not defined(__CYGWIN__) */
#define LASTLINE (LINES-1)
-#endif /* not defined(__CYGWIN__) || LANG != JA */
+#endif /* not defined(__CYGWIN__) */
global int Tabstop init(8);
global int IndentIncr init(4);
@@ -1009,6 +1010,7 @@ global wc_ces InnerCharset init(WC_CES_WTF); /* Don't change */
global wc_ces DisplayCharset init(DISPLAY_CHARSET);
global wc_ces DocumentCharset init(DOCUMENT_CHARSET);
global wc_ces SystemCharset init(SYSTEM_CHARSET);
+global wc_ces BookmarkCharset init(SYSTEM_CHARSET);
global char ExtHalfdump init(FALSE);
global char FollowLocale init(TRUE);
global char UseContentCharset init(TRUE);
@@ -1075,6 +1077,7 @@ global MouseAction mouse_action;
#ifdef USE_COOKIE
global int default_use_cookie init(TRUE);
global int use_cookie init(FALSE);
+global int show_cookie init(TRUE);
global int accept_cookie init(FALSE);
#define ACCEPT_BAD_COOKIE_DISCARD 0
#define ACCEPT_BAD_COOKIE_ACCEPT 1
diff --git a/ftp.c b/ftp.c
index e54dc3b..0ebb930 100644
--- a/ftp.c
+++ b/ftp.c
@@ -1,4 +1,4 @@
-/* $Id: ftp.c,v 1.35 2004/04/16 18:47:19 ukai Exp $ */
+/* $Id: ftp.c,v 1.37 2006/04/07 13:21:11 inu Exp $ */
#include <stdio.h>
#include <pwd.h>
#include <Str.h>
diff --git a/functable.tab b/functable.tab
deleted file mode 100644
index b78b1b2..0000000
--- a/functable.tab
+++ /dev/null
@@ -1,153 +0,0 @@
-#include <stdio.h>
-#include "funcname1.h"
-%%
-@@@ FUNCNAME_nulcmd
-ABORT FUNCNAME_quitfm
-ACCESSKEY FUNCNAME_accessKey
-ADD_BOOKMARK FUNCNAME_adBmark
-ALARM FUNCNAME_setAlarm
-BACK FUNCNAME_backBf
-BEGIN FUNCNAME_goLineF
-BOOKMARK FUNCNAME_ldBmark
-CENTER_H FUNCNAME_ctrCsrH
-CENTER_V FUNCNAME_ctrCsrV
-CHARSET FUNCNAME_docCSet
-CLOSE_TAB FUNCNAME_closeT
-CLOSE_TAB_MOUSE FUNCNAME_closeTMs
-COMMAND FUNCNAME_execCmd
-COOKIE FUNCNAME_cooLst
-DEFAULT_CHARSET FUNCNAME_defCSet
-DEFINE_KEY FUNCNAME_defKey
-DELETE_PREVBUF FUNCNAME_deletePrevBuf
-DICT_WORD FUNCNAME_dictword
-DICT_WORD_AT FUNCNAME_dictwordat
-DISPLAY_IMAGE FUNCNAME_dispI
-DOWN FUNCNAME_ldown1
-DOWNLOAD FUNCNAME_svSrc
-DOWNLOAD_LIST FUNCNAME_ldDL
-EDIT FUNCNAME_editBf
-EDIT_SCREEN FUNCNAME_editScr
-END FUNCNAME_goLineL
-ESCBMAP FUNCNAME_escbmap
-ESCMAP FUNCNAME_escmap
-EXEC_SHELL FUNCNAME_execsh
-EXIT FUNCNAME_quitfm
-EXTERN FUNCNAME_extbrz
-EXTERN_LINK FUNCNAME_linkbrz
-FRAME FUNCNAME_rFrame
-GOTO FUNCNAME_goURL
-GOTO_LINE FUNCNAME_goLine
-GOTO_LINK FUNCNAME_followA
-GOTO_RELATIVE FUNCNAME_gorURL
-HELP FUNCNAME_ldhelp
-HISTORY FUNCNAME_ldHist
-INFO FUNCNAME_pginfo
-INTERRUPT FUNCNAME_susp
-ISEARCH FUNCNAME_isrchfor
-ISEARCH_BACK FUNCNAME_isrchbak
-LEFT FUNCNAME_col1L
-LINE_BEGIN FUNCNAME_linbeg
-LINE_END FUNCNAME_linend
-LINE_INFO FUNCNAME_curlno
-LINK_BEGIN FUNCNAME_topA
-LINK_END FUNCNAME_lastA
-LINK_MENU FUNCNAME_linkMn
-LIST FUNCNAME_linkLst
-LIST_MENU FUNCNAME_listMn
-LOAD FUNCNAME_ldfile
-MAIN_MENU FUNCNAME_mainMn
-MARK FUNCNAME__mark
-MARK_MID FUNCNAME_chkNMID
-MARK_URL FUNCNAME_chkURL
-MARK_WORD FUNCNAME_chkWORD
-MENU FUNCNAME_mainMn
-MENU_MOUSE FUNCNAME_menuMs
-MOUSE FUNCNAME_mouse
-MOUSE_TOGGLE FUNCNAME_msToggle
-MOVE_DOWN FUNCNAME_movD
-MOVE_DOWN1 FUNCNAME_movD1
-MOVE_LEFT FUNCNAME_movL
-MOVE_LEFT1 FUNCNAME_movL1
-MOVE_LIST_MENU FUNCNAME_movlistMn
-MOVE_MOUSE FUNCNAME_movMs
-MOVE_RIGHT FUNCNAME_movR
-MOVE_RIGHT1 FUNCNAME_movR1
-MOVE_UP FUNCNAME_movU
-MOVE_UP1 FUNCNAME_movU1
-MSGS FUNCNAME_msgs
-MULTIMAP FUNCNAME_multimap
-NEW_TAB FUNCNAME_newT
-NEXT FUNCNAME_nextBf
-NEXT_DOWN FUNCNAME_nextD
-NEXT_LEFT FUNCNAME_nextL
-NEXT_LEFT_UP FUNCNAME_nextLU
-NEXT_LINK FUNCNAME_nextA
-NEXT_MARK FUNCNAME_nextMk
-NEXT_PAGE FUNCNAME_pgFore
-NEXT_RIGHT FUNCNAME_nextR
-NEXT_RIGHT_DOWN FUNCNAME_nextRD
-NEXT_TAB FUNCNAME_nextT
-NEXT_UP FUNCNAME_nextU
-NEXT_VISITED FUNCNAME_nextVA
-NEXT_WORD FUNCNAME_movRW
-NOTHING FUNCNAME_nulcmd
-NULL FUNCNAME_nulcmd
-OPTIONS FUNCNAME_ldOpt
-PCMAP FUNCNAME_pcmap
-PEEK FUNCNAME_curURL
-PEEK_IMG FUNCNAME_peekIMG
-PEEK_LINK FUNCNAME_peekURL
-PIPE_BUF FUNCNAME_pipeBuf
-PIPE_SHELL FUNCNAME_pipesh
-PREV FUNCNAME_prevBf
-PREV_LINK FUNCNAME_prevA
-PREV_MARK FUNCNAME_prevMk
-PREV_PAGE FUNCNAME_pgBack
-PREV_TAB FUNCNAME_prevT
-PREV_VISITED FUNCNAME_prevVA
-PREV_WORD FUNCNAME_movLW
-PRINT FUNCNAME_svBuf
-QUIT FUNCNAME_qquitfm
-READ_SHELL FUNCNAME_readsh
-REDO FUNCNAME_redoPos
-REDRAW FUNCNAME_rdrwSc
-REG_MARK FUNCNAME_reMark
-REINIT FUNCNAME_reinit
-RELOAD FUNCNAME_reload
-RESHAPE FUNCNAME_reshape
-RIGHT FUNCNAME_col1R
-SAVE FUNCNAME_svSrc
-SAVE_IMAGE FUNCNAME_svI
-SAVE_LINK FUNCNAME_svA
-SAVE_SCREEN FUNCNAME_svBuf
-SEARCH FUNCNAME_srchfor
-SEARCH_BACK FUNCNAME_srchbak
-SEARCH_FORE FUNCNAME_srchfor
-SEARCH_NEXT FUNCNAME_srchnxt
-SEARCH_PREV FUNCNAME_srchprv
-SELECT FUNCNAME_selBuf
-SELECT_MENU FUNCNAME_selMn
-SETENV FUNCNAME_setEnv
-SET_OPTION FUNCNAME_setOpt
-SHELL FUNCNAME_execsh
-SHIFT_LEFT FUNCNAME_shiftl
-SHIFT_RIGHT FUNCNAME_shiftr
-SOURCE FUNCNAME_vwSrc
-STOP_IMAGE FUNCNAME_stopI
-SUBMIT FUNCNAME_submitForm
-SUSPEND FUNCNAME_susp
-TAB_GOTO FUNCNAME_tabURL
-TAB_GOTO_RELATIVE FUNCNAME_tabrURL
-TAB_LEFT FUNCNAME_tabL
-TAB_LINK FUNCNAME_tabA
-TAB_MENU FUNCNAME_tabMn
-TAB_MOUSE FUNCNAME_tabMs
-TAB_RIGHT FUNCNAME_tabR
-UNDO FUNCNAME_undoPos
-UP FUNCNAME_lup1
-VERSION FUNCNAME_dispVer
-VIEW FUNCNAME_vwSrc
-VIEW_BOOKMARK FUNCNAME_ldBmark
-VIEW_IMAGE FUNCNAME_followI
-WHEREIS FUNCNAME_srchfor
-WRAP_TOGGLE FUNCNAME_wrapToggle
diff --git a/html.h b/html.h
index 28d1599..4c8173f 100644
--- a/html.h
+++ b/html.h
@@ -1,4 +1,4 @@
-/* $Id: html.h,v 1.25 2003/10/20 16:41:56 ukai Exp $ */
+/* $Id: html.h,v 1.26 2006/05/29 12:54:26 inu Exp $ */
#ifndef _HTML_H
#define _HTML_H
#ifdef USE_SSL
@@ -69,6 +69,7 @@ typedef struct {
InputStream stream;
char *ext;
int compression;
+ int content_encoding;
char *guess_type;
#ifdef USE_SSL
char *ssl_certificate;
diff --git a/indep.c b/indep.c
index 6478271..6f3dceb 100644
--- a/indep.c
+++ b/indep.c
@@ -1,4 +1,4 @@
-/* $Id: indep.c,v 1.35 2004/04/09 17:18:49 ukai Exp $ */
+/* $Id: indep.c,v 1.37 2006/04/07 13:21:11 inu Exp $ */
#include "fm.h"
#include <stdio.h>
#include <pwd.h>
diff --git a/islang.c b/islang.c
index bcf9688..2d0c164 100644
--- a/islang.c
+++ b/islang.c
@@ -18,7 +18,7 @@ main(int argc, char **argv)
return 1;
if (isdigit((int)*argv[1])) {
- ULONG CpList[8], CpSize;
+ unsigned long CpList[8], CpSize;
APIRET rc = DosQueryCp(sizeof(CpList), CpList, &CpSize);
if (rc)
return rc;
diff --git a/istream.c b/istream.c
index fe5847b..0e9147a 100644
--- a/istream.c
+++ b/istream.c
@@ -1,4 +1,4 @@
-/* $Id: istream.c,v 1.23 2003/10/20 16:41:56 ukai Exp $ */
+/* $Id: istream.c,v 1.25 2006/04/07 13:21:11 inu Exp $ */
#include "fm.h"
#include "myctype.h"
#include "istream.h"
diff --git a/keybind.c b/keybind.c
index 6224b44..a490962 100644
--- a/keybind.c
+++ b/keybind.c
@@ -1,4 +1,4 @@
-/* $Id: keybind.c,v 1.9 2002/12/13 03:02:03 ukai Exp $ */
+/* $Id: keybind.c,v 1.10 2006/05/29 12:17:25 inu Exp $ */
#include "funcname2.h"
unsigned char GlobalKeymap[128] = {
@@ -99,7 +99,7 @@ unsigned char EscBKeymap[128] = {
/* P Q R S T U V W */
nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd,
/* X Y Z [ \ ] ^ _ */
- nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd,
+ nulcmd, nulcmd, prevA, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd,
/* ` a b c d e f g */
nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd,
/* h i j k l m n o */
diff --git a/keybind_lynx.c b/keybind_lynx.c
index 065d008..163f6b2 100644
--- a/keybind_lynx.c
+++ b/keybind_lynx.c
@@ -1,4 +1,4 @@
-/* $Id: keybind_lynx.c,v 1.7 2002/12/13 03:02:03 ukai Exp $ */
+/* $Id: keybind_lynx.c,v 1.8 2006/05/29 12:17:25 inu Exp $ */
/*
* Lynx-like key binding.
*
@@ -107,7 +107,7 @@ unsigned char EscBKeymap[128] = {
/* P Q R S T U V W */
nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd,
/* X Y Z [ \ ] ^ _ */
- nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd,
+ nulcmd, nulcmd, prevA, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd,
/* ` a b c d e f g */
nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd, nulcmd,
/* h i j k l m n o */
diff --git a/libwc/Makefile.in b/libwc/Makefile.in
index 28a1201..bd99432 100644
--- a/libwc/Makefile.in
+++ b/libwc/Makefile.in
@@ -6,7 +6,7 @@ top_srcdir=@top_srcdir@
VPATH=$(srcdir):.
LIBRARY = libwc.a
CC=@CC@
-CFLAGS = $(OPTS) -I.. -I$(top_srcdir) -I$(srcdir) @CFLAGS@ @WCCFLAGS@ @DEFS@
+CFLAGS = $(OPTS) -I.. -I$(top_srcdir) -I$(srcdir) @CFLAGS@ @CPPFLAGS@ @WCCFLAGS@ @DEFS@
AR=ar
RANLIB=@RANLIB@
RM=rm
diff --git a/libwc/charset.c b/libwc/charset.c
index 95343b3..e64b6f6 100644
--- a/libwc/charset.c
+++ b/libwc/charset.c
@@ -6,6 +6,10 @@
#include "wc.h"
+#ifdef HAVE_LANGINFO_CODESET
+#include <langinfo.h>
+#endif
+
wc_locale WcLocale = 0;
static struct {
@@ -369,6 +373,12 @@ wc_locale_to_ces(char *locale)
if (*p == 'C' && *(p+1) == '\0')
return WC_CES_US_ASCII;
+#ifdef HAVE_LANGINFO_CODESET
+ {
+ char *cs = nl_langinfo(CODESET);
+ return wc_charset_to_ces(cs);
+ }
+#endif
for (n = 0; *p && *p != '.' && n < 5; p++) {
if ((unsigned char)*p > 0x20)
buf[n++] = tolower(*p);
diff --git a/libwc/detect.c b/libwc/detect.c
index eea2d5d..3fdf980 100644
--- a/libwc/detect.c
+++ b/libwc/detect.c
@@ -99,7 +99,7 @@ wc_auto_detect(char *is, size_t len, wc_ces hint)
for (; p < ep && ! WC_DETECT_MAP[*p]; p++)
;
if (p == ep)
- return WC_CES_US_ASCII;
+ return hint;
switch (hint) {
case WC_CES_ISO_2022_JP:
diff --git a/local.c b/local.c
index b1e388d..8da1fc7 100644
--- a/local.c
+++ b/local.c
@@ -1,4 +1,4 @@
-/* $Id: local.c,v 1.31 2003/09/26 17:59:51 ukai Exp $ */
+/* $Id: local.c,v 1.33 2006/04/07 13:21:11 inu Exp $ */
#include "fm.h"
#include <string.h>
#include <stdio.h>
diff --git a/mailcap.c b/mailcap.c
index e26da72..5bb45f6 100644
--- a/mailcap.c
+++ b/mailcap.c
@@ -252,7 +252,7 @@ acceptableMimeTypes()
/* generate acceptable media types */
l = newTextList();
mhash = newHash_si(16); /* XXX */
- pushText(l, "text");
+ /* pushText(l, "text"); */
putHash_si(mhash, "text", 1);
pushText(l, "image");
putHash_si(mhash, "image", 1);
@@ -272,11 +272,10 @@ acceptableMimeTypes()
}
}
}
+ types = Strnew();
+ Strcat_charp(types, "text/html, text/*;q=0.5");
while ((p = popText(l)) != NULL) {
- if (types == NULL)
- types = Strnew();
- else
- Strcat_charp(types, ", ");
+ Strcat_charp(types, ", ");
Strcat_charp(types, p);
Strcat_charp(types, "/*");
}
diff --git a/main.c b/main.c
index 79d6026..b11913f 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.242 2004/04/04 16:47:20 ukai Exp $ */
+/* $Id: main.c,v 1.252 2006/05/29 12:42:22 inu Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -51,7 +51,6 @@ static MySignalHandler SigAlarm(SIGNAL_ARG);
#ifdef SIGWINCH
static int need_resize_screen = FALSE;
static MySignalHandler resize_hook(SIGNAL_ARG);
-static MySignalHandler resize_handler(SIGNAL_ARG);
static void resize_screen(void);
#endif
@@ -294,10 +293,9 @@ wrap_GC_warn_proc(char *msg, GC_word arg)
for (; n > 0; --n, ++i) {
i %= sizeof(msg_ring) / sizeof(msg_ring[0]);
- disp_message_nsec(Sprintf
- (msg_ring[i].msg,
- (unsigned long)msg_ring[i].arg)->ptr, FALSE,
- 1, TRUE, FALSE);
+
+ printf(msg_ring[i].msg, (unsigned long)msg_ring[i].arg);
+ sleep_till_anykey(1, 1);
}
lock = 0;
@@ -384,9 +382,11 @@ main(int argc, char **argv, char **envp)
#endif
#endif
GC_init();
+#if ENABLE_NLS
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
+#endif
#ifndef HAVE_SYS_ERRLIST
prepare_sys_errlist();
@@ -452,6 +452,7 @@ main(int argc, char **argv, char **envp)
SystemCharset = wc_guess_locale_charset(Locale, SystemCharset);
}
auto_detect = WcOption.auto_detect;
+ BookmarkCharset = DocumentCharset;
#endif
if (!non_null(HTTP_proxy) &&
@@ -1081,24 +1082,32 @@ main(int argc, char **argv, char **envp)
}
#endif
#ifdef SIGWINCH
- if (need_resize_screen) {
- need_resize_screen = FALSE;
- resize_screen();
- }
- mySignal(SIGWINCH, resize_handler);
+ mySignal(SIGWINCH, resize_hook);
#endif
#ifdef USE_IMAGE
if (activeImage && displayImage && Currentbuf->img &&
!Currentbuf->image_loaded) {
do {
+#ifdef SIGWINCH
+ if (need_resize_screen)
+ resize_screen();
+#endif
loadImage(Currentbuf, IMG_FLAG_NEXT);
} while (sleep_till_anykey(1, 0) <= 0);
}
+#ifdef SIGWINCH
+ else
+#endif
#endif
- c = getch();
#ifdef SIGWINCH
- mySignal(SIGWINCH, resize_hook);
+ {
+ do {
+ if (need_resize_screen)
+ resize_screen();
+ } while (sleep_till_anykey(1, 0) <= 0);
+ }
#endif
+ c = getch();
#ifdef USE_ALARM
if (CurrentAlarm->sec > 0) {
alarm(0);
@@ -1109,10 +1118,18 @@ main(int argc, char **argv, char **envp)
mouse_inactive();
#endif /* USE_MOUSE */
if (IS_ASCII(c)) { /* Ascii */
- if (((prec_num && c == '0') || '1' <= c) && (c <= '9')) {
- prec_num = prec_num * 10 + (int)(c - '0');
- if (prec_num > PREC_LIMIT)
- prec_num = PREC_LIMIT;
+ if( vi_prec_num ){
+ if(((prec_num && c == '0') || '1' <= c) && (c <= '9')) {
+ prec_num = prec_num * 10 + (int)(c - '0');
+ if (prec_num > PREC_LIMIT)
+ prec_num = PREC_LIMIT;
+ }
+ else {
+ set_buffer_environ(Currentbuf);
+ save_buffer_position(Currentbuf);
+ keyPressEventProc((int)c);
+ prec_num = 0;
+ }
}
else {
set_buffer_environ(Currentbuf);
@@ -1416,17 +1433,10 @@ resize_hook(SIGNAL_ARG)
SIGNAL_RETURN;
}
-static MySignalHandler
-resize_handler(SIGNAL_ARG)
-{
- resize_screen();
- mySignal(SIGWINCH, resize_handler);
- SIGNAL_RETURN;
-}
-
static void
resize_screen(void)
{
+ need_resize_screen = FALSE;
setlinescols();
setupscreen();
if (CurrentTab)
@@ -1963,6 +1973,7 @@ DEFUN(pipeBuf, PIPE_BUF, "Send rendered document to pipe")
buf->bufferprop |= (BP_INTERNAL | BP_NO_URL);
if (buf->type == NULL)
buf->type = "text/plain";
+ buf->currentURL.file = "-";
pushBuffer(buf);
}
displayBuffer(Currentbuf, B_FORCE_REDRAW);
@@ -4110,25 +4121,20 @@ DEFUN(adBmark, ADD_BOOKMARK, "Add current page to bookmark")
Str tmp;
FormList *request;
- tmp = Sprintf("mode=panel&cookie=%s&bmark=%s&url=%s&title=%s",
+ tmp = Sprintf("mode=panel&cookie=%s&bmark=%s&url=%s&title=%s"
+#ifdef USE_M17N
+ "&charset=%s"
+#endif
+ ,
(Str_form_quote(localCookie()))->ptr,
(Str_form_quote(Strnew_charp(BookmarkFile)))->ptr,
(Str_form_quote(parsedURL2Str(&Currentbuf->currentURL)))->
ptr,
#ifdef USE_M17N
-#if LANG == JA
- /* FIXME: why WC_CES_EUC_JP hardcoded?
- * backward compatibility.
- * w3mbookmark takes arguments as EUC-JP only?
- */
(Str_form_quote(wc_conv_strict(Currentbuf->buffername,
InnerCharset,
- WC_CES_EUC_JP)))->ptr);
-#else
- (Str_form_quote(wc_conv_strict(Currentbuf->buffername,
- InnerCharset,
- SystemCharset)))->ptr);
-#endif
+ BookmarkCharset)))->ptr,
+ wc_ces_to_charset(BookmarkCharset));
#else
(Str_form_quote(Strnew_charp(Currentbuf->buffername)))->ptr);
#endif
@@ -5323,7 +5329,7 @@ DEFUN(mouse, MOUSE, "mouse operation")
int btn, x, y;
btn = (unsigned char)getch() - 32;
-#if defined(__CYGWIN__)
+#if defined(__CYGWIN__) && CYGWIN_VERSION_DLL_MAJOR < 1005
if (cygwin_mouse_btn_swapped) {
if (btn == MOUSE_BTN2_DOWN)
btn = MOUSE_BTN3_DOWN;
@@ -5674,7 +5680,7 @@ searchKeyNum(void)
static char *
getCodePage(void)
{
- ULONG CpList[8], CpSize;
+ unsigned long CpList[8], CpSize;
if (!getenv("WINDOWID") && !DosQueryCp(sizeof(CpList), CpList, &CpSize))
return Sprintf("CP%d", *CpList)->ptr;
diff --git a/menu.c b/menu.c
index a17c490..d8035e7 100644
--- a/menu.c
+++ b/menu.c
@@ -1,4 +1,4 @@
-/* $Id: menu.c,v 1.41 2004/03/23 16:44:02 ukai Exp $ */
+/* $Id: menu.c,v 1.45 2006/04/07 13:21:12 inu Exp $ */
/*
* w3m menu.c
*/
@@ -1183,7 +1183,7 @@ mMouse(char c)
int btn, x, y;
btn = (unsigned char)getch() - 32;
-#if defined(__CYGWIN__)
+#if defined(__CYGWIN__) && CYGWIN_VERSION_DLL_MAJOR < 1005
if (cygwin_mouse_btn_swapped) {
if (btn == MOUSE_BTN2_DOWN)
btn = MOUSE_BTN3_DOWN;
@@ -1717,7 +1717,7 @@ initMenu(void)
#endif
for (item = MainMenuItem; item->type != MENU_END; item++)
item->label =
- wc_conv(gettext(item->label), MainMenuCharset,
+ wc_conv(_(item->label), MainMenuCharset,
InnerCharset)->ptr;
MainMenuEncode = TRUE;
}
diff --git a/parsetagx.c b/parsetagx.c
index 6bcc787..6b627d2 100644
--- a/parsetagx.c
+++ b/parsetagx.c
@@ -1,4 +1,4 @@
-/* $Id: parsetagx.c,v 1.14 2003/02/05 16:44:00 ukai Exp $ */
+/* $Id: parsetagx.c,v 1.18 2006/06/07 03:52:03 inu Exp $ */
#include "fm.h"
#include "myctype.h"
#include "indep.h"
@@ -159,7 +159,7 @@ parse_tag(char **s, int internal)
/* Parse tag arguments */
SKIP_BLANKS(q);
while (1) {
- Str value = NULL;
+ Str value = NULL, value_tmp = NULL;
if (*q == '>' || *q == '\0')
goto done_parse_tag;
p = attrname;
@@ -174,14 +174,13 @@ parse_tag(char **s, int internal)
SKIP_BLANKS(q);
if (*q == '=') {
/* get value */
- value = Strnew();
+ value_tmp = Strnew();
q++;
SKIP_BLANKS(q);
if (*q == '"') {
q++;
while (*q && *q != '"') {
- if (*q != '\n')
- Strcat_char(value, *q);
+ Strcat_char(value_tmp, *q);
if (!tag->need_reconstruct && is_html_quote(*q))
tag->need_reconstruct = TRUE;
q++;
@@ -192,8 +191,7 @@ parse_tag(char **s, int internal)
else if (*q == '\'') {
q++;
while (*q && *q != '\'') {
- if (*q != '\n')
- Strcat_char(value, *q);
+ Strcat_char(value_tmp, *q);
if (!tag->need_reconstruct && is_html_quote(*q))
tag->need_reconstruct = TRUE;
q++;
@@ -203,7 +201,7 @@ parse_tag(char **s, int internal)
}
else if (*q) {
while (*q && !IS_SPACE(*q) && *q != '>') {
- Strcat_char(value, *q);
+ Strcat_char(value_tmp, *q);
if (!tag->need_reconstruct && is_html_quote(*q))
tag->need_reconstruct = TRUE;
q++;
@@ -218,6 +216,29 @@ parse_tag(char **s, int internal)
break;
}
}
+
+ if (value_tmp) {
+ int j, hidden=FALSE;
+ for (j=0; j<i; j++) {
+ if (tag->attrid[j] == ATTR_TYPE &&
+ strcmp("hidden",tag->value[j]) == 0) {
+ hidden=TRUE;
+ break;
+ }
+ }
+ if ((tag_id == HTML_INPUT || tag_id == HTML_INPUT_ALT) &&
+ attr_id == ATTR_VALUE && hidden) {
+ value = value_tmp;
+ } else {
+ char *x;
+ value = Strnew();
+ for (x = value_tmp->ptr; *x; x++) {
+ if (*x != '\n')
+ Strcat_char(value, *x);
+ }
+ }
+ }
+
if (i != nattr) {
if (!internal &&
((AttrMAP[attr_id].flag & AFLG_INT) ||
diff --git a/po/ja.po b/po/ja.po
index aae58a2..d3ff212 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: w3m 0.5.1\n"
"Report-Msgid-Bugs-To: ukai@debian.or.jp\n"
-"POT-Creation-Date: 2004-04-29 03:17+0900\n"
+"POT-Creation-Date: 2004-07-14 15:51+0900\n"
"PO-Revision-Date: 2003-09-26 03:35+0900\n"
"Last-Translator: Fumitoshi UKAI <ukai@debian.or.jp>\n"
"Language-Team: Japanese\n"
@@ -717,6 +717,50 @@ msgstr "A:画面サイズに比例"
msgid "B:fixed speed"
msgstr "B:一定の行数"
+#: rc.c:292
+msgid "unspecified"
+msgstr "指定しない"
+
+#: rc.c:293
+msgid "inet inet6"
+msgstr "IPv4優先"
+
+#: rc.c:294
+msgid "inet6 inet"
+msgstr "IPv6優先"
+
+#: rc.c:295
+msgid "inet only"
+msgstr "IPv4のみ"
+
+#: rc.c:296
+msgid "inet6 only"
+msgstr "IPv6のみ"
+
+#: rc.c:303
+msgid "discard"
+msgstr "破棄する"
+
+#: rc.c:305
+msgid "accept"
+msgstr "受け入れる"
+
+#: rc.c:307
+msgid "ask"
+msgstr "確認する"
+
+#: rc.c:317
+msgid "OFF"
+msgstr "無効"
+
+#: rc.c:318
+msgid "Only ISO 2022"
+msgstr "ISO 2022 のみ"
+
+#: rc.c:319
+msgid "ON"
+msgstr "有効"
+
#: rc.c:666
msgid "Display Settings"
msgstr "表示関係"
diff --git a/po/w3m.pot b/po/w3m.pot
index a6959e4..0e0797c 100644
--- a/po/w3m.pot
+++ b/po/w3m.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: ukai@debian.or.jp\n"
-"POT-Creation-Date: 2004-04-29 03:17+0900\n"
+"POT-Creation-Date: 2004-07-14 15:51+0900\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -716,6 +716,50 @@ msgstr ""
msgid "B:fixed speed"
msgstr ""
+#: rc.c:292
+msgid "unspecified"
+msgstr ""
+
+#: rc.c:293
+msgid "inet inet6"
+msgstr ""
+
+#: rc.c:294
+msgid "inet6 inet"
+msgstr ""
+
+#: rc.c:295
+msgid "inet only"
+msgstr ""
+
+#: rc.c:296
+msgid "inet6 only"
+msgstr ""
+
+#: rc.c:303
+msgid "discard"
+msgstr ""
+
+#: rc.c:305
+msgid "accept"
+msgstr ""
+
+#: rc.c:307
+msgid "ask"
+msgstr ""
+
+#: rc.c:317
+msgid "OFF"
+msgstr ""
+
+#: rc.c:318
+msgid "Only ISO 2022"
+msgstr ""
+
+#: rc.c:319
+msgid "ON"
+msgstr ""
+
#: rc.c:666
msgid "Display Settings"
msgstr ""
diff --git a/proto.h b/proto.h
index c46d789..b8f4885 100644
--- a/proto.h
+++ b/proto.h
@@ -1,4 +1,4 @@
-/* $Id: proto.h,v 1.99 2004/04/16 18:47:19 ukai Exp $ */
+/* $Id: proto.h,v 1.101 2006/04/07 13:21:12 inu Exp $ */
/*
* This file was automatically generated by version 1.7 of cextract.
* Manual editing not recommended.
diff --git a/rc.c b/rc.c
index 1d14949..661faeb 100644
--- a/rc.c
+++ b/rc.c
@@ -1,4 +1,4 @@
-/* $Id: rc.c,v 1.96 2004/04/22 16:34:08 ukai Exp $ */
+/* $Id: rc.c,v 1.102 2006/04/07 15:48:56 inu Exp $ */
/*
* Initialization file etc.
*/
@@ -192,6 +192,7 @@ static int OptionEncode = FALSE;
#endif /* USE_SSL */
#ifdef USE_COOKIE
#define CMT_USECOOKIE N_("Enable cookie processing")
+#define CMT_SHOWCOOKIE N_("Print a message when receiving a cookie")
#define CMT_ACCEPTCOOKIE N_("Accept cookies")
#define CMT_ACCEPTBADCOOKIE N_("Action to be taken on invalid cookie")
#define CMT_COOKIE_REJECT_DOMAINS N_("Domains to reject cookies from")
@@ -289,22 +290,22 @@ static struct sel_c wheelmode[] = {
#ifdef INET6
static struct sel_c dnsorders[] = {
- {N_S(DNS_ORDER_UNSPEC), "unspecified"},
- {N_S(DNS_ORDER_INET_INET6), "inet inet6"},
- {N_S(DNS_ORDER_INET6_INET), "inet6 inet"},
- {N_S(DNS_ORDER_INET_ONLY), "inet only"},
- {N_S(DNS_ORDER_INET6_ONLY), "inet6 only"},
+ {N_S(DNS_ORDER_UNSPEC), N_("unspecified")},
+ {N_S(DNS_ORDER_INET_INET6), N_("inet inet6")},
+ {N_S(DNS_ORDER_INET6_INET), N_("inet6 inet")},
+ {N_S(DNS_ORDER_INET_ONLY), N_("inet only")},
+ {N_S(DNS_ORDER_INET6_ONLY), N_("inet6 only")},
{0, NULL, NULL}
};
#endif /* INET6 */
#ifdef USE_COOKIE
static struct sel_c badcookiestr[] = {
- {N_S(ACCEPT_BAD_COOKIE_DISCARD), "discard"},
+ {N_S(ACCEPT_BAD_COOKIE_DISCARD), N_("discard")},
#if 0
- {N_S(ACCEPT_BAD_COOKIE_ACCEPT), "accept"},
+ {N_S(ACCEPT_BAD_COOKIE_ACCEPT), N_("accept")},
#endif
- {N_S(ACCEPT_BAD_COOKIE_ASK), "ask"},
+ {N_S(ACCEPT_BAD_COOKIE_ASK), N_("ask")},
{0, NULL, NULL}
};
#endif /* USE_COOKIE */
@@ -314,9 +315,9 @@ static wc_ces_list *display_charset_str = NULL;
static wc_ces_list *document_charset_str = NULL;
static wc_ces_list *system_charset_str = NULL;
static struct sel_c auto_detect_str[] = {
- {N_S(WC_OPT_DETECT_OFF), "OFF"},
- {N_S(WC_OPT_DETECT_ISO_2022), "Only ISO 2022"},
- {N_S(WC_OPT_DETECT_ON), "ON"},
+ {N_S(WC_OPT_DETECT_OFF), N_("OFF")},
+ {N_S(WC_OPT_DETECT_ISO_2022), N_("Only ISO 2022")},
+ {N_S(WC_OPT_DETECT_ON), N_("ON")},
{0, NULL, NULL}
};
#endif
@@ -552,6 +553,8 @@ struct param_ptr params7[] = {
#ifdef USE_COOKIE
struct param_ptr params8[] = {
{"use_cookie", P_INT, PI_ONOFF, (void *)&use_cookie, CMT_USECOOKIE, NULL},
+ {"show_cookie", P_INT, PI_ONOFF, (void *)&show_cookie,
+ CMT_SHOWCOOKIE, NULL},
{"accept_cookie", P_INT, PI_ONOFF, (void *)&accept_cookie,
CMT_ACCEPTCOOKIE, NULL},
{"accept_bad_cookie", P_INT, PI_SEL_C, (void *)&accept_bad_cookie,
@@ -793,7 +796,7 @@ show_params(FILE * fp)
#ifdef USE_M17N
if (!OptionEncode)
cmt =
- wc_conv(gettext(sections[j].name), OptionCharset,
+ wc_conv(_(sections[j].name), OptionCharset,
InnerCharset)->ptr;
else
#endif
@@ -839,7 +842,7 @@ show_params(FILE * fp)
}
#ifdef USE_M17N
if (!OptionEncode)
- cmt = wc_conv(gettext(sections[j].params[i].comment),
+ cmt = wc_conv(_(sections[j].params[i].comment),
OptionCharset, InnerCharset)->ptr;
else
#endif
@@ -1303,7 +1306,7 @@ load_option_panel(void)
if (optionpanel_str == NULL)
optionpanel_str = Sprintf(optionpanel_src1, w3m_version,
- html_quote(localCookie()->ptr), CMT_HELPER);
+ html_quote(localCookie()->ptr), _(CMT_HELPER));
#if ENABLE_NLS
OptionCharset = SystemCharset; /* FIXME */
#endif
@@ -1313,16 +1316,28 @@ load_option_panel(void)
wc_Str_conv(optionpanel_str, OptionCharset, InnerCharset);
for (i = 0; sections[i].name != NULL; i++) {
sections[i].name =
- wc_conv(gettext(sections[i].name), OptionCharset,
+ wc_conv(_(sections[i].name), OptionCharset,
InnerCharset)->ptr;
- for (p = sections[i].params; p->name; p++)
+ for (p = sections[i].params; p->name; p++) {
p->comment =
- wc_conv(gettext(p->comment), OptionCharset,
+ wc_conv(_(p->comment), OptionCharset,
InnerCharset)->ptr;
+ if (p->inputtype == PI_SEL_C
+#ifdef USE_COLOR
+ && p->select != colorstr
+#endif
+ ) {
+ for (s = (struct sel_c *)p->select; s->text != NULL; s++) {
+ s->text =
+ wc_conv(_(s->text), OptionCharset,
+ InnerCharset)->ptr;
+ }
+ }
+ }
}
#ifdef USE_COLOR
for (s = colorstr; s->text; s++)
- s->text = wc_conv(gettext(s->text), OptionCharset,
+ s->text = wc_conv(_(s->text), OptionCharset,
InnerCharset)->ptr;
#endif
OptionEncode = TRUE;
diff --git a/scripts/w3mmail.cgi.in b/scripts/w3mmail.cgi.in
index 670f26c..02fabd8 100755
--- a/scripts/w3mmail.cgi.in
+++ b/scripts/w3mmail.cgi.in
@@ -1,6 +1,6 @@
#!@PERL@
-$rcsid = q$Id: w3mmail.cgi.in,v 1.13 2003/09/22 21:02:29 ukai Exp $;
+$rcsid = q$Id: w3mmail.cgi.in,v 1.14 2004/08/30 16:32:24 ukai Exp $;
($id = $rcsid) =~ s/^.*,v ([\d\.]*).*/$1/;
($prog=$0) =~ s/.*\///;
@@ -180,6 +180,7 @@ if ($query =~ s/^\w+://) {
}
}
($cs,$cte,$body) = &lang_body($body, 1);
+ $body =~ s/\r//g;
print MAIL "Mime-Version: 1.0\n";
if ($boundary) {
print MAIL "Content-Type: multipart/form-data;\n";
diff --git a/scripts/w3mman/w3mman.1.in b/scripts/w3mman/w3mman.1.in
index eb30237..1c0361d 100644
--- a/scripts/w3mman/w3mman.1.in
+++ b/scripts/w3mman/w3mman.1.in
@@ -1,4 +1,4 @@
-.TH W3MMAN 1 "Mar 14, 2002"
+.TH W3MMAN 1 "Nov 5, 2005"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@@ -19,6 +19,9 @@ w3mman \- an interface to the on-line reference manuals by w3m(1)
.br
.B w3mman
.RI "[-M " path "] -k " keyword
+.br
+.B w3mman
+.RI -l " file
.SH DESCRIPTION
.B w3mman
is the system's manual pager by
@@ -31,9 +34,13 @@ Specify
.I path
as MANPATH.
.TP
-.B \-k " keyword"
+.BI \-k " keyword"
Specify
.I keyword.
+.TP
+.BI \-l " file"
+Specify a
+.I file.
.SH ENVIRONMENT
.TP
.B W3MMAN_W3M
diff --git a/scripts/w3mman/w3mman.in b/scripts/w3mman/w3mman.in
index 6c6f65d..6a27e70 100644
--- a/scripts/w3mman/w3mman.in
+++ b/scripts/w3mman/w3mman.in
@@ -8,6 +8,7 @@ sub usage {
($_ = $0) =~ s@.*/@@;
print STDERR "$_ [-M <path>] [[<section>] <command>]\n";
print STDERR "$_ [-M <path>] [-k <keyword>]\n";
+ print STDERR "$_ [-l <file>]\n";
exit 1;
}
@@ -20,6 +21,10 @@ while (@ARGV) {
} elsif (/^-k$/) {
@ARGV || &usage();
$query = "?keyword=" . &form_encode(shift @ARGV);
+ } elsif (/^-l$/) {
+ @ARGV || &usage();
+ $query = "?quit=ok&local=" . &form_encode(shift @ARGV);
+ $query .= "&pwd=" . &form_encode($ENV{'PWD'});
} elsif (/^-/) {
&usage();
} elsif (/^\d/ || $_ eq 'n') {
diff --git a/scripts/w3mman/w3mman2html.cgi.in b/scripts/w3mman/w3mman2html.cgi.in
index f41d487..3cb105d 100644
--- a/scripts/w3mman/w3mman2html.cgi.in
+++ b/scripts/w3mman/w3mman2html.cgi.in
@@ -19,7 +19,7 @@ if ($QUERY =~ /\=/) {
$query{"man"} = &form_decode($QUERY);
}
-if (! $query{"man"}) {
+if ((! $query{"man"}) && (! $query{"local"})) {
if ($query{"keyword"}) {
$keyword = $query{"keyword"};
$k = &html_quote($keyword);
@@ -71,21 +71,29 @@ EOF
exit;
}
-$man = $query{"man"};
-if ($man =~ s/\((\w+)\)$//) {
- $section = $1;
- $man_section = "$man($1)";
-} elsif ($query{"section"}) {
- $section = $query{"section"};
- $man_section = "$man($section)";
+if ($query{"local"}) {
+ $file = $query{"local"};
+ if (! ($file =~ /^\//)) {
+ $file = $query{"pwd"} . '/' . $file;
+ }
+ open(F, "$MAN -l $file 2> /dev/null |");
} else {
- $section = "";
- $man_section = "$man";
-}
+ $man = $query{"man"};
+ if ($man =~ s/\((\w+)\)$//) {
+ $section = $1;
+ $man_section = "$man($1)";
+ } elsif ($query{"section"}) {
+ $section = $query{"section"};
+ $man_section = "$man($section)";
+ } else {
+ $section = "";
+ $man_section = "$man";
+ }
-$section =~ s:([^-\w\200-\377.,])::g;
-$man =~ s:([^-\w\200-\377.,])::g;
-open(F, "$MAN $section $man 2> /dev/null |");
+ $section =~ s:([^-\w\200-\377.,])::g;
+ $man =~ s:([^-\w\200-\377.,])::g;
+ open(F, "$MAN $section $man 2> /dev/null |");
+}
$ok = 0;
undef $header;
$blank = -1;
@@ -176,6 +184,11 @@ if ($prev) {
close(F);
if (! $ok) {
if ($query{'quit'}) {
+ if ($query{'local'}) {
+ print STDERR "File $file not found.\n";
+ } else {
+ print STDERR "No manual entry for $man_section.\n";
+ }
print STDERR "No manual entry for $man_section.\n";
print <<EOF;
w3m-control: EXIT
@@ -190,7 +203,11 @@ Content-Type: text/html
<body>
<pre>
EOF
- print "No manual entry for <B>$man_section</B>.\n";
+ if ($query{'local'}) {
+ print "File <B>$file</B> not found.\n";
+ } else {
+ print "No manual entry for <B>$man_section</B>.\n";
+ }
}
print <<EOF;
</pre>
diff --git a/table.c b/table.c
index 2b0ea63..44991bd 100644
--- a/table.c
+++ b/table.c
@@ -1,4 +1,4 @@
-/* $Id: table.c,v 1.49 2004/01/09 15:46:49 ukai Exp $ */
+/* $Id: table.c,v 1.53 2006/04/08 11:52:02 inu Exp $ */
/*
* HTML table
*/
@@ -1984,7 +1984,7 @@ renderTable(struct table *t, int max_width, struct html_feed_environ *h_env)
break;
}
if (t->total_height == 0) {
- renderbuf = Strnew(" ");
+ renderbuf = Strnew_charp(" ");
t->total_height++;
t->total_width = 1;
push_render_image(renderbuf, 1, t->total_width, h_env);
@@ -2465,11 +2465,16 @@ feed_table_tag(struct table *tbl, char *line, struct table_mode *mode,
return TAG_ACTION_PLAIN;
}
if (mode->pre_mode & TBLM_INTXTA) {
- if (mode->end_tag == cmd) {
+ switch (cmd) {
+ CASE_TABLE_TAG:
+ case HTML_N_TEXTAREA:
table_close_textarea(tbl, mode, width);
- return TAG_ACTION_NONE;
+ if (cmd == HTML_N_TEXTAREA)
+ return TAG_ACTION_NONE;
+ break;
+ default:
+ return TAG_ACTION_FEED;
}
- return TAG_ACTION_FEED;
}
if (mode->pre_mode & TBLM_SCRIPT) {
if (mode->end_tag == cmd) {
diff --git a/terms.c b/terms.c
index 63963ff..b57add2 100644
--- a/terms.c
+++ b/terms.c
@@ -1,4 +1,4 @@
-/* $Id: terms.c,v 1.51 2003/12/08 16:06:34 ukai Exp $ */
+/* $Id: terms.c,v 1.55 2006/04/07 13:21:12 inu Exp $ */
/*
* An original curses library for EUC-kanji by Akinori ITO, December 1989
* revised by Akinori ITO, January 1995
@@ -56,8 +56,11 @@ static int tty;
#include <windows.h>
#include <sys/cygwin.h>
static int isWinConsole = 0;
+#define TERM_CYGWIN 1
+#define TERM_CYGWIN_RESERVE_IME 2
static int isLocalConsole = 0;
-#ifdef USE_MOUSE
+
+#if CYGWIN_VERSION_DLL_MAJOR < 1005 && defined(USE_MOUSE)
int cygwin_mouse_btn_swapped = 0;
#endif
@@ -79,9 +82,6 @@ check_win9x(void)
}
if (winVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) {
isWin95 = 1;
- if (ttyslot() != -1) {
- isLocalConsole = 0;
- }
}
else {
isWin95 = 0;
@@ -200,7 +200,7 @@ GetConsoleHwnd(void)
return (hwndFound);
}
-#ifdef USE_MOUSE
+#if CYGWIN_VERSION_DLL_MAJOR < 1005 && defined(USE_MOUSE)
static unsigned long
cygwin_version(void)
{
@@ -223,7 +223,7 @@ check_cygwin_console(void)
if (term == NULL)
term = DEFAULT_TERM;
if (term && strncmp(term, "cygwin", 6) == 0) {
- isWinConsole = 1;
+ isWinConsole = TERM_CYGWIN;
}
if (isWinConsole) {
hWnd = GetConsoleHwnd();
@@ -232,11 +232,17 @@ check_cygwin_console(void)
isLocalConsole = 1;
}
}
+ if (strncmp(getenv("LANG"), "ja", 2) == 0) {
+ isWinConsole = TERM_CYGWIN_RESERVE_IME;
+ }
#ifdef SUPPORT_WIN9X_CONSOLE_MBCS
check_win9x();
+ if (isWin95 && ttyslot() != -1) {
+ isLocalConsole = 0;
+ }
#endif
}
-#ifdef USE_MOUSE
+#if CYGWIN_VERSION_DLL_MAJOR < 1005 && defined(USE_MOUSE)
if (cygwin_version() <= 1003015) {
/* cygwin DLL 1.3.15 or earler */
cygwin_mouse_btn_swapped = 1;
@@ -382,9 +388,10 @@ char *T_cd, *T_ce, *T_kr, *T_kl, *T_cr, *T_bt, *T_ta, *T_sc, *T_rc,
*T_ti, *T_te, *T_nd, *T_as, *T_ae, *T_eA, *T_ac, *T_op;
int LINES, COLS;
-#if defined(__CYGWIN__) && LANG == JA
+#if defined(__CYGWIN__)
int LASTLINE;
-#endif /* defined(__CYGWIN__) && LANG == JA */
+#endif /* defined(__CYGWIN__) */
+
static int max_LINES = 0, max_COLS = 0;
static int tab_step = 8;
static int CurLine, CurColumn;
@@ -589,11 +596,11 @@ reset_tty(void)
MySignalHandler
reset_exit(SIGNAL_ARG)
{
- reset_tty();
#ifdef USE_MOUSE
if (mouseActive)
mouse_end();
#endif /* USE_MOUSE */
+ reset_tty();
w3m_exit(0);
SIGNAL_RETURN;
}
@@ -763,9 +770,9 @@ setlinescols(void)
COLS = MAX_COLUMN;
if (LINES > MAX_LINE)
LINES = MAX_LINE;
-#if defined(__CYGWIN__) && LANG == JA
- LASTLINE = LINES - (isWinConsole ? 2 : 1);
-#endif /* defined(__CYGWIN__) && LANG == JA */
+#if defined(__CYGWIN__)
+ LASTLINE = LINES - (isWinConsole == TERM_CYGWIN_RESERVE_IME ? 2 : 1);
+#endif /* defined(__CYGWIN__) */
}
void
@@ -1285,9 +1292,7 @@ refresh(void)
* (COLS-1,LINES-1).
*/
#if !defined(USE_BG_COLOR) || defined(__CYGWIN__)
-#if defined(__CYGWIN__) && LANG == JA
if (isWinConsole)
-#endif /* defined(__CYGWIN__) && LANG == JA */
if (line == LINES - 1 && col == COLS - 1)
break;
#endif /* !defined(USE_BG_COLOR) || defined(__CYGWIN__) */
diff --git a/terms.h b/terms.h
index b6b47ea..55c7a60 100644
--- a/terms.h
+++ b/terms.h
@@ -1,9 +1,9 @@
-/* $Id: terms.h,v 1.9 2003/09/22 21:02:22 ukai Exp $ */
+/* $Id: terms.h,v 1.10 2004/07/15 16:32:39 ukai Exp $ */
#ifndef TERMS_H
#define TERMS_H
extern int LINES, COLS;
-#if defined(__CYGWIN__) && LANG == JA
+#if defined(__CYGWIN__)
extern int LASTLINE;
#endif
@@ -21,7 +21,7 @@ extern int LASTLINE;
#endif
#ifdef __CYGWIN__
-#ifdef USE_MOUSE
+#if CYGWIN_VERSION_DLL_MAJOR < 1005 && defined(USE_MOUSE)
extern int cygwin_mouse_btn_swapped;
#endif
#ifdef SUPPORT_WIN9X_CONSOLE_MBCS
diff --git a/url.c b/url.c
index 9d8c5df..86c2d47 100644
--- a/url.c
+++ b/url.c
@@ -1,4 +1,4 @@
-/* $Id: url.c,v 1.89 2004/04/16 18:47:19 ukai Exp $ */
+/* $Id: url.c,v 1.93 2006/05/29 12:54:26 inu Exp $ */
#include "fm.h"
#include <sys/types.h>
#include <sys/socket.h>
@@ -1453,7 +1453,8 @@ init_stream(URLFile *uf, int scheme, InputStream stream)
uf->scheme = scheme;
uf->encoding = ENC_7BIT;
uf->is_cgi = FALSE;
- uf->compression = 0;
+ uf->compression = CMP_NOCOMPRESS;
+ uf->content_encoding = CMP_NOCOMPRESS;
uf->guess_type = NULL;
uf->ext = NULL;
uf->modtime = -1;
@@ -1526,12 +1527,12 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current,
/* local CGI: POST */
uf.stream = newFileStream(localcgi_post(pu->real_file, pu->query,
request, option->referer),
- (void (*)())pclose);
+ (void (*)())fclose);
else
/* lodal CGI: GET */
uf.stream = newFileStream(localcgi_get(pu->real_file, pu->query,
option->referer),
- (void (*)())pclose);
+ (void (*)())fclose);
if (uf.stream) {
uf.is_cgi = TRUE;
uf.scheme = pu->scheme = SCM_LOCAL_CGI;
diff --git a/version.c.in b/version.c.in
index f20e985..a25d596 100644
--- a/version.c.in
+++ b/version.c.in
@@ -1,5 +1,5 @@
-/* $Id: version.c.in,v 1.44 2004/04/28 18:19:25 ukai Exp $ */
-#define CURRENT_VERSION "w3m/0.5.1"
+/* $Id: version.c.in,v 1.45 2004/05/02 16:40:46 ukai Exp $ */
+#define CURRENT_VERSION "w3m/0.5.1+cvs"
#ifndef FM_H
char *w3m_version = CURRENT_VERSION;
diff --git a/w3mbookmark.c b/w3mbookmark.c
index 74d7203..b1c63bf 100644
--- a/w3mbookmark.c
+++ b/w3mbookmark.c
@@ -1,4 +1,4 @@
-/* $Id: w3mbookmark.c,v 1.10 2003/09/23 18:42:25 ukai Exp $ */
+/* $Id: w3mbookmark.c,v 1.11 2004/07/15 16:44:37 ukai Exp $ */
#include <stdlib.h>
#include <stdio.h>
#include "config.h"
@@ -52,18 +52,18 @@ static char end_section[] =
static char *Local_cookie = NULL;
void
-print_bookmark_panel(char *bmark, char *url, char *title)
+print_bookmark_panel(char *bmark, char *url, char *title, char *charset)
{
Str tmp, tmp2;
FILE *f;
char *p;
-#if LANG == JA
- /* FIXME: gettextize here */
- printf("Content-Type: text/html; charset=EUC-JP\n\n");
-#else
- printf("Content-Type: text/html\n\n");
-#endif
+ if (charset == NULL) {
+ printf("Content-Type: text/html\n\n");
+ }
+ else {
+ printf("Content-Type: text/html; charset=%s\n\n", charset);
+ }
printf(bkmark_src1, html_quote(bmark), html_quote(Local_cookie));
if ((f = fopen(bmark, "r")) != NULL) {
printf("<tr><td>Section:<td><select name=\"section\">\n");
@@ -188,6 +188,7 @@ main(int argc, char *argv[], char **envp)
char *bmark;
char *url;
char *title;
+ char *charset;
char *sent_cookie;
p = getenv("REQUEST_METHOD");
@@ -224,12 +225,13 @@ main(int argc, char *argv[], char **envp)
bmark = expandPath(tag_get_value(cgiarg, "bmark"));
url = tag_get_value(cgiarg, "url");
title = tag_get_value(cgiarg, "title");
+ charset = tag_get_value(cgiarg, "charset");
if (bmark == NULL || url == NULL)
goto request_err;
if (mode && !strcmp(mode, "panel")) {
if (title == NULL)
title = "";
- print_bookmark_panel(bmark, url, title);
+ print_bookmark_panel(bmark, url, title, charset);
}
else if (mode && !strcmp(mode, "register")) {
printf("Content-Type: text/plain\n");
diff --git a/w3mimg/fb/fb_gdkpixbuf.c b/w3mimg/fb/fb_gdkpixbuf.c
index e615da6..36e3b62 100644
--- a/w3mimg/fb/fb_gdkpixbuf.c
+++ b/w3mimg/fb/fb_gdkpixbuf.c
@@ -1,17 +1,51 @@
-/* $Id: fb_gdkpixbuf.c,v 1.16 2003/06/13 15:03:35 ukai Exp $ */
+/* $Id: fb_gdkpixbuf.c,v 1.21 2004/11/08 17:14:06 ukai Exp $ */
/**************************************************************************
fb_gdkpixbuf.c 0.3 Copyright (C) 2002, hito
**************************************************************************/
+#include "config.h"
+#if defined(USE_GTK2)
+#include <glib-object.h>
+#include <gdk/gdk.h>
+#endif
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "fb.h"
#include "fb_img.h"
-static void draw(FB_IMAGE * img, int bg, int x, int y, int w, int h,
+static void draw(FB_IMAGE * img, int x, int y, int w, int h,
GdkPixbuf * pixbuf);
static GdkPixbuf *resize_image(GdkPixbuf * pixbuf, int width, int height);
-static void
+#if defined(USE_GTK2)
+static int
+get_animation_size(GdkPixbufAnimation * animation, int *w, int *h, int *delay)
+{
+ GdkPixbufAnimationIter *iter;
+ int n, i, d = -1;
+ GTimeVal time;
+
+ g_get_current_time(&time);
+ iter = gdk_pixbuf_animation_get_iter(animation, &time);
+ *w = gdk_pixbuf_animation_get_width(animation);
+ *h = gdk_pixbuf_animation_get_height(animation);
+ for (i = 1;
+ gdk_pixbuf_animation_iter_on_currently_loading_frame(iter) != TRUE;
+ i++) {
+ int tmp;
+ tmp = gdk_pixbuf_animation_iter_get_delay_time(iter);
+ g_time_val_add(&time, tmp * 1000);
+ if (tmp > d)
+ d = tmp;
+ gdk_pixbuf_animation_iter_advance(iter, &time);
+ }
+ if (delay)
+ *delay = d;
+ n = i;
+ g_object_unref(G_OBJECT(iter));
+ return n;
+}
+#else
+static int
get_animation_size(GdkPixbufAnimation * animation, int *w, int *h, int *delay)
{
GList *frames;
@@ -42,6 +76,16 @@ get_animation_size(GdkPixbufAnimation * animation, int *w, int *h, int *delay)
}
if (delay)
*delay = d;
+ return n;
+}
+#endif
+
+void
+fb_image_init()
+{
+#if defined(USE_GTK2)
+ g_type_init();
+#endif
}
int
@@ -50,11 +94,19 @@ get_image_size(char *filename, int *w, int *h)
GdkPixbufAnimation *animation;
if (filename == NULL)
return 1;
+#if defined(USE_GTK2)
+ animation = gdk_pixbuf_animation_new_from_file(filename, NULL);
+#else
animation = gdk_pixbuf_animation_new_from_file(filename);
+#endif
if (animation == NULL)
return 1;
get_animation_size(animation, w, h, NULL);
+#if defined(USE_GTK2)
+ g_object_unref(G_OBJECT(animation));
+#else
gdk_pixbuf_animation_unref(animation);
+#endif
return 0;
}
@@ -62,19 +114,27 @@ FB_IMAGE **
fb_image_load(char *filename, int w, int h, int max_anim)
{
GdkPixbufAnimation *animation;
+#if defined(USE_GTK2)
+ GdkPixbufAnimationIter *iter;
+ GTimeVal time;
+#else
+ int i;
GList *frames;
+#endif
double ratio_w, ratio_h;
- int n, i, j, fw, fh, frame_num, delay;
+ int n, j, fw, fh, frame_num, delay;
FB_IMAGE **fb_frame = NULL, *tmp_image = NULL;
if (filename == NULL)
return NULL;
+#if defined(USE_GTK2)
+ animation = gdk_pixbuf_animation_new_from_file(filename, NULL);
+#else
animation = gdk_pixbuf_animation_new_from_file(filename);
+#endif
if (animation == NULL)
return NULL;
- frames = gdk_pixbuf_animation_get_frames(animation);
- get_animation_size(animation, &fw, &fh, &delay);
- frame_num = n = gdk_pixbuf_animation_get_num_frames(animation);
+ frame_num = n = get_animation_size(animation, &fw, &fh, &delay);
if (delay <= 0)
max_anim = -1;
if (max_anim < 0) {
@@ -108,6 +168,34 @@ fb_image_load(char *filename, int w, int h, int max_anim)
fb_image_fill(tmp_image, bg_r, bg_g, bg_b);
}
+#if defined(USE_GTK2)
+ g_get_current_time(&time);
+ iter = gdk_pixbuf_animation_get_iter(animation, &time);
+
+ if (max_anim < 0 && n > -max_anim) {
+ max_anim = n + max_anim;
+ for (j = 0; j < max_anim; j++) {
+ g_time_val_add(&time,
+ gdk_pixbuf_animation_iter_get_delay_time(iter) * 1000);
+ gdk_pixbuf_animation_iter_advance(iter, &time);
+ }
+ }
+ for (j = 0; j < n; j++) {
+ GdkPixbuf *org_pixbuf, *pixbuf;
+
+ org_pixbuf = gdk_pixbuf_animation_iter_get_pixbuf(iter);
+ pixbuf = resize_image(org_pixbuf, w, h);
+
+ fb_frame[j]->delay = gdk_pixbuf_animation_iter_get_delay_time(iter);
+ g_time_val_add(&time, fb_frame[j]->delay * 1000);
+ draw(fb_frame[j], 0, 0, w, h, pixbuf);
+ if (org_pixbuf != pixbuf)
+ g_object_unref(G_OBJECT(pixbuf));
+ gdk_pixbuf_animation_iter_advance(iter, &time);
+ }
+#else
+ frames = gdk_pixbuf_animation_get_frames(animation);
+
for (j = 0; j < n; j++) {
GdkPixbufFrame *frame;
GdkPixbuf *org_pixbuf, *pixbuf;
@@ -139,13 +227,14 @@ fb_image_load(char *filename, int w, int h, int max_anim)
fb_frame[i]->delay = gdk_pixbuf_frame_get_delay_time(frame);
fb_image_copy(fb_frame[i], tmp_image);
- draw(fb_frame[i], !i, ofstx, ofsty, width, height, pixbuf);
+ draw(fb_frame[i], ofstx, ofsty, width, height, pixbuf);
switch (gdk_pixbuf_frame_get_action(frame)) {
case GDK_PIXBUF_FRAME_RETAIN:
fb_image_copy(tmp_image, fb_frame[i]);
break;
case GDK_PIXBUF_FRAME_DISPOSE:
+ fb_image_fill(tmp_image, bg_r, bg_g, bg_b);
break;
case GDK_PIXBUF_FRAME_REVERT:
fb_image_copy(tmp_image, fb_frame[0]);
@@ -157,14 +246,19 @@ fb_image_load(char *filename, int w, int h, int max_anim)
if (org_pixbuf != pixbuf)
gdk_pixbuf_finalize(pixbuf);
}
+#endif
END:
if (tmp_image)
fb_image_free(tmp_image);
+#if defined(USE_GTK2)
+ g_object_unref(G_OBJECT(animation));
+#else
gdk_pixbuf_animation_unref(animation);
+#endif
return fb_frame;
}
static void
-draw(FB_IMAGE * img, int bg, int x, int y, int w, int h, GdkPixbuf * pixbuf)
+draw(FB_IMAGE * img, int x, int y, int w, int h, GdkPixbuf * pixbuf)
{
int i, j, r, g, b, offset, bpp, rowstride;
guchar *pixels;
diff --git a/w3mimg/fb/fb_img.h b/w3mimg/fb/fb_img.h
index cd1301b..acdb5a0 100644
--- a/w3mimg/fb/fb_img.h
+++ b/w3mimg/fb/fb_img.h
@@ -1,8 +1,9 @@
-/* $Id: fb_img.h,v 1.8 2003/07/09 15:07:11 ukai Exp $ */
+/* $Id: fb_img.h,v 1.9 2004/08/04 17:32:28 ukai Exp $ */
#ifndef fb_img_header
#define fb_img_header
#include "fb.h"
+void fb_image_init();
FB_IMAGE **fb_image_load(char *filename, int w, int h, int n);
void fb_image_set_bg(int r, int g, int b);
int fb_image_clear(int x, int y, int w, int h);
diff --git a/w3mimg/fb/fb_imlib2.c b/w3mimg/fb/fb_imlib2.c
index 972f06e..ea36637 100644
--- a/w3mimg/fb/fb_imlib2.c
+++ b/w3mimg/fb/fb_imlib2.c
@@ -1,4 +1,4 @@
-/* $Id: fb_imlib2.c,v 1.9 2003/03/24 15:45:59 ukai Exp $ */
+/* $Id: fb_imlib2.c,v 1.10 2004/08/04 17:32:28 ukai Exp $ */
/**************************************************************************
fb_imlib2.c 0.3 Copyright (C) 2002, hito
**************************************************************************/
@@ -11,6 +11,12 @@
static void draw(FB_IMAGE * img, Imlib_Image image);
static Imlib_Image resize_image(Imlib_Image image, int width, int height);
+void
+fb_image_init()
+{
+ return;
+}
+
int
get_image_size(char *filename, int *w, int *h)
{
diff --git a/w3mimg/fb/fb_w3mimg.c b/w3mimg/fb/fb_w3mimg.c
index b67bad1..d3ae5a9 100644
--- a/w3mimg/fb/fb_w3mimg.c
+++ b/w3mimg/fb/fb_w3mimg.c
@@ -1,4 +1,4 @@
-/* $Id: fb_w3mimg.c,v 1.13 2003/08/29 15:06:52 ukai Exp $ */
+/* $Id: fb_w3mimg.c,v 1.14 2004/08/04 17:32:28 ukai Exp $ */
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
@@ -17,6 +17,7 @@ w3mfb_init(w3mimg_op * self)
{
if (self == NULL)
return 0;
+ /* XXX */
return 1;
}
@@ -195,6 +196,9 @@ w3mimg_fbopen()
wop->free_image = w3mfb_free_image;
wop->get_image_size = w3mfb_get_image_size;
+ /* XXX */
+ fb_image_init();
+
return wop;
error:
free(wop);
diff --git a/w3mimg/x11/x11_w3mimg.c b/w3mimg/x11/x11_w3mimg.c
index 8c9cef2..f5be4a8 100644
--- a/w3mimg/x11/x11_w3mimg.c
+++ b/w3mimg/x11/x11_w3mimg.c
@@ -1,6 +1,7 @@
-/* $Id: x11_w3mimg.c,v 1.25 2003/07/13 16:19:10 ukai Exp $ */
+/* $Id: x11_w3mimg.c,v 1.29 2004/11/08 17:14:06 ukai Exp $ */
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <ctype.h>
#include "config.h"
@@ -11,7 +12,13 @@
#include <X11/Xutil.h>
#include <Imlib2.h>
#elif defined(USE_GDKPIXBUF)
+#if defined(USE_GTK2)
+#include <glib-object.h>
+#include <gdk/gdk.h>
+#include <gdk-pixbuf-xlib/gdk-pixbuf-xlib.h>
+#else
#include <gdk-pixbuf/gdk-pixbuf-xlib.h>
+#endif
#else
#error no Imlib and GdkPixbuf support
#endif
@@ -42,7 +49,36 @@ struct x11_image {
Pixmap *pixmap;
};
-static void
+#if defined(USE_GTK2)
+static int
+get_animation_size(GdkPixbufAnimation * animation, int *w, int *h, int *delay)
+{
+ GdkPixbufAnimationIter *iter;
+ int n, i, d = -1;
+ GTimeVal time;
+
+ g_get_current_time(&time);
+ iter = gdk_pixbuf_animation_get_iter(animation, &time);
+ *w = gdk_pixbuf_animation_get_width(animation);
+ *h = gdk_pixbuf_animation_get_height(animation);
+ for (i = 1;
+ gdk_pixbuf_animation_iter_on_currently_loading_frame(iter) != TRUE;
+ i++) {
+ int tmp;
+ tmp = gdk_pixbuf_animation_iter_get_delay_time(iter);
+ g_time_val_add(&time, tmp * 1000);
+ if (tmp > d)
+ d = tmp;
+ gdk_pixbuf_animation_iter_advance(iter, &time);
+ }
+ if (delay)
+ *delay = d;
+ g_object_unref(G_OBJECT(iter));
+ n = i;
+ return n;
+}
+#else
+static int
get_animation_size(GdkPixbufAnimation * animation, int *w, int *h, int *delay)
{
GList *frames;
@@ -73,8 +109,9 @@ get_animation_size(GdkPixbufAnimation * animation, int *w, int *h, int *delay)
}
if (delay)
*delay = d;
+ return n;
}
-
+#endif
#endif
static int
@@ -94,6 +131,9 @@ x11_init(w3mimg_op * self)
}
#elif defined(USE_GDKPIXBUF)
if (!xi->init_flag) {
+#if defined(USE_GTK2)
+ g_type_init();
+#endif
gdk_pixbuf_xlib_init(xi->display, 0);
xi->init_flag = TRUE;
}
@@ -290,11 +330,17 @@ x11_load_image(w3mimg_op * self, W3MImage * img, char *fname, int w, int h)
Imlib_Image im;
#elif defined(USE_GDKPIXBUF)
GdkPixbufAnimation *animation;
- GList *frames;
- int i, j, iw, ih, n, frame_num, delay, max_anim;
+ int j, iw, ih, n, frame_num, delay = -1, max_anim;
double ratio_w, ratio_h;
struct x11_image *ximg;
Pixmap tmp_pixmap;
+#if defined(USE_GTK2)
+ GdkPixbufAnimationIter *iter;
+ GTimeVal time;
+#else
+ int i;
+ GList *frames;
+#endif
#endif
if (self == NULL)
@@ -342,13 +388,14 @@ x11_load_image(w3mimg_op * self, W3MImage * img, char *fname, int w, int h)
imlib_free_image();
#elif defined(USE_GDKPIXBUF)
max_anim = self->max_anim;
+#if defined(USE_GTK2)
+ animation = gdk_pixbuf_animation_new_from_file(fname, NULL);
+#else
animation = gdk_pixbuf_animation_new_from_file(fname);
+#endif
if (!animation)
return 0;
- frames = gdk_pixbuf_animation_get_frames(animation);
- frame_num = n = gdk_pixbuf_animation_get_num_frames(animation);
-
- get_animation_size(animation, &iw, &ih, &delay);
+ frame_num = n = get_animation_size(animation, &iw, &ih, &delay);
if (delay <= 0)
max_anim = -1;
@@ -370,17 +417,64 @@ x11_load_image(w3mimg_op * self, W3MImage * img, char *fname, int w, int h)
}
tmp_pixmap = XCreatePixmap(xi->display, xi->parent, w, h,
DefaultDepth(xi->display, 0));
+ XSetForeground(xi->display, xi->imageGC, xi->background_pixel);
XFillRectangle(xi->display, (Pixmap) tmp_pixmap, xi->imageGC, 0, 0, w, h);
if (!tmp_pixmap) {
+#if defined(USE_GTK2)
+ g_object_unref(G_OBJECT(animation));
+#else
gdk_pixbuf_animation_unref(animation);
+#endif
return 0;
}
ximg = x11_img_new(xi, w, h, frame_num);
if (!ximg) {
XFreePixmap(xi->display, tmp_pixmap);
+#if defined(USE_GTK2)
+ g_object_unref(G_OBJECT(animation));
+#else
gdk_pixbuf_animation_unref(animation);
+#endif
return 0;
}
+#if defined(USE_GTK2)
+ g_get_current_time(&time);
+ iter = gdk_pixbuf_animation_get_iter(animation, &time);
+
+ if (max_anim < 0 && n > -max_anim) {
+ max_anim = n + max_anim;
+ for (j = 0; j < max_anim; j++) {
+ delay = gdk_pixbuf_animation_iter_get_delay_time(iter);
+ g_time_val_add(&time, delay * 1000);
+ gdk_pixbuf_animation_iter_advance(iter, &time);
+ }
+ }
+ for (j = 0; j < frame_num; j++) {
+ GdkPixbuf *org_pixbuf, *pixbuf;
+
+ org_pixbuf = gdk_pixbuf_animation_iter_get_pixbuf(iter);
+ delay = gdk_pixbuf_animation_iter_get_delay_time(iter);
+ pixbuf = resize_image(org_pixbuf, w, h);
+
+ if (delay > ximg->delay)
+ ximg->delay = delay;
+
+ gdk_pixbuf_xlib_render_to_drawable_alpha(pixbuf,
+ (Drawable) ximg->pixmap[j], 0,
+ 0, 0, 0, w, h,
+ GDK_PIXBUF_ALPHA_BILEVEL, 1,
+ XLIB_RGB_DITHER_NORMAL, 0, 0);
+ if (org_pixbuf != pixbuf)
+ g_object_unref(G_OBJECT(pixbuf));
+ g_time_val_add(&time, delay * 1000);
+ gdk_pixbuf_animation_iter_advance(iter, &time);
+ }
+ XFreePixmap(xi->display, tmp_pixmap);
+ g_object_unref(G_OBJECT(animation));
+
+#else
+ frames = gdk_pixbuf_animation_get_frames(animation);
+
for (j = 0; j < n; j++) {
GdkPixbufFrame *frame;
GdkPixbuf *org_pixbuf, *pixbuf;
@@ -430,6 +524,9 @@ x11_load_image(w3mimg_op * self, W3MImage * img, char *fname, int w, int h)
xi->imageGC, 0, 0, w, h, 0, 0);
break;
case GDK_PIXBUF_FRAME_DISPOSE:
+ XSetForeground(xi->display, xi->imageGC, xi->background_pixel);
+ XFillRectangle(xi->display, tmp_pixmap, xi->imageGC,
+ 0, 0, w, h);
break;
case GDK_PIXBUF_FRAME_REVERT:
XCopyArea(xi->display, ximg->pixmap[0], tmp_pixmap,
@@ -448,6 +545,7 @@ x11_load_image(w3mimg_op * self, W3MImage * img, char *fname, int w, int h)
}
XFreePixmap(xi->display, tmp_pixmap);
gdk_pixbuf_animation_unref(animation);
+#endif
img->pixmap = ximg;
#endif
@@ -577,13 +675,21 @@ x11_get_image_size(w3mimg_op * self, W3MImage * img, char *fname, int *w,
*h = imlib_image_get_height();
imlib_free_image();
#elif defined(USE_GDKPIXBUF)
+#if defined(USE_GTK2)
+ animation = gdk_pixbuf_animation_new_from_file(fname, NULL);
+#else
animation = gdk_pixbuf_animation_new_from_file(fname);
+#endif
if (!animation)
return 0;
get_animation_size(animation, w, h, NULL);
+#if defined(USE_GTK2)
+ g_object_unref(G_OBJECT(animation));
+#else
gdk_pixbuf_animation_unref(animation);
#endif
+#endif
return 1;
}