aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.h
blob: 35008c46ba638f65c3f8660736dcd7574f3d46f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
 * Copyright (C) 2003,2004,2005 Jason Woodward <woodwardj at jaos dot org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Library General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <getopt.h>
#include <curl/curl.h>
#include <curl/types.h>
#include <curl/easy.h>
#include <regex.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <dirent.h>
#include <ctype.h>
#include <openssl/evp.h>
#include <libintl.h>
#include <locale.h>

#include "common.h"
#include "configuration.h"
#include "package.h"
#include "curl.h"
#include "transaction.h"
#include "action.h"

enum action {
	USAGE = 0, UPDATE, INSTALL, REMOVE, SHOW, SEARCH, UPGRADE,
	LIST, INSTALLED, CLEAN, SHOWVERSION, AUTOCLEAN
};

#define UPDATE_OPT 'u'
#define UPGRADE_OPT 'g'
#define INSTALL_OPT 'i'
#define REMOVE_OPT 'r'
#define SHOW_OPT 's'
#define SEARCH_OPT 'e'
#define LIST_OPT 't'
#define INSTALLED_OPT 'd'
#define CLEAN_OPT 'c'
#define DOWNLOAD_ONLY_OPT 'o'
#define SIMULATE_OPT 'm'
#define VERSION_OPT 'v'
#define NO_PROMPT_OPT 'b'
#define REINSTALL_OPT 'n'
#define IGNORE_EXCLUDES_OPT 'x'
#define NO_MD5_OPT '5'
#define DIST_UPGRADE_OPT 'h'
#define HELP_OPT 'l'
#define IGNORE_DEP_OPT 'p'
#define NO_DEP_OPT 'q'
#define PRINT_URIS_OPT 'P'
#define SHOW_STATS_OPT 'S'
#define CONFIG_OPT 'C'
#define AUTOCLEAN_OPT 'a'
#define OBSOLETE_OPT 'O'

#define DEBUG 0
#define DO_NOT_UNLINK_BAD_FILES 1

#define _(text) gettext(text)