diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2010-12-08 14:51:47 +0100 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2010-12-08 14:51:47 +0100 |
commit | 816f3e001271ed8ab7fdadb6d90aeb2c61362dac (patch) | |
tree | a7e453859a80fb47c7c74cb37791e35ad50f1d97 /src/include/abrt_types.h | |
parent | 3a9554929de070297a0e816eb2839291335a9403 (diff) | |
download | abrt-816f3e001271ed8ab7fdadb6d90aeb2c61362dac.tar.gz abrt-816f3e001271ed8ab7fdadb6d90aeb2c61362dac.tar.xz abrt-816f3e001271ed8ab7fdadb6d90aeb2c61362dac.zip |
removal of C++isms from libabrt, part 1
This patch converts libabrt usage of C++ map<string, string>
to a glib-based container, GHashTable.
It is typedef-ed to map_string_h.
We can't typedef it to map_string_t, since other parts of ABRT
(daemon, cli) still use that name for C++ container.
Also, exceptions are removed everywhere.
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src/include/abrt_types.h')
-rw-r--r-- | src/include/abrt_types.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/include/abrt_types.h b/src/include/abrt_types.h index 38804895..3ebd1697 100644 --- a/src/include/abrt_types.h +++ b/src/include/abrt_types.h @@ -19,6 +19,33 @@ #ifndef ABRT_TYPES_H_ #define ABRT_TYPES_H_ +#include <glib.h> + +#ifdef __cplusplus +extern "C" { +#endif + +/* We can't typedef it to map_string_t, since other parts of ABRT + * (daemon, cli) still use that name for C++ container. For now, + * let's call it map_string_h: + */ +typedef GHashTable map_string_h; + +map_string_h *new_map_string(void); +void free_map_string(map_string_h *ms); +const char *get_map_string_item_or_empty(map_string_h *ms, const char *key); +static inline +const char *get_map_string_item_or_NULL(map_string_h *ms, const char *key) +{ + return (const char*)g_hash_table_lookup(ms, key); +} + + +#ifdef __cplusplus +} +#endif + + #ifdef __cplusplus #include <map> |