summaryrefslogtreecommitdiffstats
path: root/inc
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-01-19 16:48:54 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-01-19 16:48:54 +0100
commit764c3a1e4f21c635c565cf5c20c480dbf48d1599 (patch)
tree35befea8632742fcf9a05354c8a1ca9bc0a3e2d4 /inc
parentb7e20eb84250ce9feeefde8dad2eab448125dc5d (diff)
downloadabrt-764c3a1e4f21c635c565cf5c20c480dbf48d1599.tar.gz
abrt-764c3a1e4f21c635c565cf5c20c480dbf48d1599.tar.xz
abrt-764c3a1e4f21c635c565cf5c20c480dbf48d1599.zip
unify "crash data, "crash info" and "crash report" data types. they are the same
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'inc')
-rw-r--r--inc/CrashTypes.h52
-rw-r--r--inc/CrashTypesSocket.h12
2 files changed, 36 insertions, 28 deletions
diff --git a/inc/CrashTypes.h b/inc/CrashTypes.h
index ccbdd929..4778b707 100644
--- a/inc/CrashTypes.h
+++ b/inc/CrashTypes.h
@@ -1,3 +1,21 @@
+/*
+ Copyright (C) 2009 Abrt team.
+ 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 CRASHTYPES_H_
#define CRASHTYPES_H_
@@ -40,29 +58,19 @@
// <key, data>
typedef map_vector_string_t map_crash_data_t;
-typedef map_crash_data_t map_crash_info_t;
-typedef map_crash_data_t map_crash_report_t;
-typedef std::vector<map_crash_info_t> vector_crash_infos_t;
+typedef std::vector<map_crash_data_t> vector_map_crash_data_t;
-inline void add_crash_data_to_crash_info(map_crash_info_t& pCrashInfo,
- const std::string& pItem,
- const std::string& pContent)
-{
- pCrashInfo[pItem].push_back(CD_TXT);
- pCrashInfo[pItem].push_back(CD_ISNOTEDITABLE);
- pCrashInfo[pItem].push_back(pContent);
-}
+void add_to_crash_data(map_crash_data_t& pCrashData,
+ const char *pItem,
+ const char *pContent);
-inline void add_crash_data_to_crash_report(map_crash_report_t& pCrashReport,
- const std::string& pItem,
- const std::string& pType,
- const std::string& pEditable,
- const std::string& pContent)
-{
- pCrashReport[pItem].push_back(pType);
- pCrashReport[pItem].push_back(pEditable);
- pCrashReport[pItem].push_back(pContent);
-}
+void add_to_crash_data_ext(map_crash_data_t& pCrashData,
+ const char *pItem,
+ const char *pType,
+ const char *pEditable,
+ const char *pContent);
+const std::string& get_crash_data_item_content(const map_crash_data_t& crash_data,
+ const char *key);
-#endif /* CRASHTYPES_H_ */
+#endif
diff --git a/inc/CrashTypesSocket.h b/inc/CrashTypesSocket.h
index 166a8a81..db3ee44e 100644
--- a/inc/CrashTypesSocket.h
+++ b/inc/CrashTypesSocket.h
@@ -70,19 +70,19 @@
#define MESSAGE_CREATE_REPORT "(CREATE_REPORT)"
#define MESSAGE_END_MARKER 23
-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::string crash_data_to_string(const map_crash_data_t& pCrashData);
-inline std::string crash_report_to_string(const map_crash_report_t& pCrashReport)
+inline std::string crash_report_to_string(const map_crash_data_t& pCrashData)
{
- return crash_data_to_string(pCrashReport);
+ return crash_data_to_string(pCrashData);
}
-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);
map_crash_data_t string_to_crash_data(const std::string& pMessage, int& len);
-inline map_crash_report_t string_to_crash_report(const std::string& pMessage)
+inline map_crash_data_t string_to_crash_report(const std::string& pMessage)
{
int len;
return string_to_crash_data(pMessage, len);
}
-#endif /* SOCKETCRASHTYPES_H_ */
+#endif