Code

moved i18n macros to i18n.h
authorMax Kellermann <max@duempel.org>
Thu, 2 Oct 2008 15:48:00 +0000 (17:48 +0200)
committerMax Kellermann <max@duempel.org>
Thu, 2 Oct 2008 15:48:00 +0000 (17:48 +0200)
Don't make everybody include ncmpc.h just to have generic features.
Move generic i18n macros to a separate header.

18 files changed:
src/Makefile.am
src/colors.c
src/command.c
src/conf.c
src/i18n.h [new file with mode: 0644]
src/main.c
src/ncmpc.h
src/screen.c
src/screen_artist.c
src/screen_browser.c
src/screen_file.c
src/screen_help.c
src/screen_keydef.c
src/screen_lyrics.c
src/screen_play.c
src/screen_search.c
src/screen_utils.c
src/support.c

index 4cc501c107acae64e94c7332f3010b8e52d966b3..59af3b51e3589eee1cfce111319e0e663f4abbbe 100644 (file)
@@ -32,6 +32,7 @@ ncmpc_headers = \
   utils.h\
   ncmpc.h\
        defaults.h \
+       i18n.h \
        screen_browser.h \
        lyrics.h \
        str_pool.h \
index 9f4f6cdcc601d66eba344c621cac6a95c166c216..67f3319ca32a1d0ad3d970d8758532b45573248d 100644 (file)
@@ -19,7 +19,7 @@
  */
 
 #include "colors.h"
-#include "ncmpc.h"
+#include "i18n.h"
 #include "options.h"
 
 #include <stdio.h>
index 0ae90338194157da3b30e2c1f1f1eebf97cfff6f..71ae50e7df970e0985806e6d6d03872d223388b6 100644 (file)
@@ -21,6 +21,7 @@
 #include "command.h"
 #include "config.h"
 #include "ncmpc.h"
+#include "i18n.h"
 #include "mpdclient.h"
 #include "screen.h"
 
index 66f125d0d25763a5a8859ab949b6de768ddce3f7..05eb28ff7081e9b63d35d750f8b1efb7c3573e58 100644 (file)
@@ -22,7 +22,7 @@
 #include "conf.h"
 #include "config.h"
 #include "defaults.h"
-#include "ncmpc.h"
+#include "i18n.h"
 #include "support.h"
 #include "command.h"
 #include "colors.h"
diff --git a/src/i18n.h b/src/i18n.h
new file mode 100644 (file)
index 0000000..f99505e
--- /dev/null
@@ -0,0 +1,39 @@
+/* ncmpc
+ * Copyright (C) 2008 Max Kellermann <max@duempel.org>
+ * This project's homepage is: http://www.musicpd.org
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef I18N_H
+#define I18N_H
+
+#include "config.h"
+
+/* i18n */
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
+#ifdef ENABLE_NLS
+#include <libintl.h>
+#include <glib/gi18n.h>
+#else
+#define  _(x) x
+#define N_(x) x
+#endif
+
+#define YES _("y")
+#define NO _("n")
+
+#endif
index f6043d48a9613bd4e8e93b9e897049b57f4d86c2..641b12e35f8d8a1a63eb2701eaa52e381d44fae3 100644 (file)
@@ -29,6 +29,7 @@
 #include "screen.h"
 #include "screen_utils.h"
 #include "strfsong.h"
+#include "i18n.h"
 #include "gcc.h"
 
 #ifdef ENABLE_LYRICS_SCREEN
index e7da71778d81006e2a1143b5b36fab3fed5b7443..a1cd9f9fdb302125e8edb25f5ff6b758e4045ab3 100644 (file)
@@ -1,25 +1,6 @@
 #ifndef NCMPC_H
 #define NCMPC_H
 
-#ifndef PACKAGE
-#include "config.h"
-#endif
-
-/* i18n */
-#ifdef HAVE_LOCALE_H
-#include <locale.h>
-#endif
-#ifdef ENABLE_NLS
-#include <libintl.h>
-#include <glib/gi18n.h>
-#else
-#define  _(x) x
-#define N_(x) x
-#endif
-
-#define YES   _("y")
-#define NO    _("n")
-
 /* welcome message time [s] */
 #define SCREEN_WELCOME_TIME 10
 
index d0a3c74673bad1896723267b2a98a1a20b5ef921..da758b10dbc9c199d4d3031fd195f005cac9cc61 100644 (file)
@@ -23,6 +23,7 @@
 #include "screen_utils.h"
 #include "config.h"
 #include "ncmpc.h"
+#include "i18n.h"
 #include "support.h"
 #include "mpdclient.h"
 #include "utils.h"
index 0593fee3c45369e0ceb0aff6bb04aa41616f9dd2..351dcf081a620e9ac01894c848e17b4258dda8c0 100644 (file)
@@ -16,7 +16,7 @@
  *
  */
 
-#include "ncmpc.h"
+#include "i18n.h"
 #include "options.h"
 #include "support.h"
 #include "mpdclient.h"
index 6d23980208061a1f5d9bd48ec5f764d28a6c17eb..ab10299c6f6d6947d22e324d8e4b40fc84f5e22c 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "screen_browser.h"
 #include "ncmpc.h"
+#include "i18n.h"
 #include "options.h"
 #include "support.h"
 #include "strfsong.h"
index fa741cd275b39997f099ed641ace302e03f12ea9..0e1800abcc645c2f362c9e8380015288ae45c4fd 100644 (file)
@@ -17,7 +17,7 @@
  */
 
 #include "config.h"
-#include "ncmpc.h"
+#include "i18n.h"
 #include "options.h"
 #include "support.h"
 #include "mpdclient.h"
index 2637af9631f4f88bf7b91ed0057c38dc18d98049..700bc8b65a25cbff90b9edd63c14ec1aec7d3e63 100644 (file)
@@ -17,7 +17,7 @@
  */
 
 #include "config.h"
-#include "ncmpc.h"
+#include "i18n.h"
 #include "mpdclient.h"
 #include "command.h"
 #include "screen.h"
index a37d27d2a0dfb2eda684beef648c30782823e1b5..6e9cb9a25ecde8288bf96df3b4287efb123f6e98 100644 (file)
@@ -16,7 +16,7 @@
  *
  */
 
-#include "ncmpc.h"
+#include "i18n.h"
 #include "mpdclient.h"
 #include "options.h"
 #include "conf.h"
index 83bffdf8d8a2d0f048386a306154e210c10aa724..927b3dd9c486e0009af6d17ac5f7adeed49c9fd1 100644 (file)
@@ -18,7 +18,7 @@
  */
 
 #include <sys/stat.h>
-#include "ncmpc.h"
+#include "i18n.h"
 #include "options.h"
 #include "mpdclient.h"
 #include "command.h"
index 8c564c3fd56c701bf5d2f0a57c7ff7f27a93d6a2..309b9a54ed656c7ebf7b80b2b6a8bcfddcdaf06e 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "config.h"
 #include "ncmpc.h"
+#include "i18n.h"
 #include "options.h"
 #include "support.h"
 #include "mpdclient.h"
index 9d80e15a1d7250540260f84b907fc5690fcf4f96..af34baf7b006d2e0b5618d067c03a0687cd39bf4 100644 (file)
@@ -16,7 +16,7 @@
  *
  */
 
-#include "ncmpc.h"
+#include "i18n.h"
 #include "options.h"
 #include "support.h"
 #include "mpdclient.h"
index 5dfc4263031b9479a355d2c3e2af8b1f22bb6f42..d83015503abd4310bdc268239fb4d2b694359e01 100644 (file)
@@ -20,7 +20,7 @@
 #include "screen.h"
 #include "mpdclient.h"
 #include "config.h"
-#include "ncmpc.h"
+#include "i18n.h"
 #include "support.h"
 #include "options.h"
 #include "colors.h"
index bde8d1914b012fe7cb4a5cf35bb5d26679832b05..94aab41d149629c5353ac0b3e6444f7587ebf341 100644 (file)
@@ -19,7 +19,8 @@
  */
 
 #include "support.h"
-#include "ncmpc.h"
+#include "i18n.h"
+#include "config.h"
 
 #include <assert.h>
 #include <time.h>