diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-07-15 17:50:11 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-07-15 17:50:11 +0000 |
commit | 222b8e67435e41869802d3becd4060e9f65f9c9f (patch) | |
tree | 5c83069dd56b20f4d5d1b9790e9aa5c50292d27f /status.c | |
parent | d6908dd9c2dcf4262632692ea554ff4fa4d99bee (diff) | |
download | rtmux-222b8e67435e41869802d3becd4060e9f65f9c9f.tar.gz rtmux-222b8e67435e41869802d3becd4060e9f65f9c9f.tar.bz2 rtmux-222b8e67435e41869802d3becd4060e9f65f9c9f.zip |
Make status_message_set a variadic printf-like function. No functional change -
helpful for a couple of things coming soon.
Diffstat (limited to 'status.c')
-rw-r--r-- | status.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -1,4 +1,4 @@ -/* $Id: status.c,v 1.94 2009-07-15 17:44:47 nicm Exp $ */ +/* $Id: status.c,v 1.95 2009-07-15 17:50:11 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -465,17 +465,20 @@ status_print(struct session *s, struct winlink *wl, struct grid_cell *gc) return (text); } -void -status_message_set(struct client *c, const char *msg) +void printflike2 +status_message_set(struct client *c, const char *fmt, ...) { struct timeval tv; + va_list ap; int delay; delay = options_get_number(&c->session->options, "display-time"); tv.tv_sec = delay / 1000; tv.tv_usec = (delay % 1000) * 1000L; - c->message_string = xstrdup(msg); + va_start(ap, fmt); + xvasprintf(&c->message_string, fmt, ap); + va_end(ap); if (gettimeofday(&c->message_timer, NULL) != 0) fatal("gettimeofday"); timeradd(&c->message_timer, &tv, &c->message_timer); |