diff options
| author | Karel Klic <kklic@redhat.com> | 2010-07-09 13:39:58 +0200 |
|---|---|---|
| committer | Karel Klic <kklic@redhat.com> | 2010-07-09 13:39:58 +0200 |
| commit | ccd23158a4dcbc633085412bd44d8a7f7f07558e (patch) | |
| tree | d7c819929120a0bad5543f88c69b13a9621aa8b3 /lib | |
| parent | b2f2bb041ff31fdc921c0e73ffd5efc664030f3d (diff) | |
| parent | 4619286fb6f0f90f180a4293d5a330e07ea1de73 (diff) | |
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
Diffstat (limited to 'lib')
50 files changed, 89 insertions, 813 deletions
diff --git a/lib/Plugins/Bugzilla.cpp b/lib/Plugins/Bugzilla.cpp index f267b983..f4068a2d 100644 --- a/lib/Plugins/Bugzilla.cpp +++ b/lib/Plugins/Bugzilla.cpp @@ -20,10 +20,10 @@ #include "abrtlib.h" #include "abrt_xmlrpc.h" #include "Bugzilla.h" -#include "CrashTypes.h" -#include "DebugDump.h" -#include "ABRTException.h" -#include "CommLayerInner.h" +#include "crash_types.h" +#include "debug_dump.h" +#include "abrt_exception.h" +#include "comm_layer_inner.h" #ifdef HAVE_CONFIG_H # include <config.h> #endif diff --git a/lib/Plugins/Bugzilla.h b/lib/Plugins/Bugzilla.h index 1c9a06e3..e2090a2a 100644 --- a/lib/Plugins/Bugzilla.h +++ b/lib/Plugins/Bugzilla.h @@ -19,8 +19,8 @@ #ifndef BUGZILLA_H_ #define BUGZILLA_H_ -#include "Plugin.h" -#include "Reporter.h" +#include "plugin.h" +#include "reporter.h" class CReporterBugzilla : public CReporter { diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp index 2a329530..7a48331b 100644 --- a/lib/Plugins/CCpp.cpp +++ b/lib/Plugins/CCpp.cpp @@ -25,9 +25,9 @@ #include "abrtlib.h" #include "strbuf.h" #include "CCpp.h" -#include "ABRTException.h" -#include "DebugDump.h" -#include "CommLayerInner.h" +#include "abrt_exception.h" +#include "debug_dump.h" +#include "comm_layer_inner.h" #include "Polkit.h" #include "backtrace.h" #include "CCpp_sha1.h" diff --git a/lib/Plugins/CCpp.h b/lib/Plugins/CCpp.h index ce6ba7a5..f547686f 100644 --- a/lib/Plugins/CCpp.h +++ b/lib/Plugins/CCpp.h @@ -23,8 +23,8 @@ #define CCPP_H_ #include <string> -#include "Plugin.h" -#include "Analyzer.h" +#include "plugin.h" +#include "analyzer.h" class CAnalyzerCCpp : public CAnalyzer { diff --git a/lib/Plugins/FileTransfer.cpp b/lib/Plugins/FileTransfer.cpp index fd073881..76c56705 100644 --- a/lib/Plugins/FileTransfer.cpp +++ b/lib/Plugins/FileTransfer.cpp @@ -28,9 +28,9 @@ #include "abrtlib.h" #include "abrt_curl.h" #include "FileTransfer.h" -#include "DebugDump.h" -#include "ABRTException.h" -#include "CommLayerInner.h" +#include "debug_dump.h" +#include "abrt_exception.h" +#include "comm_layer_inner.h" using namespace std; diff --git a/lib/Plugins/FileTransfer.h b/lib/Plugins/FileTransfer.h index 8f77223d..5e9f4938 100644 --- a/lib/Plugins/FileTransfer.h +++ b/lib/Plugins/FileTransfer.h @@ -23,8 +23,8 @@ #define FILETRANSFER_H_ #include <string> -#include "Plugin.h" -#include "Action.h" +#include "plugin.h" +#include "action.h" class CFileTransfer : public CAction { diff --git a/lib/Plugins/Kerneloops.cpp b/lib/Plugins/Kerneloops.cpp index 6fb9cb55..64d3e406 100644 --- a/lib/Plugins/Kerneloops.cpp +++ b/lib/Plugins/Kerneloops.cpp @@ -19,9 +19,9 @@ #include "abrtlib.h" #include "Kerneloops.h" -#include "DebugDump.h" -#include "ABRTException.h" -#include "CommLayerInner.h" +#include "debug_dump.h" +#include "abrt_exception.h" +#include "comm_layer_inner.h" static unsigned hash_oops_str(const char *oops_ptr) { diff --git a/lib/Plugins/Kerneloops.h b/lib/Plugins/Kerneloops.h index 9e2010c7..2160f444 100644 --- a/lib/Plugins/Kerneloops.h +++ b/lib/Plugins/Kerneloops.h @@ -27,8 +27,8 @@ #ifndef __INCLUDE_GUARD_KERNELOOPS_H_ #define __INCLUDE_GUARD_KERNELOOPS_H_ -#include "Plugin.h" -#include "Analyzer.h" +#include "plugin.h" +#include "analyzer.h" #include <string> class CAnalyzerKerneloops : public CAnalyzer diff --git a/lib/Plugins/KerneloopsReporter.cpp b/lib/Plugins/KerneloopsReporter.cpp index f14902ff..63efc8b6 100644 --- a/lib/Plugins/KerneloopsReporter.cpp +++ b/lib/Plugins/KerneloopsReporter.cpp @@ -20,8 +20,8 @@ #include "abrtlib.h" #include "abrt_curl.h" #include "KerneloopsReporter.h" -#include "CommLayerInner.h" -#include "ABRTException.h" +#include "comm_layer_inner.h" +#include "abrt_exception.h" /* helpers */ static size_t writefunction(void *ptr, size_t size, size_t nmemb, void *stream) diff --git a/lib/Plugins/KerneloopsReporter.h b/lib/Plugins/KerneloopsReporter.h index 91326526..cb939d0d 100644 --- a/lib/Plugins/KerneloopsReporter.h +++ b/lib/Plugins/KerneloopsReporter.h @@ -27,8 +27,8 @@ #ifndef __INCLUDE_GUARD_KERNELOOPSREPORTER_H_ #define __INCLUDE_GUARD_KERNELOOPSREPORTER_H_ -#include "Plugin.h" -#include "Reporter.h" +#include "plugin.h" +#include "reporter.h" #include <string> diff --git a/lib/Plugins/KerneloopsScanner.cpp b/lib/Plugins/KerneloopsScanner.cpp index 0d27e5e1..b24f2a2b 100644 --- a/lib/Plugins/KerneloopsScanner.cpp +++ b/lib/Plugins/KerneloopsScanner.cpp @@ -25,9 +25,9 @@ #include <syslog.h> #include <asm/unistd.h> /* __NR_syslog */ #include "abrtlib.h" -#include "DebugDump.h" -#include "ABRTException.h" -#include "CommLayerInner.h" +#include "debug_dump.h" +#include "abrt_exception.h" +#include "comm_layer_inner.h" #include "KerneloopsSysLog.h" #include "KerneloopsScanner.h" diff --git a/lib/Plugins/KerneloopsScanner.h b/lib/Plugins/KerneloopsScanner.h index a76d1416..0904146e 100644 --- a/lib/Plugins/KerneloopsScanner.h +++ b/lib/Plugins/KerneloopsScanner.h @@ -27,8 +27,8 @@ #define KERNELOOPSSCANNER_H_ #include "abrt_types.h" -#include "Plugin.h" -#include "Action.h" +#include "plugin.h" +#include "action.h" class CKerneloopsScanner : public CAction { diff --git a/lib/Plugins/Logger.cpp b/lib/Plugins/Logger.cpp index a0c23645..c8f00a3c 100644 --- a/lib/Plugins/Logger.cpp +++ b/lib/Plugins/Logger.cpp @@ -20,9 +20,9 @@ */ #include "abrtlib.h" #include "Logger.h" -#include "DebugDump.h" -#include "CommLayerInner.h" -#include "ABRTException.h" +#include "debug_dump.h" +#include "comm_layer_inner.h" +#include "abrt_exception.h" CLogger::CLogger() : m_sLogPath("/var/log/abrt.log"), diff --git a/lib/Plugins/Logger.h b/lib/Plugins/Logger.h index 8801dd4f..aa7def32 100644 --- a/lib/Plugins/Logger.h +++ b/lib/Plugins/Logger.h @@ -22,8 +22,8 @@ #ifndef LOGGER_H_ #define LOGGER_H_ -#include "Plugin.h" -#include "Reporter.h" +#include "plugin.h" +#include "reporter.h" class CLogger : public CReporter { diff --git a/lib/Plugins/Mailx.cpp b/lib/Plugins/Mailx.cpp index d2039b4f..45c8abe0 100644 --- a/lib/Plugins/Mailx.cpp +++ b/lib/Plugins/Mailx.cpp @@ -20,9 +20,9 @@ */ #include "abrtlib.h" #include "Mailx.h" -#include "DebugDump.h" -#include "ABRTException.h" -#include "CommLayerInner.h" +#include "debug_dump.h" +#include "abrt_exception.h" +#include "comm_layer_inner.h" #define MAILX_COMMAND "/bin/mailx" diff --git a/lib/Plugins/Mailx.h b/lib/Plugins/Mailx.h index c71d83d8..aa870ec6 100644 --- a/lib/Plugins/Mailx.h +++ b/lib/Plugins/Mailx.h @@ -23,8 +23,8 @@ #define MAILX_H_ #include <string> -#include "Plugin.h" -#include "Reporter.h" +#include "plugin.h" +#include "reporter.h" class CMailx : public CReporter { diff --git a/lib/Plugins/Python.cpp b/lib/Plugins/Python.cpp index fc3e41c5..047d1d1a 100644 --- a/lib/Plugins/Python.cpp +++ b/lib/Plugins/Python.cpp @@ -18,8 +18,8 @@ */ #include "abrtlib.h" #include "Python.h" -#include "DebugDump.h" -#include "ABRTException.h" +#include "debug_dump.h" +#include "abrt_exception.h" #include "Python_hash.h" using namespace std; diff --git a/lib/Plugins/Python.h b/lib/Plugins/Python.h index b7eebdad..52655ec7 100644 --- a/lib/Plugins/Python.h +++ b/lib/Plugins/Python.h @@ -20,8 +20,8 @@ #define PYTHON_H_ #include <string> -#include "Plugin.h" -#include "Analyzer.h" +#include "plugin.h" +#include "analyzer.h" class CAnalyzerPython : public CAnalyzer { diff --git a/lib/Plugins/RHTSupport.cpp b/lib/Plugins/RHTSupport.cpp index c9467a43..3d3989c1 100644 --- a/lib/Plugins/RHTSupport.cpp +++ b/lib/Plugins/RHTSupport.cpp @@ -22,10 +22,10 @@ #include "abrtlib.h" #include "abrt_curl.h" #include "abrt_rh_support.h" -#include "CrashTypes.h" -#include "DebugDump.h" -#include "ABRTException.h" -#include "CommLayerInner.h" +#include "crash_types.h" +#include "debug_dump.h" +#include "abrt_exception.h" +#include "comm_layer_inner.h" #include "RHTSupport.h" #ifdef HAVE_CONFIG_H # include <config.h> diff --git a/lib/Plugins/RHTSupport.h b/lib/Plugins/RHTSupport.h index 8f915bab..a96a3b3d 100644 --- a/lib/Plugins/RHTSupport.h +++ b/lib/Plugins/RHTSupport.h @@ -19,8 +19,8 @@ #ifndef RHTICKET_H_ #define RHTICKET_H_ -#include "Plugin.h" -#include "Reporter.h" +#include "plugin.h" +#include "reporter.h" class CReporterRHticket: public CReporter { diff --git a/lib/Plugins/ReportUploader.cpp b/lib/Plugins/ReportUploader.cpp index ae118995..ebe229bf 100644 --- a/lib/Plugins/ReportUploader.cpp +++ b/lib/Plugins/ReportUploader.cpp @@ -20,9 +20,9 @@ #include "abrtlib.h" #include "abrt_curl.h" #include "ReportUploader.h" -#include "DebugDump.h" -#include "ABRTException.h" -#include "CommLayerInner.h" +#include "debug_dump.h" +#include "abrt_exception.h" +#include "comm_layer_inner.h" using namespace std; diff --git a/lib/Plugins/ReportUploader.h b/lib/Plugins/ReportUploader.h index 3611eb9f..4ff780b8 100644 --- a/lib/Plugins/ReportUploader.h +++ b/lib/Plugins/ReportUploader.h @@ -24,8 +24,8 @@ #ifndef REPORTUPLOADER_H_ #define REPORTUPLAODER_H_ -#include "Plugin.h" -#include "Reporter.h" +#include "plugin.h" +#include "reporter.h" class CReportUploader : public CReporter { diff --git a/lib/Plugins/RunApp.cpp b/lib/Plugins/RunApp.cpp index c7d5183b..adab865c 100644 --- a/lib/Plugins/RunApp.cpp +++ b/lib/Plugins/RunApp.cpp @@ -20,9 +20,9 @@ */ #include "abrtlib.h" #include "RunApp.h" -#include "DebugDump.h" -#include "ABRTException.h" -#include "CommLayerInner.h" +#include "debug_dump.h" +#include "abrt_exception.h" +#include "comm_layer_inner.h" #include "abrtlib.h" #define COMMAND 0 diff --git a/lib/Plugins/RunApp.h b/lib/Plugins/RunApp.h index 390b60a2..58f572d0 100644 --- a/lib/Plugins/RunApp.h +++ b/lib/Plugins/RunApp.h @@ -21,7 +21,7 @@ #ifndef RUNAPP_H_ #define RUNAPP_H_ -#include "Action.h" +#include "action.h" #include <string> #include <vector> diff --git a/lib/Plugins/SOSreport.cpp b/lib/Plugins/SOSreport.cpp index 8ca95347..2bc927d6 100644 --- a/lib/Plugins/SOSreport.cpp +++ b/lib/Plugins/SOSreport.cpp @@ -19,11 +19,11 @@ */ #include "abrtlib.h" #include "abrt_types.h" -#include "ABRTException.h" +#include "abrt_exception.h" #include "SOSreport.h" -#include "DebugDump.h" -#include "ABRTException.h" -#include "CommLayerInner.h" +#include "debug_dump.h" +#include "abrt_exception.h" +#include "comm_layer_inner.h" using namespace std; diff --git a/lib/Plugins/SOSreport.h b/lib/Plugins/SOSreport.h index d5c44235..4b32940f 100644 --- a/lib/Plugins/SOSreport.h +++ b/lib/Plugins/SOSreport.h @@ -20,7 +20,7 @@ #ifndef SOSREPORT_H_ #define SOSREPORT_H_ -#include "Action.h" +#include "action.h" class CActionSOSreport : public CAction { diff --git a/lib/Plugins/SQLite3.cpp b/lib/Plugins/SQLite3.cpp index 499346f4..c7f36837 100644 --- a/lib/Plugins/SQLite3.cpp +++ b/lib/Plugins/SQLite3.cpp @@ -21,7 +21,7 @@ #include <sqlite3.h> #include "abrtlib.h" #include "SQLite3.h" -#include "ABRTException.h" +#include "abrt_exception.h" using namespace std; diff --git a/lib/Plugins/SQLite3.h b/lib/Plugins/SQLite3.h index b9dc9e7f..d2af864c 100644 --- a/lib/Plugins/SQLite3.h +++ b/lib/Plugins/SQLite3.h @@ -21,8 +21,8 @@ #ifndef SQLITE3_H_ #define SQLITE3_H_ -#include "Plugin.h" -#include "Database.h" +#include "plugin.h" +#include "database.h" class CSQLite3 : public CDatabase { diff --git a/lib/Utils/ABRTException.cpp b/lib/Utils/ABRTException.cpp index a451cbdf..0ae5d452 100644 --- a/lib/Utils/ABRTException.cpp +++ b/lib/Utils/ABRTException.cpp @@ -16,7 +16,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "ABRTException.h" +#include "abrt_exception.h" CABRTException::CABRTException(abrt_exception_t type, const char* fmt, ...) { diff --git a/lib/Utils/Action.h b/lib/Utils/Action.h deleted file mode 100644 index fc56277b..00000000 --- a/lib/Utils/Action.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - Action.h - header file for action plugin - - Copyright (C) 2009 Zdenek Prikryl (zprikryl@redhat.com) - Copyright (C) 2009 RedHat inc. - - 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., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#ifndef ACTION_H_ -#define ACTION_H_ - -#include "Plugin.h" - -/** - * An abstract class. The class defines an action plugin interface. - */ -class CAction : public CPlugin -{ - public: - /** - * A Method which performs particular action. As the first parameter it - * takes an action directory. It could be either a directory of actual - * crash or it could be a directory contains all crashes. It depends on - * who call the plugin. The plugin can takes arguments, but the plugin - * has to parse them by itself. - * @param pActionDir An actual directory. - * @param pArgs Plugin's arguments. - */ - virtual void Run(const char *pActionDir, const char *pArgs, int force) = 0; -}; - -#endif diff --git a/lib/Utils/Analyzer.h b/lib/Utils/Analyzer.h deleted file mode 100644 index a45bd0e8..00000000 --- a/lib/Utils/Analyzer.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - Analyzer.h - header file for analyzer plugin - - Copyright (C) 2009 Zdenek Prikryl (zprikryl@redhat.com) - Copyright (C) 2009 RedHat inc. - - 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., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#ifndef ANALYZER_H_ -#define ANALYZER_H_ - -#include <string> -#include "Plugin.h" - -/** - * An abstract class. The class defines an analyzer plugin interface. - */ -class CAnalyzer : public CPlugin -{ - public: - /** - * A method, which gets a local UUID of particular crash. The local - * UUID is usualy computed from data which are stored in debugdump dir. - * @param pDebugDumpPath A debugdump dir containing all necessary data. - * @return A local UUID. - */ - virtual std::string GetLocalUUID(const char *pDebugDumpDir) = 0; - /** - * A method, which gets a global UUID of particular crash. - * @param pDebugDumpPath A debugdump dir containing all necessary data. - * @return A global UUID. - */ - virtual std::string GetGlobalUUID(const char *pDebugDumpDir) = 0; - /** - * A method, which takes care of getting all additional data needed - * for computing UUIDs and creating a report. This report could be send - * somewhere afterwards. - * @param pDebugDumpPath A debugdump dir containing all necessary data. - */ - virtual void CreateReport(const char *pDebugDumpDir, int force) = 0; -}; - -#endif /*ANALYZER_H_*/ diff --git a/lib/Utils/CommLayerInner.cpp b/lib/Utils/CommLayerInner.cpp index 9512019d..3c102d6e 100644 --- a/lib/Utils/CommLayerInner.cpp +++ b/lib/Utils/CommLayerInner.cpp @@ -19,7 +19,7 @@ #include <pthread.h> #include <map> #include "abrtlib.h" -#include "CommLayerInner.h" +#include "comm_layer_inner.h" static CObserver *s_pObs; diff --git a/lib/Utils/CommLayerInner.h b/lib/Utils/CommLayerInner.h deleted file mode 100644 index 353cfc76..00000000 --- a/lib/Utils/CommLayerInner.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright (C) 2010 ABRT team - Copyright (C) 2010 RedHat Inc - - 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., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#ifndef COMMLAYERINNER_H_ -#define COMMLAYERINNER_H_ - -#include "Observer.h" - -void init_daemon_logging(CObserver *pObs); - -/* - * Set client's name (dbus ID). NULL unsets it. - */ -void set_client_name(const char* name); - -/* - * Ask a client to warn the user about a non-fatal, but unexpected condition. - * In GUI, it will usually be presented as a popup message. - * Usually there is no need to call it directly, just use [p]error_msg(). - */ -//now static: void warn_client(const char *msg); - -/* - * Logs a message to a client. - * In UI, it will usually appear as a new status line message in GUI, - * or as a new message line in CLI. - */ -void update_client(const char *fmt, ...); - -#endif diff --git a/lib/Utils/CrashTypes.cpp b/lib/Utils/CrashTypes.cpp index 4fc93337..96be28c1 100644 --- a/lib/Utils/CrashTypes.cpp +++ b/lib/Utils/CrashTypes.cpp @@ -18,7 +18,7 @@ */ #include "abrt_types.h" #include "abrtlib.h" -#include "CrashTypes.h" +#include "crash_types.h" const char *const must_have_files[] = { FILENAME_ARCHITECTURE, diff --git a/lib/Utils/DBusCommon.h b/lib/Utils/DBusCommon.h deleted file mode 100644 index 58b4c8dc..00000000 --- a/lib/Utils/DBusCommon.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright (C) 2009 Jiri Moskovcak (jmoskovc@redhat.com) - Copyright (C) 2009 RedHat inc. - - 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., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#ifndef DBUSCOMMON_H_ -#define DBUSCOMMON_H_ - -#include "CrashTypes.h" - -#define ABRTD_DBUS_NAME "com.redhat.abrt" -#define ABRTD_DBUS_PATH "/com/redhat/abrt" -#define ABRTD_DBUS_IFACE "com.redhat.abrt" - -#endif diff --git a/lib/Utils/Database.h b/lib/Utils/Database.h deleted file mode 100644 index a698bcbc..00000000 --- a/lib/Utils/Database.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - Database.h - header file for database plugin - - Copyright (C) 2009 Zdenek Prikryl (zprikryl@redhat.com) - Copyright (C) 2009 RedHat inc. - - 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., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#ifndef DATABASE_H_ -#define DATABASE_H_ - -#include <string> -#include <vector> -#include "Plugin.h" - -/** - * Table - * ===== - * UUID | UID| DebugDumpPath | Count | Reported | Time | Message - * - * primary key (UUID, UID) - */ - -/** - * A struct contains one database row. - */ -typedef struct database_row_t -{ - std::string m_sUUID; /**< A local UUID.*/ - std::string m_sUID; /**< An UID of an user.*/ - std::string m_sInformAll; - std::string m_sDebugDumpDir; /**< A debugdump directory of a crash.*/ - std::string m_sCount; /**< Crash rate.*/ - std::string m_sReported; /**< Is a row reported?*/ - std::string m_sMessage; /**< if a row is reported, then there can be store message abotu that*/ - std::string m_sTime; /**< Time of last occurred crash with same local UUID*/ -} database_row_t; - -/** - * A vector contains one or more database rows. - */ -typedef std::vector<database_row_t> vector_database_rows_t; - -/** - * An abstract class. The class defines a database plugin interface. - */ -class CDatabase : public CPlugin -{ - public: - /** - * A method, which connects to a database. - */ - virtual void Connect() = 0; - /** - * A method, which disconnects from a database. - */ - virtual void DisConnect() = 0; - /** - * A method, which inserts one row to a database. - * @param pUUID A local UUID of a crash. - * @param pUID An UID of an user. - * @param pDebugDumpPath A debugdump path. - * @param pTime Time when a crash occurs. - */ - virtual void Insert_or_Update(const char *crash_id, - bool inform_all_users, - const char *pDebugDumpPath, - const char *pTime) = 0; - /** - * A method, which deletes one row in a database. - * @param pUUID A lodal UUID of a crash. - * @param pUID An UID of an user. - */ - virtual void DeleteRow(const char *crash_id) = 0; - virtual void DeleteRows_by_dir(const char *dump_dir) = 0; - /** - * A method, which sets that particular row was reported. - * @param pUUID A local UUID of a crash. - * @param pUID An UID of an user. - * @param pMessage A text explanation of reported problem - * (where it is stored etc)... - */ - virtual void SetReported(const char *crash_id, - const char *pMessage) = 0; - virtual void SetReportedPerReporter(const char *crash_id, - const char *reporter, - const char *pMessage) = 0; - /** - * A method, which gets all rows which belongs to particular user. - * If the user is root, then all rows are returned. If there are no - * rows, empty vector is returned. - * @param pUID An UID of an user. - * @return A vector of matched rows. - */ - virtual vector_database_rows_t GetUIDData(long caller_uid) = 0; - /** - * A method, which returns one row accordind to UUID of a crash and - * UID of an user. If there are no row, empty row is returned. - * @param pUUID A UUID of a crash. - * @param pUID An UID of an user. - * @return A matched row. - */ - virtual database_row_t GetRow(const char *crash_id) = 0; -}; - -#endif diff --git a/lib/Utils/DebugDump.cpp b/lib/Utils/DebugDump.cpp index 8b3d27d7..30ceacc1 100644 --- a/lib/Utils/DebugDump.cpp +++ b/lib/Utils/DebugDump.cpp @@ -20,9 +20,9 @@ */ #include <sys/utsname.h> #include "abrtlib.h" -#include "DebugDump.h" -#include "ABRTException.h" -#include "CommLayerInner.h" +#include "debug_dump.h" +#include "abrt_exception.h" +#include "comm_layer_inner.h" static bool isdigit_str(const char *str) { diff --git a/lib/Utils/DebugDump.h b/lib/Utils/DebugDump.h deleted file mode 100644 index f8487a65..00000000 --- a/lib/Utils/DebugDump.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - DebugDump.h - header file for the library caring of writing new reports - to the specific directory - - Copyright (C) 2009 Zdenek Prikryl (zprikryl@redhat.com) - Copyright (C) 2009 RedHat inc. - - 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., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#ifndef DEBUGDUMP_H_ -#define DEBUGDUMP_H_ - -#include <string> - -class CDebugDump -{ - private: - std::string m_sDebugDumpDir; - DIR* m_pGetNextFileDir; - bool m_bOpened; - bool m_bLocked; - uid_t m_uid; - gid_t m_gid; - - void Lock(); - void UnLock(); - - public: - CDebugDump(); - ~CDebugDump(); - - void Open(const char *pDir); - void Create(const char *pDir, uid_t uid); - void Delete(); - void Close(); - - bool Exist(const char* pFileName); - - void LoadText(const char* pName, std::string& pData); - - void SaveText(const char* pName, const char *pData); - void SaveBinary(const char* pName, const char* pData, unsigned pSize); - - void InitGetNextFile(); - /* Pointers may be NULL */ - bool GetNextFile(std::string *short_name, std::string *full_name); -}; - -/** - * Deletes particular debugdump directory. - * @param pDebugDumpDir A debugdump directory. - */ -void delete_debug_dump_dir(const char *pDebugDumpDir); - -#endif diff --git a/lib/Utils/Makefile.am b/lib/Utils/Makefile.am index 56678d49..d0165770 100644 --- a/lib/Utils/Makefile.am +++ b/lib/Utils/Makefile.am @@ -1,7 +1,8 @@ # ABRTUtils has small set of deps. This reduces deps of smaller abrt binaries # ABRTdUtils has much more. It is used by daemon and plugins only lib_LTLIBRARIES = libABRTUtils.la libABRTdUtils.la - +HEADER_DIR = $(srcdir)/../../inc +AM_CPPFLAGS = -I$(HEADER_DIR) AM_YFLAGS = --verbose # Not used just yet: @@ -9,7 +10,7 @@ AM_YFLAGS = --verbose # xconnect.cpp libABRTUtils_la_SOURCES = \ - xfuncs.h xfuncs.cpp \ + xfuncs.cpp \ encbase64.cpp \ read_write.cpp \ logging.cpp \ @@ -20,7 +21,7 @@ libABRTUtils_la_SOURCES = \ spawn.cpp \ stringops.cpp \ dirsize.cpp \ - DebugDump.h DebugDump.cpp \ + DebugDump.cpp \ abrt_dbus.h abrt_dbus.cpp \ CrashTypes.cpp \ ABRTException.cpp \ @@ -51,15 +52,13 @@ libABRTUtils_la_LIBADD = \ libABRTdUtils_la_SOURCES = \ parse_release.cpp \ make_descr.cpp \ - CommLayerInner.h CommLayerInner.cpp \ - abrt_xmlrpc.h abrt_xmlrpc.cpp \ + $(HEADER_DIR)/comm_layer_inner.h CommLayerInner.cpp \ + $(HEADER_DIR)/abrt_xmlrpc.h abrt_xmlrpc.cpp \ abrt_rh_support.h abrt_rh_support.cpp \ abrt_curl.h abrt_curl.cpp \ - Plugin.h Plugin.cpp \ - Polkit.h Polkit.cpp \ - Action.h Database.h Reporter.h Analyzer.h \ - Observer.h \ - DBusCommon.h + $(HEADER_DIR)/plugin.h Plugin.cpp \ + Polkit.h Polkit.cpp + libABRTdUtils_la_CPPFLAGS = \ -Wall -Werror \ -I$(srcdir)/../../inc \ diff --git a/lib/Utils/Observer.h b/lib/Utils/Observer.h deleted file mode 100644 index ec7dfa7b..00000000 --- a/lib/Utils/Observer.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - Copyright (C) 2010 ABRT team - Copyright (C) 2010 RedHat Inc - - 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., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#ifndef OBSERVER_H_ -#define OBSERVER_H_ - -#include <string> -#include <stdint.h> -#include "DBusCommon.h" - -class CObserver { - public: - virtual ~CObserver() {} - virtual void Status(const char *pMessage, const char* peer) = 0; - virtual void Warning(const char *pMessage, const char* peer) = 0; -}; - -#endif diff --git a/lib/Utils/Plugin.cpp b/lib/Utils/Plugin.cpp index 07412657..40fa39de 100644 --- a/lib/Utils/Plugin.cpp +++ b/lib/Utils/Plugin.cpp @@ -16,7 +16,7 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "Plugin.h" +#include "plugin.h" #include "abrtlib.h" CPlugin::CPlugin() {} diff --git a/lib/Utils/Plugin.h b/lib/Utils/Plugin.h deleted file mode 100644 index 367739ff..00000000 --- a/lib/Utils/Plugin.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - Plugin.h - header file for plugin. It contains mandatory macros - and common function for plugins - - Copyright (C) 2009 Zdenek Prikryl (zprikryl@redhat.com) - Copyright (C) 2009 RedHat inc. - - 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., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#ifndef PLUGIN_H_ -#define PLUGIN_H_ - -#include "abrt_types.h" -#include "CrashTypes.h" -#if HAVE_CONFIG_H -# include <config.h> -#endif -#if ENABLE_NLS -# include <libintl.h> -# define _(S) gettext(S) -#else -# define _(S) (S) -#endif - -#define PLUGINS_MAGIC_NUMBER 6 - -#define PLUGINS_CONF_EXTENSION "conf" -#define PLUGINS_LIB_EXTENSION "so" -#define PLUGINS_LIB_PREFIX "lib" - -/** - * An abstract class. The class defines a common plugin interface. If a plugin - * has some settings, then a *Settings(*) method has to be written. - */ -class CPlugin -{ - protected: - map_plugin_settings_t m_pSettings; - - public: - CPlugin(); - /** - * A destructor. - */ - virtual ~CPlugin(); - /** - * A method, which initializes a plugin. It is not mandatory method. - */ - virtual void Init(); - /** - * A method, which deinitializes a plugin. It is not mandatory method. - */ - virtual void DeInit(); - /** - * A method, which takes a settings and apply them. It is not a mandatory method. - * @param pSettings Plugin's settings - */ - virtual void SetSettings(const map_plugin_settings_t& pSettings); - /** - * A method, which return current settings. It is not mandatory method. - * @return Plugin's settings - */ - virtual const map_plugin_settings_t& GetSettings(); -}; - -/** - * An enum of plugin types. - */ -typedef enum { - ANALYZER, /**< An analyzer plugin*/ - ACTION, /**< An action plugin*/ - REPORTER, /**< A reporter plugin*/ - DATABASE, /**< A database plugin*/ - MAX_PLUGIN_TYPE = DATABASE, -} plugin_type_t; - -/** - * A struct contains all needed data about particular plugin. - */ -typedef struct SPluginInfo -{ - const plugin_type_t m_Type; /**< Plugin type.*/ - const char *const m_sName; /**< Plugin name.*/ - const char *const m_sVersion; /**< Plugin version.*/ - const char *const m_sDescription; /**< Plugin description.*/ - const char *const m_sEmail; /**< Plugin author's email.*/ - const char *const m_sWWW; /**< Plugin's home page.*/ - const char *const m_sGTKBuilder; /**< Plugin's gui description.*/ - const int m_nMagicNumber; /**< Plugin magical number.*/ -} plugin_info_t; - -#define PLUGIN_INFO(type, plugin_class, name, version, description, email, www, gtk_builder)\ - extern "C" CPlugin* plugin_new()\ - {\ - return new plugin_class();\ - }\ - extern "C" const plugin_info_t plugin_info =\ - {\ - type,\ - name,\ - version,\ - description,\ - email,\ - www,\ - gtk_builder,\ - PLUGINS_MAGIC_NUMBER,\ - }; - -/* helper functions */ -std::string make_description_bz(const map_crash_data_t& pCrashData); -std::string make_description_reproduce_comment(const map_crash_data_t& pCrashData); -std::string make_description_logger(const map_crash_data_t& pCrashData); - -/** - * Loads settings and stores it in second parameter. On success it - * returns true, otherwise returns false. - * - * @param path A path of config file. - * Config file consists of "key=value" lines. - * @param settings A readed plugin's settings. - * @param skipKeysWithoutValue - * If true, lines in format "key=" (without value) are skipped. - * Otherwise empty value "" is inserted into pSettings. - * @return if it success it returns true, otherwise it returns false. - */ -extern bool LoadPluginSettings(const char *pPath, - map_plugin_settings_t& pSettings, - bool skipKeysWithoutValue = true); - -#endif diff --git a/lib/Utils/Reporter.h b/lib/Utils/Reporter.h deleted file mode 100644 index 4144ec33..00000000 --- a/lib/Utils/Reporter.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - Reporter.h - header file for reporter plugin - - Copyright (C) 2009 Zdenek Prikryl (zprikryl@redhat.com) - Copyright (C) 2009 RedHat inc. - - 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., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#ifndef REPORTER_H_ -#define REPORTER_H_ - -#include <string> -#include "Plugin.h" -#include "CrashTypes.h" - -/** - * An abstract class. The class defines a reporter plugin interface. - */ -class CReporter : public CPlugin -{ - public: - /** - * A method, which reports a crash report to particular receiver. - * The plugin can takes arguments, but the plugin has to parse them - * by itself. - * @param pCrashData A crash report. - * @param pArgs Plugin's arguments. - * @retun A message which can be displayed after a report is created. - */ - virtual std::string Report(const map_crash_data_t& pCrashData, - const map_plugin_settings_t& pSettings, - const char *pArgs) = 0; -}; - -#endif /* REPORTER_H_ */ diff --git a/lib/Utils/abrt_curl.cpp b/lib/Utils/abrt_curl.cpp index 49d6e0b3..0eea9dbe 100644 --- a/lib/Utils/abrt_curl.cpp +++ b/lib/Utils/abrt_curl.cpp @@ -18,7 +18,7 @@ */ #include "abrtlib.h" #include "abrt_curl.h" -#include "CommLayerInner.h" +#include "comm_layer_inner.h" using namespace std; diff --git a/lib/Utils/abrt_rh_support.cpp b/lib/Utils/abrt_rh_support.cpp index a162a437..72523988 100644 --- a/lib/Utils/abrt_rh_support.cpp +++ b/lib/Utils/abrt_rh_support.cpp @@ -24,7 +24,7 @@ #include "abrtlib.h" #include "abrt_curl.h" #include "abrt_xmlrpc.h" -#include "ABRTException.h" +#include "abrt_exception.h" #include "abrt_rh_support.h" using namespace std; diff --git a/lib/Utils/abrt_xmlrpc.cpp b/lib/Utils/abrt_xmlrpc.cpp index cbe09907..0157c2d5 100644 --- a/lib/Utils/abrt_xmlrpc.cpp +++ b/lib/Utils/abrt_xmlrpc.cpp @@ -21,7 +21,7 @@ #endif #include "abrtlib.h" #include "abrt_xmlrpc.h" -#include "ABRTException.h" +#include "abrt_exception.h" void throw_xml_fault(xmlrpc_env *env) { diff --git a/lib/Utils/abrt_xmlrpc.h b/lib/Utils/abrt_xmlrpc.h deleted file mode 100644 index ce770384..00000000 --- a/lib/Utils/abrt_xmlrpc.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright (C) 2010 ABRT team - Copyright (C) 2010 RedHat Inc - - 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., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#ifndef ABRT_XMLRPC_H_ -#define ABRT_XMLRPC_H_ 1 - -#include <curl/curl.h> -#include <xmlrpc-c/base.h> -#include <xmlrpc-c/client.h> - -/* - * Simple class holding XMLRPC connection data. - * Used mainly to ensure we always destroy xmlrpc client and server_info - * on return or throw. - */ - -struct abrt_xmlrpc_conn { - xmlrpc_client* m_pClient; - xmlrpc_server_info* m_pServer_info; - - abrt_xmlrpc_conn(const char* url, bool no_ssl_verify) { new_xmlrpc_client(url, no_ssl_verify); } - /* this never throws exceptions - calls C functions only */ - ~abrt_xmlrpc_conn() { destroy_xmlrpc_client(); } - - void new_xmlrpc_client(const char* url, bool no_ssl_verify); - void destroy_xmlrpc_client(); -}; - -/* Utility functions */ -void throw_xml_fault(xmlrpc_env *env); -void throw_if_xml_fault_occurred(xmlrpc_env *env); - -#endif diff --git a/lib/Utils/hooklib.cpp b/lib/Utils/hooklib.cpp index 10b575a4..68970661 100644 --- a/lib/Utils/hooklib.cpp +++ b/lib/Utils/hooklib.cpp @@ -17,7 +17,7 @@ */ #include "abrtlib.h" #include "hooklib.h" -#include "DebugDump.h" +#include "debug_dump.h" #include <sys/statvfs.h> using namespace std; diff --git a/lib/Utils/make_descr.cpp b/lib/Utils/make_descr.cpp index 7faafcb3..46d9644d 100644 --- a/lib/Utils/make_descr.cpp +++ b/lib/Utils/make_descr.cpp @@ -17,8 +17,8 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "abrtlib.h" -#include "CrashTypes.h" -#include "DebugDump.h" /* FILENAME_ARCHITECTURE etc */ +#include "crash_types.h" +#include "debug_dump.h" /* FILENAME_ARCHITECTURE etc */ #ifdef HAVE_CONFIG_H # include "config.h" #endif diff --git a/lib/Utils/xfuncs.h b/lib/Utils/xfuncs.h deleted file mode 100644 index de785c8e..00000000 --- a/lib/Utils/xfuncs.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - Copyright (C) 2010 ABRT team - Copyright (C) 2010 RedHat Inc - - 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., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -*/ -#ifndef ABRT_XFUNCS_H -#define ABRT_XFUNCS_H - -#include <sys/socket.h> -#include <sys/stat.h> -#include <dirent.h> -#include <stdbool.h> - -#ifdef __cplusplus -extern "C" { -#endif - -extern int ndelay_on(int fd); -extern int ndelay_off(int fd); -extern int close_on_exec_on(int fd); - -extern void* xmalloc(size_t size); -extern void* xrealloc(void *ptr, size_t size); -extern void* xzalloc(size_t size); -extern char* xstrdup(const char *s); -extern char* xstrndup(const char *s, int n); - -extern void xpipe(int filedes[2]); -extern void xdup(int from); -extern void xdup2(int from, int to); -extern void xmove_fd(int from, int to); - -extern void xwrite(int fd, const void *buf, size_t count); -extern void xwrite_str(int fd, const char *str); - -extern off_t xlseek(int fd, off_t offset, int whence); - -extern void xchdir(const char *path); - -extern char* xvasprintf(const char *format, va_list p); -extern char* xasprintf(const char *format, ...); - -extern void xsetenv(const char *key, const char *value); -extern int xsocket(int domain, int type, int protocol); -extern void xbind(int sockfd, struct sockaddr *my_addr, socklen_t addrlen); -extern void xlisten(int s, int backlog); -extern ssize_t xsendto(int s, const void *buf, size_t len, const struct sockaddr *to, socklen_t tolen); -extern void xstat(const char *name, struct stat *stat_buf); - -extern int xopen3(const char *pathname, int flags, int mode); -extern int xopen(const char *pathname, int flags); -extern void xunlink(const char *pathname); - -/* Just testing dent->d_type == DT_REG is wrong: some filesystems - * do not report the type, they report DT_UNKNOWN for every dirent - * (and this is not a bug in filesystem, this is allowed by standards). - * This function handles this case. Note: it returns 0 on symlinks - * even if they point to regular files. - */ -extern int is_regular_file(struct dirent *dent, const char *dirname); -extern bool dot_or_dotdot(const char *filename); -extern char *last_char_is(const char *s, int c); - -extern bool string_to_bool(const char *s); - -extern void xseteuid(uid_t euid); -extern void xsetegid(gid_t egid); -extern void xsetreuid(uid_t ruid, uid_t euid); -extern void xsetregid(gid_t rgid, gid_t egid); - -/* Returns getpwuid(uid)->pw_dir or NULL */ -extern const char *get_home_dir(uid_t uid); - -#ifdef __cplusplus -} -#endif - -#ifdef __cplusplus -std::string ssprintf(const char *format, ...); -std::string concat_path_file(const char *path, const char *filename); -#endif - -#endif |
