=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tmux.h,v retrieving revision 1.882 retrieving revision 1.883 diff -u -r1.882 -r1.883 --- src/usr.bin/tmux/tmux.h 2019/04/25 18:18:55 1.882 +++ src/usr.bin/tmux/tmux.h 2019/04/26 11:38:51 1.883 @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.882 2019/04/25 18:18:55 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.883 2019/04/26 11:38:51 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -683,15 +683,6 @@ u_int range_argument; }; -/* Hook data structures. */ -struct hook { - const char *name; - - struct cmd_list *cmdlist; - - RB_ENTRY(hook) entry; -}; - /* Virtual screen. */ struct screen_sel; struct screen_titles; @@ -995,7 +986,6 @@ int statusat; u_int statuslines; - struct hooks *hooks; struct options *options; #define SESSION_PASTING 0x1 @@ -1521,6 +1511,7 @@ long long number; struct style style; struct options_array array; + struct cmd_list *cmdlist; }; /* Option table entries. */ @@ -1531,17 +1522,19 @@ OPTIONS_TABLE_COLOUR, OPTIONS_TABLE_FLAG, OPTIONS_TABLE_CHOICE, - OPTIONS_TABLE_STYLE + OPTIONS_TABLE_STYLE, + OPTIONS_TABLE_COMMAND }; enum options_table_scope { OPTIONS_TABLE_NONE, OPTIONS_TABLE_SERVER, OPTIONS_TABLE_SESSION, - OPTIONS_TABLE_WINDOW, + OPTIONS_TABLE_WINDOW }; #define OPTIONS_TABLE_IS_ARRAY 0x1 +#define OPTIONS_TABLE_IS_HOOK 0x2 struct options_table_entry { const char *name; @@ -1599,7 +1592,6 @@ }; /* tmux.c */ -extern struct hooks *global_hooks; extern struct options *global_options; extern struct options *global_s_options; extern struct options *global_w_options; @@ -1693,20 +1685,6 @@ char *format_trim_left(const char *, u_int); char *format_trim_right(const char *, u_int); -/* hooks.c */ -struct hook; -struct hooks *hooks_get(struct session *); -struct hooks *hooks_create(struct hooks *); -void hooks_free(struct hooks *); -struct hook *hooks_first(struct hooks *); -struct hook *hooks_next(struct hook *); -void hooks_add(struct hooks *, const char *, struct cmd_list *); -void hooks_copy(struct hooks *, struct hooks *); -void hooks_remove(struct hooks *, const char *); -struct hook *hooks_find(struct hooks *, const char *); -void printflike(4, 5) hooks_insert(struct hooks *, struct cmdq_item *, - struct cmd_find_state *, const char *, ...); - /* notify.c */ void notify_hook(struct cmdq_item *, const char *); void notify_input(struct window_pane *, struct evbuffer *); @@ -1734,8 +1712,9 @@ void options_array_clear(struct options_entry *); union options_value *options_array_get(struct options_entry *, u_int); int options_array_set(struct options_entry *, u_int, const char *, - int); -void options_array_assign(struct options_entry *, const char *); + int, char **); +int options_array_assign(struct options_entry *, const char *, + char **); struct options_array_item *options_array_first(struct options_entry *); struct options_array_item *options_array_next(struct options_array_item *); u_int options_array_item_index(struct options_array_item *); @@ -1956,6 +1935,8 @@ struct cmdq_item *cmdq_get_callback1(const char *, cmdq_cb, void *); void cmdq_insert_after(struct cmdq_item *, struct cmdq_item *); void cmdq_append(struct client *, struct cmdq_item *); +void cmdq_insert_hook(struct session *, struct cmdq_item *, + struct cmd_find_state *, const char *, ...); void printflike(3, 4) cmdq_format(struct cmdq_item *, const char *, const char *, ...); u_int cmdq_next(struct client *);