1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-25 01:05:37 +00:00

Merge branch 'elinks-0.12' into elinks-0.13

Conflicts:

	configure.in
	src/protocol/http/http.c
This commit is contained in:
Kalle Olavi Niemitalo 2008-02-24 22:49:47 +02:00 committed by Kalle Olavi Niemitalo
commit 3c861fd530
30 changed files with 690 additions and 1359 deletions

23
NEWS
View File

@ -29,7 +29,7 @@ To be released as ELinks 0.12.0.
//////////////////////////////////////////////////////////////////////
This list now contains all the important changes from ELinks 0.11.0 to
ELinks 0.12.GIT (054852ae234342765ab69da0eb95a18f96bd6028) and related
ELinks 0.12.GIT (4672bad9c73321019c1a2a7695761b8188bd1a8f) and related
bug numbers. Each section is sorted by severity and grouped by topic.
The list no doubt includes several changes that are not really
@ -80,12 +80,13 @@ Miscellaneous:
* critical bug 869: long mailcap entry buffer overflow (non-security)
when downloading
* tabs opened by -remote now go behind existing dialogs
* major bug 534, enhancement 517: fix HTTP gzip and bzip2
decompression, and add deflate and LZMA (requires LZMA Utils)
* major bug 503: various fixes in parsing and updating of elinks.conf
* Debian bug 257762: turn terminal transparency off by default
* bug 724: better parsing of escape sequences and control
sequences from the terminal
* bug 948: fix wrong UTF-8 output after the charset menu was used
* gzip_read: always call gzclearerr
* bug 816: convert entity references in input/@value only once
* bug 916: if a mailcap entry has no %s, provide the file as stdin
* bug 744: don't change ``//'' to ``/'' in URIs
@ -97,8 +98,6 @@ Miscellaneous:
reloaded. See elinks-users mail from 28 Oct 2005.
* several accesskey fixes
* in Lua: don't write to the string returned by lua_tostring
* minor bug 54, Debian bug 338402: don't force the terminal to 8 bits
with no parity, and don't disable XON/OFF flow control either
* minor bug 972: preserve the background color and underlining in
spaces when justifying
* minor bug 284: render closing bracket for HTML element SUB in the
@ -112,8 +111,6 @@ Miscellaneous:
itself acts as a pager
* enhancement 790: If-Modified-Since and If-None-Match
* enhancement: HTTP negotiate-auth using GSSAPI
* enhancement 517: fixed and enabled HTTP bzip2 decompression
* enhancement: LZMA decompression
* enhancement: FSP progress indicator and password prompt
* enhancement: autocreate directories needed to download a file
* enhancement: ``Add server'' button in the cookie manager
@ -148,10 +145,11 @@ Miscellaneous:
Build system and compile-time errors (ignore if you don't build ELinks):
* serious Debian bug 464384: fix warnings in alignof, ssl_connect, and
printing of off_t values
* bug 725: fix version checking for Ruby in 'configure'
* enhancement: if make -k was used and a sub-Make fails, build the
rest before propagating
* enhancement: avoid compilation of vernum.c in 'make install'
* enhancement: make uninstall
* experimental enhancements: --with-python=DIRECTORY, --with-gc=DIRECTORY
* experimental enhancement: Win32 port (build with MinGW MSYS)
@ -260,6 +258,7 @@ have already been considered.
earlier versions.
- fix compilation under gcc 4.x. Backported from gentoo portage.
Commit bcabd8b7951f3319199811088e607501296ee573 in ELinks 0.11.3.
- enhancement: avoid compilation of vernum.c in 'make install'
* Reverted changes:
- (new feature) document.write, reverted in
2c087e52e74528a720621186b91880463e039d50
@ -312,8 +311,8 @@ have already been considered.
* Really retry forever when connection.retries = 0
//////////////////////////////////////////////////////////////////////
ELinks 0.11.3.GIT now:
----------------------
ELinks 0.11.4rc0.GIT now:
-------------------------
To be released as 0.11.4.
@ -335,16 +334,22 @@ To be released as 0.11.4.
hostname
* bug 712: GnuTLS works on https://www-s.uiuc.edu/[]
* fix active and passive FTP over IPv6
* bug 938: elinks -remote no longer needs a controlling tty
* bug 978: Python's webbrowser.open_new_tab(URL) works since now
* minor bug 54, Debian bug 338402: don't force the terminal to 8 bits
with no parity, and don't disable XON/XOFF flow control either
* minor bug 951 in user SMJS: garbage-collect SMJS objects on 'File ->
Flush all caches' to work around their holding cache entries busy
* minor bug 396: never show empty filename in the what-to-do dialog
* minor bug 461: ensure contrast in blank areas, to keep the cursor visible
* minor bug 928: properly display no-break spaces in a UTF-8 document
if the terminal uses some other charset
* minor bug 987: English spelling and grammar corrections
* minor: don't assume sizeof(int)==4 in bittorrent
* trivial bug 947: document.html.wrap_nbsp also affects text in tables
* trivial bug 997: fix unlikely stack corruption in active FTP
* build bug 1002: fix ``comparison is always true due to limited range
of data type'' warning on PowerPC and s390
* build bug 950: fix ``config/install-sh: No such file or directory''
on SunOS
* build bug 936: fix errors about undefined off_t (autoheader

View File

@ -1,5 +1,10 @@
dnl Process this file with autoconf to produce a configure script.
dnl There are two types of comments in this file.
dnl Comments that refer to Autoconf macros begin with "dnl", and m4
dnl discards them. Other comments begin with "#", and they get copied
dnl to the configure script, hopefully making it easier to read.
dnl Autoconf 2.13 generates an incomplete config.h.in; see ELinks bug 936.
dnl Autoconf 2.59 is installed in the computer that generates our nightly
dnl snapshots, so we need to be compatible with that.
@ -37,18 +42,18 @@ if test -e Makefile.config; then
AC_MSG_RESULT(done)
fi
dnl ===================================================================
dnl Load feature configuration file and start logging features.
dnl ===================================================================
# ===================================================================
# Load feature configuration file and start logging features.
# ===================================================================
features="features.conf"
AC_CHECK_FILE("$srcdir/$features", [ . $srcdir/$features ])
AC_CHECK_FILE("$builddir/$features", [ . $builddir/$features ])
echo "Feature summary:" > features.log
dnl ===================================================================
dnl Checks for programs.
dnl ===================================================================
# ===================================================================
# Checks for programs.
# ===================================================================
AC_PROG_CC
AC_PROG_AWK
@ -116,17 +121,17 @@ EL_CONFIG_DEPENDS(CONFIG_MANUAL, [MANUAL_ASCIIDOC MANUAL_XMLTO MANUAL_JW], [Manu
EL_CONFIG_DEPENDS(CONFIG_MANPAGE, [MAN_ASCIIDOC MAN_XMLTO], [Man Page Formats])
EL_CONFIG_DEPENDS(CONFIG_APIDOCS, [CONFIG_DOXYGEN], [API Documentation])
dnl gcc specific options (to be continued at the bottom of configure)
# gcc specific options (to be continued at the bottom of configure)
if test "x$ac_cv_c_compiler_gnu" = "xyes"; then
dnl We want to see all warnings and live with none.
dnl We can't set up -Werror here as there may be some warnings in test
dnl suite of configure, and we don't want to fail them.
# We want to see all warnings and live with none.
# We can't set up -Werror here as there may be some warnings in test
# suite of configure, and we don't want to fail them.
CFLAGS="$CFLAGS -Wall"
fi
dnl ===================================================================
dnl Checks for special OSes.
dnl ===================================================================
# ===================================================================
# Checks for special OSes.
# ===================================================================
dnl EL_CHECK_COMPILER_MACRO(define, name, flagname)
AC_DEFUN([EL_CHECK_COMPILER_MACROS],
@ -172,9 +177,9 @@ fi
AC_MSG_RESULT($CONFIG_OS_UNIX)
AC_SUBST(CONFIG_OS_UNIX)
dnl ===================================================================
dnl Checks for header files.
dnl ===================================================================
# ===================================================================
# Checks for header files.
# ===================================================================
AC_HEADER_DIRENT
AC_HEADER_STDC
@ -208,9 +213,9 @@ AC_CHECK_HEADERS(sys/un.h,
[CONFIG_INTERLINK=no])
AC_SUBST(CONFIG_INTERLINK)
dnl ===================================================================
dnl Checks for typedefs, structures, and compiler characteristics.
dnl ===================================================================
# ===================================================================
# Checks for typedefs, structures, and compiler characteristics.
# ===================================================================
AC_STRUCT_TM
AC_C_CONST
@ -234,41 +239,41 @@ AC_CHECK_SIZEOF(long, 4)
test "x$HAVE_LONG_LONG" = xyes && AC_CHECK_SIZEOF(long long, 8)
test "x$HAVE_OFF_T" = xyes && AC_CHECK_SIZEOF(off_t, 4)
dnl Check for variadic macros
# Check for variadic macros
EL_CHECK_CODE([variadic macros], HAVE_VARIADIC_MACROS,
[#include <stdio.h>
#define a(b,c...) printf(b,##c)],
[a("foo");a("%s","bar");a("%s%s","baz","quux");])
dnl Check for -rdynamic
dnl
dnl gcc -rdynamic calls ld -export-dynamic, which adds all symbols of
dnl the executable to its dynamic symbol table. ELinks uses this for
dnl two purposes:
dnl
dnl 1. If ELinks detects a bug, it can try to display a backtrace by
dnl calling backtrace_symbols_fd() in the GNU libc. The glibc-2.3.6
dnl manual states users of GNU ld must pass -rdynamic to make the
dnl symbols available to the program.
dnl
dnl 2. It would eventually be nice to dynamically load shared
dnl libraries as plugins (bug 73). The plugins must be able to
dnl call ELinks functions. This can be implemented either by
dnl registering all callable functions in ELinks-specific data
dnl structures, or by letting the dynamic linker handle them.
dnl The latter way requires something equivalent to -rdynamic.
dnl
dnl Because backtraces are not needed for correct operation, and bug
dnl 73 is not yet being fixed, the configure script and makefiles
dnl should not complain to the user if they find that -rdynamic does
dnl not work. Besides, it was reported at elinks-users on 2006-09-12
dnl that gcc-3.4.2 with "ld: Software Generation Utilities - Solaris
dnl Link Editors: 5.8-1.284" on Sun Solaris 8 Sparc does not support
dnl -rdynamic but does something equivalent automatically. (This was
dnl tested with "nm -D elinks | grep redraw_from_window".)
dnl
dnl FIXME: This check doesn't work. Something to do with the compiler
dnl happily ignoring it and stderr not being checked for error messages.
# Check for -rdynamic
#
# gcc -rdynamic calls ld -export-dynamic, which adds all symbols of
# the executable to its dynamic symbol table. ELinks uses this for
# two purposes:
#
# 1. If ELinks detects a bug, it can try to display a backtrace by
# calling backtrace_symbols_fd() in the GNU libc. The glibc-2.3.6
# manual states users of GNU ld must pass -rdynamic to make the
# symbols available to the program.
#
# 2. It would eventually be nice to dynamically load shared
# libraries as plugins (bug 73). The plugins must be able to
# call ELinks functions. This can be implemented either by
# registering all callable functions in ELinks-specific data
# structures, or by letting the dynamic linker handle them.
# The latter way requires something equivalent to -rdynamic.
#
# Because backtraces are not needed for correct operation, and bug
# 73 is not yet being fixed, the configure script and makefiles
# should not complain to the user if they find that -rdynamic does
# not work. Besides, it was reported at elinks-users on 2006-09-12
# that gcc-3.4.2 with "ld: Software Generation Utilities - Solaris
# Link Editors: 5.8-1.284" on Sun Solaris 8 Sparc does not support
# -rdynamic but does something equivalent automatically. (This was
# tested with "nm -D elinks | grep redraw_from_window".)
#
# FIXME: This check doesn't work. Something to do with the compiler
# happily ignoring it and stderr not being checked for error messages.
AC_MSG_CHECKING([for -rdynamic])
LDFLAGS_X="$LDFLAGS"
LDFLAGS="$LDFLAGS -rdynamic"
@ -276,15 +281,15 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[have_rdynamic=yes],[have_rdynamic=
test "$have_rdynamic" = no && LDFLAGS="$LDFLAGS_X"
AC_MSG_RESULT($have_rdynamic)
dnl ===================================================================
dnl Check for POSIX <regex.h>
dnl ===================================================================
# ===================================================================
# Check for POSIX <regex.h>
# ===================================================================
EL_CHECK_SYS_TYPE(regex_t, HAVE_REGEX_H, [#include <regex.h>])
dnl ===================================================================
dnl Checks for library functions.
dnl ===================================================================
# ===================================================================
# Checks for library functions.
# ===================================================================
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MEMCMP
@ -307,9 +312,9 @@ AC_CHECK_FUNCS(geteuid, HAVE_GETEUID=yes)
AC_CHECK_FUNCS(wcwidth, HAVE_WCWIDTH=yes)
dnl These aren't probably needed now, as they are commented in links.h.
dnl I've no idea about their historical background, but I keep them here
dnl just in the case they will help later. --pasky
# These aren't probably needed now, as they are commented in links.h.
# I've no idea about their historical background, but I keep them here
# just in the case they will help later. --pasky
AC_CHECK_FUNCS(getpid, HAVE_GETPID=yes)
AC_CHECK_FUNCS(setpgid getpgid setpgrp getpgrp)
AC_CHECK_FUNCS(raise, HAVE_RAISE=yes)
@ -373,13 +378,13 @@ if test x"$el_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
EL_DEFINE(HAVE_C99_VSNPRINTF, [C99 compliant vsnprintf()])
fi
AC_CHECK_LIB(dl, dlopen) # OpenSSL and Lua frequently needs it
# OpenSSL and Lua frequently need dlopen
AC_CHECK_LIB(dl, dlopen)
dnl ===================================================================
dnl Checks for libraries.
dnl ===================================================================
# ===================================================================
# Checks for libraries.
# ===================================================================
dnl Replace `main' with a function in -lsocket:
AC_CHECK_FUNC(socket, cf_result=yes, cf_result=no)
if test "$cf_result" = no; then
AC_CHECK_LIB(socket, socket)
@ -400,18 +405,18 @@ if test "$cf_result" = no; then
fi
fi
dnl ===================================================================
dnl Checks for packaging specific options.
dnl ===================================================================
# ===================================================================
# Checks for packaging specific options.
# ===================================================================
AC_ARG_WITH(xterm, [ --with-xterm how to invoke the X terminal emulator],
[ if test "$withval" != no && test "$withval" != yes; then
AC_DEFINE_UNQUOTED(XTERM, "$withval", [How to invoke XTerm])
fi ])
dnl ===================================================================
dnl Checks for a libraries, optional even if installed.
dnl ===================================================================
# ===================================================================
# Checks for a libraries, optional even if installed.
# ===================================================================
dnl EL_CHECK_OPTIONAL_LIBRARY(define, name, header, lib, function)
AC_DEFUN([EL_CHECK_OPTIONAL_LIBRARY],
@ -477,6 +482,11 @@ AC_DEFUN([EL_CONFIG_OPTIONAL_LIBRARY],
EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_GPM, gpm, gpm.h, gpm, Gpm_Open,
[ --without-gpm disable gpm (mouse) support])
# ELinks calls deflateInit2 with windowBits = MAX_WBITS | 32, to
# enable automatic decoding of both zlib and gzip headers. This
# feature was added in zlib 1.2.0.2; earlier versions return an error.
# The gzclearerr function was also added in zlib 1.2.0.2, so check for
# that, even though ELinks does not actually call gzclearerr.
EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_GZIP, zlib, zlib.h, z, gzclearerr,
[ --without-zlib disable zlib support])
@ -491,12 +501,12 @@ if test "x{with_gc}" != xno; then
[ --with-gc enable Boehm's garbage collector])
fi
EL_ARG_ENABLE(CONFIG_LZMA, lzma, [lzma],
[ --enable-lzma enable lzma encoding support])
EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_LZMA, lzma, lzma.h, lzma, lzma_code,
[ --without-lzma disable lzma encoding support])
dnl ===================================================================
dnl Check for GSSAPI, optional even if installed.
dnl ===================================================================
# ===================================================================
# Check for GSSAPI, optional even if installed.
# ===================================================================
enable_gssapi="no";
@ -518,9 +528,9 @@ fi
AC_SUBST(CONFIG_GSSAPI)
dnl ===================================================================
dnl Bookmark and XBEL support
dnl ===================================================================
# ===================================================================
# Bookmark and XBEL support
# ===================================================================
EL_SAVE_FLAGS
@ -548,34 +558,34 @@ if test "$CONFIG_XBEL_BOOKMARKS" != yes; then
EL_RESTORE_FLAGS
fi
dnl ===================================================================
dnl Checks for BSD sysmouse
dnl ===================================================================
# ===================================================================
# Checks for BSD sysmouse
# ===================================================================
HAVE_SYSMOUSE_HEADER="no"
# Either of these header files provides the (same) sysmouse interface
AC_CHECK_HEADERS(sys/consio.h machine/console.h, [HAVE_SYSMOUSE_HEADER="yes"])
dnl ===================================================================
dnl Checks for OS/2
dnl ===================================================================
# ===================================================================
# Checks for OS/2
# ===================================================================
if test "$CONFIG_OS_OS2" = yes; then
EL_CONFIG_OS_OS2
fi
dnl ===================================================================
dnl Checks for Win32
dnl ===================================================================
# ===================================================================
# Checks for Win32
# ===================================================================
if test "$CONFIG_OS_WIN32" = yes; then
EL_CONFIG_OS_WIN32
fi
dnl ===================================================================
dnl Check for SEE (Simple Ecmascript Engine)
dnl ===================================================================
# ===================================================================
# Check for SEE (Simple Ecmascript Engine)
# ===================================================================
AC_ARG_WITH(see, [ --with-see enable Simple Ecmascript Engine (SEE) support],
[ if test "x$withval" != xno; then enable_see=yes; fi ])
@ -621,9 +631,9 @@ if test "$enable_see" = "yes"; then
fi
fi
dnl ===================================================================
dnl Check for SpiderMonkey, optional even if installed.
dnl ===================================================================
# ===================================================================
# Check for SpiderMonkey, optional even if installed.
# ===================================================================
AC_ARG_WITH(spidermonkey, [ --without-spidermonkey disable SpiderMonkey Mozilla JavaScript engine support],
[if test "$withval" = no; then disable_spidermonkey=yes; fi])
@ -672,9 +682,9 @@ AC_SUBST(CONFIG_ECMASCRIPT_SEE)
AC_SUBST(CONFIG_ECMASCRIPT_SMJS)
dnl ===================================================================
dnl Optional Spidermonkey-based ECMAScript browser scripting
dnl ===================================================================
# ===================================================================
# Optional Spidermonkey-based ECMAScript browser scripting
# ===================================================================
AC_ARG_ENABLE(sm-scripting,
[ --disable-sm-scripting ECMAScript browser scripting (requires Spidermonkey)],
@ -696,9 +706,9 @@ if test "x$CONFIG_ECMASCRIPT_SMJS" = xyes ||
AC_SUBST(CONFIG_SPIDERMONKEY)
fi
dnl ===================================================================
dnl Check for Guile, optional even if installed.
dnl ===================================================================
# ===================================================================
# Check for Guile, optional even if installed.
# ===================================================================
enable_guile="no";
@ -753,9 +763,9 @@ else
AC_MSG_RESULT(no);
fi
dnl ===================================================================
dnl Check for Perl
dnl ===================================================================
# ===================================================================
# Check for Perl
# ===================================================================
enable_perl="no";
AC_ARG_WITH(perl, [ --with-perl enable Perl support],
@ -810,9 +820,9 @@ else
AC_SUBST(PERL_CFLAGS)
fi
dnl ===================================================================
dnl Check for Python
dnl ===================================================================
# ===================================================================
# Check for Python
# ===================================================================
enable_python="no";
AC_ARG_WITH(python, [ --with-python=[DIR] enable Python support],
@ -871,12 +881,12 @@ else
fi
dnl ===================================================================
dnl Check for Lua, optional even if installed.
dnl ===================================================================
# ===================================================================
# Check for Lua, optional even if installed.
# ===================================================================
dnl Do this the long way, as FreeBSD reportedly needs -L<dir> for
dnl anything other than /usr/lib, and Lua is very often in /usr/local/lib.
# Do this the long way, as FreeBSD reportedly needs -L<dir> for
# anything other than /usr/lib, and Lua is very often in /usr/local/lib.
AC_ARG_WITH(lua, [ --without-lua disable Lua support],
[if test "$withval" = no; then disable_lua=yes; fi])
@ -890,7 +900,7 @@ if test -z "$disable_lua"; then
withval="";
fi
for luadir in "$withval" "" /usr /usr/local; do
for suffix in "" 50 51; do
for suffix in "" 50; do
if test "$cf_result" = no && ( test -f "$luadir/include/lua.h" || \
test -f "$luadir/include/lua$suffix/lua.h" ) ; then
LUA_LIBS="-L$luadir/lib -llua$suffix -llualib$suffix -lm"
@ -930,15 +940,15 @@ else
fi
dnl ===================================================================
dnl Check for Ruby, optional even if installed.
dnl ===================================================================
# ===================================================================
# Check for Ruby, optional even if installed.
# ===================================================================
EL_CONFIG_SCRIPTING_RUBY
dnl ===================================================================
dnl Setup global scripting
dnl ===================================================================
# ===================================================================
# Setup global scripting
# ===================================================================
EL_CONFIG_DEPENDS(CONFIG_SCRIPTING, [CONFIG_SCRIPTING_GUILE CONFIG_SCRIPTING_LUA CONFIG_SCRIPTING_PERL CONFIG_SCRIPTING_PYTHON CONFIG_SCRIPTING_RUBY CONFIG_SCRIPTING_SPIDERMONKEY], [Browser scripting])
AC_SUBST(CONFIG_SCRIPTING_GUILE)
@ -950,14 +960,14 @@ AC_SUBST(CONFIG_SCRIPTING_SPIDERMONKEY)
AC_SUBST(CONFIG_SCRIPTING)
dnl ===================================================================
dnl Check for SSL support.
dnl ===================================================================
# ===================================================================
# Check for SSL support.
# ===================================================================
dnl We by default use OpenSSL, and we always prefer it. However, when GNUTLS
dnl is enabled, we won't try to use OpenSSL anymore.
# We by default use OpenSSL, and we always prefer it. However, when GNUTLS
# is enabled, we won't try to use OpenSSL anymore.
dnl For wiping SSL hooks..
# For wiping SSL hooks..
#ifdef CONFIG_SSL
disable_openssl=""
@ -979,7 +989,7 @@ AC_ARG_WITH(openssl, [ --without-openssl disable OpenSSL support],
AC_ARG_WITH(openssl, [ --with-openssl[=DIR] enable OpenSSL support (default)])
openssl_withval="$withval"
dnl ---- OpenSSL
# ---- OpenSSL
AC_MSG_CHECKING([for OpenSSL])
@ -1030,7 +1040,7 @@ fi
AC_MSG_RESULT($cf_result)
CONFIG_GNUTLS_OPENSSL_COMPAT=no
dnl ---- GNU TLS
# ---- GNU TLS
dnl We can't have AC_MSG_CHECKING here, because AC_PATH_PROG prints its own and
dnl it looks ugly then.
@ -1095,7 +1105,7 @@ fi
AC_MSG_CHECKING([for GNU TLS (1.2 or later)])
AC_MSG_RESULT($cf_result)
dnl Final SSL setup
# Final SSL setup
EL_CONFIG_DEPENDS(CONFIG_SSL, [CONFIG_OPENSSL CONFIG_GNUTLS], [SSL])
AC_SUBST(CONFIG_GNUTLS_OPENSSL_COMPAT)
@ -1107,9 +1117,9 @@ AC_SUBST(CONFIG_GNUTLS)
AC_MSG_CHECKING([whether to be or not to be])
AC_MSG_RESULT([needs to be determined experimentally])
dnl ===================================================================
dnl Check for IPv6 support and related functions.
dnl ===================================================================
# ===================================================================
# Check for IPv6 support and related functions.
# ===================================================================
EL_CHECK_NET_TYPE(struct sockaddr_storage, HAVE_SA_STORAGE, [])
EL_CHECK_NET_TYPE(struct sockaddr_in6, HAVE_SA_IN6, [#include <netinet/in.h>])
@ -1124,9 +1134,9 @@ if test "$HAVE_GETADDRINFO" != yes; then
fi
dnl ===================================================================
dnl Checking for X11 (window title restoring).
dnl ===================================================================
# ===================================================================
# Checking for X11 (window title restoring).
# ===================================================================
AC_PATH_X
if test x"$no_x" != xyes; then
@ -1153,17 +1163,17 @@ if test x"$no_x" != xyes; then
fi
dnl ===================================================================
dnl Backtraces displaying support.
dnl ===================================================================
# ===================================================================
# Backtraces displaying support.
# ===================================================================
AC_CHECK_HEADERS(execinfo.h, HAVE_EXECINFO=yes, HAVE_EXECINFO=no)
# possible checks for other system-specific means go here
dnl ===================================================================
dnl Gettext grey zone. Beware.
dnl ===================================================================
# ===================================================================
# Gettext grey zone. Beware.
# ===================================================================
ALL_LINGUAS="af be bg ca cs da de el es et fi fr gl hr hu id is it lt nl nb pl pt pt_BR ro ru sk sr sv tr uk"
@ -1175,9 +1185,9 @@ dnl cf_result=$((48#z - 48#a + 1));
dnl AC_MSG_RESULT($cf_result)
dnl ===================================================================
dnl Compile-time features control
dnl ===================================================================
# ===================================================================
# Compile-time features control
# ===================================================================
EL_ARG_ENABLE(CONFIG_COOKIES, cookies, [Cookies],
[ --disable-cookies disable cookie support])
@ -1216,9 +1226,9 @@ EL_ARG_DEPEND(CONFIG_CGI, cgi, [HAVE_SETENV_OR_PUTENV:yes], [Local CGI],
EL_ARG_ENABLE(CONFIG_FINGER, finger, [Finger protocol],
[ --enable-finger enable finger protocol support])
dnl ===================================================================
dnl FSP protocol
dnl ===================================================================
# ===================================================================
# FSP protocol
# ===================================================================
EL_SAVE_FLAGS
if test "x${enable_fsp}" != xno; then
@ -1253,9 +1263,9 @@ EL_ARG_ENABLE(CONFIG_GOPHER, gopher, [Gopher protocol],
EL_ARG_ENABLE(CONFIG_NNTP, nntp, [NNTP protocol],
[ --enable-nntp enable nntp protocol support])
dnl ===================================================================
dnl SMB protocol support.
dnl ===================================================================
# ===================================================================
# SMB protocol support.
# ===================================================================
EL_SAVE_FLAGS
if test "x${enable_smb}" != xno; then
@ -1312,8 +1322,8 @@ EL_ARG_ENABLE(CONFIG_CSS, css, [Cascading Style Sheets],
EL_ARG_DEPEND(CONFIG_HTML_HIGHLIGHT, html-highlight, [CONFIG_CSS:yes], [HTML highlighting],
[ --enable-html-highlight HTML highlighting using DOM engine])
dnl Everything in the tree already uses CONFIG_DOM
dnl so resolve CONFIG_HTML_HIGHLIGHT to CONFIG_DOM
# Everything in the tree already uses CONFIG_DOM
# so resolve CONFIG_HTML_HIGHLIGHT to CONFIG_DOM
EL_CONFIG_DEPENDS(CONFIG_DOM, [CONFIG_HTML_HIGHLIGHT], [DOM engine])
EL_ARG_DEPEND(CONFIG_BACKTRACE, backtrace, [HAVE_EXECINFO:yes], [Backtrace],
@ -1349,15 +1359,15 @@ AC_ARG_ENABLE(weehoofooboomookerchoo,
[AC_MSG_ERROR(Are you strange, or what?)])
dnl == EMX hack
# == EMX hack
test "$CONFIG_OS_OS2" = yes && LDFLAGS="$LDFLAGS -Zexe"
test "$CONFIG_OS_OS2" = yes && LDFLAGS=`echo "$LDFLAGS" | sed "s/-Zbin-files//g"`
dnl ===================================================================
dnl Export directory paths
dnl ===================================================================
# ===================================================================
# Export directory paths
# ===================================================================
# Set up the ``entry points'' if they were not supplied by builder
test "x$prefix" = xNONE && prefix=$ac_default_prefix
@ -1397,13 +1407,13 @@ AC_SUBST(LIBDIR)
EL_LOG_CONFIG(CONFDIR, [System configuration directory], [])
EL_LOG_CONFIG(LOCALEDIR, [Locale catalogs directory], [])
dnl ===================================================================
dnl A little fine tuning of gcc specific options (continued)
dnl ===================================================================
# ===================================================================
# A little fine tuning of gcc specific options (continued)
# ===================================================================
if test "x$ac_cv_c_compiler_gnu" = "xyes"; then
if test "$CONFIG_DEBUG" = "yes"; then
dnl We want to see all warnings and live with none (in debug mode).
# We want to see all warnings and live with none (in debug mode).
CFLAGS="$CFLAGS -Werror"
fi
@ -1453,18 +1463,18 @@ EL_LOG_CONFIG(CPPFLAGS, [Preprocessor flags (CPPFLAGS)], [])
EL_LOG_CONFIG(LDFLAGS, [Linker flags (LDFLAGS)], [])
EL_LOG_CONFIG(LIBS, [Library flags (LIBS)], [])
dnl ===================================================================
dnl Colored make output
dnl ===================================================================
# ===================================================================
# Colored make output
# ===================================================================
if test $(`which tput` colors) -ge 4; then
MAKE_COLOR=1
AC_SUBST(MAKE_COLOR)
fi
dnl ===================================================================
dnl Generated files
dnl ===================================================================
# ===================================================================
# Generated files
# ===================================================================
AC_CONFIG_FILES([ \
Makefile.config \
@ -1489,9 +1499,9 @@ if test "$abs_srcdir" != "$builddir"; then
echo "*" > "$builddir/.gitignore"
fi
dnl ===================================================================
dnl Configuration summary
dnl ===================================================================
# ===================================================================
# Configuration summary
# ===================================================================
AC_MSG_RESULT(The following feature summary has been saved to features.log)
cat features.log

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/sh -e
#
# Graft the ELinks development history to the current tree.
#
@ -19,6 +19,9 @@ cd "$GIT_DIR"
echo "[grafthistory] Downloading the history"
mkdir -p objects/pack
cd objects/pack
# pack-0d6c5c67aab3b9d5d9b245da5929c15d79124a48.idx is 3163784 bytes long.
# Downloading it takes less than 6 seconds here, whereas generating it
# with git index-pack takes over 4 minutes (750 MHz Duron, git 1.5.4.1).
wget -c http://elinks.cz/elinks-history.git/objects/pack/pack-0d6c5c67aab3b9d5d9b245da5929c15d79124a48.idx
wget -c http://elinks.cz/elinks-history.git/objects/pack/pack-0d6c5c67aab3b9d5d9b245da5929c15d79124a48.pack
@ -32,4 +35,4 @@ echo 43a9a406737fd22a8558c47c74b4ad04d4c92a2b 730242dcf2cdeed13eae7e8b0c5f47bb03
echo "[grafthistory] Refreshing the dumb server info wrt. new packs"
cd ..
git-update-server-info
git update-server-info

View File

@ -42,9 +42,11 @@ ifndef::installation-webpage[]
See <<lua-scripting,the Elinks - Lua interface>> \
endif::installation-webpage[]
for more info.
zlib 1.2.0.2 or later For handling compressed documents both locally and \
sent from server.
bzip2 For handling local compressed documents.
zlib 1.2.0.2 or later For handling gzip or deflate compressed documents \
both locally and sent from server.
bzip2 Likewise, for bzip2 compressed documents.
LZMA Utils Likewise, for LZMA compressed documents. \
Version 4.32.5 should work.
OpenSSL or GNU TLS For handling secure HTTP browsing.
GPM 'General Purpose Mouse' for mouse support.
expat 'XML Parser Toolkit' needed for XBEL support.

View File

@ -17,13 +17,14 @@ When releasing a new version
- Create a signed tag having the version ("ELinks X.X.X") as the subject and
using the changelog create above as the body. Use something like:
$ cg-tag -s -M changelog.file elinks-X.X.X
$ git tag -s -F changelog.file elinks-X.X.X
- Append ".GIT" to the VERSION variable in the top of configure.in.
- Commit only this change.
- Push these changes plus tag using:
$ cg-push -t elinks-X.X.X
$ git push
$ git push --tags
2. Tasks on http://elinks.cz/ (part 1):

View File

@ -175,6 +175,49 @@ CONFIG_MAILCAP=yes
CONFIG_MIMETYPES=yes
### Gzip and Deflate Decompression
#
# This makes ELinks send "Accept-Encoding: deflate, gzip" in HTTP
# requests and decompress any documents received in those formats.
# It works with local *.gz files as well.
#
# Default: enabled if zlib is installed and new enough
CONFIG_GZIP=yes
### Bzip2 Decompression
#
# This makes ELinks decompress local *.bz2 files.
# Also, ELinks sends "Accept-Encoding: bzip2" in HTTP requests
# and decompresses any documents received in that format,
# but this encoding has not been registered at
# http://www.iana.org/assignments/http-parameters[],
# so most servers probably won't use it.
#
# Default: enabled if the library is installed
CONFIG_BZIP2=yes
### LZMA Decompression
#
# This makes ELinks decompress local *.lzma files.
# Also, ELinks sends "Accept-Encoding: lzma" in HTTP requests
# and decompresses any documents received in that format,
# but this encoding has not been registered at
# http://www.iana.org/assignments/http-parameters[],
# so most servers probably won't use it.
#
# To use this, first install http://tukaani.org/lzma/[LZMA Utils].
# Version 4.32.5 works; 4.42.2alpha also works and understands a
# newer LZMA file format. ELinks cannot use LZMA SDK from 7-Zip.
#
# Default: enabled if the library is installed
CONFIG_LZMA=yes
### IPv6 Protocol Support
#
# You know this thing that was designed to obsolete IPv4 but only pasky,

8
src/cache/cache.c vendored
View File

@ -40,9 +40,11 @@ static void truncate_entry(struct cache_entry *cached, off_t offset, int final);
#define dump_frag(frag, count) \
do { \
DBG(" [%d] f=%p offset=%" OFF_T_FORMAT " length=%" OFF_T_FORMAT \
" real_length=%" OFF_T_FORMAT, \
count, frag, frag->offset, frag->length, frag->real_length); \
DBG(" [%d] f=%p offset=%" OFF_PRINT_FORMAT \
" length=%" OFF_PRINT_FORMAT \
" real_length=%" OFF_PRINT_FORMAT, \
count, frag, (off_print_T) frag->offset, \
(off_print_T) frag->length, (off_print_T) frag->real_length); \
} while (0)
#define dump_frags(entry, comment) \

8
src/cache/dialogs.c vendored
View File

@ -82,10 +82,10 @@ get_cache_entry_info(struct listbox_item *item, struct terminal *term)
}
}
add_format_to_string(&msg, "\n%s: %" OFF_T_FORMAT, _("Size", term),
cached->length);
add_format_to_string(&msg, "\n%s: %" OFF_T_FORMAT, _("Loaded size", term),
cached->data_size);
add_format_to_string(&msg, "\n%s: %" OFF_PRINT_FORMAT, _("Size", term),
(off_print_T) cached->length);
add_format_to_string(&msg, "\n%s: %" OFF_PRINT_FORMAT, _("Loaded size", term),
(off_print_T) cached->data_size);
if (cached->content_type) {
add_format_to_string(&msg, "\n%s: %s", _("Content type", term),
cached->content_type);

View File

@ -282,7 +282,7 @@ str_rd(struct option *opt, unsigned char **file, int *line)
while (*str && (commandline || !isquote(*str))) {
if (*str == '\\') {
/* FIXME: This won't work on crlf systems. */
if (str[1] == '\n') { str[1] = ' '; str++; }
if (str[1] == '\n') { str[1] = ' '; str++; (*line)++; }
/* When there's quote char, we will just move on there,
* thus we will never test for it in while () condition
* and we will treat it just as '"', ignoring the

View File

@ -172,8 +172,9 @@ document_info_dialog(struct session *ses)
struct cache_entry *cached = doc_view->document->cached;
unsigned char *a;
add_format_to_string(&msg, "\n%s: %" OFF_T_FORMAT,
_("Size", term), cached->length);
add_format_to_string(&msg, "\n%s: %" OFF_PRINT_FORMAT,
_("Size", term),
(off_print_T) cached->length);
if (cached->incomplete) {
add_format_to_string(&msg, " (%s)", _("incomplete", term));

View File

@ -1,588 +0,0 @@
/*
LzmaDecode.c
LZMA Decoder (optimized for Speed version)
LZMA SDK 4.22 Copyright (c) 1999-2005 Igor Pavlov (2005-06-10)
http://www.7-zip.org/
LZMA SDK is licensed under two licenses:
1) GNU Lesser General Public License (GNU LGPL)
2) Common Public License (CPL)
It means that you can select one of these two licenses and
follow rules of that license.
SPECIAL EXCEPTION:
Igor Pavlov, as the author of this Code, expressly permits you to
statically or dynamically link your Code (or bind by name) to the
interfaces of this file without subjecting your linked Code to the
terms of the CPL or GNU LGPL. Any modifications or additions
to this file, however, are subject to the LGPL or CPL terms.
*/
#include "encoding/LzmaDecode.h"
#ifndef Byte
#define Byte unsigned char
#endif
#define kNumTopBits 24
#define kTopValue ((UInt32)1 << kNumTopBits)
#define kNumBitModelTotalBits 11
#define kBitModelTotal (1 << kNumBitModelTotalBits)
#define kNumMoveBits 5
#define RC_READ_BYTE (*Buffer++)
#define RC_INIT2 Code = 0; Range = 0xFFFFFFFF; \
{ int i; for(i = 0; i < 5; i++) { RC_TEST; Code = (Code << 8) | RC_READ_BYTE; }}
#ifdef _LZMA_IN_CB
#define RC_TEST { if (Buffer == BufferLim) \
{ SizeT size; int result = InCallback->Read(InCallback, &Buffer, &size); if (result != LZMA_RESULT_OK) return result; \
BufferLim = Buffer + size; if (size == 0) return LZMA_RESULT_DATA_ERROR; }}
#define RC_INIT Buffer = BufferLim = 0; RC_INIT2
#else
#define RC_TEST { if (Buffer == BufferLim) return LZMA_RESULT_DATA_ERROR; }
#define RC_INIT(buffer, bufferSize) Buffer = buffer; BufferLim = buffer + bufferSize; RC_INIT2
#endif
#define RC_NORMALIZE if (Range < kTopValue) { RC_TEST; Range <<= 8; Code = (Code << 8) | RC_READ_BYTE; }
#define IfBit0(p) RC_NORMALIZE; bound = (Range >> kNumBitModelTotalBits) * *(p); if (Code < bound)
#define UpdateBit0(p) Range = bound; *(p) += (kBitModelTotal - *(p)) >> kNumMoveBits;
#define UpdateBit1(p) Range -= bound; Code -= bound; *(p) -= (*(p)) >> kNumMoveBits;
#define RC_GET_BIT2(p, mi, A0, A1) IfBit0(p) \
{ UpdateBit0(p); mi <<= 1; A0; } else \
{ UpdateBit1(p); mi = (mi + mi) + 1; A1; }
#define RC_GET_BIT(p, mi) RC_GET_BIT2(p, mi, ; , ;)
#define RangeDecoderBitTreeDecode(probs, numLevels, res) \
{ int i = numLevels; res = 1; \
do { CProb *p = probs + res; RC_GET_BIT(p, res) } while(--i != 0); \
res -= (1 << numLevels); }
#define kNumPosBitsMax 4
#define kNumPosStatesMax (1 << kNumPosBitsMax)
#define kLenNumLowBits 3
#define kLenNumLowSymbols (1 << kLenNumLowBits)
#define kLenNumMidBits 3
#define kLenNumMidSymbols (1 << kLenNumMidBits)
#define kLenNumHighBits 8
#define kLenNumHighSymbols (1 << kLenNumHighBits)
#define LenChoice 0
#define LenChoice2 (LenChoice + 1)
#define LenLow (LenChoice2 + 1)
#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits))
#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))
#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
#define kNumStates 12
#define kNumLitStates 7
#define kStartPosModelIndex 4
#define kEndPosModelIndex 14
#define kNumFullDistances (1 << (kEndPosModelIndex >> 1))
#define kNumPosSlotBits 6
#define kNumLenToPosStates 4
#define kNumAlignBits 4
#define kAlignTableSize (1 << kNumAlignBits)
#define kMatchMinLen 2
#define IsMatch 0
#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax))
#define IsRepG0 (IsRep + kNumStates)
#define IsRepG1 (IsRepG0 + kNumStates)
#define IsRepG2 (IsRepG1 + kNumStates)
#define IsRep0Long (IsRepG2 + kNumStates)
#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax))
#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits))
#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex)
#define LenCoder (Align + kAlignTableSize)
#define RepLenCoder (LenCoder + kNumLenProbs)
#define Literal (RepLenCoder + kNumLenProbs)
#if Literal != LZMA_BASE_SIZE
StopCompilingDueBUG
#endif
int LzmaDecodeProperties(CLzmaProperties *propsRes, const unsigned char *propsData, int size)
{
unsigned char prop0;
if (size < LZMA_PROPERTIES_SIZE)
return LZMA_RESULT_DATA_ERROR;
prop0 = propsData[0];
if (prop0 >= (9 * 5 * 5))
return LZMA_RESULT_DATA_ERROR;
{
for (propsRes->pb = 0; prop0 >= (9 * 5); propsRes->pb++, prop0 -= (9 * 5));
for (propsRes->lp = 0; prop0 >= 9; propsRes->lp++, prop0 -= 9);
propsRes->lc = prop0;
/*
unsigned char remainder = (unsigned char)(prop0 / 9);
propsRes->lc = prop0 % 9;
propsRes->pb = remainder / 5;
propsRes->lp = remainder % 5;
*/
}
#ifdef _LZMA_OUT_READ
{
int i;
propsRes->DictionarySize = 0;
for (i = 0; i < 4; i++)
propsRes->DictionarySize += (UInt32)(propsData[1 + i]) << (i * 8);
if (propsRes->DictionarySize == 0)
propsRes->DictionarySize = 1;
}
#endif
return LZMA_RESULT_OK;
}
#define kLzmaStreamWasFinishedId (-1)
int LzmaDecode(CLzmaDecoderState *vs,
#ifdef _LZMA_IN_CB
ILzmaInCallback *InCallback,
#else
const unsigned char *inStream, SizeT inSize, SizeT *inSizeProcessed,
#endif
unsigned char *outStream, SizeT outSize, SizeT *outSizeProcessed)
{
CProb *p = vs->Probs;
SizeT nowPos = 0;
Byte previousByte = 0;
UInt32 posStateMask = (1 << (vs->Properties.pb)) - 1;
UInt32 literalPosMask = (1 << (vs->Properties.lp)) - 1;
int lc = vs->Properties.lc;
#ifdef _LZMA_OUT_READ
UInt32 Range = vs->Range;
UInt32 Code = vs->Code;
#ifdef _LZMA_IN_CB
const Byte *Buffer = vs->Buffer;
const Byte *BufferLim = vs->BufferLim;
#else
const Byte *Buffer = inStream;
const Byte *BufferLim = inStream + inSize;
#endif
int state = vs->State;
UInt32 rep0 = vs->Reps[0], rep1 = vs->Reps[1], rep2 = vs->Reps[2], rep3 = vs->Reps[3];
int len = vs->RemainLen;
UInt32 globalPos = vs->GlobalPos;
UInt32 distanceLimit = vs->DistanceLimit;
Byte *dictionary = vs->Dictionary;
UInt32 dictionarySize = vs->Properties.DictionarySize;
UInt32 dictionaryPos = vs->DictionaryPos;
Byte tempDictionary[4];
#ifndef _LZMA_IN_CB
*inSizeProcessed = 0;
#endif
*outSizeProcessed = 0;
if (len == kLzmaStreamWasFinishedId)
return LZMA_RESULT_OK;
if (dictionarySize == 0)
{
dictionary = tempDictionary;
dictionarySize = 1;
tempDictionary[0] = vs->TempDictionary[0];
}
if (len == kLzmaNeedInitId)
{
{
UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (lc + vs->Properties.lp));
UInt32 i;
for (i = 0; i < numProbs; i++)
p[i] = kBitModelTotal >> 1;
rep0 = rep1 = rep2 = rep3 = 1;
state = 0;
globalPos = 0;
distanceLimit = 0;
dictionaryPos = 0;
dictionary[dictionarySize - 1] = 0;
#ifdef _LZMA_IN_CB
RC_INIT;
#else
RC_INIT(inStream, inSize);
#endif
}
len = 0;
}
while(len != 0 && nowPos < outSize)
{
UInt32 pos = dictionaryPos - rep0;
if (pos >= dictionarySize)
pos += dictionarySize;
outStream[nowPos++] = dictionary[dictionaryPos] = dictionary[pos];
if (++dictionaryPos == dictionarySize)
dictionaryPos = 0;
len--;
}
if (dictionaryPos == 0)
previousByte = dictionary[dictionarySize - 1];
else
previousByte = dictionary[dictionaryPos - 1];
#else /* if !_LZMA_OUT_READ */
int state = 0;
UInt32 rep0 = 1, rep1 = 1, rep2 = 1, rep3 = 1;
int len = 0;
const Byte *Buffer;
const Byte *BufferLim;
UInt32 Range;
UInt32 Code;
#ifndef _LZMA_IN_CB
*inSizeProcessed = 0;
#endif
*outSizeProcessed = 0;
{
UInt32 i;
UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (lc + vs->Properties.lp));
for (i = 0; i < numProbs; i++)
p[i] = kBitModelTotal >> 1;
}
#ifdef _LZMA_IN_CB
RC_INIT;
#else
RC_INIT(inStream, inSize);
#endif
#endif /* _LZMA_OUT_READ */
while(nowPos < outSize)
{
CProb *prob;
UInt32 bound;
int posState = (int)(
(nowPos
#ifdef _LZMA_OUT_READ
+ globalPos
#endif
)
& posStateMask);
prob = p + IsMatch + (state << kNumPosBitsMax) + posState;
IfBit0(prob)
{
int symbol = 1;
UpdateBit0(prob)
prob = p + Literal + (LZMA_LIT_SIZE *
(((
(nowPos
#ifdef _LZMA_OUT_READ
+ globalPos
#endif
)
& literalPosMask) << lc) + (previousByte >> (8 - lc))));
if (state >= kNumLitStates)
{
int matchByte;
#ifdef _LZMA_OUT_READ
UInt32 pos = dictionaryPos - rep0;
if (pos >= dictionarySize)
pos += dictionarySize;
matchByte = dictionary[pos];
#else
matchByte = outStream[nowPos - rep0];
#endif
do
{
int bit;
CProb *probLit;
matchByte <<= 1;
bit = (matchByte & 0x100);
probLit = prob + 0x100 + bit + symbol;
RC_GET_BIT2(probLit, symbol, if (bit != 0) break, if (bit == 0) break)
}
while (symbol < 0x100);
}
while (symbol < 0x100)
{
CProb *probLit = prob + symbol;
RC_GET_BIT(probLit, symbol)
}
previousByte = (Byte)symbol;
outStream[nowPos++] = previousByte;
#ifdef _LZMA_OUT_READ
if (distanceLimit < dictionarySize)
distanceLimit++;
dictionary[dictionaryPos] = previousByte;
if (++dictionaryPos == dictionarySize)
dictionaryPos = 0;
#endif
if (state < 4) state = 0;
else if (state < 10) state -= 3;
else state -= 6;
}
else
{
UpdateBit1(prob);
prob = p + IsRep + state;
IfBit0(prob)
{
UpdateBit0(prob);
rep3 = rep2;
rep2 = rep1;
rep1 = rep0;
state = state < kNumLitStates ? 0 : 3;
prob = p + LenCoder;
}
else
{
UpdateBit1(prob);
prob = p + IsRepG0 + state;
IfBit0(prob)
{
UpdateBit0(prob);
prob = p + IsRep0Long + (state << kNumPosBitsMax) + posState;
IfBit0(prob)
{
#ifdef _LZMA_OUT_READ
UInt32 pos;
#endif
UpdateBit0(prob);
#ifdef _LZMA_OUT_READ
if (distanceLimit == 0)
#else
if (nowPos == 0)
#endif
return LZMA_RESULT_DATA_ERROR;
state = state < kNumLitStates ? 9 : 11;
#ifdef _LZMA_OUT_READ
pos = dictionaryPos - rep0;
if (pos >= dictionarySize)
pos += dictionarySize;
previousByte = dictionary[pos];
dictionary[dictionaryPos] = previousByte;
if (++dictionaryPos == dictionarySize)
dictionaryPos = 0;
#else
previousByte = outStream[nowPos - rep0];
#endif
outStream[nowPos++] = previousByte;
#ifdef _LZMA_OUT_READ
if (distanceLimit < dictionarySize)
distanceLimit++;
#endif
continue;
}
else
{
UpdateBit1(prob);
}
}
else
{
UInt32 distance;
UpdateBit1(prob);
prob = p + IsRepG1 + state;
IfBit0(prob)
{
UpdateBit0(prob);
distance = rep1;
}
else
{
UpdateBit1(prob);
prob = p + IsRepG2 + state;
IfBit0(prob)
{
UpdateBit0(prob);
distance = rep2;
}
else
{
UpdateBit1(prob);
distance = rep3;
rep3 = rep2;
}
rep2 = rep1;
}
rep1 = rep0;
rep0 = distance;
}
state = state < kNumLitStates ? 8 : 11;
prob = p + RepLenCoder;
}
{
int numBits, offset;
CProb *probLen = prob + LenChoice;
IfBit0(probLen)
{
UpdateBit0(probLen);
probLen = prob + LenLow + (posState << kLenNumLowBits);
offset = 0;
numBits = kLenNumLowBits;
}
else
{
UpdateBit1(probLen);
probLen = prob + LenChoice2;
IfBit0(probLen)
{
UpdateBit0(probLen);
probLen = prob + LenMid + (posState << kLenNumMidBits);
offset = kLenNumLowSymbols;
numBits = kLenNumMidBits;
}
else
{
UpdateBit1(probLen);
probLen = prob + LenHigh;
offset = kLenNumLowSymbols + kLenNumMidSymbols;
numBits = kLenNumHighBits;
}
}
RangeDecoderBitTreeDecode(probLen, numBits, len);
len += offset;
}
if (state < 4)
{
int posSlot;
state += kNumLitStates;
prob = p + PosSlot +
((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
kNumPosSlotBits);
RangeDecoderBitTreeDecode(prob, kNumPosSlotBits, posSlot);
if (posSlot >= kStartPosModelIndex)
{
int numDirectBits = ((posSlot >> 1) - 1);
rep0 = (2 | ((UInt32)posSlot & 1));
if (posSlot < kEndPosModelIndex)
{
rep0 <<= numDirectBits;
prob = p + SpecPos + rep0 - posSlot - 1;
}
else
{
numDirectBits -= kNumAlignBits;
do
{
RC_NORMALIZE
Range >>= 1;
rep0 <<= 1;
if (Code >= Range)
{
Code -= Range;
rep0 |= 1;
}
}
while (--numDirectBits != 0);
prob = p + Align;
rep0 <<= kNumAlignBits;
numDirectBits = kNumAlignBits;
}
{
int i = 1;
int mi = 1;
do
{
CProb *prob3 = prob + mi;
RC_GET_BIT2(prob3, mi, ; , rep0 |= i);
i <<= 1;
}
while(--numDirectBits != 0);
}
}
else
rep0 = posSlot;
if (++rep0 == (UInt32)(0))
{
/* it's for stream version */
len = kLzmaStreamWasFinishedId;
break;
}
}
len += kMatchMinLen;
#ifdef _LZMA_OUT_READ
if (rep0 > distanceLimit)
#else
if (rep0 > nowPos)
#endif
return LZMA_RESULT_DATA