95 Commits

Author SHA1 Message Date
Xavier Roche
1dd36157c9 created tag 3.48.17 2014-07-12 13:30:20 +00:00
Xavier Roche
9f21da0f1b 3.48.17 2014-07-12 13:28:28 +00:00
Xavier Roche
a68ec9ad2a 3.48.17 2014-07-12 13:20:10 +00:00
Xavier Roche
f912d9f024 Fixed URL list not working anymore (tom swift) 2014-07-12 12:18:33 +00:00
Xavier Roche
8b8cce197a 3.48.16 2014-07-09 05:09:15 +00:00
Xavier Roche
e8188eb243 Fixed FTBFS on ARM/MIPS again. 2014-07-09 05:09:11 +00:00
Xavier Roche
f59bc8a790 3.48.15 2014-07-08 20:08:20 +00:00
Xavier Roche
854b7fe18e Updated man 2014-07-08 20:01:32 +00:00
Xavier Roche
920d51082c proxytrack: fixed FTBFS on ARM/MIPS 2014-07-08 20:01:22 +00:00
Xavier Roche
e35b329c50 3.48.14 2014-07-08 18:40:01 +00:00
Xavier Roche
1ff6c081f1 3.48-14 2014-07-08 18:23:06 +00:00
Xavier Roche
7503937d76 Fixed buggy FFFD (replacement character) in place of leading non-ascii character
* closes:#48
2014-07-08 18:20:20 +00:00
Xavier Roche
23fa293e9e Fixed htssafe.h 2014-07-08 07:06:10 +00:00
Xavier Roche
25c278b599 Another assert 2014-07-07 19:24:18 +00:00
Xavier Roche
721da33d81 int => size_t cleanup 2014-07-07 19:07:08 +00:00
Xavier Roche
c0165072d6 Fixed MD5_CTX => struct MD5Context 2014-07-06 08:24:40 +00:00
Xavier Roche
ebd4d34b7b Fixed HashMD5Context 2014-07-06 08:17:09 +00:00
Xavier Roche
047c6b726b Fixed MD5 definitions 2014-07-06 08:12:42 +00:00
Xavier Roche
aecd9a41ea Fixed MD5_Init() 2014-07-06 08:05:19 +00:00
Xavier Roche
46a9b89dd3 Added hts_has_stopped() flag, added some asserts 2014-07-06 08:00:36 +00:00
Xavier Roche
b6ba5073a5 typo. 2014-06-28 11:20:04 +00:00
Xavier Roche
5eb5b0891d Optimize the case when realloc() returns the same base address while reallocating the string pool. 2014-06-28 11:18:06 +00:00
Xavier Roche
afff7dc033 Fixed NULL pointer dereferencing in back_unserialize (htsback.c:976) spotted on Android platforms 2014-06-27 16:03:10 +00:00
Xavier Roche
69a93698dc Temporarily switch to MD5 with architectures not supporting unaligned integer accesses. 2014-06-24 18:16:30 +00:00
Xavier Roche
68d81080b3 Check for aligned access requirements explicitly. 2014-06-23 18:52:33 +00:00
Xavier Roche
a431fcf717 #ifdef failed 2014-06-23 07:33:30 +00:00
Xavier Roche
c722368dc0 Emergency fixing Invalid address alignment issues on Android 2014-06-23 04:49:41 +00:00
Xavier Roche
b1367feade Do not uncompress .tgz advertised as "streamed" (Smiling Spectre) 2014-06-22 13:30:41 +00:00
Xavier Roche
5882b122d1 Handle buggy SVG (Smiling Spectre) 2014-06-22 13:03:07 +00:00
Xavier Roche
f27a5f58be Fixed "comparison between signed and unsigned integer expressions" 2014-06-22 10:42:38 +00:00
Xavier Roche
d0d62c0598 No fopen64() on Android. 2014-06-22 10:22:39 +00:00
Xavier Roche
027fe3a5ee Possible cause of crash at htstools.c:425 inside long_to_83() 2014-06-17 19:56:26 +00:00
Xavier Roche
8b05179083 Fixed "old-style function definition" warning. 2014-06-17 19:09:31 +00:00
Xavier Roche
522af8962f Faster coucal_del_value_ 2014-06-15 20:27:45 +00:00
Xavier Roche
96a727e4fb Better coucal_is_acceptable_pow2() logic 2014-06-15 12:10:52 +00:00
Xavier Roche
4c876451be Fixed log size limit check. 2014-06-15 11:21:17 +00:00
Xavier Roche
c5003322b7 Cleanup in coucal_new() 2014-06-15 11:12:08 +00:00
Xavier Roche
8e72bb5deb Optional 64-bit hash for really big hashtables. (disabled by default) 2014-06-15 10:24:06 +00:00
Xavier Roche
2e6a99ce09 Added coucal_calc_hashes() 2014-06-15 08:48:18 +00:00
Xavier Roche
218f6e2cd9 Added coucal_fetch_value() 2014-06-15 08:31:41 +00:00
Xavier Roche
967932e75d Added coucal_fetch_value_hashes() 2014-06-15 08:29:02 +00:00
Xavier Roche
42bb06703a Credits. 2014-06-15 07:52:33 +00:00
Xavier Roche
3bb87c123a Intro line. 2014-06-15 07:43:32 +00:00
Xavier Roche
eeaa956588 Original cuckoo hashing paper 2014-06-15 07:39:57 +00:00
Xavier Roche
7925eccecd Added coucal_hash_data() 2014-06-14 20:18:56 +00:00
Xavier Roche
60ee0687d5 Cosmetic 2014-06-14 20:02:11 +00:00
Xavier Roche
8b3af0d585 Added comments. 2014-06-14 19:35:29 +00:00
Xavier Roche
028f23ca6f Added coucal_get_pvoid() and coucal_get_intptr() 2014-06-14 13:07:33 +00:00
Xavier Roche
bf40691b62 Wrapped lines. 2014-06-14 12:59:42 +00:00
Xavier Roche
dc21c7f595 BSD 3-Clause License 2014-06-14 12:55:11 +00:00
Xavier Roche
4461278b80 Added diff murmurhash3.h 2014-06-14 12:46:19 +00:00
Xavier Roche
95480e8d16 Fixed exports.
Fixed WIN32.
2014-06-14 12:39:16 +00:00
Xavier Roche
b10df97dd0 Remarks over MD5 vs. murmur hashing. 2014-06-14 10:08:38 +00:00
Xavier Roche
7a1e4b8265 Renamed inthash_* API to coucal_* one. 2014-06-14 10:05:44 +00:00
Xavier Roche
6c2120e053 Fixed includes. 2014-06-14 09:56:14 +00:00
Xavier Roche
7a261eec39 Re-license coucal to BSD-style license. 2014-06-14 09:55:50 +00:00
Xavier Roche
dbd99bb365 Fixed include 2014-06-14 09:51:03 +00:00
Xavier Roche
e0fe304f0b Preparing to export the cuckoo hashtable library as "coucal" project 2014-06-14 09:50:17 +00:00
Xavier Roche
84632e7bb6 Hashtable cleanup 2014-06-14 09:21:48 +00:00
Xavier Roche
a4f1156edc Fixed WIN32 build (stdint.h) 2014-06-11 19:04:32 +00:00
Xavier Roche
1e87dc455f Fixed zlib warning (build zlib with -DZLIB_CONST) 2014-06-11 18:59:42 +00:00
Xavier Roche
c0a31f2656 Added the following compiler flags:
* -Wunused-but-set-parameter
  * -Wignored-qualifiers
2014-06-11 16:50:00 +00:00
Xavier Roche
2e59d67d7a -Wstrict-aliasing=2 => -Wstrict-aliasing 2014-06-10 20:42:28 +00:00
Xavier Roche
713b83f7b4 Added the following compiler flags:
* -Wcast-qual 
  * -Wmissing-parameter-type
  * -Wold-style-definition
2014-06-10 20:27:13 +00:00
Xavier Roche
82e61ae9d6 Added missing minizip/mztools.c.diff reference 2014-06-10 17:04:48 +00:00
Xavier Roche
d2103fce8a Fixed const 2014-06-10 16:43:33 +00:00
Xavier Roche
93ae992d7b Changed hashtable types to have either opaque void*, or unions. 2014-06-10 16:37:44 +00:00
Xavier Roche
49dd329a09 Updated Makefile 2014-06-09 20:07:04 +00:00
Xavier Roche
185b664930 Added diff 2014-06-08 20:08:21 +00:00
Xavier Roche
3a7441b57b Reverted diff, groumph. 2014-06-08 20:06:06 +00:00
Xavier Roche
eeee43acb7 Added minizip orig files. 2014-06-08 20:00:57 +00:00
Xavier Roche
91946b7834 Fixed FTBFS when compiling with zlib versions < 1.2.70 (sammyx) 2014-06-08 19:54:49 +00:00
Xavier Roche
1af7fd8c5d 3.48.13 2014-06-08 15:43:28 +00:00
Xavier Roche
f509bed5be __cplusplus 2014-06-08 13:58:57 +00:00
Xavier Roche
6d1544383e Public definitions cleanup (especially for httraqt)
htsopt.h now has the following definitions:
  * struct htsrequest_proxy
  * struct htsrequest
  * struct htsblk
  * struct lien_url
  * struct lien_back
2014-06-08 13:02:43 +00:00
Xavier Roche
cd268fd39e 3.48.12 2014-06-08 11:22:41 +00:00
Xavier Roche
113fb00073 Using subdir-objects for automake
Replaced legacy INCLUDES by AM_CPPFLAGS
2014-06-08 11:12:21 +00:00
Xavier Roche
4608b62e2e Fixed __cplusplus issues 2014-06-08 09:35:34 +00:00
Xavier Roche
3f1e6ac8cd Typos 2014-06-08 09:26:46 +00:00
Xavier Roche
bfdc88cb0b Better. 2014-06-07 07:03:13 +00:00
Xavier Roche
a911bcf0c9 Fixed --advanced-maxlinks broken (Localhost) 2014-06-07 07:03:08 +00:00
Xavier Roche
49691770a9 Fixed initializer. 2014-06-06 20:58:35 +00:00
Xavier Roche
1a683c668a Cleanup. 2014-06-06 19:08:47 +00:00
Xavier Roche
dc49da62a1 Progressive power-of-two allocator for linked blocks. 2014-06-06 19:03:41 +00:00
Xavier Roche
018832a18b Added htsarrays.h to Makefile and devel libs 2014-06-06 18:47:53 +00:00
Xavier Roche
7ec5e6e7e4 tr -d '\r' 2014-06-06 18:47:39 +00:00
Xavier Roche
8c1e9ef23d Updated man 2014-06-06 18:47:24 +00:00
Xavier Roche
073a55ab1c Splitted typed arrays in htsarrays.h
Cleaned-up page generation
2014-06-06 18:43:50 +00:00
Xavier Roche
9ff2518be6 3.48.11 2014-06-06 16:02:35 +00:00
Xavier Roche
f78d271246 3.48.11 2014-06-06 15:57:02 +00:00
Xavier Roche
344d47e632 Additional check. 2014-06-06 15:48:05 +00:00
Xavier Roche
d068a8f3ff Fixed assertion failure at htscore.c:244 (len + liensbuf->string_buffer_size < liensbuf->string_buffer_capa)
* closes:46

-Cette ligne, et les suivantes ci-dessous, seront ignorées--

M    trunk/src/htscore.c
2014-06-06 15:47:38 +00:00
Xavier Roche
e64f9a8929 Added missing .h to -dev 2014-06-05 16:00:05 +00:00
Xavier Roche
2d2ec627b4 changelog 2014-06-05 15:59:49 +00:00
Xavier Roche
40f237fe9c Fixed "this decimal constant is unsigned only in ISO C90" 2014-06-04 19:53:07 +00:00
70 changed files with 6402 additions and 2022 deletions

View File

@@ -6,6 +6,9 @@
/* Check for ftime */
#undef FTIME
/* Define if pointers to integers require aligned access */
#undef HAVE_ALIGNED_ACCESS_REQUIRED
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H

271
configure vendored
View File

@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for httrack 3.48.10.
# Generated by GNU Autoconf 2.69 for httrack 3.48.17.
#
# Report bugs to <roche+packaging@httrack.com>.
#
@@ -616,8 +616,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='httrack'
PACKAGE_TARNAME='httrack'
PACKAGE_VERSION='3.48.10'
PACKAGE_STRING='httrack 3.48.10'
PACKAGE_VERSION='3.48.17'
PACKAGE_STRING='httrack 3.48.17'
PACKAGE_BUGREPORT='roche+packaging@httrack.com'
PACKAGE_URL='http://www.httrack.com/'
@@ -1356,7 +1356,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures httrack 3.48.10 to adapt to many kinds of systems.
\`configure' configures httrack 3.48.17 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1426,7 +1426,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of httrack 3.48.10:";;
short | recursive ) echo "Configuration of httrack 3.48.17:";;
esac
cat <<\_ACEOF
@@ -1537,7 +1537,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
httrack configure 3.48.10
httrack configure 3.48.17
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2169,7 +2169,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by httrack $as_me 3.48.10, which was
It was created by httrack $as_me 3.48.17, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2990,7 +2990,7 @@ fi
# Define the identity of the package.
PACKAGE='httrack'
VERSION='3.48.10'
VERSION='3.48.17'
cat >>confdefs.h <<_ACEOF
@@ -11778,8 +11778,9 @@ LT_CV_OBJDIR=$lt_cv_objdir
### Default CFLAGS
DEFAULT_CFLAGS="-Wall -Wformat -Wformat-security \
-Wmultichar -Wwrite-strings -Wcast-align -Wstrict-prototypes \
-Wmissing-prototypes -Wmissing-declarations -Wdeclaration-after-statement \
-Wmultichar -Wwrite-strings -Wcast-qual -Wcast-align \
-Wstrict-prototypes -Wmissing-prototypes \
-Wmissing-declarations -Wdeclaration-after-statement \
-Wpointer-arith -Wsequence-point -Wnested-externs \
-D_REENTRANT"
@@ -11857,6 +11858,76 @@ else
:
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wunused-but-set-parameter" >&5
$as_echo_n "checking whether C compiler accepts -Wunused-but-set-parameter... " >&6; }
if ${ax_cv_check_cflags___Wunused_but_set_parameter+:} false; then :
$as_echo_n "(cached) " >&6
else
ax_check_save_flags=$CFLAGS
CFLAGS="$CFLAGS -Wunused-but-set-parameter"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ax_cv_check_cflags___Wunused_but_set_parameter=yes
else
ax_cv_check_cflags___Wunused_but_set_parameter=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS=$ax_check_save_flags
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Wunused_but_set_parameter" >&5
$as_echo "$ax_cv_check_cflags___Wunused_but_set_parameter" >&6; }
if test x"$ax_cv_check_cflags___Wunused_but_set_parameter" = xyes; then :
DEFAULT_CFLAGS="$DEFAULT_CFLAGS -Wunused-but-set-parameter"
else
:
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Waddress" >&5
$as_echo_n "checking whether C compiler accepts -Waddress... " >&6; }
if ${ax_cv_check_cflags___Waddress+:} false; then :
$as_echo_n "(cached) " >&6
else
ax_check_save_flags=$CFLAGS
CFLAGS="$CFLAGS -Waddress"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ax_cv_check_cflags___Waddress=yes
else
ax_cv_check_cflags___Waddress=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS=$ax_check_save_flags
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Waddress" >&5
$as_echo "$ax_cv_check_cflags___Waddress" >&6; }
if test x"$ax_cv_check_cflags___Waddress" = xyes; then :
DEFAULT_CFLAGS="$DEFAULT_CFLAGS -Waddress"
else
:
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wuninitialized" >&5
$as_echo_n "checking whether C compiler accepts -Wuninitialized... " >&6; }
if ${ax_cv_check_cflags___Wuninitialized+:} false; then :
@@ -11962,14 +12033,14 @@ else
:
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fstrict-aliasing -Wstrict-aliasing=2" >&5
$as_echo_n "checking whether C compiler accepts -fstrict-aliasing -Wstrict-aliasing=2... " >&6; }
if ${ax_cv_check_cflags___fstrict_aliasing__Wstrict_aliasing_2+:} false; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wmissing-parameter-type" >&5
$as_echo_n "checking whether C compiler accepts -Wmissing-parameter-type... " >&6; }
if ${ax_cv_check_cflags___Wmissing_parameter_type+:} false; then :
$as_echo_n "(cached) " >&6
else
ax_check_save_flags=$CFLAGS
CFLAGS="$CFLAGS -fstrict-aliasing -Wstrict-aliasing=2"
CFLAGS="$CFLAGS -Wmissing-parameter-type"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11982,17 +12053,122 @@ main ()
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ax_cv_check_cflags___fstrict_aliasing__Wstrict_aliasing_2=yes
ax_cv_check_cflags___Wmissing_parameter_type=yes
else
ax_cv_check_cflags___fstrict_aliasing__Wstrict_aliasing_2=no
ax_cv_check_cflags___Wmissing_parameter_type=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS=$ax_check_save_flags
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fstrict_aliasing__Wstrict_aliasing_2" >&5
$as_echo "$ax_cv_check_cflags___fstrict_aliasing__Wstrict_aliasing_2" >&6; }
if test x"$ax_cv_check_cflags___fstrict_aliasing__Wstrict_aliasing_2" = xyes; then :
DEFAULT_CFLAGS="$DEFAULT_CFLAGS -fstrict-aliasing -Wstrict-aliasing=2"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Wmissing_parameter_type" >&5
$as_echo "$ax_cv_check_cflags___Wmissing_parameter_type" >&6; }
if test x"$ax_cv_check_cflags___Wmissing_parameter_type" = xyes; then :
DEFAULT_CFLAGS="$DEFAULT_CFLAGS -Wmissing-parameter-type"
else
:
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wold-style-definition" >&5
$as_echo_n "checking whether C compiler accepts -Wold-style-definition... " >&6; }
if ${ax_cv_check_cflags___Wold_style_definition+:} false; then :
$as_echo_n "(cached) " >&6
else
ax_check_save_flags=$CFLAGS
CFLAGS="$CFLAGS -Wold-style-definition"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ax_cv_check_cflags___Wold_style_definition=yes
else
ax_cv_check_cflags___Wold_style_definition=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS=$ax_check_save_flags
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Wold_style_definition" >&5
$as_echo "$ax_cv_check_cflags___Wold_style_definition" >&6; }
if test x"$ax_cv_check_cflags___Wold_style_definition" = xyes; then :
DEFAULT_CFLAGS="$DEFAULT_CFLAGS -Wold-style-definition"
else
:
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wignored-qualifiers" >&5
$as_echo_n "checking whether C compiler accepts -Wignored-qualifiers... " >&6; }
if ${ax_cv_check_cflags___Wignored_qualifiers+:} false; then :
$as_echo_n "(cached) " >&6
else
ax_check_save_flags=$CFLAGS
CFLAGS="$CFLAGS -Wignored-qualifiers"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ax_cv_check_cflags___Wignored_qualifiers=yes
else
ax_cv_check_cflags___Wignored_qualifiers=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS=$ax_check_save_flags
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Wignored_qualifiers" >&5
$as_echo "$ax_cv_check_cflags___Wignored_qualifiers" >&6; }
if test x"$ax_cv_check_cflags___Wignored_qualifiers" = xyes; then :
DEFAULT_CFLAGS="$DEFAULT_CFLAGS -Wignored-qualifiers"
else
:
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fstrict-aliasing -Wstrict-aliasing" >&5
$as_echo_n "checking whether C compiler accepts -fstrict-aliasing -Wstrict-aliasing... " >&6; }
if ${ax_cv_check_cflags___fstrict_aliasing__Wstrict_aliasing+:} false; then :
$as_echo_n "(cached) " >&6
else
ax_check_save_flags=$CFLAGS
CFLAGS="$CFLAGS -fstrict-aliasing -Wstrict-aliasing"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ax_cv_check_cflags___fstrict_aliasing__Wstrict_aliasing=yes
else
ax_cv_check_cflags___fstrict_aliasing__Wstrict_aliasing=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS=$ax_check_save_flags
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fstrict_aliasing__Wstrict_aliasing" >&5
$as_echo "$ax_cv_check_cflags___fstrict_aliasing__Wstrict_aliasing" >&6; }
if test x"$ax_cv_check_cflags___fstrict_aliasing__Wstrict_aliasing" = xyes; then :
DEFAULT_CFLAGS="$DEFAULT_CFLAGS -fstrict-aliasing -Wstrict-aliasing"
else
:
fi
@@ -12280,6 +12456,57 @@ $as_echo "#define sa_family_t uint16_t" >>confdefs.h
fi
# check wether misaligned access is possible or not
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if pointers to integers require aligned access" >&5
$as_echo_n "checking if pointers to integers require aligned access... " >&6; }
if ${ax_cv_have_aligned_access_required+:} false; then :
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then :
ax_cv_have_aligned_access_required=no
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdio.h>
#include <stdlib.h>
int main()
{
char* string = malloc(40);
int i;
for (i=0; i < 40; i++) string[[i]] = i;
{
void* s = string;
int* p = s+1;
int* q = s+2;
if (*p == *q) { return 1; }
}
return 0;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
ax_cv_have_aligned_access_required=yes
else
ax_cv_have_aligned_access_required=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_have_aligned_access_required" >&5
$as_echo "$ax_cv_have_aligned_access_required" >&6; }
if test "$ax_cv_have_aligned_access_required" = yes ; then
$as_echo "#define HAVE_ALIGNED_ACCESS_REQUIRED 1" >>confdefs.h
fi
### zlib
#
# Handle user hints
@@ -13760,7 +13987,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by httrack $as_me 3.48.10, which was
This file was extended by httrack $as_me 3.48.17, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -13827,7 +14054,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
httrack config.status 3.48.10
httrack config.status 3.48.17
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

View File

@@ -1,6 +1,6 @@
AC_PREREQ(2.59)
AC_INIT([httrack], [3.48.10], [roche+packaging@httrack.com], [httrack], [http://www.httrack.com/])
AC_INIT([httrack], [3.48.17], [roche+packaging@httrack.com], [httrack], [http://www.httrack.com/])
AC_COPYRIGHT([
HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors
@@ -30,7 +30,7 @@ Please visit our Website: http://www.httrack.com
AC_CONFIG_SRCDIR(src/httrack.c)
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS(config.h)
AM_INIT_AUTOMAKE
AM_INIT_AUTOMAKE([subdir-objects])
VERSION_INFO="2:48:0"
AM_MAINTAINER_MODE
@@ -52,8 +52,9 @@ AC_SUBST(VERSION_INFO)
### Default CFLAGS
DEFAULT_CFLAGS="-Wall -Wformat -Wformat-security \
-Wmultichar -Wwrite-strings -Wcast-align -Wstrict-prototypes \
-Wmissing-prototypes -Wmissing-declarations -Wdeclaration-after-statement \
-Wmultichar -Wwrite-strings -Wcast-qual -Wcast-align \
-Wstrict-prototypes -Wmissing-prototypes \
-Wmissing-declarations -Wdeclaration-after-statement \
-Wpointer-arith -Wsequence-point -Wnested-externs \
-D_REENTRANT"
AC_SUBST(DEFAULT_CFLAGS)
@@ -63,10 +64,15 @@ AC_SUBST(DEFAULT_LDFLAGS)
### Additional flags (if supported)
AX_CHECK_COMPILE_FLAG([-Wparentheses], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -Wparentheses"])
AX_CHECK_COMPILE_FLAG([-Winit-self], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -Winit-self"])
AX_CHECK_COMPILE_FLAG([-Wunused-but-set-parameter], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -Wunused-but-set-parameter"])
AX_CHECK_COMPILE_FLAG([-Waddress], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -Waddress"])
AX_CHECK_COMPILE_FLAG([-Wuninitialized], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -Wuninitialized"])
AX_CHECK_COMPILE_FLAG([-Wformat=2], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -Wformat=2"])
AX_CHECK_COMPILE_FLAG([-Wformat-nonliteral], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -Wformat-nonliteral"])
AX_CHECK_COMPILE_FLAG([-fstrict-aliasing -Wstrict-aliasing=2], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -fstrict-aliasing -Wstrict-aliasing=2"])
AX_CHECK_COMPILE_FLAG([-Wmissing-parameter-type], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -Wmissing-parameter-type"])
AX_CHECK_COMPILE_FLAG([-Wold-style-definition], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -Wold-style-definition"])
AX_CHECK_COMPILE_FLAG([-Wignored-qualifiers], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -Wignored-qualifiers"])
AX_CHECK_COMPILE_FLAG([-fstrict-aliasing -Wstrict-aliasing], [DEFAULT_CFLAGS="$DEFAULT_CFLAGS -fstrict-aliasing -Wstrict-aliasing"])
AX_CHECK_LINK_FLAG([-Wl,--discard-all], [DEFAULT_LDLAGS="$DEFAULT_LDLAGS -Wl,--discard-all"])
AX_CHECK_LINK_FLAG([-Wl,--no-undefined], [DEFAULT_LDLAGS="$DEFAULT_LDLAGS -Wl,--no-undefined"])
@@ -107,6 +113,9 @@ AC_CHECK_TYPE(sa_family_t, [], [AC_DEFINE([sa_family_t], [uint16_t], [sa_family_
#include <netinet/in.h>
])
# check wether misaligned access is possible or not
AX_CHECK_ALIGNED_ACCESS_REQUIRED
### zlib
CHECK_ZLIB()

48
debian/changelog vendored
View File

@@ -1,4 +1,50 @@
httrack (3.48.10) unstable; urgency=low
httrack (3.48.17-1) unstable; urgency=low
* Updated to 3.48.17 (3.48-17)
-- Xavier Roche <xavier@debian.org> Sat, 12 Jul 2014 15:21:14 +0200
httrack (3.48.16-1) unstable; urgency=low
* Updated to 3.48.16 (3.48-16)
fixed FTBFS on ARM/MIPS again
-- Xavier Roche <xavier@debian.org> Wed, 09 Jul 2014 07:02:08 +0200
httrack (3.48.15-1) unstable; urgency=low
* Updated to 3.48.15 (3.48-15)
fixed FTBFS on ARM/MIPS
-- Xavier Roche <xavier@debian.org> Tue, 08 Jul 2014 22:05:14 +0200
httrack (3.48.14-1) unstable; urgency=low
* Updated to 3.48.14 (3.48-14)
-- Xavier Roche <xavier@debian.org> Tue, 08 Jul 2014 20:36:55 +0200
httrack (3.48.13-1) unstable; urgency=low
* Updated to 3.48.13 (3.48-13)
closes:#750931
-- Xavier Roche <xavier@debian.org> Sun, 08 Jun 2014 16:22:13 +0200
httrack (3.48.12-1) unstable; urgency=low
* Updated to 3.48.12 (3.48-12)
Should fix missing/broken .h for libhttrack-dev
-- Xavier Roche <xavier@debian.org> Sun, 08 Jun 2014 13:19:49 +0200
httrack (3.48.11-1) unstable; urgency=low
* Updated to 3.48.11 (3.48-11)
-- Xavier Roche <xavier@debian.org> Fri, 06 Jun 2014 17:58:12 +0200
httrack (3.48.10-1) unstable; urgency=low
* Updated to 3.48.10 (3.48-10)

View File

@@ -4,12 +4,23 @@ HTTrack Website Copier release history:
This file lists all changes and fixes that have been made for HTTrack.
3.48-10
3.48-17
+ Fixed: URL list not working anymore (tom swift)
+ Fixed: FTBFS on ARM
+ Fixed: buggy FFFD (replacement character) in place of leading non-ascii character such as Chinese ones (aballboy)
+ Fixed: FTBFS when compiling with zlib versions < 1.2.70 (sammyx)
+ Fixed: buggy SVG (Smiling Spectre)
+ Fixed: do not uncompress .tgz advertised as "streamed" (Smiling Spectre)
+ Fixed: NULL pointer dereferencing in back_unserialize (htsback.c:976)
+ Fixed: library development files
+ Fixed: --advanced-maxlinks broken (Localhost)
+ Fixed: -devel package should now be standalone
+ Fixed: assertion failure at htscore.c:244 (len + liensbuf->string_buffer_size < liensbuf->string_buffer_capa)
+ Fixed: injection-proof templates
+ Fixed: htshash.c:330 assertion failure ("error invalidating hash entry") (Sergey)
+ Fixed: Windows 2000 regression (fantozzi.usenet)
+ Fixed: code cleanup (aliasing issues, const correctness, safe strings)
+ New: handle --max-links 0 to disable maximum link limits
+ New: handle --advanced-maxlinks=0 to disable maximum link limits
+ New: updated ZIP routines (zlib 1.2.8)
+ Fixed: broken 32-bit version
+ Fixed: assertion "segOutputSize < segSize assertion fails at htscharset.c:993"

View File

@@ -1032,8 +1032,8 @@ HTTP headers (&minus;F &quot;user&minus;agent name&quot;)
<td width="78%">
<p>accepted formats (&minus;%l
&quot;text/html,image/png,image/jpeg,image/gif;q=0.9,*/*;q=0.1&quot;
<p>accepted formats (&minus;%a
&quot;text/html,image/png;q=0.9,*/*;q=0.1&quot;
(&minus;&minus;accept &lt;param&gt;)</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>

View File

@@ -3,7 +3,7 @@ exemplesdir = $(datadir)/httrack/libtest
exemples_DATA = *.c *.h *.txt
EXTRA_DIST = $(exemples_DATA)
INCLUDES = \
AM_CPPFLAGS = \
@DEFAULT_CFLAGS@ \
@THREADS_CFLAGS@ \
@V6_FLAG@ \
@@ -13,7 +13,7 @@ INCLUDES = \
-DDATADIR=\""$(datadir)"\" \
-DLIBDIR=\""$(libdir)"\"
AM_CPPFLAGS = -I../src
AM_CPPFLAGS += -I../src
AM_LDFLAGS = -L../src
# Examples

View File

@@ -334,17 +334,9 @@ top_srcdir = @top_srcdir@
exemplesdir = $(datadir)/httrack/libtest
exemples_DATA = *.c *.h *.txt
EXTRA_DIST = $(exemples_DATA)
INCLUDES = \
@DEFAULT_CFLAGS@ \
@THREADS_CFLAGS@ \
@V6_FLAG@ \
@LFS_FLAG@ \
-DPREFIX=\""$(prefix)"\" \
-DSYSCONFDIR=\""$(sysconfdir)"\" \
-DDATADIR=\""$(datadir)"\" \
-DLIBDIR=\""$(libdir)"\"
AM_CPPFLAGS = -I../src
AM_CPPFLAGS = @DEFAULT_CFLAGS@ @THREADS_CFLAGS@ @V6_FLAG@ @LFS_FLAG@ \
-DPREFIX=\""$(prefix)"\" -DSYSCONFDIR=\""$(sysconfdir)"\" \
-DDATADIR=\""$(datadir)"\" -DLIBDIR=\""$(libdir)"\" -I../src
AM_LDFLAGS = -L../src
# Examples
@@ -484,22 +476,25 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/callbacks-example-simple.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<

View File

@@ -100,9 +100,9 @@ EXTERNAL_FUNCTION int hts_plug(httrackp * opt, const char *argv) {
if (arg == NULL)
arg = "log-wrapper-info";
hts_log(opt, arg, "* plugging functions");
CHAIN_FUNCTION(opt, check_html, process_file, (char *) arg);
CHAIN_FUNCTION(opt, start, start_of_mirror, (char *) arg);
CHAIN_FUNCTION(opt, end, end_of_mirror, (char *) arg);
CHAIN_FUNCTION(opt, check_html, process_file, (void *) (uintptr_t) arg);
CHAIN_FUNCTION(opt, start, start_of_mirror, (void *) (uintptr_t) arg);
CHAIN_FUNCTION(opt, end, end_of_mirror, (void *) (uintptr_t) arg);
hts_log(opt, arg, "* module successfully plugged");
return 1; /* success */

View File

@@ -1,7 +1,7 @@
.\" Process this file with
.\" groff -man -Tascii httrack.1
.\"
.TH httrack 1 "04 June 2014" "httrack website copier"
.TH httrack 1 "12 July 2014" "httrack website copier"
.SH NAME
httrack \- offline browser : copy websites to a local directory
.SH SYNOPSIS
@@ -347,7 +347,7 @@ footer string in Html code (\-%F "Mirrored [from host %s [file %s [at %s]]]" (\-
.IP \-%l
preffered language (\-%l "fr, en, jp, *" (\-\-language <param>)
.IP \-%a
accepted formats (\-%l "text/html,image/png,image/jpeg,image/gif;q=0.9,*/*;q=0.1" (\-\-accept <param>)
accepted formats (\-%a "text/html,image/png;q=0.9,*/*;q=0.1" (\-\-accept <param>)
.IP \-%X
additional HTTP header line (\-%X "X\-Magic: 42" (\-\-headers <param>)

View File

@@ -8,10 +8,14 @@ DevIncludes_DATA = \
../config.h \
htsmodules.h \
htsbasenet.h \
htsnet.h \
htsbauth.h \
htsdefines.h
htsdefines.h \
htsstrings.h \
htsarrays.h \
htssafe.h
INCLUDES = \
AM_CPPFLAGS = \
@DEFAULT_CFLAGS@ \
@THREADS_CFLAGS@ \
@V6_FLAG@ \
@@ -26,21 +30,22 @@ bin_PROGRAMS = proxytrack httrack htsserver
httrack_LDADD = $(THREADS_LIBS) libhttrack.la
htsserver_LDADD = $(THREADS_LIBS) $(SOCKET_LIBS) libhttrack.la
proxytrack_LDADD = $(THREADS_LIBS) $(SOCKET_LIBS)
proxytrack_CFLAGS = $(AM_CFLAGS) -DNO_MALLOCT
proxytrack_CFLAGS = $(AM_CFLAGS) -DNO_MALLOCT -DZLIB_CONST -DHTS_INTHASH_USES_MD5
htsserver_CFLAGS = $(AM_CFLAGS) -DZLIB_CONST -DHTS_INTHASH_USES_MD5
lib_LTLIBRARIES = libhttrack.la libhtsjava.la
htsserver_SOURCES = htsserver.c htsserver.h htsweb.c htsweb.h
proxytrack_SOURCES = proxy/main.c \
proxy/proxytrack.c proxy/store.c \
htsinthash.c htsmd5.c md5.c \
coucal.c htsmd5.c md5.c \
minizip/ioapi.c minizip/mztools.c minizip/unzip.c minizip/zip.c
whttrackrundir = $(bindir)
whttrackrun_SCRIPTS = webhttrack
libhttrack_la_SOURCES = htscore.c htsparse.c htsback.c htscache.c \
htscatchurl.c htsfilters.c htsftp.c htshash.c htsinthash.c \
htscatchurl.c htsfilters.c htsftp.c htshash.c coucal.c \
htshelp.c htslib.c htscoremain.c \
htsname.c htsrobots.c htstools.c htswizard.c \
htsalias.c htsthread.c htsindex.c htsbauth.c \
@@ -51,17 +56,18 @@ libhttrack_la_SOURCES = htscore.c htsparse.c htsback.c htscache.c \
hts-indextmpl.h htsalias.h htsback.h htsbase.h htssafe.h \
htsbasenet.h htsbauth.h htscache.h htscatchurl.h \
htsconfig.h htscore.h htsparse.h htscoremain.h htsdefines.h \
htsfilters.h htsftp.h htsglobal.h htshash.h htsinthash.h \
htsfilters.h htsftp.h htsglobal.h htshash.h coucal.h \
htshelp.h htsindex.h htslib.h htsmd5.h \
htsmodules.h htsname.h htsnet.h \
htsopt.h htsrobots.h htsthread.h \
htstools.h htswizard.h htswrap.h htszlib.h \
htsstrings.h httrack-library.h htscharset.h punycode.h htsencoding.h \
htsstrings.h htsarrays.h httrack-library.h \
htscharset.h punycode.h htsencoding.h \
htsentities.h htsentities.sh htsbasiccharsets.sh htscodepages.h \
md5.h murmurhash3.h \
minizip/crypt.h minizip/ioapi.h minizip/mztools.h minizip/unzip.h minizip/zip.h
libhttrack_la_LIBADD = $(THREADS_LIBS) $(ZLIB_LIBS) $(OPENSSL_LIBS) $(DL_LIBS) $(SOCKET_LIBS) $(ICONV_LIBS)
libhttrack_la_CFLAGS = $(AM_CFLAGS) -DLIBHTTRACK_EXPORTS
libhttrack_la_CFLAGS = $(AM_CFLAGS) -DLIBHTTRACK_EXPORTS -DZLIB_CONST
libhttrack_la_LDFLAGS = -version-info $(VERSION_INFO)
libhtsjava_la_SOURCES = htsjava.c htsjava.h
@@ -69,12 +75,20 @@ libhtsjava_la_LIBADD = $(THREADS_LIBS) $(DL_LIBS) libhttrack.la
libhtsjava_la_LDFLAGS = -version-info $(VERSION_INFO)
EXTRA_DIST = httrack.h webhttrack \
murmurhash3.h.diff \
murmurhash3.h.orig \
minizip/iowin32.c \
minizip/iowin32.h \
minizip/ioapi.c.diff \
minizip/ioapi.h.diff \
minizip/zip.c.diff \
minizip/zip.h.diff \
minizip/mztools.c.diff \
minizip/ioapi.c.orig \
minizip/ioapi.h.orig \
minizip/mztools.c.orig \
minizip/zip.c.orig \
minizip/zip.h.orig \
minizip/MiniZip64_Changes.txt \
minizip/MiniZip64_info.txt \
proxy/AUTHORS \

View File

@@ -110,11 +110,12 @@ libhtsjava_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
libhttrack_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
am__dirstamp = $(am__leading_dot)dirstamp
am_libhttrack_la_OBJECTS = libhttrack_la-htscore.lo \
libhttrack_la-htsparse.lo libhttrack_la-htsback.lo \
libhttrack_la-htscache.lo libhttrack_la-htscatchurl.lo \
libhttrack_la-htsfilters.lo libhttrack_la-htsftp.lo \
libhttrack_la-htshash.lo libhttrack_la-htsinthash.lo \
libhttrack_la-htshash.lo libhttrack_la-coucal.lo \
libhttrack_la-htshelp.lo libhttrack_la-htslib.lo \
libhttrack_la-htscoremain.lo libhttrack_la-htsname.lo \
libhttrack_la-htsrobots.lo libhttrack_la-htstools.lo \
@@ -125,26 +126,33 @@ am_libhttrack_la_OBJECTS = libhttrack_la-htscore.lo \
libhttrack_la-htsconcat.lo libhttrack_la-htsmodules.lo \
libhttrack_la-htscharset.lo libhttrack_la-punycode.lo \
libhttrack_la-htsencoding.lo libhttrack_la-md5.lo \
libhttrack_la-ioapi.lo libhttrack_la-mztools.lo \
libhttrack_la-unzip.lo libhttrack_la-zip.lo
minizip/libhttrack_la-ioapi.lo \
minizip/libhttrack_la-mztools.lo \
minizip/libhttrack_la-unzip.lo minizip/libhttrack_la-zip.lo
libhttrack_la_OBJECTS = $(am_libhttrack_la_OBJECTS)
libhttrack_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(libhttrack_la_CFLAGS) \
$(CFLAGS) $(libhttrack_la_LDFLAGS) $(LDFLAGS) -o $@
PROGRAMS = $(bin_PROGRAMS)
am_htsserver_OBJECTS = htsserver.$(OBJEXT) htsweb.$(OBJEXT)
am_htsserver_OBJECTS = htsserver-htsserver.$(OBJEXT) \
htsserver-htsweb.$(OBJEXT)
htsserver_OBJECTS = $(am_htsserver_OBJECTS)
htsserver_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
libhttrack.la
htsserver_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(htsserver_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
httrack_SOURCES = httrack.c
httrack_OBJECTS = httrack.$(OBJEXT)
httrack_DEPENDENCIES = $(am__DEPENDENCIES_1) libhttrack.la
am_proxytrack_OBJECTS = proxytrack-main.$(OBJEXT) \
proxytrack-proxytrack.$(OBJEXT) proxytrack-store.$(OBJEXT) \
proxytrack-htsinthash.$(OBJEXT) proxytrack-htsmd5.$(OBJEXT) \
proxytrack-md5.$(OBJEXT) proxytrack-ioapi.$(OBJEXT) \
proxytrack-mztools.$(OBJEXT) proxytrack-unzip.$(OBJEXT) \
proxytrack-zip.$(OBJEXT)
am_proxytrack_OBJECTS = proxy/proxytrack-main.$(OBJEXT) \
proxy/proxytrack-proxytrack.$(OBJEXT) \
proxy/proxytrack-store.$(OBJEXT) proxytrack-coucal.$(OBJEXT) \
proxytrack-htsmd5.$(OBJEXT) proxytrack-md5.$(OBJEXT) \
minizip/proxytrack-ioapi.$(OBJEXT) \
minizip/proxytrack-mztools.$(OBJEXT) \
minizip/proxytrack-unzip.$(OBJEXT) \
minizip/proxytrack-zip.$(OBJEXT)
proxytrack_OBJECTS = $(am_proxytrack_OBJECTS)
proxytrack_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
proxytrack_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
@@ -319,10 +327,14 @@ DevIncludes_DATA = \
../config.h \
htsmodules.h \
htsbasenet.h \
htsnet.h \
htsbauth.h \
htsdefines.h
htsdefines.h \
htsstrings.h \
htsarrays.h \
htssafe.h
INCLUDES = \
AM_CPPFLAGS = \
@DEFAULT_CFLAGS@ \
@THREADS_CFLAGS@ \
@V6_FLAG@ \
@@ -335,18 +347,19 @@ INCLUDES = \
httrack_LDADD = $(THREADS_LIBS) libhttrack.la
htsserver_LDADD = $(THREADS_LIBS) $(SOCKET_LIBS) libhttrack.la
proxytrack_LDADD = $(THREADS_LIBS) $(SOCKET_LIBS)
proxytrack_CFLAGS = $(AM_CFLAGS) -DNO_MALLOCT
proxytrack_CFLAGS = $(AM_CFLAGS) -DNO_MALLOCT -DZLIB_CONST -DHTS_INTHASH_USES_MD5
htsserver_CFLAGS = $(AM_CFLAGS) -DZLIB_CONST -DHTS_INTHASH_USES_MD5
lib_LTLIBRARIES = libhttrack.la libhtsjava.la
htsserver_SOURCES = htsserver.c htsserver.h htsweb.c htsweb.h
proxytrack_SOURCES = proxy/main.c \
proxy/proxytrack.c proxy/store.c \
htsinthash.c htsmd5.c md5.c \
coucal.c htsmd5.c md5.c \
minizip/ioapi.c minizip/mztools.c minizip/unzip.c minizip/zip.c
whttrackrundir = $(bindir)
whttrackrun_SCRIPTS = webhttrack
libhttrack_la_SOURCES = htscore.c htsparse.c htsback.c htscache.c \
htscatchurl.c htsfilters.c htsftp.c htshash.c htsinthash.c \
htscatchurl.c htsfilters.c htsftp.c htshash.c coucal.c \
htshelp.c htslib.c htscoremain.c \
htsname.c htsrobots.c htstools.c htswizard.c \
htsalias.c htsthread.c htsindex.c htsbauth.c \
@@ -357,29 +370,38 @@ libhttrack_la_SOURCES = htscore.c htsparse.c htsback.c htscache.c \
hts-indextmpl.h htsalias.h htsback.h htsbase.h htssafe.h \
htsbasenet.h htsbauth.h htscache.h htscatchurl.h \
htsconfig.h htscore.h htsparse.h htscoremain.h htsdefines.h \
htsfilters.h htsftp.h htsglobal.h htshash.h htsinthash.h \
htsfilters.h htsftp.h htsglobal.h htshash.h coucal.h \
htshelp.h htsindex.h htslib.h htsmd5.h \
htsmodules.h htsname.h htsnet.h \
htsopt.h htsrobots.h htsthread.h \
htstools.h htswizard.h htswrap.h htszlib.h \
htsstrings.h httrack-library.h htscharset.h punycode.h htsencoding.h \
htsstrings.h htsarrays.h httrack-library.h \
htscharset.h punycode.h htsencoding.h \
htsentities.h htsentities.sh htsbasiccharsets.sh htscodepages.h \
md5.h murmurhash3.h \
minizip/crypt.h minizip/ioapi.h minizip/mztools.h minizip/unzip.h minizip/zip.h
libhttrack_la_LIBADD = $(THREADS_LIBS) $(ZLIB_LIBS) $(OPENSSL_LIBS) $(DL_LIBS) $(SOCKET_LIBS) $(ICONV_LIBS)
libhttrack_la_CFLAGS = $(AM_CFLAGS) -DLIBHTTRACK_EXPORTS
libhttrack_la_CFLAGS = $(AM_CFLAGS) -DLIBHTTRACK_EXPORTS -DZLIB_CONST
libhttrack_la_LDFLAGS = -version-info $(VERSION_INFO)
libhtsjava_la_SOURCES = htsjava.c htsjava.h
libhtsjava_la_LIBADD = $(THREADS_LIBS) $(DL_LIBS) libhttrack.la
libhtsjava_la_LDFLAGS = -version-info $(VERSION_INFO)
EXTRA_DIST = httrack.h webhttrack \
murmurhash3.h.diff \
murmurhash3.h.orig \
minizip/iowin32.c \
minizip/iowin32.h \
minizip/ioapi.c.diff \
minizip/ioapi.h.diff \
minizip/zip.c.diff \
minizip/zip.h.diff \
minizip/mztools.c.diff \
minizip/ioapi.c.orig \
minizip/ioapi.h.orig \
minizip/mztools.c.orig \
minizip/zip.c.orig \
minizip/zip.h.orig \
minizip/MiniZip64_Changes.txt \
minizip/MiniZip64_info.txt \
proxy/AUTHORS \
@@ -458,6 +480,20 @@ clean-libLTLIBRARIES:
done
libhtsjava.la: $(libhtsjava_la_OBJECTS) $(libhtsjava_la_DEPENDENCIES) $(EXTRA_libhtsjava_la_DEPENDENCIES)
$(libhtsjava_la_LINK) -rpath $(libdir) $(libhtsjava_la_OBJECTS) $(libhtsjava_la_LIBADD) $(LIBS)
minizip/$(am__dirstamp):
@$(MKDIR_P) minizip
@: > minizip/$(am__dirstamp)
minizip/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) minizip/$(DEPDIR)
@: > minizip/$(DEPDIR)/$(am__dirstamp)
minizip/libhttrack_la-ioapi.lo: minizip/$(am__dirstamp) \
minizip/$(DEPDIR)/$(am__dirstamp)
minizip/libhttrack_la-mztools.lo: minizip/$(am__dirstamp) \
minizip/$(DEPDIR)/$(am__dirstamp)
minizip/libhttrack_la-unzip.lo: minizip/$(am__dirstamp) \
minizip/$(DEPDIR)/$(am__dirstamp)
minizip/libhttrack_la-zip.lo: minizip/$(am__dirstamp) \
minizip/$(DEPDIR)/$(am__dirstamp)
libhttrack.la: $(libhttrack_la_OBJECTS) $(libhttrack_la_DEPENDENCIES) $(EXTRA_libhttrack_la_DEPENDENCIES)
$(libhttrack_la_LINK) -rpath $(libdir) $(libhttrack_la_OBJECTS) $(libhttrack_la_LIBADD) $(LIBS)
install-binPROGRAMS: $(bin_PROGRAMS)
@@ -508,10 +544,30 @@ clean-binPROGRAMS:
rm -f $$list
htsserver$(EXEEXT): $(htsserver_OBJECTS) $(htsserver_DEPENDENCIES) $(EXTRA_htsserver_DEPENDENCIES)
@rm -f htsserver$(EXEEXT)
$(LINK) $(htsserver_OBJECTS) $(htsserver_LDADD) $(LIBS)
$(htsserver_LINK) $(htsserver_OBJECTS) $(htsserver_LDADD) $(LIBS)
httrack$(EXEEXT): $(httrack_OBJECTS) $(httrack_DEPENDENCIES) $(EXTRA_httrack_DEPENDENCIES)
@rm -f httrack$(EXEEXT)
$(LINK) $(httrack_OBJECTS) $(httrack_LDADD) $(LIBS)
proxy/$(am__dirstamp):
@$(MKDIR_P) proxy
@: > proxy/$(am__dirstamp)
proxy/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) proxy/$(DEPDIR)
@: > proxy/$(DEPDIR)/$(am__dirstamp)
proxy/proxytrack-main.$(OBJEXT): proxy/$(am__dirstamp) \
proxy/$(DEPDIR)/$(am__dirstamp)
proxy/proxytrack-proxytrack.$(OBJEXT): proxy/$(am__dirstamp) \
proxy/$(DEPDIR)/$(am__dirstamp)
proxy/proxytrack-store.$(OBJEXT): proxy/$(am__dirstamp) \
proxy/$(DEPDIR)/$(am__dirstamp)
minizip/proxytrack-ioapi.$(OBJEXT): minizip/$(am__dirstamp) \
minizip/$(DEPDIR)/$(am__dirstamp)
minizip/proxytrack-mztools.$(OBJEXT): minizip/$(am__dirstamp) \
minizip/$(DEPDIR)/$(am__dirstamp)
minizip/proxytrack-unzip.$(OBJEXT): minizip/$(am__dirstamp) \
minizip/$(DEPDIR)/$(am__dirstamp)
minizip/proxytrack-zip.$(OBJEXT): minizip/$(am__dirstamp) \
minizip/$(DEPDIR)/$(am__dirstamp)
proxytrack$(EXEEXT): $(proxytrack_OBJECTS) $(proxytrack_DEPENDENCIES) $(EXTRA_proxytrack_DEPENDENCIES)
@rm -f proxytrack$(EXEEXT)
$(proxytrack_LINK) $(proxytrack_OBJECTS) $(proxytrack_LDADD) $(LIBS)
@@ -553,14 +609,30 @@ uninstall-whttrackrunSCRIPTS:
mostlyclean-compile:
-rm -f *.$(OBJEXT)
-rm -f minizip/libhttrack_la-ioapi.$(OBJEXT)
-rm -f minizip/libhttrack_la-ioapi.lo
-rm -f minizip/libhttrack_la-mztools.$(OBJEXT)
-rm -f minizip/libhttrack_la-mztools.lo
-rm -f minizip/libhttrack_la-unzip.$(OBJEXT)
-rm -f minizip/libhttrack_la-unzip.lo
-rm -f minizip/libhttrack_la-zip.$(OBJEXT)
-rm -f minizip/libhttrack_la-zip.lo
-rm -f minizip/proxytrack-ioapi.$(OBJEXT)
-rm -f minizip/proxytrack-mztools.$(OBJEXT)
-rm -f minizip/proxytrack-unzip.$(OBJEXT)
-rm -f minizip/proxytrack-zip.$(OBJEXT)
-rm -f proxy/proxytrack-main.$(OBJEXT)
-rm -f proxy/proxytrack-proxytrack.$(OBJEXT)
-rm -f proxy/proxytrack-store.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htsjava.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htsserver.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htsweb.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htsserver-htsserver.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htsserver-htsweb.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/httrack.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-coucal.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htsalias.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htsback.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htsbauth.Plo@am__quote@
@@ -576,7 +648,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htshash.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htshelp.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htsindex.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htsinthash.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htslib.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htsmd5.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htsmodules.Plo@am__quote@
@@ -588,40 +659,43 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htswizard.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htswrap.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-htszlib.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-ioapi.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-md5.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-mztools.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-punycode.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-unzip.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libhttrack_la-zip.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxytrack-htsinthash.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxytrack-coucal.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxytrack-htsmd5.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxytrack-ioapi.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxytrack-main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxytrack-md5.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxytrack-mztools.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxytrack-proxytrack.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxytrack-store.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxytrack-unzip.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxytrack-zip.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@minizip/$(DEPDIR)/libhttrack_la-ioapi.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@minizip/$(DEPDIR)/libhttrack_la-mztools.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@minizip/$(DEPDIR)/libhttrack_la-unzip.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@minizip/$(DEPDIR)/libhttrack_la-zip.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@minizip/$(DEPDIR)/proxytrack-ioapi.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@minizip/$(DEPDIR)/proxytrack-mztools.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@minizip/$(DEPDIR)/proxytrack-unzip.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@minizip/$(DEPDIR)/proxytrack-zip.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@proxy/$(DEPDIR)/proxytrack-main.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@proxy/$(DEPDIR)/proxytrack-proxytrack.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@proxy/$(DEPDIR)/proxytrack-store.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
@am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
@@ -682,12 +756,12 @@ libhttrack_la-htshash.lo: htshash.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htshash.lo `test -f 'htshash.c' || echo '$(srcdir)/'`htshash.c
libhttrack_la-htsinthash.lo: htsinthash.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htsinthash.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htsinthash.Tpo -c -o libhttrack_la-htsinthash.lo `test -f 'htsinthash.c' || echo '$(srcdir)/'`htsinthash.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-htsinthash.Tpo $(DEPDIR)/libhttrack_la-htsinthash.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htsinthash.c' object='libhttrack_la-htsinthash.lo' libtool=yes @AMDEPBACKSLASH@
libhttrack_la-coucal.lo: coucal.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-coucal.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-coucal.Tpo -c -o libhttrack_la-coucal.lo `test -f 'coucal.c' || echo '$(srcdir)/'`coucal.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-coucal.Tpo $(DEPDIR)/libhttrack_la-coucal.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='coucal.c' object='libhttrack_la-coucal.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-htsinthash.lo `test -f 'htsinthash.c' || echo '$(srcdir)/'`htsinthash.c
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-coucal.lo `test -f 'coucal.c' || echo '$(srcdir)/'`coucal.c
libhttrack_la-htshelp.lo: htshelp.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-htshelp.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-htshelp.Tpo -c -o libhttrack_la-htshelp.lo `test -f 'htshelp.c' || echo '$(srcdir)/'`htshelp.c
@@ -829,89 +903,117 @@ libhttrack_la-md5.lo: md5.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-md5.lo `test -f 'md5.c' || echo '$(srcdir)/'`md5.c
libhttrack_la-ioapi.lo: minizip/ioapi.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-ioapi.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-ioapi.Tpo -c -o libhttrack_la-ioapi.lo `test -f 'minizip/ioapi.c' || echo '$(srcdir)/'`minizip/ioapi.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-ioapi.Tpo $(DEPDIR)/libhttrack_la-ioapi.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/ioapi.c' object='libhttrack_la-ioapi.lo' libtool=yes @AMDEPBACKSLASH@
minizip/libhttrack_la-ioapi.lo: minizip/ioapi.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT minizip/libhttrack_la-ioapi.lo -MD -MP -MF minizip/$(DEPDIR)/libhttrack_la-ioapi.Tpo -c -o minizip/libhttrack_la-ioapi.lo `test -f 'minizip/ioapi.c' || echo '$(srcdir)/'`minizip/ioapi.c
@am__fastdepCC_TRUE@ $(am__mv) minizip/$(DEPDIR)/libhttrack_la-ioapi.Tpo minizip/$(DEPDIR)/libhttrack_la-ioapi.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/ioapi.c' object='minizip/libhttrack_la-ioapi.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-ioapi.lo `test -f 'minizip/ioapi.c' || echo '$(srcdir)/'`minizip/ioapi.c
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o minizip/libhttrack_la-ioapi.lo `test -f 'minizip/ioapi.c' || echo '$(srcdir)/'`minizip/ioapi.c
libhttrack_la-mztools.lo: minizip/mztools.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-mztools.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-mztools.Tpo -c -o libhttrack_la-mztools.lo `test -f 'minizip/mztools.c' || echo '$(srcdir)/'`minizip/mztools.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-mztools.Tpo $(DEPDIR)/libhttrack_la-mztools.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/mztools.c' object='libhttrack_la-mztools.lo' libtool=yes @AMDEPBACKSLASH@
minizip/libhttrack_la-mztools.lo: minizip/mztools.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT minizip/libhttrack_la-mztools.lo -MD -MP -MF minizip/$(DEPDIR)/libhttrack_la-mztools.Tpo -c -o minizip/libhttrack_la-mztools.lo `test -f 'minizip/mztools.c' || echo '$(srcdir)/'`minizip/mztools.c
@am__fastdepCC_TRUE@ $(am__mv) minizip/$(DEPDIR)/libhttrack_la-mztools.Tpo minizip/$(DEPDIR)/libhttrack_la-mztools.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/mztools.c' object='minizip/libhttrack_la-mztools.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-mztools.lo `test -f 'minizip/mztools.c' || echo '$(srcdir)/'`minizip/mztools.c
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o minizip/libhttrack_la-mztools.lo `test -f 'minizip/mztools.c' || echo '$(srcdir)/'`minizip/mztools.c
libhttrack_la-unzip.lo: minizip/unzip.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-unzip.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-unzip.Tpo -c -o libhttrack_la-unzip.lo `test -f 'minizip/unzip.c' || echo '$(srcdir)/'`minizip/unzip.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-unzip.Tpo $(DEPDIR)/libhttrack_la-unzip.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/unzip.c' object='libhttrack_la-unzip.lo' libtool=yes @AMDEPBACKSLASH@
minizip/libhttrack_la-unzip.lo: minizip/unzip.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT minizip/libhttrack_la-unzip.lo -MD -MP -MF minizip/$(DEPDIR)/libhttrack_la-unzip.Tpo -c -o minizip/libhttrack_la-unzip.lo `test -f 'minizip/unzip.c' || echo '$(srcdir)/'`minizip/unzip.c
@am__fastdepCC_TRUE@ $(am__mv) minizip/$(DEPDIR)/libhttrack_la-unzip.Tpo minizip/$(DEPDIR)/libhttrack_la-unzip.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/unzip.c' object='minizip/libhttrack_la-unzip.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-unzip.lo `test -f 'minizip/unzip.c' || echo '$(srcdir)/'`minizip/unzip.c
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o minizip/libhttrack_la-unzip.lo `test -f 'minizip/unzip.c' || echo '$(srcdir)/'`minizip/unzip.c
libhttrack_la-zip.lo: minizip/zip.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT libhttrack_la-zip.lo -MD -MP -MF $(DEPDIR)/libhttrack_la-zip.Tpo -c -o libhttrack_la-zip.lo `test -f 'minizip/zip.c' || echo '$(srcdir)/'`minizip/zip.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libhttrack_la-zip.Tpo $(DEPDIR)/libhttrack_la-zip.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/zip.c' object='libhttrack_la-zip.lo' libtool=yes @AMDEPBACKSLASH@
minizip/libhttrack_la-zip.lo: minizip/zip.c
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -MT minizip/libhttrack_la-zip.lo -MD -MP -MF minizip/$(DEPDIR)/libhttrack_la-zip.Tpo -c -o minizip/libhttrack_la-zip.lo `test -f 'minizip/zip.c' || echo '$(srcdir)/'`minizip/zip.c
@am__fastdepCC_TRUE@ $(am__mv) minizip/$(DEPDIR)/libhttrack_la-zip.Tpo minizip/$(DEPDIR)/libhttrack_la-zip.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/zip.c' object='minizip/libhttrack_la-zip.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o libhttrack_la-zip.lo `test -f 'minizip/zip.c' || echo '$(srcdir)/'`minizip/zip.c
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libhttrack_la_CFLAGS) $(CFLAGS) -c -o minizip/libhttrack_la-zip.lo `test -f 'minizip/zip.c' || echo '$(srcdir)/'`minizip/zip.c
proxytrack-main.o: proxy/main.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxytrack-main.o -MD -MP -MF $(DEPDIR)/proxytrack-main.Tpo -c -o proxytrack-main.o `test -f 'proxy/main.c' || echo '$(srcdir)/'`proxy/main.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/proxytrack-main.Tpo $(DEPDIR)/proxytrack-main.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='proxy/main.c' object='proxytrack-main.o' libtool=no @AMDEPBACKSLASH@
htsserver-htsserver.o: htsserver.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htsserver_CFLAGS) $(CFLAGS) -MT htsserver-htsserver.o -MD -MP -MF $(DEPDIR)/htsserver-htsserver.Tpo -c -o htsserver-htsserver.o `test -f 'htsserver.c' || echo '$(srcdir)/'`htsserver.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htsserver-htsserver.Tpo $(DEPDIR)/htsserver-htsserver.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htsserver.c' object='htsserver-htsserver.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o proxytrack-main.o `test -f 'proxy/main.c' || echo '$(srcdir)/'`proxy/main.c
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htsserver_CFLAGS) $(CFLAGS) -c -o htsserver-htsserver.o `test -f 'htsserver.c' || echo '$(srcdir)/'`htsserver.c
proxytrack-main.obj: proxy/main.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxytrack-main.obj -MD -MP -MF $(DEPDIR)/proxytrack-main.Tpo -c -o proxytrack-main.obj `if test -f 'proxy/main.c'; then $(CYGPATH_W) 'proxy/main.c'; else $(CYGPATH_W) '$(srcdir)/proxy/main.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/proxytrack-main.Tpo $(DEPDIR)/proxytrack-main.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='proxy/main.c' object='proxytrack-main.obj' libtool=no @AMDEPBACKSLASH@
htsserver-htsserver.obj: htsserver.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htsserver_CFLAGS) $(CFLAGS) -MT htsserver-htsserver.obj -MD -MP -MF $(DEPDIR)/htsserver-htsserver.Tpo -c -o htsserver-htsserver.obj `if test -f 'htsserver.c'; then $(CYGPATH_W) 'htsserver.c'; else $(CYGPATH_W) '$(srcdir)/htsserver.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htsserver-htsserver.Tpo $(DEPDIR)/htsserver-htsserver.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htsserver.c' object='htsserver-htsserver.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o proxytrack-main.obj `if test -f 'proxy/main.c'; then $(CYGPATH_W) 'proxy/main.c'; else $(CYGPATH_W) '$(srcdir)/proxy/main.c'; fi`
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htsserver_CFLAGS) $(CFLAGS) -c -o htsserver-htsserver.obj `if test -f 'htsserver.c'; then $(CYGPATH_W) 'htsserver.c'; else $(CYGPATH_W) '$(srcdir)/htsserver.c'; fi`
proxytrack-proxytrack.o: proxy/proxytrack.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxytrack-proxytrack.o -MD -MP -MF $(DEPDIR)/proxytrack-proxytrack.Tpo -c -o proxytrack-proxytrack.o `test -f 'proxy/proxytrack.c' || echo '$(srcdir)/'`proxy/proxytrack.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/proxytrack-proxytrack.Tpo $(DEPDIR)/proxytrack-proxytrack.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='proxy/proxytrack.c' object='proxytrack-proxytrack.o' libtool=no @AMDEPBACKSLASH@
htsserver-htsweb.o: htsweb.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htsserver_CFLAGS) $(CFLAGS) -MT htsserver-htsweb.o -MD -MP -MF $(DEPDIR)/htsserver-htsweb.Tpo -c -o htsserver-htsweb.o `test -f 'htsweb.c' || echo '$(srcdir)/'`htsweb.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htsserver-htsweb.Tpo $(DEPDIR)/htsserver-htsweb.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htsweb.c' object='htsserver-htsweb.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o proxytrack-proxytrack.o `test -f 'proxy/proxytrack.c' || echo '$(srcdir)/'`proxy/proxytrack.c
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htsserver_CFLAGS) $(CFLAGS) -c -o htsserver-htsweb.o `test -f 'htsweb.c' || echo '$(srcdir)/'`htsweb.c
proxytrack-proxytrack.obj: proxy/proxytrack.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxytrack-proxytrack.obj -MD -MP -MF $(DEPDIR)/proxytrack-proxytrack.Tpo -c -o proxytrack-proxytrack.obj `if test -f 'proxy/proxytrack.c'; then $(CYGPATH_W) 'proxy/proxytrack.c'; else $(CYGPATH_W) '$(srcdir)/proxy/proxytrack.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/proxytrack-proxytrack.Tpo $(DEPDIR)/proxytrack-proxytrack.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='proxy/proxytrack.c' object='proxytrack-proxytrack.obj' libtool=no @AMDEPBACKSLASH@
htsserver-htsweb.obj: htsweb.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htsserver_CFLAGS) $(CFLAGS) -MT htsserver-htsweb.obj -MD -MP -MF $(DEPDIR)/htsserver-htsweb.Tpo -c -o htsserver-htsweb.obj `if test -f 'htsweb.c'; then $(CYGPATH_W) 'htsweb.c'; else $(CYGPATH_W) '$(srcdir)/htsweb.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htsserver-htsweb.Tpo $(DEPDIR)/htsserver-htsweb.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htsweb.c' object='htsserver-htsweb.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o proxytrack-proxytrack.obj `if test -f 'proxy/proxytrack.c'; then $(CYGPATH_W) 'proxy/proxytrack.c'; else $(CYGPATH_W) '$(srcdir)/proxy/proxytrack.c'; fi`
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htsserver_CFLAGS) $(CFLAGS) -c -o htsserver-htsweb.obj `if test -f 'htsweb.c'; then $(CYGPATH_W) 'htsweb.c'; else $(CYGPATH_W) '$(srcdir)/htsweb.c'; fi`
proxytrack-store.o: proxy/store.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxytrack-store.o -MD -MP -MF $(DEPDIR)/proxytrack-store.Tpo -c -o proxytrack-store.o `test -f 'proxy/store.c' || echo '$(srcdir)/'`proxy/store.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/proxytrack-store.Tpo $(DEPDIR)/proxytrack-store.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='proxy/store.c' object='proxytrack-store.o' libtool=no @AMDEPBACKSLASH@
proxy/proxytrack-main.o: proxy/main.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxy/proxytrack-main.o -MD -MP -MF proxy/$(DEPDIR)/proxytrack-main.Tpo -c -o proxy/proxytrack-main.o `test -f 'proxy/main.c' || echo '$(srcdir)/'`proxy/main.c
@am__fastdepCC_TRUE@ $(am__mv) proxy/$(DEPDIR)/proxytrack-main.Tpo proxy/$(DEPDIR)/proxytrack-main.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='proxy/main.c' object='proxy/proxytrack-main.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o proxytrack-store.o `test -f 'proxy/store.c' || echo '$(srcdir)/'`proxy/store.c
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o proxy/proxytrack-main.o `test -f 'proxy/main.c' || echo '$(srcdir)/'`proxy/main.c
proxytrack-store.obj: proxy/store.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxytrack-store.obj -MD -MP -MF $(DEPDIR)/proxytrack-store.Tpo -c -o proxytrack-store.obj `if test -f 'proxy/store.c'; then $(CYGPATH_W) 'proxy/store.c'; else $(CYGPATH_W) '$(srcdir)/proxy/store.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/proxytrack-store.Tpo $(DEPDIR)/proxytrack-store.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='proxy/store.c' object='proxytrack-store.obj' libtool=no @AMDEPBACKSLASH@
proxy/proxytrack-main.obj: proxy/main.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxy/proxytrack-main.obj -MD -MP -MF proxy/$(DEPDIR)/proxytrack-main.Tpo -c -o proxy/proxytrack-main.obj `if test -f 'proxy/main.c'; then $(CYGPATH_W) 'proxy/main.c'; else $(CYGPATH_W) '$(srcdir)/proxy/main.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) proxy/$(DEPDIR)/proxytrack-main.Tpo proxy/$(DEPDIR)/proxytrack-main.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='proxy/main.c' object='proxy/proxytrack-main.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o proxytrack-store.obj `if test -f 'proxy/store.c'; then $(CYGPATH_W) 'proxy/store.c'; else $(CYGPATH_W) '$(srcdir)/proxy/store.c'; fi`
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o proxy/proxytrack-main.obj `if test -f 'proxy/main.c'; then $(CYGPATH_W) 'proxy/main.c'; else $(CYGPATH_W) '$(srcdir)/proxy/main.c'; fi`
proxytrack-htsinthash.o: htsinthash.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxytrack-htsinthash.o -MD -MP -MF $(DEPDIR)/proxytrack-htsinthash.Tpo -c -o proxytrack-htsinthash.o `test -f 'htsinthash.c' || echo '$(srcdir)/'`htsinthash.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/proxytrack-htsinthash.Tpo $(DEPDIR)/proxytrack-htsinthash.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htsinthash.c' object='proxytrack-htsinthash.o' libtool=no @AMDEPBACKSLASH@
proxy/proxytrack-proxytrack.o: proxy/proxytrack.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxy/proxytrack-proxytrack.o -MD -MP -MF proxy/$(DEPDIR)/proxytrack-proxytrack.Tpo -c -o proxy/proxytrack-proxytrack.o `test -f 'proxy/proxytrack.c' || echo '$(srcdir)/'`proxy/proxytrack.c
@am__fastdepCC_TRUE@ $(am__mv) proxy/$(DEPDIR)/proxytrack-proxytrack.Tpo proxy/$(DEPDIR)/proxytrack-proxytrack.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='proxy/proxytrack.c' object='proxy/proxytrack-proxytrack.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o proxytrack-htsinthash.o `test -f 'htsinthash.c' || echo '$(srcdir)/'`htsinthash.c
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o proxy/proxytrack-proxytrack.o `test -f 'proxy/proxytrack.c' || echo '$(srcdir)/'`proxy/proxytrack.c
proxytrack-htsinthash.obj: htsinthash.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxytrack-htsinthash.obj -MD -MP -MF $(DEPDIR)/proxytrack-htsinthash.Tpo -c -o proxytrack-htsinthash.obj `if test -f 'htsinthash.c'; then $(CYGPATH_W) 'htsinthash.c'; else $(CYGPATH_W) '$(srcdir)/htsinthash.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/proxytrack-htsinthash.Tpo $(DEPDIR)/proxytrack-htsinthash.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htsinthash.c' object='proxytrack-htsinthash.obj' libtool=no @AMDEPBACKSLASH@
proxy/proxytrack-proxytrack.obj: proxy/proxytrack.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxy/proxytrack-proxytrack.obj -MD -MP -MF proxy/$(DEPDIR)/proxytrack-proxytrack.Tpo -c -o proxy/proxytrack-proxytrack.obj `if test -f 'proxy/proxytrack.c'; then $(CYGPATH_W) 'proxy/proxytrack.c'; else $(CYGPATH_W) '$(srcdir)/proxy/proxytrack.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) proxy/$(DEPDIR)/proxytrack-proxytrack.Tpo proxy/$(DEPDIR)/proxytrack-proxytrack.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='proxy/proxytrack.c' object='proxy/proxytrack-proxytrack.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o proxytrack-htsinthash.obj `if test -f 'htsinthash.c'; then $(CYGPATH_W) 'htsinthash.c'; else $(CYGPATH_W) '$(srcdir)/htsinthash.c'; fi`
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o proxy/proxytrack-proxytrack.obj `if test -f 'proxy/proxytrack.c'; then $(CYGPATH_W) 'proxy/proxytrack.c'; else $(CYGPATH_W) '$(srcdir)/proxy/proxytrack.c'; fi`
proxy/proxytrack-store.o: proxy/store.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxy/proxytrack-store.o -MD -MP -MF proxy/$(DEPDIR)/proxytrack-store.Tpo -c -o proxy/proxytrack-store.o `test -f 'proxy/store.c' || echo '$(srcdir)/'`proxy/store.c
@am__fastdepCC_TRUE@ $(am__mv) proxy/$(DEPDIR)/proxytrack-store.Tpo proxy/$(DEPDIR)/proxytrack-store.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='proxy/store.c' object='proxy/proxytrack-store.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o proxy/proxytrack-store.o `test -f 'proxy/store.c' || echo '$(srcdir)/'`proxy/store.c
proxy/proxytrack-store.obj: proxy/store.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxy/proxytrack-store.obj -MD -MP -MF proxy/$(DEPDIR)/proxytrack-store.Tpo -c -o proxy/proxytrack-store.obj `if test -f 'proxy/store.c'; then $(CYGPATH_W) 'proxy/store.c'; else $(CYGPATH_W) '$(srcdir)/proxy/store.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) proxy/$(DEPDIR)/proxytrack-store.Tpo proxy/$(DEPDIR)/proxytrack-store.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='proxy/store.c' object='proxy/proxytrack-store.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o proxy/proxytrack-store.obj `if test -f 'proxy/store.c'; then $(CYGPATH_W) 'proxy/store.c'; else $(CYGPATH_W) '$(srcdir)/proxy/store.c'; fi`
proxytrack-coucal.o: coucal.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxytrack-coucal.o -MD -MP -MF $(DEPDIR)/proxytrack-coucal.Tpo -c -o proxytrack-coucal.o `test -f 'coucal.c' || echo '$(srcdir)/'`coucal.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/proxytrack-coucal.Tpo $(DEPDIR)/proxytrack-coucal.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='coucal.c' object='proxytrack-coucal.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o proxytrack-coucal.o `test -f 'coucal.c' || echo '$(srcdir)/'`coucal.c
proxytrack-coucal.obj: coucal.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxytrack-coucal.obj -MD -MP -MF $(DEPDIR)/proxytrack-coucal.Tpo -c -o proxytrack-coucal.obj `if test -f 'coucal.c'; then $(CYGPATH_W) 'coucal.c'; else $(CYGPATH_W) '$(srcdir)/coucal.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/proxytrack-coucal.Tpo $(DEPDIR)/proxytrack-coucal.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='coucal.c' object='proxytrack-coucal.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o proxytrack-coucal.obj `if test -f 'coucal.c'; then $(CYGPATH_W) 'coucal.c'; else $(CYGPATH_W) '$(srcdir)/coucal.c'; fi`
proxytrack-htsmd5.o: htsmd5.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxytrack-htsmd5.o -MD -MP -MF $(DEPDIR)/proxytrack-htsmd5.Tpo -c -o proxytrack-htsmd5.o `test -f 'htsmd5.c' || echo '$(srcdir)/'`htsmd5.c
@@ -941,67 +1043,68 @@ proxytrack-md5.obj: md5.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o proxytrack-md5.obj `if test -f 'md5.c'; then $(CYGPATH_W) 'md5.c'; else $(CYGPATH_W) '$(srcdir)/md5.c'; fi`
proxytrack-ioapi.o: minizip/ioapi.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxytrack-ioapi.o -MD -MP -MF $(DEPDIR)/proxytrack-ioapi.Tpo -c -o proxytrack-ioapi.o `test -f 'minizip/ioapi.c' || echo '$(srcdir)/'`minizip/ioapi.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/proxytrack-ioapi.Tpo $(DEPDIR)/proxytrack-ioapi.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/ioapi.c' object='proxytrack-ioapi.o' libtool=no @AMDEPBACKSLASH@
minizip/proxytrack-ioapi.o: minizip/ioapi.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT minizip/proxytrack-ioapi.o -MD -MP -MF minizip/$(DEPDIR)/proxytrack-ioapi.Tpo -c -o minizip/proxytrack-ioapi.o `test -f 'minizip/ioapi.c' || echo '$(srcdir)/'`minizip/ioapi.c
@am__fastdepCC_TRUE@ $(am__mv) minizip/$(DEPDIR)/proxytrack-ioapi.Tpo minizip/$(DEPDIR)/proxytrack-ioapi.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/ioapi.c' object='minizip/proxytrack-ioapi.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o proxytrack-ioapi.o `test -f 'minizip/ioapi.c' || echo '$(srcdir)/'`minizip/ioapi.c
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o minizip/proxytrack-ioapi.o `test -f 'minizip/ioapi.c' || echo '$(srcdir)/'`minizip/ioapi.c
proxytrack-ioapi.obj: minizip/ioapi.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxytrack-ioapi.obj -MD -MP -MF $(DEPDIR)/proxytrack-ioapi.Tpo -c -o proxytrack-ioapi.obj `if test -f 'minizip/ioapi.c'; then $(CYGPATH_W) 'minizip/ioapi.c'; else $(CYGPATH_W) '$(srcdir)/minizip/ioapi.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/proxytrack-ioapi.Tpo $(DEPDIR)/proxytrack-ioapi.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/ioapi.c' object='proxytrack-ioapi.obj' libtool=no @AMDEPBACKSLASH@
minizip/proxytrack-ioapi.obj: minizip/ioapi.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT minizip/proxytrack-ioapi.obj -MD -MP -MF minizip/$(DEPDIR)/proxytrack-ioapi.Tpo -c -o minizip/proxytrack-ioapi.obj `if test -f 'minizip/ioapi.c'; then $(CYGPATH_W) 'minizip/ioapi.c'; else $(CYGPATH_W) '$(srcdir)/minizip/ioapi.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) minizip/$(DEPDIR)/proxytrack-ioapi.Tpo minizip/$(DEPDIR)/proxytrack-ioapi.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/ioapi.c' object='minizip/proxytrack-ioapi.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o proxytrack-ioapi.obj `if test -f 'minizip/ioapi.c'; then $(CYGPATH_W) 'minizip/ioapi.c'; else $(CYGPATH_W) '$(srcdir)/minizip/ioapi.c'; fi`
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o minizip/proxytrack-ioapi.obj `if test -f 'minizip/ioapi.c'; then $(CYGPATH_W) 'minizip/ioapi.c'; else $(CYGPATH_W) '$(srcdir)/minizip/ioapi.c'; fi`
proxytrack-mztools.o: minizip/mztools.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxytrack-mztools.o -MD -MP -MF $(DEPDIR)/proxytrack-mztools.Tpo -c -o proxytrack-mztools.o `test -f 'minizip/mztools.c' || echo '$(srcdir)/'`minizip/mztools.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/proxytrack-mztools.Tpo $(DEPDIR)/proxytrack-mztools.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/mztools.c' object='proxytrack-mztools.o' libtool=no @AMDEPBACKSLASH@
minizip/proxytrack-mztools.o: minizip/mztools.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT minizip/proxytrack-mztools.o -MD -MP -MF minizip/$(DEPDIR)/proxytrack-mztools.Tpo -c -o minizip/proxytrack-mztools.o `test -f 'minizip/mztools.c' || echo '$(srcdir)/'`minizip/mztools.c
@am__fastdepCC_TRUE@ $(am__mv) minizip/$(DEPDIR)/proxytrack-mztools.Tpo minizip/$(DEPDIR)/proxytrack-mztools.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/mztools.c' object='minizip/proxytrack-mztools.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o proxytrack-mztools.o `test -f 'minizip/mztools.c' || echo '$(srcdir)/'`minizip/mztools.c
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o minizip/proxytrack-mztools.o `test -f 'minizip/mztools.c' || echo '$(srcdir)/'`minizip/mztools.c
proxytrack-mztools.obj: minizip/mztools.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxytrack-mztools.obj -MD -MP -MF $(DEPDIR)/proxytrack-mztools.Tpo -c -o proxytrack-mztools.obj `if test -f 'minizip/mztools.c'; then $(CYGPATH_W) 'minizip/mztools.c'; else $(CYGPATH_W) '$(srcdir)/minizip/mztools.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/proxytrack-mztools.Tpo $(DEPDIR)/proxytrack-mztools.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/mztools.c' object='proxytrack-mztools.obj' libtool=no @AMDEPBACKSLASH@
minizip/proxytrack-mztools.obj: minizip/mztools.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT minizip/proxytrack-mztools.obj -MD -MP -MF minizip/$(DEPDIR)/proxytrack-mztools.Tpo -c -o minizip/proxytrack-mztools.obj `if test -f 'minizip/mztools.c'; then $(CYGPATH_W) 'minizip/mztools.c'; else $(CYGPATH_W) '$(srcdir)/minizip/mztools.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) minizip/$(DEPDIR)/proxytrack-mztools.Tpo minizip/$(DEPDIR)/proxytrack-mztools.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/mztools.c' object='minizip/proxytrack-mztools.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o proxytrack-mztools.obj `if test -f 'minizip/mztools.c'; then $(CYGPATH_W) 'minizip/mztools.c'; else $(CYGPATH_W) '$(srcdir)/minizip/mztools.c'; fi`
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o minizip/proxytrack-mztools.obj `if test -f 'minizip/mztools.c'; then $(CYGPATH_W) 'minizip/mztools.c'; else $(CYGPATH_W) '$(srcdir)/minizip/mztools.c'; fi`
proxytrack-unzip.o: minizip/unzip.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxytrack-unzip.o -MD -MP -MF $(DEPDIR)/proxytrack-unzip.Tpo -c -o proxytrack-unzip.o `test -f 'minizip/unzip.c' || echo '$(srcdir)/'`minizip/unzip.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/proxytrack-unzip.Tpo $(DEPDIR)/proxytrack-unzip.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/unzip.c' object='proxytrack-unzip.o' libtool=no @AMDEPBACKSLASH@
minizip/proxytrack-unzip.o: minizip/unzip.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT minizip/proxytrack-unzip.o -MD -MP -MF minizip/$(DEPDIR)/proxytrack-unzip.Tpo -c -o minizip/proxytrack-unzip.o `test -f 'minizip/unzip.c' || echo '$(srcdir)/'`minizip/unzip.c
@am__fastdepCC_TRUE@ $(am__mv) minizip/$(DEPDIR)/proxytrack-unzip.Tpo minizip/$(DEPDIR)/proxytrack-unzip.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/unzip.c' object='minizip/proxytrack-unzip.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o proxytrack-unzip.o `test -f 'minizip/unzip.c' || echo '$(srcdir)/'`minizip/unzip.c
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o minizip/proxytrack-unzip.o `test -f 'minizip/unzip.c' || echo '$(srcdir)/'`minizip/unzip.c
proxytrack-unzip.obj: minizip/unzip.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxytrack-unzip.obj -MD -MP -MF $(DEPDIR)/proxytrack-unzip.Tpo -c -o proxytrack-unzip.obj `if test -f 'minizip/unzip.c'; then $(CYGPATH_W) 'minizip/unzip.c'; else $(CYGPATH_W) '$(srcdir)/minizip/unzip.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/proxytrack-unzip.Tpo $(DEPDIR)/proxytrack-unzip.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/unzip.c' object='proxytrack-unzip.obj' libtool=no @AMDEPBACKSLASH@
minizip/proxytrack-unzip.obj: minizip/unzip.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT minizip/proxytrack-unzip.obj -MD -MP -MF minizip/$(DEPDIR)/proxytrack-unzip.Tpo -c -o minizip/proxytrack-unzip.obj `if test -f 'minizip/unzip.c'; then $(CYGPATH_W) 'minizip/unzip.c'; else $(CYGPATH_W) '$(srcdir)/minizip/unzip.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) minizip/$(DEPDIR)/proxytrack-unzip.Tpo minizip/$(DEPDIR)/proxytrack-unzip.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/unzip.c' object='minizip/proxytrack-unzip.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o proxytrack-unzip.obj `if test -f 'minizip/unzip.c'; then $(CYGPATH_W) 'minizip/unzip.c'; else $(CYGPATH_W) '$(srcdir)/minizip/unzip.c'; fi`
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o minizip/proxytrack-unzip.obj `if test -f 'minizip/unzip.c'; then $(CYGPATH_W) 'minizip/unzip.c'; else $(CYGPATH_W) '$(srcdir)/minizip/unzip.c'; fi`
proxytrack-zip.o: minizip/zip.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxytrack-zip.o -MD -MP -MF $(DEPDIR)/proxytrack-zip.Tpo -c -o proxytrack-zip.o `test -f 'minizip/zip.c' || echo '$(srcdir)/'`minizip/zip.c
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/proxytrack-zip.Tpo $(DEPDIR)/proxytrack-zip.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/zip.c' object='proxytrack-zip.o' libtool=no @AMDEPBACKSLASH@
minizip/proxytrack-zip.o: minizip/zip.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT minizip/proxytrack-zip.o -MD -MP -MF minizip/$(DEPDIR)/proxytrack-zip.Tpo -c -o minizip/proxytrack-zip.o `test -f 'minizip/zip.c' || echo '$(srcdir)/'`minizip/zip.c
@am__fastdepCC_TRUE@ $(am__mv) minizip/$(DEPDIR)/proxytrack-zip.Tpo minizip/$(DEPDIR)/proxytrack-zip.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/zip.c' object='minizip/proxytrack-zip.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o proxytrack-zip.o `test -f 'minizip/zip.c' || echo '$(srcdir)/'`minizip/zip.c
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o minizip/proxytrack-zip.o `test -f 'minizip/zip.c' || echo '$(srcdir)/'`minizip/zip.c
proxytrack-zip.obj: minizip/zip.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT proxytrack-zip.obj -MD -MP -MF $(DEPDIR)/proxytrack-zip.Tpo -c -o proxytrack-zip.obj `if test -f 'minizip/zip.c'; then $(CYGPATH_W) 'minizip/zip.c'; else $(CYGPATH_W) '$(srcdir)/minizip/zip.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/proxytrack-zip.Tpo $(DEPDIR)/proxytrack-zip.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/zip.c' object='proxytrack-zip.obj' libtool=no @AMDEPBACKSLASH@
minizip/proxytrack-zip.obj: minizip/zip.c
@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -MT minizip/proxytrack-zip.obj -MD -MP -MF minizip/$(DEPDIR)/proxytrack-zip.Tpo -c -o minizip/proxytrack-zip.obj `if test -f 'minizip/zip.c'; then $(CYGPATH_W) 'minizip/zip.c'; else $(CYGPATH_W) '$(srcdir)/minizip/zip.c'; fi`
@am__fastdepCC_TRUE@ $(am__mv) minizip/$(DEPDIR)/proxytrack-zip.Tpo minizip/$(DEPDIR)/proxytrack-zip.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='minizip/zip.c' object='minizip/proxytrack-zip.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o proxytrack-zip.obj `if test -f 'minizip/zip.c'; then $(CYGPATH_W) 'minizip/zip.c'; else $(CYGPATH_W) '$(srcdir)/minizip/zip.c'; fi`
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(proxytrack_CFLAGS) $(CFLAGS) -c -o minizip/proxytrack-zip.obj `if test -f 'minizip/zip.c'; then $(CYGPATH_W) 'minizip/zip.c'; else $(CYGPATH_W) '$(srcdir)/minizip/zip.c'; fi`
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
-rm -rf minizip/.libs minizip/_libs
install-DevIncludesDATA: $(DevIncludes_DATA)
@$(NORMAL_INSTALL)
@list='$(DevIncludes_DATA)'; test -n "$(DevIncludesdir)" || list=; \
@@ -1141,6 +1244,10 @@ clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-rm -f minizip/$(DEPDIR)/$(am__dirstamp)
-rm -f minizip/$(am__dirstamp)
-rm -f proxy/$(DEPDIR)/$(am__dirstamp)
-rm -f proxy/$(am__dirstamp)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -1151,7 +1258,7 @@ clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
clean-libtool mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -rf ./$(DEPDIR) minizip/$(DEPDIR) proxy/$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
@@ -1197,7 +1304,7 @@ install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -rf ./$(DEPDIR) minizip/$(DEPDIR) proxy/$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic

File diff suppressed because it is too large Load Diff

529
src/coucal.h Normal file
View File

@@ -0,0 +1,529 @@
/* ------------------------------------------------------------ */
/*
Coucal, Cuckoo hashing-based hashtable with stash area.
Copyright (C) 2013-2014 Xavier Roche (http://www.httrack.com/)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* Coucal, a Cuckoo-hashing-based hashtable with stash area C library.
*
* This hashtable library provides key/value hashtable, with by default a
* string key, and integer/pointer value (with an associated optional
* allocator). Both key and value can be of any type, using custom settings.
* By default, the string key is dup'ed using a string pool, and the opaque
* value is stored as-is (either the pointer, or an uintptr_t integer value).
* It features O(1) average insertion, and guaranteed O(1) lookup, replace,
* and delete operations.
*
* Implementation notes:
* Implementation is auto-rehashable, and uses cuckoo hashing of size 2**n
* with a Murmur or MD5 hash function, with one additional auxiliary hash
* function.
* It also uses a small stash area to handle rare cases of collisions.
* Enumeration of all key/values is possible, deletion is also possible, but
* currently without any auto-shrinking (ie. table will never shrink).
* Overall, two main blocks are allocated: one for the items, and one for
* the keys (pool).
* If the string pool is being used (to store dup'ed keys), deleting is only
* O(1) average, because the pool needs to be compacted time to time.
* Currently the default maximum number of elements in the hashtable is
* 2**31 - 1 (that is, 2,147,483,648 elements), but this default can be changed
* by setting COUCAL_HASH_SIZE to a higher value (64 is the only higher value
* currently supported), and rebuilding the library.
*
* References:
*
* Cuckoo Hashing, by Rasmus Pagh and Flemming Friche Rodler
* http://www.it-c.dk/people/pagh/papers/cuckoo-jour.pdf
*
* Cuckoo Stash, by Adam Kirsch, Michael Mitzenmacher and Udi Wieder
* http://research.microsoft.com/pubs/73856/stash-full.9-30.pdf
*
* MurmurHash3, by Austin Appleby
* http://en.wikipedia.org/wiki/MurmurHash
*
* MD5 http://en.wikipedia.org/wiki/MD5
* FNV http://www.isthe.com/chongo/tech/comp/fnv/
**/
#ifndef COUCAL_DEFH
#define COUCAL_DEFH
/* Includes */
#ifdef _WIN32
#include <stddef.h>
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
#elif (defined(SOLARIS) || defined(sun) || defined(HAVE_INTTYPES_H) \
|| defined(BSD) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD_kernel__))
#include <inttypes.h>
#else
#include <stdint.h>
#endif
#include <stdarg.h>
/* External definitions */
#ifndef COUCAL_EXTERN
#ifdef _WIN32
#ifdef COUCAL_BUILDING
#define COUCAL_EXTERN __declspec(dllimport)
#else
#define COUCAL_EXTERN __declspec(dllexport)
#endif
#elif ( ( defined(__GNUC__) && ( __GNUC__ >= 4 ) ) \
|| ( defined(HAVE_VISIBILITY) && HAVE_VISIBILITY ) )
#define COUCAL_EXTERN extern __attribute__ ((visibility("default")))
#else
#define COUCAL_EXTERN extern
#endif
#endif
/** Key opaque type. May be a regular 'const char*'. **/
typedef void* coucal_key;
/** Key constant (can not be modified) opaque type. **/
typedef const void* coucal_key_const;
/** Opaque user-defined pointer. **/
typedef void* coucal_opaque;
/** Value (union of any value). **/
typedef union coucal_value {
/** Integer value. **/
intptr_t intg;
/** Unsigned integer value. **/
uintptr_t uintg;
/** Pointer value. **/
void *ptr;
} coucal_value;
/** Value constant. **/
typedef const coucal_value coucal_value_const;
/** NULL Value. **/
#define INTHASH_VALUE_NULL { 0 }
#ifndef HTS_DEF_FWSTRUCT_coucal_item
#define HTS_DEF_FWSTRUCT_coucal_item
typedef struct coucal_item coucal_item;
#endif
/** Coucal primary hash size. Default is 32-bit. **/
#ifndef COUCAL_HASH_SIZE
#define COUCAL_HASH_SIZE 32
#endif
/** Hash integer type. **/
#if (COUCAL_HASH_SIZE == 32)
/** 32-bit hash key. **/
typedef uint32_t coucal_hashkey;
#elif (COUCAL_HASH_SIZE == 64)
/** 64-bit hash key. **/
typedef uint64_t coucal_hashkey;
#else
#error "Unsupported COUCAL_HASH_SIZE"
#endif
/** Pair of hashes **/
typedef struct coucal_hashkeys {
coucal_hashkey hash1;
coucal_hashkey hash2;
} coucal_hashkeys;
/** NULL pair of hashes. **/
#define INTHASH_KEYS_NULL { 0, 0 }
/** Item holding a value. **/
struct coucal_item {
/** Key. **/
coucal_key name;
/** Value. **/
coucal_value value;
/** Hashes of the key. **/
coucal_hashkeys hashes;
};
/** Log level. **/
typedef enum coucal_loglevel {
coucal_log_critical,
coucal_log_warning,
coucal_log_info,
coucal_log_debug,
coucal_log_trace
} coucal_loglevel;
/** free handler. Only used when values are markes as xxc **/
typedef void (*t_coucal_key_freehandler)(coucal_opaque arg,
coucal_key key);
/** Value free handler. Only used when values are markes as xxc **/
typedef void (*t_coucal_value_freehandler)(coucal_opaque arg,
coucal_value value);
/** Key dup handler. **/
typedef coucal_key (*t_coucal_duphandler)(coucal_opaque arg,
coucal_key_const name);
/** Key hash computation handler. **/
typedef coucal_hashkeys (*t_coucal_hasheshandler)(coucal_opaque arg,
coucal_key_const name);
/** Hashtable logging handler. **/
typedef void (*t_coucal_loghandler)(coucal_opaque arg, coucal_loglevel level,
const char* format, va_list args);
/** Hashtable fatal assertion failure. **/
typedef void (*t_coucal_asserthandler)(coucal_opaque arg, const char* exp,
const char* file, int line);
/** Key printer (debug) **/
typedef const char* (*t_coucal_printkeyhandler)(coucal_opaque arg,
coucal_key_const name);
/** Value printer (debug) **/
typedef const char* (*t_coucal_printvaluehandler)(coucal_opaque arg,
coucal_value_const value);
/**
* Value comparison handler (returns non-zero value if strings are equal).
**/
typedef int (*t_coucal_cmphandler)(coucal_opaque arg,
coucal_key_const a,
coucal_key_const b);
/** Hashtable (opaque structure). **/
#ifndef HTS_DEF_FWSTRUCT_struct_coucal
#define HTS_DEF_FWSTRUCT_struct_coucal
typedef struct struct_coucal struct_coucal, *coucal;
#endif
/** Hashtable enumeration (opaque structure). **/
#ifndef HTS_DEF_FWSTRUCT_struct_coucal_enum
#define HTS_DEF_FWSTRUCT_struct_coucal_enum
typedef struct struct_coucal_enum struct_coucal_enum;
#endif
/** Enumeration. **/
struct struct_coucal_enum {
coucal table;
size_t index;
};
#ifdef __cplusplus
extern "C" {
#endif
/**
* Create a new hashtable, with initial bucket size of 'size'.
* If size is 0, use the default minimal bucket size.
* Return a non-NULL pointer upon success.
*
* By default, keys are supposed to be '\0'-terminated strings, which are
* duplicated by the library (the passed pointer does not need to be
* persistent), and values are opaque pointers (or integers) which are copied
* "as is", without further processing. Use coucal_value_set_key_handler()
* and coucal_value_set_value_handler() to alter this default behavior.
**/
COUCAL_EXTERN coucal coucal_new(size_t size);
/**
* Was the hashtable successfully created ?
* Return non-zero value if the hashtable is valid.
**/
COUCAL_EXTERN int coucal_created(coucal hashtable);
/**
* Delete a hashtable, freeing all entries.
**/
COUCAL_EXTERN void coucal_delete(coucal * hashtable);
/**
* Return the number of items in the hashtable.
**/
COUCAL_EXTERN size_t coucal_nitems(coucal hashtable);
/**
* Return the memory size taken by the hashtable.
* (This does not take account of the possible memory taken by values)
**/
COUCAL_EXTERN size_t coucal_memory_size(coucal hashtable);
/**
* Return the library hash size compiled.
* The returned value MUST match COUCAL_HASH_SIZE.
**/
COUCAL_EXTERN size_t coucal_hash_size(void);
/**
* If 'flag' is non-zero, calls coucal_value_set_value_handler() with
* default system free() handler function, otherwise, free the value handlers.
**/
COUCAL_EXTERN void coucal_value_is_malloc(coucal hashtable, int flag);
/**
* Set handlers for values.
* free: this handler will be called when a value is to be removed from
* the hashtable. if NULL, values won't be free'd.
* arg: opaque custom argument to be used by functions.
* Handler(s) MUST NOT be changed once elements have been added.
**/
COUCAL_EXTERN void coucal_value_set_value_handler(coucal hashtable,
t_coucal_value_freehandler free,
coucal_opaque arg);
/**
* Set handlers for keys.
* dup: handler called to duplicate a key. if NULL, the internal pool is used.
* free: handler called to free a key. if NULL, the internal pool is used.
* hash: hashing handler, called to hash a key. if NULL, the default hash
* function is used.
* equals: comparison handler, returning non-zero value when two keys are
* identical. if NULL, the default comparison function is used.
* arg: opaque custom argument to be used by functions.
* Handler(s) MUST NOT be changed once elements have been added.
**/
COUCAL_EXTERN void coucal_value_set_key_handler(coucal hashtable,
t_coucal_duphandler dup,
t_coucal_key_freehandler free,
t_coucal_hasheshandler hash,
t_coucal_cmphandler equals,
coucal_opaque arg);
/**
* Set assertion failure handler.
* log: handler called upon serious programming error
* fatal: handler called upon serious programming error
**/
COUCAL_EXTERN void coucal_set_assert_handler(coucal hashtable,
t_coucal_loghandler log,
t_coucal_asserthandler fatal,
coucal_opaque arg);
/**
* Set pretty print loggers (debug). Both handlers must return a string
* pointer which shall be valid until the next call. Both key and value
* pointers shall be valid at the same time.
* name: handler called to print the string representation of the name
* value: handler called to print the string representation of the value
**/
COUCAL_EXTERN void coucal_set_print_handler(coucal hashtable,
t_coucal_printkeyhandler key,
t_coucal_printvaluehandler value,
coucal_opaque arg);
/**
* Set the hashtable name, for degugging purpose.
* name: the hashtable name (ASCII or UTF-8)
*/
COUCAL_EXTERN void coucal_set_name(coucal hashtable, coucal_key_const name);
/**
* Get the hashtable name, for degugging purpose.
* Return NULL if no name was defined.
**/
COUCAL_EXTERN const char* coucal_get_name(coucal hashtable);
/**
* Read an integer entry from the hashtable.
* Return non-zero value upon success and sets intvalue.
**/
COUCAL_EXTERN int coucal_read(coucal hashtable, coucal_key_const name,
intptr_t * intvalue);
/**
* Same as coucal_read(), but return 0 is the value was zero.
**/
COUCAL_EXTERN int coucal_readptr(coucal hashtable, coucal_key_const name,
intptr_t * intvalue);
/**
* Read an integer entry from the hashtable.
* Return 0 if the entry could not be found.
**/
COUCAL_EXTERN intptr_t coucal_get_intptr(coucal hashtable,
coucal_key_const name);
/**
* Return non-zero value if the given entry exists.
**/
COUCAL_EXTERN int coucal_exists(coucal hashtable, coucal_key_const name);
/**
* Read an entry from the hashtable.
* Return non-zero value upon success and sets value.
**/
COUCAL_EXTERN int coucal_read_value(coucal hashtable, coucal_key_const name,
coucal_value *value);
/**
* Write an entry to the hashtable.
* Return non-zero value if the entry was added, zero if it was replaced.
**/
COUCAL_EXTERN int coucal_write_value(coucal hashtable, coucal_key_const name,
coucal_value_const value);
/**
* Read a pointer entry from the hashtable.
* Return non-zero value upon success and sets value.
**/
COUCAL_EXTERN int coucal_read_pvoid(coucal hashtable, coucal_key_const name,
void **value);
/**
* Read a pointer entry from the hashtable and returns its value.
* Return NULL if the entry could not be found.
**/
COUCAL_EXTERN void* coucal_get_pvoid(coucal hashtable, coucal_key_const name);
/**
* Write a pointer entry to the hashtable.
* Return non-zero value if the entry was added, zero if it was replaced.
**/
COUCAL_EXTERN int coucal_write_pvoid(coucal hashtable, coucal_key_const name,
void *value);
/**
* Alias to coucal_write_pvoid()
**/
COUCAL_EXTERN void coucal_add_pvoid(coucal hashtable, coucal_key_const name,
void *value);
/**
* Write an integer entry to the hashtable.
* Return non-zero value if the entry was added, zero if it was replaced.
**/
COUCAL_EXTERN int coucal_write(coucal hashtable, coucal_key_const name,
intptr_t value);
/**
* Alias to coucal_write()
**/
COUCAL_EXTERN void coucal_add(coucal hashtable, coucal_key_const name,
intptr_t value);
/**
* Increment an entry value in the hashtable
* (or create a new entry with value 1 if it does not yet exist)
* Return non-zero value if the entry was added, zero if it was changed.
**/
COUCAL_EXTERN int coucal_inc(coucal hashtable, coucal_key_const name);
/**
* Decrement an entry value in the hashtable
* (or create a new entry with value -1 if it does not yet exist)
* Return non-zero value if the entry was added, zero if it was changed.
**/
COUCAL_EXTERN int coucal_dec(coucal hashtable, coucal_key_const name);
/**
* Fetch an entry value from the hashtable.
* Returns NULL if the entry could not be found.
* The returned pointer is only valid until next call to this library, and can
* be used for read or write operations.
**/
COUCAL_EXTERN coucal_value* coucal_fetch_value(coucal hashtable,
coucal_key_const name);
/**
* Fetch an entry value from the hashtable, given a name, and its hashes.
* Returns NULL if the entry could not be found.
* The returned pointer is only valid until next call to this library, and can
* be used for read or write operations.
* The hashes MUST have been computed using coucal_calc_hashes(), or by
* copying an existing hash during an enumeration.
* The use of a non-matching hash is safe, but will return NULL.
**/
COUCAL_EXTERN coucal_value* coucal_fetch_value_hashes(coucal hashtable,
coucal_key_const name,
const coucal_hashkeys
*hashes);
/**
* Remove an entry from the hashtable
* Return non-zero value if the entry was removed, zero otherwise.
**/
COUCAL_EXTERN int coucal_remove(coucal hashtable, coucal_key_const name);
/**
* Return a new enumerator.
* Note: deleting entries is safe while enumerating, but adding entries
* lead to undefined enumeration behavior (yet safe).
**/
COUCAL_EXTERN struct_coucal_enum coucal_enum_new(coucal hashtable);
/**
* Enumerate the next entry.
**/
COUCAL_EXTERN coucal_item *coucal_enum_next(struct_coucal_enum * e);
/**
* Compute a hash of a key for the hashtable 'hashtable'.
* The returned hash is suitable for use with coucal_fetch_value_hashes()
* Note: the default implementation uses coucal_hash_string()
**/
COUCAL_EXTERN coucal_hashkeys coucal_calc_hashes(coucal hashtable,
coucal_key_const value);
/**
* Compute a hash, given a string. This is the default function used for
* hashing keys, which are by default strings. This function uses
* coucal_hash_data() as backend.
**/
COUCAL_EXTERN coucal_hashkeys coucal_hash_string(const char *value);
/**
* Compute a hash, given an opaque buffer.
**/
COUCAL_EXTERN coucal_hashkeys coucal_hash_data(const void *data, size_t size);
/**
* Set default global assertion failure handler.
* The handler will be used if no specific handler was defined in the
* hashtable itself.
* log: handler called upon serious error log (opaque argument
* is the hashtable itself)
* fatal: handler called upon serious programming error (opaque argument
* is the hashtable itself)
**/
COUCAL_EXTERN void coucal_set_global_assert_handler(t_coucal_loghandler log,
t_coucal_asserthandler fatal);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -192,7 +192,7 @@ const char *hts_optalias[][4] = {
{"advanced-maxfilters", "-#F", "param", "maximum number of scan rules"},
{"version", "-#h", "single", ""},
{"debug-scanstdin", "-#K", "single", ""},
{"advanced-maxlinks", "-#L", "single", "maximum number of links (0 to disable limit)"},
{"advanced-maxlinks", "-#L", "param", "maximum number of links (0 to disable limit)"},
{"advanced-progressinfo", "-#p", "single", "deprecated"},
{"catch-url", "-#P", "single", "catch complex URL through proxy"},
/*{"debug-oldftp","-#R","single",""}, */

149
src/htsarrays.h Normal file
View File

@@ -0,0 +1,149 @@
/* ------------------------------------------------------------ */
/*
HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Important notes:
- We hereby ask people using this source NOT to use it in purpose of grabbing
emails addresses, or collecting any other private information on persons.
This would disgrace our work, and spoil the many hours we spent on it.
Please visit our Website: http://www.httrack.com
*/
/* ------------------------------------------------------------ */
/* File: Arrays */
/* Author: Xavier Roche */
/* ------------------------------------------------------------ */
#ifndef HTS_ARRAYS_DEFSTATIC
#define HTS_ARRAYS_DEFSTATIC
/* System definitions. */
#include <stdlib.h>
#include <string.h>
#include "htssafe.h"
/* Memory allocation assertion failure */
static void hts_record_assert_memory_failed(const size_t size) {
fprintf(stderr, "memory allocation failed (%lu bytes)", \
(long int) size); \
assertf(! "memory allocation failed"); \
}
/** Dynamic array of T elements. **/
#define TypedArray(T) \
struct { \
/** Elements. **/ \
union { \
/** Typed. **/ \
T* elts; \
/** Opaque. **/ \
void* ptr; \
} data; \
/** Count. **/ \
size_t size; \
/** Capacity. **/ \
size_t capa; \
}
#define EMPTY_TYPED_ARRAY { { NULL }, 0, 0 }
/** Array size, in elements. **/
#define TypedArraySize(A) ((A).size)
/** Array capacity, in elements. **/
#define TypedArrayCapa(A) ((A).capa)
/**
* Remaining free space, in elements.
* Macro, first element evaluated multiple times.
**/
#define TypedArrayRoom(A) ( TypedArrayCapa(A) - TypedArraySize(A) )
/** Array elements, of type T*. **/
#define TypedArrayElts(A) ((A).data.elts)
/** Array pointer, of type void*. **/
#define TypedArrayPtr(A) ((A).data.ptr)
/** Size of T. **/
#define TypedArrayWidth(A) (sizeof(*TypedArrayElts(A)))
/** Nth element of the array. **/
#define TypedArrayNth(A, N) (TypedArrayElts(A)[N])
/**
* Tail of the array (outside the array).
* The returned pointer points to the beginning of TypedArrayRoom(A)
* free elements.
**/
#define TypedArrayTail(A) (TypedArrayNth(A, TypedArraySize(A)))
/**
* Ensure at least 'ROOM' elements can be put in the remaining space.
* After a call to this macro, TypedArrayRoom(A) is guaranteed to be at
* least equal to 'ROOM'.
**/
#define TypedArrayEnsureRoom(A, ROOM) do { \
const size_t room_ = (ROOM); \
while (TypedArrayRoom(A) < room_) { \
TypedArrayCapa(A) = TypedArrayCapa(A) < 16 ? 16 : TypedArrayCapa(A) * 2; \
} \
TypedArrayPtr(A) = realloc(TypedArrayPtr(A), \
TypedArrayCapa(A)*TypedArrayWidth(A)); \
if (TypedArrayPtr(A) == NULL) { \
hts_record_assert_memory_failed(TypedArrayCapa(A)*TypedArrayWidth(A)); \
} \
} while(0)
/** Add an element. Macro, first element evaluated multiple times. **/
#define TypedArrayAdd(A, E) do { \
TypedArrayEnsureRoom(A, 1); \
assertf(TypedArraySize(A) < TypedArrayCapa(A)); \
TypedArrayTail(A) = (E); \
TypedArraySize(A)++; \
} while(0)
/**
* Add 'COUNT' elements from 'PTR'.
* Macro, first element evaluated multiple times.
**/
#define TypedArrayAppend(A, PTR, COUNT) do { \
const size_t count_ = (COUNT); \
/* This 1-case is to benefit from type safety. */ \
if (count_ == 1) { \
TypedArrayAdd(A, *(PTR)); \
} else { \
const void *const source_ = (PTR); \
TypedArrayEnsureRoom(A, count_); \
assertf(count_ <= TypedArrayRoom(A)); \
memcpy(&TypedArrayTail(A), source_, count_ * TypedArrayWidth(A)); \
TypedArraySize(A) += count_; \
} \
} while(0)
/** Clear an array, freeing memory and clearing size and capacity. **/
#define TypedArrayFree(A) do { \
if (TypedArrayPtr(A) != NULL) { \
TypedArrayCapa(A) = TypedArraySize(A) = 0; \
free(TypedArrayPtr(A)); \
TypedArrayPtr(A) = NULL; \
} \
} while(0)
#endif

View File

@@ -73,11 +73,11 @@ struct_back *back_new(httrackp *opt, int back_max) {
sback->count = back_max;
sback->lnk = (lien_back *) calloct((back_max + 1), sizeof(lien_back));
sback->ready = inthash_new(0);
sback->ready = coucal_new(0);
hts_set_hash_handler(sback->ready, opt);
inthash_set_name(sback->ready, "back_new");
coucal_set_name(sback->ready, "back_new");
sback->ready_size_bytes = 0;
inthash_value_is_malloc(sback->ready, 1);
coucal_value_is_malloc(sback->ready, 1);
// init
for(i = 0; i < sback->count; i++) {
sback->lnk[i].r.location = sback->lnk[i].location_buffer;
@@ -94,7 +94,7 @@ void back_free(struct_back ** sback) {
(*sback)->lnk = NULL;
}
if ((*sback)->ready != NULL) {
inthash_delete(&(*sback)->ready);
coucal_delete(&(*sback)->ready);
(*sback)->ready_size_bytes = 0;
}
freet(*sback);
@@ -112,10 +112,10 @@ void back_delete_all(httrackp * opt, cache_back * cache, struct_back * sback) {
}
// delete stored slots
if (sback->ready != NULL) {
struct_inthash_enum e = inthash_enum_new(sback->ready);
inthash_chain *item;
struct_coucal_enum e = coucal_enum_new(sback->ready);
coucal_item *item;
while((item = inthash_enum_next(&e))) {
while((item = coucal_enum_next(&e))) {
#ifndef HTS_NO_BACK_ON_DISK
const char *filename = (char *) item->value.ptr;
@@ -130,7 +130,7 @@ void back_delete_all(httrackp * opt, cache_back * cache, struct_back * sback) {
#endif
}
/* delete hashtable & content */
inthash_delete(&sback->ready);
coucal_delete(&sback->ready);
sback->ready_size_bytes = 0;
}
}
@@ -182,7 +182,7 @@ static int back_index_ready(httrackp * opt, struct_back * sback, const char *adr
lien_back *const back = sback->lnk;
void *ptr = NULL;
if (inthash_read_pvoid(sback->ready, sav, &ptr)) {
if (coucal_read_pvoid(sback->ready, sav, &ptr)) {
if (!getIndex) { /* don't "pagefault" the entry */
if (ptr != NULL) {
return sback->count; /* (invalid but) positive result */
@@ -228,7 +228,7 @@ static int back_index_ready(httrackp * opt, struct_back * sback, const char *adr
back_clear_entry(itemback); /* delete entry content */
freet(itemback); /* delete item */
itemback = NULL;
inthash_remove(sback->ready, sav); // delete item
coucal_remove(sback->ready, sav); // delete item
sback->ready_size_bytes -= back[q].r.size; /* substract for stats */
back_set_locked(sback, q); /* locked */
return q;
@@ -309,7 +309,7 @@ int back_cleanup_background(httrackp * opt, cache_back * cache,
/* Create file and serialize slot */
if ((fp = filecreate(NULL, filename)) != NULL) {
if (back_serialize(fp, &back[i]) == 0) {
inthash_add_pvoid(sback->ready, back[i].url_sav, filename);
coucal_add_pvoid(sback->ready, back[i].url_sav, filename);
filename = NULL;
sback->ready_size_bytes += back[i].r.size; /* add for stats */
nclean++;
@@ -340,7 +340,7 @@ int back_cleanup_background(httrackp * opt, cache_back * cache,
#else
itemback = calloct(1, sizeof(lien_back));
back_move(&back[i], itemback);
inthash_add_pvoid(sback->ready, itemback->url_sav, itemback);
coucal_add_pvoid(sback->ready, itemback->url_sav, itemback);
nclean++;
#endif
}
@@ -375,10 +375,10 @@ LLint back_incache(const struct_back * sback) {
// stored (ready) slots
#ifdef HTS_NO_BACK_ON_DISK
if (sback->ready != NULL) {
struct_inthash_enum e = inthash_enum_new(sback->ready);
inthash_chain *item;
struct_coucal_enum e = coucal_enum_new(sback->ready);
coucal_item *item;
while((item = inthash_enum_next(&e))) {
while((item = coucal_enum_next(&e))) {
lien_back *ritem = (lien_back *) item->value.ptr;
if (ritem->status != -1)
@@ -403,12 +403,12 @@ int back_done_incache(const struct_back * sback) {
// stored (ready) slots
if (sback->ready != NULL) {
#ifndef HTS_NO_BACK_ON_DISK
n += (int) inthash_nitems(sback->ready);
n += (int) coucal_nitems(sback->ready);
#else
struct_inthash_enum e = inthash_enum_new(sback->ready);
inthash_chain *item;
struct_coucal_enum e = coucal_enum_new(sback->ready);
coucal_item *item;
while((item = inthash_enum_next(&e))) {
while((item = coucal_enum_next(&e))) {
lien_back *ritem = (lien_back *) item->value.ptr;
if (ritem->status == STATUS_READY)
@@ -971,9 +971,10 @@ int back_unserialize(FILE * fp, lien_back ** dst) {
if ((*dst)->r.adr != NULL)
freet((*dst)->r.adr);
}
if (dst != NULL)
freet(dst);
*dst = NULL;
if (dst != NULL) {
freet(*dst);
*dst = NULL;
}
return 1; /* error */
}
@@ -1506,7 +1507,7 @@ int back_add(struct_back * sback, httrackp * opt, cache_back * cache, const char
if (cache->cached_tests != NULL) {
intptr_t ptr = 0;
if (inthash_read(cache->cached_tests,
if (coucal_read(cache->cached_tests,
concat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), adr, fil), &ptr)) { // gotcha
if (ptr != 0) {
char *text = (char *) ptr;
@@ -1544,7 +1545,7 @@ int back_add(struct_back * sback, httrackp * opt, cache_back * cache, const char
#if HTS_FAST_CACHE
strcpybuff(buff, adr);
strcatbuff(buff, fil);
hash_pos_return = inthash_read(cache->hashtable, buff, &hash_pos);
hash_pos_return = coucal_read(cache->hashtable, buff, &hash_pos);
#else
buff[0] = '\0';
strcatbuff(buff, "\n");
@@ -2131,7 +2132,7 @@ void back_solve(httrackp * opt, lien_back * back) {
else
a = back->r.req.proxy.name;
assertf(a != NULL);
a = jump_protocol(a);
a = jump_protocol_const(a);
if (check_hostname_dns(a)) {
hts_log_print(opt, LOG_DEBUG, "resolved: %s", a);
} else {
@@ -2780,8 +2781,8 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
back[i].r.is_write = 1; // écrire
if (back[i].r.compressed &&
/* .gz are *NOT* depacked!! */
(strfield
(get_ext(catbuff, sizeof(catbuff), back[i].url_sav), "gz") == 0)
strfield(get_ext(catbuff, sizeof(catbuff), back[i].url_sav), "gz") == 0
&& strfield(get_ext(catbuff, sizeof(catbuff), back[i].url_sav), "tgz") == 0
) {
if (create_back_tmpfile(opt, &back[i]) == 0) {
assertf(back[i].tmpfile != NULL);
@@ -3240,7 +3241,7 @@ void back_wait(struct_back * sback, httrackp * opt, cache_back * cache,
fprintf(ioinfo,
"[%d] response for %s%s:\r\ncode=%d\r\n",
back[i].r.debugid,
jump_identification(back[i].url_adr),
jump_identification_const(back[i].url_adr),
back[i].url_fil, back[i].r.statuscode);
fprintfio(ioinfo, back[i].r.adr, ">>> ");
fprintf(ioinfo, "\r\n");
@@ -3978,10 +3979,10 @@ LLint back_transferred(LLint nb, struct_back * sback) {
#ifndef HTS_NO_BACK_ON_DISK
nb += sback->ready_size_bytes;
#else
struct_inthash_enum e = inthash_enum_new(sback->ready);
inthash_chain *item;
struct_coucal_enum e = coucal_enum_new(sback->ready);
coucal_item *item;
while((item = inthash_enum_next(&e))) {
while((item = coucal_enum_next(&e))) {
lien_back *ritem = (lien_back *) item->value.ptr;
if ((ritem->status > 0) && (ritem->status < 99 || ritem->status >= 1000))

View File

@@ -59,6 +59,10 @@ Please visit our Website: http://www.httrack.com
#define INVALID_SOCKET -1
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if HTS_USEOPENSSL
/*
OpensSSL crypto routines by Eric Young (eay@cryptsoft.com)
@@ -154,4 +158,8 @@ typedef enum HTTrackStatus {
STATUS_FTP_READY = 1001
} HTTrackStatus;
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -461,7 +461,7 @@ char *bauth_check(t_cookie * cookie, const char *adr, const char *fil) {
char *bauth_prefix(char *prefix, const char *adr, const char *fil) {
char *a;
strcpybuff(prefix, jump_identification(adr));
strcpybuff(prefix, jump_identification_const(adr));
strcatbuff(prefix, fil);
a = strchr(prefix, '?');
if (a)

View File

@@ -145,7 +145,7 @@ void cache_mayadd(httrackp * opt, cache_back * cache, htsblk * r,
// we just store statuscode + location (if any)
if (url_save == NULL && r->statuscode / 100 >= 3) {
// cached "fast" header doesn't yet exists
if (inthash_read
if (coucal_read
(cache->cached_tests,
concat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), url_adr, url_fil), NULL) == 0) {
char BIGSTK tempo[HTS_URLMAXSIZE * 2];
@@ -158,7 +158,7 @@ void cache_mayadd(httrackp * opt, cache_back * cache, htsblk * r,
hts_log_print(opt, LOG_DEBUG,
"Cached fast-header response: %s%s is %d",
url_adr, url_fil, (int) r->statuscode);
inthash_add(cache->cached_tests,
coucal_add(cache->cached_tests,
concat(OPT_GET_BUFF(opt), OPT_GET_BUFF_SIZE(opt), url_adr, url_fil),
(intptr_t) strdupt(tempo));
}
@@ -646,7 +646,7 @@ static htsblk cache_readex_new(httrackp * opt, cache_back * cache,
strcpybuff(r.location, "");
strcpybuff(buff, adr);
strcatbuff(buff, fil);
hash_pos_return = inthash_read(cache->hashtable, buff, &hash_pos);
hash_pos_return = coucal_read(cache->hashtable, buff, &hash_pos);
/* avoid errors on data entries */
if (adr[0] == '/' && adr[1] == '/' && adr[2] == '[') {
#if HTS_FAST_CACHE
@@ -1029,7 +1029,7 @@ static htsblk cache_readex_old(httrackp * opt, cache_back * cache,
#if HTS_FAST_CACHE
strcpybuff(buff, adr);
strcatbuff(buff, fil);
hash_pos_return = inthash_read(cache->hashtable, buff, &hash_pos);
hash_pos_return = coucal_read(cache->hashtable, buff, &hash_pos);
#else
buff[0] = '\0';
strcatbuff(buff, "\n");
@@ -1349,7 +1349,7 @@ int cache_readdata(cache_back * cache, const char *str1, const char *str2,
strcpybuff(buff, str1);
strcatbuff(buff, str2);
if (inthash_read(cache->hashtable, buff, &pos)) {
if (coucal_read(cache->hashtable, buff, &pos)) {
if (fseek(cache->olddat, (long) ((pos > 0) ? pos : (-pos)), SEEK_SET) ==
0) {
INTsys len;
@@ -1642,9 +1642,9 @@ void cache_init(cache_back * cache, httrackp * opt) {
}
}
if (dataincache)
inthash_add(cache->hashtable, filenameIndex, pos);
coucal_add(cache->hashtable, filenameIndex, pos);
else
inthash_add(cache->hashtable, filenameIndex, -pos);
coucal_add(cache->hashtable, filenameIndex, -pos);
} else {
hts_log_print(opt, LOG_WARNING,
"Corrupted cache meta entry #%d",
@@ -1810,7 +1810,7 @@ void cache_init(cache_back * cache, httrackp * opt) {
/* read position */
a += binput(a, linepos, 200);
sscanf(linepos, "%d", &pos);
inthash_add(cache->hashtable, line, pos);
coucal_add(cache->hashtable, line, pos);
}
}
/* Not needed anymore! */

View File

@@ -35,6 +35,18 @@ Please visit our Website: http://www.httrack.com
#include "punycode.h"
#include "htssafe.h"
#ifdef _WIN32
#include <stddef.h>
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
#elif (defined(SOLARIS) || defined(sun) || defined(HAVE_INTTYPES_H) \
|| defined(BSD) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD_kernel__))
#include <inttypes.h>
#else
#include <stdint.h>
#endif
#include <stdarg.h>
int hts_isStringAscii(const char *s, size_t size) {
size_t i;
@@ -441,7 +453,7 @@ static char *hts_convertStringCharset(const char *s, size_t size,
const iconv_t cp = iconv_open(to, from);
if (cp != (iconv_t) - 1) {
char *inbuf = (char *) s;
char *inbuf = (char*) (uintptr_t) s; /* ugly iconv api, sheesh */
size_t inbytesleft = size;
size_t outbufCapa = 0;
char *outbuf = NULL;

View File

@@ -61,6 +61,9 @@ Please visit our Website: http://www.httrack.com
/* Charset handling */
#include "htscharset.h"
/* Dynamic typed arrays */
#include "htsarrays.h"
/* END specific definitions */
/* external modules */
@@ -146,8 +149,8 @@ RUN_CALLBACK0(opt, end); \
if (maketrack_fp){ fclose(maketrack_fp); maketrack_fp=NULL; } \
if (opt->accept_cookie) cookie_save(opt->cookie,fconcat(OPT_GET_BUFF(opt),OPT_GET_BUFF_SIZE(opt),StringBuff(opt->path_log),"cookies.txt")); \
if (makeindex_fp) { fclose(makeindex_fp); makeindex_fp=NULL; } \
if (cache_hashtable) { inthash_delete(&cache_hashtable); } \
if (cache_tests) { inthash_delete(&cache_tests); } \
if (cache_hashtable) { coucal_delete(&cache_hashtable); } \
if (cache_tests) { coucal_delete(&cache_tests); } \
if (template_header) { freet(template_header); template_header=NULL; } \
if (template_body) { freet(template_body); template_body=NULL; } \
if (template_footer) { freet(template_footer); template_footer=NULL; } \
@@ -157,47 +160,6 @@ RUN_CALLBACK0(opt, end); \
} while(0)
#define XH_uninit do { XH_extuninit; if (r.adr) { freet(r.adr); r.adr=NULL; } } while(0)
// memory allocation assertion failure
static void hts_record_assert_memory_failed(const size_t size) {
fprintf(stderr, "memory allocation failed (%lu bytes)", \
(long int) size); \
assertf(! "memory allocation failed"); \
}
// Typed array
#define TypedArray(T) \
struct { \
T* elts; \
size_t size; \
size_t capa; \
}
#define EMPTY_TYPED_ARRAY { NULL, 0, 0 }
#define TypedArrayAdd(A, E) do { \
if ((A).capa == (A).size) { \
(A).capa = (A).capa < 16 ? 16 : (A).capa * 2; \
(A).elts = realloct((A).elts, (A).capa*sizeof(*(A).elts)); \
if ((A).elts == NULL) { \
hts_record_assert_memory_failed((A).capa*sizeof(*(A).elts)); \
} \
} \
assertf((A).size < (A).capa); \
(A).elts[(A).size++] = (E); \
} while(0)
#define TypedArrayFree(A) do { \
if ((A).elts != NULL) { \
freet((A).elts); \
(A).elts = NULL; \
(A).capa = (A).size = 0; \
} \
} while(0)
#define TypedArraySize(A) ((A).size)
#define TypedArrayCapa(A) ((A).capa)
#define TypedArrayElts(A) ((A).elts)
#define TypedArrayNth(A, N) (TypedArrayElts(A)[N])
struct lien_buffers {
/* Main array of pointers.
This is the real "lien_url **liens" pointer base. */
@@ -216,12 +178,13 @@ struct lien_buffers {
// duplicate a string, or return NULL upon error (out-of-memory)
static char* hts_record_link_strdup_(httrackp *opt, const char *s) {
static const size_t block_capa = 256000;
static const size_t block_capa = 32768;
lien_buffers *const liensbuf = opt->liensbuf;
const size_t len = strlen(s) + 1; /* including terminating \0 */
char *s_dup;
assertf(liensbuf != NULL);
assertf(len < block_capa);
// not enough capacity ? then create a new chunk
if (len + liensbuf->string_buffer_size > liensbuf->string_buffer_capa) {
@@ -230,18 +193,25 @@ static char* hts_record_link_strdup_(httrackp *opt, const char *s) {
TypedArrayAdd(liensbuf->string_buffers, liensbuf->string_buffer);
liensbuf->string_buffer = NULL;
liensbuf->string_buffer_size = 0;
liensbuf->string_buffer_capa = 0;
}
liensbuf->string_buffer = malloct(block_capa);
// Double capacity for each new chained block
liensbuf->string_buffer_capa =
liensbuf->string_buffer_capa < block_capa
? block_capa : liensbuf->string_buffer_capa * 2;
liensbuf->string_buffer = malloct(liensbuf->string_buffer_capa);
if (liensbuf->string_buffer == NULL) {
hts_record_assert_memory_failed(block_capa); \
hts_record_assert_memory_failed(liensbuf->string_buffer_capa);
}
liensbuf->string_buffer_capa = block_capa;
liensbuf->string_buffer_size = 0;
hts_log_print(opt, LOG_DEBUG,
"reallocated %d new bytes of strings room",
(int) liensbuf->string_buffer_capa);
}
assertf(len + liensbuf->string_buffer_size < liensbuf->string_buffer_capa);
assertf(len + liensbuf->string_buffer_size <= liensbuf->string_buffer_capa);
s_dup = &liensbuf->string_buffer[liensbuf->string_buffer_size];
memcpy(s_dup, s, len);
liensbuf->string_buffer_size += len;
@@ -266,7 +236,7 @@ size_t hts_record_link_latest(httrackp *opt) {
// or (size_t) -1 upon error (out-of-memory)
// the returned index is the osset within opt->liens[]
static size_t hts_record_link_alloc(httrackp *opt) {
static const size_t block_capa = 10000;
static const size_t block_capa = 256;
lien_buffers *const liensbuf = opt->liensbuf;
lien_url *link;
@@ -281,16 +251,27 @@ static size_t hts_record_link_alloc(httrackp *opt) {
// Create a new chunk of lien_url[]
// There are references to item pointers, so we can not just realloc()
if (liensbuf->lien_buffer_size == liensbuf->lien_buffer_capa) {
TypedArrayAdd(liensbuf->lien_buffers, liensbuf->lien_buffer);
liensbuf->lien_buffer_size = 0;
liensbuf->lien_buffer_capa = 0;
size_t capa_bytes;
liensbuf->lien_buffer = (lien_url*) malloct(block_capa*sizeof(*liensbuf->lien_buffer));
if (liensbuf->lien_buffer == NULL) {
hts_record_assert_memory_failed(block_capa*sizeof(*liensbuf->lien_buffer));
if (liensbuf->lien_buffer != NULL) {
TypedArrayAdd(liensbuf->lien_buffers, liensbuf->lien_buffer);
liensbuf->lien_buffer_size = 0;
}
// Double capacity for each new chained block
liensbuf->lien_buffer_capa =
liensbuf->lien_buffer_capa < block_capa
? block_capa : liensbuf->lien_buffer_capa * 2;
capa_bytes = liensbuf->lien_buffer_capa*sizeof(*liensbuf->lien_buffer);
liensbuf->lien_buffer = (lien_url*) malloct(capa_bytes);
if (liensbuf->lien_buffer == NULL) {
hts_record_assert_memory_failed(capa_bytes);
}
liensbuf->lien_buffer_capa = block_capa;
liensbuf->lien_buffer_size = 0;
hts_log_print(opt, LOG_DEBUG, "reallocated %d new link placeholders",
(int) liensbuf->lien_buffer_capa);
}
// Take next lien_url item
@@ -414,7 +395,7 @@ int hts_record_link(httrackp * opt,
hts_log_print(opt, LOG_PANIC, "Too many links (links=%ld, limit=%ld)",
(long int) heap_top_index(), (long int) opt->maxlink);
hts_log_print(opt, LOG_INFO,
"To avoid that: use #L option for more links (example: -#L1000000)");
"To avoid that: use #L option for more links (example: -#L1000000, or -#L0 to disable)");
}
return success;
}
@@ -448,6 +429,14 @@ if (makeindex_fp) { \
makeindex_done=1; /* ok c'est fait */ \
} while(0)
/* does it look like XML ? (SVG et al.) */
static int look_like_xml(const char *s) {
return strncmp(s, "<?xml", 5) == 0
|| strncmp(s, "<!-- ", 5) == 0
|| strncmp(s, "<svg ", 5) == 0
;
}
// Début de httpmirror, robot
// url1 peut être multiple
int httpmirror(char *url1, httrackp * opt) {
@@ -498,8 +487,8 @@ int httpmirror(char *url1, httrackp * opt) {
//
cache_back BIGSTK cache;
robots_wizard BIGSTK robots; // gestion robots.txt
inthash cache_hashtable = NULL;
inthash cache_tests = NULL;
coucal cache_hashtable = NULL;
coucal cache_tests = NULL;
//
char *template_header = NULL, *template_body = NULL, *template_footer = NULL;
@@ -582,8 +571,8 @@ int httpmirror(char *url1, httrackp * opt) {
cache.ptr_ant = cache.ptr_last = 0; // pointeur pour anticiper
// initialiser hash cache
cache_hashtable = inthash_new(0);
cache_tests = inthash_new(0);
cache_hashtable = coucal_new(0);
cache_tests = coucal_new(0);
if (cache_hashtable == NULL || cache_tests == NULL) {
printf("PANIC! : Not enough memory [%d]\n", __LINE__);
filters[0] = NULL; // uniquement a cause du warning de XH_extuninit
@@ -592,9 +581,9 @@ int httpmirror(char *url1, httrackp * opt) {
}
hts_set_hash_handler(cache_hashtable, opt);
hts_set_hash_handler(cache_tests, opt);
inthash_set_name(cache_hashtable, "cache_hashtable");
inthash_set_name(cache_tests, "cache_tests");
inthash_value_is_malloc(cache_tests, 1); /* malloc */
coucal_set_name(cache_hashtable, "cache_hashtable");
coucal_set_name(cache_tests, "cache_tests");
coucal_value_is_malloc(cache_tests, 1); /* malloc */
cache.hashtable = (void *) cache_hashtable; /* copy backcache hash */
cache.cached_tests = (void *) cache_tests; /* copy of cache_tests */
@@ -628,7 +617,7 @@ int httpmirror(char *url1, httrackp * opt) {
// initialiser hachage
hash_init(opt, &hash, opt->urlhack);
// note: we need a cast because of the const
hash.liens = (const lien_url ***) &opt->liens;
hash.liens = (const lien_url *const*const*) &opt->liens;
// copier adresse(s) dans liste des adresses
{
@@ -1199,8 +1188,13 @@ int httpmirror(char *url1, httrackp * opt) {
if (!error) {
if (r.statuscode == HTTP_OK) { // OK (ou 304 en backing)
if (r.adr) { // Written file
if ((is_hypertext_mime(opt, r.contenttype, urlfil()))
// Buggy SVG (Smiling Spectre)
if (strcmp(r.contenttype, "image/svg+xml") == 0 && !look_like_xml(r.adr)) {
// patch it
strcpybuff(r.contenttype, "application/octet-stream");
is_binary = 1;
}
else if ((is_hypertext_mime(opt, r.contenttype, urlfil()))
/* Is HTML or Js, .. */
/* NO - real media is real media, not HTML */
/*|| (may_be_hypertext_mime(r.contenttype, urlfil()) && (r.adr) ) */
@@ -2502,7 +2496,7 @@ void host_ban(httrackp * opt, int ptr,
while((heap(i)->adr[l]) && (l < 1020))
l++;
if ((l > 0) && (l < 1020)) { // sécurité
if (strfield2(jump_identification(heap(i)->adr), host)) { // host
if (strfield2(jump_identification_const(heap(i)->adr), host)) { // host
hts_log_print(opt, LOG_DEBUG, "Cancel: %s%s", heap(i)->adr,
heap(i)->fil);
hts_invalidate_link(opt, i); // invalidate hashtable entry
@@ -3663,11 +3657,21 @@ HTSEXT_API int hts_setpause(httrackp * opt, int p) {
HTSEXT_API int hts_request_stop(httrackp * opt, int force) {
if (opt != NULL) {
hts_log_print(opt, LOG_ERROR, "Exit requested by shell or user");
hts_mutexlock(&opt->state.lock);
opt->state.stop = 1;
hts_mutexrelease(&opt->state.lock);
}
return 0;
}
HTSEXT_API int hts_has_stopped(httrackp * opt) {
int ended;
hts_mutexlock(&opt->state.lock);
ended = opt->state.is_ended;
hts_mutexrelease(&opt->state.lock);
return ended;
}
// régler en cours de route les paramètres réglables..
// -1 : erreur
//HTSEXT_API int hts_setopt(httrackp* set_opt) {

View File

@@ -123,35 +123,12 @@ typedef struct filecreate_params filecreate_params;
// gestion hashage
#include "htshash.h"
#include "htsinthash.h"
#include "coucal.h"
#include "htsdefines.h"
#include "hts-indextmpl.h"
// structure d'un lien
#ifndef HTS_DEF_FWSTRUCT_lien_url
#define HTS_DEF_FWSTRUCT_lien_url
typedef struct lien_url lien_url;
#endif
struct lien_url {
char *adr; // adresse
char *fil; // nom du fichier distant
char *sav; // nom à sauver sur disque (avec chemin éventuel)
char *cod; // chemin codebase éventuel si classe java
char *former_adr; // adresse initiale (avant éventuel moved), peut être nulle
char *former_fil; // nom du fichier distant initial (avant éventuel moved), peut être nul
int premier; // pointeur sur le premier lien qui a donné lieu aux autres liens du domaine
int precedent; // pointeur sur le lien qui a donné lieu à ce lien précis
int depth; // profondeur autorisée lien ; >0 forte 0=faible
int pass2; // traiter après les autres, seconde passe. si == -1, lien traité en background
char link_import; // lien importé à la suite d'un moved - ne pas appliquer les règles classiques up/down
//int moved; // pointeur sur moved
int retry; // nombre de retry restants
int testmode; // mode test uniquement, envoyer juste un head!
};
// adr, fil
#ifndef HTS_DEF_FWSTRUCT_lien_adrfil
#define HTS_DEF_FWSTRUCT_lien_adrfil
@@ -172,57 +149,6 @@ struct lien_adrfilsave {
char save[HTS_URLMAXSIZE * 2]; // nom à sauver sur disque (avec chemin éventuel)
};
// chargement de fichiers en 'arrière plan'
#ifndef HTS_DEF_FWSTRUCT_lien_back
#define HTS_DEF_FWSTRUCT_lien_back
typedef struct lien_back lien_back;
#endif
struct lien_back {
#if DEBUG_CHECKINT
char magic;
#endif
char url_adr[HTS_URLMAXSIZE * 2]; // adresse
char url_fil[HTS_URLMAXSIZE * 2]; // nom du fichier distant
char url_sav[HTS_URLMAXSIZE * 2]; // nom à sauver sur disque (avec chemin éventuel)
char referer_adr[HTS_URLMAXSIZE * 2]; // adresse host page referer
char referer_fil[HTS_URLMAXSIZE * 2]; // fichier page referer
char location_buffer[HTS_URLMAXSIZE * 2]; // "location" en cas de "moved" (302,..)
char *tmpfile; // nom à sauver temporairement (compressé)
char tmpfile_buffer[HTS_URLMAXSIZE * 2]; // buffer pour le nom à sauver temporairement
char send_too[1024]; // données à envoyer en même temps que le header
int status; // status (-1=non utilisé, 0: prêt, >0: opération en cours)
int locked; // locked (to be used soon)
int testmode; // mode de test
int timeout; // gérer des timeouts? (!=0 : nombre de secondes)
TStamp timeout_refresh; // si oui, time refresh
int rateout; // timeout refresh? (!=0 : taux minimum toléré en octets/s)
TStamp rateout_time; // si oui, date de départ
LLint maxfile_nonhtml; // taille max d'un fichier non html
LLint maxfile_html; // idem pour un ficheir html
htsblk r; // structure htsblk de chaque objet en background
int is_update; // mode update
int head_request; // requète HEAD?
LLint range_req_size; // range utilisé
TStamp ka_time_start; // refresh time for KA
//
int http11; // L'en tête doit être signé HTTP/1.1 et non HTTP/1.0
int is_chunk; // chunk?
char *chunk_adr; // adresse chunk en cours de chargement
LLint chunk_size; // taille chunk en cours de chargement
LLint chunk_blocksize; // taille data declaree par le chunk
LLint compressed_size; // taille compressés (stats uniquement)
//
//int links_index; // to access liens[links_index]
//
char info[256]; // éventuel status pour le ftp
int stop_ftp; // flag stop pour ftp
int finalized; // finalized (optim memory)
int early_add; // was added before link heap saw it
#if DEBUG_CHECKINT
char magic2;
#endif
};
#ifndef HTS_DEF_FWSTRUCT_struct_back
#define HTS_DEF_FWSTRUCT_struct_back
typedef struct struct_back struct_back;
@@ -230,7 +156,7 @@ typedef struct struct_back struct_back;
struct struct_back {
lien_back *lnk;
int count;
inthash ready;
coucal ready;
LLint ready_size_bytes;
};
@@ -252,9 +178,9 @@ struct cache_back {
FILE *txt; // liste des fichiers (info)
char lastmodified[256];
// HASH
inthash hashtable;
coucal hashtable;
// HASH for tests (naming subsystem)
inthash cached_tests;
coucal cached_tests;
// fichiers log optionnels
FILE *log;
FILE *errlog;
@@ -275,13 +201,13 @@ typedef struct hash_struct hash_struct;
#endif
struct hash_struct {
/* Links big array reference */
const lien_url ***liens;
const lien_url *const*const*liens;
/* Savename (case insensitive ; lowercased) */
inthash sav;
coucal sav;
/* Address and path */
inthash adrfil;
coucal adrfil;
/* Former address and path */
inthash former_adrfil;
coucal former_adrfil;
/** Buffers **/
int normalized;
char normfil[HTS_URLMAXSIZE * 2];

View File

@@ -86,7 +86,11 @@ extern int IPV6_resolver;
ptr += (int) (strlen(argv[0])+2); \
argc++
#define htsmain_free() do { if (url != NULL) { free(url); } } while(0)
#define htsmain_free() do { \
if (url != NULL) { \
free(url); \
} \
} while(0)
#define ensureUrlCapacity(url, urlsize, size) do { \
if (urlsize < size || url == NULL) { \
@@ -126,8 +130,28 @@ HTSEXT_API int hts_main(int argc, char **argv) {
return ret;
}
static int hts_main_internal(int argc, char **argv, httrackp * opt);
// Main, récupère les paramètres et appelle le robot
HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
int code;
// Set ended state (3.48-14)
hts_mutexlock(&opt->state.lock);
opt->state.is_ended = 0;
hts_mutexrelease(&opt->state.lock);
code = hts_main_internal(argc, argv, opt);
// Set ended state (3.48-14)
hts_mutexlock(&opt->state.lock);
opt->state.is_ended = 1;
hts_mutexrelease(&opt->state.lock);
return code;
}
static int hts_main_internal(int argc, char **argv, httrackp * opt) {
char **x_argv = NULL; // Patch pour argv et argc: en cas de récupération de ligne de commande
char *x_argvblk = NULL; // (reprise ou update)
int x_ptr = 0; // offset
@@ -1984,7 +2008,7 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
int found = 0;
char *filter = NULL;
cache_back cache;
inthash cache_hashtable = inthash_new(0);
coucal cache_hashtable = coucal_new(0);
int sendb = 0;
if (isdigit((unsigned char) *(com + 1))) {
@@ -2515,7 +2539,7 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
/* successfully read */
if (count > 0) {
inthash hashtable = inthash_new(0);
coucal hashtable = coucal_new(0);
size_t loop;
for(loop = 0 ; bench[loop].type != DO_END ; loop++) {
size_t i;
@@ -2526,9 +2550,9 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
if (bench[loop].type == DO_ADD
|| bench[loop].type == DO_DRY_ADD) {
size_t k;
result = inthash_write(hashtable, name, (uintptr_t) expected);
result = coucal_write(hashtable, name, (uintptr_t) expected);
for(k = 0 ; k < /* stash_size*2 */ 32 ; k++) {
(void) inthash_write(hashtable, name, (uintptr_t) expected);
(void) coucal_write(hashtable, name, (uintptr_t) expected);
}
/* revert logic */
if (bench[loop].type == DO_DRY_ADD) {
@@ -2538,9 +2562,9 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
else if (bench[loop].type == DO_DEL
|| bench[loop].type == DO_DRY_DEL) {
size_t k;
result = inthash_remove(hashtable, name);
result = coucal_remove(hashtable, name);
for(k = 0 ; k < /* stash_size*2 */ 32 ; k++) {
(void) inthash_remove(hashtable, name);
(void) coucal_remove(hashtable, name);
}
/* revert logic */
if (bench[loop].type == DO_DRY_DEL) {
@@ -2550,7 +2574,7 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
else if (bench[loop].type == TEST_ADD
|| bench[loop].type == TEST_DEL) {
intptr_t value = -1;
result = inthash_readptr(hashtable, name, &value);
result = coucal_readptr(hashtable, name, &value);
if (bench[loop].type == TEST_ADD && result
&& value != expected) {
fprintf(stderr, "value failed for %s (expected %ld, got %ld)\n",
@@ -2573,7 +2597,7 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt) {
}
}
}
inthash_delete(&hashtable);
coucal_delete(&hashtable);
fprintf(stderr, "all hashtable tests were successful!\n");
} else {
fprintf(stderr, "Malformed number\n");

View File

@@ -231,8 +231,16 @@ struct t_hts_callback_ref {
size_t offset;
};
#ifdef __cplusplus
extern "C" {
#endif
extern const t_hts_htmlcheck_callbacks default_callbacks;
#ifdef __cplusplus
}
#endif
#define HT_PRINT(A) strcatbuff(opt->state.HTbuff,A);
#define HT_REQUEST_START opt->state.HTbuff[0]='\0';
#define HT_REQUEST_END

View File

@@ -270,7 +270,7 @@ int hts_unescapeUrlSpecial(const char *src, char *dest, const size_t max,
/* First character */
if (k == 0) {
/* New destination-centric offset of utf-8 buffer beginning */
if (i == lastI + 2) { /* just read a %xx */
if (lastI != (size_t) -1 && i == lastI + 2) { /* just read a %xx */
utfBufferJ = lastJ; /* position of % */
} else {
utfBufferJ = j; /* current position otherwise */

File diff suppressed because it is too large Load Diff

View File

@@ -56,7 +56,7 @@ EOF
i=$[${i}+1]
done
echo -e " /* $A */"
echo -e " case ${hash}:"
echo -e " case ${hash}u:"
echo -e " if (len == ${#ent} /* && strncmp(ent, \"${ent}\") == 0 */) {"
echo -e " return ${code};"
echo -e " }"

View File

@@ -36,8 +36,8 @@ Please visit our Website: http://www.httrack.com
#define HTTRACK_GLOBAL_DEFH
// Version (also check external version information)
#define HTTRACK_VERSION "3.48-10"
#define HTTRACK_VERSIONID "3.48.10"
#define HTTRACK_VERSION "3.48-17"
#define HTTRACK_VERSIONID "3.48.17"
#define HTTRACK_AFF_VERSION "3.x"
#define HTTRACK_LIB_VERSION "2.0"

View File

@@ -42,7 +42,7 @@ Please visit our Website: http://www.httrack.com
#include "htsglobal.h"
#include "htsmd5.h"
#include "htscore.h"
#include "htsinthash.h"
#include "coucal.h"
/* END specific definitions */
/* Specific macros */
@@ -60,48 +60,55 @@ Please visit our Website: http://www.httrack.com
// recherche dans la table selon nom1,nom2 et le no d'enregistrement
/* Key free handler (NOOP) ; addresses are kept */
static void key_freehandler(void *arg, void *value) {
static void key_freehandler(void *arg, coucal_key value) {
}
/* Key strdup (pointer copy) */
static char* key_duphandler(void *arg, const char *name) {
static coucal_key key_duphandler(void *arg, coucal_key_const name) {
union {
const char *roname;
char *name;
coucal_key_const roname;
coucal_key name;
} u;
u.roname = name;
return u.name;
}
/* Key sav hashes are using case-insensitive version */
static inthash_keys key_sav_hashes(void *arg, const char *value) {
static coucal_hashkeys key_sav_hashes(void *arg, coucal_key_const key) {
hash_struct *const hash = (hash_struct*) arg;
convtolower(hash->catbuff, value);
return inthash_hash_value(hash->catbuff);
convtolower(hash->catbuff, (const char*) key);
return coucal_hash_string(hash->catbuff);
}
/* Key sav comparison is case-insensitive */
static int key_sav_equals(void *arg, const char *a, const char *b) {
static int key_sav_equals(void *arg,
coucal_key_const a_,
coucal_key_const b_) {
const char *const a = (const char*) a_;
const char *const b = (const char*) b_;
return strcasecmp(a, b) == 0;
}
static const char* key_sav_debug_print(void *arg, const char *a) {
return a;
static const char* key_sav_debug_print(void *arg,
coucal_key_const a) {
return (const char*) a;
}
static const char* value_sav_debug_print(void *arg, void *a) {
return (char*) a;
static const char* value_sav_debug_print(void *arg, coucal_value_const a) {
return (char*) a.ptr;
}
/* Pseudo-key (lien_url structure) hash function */
static inthash_keys key_adrfil_hashes_generic(void *arg, const char *value_,
static coucal_hashkeys key_adrfil_hashes_generic(void *arg,
coucal_key_const value,
const int former) {
hash_struct *const hash = (hash_struct*) arg;
const lien_url*const lien = (lien_url*) value_;
const lien_url*const lien = (const lien_url*) value;
const char *const adr = !former ? lien->adr : lien->former_adr;
const char *const fil = !former ? lien->fil : lien->former_fil;
const char *const adr_norm = adr != NULL ?
( hash->normalized ? jump_normalized(adr) : jump_identification(adr) )
( hash->normalized ? jump_normalized_const(adr)
: jump_identification_const(adr) )
: NULL;
// copy address
@@ -117,16 +124,18 @@ static inthash_keys key_adrfil_hashes_generic(void *arg, const char *value_,
}
// hash
return inthash_hash_value(hash->normfil);
return coucal_hash_string(hash->normfil);
}
/* Pseudo-key (lien_url structure) comparison function */
static int key_adrfil_equals_generic(void *arg, const char *a_, const char *b_,
static int key_adrfil_equals_generic(void *arg,
coucal_key_const a_,
coucal_key_const b_,
const int former) {
hash_struct *const hash = (hash_struct*) arg;
const int normalized = hash->normalized;
const lien_url*const a = (lien_url*) a_;
const lien_url*const b = (lien_url*) b_;
const lien_url*const a = (const lien_url*) a_;
const lien_url*const b = (const lien_url*) b_;
const char *const a_adr = !former ? a->adr : a->former_adr;
const char *const b_adr = !former ? b->adr : b->former_adr;
const char *const a_fil = !former ? a->fil : a->former_fil;
@@ -141,8 +150,10 @@ static int key_adrfil_equals_generic(void *arg, const char *a_, const char *b_,
assertf(b_fil != NULL);
// skip scheme and authentication to the domain (possibly without www.)
ja = normalized ? jump_normalized(a_adr) : jump_identification(a_adr);
jb = normalized ? jump_normalized(b_adr) : jump_identification(b_adr);
ja = normalized
? jump_normalized_const(a_adr) : jump_identification_const(a_adr);
jb = normalized
? jump_normalized_const(b_adr) : jump_identification_const(b_adr);
assertf(ja != NULL);
assertf(jb != NULL);
if (strcasecmp(ja, jb) != 0) {
@@ -159,67 +170,74 @@ static int key_adrfil_equals_generic(void *arg, const char *a_, const char *b_,
}
}
static const char* key_adrfil_debug_print_(void *arg, const char *a_, const int former) {
static const char* key_adrfil_debug_print_(void *arg,
coucal_key_const a_,
const int former) {
hash_struct *const hash = (hash_struct*) arg;
const lien_url*const a = (lien_url*) a_;
const lien_url*const a = (const lien_url*) a_;
const char *const a_adr = !former ? a->adr : a->former_adr;
const char *const a_fil = !former ? a->fil : a->former_fil;
snprintf(hash->normfil, sizeof(hash->normfil), "%s%s", a_adr, a_fil);
return hash->normfil;
}
static const char* key_adrfil_debug_print(void *arg, const char *a_) {
static const char* key_adrfil_debug_print(void *arg,
coucal_key_const a_) {
return key_adrfil_debug_print_(arg, a_, 0);
}
static const char* key_former_adrfil_debug_print(void *arg, const char *a_) {
static const char* key_former_adrfil_debug_print(void *arg,
coucal_key_const a_) {
return key_adrfil_debug_print_(arg, a_, 1);
}
static const char* value_adrfil_debug_print(void *arg, void *value) {
static const char* value_adrfil_debug_print(void *arg,
coucal_value_const value) {
hash_struct *const hash = (hash_struct*) arg;
inthash_value v;
v.ptr = value;
snprintf(hash->normfil2, sizeof(hash->normfil2), "%d", (int) v.intg);
snprintf(hash->normfil2, sizeof(hash->normfil2), "%d", (int) value.intg);
return hash->normfil2;
}
/* "adr"/"fil" lien_url structure members hashing function */
static inthash_keys key_adrfil_hashes(void *arg, const char *value_) {
static coucal_hashkeys key_adrfil_hashes(void *arg, coucal_key_const value_) {
return key_adrfil_hashes_generic(arg, value_, 0);
}
/* "adr"/"fil" lien_url structure members comparison function */
static int key_adrfil_equals(void *arg, const char *a, const char *b) {
static int key_adrfil_equals(void *arg,
coucal_key_const a,
coucal_key_const b) {
return key_adrfil_equals_generic(arg, a, b, 0);
}
/* "former_adr"/"former_fil" lien_url structure members hashing function */
static inthash_keys key_former_adrfil_hashes(void *arg, const char *value_) {
static coucal_hashkeys key_former_adrfil_hashes(void *arg, coucal_key_const value_) {
return key_adrfil_hashes_generic(arg, value_, 1);
}
/* "former_adr"/"former_fil" lien_url structure members comparison function */
static int key_former_adrfil_equals(void *arg, const char *a, const char *b) {
static int key_former_adrfil_equals(void *arg,
coucal_key_const a,
coucal_key_const b) {
return key_adrfil_equals_generic(arg, a, b, 1);
}
void hash_init(httrackp *opt, hash_struct * hash, int normalized) {
hash->sav = inthash_new(0);
hash->adrfil = inthash_new(0);
hash->former_adrfil = inthash_new(0);
hash->sav = coucal_new(0);
hash->adrfil = coucal_new(0);
hash->former_adrfil = coucal_new(0);
hash->normalized = normalized;
hts_set_hash_handler(hash->sav, opt);
hts_set_hash_handler(hash->adrfil, opt);
hts_set_hash_handler(hash->former_adrfil, opt);
inthash_set_name(hash->sav, "hash->sav");
inthash_set_name(hash->adrfil, "hash->adrfil");
inthash_set_name(hash->former_adrfil, "hash->former_adrfil");
coucal_set_name(hash->sav, "hash->sav");
coucal_set_name(hash->adrfil, "hash->adrfil");
coucal_set_name(hash->former_adrfil, "hash->former_adrfil");
/* Case-insensitive comparison ; keys are direct char* filenames */
inthash_value_set_key_handler(hash->sav,
coucal_value_set_key_handler(hash->sav,
key_duphandler,
key_freehandler,
key_sav_hashes,
@@ -228,13 +246,13 @@ void hash_init(httrackp *opt, hash_struct * hash, int normalized) {
/* URL-style comparison ; keys are lien_url structure pointers casted
to char* */
inthash_value_set_key_handler(hash->adrfil,
coucal_value_set_key_handler(hash->adrfil,
key_duphandler,
key_freehandler,
key_adrfil_hashes,
key_adrfil_equals,
hash);
inthash_value_set_key_handler(hash->former_adrfil,
coucal_value_set_key_handler(hash->former_adrfil,
key_duphandler,
key_freehandler,
key_former_adrfil_hashes,
@@ -242,15 +260,15 @@ void hash_init(httrackp *opt, hash_struct * hash, int normalized) {
hash);
/* pretty-printing */
inthash_set_print_handler(hash->sav,
coucal_set_print_handler(hash->sav,
key_sav_debug_print,
value_sav_debug_print,
NULL);
inthash_set_print_handler(hash->adrfil,
coucal_set_print_handler(hash->adrfil,
key_adrfil_debug_print,
value_adrfil_debug_print,
hash);
inthash_set_print_handler(hash->former_adrfil,
coucal_set_print_handler(hash->former_adrfil,
key_former_adrfil_debug_print,
value_adrfil_debug_print,
hash);
@@ -258,9 +276,9 @@ void hash_init(httrackp *opt, hash_struct * hash, int normalized) {
void hash_free(hash_struct *hash) {
if (hash != NULL) {
inthash_delete(&hash->sav);
inthash_delete(&hash->adrfil);
inthash_delete(&hash->former_adrfil);
coucal_delete(&hash->sav);
coucal_delete(&hash->adrfil);
coucal_delete(&hash->former_adrfil);
}
}
@@ -273,7 +291,7 @@ int hash_read(const hash_struct * hash, const char *nom1, const char *nom2,
/* read */
switch(type) {
case HASH_STRUCT_FILENAME:
if (inthash_read(hash->sav, nom1, &intvalue)) {
if (coucal_read(hash->sav, nom1, &intvalue)) {
return (int) intvalue;
} else {
return -1;
@@ -283,7 +301,7 @@ int hash_read(const hash_struct * hash, const char *nom1, const char *nom2,
memset(&lien, 0, sizeof(lien));
lien.adr = key_duphandler(NULL, nom1);
lien.fil = key_duphandler(NULL, nom2);
if (inthash_read(hash->adrfil, (char*) &lien, &intvalue)) {
if (coucal_read(hash->adrfil, (char*) &lien, &intvalue)) {
return (int) intvalue;
} else {
return -1;
@@ -293,7 +311,7 @@ int hash_read(const hash_struct * hash, const char *nom1, const char *nom2,
memset(&lien, 0, sizeof(lien));
lien.former_adr = key_duphandler(NULL, nom1);
lien.former_fil = key_duphandler(NULL, nom2);
if (inthash_read(hash->former_adrfil, (char*) &lien, &intvalue)) {
if (coucal_read(hash->former_adrfil, (char*) &lien, &intvalue)) {
return (int) intvalue;
} else {
return -1;
@@ -309,13 +327,13 @@ int hash_read(const hash_struct * hash, const char *nom1, const char *nom2,
// enregistrement lien lpos dans les 3 tables hash1..3
void hash_write(hash_struct * hash, size_t lpos) {
/* first entry: destination filename (lowercased) */
inthash_write(hash->sav, (*hash->liens)[lpos]->sav, lpos);
coucal_write(hash->sav, (*hash->liens)[lpos]->sav, lpos);
/* second entry: URL address and path */
inthash_write(hash->adrfil, (char*) (*hash->liens)[lpos], lpos);
coucal_write(hash->adrfil, (*hash->liens)[lpos], lpos);
/* third entry: URL address and path before redirect */
if ((*hash->liens)[lpos]->former_adr) { // former_adr existe?
inthash_write(hash->former_adrfil, (char*) (*hash->liens)[lpos], lpos);
coucal_write(hash->former_adrfil, (*hash->liens)[lpos], lpos);
}
}

View File

@@ -272,7 +272,7 @@ void help_wizard(httrackp * opt) {
if (strnotempty(str)) {
while((a = strchr(str, ' ')))
*a = ':'; // port
if (!strchr(jump_identification(str), ':')) {
if (!strchr(jump_identification_const(str), ':')) {
char str2[256];
printf("\nProxy port (return=8080) :");

View File

@@ -40,7 +40,7 @@ Please visit our Website: http://www.httrack.com
#if HTS_MAKE_KEYWORD_INDEX
#include "htshash.h"
#include "htsinthash.h"
#include "coucal.h"
/* Keyword Indexer Parameters */
@@ -144,7 +144,7 @@ int index_keyword(const char *html_data, LLint size, const char *mime,
//
//int WordIndexSize = 1024;
inthash WordIndexHash = NULL;
coucal WordIndexHash = NULL;
FILE *tmpfp = NULL;
//
@@ -190,7 +190,7 @@ int index_keyword(const char *html_data, LLint size, const char *mime,
// Create hash structure
// Hash tables rulez da world!
WordIndexHash = inthash_new(0);
WordIndexHash = coucal_new(0);
if (!WordIndexHash)
return 0;
@@ -252,7 +252,7 @@ int index_keyword(const char *html_data, LLint size, const char *mime,
/* Store it ? */
if (len >= KEYW_MIN_LEN) {
hts_primindex_words++;
if (inthash_inc(WordIndexHash, keyword)) { /* added new */
if (coucal_inc(WordIndexHash, keyword)) { /* added new */
fprintf(tmpfp, "%s\n", keyword);
}
}
@@ -285,13 +285,13 @@ int index_keyword(const char *html_data, LLint size, const char *mime,
if (strnotempty(line)) {
intptr_t e = 0;
if (inthash_read(WordIndexHash, line, &e)) {
if (coucal_read(WordIndexHash, line, &e)) {
//if (e) {
char BIGSTK savelst[HTS_URLMAXSIZE * 2];
e++; /* 0 means "once" */
if (strncmp((const char *) fslash(catbuff, sizeof(catbuff), (char *) indexpath), filename, strlen(indexpath)) == 0) // couper
if (strncmp((const char *) fslash(catbuff, sizeof(catbuff), (const char *) indexpath), filename, strlen(indexpath)) == 0) // couper
strcpybuff(savelst, filename + strlen(indexpath));
else
strcpybuff(savelst, filename);
@@ -313,7 +313,7 @@ int index_keyword(const char *html_data, LLint size, const char *mime,
tmpfp = NULL;
// Clear hash table
inthash_delete(&WordIndexHash);
coucal_delete(&WordIndexHash);
#endif
return 1;
}
@@ -478,8 +478,8 @@ int strcpos(const char *adr, char c) {
}
int mystrcmp(const void *_e1, const void *_e2) {
char **e1 = (char **) _e1;
char **e2 = (char **) _e2;
const char *const*const e1 = (const char *const*) _e1;
const char *const*const e2 = (const char *const*) _e2;
return strcmp(*e1, *e2);
}

View File

@@ -1,382 +0,0 @@
/* ------------------------------------------------------------ */
/*
HTTrack Website Copier, Offline Browser for Windows and Unix
Copyright (C) 1998-2014 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Important notes:
- We hereby ask people using this source NOT to use it in purpose of grabbing
emails addresses, or collecting any other private information on persons.
This would disgrace our work, and spoil the many hours we spent on it.
Please visit our Website: http://www.httrack.com
*/
/* ------------------------------------------------------------ */
/* File: hash table system (fast index) */
/* Author: Xavier Roche */
/* ------------------------------------------------------------ */
/**
* Library notes:
* This small hashtable library provides key/value hashtable, with a string
* key, and integer/pointer value (with an associated optional allocator)
* It features O(1) average insertion, O(1) lookup, and O(1) delete.
*
* Implementation notes:
* Implementation is auto-rehashable, and uses cuckoo hashing of size 2**n
* with a MD5 or FNV-1 hash function, with one additional auxiliary hash
* function.
* It also uses a small stash area to handle rare cases of collisions.
* Enumeration of all key/values is possible, deletion is also possible, but
* currently without any auto-shrinking (ie. table will never shrink).
* Overall, two main blocks are allocated: one for the items, and one for
* the keys (pool).
*
* References:
* Cuckoo Hashing http://en.wikipedia.org/wiki/Cuckoo_hashing
* Cuckoo Stash http://research.microsoft.com/pubs/73856/stash-full.9-30.pdf
* FNV http://www.isthe.com/chongo/tech/comp/fnv/
* MD5 http://en.wikipedia.org/wiki/MD5
**/
#ifndef HTSINTHASH_DEFH
#define HTSINTHASH_DEFH
/* Includes */
#ifdef _WIN32
#include <stddef.h>
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
#elif (defined(SOLARIS) || defined(sun) || defined(HAVE_INTTYPES_H) \
|| defined(BSD) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD_kernel__))
#include <inttypes.h>
#else
#include <stdint.h>
#endif
#include <stdarg.h>
/** Value. **/
typedef union inthash_value {
/** Integer value. **/
intptr_t intg;
/** Unsigned integer value. **/
uintptr_t uintg;
/** Pointer value. **/
void *ptr;
} inthash_value;
/** NULL Value. **/
#define INTHASH_VALUE_NULL { 0 }
#ifndef HTS_DEF_FWSTRUCT_inthash_item
#define HTS_DEF_FWSTRUCT_inthash_item
typedef struct inthash_item inthash_item;
#endif
/** Hash key (32-bit) **/
typedef uint32_t inthash_key;
/** Pair of hashes **/
typedef struct inthash_keys {
inthash_key hash1;
inthash_key hash2;
} inthash_keys;
/** NULL pair of hashes. **/
#define INTHASH_KEYS_NULL { 0, 0 }
/** Item holding a value. **/
struct inthash_item {
/** Key. **/
char *name;
/** Value. **/
inthash_value value;
/** Hashes of the key. **/
inthash_keys hashes;
};
/** Log level. **/
typedef enum inthash_loglevel {
inthash_log_critical,
inthash_log_warning,
inthash_log_info,
inthash_log_debug,
inthash_log_trace
} inthash_loglevel;
/** Alias for legacy code. **/
typedef inthash_item inthash_chain;
/** Value free handler **/
typedef void (*t_inthash_freehandler)(void *arg, void *value);
/** Name dup handler. **/
typedef char* (*t_inthash_duphandler)(void *arg, const char *name);
/** Hash computation handler. **/
typedef inthash_keys (*t_inthash_hasheshandler)(void *arg, const char *value);
/** Hashtable logging handler. **/
typedef void (*t_inthash_loghandler)(void *arg, inthash_loglevel level,
const char* format, va_list args);
/** Hashtable fatal assertion failure. **/
typedef void (*t_inthash_asserthandler)(void *arg, const char* exp, const char* file, int line);
/** Key printer (debug) **/
typedef const char* (*t_inthash_printkeyhandler)(void *arg, const char *name);
/** Value printer (debug) **/
typedef const char* (*t_inthash_printvaluehandler)(void *arg, void *value);
/**
* Value comparison handler (returns non-zero value if strings are equal).
**/
typedef int (*t_inthash_cmphandler)(void *arg, const char *a, const char *b);
/** Hashtable (opaque structure). **/
#ifndef HTS_DEF_FWSTRUCT_struct_inthash
#define HTS_DEF_FWSTRUCT_struct_inthash
typedef struct struct_inthash struct_inthash, *inthash;
#endif
/** Hashtable enumeration (opaque structure). **/
#ifndef HTS_DEF_FWSTRUCT_struct_inthash_enum
#define HTS_DEF_FWSTRUCT_struct_inthash_enum
typedef struct struct_inthash_enum struct_inthash_enum;
#endif
/** Enumeration. **/
struct struct_inthash_enum {
inthash table;
size_t index;
};
/* Library internal definictions */
#ifdef HTS_INTERNAL_BYTECODE
/**
* Create a new hashtable, with initial bucket size of 'size'.
* If size is 0, use the default minimal bucket size.
* Return a non-NULL pointer upon success.
**/
inthash inthash_new(size_t size);
/**
* Was the hashtable successfully created ?
* Return non-zero value if the hashtable is valid.
**/
int inthash_created(inthash hashtable);
/**
* Delete a hashtable, freeing all entries.
**/
void inthash_delete(inthash * hashtable);
/**
* Return the number of items in the hashtable.
**/
size_t inthash_nitems(inthash hashtable);
/**
* Return the memory size taken by the hashtable.
* (This does not take account of the possible memory taken by values)
**/
size_t inthash_memory_size(inthash hashtable);
/**
* If 'flag' is non-zero, calls inthash_value_set_value_handler() with
* default system free() handler function, otherwise, free the value handlers.
**/
void inthash_value_is_malloc(inthash hashtable, int flag);
/**
* Set handlers for values.
* free: this handler will be called when a value is to be removed from
* the hashtable. if NULL, values won't be free'd.
* arg: opaque custom argument to be used by functions.
* Handler(s) MUST NOT be changed once elements have been added.
**/
void inthash_value_set_value_handler(inthash hashtable,
t_inthash_freehandler free,
void *arg);
/**
* Set handlers for keys.
* dup: handler called to duplicate a key. if NULL, the internal pool is used.
* free: handler called to free a key. if NULL, the internal pool is used.
* hash: hashing handler, called to hash a key. if NULL, the default hash
* function is used.
* equals: comparison handler, returning non-zero value when two keys are
* identical. if NULL, the default comparison function is used.
* arg: opaque custom argument to be used by functions.
* Handler(s) MUST NOT be changed once elements have been added.
**/
void inthash_value_set_key_handler(inthash hashtable,
t_inthash_duphandler dup,
t_inthash_freehandler free,
t_inthash_hasheshandler hash,
t_inthash_cmphandler equals,
void *arg);
/**
* Set assertion failure handler.
* log: handler called upon serious programming error
* fatal: handler called upon serious programming error
**/
void inthash_set_assert_handler(inthash hashtable,
t_inthash_loghandler log,
t_inthash_asserthandler fatal,
void *arg);
/**
* Set pretty print loggers (debug). Both handlers must return a string
* pointer which shall be valid until the next call. Both key and value
* pointers shall be valid at the same time.
* name: handler called to print the string representation of the name
* value: handler called to print the string representation of the value
**/
void inthash_set_print_handler(inthash hashtable,
t_inthash_printkeyhandler key,
t_inthash_printvaluehandler value,
void *arg);
/**
* Set the hashtable name, for degugging purpose.
* name: the hashtable name (ASCII or UTF-8)
*/
void inthash_set_name(inthash hashtable, const char *name);
/**
* Get the hashtable name, for degugging purpose.
* Return NULL if no name was defined.
**/
const char* inthash_get_name(inthash hashtable);
/**
* Read an integer entry from the hashtable.
* Return non-zero value upon success and sets intvalue.
**/
int inthash_read(inthash hashtable, const char *name, intptr_t * intvalue);
/**
* Same as inthash_read(), but return 0 is the value was zero.
**/
int inthash_readptr(inthash hashtable, const char *name, intptr_t * intvalue);
/**
* Return non-zero value if the given entry exists.
**/
int inthash_exists(inthash hashtable, const char *name);
/**
* Read an entry from the hashtable.
* Return non-zero value upon success and sets value.
**/
int inthash_read_value(inthash hashtable, const char *name,
inthash_value * value);
/**
* Write an entry to the hashtable.
* Return non-zero value if the entry was added, zero if it was replaced.
**/
int inthash_write_value(inthash hashtable, const char *name,
inthash_value value);
/**
* Read a pointer entry from the hashtable.
* Return non-zero value upon success and sets value.
**/
int inthash_read_pvoid(inthash hashtable, const char *name, void **value);
/**
* Write a pointer entry to the hashtable.
* Return non-zero value if the entry was added, zero if it was replaced.
**/
int inthash_write_pvoid(inthash hashtable, const char *name, void *value);
/**
* Alias to inthash_write_pvoid()
**/
void inthash_add_pvoid(inthash hashtable, const char *name, void *value);
/**
* Write an integer entry to the hashtable.
* Return non-zero value if the entry was added, zero if it was replaced.
**/
int inthash_write(inthash hashtable, const char *name, intptr_t value);
/**
* Alias to inthash_write()
**/
void inthash_add(inthash hashtable, const char *name, intptr_t value);
/**
* Increment an entry value in the hashtable
* (or create a new entry with value 1 if it does not yet exist)
* Return non-zero value if the entry was added, zero if it was changed.
**/
int inthash_inc(inthash hashtable, const char *name);
/**
* Decrement an entry value in the hashtable
* (or create a new entry with value -1 if it does not yet exist)
* Return non-zero value if the entry was added, zero if it was changed.
**/
int inthash_dec(inthash hashtable, const char *name);
/**
* Remove an entry from the hashtable
* Return non-zero value if the entry was removed, zero otherwise.
**/
int inthash_remove(inthash hashtable, const char *name);
/**
* Return a new enumerator.
* Note: deleting entries is safe while enumerating, but adding entries
* lead to undefined enumeration behavior (yet safe).
**/
struct_inthash_enum inthash_enum_new(inthash hashtable);
/**
* Enumerate the next entry.
**/
inthash_item *inthash_enum_next(struct_inthash_enum * e);
/**
* Compute a hash, given a string value.
**/
inthash_keys inthash_hash_value(const char *value);
/**
* Set default global assertion failure handler.
* The handler will be used if no specific handler was defined in the
* hashtable itself.
* log: handler called upon serious error log (opaque argument
* is the hashtable itself)
* fatal: handler called upon serious programming error (opaque argument
* is the hashtable itself)
**/
void inthash_set_global_assert_handler(t_inthash_loghandler log,
t_inthash_asserthandler fatal);
#endif
#endif

View File

@@ -928,7 +928,7 @@ int http_sendhead(httrackp * opt, t_cookie * cookie, int mode,
printf("Proxy Use: for %s%s proxy %d port %d\n", adr, fil,
retour->req.proxy.name, retour->req.proxy.port);
#endif
print_buffer(&bstr, "http://%s", jump_identification(adr));
print_buffer(&bstr, "http://%s", jump_identification_const(adr));
} else { // ftp:// en proxy http
#if HDEBUG
printf("Proxy Use for ftp: for %s%s proxy %d port %d\n", adr, fil,
@@ -971,8 +971,8 @@ int http_sendhead(httrackp * opt, t_cookie * cookie, int mode,
// tester proxy authentication
if (retour->req.proxy.active) {
if (link_has_authorization(retour->req.proxy.name)) { // et hop, authentification proxy!
const char *a = jump_identification(retour->req.proxy.name);
const char *astart = jump_protocol(retour->req.proxy.name);
const char *a = jump_identification_const(retour->req.proxy.name);
const char *astart = jump_protocol_const(retour->req.proxy.name);
char autorisation[1100];
char user_pass[256];
@@ -1000,7 +1000,7 @@ int http_sendhead(httrackp * opt, t_cookie * cookie, int mode,
)
) { // PAS file://
print_buffer(&bstr, "Referer: http://%s%s"H_CRLF,
jump_identification(referer_adr), referer_fil);
jump_identification_const(referer_adr), referer_fil);
}
}
// HTTP field: referer
@@ -1025,7 +1025,7 @@ int http_sendhead(httrackp * opt, t_cookie * cookie, int mode,
int max_cookies = 8;
do {
b = cookie_find(b, "", jump_identification(adr), fil); // prochain cookie satisfaisant aux conditions
b = cookie_find(b, "", jump_identification_const(adr), fil); // prochain cookie satisfaisant aux conditions
if (b != NULL) {
max_cookies--;
if (!cook) {
@@ -1054,7 +1054,7 @@ int http_sendhead(httrackp * opt, t_cookie * cookie, int mode,
}
{
const char *real_adr = jump_identification(adr);
const char *real_adr = jump_identification_const(adr);
// Mandatory per RFC2616
if (!direct_url) { // pas ftp:// par exemple
@@ -1103,8 +1103,8 @@ int http_sendhead(httrackp * opt, t_cookie * cookie, int mode,
autorisation[0] = '\0';
if (link_has_authorization(adr)) { // ohh une authentification!
const char *a = jump_identification(adr);
const char *astart = jump_protocol(adr);
const char *a = jump_identification_const(adr);
const char *astart = jump_protocol_const(adr);
if (!direct_url) { // pas ftp:// par exemple
char user_pass[256];
@@ -1149,7 +1149,7 @@ int http_sendhead(httrackp * opt, t_cookie * cookie, int mode,
if (_DEBUG_HEAD) {
if (ioinfo) {
fprintf(ioinfo, "[%d] request for %s%s:\r\n", retour->debugid,
jump_identification(adr), fil);
jump_identification_const(adr), fil);
fprintfio(ioinfo, bstr.buffer, "<<< ");
fprintf(ioinfo, "\r\n");
fflush(ioinfo);
@@ -1528,7 +1528,7 @@ void treathead(t_cookie * cookie, const char *adr, const char *fil, htsblk * ret
// initialiser cookie lu actuellement
if (adr)
strcpybuff(domain, jump_identification(adr)); // domaine
strcpybuff(domain, jump_identification_const(adr)); // domaine
strcpybuff(path, "/"); // chemin (/)
strcpybuff(cook_name, ""); // nom cookie (MYCOOK)
strcpybuff(cook_value, ""); // valeur (ID=toto,S=1234)
@@ -2103,7 +2103,7 @@ T_SOC newhttp(httrackp * opt, const char *_iadr, htsblk * retour, int port,
const char *error = "unknown error";
// tester un éventuel id:pass et virer id:pass@ si détecté
const char *const iadr = jump_identification(_iadr);
const char *const iadr = jump_identification_const(_iadr);
SOCaddr_clear(server);
@@ -2113,7 +2113,7 @@ T_SOC newhttp(httrackp * opt, const char *_iadr, htsblk * retour, int port,
// tester un éventuel port
if (port == -1) {
char *a = jump_toport(iadr);
const char *a = jump_toport_const(iadr);
#if HTS_USEOPENSSL
if (retour->ssl)
@@ -2362,9 +2362,9 @@ int ident_url_absolute(const char *url, lien_adrfil *adrfil) {
p = url + pos;
// p pointe sur le début de l'adrfil->adresse, ex: www.truc.fr/sommaire/index.html
q = strchr(jump_identification(p), '/');
q = strchr(jump_identification_const(p), '/');
if (q == 0)
q = strchr(jump_identification(p), '?'); // http://www.foo.com?bar=1
q = strchr(jump_identification_const(p), '?'); // http://www.foo.com?bar=1
if (q == 0)
q = p + strlen(p); // pointe sur \0
// q pointe sur le chemin, ex: index.html?query=recherche
@@ -3123,7 +3123,7 @@ void rawlinput(FILE * fp, char *s, int max) {
}
//cherche chaine, case insensitive
char *strstrcase(char *s, const char *o) {
const char *strstrcase(const char *s, const char *o) {
while(*s && strfield(s, o) == 0)
s++;
if (*s == '\0')
@@ -3344,24 +3344,33 @@ int ishttperror(int err) {
return 0;
}
/* Declare a non-const version of FUN */
#define DECLARE_NON_CONST_VERSION(FUN) \
char *FUN(char *source) { \
const char *const ret = FUN ##_const(source); \
return ret != NULL ? source + ( ret - source ) : NULL; \
}
// retourne le pointeur ou le pointeur + offset si il existe dans la chaine un @ signifiant
// une identification
HTSEXT_API char *jump_identification(const char *source) {
HTSEXT_API const char *jump_identification_const(const char *source) {
const char *a, *trytofind;
if (strcmp(source, "file://") == 0)
return (char *) source;
return source;
// rechercher dernier @ (car parfois email transmise dans adresse!)
// mais sauter ftp:// éventuel
a = jump_protocol(source);
a = jump_protocol_const(source);
trytofind = strrchr_limit(a, '@', strchr(a, '/'));
return (char *) ((trytofind != NULL) ? trytofind : a);
return trytofind != NULL ? trytofind : a;
}
HTSEXT_API char *jump_normalized(const char *source) {
HTSEXT_API DECLARE_NON_CONST_VERSION(jump_identification)
HTSEXT_API const char *jump_normalized_const(const char *source) {
if (strcmp(source, "file://") == 0)
return (char *) source;
source = jump_identification(source);
return source;
source = jump_identification_const(source);
if (strfield(source, "www") && source[3] != '\0') {
if (source[3] == '.') { // www.foo.com -> foo.com
source += 4;
@@ -3375,12 +3384,14 @@ HTSEXT_API char *jump_normalized(const char *source) {
}
}
}
return (char *) source;
return source;
}
HTSEXT_API DECLARE_NON_CONST_VERSION(jump_normalized)
static int sortNormFnc(const void *a_, const void *b_) {
char **a = (char **) a_;
char **b = (char **) b_;
const char *const*const a = (const char *const*) a_;
const char *const*const b = (const char *const*) b_;
return strcmp(*a + 1, *b + 1);
}
@@ -3389,7 +3400,7 @@ HTSEXT_API char *fil_normalized(const char *source, char *dest) {
char lastc = 0;
int gotquery = 0;
int ampargs = 0;
int i, j;
size_t i, j;
char *query = NULL;
for(i = j = 0; source[i] != '\0'; i++) {
@@ -3411,7 +3422,7 @@ HTSEXT_API char *fil_normalized(const char *source, char *dest) {
if (ampargs > 1) {
char **amps = malloct(ampargs * sizeof(char *));
char *copyBuff = NULL;
int qLen = 0;
size_t qLen = 0;
assertf(amps != NULL);
gotquery = 0;
@@ -3420,13 +3431,14 @@ HTSEXT_API char *fil_normalized(const char *source, char *dest) {
if (!gotquery) {
gotquery = 1;
query = &dest[i];
qLen = (int) strlen(query);
qLen = strlen(query);
}
assertf(j < ampargs);
amps[j++] = &dest[i];
dest[i] = '\0';
}
}
assertf(gotquery);
assertf(j == ampargs);
/* Sort 'em all */
@@ -3443,7 +3455,7 @@ HTSEXT_API char *fil_normalized(const char *source, char *dest) {
strcatbuff(copyBuff, "&");
strcatbuff(copyBuff, amps[i] + 1);
}
assertf((int) strlen(copyBuff) <= qLen);
assertf(strlen(copyBuff) == qLen);
strcpybuff(query, copyBuff);
/* Cleanup */
@@ -3457,7 +3469,7 @@ HTSEXT_API char *fil_normalized(const char *source, char *dest) {
#define endwith(a) ( (len >= (sizeof(a)-1)) ? ( strncmp(dest, a+len-(sizeof(a)-1), sizeof(a)-1) == 0 ) : 0 );
HTSEXT_API char *adr_normalized(const char *source, char *dest) {
/* not yet too aggressive (no com<->net<->org checkings) */
strcpybuff(dest, jump_normalized(source));
strcpybuff(dest, jump_normalized_const(source));
return dest;
}
@@ -3465,52 +3477,37 @@ HTSEXT_API char *adr_normalized(const char *source, char *dest) {
// find port (:80) or NULL if not found
// can handle IPV6 addresses
HTSEXT_API char *jump_toport(const char *source) {
HTSEXT_API const char *jump_toport_const(const char *source) {
const char *a, *trytofind;
a = jump_identification(source);
a = jump_identification_const(source);
trytofind = strrchr_limit(a, ']', strchr(source, '/')); // find last ] (http://[3ffe:b80:1234::1]:80/foo.html)
a = strchr((trytofind) ? trytofind : a, ':');
return (char *) a;
return a;
}
HTSEXT_API DECLARE_NON_CONST_VERSION(jump_toport)
// strrchr, but not too far
char *strrchr_limit(const char *s, char c, const char *limit) {
const char *strrchr_limit(const char *s, char c, const char *limit) {
if (limit == NULL) {
const char *p = strrchr(s, c);
return (char *) (p ? (p + 1) : NULL);
return p ? (p + 1) : NULL;
} else {
const char *a = NULL, *p;
for(;;) {
p = strchr((a) ? a : s, c);
if ((p >= limit) || (p == NULL))
return (char *) a;
return a;
a = p + 1;
}
}
}
// strrchr, but not too far
char *strstr_limit(const char *s, const char *sub, const char *limit) {
if (limit == NULL) {
return strstr(s, sub);
} else {
const char *pos = strstr(s, sub);
if (pos != NULL) {
const char *farpos = strstr(s, limit);
if (farpos == NULL || pos < farpos)
return (char *) pos;
}
}
return NULL;
}
// retourner adr sans ftp://
char *jump_protocol(const char *source) {
const char *jump_protocol_const(const char *source) {
int p;
// scheme
@@ -3526,9 +3523,11 @@ char *jump_protocol(const char *source) {
// net_path
if (strncmp(source, "//", 2) == 0)
source += 2;
return (char *) source;
return source;
}
DECLARE_NON_CONST_VERSION(jump_protocol)
// codage base 64 a vers b
void code64(unsigned char *a, int size_a, unsigned char *b, int crlf) {
int i1 = 0, i2 = 0, i3 = 0, i4 = 0;
@@ -4520,7 +4519,7 @@ int hts_read(htsblk * r, char *buff, int size) {
// 'RX98
// 'capsule' contenant uniquement le cache
t_dnscache *_hts_cache(httrackp * opt) {
t_dnscache *hts_cache(httrackp * opt) {
assertf(opt != NULL);
if (opt->state.dns_cache == NULL) {
opt->state.dns_cache = (t_dnscache *) malloct(sizeof(t_dnscache));
@@ -4553,9 +4552,12 @@ void hts_cache_free(t_dnscache *const root) {
// si h_length==0 alors le nom n'existe pas dans le dns
static SOCaddr* hts_ghbn(const t_dnscache *cache, const char *const iadr, SOCaddr *const addr) {
assertf(addr != NULL);
assertf(iadr != NULL);
if (*iadr == '\0') {
return NULL;
}
for(; cache != NULL; cache = cache->n) {
assertf(cache != NULL);
assertf(iadr != NULL);
if (cache->iadr != NULL && strcmp(cache->iadr, iadr) == 0) { // ok trouvé
if (cache->host_length > 0) { // entrée valide
SOCaddr_copyaddr2(*addr, cache->host_addr, cache->host_length);
@@ -4659,16 +4661,16 @@ HTSEXT_API int check_hostname_dns(const char *const hostname) {
// Needs locking
// cache dns interne à HTS // ** FREE A FAIRE sur la chaine
static SOCaddr* hts_dns_resolve_(httrackp * opt, const char *_iadr,
SOCaddr *const addr, const char **error) {
SOCaddr *const addr, const char **error) {
char BIGSTK iadr[HTS_URLMAXSIZE * 2];
t_dnscache *cache = _hts_cache(opt); // adresse du cache
t_dnscache *cache = hts_cache(opt); // adresse du cache
SOCaddr *sa;
assertf(opt != NULL);
assertf(_iadr != NULL);
assertf(addr != NULL);
strcpybuff(iadr, jump_identification(_iadr));
strcpybuff(iadr, jump_identification_const(_iadr));
// couper éventuel :
{
char *a;
@@ -4698,16 +4700,17 @@ static SOCaddr* hts_dns_resolve_(httrackp * opt, const char *_iadr,
/* attempt to store new entry */
cache->n = (t_dnscache *) calloct(1, sizeof(t_dnscache));
if (cache->n != NULL) {
strcpybuff(cache->n->iadr, iadr);
t_dnscache *const next = cache->n;
strcpybuff(next->iadr, iadr);
if (sa != NULL) {
cache->n->host_length = SOCaddr_size(*sa);
assertf(cache->n->host_length < sizeof(cache->n->host_addr));
memcpy(cache->n->host_addr, &SOCaddr_sockaddr(*sa), cache->n->host_length);
next->host_length = SOCaddr_size(*sa);
assertf(next->host_length < sizeof(next->host_addr));
memcpy(next->host_addr, &SOCaddr_sockaddr(*sa), next->host_length);
} else {
cache->n->host_addr[0] = '\0';
cache->n->host_length = 0; // non existant dans le dns
next->host_addr[0] = '\0';
next->host_length = 0; // non existant dans le dns
}
cache->n->n = NULL;
next->n = NULL;
return sa;
}
@@ -5020,29 +5023,29 @@ HTSEXT_API void hts_set_error_callback(htsErrorCallback handler) {
htsCallbackErr = handler;
}
HTSEXT_API htsErrorCallback hts_get_error_callback() {
HTSEXT_API htsErrorCallback hts_get_error_callback(void) {
return htsCallbackErr;
}
static void default_inthash_asserthandler(void *arg, const char* exp, const char* file, int line) {
static void default_coucal_asserthandler(void *arg, const char* exp, const char* file, int line) {
abortf_(exp, file, line);
}
static int get_loglevel_from_inthash(inthash_loglevel level) {
static int get_loglevel_from_coucal(coucal_loglevel level) {
switch(level) {
case inthash_log_critical:
case coucal_log_critical:
return LOG_PANIC;
break;
case inthash_log_warning:
case coucal_log_warning:
return LOG_WARNING;
break;
case inthash_log_info:
case coucal_log_info:
return LOG_INFO;
break;
case inthash_log_debug:
case coucal_log_debug:
return LOG_DEBUG;
break;
case inthash_log_trace:
case coucal_log_trace:
return LOG_TRACE;
break;
default:
@@ -5052,10 +5055,10 @@ static int get_loglevel_from_inthash(inthash_loglevel level) {
}
/* log to default console */
static void default_inthash_loghandler(void *arg, inthash_loglevel level,
static void default_coucal_loghandler(void *arg, coucal_loglevel level,
const char* format, va_list args) {
if (level <= inthash_log_warning) {
if (level <= coucal_log_warning) {
fprintf(stderr, "** warning: ");
}
vfprintf(stderr, format, args);
@@ -5063,23 +5066,23 @@ static void default_inthash_loghandler(void *arg, inthash_loglevel level,
}
/* log to project log */
static void htsopt_inthash_loghandler(void *arg, inthash_loglevel level,
static void htsopt_coucal_loghandler(void *arg, coucal_loglevel level,
const char* format, va_list args) {
httrackp *const opt = (httrackp*) arg;
if (opt != NULL && opt->log != NULL) {
hts_log_vprint(opt, get_loglevel_from_inthash(level),
hts_log_vprint(opt, get_loglevel_from_coucal(level),
format, args);
} else {
default_inthash_loghandler(NULL, level, format, args);
default_coucal_loghandler(NULL, level, format, args);
}
}
/* attach hashtable logger to project log */
void hts_set_hash_handler(inthash hashtable, httrackp *opt) {
void hts_set_hash_handler(coucal hashtable, httrackp *opt) {
/* Init hashtable default assertion handler. */
inthash_set_assert_handler(hashtable,
htsopt_inthash_loghandler,
default_inthash_asserthandler,
coucal_set_assert_handler(hashtable,
htsopt_coucal_loghandler,
default_coucal_asserthandler,
opt);
}
@@ -5105,8 +5108,8 @@ HTSEXT_API int hts_init(void) {
hts_debug_log_print("entering hts_init()"); /* debug */
/* Init hashtable default assertion handler. */
inthash_set_global_assert_handler(default_inthash_loghandler,
default_inthash_asserthandler);
coucal_set_global_assert_handler(default_coucal_loghandler,
default_coucal_asserthandler);
/* Init threads (lazy init) */
htsthread_init();
@@ -5477,6 +5480,8 @@ HTSEXT_API httrackp *hts_create_opt(void) {
opt->bypass_limits = 0; // enforce limits by default
opt->state.stop = 0; // stopper
opt->state.exit_xh = 0; // abort
//
opt->state.is_ended = 0;
/* Alocated buffers */
@@ -5501,6 +5506,10 @@ HTSEXT_API httrackp *hts_create_opt(void) {
return opt;
}
HTSEXT_API size_t hts_sizeof_opt(void) {
return sizeof(httrackp);
}
HTSEXT_API void hts_free_opt(httrackp * opt) {
if (opt != NULL) {
@@ -5536,8 +5545,13 @@ HTSEXT_API void hts_free_opt(httrackp * opt) {
/* Cache */
if (opt->state.dns_cache != NULL) {
t_dnscache *const root = opt->state.dns_cache;
t_dnscache *root;
hts_mutexlock(&opt->state.lock);
root = opt->state.dns_cache;
opt->state.dns_cache = NULL;
hts_mutexrelease(&opt->state.lock);
hts_cache_free(root);
}

View File

@@ -105,86 +105,6 @@ MSVC2003INLINEBUG HTS_STATIC char *getHtsOptBuff_(httrackp * opt) {
#define OPT_GET_BUFF(OPT) ( getHtsOptBuff_(OPT) )
#define OPT_GET_BUFF_SIZE(OPT) ( sizeof(opt->state.concat.buff[0]) )
// structure pour paramètres supplémentaires lors de la requête
#ifndef HTS_DEF_FWSTRUCT_htsrequest_proxy
#define HTS_DEF_FWSTRUCT_htsrequest_proxy
typedef struct htsrequest_proxy htsrequest_proxy;
#endif
struct htsrequest_proxy {
int active;
const char* name;
int port;
const char* bindhost; // bind this host
};
#ifndef HTS_DEF_FWSTRUCT_htsrequest
#define HTS_DEF_FWSTRUCT_htsrequest
typedef struct htsrequest htsrequest;
#endif
struct htsrequest {
short int user_agent_send; // user agent (ex: httrack/1.0 [sun])
short int http11; // l'en tête peut (doit) être signé HTTP/1.1 et non HTTP/1.0
short int nokeepalive; // pas de keep-alive
short int range_used; // Range utilisé
short int nocompression; // Pas de compression
short int flush_garbage; // recycled
const char* user_agent;
const char* referer;
const char* from;
const char* lang_iso;
const char* accept;
const char* headers;
htsrequest_proxy proxy; // proxy
};
// structure pour retour d'une connexion/prise d'en tête
#ifndef HTS_DEF_FWSTRUCT_htsblk
#define HTS_DEF_FWSTRUCT_htsblk
typedef struct htsblk htsblk;
#endif
struct htsblk {
int statuscode; // status-code, -1=erreur, 200=OK,201=..etc (cf RFC1945)
short int notmodified; // page ou fichier NON modifié (transféré)
short int is_write; // sortie sur disque (out) ou en mémoire (adr)
short int is_chunk; // mode chunk
short int compressed; // compressé?
short int empty; // vide?
short int keep_alive; // Keep-Alive?
short int keep_alive_trailers; // ..with trailers extension
int keep_alive_t; // KA timeout
int keep_alive_max; // KA number of requests
char *adr; // adresse du bloc de mémoire, NULL=vide
char *headers; // adresse des en têtes si présents
FILE *out; // écriture directe sur disque (si is_write=1)
LLint size; // taille fichier
char msg[80]; // message éventuel si échec ("\0"=non précisé)
char contenttype[64]; // content-type ("text/html" par exemple)
char charset[64]; // charset ("iso-8859-1" par exemple)
char contentencoding[64]; // content-encoding ("gzip" par exemple)
char *location; // on copie dedans éventuellement la véritable 'location'
LLint totalsize; // taille totale à télécharger (-1=inconnue)
short int is_file; // ce n'est pas une socket mais un descripteur de fichier si 1
T_SOC soc; // ID socket
SOCaddr address; // IP address
int address_size; // IP address structure length (unused internally)
FILE *fp; // fichier pour file://
#if HTS_USEOPENSSL
short int ssl; // is this connection a SSL one? (https)
// BIO* ssl_soc; // SSL structure
SSL *ssl_con; // connection structure
#endif
char lastmodified[64]; // Last-Modified
char etag[256]; // Etag
char cdispo[256]; // Content-Disposition coupé
LLint crange; // Content-Range
LLint crange_start; // Content-Range
LLint crange_end; // Content-Range
int debugid; // debug connection
/* */
htsrequest req; // paramètres pour la requête
/*char digest[32+2]; // digest md5 généré par le moteur ("" si non généré) */
};
/* ANCIENNE STURCTURE pour cache 1.0 */
#ifndef HTS_DEF_FWSTRUCT_OLD_t_proxy
#define HTS_DEF_FWSTRUCT_OLD_t_proxy
@@ -243,7 +163,7 @@ struct t_dnscache {
void hts_init_htsblk(htsblk * r);
// attach specific project log to hachtable logger
void hts_set_hash_handler(inthash hashtable, httrackp *opt);
void hts_set_hash_handler(coucal hashtable, httrackp *opt);
// version
HTSEXT_API const char* hts_version(void);
@@ -297,7 +217,7 @@ int ftp_available(void);
#if HTS_DNSCACHE
void hts_cache_free(t_dnscache *const cache);
t_dnscache *_hts_cache(httrackp * opt);
t_dnscache *hts_cache(httrackp * opt);
#endif
// outils divers
@@ -323,7 +243,7 @@ int linputsoc_t(T_SOC soc, char *s, int max, int timeout);
int linput_trim(FILE * fp, char *s, int max);
int linput_cpp(FILE * fp, char *s, int max);
void rawlinput(FILE * fp, char *s, int max);
char *strstrcase(char *s, const char *o);
const char *strstrcase(const char *s, const char *o);
int ident_url_absolute(const char *url, lien_adrfil *adrfil);
void fil_simplifie(char *f);
int is_unicode_utf8(const char *buffer, const size_t size);
@@ -339,9 +259,9 @@ void give_mimext(char *s, const char *st);
int may_bogus_multiple(httrackp * opt, const char *mime, const char *filename);
int may_unknown2(httrackp * opt, const char *mime, const char *filename);
char *strrchr_limit(const char *s, char c, const char *limit);
char *strstr_limit(const char *s, const char *sub, const char *limit);
HTS_INLINE char *jump_protocol(const char *source);
const char *strrchr_limit(const char *s, char c, const char *limit);
char *jump_protocol(char *source);
const char *jump_protocol_const(const char *source);
void code64(unsigned char *a, int size_a, unsigned char *b, int crlf);
#define copychar(catbuff,a) concat(catbuff,(a),NULL)
@@ -524,7 +444,7 @@ HTS_STATIC int strfield(const char *f, const char *s) {
return 0;
}
HTS_STATIC int strcmpnocase(char *a, char *b) {
HTS_STATIC int strcmpnocase(const char *a, const char *b) {
while(*a) {
int cmp = hichar(*a) - hichar(*b);
@@ -621,8 +541,9 @@ HTS_STATIC int compare_mime(httrackp * opt, const char *mime, const char *file,
// returns (size_t) -1 upon error
static HTS_UNUSED size_t off_t_to_size_t(off_t o) {
if (o >= 0 && o < ( (size_t) -1 ) / 2) {
return (size_t) o;
const size_t so = (size_t) o;
if ((off_t) so == o) {
return so;
} else {
return (size_t) -1;
}

View File

@@ -49,7 +49,7 @@ Please visit our Website: http://www.httrack.com
int domd5mem(const char *buf, size_t len, char *digest, int asAscii) {
int endian = 1;
unsigned char bindigest[16];
MD5_CTX ctx;
struct MD5Context ctx;
MD5Init(&ctx, *((char *) &endian));
MD5Update(&ctx, (const unsigned char *) buf, (unsigned int) len);
@@ -80,7 +80,7 @@ unsigned long int md5sum32(const char *buff) {
return u.hash;
}
void md5selftest() {
void md5selftest(void) {
static const char str1[] = "The quick brown fox jumps over the lazy dog\n";
static const char str1m[] = "37c4b87edffc5d198ff5a185cee7ee09";
static const char str2[] = "Hello";

View File

@@ -115,6 +115,10 @@ struct htsmoduleStruct {
};
#ifdef __cplusplus
extern "C" {
#endif
/* Used to wrap module initialization */
/* return 1 if init was ok */
typedef int (*t_htsWrapperInit) (char *fn, char *args);
@@ -133,4 +137,8 @@ extern int hts_parse_externals(htsmoduleStruct * str);
extern int V6_is_available;
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -164,11 +164,11 @@ int url_savename(lien_adrfilsave *const afs,
static const char *protocol_str[] =
{ "http", "https", "ftp", "file", "unknown" };
int protocol = PROTOCOL_HTTP;
const char *const adr = jump_identification(adr_complete);
const char *const adr = jump_identification_const(adr_complete);
// copy of fil, used for lookups (see urlhack)
const char *normadr = adr;
const char *normfil = fil_complete;
const char *const print_adr = jump_protocol(adr);
const char *const print_adr = jump_protocol_const(adr);
const char *start_pos = NULL, *nom_pos = NULL, *dot_pos = NULL; // Position nom et point
// pour changement d'extension ou de nom (content-disposition)
@@ -1239,7 +1239,7 @@ int url_savename(lien_adrfilsave *const afs,
// (plus la peine : masqué au début)
/*
{
char* a=jump_identification(afs->save);
char* a = jump_identification(afs->save);
if (a!=afs->save) {
char BIGSTK tempo[HTS_URLMAXSIZE*2];
char *b;
@@ -1307,9 +1307,9 @@ int url_savename(lien_adrfilsave *const afs,
int i = 0;
while(hts_tbdev[i][0]) {
char *a = afs->save;
const char *a = afs->save;
while((a = strstrcase(a, (char *) hts_tbdev[i]))) {
while((a = strstrcase(a, hts_tbdev[i]))) {
switch ((int) a[strlen(hts_tbdev[i])]) {
case '\0':
case '/':
@@ -1691,7 +1691,7 @@ void url_savename_addstr(char *d, const char *s) {
/* "filename" should be at least 64 bytes. */
void url_savename_refname(const char *adr, const char *fil, char *filename) {
unsigned char bindigest[16];
MD5_CTX ctx;
struct MD5Context ctx;
MD5Init(&ctx, 0);
MD5Update(&ctx, (const unsigned char *) adr, (int) strlen(adr));

View File

@@ -74,6 +74,10 @@ typedef unsigned long in_addr_t;
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* Ipv4 structures */
#if HTS_INET6 != 0
typedef struct in6_addr INaddr;
@@ -253,4 +257,8 @@ static HTS_UNUSED void SOCaddr_inetntoa_(char *namebuf, size_t namebuflen,
/* Socket length type */
typedef socklen_t SOClen;
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -35,7 +35,13 @@ Please visit our Website: http://www.httrack.com
#define HTTRACK_DEFOPT
#include <stdio.h>
#include "htsglobal.h"
#include "htsnet.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Forward definitions */
#ifndef HTS_DEF_FWSTRUCT_t_hts_htmlcheck_callbacks
@@ -199,9 +205,9 @@ typedef struct htsmutex_s htsmutex_s, *htsmutex;
#endif
/* Hashtables */
#ifndef HTS_DEF_FWSTRUCT_struct_inthash
#define HTS_DEF_FWSTRUCT_struct_inthash
typedef struct struct_inthash struct_inthash, *inthash;
#ifndef HTS_DEF_FWSTRUCT_struct_coucal
#define HTS_DEF_FWSTRUCT_struct_coucal
typedef struct struct_coucal struct_coucal, *coucal;
#endif
/* Structure état du miroir */
@@ -245,6 +251,7 @@ struct htsoptstate {
char HTbuff[2048];
unsigned int debug_state;
unsigned int tmpnameid; /* 3.41 */
int is_ended; /* 3.48-14 */
};
/* Library handles */
@@ -439,4 +446,162 @@ struct hts_stat_struct {
TStamp last_request; // last request issued
};
// structure pour paramètres supplémentaires lors de la requête
#ifndef HTS_DEF_FWSTRUCT_htsrequest_proxy
#define HTS_DEF_FWSTRUCT_htsrequest_proxy
typedef struct htsrequest_proxy htsrequest_proxy;
#endif
struct htsrequest_proxy {
int active;
const char* name;
int port;
const char* bindhost; // bind this host
};
#ifndef HTS_DEF_FWSTRUCT_htsrequest
#define HTS_DEF_FWSTRUCT_htsrequest
typedef struct htsrequest htsrequest;
#endif
struct htsrequest {
short int user_agent_send; // user agent (ex: httrack/1.0 [sun])
short int http11; // l'en tête peut (doit) être signé HTTP/1.1 et non HTTP/1.0
short int nokeepalive; // pas de keep-alive
short int range_used; // Range utilisé
short int nocompression; // Pas de compression
short int flush_garbage; // recycled
const char* user_agent;
const char* referer;
const char* from;
const char* lang_iso;
const char* accept;
const char* headers;
htsrequest_proxy proxy; // proxy
};
// structure pour retour d'une connexion/prise d'en tête
#ifndef HTS_DEF_FWSTRUCT_htsblk
#define HTS_DEF_FWSTRUCT_htsblk
typedef struct htsblk htsblk;
#endif
struct htsblk {
int statuscode; // status-code, -1=erreur, 200=OK,201=..etc (cf RFC1945)
short int notmodified; // page ou fichier NON modifié (transféré)
short int is_write; // sortie sur disque (out) ou en mémoire (adr)
short int is_chunk; // mode chunk
short int compressed; // compressé?
short int empty; // vide?
short int keep_alive; // Keep-Alive?
short int keep_alive_trailers; // ..with trailers extension
int keep_alive_t; // KA timeout
int keep_alive_max; // KA number of requests
char *adr; // adresse du bloc de mémoire, NULL=vide
char *headers; // adresse des en têtes si présents
FILE *out; // écriture directe sur disque (si is_write=1)
LLint size; // taille fichier
char msg[80]; // message éventuel si échec ("\0"=non précisé)
char contenttype[64]; // content-type ("text/html" par exemple)
char charset[64]; // charset ("iso-8859-1" par exemple)
char contentencoding[64]; // content-encoding ("gzip" par exemple)
char *location; // on copie dedans éventuellement la véritable 'location'
LLint totalsize; // taille totale à télécharger (-1=inconnue)
short int is_file; // ce n'est pas une socket mais un descripteur de fichier si 1
T_SOC soc; // ID socket
SOCaddr address; // IP address
int address_size; // IP address structure length (unused internally)
FILE *fp; // fichier pour file://
#if HTS_USEOPENSSL
short int ssl; // is this connection a SSL one? (https)
// BIO* ssl_soc; // SSL structure
SSL *ssl_con; // connection structure
#endif
char lastmodified[64]; // Last-Modified
char etag[256]; // Etag
char cdispo[256]; // Content-Disposition coupé
LLint crange; // Content-Range
LLint crange_start; // Content-Range
LLint crange_end; // Content-Range
int debugid; // debug connection
/* */
htsrequest req; // paramètres pour la requête
/*char digest[32+2]; // digest md5 généré par le moteur ("" si non généré) */
};
// structure d'un lien
#ifndef HTS_DEF_FWSTRUCT_lien_url
#define HTS_DEF_FWSTRUCT_lien_url
typedef struct lien_url lien_url;
#endif
struct lien_url {
char *adr; // adresse
char *fil; // nom du fichier distant
char *sav; // nom à sauver sur disque (avec chemin éventuel)
char *cod; // chemin codebase éventuel si classe java
char *former_adr; // adresse initiale (avant éventuel moved), peut être nulle
char *former_fil; // nom du fichier distant initial (avant éventuel moved), peut être nul
int premier; // pointeur sur le premier lien qui a donné lieu aux autres liens du domaine
int precedent; // pointeur sur le lien qui a donné lieu à ce lien précis
int depth; // profondeur autorisée lien ; >0 forte 0=faible
int pass2; // traiter après les autres, seconde passe. si == -1, lien traité en background
char link_import; // lien importé à la suite d'un moved - ne pas appliquer les règles classiques up/down
//int moved; // pointeur sur moved
int retry; // nombre de retry restants
int testmode; // mode test uniquement, envoyer juste un head!
};
// chargement de fichiers en 'arrière plan'
#ifndef HTS_DEF_FWSTRUCT_lien_back
#define HTS_DEF_FWSTRUCT_lien_back
typedef struct lien_back lien_back;
#endif
struct lien_back {
#if DEBUG_CHECKINT
char magic;
#endif
char url_adr[HTS_URLMAXSIZE * 2]; // adresse
char url_fil[HTS_URLMAXSIZE * 2]; // nom du fichier distant
char url_sav[HTS_URLMAXSIZE * 2]; // nom à sauver sur disque (avec chemin éventuel)
char referer_adr[HTS_URLMAXSIZE * 2]; // adresse host page referer
char referer_fil[HTS_URLMAXSIZE * 2]; // fichier page referer
char location_buffer[HTS_URLMAXSIZE * 2]; // "location" en cas de "moved" (302,..)
char *tmpfile; // nom à sauver temporairement (compressé)
char tmpfile_buffer[HTS_URLMAXSIZE * 2]; // buffer pour le nom à sauver temporairement
char send_too[1024]; // données à envoyer en même temps que le header
int status; // status (-1=non utilisé, 0: prêt, >0: opération en cours)
int locked; // locked (to be used soon)
int testmode; // mode de test
int timeout; // gérer des timeouts? (!=0 : nombre de secondes)
TStamp timeout_refresh; // si oui, time refresh
int rateout; // timeout refresh? (!=0 : taux minimum toléré en octets/s)
TStamp rateout_time; // si oui, date de départ
LLint maxfile_nonhtml; // taille max d'un fichier non html
LLint maxfile_html; // idem pour un ficheir html
htsblk r; // structure htsblk de chaque objet en background
int is_update; // mode update
int head_request; // requète HEAD?
LLint range_req_size; // range utilisé
TStamp ka_time_start; // refresh time for KA
//
int http11; // L'en tête doit être signé HTTP/1.1 et non HTTP/1.0
int is_chunk; // chunk?
char *chunk_adr; // adresse chunk en cours de chargement
LLint chunk_size; // taille chunk en cours de chargement
LLint chunk_blocksize; // taille data declaree par le chunk
LLint compressed_size; // taille compressés (stats uniquement)
//
//int links_index; // to access liens[links_index]
//
char info[256]; // éventuel status pour le ftp
int stop_ftp; // flag stop pour ftp
int finalized; // finalized (optim memory)
int early_add; // was added before link heap saw it
#if DEBUG_CHECKINT
char magic2;
#endif
};
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -60,87 +60,58 @@ Please visit our Website: http://www.httrack.com
#include "htsparse.h"
#include "htsback.h"
// arrays
#include "htsarrays.h"
/** Append bytes to the output buffer up to the pointer 'html'. **/
#define HT_add_adr do { \
if ( (opt->getmode & 1) != 0 && ptr > 0 ) { \
const size_t sz_ = html - lastsaved; \
if (sz_ != 0) { \
TypedArrayAppend(output_buffer, lastsaved, sz_); \
lastsaved = html; \
} \
} \
} while(0)
/** Append to the output buffer the string 'A'. **/
#define HT_ADD(A) TypedArrayAppend(output_buffer, A, strlen(A))
/** Append to the output buffer the string 'A', html-escaped. **/
#define HT_ADD_HTMLESCAPED_ANY(A, FUNCTION) do { \
if ((opt->getmode & 1) != 0 && ptr>0) { \
const char *const str_ = (A); \
size_t size_; \
/* &amp; is the maximum expansion */ \
TypedArrayEnsureRoom(output_buffer, strlen(str_) * 5 + 1024); \
size_ = FUNCTION(str_, &TypedArrayTail(output_buffer), \
TypedArrayRoom(output_buffer)); \
TypedArraySize(output_buffer) += size_; \
} \
} while(0)
/** Append to the output buffer the string 'A', html-escaped for &. **/
#define HT_ADD_HTMLESCAPED(A) HT_ADD_HTMLESCAPED_ANY(A, escape_for_html_print)
/**
* Append to the output buffer the string 'A', html-escaped for & and
* high chars.
**/
#define HT_ADD_HTMLESCAPED_FULL(A) HT_ADD_HTMLESCAPED_ANY(A, escape_for_html_print_full)
// does nothing
#define XH_uninit do {} while(0)
// version optimisée, qui permet de ne pas toucher aux html non modifiés (update)
#define REALLOC_SIZE 8192
#define HT_ADD_CHK(A) if (((int) (A)+ht_len+1) >= ht_size) { \
char message[256]; \
ht_size=(A)+ht_len+REALLOC_SIZE; \
ht_buff=(char*) realloct(ht_buff,ht_size); \
if (ht_buff==NULL) { \
printf("PANIC! : Not enough memory [%d]\n", __LINE__); \
XH_uninit; \
snprintf(message, sizeof(message), "not enough memory for current html document in HT_ADD_CHK : realloct("LLintP") failed", (LLint) ht_size); \
abortLog(message); \
abort(); \
} \
} \
ht_len+=A;
#define HT_add_adr \
if ((opt->getmode & 1) && (ptr>0)) { \
size_t i = ((html - lastsaved)),j=ht_len; HT_ADD_CHK(i) \
memcpy(ht_buff+j, lastsaved, i); \
ht_buff[j+i]='\0'; \
lastsaved=html; \
}
#define HT_ADD(A) \
if ((opt->getmode & 1) && (ptr>0)) { \
size_t i_ = strlen(A), j_ = ht_len; \
if (i_) { \
HT_ADD_CHK(i_) \
memcpy(ht_buff+j_, A, i_); \
ht_buff[j_+i_]='\0'; \
} }
#define HT_ADD_HTMLESCAPED(A) \
if ((opt->getmode & 1) && (ptr>0)) { \
size_t i_, j_; \
char BIGSTK tempo_[HTS_URLMAXSIZE*2]; \
escape_for_html_print(A, tempo_, sizeof(tempo_)); \
i_=strlen(tempo_); \
j_=ht_len; \
if (i_) { \
HT_ADD_CHK(i_) \
memcpy(ht_buff+j_, tempo_, i_); \
ht_buff[j_+i_]='\0'; \
} }
#define HT_ADD_HTMLESCAPED_FULL(A) \
if ((opt->getmode & 1) && (ptr>0)) { \
size_t i_, j_; \
char BIGSTK tempo_[HTS_URLMAXSIZE*2]; \
escape_for_html_print_full(A, tempo_, sizeof(tempo_)); \
i_=strlen(tempo_); \
j_=ht_len; \
if (i_) { \
HT_ADD_CHK(i_) \
memcpy(ht_buff+j_, tempo_, i_); \
ht_buff[j_+i_]='\0'; \
} }
#define HT_ADD_START \
char message[256]; \
size_t ht_size=(size_t)(r->size*5)/4+REALLOC_SIZE; \
size_t ht_len=0; \
char* ht_buff=NULL; \
if ((opt->getmode & 1) && (ptr>0)) { \
ht_buff=(char*) malloct(ht_size); \
if (ht_buff==NULL) { \
printf("PANIC! : Not enough memory [%d]\n",__LINE__); \
XH_uninit; \
snprintf(message, sizeof(message), "not enough memory for current html document in HT_ADD_START : malloct("LLintP") failed", (LLint) ht_size); \
abortLog(message); \
abort(); \
} \
ht_buff[0]='\0'; \
}
#define HT_ADD_END { \
int ok=0;\
if (ht_buff) { \
if (TypedArraySize(output_buffer) != 0) { \
const size_t ht_len = TypedArraySize(output_buffer); \
const char *const ht_buff = TypedArrayElts(output_buffer); \
char digest[32+2];\
off_t fsize_old = fsize(fconv(OPT_GET_BUFF(opt),OPT_GET_BUFF_SIZE(opt),savename()));\
digest[0]='\0';\
domd5mem(ht_buff,ht_len,digest,1);\
if (fsize_old==ht_len) { \
digest[0] = '\0';\
domd5mem(TypedArrayElts(output_buffer), ht_len, digest, 1);\
if (fsize_old == (off_t) ht_len) { \
int mlen = 0;\
char* mbuff;\
cache_readdata(cache,"//[HTML-MD5]//",savename(),&mbuff,&mlen);\
@@ -192,7 +163,7 @@ Please visit our Website: http://www.httrack.com
if (cache->ndx)\
cache_writedata(cache->ndx,cache->dat,"//[HTML-MD5]//",savename(),digest,(int)strlen(digest));\
} \
freet(ht_buff); ht_buff=NULL; \
TypedArrayFree(output_buffer); \
}
#define HT_ADD_FOP
@@ -362,11 +333,13 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
}
if (!error) {
// output HTML
TypedArray(char) output_buffer = EMPTY_TYPED_ARRAY;
time_t user_interact_timestamp = 0;
int detect_title = 0; // détection du title
int back_add_stats = opt->state.back_add_stats;
//
const char *in_media = NULL; // in other media type (real media and so..)
int intag = 0; // on est dans un tag
int incomment = 0; // dans un <!--
@@ -417,7 +390,6 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
//
int parent_relative = 0; // the parent is the base path (.js, .css..)
HT_ADD_START; // débuter
lastsaved = html;
/* Initialize script automate for comments, quotes.. */
@@ -568,9 +540,9 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
p = -1; // noter, mais sans titre
else if (strfield(html, "body"))
p = -1; // noter, mais sans titre
else if (((int) (html - r->adr)) >= (r->size - 1))
else if (html - r->adr >= r->size - 1)
p = -1; // noter, mais sans titre
else if ((int) (html - r->adr) >= r->size - 2) // we got to hurry
else if (html - r->adr >= r->size - 2) // we got to hurry
p = -1; // xxc xxc xxc
}
} else
@@ -645,8 +617,7 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
if (str->page_charset_ != NULL
&& *str->page_charset_ != '\0') {
char *const sUtf =
hts_convertStringToUTF8(s, (int) strlen(s),
str->page_charset_);
hts_convertStringToUTF8(s, strlen(s), str->page_charset_);
if (sUtf != NULL) {
strcpy(s, sUtf);
free(sUtf);
@@ -754,7 +725,7 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
strcatbuff(tempo, eol);
hts_template_format_str(tempo + strlen(tempo), sizeof(tempo) - strlen(tempo),
StringBuff(opt->footer),
jump_identification(urladr()), urlfil(), gmttime,
jump_identification_const(urladr()), urlfil(), gmttime,
HTTRACK_VERSIONID, /* EOF */ NULL);
strcatbuff(tempo, eol);
//fwrite(tempo,1,strlen(tempo),fp);
@@ -1246,8 +1217,8 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
printf("robots.txt meta tag detected\n");
#endif
if (a) {
if (((int) (a - html)) < 999) {
strncatbuff(tempo, html, (int) (a - html));
if (a - html < 999) {
strncatbuff(tempo, html, a - html);
if (strstrcase(tempo, "content")) {
if (strstrcase(tempo, "robots")) {
if (strstrcase(tempo, "nofollow")) {
@@ -1835,11 +1806,11 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
if (ok != -1) { // continuer
// découper le lien
do {
if ((*(unsigned char *) eadr) < 32) { // caractère de contrôle (ou \0)
if ((unsigned char) *eadr < 32) { // caractère de contrôle (ou \0)
if (!is_space(*eadr))
ok = 0;
}
if ((((int) (eadr - html))) > HTS_URLMAXSIZE) // ** trop long, >HTS_URLMAXSIZE caractères (on prévoit HTS_URLMAXSIZE autres pour path)
if (eadr - html > HTS_URLMAXSIZE) // ** trop long, >HTS_URLMAXSIZE caractères (on prévoit HTS_URLMAXSIZE autres pour path)
ok = -1; // ne pas traiter ce lien
if (ok > 0) {
@@ -1884,10 +1855,10 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
} while(ok == 1);
// Empty link detected
if ((((int) (eadr - html))) <= 1) { // link empty
if (eadr - html <= 1) { // link empty
ok = -1; // No
if (*html != '#') { // Not empty+unique #
if ((((int) (eadr - html)) == 1)) { // 1=link empty with delim (end_adr-start_adr)
if (eadr - html == 1) { // 1=link empty with delim (end_adr-start_adr)
if (quote) {
if ((opt->getmode & 1) && (ptr > 0)) {
HT_ADD("#"); // We add this for a <href="">
@@ -1911,9 +1882,9 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
//char* p;
// construire lien (découpage)
if ((((int) (eadr - html)) - 1) < HTS_URLMAXSIZE) { // pas trop long?
strncpy(lien, html, ((int) (eadr - html)) - 1);
*(lien + (((int) (eadr - html))) - 1) = '\0';
if (eadr - html - 1 < HTS_URLMAXSIZE) { // pas trop long?
strncpy(lien, html, eadr - html - 1);
lien[eadr - html - 1] = '\0';
//printf("link: %s\n",lien);
// supprimer les espaces
while((lien[strlen(lien) - 1] == ' ') && (strnotempty(lien)))
@@ -1969,13 +1940,13 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
if (!q)
q = a + strlen(a) - 1;
while((p = strstr(a, "//")) && (!done)) { // remplacer // par /
if ((int) p > (int) q) { // après le ? (toto.cgi?param=1//2.3)
if (p > q) { // après le ? (toto.cgi?param=1//2.3)
done = 1; // stopper
} else {
char BIGSTK tempo[HTS_URLMAXSIZE * 2];
tempo[0] = '\0';
strncatbuff(tempo, a, (int) p - (int) a);
strncatbuff(tempo, a, p - a);
strcatbuff(tempo, p + 1);
strcpybuff(a, tempo); // recopier
}
@@ -2047,7 +2018,7 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
// and not already UTF-8
// (note: not for the query string!)
if (hasCharset && !hts_isCharsetUTF8(charset)) {
char *const s = hts_convertStringToUTF8(lien, (int) strlen(lien), charset);
char *const s = hts_convertStringToUTF8(lien, strlen(lien), charset);
if (s != NULL) {
hts_log_print(opt, LOG_DEBUG,
"engine: save-name: '%s' charset conversion from '%s' to '%s'",
@@ -2120,7 +2091,7 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
char *a = lien + strlen(lien) - 1;
// éviter aussi index~1.html
while(((int) a > (int) lien) && (*a != '~') && (*a != '/')
while(a > lien && (*a != '~') && (*a != '/')
&& (*a != '.'))
a--;
if (*a == '~') {
@@ -2179,7 +2150,7 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
char BIGSTK tempo[HTS_URLMAXSIZE * 2];
tempo[0] = '\0';
strncatbuff(tempo, lien, (int) (a - lien));
strncatbuff(tempo, lien, a - lien);
strcatbuff(tempo, a + 3); // sauter :80
strcpybuff(lien, tempo);
}
@@ -2231,8 +2202,8 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
}
/* only one ending / (bug on some pages) */
if ((int) strlen(lien) > 2) {
int len = (int) strlen(lien);
if (strlen(lien) > 2) {
size_t len = strlen(lien);
while(len > 1 && lien[len - 1] == '/' && lien[len - 2] == '/') /* double // (bug) */
lien[--len] = '\0';
@@ -2324,8 +2295,7 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
if (strnotempty(_base)) { // considérer base
if (!link_has_authority(lien)) { // non absolue
if (*lien != '/') { // non absolu sur le site (/)
if (((int) strlen(_base) + (int) strlen(lien)) <
HTS_URLMAXSIZE) {
if ((strlen(_base) + strlen(lien)) < HTS_URLMAXSIZE) {
// mailto: and co: do NOT add base
if (ident_url_relatif
(lien, urladr(), urlfil(), &afs.af) >= 0) {
@@ -2351,8 +2321,7 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
} else {
lien_adrfil baseaf;
if (ident_url_absolute(_base, &baseaf) >= 0) {
if (((int) strlen(baseaf.adr) + (int) strlen(lien)) <
HTS_URLMAXSIZE) {
if ((strlen(baseaf.adr) + strlen(lien)) < HTS_URLMAXSIZE) {
char BIGSTK tempo[HTS_URLMAXSIZE * 2];
// base est absolue
@@ -2443,8 +2412,8 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
}
// calculer meme_adresse
meme_adresse =
strfield2(jump_identification(afs.af.adr),
jump_identification(urladr()));
strfield2(jump_identification_const(afs.af.adr),
jump_identification_const(urladr()));
// Début partie sauvegarde
@@ -2481,8 +2450,8 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
url_savename(&afs, &former, heap(ptr)->adr, heap(ptr)->fil, opt,
sback, cache, hash, ptr,
numero_passe, NULL);
if (strcmp(jump_identification(last_adr),
jump_identification(afs.af.adr)) != 0) { // a changé
if (strcmp(jump_identification_const(last_adr),
jump_identification_const(afs.af.adr)) != 0) { // a changé
// 2e test si moved
@@ -2587,9 +2556,9 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
}
if (!opt->passprivacy) {
HT_ADD_HTMLESCAPED(jump_protocol(afs.af.adr)); // Password
HT_ADD_HTMLESCAPED(jump_protocol_const(afs.af.adr)); // Password
} else {
HT_ADD_HTMLESCAPED(jump_identification(afs.af.adr)); // No Password
HT_ADD_HTMLESCAPED(jump_identification_const(afs.af.adr)); // No Password
}
if (afs.af.fil[0] != '/')
HT_ADD("/");
@@ -2610,7 +2579,7 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
if (!opt->passprivacy) {
HT_ADD_HTMLESCAPED(afs.af.adr); // Password
} else {
HT_ADD_HTMLESCAPED(jump_identification(afs.af.adr)); // No Password
HT_ADD_HTMLESCAPED(jump_identification_const(afs.af.adr)); // No Password
}
if (afs.af.fil[0] != '/')
HT_ADD("/");
@@ -2626,9 +2595,9 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
HT_ADD(tmp); // Protocol
HT_ADD("//");
if (!opt->passprivacy) {
HT_ADD_HTMLESCAPED(jump_protocol(afs.af.adr)); // Password
HT_ADD_HTMLESCAPED(jump_protocol_const(afs.af.adr)); // Password
} else {
HT_ADD_HTMLESCAPED(jump_identification(afs.af.adr)); // No Password
HT_ADD_HTMLESCAPED(jump_identification_const(afs.af.adr)); // No Password
}
if (afs.af.fil[0] != '/')
HT_ADD("/");
@@ -2663,15 +2632,15 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
default: // inconnu
// asp, cgi..
if ((strfield2
(afs.af.fil + max(0, (int) strlen(afs.af.fil) - 4),
(afs.af.fil + max(0, strlen(afs.af.fil) - 4),
".gif"))
||
(strfield2
(afs.af.fil + max(0, (int) strlen(afs.af.fil) - 4),
(afs.af.fil + max(0, strlen(afs.af.fil) - 4),
".jpg"))
||
(strfield2
(afs.af.fil + max(0, (int) strlen(afs.af.fil) - 4),
(afs.af.fil + max(0, strlen(afs.af.fil) - 4),
".xbm"))
/*|| (ishtml(opt,fil)!=0) */
) {
@@ -2716,7 +2685,7 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
if (!opt->passprivacy) {
HT_ADD_HTMLESCAPED(afs.af.adr); // Password
} else {
HT_ADD_HTMLESCAPED(jump_identification(afs.af.adr)); // No Password
HT_ADD_HTMLESCAPED(jump_identification_const(afs.af.adr)); // No Password
}
if (afs.af.fil[0] != '/')
HT_ADD("/");
@@ -2731,9 +2700,9 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
strncatbuff(tmp, afs.af.adr, (aut - afs.af.adr) + 2); // scheme
HT_ADD(tmp);
if (!opt->passprivacy) {
HT_ADD_HTMLESCAPED(jump_protocol(afs.af.adr)); // Password
HT_ADD_HTMLESCAPED(jump_protocol_const(afs.af.adr)); // Password
} else {
HT_ADD_HTMLESCAPED(jump_identification(afs.af.adr)); // No Password
HT_ADD_HTMLESCAPED(jump_identification_const(afs.af.adr)); // No Password
}
if (afs.af.fil[0] != '/')
HT_ADD("/");
@@ -2778,7 +2747,7 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
if (!opt->passprivacy) {
HT_ADD_HTMLESCAPED(afs.af.adr); // Password
} else {
HT_ADD_HTMLESCAPED(jump_identification(afs.af.adr)); // No Password
HT_ADD_HTMLESCAPED(jump_identification_const(afs.af.adr)); // No Password
}
if (afs.af.fil[0] != '/')
HT_ADD("/");
@@ -2833,7 +2802,7 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
if (!opt->passprivacy) {
HT_ADD_HTMLESCAPED(afs.af.adr); // Password
} else {
HT_ADD_HTMLESCAPED(jump_identification(afs.af.adr)); // No Password
HT_ADD_HTMLESCAPED(jump_identification_const(afs.af.adr)); // No Password
}
if (*tempo_pat != '/')
HT_ADD("/");
@@ -2841,8 +2810,7 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
HT_ADD("\" ");
}
strncatbuff(tempo4, lastsaved,
(int) (p_flush - lastsaved));
strncatbuff(tempo4, lastsaved, p_flush - lastsaved);
HT_ADD(tempo4); // refresh code="
HT_ADD(tempo);
}
@@ -2979,7 +2947,7 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
char BIGSTK tempo2[HTS_URLMAXSIZE * 2];
strcpybuff(tempo2, a + 1);
strncatbuff(tempo_pat, tempo, (int) (a - tempo) + 1); // chemin
strncatbuff(tempo_pat, tempo, a - tempo + 1); // chemin
strcpybuff(tempo, tempo2); // fichier
}
}
@@ -2996,8 +2964,7 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
HT_ADD("\" ");
}
strncatbuff(tempo4, lastsaved,
(int) (p_flush - lastsaved));
strncatbuff(tempo4, lastsaved, p_flush - lastsaved);
HT_ADD(tempo4); // refresh code="
}
}
@@ -3280,7 +3247,7 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
&&(!inscript_tag) /* Not in tag with script inside */
) {
/* Not at the end */
if ((((int) (html - r->adr))) < r->size) {
if (html - r->adr < r->size) {
/* Not on a starting tag yet */
if (*html != '<') {
/* strchr does not well behave with null chrs.. */
@@ -3292,8 +3259,8 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
}
/* Jump to near end (index hack) */
if (!adr_next || *adr_next != '<') {
if (((int) (html - r->adr) < (r->size - 4))
&& (r->size > 4)
if (html - r->adr < r->size - 4
&& r->size > 4
) {
html = r->adr + r->size - 2;
}
@@ -3368,15 +3335,18 @@ int htsparse(htsmoduleStruct * str, htsmoduleStructExtended * stre) {
if ((opt->getmode & 1) && (ptr > 0)) {
{
char *cAddr = ht_buff;
int cSize = (int) ht_len;
char *cAddr = TypedArrayElts(output_buffer);
int cSize = (int) TypedArraySize(output_buffer);
hts_log_print(opt, LOG_DEBUG, "engine: postprocess-html: %s%s",
urladr(), urlfil());
if (RUN_CALLBACK4(opt, postprocess, &cAddr, &cSize, urladr(), urlfil()) ==
1) {
ht_buff = cAddr;
ht_len = cSize;
if (RUN_CALLBACK4(opt, postprocess, &cAddr, &cSize, urladr(), urlfil()) == 1) {
if (cAddr != TypedArrayElts(output_buffer)) {
hts_log_print(opt, LOG_DEBUG,
"engine: postprocess-html: callback modified data, applying %d bytes", cSize);
TypedArraySize(output_buffer) = 0;
TypedArrayAppend(output_buffer, cAddr, cSize);
}
}
}
@@ -3658,7 +3628,7 @@ int hts_mirror_check_moved(htsmoduleStruct * str,
if (opt->hostcontrol) { // timeout et retry épuisés
if ((opt->hostcontrol & 1) && (heap(ptr)->retry <= 0)) {
hts_log_print(opt, LOG_DEBUG, "Link banned: %s%s", urladr(), urlfil());
host_ban(opt, ptr, sback, jump_identification(urladr()));
host_ban(opt, ptr, sback, jump_identification_const(urladr()));
hts_log_print(opt, LOG_DEBUG,
"Info: previous log - link banned: %s%s", urladr(),
urlfil());
@@ -3671,7 +3641,7 @@ int hts_mirror_check_moved(htsmoduleStruct * str,
if ((opt->hostcontrol) && (heap(ptr)->retry <= 0)) { // too slow
if (opt->hostcontrol & 2) {
hts_log_print(opt, LOG_DEBUG, "Link banned: %s%s", urladr(), urlfil());
host_ban(opt, ptr, sback, jump_identification(urladr()));
host_ban(opt, ptr, sback, jump_identification_const(urladr()));
hts_log_print(opt, LOG_DEBUG,
"Info: previous log - link banned: %s%s", urladr(),
urlfil());
@@ -4636,7 +4606,7 @@ int hts_wait_delayed(htsmoduleStruct * str, lien_adrfilsave *afs,
b = -1;
/* Handle redirect */
if ((int) strnotempty(mov_url)) { // location existe!
if (strnotempty(mov_url)) { // location existe!
lien_adrfil moved;
moved.adr[0] = moved.fil[0] = '\0';
//

View File

@@ -60,7 +60,7 @@ int checkrobots(robots_wizard * robots, const char *adr, const char *fil) {
return -1; // interdit
}
} else { // relatif
if (strstrcase((char*) fil, line)) {
if (strstrcase(fil, line)) {
return -1;
}
}

View File

@@ -33,19 +33,29 @@ Please visit our Website: http://www.httrack.com
#ifndef HTSSAFE_DEFH
#define HTSSAFE_DEFH
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "htsglobal.h"
/**
* Emergency logging.
* Default is to use libhttrack one.
*/
#ifndef HTSSAFE_ABORT_FUNCTION
#if (!defined(HTSSAFE_ABORT_FUNCTION) && defined(LIBHTTRACK_EXPORTS))
/** Assert error callback. **/
#ifndef HTS_DEF_FWSTRUCT_htsErrorCallback
#define HTS_DEF_FWSTRUCT_htsErrorCallback
typedef void (*htsErrorCallback) (const char *msg, const char *file, int line);
#ifdef __cplusplus
extern "C" {
#endif
HTSEXT_API htsErrorCallback hts_get_error_callback(void);
#ifdef __cplusplus
}
#endif
#endif
#define HTSSAFE_ABORT_FUNCTION(A,B,C) do { \
@@ -83,7 +93,9 @@ static HTS_UNUSED void log_abort_(const char *msg, const char *file, int line) {
}
static HTS_UNUSED void abortf_(const char *exp, const char *file, int line) {
#ifdef HTSSAFE_ABORT_FUNCTION
HTSSAFE_ABORT_FUNCTION(exp, file, line);
#endif
log_abort_(exp, file, line);
abort();
}
@@ -91,7 +103,7 @@ static HTS_UNUSED void abortf_(const char *exp, const char *file, int line) {
/**
* Check wether 'VAR' is of type char[].
*/
#ifdef __GNUC__
#if (defined(__GNUC__) && !defined(__cplusplus))
/* Note: char[] and const char[] are compatible */
#define HTS_IS_CHAR_BUFFER(VAR) ( __builtin_types_compatible_p ( typeof (VAR), char[] ) )
#else

View File

@@ -67,15 +67,15 @@ Please visit our Website: http://www.httrack.com
/* Bypass internal definition protection */
#define HTS_INTERNAL_BYTECODE
#include "htsinthash.h"
#include "coucal.h"
#undef HTS_INTERNAL_BYTECODE
int NewLangStrSz = 1024;
inthash NewLangStr = NULL;
coucal NewLangStr = NULL;
int NewLangStrKeysSz = 1024;
inthash NewLangStrKeys = NULL;
coucal NewLangStrKeys = NULL;
int NewLangListSz = 1024;
inthash NewLangList = NULL;
coucal NewLangList = NULL;
/* Language files */
@@ -296,7 +296,7 @@ typedef struct {
} initStrElt;
#define SET_ERROR(err) do { \
inthash_write(NewLangList, "error", (intptr_t)strdup(err)); \
coucal_write(NewLangList, "error", (intptr_t)strdup(err)); \
error_redirect = "/server/error.html"; \
} while(0)
@@ -359,18 +359,18 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
char tmp[32];
sprintf(tmp, "%d", initInt[i].value);
inthash_write(NewLangList, initInt[i].name, (intptr_t) strdup(tmp));
coucal_write(NewLangList, initInt[i].name, (intptr_t) strdup(tmp));
}
for(i = 0; initOn[i]; i++) {
inthash_write(NewLangList, initOn[i], (intptr_t) strdup("1")); /* "on" */
coucal_write(NewLangList, initOn[i], (intptr_t) strdup("1")); /* "on" */
}
for(i = 0; initStr[i].name; i++) {
inthash_write(NewLangList, initStr[i].name,
coucal_write(NewLangList, initStr[i].name,
(intptr_t) strdup(initStr[i].value));
}
strcpybuff(pth, gethomedir());
strcatbuff(pth, "/websites");
inthash_write(NewLangList, "path", (intptr_t) strdup(pth));
coucal_write(NewLangList, "path", (intptr_t) strdup(pth));
}
/* Lock */
@@ -468,15 +468,15 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
char tmp[32];
sprintf(tmp, "%d", commandReturn);
inthash_write(NewLangList, "commandReturn", (intptr_t) strdup(tmp));
inthash_write(NewLangList, "commandReturnMsg",
coucal_write(NewLangList, "commandReturn", (intptr_t) strdup(tmp));
coucal_write(NewLangList, "commandReturnMsg",
(intptr_t) commandReturnMsg);
inthash_write(NewLangList, "commandReturnCmdl",
coucal_write(NewLangList, "commandReturnCmdl",
(intptr_t) commandReturnCmdl);
} else {
inthash_write(NewLangList, "commandReturn", (intptr_t) NULL);
inthash_write(NewLangList, "commandReturnMsg", (intptr_t) NULL);
inthash_write(NewLangList, "commandReturnCmdl", (intptr_t) NULL);
coucal_write(NewLangList, "commandReturn", (intptr_t) NULL);
coucal_write(NewLangList, "commandReturnMsg", (intptr_t) NULL);
coucal_write(NewLangList, "commandReturnCmdl", (intptr_t) NULL);
}
}
@@ -484,8 +484,8 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
{
intptr_t adr = 0;
if (inthash_readptr(NewLangList, "_sid", &adr)) {
if (inthash_write
if (coucal_readptr(NewLangList, "_sid", &adr)) {
if (coucal_write
(NewLangList, "sid", (intptr_t) strdup((char *) adr))) {
}
}
@@ -506,7 +506,7 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
if (strfield2(ua, "on")) /* hack : "on" == 1 */
ua = "1";
unescapehttp(ua, &sua);
inthash_write(NewLangList, s, (intptr_t) StringAcquire(&sua));
coucal_write(NewLangList, s, (intptr_t) StringAcquire(&sua));
s = f + 1;
}
}
@@ -516,8 +516,8 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
intptr_t adr = 0;
intptr_t adr2 = 0;
if (inthash_readptr(NewLangList, "sid", &adr)) {
if (inthash_readptr(NewLangList, "_sid", &adr2)) {
if (coucal_readptr(NewLangList, "sid", &adr)) {
if (coucal_readptr(NewLangList, "_sid", &adr2)) {
if (strcmp((char *) adr, (char *) adr2) != 0) {
meth = 0;
}
@@ -530,40 +530,40 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
int doLoad = 0;
intptr_t adr = 0;
if (inthash_readptr(NewLangList, "lang", &adr)) {
if (coucal_readptr(NewLangList, "lang", &adr)) {
int n = 0;
if (sscanf((char *) adr, "%d", &n) == 1 && n > 0
&& n - 1 != LANG_T(path, -1)) {
LANG_T(path, n - 1);
/* make a backup, because the GUI will override it */
inthash_write(NewLangList, "lang_",
coucal_write(NewLangList, "lang_",
(intptr_t) strdup((char *) adr));
}
}
/* Load existing project settings */
if (inthash_readptr(NewLangList, "loadprojname", &adr)) {
if (coucal_readptr(NewLangList, "loadprojname", &adr)) {
char *pname = (char *) adr;
if (*pname) {
inthash_write(NewLangList, "projname", (intptr_t) strdup(pname));
coucal_write(NewLangList, "projname", (intptr_t) strdup(pname));
}
inthash_write(NewLangList, "loadprojname", (intptr_t) NULL);
coucal_write(NewLangList, "loadprojname", (intptr_t) NULL);
doLoad = 1;
} else if (inthash_readptr(NewLangList, "loadprojcateg", &adr)) {
} else if (coucal_readptr(NewLangList, "loadprojcateg", &adr)) {
char *pname = (char *) adr;
if (*pname) {
inthash_write(NewLangList, "projcateg", (intptr_t) strdup(pname));
coucal_write(NewLangList, "projcateg", (intptr_t) strdup(pname));
}
inthash_write(NewLangList, "loadprojcateg", (intptr_t) NULL);
coucal_write(NewLangList, "loadprojcateg", (intptr_t) NULL);
}
/* intial configuration */
{
if (!inthash_read(NewLangList, "conf_file_loaded", NULL)) {
inthash_write(NewLangList, "conf_file_loaded",
if (!coucal_read(NewLangList, "conf_file_loaded", NULL)) {
coucal_write(NewLangList, "conf_file_loaded",
(intptr_t) strdup("true"));
doLoad = 2;
}
@@ -573,8 +573,8 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
if (!commandRunning) {
intptr_t adrpath = 0, adrprojname = 0;
if (inthash_readptr(NewLangList, "path", &adrpath)
&& inthash_readptr(NewLangList, "projname", &adrprojname)) {
if (coucal_readptr(NewLangList, "path", &adrpath)
&& coucal_readptr(NewLangList, "projname", &adrprojname)) {
StringClear(fspath);
StringCat(fspath, (char *) adrpath);
StringCat(fspath, "/");
@@ -614,7 +614,7 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
if (pos[0] == '0' && pos[1] == '\0')
*pos = '\0'; /* 0 => empty */
unescapeini(pos, &escline);
inthash_write(NewLangList, line,
coucal_write(NewLangList, line,
(intptr_t) StringAcquire(&escline));
}
}
@@ -630,7 +630,7 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
intptr_t adr = 0;
int p = 0;
if (inthash_readptr(NewLangList, "command", &adr)) {
if (coucal_readptr(NewLangList, "command", &adr)) {
if (strcmp((char *) adr, "cancel") == 0) {
if (commandRunning) {
if (!commandEndRequested) {
@@ -674,15 +674,15 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
if (!commandRunning) {
intptr_t adrcd = 0;
if (inthash_readptr(NewLangList, "command_do", &adrcd)) {
if (coucal_readptr(NewLangList, "command_do", &adrcd)) {
intptr_t adrw = 0;
if (inthash_readptr(NewLangList, "winprofile", &adrw)) {
if (coucal_readptr(NewLangList, "winprofile", &adrw)) {
/* User general profile */
intptr_t adruserprofile = 0;
if (inthash_readptr
if (coucal_readptr
(NewLangList, "userprofile", &adruserprofile)
&& adruserprofile != 0) {
int count = (int) strlen((char *) adruserprofile);
@@ -774,7 +774,7 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
} else if (strcmp((char *) adr, "quit") == 0) {
willexit = 1;
}
inthash_write(NewLangList, "command", (intptr_t) NULL);
coucal_write(NewLangList, "command", (intptr_t) NULL);
}
}
@@ -827,7 +827,7 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
} else {
intptr_t adr = 0;
if (inthash_readptr(NewLangList, "projpath", &adr)) {
if (coucal_readptr(NewLangList, "projpath", &adr)) {
sprintf(fsfile, "%s%s", (char *) adr, file + 9);
}
}
@@ -848,7 +848,7 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
"Server: httrack small server\r\n" "Content-type: text/plain\r\n";
/* register current page */
inthash_write(NewLangList, "thisfile", (intptr_t) strdup(file));
coucal_write(NewLangList, "thisfile", (intptr_t) strdup(file));
/* Force GET for the last request */
if (meth == 2 && willexit) {
@@ -863,7 +863,7 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
intptr_t adr = 0;
const char *newfile = file;
if (inthash_readptr(NewLangList, "redirect", &adr) && adr != 0) {
if (coucal_readptr(NewLangList, "redirect", &adr) && adr != 0) {
const char *newadr = (char *) adr;
if (*newadr) {
@@ -879,7 +879,7 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
StringMemcat(headers, tmp, strlen(tmp));
}
}
inthash_write(NewLangList, "redirect", (intptr_t) NULL);
coucal_write(NewLangList, "redirect", (intptr_t) NULL);
} else if (is_html(file)) {
int outputmode = 0;
@@ -983,14 +983,14 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
} else if (strcmp(name, "if-not-empty") == 0) {
intptr_t adr = 0;
if (!inthash_readptr(NewLangList, pos2, &adr)
if (!coucal_readptr(NewLangList, pos2, &adr)
|| *((char *) adr) == 0) {
outputmode = -1;
}
} else if (strcmp(name, "if-empty") == 0) {
intptr_t adr = 0;
if (inthash_readptr(NewLangList, pos2, &adr)
if (coucal_readptr(NewLangList, pos2, &adr)
&& *((char *) adr) != 0) {
outputmode = -1;
}
@@ -999,7 +999,7 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
} else if (strcmp(name, "loadhash") == 0) {
intptr_t adr = 0;
if (inthash_readptr(NewLangList, "path", &adr)) {
if (coucal_readptr(NewLangList, "path", &adr)) {
char *rpath = (char *) adr;
//find_handle h;
@@ -1012,9 +1012,9 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
const char *profiles = hts_getcategories(rpath, 0);
const char *categ = hts_getcategories(rpath, 1);
inthash_write(NewLangList, "winprofile",
coucal_write(NewLangList, "winprofile",
(intptr_t) profiles);
inthash_write(NewLangList, "wincateg",
coucal_write(NewLangList, "wincateg",
(intptr_t) categ);
}
}
@@ -1026,10 +1026,10 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
intptr_t adr = 0;
*pos3++ = '\0';
if (inthash_readptr(NewLangList, pos2, &adr)) {
inthash_write(NewLangList, pos3,
if (coucal_readptr(NewLangList, pos2, &adr)) {
coucal_write(NewLangList, pos3,
(intptr_t) strdup((char *) adr));
inthash_write(NewLangList, pos2, (intptr_t) NULL);
coucal_write(NewLangList, pos2, (intptr_t) NULL);
}
}
}
@@ -1039,10 +1039,10 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
if (pos3) {
*pos3++ = '\0';
inthash_write(NewLangList, pos2,
coucal_write(NewLangList, pos2,
(intptr_t) strdup(pos3));
} else {
inthash_write(NewLangList, pos2, (intptr_t) NULL);
coucal_write(NewLangList, pos2, (intptr_t) NULL);
}
}
}
@@ -1063,7 +1063,7 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
pos2 = strchr(name, ':');
if (pos2 != NULL) {
*pos2 = '\0';
if (inthash_readptr(NewLangList, name, &adr) || ztest) {
if (coucal_readptr(NewLangList, name, &adr) || ztest) {
const char *newadr = (char *) adr;
if (!newadr)
@@ -1123,7 +1123,7 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
dname[0] = '\0';
strncatbuff(dname, name, n2);
if (inthash_readptr(NewLangList, dname, &adr)) {
if (coucal_readptr(NewLangList, dname, &adr)) {
int n = 0;
if (sscanf((char *) adr, "%d", &n) == 1) {
@@ -1148,7 +1148,7 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
if (langstr == NULL || *langstr == '\0') {
intptr_t adr = 0;
if (inthash_readptr(NewLangList, name, &adr)) {
if (coucal_readptr(NewLangList, name, &adr)) {
char *newadr = (char *) adr;
langstr = newadr;
@@ -1411,12 +1411,12 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path) {
int htslang_init(void) {
if (NewLangList == NULL) {
NewLangList = inthash_new(0);
inthash_set_name(NewLangList, "NewLangList");
NewLangList = coucal_new(0);
coucal_set_name(NewLangList, "NewLangList");
if (NewLangList == NULL) {
abortLog("Error in lang.h: not enough memory");
} else {
inthash_value_is_malloc(NewLangList, 1);
coucal_value_is_malloc(NewLangList, 1);
}
}
return 1;
@@ -1424,26 +1424,26 @@ int htslang_init(void) {
int htslang_uninit(void) {
if (NewLangList != NULL) {
inthash_delete(&NewLangList);
coucal_delete(&NewLangList);
}
return 1;
}
int smallserver_setkey(const char *key, const char *value) {
return inthash_write(NewLangList, key, (intptr_t) strdup(value));
return coucal_write(NewLangList, key, (intptr_t) strdup(value));
}
int smallserver_setkeyint(const char *key, LLint value) {
char tmp[256];
snprintf(tmp, sizeof(tmp), LLintP, value);
return inthash_write(NewLangList, key, (intptr_t) strdup(tmp));
return coucal_write(NewLangList, key, (intptr_t) strdup(tmp));
}
int smallserver_setkeyarr(const char *key, int id, const char *key2, const char *value) {
char tmp[256];
snprintf(tmp, sizeof(tmp), "%s%d%s", key, id, key2);
return inthash_write(NewLangList, tmp, (intptr_t) strdup(value));
return coucal_write(NewLangList, tmp, (intptr_t) strdup(value));
}
static int htslang_load(char *limit_to, const char *path) {
@@ -1456,15 +1456,15 @@ static int htslang_load(char *limit_to, const char *path) {
//
if (!limit_to) {
LANG_DELETE();
NewLangStr = inthash_new(0);
NewLangStrKeys = inthash_new(0);
inthash_set_name(NewLangStr, "NewLangStr");
inthash_set_name(NewLangStrKeys, "NewLangStrKeys");
NewLangStr = coucal_new(0);
NewLangStrKeys = coucal_new(0);
coucal_set_name(NewLangStr, "NewLangStr");
coucal_set_name(NewLangStrKeys, "NewLangStrKeys");
if ((NewLangStr == NULL) || (NewLangStrKeys == NULL)) {
abortLog("Error in lang.h: not enough memory");
} else {
inthash_value_is_malloc(NewLangStr, 1);
inthash_value_is_malloc(NewLangStrKeys, 1);
coucal_value_is_malloc(NewLangStr, 1);
coucal_value_is_malloc(NewLangStrKeys, 1);
}
}
@@ -1502,7 +1502,7 @@ static int htslang_load(char *limit_to, const char *path) {
if (buff) {
strcpybuff(buff, intkey);
inthash_add(NewLangStrKeys, key, (intptr_t) buff);
coucal_add(NewLangStrKeys, key, (intptr_t) buff);
}
}
} // if
@@ -1599,7 +1599,7 @@ static int htslang_load(char *limit_to, const char *path) {
char *const buff = (char *) malloc(len + 1);
if (buff) {
conv_printf(value, buff);
inthash_add(NewLangStr, intkey, (intptr_t) buff);
coucal_add(NewLangStr, intkey, (intptr_t) buff);
}
}
@@ -1690,8 +1690,8 @@ static void conv_printf(const char *from, char *to) {
}
static void LANG_DELETE(void) {
inthash_delete(&NewLangStr);
inthash_delete(&NewLangStrKeys);
coucal_delete(&NewLangStr);
coucal_delete(&NewLangStrKeys);
}
// sélection de la langue
@@ -1761,9 +1761,9 @@ static int QLANG_T(int l) {
}
const char* LANGSEL(const char* name) {
inthash_value value;
coucal_value value;
if (NewLangStr != NULL
&& inthash_read_value(NewLangStr, name, &value) != 0
&& coucal_read_value(NewLangStr, name, &value) != 0
&& value.ptr != NULL) {
return (char*) value.ptr;
} else {
@@ -1772,9 +1772,9 @@ const char* LANGSEL(const char* name) {
}
const char* LANGINTKEY(const char* name) {
inthash_value value;
coucal_value value;
if (NewLangStrKeys != NULL
&& inthash_read_value(NewLangStrKeys, name, &value) != 0
&& coucal_read_value(NewLangStrKeys, name, &value) != 0
&& value.ptr != NULL) {
return (char*) value.ptr;
} else {

View File

@@ -71,11 +71,11 @@ int smallserver(T_SOC soc, char *url, char *method, char *data, char *path);
"\r\n"\
extern int NewLangStrSz;
extern inthash NewLangStr;
extern coucal NewLangStr;
extern int NewLangStrKeysSz;
extern inthash NewLangStrKeys;
extern coucal NewLangStrKeys;
extern int NewLangListSz;
extern inthash NewLangList;
extern coucal NewLangList;
extern httrackp *global_opt;

View File

@@ -194,15 +194,15 @@ int ident_url_relatif(const char *lien, const char *origin_adr,
/* patch scheme if necessary */
if (strfield(lien, "http:")) {
lien += 5;
strcpybuff(adrfil->adr, jump_protocol(origin_adr)); // même adresse ; protocole vide (http)
strcpybuff(adrfil->adr, jump_protocol_const(origin_adr)); // même adresse ; protocole vide (http)
} else if (strfield(lien, "https:")) {
lien += 6;
strcpybuff(adrfil->adr, "https://"); // même adresse forcée en https
strcatbuff(adrfil->adr, jump_protocol(origin_adr));
strcatbuff(adrfil->adr, jump_protocol_const(origin_adr));
} else if (strfield(lien, "ftp:")) {
lien += 4;
strcpybuff(adrfil->adr, "ftp://"); // même adresse forcée en ftp
strcatbuff(adrfil->adr, jump_protocol(origin_adr));
strcatbuff(adrfil->adr, jump_protocol_const(origin_adr));
} else {
strcpybuff(adrfil->adr, origin_adr); // même adresse ; et même éventuel protocole
}
@@ -395,7 +395,7 @@ int link_has_authority(const char *lien) {
}
int link_has_authorization(const char *lien) {
const char *adr = jump_protocol(lien);
const char *adr = jump_protocol_const(lien);
const char *firstslash = strchr(adr, '/');
const char *detect = strchr(adr, '@');
@@ -415,14 +415,15 @@ void long_to_83(int mode, char *n83, char *save) {
while(*save) {
char fn83[256], fnl[256];
int i = 0;
size_t i, j;
fn83[0] = fnl[0] = '\0';
while((save[i]) && (save[i] != '/')) {
fnl[i] = save[i];
i++;
for(i = j = 0 ; save[i] && save[i] != '/' ; i++) {
if (j + 1 < sizeof(fnl)) {
fnl[j++] = save[i];
}
}
fnl[i] = '\0';
fnl[j] = '\0';
// conversion
longfile_to_83(mode, fn83, fnl);
strcatbuff(n83, fn83);
@@ -748,8 +749,8 @@ int istoobig(httrackp * opt, LLint size, LLint maxhtml, LLint maxnhtml,
static int sortTopIndexFnc(const void *a_, const void *b_) {
int cmp;
topindex_chain **a = (topindex_chain **) a_;
topindex_chain **b = (topindex_chain **) b_;
const topindex_chain *const*const a = (const topindex_chain *const*) a_;
const topindex_chain *const*const b = (const topindex_chain *const*) b_;
/* Category first, then name */
if ((cmp = (*a)->level - (*b)->level) == 0) {
@@ -1079,7 +1080,7 @@ HTSEXT_API char *hts_getcategories(char *path, int type) {
String profiles = STRING_EMPTY;
char *rpath = path;
find_handle h;
inthash hashCateg = NULL;
coucal hashCateg = NULL;
if (rpath[0]) {
if (rpath[strlen(rpath) - 1] == '/') {
@@ -1091,8 +1092,8 @@ HTSEXT_API char *hts_getcategories(char *path, int type) {
String iname = STRING_EMPTY;
if (type == 1) {
hashCateg = inthash_new(0);
inthash_set_name(hashCateg, "hashCateg");
hashCateg = coucal_new(0);
coucal_set_name(hashCateg, "hashCateg");
StringCat(categ, "Test category 1");
StringCat(categ, "\r\nTest category 2");
}
@@ -1117,8 +1118,8 @@ HTSEXT_API char *hts_getcategories(char *path, int type) {
if (n > 0) {
if (strfield(line2, "category=")) {
if (*(line2 + 9)) {
if (!inthash_read(hashCateg, line2 + 9, NULL)) {
inthash_write(hashCateg, line2 + 9, 0);
if (!coucal_read(hashCateg, line2 + 9, NULL)) {
coucal_write(hashCateg, line2 + 9, 0);
if (StringLength(categ) > 0) {
StringCat(categ, "\r\n");
}
@@ -1146,7 +1147,7 @@ HTSEXT_API char *hts_getcategories(char *path, int type) {
StringFree(iname);
}
if (hashCateg) {
inthash_delete(&hashCateg);
coucal_delete(&hashCateg);
hashCateg = NULL;
}
if (type == 1)

View File

@@ -58,7 +58,7 @@ Please visit our Website: http://www.httrack.com
#include "htsthread.h"
/* External modules */
#include "htsinthash.c"
#include "coucal.c"
#include "htsmd5.c"
#include "md5.c"
@@ -178,6 +178,14 @@ int main(int argc, char *argv[]) {
}
smallserver_setkey("HTTRACK_WEB", HTTRACK_WEB);
/* Check version compatibility */
if (hts_sizeof_opt() != sizeof(httrackp)) {
fprintf(stderr,
"** CRITICAL: incompatible current httrack library version %s, expected version %s",
hts_version(), HTTRACK_VERSIONID);
smallserver_setkey("HTTRACK_INCOMPATIBLE_VERSIONID", hts_version());
}
/* protected session-id */
{
char buff[1024];

View File

@@ -459,7 +459,7 @@ static int hts_acceptlink_(httrackp * opt, int ptr,
question = 0; // pas de question, résolu
// former URL complète du lien actuel
strcpybuff(l, jump_identification(adr));
strcpybuff(l, jump_identification_const(adr));
if (*fil != '/')
strcatbuff(l, "/");
strcatbuff(l, fil);
@@ -711,7 +711,7 @@ static int hts_acceptlink_(httrackp * opt, int ptr,
forbidden_url = 1;
HT_INSERT_FILTERS0; // insérer en 0
strcpybuff(_FILTERS[0], "-");
strcatbuff(_FILTERS[0], jump_identification(adr));
strcatbuff(_FILTERS[0], jump_identification_const(adr));
if (*fil != '/')
strcatbuff(_FILTERS[0], "/");
strcatbuff(_FILTERS[0], fil);
@@ -727,7 +727,7 @@ static int hts_acceptlink_(httrackp * opt, int ptr,
if (fil[i] == '/') {
HT_INSERT_FILTERS0; // insérer en 0
strcpybuff(_FILTERS[0], "-");
strcatbuff(_FILTERS[0], jump_identification(adr));
strcatbuff(_FILTERS[0], jump_identification_const(adr));
if (*fil != '/')
strcatbuff(_FILTERS[0], "/");
strncatbuff(_FILTERS[0], fil, i);
@@ -744,7 +744,7 @@ static int hts_acceptlink_(httrackp * opt, int ptr,
forbidden_url = 1;
HT_INSERT_FILTERS0; // insérer en 0
strcpybuff(_FILTERS[0], "-");
strcatbuff(_FILTERS[0], jump_identification(adr));
strcatbuff(_FILTERS[0], jump_identification_const(adr));
strcatbuff(_FILTERS[0], "*");
break;
@@ -786,7 +786,7 @@ static int hts_acceptlink_(httrackp * opt, int ptr,
if (fil[i] == '/') {
HT_INSERT_FILTERS0; // insérer en 0
strcpybuff(_FILTERS[0], "+");
strcatbuff(_FILTERS[0], jump_identification(adr));
strcatbuff(_FILTERS[0], jump_identification_const(adr));
if (*fil != '/')
strcatbuff(_FILTERS[0], "/");
strncatbuff(_FILTERS[0], fil, i + 1);
@@ -795,7 +795,7 @@ static int hts_acceptlink_(httrackp * opt, int ptr,
} else { // autoriser domaine alors!!
HT_INSERT_FILTERS0; // insérer en 0 strcpybuff(filters[filptr],"+");
strcpybuff(_FILTERS[0], "+");
strcatbuff(_FILTERS[0], jump_identification(adr));
strcatbuff(_FILTERS[0], jump_identification_const(adr));
strcatbuff(_FILTERS[0], "*");
}
break;
@@ -803,7 +803,7 @@ static int hts_acceptlink_(httrackp * opt, int ptr,
case 6: // same domain
HT_INSERT_FILTERS0; // insérer en 0 strcpybuff(filters[filptr],"+");
strcpybuff(_FILTERS[0], "+");
strcatbuff(_FILTERS[0], jump_identification(adr));
strcatbuff(_FILTERS[0], jump_identification_const(adr));
strcatbuff(_FILTERS[0], "*");
break;
//
@@ -816,7 +816,7 @@ static int hts_acceptlink_(httrackp * opt, int ptr,
if (fil[i] == '/') {
HT_INSERT_FILTERS0; // insérer en 0
strcpybuff(_FILTERS[0], "+");
strcatbuff(_FILTERS[0], jump_identification(adr));
strcatbuff(_FILTERS[0], jump_identification_const(adr));
if (*fil != '/')
strcatbuff(_FILTERS[0], "/");
strncatbuff(_FILTERS[0], fil, i + 1);
@@ -915,7 +915,7 @@ int hts_testlinksize(httrackp * opt, const char *adr, const char *fil, LLint siz
int size_flag = 0;
// former URL complète du lien actuel
strcpybuff(l, jump_identification(adr));
strcpybuff(l, jump_identification_const(adr));
if (*fil != '/')
strcatbuff(l, "/");
strcatbuff(l, fil);

View File

@@ -36,7 +36,7 @@ Please visit our Website: http://www.httrack.com
#include "htswrap.h"
#include "htshash.h"
#include "htsinthash.h"
#include "coucal.h"
#include "htslib.h"
HTSEXT_API int htswrap_init(void) { // LEGACY

View File

@@ -38,7 +38,7 @@ Please visit our Website: http://www.httrack.com
#ifdef HTS_INTERNAL_BYTECODE
#include "htsglobal.h"
#include "htsinthash.h"
#include "coucal.h"
/* Forward definitions */
#ifndef HTS_DEF_FWSTRUCT_httrackp
@@ -46,9 +46,17 @@ Please visit our Website: http://www.httrack.com
typedef struct httrackp httrackp;
#endif
#ifdef __cplusplus
extern "C" {
#endif
HTSEXT_API int htswrap_init(void); // LEGACY
HTSEXT_API int htswrap_free(void); // LEGACY
#ifdef __cplusplus
}
#endif
//HTSEXT_API int htswrap_add(httrackp * opt, const char *name, void *fct);
//HTSEXT_API uintptr_t htswrap_read(httrackp * opt, const char *name);

View File

@@ -5,7 +5,7 @@ Copyright (C) 1998-2014 Xavier Roche and other contributors
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
as published by the Free Software Foundation; either version 2
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@@ -33,6 +33,10 @@ Please visit our Website: http://www.httrack.com
#ifndef HTTRACK_DEFLIB
#define HTTRACK_DEFLIB
#ifdef __cplusplus
extern "C" {
#endif
#include "htsglobal.h"
#ifndef _WIN32
@@ -114,6 +118,7 @@ HTSEXT_API int hts_main2(int argc, char **argv, httrackp * opt);
/* Options handling */
HTSEXT_API httrackp *hts_create_opt(void);
HTSEXT_API void hts_free_opt(httrackp * opt);
HTSEXT_API size_t hts_sizeof_opt(void);
HTSEXT_API const hts_stat_struct* hts_get_stats(httrackp * opt);
HTSEXT_API void set_wrappers(httrackp * opt); /* LEGACY */
HTSEXT_API int plug_wrapper(httrackp * opt, const char *moduleName,
@@ -181,6 +186,7 @@ HTSEXT_API void hts_cancel_test(httrackp * opt);
HTSEXT_API void hts_cancel_parsing(httrackp * opt);
HTSEXT_API void hts_cancel_test(httrackp * opt);
HTSEXT_API void hts_cancel_parsing(httrackp * opt);
HTSEXT_API int hts_has_stopped(httrackp * opt);
/* Tools */
HTSEXT_API int structcheck(const char *path);
@@ -193,9 +199,12 @@ HTSEXT_API char *int2char(strc_int2bytes2 * strc, int n);
HTSEXT_API char *int2bytes(strc_int2bytes2 * strc, LLint n);
HTSEXT_API char *int2bytessec(strc_int2bytes2 * strc, long int n);
HTSEXT_API char **int2bytes2(strc_int2bytes2 * strc, LLint n);
HTSEXT_API char *jump_identification(const char *);
HTSEXT_API char *jump_normalized(const char *);
HTSEXT_API char *jump_toport(const char *);
HTSEXT_API char *jump_identification(char *);
HTSEXT_API const char *jump_identification_const(const char *);
HTSEXT_API char *jump_normalized(char *);
HTSEXT_API const char *jump_normalized_const(const char *);
HTSEXT_API char *jump_toport(char *);
HTSEXT_API const char *jump_toport_const(const char *);
HTSEXT_API char *fil_normalized(const char *source, char *dest);
HTSEXT_API char *adr_normalized(const char *source, char *dest);
HTSEXT_API const char *hts_rootdir(char *file);
@@ -332,4 +341,8 @@ typedef struct utimbuf STRUCT_UTIMBUF;
#define fconcat(A,B,C,D) (COMPILE_TIME_CHECK_SIZE(B), fconcat(A,B,C,D))
#define fslash(A,B,C) (COMPILE_TIME_CHECK_SIZE(B), fslash(A,B,C))
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -223,6 +223,15 @@ int main(int argc, char **argv) {
signal_handlers();
hts_init();
// Check version compatibility
if (hts_sizeof_opt() != sizeof(httrackp)) {
fprintf(stderr,
"incompatible current httrack library version %s, expected version %s",
hts_version(), HTTRACK_VERSIONID);
abortLog("incompatible httrack library version, please update both httrack and its library");
}
opt = global_opt = hts_create_opt();
assert(opt->size_httrackp == sizeof(httrackp));

View File

@@ -44,6 +44,6 @@ int mdbinfileBroken(char *fn, unsigned char *bindigest);
/*
* This is needed to make RSAREF happy on some MS-DOS compilers.
*/
typedef struct MD5Context MD5_CTX;
typedef struct MD5Context MD5CTX;
#endif /* !MD5_H */

View File

@@ -14,7 +14,7 @@
#define _CRT_SECURE_NO_WARNINGS
#endif
#if defined(__APPLE__) || defined(IOAPI_NO_64)
#if defined(__APPLE__) || defined(__ANDROID__) || defined(IOAPI_NO_64)
// In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions
#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
#define FTELLO_FUNC(stream) ftello(stream)
@@ -230,8 +230,7 @@ static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream)
return ret;
}
void fill_fopen_filefunc (pzlib_filefunc_def)
zlib_filefunc_def* pzlib_filefunc_def;
void fill_fopen_filefunc (zlib_filefunc_def* pzlib_filefunc_def)
{
pzlib_filefunc_def->zopen_file = fopen_file_func;
pzlib_filefunc_def->zread_file = fread_file_func;

View File

@@ -1,5 +1,14 @@
--- ioapi.c.orig 2012-01-21 20:58:45.000000000 +0100
+++ ioapi.c 2014-05-24 13:27:22.516230485 +0200
--- ioapi.c.orig 2014-06-10 18:55:32.778807408 +0200
+++ ioapi.c 2014-06-22 12:22:06.606696274 +0200
@@ -14,7 +14,7 @@
#define _CRT_SECURE_NO_WARNINGS
#endif
-#if defined(__APPLE__) || defined(IOAPI_NO_64)
+#if defined(__APPLE__) || defined(__ANDROID__) || defined(IOAPI_NO_64)
// In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions
#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
#define FTELLO_FUNC(stream) ftello(stream)
@@ -73,6 +73,7 @@
p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file;
p_filefunc64_32->zfile_func64.zread_file = p_filefunc32->zread_file;
@@ -30,7 +39,16 @@
static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream)
{
@@ -229,6 +238,7 @@
@@ -221,14 +230,14 @@
return ret;
}
-void fill_fopen_filefunc (pzlib_filefunc_def)
- zlib_filefunc_def* pzlib_filefunc_def;
+void fill_fopen_filefunc (zlib_filefunc_def* pzlib_filefunc_def)
{
pzlib_filefunc_def->zopen_file = fopen_file_func;
pzlib_filefunc_def->zread_file = fread_file_func;
pzlib_filefunc_def->zwrite_file = fwrite_file_func;
pzlib_filefunc_def->ztell_file = ftell_file_func;
pzlib_filefunc_def->zseek_file = fseek_file_func;
@@ -38,7 +56,7 @@
pzlib_filefunc_def->zclose_file = fclose_file_func;
pzlib_filefunc_def->zerror_file = ferror_file_func;
pzlib_filefunc_def->opaque = NULL;
@@ -241,6 +251,7 @@
@@ -241,6 +250,7 @@
pzlib_filefunc_def->zwrite_file = fwrite_file_func;
pzlib_filefunc_def->ztell64_file = ftell64_file_func;
pzlib_filefunc_def->zseek64_file = fseek64_file_func;

247
src/minizip/ioapi.c.orig Normal file
View File

@@ -0,0 +1,247 @@
/* ioapi.h -- IO base function header for compress/uncompress .zip
part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
Modifications for Zip64 support
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
For more info read MiniZip_info.txt
*/
#if defined(_WIN32) && (!(defined(_CRT_SECURE_NO_WARNINGS)))
#define _CRT_SECURE_NO_WARNINGS
#endif
#if defined(__APPLE__) || defined(IOAPI_NO_64)
// In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions
#define FOPEN_FUNC(filename, mode) fopen(filename, mode)
#define FTELLO_FUNC(stream) ftello(stream)
#define FSEEKO_FUNC(stream, offset, origin) fseeko(stream, offset, origin)
#else
#define FOPEN_FUNC(filename, mode) fopen64(filename, mode)
#define FTELLO_FUNC(stream) ftello64(stream)
#define FSEEKO_FUNC(stream, offset, origin) fseeko64(stream, offset, origin)
#endif
#include "ioapi.h"
voidpf call_zopen64 (const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode)
{
if (pfilefunc->zfile_func64.zopen64_file != NULL)
return (*(pfilefunc->zfile_func64.zopen64_file)) (pfilefunc->zfile_func64.opaque,filename,mode);
else
{
return (*(pfilefunc->zopen32_file))(pfilefunc->zfile_func64.opaque,(const char*)filename,mode);
}
}
long call_zseek64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin)
{
if (pfilefunc->zfile_func64.zseek64_file != NULL)
return (*(pfilefunc->zfile_func64.zseek64_file)) (pfilefunc->zfile_func64.opaque,filestream,offset,origin);
else
{
uLong offsetTruncated = (uLong)offset;
if (offsetTruncated != offset)
return -1;
else
return (*(pfilefunc->zseek32_file))(pfilefunc->zfile_func64.opaque,filestream,offsetTruncated,origin);
}
}
ZPOS64_T call_ztell64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream)
{
if (pfilefunc->zfile_func64.zseek64_file != NULL)
return (*(pfilefunc->zfile_func64.ztell64_file)) (pfilefunc->zfile_func64.opaque,filestream);
else
{
uLong tell_uLong = (*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream);
if ((tell_uLong) == MAXU32)
return (ZPOS64_T)-1;
else
return tell_uLong;
}
}
void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32)
{
p_filefunc64_32->zfile_func64.zopen64_file = NULL;
p_filefunc64_32->zopen32_file = p_filefunc32->zopen_file;
p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file;
p_filefunc64_32->zfile_func64.zread_file = p_filefunc32->zread_file;
p_filefunc64_32->zfile_func64.zwrite_file = p_filefunc32->zwrite_file;
p_filefunc64_32->zfile_func64.ztell64_file = NULL;
p_filefunc64_32->zfile_func64.zseek64_file = NULL;
p_filefunc64_32->zfile_func64.zclose_file = p_filefunc32->zclose_file;
p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file;
p_filefunc64_32->zfile_func64.opaque = p_filefunc32->opaque;
p_filefunc64_32->zseek32_file = p_filefunc32->zseek_file;
p_filefunc64_32->ztell32_file = p_filefunc32->ztell_file;
}
static voidpf ZCALLBACK fopen_file_func OF((voidpf opaque, const char* filename, int mode));
static uLong ZCALLBACK fread_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size));
static uLong ZCALLBACK fwrite_file_func OF((voidpf opaque, voidpf stream, const void* buf,uLong size));
static ZPOS64_T ZCALLBACK ftell64_file_func OF((voidpf opaque, voidpf stream));
static long ZCALLBACK fseek64_file_func OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin));
static int ZCALLBACK fclose_file_func OF((voidpf opaque, voidpf stream));
static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream));
static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode)
{
FILE* file = NULL;
const char* mode_fopen = NULL;
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
mode_fopen = "rb";
else
if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
mode_fopen = "r+b";
else
if (mode & ZLIB_FILEFUNC_MODE_CREATE)
mode_fopen = "wb";
if ((filename!=NULL) && (mode_fopen != NULL))
file = fopen(filename, mode_fopen);
return file;
}
static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode)
{
FILE* file = NULL;
const char* mode_fopen = NULL;
if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
mode_fopen = "rb";
else
if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
mode_fopen = "r+b";
else
if (mode & ZLIB_FILEFUNC_MODE_CREATE)
mode_fopen = "wb";
if ((filename!=NULL) && (mode_fopen != NULL))
file = FOPEN_FUNC((const char*)filename, mode_fopen);
return file;
}
static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size)
{
uLong ret;
ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream);
return ret;
}
static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size)
{
uLong ret;
ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream);
return ret;
}
static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream)
{
long ret;
ret = ftell((FILE *)stream);
return ret;
}
static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream)
{
ZPOS64_T ret;
ret = FTELLO_FUNC((FILE *)stream);
return ret;
}
static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin)
{
int fseek_origin=0;
long ret;
switch (origin)
{
case ZLIB_FILEFUNC_SEEK_CUR :
fseek_origin = SEEK_CUR;
break;
case ZLIB_FILEFUNC_SEEK_END :
fseek_origin = SEEK_END;
break;
case ZLIB_FILEFUNC_SEEK_SET :
fseek_origin = SEEK_SET;
break;
default: return -1;
}
ret = 0;
if (fseek((FILE *)stream, offset, fseek_origin) != 0)
ret = -1;
return ret;
}
static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)
{
int fseek_origin=0;
long ret;
switch (origin)
{
case ZLIB_FILEFUNC_SEEK_CUR :
fseek_origin = SEEK_CUR;
break;
case ZLIB_FILEFUNC_SEEK_END :
fseek_origin = SEEK_END;
break;
case ZLIB_FILEFUNC_SEEK_SET :
fseek_origin = SEEK_SET;
break;
default: return -1;
}
ret = 0;
if(FSEEKO_FUNC((FILE *)stream, offset, fseek_origin) != 0)
ret = -1;
return ret;
}
static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream)
{
int ret;
ret = fclose((FILE *)stream);
return ret;
}
static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream)
{
int ret;
ret = ferror((FILE *)stream);
return ret;
}
void fill_fopen_filefunc (pzlib_filefunc_def)
zlib_filefunc_def* pzlib_filefunc_def;
{
pzlib_filefunc_def->zopen_file = fopen_file_func;
pzlib_filefunc_def->zread_file = fread_file_func;
pzlib_filefunc_def->zwrite_file = fwrite_file_func;
pzlib_filefunc_def->ztell_file = ftell_file_func;
pzlib_filefunc_def->zseek_file = fseek_file_func;
pzlib_filefunc_def->zclose_file = fclose_file_func;
pzlib_filefunc_def->zerror_file = ferror_file_func;
pzlib_filefunc_def->opaque = NULL;
}
void fill_fopen64_filefunc (zlib_filefunc64_def* pzlib_filefunc_def)
{
pzlib_filefunc_def->zopen64_file = fopen64_file_func;
pzlib_filefunc_def->zread_file = fread_file_func;
pzlib_filefunc_def->zwrite_file = fwrite_file_func;
pzlib_filefunc_def->ztell64_file = ftell64_file_func;
pzlib_filefunc_def->zseek64_file = fseek64_file_func;
pzlib_filefunc_def->zclose_file = fclose_file_func;
pzlib_filefunc_def->zerror_file = ferror_file_func;
pzlib_filefunc_def->opaque = NULL;
}

View File

@@ -67,6 +67,24 @@
#endif
#endif
/* As reported by sammyx, z_crc_t and z_const are not defined in pre-1.2.70 releases of zlib */
/* See <https://github.com/madler/zlib/commit/6c9bd474aa08312ef2e2e9655a80e18db24a1680#diff-d466aa66f7e453e0c8a7719229cff391R391> */
#if ZLIB_VERNUM < 0x1270
#ifdef Z_U4
typedef Z_U4 z_crc_t;
#else
typedef unsigned long z_crc_t;
#endif
#if defined(ZLIB_CONST) && !defined(z_const)
# define z_const const
#else
# define z_const
#endif
#endif
/*
#ifndef ZPOS64_T
#ifdef _WIN32

View File

@@ -1,6 +1,31 @@
--- ioapi.h.orig 2012-01-17 03:51:31.000000000 +0100
+++ ioapi.h 2014-05-24 13:27:22.516230485 +0200
@@ -135,6 +135,7 @@
+++ ioapi.h 2014-06-08 21:54:18.326360527 +0200
@@ -67,6 +67,24 @@
#endif
#endif
+/* As reported by sammyx, z_crc_t and z_const are not defined in pre-1.2.70 releases of zlib */
+/* See <https://github.com/madler/zlib/commit/6c9bd474aa08312ef2e2e9655a80e18db24a1680#diff-d466aa66f7e453e0c8a7719229cff391R391> */
+#if ZLIB_VERNUM < 0x1270
+
+#ifdef Z_U4
+ typedef Z_U4 z_crc_t;
+#else
+ typedef unsigned long z_crc_t;
+#endif
+
+#if defined(ZLIB_CONST) && !defined(z_const)
+# define z_const const
+#else
+# define z_const
+#endif
+
+#endif
+
/*
#ifndef ZPOS64_T
#ifdef _WIN32
@@ -135,6 +153,7 @@
typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode));
typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size));
typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
@@ -8,7 +33,7 @@
typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream));
typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream));
@@ -148,6 +149,7 @@
@@ -148,6 +167,7 @@
open_file_func zopen_file;
read_file_func zread_file;
write_file_func zwrite_file;
@@ -16,7 +41,7 @@
tell_file_func ztell_file;
seek_file_func zseek_file;
close_file_func zclose_file;
@@ -164,6 +166,7 @@
@@ -164,6 +184,7 @@
open64_file_func zopen64_file;
read_file_func zread_file;
write_file_func zwrite_file;
@@ -24,7 +49,7 @@
tell64_file_func ztell64_file;
seek64_file_func zseek64_file;
close_file_func zclose_file;
@@ -186,6 +189,7 @@
@@ -186,6 +207,7 @@
#define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size))
#define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size))

208
src/minizip/ioapi.h.orig Normal file
View File

@@ -0,0 +1,208 @@
/* ioapi.h -- IO base function header for compress/uncompress .zip
part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
Modifications for Zip64 support
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
For more info read MiniZip_info.txt
Changes
Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (might need to find a better why for this)
Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would work on linux.
More if/def section may be needed to support other platforms
Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would compile on windows.
(but you should use iowin32.c for windows instead)
*/
#ifndef _ZLIBIOAPI64_H
#define _ZLIBIOAPI64_H
#if (!defined(_WIN32)) && (!defined(WIN32)) && (!defined(__APPLE__))
// Linux needs this to support file operation on files larger then 4+GB
// But might need better if/def to select just the platforms that needs them.
#ifndef __USE_FILE_OFFSET64
#define __USE_FILE_OFFSET64
#endif
#ifndef __USE_LARGEFILE64
#define __USE_LARGEFILE64
#endif
#ifndef _LARGEFILE64_SOURCE
#define _LARGEFILE64_SOURCE
#endif
#ifndef _FILE_OFFSET_BIT
#define _FILE_OFFSET_BIT 64
#endif
#endif
#include <stdio.h>
#include <stdlib.h>
#include "zlib.h"
#if defined(USE_FILE32API)
#define fopen64 fopen
#define ftello64 ftell
#define fseeko64 fseek
#else
#ifdef __FreeBSD__
#define fopen64 fopen
#define ftello64 ftello
#define fseeko64 fseeko
#endif
#ifdef _MSC_VER
#define fopen64 fopen
#if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC)))
#define ftello64 _ftelli64
#define fseeko64 _fseeki64
#else // old MSC
#define ftello64 ftell
#define fseeko64 fseek
#endif
#endif
#endif
/*
#ifndef ZPOS64_T
#ifdef _WIN32
#define ZPOS64_T fpos_t
#else
#include <stdint.h>
#define ZPOS64_T uint64_t
#endif
#endif
*/
#ifdef HAVE_MINIZIP64_CONF_H
#include "mz64conf.h"
#endif
/* a type choosen by DEFINE */
#ifdef HAVE_64BIT_INT_CUSTOM
typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T;
#else
#ifdef HAS_STDINT_H
#include "stdint.h"
typedef uint64_t ZPOS64_T;
#else
/* Maximum unsigned 32-bit value used as placeholder for zip64 */
#define MAXU32 0xffffffff
#if defined(_MSC_VER) || defined(__BORLANDC__)
typedef unsigned __int64 ZPOS64_T;
#else
typedef unsigned long long int ZPOS64_T;
#endif
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define ZLIB_FILEFUNC_SEEK_CUR (1)
#define ZLIB_FILEFUNC_SEEK_END (2)
#define ZLIB_FILEFUNC_SEEK_SET (0)
#define ZLIB_FILEFUNC_MODE_READ (1)
#define ZLIB_FILEFUNC_MODE_WRITE (2)
#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3)
#define ZLIB_FILEFUNC_MODE_EXISTING (4)
#define ZLIB_FILEFUNC_MODE_CREATE (8)
#ifndef ZCALLBACK
#if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK)
#define ZCALLBACK CALLBACK
#else
#define ZCALLBACK
#endif
#endif
typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode));
typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size));
typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream));
typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream));
typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream));
typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin));
/* here is the "old" 32 bits structure structure */
typedef struct zlib_filefunc_def_s
{
open_file_func zopen_file;
read_file_func zread_file;
write_file_func zwrite_file;
tell_file_func ztell_file;
seek_file_func zseek_file;
close_file_func zclose_file;
testerror_file_func zerror_file;
voidpf opaque;
} zlib_filefunc_def;
typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream));
typedef long (ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin));
typedef voidpf (ZCALLBACK *open64_file_func) OF((voidpf opaque, const void* filename, int mode));
typedef struct zlib_filefunc64_def_s
{
open64_file_func zopen64_file;
read_file_func zread_file;
write_file_func zwrite_file;
tell64_file_func ztell64_file;
seek64_file_func zseek64_file;
close_file_func zclose_file;
testerror_file_func zerror_file;
voidpf opaque;
} zlib_filefunc64_def;
void fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def));
void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def));
/* now internal definition, only for zip.c and unzip.h */
typedef struct zlib_filefunc64_32_def_s
{
zlib_filefunc64_def zfile_func64;
open_file_func zopen32_file;
tell_file_func ztell32_file;
seek_file_func zseek32_file;
} zlib_filefunc64_32_def;
#define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size))
#define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size))
//#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream))
//#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode))
#define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream))
#define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream))
voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode));
long call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin));
ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream));
void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32);
#define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode)))
#define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream)))
#define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode)))
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,66 @@
--- mztools.c.orig 2012-01-21 20:58:45.000000000 +0100
+++ mztools.c 2014-05-24 13:27:22.516230485 +0200
@@ -10,6 +10,7 @@
#include <string.h>
#include "zlib.h"
#include "unzip.h"
+#include "mztools.h"
#define READ_8(adr) ((unsigned char)*(adr))
#define READ_16(adr) ( READ_8(adr) | (READ_8(adr+1) << 8) )
@@ -27,12 +28,9 @@
WRITE_16((unsigned char*)(buff) + 2, (n) >> 16); \
} while(0)
-extern int ZEXPORT unzRepair(file, fileOut, fileOutTmp, nRecovered, bytesRecovered)
-const char* file;
-const char* fileOut;
-const char* fileOutTmp;
-uLong* nRecovered;
-uLong* bytesRecovered;
+int ZEXPORT unzRepair(const char* file, const char* fileOut,
+ const char* fileOutTmp, uLong* nRecovered,
+ uLong* bytesRecovered)
{
int err = Z_OK;
FILE* fpZip = fopen(file, "rb");
@@ -147,8 +145,8 @@
/* Central directory entry */
{
char header[46];
- char* comment = "";
- int comsize = (int) strlen(comment);
+ const char* comment = "";
+ const size_t comsize = strlen(comment);
WRITE_32(header, 0x02014b50);
WRITE_16(header + 4, version);
WRITE_16(header + 6, version);
@@ -195,7 +193,7 @@
/* Comment field */
if (comsize > 0) {
- if ((int)fwrite(comment, 1, comsize, fpOutCD) == comsize) {
+ if (fwrite(comment, 1, comsize, fpOutCD) == comsize) {
offsetCD += comsize;
} else {
err = Z_ERRNO;
@@ -222,8 +220,8 @@
{
int entriesZip = entries;
char header[22];
- char* comment = ""; // "ZIP File recovered by zlib/minizip/mztools";
- int comsize = (int) strlen(comment);
+ const char* comment = ""; // "ZIP File recovered by zlib/minizip/mztools";
+ const size_t comsize = strlen(comment);
if (entriesZip > 0xffff) {
entriesZip = 0xffff;
}
@@ -241,7 +239,7 @@
/* Comment field */
if (comsize > 0) {
- if ((int)fwrite(comment, 1, comsize, fpOutCD) != comsize) {
+ if (fwrite(comment, 1, comsize, fpOutCD) != comsize) {
err = Z_ERRNO;
}
}

291
src/minizip/mztools.c.orig Normal file
View File

@@ -0,0 +1,291 @@
/*
Additional tools for Minizip
Code: Xavier Roche '2004
License: Same as ZLIB (www.gzip.org)
*/
/* Code */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "zlib.h"
#include "unzip.h"
#define READ_8(adr) ((unsigned char)*(adr))
#define READ_16(adr) ( READ_8(adr) | (READ_8(adr+1) << 8) )
#define READ_32(adr) ( READ_16(adr) | (READ_16((adr)+2) << 16) )
#define WRITE_8(buff, n) do { \
*((unsigned char*)(buff)) = (unsigned char) ((n) & 0xff); \
} while(0)
#define WRITE_16(buff, n) do { \
WRITE_8((unsigned char*)(buff), n); \
WRITE_8(((unsigned char*)(buff)) + 1, (n) >> 8); \
} while(0)
#define WRITE_32(buff, n) do { \
WRITE_16((unsigned char*)(buff), (n) & 0xffff); \
WRITE_16((unsigned char*)(buff) + 2, (n) >> 16); \
} while(0)
extern int ZEXPORT unzRepair(file, fileOut, fileOutTmp, nRecovered, bytesRecovered)
const char* file;
const char* fileOut;
const char* fileOutTmp;
uLong* nRecovered;
uLong* bytesRecovered;
{
int err = Z_OK;
FILE* fpZip = fopen(file, "rb");
FILE* fpOut = fopen(fileOut, "wb");
FILE* fpOutCD = fopen(fileOutTmp, "wb");
if (fpZip != NULL && fpOut != NULL) {
int entries = 0;
uLong totalBytes = 0;
char header[30];
char filename[1024];
char extra[1024];
int offset = 0;
int offsetCD = 0;
while ( fread(header, 1, 30, fpZip) == 30 ) {
int currentOffset = offset;
/* File entry */
if (READ_32(header) == 0x04034b50) {
unsigned int version = READ_16(header + 4);
unsigned int gpflag = READ_16(header + 6);
unsigned int method = READ_16(header + 8);
unsigned int filetime = READ_16(header + 10);
unsigned int filedate = READ_16(header + 12);
unsigned int crc = READ_32(header + 14); /* crc */
unsigned int cpsize = READ_32(header + 18); /* compressed size */
unsigned int uncpsize = READ_32(header + 22); /* uncompressed sz */
unsigned int fnsize = READ_16(header + 26); /* file name length */
unsigned int extsize = READ_16(header + 28); /* extra field length */
filename[0] = extra[0] = '\0';
/* Header */
if (fwrite(header, 1, 30, fpOut) == 30) {
offset += 30;
} else {
err = Z_ERRNO;
break;
}
/* Filename */
if (fnsize > 0) {
if (fnsize < sizeof(filename)) {
if (fread(filename, 1, fnsize, fpZip) == fnsize) {
if (fwrite(filename, 1, fnsize, fpOut) == fnsize) {
offset += fnsize;
} else {
err = Z_ERRNO;
break;
}
} else {
err = Z_ERRNO;
break;
}
} else {
err = Z_ERRNO;
break;
}
} else {
err = Z_STREAM_ERROR;
break;
}
/* Extra field */
if (extsize > 0) {
if (extsize < sizeof(extra)) {
if (fread(extra, 1, extsize, fpZip) == extsize) {
if (fwrite(extra, 1, extsize, fpOut) == extsize) {
offset += extsize;
} else {
err = Z_ERRNO;
break;
}
} else {
err = Z_ERRNO;
break;
}
} else {
err = Z_ERRNO;
break;
}
}
/* Data */
{
int dataSize = cpsize;
if (dataSize == 0) {
dataSize = uncpsize;
}
if (dataSize > 0) {
char* data = malloc(dataSize);
if (data != NULL) {
if ((int)fread(data, 1, dataSize, fpZip) == dataSize) {
if ((int)fwrite(data, 1, dataSize, fpOut) == dataSize) {
offset += dataSize;
totalBytes += dataSize;
} else {
err = Z_ERRNO;
}
} else {
err = Z_ERRNO;
}
free(data);
if (err != Z_OK) {
break;
}
} else {
err = Z_MEM_ERROR;
break;
}
}
}
/* Central directory entry */
{
char header[46];
char* comment = "";
int comsize = (int) strlen(comment);
WRITE_32(header, 0x02014b50);
WRITE_16(header + 4, version);
WRITE_16(header + 6, version);
WRITE_16(header + 8, gpflag);
WRITE_16(header + 10, method);
WRITE_16(header + 12, filetime);
WRITE_16(header + 14, filedate);
WRITE_32(header + 16, crc);
WRITE_32(header + 20, cpsize);
WRITE_32(header + 24, uncpsize);
WRITE_16(header + 28, fnsize);
WRITE_16(header + 30, extsize);
WRITE_16(header + 32, comsize);
WRITE_16(header + 34, 0); /* disk # */
WRITE_16(header + 36, 0); /* int attrb */
WRITE_32(header + 38, 0); /* ext attrb */
WRITE_32(header + 42, currentOffset);
/* Header */
if (fwrite(header, 1, 46, fpOutCD) == 46) {
offsetCD += 46;
/* Filename */
if (fnsize > 0) {
if (fwrite(filename, 1, fnsize, fpOutCD) == fnsize) {
offsetCD += fnsize;
} else {
err = Z_ERRNO;
break;
}
} else {
err = Z_STREAM_ERROR;
break;
}
/* Extra field */
if (extsize > 0) {
if (fwrite(extra, 1, extsize, fpOutCD) == extsize) {
offsetCD += extsize;
} else {
err = Z_ERRNO;
break;
}
}
/* Comment field */
if (comsize > 0) {
if ((int)fwrite(comment, 1, comsize, fpOutCD) == comsize) {
offsetCD += comsize;
} else {
err = Z_ERRNO;
break;
}
}
} else {
err = Z_ERRNO;
break;
}
}
/* Success */
entries++;
} else {
break;
}
}
/* Final central directory */
{
int entriesZip = entries;
char header[22];
char* comment = ""; // "ZIP File recovered by zlib/minizip/mztools";
int comsize = (int) strlen(comment);
if (entriesZip > 0xffff) {
entriesZip = 0xffff;
}
WRITE_32(header, 0x06054b50);
WRITE_16(header + 4, 0); /* disk # */
WRITE_16(header + 6, 0); /* disk # */
WRITE_16(header + 8, entriesZip); /* hack */
WRITE_16(header + 10, entriesZip); /* hack */
WRITE_32(header + 12, offsetCD); /* size of CD */
WRITE_32(header + 16, offset); /* offset to CD */
WRITE_16(header + 20, comsize); /* comment */
/* Header */
if (fwrite(header, 1, 22, fpOutCD) == 22) {
/* Comment field */
if (comsize > 0) {
if ((int)fwrite(comment, 1, comsize, fpOutCD) != comsize) {
err = Z_ERRNO;
}
}
} else {
err = Z_ERRNO;
}
}
/* Final merge (file + central directory) */
fclose(fpOutCD);
if (err == Z_OK) {
fpOutCD = fopen(fileOutTmp, "rb");
if (fpOutCD != NULL) {
int nRead;
char buffer[8192];
while ( (nRead = (int)fread(buffer, 1, sizeof(buffer), fpOutCD)) > 0) {
if ((int)fwrite(buffer, 1, nRead, fpOut) != nRead) {
err = Z_ERRNO;
break;
}
}
fclose(fpOutCD);
}
}
/* Close */
fclose(fpZip);
fclose(fpOut);
/* Wipe temporary file */
(void)remove(fileOutTmp);
/* Number of recovered entries */
if (err == Z_OK) {
if (nRecovered != NULL) {
*nRecovered = entries;
}
if (bytesRecovered != NULL) {
*bytesRecovered = totalBytes;
}
}
} else {
err = Z_STREAM_ERROR;
}
return err;
}

View File

@@ -238,7 +238,7 @@ local int add_data_in_datablock(linkedlist_data* ll, const void* buf, uLong len)
}
ldi = ll->last_block;
from_copy = (unsigned char*)buf;
from_copy = (const unsigned char*)buf;
while (len>0)
{
@@ -1416,7 +1416,7 @@ extern int ZEXPORT zipWriteInFileInZip (zipFile file,const void* buf,unsigned in
#ifdef HAVE_BZIP2
if(zi->ci.method == Z_BZIP2ED && (!zi->ci.raw))
{
zi->ci.bstream.next_in = (void*)buf;
zi->ci.bstream.next_in = buf;
zi->ci.bstream.avail_in = len;
err = BZ_RUN_OK;
@@ -1450,7 +1450,7 @@ extern int ZEXPORT zipWriteInFileInZip (zipFile file,const void* buf,unsigned in
else
#endif
{
zi->ci.stream.next_in = (Bytef*)buf;
zi->ci.stream.next_in = buf;
zi->ci.stream.avail_in = len;
while ((err==ZIP_OK) && (zi->ci.stream.avail_in>0))

View File

@@ -1,5 +1,5 @@
--- zip.c.orig 2013-02-24 08:32:30.000000000 +0100
+++ zip.c 2014-05-24 13:52:45.570151611 +0200
--- zip.c.orig 2014-06-10 18:55:32.778807408 +0200
+++ zip.c 2014-06-11 20:27:18.355848501 +0200
@@ -186,7 +186,7 @@
#include "crypt.h"
#endif
@@ -9,6 +9,15 @@
{
linkedlist_datablock_internal* ldi;
ldi = (linkedlist_datablock_internal*)
@@ -238,7 +238,7 @@
}
ldi = ll->last_block;
- from_copy = (unsigned char*)buf;
+ from_copy = (const unsigned char*)buf;
while (len>0)
{
@@ -637,7 +637,7 @@
return relativeOffset;
}
@@ -27,6 +36,24 @@
{
/* write the local header */
int err;
@@ -1416,7 +1416,7 @@
#ifdef HAVE_BZIP2
if(zi->ci.method == Z_BZIP2ED && (!zi->ci.raw))
{
- zi->ci.bstream.next_in = (void*)buf;
+ zi->ci.bstream.next_in = buf;
zi->ci.bstream.avail_in = len;
err = BZ_RUN_OK;
@@ -1450,7 +1450,7 @@
else
#endif
{
- zi->ci.stream.next_in = (Bytef*)buf;
+ zi->ci.stream.next_in = buf;
zi->ci.stream.avail_in = len;
while ((err==ZIP_OK) && (zi->ci.stream.avail_in>0))
@@ -1752,7 +1752,7 @@
return zipCloseFileInZipRaw (file,0,0);
}

2007
src/minizip/zip.c.orig Normal file

File diff suppressed because it is too large Load Diff

362
src/minizip/zip.h.orig Normal file
View File

@@ -0,0 +1,362 @@
/* zip.h -- IO on .zip files using zlib
Version 1.1, February 14h, 2010
part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
Modifications for Zip64 support
Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
For more info read MiniZip_info.txt
---------------------------------------------------------------------------
Condition of use and distribution are the same than zlib :
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
---------------------------------------------------------------------------
Changes
See header of zip.h
*/
#ifndef _zip12_H
#define _zip12_H
#ifdef __cplusplus
extern "C" {
#endif
//#define HAVE_BZIP2
#ifndef _ZLIB_H
#include "zlib.h"
#endif
#ifndef _ZLIBIOAPI_H
#include "ioapi.h"
#endif
#ifdef HAVE_BZIP2
#include "bzlib.h"
#endif
#define Z_BZIP2ED 12
#if defined(STRICTZIP) || defined(STRICTZIPUNZIP)
/* like the STRICT of WIN32, we define a pointer that cannot be converted
from (void*) without cast */
typedef struct TagzipFile__ { int unused; } zipFile__;
typedef zipFile__ *zipFile;
#else
typedef voidp zipFile;
#endif
#define ZIP_OK (0)
#define ZIP_EOF (0)
#define ZIP_ERRNO (Z_ERRNO)
#define ZIP_PARAMERROR (-102)
#define ZIP_BADZIPFILE (-103)
#define ZIP_INTERNALERROR (-104)
#ifndef DEF_MEM_LEVEL
# if MAX_MEM_LEVEL >= 8
# define DEF_MEM_LEVEL 8
# else
# define DEF_MEM_LEVEL MAX_MEM_LEVEL
# endif
#endif
/* default memLevel */
/* tm_zip contain date/time info */
typedef struct tm_zip_s
{
uInt tm_sec; /* seconds after the minute - [0,59] */
uInt tm_min; /* minutes after the hour - [0,59] */
uInt tm_hour; /* hours since midnight - [0,23] */
uInt tm_mday; /* day of the month - [1,31] */
uInt tm_mon; /* months since January - [0,11] */
uInt tm_year; /* years - [1980..2044] */
} tm_zip;
typedef struct
{
tm_zip tmz_date; /* date in understandable format */
uLong dosDate; /* if dos_date == 0, tmu_date is used */
/* uLong flag; */ /* general purpose bit flag 2 bytes */
uLong internal_fa; /* internal file attributes 2 bytes */
uLong external_fa; /* external file attributes 4 bytes */
} zip_fileinfo;
typedef const char* zipcharpc;
#define APPEND_STATUS_CREATE (0)
#define APPEND_STATUS_CREATEAFTER (1)
#define APPEND_STATUS_ADDINZIP (2)
extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append));
extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append));
/*
Create a zipfile.
pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on
an Unix computer "zlib/zlib113.zip".
if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip
will be created at the end of the file.
(useful if the file contain a self extractor code)
if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will
add files in existing zip (be sure you don't add file that doesn't exist)
If the zipfile cannot be opened, the return value is NULL.
Else, the return value is a zipFile Handle, usable with other function
of this zip package.
*/
/* Note : there is no delete function into a zipfile.
If you want delete file into a zipfile, you must open a zipfile, and create another
Of couse, you can use RAW reading and writing to copy the file you did not want delte
*/
extern zipFile ZEXPORT zipOpen2 OF((const char *pathname,
int append,
zipcharpc* globalcomment,
zlib_filefunc_def* pzlib_filefunc_def));
extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname,
int append,
zipcharpc* globalcomment,
zlib_filefunc64_def* pzlib_filefunc_def));
extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file,
const char* filename,
const zip_fileinfo* zipfi,
const void* extrafield_local,
uInt size_extrafield_local,
const void* extrafield_global,
uInt size_extrafield_global,
const char* comment,
int method,
int level));
extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file,
const char* filename,
const zip_fileinfo* zipfi,
const void* extrafield_local,
uInt size_extrafield_local,
const void* extrafield_global,
uInt size_extrafield_global,
const char* comment,
int method,
int level,
int zip64));
/*
Open a file in the ZIP for writing.
filename : the filename in zip (if NULL, '-' without quote will be used
*zipfi contain supplemental information
if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local
contains the extrafield data the the local header
if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global
contains the extrafield data the the local header
if comment != NULL, comment contain the comment string
method contain the compression method (0 for store, Z_DEFLATED for deflate)
level contain the level of compression (can be Z_DEFAULT_COMPRESSION)
zip64 is set to 1 if a zip64 extended information block should be added to the local file header.
this MUST be '1' if the uncompressed size is >= 0xffffffff.
*/
extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file,
const char* filename,
const zip_fileinfo* zipfi,
const void* extrafield_local,
uInt size_extrafield_local,
const void* extrafield_global,
uInt size_extrafield_global,
const char* comment,
int method,
int level,
int raw));
extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file,
const char* filename,
const zip_fileinfo* zipfi,
const void* extrafield_local,
uInt size_extrafield_local,
const void* extrafield_global,
uInt size_extrafield_global,
const char* comment,
int method,
int level,
int raw,
int zip64));
/*
Same than zipOpenNewFileInZip, except if raw=1, we write raw file
*/
extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file,
const char* filename,
const zip_fileinfo* zipfi,
const void* extrafield_local,
uInt size_extrafield_local,
const void* extrafield_global,
uInt size_extrafield_global,
const char* comment,
int method,
int level,
int raw,
int windowBits,
int memLevel,
int strategy,
const char* password,
uLong crcForCrypting));
extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file,
const char* filename,
const zip_fileinfo* zipfi,
const void* extrafield_local,
uInt size_extrafield_local,
const void* extrafield_global,
uInt size_extrafield_global,
const char* comment,
int method,
int level,
int raw,
int windowBits,
int memLevel,
int strategy,
const char* password,
uLong crcForCrypting,
int zip64
));
/*
Same than zipOpenNewFileInZip2, except
windowBits,memLevel,,strategy : see parameter strategy in deflateInit2
password : crypting password (NULL for no crypting)
crcForCrypting : crc of file to compress (needed for crypting)
*/
extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file,
const char* filename,
const zip_fileinfo* zipfi,
const void* extrafield_local,
uInt size_extrafield_local,
const void* extrafield_global,
uInt size_extrafield_global,
const char* comment,
int method,
int level,
int raw,
int windowBits,
int memLevel,
int strategy,
const char* password,
uLong crcForCrypting,
uLong versionMadeBy,
uLong flagBase
));
extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file,
const char* filename,
const zip_fileinfo* zipfi,
const void* extrafield_local,
uInt size_extrafield_local,
const void* extrafield_global,
uInt size_extrafield_global,
const char* comment,
int method,
int level,
int raw,
int windowBits,
int memLevel,
int strategy,
const char* password,
uLong crcForCrypting,
uLong versionMadeBy,
uLong flagBase,
int zip64
));
/*
Same than zipOpenNewFileInZip4, except
versionMadeBy : value for Version made by field
flag : value for flag field (compression level info will be added)
*/
extern int ZEXPORT zipWriteInFileInZip OF((zipFile file,
const void* buf,
unsigned len));
/*
Write data in the zipfile
*/
extern int ZEXPORT zipCloseFileInZip OF((zipFile file));
/*
Close the current file in the zipfile
*/
extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file,
uLong uncompressed_size,
uLong crc32));
extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file,
ZPOS64_T uncompressed_size,
uLong crc32));
/*
Close the current file in the zipfile, for file opened with
parameter raw=1 in zipOpenNewFileInZip2
uncompressed_size and crc32 are value for the uncompressed size
*/
extern int ZEXPORT zipClose OF((zipFile file,
const char* global_comment));
/*
Close the zipfile
*/
extern int ZEXPORT zipRemoveExtraInfoBlock OF((char* pData, int* dataLen, short sHeader));
/*
zipRemoveExtraInfoBlock - Added by Mathias Svensson
Remove extra information block from a extra information data for the local file header or central directory header
It is needed to remove ZIP64 extra information blocks when before data is written if using RAW mode.
0x0001 is the signature header for the ZIP64 extra information blocks
usage.
Remove ZIP64 Extra information from a central director extra field data
zipRemoveExtraInfoBlock(pCenDirExtraFieldData, &nCenDirExtraFieldDataLen, 0x0001);
Remove ZIP64 Extra information from a Local File Header extra field data
zipRemoveExtraInfoBlock(pLocalHeaderExtraFieldData, &nLocalHeaderExtraFieldDataLen, 0x0001);
*/
#ifdef __cplusplus
}
#endif
#endif /* _zip64_H */

View File

@@ -7,7 +7,19 @@
// compile and run any of them on any platform, but your performance with the
// non-native version will be less than optimal.
#ifdef _WIN32
#include <stddef.h>
typedef __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
#elif (defined(SOLARIS) || defined(sun) || defined(HAVE_INTTYPES_H) \
|| defined(BSD) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD_kernel__))
#include <inttypes.h>
#else
#include <stdint.h>
#endif
static uint32_t rotl32 ( uint32_t x, int8_t r )
{

22
src/murmurhash3.h.diff Normal file
View File

@@ -0,0 +1,22 @@
--- murmurhash3.h.orig 2014-06-14 14:29:11.562576736 +0200
+++ murmurhash3.h 2014-06-14 14:39:43.989624584 +0200
@@ -7,7 +7,19 @@
// compile and run any of them on any platform, but your performance with the
// non-native version will be less than optimal.
+#ifdef _WIN32
+#include <stddef.h>
+typedef __int8 int8_t;
+typedef unsigned __int8 uint8_t;
+typedef unsigned __int16 uint16_t;
+typedef unsigned __int32 uint32_t;
+typedef unsigned __int64 uint64_t;
+#elif (defined(SOLARIS) || defined(sun) || defined(HAVE_INTTYPES_H) \
+ || defined(BSD) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD_kernel__))
+#include <inttypes.h>
+#else
#include <stdint.h>
+#endif
static uint32_t rotl32 ( uint32_t x, int8_t r )
{

127
src/murmurhash3.h.orig Normal file
View File

@@ -0,0 +1,127 @@
//-----------------------------------------------------------------------------
// MurmurHash3 was written by Austin Appleby, and is placed in the public
// domain. The author hereby disclaims copyright to this source code.
// Note - The x86 and x64 versions do _not_ produce the same results, as the
// algorithms are optimized for their respective platforms. You can still
// compile and run any of them on any platform, but your performance with the
// non-native version will be less than optimal.
#include <stdint.h>
static uint32_t rotl32 ( uint32_t x, int8_t r )
{
return (x << r) | (x >> (32 - r));
}
#define ROTL32(x,y) rotl32(x,y)
static uint32_t getblock32 ( const uint32_t * p, int i )
{
return p[i];
}
static uint32_t fmix32 ( uint32_t h )
{
h ^= h >> 16;
h *= 0x85ebca6b;
h ^= h >> 13;
h *= 0xc2b2ae35;
h ^= h >> 16;
return h;
}
#define BIG_CONSTANT(x) (x##LLU)
static void MurmurHash3_x86_128 ( const void * key, const int len,
uint32_t seed, void * out ) {
const uint8_t * data = (const uint8_t*)key;
const int nblocks = len / 16;
uint32_t h1 = seed;
uint32_t h2 = seed;
uint32_t h3 = seed;
uint32_t h4 = seed;
const uint32_t c1 = 0x239b961b;
const uint32_t c2 = 0xab0e9789;
const uint32_t c3 = 0x38b34ae5;
const uint32_t c4 = 0xa1e38b93;
const uint32_t * blocks = (const uint32_t *)(data + nblocks*16);
int i;
for(i = -nblocks; i; i++)
{
uint32_t k1 = getblock32(blocks,i*4+0);
uint32_t k2 = getblock32(blocks,i*4+1);
uint32_t k3 = getblock32(blocks,i*4+2);
uint32_t k4 = getblock32(blocks,i*4+3);
k1 *= c1; k1 = ROTL32(k1,15); k1 *= c2; h1 ^= k1;
h1 = ROTL32(h1,19); h1 += h2; h1 = h1*5+0x561ccd1b;
k2 *= c2; k2 = ROTL32(k2,16); k2 *= c3; h2 ^= k2;
h2 = ROTL32(h2,17); h2 += h3; h2 = h2*5+0x0bcaa747;
k3 *= c3; k3 = ROTL32(k3,17); k3 *= c4; h3 ^= k3;
h3 = ROTL32(h3,15); h3 += h4; h3 = h3*5+0x96cd1c35;
k4 *= c4; k4 = ROTL32(k4,18); k4 *= c1; h4 ^= k4;
h4 = ROTL32(h4,13); h4 += h1; h4 = h4*5+0x32ac3b17;
}
{
const uint8_t * tail = (const uint8_t*)(data + nblocks*16);
uint32_t k1 = 0;
uint32_t k2 = 0;
uint32_t k3 = 0;
uint32_t k4 = 0;
switch(len & 15)
{
case 15: k4 ^= tail[14] << 16;
case 14: k4 ^= tail[13] << 8;
case 13: k4 ^= tail[12] << 0;
k4 *= c4; k4 = ROTL32(k4,18); k4 *= c1; h4 ^= k4;
case 12: k3 ^= tail[11] << 24;
case 11: k3 ^= tail[10] << 16;
case 10: k3 ^= tail[ 9] << 8;
case 9: k3 ^= tail[ 8] << 0;
k3 *= c3; k3 = ROTL32(k3,17); k3 *= c4; h3 ^= k3;
case 8: k2 ^= tail[ 7] << 24;
case 7: k2 ^= tail[ 6] << 16;
case 6: k2 ^= tail[ 5] << 8;
case 5: k2 ^= tail[ 4] << 0;
k2 *= c2; k2 = ROTL32(k2,16); k2 *= c3; h2 ^= k2;
case 4: k1 ^= tail[ 3] << 24;
case 3: k1 ^= tail[ 2] << 16;
case 2: k1 ^= tail[ 1] << 8;
case 1: k1 ^= tail[ 0] << 0;
k1 *= c1; k1 = ROTL32(k1,15); k1 *= c2; h1 ^= k1;
};
h1 ^= len; h2 ^= len; h3 ^= len; h4 ^= len;
h1 += h2; h1 += h3; h1 += h4;
h2 += h1; h3 += h1; h4 += h1;
h1 = fmix32(h1);
h2 = fmix32(h2);
h3 = fmix32(h3);
h4 = fmix32(h4);
h1 += h2; h1 += h3; h1 += h4;
h2 += h1; h3 += h1; h4 += h1;
((uint32_t*)out)[0] = h1;
((uint32_t*)out)[1] = h2;
((uint32_t*)out)[2] = h3;
((uint32_t*)out)[3] = h4;
}
}

View File

@@ -129,7 +129,7 @@ Remark: If no cache newer than the added one is found, all entries can be added
#include "htsglobal.h"
/* htsweb */
#include "htsinthash.h"
#include "coucal.h"
/* ProxyTrack */
#include "proxytrack.h"

View File

@@ -45,7 +45,7 @@ static long int timezone = 0;
#include "htsglobal.h"
#define HTS_INTERNAL_BYTECODE
#include "htsinthash.h"
#include "coucal.h"
#include "htsmd5.h"
#undef HTS_INTERNAL_BYTECODE
#include "../minizip/mztools.h"
@@ -168,7 +168,7 @@ static _PT_Index_Functions _IndexFuncts[] = {
#define PT_INDEX_COMMON_STRUCTURE \
time_t timestamp; \
inthash hash; \
coucal hash; \
char startUrl[1024]
struct _PT_Index__New {
@@ -216,7 +216,7 @@ struct _PT_Index {
};
struct _PT_Indexes {
inthash cil;
coucal cil;
struct _PT_Index **index;
int index_size;
};
@@ -228,7 +228,7 @@ struct _PT_CacheItem {
};
struct _PT_Cache {
inthash index;
coucal index;
size_t maxSize;
size_t totalSize;
int count;
@@ -237,8 +237,8 @@ struct _PT_Cache {
PT_Indexes PT_New(void) {
PT_Indexes index = (PT_Indexes) calloc(sizeof(_PT_Indexes), 1);
index->cil = inthash_new(0);
inthash_set_name(index->cil, "index->cil");
index->cil = coucal_new(0);
coucal_set_name(index->cil, "index->cil");
index->index_size = 0;
index->index = NULL;
return index;
@@ -246,7 +246,7 @@ PT_Indexes PT_New(void) {
void PT_Delete(PT_Indexes index) {
if (index != NULL) {
inthash_delete(&index->cil);
coucal_delete(&index->cil);
free(index);
}
}
@@ -322,7 +322,7 @@ static void PT_Index_Delete__New(PT_Index * pindex) {
index->zFile = NULL;
}
if (index->hash != NULL) {
inthash_delete(&index->hash);
coucal_delete(&index->hash);
index->hash = NULL;
}
MutexFree(&index->zFileLock);
@@ -340,7 +340,7 @@ static void PT_Index_Delete__Old(PT_Index * pindex) {
fclose(index->ndx);
}
if (index->hash != NULL) {
inthash_delete(&index->hash);
coucal_delete(&index->hash);
index->hash = NULL;
}
MutexFree(&index->fileLock);
@@ -429,13 +429,13 @@ char **PT_Enumerate(PT_Indexes indexes, const char *url, int subtree) {
String listindexes = STRING_EMPTY;
String subitem = STRING_EMPTY;
unsigned int listCount = 0;
struct_inthash_enum en = inthash_enum_new(indexes->cil);
inthash_chain *chain;
inthash hdupes = NULL;
struct_coucal_enum en = coucal_enum_new(indexes->cil);
coucal_item *chain;
coucal hdupes = NULL;
if (!subtree) {
hdupes = inthash_new(0);
inthash_set_name(hdupes, "hdupes");
hdupes = coucal_new(0);
coucal_set_name(hdupes, "hdupes");
}
StringClear(list);
StringClear(listindexes);
@@ -443,12 +443,12 @@ char **PT_Enumerate(PT_Indexes indexes, const char *url, int subtree) {
if (strncmp(url, "http://", 7) == 0)
url += 7;
urlSize = (unsigned int) strlen(url);
while((chain = inthash_enum_next(&en))) {
while((chain = coucal_enum_next(&en))) {
long int index = (long int) chain->value.intg;
if (urlSize == 0 || strncmp(chain->name, url, urlSize) == 0) {
if (index >= 0 && index < indexes->index_size) {
char *item = chain->name + urlSize;
char *item = (char*) chain->name + urlSize;
if (*item == '/')
item++;
@@ -462,7 +462,7 @@ char **PT_Enumerate(PT_Indexes indexes, const char *url, int subtree) {
StringClear(subitem);
if (len > 0)
StringMemcat(subitem, item, len);
if (len == 0 || !inthash_exists(hdupes, StringBuff(subitem))) {
if (len == 0 || !coucal_exists(hdupes, StringBuff(subitem))) {
char *ptr = NULL;
ptr += StringLength(list);
@@ -473,7 +473,7 @@ char **PT_Enumerate(PT_Indexes indexes, const char *url, int subtree) {
StringMemcat(list, "\0", 1); /* NULL terminated strings */
StringMemcat(listindexes, (char*) &ptr, sizeof(ptr));
listCount++;
inthash_write(hdupes, StringBuff(subitem), 0);
coucal_write(hdupes, StringBuff(subitem), 0);
}
}
}
@@ -484,7 +484,7 @@ char **PT_Enumerate(PT_Indexes indexes, const char *url, int subtree) {
}
}
StringFree(subitem);
inthash_delete(&hdupes);
coucal_delete(&hdupes);
if (listCount > 0) {
unsigned int i;
void *blk;
@@ -553,8 +553,8 @@ PT_Index PT_LoadCache(const char *filename) {
index->type = type;
index->slots.common.timestamp = (time_t) time(NULL);
index->slots.common.startUrl[0] = '\0';
index->slots.common.hash = inthash_new(0);
inthash_set_name(index->slots.common.hash, "index->slots.common.hash");
index->slots.common.hash = coucal_new(0);
coucal_set_name(index->slots.common.hash, "index->slots.common.hash");
if (!_IndexFuncts[type].PT_LoadCache(index, filename)) {
proxytrack_print_log(DEBUG,
"reading httrack cache (format #%d) %s : error",
@@ -569,12 +569,12 @@ PT_Index PT_LoadCache(const char *filename) {
}
/* default starting URL is the first hash entry */
if (index->slots.common.startUrl[0] == '\0') {
struct_inthash_enum en = inthash_enum_new(index->slots.common.hash);
inthash_chain *chain;
struct_coucal_enum en = coucal_enum_new(index->slots.common.hash);
coucal_item *chain;
chain = inthash_enum_next(&en);
chain = coucal_enum_next(&en);
if (chain != NULL && strstr(chain->name, "/robots.txt") != NULL) {
chain = inthash_enum_next(&en);
chain = coucal_enum_next(&en);
}
if (chain != NULL) {
if (!link_has_authority(chain->name))
@@ -625,10 +625,10 @@ int PT_EnumCache(PT_Indexes indexes,
int (*callback) (void *, const char *url, PT_Element),
void *arg) {
if (indexes != NULL && indexes->cil != NULL) {
struct_inthash_enum en = inthash_enum_new(indexes->cil);
inthash_chain *chain;
struct_coucal_enum en = coucal_enum_new(indexes->cil);
coucal_item *chain;
while((chain = inthash_enum_next(&en))) {
while((chain = coucal_enum_next(&en))) {
const long int index_id = (long int) chain->value.intg;
const char *const url = chain->name;
@@ -677,7 +677,7 @@ static int PT_LookupCache__New_u(PT_Index index_, const char *url) {
if (strncmp(url, "http://", 7) == 0)
url += 7;
hash_pos_return = inthash_read(index->hash, url, NULL);
hash_pos_return = coucal_read(index->hash, url, NULL);
if (hash_pos_return)
return 1;
}
@@ -689,8 +689,8 @@ int PT_IndexMerge(PT_Indexes indexes, PT_Index * pindex) {
if (pindex != NULL && *pindex != NULL && (*pindex)->slots.common.hash != NULL
&& indexes != NULL) {
PT_Index index = *pindex;
struct_inthash_enum en = inthash_enum_new(index->slots.common.hash);
inthash_chain *chain;
struct_coucal_enum en = coucal_enum_new(index->slots.common.hash);
coucal_item *chain;
int index_id = indexes->index_size++;
int nMerged = 0;
@@ -699,13 +699,13 @@ int PT_IndexMerge(PT_Indexes indexes, PT_Index * pindex) {
sizeof(struct _PT_Index) * indexes->index_size)) != NULL) {
indexes->index[index_id] = index;
*pindex = NULL;
while((chain = inthash_enum_next(&en)) != NULL) {
while((chain = coucal_enum_next(&en)) != NULL) {
const char *url = chain->name;
if (url != NULL && url[0] != '\0') {
intptr_t previous_index_id = 0;
if (inthash_read(indexes->cil, url, &previous_index_id)) {
if (coucal_read(indexes->cil, url, &previous_index_id)) {
if (previous_index_id >= 0
&& previous_index_id < indexes->index_size) {
if (indexes->index[previous_index_id]->slots.common.timestamp > index->slots.common.timestamp) // existing entry is newer
@@ -715,7 +715,7 @@ int PT_IndexMerge(PT_Indexes indexes, PT_Index * pindex) {
"PT_IndexMerge:Corrupted central index locator");
}
}
inthash_write(indexes->cil, chain->name, index_id);
coucal_write(indexes->cil, chain->name, index_id);
nMerged++;
}
}
@@ -756,7 +756,7 @@ PT_Element PT_ReadIndex(PT_Indexes indexes, const char *url, int flags) {
if (strncmp(url, "http://", 7) == 0)
url += 7;
if (inthash_read(indexes->cil, url, &index_id)) {
if (coucal_read(indexes->cil, url, &index_id)) {
if (index_id >= 0 && index_id <= indexes->index_size) {
PT_Element item = PT_ReadCache(indexes->index[index_id], url, flags);
@@ -779,7 +779,7 @@ int PT_LookupIndex(PT_Indexes indexes, const char *url) {
if (strncmp(url, "http://", 7) == 0)
url += 7;
if (inthash_read(indexes->cil, url, &index_id)) {
if (coucal_read(indexes->cil, url, &index_id)) {
if (index_id >= 0 && index_id <= indexes->index_size) {
return 1;
} else {
@@ -890,7 +890,7 @@ int PT_LoadCache__New(PT_Index index_, const char *filename) {
if (zFile != NULL) {
const char *abpath;
int slashes;
inthash hashtable = index->hash;
coucal hashtable = index->hash;
/* Compute base path for this index - the filename MUST be absolute! */
for(slashes = 2, abpath = filename + (int) strlen(filename) - 1;
@@ -960,9 +960,9 @@ int PT_LoadCache__New(PT_Index index_, const char *filename) {
}
}
if (dataincache)
inthash_add(hashtable, filenameIndex, pos);
coucal_add(hashtable, filenameIndex, pos);
else
inthash_add(hashtable, filenameIndex, -pos);
coucal_add(hashtable, filenameIndex, -pos);
/* First link as starting URL */
if (!firstSeen) {
@@ -987,7 +987,7 @@ int PT_LoadCache__New(PT_Index index_, const char *filename) {
} while(unzGoToNextFile(zFile) == Z_OK);
return 1;
} else {
inthash_delete(&index->hash);
coucal_delete(&index->hash);
index = NULL;
}
} else {
@@ -1020,7 +1020,7 @@ static PT_Element PT_ReadCache__New_u(PT_Index index_, const char *url,
strcpy(r->location, "");
if (strncmp(url, "http://", 7) == 0)
url += 7;
hash_pos_return = inthash_read(index->hash, url, &hash_pos);
hash_pos_return = coucal_read(index->hash, url, &hash_pos);
if (hash_pos_return) {
uLong posInZip;
@@ -1523,7 +1523,7 @@ static int PT_LoadCache__Old(PT_Index index_, const char *filename) {
sscanf(linepos, "%d", &pos);
/* Add entry */
inthash_add(cache->hash, line, pos);
coucal_add(cache->hash, line, pos);
/* First link as starting URL */
if (!firstSeen) {
@@ -1614,7 +1614,7 @@ static PT_Element PT_ReadCache__Old_u(PT_Index index_, const char *url,
strcpy(r->location, "");
if (strncmp(url, "http://", 7) == 0)
url += 7;
hash_pos_return = inthash_read(cache->hash, url, &hash_pos);
hash_pos_return = coucal_read(cache->hash, url, &hash_pos);
if (hash_pos_return) {
int pos = (int) hash_pos; /* simply */
@@ -1848,7 +1848,7 @@ static int PT_LookupCache__Old_u(PT_Index index_, const char *url) {
return 0;
if (strncmp(url, "http://", 7) == 0)
url += 7;
if (inthash_read(cache->hash, url, NULL))
if (coucal_read(cache->hash, url, NULL))
return 1;
}
return 0;
@@ -2002,7 +2002,7 @@ int PT_LoadCache__Arc(PT_Index index_, const char *filename) {
// Opened ?
if (index->file != NULL) {
inthash hashtable = index->hash;
coucal hashtable = index->hash;
if (readArcURLRecord(index) == 0) {
int entries = 0;
@@ -2046,7 +2046,7 @@ int PT_LoadCache__Arc(PT_Index index_, const char *filename) {
}
/*fprintf(stdout, "adding %s [%d]\n", filenameIndex, (int)fpos); */
if (PT_CompatibleScheme(index->filenameIndexBuff)) {
inthash_add(hashtable, filenameIndex, fpos); /* position of meta-data */
coucal_add(hashtable, filenameIndex, fpos); /* position of meta-data */
entries++;
}
} else {
@@ -2123,7 +2123,7 @@ static PT_Element PT_ReadCache__Arc_u(PT_Index index_, const char *url,
strcpy(r->location, "");
if (strncmp(url, "http://", 7) == 0)
url += 7;
hash_pos_return = inthash_read(index->hash, url, &hash_pos);
hash_pos_return = coucal_read(index->hash, url, &hash_pos);
if (hash_pos_return) {
if (fseek(index->file, (long) hash_pos, SEEK_SET) == 0) {
@@ -2266,7 +2266,7 @@ static int PT_LookupCache__Arc_u(PT_Index index_, const char *url) {
return 0;
if (strncmp(url, "http://", 7) == 0)
url += 7;
if (inthash_read(cache->hash, url, NULL))
if (coucal_read(cache->hash, url, NULL))
return 1;
}
return 0;