1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

simplified hook_lookup()

This commit is contained in:
Steffen Vogel 2015-04-01 14:25:21 +02:00
parent 877e2b7aec
commit 50622d1102

View file

@ -27,15 +27,13 @@ static struct hook_id hook_list[] = {
{ hook_tofixed, "tofixed" },
{ hook_ts, "ts" },
{ hook_fir, "fir" },
{ NULL }
};
hook_cb_t hook_lookup(const char *name)
{
for (struct hook_id *hid = hook_list; hid->cb; hid++) {
if (!strcmp(name, hid->name)) {
return hid->cb;
}
for (int i=0; i<ARRAY_LEN(hook_list); i++) {
if (!strcmp(name, hook_list[i].name))
return hook_list[i].cb;
}
return NULL; /* No matching hook was found */