diff options
Diffstat (limited to 'src/bar.c')
-rw-r--r-- | src/bar.c | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -29,6 +29,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <stdarg.h> #include "ratpoison.h" @@ -106,6 +107,32 @@ update_window_names (screen_info *s) } void +marked_message_printf (int mark_start, int mark_end, char *fmt, ...) +{ + int size, nchars; + char *buffer; + va_list ap; + + va_start (ap, fmt); + + /* A resonable starting value. */ + size = strlen (fmt) + 1; + buffer = (char *)xmalloc (size); + + nchars = vsnprintf (buffer, size, fmt, ap); + if (nchars >= size) + { + buffer = (char *)xrealloc (buffer, nchars + 1); + vsnprintf (buffer, nchars + 1, fmt, ap); + } + + va_end (ap); + + marked_message (buffer, mark_start, mark_end); + free (buffer); +} + +void marked_message (char *msg, int mark_start, int mark_end) { XGCValues lgv; |