}
static gboolean read_query_database(Storage *strg, void *handle, const char *query, GHashTable *in_param,
- GHashTable *out_param, int out_param_cnt)
+ GHashTable **out_param, int out_param_cnt)
{
- _read_query_database_internal(strg, handle, query, in_param, out_param, out_param_cnt, FALSE);
+ GHashTable *out_hash_table;
+
+ if (out_param == NULL)
+ return FALSE;
+
+ out_hash_table = g_hash_table_new_full(g_str_hash, g_str_equal,
+ g_free, (GDestroyNotify)g_hash_table_destroy);
+
+ if (_read_query_database_internal(strg,
+ handle, query, in_param, out_hash_table, out_param_cnt, FALSE) == FALSE) {
+ g_hash_table_destroy(out_hash_table);
+ return FALSE;
+ }
+
+ *out_param = out_hash_table;
+
return TRUE;
}
static gboolean read_query_database_in_order(Storage *strg, void *handle, const char *query, GHashTable *in_param,
GSList **out_param, int out_param_cnt)
{
- _read_query_database_internal(strg, handle, query, in_param, out_param, out_param_cnt, TRUE);
+ if (_read_query_database_internal(strg,
+ handle, query, in_param, out_param, out_param_cnt, TRUE) == FALSE)
+ return FALSE;
+
return TRUE;
}