X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Flttv%2Fhook.h;h=77a5dd5f59194ede727e5760c55d9f62f741ab88;hb=04cd9a1e94f33a731da0871ab6c4edb3db37cc4d;hp=c1814d8191b66b156c5707cf388fa5826aa859b3;hpb=bb545b3cec36359286807096eef91175d1dd5da4;p=lttv.git diff --git a/ltt/branches/poly/lttv/lttv/hook.h b/ltt/branches/poly/lttv/lttv/hook.h index c1814d81..77a5dd5f 100644 --- a/ltt/branches/poly/lttv/lttv/hook.h +++ b/ltt/branches/poly/lttv/lttv/hook.h @@ -76,7 +76,7 @@ void lttv_hooks_remove_data(LttvHooks *h, LttvHook f, void *hook_data); /* Remove a list of hooks from the hooks list in h. */ -void lttv_hooks_remove_data_list(LttvHooks *h, LttvHooks *list); +void lttv_hooks_remove_list(LttvHooks *h, LttvHooks *list); /* Return the number of hooks in the list */ @@ -92,6 +92,7 @@ void lttv_hooks_get(LttvHooks *h, unsigned i, LttvHook *f, void **hook_data, /* Remove the specified hook. The position of the following hooks may change */ +/* The hook is removed from the list event if its ref_count is higher than 1 */ void lttv_hooks_remove_by_position(LttvHooks *h, unsigned i); @@ -143,7 +144,14 @@ unsigned lttv_hooks_by_id_max_id(LttvHooksById *h); /* Get the list of hooks for an id, NULL if none exists */ -LttvHooks *lttv_hooks_by_id_get(LttvHooksById *h, unsigned id); +static inline LttvHooks *lttv_hooks_by_id_get(LttvHooksById *h, unsigned id) +{ + LttvHooks *ret; + if(id < h->len) ret = h->pdata[id]; + else ret = NULL; + + return ret; +} /* Remove the list of hooks associated with an id */