static VALUE
rg_valid_p(VALUE self, VALUE source, VALUE source_tag)
{
        return CBOOL2RVAL(g_simple_async_result_is_valid(RVAL2GASYNCRESULT(self),
                                                         RVAL2GOBJ(source),
                                                         (gpointer)source_tag));
}
Exemple #2
0
static VALUE
boolean_finish_method(BooleanFinishMethod method, VALUE self, VALUE result)
{
        GError *error = NULL;

        if (!method(_SELF(self), RVAL2GASYNCRESULT(result), &error))
                rbgio_raise_error(error);

        return self;
}
static VALUE
fileenumerator_close_finish(VALUE self, VALUE result)
{
        GError *error = NULL;
        if (!g_file_enumerator_close_finish(_SELF(self),
                                            RVAL2GASYNCRESULT(result),
                                            &error))
                rbgio_raise_error(error);

        return Qnil;
}
Exemple #4
0
static VALUE
rg_lookup_service_finish(VALUE self, VALUE result)
{
        GError *error = NULL;
        GList *targets;

        targets = g_resolver_lookup_service_finish(_SELF(self), RVAL2GASYNCRESULT(result), &error);
        if (targets == NULL)
                rbgio_raise_error(error);

        return GLIST2ARY_UNREF_FREE(targets);
}
Exemple #5
0
static VALUE
rg_close_finish(VALUE self, VALUE result)
{
        GError *error = NULL;

        if (!g_io_stream_close_finish(_SELF(self),
                                      RVAL2GASYNCRESULT(result),
                                      &error))
                rbgio_raise_error(error);

        return self;
}
static VALUE
ssize_finish_method(SSizeFinishMethod method, VALUE self, VALUE result)
{
        GError *error = NULL;
        gssize bytes_read;

        bytes_read = method(_SELF(self), RVAL2GASYNCRESULT(result), &error);
        if (error != NULL)
                rbgio_raise_error(error);

        return GSSIZE2RVAL(bytes_read);
}
static VALUE
fileenumerator_next_files_finish(VALUE self, VALUE result)
{
        GError *error = NULL;
        GList *files = g_file_enumerator_next_files_finish(_SELF(self),
                                                           RVAL2GASYNCRESULT(result),
                                                           &error);
        if (error != NULL)
                rbgio_raise_error(error);

        return GLIST2ARY_FREE(files);
}
static VALUE
asyncinitable_init_finish(VALUE self, VALUE result)
{
        GError *error = NULL;

        if (!g_async_initable_init_finish(_SELF(self),
                                          RVAL2GASYNCRESULT(result),
                                          &error))
                rbgio_raise_error(error);

        return self;
}
Exemple #9
0
static VALUE
connection_finish_method(ConnectionFinishMethod method, VALUE self, VALUE result)
{
        GError *error = NULL;
        GSocketConnection *connection;

        connection = method(_SELF(self), RVAL2GASYNCRESULT(result), &error);
        if (connection == NULL)
                rbgio_raise_error(error);

        return GOBJ2RVAL_UNREF(connection);
}
Exemple #10
0
static VALUE
rg_lookup_by_name_finish(VALUE self, VALUE result)
{
        GError *error = NULL;
        GList *addresses;

        addresses = g_resolver_lookup_by_name_finish(_SELF(self),
                                                     RVAL2GASYNCRESULT(result),
                                                     &error);
        if (addresses == NULL)
                rbgio_raise_error(error);

        return GLIST2ARY_UNREF_FREE(addresses);
}
Exemple #11
0
static VALUE
rg_lookup_by_address_finish(VALUE self, VALUE result)
{
        GError *error = NULL;
        gchar *hostname;

        hostname = g_resolver_lookup_by_address_finish(_SELF(self),
                                                       RVAL2GASYNCRESULT(result),
                                                       &error);
        if (hostname == NULL)
                rbgio_raise_error(error);

        return CSTR2RVAL_FREE(hostname);
}
Exemple #12
0
static VALUE
rg_guess_content_type_finish(VALUE self, VALUE result)
{
        GError *error = NULL;
        gchar **content_types;

        content_types = g_mount_guess_content_type_finish(_SELF(self),
                                                          RVAL2GASYNCRESULT(result),
                                                          &error);
        if (content_types == NULL)
                rbgio_raise_error(error);

        return STRV2RVAL_FREE(content_types);
}
static VALUE
rg_fill_finish(VALUE self, VALUE result)
{
        GError *error = NULL;
        gsize bytes_read;

        bytes_read = g_buffered_input_stream_fill_finish(_SELF(self),
                                                         RVAL2GASYNCRESULT(result),
                                                         &error);
        if (error != NULL)
                rbgio_raise_error(error);

        return GSSIZE2RVAL(bytes_read);
}
Exemple #14
0
static VALUE
rg_query_info_finish(VALUE self, VALUE result)
{
        GError *error = NULL;
        GFileInfo *info;

        info = g_file_input_stream_query_info_finish(_SELF(self),
                                                     RVAL2GASYNCRESULT(result),
                                                     &error);
        if (info == NULL)
                rbgio_raise_error(error);

        return GOBJ2RVAL_UNREF(info);
}
static VALUE
asyncinitable_initialize_finish(VALUE self, VALUE result)
{
        GError *error = NULL;
        GObject *object;
        VALUE rbobject;

        object = g_async_initable_new_finish(_SELF(self),
                                             RVAL2GASYNCRESULT(result),
                                             &error);
        if (object == NULL)
                rbgio_raise_error(error);

        rbobject = GOBJ2RVAL(object);
        g_object_unref(object);

        return rbobject;
}