libalpm
Arch Linux Package Manager Library
Defines | Functions | Variables
be_sync.c File Reference
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <archive.h>
#include <archive_entry.h>
#include "util.h"
#include "log.h"
#include "alpm.h"
#include "alpm_list.h"
#include "package.h"
#include "handle.h"
#include "delta.h"
#include "deps.h"
#include "dload.h"
Include dependency graph for be_sync.c:

Go to the source code of this file.

Defines

#define READ_NEXT()
#define READ_AND_STORE(f)
#define READ_AND_STORE_ALL(f)
#define READ_AND_SPLITDEP(f)

Functions

int alpm_db_update (int force, alpm_db_t *db)
 Update a package database.
alpm_db_t_alpm_db_register_sync (alpm_handle_t *handle, const char *treename, alpm_siglevel_t level)

Variables

struct db_operations sync_db_ops

Define Documentation

#define READ_AND_SPLITDEP (   f)
Value:
do { \
    if(_alpm_archive_fgets(archive, &buf) != ARCHIVE_OK) goto error; \
    if(_alpm_strip_newline(buf.line) == 0) break; \
    f = alpm_list_add(f, _alpm_splitdep(line)); \
} while(1) /* note the while(1) and not (0) */

Definition at line 477 of file be_sync.c.

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

Definition at line 464 of file be_sync.c.

#define READ_AND_STORE_ALL (   f)
Value:
do { \
    char *linedup; \
    if(_alpm_archive_fgets(archive, &buf) != ARCHIVE_OK) goto error; \
    if(_alpm_strip_newline(buf.line) == 0) break; \
    STRDUP(linedup, buf.line, goto error); \
    f = alpm_list_add(f, linedup); \
} while(1) /* note the while(1) and not (0) */

Definition at line 469 of file be_sync.c.

#define READ_NEXT ( )
Value:
do { \
    if(_alpm_archive_fgets(archive, &buf) != ARCHIVE_OK) goto error; \
    line = buf.line; \
    _alpm_strip_newline(line); \
} while(0)

Definition at line 458 of file be_sync.c.


Function Documentation

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:


Variable Documentation

Initial value:
 {
    .validate         = sync_db_validate,
    .populate         = sync_db_populate,
    .unregister       = _alpm_db_unregister,
}

Definition at line 602 of file be_sync.c.

Referenced by _alpm_db_register_sync().