The "c" Package

These routines are meant to provide a general purpose callback management framework. Library packages and applications may use this package to implement their own callback mechanisms. This package removes the need for external code to maintain and traverse callback lists.

Library: karma
Link With: -lkarma

Functions

c_register_callbackRegister a callback function with a list.
c_unregister_callbackUnregister a callback function.
c_call_callbacksCall all registered callbacks for an object.
c_destroy_listDestroy a callback list.

Prototype Functions

C_PROTO_callbackGeneric callback.


Functions


KCallbackFunc c_register_callback (KCallbackList *list, flag (*callback) (), void *object, void *client1_data, flag client1_indirect, void *client2_data, flag client2_indirect, flag quenchable)

This routine will register a function which should be called when the callbacks for an object should be called. When the object is destroyed a call should be made to c_destroy_list. The first callback registered is the first one called. Multiple callback functions may be registered per object.

Parameters:

Returns: A KCallbackFunc on success. On failure, the process aborts.
Multithreading Level: Unsafe


void c_unregister_callback (KCallbackFunc callback)

Unregister a callback function.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


flag c_call_callbacks (KCallbackList list, void *call_data)

Call all registered callbacks for an object.

Parameters:

Returns: TRUE if one of the callbacks quenched the further delivery of callbacks, else FALSE.
Multithreading Level: Unsafe


void c_destroy_list (KCallbackList list)

This routine will unregister all callbacks in a callback list and then destroys the list.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


Prototype Functions


flag C_PROTO_callback (void *object, void *client1_data, void *call_data, void *client2_data)

This routine is called when object callbacks are called.

Parameters:

Returns: TRUE if further callbacks should not be called, else FALSE.
Multithreading Level: Unsafe


Contact: Richard Gooch
Web Development: Ariel Internet Services