[jewel] C callback functions

  • From: frank.hale@xxxxxxxxxxx
  • To: jewel-dev@xxxxxxxxxxxxx
  • Date: Fri, 23 May 2003 07:29:04 -0400

Does anyone know how to write a callback function in C? I know what they do but 
have no idea how to write one. What I'm hoping to do is create a struct and 
have a pointer to a function contained in it. 

struct something
{
    (...) /* stuff here */
    (void*) my_function_pointer;
    (...) /* other stuff here */
};

I am not sure if this is the proper syntax. Basically there will be many 
instances of this struct and I wanna have a callback function for each one and 
that function will be custom for each instance of the struct.

I hope that makes some kind of sense.




Other related posts: