creating a callback in newlisp

Started by newdep, March 25, 2009, 06:05:33 AM

Previous topic - Next topic

newdep

Hi Lutz,



Is there way to Pre-determine what memory address newlisp will

use when using get-url read-file load ..etc. (all functions that

load into memory directly)



Im trying to create a callback to inspect loaded data but I cant

find a proper way to do so.. It always endsups doing it after the

data was fully read..





Would be nice to have a function like "inspect" that returns the

data-segment for a specific function in combination with address ..etc..



Not sure if its possible but it would open another door in newlisp ;-)



Norman.
-- (define? (Cornflakes))

Lutz

#1
On http:// URLs you will not know the size until it is downloaded, and then you can use 'length' to check the length of the string buffer plus 16 bytes overhead.



On file:// URLs and before doing 'read-file' you could use 'file-info' to find out the size in memory plus (as above) 16 bytes of overhead before reading.



Putting a callback facility into 'get/put/post-url' has been on my todo list for a long time and it will come one day. Right now, these functions already are not atomic in reading and writing, checking continuously for timeout.