Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

lib/rpmal.c File Reference

More...

#include "system.h"
#include <rpmlib.h>
#include "rpmal.h"
#include "rpmds.h"
#include "rpmfi.h"
#include "debug.h"

Go to the source code of this file.

Data Structures

struct  availableIndex_s
struct  availableIndexEntry_s
struct  availablePackage_s
struct  dirInfo_s
struct  fileIndexEntry_s
struct  rpmal_s

Typedefs

typedef availablePackage_savailablePackage
typedef availableIndexEntry_savailableIndexEntry
typedef availableIndex_savailableIndex
typedef fileIndexEntry_sfileIndexEntry
typedef dirInfo_sdirInfo

Functions

void rpmalFreeIndex (rpmal al)
 Destroy available item index.

alNum alKey2Num (const rpmal al, alKey pkgKey)
alKey alNum2Key (const rpmal al, alNum pkgNum)
rpmal rpmalCreate (int delta)
 Initialize available packckages, items, and directory list.

rpmal rpmalFree (rpmal al)
 Free available packages, items, and directory members.

int dieCompare (const void *one, const void *two)
 Compare two directory info entries by name (qsort/bsearch).

int fieCompare (const void *one, const void *two)
 Compare two file info entries by name (qsort/bsearch).

void rpmalDel (rpmal al, alKey pkgKey)
 Delete package from available list.

alKey rpmalAdd (rpmal *alistp, alKey pkgKey, fnpyKey key, rpmds provides, rpmfi fi, uint_32 tscolor)
 Add package to available list.

int indexcmp (const void *one, const void *two)
 Compare two available index entries by name (qsort/bsearch).

void rpmalAddProvides (rpmal al, alKey pkgKey, rpmds provides, uint_32 tscolor)
 Add package provides to available list index.

void rpmalMakeIndex (rpmal al)
 Generate index for available list.

fnpyKeyrpmalAllFileSatisfiesDepend (const rpmal al, const rpmds ds, alKey *keyp)
 Check added package file lists for package(s) that provide a file.

fnpyKeyrpmalAllSatisfiesDepend (const rpmal al, const rpmds ds, alKey *keyp)
 Check added package file lists for package(s) that have a provide.

fnpyKey rpmalSatisfiesDepend (const rpmal al, const rpmds ds, alKey *keyp)
 Check added package file lists for first package that has a provide.


Variables

int _rpmal_debug = 0


Detailed Description

Definition in file rpmal.c.


Typedef Documentation

typedef struct availableIndex_s* availableIndex
 

Definition at line 61 of file rpmal.c.

Referenced by rpmalAddProvides(), rpmalAllSatisfiesDepend(), rpmalCreate(), rpmalFreeIndex(), and rpmalMakeIndex().

typedef struct availableIndexEntry_s* availableIndexEntry
 

Definition at line 43 of file rpmal.c.

Referenced by indexcmp(), rpmalAddProvides(), and rpmalAllSatisfiesDepend().

typedef struct availablePackage_s* availablePackage
 

Definition at line 15 of file rpmal.c.

Referenced by rpmalAdd(), rpmalAllFileSatisfiesDepend(), rpmalAllSatisfiesDepend(), rpmalDel(), rpmalFree(), and rpmalMakeIndex().

typedef struct dirInfo_s* dirInfo
 

Definition at line 88 of file rpmal.c.

Referenced by dieCompare(), rpmalAdd(), rpmalAllFileSatisfiesDepend(), rpmalDel(), and rpmalFree().

typedef struct fileIndexEntry_s* fileIndexEntry
 

Definition at line 74 of file rpmal.c.

Referenced by fieCompare(), rpmalAdd(), rpmalAllFileSatisfiesDepend(), and rpmalDel().


Function Documentation

alNum alKey2Num const rpmal  al,
alKey  pkgKey
[inline, static]
 

Definition at line 146 of file rpmal.c.

References alKey, alNum, and rpmal.

Referenced by rpmalAdd(), rpmalAddProvides(), rpmalAllSatisfiesDepend(), and rpmalDel().

alKey alNum2Key const rpmal  al,
alNum  pkgNum
[inline, static]
 

Definition at line 155 of file rpmal.c.

References alKey, alNum, and rpmal.

Referenced by rpmalAllFileSatisfiesDepend().

int dieCompare const void *  one,
const void *  two
[static]
 

Compare two directory info entries by name (qsort/bsearch).

Parameters:
one 1st directory info
two 2nd directory info
Returns:
result of comparison

Definition at line 241 of file rpmal.c.

References dirInfo, dirInfo_s::dirName, and dirInfo_s::dirNameLen.

Referenced by rpmalAdd(), rpmalAllFileSatisfiesDepend(), and rpmalDel().

int fieCompare const void *  one,
const void *  two
[static]
 

Compare two file info entries by name (qsort/bsearch).

Parameters:
one 1st directory info
two 2nd directory info
Returns:
result of comparison

Definition at line 266 of file rpmal.c.

References fileIndexEntry_s::baseName, fileIndexEntry_s::baseNameLen, and fileIndexEntry.

Referenced by rpmalAdd(), and rpmalAllFileSatisfiesDepend().

int indexcmp const void *  one,
const void *  two
[static]
 

Compare two available index entries by name (qsort/bsearch).

Parameters:
one 1st available index entry
two 2nd available index entry
Returns:
result of comparison

Definition at line 535 of file rpmal.c.

References availableIndexEntry, availableIndexEntry_s::entry, and availableIndexEntry_s::entryLen.

Referenced by rpmalAllSatisfiesDepend(), and rpmalMakeIndex().

alKey rpmalAdd rpmal alistp,
alKey  pkgKey,
fnpyKey  key,
rpmds  provides,
rpmfi  fi,
uint_32  tscolor
 

Add package to available list.

Parameters:
alistp address of available list
pkgKey package key, RPMAL_NOMATCH to force an append
key associated file name/python object
provides provides dependency set
fi file info set
tscolor transaction color bits
Returns:
available package index

Definition at line 379 of file rpmal.c.

References _rpmal_debug, alKey, alKey2Num(), alloca(), rpmal_s::alloced, alNum, availablePackage, fileIndexEntry_s::baseName, fileIndexEntry_s::baseNameLen, rpmal_s::delta, die(), dieCompare(), dirInfo, rpmal_s::dirs, availablePackage_s::fi, fileIndexEntry_s::ficolor, fieCompare(), fileIndexEntry, fnpyKey, availablePackage_s::key, rpmal_s::list, rpmal_s::numDirs, fileIndexEntry_s::pkgNum, availablePackage_s::provides, rpmal, RPMAL_NOMATCH, rpmalCreate(), rpmalDel(), rpmalFreeIndex(), rpmds, rpmdsLink, rpmfi, rpmfiBN(), rpmfiDC(), rpmfiDN(), rpmfiDX(), rpmfiFC(), rpmfiFColor(), rpmfiInit(), rpmfiLink, rpmfiNext(), rpmfiSetDX(), rpmfiUnlink, rpmal_s::size, availablePackage_s::tscolor, uint_32, xrealloc(), and xstrdup().

Referenced by rpmal_Add(), rpmtsAddAvailableElement(), and rpmtsAddInstallElement().

void rpmalAddProvides rpmal  al,
alKey  pkgKey,
rpmds  provides,
uint_32  tscolor
 

Add package provides to available list index.

Parameters:
al available list
pkgKey package key
provides added package provides
tscolor transaction color bits

Definition at line 551 of file rpmal.c.

References alKey, alKey2Num(), alNum, availableIndex, availableIndexEntry, availableIndexEntry_s::entry, availableIndexEntry_s::entryIx, availableIndexEntry_s::entryLen, rpmal_s::index, availableIndex_s::index, availableIndex_s::k, availableIndexEntry_s::pkgKey, rpmal, rpmds, rpmdsColor(), rpmdsInit(), rpmdsIx(), rpmdsN(), rpmdsNext(), rpmal_s::size, availableIndex_s::size, availableIndexEntry_s::type, and uint_32.

Referenced by rpmal_AddProvides(), and rpmalMakeIndex().

fnpyKey* rpmalAllFileSatisfiesDepend const rpmal  al,
const rpmds  ds,
alKey keyp
 

Check added package file lists for package(s) that provide a file.

Parameters:
al available list
ds dependency set
Return values:
keyp added package key pointer (or NULL)
Returns:
associated package key(s), NULL if none

Definition at line 620 of file rpmal.c.

References _, _free(), _rpmal_debug, alKey, alloca(), alNum2Key(), availablePackage, fileIndexEntry_s::baseName, die(), dieCompare(), dirInfo, rpmal_s::dirs, fileIndexEntry_s::ficolor, fieCompare(), fileIndexEntry, fnpyKey, availablePackage_s::key, rpmal_s::list, rpmal_s::numDirs, fileIndexEntry_s::pkgNum, rpmal, RPMAL_NOMATCH, rpmds, rpmdsN(), rpmdsNotify(), availablePackage_s::tscolor, uint_32, xrealloc(), and xstrdup().

Referenced by rpmalAllSatisfiesDepend().

fnpyKey* rpmalAllSatisfiesDepend const rpmal  al,
const rpmds  ds,
alKey keyp
 

Check added package file lists for package(s) that have a provide.

Parameters:
al available list
ds dependency set
Return values:
keyp added package key pointer (or NULL)
Returns:
associated package key(s), NULL if none

Definition at line 721 of file rpmal.c.

References _, alKey, alKey2Num(), alloca(), availableIndex, availableIndexEntry, availablePackage, availableIndexEntry_s::entryIx, fnpyKey, rpmal_s::index, availableIndex_s::index, indexcmp(), availablePackage_s::key, rpmal_s::list, availableIndexEntry_s::pkgKey, availablePackage_s::provides, rpmal, RPMAL_NOMATCH, rpmalAllFileSatisfiesDepend(), rpmds, rpmdsCompare(), rpmdsN(), rpmdsNext(), rpmdsNotify(), rpmdsSetIx(), availableIndex_s::size, availableIndexEntry_s::type, and xrealloc().

Referenced by checkPackageDeps(), rpmalSatisfiesDepend(), and rpmtsAvailable().

rpmal rpmalCreate int  delta  ) 
 

Initialize available packckages, items, and directory list.

Parameters:
delta no. of entries to add on each realloc
Returns:
al new available list

Definition at line 187 of file rpmal.c.

References rpmal_s::alloced, availableIndex, rpmal_s::delta, rpmal_s::dirs, rpmal_s::index, availableIndex_s::index, rpmal_s::list, rpmal_s::numDirs, rpmal, rpmal_s::size, availableIndex_s::size, and xcalloc().

Referenced by rpmalAdd().

void rpmalDel rpmal  al,
alKey  pkgKey
 

Delete package from available list.

Parameters:
al available list
pkgKey package key

Definition at line 285 of file rpmal.c.

References _free(), _rpmal_debug, alKey, alKey2Num(), alloca(), alNum, availablePackage, die(), dieCompare(), dirInfo, rpmal_s::dirs, availablePackage_s::fi, fileIndexEntry, rpmal_s::list, rpmal_s::numDirs, fileIndexEntry_s::pkgNum, availablePackage_s::provides, rpmal, rpmdsFree(), rpmfi, rpmfiDC(), rpmfiDN(), rpmfiFC(), rpmfiFree(), rpmfiSetDX(), and xrealloc().

Referenced by rpmal_Del(), and rpmalAdd().

rpmal rpmalFree rpmal  al  ) 
 

Free available packages, items, and directory members.

Parameters:
al available list
Returns:
NULL always

Definition at line 205 of file rpmal.c.

References _free(), rpmal_s::alloced, availablePackage, die(), dirInfo, rpmal_s::dirs, availablePackage_s::fi, rpmal_s::list, rpmal_s::numDirs, availablePackage_s::provides, rpmal, rpmalFreeIndex(), rpmdsFree(), rpmfiFree(), and rpmal_s::size.

Referenced by rpmal_dealloc(), rpmtsClean(), and rpmtsFree().

void rpmalFreeIndex rpmal  al  )  [static]
 

Destroy available item index.

Parameters:
al available list

Definition at line 123 of file rpmal.c.

References _free(), availableIndex, availableIndex_s::index, rpmal_s::index, rpmal, and availableIndex_s::size.

Referenced by rpmalAdd(), and rpmalFree().

void rpmalMakeIndex rpmal  al  ) 
 

Generate index for available list.

Parameters:
al available list

Definition at line 592 of file rpmal.c.

References alKey, availableIndex, availablePackage, rpmal_s::index, availableIndex_s::index, indexcmp(), availableIndex_s::k, rpmal_s::list, availablePackage_s::provides, rpmal, rpmalAddProvides(), rpmdsCount(), availableIndex_s::size, rpmal_s::size, availablePackage_s::tscolor, and xrealloc().

Referenced by rpmal_MakeIndex(), rpmts_Check(), rpmtsCheck(), rpmtsOrder(), and unsatisfiedDepend().

fnpyKey rpmalSatisfiesDepend const rpmal  al,
const rpmds  ds,
alKey keyp
 

Check added package file lists for first package that has a provide.

Todo:
Eliminate.
Parameters:
al available list
ds dependency set
Return values:
keyp added package key pointer (or NULL)
Returns:
associated package key, NULL if none

Definition at line 808 of file rpmal.c.

References alKey, fnpyKey, rpmal, rpmalAllSatisfiesDepend(), and rpmds.

Referenced by addRelation(), and unsatisfiedDepend().


Variable Documentation

int _rpmal_debug = 0
 

Definition at line 18 of file rpmal.c.


Generated on Thu Sep 9 05:10:33 2004 for rpm by doxygen 1.3.5