Initialisation of static data


I am writing code to  provide access to the net 
from Prolog, using libwww. This code gets linked  
into an interpreter. When the code is linked in,
static data is allocated an initialised. I can
then call a function in the code.

The function I have written starts up the
lib, fetches a url, and then shuts down the lib.
However, since the static data is only initialised
once (when I first link in the code), it does not
get reinitialised each time I call my function.

Do you see what I mean?

E.g. if you have

PRIVATE void* ptr = NULL;

in a file, ptr gets set to NULL when the code is
linked into the interpreter but is not reset to
NULL each time I initialise the Library.

I hope this is making sense, it is difficult to

In any case, it would be nice to have HTLibInit
initialise all the static data explicitly, perhaps
via a function HT???_staticInit.

Also, it is crucial to me that all memory be tidied
up carefully.

I hope you have understood what I am trying to say!
I will be modifying my version of the lib (4.0) and
if you like can keep track of all the changes I make
and inform you when I'm done.