mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
(hline_set_textv): new API.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
d35f0c68dc
commit
dffe01fab1
@ -34,6 +34,7 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "lib/global.h"
|
||||
@ -171,3 +172,18 @@ hline_set_text (WHLine * l, const char *text)
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
hline_set_textv (WHLine * l, const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUF_1K]; /* FIXME: is it enough? */
|
||||
|
||||
va_start (args, format);
|
||||
g_vsnprintf (buf, sizeof (buf), format, args);
|
||||
va_end (args);
|
||||
|
||||
hline_set_text (l, buf);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -28,6 +28,9 @@ typedef struct
|
||||
|
||||
WHLine *hline_new (int y, int x, int width);
|
||||
void hline_set_text (WHLine * l, const char *text);
|
||||
/* *INDENT-OFF* */
|
||||
void hline_set_textv (WHLine * l, const char *format, ...) G_GNUC_PRINTF (2, 3);
|
||||
/* *INDENT-ON* */
|
||||
|
||||
/*** inline functions ****************************************************************************/
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user