repo.c File Reference

#include <string.h>
#include <fnmatch.h>
#include <stdio.h>
#include <stdlib.h>
#include "repo.h"
#include "pool.h"
#include "poolid_private.h"
#include "util.h"

Go to the source code of this file.

Classes

struct  matchdata

Defines

#define _GNU_SOURCE
#define IDARRAY_BLOCK   4095
#define REPO_SIDEDATA_BLOCK   63

Functions

Reporepo_create (Pool *pool, const char *name)
static void repo_freedata (Repo *repo)
void repo_empty (Repo *repo, int reuseids)
void repo_free (Repo *repo, int reuseids)
void repo_freeallrepos (Pool *pool, int reuseids)
void repo_free_solvable_block (Repo *repo, Id start, int count, int reuseids)
void * repo_sidedata_create (Repo *repo, size_t size)
void * repo_sidedata_extend (Repo *repo, void *b, size_t size, Id p, int count)
Offset repo_addid (Repo *repo, Offset olddeps, Id id)
Offset repo_addid_dep (Repo *repo, Offset olddeps, Id id, Id marker)
Offset repo_reserve_ids (Repo *repo, Offset olddeps, int num)
Offset repo_fix_supplements (Repo *repo, Offset provides, Offset supplements, Offset freshens)
Offset repo_fix_conflicts (Repo *repo, Offset conflicts)
int repo_matchvalue (void *cbdata, Solvable *s, Repodata *data, Repokey *key, KeyValue *kv)
static void domatch_idarray (Solvable *s, Id keyname, struct matchdata *md, Id *ida)
static void repo_search_md (Repo *repo, Id p, Id keyname, struct matchdata *md)
void repo_search (Repo *repo, Id p, Id keyname, const char *match, int flags, int(*callback)(void *cbdata, Solvable *s, Repodata *data, Repokey *key, KeyValue *kv), void *cbdata)
const char * repo_lookup_str (Repo *repo, Id entry, Id keyname)
unsigned int repo_lookup_num (Repo *repo, Id entry, Id keyname, unsigned int notfound)
Id repo_lookup_id (Repo *repo, Id entry, Id keyname)
const unsigned char * repo_lookup_bin_checksum (Repo *repo, Id entry, Id keyname, Id *typep)
int repo_lookup_void (Repo *repo, Id entry, Id keyname)
Repodatarepo_add_repodata (Repo *repo, int flags)
Repodatarepo_last_repodata (Repo *repo)
void repo_set_id (Repo *repo, Id p, Id keyname, Id id)
void repo_set_num (Repo *repo, Id p, Id keyname, Id num)
void repo_set_str (Repo *repo, Id p, Id keyname, const char *str)
void repo_set_poolstr (Repo *repo, Id p, Id keyname, const char *str)
void repo_add_poolstr_array (Repo *repo, Id p, Id keyname, const char *str)
void repo_internalize (Repo *repo)
void repo_disable_paging (Repo *repo)

Variables

static Repokey solvablekeys [RPM_RPMDBID-SOLVABLE_NAME+1]

Define Documentation

#define _GNU_SOURCE

Definition at line 15 of file repo.c.

#define IDARRAY_BLOCK   4095

Definition at line 32 of file repo.c.

Referenced by repo_addid(), and repo_reserve_ids().

#define REPO_SIDEDATA_BLOCK   63

Definition at line 177 of file repo.c.

Referenced by repo_sidedata_create(), and repo_sidedata_extend().


Function Documentation

Repo* repo_create ( Pool pool,
const char *  name 
)
static void repo_freedata ( Repo repo  )  [static]
void repo_empty ( Repo repo,
int  reuseids 
)
void repo_free ( Repo repo,
int  reuseids 
)

Definition at line 117 of file repo.c.

References _Pool::nrepos, _Repo::pool, repo_empty(), repo_freedata(), _Repo::repoid, and _Pool::repos.

void repo_freeallrepos ( Pool pool,
int  reuseids 
)
void repo_free_solvable_block ( Repo repo,
Id  start,
int  count,
int  reuseids 
)
void* repo_sidedata_create ( Repo repo,
size_t  size 
)

Definition at line 180 of file repo.c.

References _Repo::end, REPO_SIDEDATA_BLOCK, sat_calloc_block(), and _Repo::start.

Referenced by repo_add_solv_flags().

void* repo_sidedata_extend ( Repo repo,
void *  b,
size_t  size,
Id  p,
int  count 
)

Definition at line 186 of file repo.c.

References _Repo::end, REPO_SIDEDATA_BLOCK, sat_extend(), and _Repo::start.

Referenced by repo_add_solvable(), and repo_add_solvable_block().

Offset repo_addid ( Repo repo,
Offset  olddeps,
Id  id 
)
Offset repo_addid_dep ( Repo repo,
Offset  olddeps,
Id  id,
Id  marker 
)

Definition at line 270 of file repo.c.

References _Repo::idarraydata, and repo_addid().

Referenced by addfileprovides_cb(), pool_add_fileconflicts_deps(), and repo_fix_supplements().

Offset repo_reserve_ids ( Repo repo,
Offset  olddeps,
int  num 
)
Offset repo_fix_supplements ( Repo repo,
Offset  provides,
Offset  supplements,
Offset  freshens 
)
Offset repo_fix_conflicts ( Repo repo,
Offset  conflicts 
)

Definition at line 598 of file repo.c.

References id2str(), _Repo::idarraydata, ISRELDEP, _Repo::pool, rel2id(), REL_NAMESPACE, and str2id().

int repo_matchvalue ( void *  cbdata,
Solvable s,
Repodata data,
Repokey key,
KeyValue kv 
)
static void domatch_idarray ( Solvable s,
Id  keyname,
struct matchdata md,
Id ida 
) [static]
static void repo_search_md ( Repo repo,
Id  p,
Id  keyname,
struct matchdata md 
) [static]
void repo_search ( Repo repo,
Id  p,
Id  keyname,
const char *  match,
int  flags,
int(*)(void *cbdata, Solvable *s, Repodata *data, Repokey *key, KeyValue *kv)  callback,
void *  cbdata 
)
const char* repo_lookup_str ( Repo repo,
Id  entry,
Id  keyname 
)
unsigned int repo_lookup_num ( Repo repo,
Id  entry,
Id  keyname,
unsigned int  notfound 
)
Id repo_lookup_id ( Repo repo,
Id  entry,
Id  keyname 
)
const unsigned char* repo_lookup_bin_checksum ( Repo repo,
Id  entry,
Id  keyname,
Id typep 
)
int repo_lookup_void ( Repo repo,
Id  entry,
Id  keyname 
)
Repodata* repo_add_repodata ( Repo repo,
int  flags 
)
Repodata* repo_last_repodata ( Repo repo  ) 
void repo_set_id ( Repo repo,
Id  p,
Id  keyname,
Id  id 
)

Definition at line 1059 of file repo.c.

References repo_last_repodata(), and repodata_set_id().

void repo_set_num ( Repo repo,
Id  p,
Id  keyname,
Id  num 
)

Definition at line 1066 of file repo.c.

References repo_last_repodata(), and repodata_set_num().

void repo_set_str ( Repo repo,
Id  p,
Id  keyname,
const char *  str 
)

Definition at line 1073 of file repo.c.

References repo_last_repodata(), and repodata_set_str().

void repo_set_poolstr ( Repo repo,
Id  p,
Id  keyname,
const char *  str 
)

Definition at line 1080 of file repo.c.

References repo_last_repodata(), and repodata_set_poolstr().

void repo_add_poolstr_array ( Repo repo,
Id  p,
Id  keyname,
const char *  str 
)

Definition at line 1087 of file repo.c.

References repo_last_repodata(), and repodata_add_poolstr_array().

void repo_internalize ( Repo repo  ) 

Definition at line 1094 of file repo.c.

References _Repodata::attrs, _Repo::repodata, repodata_internalize(), and _Repodata::xattrs.

void repo_disable_paging ( Repo repo  ) 

Definition at line 1105 of file repo.c.

References _Repo::repodata, and repodata_disable_paging().


Variable Documentation

Repokey solvablekeys[RPM_RPMDBID-SOLVABLE_NAME+1] [static]
Initial value:
 {
  { SOLVABLE_NAME,        REPOKEY_TYPE_ID, 0, KEY_STORAGE_SOLVABLE },
  { SOLVABLE_ARCH,        REPOKEY_TYPE_ID, 0, KEY_STORAGE_SOLVABLE },
  { SOLVABLE_EVR,         REPOKEY_TYPE_ID, 0, KEY_STORAGE_SOLVABLE },
  { SOLVABLE_VENDOR,      REPOKEY_TYPE_ID, 0, KEY_STORAGE_SOLVABLE },
  { SOLVABLE_PROVIDES,    REPOKEY_TYPE_IDARRAY, 0, KEY_STORAGE_SOLVABLE },
  { SOLVABLE_OBSOLETES,   REPOKEY_TYPE_IDARRAY, 0, KEY_STORAGE_SOLVABLE },
  { SOLVABLE_CONFLICTS,   REPOKEY_TYPE_IDARRAY, 0, KEY_STORAGE_SOLVABLE },
  { SOLVABLE_REQUIRES,    REPOKEY_TYPE_IDARRAY, 0, KEY_STORAGE_SOLVABLE },
  { SOLVABLE_RECOMMENDS,  REPOKEY_TYPE_IDARRAY, 0, KEY_STORAGE_SOLVABLE },
  { SOLVABLE_SUGGESTS,    REPOKEY_TYPE_IDARRAY, 0, KEY_STORAGE_SOLVABLE },
  { SOLVABLE_SUPPLEMENTS, REPOKEY_TYPE_IDARRAY, 0, KEY_STORAGE_SOLVABLE },
  { SOLVABLE_ENHANCES,    REPOKEY_TYPE_IDARRAY, 0, KEY_STORAGE_SOLVABLE },
  { RPM_RPMDBID,          REPOKEY_TYPE_U32, 0, KEY_STORAGE_SOLVABLE },
}

Definition at line 653 of file repo.c.

Generated on Mon Dec 12 11:44:12 2011 for satsolver by  doxygen 1.6.3