00001 /* 00002 * conf.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 _PM_CONF_H 00020 #define _PM_CONF_H 00021 00022 #include <alpm.h> 00023 00024 typedef struct __config_t { 00025 unsigned short op; 00026 unsigned short quiet; 00027 unsigned short verbose; 00028 unsigned short version; 00029 unsigned short help; 00030 unsigned short upgrade; 00031 unsigned short noconfirm; 00032 unsigned short noprogressbar; 00033 unsigned short logmask; 00034 /* unfortunately, we have to keep track of paths both here and in the library 00035 * because they can come from both the command line or config file, and we 00036 * need to ensure we get the order of preference right. */ 00037 char *configfile; 00038 char *rootdir; 00039 char *dbpath; 00040 char *logfile; 00041 /* TODO how to handle cachedirs? */ 00042 00043 unsigned short op_q_isfile; 00044 unsigned short op_q_info; 00045 unsigned short op_q_list; 00046 unsigned short op_q_foreign; 00047 unsigned short op_q_unrequired; 00048 unsigned short op_q_deps; 00049 unsigned short op_q_explicit; 00050 unsigned short op_q_owns; 00051 unsigned short op_q_search; 00052 unsigned short op_q_changelog; 00053 unsigned short op_q_upgrade; 00054 00055 unsigned short op_s_clean; 00056 unsigned short op_s_dependsonly; 00057 unsigned short op_s_downloadonly; 00058 unsigned short op_s_info; 00059 unsigned short op_s_sync; 00060 unsigned short op_s_search; 00061 unsigned short op_s_upgrade; 00062 00063 unsigned short group; 00064 pmtransflag_t flags; 00065 00066 /* conf file options */ 00067 unsigned short chomp; /* I Love Candy! */ 00068 unsigned short usecolor; /* enable colorful output */ 00069 unsigned short showsize; /* show individual package sizes */ 00070 unsigned short totaldownload; /* When downloading, display the amount 00071 downloaded, rate, ETA, and percent 00072 downloaded of the total download list */ 00073 } config_t; 00074 00075 /* Operations */ 00076 enum { 00077 PM_OP_MAIN = 1, 00078 PM_OP_ADD, 00079 PM_OP_REMOVE, 00080 PM_OP_UPGRADE, 00081 PM_OP_QUERY, 00082 PM_OP_SYNC, 00083 PM_OP_DEPTEST 00084 }; 00085 00086 /* global config variable */ 00087 extern config_t *config; 00088 00089 config_t *config_new(void); 00090 int config_free(config_t *oldconfig); 00091 00092 #endif /* _PM_CONF_H */ 00093 00094 /* vim: set ts=2 sw=2 noet: */
1.5.4