pool.h File Reference

#include <stdio.h>
#include "satversion.h"
#include "pooltypes.h"
#include "poolid.h"
#include "solvable.h"
#include "bitmap.h"
#include "queue.h"
#include "strpool.h"
#include "knownid.h"

Go to the source code of this file.

Classes

struct  _Repopos
struct  _Pool
struct  _DUChanges

Defines

#define SYSTEMSOLVABLE   1
#define POOL_TMPSPACEBUF   16
#define SAT_FATAL   (1<<0)
#define SAT_ERROR   (1<<1)
#define SAT_WARN   (1<<2)
#define SAT_DEBUG_STATS   (1<<3)
#define SAT_DEBUG_RULE_CREATION   (1<<4)
#define SAT_DEBUG_PROPAGATE   (1<<5)
#define SAT_DEBUG_ANALYZE   (1<<6)
#define SAT_DEBUG_UNSOLVABLE   (1<<7)
#define SAT_DEBUG_SOLUTIONS   (1<<8)
#define SAT_DEBUG_POLICY   (1<<9)
#define SAT_DEBUG_RESULT   (1<<10)
#define SAT_DEBUG_JOB   (1<<11)
#define SAT_DEBUG_SCHUBI   (1<<12)
#define SAT_DEBUG_SOLVER   (1<<13)
#define SAT_DEBUG_TRANSACTION   (1<<14)
#define SAT_DEBUG_TO_STDERR   (1<<30)
#define MAKERELDEP(id)   ((id) | 0x80000000)
#define ISRELDEP(id)   (((id) & 0x80000000) != 0)
#define GETRELID(id)   ((id) ^ 0x80000000)
#define GETRELDEP(pool, id)   ((pool)->rels + ((id) ^ 0x80000000))
#define REL_GT   1
#define REL_EQ   2
#define REL_LT   4
#define REL_AND   16
#define REL_OR   17
#define REL_WITH   18
#define REL_NAMESPACE   19
#define REL_ARCH   20
#define REL_FILECONFLICT   21
#define __attribute__(x)
#define FOR_PROVIDES(v, vp, d)   for (vp = pool_whatprovides(pool, d) ; (v = pool->whatprovidesdata[vp++]) != 0; )
#define FOR_REPOS(idx, r)
#define POOL_DEBUG(type,...)   do {if ((pool->debugmask & (type)) != 0) pool_debug(pool, (type), __VA_ARGS__);} while (0)
#define IF_POOLDEBUG(type)   if ((pool->debugmask & (type)) != 0)

Typedefs

typedef struct _Repopos Repopos
typedef struct _DUChanges DUChanges

Functions

Poolpool_create (void)
 Creates a new pool.
void pool_free (Pool *pool)
 Delete a pool.
void pool_setdebuglevel (Pool *pool, int level)
void pool_debug (Pool *pool, int type, const char *format,...) __attribute__((format(printf
void char * pool_alloctmpspace (Pool *pool, int len)
char * pool_tmpjoin (Pool *pool, const char *str1, const char *str2, const char *str3)
void pool_set_installed (Pool *pool, struct _Repo *repo)
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)
static Solvablepool_id2solvable (const Pool *pool, Id p)
const char * solvable2str (Pool *pool, Solvable *s)
static const char * solvid2str (Pool *pool, Id p)
void pool_set_languages (Pool *pool, const char **languages, int nlanguages)
Id pool_id2langid (Pool *pool, Id id, const char *lang, int create)
Id solvable_lookup_id (Solvable *s, Id keyname)
unsigned int solvable_lookup_num (Solvable *s, Id keyname, unsigned int notfound)
const char * solvable_lookup_str (Solvable *s, Id keyname)
const char * solvable_lookup_str_poollang (Solvable *s, Id keyname)
const char * solvable_lookup_str_lang (Solvable *s, Id keyname, const char *lang, int usebase)
int solvable_lookup_bool (Solvable *s, Id keyname)
int solvable_lookup_void (Solvable *s, Id keyname)
char * solvable_get_location (Solvable *s, unsigned int *medianrp)
const unsigned char * solvable_lookup_bin_checksum (Solvable *s, Id keyname, Id *typep)
const char * solvable_lookup_checksum (Solvable *s, Id keyname, Id *typep)
int solvable_lookup_idarray (Solvable *s, Id keyname, Queue *q)
int solvable_identical (Solvable *s1, Solvable *s2)
Id solvable_selfprovidedep (Solvable *s)
int solvable_trivial_installable_map (Solvable *s, Map *installedmap, Map *conflictsmap)
int solvable_trivial_installable_repo (Solvable *s, struct _Repo *installed)
int solvable_trivial_installable_queue (Solvable *s, Queue *installed)
void pool_create_state_maps (Pool *pool, Queue *installed, Map *installedmap, Map *conflictsmap)
int pool_match_nevr_rel (Pool *pool, Solvable *s, Id d)
int pool_match_dep (Pool *pool, Id d1, Id d2)
static int pool_match_nevr (Pool *pool, Solvable *s, Id d)
void pool_createwhatprovides (Pool *pool)
 Prepares a pool for solving.
void pool_addfileprovides (Pool *pool)
void pool_addfileprovides_ids (Pool *pool, struct _Repo *installed, Id **idp)
void pool_freewhatprovides (Pool *pool)
Id pool_queuetowhatprovides (Pool *pool, Queue *q)
Id pool_addrelproviders (Pool *pool, Id d)
static Id pool_whatprovides (Pool *pool, Id d)
static Idpool_whatprovides_ptr (Pool *pool, Id d)
static void pool_setdebugcallback (Pool *pool, void(*debugcallback)(struct _Pool *, void *data, int type, const char *str), void *debugcallbackdata)
static void pool_setdebugmask (Pool *pool, int mask)
static void pool_setloadcallback (Pool *pool, int(*cb)(struct _Pool *, struct _Repodata *, void *), void *loadcbdata)
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_calc_duchanges (Pool *pool, Map *installedmap, DUChanges *mps, int nmps)
int pool_calc_installsizechange (Pool *pool, Map *installedmap)
void pool_trivial_installable (Pool *pool, Map *installedmap, Queue *pkgs, Queue *res)
void pool_trivial_installable_noobsoletesmap (Pool *pool, Map *installedmap, Queue *pkgs, Queue *res, Map *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)


Define Documentation

#define SYSTEMSOLVABLE   1

#define POOL_TMPSPACEBUF   16

Definition at line 38 of file pool.h.

Referenced by pool_alloctmpspace(), and pool_free().

#define SAT_FATAL   (1<<0)

Definition at line 136 of file pool.h.

Referenced by pool_debug(), repodata_internalize(), and repodata_serialize_key().

#define SAT_ERROR   (1<<1)

#define SAT_WARN   (1<<2)

Definition at line 138 of file pool.h.

Referenced by transaction_check_order().

#define SAT_DEBUG_STATS   (1<<3)

#define SAT_DEBUG_RULE_CREATION   (1<<4)

#define SAT_DEBUG_PROPAGATE   (1<<5)

Definition at line 141 of file pool.h.

Referenced by makeruledecisions(), pool_setdebuglevel(), propagate(), revert(), and solver_run_sat().

#define SAT_DEBUG_ANALYZE   (1<<6)

Definition at line 142 of file pool.h.

Referenced by analyze(), pool_setdebuglevel(), and setpropagatelearn().

#define SAT_DEBUG_UNSOLVABLE   (1<<7)

#define SAT_DEBUG_SOLUTIONS   (1<<8)

#define SAT_DEBUG_POLICY   (1<<9)

#define SAT_DEBUG_RESULT   (1<<10)

#define SAT_DEBUG_JOB   (1<<11)

Definition at line 147 of file pool.h.

Referenced by pool_setdebuglevel(), and solver_solve().

#define SAT_DEBUG_SCHUBI   (1<<12)

#define SAT_DEBUG_SOLVER   (1<<13)

Definition at line 149 of file pool.h.

Referenced by pool_setdebuglevel(), solver_run_sat(), and solver_solve().

#define SAT_DEBUG_TRANSACTION   (1<<14)

Definition at line 150 of file pool.h.

Referenced by pool_setdebuglevel().

#define SAT_DEBUG_TO_STDERR   (1<<30)

Definition at line 152 of file pool.h.

Referenced by pool_debug(), and pool_setdebuglevel().

#define MAKERELDEP ( id   )     ((id) | 0x80000000)

Definition at line 159 of file pool.h.

Referenced by pool_addrelproviders(), rel2id(), and repo_add_solv_flags().

#define ISRELDEP ( id   )     (((id) & 0x80000000) != 0)

#define GETRELID ( id   )     ((id) ^ 0x80000000)

Definition at line 161 of file pool.h.

Referenced by pool_addfileprovides_dep(), pool_addrelproviders(), and pool_whatprovides().

#define GETRELDEP ( pool,
id   )     ((pool)->rels + ((id) ^ 0x80000000))

#define REL_GT   1

Definition at line 164 of file pool.h.

#define REL_EQ   2

Definition at line 165 of file pool.h.

Referenced by solvable_selfprovidedep().

#define REL_LT   4

Definition at line 166 of file pool.h.

#define REL_AND   16

#define REL_OR   17

#define REL_WITH   18

#define REL_NAMESPACE   19

#define REL_ARCH   20

Definition at line 172 of file pool.h.

Referenced by id2rel(), jobtodisablelist(), pool_addrelproviders(), and pool_match_nevr_rel().

#define REL_FILECONFLICT   21

#define __attribute__ (  ) 

Definition at line 176 of file pool.h.

#define FOR_PROVIDES ( v,
vp,
 )     for (vp = pool_whatprovides(pool, d) ; (v = pool->whatprovidesdata[vp++]) != 0; )

#define FOR_REPOS ( idx,
 ) 

Value:

for (idx = 0; idx < pool->nrepos; idx++)                                \
    if ((r = pool->repos[idx]) != 0)

Definition at line 336 of file pool.h.

#define POOL_DEBUG ( type,
...   )     do {if ((pool->debugmask & (type)) != 0) pool_debug(pool, (type), __VA_ARGS__);} while (0)

#define IF_POOLDEBUG ( type   )     if ((pool->debugmask & (type)) != 0)


Typedef Documentation

typedef struct _Repopos Repopos

typedef struct _DUChanges DUChanges


Function Documentation

Pool* pool_create ( void   ) 

void pool_free ( Pool pool  ) 

void pool_setdebuglevel ( Pool pool,
int  level 
)

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

void 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().

void pool_set_installed ( Pool pool,
struct _Repo repo 
)

Definition at line 135 of file pool.c.

References _Pool::installed, and pool_freewhatprovides().

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().

static Solvable* pool_id2solvable ( const Pool pool,
Id  p 
) [inline, static]

Definition at line 207 of file pool.h.

Referenced by repo_add_solv_flags().

const char* solvable2str ( Pool pool,
Solvable s 
)

static const char* solvid2str ( Pool pool,
Id  p 
) [inline, static]

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().

Id solvable_lookup_id ( Solvable s,
Id  keyname 
)

Definition at line 38 of file solvable.c.

References _Repo::pool, _Solvable::repo, repo_lookup_id(), and _Pool::solvables.

Referenced by pool_lookup_id().

unsigned int solvable_lookup_num ( Solvable s,
Id  keyname,
unsigned int  notfound 
)

const char* solvable_lookup_str ( Solvable s,
Id  keyname 
)

const char* solvable_lookup_str_poollang ( Solvable s,
Id  keyname 
)

const char* solvable_lookup_str_lang ( Solvable s,
Id  keyname,
const char *  lang,
int  usebase 
)

int solvable_lookup_bool ( Solvable s,
Id  keyname 
)

int solvable_lookup_void ( Solvable s,
Id  keyname 
)

Definition at line 188 of file solvable.c.

References _Repo::pool, _Solvable::repo, repo_lookup_void(), and _Pool::solvables.

Referenced by pool_lookup_void(), and solvable_get_location().

char* solvable_get_location ( Solvable s,
unsigned int *  medianrp 
)

const unsigned char* solvable_lookup_bin_checksum ( Solvable s,
Id  keyname,
Id typep 
)

const char* solvable_lookup_checksum ( Solvable s,
Id  keyname,
Id typep 
)

int solvable_lookup_idarray ( Solvable s,
Id  keyname,
Queue q 
)

int solvable_identical ( Solvable s1,
Solvable s2 
)

Id solvable_selfprovidedep ( Solvable s  ) 

int solvable_trivial_installable_map ( Solvable s,
Map installedmap,
Map conflictsmap 
)

int solvable_trivial_installable_repo ( Solvable s,
struct _Repo installed 
)

int solvable_trivial_installable_queue ( Solvable s,
Queue installed 
)

void pool_create_state_maps ( Pool pool,
Queue installed,
Map installedmap,
Map conflictsmap 
)

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

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

static int pool_match_nevr ( Pool pool,
Solvable s,
Id  d 
) [inline, static]

void pool_createwhatprovides ( Pool pool  ) 

void pool_addfileprovides ( Pool pool  ) 

Definition at line 1132 of file pool.c.

References _Pool::installed, and pool_addfileprovides_ids().

void pool_addfileprovides_ids ( Pool pool,
struct _Repo installed,
Id **  idp 
)

void pool_freewhatprovides ( Pool pool  ) 

Id pool_queuetowhatprovides ( Pool pool,
Queue q 
)

Id pool_addrelproviders ( Pool pool,
Id  d 
)

static Id pool_whatprovides ( Pool pool,
Id  d 
) [inline, static]

static Id* pool_whatprovides_ptr ( Pool pool,
Id  d 
) [inline, static]

static void pool_setdebugcallback ( Pool pool,
void(*)(struct _Pool *, void *data, int type, const char *str)  debugcallback,
void *  debugcallbackdata 
) [inline, static]

Definition at line 281 of file pool.h.

References _Pool::debugcallback, and _Pool::debugcallbackdata.

static void pool_setdebugmask ( Pool pool,
int  mask 
) [inline, static]

Definition at line 287 of file pool.h.

References _Pool::debugmask.

static void pool_setloadcallback ( Pool pool,
int(*)(struct _Pool *, struct _Repodata *, void *)  cb,
void *  loadcbdata 
) [inline, static]

Definition at line 292 of file pool.h.

References _Pool::loadcallback, and _Pool::loadcallbackdata.

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_calc_duchanges ( Pool pool,
Map installedmap,
DUChanges mps,
int  nmps 
)

int pool_calc_installsizechange ( Pool pool,
Map installedmap 
)

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().

void pool_trivial_installable_noobsoletesmap ( Pool pool,
Map installedmap,
Queue pkgs,
Queue res,
Map 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