| > OK I'll try to do what I need. Could you just point me to
> where to start? I was looking to the sources and well -
all
> the comments are in French ;-) I couldn't understand
them.
> Would it be possible to provide some short description
for
> them?
Hum, I'll have to document a bit more the API one day.
First take a look at lib/example.c, it can give you some
interesting hints.
The naming functions is located in htsname.c, in the
url_savename() routine:
int url_savename(
char* adr_complete, /* address (www.foo.com) */
char* fil_complete, /* file (/foo/index.html) */
char* save, /* target to generate */
char* former_adr, /* address if moved during test */
char* former_fil, /* file if moved during test */
char* referer_adr, /* referer address if .. */
char* referer_fil, /* referer file if .. */
httrackp* opt, /* option settings */
lien_url** liens, /* current link heap */
int lien_tot, /* number of links in heap */
lien_back* back, /* internal background download */
int back_max, /* background size */
cache_back* cache, /* internal cache */
hash_struct* hash, /* filenames hashtable */
int ptr, /* current position */
int numero_passe /* reserved */
);
You just have to hack this function ; for example before
line 628, before the loop which forms the filename
according to the build structure settings. You have to
create in the 'save' (char*) variable the filename, from
the adr_complete and fil_complete address and filename.
Then, just leave the rest of the process (line 810) to
handle collisions, and other things.
I'll add a wrapper which will simplify that in the future ;
that is, just after (line 810) the 'save' initialization,
an optional handler to modify it.
| |