* Copyright (c) 2007-2011, Novell Inc.
*
* This program is licensed under the BSD license, read LICENSE.BSD
* for further information
*/
#ifndef LIBSOLV_REPOPAGE_H
#define LIBSOLV_REPOPAGE_H
#define REPOPAGE_BLOBBITS 15
#define REPOPAGE_BLOBSIZE (1 << REPOPAGE_BLOBBITS)
typedef struct _Attrblobpage
{
Otherwise it is L*2+(compressed ? 1 : 0), with L being the data
length. */
unsigned int page_offset;
unsigned int page_size;
} Attrblobpage;
typedef struct _Repopagestore {
int pagefd;
long file_offset;
unsigned char *blob_store;
unsigned int num_pages;
store->blob_store. The size of the mapping is REPOPAGE_BLOBSIZE
except for the last page. */
unsigned int *mapped_at;
Attrblobpage *file_pages;
otherwise it contains the page number (of the mapped page). */
unsigned int *mapped;
unsigned int nmapped;
unsigned int rr_counter;
} Repopagestore;
#ifdef __cplusplus
extern "C" {
#endif
void repopagestore_init(Repopagestore *store);
void repopagestore_free(Repopagestore *store);
unsigned char *repopagestore_load_page_range(Repopagestore *store, unsigned int pstart, unsigned int pend);
unsigned int repopagestore_compress_page(unsigned char *page, unsigned int len, unsigned char *cpage, unsigned int max);
int repopagestore_read_or_setup_pages(Repopagestore *store, FILE *fp, unsigned int pagesz, unsigned int blobsz);
void repopagestore_disable_paging(Repopagestore *store);
#ifdef __cplusplus
}
#endif
#endif