/** * find_hook - Find a hook to match a path * @param type Type of hook, see #HookFlags * @param path Filename to test * @retval ptr Matching hook command * @retval NULL No matches * * Each hook has a type and a pattern. * Find a command that matches the type and path supplied. e.g. * * User config: * open-hook '\.gz$' "gzip -cd '%f' > '%t'" * * Call: * find_hook (#MUTT_OPEN_HOOK, "myfile.gz"); */ static const char *find_hook(HookFlags type, const char *path) { if (!path) return NULL; const char *c = mutt_find_hook(type, path); if (!c || !*c) return NULL; return c; }
static const char *find_compress_hook (int type, const char *path) { const char *c = mutt_find_hook (type, path); return (!c || !*c) ? NULL : c; }