summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4522707)
raw | patch | inline | side by side (parent: 4522707)
author | Max Kellermann <max@duempel.org> | |
Thu, 2 Oct 2008 15:48:00 +0000 (17:48 +0200) | ||
committer | Max 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.
Move generic i18n macros to a separate header.
18 files changed:
src/Makefile.am | patch | blob | history | |
src/colors.c | patch | blob | history | |
src/command.c | patch | blob | history | |
src/conf.c | patch | blob | history | |
src/i18n.h | [new file with mode: 0644] | patch | blob |
src/main.c | patch | blob | history | |
src/ncmpc.h | patch | blob | history | |
src/screen.c | patch | blob | history | |
src/screen_artist.c | patch | blob | history | |
src/screen_browser.c | patch | blob | history | |
src/screen_file.c | patch | blob | history | |
src/screen_help.c | patch | blob | history | |
src/screen_keydef.c | patch | blob | history | |
src/screen_lyrics.c | patch | blob | history | |
src/screen_play.c | patch | blob | history | |
src/screen_search.c | patch | blob | history | |
src/screen_utils.c | patch | blob | history | |
src/support.c | patch | blob | history |
diff --git a/src/Makefile.am b/src/Makefile.am
index 4cc501c107acae64e94c7332f3010b8e52d966b3..59af3b51e3589eee1cfce111319e0e663f4abbbe 100644 (file)
--- a/src/Makefile.am
+++ b/src/Makefile.am
utils.h\
ncmpc.h\
defaults.h \
+ i18n.h \
screen_browser.h \
lyrics.h \
str_pool.h \
diff --git a/src/colors.c b/src/colors.c
index 9f4f6cdcc601d66eba344c621cac6a95c166c216..67f3319ca32a1d0ad3d970d8758532b45573248d 100644 (file)
--- a/src/colors.c
+++ b/src/colors.c
*/
#include "colors.h"
-#include "ncmpc.h"
+#include "i18n.h"
#include "options.h"
#include <stdio.h>
diff --git a/src/command.c b/src/command.c
index 0ae90338194157da3b30e2c1f1f1eebf97cfff6f..71ae50e7df970e0985806e6d6d03872d223388b6 100644 (file)
--- a/src/command.c
+++ b/src/command.c
#include "command.h"
#include "config.h"
#include "ncmpc.h"
+#include "i18n.h"
#include "mpdclient.h"
#include "screen.h"
diff --git a/src/conf.c b/src/conf.c
index 66f125d0d25763a5a8859ab949b6de768ddce3f7..05eb28ff7081e9b63d35d750f8b1efb7c3573e58 100644 (file)
--- a/src/conf.c
+++ b/src/conf.c
#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
--- /dev/null
+++ b/src/i18n.h
@@ -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
diff --git a/src/main.c b/src/main.c
index f6043d48a9613bd4e8e93b9e897049b57f4d86c2..641b12e35f8d8a1a63eb2701eaa52e381d44fae3 100644 (file)
--- a/src/main.c
+++ b/src/main.c
#include "screen.h"
#include "screen_utils.h"
#include "strfsong.h"
+#include "i18n.h"
#include "gcc.h"
#ifdef ENABLE_LYRICS_SCREEN
diff --git a/src/ncmpc.h b/src/ncmpc.h
index e7da71778d81006e2a1143b5b36fab3fed5b7443..a1cd9f9fdb302125e8edb25f5ff6b758e4045ab3 100644 (file)
--- a/src/ncmpc.h
+++ b/src/ncmpc.h
#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
diff --git a/src/screen.c b/src/screen.c
index d0a3c74673bad1896723267b2a98a1a20b5ef921..da758b10dbc9c199d4d3031fd195f005cac9cc61 100644 (file)
--- a/src/screen.c
+++ b/src/screen.c
#include "screen_utils.h"
#include "config.h"
#include "ncmpc.h"
+#include "i18n.h"
#include "support.h"
#include "mpdclient.h"
#include "utils.h"
diff --git a/src/screen_artist.c b/src/screen_artist.c
index 0593fee3c45369e0ceb0aff6bb04aa41616f9dd2..351dcf081a620e9ac01894c848e17b4258dda8c0 100644 (file)
--- a/src/screen_artist.c
+++ b/src/screen_artist.c
*
*/
-#include "ncmpc.h"
+#include "i18n.h"
#include "options.h"
#include "support.h"
#include "mpdclient.h"
diff --git a/src/screen_browser.c b/src/screen_browser.c
index 6d23980208061a1f5d9bd48ec5f764d28a6c17eb..ab10299c6f6d6947d22e324d8e4b40fc84f5e22c 100644 (file)
--- a/src/screen_browser.c
+++ b/src/screen_browser.c
#include "screen_browser.h"
#include "ncmpc.h"
+#include "i18n.h"
#include "options.h"
#include "support.h"
#include "strfsong.h"
diff --git a/src/screen_file.c b/src/screen_file.c
index fa741cd275b39997f099ed641ace302e03f12ea9..0e1800abcc645c2f362c9e8380015288ae45c4fd 100644 (file)
--- a/src/screen_file.c
+++ b/src/screen_file.c
*/
#include "config.h"
-#include "ncmpc.h"
+#include "i18n.h"
#include "options.h"
#include "support.h"
#include "mpdclient.h"
diff --git a/src/screen_help.c b/src/screen_help.c
index 2637af9631f4f88bf7b91ed0057c38dc18d98049..700bc8b65a25cbff90b9edd63c14ec1aec7d3e63 100644 (file)
--- a/src/screen_help.c
+++ b/src/screen_help.c
*/
#include "config.h"
-#include "ncmpc.h"
+#include "i18n.h"
#include "mpdclient.h"
#include "command.h"
#include "screen.h"
diff --git a/src/screen_keydef.c b/src/screen_keydef.c
index a37d27d2a0dfb2eda684beef648c30782823e1b5..6e9cb9a25ecde8288bf96df3b4287efb123f6e98 100644 (file)
--- a/src/screen_keydef.c
+++ b/src/screen_keydef.c
*
*/
-#include "ncmpc.h"
+#include "i18n.h"
#include "mpdclient.h"
#include "options.h"
#include "conf.h"
diff --git a/src/screen_lyrics.c b/src/screen_lyrics.c
index 83bffdf8d8a2d0f048386a306154e210c10aa724..927b3dd9c486e0009af6d17ac5f7adeed49c9fd1 100644 (file)
--- a/src/screen_lyrics.c
+++ b/src/screen_lyrics.c
*/
#include <sys/stat.h>
-#include "ncmpc.h"
+#include "i18n.h"
#include "options.h"
#include "mpdclient.h"
#include "command.h"
diff --git a/src/screen_play.c b/src/screen_play.c
index 8c564c3fd56c701bf5d2f0a57c7ff7f27a93d6a2..309b9a54ed656c7ebf7b80b2b6a8bcfddcdaf06e 100644 (file)
--- a/src/screen_play.c
+++ b/src/screen_play.c
#include "config.h"
#include "ncmpc.h"
+#include "i18n.h"
#include "options.h"
#include "support.h"
#include "mpdclient.h"
diff --git a/src/screen_search.c b/src/screen_search.c
index 9d80e15a1d7250540260f84b907fc5690fcf4f96..af34baf7b006d2e0b5618d067c03a0687cd39bf4 100644 (file)
--- a/src/screen_search.c
+++ b/src/screen_search.c
*
*/
-#include "ncmpc.h"
+#include "i18n.h"
#include "options.h"
#include "support.h"
#include "mpdclient.h"
diff --git a/src/screen_utils.c b/src/screen_utils.c
index 5dfc4263031b9479a355d2c3e2af8b1f22bb6f42..d83015503abd4310bdc268239fb4d2b694359e01 100644 (file)
--- a/src/screen_utils.c
+++ b/src/screen_utils.c
#include "screen.h"
#include "mpdclient.h"
#include "config.h"
-#include "ncmpc.h"
+#include "i18n.h"
#include "support.h"
#include "options.h"
#include "colors.h"
diff --git a/src/support.c b/src/support.c
index bde8d1914b012fe7cb4a5cf35bb5d26679832b05..94aab41d149629c5353ac0b3e6444f7587ebf341 100644 (file)
--- a/src/support.c
+++ b/src/support.c
*/
#include "support.h"
-#include "ncmpc.h"
+#include "i18n.h"
+#include "config.h"
#include <assert.h>
#include <time.h>