creating a callback in newlisp

Q&A's, tips, howto's
Locked
newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

creating a callback in newlisp

Post by 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
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Post by Lutz »

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.

Locked