lib/rpmal.c File Reference

#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  availablePackage_s
 Info about a single package to be installed. More...
struct  availableIndexEntry_s
 A single available item (e.g. More...
struct  availableIndex_s
 Index of all available items. More...
struct  fileIndexEntry_s
 A file to be installed/removed. More...
struct  dirInfo_s
 A directory to be installed/removed. More...
struct  rpmal_s
 Set of available packages, items, and directories. More...

Typedefs

typedef struct availablePackage_savailablePackage
typedef struct
availableIndexEntry_s
availableIndexEntry
typedef struct availableIndex_savailableIndex
typedef struct fileIndexEntry_sfileIndexEntry
typedef struct dirInfo_sdirInfo

Functions

static void rpmalFreeIndex (rpmal al)
 Destroy available item index.
static alNum alKey2Num (const rpmal al, alKey pkgKey)
static 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.
static int dieCompare (const void *one, const void *two)
 Compare two directory info entries by name (qsort/bsearch).
static 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.
static 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.

typedef struct availableIndexEntry_s* availableIndexEntry

Definition at line 43 of file rpmal.c.

typedef struct availablePackage_s* availablePackage

Definition at line 15 of file rpmal.c.

typedef struct dirInfo_s* dirInfo

Definition at line 88 of file rpmal.c.

typedef struct fileIndexEntry_s* fileIndexEntry

Definition at line 74 of file rpmal.c.


Function Documentation

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

Definition at line 145 of file rpmal.c.

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

Definition at line 154 of file rpmal.c.

static 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 238 of file rpmal.c.

static 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 263 of file rpmal.c.

static 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 603 of file rpmal.c.

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 414 of file rpmal.c.

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 619 of file rpmal.c.

Referenced by rpmal_AddProvides().

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 690 of file rpmal.c.

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 791 of file rpmal.c.

Referenced by 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 184 of file rpmal.c.

void rpmalDel ( rpmal  al,
alKey  pkgKey 
)

Delete package from available list.

Parameters:
al available list
pkgKey package key

Definition at line 292 of file rpmal.c.

Referenced by rpmal_Del().

rpmal rpmalFree ( rpmal  al  ) 

Free available packages, items, and directory members.

Parameters:
al available list
Returns:
NULL always

Definition at line 202 of file rpmal.c.

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

static void rpmalFreeIndex ( rpmal  al  )  [static]

Destroy available item index.

Parameters:
al available list

Definition at line 123 of file rpmal.c.

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

void rpmalMakeIndex ( rpmal  al  ) 

Generate index for available list.

Parameters:
al available list

Definition at line 660 of file rpmal.c.

Referenced by rpmal_MakeIndex(), rpmts_Check(), 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 879 of file rpmal.c.

Referenced by unsatisfiedDepend().


Variable Documentation

int _rpmal_debug = 0

Definition at line 18 of file rpmal.c.

Referenced by rpmal_Debug().


Generated on Tue Jan 15 19:55:46 2008 for rpm by  doxygen 1.5.4