aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-07 13:27:31 +0100
committerMax Kellermann <max@duempel.org>2008-11-07 13:27:31 +0100
commit54674384020f5d8019ca71f6c283d18ba32d5171 (patch)
tree8684aa7a9ccd18c808ad265e7c7bb9e283833cdc /src
parent9e8806dadee58efe36151a6bca22d65487ed02ee (diff)
downloadmpd-54674384020f5d8019ca71f6c283d18ba32d5171.tar.gz
mpd-54674384020f5d8019ca71f6c283d18ba32d5171.tar.xz
mpd-54674384020f5d8019ca71f6c283d18ba32d5171.zip
disable more features with --enable-mini
Disable lots of smaller features which don't have a separate configure option: - xterm title - screen list - horizontal scrolling - MPD version number check - key binding checks - character set conversion - bitrate display - highlighting in the file browser - completion / history
Diffstat (limited to '')
-rw-r--r--src/Makefile.am6
-rw-r--r--src/charset.c6
-rw-r--r--src/charset.h2
-rw-r--r--src/i18n.h2
-rw-r--r--src/main.c25
-rw-r--r--src/options.c4
-rw-r--r--src/options.h6
-rw-r--r--src/screen.c31
-rw-r--r--src/screen_browser.c29
-rw-r--r--src/screen_browser.h4
-rw-r--r--src/screen_file.c8
-rw-r--r--src/screen_play.c25
-rw-r--r--src/screen_utils.c2
-rw-r--r--src/screen_utils.h2
-rw-r--r--src/wreadln.c8
-rw-r--r--src/wreadln.h4
16 files changed, 151 insertions, 13 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index e03f645f8..2c0d63d80 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -57,7 +57,6 @@ ncmpc_SOURCES = \
playlist.c \
filelist.c \
options.c\
- conf.c\
command.c\
ncu.c \
screen.c\
@@ -75,6 +74,11 @@ ncmpc_SOURCES = \
utils.c\
str_pool.c
+if NCMPC_MINI
+else
+ncmpc_SOURCES += conf.c
+endif
+
if ENABLE_HELP_SCREEN
ncmpc_SOURCES += screen_help.c
endif
diff --git a/src/charset.c b/src/charset.c
index a0e8bbda4..69e15eb6e 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -23,7 +23,7 @@
#include <string.h>
#include <glib.h>
-#ifdef HAVE_LOCALE_H
+#if defined(HAVE_LOCALE_H) && !defined(NCMPC_MINI)
static bool noconvert = true;
static const char *charset;
@@ -62,7 +62,7 @@ utf8_width(const char *str)
char *
utf8_to_locale(const char *utf8str)
{
-#ifdef HAVE_LOCALE_H
+#if defined(HAVE_LOCALE_H) && !defined(NCMPC_MINI)
gchar *str;
assert(utf8str != NULL);
@@ -85,7 +85,7 @@ utf8_to_locale(const char *utf8str)
char *
locale_to_utf8(const char *localestr)
{
-#ifdef HAVE_LOCALE_H
+#if defined(HAVE_LOCALE_H) && !defined(NCMPC_MINI)
gchar *str;
assert(localestr != NULL);
diff --git a/src/charset.h b/src/charset.h
index 0cb69d135..4dfe13f3f 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -25,7 +25,7 @@
#include <stdbool.h>
#include <stddef.h>
-#ifdef HAVE_LOCALE_H
+#if defined(HAVE_LOCALE_H) && !defined(NCMPC_MINI)
const char *
charset_init(void);
#endif
diff --git a/src/i18n.h b/src/i18n.h
index f99505ed1..64484834a 100644
--- a/src/i18n.h
+++ b/src/i18n.h
@@ -22,7 +22,7 @@
#include "config.h"
/* i18n */
-#ifdef HAVE_LOCALE_H
+#if defined(HAVE_LOCALE_H) && !defined(NCMPC_MINI)
#include <locale.h>
#endif
#ifdef ENABLE_NLS
diff --git a/src/main.c b/src/main.c
index 49c813a7a..6a0336349 100644
--- a/src/main.c
+++ b/src/main.c
@@ -21,7 +21,6 @@
#include "mpdclient.h"
#include "charset.h"
#include "options.h"
-#include "conf.h"
#include "command.h"
#include "ncu.h"
#include "screen.h"
@@ -30,6 +29,10 @@
#include "i18n.h"
#include "gcc.h"
+#ifndef NCMPC_MINI
+#include "conf.h"
+#endif
+
#ifdef ENABLE_LYRICS_SCREEN
#include "lyrics.h"
#endif
@@ -89,6 +92,7 @@ error_callback(mpd_unused mpdclient_t *c, gint error, const gchar *msg)
}
}
+#ifndef NCMPC_MINI
static void
update_xterm_title(void)
{
@@ -113,12 +117,15 @@ update_xterm_title(void)
set_xterm_title("%s", title);
}
}
+#endif
static void
exit_and_cleanup(void)
{
screen_exit();
+#ifndef NCMPC_MINI
set_xterm_title("");
+#endif
printf("\n");
if (mpd) {
@@ -130,7 +137,9 @@ exit_and_cleanup(void)
g_free(options.password);
g_free(options.list_format);
g_free(options.status_format);
+#ifndef NCMPC_MINI
g_free(options.scroll_sep);
+#endif
}
static void
@@ -209,6 +218,7 @@ timer_reconnect(mpd_unused gpointer data)
return FALSE;
}
+#ifndef NCMPC_MINI
/* quit if mpd is pre 0.11.0 - song id not supported by mpd */
if (MPD_VERSION_LT(mpd, 0, 11, 0)) {
screen_status_printf(_("Error: MPD version %d.%d.%d is to old (0.11.0 needed).\n"),
@@ -222,6 +232,7 @@ timer_reconnect(mpd_unused gpointer data)
g_timeout_add(30000, timer_reconnect, NULL);
return FALSE;
}
+#endif
screen_status_printf(_("Connected to %s!"), options.host);
doupdate();
@@ -245,8 +256,10 @@ timer_mpd_update(gpointer data)
reconnect_source_id = g_timeout_add(1000, timer_reconnect,
NULL);
+#ifndef NCMPC_MINI
if (options.enable_xterm_title)
update_xterm_title();
+#endif
screen_update(mpd);
@@ -330,6 +343,7 @@ lirc_event(mpd_unused GIOChannel *source,
}
#endif
+#ifndef NCMPC_MINI
/**
* Check the configured key bindings for errors, and display a status
* message every 10 seconds.
@@ -350,12 +364,13 @@ timer_check_key_bindings(mpd_unused gpointer data)
doupdate();
return TRUE;
}
+#endif
int
main(int argc, const char *argv[])
{
struct sigaction act;
-#ifdef HAVE_LOCALE_H
+#if defined(HAVE_LOCALE_H) && !defined(NCMPC_MINI)
const char *charset = NULL;
#endif
GIOChannel *keyboard_channel;
@@ -364,7 +379,7 @@ main(int argc, const char *argv[])
GIOChannel *lirc_channel = NULL;
#endif
-#ifdef HAVE_LOCALE_H
+#if defined(HAVE_LOCALE_H) && !defined(NCMPC_MINI)
/* time and date formatting */
setlocale(LC_TIME,"");
/* care about sorting order etc */
@@ -390,7 +405,9 @@ main(int argc, const char *argv[])
options_parse(argc, argv);
/* read configuration */
+#ifndef NCMPC_MINI
read_configuration();
+#endif
/* check key bindings */
check_key_bindings(NULL, NULL, 0);
@@ -483,7 +500,9 @@ main(int argc, const char *argv[])
update_source_id = g_timeout_add(update_interval,
timer_mpd_update,
GINT_TO_POINTER(TRUE));
+#ifndef NCMPC_MINI
g_timeout_add(10000, timer_check_key_bindings, NULL);
+#endif
idle_source_id = g_timeout_add(idle_interval, timer_idle, NULL);
screen_paint(mpd);
diff --git a/src/options.c b/src/options.c
index 3c39bdaf6..b6a49e3c6 100644
--- a/src/options.c
+++ b/src/options.c
@@ -55,8 +55,10 @@ options_t options = {
.find_wrap = true,
.wide_cursor = true,
.audible_bell = true,
+#ifndef NCMPC_MINI
.scroll = DEFAULT_SCROLL,
.welcome_screen_list = true,
+#endif
};
static const arg_opt_t option_table[] = {
@@ -353,5 +355,7 @@ options_init(void)
options.status_format = g_strdup(DEFAULT_STATUS_FORMAT);
options.screen_list = g_strsplit_set(DEFAULT_SCREEN_LIST, " ", 0);
options.timedisplay_type = g_strdup(DEFAULT_TIMEDISPLAY_TYPE);
+#ifndef NCMPC_MINI
options.scroll_sep = g_strdup(DEFAULT_SCROLL_SEP);
+#endif
}
diff --git a/src/options.h b/src/options.h
index 5496e78ca..98ad3156e 100644
--- a/src/options.h
+++ b/src/options.h
@@ -16,8 +16,10 @@ typedef struct {
char *key_file;
char *list_format;
char *status_format;
+#ifndef NCMPC_MINI
char *xterm_title_format;
char *scroll_sep;
+#endif
char **screen_list;
char *timedisplay_type;
int port;
@@ -38,13 +40,17 @@ typedef struct {
#endif
bool audible_bell;
bool visible_bell;
+#ifndef NCMPC_MINI
bool enable_xterm_title;
+#endif
#ifdef HAVE_GETMOUSE
bool enable_mouse;
#endif
+#ifndef NCMPC_MINI
bool scroll;
bool visible_bitrate;
bool welcome_screen_list;
+#endif
} options_t;
extern options_t options;
diff --git a/src/screen.c b/src/screen.c
index c333529fd..17641df99 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -36,8 +36,10 @@
#include <time.h>
#include <locale.h>
+#ifndef NCMPC_MINI
/** welcome message time [s] */
static const GTime SCREEN_WELCOME_TIME = 10;
+#endif
/** status message time [s] */
static const GTime SCREEN_STATUS_MESSAGE_TIME = 3;
@@ -48,7 +50,10 @@ static const int SCREEN_MIN_ROWS = 5;
/* screens */
+#ifndef NCMPC_MINI
static gboolean welcome = TRUE;
+#endif
+
struct screen screen;
static const struct screen_functions *mode_fn = &screen_playlist;
static int seek_id = -1;
@@ -124,6 +129,7 @@ paint_top_window2(const char *header, mpdclient_t *c)
if (header[0]) {
colors_use(w, COLOR_TITLE_BOLD);
mvwaddstr(w, 0, 0, header);
+#ifndef NCMPC_MINI
} else {
colors_use(w, COLOR_TITLE_BOLD);
waddstr(w, get_key_names(CMD_SCREEN_HELP, FALSE));
@@ -155,7 +161,9 @@ paint_top_window2(const char *header, mpdclient_t *c)
colors_use(w, COLOR_TITLE);
waddstr(w, _(":Lyrics "));
#endif
+#endif
}
+
if (c->status == NULL || c->status->volume == MPD_STATUS_NO_VOLUME) {
g_snprintf(buf, 32, _("Volume n/a "));
} else {
@@ -249,7 +257,11 @@ paint_status_window(mpdclient_t *c)
mpd_Status *status = c->status;
mpd_Song *song = c->song;
int elapsedTime = 0;
+#ifdef NCMPC_MINI
+ static char bitrate[1];
+#else
char bitrate[16];
+#endif
const char *str = NULL;
int x = 0;
@@ -292,12 +304,14 @@ paint_status_window(mpdclient_t *c)
elapsedTime = seek_target_time;
/* display bitrate if visible-bitrate is true */
+#ifndef NCMPC_MINI
if (options.visible_bitrate) {
g_snprintf(bitrate, 16,
" [%d kbps]", status->bitRate);
} else {
bitrate[0] = '\0';
}
+#endif
/*write out the time, using hours if time over 60 minutes*/
if (c->status->totalTime > 3600) {
@@ -311,22 +325,28 @@ paint_status_window(mpdclient_t *c)
bitrate, elapsedTime/60, elapsedTime%60,
status->totalTime/60, status->totalTime%60 );
}
+#ifndef NCMPC_MINI
} else {
g_snprintf(screen.buf, screen.buf_size,
" [%d kbps]", status->bitRate );
+#endif
}
+#ifndef NCMPC_MINI
} else {
time_t timep;
time(&timep);
strftime(screen.buf, screen.buf_size, "%X ",localtime(&timep));
+#endif
}
/* display song */
if (status != NULL && (IS_PLAYING(status->state) ||
IS_PAUSED(status->state))) {
char songname[MAX_SONGNAME_LENGTH];
+#ifndef NCMPC_MINI
int width = COLS - x - utf8_width(screen.buf);
+#endif
if (song)
strfsong(songname, MAX_SONGNAME_LENGTH,
@@ -336,6 +356,7 @@ paint_status_window(mpdclient_t *c)
colors_use(w, COLOR_STATUS);
/* scroll if the song name is to long */
+#ifndef NCMPC_MINI
if (options.scroll && utf8_width(songname) > (unsigned)width) {
static scroll_state_t st = { 0, 0 };
char *tmp = strscroll(songname, options.scroll_sep, width, &st);
@@ -343,6 +364,7 @@ paint_status_window(mpdclient_t *c)
g_strlcpy(songname, tmp, MAX_SONGNAME_LENGTH);
g_free(tmp);
}
+#endif
//mvwaddnstr(w, 0, x, songname, width);
mvwaddstr(w, 0, x, songname);
}
@@ -554,6 +576,7 @@ screen_paint(mpdclient_t *c)
void
screen_update(mpdclient_t *c)
{
+#ifndef NCMPC_MINI
static int repeat = -1;
static int random_enabled = -1;
static int crossfade = -1;
@@ -597,9 +620,13 @@ screen_update(mpdclient_t *c)
screen.last_cmd==CMD_NONE &&
time(NULL)-screen.start_timestamp <= SCREEN_WELCOME_TIME)
paint_top_window("", c, 0);
- else if (mode_fn->get_title != NULL) {
+ else
+#endif
+ if (mode_fn->get_title != NULL) {
paint_top_window(mode_fn->get_title(screen.buf,screen.buf_size), c, 0);
+#ifndef NCMPC_MINI
welcome = FALSE;
+#endif
} else
paint_top_window("", c, 0);
@@ -756,7 +783,9 @@ void
screen_cmd(mpdclient_t *c, command_t cmd)
{
screen.last_cmd = cmd;
+#ifndef NCMPC_MINI
welcome = FALSE;
+#endif
if (mode_fn->cmd != NULL && mode_fn->cmd(c, cmd))
return;
diff --git a/src/screen_browser.c b/src/screen_browser.c
index 5bea9e490..26dca5285 100644
--- a/src/screen_browser.c
+++ b/src/screen_browser.c
@@ -31,10 +31,14 @@
#define BUFSIZE 1024
+#ifndef NCMPC_MINI
#define HIGHLIGHT (0x01)
+#endif
static const char playlist_format[] = "*%s*";
+#ifndef NCMPC_MINI
+
/* clear the highlight flag for all items in the filelist */
static void
clear_highlights(mpdclient_filelist_t *fl)
@@ -112,6 +116,8 @@ browser_playlist_changed(struct screen_browser *browser, mpdclient_t *c,
}
}
+#endif
+
/* list_window callback */
const char *
browser_lw_callback(unsigned idx, int *highlight, void *data)
@@ -128,7 +134,11 @@ browser_lw_callback(unsigned idx, int *highlight, void *data)
assert(entry != NULL);
entity = entry->entity;
+#ifndef NCMPC_MINI
*highlight = (entry->flags & HIGHLIGHT);
+#else
+ *highlight = false;
+#endif
if( entity == NULL )
return "[..]";
@@ -194,7 +204,9 @@ browser_change_directory(struct screen_browser *browser, mpdclient_t *c,
filelist_free(browser->filelist);
browser->filelist = mpdclient_filelist_get(c, path);
+#ifndef NCMPC_MINI
sync_highlights(c, browser->filelist);
+#endif
idx = filelist_find_directory(browser->filelist, old_path);
g_free(old_path);
@@ -231,17 +243,23 @@ enqueue_and_play(mpdclient_t *c, filelist_entry_t *entry)
mpd_InfoEntity *entity = entry->entity;
mpd_Song *song = entity->info.song;
+#ifndef NCMPC_MINI
if (!(entry->flags & HIGHLIGHT)) {
+#endif
if (mpdclient_cmd_add(c, song) == 0) {
char buf[BUFSIZE];
+#ifndef NCMPC_MINI
entry->flags |= HIGHLIGHT;
+#endif
strfsong(buf, BUFSIZE, options.list_format, song);
screen_status_printf(_("Adding \'%s\' to playlist\n"), buf);
mpdclient_update(c); /* get song id */
} else
return -1;
+#ifndef NCMPC_MINI
}
+#endif
idx = playlist_get_index_from_file(c, song->file);
mpdclient_cmd_play(c, idx);
@@ -328,7 +346,7 @@ add_directory(mpdclient_t *c, char *dir)
static int
browser_select_entry(mpdclient_t *c, filelist_entry_t *entry,
- gboolean toggle)
+ mpd_unused gboolean toggle)
{
assert(entry != NULL);
assert(entry->entity != NULL);
@@ -356,10 +374,15 @@ browser_select_entry(mpdclient_t *c, filelist_entry_t *entry,
assert(entry->entity->info.song != NULL);
- if (!toggle || (entry->flags & HIGHLIGHT) == 0) {
+#ifndef NCMPC_MINI
+ if (!toggle || (entry->flags & HIGHLIGHT) == 0)
+#endif
+ {
mpd_Song *song = entry->entity->info.song;
+#ifndef NCMPC_MINI
entry->flags |= HIGHLIGHT;
+#endif
if (mpdclient_cmd_add(c, song) == 0) {
char buf[BUFSIZE];
@@ -367,6 +390,7 @@ browser_select_entry(mpdclient_t *c, filelist_entry_t *entry,
strfsong(buf, BUFSIZE, options.list_format, song);
screen_status_printf(_("Adding \'%s\' to playlist\n"), buf);
}
+#ifndef NCMPC_MINI
} else {
/* remove song from playlist */
mpd_Song *song = entry->entity->info.song;
@@ -376,6 +400,7 @@ browser_select_entry(mpdclient_t *c, filelist_entry_t *entry,
while ((idx = playlist_get_index_from_file(c, song->file)) >=0)
mpdclient_cmd_delete(c, idx);
+#endif
}
return 0;
diff --git a/src/screen_browser.h b/src/screen_browser.h
index 802886aa0..57564f1c9 100644
--- a/src/screen_browser.h
+++ b/src/screen_browser.h
@@ -35,6 +35,8 @@ struct screen_browser {
mpdclient_filelist_t *filelist;
};
+#ifndef NCMPC_MINI
+
void
sync_highlights(mpdclient_t *c, mpdclient_filelist_t *fl);
@@ -42,6 +44,8 @@ void
browser_playlist_changed(struct screen_browser *browser, mpdclient_t *c,
int event, gpointer data);
+#endif
+
const char *browser_lw_callback(unsigned index, int *highlight, void *filelist);
int
diff --git a/src/screen_file.c b/src/screen_file.c
index b14b3b104..5a81e8fb8 100644
--- a/src/screen_file.c
+++ b/src/screen_file.c
@@ -58,12 +58,15 @@ file_changed_callback(mpdclient_t *c, mpd_unused int event,
mpd_unused gpointer data)
{
browser.filelist = mpdclient_filelist_update(c, browser.filelist);
+#ifndef NCMPC_MINI
sync_highlights(c, browser.filelist);
+#endif
list_window_check_selected(browser.lw, filelist_length(browser.filelist));
file_repaint_if_active();
}
+#ifndef NCMPC_MINI
/* the playlist have been updated -> fix highlights */
static void
playlist_changed_callback(mpdclient_t *c, int event, gpointer data)
@@ -72,6 +75,7 @@ playlist_changed_callback(mpdclient_t *c, int event, gpointer data)
file_repaint_if_active();
}
+#endif
static int
handle_save(mpdclient_t *c)
@@ -162,7 +166,9 @@ browse_open(mpd_unused mpdclient_t *c)
{
if (browser.filelist == NULL) {
browser.filelist = mpdclient_filelist_get(c, "");
+#ifndef NCMPC_MINI
mpdclient_install_playlist_callback(c, playlist_changed_callback);
+#endif
mpdclient_install_browse_callback(c, file_changed_callback);
}
}
@@ -216,7 +222,9 @@ browse_cmd(mpdclient_t *c, command_t cmd)
break;
case CMD_SCREEN_UPDATE:
browser.filelist = mpdclient_filelist_update(c, browser.filelist);
+#ifndef NCMPC_MINI
sync_highlights(c, browser.filelist);
+#endif
list_window_check_selected(browser.lw,
filelist_length(browser.filelist));
file_repaint();
diff --git a/src/screen_play.c b/src/screen_play.c
index 90b06aa0e..58bf65a54 100644
--- a/src/screen_play.c
+++ b/src/screen_play.c
@@ -39,12 +39,14 @@
#define MAX_SONG_LENGTH 512
+#ifndef NCMPC_MINI
typedef struct
{
GList **list;
GList **dir_list;
mpdclient_t *c;
} completion_callback_data_t;
+#endif
static struct mpdclient_playlist *playlist;
static int current_song_id = -1;
@@ -127,6 +129,7 @@ center_playing_item(mpdclient_t *c)
list_window_check_selected(lw, length);
}
+#ifndef NCMPC_MINI
static void
save_pre_completion_cb(GCompletion *gcmp, mpd_unused gchar *line, void *data)
{
@@ -148,16 +151,24 @@ save_post_completion_cb(mpd_unused GCompletion *gcmp, mpd_unused gchar *line,
if (g_list_length(items) >= 1)
screen_display_completion_list(items);
}
+#endif
int
playlist_save(mpdclient_t *c, char *name, char *defaultname)
{
gchar *filename;
gint error;
+#ifndef NCMPC_MINI
GCompletion *gcmp;
GList *list = NULL;
completion_callback_data_t data;
+#endif
+
+#ifdef NCMPC_MINI
+ (void)defaultname;
+#endif
+#ifndef NCMPC_MINI
if (name == NULL) {
/* initialize completion support */
gcmp = g_completion_new(NULL);
@@ -186,6 +197,7 @@ playlist_save(mpdclient_t *c, char *name, char *defaultname)
if( filename )
filename=g_strstrip(filename);
} else
+#endif
filename=g_strdup(name);
if (filename == NULL || filename[0] == '\0')
@@ -229,6 +241,7 @@ playlist_save(mpdclient_t *c, char *name, char *defaultname)
return 0;
}
+#ifndef NCMPC_MINI
static void add_dir(GCompletion *gcmp, gchar *dir, GList **dir_list,
GList **list, mpdclient_t *c)
{
@@ -274,11 +287,13 @@ static void add_post_completion_cb(GCompletion *gcmp, gchar *line,
add_dir(gcmp, line, dir_list, list, c);
}
}
+#endif
static int
handle_add_to_playlist(mpdclient_t *c)
{
gchar *path;
+#ifndef NCMPC_MINI
GCompletion *gcmp;
GList *list = NULL;
GList *dir_list = NULL;
@@ -293,21 +308,29 @@ handle_add_to_playlist(mpdclient_t *c)
wrln_completion_callback_data = &data;
wrln_pre_completion_callback = add_pre_completion_cb;
wrln_post_completion_callback = add_post_completion_cb;
+#endif
/* get path */
path = screen_readln(screen.status_window.w,
_("Add: "),
NULL,
NULL,
- gcmp);
+#ifdef NCMPC_MINI
+ NULL
+#else
+ gcmp
+#endif
+ );
/* destroy completion data */
+#ifndef NCMPC_MINI
wrln_completion_callback_data = NULL;
wrln_pre_completion_callback = NULL;
wrln_post_completion_callback = NULL;
g_completion_free(gcmp);
string_list_free(list);
string_list_free(dir_list);
+#endif
/* add the path to the playlist */
if (path && path[0])
diff --git a/src/screen_utils.c b/src/screen_utils.c
index fc8fa90b3..e44d8eb67 100644
--- a/src/screen_utils.c
+++ b/src/screen_utils.c
@@ -244,6 +244,7 @@ screen_display_completion_list(GList *list)
colors_use(w, COLOR_LIST);
}
+#ifndef NCMPC_MINI
void
set_xterm_title(const char *format, ...)
{
@@ -264,3 +265,4 @@ set_xterm_title(const char *format, ...)
options.enable_xterm_title = FALSE;
}
}
+#endif
diff --git a/src/screen_utils.h b/src/screen_utils.h
index 335faceb2..8e0f86d58 100644
--- a/src/screen_utils.h
+++ b/src/screen_utils.h
@@ -36,6 +36,8 @@ gint screen_auth(struct mpdclient *c);
void screen_display_completion_list(GList *list);
+#ifndef NCMPC_MINI
void set_xterm_title(const char *format, ...);
+#endif
#endif
diff --git a/src/wreadln.c b/src/wreadln.c
index 7abfc4ac2..df5b55e8c 100644
--- a/src/wreadln.c
+++ b/src/wreadln.c
@@ -72,9 +72,11 @@ struct wreadln {
/** max items stored in the history list */
static const guint wrln_max_history_length = 32;
+#ifndef NCMPC_MINI
void *wrln_completion_callback_data = NULL;
wrln_gcmp_pre_cb_t wrln_pre_completion_callback = NULL;
wrln_gcmp_post_cb_t wrln_post_completion_callback = NULL;
+#endif
/** converts a byte position to a screen column */
static unsigned
@@ -396,6 +398,10 @@ _wreadln(WINDOW *w,
gint key = 0;
size_t i;
+#ifdef NCMPC_MINI
+ (void)gcmp;
+#endif
+
/* turn off echo */
noecho();
/* make shure the cursor is visible */
@@ -458,6 +464,7 @@ _wreadln(WINDOW *w,
break;
case TAB:
+#ifndef NCMPC_MINI
if (gcmp) {
char *prefix = NULL;
GList *list;
@@ -477,6 +484,7 @@ _wreadln(WINDOW *w,
wrln_post_completion_callback(gcmp, wr.line, list,
wrln_completion_callback_data);
}
+#endif
break;
case KEY_CTRL_G:
diff --git a/src/wreadln.h b/src/wreadln.h
index e1ac67318..e745025d3 100644
--- a/src/wreadln.h
+++ b/src/wreadln.h
@@ -11,6 +11,8 @@
#include <ncurses.h>
#endif
+#ifndef NCMPC_MINI
+
/* completion callback data */
extern void *wrln_completion_callback_data;
@@ -23,6 +25,8 @@ typedef void (*wrln_gcmp_post_cb_t) (GCompletion *gcmp, gchar *s, GList *l,
void *data);
extern wrln_gcmp_post_cb_t wrln_post_completion_callback;
+#endif
+
/* Note, wreadln calls curs_set() and noecho(), to enable cursor and
* disable echo. wreadln will not restore these settings when exiting! */
gchar *wreadln(WINDOW *w, /* the curses window to use */