static VALUE get_value_by(GetMethod method, int argc, VALUE *argv, VALUE self) { VALUE info, rbfiles; GList *files; char *value; rb_scan_args(argc, argv, "11", &info, &rbfiles); files = GFILEARY2GLIST_ACCEPT_NIL(rbfiles); value = method(_SELF(self), RVAL2GAPPINFO(info), files); g_list_free(files); return CSTR2RVAL_FREE(value); }
static VALUE launch_method(LaunchMethod method, int argc, VALUE *argv, VALUE self) { VALUE rbfiles, rblaunch_context; GList *files; GAppLaunchContext *launch_context; GError *error = NULL; gboolean launched; rb_scan_args(argc, argv, "02", &rbfiles, &rblaunch_context); launch_context = RVAL2GAPPLAUNCHCONTEXT(rblaunch_context); files = GFILEARY2GLIST_ACCEPT_NIL(rbfiles); launched = method(_SELF(self), files, launch_context, &error); g_list_free(files); if (!launched) rbgio_raise_error(error); return self; }