MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ng_findhook

Function ng_findhook

lib/ff_ng_base.c:1130–1143  ·  view source on GitHub ↗

* Find a hook * * Node types may supply their own optimized routines for finding * hooks. If none is supplied, we just do a linear search. * XXX Possibly we should add a reference to the hook? */

Source from the content-addressed store, hash-verified

1128 * XXX Possibly we should add a reference to the hook?
1129 */
1130hook_p
1131ng_findhook(node_p node, const char *name)
1132{
1133 hook_p hook;
1134
1135 if (node->nd_type->findhook != NULL)
1136 return (*node->nd_type->findhook)(node, name);
1137 LIST_FOREACH(hook, &node->nd_hooks, hk_hooks) {
1138 if (NG_HOOK_IS_VALID(hook) &&
1139 (strcmp(NG_HOOK_NAME(hook), name) == 0))
1140 return (hook);
1141 }
1142 return (NULL);
1143}
1144
1145/*
1146 * Destroy a hook

Callers 5

ng_add_hookFunction · 0.70
ng_con_part2Function · 0.70
ng_con_nodesFunction · 0.70
ng_path2noderefFunction · 0.70
ng_generic_msgFunction · 0.70

Calls 1

strcmpFunction · 0.85

Tested by

no test coverage detected