rsvg_acquire_file_resource (const char *filename, const char *base_uri, GError ** error)
{
    GByteArray *array;
    gchar *path;
    gchar *data = NULL;
    gsize length;

    rsvg_return_val_if_fail (filename != NULL, NULL, error);

    path = rsvg_get_file_path (filename, base_uri);
    if (path == NULL)
        return NULL;

    if (!g_file_get_contents (path, &data, &length, error)) {
        g_free (path);
        return NULL;
    }

    array = g_byte_array_new ();

    g_byte_array_append (array, (guint8 *)data, length);
    g_free (data);
    g_free (path);

    return array;
}
rsvg_acquire_file_resource (const char *filename, const char *base_uri, GError ** error)
{
    GByteArray *array;
    gchar *path;
    gchar *data = NULL;
    gsize length;

    rsvg_return_val_if_fail (filename != NULL, NULL, error);

    path = rsvg_get_file_path (filename, base_uri);
    if (path == NULL)
        return NULL;

    if (!g_file_get_contents (path, &data, &length, error)) {
        g_free (path);
        return NULL;
    }

    array = g_byte_array_new ();

    g_byte_array_append (array, (guint8 *)data, length);
    g_free (data);
    g_free (path);

    return array;
}