=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/Attic/hooks.c,v retrieving revision 1.9 retrieving revision 1.10 diff -c -r1.9 -r1.10 *** src/usr.bin/tmux/Attic/hooks.c 2016/10/16 19:36:37 1.9 --- src/usr.bin/tmux/Attic/hooks.c 2018/01/18 07:10:53 1.10 *************** *** 1,4 **** ! /* $OpenBSD: hooks.c,v 1.9 2016/10/16 19:36:37 nicm Exp $ */ /* * Copyright (c) 2012 Thomas Adam --- 1,4 ---- ! /* $OpenBSD: hooks.c,v 1.10 2018/01/18 07:10:53 nicm Exp $ */ /* * Copyright (c) 2012 Thomas Adam *************** *** 137,169 **** hook = RB_FIND(hooks_tree, &hooks->tree, &hook0); } return (hook); - } - - void - hooks_run(struct hooks *hooks, struct client *c, struct cmd_find_state *fs, - const char *fmt, ...) - { - struct hook *hook; - va_list ap; - char *name; - struct cmdq_item *new_item; - - va_start(ap, fmt); - xvasprintf(&name, fmt, ap); - va_end(ap); - - hook = hooks_find(hooks, name); - if (hook == NULL) { - free(name); - return; - } - log_debug("running hook %s", name); - - new_item = cmdq_get_command(hook->cmdlist, fs, NULL, CMDQ_NOHOOKS); - cmdq_format(new_item, "hook", "%s", name); - cmdq_append(c, new_item); - - free(name); } void --- 137,142 ----