Code

disable more features with --enable-mini
authorMax Kellermann <max@duempel.org>
Fri, 7 Nov 2008 12:27:31 +0000 (13:27 +0100)
committerMax Kellermann <max@duempel.org>
Fri, 7 Nov 2008 12:27:31 +0000 (13:27 +0100)
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

16 files changed:
src/Makefile.am
src/charset.c
src/charset.h
src/i18n.h
src/main.c
src/options.c
src/options.h
src/screen.c
src/screen_browser.c
src/screen_browser.h
src/screen_file.c
src/screen_play.c
src/screen_utils.c
src/screen_utils.h
src/wreadln.c
src/wreadln.h

index e03f645f80ca6d4e812686725e8ae962e405614e..2c0d63d802c0798c5f8e74548dcad938e67f6085 100644 (file)
@@ -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
index a0e8bbda4dca3fb07ff55f05d622274502361f6a..69e15eb6e042b6047ac52bbec4be8a6f8041e51a 100644 (file)
@@ -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);
index 0cb69d135bece726bb9077d3e10f862b65843016..4dfe13f3f19f28b490cf73cb8aeba9aa03886c5a 100644 (file)
@@ -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
index f99505ed1a052d4dd659fd244b5881967e30e0bf..64484834a67847a4adc27d7861e2815f6e4f9241 100644 (file)
@@ -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
index 49c813a7a49d83523b3b5012a14aee3b46136fca..6a0336349b14408d3a3a912003c364f267f1097d 100644 (file)
@@ -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"
 #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);
index 3c39bdaf6ff4aae9aa49e67d7153e2b9c43abdf6..b6a49e3c68204d7cdef42abb9271c5c8d0e73145 100644 (file)
@@ -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
 }
index 5496e78ca468a82db9517bb26754d7139a7dd357..98ad3156ecbfd91482667d63e10e8c7c7af9c927 100644 (file)
@@ -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;
index c333529fd21afd9a6a91b196e054b6cef7673c9f..17641df997a2bfb5fc3efdebd16d431c30e8884c 100644 (file)
 #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));
@@ -154,8 +160,10 @@ paint_top_window2(const char *header, mpdclient_t *c)
                waddstr(w, get_key_names(CMD_SCREEN_LYRICS, FALSE));
                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;
index 5bea9e49075158a5eb37a1d2f38e957ddd10c2ca..26dca5285ac533d1f730bb389a3dbe6fed4b3a06 100644 (file)
 
 #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;
index 802886aa0b75b8e167c9b222a9245782a6ecbe3c..57564f1c948e956f112f91963fd66a0cb996ccf5 100644 (file)
@@ -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
index b14b3b10495aac68bd14ad75792ffe45162f1bac..5a81e8fb8c0eccaeaf79f83acfee22d2736da4a4 100644 (file)
@@ -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();
index 90b06aa0eb730d3ef2ee8749a681e7e6dbd05db5..58bf65a545c988d1df68412fa644df30b2c51d8a 100644 (file)
 
 #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])
index fc8fa90b323303ba0b9a0d20ff73ce9953417f5c..e44d8eb67cc03e442ef803af0f1da86a15eca39b 100644 (file)
@@ -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
index 335faceb2b40b0183b6e0dd6e45245deff45a7cb..8e0f86d588533f89b1f594e802f6d74509cd48da 100644 (file)
@@ -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
index 7abfc4ac203a65270f65c0176b812d336ca64d43..df5b55e8c97a9d7ae2477a8363de70fdaab9f1f6 100644 (file)
@@ -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:
index e1ac67318cde15e724ba51ec94867c87f4d1e47d..e745025d347431657c3f7d3313514def1d76b91d 100644 (file)
@@ -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 */