From 3da656b83260ef257675a4ae4c681b3b99f83353 Mon Sep 17 00:00:00 2001 From: Kalle Wallin Date: Mon, 22 Mar 2004 18:09:23 +0000 Subject: Added a find buffer and a function for formated status messages. git-svn-id: https://svn.musicpd.org/ncmpc/trunk@368 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- screen.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'screen.c') diff --git a/screen.c b/screen.c index 98c08eb66..2d61122fd 100644 --- a/screen.c +++ b/screen.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -20,6 +21,7 @@ #include "screen_search.h" #define STATUS_MESSAGE_TIMEOUT 3 +#define STATUS_LINE_MAX_SIZE 512 static screen_t *screen = NULL; @@ -203,6 +205,7 @@ screen_exit(void) screen->filelist = list_window_free(screen->filelist); screen->helplist = list_window_free(screen->helplist); free(screen->buf); + free(screen->findbuf); free(screen); screen = NULL; } @@ -235,6 +238,18 @@ screen_status_message(mpd_client_t *c, char *msg) screen->status_timestamp = time(NULL); } +void +screen_status_printf(mpd_client_t *c, char *format, ...) +{ + char buffer[STATUS_LINE_MAX_SIZE]; + va_list ap; + + va_start(ap,format); + vsnprintf(buffer,sizeof(buffer),format,ap); + va_end(ap); + screen_status_message(c, buffer); +} + int screen_init(void) { @@ -269,6 +284,7 @@ screen_init(void) screen->rows = LINES; screen->buf = malloc(screen->cols); screen->buf_size = screen->cols; + screen->findbuf = NULL; screen->painted = 0; /* create top window */ @@ -503,6 +519,8 @@ screen_cmd(mpd_client_t *c, command_t cmd) break; case CMD_QUIT: exit(EXIT_SUCCESS); + case CMD_LIST_FIND: + case CMD_LIST_FIND_NEXT: case CMD_NONE: case CMD_DELETE: case CMD_SELECT: -- cgit v1.2.3