19 #ifndef LIBREPORT_TYPES_H_ 20 #define LIBREPORT_TYPES_H_ 25 typedef gchar **string_vector_ptr_t;
26 typedef const gchar *
const *const_string_vector_const_ptr_t;
28 #define string_vector_new_from_string libreport_string_vector_new_from_string 29 string_vector_ptr_t string_vector_new_from_string(
const char *vector);
30 #define string_vector_free libreport_string_vector_free 31 void string_vector_free(string_vector_ptr_t vector);
33 typedef GHashTable map_string_t;
34 #define new_map_string libreport_new_map_string 35 map_string_t *new_map_string(
void);
36 #define free_map_string libreport_free_map_string 37 void free_map_string(map_string_t *ms);
38 #define clone_map_string libreport_clone_map_string 39 map_string_t *clone_map_string(map_string_t *ms);
40 #define size_map_string libreport_size_map_string 42 unsigned size_map_string(map_string_t *ms)
47 return g_hash_table_size(ms);
49 #define insert_map_string_item libreport_insert_map_string_item 51 void insert_map_string(map_string_t *ms,
char *key,
char *value)
53 g_hash_table_insert(ms, key, value);
55 #define replace_map_string_item libreport_replace_map_string_item 57 void replace_map_string_item(map_string_t *ms,
char *key,
char *value)
59 g_hash_table_replace(ms, key, value);
61 #define remove_map_string_item libreport_remove_map_string_item 63 void remove_map_string_item(map_string_t *ms,
const char *key)
65 g_hash_table_remove(ms, key);
67 #define get_map_string_item_or_empty libreport_get_map_string_item_or_empty 68 const char *get_map_string_item_or_empty(map_string_t *ms,
const char *key);
69 #define get_map_string_item_or_NULL libreport_get_map_string_item_or_NULL 71 const char *get_map_string_item_or_NULL(map_string_t *ms,
const char *key)
73 return (
const char*)g_hash_table_lookup(ms, key);
76 #define set_map_string_item_from_bool libreport_set_map_string_item_from_bool 77 void set_map_string_item_from_bool(map_string_t *ms,
const char *key,
int value);
78 #define try_get_map_string_item_as_bool libreport_try_get_map_string_item_as_bool 79 int try_get_map_string_item_as_bool(map_string_t *ms,
const char *key,
int *value);
81 #define set_map_string_item_from_int libreport_set_map_string_item_from_int 82 void set_map_string_item_from_int(map_string_t *ms,
const char *key,
int value);
83 #define try_get_map_string_item_as_int libreport_try_get_map_string_item_as_int 84 int try_get_map_string_item_as_int(map_string_t *ms,
const char *key,
int *value);
86 #define set_map_string_item_from_uint libreport_set_map_string_item_from_uint 87 void set_map_string_item_from_uint(map_string_t *ms,
const char *key,
unsigned int value);
88 #define try_get_map_string_item_as_uint libreport_try_get_map_string_item_as_uint 89 int try_get_map_string_item_as_uint(map_string_t *ms,
const char *key,
unsigned int *value);
91 #define set_map_string_item_from_string libreport_set_map_string_item_from_string 92 void set_map_string_item_from_string(map_string_t *ms,
const char *key,
const char *value);
93 #define try_get_map_string_item_as_string libreport_try_get_map_string_item_as_string 94 int try_get_map_string_item_as_string(map_string_t *ms,
const char *key,
char **value);
96 #define set_map_string_item_from_string_vector libreport_set_map_string_item_from_string_vector 97 void set_map_string_item_from_string_vector(map_string_t *ms,
const char *key, string_vector_ptr_t value);
98 #define try_get_map_string_item_as_string_vector libreport_try_get_map_string_item_as_string_vector 99 int try_get_map_string_item_as_string_vector(map_string_t *ms,
const char *key, string_vector_ptr_t *value);
102 typedef GHashTableIter map_string_iter_t;
103 #define init_map_string_iter libreport_init_map_string_iter 105 void init_map_string_iter(map_string_iter_t *iter, map_string_t *ms)
107 g_hash_table_iter_init(iter, ms);
109 #define next_map_string_iter libreport_next_map_string_iter 111 int next_map_string_iter(map_string_iter_t *iter,
const char **key,
const char **value)
113 return g_hash_table_iter_next(iter, (gpointer *)key, (gpointer *)value);