db.h File Reference

#include "alpm.h"
#include <limits.h>
#include <time.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  __pmdb_t

Typedefs

typedef enum _pmdbinfrq_t pmdbinfrq_t

Enumerations

enum  _pmdbinfrq_t {
  INFRQ_BASE = 0x01, INFRQ_DESC = 0x02, INFRQ_DEPENDS = 0x04, INFRQ_FILES = 0x08,
  INFRQ_SCRIPTLET = 0x10, INFRQ_DELTAS = 0x20, INFRQ_ALL = 0x3F
}

Functions

pmdb_t_alpm_db_new (const char *dbpath, const char *treename)
void _alpm_db_free (pmdb_t *db)
int _alpm_db_cmp (const void *db1, const void *db2)
alpm_list_t_alpm_db_search (pmdb_t *db, const alpm_list_t *needles)
pmdb_t_alpm_db_register_local (void)
pmdb_t_alpm_db_register_sync (const char *treename)
int _alpm_prov_cmp (const void *provision, const void *needle)
alpm_list_t_alpm_db_whatprovides (pmdb_t *db, const char *package)
int _alpm_db_install (pmdb_t *db, const char *dbfile)
int _alpm_db_open (pmdb_t *db)
void _alpm_db_close (pmdb_t *db)
void _alpm_db_rewind (pmdb_t *db)
pmpkg_t_alpm_db_scan (pmdb_t *db, const char *target)
int _alpm_db_read (pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
int _alpm_db_write (pmdb_t *db, pmpkg_t *info, pmdbinfrq_t inforeq)
int _alpm_db_remove (pmdb_t *db, pmpkg_t *info)
time_t _alpm_db_getlastupdate (const pmdb_t *db)
int _alpm_db_setlastupdate (const pmdb_t *db, time_t time)


Typedef Documentation

typedef enum _pmdbinfrq_t pmdbinfrq_t


Enumeration Type Documentation

enum _pmdbinfrq_t

Enumerator:
INFRQ_BASE 
INFRQ_DESC 
INFRQ_DEPENDS 
INFRQ_FILES 
INFRQ_SCRIPTLET 
INFRQ_DELTAS 
INFRQ_ALL 

Definition at line 29 of file db.h.


Function Documentation

void _alpm_db_close ( pmdb_t db  ) 

Definition at line 84 of file be_files.c.

References ALPM_LOG_FUNC, and __pmdb_t::handle.

int _alpm_db_cmp ( const void *  db1,
const void *  db2 
)

Definition at line 473 of file db.c.

References ALPM_LOG_FUNC.

Referenced by alpm_db_unregister().

Here is the caller graph for this function:

void _alpm_db_free ( pmdb_t db  ) 

Definition at line 454 of file db.c.

References _alpm_db_free_pkgcache(), _alpm_server_free(), alpm_list_free(), alpm_list_next(), ALPM_LOG_FUNC, __alpm_list_t::data, FREE, __pmdb_t::path, and __pmdb_t::servers.

Referenced by _alpm_db_register_local(), and _alpm_db_register_sync().

Here is the call graph for this function:

Here is the caller graph for this function:

time_t _alpm_db_getlastupdate ( const pmdb_t db  ) 

Definition at line 747 of file be_files.c.

References ALPM_LOG_FUNC, and __pmdb_t::path.

Referenced by alpm_db_update().

Here is the caller graph for this function:

int _alpm_db_install ( pmdb_t db,
const char *  dbfile 
)

Definition at line 52 of file be_files.c.

References _alpm_log(), _alpm_unpack(), ALPM_LOG_FUNC, __pmdb_t::path, PM_ERR_SYSTEM, PM_LOG_DEBUG, and RET_ERR.

Referenced by alpm_db_update().

Here is the call graph for this function:

Here is the caller graph for this function:

pmdb_t* _alpm_db_new ( const char *  dbpath,
const char *  treename 
)

Definition at line 437 of file db.c.

References ALPM_LOG_FUNC, CALLOC, __pmdb_t::path, PM_ERR_MEMORY, RET_ERR, and __pmdb_t::treename.

Referenced by _alpm_db_register_local(), and _alpm_db_register_sync().

Here is the caller graph for this function:

int _alpm_db_open ( pmdb_t db  ) 

Definition at line 67 of file be_files.c.

References _alpm_log(), ALPM_LOG_FUNC, __pmdb_t::handle, __pmdb_t::path, PM_ERR_DB_NULL, PM_ERR_DB_OPEN, PM_LOG_DEBUG, and RET_ERR.

Referenced by _alpm_db_register_local(), and _alpm_db_register_sync().

Here is the call graph for this function:

Here is the caller graph for this function:

int _alpm_db_read ( pmdb_t db,
pmpkg_t info,
pmdbinfrq_t  inforeq 
)

Definition at line 248 of file be_files.c.

References _, _alpm_delta_parse(), _alpm_log(), _alpm_strtrim(), alpm_list_add(), ALPM_LOG_FUNC, alpm_splitdep(), __pmpkg_t::arch, __pmpkg_t::backup, __pmpkg_t::builddate, __pmpkg_t::conflicts, __pmpkg_t::deltas, __pmpkg_t::depends, __pmpkg_t::desc, __pmpkg_t::filename, __pmpkg_t::files, __pmpkg_t::force, __pmpkg_t::groups, __pmpkg_t::infolevel, INFRQ_DELTAS, INFRQ_DEPENDS, INFRQ_DESC, INFRQ_FILES, INFRQ_SCRIPTLET, __pmpkg_t::installdate, __pmpkg_t::isize, __pmpkg_t::licenses, __pmpkg_t::md5sum, __pmpkg_t::name, __pmpkg_t::optdepends, __pmpkg_t::origin, __pmpkg_t::packager, __pmdb_t::path, PKG_FROM_FILE, PM_ERR_DB_NULL, PM_LOG_DEBUG, PM_LOG_ERROR, PM_LOG_FUNCTION, __pmpkg_t::provides, __pmpkg_t::reason, __pmpkg_t::replaces, RET_ERR, __pmpkg_t::scriptlet, __pmpkg_t::size, STRDUP, __pmdb_t::treename, __pmpkg_t::url, and __pmpkg_t::version.

Referenced by _alpm_db_scan(), _alpm_pkg_compare_versions(), alpm_pkg_get_arch(), alpm_pkg_get_backup(), alpm_pkg_get_builddate(), alpm_pkg_get_conflicts(), alpm_pkg_get_deltas(), alpm_pkg_get_depends(), alpm_pkg_get_desc(), alpm_pkg_get_filename(), alpm_pkg_get_files(), alpm_pkg_get_groups(), alpm_pkg_get_installdate(), alpm_pkg_get_isize(), alpm_pkg_get_licenses(), alpm_pkg_get_md5sum(), alpm_pkg_get_name(), alpm_pkg_get_optdepends(), alpm_pkg_get_packager(), alpm_pkg_get_provides(), alpm_pkg_get_reason(), alpm_pkg_get_replaces(), alpm_pkg_get_size(), alpm_pkg_get_url(), alpm_pkg_get_version(), and alpm_pkg_has_scriptlet().

Here is the call graph for this function:

Here is the caller graph for this function:

pmdb_t* _alpm_db_register_local ( void   ) 

Definition at line 539 of file db.c.

References _, _alpm_db_free(), _alpm_db_new(), _alpm_db_open(), _alpm_log(), _alpm_makepath(), ALPM_LOG_FUNC, alpm_option_get_dbpath(), _pmhandle_t::db_local, handle, PM_ERR_DB_CREATE, PM_ERR_DB_NOT_NULL, PM_ERR_DB_OPEN, PM_ERR_SYSTEM, PM_LOG_DEBUG, PM_LOG_ERROR, PM_LOG_WARNING, and RET_ERR.

Referenced by alpm_db_register_local().

Here is the call graph for this function:

Here is the caller graph for this function:

pmdb_t* _alpm_db_register_sync ( const char *  treename  ) 

Definition at line 586 of file db.c.

References _, _alpm_db_free(), _alpm_db_new(), _alpm_db_open(), _alpm_log(), _alpm_makepath(), alpm_list_add(), ALPM_LOG_FUNC, alpm_option_get_dbpath(), __alpm_list_t::data, _pmhandle_t::dbs_sync, handle, __alpm_list_t::next, PM_ERR_DB_CREATE, PM_ERR_DB_OPEN, PM_ERR_SYSTEM, PM_LOG_DEBUG, PM_LOG_ERROR, RET_ERR, and __pmdb_t::treename.

Referenced by alpm_db_register_sync().

Here is the call graph for this function:

Here is the caller graph for this function:

int _alpm_db_remove ( pmdb_t db,
pmpkg_t info 
)

Definition at line 725 of file be_files.c.

References _alpm_rmrf(), ALPM_LOG_FUNC, __pmpkg_t::name, __pmdb_t::path, PM_ERR_DB_NULL, RET_ERR, and __pmpkg_t::version.

Referenced by _alpm_remove_commit(), and alpm_db_update().

Here is the call graph for this function:

Here is the caller graph for this function:

void _alpm_db_rewind ( pmdb_t db  ) 

Definition at line 98 of file be_files.c.

References ALPM_LOG_FUNC, and __pmdb_t::handle.

Referenced by _alpm_db_load_pkgcache().

Here is the caller graph for this function:

pmpkg_t* _alpm_db_scan ( pmdb_t db,
const char *  target 
)

Definition at line 148 of file be_files.c.

References _, _alpm_db_read(), _alpm_log(), _alpm_pkg_free(), _alpm_pkg_new(), ALPM_LOG_FUNC, alpm_pkg_free(), __pmpkg_t::db, FREE, __pmdb_t::handle, INFRQ_BASE, __pmpkg_t::origin, __pmpkg_t::origin_data, __pmdb_t::path, PKG_FROM_CACHE, PM_ERR_DB_NULL, PM_LOG_DEBUG, PM_LOG_ERROR, RET_ERR, and STRDUP.

Referenced by _alpm_db_load_pkgcache(), _alpm_remove_loadtarget(), and _alpm_remove_prepare().

Here is the call graph for this function:

Here is the caller graph for this function:

alpm_list_t* _alpm_db_search ( pmdb_t db,
const alpm_list_t needles 
)

Definition at line 479 of file db.c.

References _alpm_db_get_pkgcache(), _alpm_log(), alpm_list_add(), ALPM_LOG_FUNC, alpm_pkg_get_desc(), alpm_pkg_get_name(), alpm_pkg_get_provides(), __alpm_list_t::data, __alpm_list_t::next, PM_ERR_INVALID_REGEX, PM_LOG_DEBUG, and RET_ERR.

Referenced by alpm_db_search().

Here is the call graph for this function:

Here is the caller graph for this function:

int _alpm_db_setlastupdate ( const pmdb_t db,
time_t  time 
)

Definition at line 777 of file be_files.c.

References ALPM_LOG_FUNC, and __pmdb_t::path.

Referenced by alpm_db_update().

Here is the caller graph for this function:

alpm_list_t* _alpm_db_whatprovides ( pmdb_t db,
const char *  package 
)

Definition at line 663 of file db.c.

References _alpm_db_get_pkgcache(), _alpm_prov_cmp(), alpm_list_add(), alpm_list_find(), ALPM_LOG_FUNC, alpm_pkg_get_provides(), __alpm_list_t::data, and __alpm_list_t::next.

Referenced by alpm_db_whatprovides().

Here is the call graph for this function:

Here is the caller graph for this function:

int _alpm_db_write ( pmdb_t db,
pmpkg_t info,
pmdbinfrq_t  inforeq 
)

Definition at line 526 of file be_files.c.

References _, _alpm_log(), alpm_dep_get_string(), ALPM_LOG_FUNC, __pmpkg_t::arch, __pmpkg_t::backup, __pmpkg_t::builddate, __pmpkg_t::conflicts, __alpm_list_t::data, __pmpkg_t::depends, __pmpkg_t::desc, __pmpkg_t::files, __pmpkg_t::force, __pmpkg_t::groups, INFRQ_DEPENDS, INFRQ_DESC, INFRQ_FILES, __pmpkg_t::installdate, __pmpkg_t::isize, __pmpkg_t::licenses, __pmpkg_t::md5sum, __pmpkg_t::name, __alpm_list_t::next, __pmpkg_t::optdepends, __pmpkg_t::packager, __pmdb_t::path, PM_LOG_DEBUG, PM_LOG_ERROR, __pmpkg_t::provides, __pmpkg_t::reason, __pmpkg_t::replaces, __pmpkg_t::size, __pmdb_t::treename, __pmpkg_t::url, and __pmpkg_t::version.

Here is the call graph for this function:

int _alpm_prov_cmp ( const void *  provision,
const void *  needle 
)

Definition at line 646 of file db.c.

Referenced by _alpm_db_whatprovides(), and _alpm_sync_prepare().

Here is the caller graph for this function:


Generated on Mon Jan 14 23:56:23 2008 for libalpm by  doxygen 1.5.4