From 47728cc3c70c2b6d3a645e5760b39b20bd946e39 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 6 Dec 2010 16:56:50 +0100 Subject: This patch changes crash data to use C structures. The smallest data element is: struct crash_item { char *content; unsigned flags; }; where content is, eh, content, and flags is a bit flag field. crash_data_t is a map of crash_item's, implemented as a pointer to heap-allocated GHashTable. vector_of_crash_data_t is a vector of crash_data_t's, implemented as a pointer to heap-allocated GPtrArray. Most operations have light wrappers around them to hide the nature of the containers. For example, to free vector_of_crash_data, you need to use free_vector_of_crash_data(ptr) instead of open-coding g_ptr_array_free. The wrapper is thin. The goal is not so much to hide the implementation, but more to make it easier to use the correct function. dbus (un)marshalling functions convert crash_item to three-element array of strings, in order to keep compatibility with abrt-gui (python). This can be changed later to use native representation. crash_data_t and vector_of_crash_data_t are represented in "natural" way, no funny stuff there. Signed-off-by: Denys Vlasenko --- src/lib/abrt_dbus.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/lib/abrt_dbus.h') diff --git a/src/lib/abrt_dbus.h b/src/lib/abrt_dbus.h index 16b91d5b..b971280c 100644 --- a/src/lib/abrt_dbus.h +++ b/src/lib/abrt_dbus.h @@ -83,6 +83,8 @@ void store_uint32(DBusMessageIter* iter, uint32_t val); void store_int64(DBusMessageIter* iter, int64_t val); void store_uint64(DBusMessageIter* iter, uint64_t val); void store_string(DBusMessageIter* iter, const char* val); +void store_crash_data(DBusMessageIter* iter, crash_data_t *val); +void store_vector_of_crash_data(DBusMessageIter* iter, vector_of_crash_data_t *val); /* * Helpers for parsing DBus messages @@ -104,6 +106,8 @@ int load_uint32(DBusMessageIter* iter, uint32_t *val); int load_int64(DBusMessageIter* iter, int64_t *val); int load_uint64(DBusMessageIter* iter, uint64_t *val); int load_charp(DBusMessageIter* iter, const char **val); +int load_crash_data(DBusMessageIter* iter, crash_data_t **val); +int load_vector_of_crash_data(DBusMessageIter* iter, vector_of_crash_data_t **val); #ifdef __cplusplus } -- cgit