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.
c_move_callbackMove a callback function.
c_list_dispatchingTest if a callback list is currently dispatching events.
c_list_dispatching2Test if a callback list is currently dispatching events.
c_list_test_emptyTest if a callback list has any callbacks registered with it.
c_write_null_funcWrite NULL to a pointer.
c_write_2nulls_funcWrite NULL values to a structure containing two pointers.
c_unregister_callback2Unregister a callback function.

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


EXPERIMENTAL FUNCTION: subject to change without notice

void c_move_callback (KCallbackFunc callback, flag last)

Move a callback function.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag c_list_dispatching (KCallbackList list)

Test if a callback list is currently dispatching events.

Parameters:

Returns: TRUE if the list is dispatching, else FALSE.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag c_list_dispatching2 (KCallbackFunc callback)

Test if a callback list is currently dispatching events.

Parameters:

Returns: TRUE if the list is dispatching, else FALSE.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

flag c_list_test_empty (KCallbackList list)

Test if a callback list has any callbacks registered with it.

Parameters:

Returns: TRUE if the list is empty (no callbacks), else FALSE.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void c_write_null_func (void **pointer)

Write NULL to a pointer.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void c_write_2nulls_func (void *pointer)

Write NULL values to a structure containing two pointers.

Parameters:

Returns: Nothing.
Multithreading Level: Unsafe


EXPERIMENTAL FUNCTION: subject to change without notice

void c_unregister_callback2 (KCallbackFunc callback)

Unregister a callback function.

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


Back to Karma Home Page
Contact: Richard Gooch
Web Development: Ariel Internet Services