repo_solv.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "repo_solv.h"
#include "util.h"
#include "repopack.h"
#include "repopage.h"

Go to the source code of this file.

Defines

#define INTERESTED_START   SOLVABLE_NAME
#define INTERESTED_END   SOLVABLE_ENHANCES
#define SOLV_ERROR_NOT_SOLV   1
#define SOLV_ERROR_UNSUPPORTED   2
#define SOLV_ERROR_EOF   3
#define SOLV_ERROR_ID_RANGE   4
#define SOLV_ERROR_OVERFLOW   5
#define SOLV_ERROR_CORRUPT   6
#define INCORE_ADD_CHUNK   8192
#define DATA_READ_CHUNK   8192

Functions

static unsigned int read_u32 (Repodata *data)
static unsigned int read_u8 (Repodata *data)
static Id read_id (Repodata *data, Id max)
static Idread_idarray (Repodata *data, Id max, Id *map, Id *store, Id *end)
static unsigned char * data_read_id_max (unsigned char *dp, Id *ret, Id *map, int max, int *error)
unsigned char * data_read_idarray (unsigned char *dp, Id **storep, Id *map, int max, int *error)
unsigned char * data_read_rel_idarray (unsigned char *dp, Id **storep, Id *map, int max, int *error, Id marker)
static void incore_add_id (Repodata *data, Id x)
static void incore_add_blob (Repodata *data, unsigned char *buf, int len)
static void incore_map_idarray (Repodata *data, unsigned char *dp, Id *map, Id max)
static void incore_add_u32 (Repodata *data, unsigned int x)
int repo_add_solv_flags (Repo *repo, FILE *fp, int flags)
int repo_add_solv (Repo *repo, FILE *fp)

Variables

static Poolmypool


Define Documentation

#define INTERESTED_START   SOLVABLE_NAME

Definition at line 32 of file repo_solv.c.

Referenced by repo_add_solv_flags().

#define INTERESTED_END   SOLVABLE_ENHANCES

Definition at line 33 of file repo_solv.c.

Referenced by repo_add_solv_flags().

#define SOLV_ERROR_NOT_SOLV   1

Definition at line 35 of file repo_solv.c.

Referenced by repo_add_solv_flags().

#define SOLV_ERROR_UNSUPPORTED   2

Definition at line 36 of file repo_solv.c.

Referenced by repo_add_solv_flags().

#define SOLV_ERROR_EOF   3

#define SOLV_ERROR_ID_RANGE   4

#define SOLV_ERROR_OVERFLOW   5

Definition at line 39 of file repo_solv.c.

Referenced by read_idarray(), and repo_add_solv_flags().

#define SOLV_ERROR_CORRUPT   6

Definition at line 40 of file repo_solv.c.

Referenced by read_id(), repo_add_solv_flags(), and repopagestore_read_or_setup_pages().

#define INCORE_ADD_CHUNK   8192

Definition at line 300 of file repo_solv.c.

Referenced by incore_add_blob(), incore_add_id(), and incore_add_u32().

#define DATA_READ_CHUNK   8192

Definition at line 301 of file repo_solv.c.

Referenced by repo_add_solv_flags().


Function Documentation

static unsigned int read_u32 ( Repodata data  )  [static]

Definition at line 55 of file repo_solv.c.

References _Repodata::error, _Repodata::fp, pool_debug(), SAT_ERROR, and SOLV_ERROR_EOF.

Referenced by repo_add_solv_flags().

static unsigned int read_u8 ( Repodata data  )  [static]

Definition at line 82 of file repo_solv.c.

References _Repodata::error, _Repodata::fp, pool_debug(), SAT_ERROR, and SOLV_ERROR_EOF.

Referenced by repo_add_solv_flags().

static Id read_id ( Repodata data,
Id  max 
) [static]

static Id* read_idarray ( Repodata data,
Id  max,
Id map,
Id store,
Id end 
) [static]

static unsigned char* data_read_id_max ( unsigned char *  dp,
Id ret,
Id map,
int  max,
int *  error 
) [inline, static]

Definition at line 203 of file repo_solv.c.

References data_read_id(), pool_debug(), SAT_ERROR, and SOLV_ERROR_ID_RANGE.

Referenced by repo_add_solv_flags().

unsigned char* data_read_idarray ( unsigned char *  dp,
Id **  storep,
Id map,
int  max,
int *  error 
)

Definition at line 218 of file repo_solv.c.

References pool_debug(), SAT_ERROR, and SOLV_ERROR_ID_RANGE.

Referenced by repo_add_solv_flags().

unsigned char* data_read_rel_idarray ( unsigned char *  dp,
Id **  storep,
Id map,
int  max,
int *  error,
Id  marker 
)

Definition at line 250 of file repo_solv.c.

References pool_debug(), SAT_ERROR, and SOLV_ERROR_ID_RANGE.

Referenced by repo_add_solv_flags().

static void incore_add_id ( Repodata data,
Id  x 
) [static]

static void incore_add_blob ( Repodata data,
unsigned char *  buf,
int  len 
) [static]

static void incore_map_idarray ( Repodata data,
unsigned char *  dp,
Id map,
Id  max 
) [static]

static void incore_add_u32 ( Repodata data,
unsigned int  x 
) [static]

int repo_add_solv_flags ( Repo repo,
FILE *  fp,
int  flags 
)

Definition at line 417 of file repo_solv.c.

References _Solvable::arch, _Solvable::conflicts, DATA_READ_CHUNK, data_read_id(), data_read_id_max(), data_read_idarray(), data_read_rel_idarray(), data_read_u32(), data_skip(), dep2str(), _Repodata::dirpool, _Dirpool::dirs, _Repodata::end, _Solvable::enhances, _Repodata::error, _Solvable::evr, _Reldep::evr, _Reldep::flags, _Repodata::fp, HASHCHAIN_NEXT, HASHCHAIN_START, id2str(), _Repo::idarraydata, _Repo::idarraysize, incore_add_blob(), incore_add_id(), incore_add_u32(), incore_map_idarray(), _Repodata::incoredata, _Repodata::incoredatafree, _Repodata::incoredatalen, _Repodata::incoreoffset, INTERESTED_END, INTERESTED_START, KEY_STORAGE_INCORE, KEY_STORAGE_SOLVABLE, KEY_STORAGE_VERTICAL_OFFSET, _Repodata::keybits, _Repodata::keys, _Repo::lastoff, _Repodata::lastverticaloffset, _Repodata::localpool, _Repodata::mainschema, _Repodata::mainschemaoffsets, MAKERELDEP, mkmask(), _Solvable::name, _Repokey::name, _Reldep::name, _Dirpool::ndirs, _Repodata::nkeys, _Pool::nrels, _Repo::nrepodata, _Repodata::nschemata, _Repo::nsolvables, _Stringpool::nstrings, _Solvable::obsoletes, _Repo::pool, POOL_DEBUG, pool_debug(), pool_freeidhashes(), pool_id2solvable(), pool_shrink_rels(), pool_shrink_strings(), _Solvable::provides, read_id(), read_idarray(), read_u32(), read_u8(), _Solvable::recommends, relhash(), _Pool::rels, _Solvable::repo, _Repodata::repo, repo_add_repodata(), repo_add_solvable_block(), REPO_EXTEND_SOLVABLES, repo_free_solvable_block(), REPO_LOCALPOOL, repo_reserve_ids(), REPO_REUSE_REPODATA, repo_sidedata_create(), REPO_USE_LOADING, _Repo::repodata, repodata_create_stubs(), repodata_extend_block(), repodata_freedata(), repopagestore_init(), repopagestore_read_or_setup_pages(), _Solvable::requires, _Repo::rpmdbid, sat_calloc(), SAT_DEBUG_STATS, SAT_ERROR, sat_free(), sat_malloc(), sat_malloc2(), sat_realloc(), sat_realloc2(), sat_timems(), _Repodata::schemadata, _Repodata::schemadatalen, _Repodata::schemata, _Repokey::size, SOLV_ADD_NO_STUBS, SOLV_ERROR_CORRUPT, SOLV_ERROR_EOF, SOLV_ERROR_NOT_SOLV, SOLV_ERROR_OVERFLOW, SOLV_ERROR_UNSUPPORTED, SOLV_FLAG_PREFIX_POOL, SOLV_VERSION_8, _Pool::solvables, _Repodata::spool, _Pool::ss, _Stringpool::sstrings, _Repo::start, _Repodata::start, _Repokey::storage, _Repodata::store, str2id(), strhash(), stringpool_id2str(), _Stringpool::strings, _Stringpool::stringspace, _Solvable::suggests, _Solvable::supplements, _Repokey::type, _Solvable::vendor, and _Repodata::verticaloffset.

Referenced by repo_add_solv().

int repo_add_solv ( Repo repo,
FILE *  fp 
)

Definition at line 1305 of file repo_solv.c.

References repo_add_solv_flags().


Variable Documentation

Pool* mypool [static]

Definition at line 42 of file repo_solv.c.


doxygen