diff options
Diffstat (limited to 'libtest')
-rw-r--r-- | libtest/Makefile.am | 5 | ||||
-rw-r--r-- | libtest/Makefile.in | 307 | ||||
-rwxr-xr-x | libtest/callbacks-example.c | 73 | ||||
-rw-r--r-- | libtest/example.c | 158 | ||||
-rw-r--r-- | libtest/example.dsp | 95 | ||||
-rw-r--r-- | libtest/example.dsw | 29 | ||||
-rw-r--r-- | libtest/example.h | 27 | ||||
-rw-r--r-- | libtest/htssystem.h | 2 | ||||
-rw-r--r-- | libtest/readme.txt | 34 |
9 files changed, 730 insertions, 0 deletions
diff --git a/libtest/Makefile.am b/libtest/Makefile.am new file mode 100644 index 0000000..9bd2fe7 --- /dev/null +++ b/libtest/Makefile.am @@ -0,0 +1,5 @@ + +exemplesdir = $(datadir)/httrack/libtest +exemples_DATA = *.c *.h *.txt *.dsp *.dsw + +EXTRA_DIST = $(exemples_DATA) diff --git a/libtest/Makefile.in b/libtest/Makefile.in new file mode 100644 index 0000000..701bef3 --- /dev/null +++ b/libtest/Makefile.in @@ -0,0 +1,307 @@ +# Makefile.in generated by automake 1.7 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_triplet = @host@ +ACLOCAL = @ACLOCAL@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFAULT_CFLAGS = @DEFAULT_CFLAGS@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DL_LIBS = @DL_LIBS@ +ECHO = @ECHO@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LFS_FLAG = @LFS_FLAG@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SOCKET_LIBS = @SOCKET_LIBS@ +STRIP = @STRIP@ +THREADS_CFLAGS = @THREADS_CFLAGS@ +THREADS_LIBS = @THREADS_LIBS@ +V6_FLAG = @V6_FLAG@ +VERSION = @VERSION@ +VERSION_INFO = @VERSION_INFO@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ +am__quote = @am__quote@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ + +exemplesdir = $(datadir)/httrack/libtest +exemples_DATA = *.c *.h *.txt *.dsp *.dsw + +EXTRA_DIST = $(exemples_DATA) +subdir = libtest +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = +DATA = $(exemples_DATA) + +DIST_COMMON = Makefile.am Makefile.in +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu libtest/Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +exemplesDATA_INSTALL = $(INSTALL_DATA) +install-exemplesDATA: $(exemples_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(exemplesdir) + @list='$(exemples_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(exemplesDATA_INSTALL) $$d$$p $(DESTDIR)$(exemplesdir)/$$f"; \ + $(exemplesDATA_INSTALL) $$d$$p $(DESTDIR)$(exemplesdir)/$$f; \ + done + +uninstall-exemplesDATA: + @$(NORMAL_UNINSTALL) + @list='$(exemples_DATA)'; for p in $$list; do \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " rm -f $(DESTDIR)$(exemplesdir)/$$f"; \ + rm -f $(DESTDIR)$(exemplesdir)/$$f; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) + +installdirs: + $(mkinstalldirs) $(DESTDIR)$(exemplesdir) + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-generic distclean-libtool + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: install-exemplesDATA + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-exemplesDATA uninstall-info-am + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am \ + install-exemplesDATA install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-exemplesDATA uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/libtest/callbacks-example.c b/libtest/callbacks-example.c new file mode 100755 index 0000000..3364969 --- /dev/null +++ b/libtest/callbacks-example.c @@ -0,0 +1,73 @@ +/*
+ HTTrack external callbacks example
+ .c file
+
+ How to use:
+ - compile this file as a module (callback.so or callback.dll)
+ example:
+ (with gcc)
+ gcc -O -g3 -Wall -D_REENTRANT -DINET6 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -shared -o callback.so callbacks-example.c
+ or (with visual c++)
+ cl -LD -nologo -W3 -Zi -Zp4 -DWIN32 -Fe"callback.dll" callbacks-example.c
+ - use the --wrapper option in httrack:
+ httrack --wrapper check-html=callback:process_file
+ --wrapper link-detected=callback:check_detectedlink
+ --wrapper loop=callback:check_loop
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* "External" */
+#ifdef _WIN32
+#define EXTERNAL_FUNCTION __declspec(dllexport)
+#else
+#define EXTERNAL_FUNCTION
+#endif
+
+/*
+ This sample just lists all links in documents with the parent link:
+ <parent> -> <link>
+ This sample can be improved, for example, to make a map of a website.
+*/
+
+static char currentURLBeingParsed[2048];
+
+/*
+"check-html" callback
+typedef int (* t_hts_htmlcheck)(char* html,int len,char* url_adresse,char* url_fichier);
+*/
+EXTERNAL_FUNCTION int process_file(char* html, int len, char* url_adresse, char* url_fichier) {
+ printf("now parsing %s%s..\n", url_adresse, url_fichier);
+ strcpy(currentURLBeingParsed, url_adresse);
+ strcat(currentURLBeingParsed, url_fichier);
+ return 1; /* success */
+}
+
+/*
+"link-detected" callback
+typedef int (* t_hts_htmlcheck_linkdetected)(char* link);
+*/
+EXTERNAL_FUNCTION int check_detectedlink(char* link) {
+ printf("[%s] -> [%s]\n", currentURLBeingParsed, link);
+ return 1; /* success */
+}
+
+/*
+"loop" callback
+typedef int (* t_hts_htmlcheck_loop)(void* back,int back_max,int back_index,int lien_tot,int lien_ntot,int stat_time,void* stats);
+*/
+EXTERNAL_FUNCTION int check_loop(void* back,int back_max,int back_index,int lien_tot,int lien_ntot,int stat_time,void* stats) {
+ static int fun_animation=0;
+ printf("%c\r", "/-\\|"[(fun_animation++)%4]);
+ return 1;
+}
+
+/*
+a default callback for testing purpose
+*/
+EXTERNAL_FUNCTION int check_void(void) {
+ printf("\n* * * default callback function called! * * *\n\n");
+ return 1;
+}
diff --git a/libtest/example.c b/libtest/example.c new file mode 100644 index 0000000..3361872 --- /dev/null +++ b/libtest/example.c @@ -0,0 +1,158 @@ +/*
+ HTTrack library example
+ .c file
+
+ To Build on Windows:
+ - install winhttrack
+ - set the proper path in the project settings (especially for the httrack lib and dll)
+ - compile in multithreaded DLL
+ - avoid precompiled headers with VC
+
+ To Build on Linux:
+ - install httrack
+ - link with libhttrack.so and compile using something like:
+ gcc example.c -I/usr/include/httrack -lhttrack
+*/
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "httrack-library.h"
+
+#include "example.h"
+
+
+
+/*
+ * Name: main
+ * Description: main() function
+ * Parameters: None
+ * Should return: error status
+*/
+int main(void) {
+ /*
+ First, ask for an URL
+ Note: For the test, option r2 (mirror max depth=1) and --testscan (no index, no cache, do not store, no log files)
+ */
+ char _argv[][256] = {"httrack_test" , "<URL>" , "-r3" , "--testscan" , "" };
+ char* argv[] = {NULL , NULL , NULL , NULL , NULL};
+ int argc = 0;
+ while(strlen(_argv[argc])) {
+ argv[argc]=_argv[argc];
+ argc++;
+ }
+ argv[argc]=NULL;
+ printf("HTTrackLib test program\n");
+ printf("Enter URL (example: www.foobar.com/index.html) :");
+ scanf("%s",argv[1]);
+ printf("Test: 1 depth\n");
+
+ hts_init();
+ htswrap_add("init",httrack_wrapper_init);
+ htswrap_add("free",httrack_wrapper_uninit);
+ htswrap_add("start",httrack_wrapper_start);
+ htswrap_add("change-options",httrack_wrapper_chopt);
+ htswrap_add("end",httrack_wrapper_end);
+ htswrap_add("check-html",httrack_wrapper_checkhtml);
+ htswrap_add("loop",httrack_wrapper_loop);
+ htswrap_add("query",httrack_wrapper_query);
+ htswrap_add("query2",httrack_wrapper_query2);
+ htswrap_add("query3",httrack_wrapper_query3);
+ htswrap_add("check-link",httrack_wrapper_check);
+ htswrap_add("pause",httrack_wrapper_pause);
+ htswrap_add("save-file",httrack_wrapper_filesave);
+ htswrap_add("link-detected",httrack_wrapper_linkdetected);
+ htswrap_add("transfer-status",httrack_wrapper_xfrstatus);
+
+ /* Then, launch the mirror */
+ hts_main(argc,argv);
+
+ /* Wait for a key */
+ printf("\nPress ENTER key to exit\n");
+ scanf("%s",argv[1]);
+
+ /* That's all! */
+ return 0;
+}
+
+
+/* CALLBACK FUNCTIONS */
+
+/* Initialize the Winsock */
+void CDECL httrack_wrapper_init(void) {
+ printf("Engine started\n");
+#ifdef _WIN32
+ {
+ WORD wVersionRequested; // requested version WinSock API
+ WSADATA wsadata; // Windows Sockets API data
+ int stat;
+ wVersionRequested = 0x0101;
+ stat = WSAStartup( wVersionRequested, &wsadata );
+ if (stat != 0) {
+ printf("Winsock not found!\n");
+ return;
+ } else if (LOBYTE(wsadata.wVersion) != 1 && HIBYTE(wsadata.wVersion) != 1) {
+ printf("WINSOCK.DLL does not support version 1.1\n");
+ WSACleanup();
+ return;
+ }
+ }
+#endif
+
+}
+void CDECL httrack_wrapper_uninit(void) {
+ printf("Engine exited\n");
+#ifdef _WIN32
+ WSACleanup();
+#endif
+}
+int CDECL httrack_wrapper_start(httrackp* opt) {
+ printf("Start of mirror\n");
+ return 1;
+}
+int CDECL httrack_wrapper_chopt(httrackp* opt) {
+ return CDECL httrack_wrapper_start(opt);
+}
+int CDECL httrack_wrapper_end(void) {
+ printf("End of mirror\n");
+ return 1;
+}
+int CDECL httrack_wrapper_checkhtml(char* html,int len,char* url_adresse,char* url_fichier) {
+ printf("Parsing html file: http://%s%s\n",url_adresse,url_fichier);
+ return 1;
+}
+int CDECL httrack_wrapper_loop(void* _back,int back_max,int back_index,int lien_n,int lien_tot,int stat_time,hts_stat_struct* stats) {
+ /* printf("..httrack_wrapper_loop called\n"); */
+ return 1;
+}
+char* CDECL httrack_wrapper_query(char* question) {
+ /* Answer is No */
+ return "N";
+}
+char* CDECL httrack_wrapper_query2(char* question) {
+ /* Answer is No */
+ return "N";
+}
+char* CDECL httrack_wrapper_query3(char* question) {
+ /* Answer is "" */
+ return "";
+}
+int CDECL httrack_wrapper_check(char* adr,char* fil,int status) {
+ printf("Link status tested: http://%s%s\n",adr,fil);
+ return -1;
+}
+void CDECL httrack_wrapper_pause(char* lockfile) {
+ /* Wait until lockfile is removed.. */
+}
+void CDECL httrack_wrapper_filesave(char* file) {
+}
+int CDECL httrack_wrapper_linkdetected(char* link) {
+ printf("Link detected: %s\n",link);
+ return 1;
+}
+int CDECL httrack_wrapper_xfrstatus(void* back) {
+ return 1;
+}
+
diff --git a/libtest/example.dsp b/libtest/example.dsp new file mode 100644 index 0000000..0f87ae0 --- /dev/null +++ b/libtest/example.dsp @@ -0,0 +1,95 @@ +# Microsoft Developer Studio Project File - Name="example" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=example - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "example.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "example.mak" CFG="example - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "example - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "example - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "example - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "C:\Dev" /I "C:\Dev\IPv6Kit\inc" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x40c /d "NDEBUG"
+# ADD RSC /l 0x40c /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 wsock32.lib libhttrack.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "example - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "C:\Dev\IPv6Kit\inc" /I "C:\Dev" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x40c /d "_DEBUG"
+# ADD RSC /l 0x40c /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 wsock32.lib libhttrack.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "example - Win32 Release"
+# Name "example - Win32 Debug"
+# Begin Source File
+
+SOURCE=.\example.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\example.h
+# End Source File
+# End Target
+# End Project
diff --git a/libtest/example.dsw b/libtest/example.dsw new file mode 100644 index 0000000..adba05b --- /dev/null +++ b/libtest/example.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "example"=".\example.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/libtest/example.h b/libtest/example.h new file mode 100644 index 0000000..161dce5 --- /dev/null +++ b/libtest/example.h @@ -0,0 +1,27 @@ +/*
+ HTTrack library example
+ .h file
+*/
+
+#ifdef __WIN32
+#define CDECL __cdecl
+#else
+#define CDECL
+#endif
+
+void CDECL httrack_wrapper_init(void);
+void CDECL httrack_wrapper_uninit(void);
+int CDECL httrack_wrapper_start(httrackp* opt);
+int CDECL httrack_wrapper_chopt(httrackp* opt);
+int CDECL httrack_wrapper_end(void);
+int CDECL httrack_wrapper_checkhtml(char* html,int len,char* url_adresse,char* url_fichier);
+int CDECL httrack_wrapper_loop(void* _back,int back_max,int back_index,int lien_n,int lien_tot,int stat_time,hts_stat_struct* stats);
+char* CDECL httrack_wrapper_query(char* question);
+char* CDECL httrack_wrapper_query2(char* question);
+char* CDECL httrack_wrapper_query3(char* question);
+int CDECL httrack_wrapper_check(char* adr,char* fil,int status);
+void CDECL httrack_wrapper_pause(char* lockfile);
+void CDECL httrack_wrapper_filesave(char* file);
+int CDECL httrack_wrapper_linkdetected(char* link);
+int CDECL httrack_wrapper_xfrstatus(void* back);
+
diff --git a/libtest/htssystem.h b/libtest/htssystem.h new file mode 100644 index 0000000..58941ed --- /dev/null +++ b/libtest/htssystem.h @@ -0,0 +1,2 @@ +#define HTS_ANALYSTE 1
+
diff --git a/libtest/readme.txt b/libtest/readme.txt new file mode 100644 index 0000000..3c23e4c --- /dev/null +++ b/libtest/readme.txt @@ -0,0 +1,34 @@ +HTTrack library example
+-----------------------
+
+Here is an example of how to integrate HTTrack Website Copier into a project
+to use it as a "core library".
+
+
+Important Notice:
+----------------
+
+These sources are covered by the GNU General Public License (see below)
+(Projects based on these sources must follow the GPL, too)
+
+
+Copyright notice:
+----------------
+
+HTTrack Website Copier, Offline Browser for Windows and Unix
+Copyright (C) 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 2
+of the License, or 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, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
|