libalpm
Arch Linux Package Manager Library
Defines | Functions | Variables
be_local.c File Reference
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <stdint.h>
#include <sys/stat.h>
#include <dirent.h>
#include <limits.h>
#include "db.h"
#include "alpm_list.h"
#include "log.h"
#include "util.h"
#include "alpm.h"
#include "handle.h"
#include "package.h"
#include "deps.h"
Include dependency graph for be_local.c:

Go to the source code of this file.

Defines

#define LAZY_LOAD(info, errret)
#define READ_NEXT()
#define READ_AND_STORE(f)
#define READ_AND_STORE_ALL(f)
#define READ_AND_SPLITDEP(f)

Functions

char * _alpm_local_db_pkgpath (alpm_db_t *db, alpm_pkg_t *info, const char *filename)
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)
alpm_db_t_alpm_db_register_local (alpm_handle_t *handle)

Variables

struct db_operations local_db_ops

Define Documentation

#define LAZY_LOAD (   info,
  errret 
)
Value:
do { \
        if(!(pkg->infolevel & info)) { \
            local_db_read(pkg, info); \
        } \
    } while(0)

Definition at line 43 of file be_local.c.

#define READ_AND_SPLITDEP (   f)
Value:
do { \
    if(fgets(line, sizeof(line), fp) == NULL) {\
        if(!feof(fp)) goto error; else break; \
    } \
    if(_alpm_strip_newline(line) == 0) break; \
    f = alpm_list_add(f, _alpm_splitdep(line)); \
} while(1) /* note the while(1) and not (0) */

Definition at line 510 of file be_local.c.

#define READ_AND_STORE (   f)
Value:
do { \
    READ_NEXT(); \
    STRDUP(f, line, goto error); \
} while(0)

Definition at line 495 of file be_local.c.

#define READ_AND_STORE_ALL (   f)
Value:
do { \
    char *linedup; \
    if(fgets(line, sizeof(line), fp) == NULL) {\
        if(!feof(fp)) goto error; else break; \
    } \
    if(_alpm_strip_newline(line) == 0) break; \
    STRDUP(linedup, line, goto error); \
    f = alpm_list_add(f, linedup); \
} while(1) /* note the while(1) and not (0) */

Definition at line 500 of file be_local.c.

#define READ_NEXT ( )
Value:
do { \
    if(fgets(line, sizeof(line), fp) == NULL && !feof(fp)) goto error; \
    _alpm_strip_newline(line); \
} while(0)

Definition at line 490 of file be_local.c.


Function Documentation

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:

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 
)

Variable Documentation

Initial value:
 {
    .validate         = local_db_validate,
    .populate         = local_db_populate,
    .unregister       = _alpm_db_unregister,
}

Definition at line 921 of file be_local.c.

Referenced by _alpm_db_register_local().