So hooking the HOOK_PRINTF callback allows you to redefine and redirect the channels. The following callbacks are defined:
As a part of that the output channels are handled here. The following output channels exist:
Note, that the term hook and callback are used mostly as synonyms. (Actually the term hook should be replaced by callback for clarity.)
As oposed to other modules some of the functions in this module are not prefixed by hk
as the Coding style dictates. The reason for that lies in the relative importance of this module and some of its functions to the overall system, i.e. cdgPrintf().
Data Structures | |
struct | HookStruct |
Defines | |
#define | CDG_DEBUG (1L << 9) |
#define | CDG_DEFAULT (1L << 10) |
#define | CDG_ERROR (1L << 8) |
#define | CDG_EVAL (1L << 4) |
#define | CDG_HINT (1L << 0) |
#define | CDG_HOOK (1L << 7) |
#define | CDG_INFO (1L << 1) |
#define | CDG_PROFILE (1L << 6) |
#define | CDG_PROGRESS (1L << 11) |
#define | CDG_PROLOG (1L << 3) |
#define | CDG_SEARCHRESULT (1L << 5) |
#define | CDG_WARNING (1L << 2) |
#define | CDG_XML (1L << 12) |
#define | HOOK_CNBUILDNODES 0 |
#define | HOOK_EVAL 1 |
#define | HOOK_FLUSH 4 |
#define | HOOK_GETS 7 |
#define | HOOK_GLSINTERACTION 6 |
#define | HOOK_ICINTERACTION 10 |
#define | HOOK_NSSEARCH 2 |
#define | HOOK_PARTIALRESULT 9 |
#define | HOOK_PRINTF 3 |
#define | HOOK_PROGRESS 8 |
#define | HOOK_RESET 5 |
Typedefs | |
typedef HookStruct * | Hook |
typedef void | HookFunction () |
Functions | |
void | cdgExecHook (int hookNo,...) |
void | cdgFlush (void) |
void | cdgGetString (String buffer, int size) |
void | cdgPrintf (int mode, String format,...) |
void | hkCallback (String name, Boolean *var) |
void | hkFinalize (void) |
int | hkFindNoOfHook (String name) |
void | hkInitialize (void) |
Boolean | hkValidate (String name, String value, Boolean *var) |
Variables | |
Vector | hkHooks |
Vector | hkHooks = NULL |
unsigned long int | hkVerbosity |
unsigned long int | hkVerbosity = CDG_DEFAULT | CDG_ERROR | CDG_INFO | CDG_WARNING | CDG_SEARCHRESULT |
|
identification of the Referenced by cmdStatus(), cnBuildEdges(), cnBuildLv(), cnBuildNodes(), cnBuildUpdateArcs(), cnOptimizeNet(), cnOptimizeNode(), cnPrintActiveLVs(), cnSortNodes(), cnTag(), comMake(), embedChunk(), evalBinary(), evalUnary(), findChunk(), getCategories(), getChunks(), getFakeChunksAt(), hkInitialize(), initRealChunker(), lgPartitions(), mergeChunk(), postProcessChunks(), and scSetScore(). |
|
identification of the Referenced by cmdAnnotation(), cmdConstraint(), cmdDistance(), cmdEdges(), cmdHelp(), cmdHierarchy(), cmdHook(), cmdLevel(), cmdLexicon(), cmdLicense(), cmdNet(), cmdNonSpecCompatible(), cmdSection(), cmdStatus(), cmdVersion(), cmdWordgraph(), comApprove(), comCompile(), commandLoop(), and hkInitialize(). |
|
|
identification of the
Referenced by cmdStatus(), and hkInitialize(). |
|
identification of the
Referenced by cmdStatus(), and hkInitialize(). |
|
global hook flag. This flag switches on/off the complete hook system.
Referenced by cmdHook(), cmdStatus(), cnBuildNodes(), evalBinaryConstraint(), evalConstraint(), and evalUnaryConstraint(). |
|
identification of the Referenced by cdgDeleteComputed(), chunkerChunk(), cmdAnno2Parse(), cmdAnnos2prolog(), cmdChunk(), cmdCompile(), cmdHook(), cmdIncrementalCompletion(), cmdInputwordgraph(), cmdISearch(), cmdLevelsort(), cmdLexicon(), cmdLoad(), cmdNetsearch(), cmdNewnet(), cmdNonSpecCompatible(), cmdParsedelete(), cmdParses2prolog(), cmdRenewnet(), cmdSet(), cmdShowlevel(), cmdStatus(), cmdUseconstraint(), cmdUselevel(), cmdVerify(), cmdWeight(), cnCallback(), cnPrintActiveLVs(), cnPrintInfo(), cnPrintParses(), cnTag(), cnUnaryPruning(), comLoad(), comMake(), comTranslate(), cvAnalyse(), cvPrint(), dbLoad(), dbLoadAll(), dbLoadEntries(), evalChunker(), hkInitialize(), and lgNewFinal(). |
|
identification of the Referenced by cmdChunk(), cmdIncrementalCompletion(), cmdISearch(), cmdNewnet(), cmdStatus(), cnBuildEdges(), cnBuildNodes(), and hkInitialize(). |
|
identification of the Referenced by cdgPrintf(), cmdAnno2Parse(), cmdStatus(), dbLoadAll(), and hkInitialize(). |
|
identification of the
Referenced by cmdStatus(), and hkInitialize(). |
|
identification of the Referenced by cmdNetsearch(), cmdStatus(), and hkInitialize(). |
|
identification of the Referenced by cdgAgInsert(), cdgPrintf(), cmdAnno2Parse(), cmdLs(), cmdNewnet(), cmdStatus(), cnBuild(), cnBuildFinal(), cnDelete(), cnFindNode(), cnOptimizeNode(), cnPrintInfo(), comApprove(), commandLoop(), dbAvailable(), evalBinaryConstraint(), evalChunker(), evalConstraint(), evalFormula(), evalTerm(), evalUnaryConstraint(), evalValidateEvalMethod(), getCategory(), getChunks(), getNextArgument(), hkInitialize(), lgDeleteNode(), lgDeleteNodes(), lgMostProbablePath(), lgNewFinal(), lgNewIter(), lgSimultaneous(), peekValue(), and terminateChild(). |
|
identification of the Referenced by cmdStatus(), commandEval(), and hkInitialize(). |
|
callback after building constraintnodes. Definition at line 43 of file hook.h. Referenced by cnBuildNodes(), and hkInitialize(). |
|
callback after evaluation of constraints. Definition at line 48 of file hook.h. Referenced by evalBinaryConstraint(), evalConstraint(), evalUnaryConstraint(), hkInitialize(), and hooker_init(). |
|
callback for flushing the output channels. Definition at line 63 of file hook.h. Referenced by cdgFlush(), hkInitialize(), hooker_init(), and logFlush(). |
|
callback in to get a string from the user. Definition at line 79 of file hook.h. Referenced by cdgGetString(), hkInitialize(), and hooker_init(). |
|
callback for user interaction in the gls module. Definition at line 74 of file hook.h. Referenced by hkInitialize(), and hooker_init(). |
|
callback for user interaction in the incrementalcompletion module. Definition at line 94 of file hook.h. Referenced by hkInitialize(), and hooker_init(). |
|
callback in netsearching. Definition at line 53 of file hook.h. Referenced by hkInitialize(), and hooker_init(). |
|
callback to hand over partial results. Definition at line 89 of file hook.h. Referenced by hkInitialize(), and hooker_init(). |
|
callback for printfing. Definition at line 58 of file hook.h. Referenced by cdgPrintf(), hkInitialize(), hooker_init(), logFlush(), and logPrintf(). |
|
callback to indicate progress in a heavy computation. Definition at line 84 of file hook.h. Referenced by cdgPrintf(), hkInitialize(), and hooker_init(). |
|
notification that parses, constraint nets etc. have become invalid because of grammar changes. Definition at line 69 of file hook.h. Referenced by cdgDeleteComputed(), hkInitialize(), and hooker_init(). |
|
type of a Hook Definition at line 216 of file hook.h. Referenced by cdgExecHook(), cdgFlush(), cdgGetString(), cdgPrintf(), cmdHook(), evalHookHandle(), getHookCmd(), getsHookHandle(), glsInteractionHookHandle(), hkFindNoOfHook(), hkInitialize(), hook_completion_function(), hooker_init(), ICinteractionHookHandle(), initHookResult(), logFlush(), netsearchHookHandle(), partialResultHookHandle(), progressHookHandle(), resetHookHandle(), setHookCmd(), and tclHookHandle(). |
|
type of a callback function. This function is installed into a callback hook and executed whenever this callback is triggered. This is only a indicator definition without any grants on the arguments. But be aware of the arguments that are actually needed by every callback. Definition at line 201 of file hook.h. Referenced by hkInitialize(), and hooker_init(). |
|
execute a defined callback. This is the standard way to call a hook. If the corresponding HookStruct::active is set, its HookStruct::count is increased and its HookStruct::function is called handing over a pointer to the HookStruct we are executing and the entire va_list passed to this function. For example,
References HookStruct::active, CDG_ERROR, cdgPrintf(), HookStruct::count, HookStruct::function, hkHooks, Hook, and HookStruct::name. Referenced by cdgDeleteComputed(), cnBuildNodes(), evalBinaryConstraint(), evalConstraint(), and evalUnaryConstraint(). |
|
default flush callback. This is the default callback for HOOK_FLUSH. If no hook is installed, i.e. HookStruct::function is NULL, then References HookStruct::count, HookStruct::function, hkHooks, Hook, and HOOK_FLUSH. Referenced by cdgPrintf(), cnBuildEdges(), cnBuildIter(), comApprove(), comMake(), commandEval(), and comTranslate(). |
|
default get string callback. This function gets one newline-terminated chunk of console input from the user. Up to References HookStruct::count, HookStruct::function, hkHooks, Hook, and HOOK_GETS. |
|
|
monitor access to variables in this module.
This function is installed using setRegister() in the hkInitialize() function of this module. When a variable is changed hkCallback() is called handling appropriate sideeffects depending on the new variable value. Right now only the variable
Switching on Referenced by hkInitialize(). |
|
finalization of this module. After this call the References hkHooks. Referenced by cdgFinalize(). |
|
get the numerical identifier of a named hook.
References FALSE, hkHooks, Hook, and HookStruct::name. Referenced by cmdHook(), getHookCmd(), and setHookCmd(). |
|
initialization of the hook module. This function must be called before the References HookStruct::active, CDG_DEBUG, CDG_DEFAULT, CDG_ERROR, CDG_EVAL, CDG_HINT, CDG_INFO, CDG_PROFILE, CDG_PROGRESS, CDG_PROLOG, CDG_SEARCHRESULT, CDG_WARNING, CDG_XML, HookStruct::cmd, HookStruct::count, FALSE, HookStruct::function, hkCallback(), hkHooks, hkValidate(), hkVerbosity, Hook, HOOK_CNBUILDNODES, HOOK_EVAL, HOOK_FLUSH, HOOK_GETS, HOOK_GLSINTERACTION, HOOK_ICINTERACTION, HOOK_NSSEARCH, HOOK_PARTIALRESULT, HOOK_PRINTF, HOOK_PROGRESS, HOOK_RESET, HookFunction, HookStruct::name, HookStruct::no, NULL, and TRUE. Referenced by cdgInitialize(). |
|
validate access to variables in this module.
This function is installed using setRegister() in the hkInitialize() function of this module. It is monitoring the access to the variable Referenced by hkInitialize(). |
|
This Vector holds all defined hooks. It is initialized by the function hkInitialize(). After that, the symbolic constants can be used to execute any of the hooks. Definition at line 88 of file hook.c. Referenced by cdgExecHook(), cdgFlush(), cdgGetString(), cdgPrintf(), cmdHook(), getHookCmd(), hkFinalize(), hkFindNoOfHook(), hkInitialize(), hook_completion_function(), hooker_init(), logFlush(), logPrintf(), and setHookCmd(). |
|
This Vector holds all defined hooks. It is initialized by the function hkInitialize(). After that, the symbolic constants can be used to execute any of the hooks. Definition at line 88 of file hook.c. Referenced by cdgExecHook(), cdgFlush(), cdgGetString(), cdgPrintf(), cmdHook(), getHookCmd(), hkFinalize(), hkFindNoOfHook(), hkInitialize(), hook_completion_function(), hooker_init(), logFlush(), logPrintf(), and setHookCmd(). |
|
bitwise encoding of active output channels. This variable controls the currently active output channels. All output is performed by the function cdgPrintf(), whose first argument is a bitwise encoding denoting the output channels (e.g. CDG_INFO, CDG_ERROR, or CDG_DEBUG output) to which a message is to be routed.
All messages tagged with a bit that is not set in Referenced by cdgPrintf(), cmdHook(), cmdNetsearch(), cmdStatus(), cnBuildNodes(), cnPrintInfo(), cnSortNodes(), cnTag(), comApprove(), commandEval(), dbLoadEntries(), evalBinaryConstraint(), evalConstraint(), evalUnaryConstraint(), and hkInitialize(). |
|
bitwise encoding of active output channels. This variable controls the currently active output channels. All output is performed by the function cdgPrintf(), whose first argument is a bitwise encoding denoting the output channels (e.g. CDG_INFO, CDG_ERROR, or CDG_DEBUG output) to which a message is to be routed.
All messages tagged with a bit that is not set in Referenced by cdgPrintf(), cmdHook(), cmdNetsearch(), cmdStatus(), cnBuildNodes(), cnPrintInfo(), cnSortNodes(), cnTag(), comApprove(), commandEval(), dbLoadEntries(), evalBinaryConstraint(), evalConstraint(), evalUnaryConstraint(), and hkInitialize(). |