blob: 49bd6692a2682c3e14bd53940203af0c99cc3f93 (
plain) (
tree)
|
|
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <glib.h>
#include <ncurses.h>
#include "libmpdclient.h"
#include "mpc.h"
#include "support.h"
#include "command.h"
#include "screen.h"
char *
screen_readln(WINDOW *w, char *prompt)
{
char buf[256], *line = NULL;
int prompt_len = strlen(prompt);
wclear(w);
wmove(w, 0, 0);
waddstr(w, prompt);
wmove(w, 0, prompt_len);
echo();
curs_set(1);
if( wgetnstr(w, buf, 256) == OK )
line = strdup(buf);
noecho();
curs_set(0);
return line;
}
|