summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-08-17 18:55:35 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-08-17 18:55:35 +0200
commit3d7e4711921a936688441ea06c4691a67d5809be (patch)
tree2e9579ccfe53d00bb2b98d79d4fd703b7e91aad5
parent276100c5e7b543dfcaa1dc9f4ee748ca9032d587 (diff)
downloadabrt-3d7e4711921a936688441ea06c4691a67d5809be.tar.gz
abrt-3d7e4711921a936688441ea06c4691a67d5809be.tar.xz
abrt-3d7e4711921a936688441ea06c4691a67d5809be.zip
*: move NLS include and #define _ to abrtlib.h
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--inc/abrtlib.h16
-rw-r--r--inc/plugin.h10
-rw-r--r--lib/plugins/Bugzilla.cpp6
-rw-r--r--lib/plugins/RHTSupport.cpp6
-rw-r--r--lib/utils/make_descr.cpp12
-rw-r--r--lib/utils/parse_release.cpp2
-rw-r--r--src/applet/Applet.cpp12
-rw-r--r--src/applet/CCApplet.cpp6
-rw-r--r--src/cli/CLI.cpp18
-rw-r--r--src/cli/report.cpp18
-rw-r--r--src/daemon/CommLayerServerDBus.cpp13
-rw-r--r--src/daemon/Daemon.cpp18
12 files changed, 47 insertions, 90 deletions
diff --git a/inc/abrtlib.h b/inc/abrtlib.h
index 57097ece..713694b8 100644
--- a/inc/abrtlib.h
+++ b/inc/abrtlib.h
@@ -40,24 +40,30 @@
/* C++ bits */
#include <string>
-#include "abrt_types.h"
-#include "xfuncs.h"
-
/* Some libc's forget to declare these, do it ourself */
extern char **environ;
#if defined(__GLIBC__) && __GLIBC__ < 2
int vdprintf(int d, const char *format, va_list ap);
#endif
-
#define NORETURN __attribute__ ((noreturn))
-
#undef ARRAY_SIZE
#define ARRAY_SIZE(x) ((unsigned)(sizeof(x) / sizeof((x)[0])))
+#if ENABLE_NLS
+# include <libintl.h>
+# define _(S) gettext(S)
+#else
+# define _(S) (S)
+#endif
+
+
+#include "abrt_types.h"
+#include "xfuncs.h"
#include "logging.h"
+
char* skip_whitespace(const char *s);
char* skip_non_whitespace(const char *s);
diff --git a/inc/plugin.h b/inc/plugin.h
index ebad0866..420a7cd8 100644
--- a/inc/plugin.h
+++ b/inc/plugin.h
@@ -22,17 +22,11 @@
#ifndef PLUGIN_H_
#define PLUGIN_H_
-#include "abrt_types.h"
-#include "crash_types.h"
#if HAVE_CONFIG_H
# include <config.h>
#endif
-#if ENABLE_NLS
-# include <libintl.h>
-# define _(S) gettext(S)
-#else
-# define _(S) (S)
-#endif
+#include "abrt_types.h"
+#include "crash_types.h"
#define PLUGINS_MAGIC_NUMBER 6
diff --git a/lib/plugins/Bugzilla.cpp b/lib/plugins/Bugzilla.cpp
index 55a957be..bcdb7730 100644
--- a/lib/plugins/Bugzilla.cpp
+++ b/lib/plugins/Bugzilla.cpp
@@ -17,6 +17,9 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include "abrtlib.h"
#include "abrt_xmlrpc.h"
#include "Bugzilla.h"
@@ -25,9 +28,6 @@
#include "abrt_exception.h"
#include "comm_layer_inner.h"
#include "strbuf.h"
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
#define XML_RPC_SUFFIX "/xmlrpc.cgi"
#define MAX_HOPS 5
diff --git a/lib/plugins/RHTSupport.cpp b/lib/plugins/RHTSupport.cpp
index f056056d..0db227b3 100644
--- a/lib/plugins/RHTSupport.cpp
+++ b/lib/plugins/RHTSupport.cpp
@@ -18,6 +18,9 @@
*/
#define _GNU_SOURCE 1 /* for stpcpy */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
#include <libtar.h>
#include "abrtlib.h"
#include "abrt_curl.h"
@@ -28,9 +31,6 @@
#include "comm_layer_inner.h"
#include "RHTSupport.h"
#include "strbuf.h"
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
using namespace std;
diff --git a/lib/utils/make_descr.cpp b/lib/utils/make_descr.cpp
index 8569100f..dc5273ca 100644
--- a/lib/utils/make_descr.cpp
+++ b/lib/utils/make_descr.cpp
@@ -16,19 +16,13 @@
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include "abrtlib.h"
#include "crash_types.h"
#include "debug_dump.h" /* FILENAME_ARCHITECTURE etc */
#include "strbuf.h"
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-#if ENABLE_NLS
-# include <libintl.h>
-# define _(S) gettext(S)
-#else
-# define _(S) (S)
-#endif
using namespace std;
diff --git a/lib/utils/parse_release.cpp b/lib/utils/parse_release.cpp
index 3d6b572f..0b8bf5eb 100644
--- a/lib/utils/parse_release.cpp
+++ b/lib/utils/parse_release.cpp
@@ -16,10 +16,10 @@
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#include "abrtlib.h"
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
+#include "abrtlib.h"
#include "strbuf.h"
diff --git a/src/applet/Applet.cpp b/src/applet/Applet.cpp
index 85ee0db8..be9c662d 100644
--- a/src/applet/Applet.cpp
+++ b/src/applet/Applet.cpp
@@ -16,21 +16,15 @@
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#include <dbus/dbus-shared.h>
-#include <dbus/dbus-glib.h>
-#include <dbus/dbus-glib-lowlevel.h>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#if HAVE_LOCALE_H
# include <locale.h>
#endif
-#if ENABLE_NLS
-# include <libintl.h>
-# define _(S) gettext(S)
-#else
-# define _(S) (S)
-#endif
+#include <dbus/dbus-shared.h>
+#include <dbus/dbus-glib.h>
+#include <dbus/dbus-glib-lowlevel.h>
#include "abrtlib.h"
#include "abrt_dbus.h"
#include "dbus_common.h"
diff --git a/src/applet/CCApplet.cpp b/src/applet/CCApplet.cpp
index 5349c7a5..4f6c2c65 100644
--- a/src/applet/CCApplet.cpp
+++ b/src/applet/CCApplet.cpp
@@ -19,12 +19,6 @@
#if HAVE_CONFIG_H
# include <config.h>
#endif
-#if ENABLE_NLS
-# include <libintl.h>
-# define _(S) gettext(S)
-#else
-# define _(S) (S)
-#endif
#include "abrtlib.h"
#include "CCApplet.h"
diff --git a/src/cli/CLI.cpp b/src/cli/CLI.cpp
index 276703dc..d1cc13d8 100644
--- a/src/cli/CLI.cpp
+++ b/src/cli/CLI.cpp
@@ -15,6 +15,12 @@
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+#if HAVE_LOCALE_H
+# include <locale.h>
+#endif
#include <getopt.h>
#include "abrt_exception.h"
#include "abrtlib.h"
@@ -22,18 +28,6 @@
#include "dbus_common.h"
#include "report.h"
#include "dbus.h"
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-#if HAVE_LOCALE_H
-# include <locale.h>
-#endif
-#if ENABLE_NLS
-# include <libintl.h>
-# define _(S) gettext(S)
-#else
-# define _(S) (S)
-#endif
/** Creates a localized string from crash time. */
static char *localize_crash_time(const char *timestr)
diff --git a/src/cli/report.cpp b/src/cli/report.cpp
index 96dec553..4c5eb6f1 100644
--- a/src/cli/report.cpp
+++ b/src/cli/report.cpp
@@ -15,6 +15,12 @@
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#include <cassert>
+#include <algorithm>
+#include <termios.h>
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
#include "report.h"
#include "run-command.h"
#include "dbus.h"
@@ -22,18 +28,6 @@
#include "debug_dump.h"
#include "crash_types.h" // FILENAME_* defines
#include "plugin.h" // LoadPluginSettings
-#include <cassert>
-#include <algorithm>
-#include <termios.h>
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-#if ENABLE_NLS
-# include <libintl.h>
-# define _(S) gettext(S)
-#else
-# define _(S) (S)
-#endif
#include "abrt_packages.h"
diff --git a/src/daemon/CommLayerServerDBus.cpp b/src/daemon/CommLayerServerDBus.cpp
index 4b11fc04..4a3c5add 100644
--- a/src/daemon/CommLayerServerDBus.cpp
+++ b/src/daemon/CommLayerServerDBus.cpp
@@ -16,6 +16,9 @@
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
#include <dbus/dbus.h>
#include "abrtlib.h"
#include "abrt_dbus.h"
@@ -28,16 +31,6 @@
// 16kB message limit
#define LIMIT_MESSAGE 16384
-#if HAVE_CONFIG_H
- #include <config.h>
-#endif
-#if ENABLE_NLS
- #include <libintl.h>
- #define _(S) gettext(S)
-#else
- #define _(S) (S)
-#endif
-
/*
* DBus signal emitters
*/
diff --git a/src/daemon/Daemon.cpp b/src/daemon/Daemon.cpp
index 735da5af..a568b477 100644
--- a/src/daemon/Daemon.cpp
+++ b/src/daemon/Daemon.cpp
@@ -16,6 +16,12 @@
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+#if HAVE_LOCALE_H
+# include <locale.h>
+#endif
#include <syslog.h>
#include <pthread.h>
#include <resolv.h> /* res_init */
@@ -25,18 +31,6 @@
#include <xmlrpc-c/base.h>
#include <xmlrpc-c/client.h>
#include <glib.h>
-#if HAVE_CONFIG_H
- #include <config.h>
-#endif
-#if HAVE_LOCALE_H
- #include <locale.h>
-#endif
-#if ENABLE_NLS
- #include <libintl.h>
- #define _(S) gettext(S)
-#else
- #define _(S) (S)
-#endif
#include "abrtlib.h"
#include "abrt_exception.h"
#include "CrashWatcher.h"