=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-wait-for.c,v retrieving revision 1.13 retrieving revision 1.14 diff -c -r1.13 -r1.14 *** src/usr.bin/tmux/cmd-wait-for.c 2016/01/19 15:59:12 1.13 --- src/usr.bin/tmux/cmd-wait-for.c 2016/10/10 21:51:39 1.14 *************** *** 1,4 **** ! /* $OpenBSD: cmd-wait-for.c,v 1.13 2016/01/19 15:59:12 nicm Exp $ */ /* * Copyright (c) 2013 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: cmd-wait-for.c,v 1.14 2016/10/10 21:51:39 nicm Exp $ */ /* * Copyright (c) 2013 Nicholas Marriott *************** *** 28,34 **** * Block or wake a client on a named wait channel. */ ! enum cmd_retval cmd_wait_for_exec(struct cmd *, struct cmd_q *); const struct cmd_entry cmd_wait_for_entry = { .name = "wait-for", --- 28,34 ---- * Block or wake a client on a named wait channel. */ ! static enum cmd_retval cmd_wait_for_exec(struct cmd *, struct cmd_q *); const struct cmd_entry cmd_wait_for_entry = { .name = "wait-for", *************** *** 52,82 **** RB_ENTRY(wait_channel) entry; }; RB_HEAD(wait_channels, wait_channel); ! struct wait_channels wait_channels = RB_INITIALIZER(wait_channels); ! int wait_channel_cmp(struct wait_channel *, struct wait_channel *); ! RB_PROTOTYPE(wait_channels, wait_channel, entry, wait_channel_cmp); ! RB_GENERATE(wait_channels, wait_channel, entry, wait_channel_cmp); ! int wait_channel_cmp(struct wait_channel *wc1, struct wait_channel *wc2) { return (strcmp(wc1->name, wc2->name)); } ! enum cmd_retval cmd_wait_for_signal(struct cmd_q *, const char *, ! struct wait_channel *); ! enum cmd_retval cmd_wait_for_wait(struct cmd_q *, const char *, ! struct wait_channel *); ! enum cmd_retval cmd_wait_for_lock(struct cmd_q *, const char *, ! struct wait_channel *); ! enum cmd_retval cmd_wait_for_unlock(struct cmd_q *, const char *, ! struct wait_channel *); ! struct wait_channel *cmd_wait_for_add(const char *); ! void cmd_wait_for_remove(struct wait_channel *wc); ! struct wait_channel * cmd_wait_for_add(const char *name) { struct wait_channel *wc; --- 52,81 ---- RB_ENTRY(wait_channel) entry; }; RB_HEAD(wait_channels, wait_channel); ! static struct wait_channels wait_channels = RB_INITIALIZER(wait_channels); ! static int wait_channel_cmp(struct wait_channel *, struct wait_channel *); ! RB_GENERATE_STATIC(wait_channels, wait_channel, entry, wait_channel_cmp); ! static int wait_channel_cmp(struct wait_channel *wc1, struct wait_channel *wc2) { return (strcmp(wc1->name, wc2->name)); } ! static enum cmd_retval cmd_wait_for_signal(struct cmd_q *, const char *, ! struct wait_channel *); ! static enum cmd_retval cmd_wait_for_wait(struct cmd_q *, const char *, ! struct wait_channel *); ! static enum cmd_retval cmd_wait_for_lock(struct cmd_q *, const char *, ! struct wait_channel *); ! static enum cmd_retval cmd_wait_for_unlock(struct cmd_q *, const char *, ! struct wait_channel *); ! static struct wait_channel *cmd_wait_for_add(const char *); ! static void cmd_wait_for_remove(struct wait_channel *wc); ! static struct wait_channel * cmd_wait_for_add(const char *name) { struct wait_channel *wc; *************** *** 97,103 **** return (wc); } ! void cmd_wait_for_remove(struct wait_channel *wc) { if (wc->locked) --- 96,102 ---- return (wc); } ! static void cmd_wait_for_remove(struct wait_channel *wc) { if (wc->locked) *************** *** 113,119 **** free(wc); } ! enum cmd_retval cmd_wait_for_exec(struct cmd *self, struct cmd_q *cmdq) { struct args *args = self->args; --- 112,118 ---- free(wc); } ! static enum cmd_retval cmd_wait_for_exec(struct cmd *self, struct cmd_q *cmdq) { struct args *args = self->args; *************** *** 132,138 **** return (cmd_wait_for_wait(cmdq, name, wc)); } ! enum cmd_retval cmd_wait_for_signal(__unused struct cmd_q *cmdq, const char *name, struct wait_channel *wc) { --- 131,137 ---- return (cmd_wait_for_wait(cmdq, name, wc)); } ! static enum cmd_retval cmd_wait_for_signal(__unused struct cmd_q *cmdq, const char *name, struct wait_channel *wc) { *************** *** 158,164 **** return (CMD_RETURN_NORMAL); } ! enum cmd_retval cmd_wait_for_wait(struct cmd_q *cmdq, const char *name, struct wait_channel *wc) { --- 157,163 ---- return (CMD_RETURN_NORMAL); } ! static enum cmd_retval cmd_wait_for_wait(struct cmd_q *cmdq, const char *name, struct wait_channel *wc) { *************** *** 185,191 **** return (CMD_RETURN_WAIT); } ! enum cmd_retval cmd_wait_for_lock(struct cmd_q *cmdq, const char *name, struct wait_channel *wc) { --- 184,190 ---- return (CMD_RETURN_WAIT); } ! static enum cmd_retval cmd_wait_for_lock(struct cmd_q *cmdq, const char *name, struct wait_channel *wc) { *************** *** 207,213 **** return (CMD_RETURN_NORMAL); } ! enum cmd_retval cmd_wait_for_unlock(struct cmd_q *cmdq, const char *name, struct wait_channel *wc) { --- 206,212 ---- return (CMD_RETURN_NORMAL); } ! static enum cmd_retval cmd_wait_for_unlock(struct cmd_q *cmdq, const char *name, struct wait_channel *wc) {