gboolean get_extra_chunk_info(const char *pathname, GError ** error, struct chunk_textinfo_extra_s *chunk_textinfo_extra){ struct attr_handle_s *attr_handle; GError *local_error = NULL; if(!_load_attr_from_file(pathname, &attr_handle, &local_error)){ SETERROR(error, "Failed to init the attribute management context : %s", local_error->message); g_clear_error(&local_error); return FALSE; } if (!_get_attr_from_handle(attr_handle, &local_error, ATTR_DOMAIN,\ ATTR_NAME_CHUNK_COMPRESSED_SIZE, &(chunk_textinfo_extra->compressedsize))) goto error_get_attr; if (!_get_attr_from_handle(attr_handle, &local_error, ATTR_DOMAIN,\ ATTR_NAME_CHUNK_METADATA_COMPRESS, &(chunk_textinfo_extra->metadatacompress))) goto error_get_attr; _clean_attr_handle(attr_handle, FALSE); return TRUE; error_get_attr: SETERROR(error, "Failed to get attr : %s", local_error->message); g_clear_error(&local_error); _clean_attr_handle(attr_handle, FALSE); return FALSE; }
gboolean get_rawx_info_in_attr(const char *pathname, GError ** error, struct content_textinfo_s * content, struct chunk_textinfo_s * chunk) { struct attr_handle_s *attr_handle = NULL; GError *e = NULL; if (!_load_attr_from_file(pathname, &attr_handle, &e)) { SETERROR(error, "Failed to init the attribute management context : %s", e->message); g_clear_error(&e); return FALSE; } if (chunk) { GET(ATTR_NAME_CHUNK_ID, chunk->id); GET(ATTR_NAME_CHUNK_SIZE, chunk->size); GET(ATTR_NAME_CHUNK_POS, chunk->position); GET(ATTR_NAME_CHUNK_HASH, chunk->hash); GET(ATTR_NAME_CHUNK_METADATA, chunk->metadata); } if (content) { GET(ATTR_NAME_CONTENT_CONTAINER, content->container_id); GET(ATTR_NAME_CONTENT_ID, content->content_id); GET(ATTR_NAME_CONTENT_PATH, content->path); GET(ATTR_NAME_CONTENT_VERSION, content->version); GET(ATTR_NAME_CONTENT_SIZE, content->size); GET(ATTR_NAME_CONTENT_NBCHUNK, content->chunk_nb); GET(ATTR_NAME_CONTENT_STGPOL, content->storage_policy); GET(ATTR_NAME_CONTENT_CHUNKMETHOD, content->chunk_method); GET(ATTR_NAME_CONTENT_MIMETYPE, content->mime_type); } _clean_attr_handle(attr_handle, FALSE); return TRUE; error_get_attr: SETERROR(error, "Failed to get attr : %s", e->message); g_clear_error(&e); _clean_attr_handle(attr_handle, FALSE); return FALSE; }