libalpm
Arch Linux Package Manager Library
Data Structures | Typedefs | Enumerations | Functions
db.h File Reference
#include <archive.h>
#include <archive_entry.h>
#include "alpm.h"
#include "pkghash.h"
#include "signing.h"
Include dependency graph for db.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  db_operations
struct  __alpm_db_t

Typedefs

typedef enum _alpm_dbinfrq_t alpm_dbinfrq_t

Enumerations

enum  _alpm_dbinfrq_t {
  INFRQ_BASE = 1, INFRQ_DESC = (1 << 1), INFRQ_FILES = (1 << 2), INFRQ_SCRIPTLET = (1 << 3),
  INFRQ_DSIZE = (1 << 4), INFRQ_ALL = 0x1F, INFRQ_ERROR = (1 << 31)
}
enum  _alpm_dbstatus_t {
  DB_STATUS_VALID = (1 << 0), DB_STATUS_INVALID = (1 << 1), DB_STATUS_EXISTS = (1 << 2), DB_STATUS_MISSING = (1 << 3),
  DB_STATUS_LOCAL = (1 << 10), DB_STATUS_PKGCACHE = (1 << 11), DB_STATUS_GRPCACHE = (1 << 12)
}
 Database status. More...

Functions

alpm_db_t_alpm_db_new (const char *treename, int is_local)
void _alpm_db_free (alpm_db_t *db)
const char * _alpm_db_path (alpm_db_t *db)
int _alpm_db_cmp (const void *d1, const void *d2)
alpm_list_t_alpm_db_search (alpm_db_t *db, const alpm_list_t *needles)
alpm_db_t_alpm_db_register_local (alpm_handle_t *handle)
alpm_db_t_alpm_db_register_sync (alpm_handle_t *handle, const char *treename, alpm_siglevel_t level)
void _alpm_db_unregister (alpm_db_t *db)
int _alpm_local_db_prepare (alpm_db_t *db, alpm_pkg_t *info)
int _alpm_local_db_write (alpm_db_t *db, alpm_pkg_t *info, alpm_dbinfrq_t inforeq)
int _alpm_local_db_remove (alpm_db_t *db, alpm_pkg_t *info)
char * _alpm_local_db_pkgpath (alpm_db_t *db, alpm_pkg_t *info, const char *filename)
void _alpm_db_free_pkgcache (alpm_db_t *db)
int _alpm_db_add_pkgincache (alpm_db_t *db, alpm_pkg_t *pkg)
int _alpm_db_remove_pkgfromcache (alpm_db_t *db, alpm_pkg_t *pkg)
alpm_pkghash_t_alpm_db_get_pkgcache_hash (alpm_db_t *db)
alpm_list_t_alpm_db_get_pkgcache (alpm_db_t *db)
alpm_pkg_t_alpm_db_get_pkgfromcache (alpm_db_t *db, const char *target)
alpm_list_t_alpm_db_get_groupcache (alpm_db_t *db)
alpm_group_t_alpm_db_get_groupfromcache (alpm_db_t *db, const char *target)

Typedef Documentation


Enumeration Type Documentation

Enumerator:
INFRQ_BASE 
INFRQ_DESC 
INFRQ_FILES 
INFRQ_SCRIPTLET 
INFRQ_DSIZE 
INFRQ_ALL 
INFRQ_ERROR 

Definition at line 34 of file db.h.

Database status.

Bitflags.

Enumerator:
DB_STATUS_VALID 
DB_STATUS_INVALID 
DB_STATUS_EXISTS 
DB_STATUS_MISSING 
DB_STATUS_LOCAL 
DB_STATUS_PKGCACHE 
DB_STATUS_GRPCACHE 

Definition at line 46 of file db.h.


Function Documentation

int _alpm_db_add_pkgincache ( alpm_db_t db,
alpm_pkg_t pkg 
)
int _alpm_db_cmp ( const void *  d1,
const void *  d2 
)

Definition at line 380 of file db.c.

References __alpm_db_t::treename.

Referenced by alpm_db_unregister().

Here is the caller graph for this function:

void _alpm_db_free ( alpm_db_t db)

Definition at line 336 of file db.c.

References _alpm_db_free_pkgcache(), __alpm_db_t::_path, FREE, FREELIST, __alpm_db_t::servers, and __alpm_db_t::treename.

Referenced by _alpm_db_register_local(), and _alpm_db_unregister().

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 500 of file db.c.

References _alpm_log(), _alpm_pkg_free(), _alpm_pkghash_free(), alpm_list_free_inner(), ALPM_LOG_DEBUG, DB_STATUS_PKGCACHE, __alpm_db_t::handle, __alpm_pkghash_t::list, __alpm_db_t::pkgcache, __alpm_db_t::status, and __alpm_db_t::treename.

Referenced by _alpm_db_free(), and alpm_db_update().

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 661 of file db.c.

References ALPM_ERR_DB_INVALID, DB_STATUS_GRPCACHE, DB_STATUS_VALID, __alpm_db_t::grpcache, __alpm_db_t::handle, RET_ERR, and __alpm_db_t::status.

Referenced by _alpm_db_get_groupfromcache(), and alpm_db_get_groupcache().

Here is the caller graph for this function:

alpm_group_t* _alpm_db_get_groupfromcache ( alpm_db_t db,
const char *  target 
)

Definition at line 678 of file db.c.

References _alpm_db_get_groupcache(), __alpm_list_t::data, _alpm_group_t::name, and __alpm_list_t::next.

Referenced by alpm_db_readgroup().

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 536 of file db.c.

References _alpm_db_get_pkgcache_hash(), and __alpm_pkghash_t::list.

Referenced by _alpm_db_find_fileconflicts(), _alpm_db_search(), _alpm_outerconflicts(), _alpm_recursedeps(), _alpm_remove_prepare(), _alpm_sync_prepare(), alpm_db_get_pkgcache(), and alpm_sync_sysupgrade().

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 519 of file db.c.

References ALPM_ERR_DB_INVALID, DB_STATUS_PKGCACHE, DB_STATUS_VALID, __alpm_db_t::handle, __alpm_db_t::pkgcache, RET_ERR, and __alpm_db_t::status.

Referenced by _alpm_db_get_pkgcache(), and _alpm_db_get_pkgfromcache().

Here is the caller graph for this function:

alpm_pkg_t* _alpm_db_get_pkgfromcache ( alpm_db_t db,
const char *  target 
)

Definition at line 595 of file db.c.

References _alpm_db_get_pkgcache_hash(), and _alpm_pkghash_find().

Referenced by _alpm_check_diskspace(), _alpm_db_find_fileconflicts(), _alpm_resolvedeps(), _alpm_sync_prepare(), alpm_add_pkg(), alpm_db_get_pkg(), alpm_sync_newversion(), and alpm_sync_sysupgrade().

Here is the call graph for this function:

Here is the caller graph for this function:

alpm_db_t* _alpm_db_new ( const char *  treename,
int  is_local 
)

Definition at line 321 of file db.c.

References CALLOC, DB_STATUS_LOCAL, __alpm_db_t::status, STRDUP, and __alpm_db_t::treename.

Referenced by _alpm_db_register_local(), and _alpm_db_register_sync().

Here is the caller graph for this function:

const char* _alpm_db_path ( alpm_db_t db)

Definition at line 927 of file be_local.c.

References _alpm_db_free(), _alpm_db_new(), _alpm_log(), ALPM_ERR_DB_CREATE, ALPM_LOG_DEBUG, __alpm_handle_t::db_local, handle, __alpm_db_t::handle, local_db_ops, __alpm_db_t::ops, and __alpm_handle_t::pm_errno.

Referenced by alpm_initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

alpm_db_t* _alpm_db_register_sync ( alpm_handle_t handle,
const char *  treename,
alpm_siglevel_t  level 
)

Definition at line 608 of file be_sync.c.

References _alpm_db_new(), _alpm_log(), ALPM_ERR_DB_CREATE, ALPM_ERR_WRONG_ARGS, alpm_list_add(), ALPM_LOG_DEBUG, ALPM_SIG_USE_DEFAULT, __alpm_handle_t::dbs_sync, handle, __alpm_db_t::handle, __alpm_db_t::ops, RET_ERR, __alpm_db_t::siglevel, and sync_db_ops.

Referenced by alpm_db_register_sync().

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 569 of file db.c.

References _alpm_log(), _alpm_pkg_free(), _alpm_pkghash_remove(), ALPM_LOG_DEBUG, DB_STATUS_PKGCACHE, __alpm_db_t::handle, __alpm_pkg_t::name, __alpm_db_t::pkgcache, __alpm_db_t::status, and __alpm_db_t::treename.

Referenced by _alpm_remove_single_package().

Here is the call graph for this function:

Here is the caller graph for this function:

alpm_list_t* _alpm_db_search ( alpm_db_t db,
const alpm_list_t needles 
)
char* _alpm_local_db_pkgpath ( alpm_db_t db,
alpm_pkg_t info,
const char *  filename 
)

Definition at line 474 of file be_local.c.

References _alpm_db_path(), ALPM_ERR_MEMORY, dbpath, __alpm_db_t::handle, MALLOC, __alpm_pkg_t::name, RET_ERR, and __alpm_pkg_t::version.

Referenced by _alpm_local_db_prepare(), _alpm_local_db_remove(), _alpm_local_db_write(), and _alpm_remove_single_package().

Here is the call graph for this function:

Here is the caller graph for this function:

int _alpm_local_db_prepare ( alpm_db_t db,
alpm_pkg_t info 
)

Definition at line 710 of file be_local.c.

References _, _alpm_local_db_pkgpath(), _alpm_log(), ALPM_LOG_ERROR, and __alpm_db_t::handle.

Here is the call graph for this function:

int _alpm_local_db_remove ( alpm_db_t db,
alpm_pkg_t info 
)

Definition at line 907 of file be_local.c.

References _alpm_local_db_pkgpath(), and _alpm_rmrf().

Referenced by _alpm_remove_single_package().

Here is the call graph for this function:

Here is the caller graph for this function:

int _alpm_local_db_write ( alpm_db_t db,
alpm_pkg_t info,
alpm_dbinfrq_t  inforeq 
)