summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 60edfc5)
raw | patch | inline | side by side (parent: 60edfc5)
author | Kalle Wallin <kaw@linux.se> | |
Mon, 22 Mar 2004 18:09:23 +0000 (18:09 +0000) | ||
committer | Kalle Wallin <kaw@linux.se> | |
Mon, 22 Mar 2004 18:09:23 +0000 (18:09 +0000) |
screen.c | patch | blob | history | |
screen.h | patch | blob | history |
diff --git a/screen.c b/screen.c
index 98c08eb66027c601bf186a9678d74e916bfd4ff9..2d61122fd91cfe08d988bab76080f93a0124a0c6 100644 (file)
--- a/screen.c
+++ b/screen.c
#include <stdlib.h>
#include <unistd.h>
+#include <stdarg.h>
#include <string.h>
#include <time.h>
#include <glib.h>
#include "screen_search.h"
#define STATUS_MESSAGE_TIMEOUT 3
+#define STATUS_LINE_MAX_SIZE 512
static screen_t *screen = NULL;
screen->filelist = list_window_free(screen->filelist);
screen->helplist = list_window_free(screen->helplist);
free(screen->buf);
+ free(screen->findbuf);
free(screen);
screen = NULL;
}
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)
{
screen->rows = LINES;
screen->buf = malloc(screen->cols);
screen->buf_size = screen->cols;
+ screen->findbuf = NULL;
screen->painted = 0;
/* create top window */
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:
diff --git a/screen.h b/screen.h
index 35124240b002f56d46b48b14a9ceca1cc0a2200a..4681319c391d646c39e14aff07b4a832fd0337d5 100644 (file)
--- a/screen.h
+++ b/screen.h
char *buf;
size_t buf_size;
+ char *findbuf;
+
int painted;
} screen_t;
int screen_exit(void);
void screen_resized(int sig);
void screen_status_message(mpd_client_t *c, char *msg);
+void screen_status_printf(mpd_client_t *c, char *format, ...);
char *screen_error(void);
void screen_paint(mpd_client_t *c);
void screen_update(mpd_client_t *c);