From df1b1d501106687fcf0039dc9771c4455c346df5 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 22 Dec 2010 13:57:14 +0100 Subject: *: rename *crash_dump.* -> *crash_data.* Signed-off-by: Denys Vlasenko --- src/include/Makefile.am | 4 +- src/include/abrt_crash_data.h | 88 +++++++++++++++++++++++++++++++++++ src/include/abrt_crash_dump.h | 88 ----------------------------------- src/include/abrtlib.h | 2 +- src/include/dbus_common.h | 2 +- src/include/plugin.h | 2 +- src/include/report/crash_data.h | 100 ++++++++++++++++++++++++++++++++++++++++ src/include/report/crash_dump.h | 100 ---------------------------------------- 8 files changed, 193 insertions(+), 193 deletions(-) create mode 100644 src/include/abrt_crash_data.h delete mode 100644 src/include/abrt_crash_dump.h create mode 100644 src/include/report/crash_data.h delete mode 100644 src/include/report/crash_dump.h (limited to 'src/include') diff --git a/src/include/Makefile.am b/src/include/Makefile.am index 165c705b..b5d604ef 100644 --- a/src/include/Makefile.am +++ b/src/include/Makefile.am @@ -1,6 +1,6 @@ libreport_includedir = $(includedir)/report libreport_include_HEADERS = \ - report/crash_dump.h \ + report/crash_data.h \ report/dump_dir.h \ report/run_event.h @@ -9,7 +9,7 @@ libabrt_include_HEADERS = \ abrtlib.h \ abrt_types.h \ comm_layer_inner.h \ - abrt_crash_dump.h \ + abrt_crash_data.h \ dbus_common.h \ observer.h \ plugin.h \ diff --git a/src/include/abrt_crash_data.h b/src/include/abrt_crash_data.h new file mode 100644 index 00000000..b3278858 --- /dev/null +++ b/src/include/abrt_crash_data.h @@ -0,0 +1,88 @@ +/* + 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 ABRT_CRASH_DUMP_H_ +#define ABRT_CRASH_DUMP_H_ + +#include "crash_data.h" +#include "abrt_types.h" + +// Text bigger than this usually is attached, not added inline +#define CD_TEXT_ATT_SIZE (2*1024) + +// Keep in sync with CCDump.py: + +// Filenames in dump directory: +// filled by a hook: +#define FILENAME_ANALYZER "analyzer" +#define FILENAME_EXECUTABLE "executable" +#define FILENAME_BINARY "binary" +#define FILENAME_CMDLINE "cmdline" +#define FILENAME_REASON "reason" +#define FILENAME_COREDUMP "coredump" +#define FILENAME_BACKTRACE "backtrace" +#define FILENAME_MEMORYMAP "memorymap" +#define FILENAME_DUPHASH "global_uuid" /* name is compat, to be renamed to "duphash" */ +// Name of the function where the application crashed. +// Optional. +#define FILENAME_CRASH_FUNCTION "crash_function" +// filled by CDebugDump::Create() (which also fills FILENAME_UID): +#define FILENAME_ARCHITECTURE "architecture" +#define FILENAME_KERNEL "kernel" +#define FILENAME_TIME "time" +#define FILENAME_RELEASE "release" /* from /etc/redhat-release */ +// filled by +#define FILENAME_PACKAGE "package" +#define FILENAME_COMPONENT "component" +#define FILENAME_DESCRIPTION "description" /* package descr (not crash descr) */ +#define FILENAME_COMMENT "comment" +#define FILENAME_REPRODUCE "reproduce" +#define FILENAME_RATING "rating" +#define FILENAME_HOSTNAME "hostname" +// Optional. Set to "1" by abrt-handle-upload for every unpacked crashdump +#define FILENAME_REMOTE "remote" +#define FILENAME_TAINTED "kernel_tainted" +// TODO: TicketUploader also has open-coded "TICKET", "CUSTOMER" files + +#define FILENAME_UID "uid" +#define FILENAME_UUID "uuid" +#define FILENAME_INFORMALL "inform_all_users" +#define FILENAME_COUNT "count" +#define FILENAME_MESSAGE "message" +// Not stored as files, added "on the fly": +#define CD_DUMPDIR "DumpDir" +// "Which events are possible (make sense) on this crash dump?" +// (a string with "\n" terminated event names) +#define CD_EVENTS "Events" + + +#ifdef __cplusplus +extern "C" { +#endif + +#define is_editable_file abrt_is_editable_file +bool is_editable_file(const char *file_name); + +#define log_crash_data abrt_log_crash_data +void log_crash_data(crash_data_t *crash_data, const char *pfx); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/include/abrt_crash_dump.h b/src/include/abrt_crash_dump.h deleted file mode 100644 index 9ecbf56d..00000000 --- a/src/include/abrt_crash_dump.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - 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 ABRT_CRASH_DUMP_H_ -#define ABRT_CRASH_DUMP_H_ - -#include "crash_dump.h" -#include "abrt_types.h" - -// Text bigger than this usually is attached, not added inline -#define CD_TEXT_ATT_SIZE (2*1024) - -// Keep in sync with CCDump.py: - -// Filenames in dump directory: -// filled by a hook: -#define FILENAME_ANALYZER "analyzer" -#define FILENAME_EXECUTABLE "executable" -#define FILENAME_BINARY "binary" -#define FILENAME_CMDLINE "cmdline" -#define FILENAME_REASON "reason" -#define FILENAME_COREDUMP "coredump" -#define FILENAME_BACKTRACE "backtrace" -#define FILENAME_MEMORYMAP "memorymap" -#define FILENAME_DUPHASH "global_uuid" /* name is compat, to be renamed to "duphash" */ -// Name of the function where the application crashed. -// Optional. -#define FILENAME_CRASH_FUNCTION "crash_function" -// filled by CDebugDump::Create() (which also fills FILENAME_UID): -#define FILENAME_ARCHITECTURE "architecture" -#define FILENAME_KERNEL "kernel" -#define FILENAME_TIME "time" -#define FILENAME_RELEASE "release" /* from /etc/redhat-release */ -// filled by -#define FILENAME_PACKAGE "package" -#define FILENAME_COMPONENT "component" -#define FILENAME_DESCRIPTION "description" /* package descr (not crash descr) */ -#define FILENAME_COMMENT "comment" -#define FILENAME_REPRODUCE "reproduce" -#define FILENAME_RATING "rating" -#define FILENAME_HOSTNAME "hostname" -// Optional. Set to "1" by abrt-handle-upload for every unpacked crashdump -#define FILENAME_REMOTE "remote" -#define FILENAME_TAINTED "kernel_tainted" -// TODO: TicketUploader also has open-coded "TICKET", "CUSTOMER" files - -#define FILENAME_UID "uid" -#define FILENAME_UUID "uuid" -#define FILENAME_INFORMALL "inform_all_users" -#define FILENAME_COUNT "count" -#define FILENAME_MESSAGE "message" -// Not stored as files, added "on the fly": -#define CD_DUMPDIR "DumpDir" -// "Which events are possible (make sense) on this crash dump?" -// (a string with "\n" terminated event names) -#define CD_EVENTS "Events" - - -#ifdef __cplusplus -extern "C" { -#endif - -#define is_editable_file abrt_is_editable_file -bool is_editable_file(const char *file_name); - -#define log_map_crash_data abrt_log_map_crash_data -void log_map_crash_data(crash_data_t *crash_data, const char *pfx); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/include/abrtlib.h b/src/include/abrtlib.h index d3f355e9..0eb0f2d0 100644 --- a/src/include/abrtlib.h +++ b/src/include/abrtlib.h @@ -77,7 +77,7 @@ int vdprintf(int d, const char *format, va_list ap); #include "hash_sha1.h" #include "hash_md5.h" -#include "abrt_crash_dump.h" +#include "abrt_crash_data.h" #include "abrt_types.h" #include "dump_dir.h" #include "run_event.h" diff --git a/src/include/dbus_common.h b/src/include/dbus_common.h index 6c739169..4e980d34 100644 --- a/src/include/dbus_common.h +++ b/src/include/dbus_common.h @@ -19,7 +19,7 @@ #ifndef DBUSCOMMON_H_ #define DBUSCOMMON_H_ -#include "abrt_crash_dump.h" +#include "abrt_crash_data.h" #define ABRTD_DBUS_NAME "com.redhat.abrt" #define ABRTD_DBUS_PATH "/com/redhat/abrt" diff --git a/src/include/plugin.h b/src/include/plugin.h index 322c212f..e3f1f81f 100644 --- a/src/include/plugin.h +++ b/src/include/plugin.h @@ -23,7 +23,7 @@ #define PLUGIN_H_ #include "abrt_types.h" -#include "abrt_crash_dump.h" +#include "abrt_crash_data.h" #define PLUGINS_MAGIC_NUMBER 6 diff --git a/src/include/report/crash_data.h b/src/include/report/crash_data.h new file mode 100644 index 00000000..86cdadd0 --- /dev/null +++ b/src/include/report/crash_data.h @@ -0,0 +1,100 @@ +/* + 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 CRASH_DUMP_H_ +#define CRASH_DUMP_H_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct dump_dir; + +enum { + CD_FLAG_SYS = (1 << 0), + CD_FLAG_BIN = (1 << 1), + CD_FLAG_TXT = (1 << 2), + CD_FLAG_ISEDITABLE = (1 << 3), + CD_FLAG_ISNOTEDITABLE = (1 << 4), +}; + +struct crash_item { + char *content; + unsigned flags; +}; +typedef struct crash_item crash_item; + +/* In-memory crash data structure and accessors */ + +typedef GHashTable crash_data_t; + +crash_data_t *new_crash_data(void); + +static inline void free_crash_data(crash_data_t *crash_data) +{ + if (crash_data) + g_hash_table_destroy(crash_data); +} + +void add_to_crash_data_ext(crash_data_t *crash_data, + const char *name, + const char *content, + unsigned flags); +/* Uses CD_FLAG_TXT + CD_FLAG_ISNOTEDITABLE flags */ +void add_to_crash_data(crash_data_t *crash_data, + const char *name, + const char *content); + +static inline struct crash_item *get_crash_data_item_or_NULL(crash_data_t *crash_data, const char *key) +{ + return (struct crash_item *)g_hash_table_lookup(crash_data, key); +} +const char *get_crash_item_content_or_NULL(crash_data_t *crash_data, const char *key); +/* Aborts if key is not found: */ +const char *get_crash_item_content_or_die(crash_data_t *crash_data, const char *key); + + +/* Vector of these structures */ + +typedef GPtrArray vector_of_crash_data_t; + +static inline crash_data_t *get_crash_data(vector_of_crash_data_t *vector, unsigned i) +{ + return (crash_data_t *)g_ptr_array_index(vector, i); +} + +vector_of_crash_data_t *new_vector_of_crash_data(void); +static inline void free_vector_of_crash_data(vector_of_crash_data_t *vector) +{ + if (vector) + g_ptr_array_free(vector, TRUE); +} + + +/* Conversions between in-memory and on-disk formats */ + +crash_data_t *load_crash_data_from_dump_dir(struct dump_dir *dd); +struct dump_dir *create_dump_dir(crash_data_t *crash_data, const char *base_dir_name); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/include/report/crash_dump.h b/src/include/report/crash_dump.h deleted file mode 100644 index 86cdadd0..00000000 --- a/src/include/report/crash_dump.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - 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 CRASH_DUMP_H_ -#define CRASH_DUMP_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct dump_dir; - -enum { - CD_FLAG_SYS = (1 << 0), - CD_FLAG_BIN = (1 << 1), - CD_FLAG_TXT = (1 << 2), - CD_FLAG_ISEDITABLE = (1 << 3), - CD_FLAG_ISNOTEDITABLE = (1 << 4), -}; - -struct crash_item { - char *content; - unsigned flags; -}; -typedef struct crash_item crash_item; - -/* In-memory crash data structure and accessors */ - -typedef GHashTable crash_data_t; - -crash_data_t *new_crash_data(void); - -static inline void free_crash_data(crash_data_t *crash_data) -{ - if (crash_data) - g_hash_table_destroy(crash_data); -} - -void add_to_crash_data_ext(crash_data_t *crash_data, - const char *name, - const char *content, - unsigned flags); -/* Uses CD_FLAG_TXT + CD_FLAG_ISNOTEDITABLE flags */ -void add_to_crash_data(crash_data_t *crash_data, - const char *name, - const char *content); - -static inline struct crash_item *get_crash_data_item_or_NULL(crash_data_t *crash_data, const char *key) -{ - return (struct crash_item *)g_hash_table_lookup(crash_data, key); -} -const char *get_crash_item_content_or_NULL(crash_data_t *crash_data, const char *key); -/* Aborts if key is not found: */ -const char *get_crash_item_content_or_die(crash_data_t *crash_data, const char *key); - - -/* Vector of these structures */ - -typedef GPtrArray vector_of_crash_data_t; - -static inline crash_data_t *get_crash_data(vector_of_crash_data_t *vector, unsigned i) -{ - return (crash_data_t *)g_ptr_array_index(vector, i); -} - -vector_of_crash_data_t *new_vector_of_crash_data(void); -static inline void free_vector_of_crash_data(vector_of_crash_data_t *vector) -{ - if (vector) - g_ptr_array_free(vector, TRUE); -} - - -/* Conversions between in-memory and on-disk formats */ - -crash_data_t *load_crash_data_from_dump_dir(struct dump_dir *dd); -struct dump_dir *create_dump_dir(crash_data_t *crash_data, const char *base_dir_name); - -#ifdef __cplusplus -} -#endif - -#endif -- cgit