00001 /* 00002 * handle.h 00003 * 00004 * Copyright (c) 2002-2007 by Judd Vinet <jvinet@zeroflux.org> 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 #ifndef _ALPM_HANDLE_H 00020 #define _ALPM_HANDLE_H 00021 00022 #include <stdio.h> 00023 #include <sys/types.h> 00024 00025 #include "alpm_list.h" 00026 #include "db.h" 00027 #include "log.h" 00028 #include "alpm.h" 00029 #include "trans.h" 00030 00031 typedef struct _pmhandle_t { 00032 /* internal usage */ 00033 uid_t uid; /* current UID */ /* TODO is this used? */ 00034 pmdb_t *db_local; /* local db pointer */ 00035 alpm_list_t *dbs_sync; /* List of (pmdb_t *) */ 00036 FILE *logstream; /* log file stream pointer */ 00037 int lckfd; /* lock file descriptor if one exists */ 00038 pmtrans_t *trans; 00039 00040 /* callback functions */ 00041 alpm_cb_log logcb; /* Log callback function */ 00042 alpm_cb_download dlcb; /* Download callback function */ 00043 00044 /* filesystem paths */ 00045 char *root; /* Root path, default '/' */ 00046 char *dbpath; /* Base path to pacman's DBs */ 00047 char *logfile; /* Name of the log file */ 00048 char *lockfile; /* Name of the lock file */ 00049 alpm_list_t *cachedirs; /* Paths to pacman cache directories */ 00050 00051 /* package lists */ 00052 alpm_list_t *noupgrade; /* List of packages NOT to be upgraded */ 00053 alpm_list_t *noextract; /* List of packages NOT to extract */ /*TODO is this used?*/ 00054 alpm_list_t *ignorepkg; /* List of packages to ignore */ 00055 alpm_list_t *holdpkg; /* List of packages which 'hold' pacman */ 00056 alpm_list_t *ignoregrp; /* List of groups to ignore */ 00057 00058 /* options */ 00059 unsigned short usesyslog; /* Use syslog instead of logfile? */ /* TODO move to frontend */ 00060 unsigned short nopassiveftp; /* Don't use PASV ftp connections */ 00061 char *xfercommand; /* External download command */ 00062 unsigned short usedelta; /* Download deltas if possible */ 00063 } pmhandle_t; 00064 00065 /* global handle variable */ 00066 extern pmhandle_t *handle; 00067 00068 pmhandle_t *_alpm_handle_new(); 00069 void _alpm_handle_free(pmhandle_t *handle); 00070 00071 #endif /* _ALPM_HANDLE_H */ 00072 00073 /* vim: set ts=2 sw=2 noet: */
1.5.4