Lines Matching refs:hookMgr
59 static HOOK_MGR *getHookMgr(HOOK_MGR *hookMgr, int autoCreate)
61 BEGET_CHECK(hookMgr == NULL, return hookMgr);
93 static HOOK_STAGE *getHookStage(HOOK_MGR *hookMgr, int stage, int createIfNotFound)
97 stageItem = (HOOK_STAGE *)OH_ListFind(&(hookMgr->stages), (void *)(&stage), hookStageCompare);
107 OH_ListAddTail(&(hookMgr->stages), (ListNode *)stageItem);
167 int HookMgrAddEx(HOOK_MGR *hookMgr, const HOOK_INFO *hookInfo)
174 hookMgr = getHookMgr(hookMgr, true);
175 BEGET_CHECK(hookMgr != NULL, return -1);
178 stageItem = getHookStage(hookMgr, hookInfo->stage, true);
185 int HookMgrAdd(HOOK_MGR *hookMgr, int stage, int prio, OhosHook hook)
192 return HookMgrAddEx(hookMgr, &info);
214 void HookMgrDel(HOOK_MGR *hookMgr, int stage, OhosHook hook)
219 hookMgr = getHookMgr(hookMgr, 0);
220 BEGET_CHECK(hookMgr != NULL, return);
223 stageItem = getHookStage(hookMgr, stage, false);
263 int HookMgrExecute(HOOK_MGR *hookMgr, int stage, void *executionContext, const HOOK_EXEC_OPTIONS *options)
270 hookMgr = getHookMgr(hookMgr, 0);
271 BEGET_CHECK(hookMgr != NULL, return -1)
274 stageItem = getHookStage(hookMgr, stage, false);
306 void HookMgrDestroy(HOOK_MGR *hookMgr)
308 hookMgr = getHookMgr(hookMgr, 0);
309 BEGET_CHECK(hookMgr != NULL, return);
311 OH_ListRemoveAll(&(hookMgr->stages), hookStageDestroy);
313 if (hookMgr == defaultHookMgr) {
316 if (hookMgr->name != NULL) {
317 free((void *)hookMgr->name);
319 free((void *)hookMgr);
349 void HookMgrTraversal(HOOK_MGR *hookMgr, void *traversalCookie, OhosHookTraversal traversal)
355 hookMgr = getHookMgr(hookMgr, 0);
356 BEGET_CHECK(hookMgr != NULL, return);
361 OH_ListTraversal(&(hookMgr->stages), (void *)(&stageArgs), hookStageTraversal, 0);
367 int HookMgrGetHooksCnt(HOOK_MGR *hookMgr, int stage)
371 hookMgr = getHookMgr(hookMgr, 0);
372 BEGET_CHECK(hookMgr != NULL, return 0);
375 stageItem = getHookStage(hookMgr, stage, false);
384 int HookMgrGetStagesCnt(HOOK_MGR *hookMgr)
386 hookMgr = getHookMgr(hookMgr, 0);
387 BEGET_CHECK(hookMgr != NULL, return 0);
389 return OH_ListGetCnt(&(hookMgr->stages));