diff options
author | sabetts <sabetts> | 2001-08-23 16:58:28 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2001-08-23 16:58:28 +0000 |
commit | 64bf4e18b28591e8b6a6b133b440fa9f28d8e693 (patch) | |
tree | 80245a33b3fc14f3e5e72cd58a77e64848bddb4c /src/bar.c | |
parent | b4bbd9206ca9a5f9b0fec30bb70b04d29e84a8c8 (diff) | |
download | ratpoison-64bf4e18b28591e8b6a6b133b440fa9f28d8e693.zip |
new rudeness command
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; |