This module provides functions that allow users to insert hooks, i.e. user-supplied functions, that are called by the system at as specific conditions arise. These conditions differ from UNIX signals in that they are raised synchronously, via a regular function call; and that a single condition can call several different functions.
The system-defined conditions are:
int CcdCallOnCondition(condnum,fnp,arg)
int condnum;
CcdVoidFn fnp;
void *arg;
This call instructs the system to call the function indicated by the function pointer fnp, with the specified argument arg, when the condition indicated by condnum is raised next. Multiple functions may be registered for the same condition number.
int CcdCallOnConditionKeep(condnum,fnp,arg)
As above, but the association is permanent- the given function will
be called again whenever this condition is raised.
Returns an index that may be used to cancel the association later.
void CcdCancelCallOnCondition(int condnum, int idx)
void CcdCancelCallOnConditionKeep(int condnum, int idx)
Delete the given index from the list of callbacks for
the given condition. The corresponding function will no longer be
called when the condition is raised.
Note that it is illegal to call these two functions to cancel callbacks from within ccd callbacks.
void CcdRaiseCondition(condNum)
int condNum;
When this function is called, it invokes all the functions whose
pointers were registered for the condNum via a prior call
to CcdCallOnCondition or CcdCallOnConditionKeep.
void CcdCallFnAfter(fnp, arg, msLater)
CcdVoidFn fnp;
void *arg;
unsigned int msLater;
This call registers a function via a pointer to it, fnp, that will be called at least msLater milliseconds later. The registered function fnp is actually called the first time the scheduler gets control after deltaT milliseconds have elapsed.
November 23, 2009
Converse Homepage
Charm Homepage