set ptr and query functions to be exported...

... so that the code can be utilised as a module