Rename pmtrans_t to alpm_trans_t
[pacman-ng.git] / lib / libalpm / handle.h
blobc0078b0bca3423dcffb668fbbecd3e911d702c9d
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 "alpm.h"
29 #ifdef HAVE_LIBCURL
30 #include <curl/curl.h>
31 #endif
33 struct __alpm_handle_t {
34 /* internal usage */
35 alpm_db_t *db_local; /* local db pointer */
36 alpm_list_t *dbs_sync; /* List of (alpm_db_t *) */
37 FILE *logstream; /* log file stream pointer */
38 FILE *lckstream; /* lock file stream pointer if one exists */
39 alpm_trans_t *trans;
41 #ifdef HAVE_LIBCURL
42 /* libcurl handle */
43 CURL *curl; /* reusable curl_easy handle */
44 CURLcode curlerr; /* last error produced by curl */
45 #endif
47 /* callback functions */
48 alpm_cb_log logcb; /* Log callback function */
49 alpm_cb_download dlcb; /* Download callback function */
50 alpm_cb_totaldl totaldlcb; /* Total download callback function */
51 alpm_cb_fetch fetchcb; /* Download file callback function */
53 /* filesystem paths */
54 char *root; /* Root path, default '/' */
55 char *dbpath; /* Base path to pacman's DBs */
56 char *logfile; /* Name of the log file */
57 char *lockfile; /* Name of the lock file */
58 char *gpgdir; /* Directory where GnuPG files are stored */
59 alpm_list_t *cachedirs; /* Paths to pacman cache directories */
61 /* package lists */
62 alpm_list_t *noupgrade; /* List of packages NOT to be upgraded */
63 alpm_list_t *noextract; /* List of files NOT to extract */
64 alpm_list_t *ignorepkg; /* List of packages to ignore */
65 alpm_list_t *ignoregrp; /* List of groups to ignore */
67 /* options */
68 int usesyslog; /* Use syslog instead of logfile? */ /* TODO move to frontend */
69 char *arch; /* Architecture of packages we should allow */
70 int usedelta; /* Download deltas if possible */
71 int checkspace; /* Check disk space before installing */
72 pgp_verify_t sigverify; /* Default signature verification level */
74 /* error code */
75 enum _pmerrno_t pm_errno;
78 alpm_handle_t *_alpm_handle_new(void);
79 void _alpm_handle_free(alpm_handle_t *handle);
81 int _alpm_handle_lock(alpm_handle_t *handle);
82 int _alpm_handle_unlock(alpm_handle_t *handle);
84 enum _pmerrno_t _alpm_set_directory_option(const char *value,
85 char **storage, int must_exist);
87 #endif /* _ALPM_HANDLE_H */
89 /* vim: set ts=2 sw=2 noet: */