cleanup_storage(path, level);
}
-static void _popup_cb(GVariant *var, void *user_data, GError *err)
+static void _cb_get_message(GVariant *var, void *user_data, GError *err, int *ret)
{
- int ret_val;
+ int ret_val = 0;
if (!var) {
_E("No message: %s", err->message);
goto out;
}
- _D("Reply value: %d", ret_val);
+ if (ret != NULL)
+ *ret = ret_val;
+ _D("Reply value: %d", ret_val);
out:
g_variant_unref(var);
}
+static void _popup_cb(GVariant *var, void *user_data, GError *err)
+{
+ _cb_get_message(var, user_data, err, NULL);
+}
+
static int launch_memory_popup(int num, ...)
{
int ret;
static void _noti_cb(GVariant *var, void *user_data, GError *err)
{
- int ret_val;
-
- if (!var) {
- _E("No message: %s", err->message);
- return;
- }
-
- if (!g_variant_get_safe(var, "(i)", &ret_val)) {
- _E("No message: %s", g_variant_get_type_string(var));
- goto out;
- }
-
- noti_id = ret_val;
- _D("Reply value: %d", ret_val);
-
-out:
- g_variant_unref(var);
+ _cb_get_message(var, user_data, err, ¬i_id);
}
static int remove_notification(void)