From 3f76f8076c3e0a5cfcc14852e7f8badc023e4911 Mon Sep 17 00:00:00 2001 From: Kalle Wallin Date: Thu, 24 Jun 2004 14:26:53 +0000 Subject: [PATCH] Renamed mpd version macro git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1643 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/main.c | 10 +++++----- src/mpdclient.h | 12 ++++++++++-- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/main.c b/src/main.c index f2a0e3d..f42a2b0 100644 --- a/src/main.c +++ b/src/main.c @@ -82,6 +82,7 @@ void exit_and_cleanup(void) { screen_exit(); + set_xterm_title(""); printf("\n"); if( mpd ) { @@ -164,10 +165,7 @@ main(int argc, const char *argv[]) } /* set xterm title */ -#ifdef DEBUG - options->enable_xterm_title = 1; set_xterm_title(PACKAGE " version " VERSION); -#endif /* install exit function */ atexit(exit_and_cleanup); @@ -188,9 +186,11 @@ main(int argc, const char *argv[]) mpd->connection->version[1], mpd->connection->version[2]); - if( !MPD_VERSION(mpd, 0,11,0) ) + /* quit if mpd is pre 0.11.0 - song id not supported by mpd */ + if( MPD_VERSION_LT(mpd, 0,11,0) ) { - fprintf(stderr, "MPD version %d.%d.%d is to old (0.11.0 needed).\n", + fprintf(stderr, + _("Error: MPD version %d.%d.%d is to old (0.11.0 needed).\n"), mpd->connection->version[0], mpd->connection->version[1], mpd->connection->version[2]); diff --git a/src/mpdclient.h b/src/mpdclient.h index bb8771f..016d1ba 100644 --- a/src/mpdclient.h +++ b/src/mpdclient.h @@ -2,8 +2,16 @@ #define MPDCLIENT_H #include "libmpdclient.h" -#define MPD_VERSION(c,x,y,z) (c->connection->version[0]*10000+c->connection->version[1]*100+c->connection->version[2] >= \ - x*10000+y*100+z) +#define MPD_VERSION_EQ(c,x,y,z) (c->connection->version[0] == x && \ + c->connection->version[1] == y && \ + c->connection->version[2] == z ) + +#define MPD_VERSION_LT(c,x,y,z) ( c->connection->version[0]connection->version[0]==x && c->connection->version[1]connection->version[0]==x && c->connection->version[1]==y && \ + c->connection->version[2]