summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2010-01-19 17:33:57 +0100
committerJiri Moskovcak <jmoskovc@redhat.com>2010-01-19 17:33:57 +0100
commit811e5d7e9917558b9529c42a9cc86a773b31c0c2 (patch)
tree8b62f6718e1bbcd997530a9e38fe57046af302c7 /lib
parent186bde035d2789a0067d8137bdb9afde635802c8 (diff)
parent764c3a1e4f21c635c565cf5c20c480dbf48d1599 (diff)
downloadabrt-811e5d7e9917558b9529c42a9cc86a773b31c0c2.tar.gz
abrt-811e5d7e9917558b9529c42a9cc86a773b31c0c2.tar.xz
abrt-811e5d7e9917558b9529c42a9cc86a773b31c0c2.zip
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
Diffstat (limited to 'lib')
-rw-r--r--lib/Plugins/Bugzilla.cpp34
-rw-r--r--lib/Plugins/Bugzilla.h2
-rw-r--r--lib/Plugins/Catcut.cpp30
-rw-r--r--lib/Plugins/Catcut.h2
-rw-r--r--lib/Plugins/KerneloopsReporter.cpp6
-rw-r--r--lib/Plugins/KerneloopsReporter.h2
-rw-r--r--lib/Plugins/Logger.cpp4
-rw-r--r--lib/Plugins/Logger.h4
-rw-r--r--lib/Plugins/Mailx.cpp8
-rw-r--r--lib/Plugins/Mailx.h2
-rw-r--r--lib/Plugins/TicketUploader.cpp6
-rw-r--r--lib/Plugins/TicketUploader.h2
-rw-r--r--lib/Utils/CrashTypes.cpp61
-rw-r--r--lib/Utils/CrashTypesSocket.cpp12
-rw-r--r--lib/Utils/Makefile.am1
-rw-r--r--lib/Utils/Plugin.h6
-rw-r--r--lib/Utils/Reporter.h4
-rw-r--r--lib/Utils/make_descr.cpp30
-rw-r--r--lib/Utils/test.cpp4
19 files changed, 141 insertions, 79 deletions
diff --git a/lib/Plugins/Bugzilla.cpp b/lib/Plugins/Bugzilla.cpp
index f963eb9c..5fdaa750 100644
--- a/lib/Plugins/Bugzilla.cpp
+++ b/lib/Plugins/Bugzilla.cpp
@@ -32,8 +32,8 @@ struct ctx: public abrt_xmlrpc_conn {
int32_t check_uuid_in_bugzilla(const char* component, const char* UUID);
bool check_cc_and_reporter(uint32_t bug_id, const char* login);
void add_plus_one_cc(uint32_t bug_id, const char* login);
- uint32_t new_bug(const map_crash_report_t& pCrashReport);
- void add_attachments(const char* bug_id_str, const map_crash_report_t& pCrashReport);
+ uint32_t new_bug(const map_crash_data_t& pCrashData);
+ void add_attachments(const char* bug_id_str, const map_crash_data_t& pCrashData);
};
void ctx::login(const char* login, const char* passwd)
@@ -278,22 +278,22 @@ int32_t ctx::check_uuid_in_bugzilla(const char* component, const char* UUID)
return -1;
}
-uint32_t ctx::new_bug(const map_crash_report_t& pCrashReport)
+uint32_t ctx::new_bug(const map_crash_data_t& pCrashData)
{
xmlrpc_env env;
xmlrpc_env_init(&env);
- std::string package = pCrashReport.find(FILENAME_PACKAGE)->second[CD_CONTENT];
- std::string component = pCrashReport.find(FILENAME_COMPONENT)->second[CD_CONTENT];
- std::string release = pCrashReport.find(FILENAME_RELEASE)->second[CD_CONTENT];
- std::string arch = pCrashReport.find(FILENAME_ARCHITECTURE)->second[CD_CONTENT];
- std::string uuid = pCrashReport.find(CD_UUID)->second[CD_CONTENT];
+ std::string package = pCrashData.find(FILENAME_PACKAGE)->second[CD_CONTENT];
+ std::string component = pCrashData.find(FILENAME_COMPONENT)->second[CD_CONTENT];
+ std::string release = pCrashData.find(FILENAME_RELEASE)->second[CD_CONTENT];
+ std::string arch = pCrashData.find(FILENAME_ARCHITECTURE)->second[CD_CONTENT];
+ std::string uuid = pCrashData.find(CD_UUID)->second[CD_CONTENT];
std::string summary = "[abrt] crash in " + package;
std::string status_whiteboard = "abrt_hash:" + uuid;
std::string description = "abrt "VERSION" detected a crash.\n\n";
- description += make_description_bz(pCrashReport);
+ description += make_description_bz(pCrashData);
std::string product;
std::string version;
@@ -346,15 +346,15 @@ uint32_t ctx::new_bug(const map_crash_report_t& pCrashReport)
return bug_id;
}
-void ctx::add_attachments(const char* bug_id_str, const map_crash_report_t& pCrashReport)
+void ctx::add_attachments(const char* bug_id_str, const map_crash_data_t& pCrashData)
{
xmlrpc_env env;
xmlrpc_env_init(&env);
xmlrpc_value* result = NULL;
- map_crash_report_t::const_iterator it = pCrashReport.begin();
- for (; it != pCrashReport.end(); it++)
+ map_crash_data_t::const_iterator it = pCrashData.begin();
+ for (; it != pCrashData.end(); it++)
{
const std::string &filename = it->first;
const std::string &type = it->second[CD_TYPE];
@@ -404,7 +404,7 @@ CReporterBugzilla::CReporterBugzilla() :
CReporterBugzilla::~CReporterBugzilla()
{}
-std::string CReporterBugzilla::Report(const map_crash_report_t& pCrashReport,
+std::string CReporterBugzilla::Report(const map_crash_data_t& pCrashData,
const map_plugin_settings_t& pSettings,
const char *pArgs)
{
@@ -433,8 +433,8 @@ std::string CReporterBugzilla::Report(const map_crash_report_t& pCrashReport,
NoSSLVerify = m_bNoSSLVerify;
}
- std::string component = pCrashReport.find(FILENAME_COMPONENT)->second[CD_CONTENT];
- std::string uuid = pCrashReport.find(CD_UUID)->second[CD_CONTENT];
+ std::string component = pCrashData.find(FILENAME_COMPONENT)->second[CD_CONTENT];
+ std::string uuid = pCrashData.find(CD_UUID)->second[CD_CONTENT];
try
{
ctx bz_server(BugzillaXMLRPC.c_str(), NoSSLVerify);
@@ -462,8 +462,8 @@ std::string CReporterBugzilla::Report(const map_crash_report_t& pCrashReport,
}
update_client(_("Creating new bug..."));
- bug_id = bz_server.new_bug(pCrashReport);
- bz_server.add_attachments(to_string(bug_id).c_str(), pCrashReport);
+ bug_id = bz_server.new_bug(pCrashData);
+ bz_server.add_attachments(to_string(bug_id).c_str(), pCrashData);
update_client(_("Logging out..."));
bz_server.logout();
diff --git a/lib/Plugins/Bugzilla.h b/lib/Plugins/Bugzilla.h
index ee6bc6a5..571d0c60 100644
--- a/lib/Plugins/Bugzilla.h
+++ b/lib/Plugins/Bugzilla.h
@@ -20,7 +20,7 @@ class CReporterBugzilla : public CReporter
CReporterBugzilla();
virtual ~CReporterBugzilla();
- virtual std::string Report(const map_crash_report_t& pCrashReport,
+ virtual std::string Report(const map_crash_data_t& pCrashData,
const map_plugin_settings_t& pSettings,
const char *pArgs);
diff --git a/lib/Plugins/Catcut.cpp b/lib/Plugins/Catcut.cpp
index b69038fb..73316e70 100644
--- a/lib/Plugins/Catcut.cpp
+++ b/lib/Plugins/Catcut.cpp
@@ -215,13 +215,13 @@ struct ctx: public abrt_xmlrpc_conn {
ctx(const char* url, bool no_ssl_verify): abrt_xmlrpc_conn(url, no_ssl_verify) {}
string login(const char* login, const char* passwd);
- string new_bug(const char *auth_cookie, const map_crash_report_t& pCrashReport);
+ string new_bug(const char *auth_cookie, const map_crash_data_t& pCrashData);
string request_upload(const char* auth_cookie, const char* pTicketName,
const char* fileName, const char* description);
void add_attachments(const char* xmlrpc_URL,
const char* auth_cookie,
const char* pTicketName,
- const map_crash_report_t& pCrashReport,
+ const map_crash_data_t& pCrashData,
int retryCount,
int retryDelaySeconds);
};
@@ -263,21 +263,21 @@ ctx::login(const char* login, const char* passwd)
}
string
-ctx::new_bug(const char *auth_cookie, const map_crash_report_t& pCrashReport)
+ctx::new_bug(const char *auth_cookie, const map_crash_data_t& pCrashData)
{
xmlrpc_env env;
xmlrpc_env_init(&env);
- string package = pCrashReport.find(FILENAME_PACKAGE)->second[CD_CONTENT];
- string component = pCrashReport.find(FILENAME_COMPONENT)->second[CD_CONTENT];
- string release = pCrashReport.find(FILENAME_RELEASE)->second[CD_CONTENT];
- string arch = pCrashReport.find(FILENAME_ARCHITECTURE)->second[CD_CONTENT];
- string uuid = pCrashReport.find(CD_UUID)->second[CD_CONTENT];
+ string package = pCrashData.find(FILENAME_PACKAGE)->second[CD_CONTENT];
+ string component = pCrashData.find(FILENAME_COMPONENT)->second[CD_CONTENT];
+ string release = pCrashData.find(FILENAME_RELEASE)->second[CD_CONTENT];
+ string arch = pCrashData.find(FILENAME_ARCHITECTURE)->second[CD_CONTENT];
+ string uuid = pCrashData.find(CD_UUID)->second[CD_CONTENT];
string summary = "[abrt] crash in " + package;
string status_whiteboard = "abrt_hash:" + uuid;
- string description = make_description_catcut(pCrashReport);
+ string description = make_description_catcut(pCrashData);
string product;
string version;
@@ -382,13 +382,13 @@ void
ctx::add_attachments(const char* xmlrpc_URL,
const char* auth_cookie,
const char* pTicketName,
- const map_crash_report_t& pCrashReport,
+ const map_crash_data_t& pCrashData,
int retryCount,
int retryDelaySeconds)
{
- map_crash_report_t::const_iterator it = pCrashReport.begin();
- for (; it != pCrashReport.end(); it++)
+ map_crash_data_t::const_iterator it = pCrashData.begin();
+ for (; it != pCrashData.end(); it++)
{
if (it->second[CD_TYPE] == CD_TXT && it->second[CD_TYPE].size() > CD_TEXT_ATT_SIZE)
{
@@ -446,7 +446,7 @@ CReporterCatcut::CReporterCatcut() :
CReporterCatcut::~CReporterCatcut()
{}
-string CReporterCatcut::Report(const map_crash_report_t& pCrashReport,
+string CReporterCatcut::Report(const map_crash_data_t& pCrashData,
const map_plugin_settings_t& pSettings,
const char *pArgs)
{
@@ -459,14 +459,14 @@ string CReporterCatcut::Report(const map_crash_report_t& pCrashReport,
string message;
if (auth_cookie != "")
{
- string ticket_name = catcut_server.new_bug(auth_cookie.c_str(), pCrashReport);
+ string ticket_name = catcut_server.new_bug(auth_cookie.c_str(), pCrashData);
if (ticket_name != "")
{
catcut_server.add_attachments(
m_sCatcutURL.c_str(),
auth_cookie.c_str(),
ticket_name.c_str(),
- pCrashReport,
+ pCrashData,
m_nRetryCount,
m_nRetryDelay
);
diff --git a/lib/Plugins/Catcut.h b/lib/Plugins/Catcut.h
index 00f486c0..65c70444 100644
--- a/lib/Plugins/Catcut.h
+++ b/lib/Plugins/Catcut.h
@@ -20,7 +20,7 @@ class CReporterCatcut : public CReporter
virtual void SetSettings(const map_plugin_settings_t& pSettings);
- virtual std::string Report(const map_crash_report_t& pCrashReport,
+ virtual std::string Report(const map_crash_data_t& pCrashData,
const map_plugin_settings_t& pSettings,
const char *Args);
};
diff --git a/lib/Plugins/KerneloopsReporter.cpp b/lib/Plugins/KerneloopsReporter.cpp
index 5cb525bc..7c488363 100644
--- a/lib/Plugins/KerneloopsReporter.cpp
+++ b/lib/Plugins/KerneloopsReporter.cpp
@@ -93,7 +93,7 @@ CKerneloopsReporter::CKerneloopsReporter() :
m_sSubmitURL("http://submit.kerneloops.org/submitoops.php")
{}
-std::string CKerneloopsReporter::Report(const map_crash_report_t& pCrashReport,
+std::string CKerneloopsReporter::Report(const map_crash_data_t& pCrashData,
const map_plugin_settings_t& pSettings,
const char *pArgs)
{
@@ -101,8 +101,8 @@ std::string CKerneloopsReporter::Report(const map_crash_report_t& pCrashReport,
update_client(_("Creating and submitting a report..."));
- map_crash_report_t::const_iterator it = pCrashReport.find(FILENAME_KERNELOOPS);
- if (it != pCrashReport.end()) {
+ map_crash_data_t::const_iterator it = pCrashData.find(FILENAME_KERNELOOPS);
+ if (it != pCrashData.end()) {
ret = http_post_to_kerneloops_site(
m_sSubmitURL.c_str(),
it->second[CD_CONTENT].c_str()
diff --git a/lib/Plugins/KerneloopsReporter.h b/lib/Plugins/KerneloopsReporter.h
index 10e5e644..91326526 100644
--- a/lib/Plugins/KerneloopsReporter.h
+++ b/lib/Plugins/KerneloopsReporter.h
@@ -43,7 +43,7 @@ class CKerneloopsReporter : public CReporter
virtual void SetSettings(const map_plugin_settings_t& pSettings);
//ok to delete?
// virtual const map_plugin_settings_t& GetSettings();
- virtual std::string Report(const map_crash_report_t& pCrashReport,
+ virtual std::string Report(const map_crash_data_t& pCrashData,
const map_plugin_settings_t& pSettings,
const char *pArgs);
};
diff --git a/lib/Plugins/Logger.cpp b/lib/Plugins/Logger.cpp
index d6cc124e..f428aec5 100644
--- a/lib/Plugins/Logger.cpp
+++ b/lib/Plugins/Logger.cpp
@@ -59,12 +59,12 @@ void CLogger::SetSettings(const map_plugin_settings_t& pSettings)
// return m_pSettings;
//}
-std::string CLogger::Report(const map_crash_report_t& pCrashReport,
+std::string CLogger::Report(const map_crash_data_t& pCrashData,
const map_plugin_settings_t& pSettings,
const char *pArgs)
{
- std::string description = make_description_logger(pCrashReport);
+ std::string description = make_description_logger(pCrashData);
description += "\n\n\n";
FILE *fOut;
diff --git a/lib/Plugins/Logger.h b/lib/Plugins/Logger.h
index c7d76798..02429b2c 100644
--- a/lib/Plugins/Logger.h
+++ b/lib/Plugins/Logger.h
@@ -1,6 +1,6 @@
/*
Logger.h - header file for Logger reporter plugin
- - it simple writes report to specific file
+ - it simply writes report to specific file
Copyright (C) 2009 Zdenek Prikryl (zprikryl@redhat.com)
Copyright (C) 2009 RedHat inc.
@@ -37,7 +37,7 @@ class CLogger : public CReporter
virtual void SetSettings(const map_plugin_settings_t& pSettings);
//ok to delete?
// virtual const map_plugin_settings_t& GetSettings();
- virtual std::string Report(const map_crash_report_t& pCrashReport,
+ virtual std::string Report(const map_crash_data_t& pCrashData,
const map_plugin_settings_t& pSettings,
const char *pArgs);
};
diff --git a/lib/Plugins/Mailx.cpp b/lib/Plugins/Mailx.cpp
index 2f8448f5..ae8c2dc9 100644
--- a/lib/Plugins/Mailx.cpp
+++ b/lib/Plugins/Mailx.cpp
@@ -65,7 +65,7 @@ static char** append_str_to_vector(char **vec, unsigned &size, const char *str)
return vec;
}
-std::string CMailx::Report(const map_crash_report_t& pCrashReport,
+std::string CMailx::Report(const map_crash_data_t& pCrashData,
const map_plugin_settings_t& pSettings,
const char *pArgs)
{
@@ -75,8 +75,8 @@ std::string CMailx::Report(const map_crash_report_t& pCrashReport,
//TODO: move email body generation to make_descr.cpp
std::string binaryFiles, commonFiles, additionalFiles, UUIDFile;
- map_crash_report_t::const_iterator it;
- for (it = pCrashReport.begin(); it != pCrashReport.end(); it++)
+ map_crash_data_t::const_iterator it;
+ for (it = pCrashData.begin(); it != pCrashData.end(); it++)
{
if (it->second[CD_TYPE] == CD_TXT)
{
@@ -135,7 +135,7 @@ std::string CMailx::Report(const map_crash_report_t& pCrashReport,
args = append_str_to_vector(args, arg_size, m_sEmailTo.c_str());
update_client(_("Sending an email..."));
- const char *uid_str = pCrashReport.find(CD_MWUID)->second[CD_CONTENT].c_str();
+ const char *uid_str = get_crash_data_item_content(pCrashData, CD_MWUID).c_str();
exec_and_feed_input(xatoi_u(uid_str), emailBody.c_str(), args);
while (*args)
diff --git a/lib/Plugins/Mailx.h b/lib/Plugins/Mailx.h
index 1ddb5ff0..619e349c 100644
--- a/lib/Plugins/Mailx.h
+++ b/lib/Plugins/Mailx.h
@@ -41,7 +41,7 @@ class CMailx : public CReporter
virtual void SetSettings(const map_plugin_settings_t& pSettings);
//ok to delete?
// virtual const map_plugin_settings_t& GetSettings();
- virtual std::string Report(const map_crash_report_t& pCrashReport,
+ virtual std::string Report(const map_crash_data_t& pCrashData,
const map_plugin_settings_t& pSettings,
const char *pArgs);
};
diff --git a/lib/Plugins/TicketUploader.cpp b/lib/Plugins/TicketUploader.cpp
index 7483768d..b273ae8b 100644
--- a/lib/Plugins/TicketUploader.cpp
+++ b/lib/Plugins/TicketUploader.cpp
@@ -150,7 +150,7 @@ void CTicketUploader::SendFile(const char *pURL, const char *pFilename)
}
-string CTicketUploader::Report(const map_crash_report_t& pCrashReport,
+string CTicketUploader::Report(const map_crash_data_t& pCrashData,
const map_plugin_settings_t& pSettings,
const char *pArgs)
{
@@ -200,8 +200,8 @@ string CTicketUploader::Report(const map_crash_report_t& pCrashReport,
// Copy each entry into the tarball root,
// files are simply copied, strings are written to a file
- map_crash_report_t::const_iterator it;
- for (it = pCrashReport.begin(); it != pCrashReport.end(); it++)
+ map_crash_data_t::const_iterator it;
+ for (it = pCrashData.begin(); it != pCrashData.end(); it++)
{
if (it->second[CD_TYPE] == CD_TXT)
{
diff --git a/lib/Plugins/TicketUploader.h b/lib/Plugins/TicketUploader.h
index 1bc8f6ba..fcc59f06 100644
--- a/lib/Plugins/TicketUploader.h
+++ b/lib/Plugins/TicketUploader.h
@@ -48,7 +48,7 @@ class CTicketUploader : public CReporter
virtual const map_plugin_settings_t& GetSettings();
virtual void SetSettings(const map_plugin_settings_t& pSettings);
- virtual std::string Report(const map_crash_report_t& pCrashReport,
+ virtual std::string Report(const map_crash_data_t& pCrashData,
const map_plugin_settings_t& pSettings,
const char *pArgs);
};
diff --git a/lib/Utils/CrashTypes.cpp b/lib/Utils/CrashTypes.cpp
new file mode 100644
index 00000000..4824e507
--- /dev/null
+++ b/lib/Utils/CrashTypes.cpp
@@ -0,0 +1,61 @@
+/*
+ Copyright (C) 2010 Denys Vlasenko (dvlasenk@redhat.com)
+ 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.
+*/
+#include "abrt_types.h"
+#include "abrtlib.h"
+#include "CrashTypes.h"
+
+void add_to_crash_data_ext(map_crash_data_t& pCrashData,
+ const char *pItem,
+ const char *pType,
+ const char *pEditable,
+ const char *pContent)
+{
+ map_crash_data_t::iterator it = pCrashData.find(pItem);
+ if (it == pCrashData.end()) {
+ pCrashData[pItem].push_back(pType);
+ pCrashData[pItem].push_back(pEditable);
+ pCrashData[pItem].push_back(pContent);
+ return;
+ }
+ vector_string_t& v = it->second;
+ while (v.size() < 3)
+ v.push_back("");
+ v[CD_TYPE] = pType;
+ v[CD_EDITABLE] = pEditable;
+ v[CD_CONTENT] = pContent;
+}
+
+void add_to_crash_data(map_crash_data_t& pCrashData,
+ const char *pItem,
+ const char *pContent)
+{
+ add_to_crash_data_ext(pCrashData, pItem, CD_TXT, CD_ISNOTEDITABLE, pContent);
+}
+
+const std::string& get_crash_data_item_content(const map_crash_data_t& crash_data, const char *key)
+{
+ map_crash_data_t::const_iterator it = crash_data.find(key);
+ if (it == crash_data.end()) {
+ error_msg_and_die("Error accessing crash data: no ['%s']", key);
+ }
+ if (it->second.size() <= CD_CONTENT) {
+ error_msg_and_die("Error accessing crash data: no ['%s'][%d]", key, CD_CONTENT);
+ }
+ return it->second[CD_CONTENT];
+}
diff --git a/lib/Utils/CrashTypesSocket.cpp b/lib/Utils/CrashTypesSocket.cpp
index 3525c6a5..d555571b 100644
--- a/lib/Utils/CrashTypesSocket.cpp
+++ b/lib/Utils/CrashTypesSocket.cpp
@@ -87,13 +87,13 @@ std::string crash_data_to_string(const map_crash_data_t& pCrashData)
return sCD.str();
}
-std::string crash_infos_to_string(const vector_crash_infos_t& pCrashInfos)
+std::string crash_infos_to_string(const vector_map_crash_data_t& pCrashDatas)
{
std::stringstream sCI;
unsigned int ii;
- for (ii = 0; ii < pCrashInfos.size(); ii++)
+ for (ii = 0; ii < pCrashDatas.size(); ii++)
{
- sCI << crash_data_to_string(pCrashInfos[ii]);
+ sCI << crash_data_to_string(pCrashDatas[ii]);
}
return sCI.str();
}
@@ -164,15 +164,15 @@ map_crash_data_t string_to_crash_data(const std::string& pMessage, int& len)
return ci;
}
-vector_crash_infos_t string_to_crash_infos(const std::string& pMessage)
+vector_map_crash_data_t string_to_crash_infos(const std::string& pMessage)
{
- vector_crash_infos_t vci;
+ vector_map_crash_data_t vci;
std::string message = pMessage;
int len;
while (message != "")
{
- map_crash_info_t crash_info = string_to_crash_data(message, len);
+ map_crash_data_t crash_info = string_to_crash_data(message, len);
if (crash_info.size() == 0)
{
return vci;
diff --git a/lib/Utils/Makefile.am b/lib/Utils/Makefile.am
index a944d977..59607104 100644
--- a/lib/Utils/Makefile.am
+++ b/lib/Utils/Makefile.am
@@ -20,6 +20,7 @@ libABRTUtils_la_SOURCES = \
stringops.cpp \
dirsize.cpp \
DebugDump.h DebugDump.cpp \
+ CrashTypes.cpp \
ABRTException.cpp
libABRTUtils_la_CPPFLAGS = \
-Wall -Werror \
diff --git a/lib/Utils/Plugin.h b/lib/Utils/Plugin.h
index d7108ce9..e8464032 100644
--- a/lib/Utils/Plugin.h
+++ b/lib/Utils/Plugin.h
@@ -120,8 +120,8 @@ typedef struct SPluginInfo
};
/* helper finctions */
-std::string make_description_bz(const map_crash_report_t& pCrashReport);
-std::string make_description_logger(const map_crash_report_t& pCrashReport);
-std::string make_description_catcut(const map_crash_report_t& pCrashReport);
+std::string make_description_bz(const map_crash_data_t& pCrashData);
+std::string make_description_logger(const map_crash_data_t& pCrashData);
+std::string make_description_catcut(const map_crash_data_t& pCrashData);
#endif
diff --git a/lib/Utils/Reporter.h b/lib/Utils/Reporter.h
index 0a06a7c9..e9445f93 100644
--- a/lib/Utils/Reporter.h
+++ b/lib/Utils/Reporter.h
@@ -36,11 +36,11 @@ class CReporter : public CPlugin
* 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 pCrashReport A crash report.
+ * @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_report_t& pCrashReport,
+ virtual std::string Report(const map_crash_data_t& pCrashData,
const map_plugin_settings_t& pSettings,
const char *pArgs) = 0;
};
diff --git a/lib/Utils/make_descr.cpp b/lib/Utils/make_descr.cpp
index 2a0d4a99..e74e9b1d 100644
--- a/lib/Utils/make_descr.cpp
+++ b/lib/Utils/make_descr.cpp
@@ -50,27 +50,27 @@ static void add_content(bool &was_multiline, string& description, const char *he
}
}
-string make_description_bz(const map_crash_report_t& pCrashReport)
+string make_description_bz(const map_crash_data_t& pCrashData)
{
string description;
- map_crash_report_t::const_iterator it;
- map_crash_report_t::const_iterator end = pCrashReport.end();
+ map_crash_data_t::const_iterator it;
+ map_crash_data_t::const_iterator end = pCrashData.end();
bool was_multiline = 0;
- it = pCrashReport.find(CD_REPRODUCE);
+ it = pCrashData.find(CD_REPRODUCE);
if (it != end && it->second[CD_CONTENT] != "1.\n2.\n3.\n")
{
add_content(was_multiline, description, "How to reproduce", it->second[CD_CONTENT].c_str());
}
- it = pCrashReport.find(CD_COMMENT);
+ it = pCrashData.find(CD_COMMENT);
if (it != end)
{
add_content(was_multiline, description, "Comment", it->second[CD_CONTENT].c_str());
}
- it = pCrashReport.begin();
+ it = pCrashData.begin();
for (; it != end; it++)
{
const string &filename = it->first;
@@ -97,13 +97,13 @@ string make_description_bz(const map_crash_report_t& pCrashReport)
return description;
}
-string make_description_logger(const map_crash_report_t& pCrashReport)
+string make_description_logger(const map_crash_data_t& pCrashData)
{
string description;
string long_description;
- map_crash_report_t::const_iterator it = pCrashReport.begin();
- for (; it != pCrashReport.end(); it++)
+ map_crash_data_t::const_iterator it = pCrashData.begin();
+ for (; it != pCrashData.end(); it++)
{
const string &filename = it->first;
const string &type = it->second[CD_TYPE];
@@ -141,13 +141,13 @@ string make_description_logger(const map_crash_report_t& pCrashReport)
}
/* This needs more work to make the result less ugly */
-string make_description_catcut(const map_crash_report_t& pCrashReport)
+string make_description_catcut(const map_crash_data_t& pCrashData)
{
- map_crash_report_t::const_iterator end = pCrashReport.end();
- map_crash_report_t::const_iterator it;
+ map_crash_data_t::const_iterator end = pCrashData.end();
+ map_crash_data_t::const_iterator it;
string howToReproduce;
- it = pCrashReport.find(CD_REPRODUCE);
+ it = pCrashData.find(CD_REPRODUCE);
if (it != end)
{
howToReproduce = "\n\nHow to reproduce\n"
@@ -155,7 +155,7 @@ string make_description_catcut(const map_crash_report_t& pCrashReport)
howToReproduce += it->second[CD_CONTENT];
}
string comment;
- it = pCrashReport.find(CD_COMMENT);
+ it = pCrashData.find(CD_COMMENT);
if (it != end)
{
comment = "\n\nComment\n"
@@ -169,7 +169,7 @@ string make_description_catcut(const map_crash_report_t& pCrashReport)
pDescription += "\n\nAdditional information\n"
"======\n";
- for (it = pCrashReport.begin(); it != end; it++)
+ for (it = pCrashData.begin(); it != end; it++)
{
const string &filename = it->first;
const string &type = it->second[CD_TYPE];
diff --git a/lib/Utils/test.cpp b/lib/Utils/test.cpp
index fbad1db9..160c107b 100644
--- a/lib/Utils/test.cpp
+++ b/lib/Utils/test.cpp
@@ -80,7 +80,7 @@ int main(int argc, char** argv)
std::cout << "-------------------------------------------" << std::endl;
}
/* Try to save it into DB */
- map_crash_info_t crashInfo;
+ map_crash_data_t crashInfo;
if (middleWare.SaveDebugDump(argv[1], crashInfo))
{
std::cout << "Application Crashed! " <<
@@ -91,7 +91,7 @@ int main(int argc, char** argv)
/* Get Report, so user can change data (remove private stuff)
* If we do not want user interaction, just send data immediately
*/
- map_crash_report_t crashReport;
+ map_crash_data_t crashReport;
middleWare.CreateCrashReport(crashInfo[CD_UUID][CD_CONTENT],
crashInfo[CD_UID][CD_CONTENT],
crashReport);