From 844ecc37072d515513177c65a8c9dc35c9cdfc1a Mon Sep 17 00:00:00 2001 From: Xavier Roche Date: Mon, 19 Mar 2012 12:55:42 +0000 Subject: httrack 3.33.16 --- html/plug.html | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'html/plug.html') diff --git a/html/plug.html b/html/plug.html index ba4be25..4c99798 100755 --- a/html/plug.html +++ b/html/plug.html @@ -131,15 +131,16 @@ int process_file(char* html, int len, char* url_adresse, char* url_fichier) { Below the list of callbacks, and associated external wrappers:
- - + - - - + + + + + @@ -150,11 +151,34 @@ Below the list of callbacks, and associated external wrappers:
+ +
"callback name"callback descriptioncallback function signature
"callback name"callback descriptioncallback function signature
"init"Called during initialization
return value: none
void (* myfunction)(void);
"free"Called during un-initialization
return value: none
void (* myfunction)(void);
"start"Called when the mirror starts. The opt structure passed lists all options defined for this mirror. You may modify the opt structure to fit your needs
return value: 1 upon success, 0 upon error (the mirror will then be aborted)
int (* myfunction)(httrackp* opt);
"init"Note: deprecated, should not be used anymore (unsafe callback) - see "start" callback or wrapper_init() module function below this table.Called during initialization ; use of htswrap_add (see httrack-library.h) is permitted inside this function to setup other callbacks.
return value: none
void (* myfunction)(void);
"free"Note: deprecated, should not be used anymore (unsafe callback) - see "end" callback or wrapper_exit() module function below this table.
Called during un-initialization
return value: none
void (* myfunction)(void);
"start"Called when the mirror starts. The opt structure passed lists all options defined for this mirror. You may modify the opt structure to fit your needs. Besides, use of htswrap_add (see httrack-library.h) is permitted inside this function to setup other callbacks.
return value: 1 upon success, 0 upon error (the mirror will then be aborted)
int (* myfunction)(httrackp* opt);
"end"Called when the mirror ends
return value: 1 upon success, 0 upon error (the mirror will then be considered aborted)
int (* myfunction)(void);
"change-options"Called when options are to be changed. The opt structure passed lists all options, updated to take account of recent changes
return value: 1 upon success, 0 upon error (the mirror will then be aborted)
int (* myfunction)(httrackp* opt);
"check-html"Called when a document (which may not be an html document) is to be parsed. The html address points to the document data, of lenth len. The url_adresse and url_fichier are the address and URI of the file being processed
return value: 1 if the parsing can be processed, 0 if the file must be skipped without being parsed
int (* myfunction)(char* html,int len,char* url_adresse,char* url_fichier);
"preprocess-html"Called when a document (which is an html document) is to be parsed (original, not yet modified document). The html address points to the document data address (char**), and the length address points to the lenth of this document. Both pointer values (address and size) can be modified to change the document. It is up to the callback function to reallocate the given pointer (using standard C library realloc()/free() functions), which will be free()'ed by the engine. Hence, return of static buffers is strictly forbidden, and the use of strdup() in such cases is advised. The url_adresse and url_fichier are the address and URI of the file being processed
return value: 1 if the new pointers can be applied (default value)
int (* myfunction)(char** html,int* len,char* url_adresse,char* url_fichier);
"postprocess-html"Called when a document (which is an html document) is parsed and transformed (links rewritten). The html address points to the document data address (char**), and the length address points to the lenth of this document. Both pointer values (address and size) can be modified to change the document. It is up to the callback function to reallocate the given pointer (using standard C library realloc()/free() functions), which will be free()'ed by the engine. Hence, return of static buffers is strictly forbidden, and the use of strdup() in such cases is advised. The url_adresse and url_fichier are the address and URI of the file being processed
return value: 1 if the new pointers can be applied (default value)
int (* myfunction)(char** html,int* len,char* url_adresse,char* url_fichier);
"query"Called when the wizard needs to ask a question. The question string contains the question for the (human) user
return value: the string answer ("" for default reply)
char* (* myfunction)(char* question);
"query2"Called when the wizard needs to ask a questionchar* (* myfunction)(char* question);
"query3"Called when the wizard needs to ask a questionchar* (* myfunction)(char* question);
"link-detected"Called when a link has been detected
return value: 1 if the link can be analyzed, 0 if the link must not even be considered
int (* myfunction)(char* link);
"transfer-status"Called when a file has been processed (downloaded, updated, or error)
return value: must return 1
int (* myfunction)(lien_back* back);
"save-name"Called when a local filename has to be processed. The adr_complete and fil_complete are the address and URI of the file being saved ; the referer_adr and referer_fil are the address and URI of the referer link. The save string contains the local filename being used. You may modifiy the save string to fit your needs, up to 1024 bytes (note: filename collisions, if any, will be handled by the engine by renaming the file into file-2.ext, file-3.ext ..).
return value: must return 1
int (* myfunction)(char* adr_complete,char* fil_complete,char* referer_adr,char* referer_fil,char* save);
"send-header"Called when HTTP headers are to be sent to the remote server. The buff buffer contains text headers, adr and fil the URL, and referer_adr and referer_fil the referer URL. The outgoing structure contains all information related to the current slot.
return value: 1 if the mirror can continue, 0 if the mirror must be aborted
int (* myfunction)(char* buff, char* adr, char* fil, char* referer_adr, char* referer_fil, htsblk* outgoing);
"receive-header"Called when HTTP headers are recevived from the remote server. The buff buffer contains text headers, adr and fil the URL, and referer_adr and referer_fil the referer URL. The incoming structure contains all information related to the current slot.
return value: 1 if the mirror can continue, 0 if the mirror must be aborted
int (* myfunction)(char* buff, char* adr, char* fil, char* referer_adr, char* referer_fil, htsblk* incoming);


+Below additional function names that can be defined inside the module (DLL/.so):
+ + + + + + + +
"module function name"function description
int function-name_init(char *args);Called when a function named function-name is extracted from the current module (same as wrapper_init). The optional args provides additional commandline parameters. Returns 1 upon success, 0 if the function should not be extracted.
int wrapper_init(char *fname, char *args);Called when a function named fname is extracted from the current module. The optional args provides additional commandline parameters. Besides, use of htswrap_add (see httrack-library.h) is permitted inside this function to setup other callbacks. Returns 1 upon success, 0 if the function should not be extracted.
int wrapper_exit(void);Called when the module is unloaded. The function should return 1 (but the result is ignored).
+ +

+Below additional function names that can be defined inside the optional libhttrack-plugin module (libhttrack-plugin.dll or libhttrack-plugin.so) searched inside common library path:
+ + + + + + +
"module function name"function description
void plugin_init(void);Called if the module (named libhttrack-plugin.(so|dll)) is found in the library path. Use of htswrap_add (see httrack-library.h) is permitted inside this function to setup other callbacks.
+ +



-- cgit v1.2.3