Re: calling a function in a struct ?

"smallhairytroll" <[email protected]> Thu, 12 Jun 2003 22:53:58 -0000
Newsgroups gmane.lisp.corman
Message-ID <[email protected]>
--- In [email protected], Chris Double <chris.double@d...> 
wrote:
> On Thu, 12 Jun 2003 18:42, smallhairytroll wrote:
> > How would I go about calling a function defined within a struct ?
> 
> I think this came up about 2 months ago in the mailing list. I 
can't check at 

What about this method ?

typedef struct SDL_RWops {
int (*seek)(struct SDL_RWops *context, int offset, int whence);
}

seek is of type (:void *), so, dereference seek to get the address 
of the function. Set the first 4 bytes to a SDL_RWops struct, the 
second 4 bytes to offset and the third 4 bytes to whence.

Not sure how I would actually call the function though.

-Luke


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Looking for the latest Free IT White Papers?
Visit SearchSecurity.com to access over 500 white papers.
Get instant access at SearchSecurity.com Today
http://us.click.yahoo.com/.lAzoD/QLNGAA/witMAA/SyjtlB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
[email protected]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/