pool.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <unistd.h>
#include <string.h>
#include "pool.h"
#include "repo.h"
#include "poolid.h"
#include "poolid_private.h"
#include "poolarch.h"
#include "util.h"
#include "bitmap.h"
#include "evr.h"
#include "knownid.h"

Go to the source code of this file.

Classes

struct  searchfiles
struct  addfileprovides_cbdata
struct  mptree
struct  ducbdata

Defines

#define SOLVABLE_BLOCK   255
#define KNOWNID_INITIALIZE
#define EVRCMP_DEPCMP   EVRCMP_MATCH_RELEASE
#define SEARCHFILES_BLOCK   127
#define MPTREE_BLOCK   15

Functions

Poolpool_create (void)
 Creates a new pool.
void pool_free (Pool *pool)
 Delete a pool.
Id pool_add_solvable (Pool *pool)
 Solvable management.
Id pool_add_solvable_block (Pool *pool, int count)
void pool_free_solvable_block (Pool *pool, Id start, int count, int reuseids)
void pool_set_installed (Pool *pool, Repo *installed)
static int pool_shrink_whatprovides_sortcmp (const void *ap, const void *bp, void *dp)
static void pool_shrink_whatprovides (Pool *pool)
void pool_createwhatprovides (Pool *pool)
 Prepares a pool for solving.
void pool_freewhatprovides (Pool *pool)
Id pool_queuetowhatprovides (Pool *pool, Queue *q)
int pool_match_nevr_rel (Pool *pool, Solvable *s, Id d)
int pool_match_dep (Pool *pool, Id d1, Id d2)
Id pool_addrelproviders (Pool *pool, Id d)
void pool_debug (Pool *pool, int type, const char *format,...)
void pool_setdebuglevel (Pool *pool, int level)
static void pool_addfileprovides_dep (Pool *pool, Id *ida, struct searchfiles *sf, struct searchfiles *isf)
static int addfileprovides_cb (void *cbdata, Solvable *s, Repodata *data, Repokey *key, KeyValue *value)
static void pool_addfileprovides_search (Pool *pool, struct addfileprovides_cbdata *cbd, struct searchfiles *sf, Repo *repoonly)
void pool_addfileprovides_ids (Pool *pool, Repo *installed, Id **idp)
void pool_addfileprovides (Pool *pool)
void pool_search (Pool *pool, Id p, Id key, const char *match, int flags, int(*callback)(void *cbdata, Solvable *s, struct _Repodata *data, struct _Repokey *key, struct _KeyValue *kv), void *cbdata)
void pool_clear_pos (Pool *pool)
void pool_set_languages (Pool *pool, const char **languages, int nlanguages)
Id pool_id2langid (Pool *pool, Id id, const char *lang, int create)
char * pool_alloctmpspace (Pool *pool, int len)
char * pool_tmpjoin (Pool *pool, const char *str1, const char *str2, const char *str3)
static int solver_fill_DU_cb (void *cbdata, Solvable *s, Repodata *data, Repokey *key, KeyValue *value)
static void propagate_mountpoints (struct mptree *mptree, int pos, Id mountpoint)
void pool_calc_duchanges (Pool *pool, Map *installedmap, DUChanges *mps, int nmps)
int pool_calc_installsizechange (Pool *pool, Map *installedmap)
static Id dep2name (Pool *pool, Id dep)
static int providedbyinstalled_multiversion (Pool *pool, unsigned char *map, Id n, Id con)
static int providedbyinstalled (Pool *pool, unsigned char *map, Id dep, int ispatch, Map *noobsoletesmap)
void pool_trivial_installable_noobsoletesmap (Pool *pool, Map *installedmap, Queue *pkgs, Queue *res, Map *noobsoletesmap)
void pool_trivial_installable (Pool *pool, Map *installedmap, Queue *pkgs, Queue *res)
const char * pool_lookup_str (Pool *pool, Id entry, Id keyname)
Id pool_lookup_id (Pool *pool, Id entry, Id keyname)
unsigned int pool_lookup_num (Pool *pool, Id entry, Id keyname, unsigned int notfound)
int pool_lookup_void (Pool *pool, Id entry, Id keyname)
const unsigned char * pool_lookup_bin_checksum (Pool *pool, Id entry, Id keyname, Id *typep)
const char * pool_lookup_checksum (Pool *pool, Id entry, Id keyname, Id *typep)
void pool_add_fileconflicts_deps (Pool *pool, Queue *conflicts)


Define Documentation

#define SOLVABLE_BLOCK   255

Definition at line 30 of file pool.c.

Referenced by pool_add_solvable(), pool_add_solvable_block(), and pool_create().

#define KNOWNID_INITIALIZE

Definition at line 32 of file pool.c.

#define EVRCMP_DEPCMP   EVRCMP_MATCH_RELEASE

Definition at line 427 of file pool.c.

Referenced by pool_addrelproviders(), pool_match_dep(), and pool_match_nevr_rel().

#define SEARCHFILES_BLOCK   127

Definition at line 793 of file pool.c.

Referenced by pool_addfileprovides_dep(), and pool_addfileprovides_ids().

#define MPTREE_BLOCK   15

Definition at line 1357 of file pool.c.

Referenced by pool_calc_duchanges().


Function Documentation

Pool* pool_create ( void   ) 

void pool_free ( Pool pool  ) 

Id pool_add_solvable ( Pool pool  ) 

Solvable management.

Definition at line 100 of file pool.c.

References _Pool::nsolvables, sat_extend(), SOLVABLE_BLOCK, and _Pool::solvables.

Referenced by repo_add_solvable().

Id pool_add_solvable_block ( Pool pool,
int  count 
)

Definition at line 108 of file pool.c.

References _Pool::nsolvables, sat_extend(), SOLVABLE_BLOCK, and _Pool::solvables.

Referenced by repo_add_solvable_block().

void pool_free_solvable_block ( Pool pool,
Id  start,
int  count,
int  reuseids 
)

Definition at line 120 of file pool.c.

References _Pool::nsolvables, and _Pool::solvables.

Referenced by repo_empty(), repo_free_solvable_block(), and repo_freeallrepos().

void pool_set_installed ( Pool pool,
Repo installed 
)

Definition at line 135 of file pool.c.

References _Pool::installed, and pool_freewhatprovides().

static int pool_shrink_whatprovides_sortcmp ( const void *  ap,
const void *  bp,
void *  dp 
) [static]

Definition at line 144 of file pool.c.

References _Pool::whatprovides, and _Pool::whatprovidesdata.

Referenced by pool_shrink_whatprovides().

static void pool_shrink_whatprovides ( Pool pool  )  [static]

void pool_createwhatprovides ( Pool pool  ) 

void pool_freewhatprovides ( Pool pool  ) 

Id pool_queuetowhatprovides ( Pool pool,
Queue q 
)

int pool_match_nevr_rel ( Pool pool,
Solvable s,
Id  d 
)

int pool_match_dep ( Pool pool,
Id  d1,
Id  d2 
)

Id pool_addrelproviders ( Pool pool,
Id  d 
)

void pool_debug ( Pool pool,
int  type,
const char *  format,
  ... 
)

void pool_setdebuglevel ( Pool pool,
int  level 
)

static void pool_addfileprovides_dep ( Pool pool,
Id ida,
struct searchfiles sf,
struct searchfiles isf 
) [static]

static int addfileprovides_cb ( void *  cbdata,
Solvable s,
Repodata data,
Repokey key,
KeyValue value 
) [static]

static void pool_addfileprovides_search ( Pool pool,
struct addfileprovides_cbdata cbd,
struct searchfiles sf,
Repo repoonly 
) [static]

void pool_addfileprovides_ids ( Pool pool,
Repo installed,
Id **  idp 
)

void pool_addfileprovides ( Pool pool  ) 

Definition at line 1132 of file pool.c.

References _Pool::installed, and pool_addfileprovides_ids().

void pool_search ( Pool pool,
Id  p,
Id  key,
const char *  match,
int  flags,
int(*)(void *cbdata, Solvable *s, struct _Repodata *data, struct _Repokey *key, struct _KeyValue *kv)  callback,
void *  cbdata 
)

Definition at line 1138 of file pool.c.

References _Pool::nsolvables, _Solvable::repo, repo_search(), and _Pool::solvables.

void pool_clear_pos ( Pool pool  ) 

Definition at line 1153 of file pool.c.

References _Pool::pos.

Referenced by dataiterator_setpos(), dataiterator_setpos_parent(), and repodata_setpos_kv().

void pool_set_languages ( Pool pool,
const char **  languages,
int  nlanguages 
)

Id pool_id2langid ( Pool pool,
Id  id,
const char *  lang,
int  create 
)

Definition at line 1181 of file pool.c.

References id2str(), sat_malloc(), and str2id().

Referenced by solvable_lookup_str_lang(), and solvable_lookup_str_poollang().

char* pool_alloctmpspace ( Pool pool,
int  len 
)

char* pool_tmpjoin ( Pool pool,
const char *  str1,
const char *  str2,
const char *  str3 
)

Definition at line 1218 of file pool.c.

References pool_alloctmpspace().

static int solver_fill_DU_cb ( void *  cbdata,
Solvable s,
Repodata data,
Repokey key,
KeyValue value 
) [static]

static void propagate_mountpoints ( struct mptree mptree,
int  pos,
Id  mountpoint 
) [static]

Definition at line 1346 of file pool.c.

References mptree::child, mptree::mountpoint, and mptree::sibling.

Referenced by pool_calc_duchanges().

void pool_calc_duchanges ( Pool pool,
Map installedmap,
DUChanges mps,
int  nmps 
)

int pool_calc_installsizechange ( Pool pool,
Map installedmap 
)

static Id dep2name ( Pool pool,
Id  dep 
) [inline, static]

Definition at line 1533 of file pool.c.

References GETRELDEP, ISRELDEP, and _Reldep::name.

Referenced by pool_trivial_installable_noobsoletesmap().

static int providedbyinstalled_multiversion ( Pool pool,
unsigned char *  map,
Id  n,
Id  con 
) [static]

Definition at line 1543 of file pool.c.

References _Solvable::arch, FOR_PROVIDES, _Solvable::name, pool_match_nevr(), and _Pool::solvables.

Referenced by providedbyinstalled().

static int providedbyinstalled ( Pool pool,
unsigned char *  map,
Id  dep,
int  ispatch,
Map noobsoletesmap 
) [inline, static]

void pool_trivial_installable_noobsoletesmap ( Pool pool,
Map installedmap,
Queue pkgs,
Queue res,
Map noobsoletesmap 
)

void pool_trivial_installable ( Pool pool,
Map installedmap,
Queue pkgs,
Queue res 
)

Definition at line 1735 of file pool.c.

References pool_trivial_installable_noobsoletesmap().

const char* pool_lookup_str ( Pool pool,
Id  entry,
Id  keyname 
)

Id pool_lookup_id ( Pool pool,
Id  entry,
Id  keyname 
)

unsigned int pool_lookup_num ( Pool pool,
Id  entry,
Id  keyname,
unsigned int  notfound 
)

int pool_lookup_void ( Pool pool,
Id  entry,
Id  keyname 
)

const unsigned char* pool_lookup_bin_checksum ( Pool pool,
Id  entry,
Id  keyname,
Id typep 
)

const char* pool_lookup_checksum ( Pool pool,
Id  entry,
Id  keyname,
Id typep 
)

void pool_add_fileconflicts_deps ( Pool pool,
Queue conflicts 
)


doxygen