Read pkgcache into hash
[pacman-ng.git] / lib / libalpm / handle.h
blobfa29d112f8cde3994e20aab9ada23ba317b79e9b
1 /*
2 * handle.h
4 * Copyright (c) 2006-2011 Pacman Development Team <pacman-dev@archlinux.org>
5 * Copyright (c) 2002-2006 by Judd Vinet <jvinet@zeroflux.org>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef _ALPM_HANDLE_H
21 #define _ALPM_HANDLE_H
23 #include <stdio.h>
24 #include <sys/types.h>
26 #include "alpm_list.h"
27 #include "db.h"
28 #include "log.h"
29 #include "alpm.h"
30 #include "trans.h"
32 typedef struct _pmhandle_t {
33 /* internal usage */
34 pmdb_t *db_local; /* local db pointer */
35 alpm_list_t *dbs_sync; /* List of (pmdb_t *) */
36 FILE *logstream; /* log file stream pointer */
37 int lckfd; /* lock file descriptor if one exists */
38 pmtrans_t *trans;
40 /* callback functions */
41 alpm_cb_log logcb; /* Log callback function */
42 alpm_cb_download dlcb; /* Download callback function */
43 alpm_cb_totaldl totaldlcb; /* Total download callback function */
44 alpm_cb_fetch fetchcb; /* Download file callback function */
46 /* filesystem paths */
47 char *root; /* Root path, default '/' */
48 char *dbpath; /* Base path to pacman's DBs */
49 char *logfile; /* Name of the log file */
50 char *lockfile; /* Name of the lock file */
51 alpm_list_t *cachedirs; /* Paths to pacman cache directories */
53 /* package lists */
54 alpm_list_t *noupgrade; /* List of packages NOT to be upgraded */
55 alpm_list_t *noextract; /* List of files NOT to extract */
56 alpm_list_t *ignorepkg; /* List of packages to ignore */
57 alpm_list_t *ignoregrp; /* List of groups to ignore */
59 /* options */
60 int usesyslog; /* Use syslog instead of logfile? */ /* TODO move to frontend */
61 char *arch; /* Architecture of packages we should allow */
62 int usedelta; /* Download deltas if possible */
63 int checkspace; /* Check disk space before installing */
64 } pmhandle_t;
66 /* global handle variable */
67 extern pmhandle_t *handle;
69 pmhandle_t *_alpm_handle_new(void);
70 void _alpm_handle_free(pmhandle_t *handle);
72 #endif /* _ALPM_HANDLE_H */
74 /* vim: set ts=2 sw=2 noet: */