Remove list_pending command. Undocumented and the pending_dir was unpopulated.
[oweals/opkg-lede.git] / libopkg / opkg_conf.h
1 /* opkg_conf.h - the opkg package management system
2
3    Carl D. Worth
4
5    Copyright (C) 2001 University of Southern California
6
7    This program is free software; you can redistribute it and/or
8    modify it under the terms of the GNU General Public License as
9    published by the Free Software Foundation; either version 2, or (at
10    your option) any later version.
11
12    This program is distributed in the hope that it will be useful, but
13    WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15    General Public License for more details.
16 */
17
18 #ifndef OPKG_CONF_H
19 #define OPKG_CONF_H
20
21 typedef struct opkg_conf opkg_conf_t;
22
23 #include "hash_table.h"
24 #include "args.h"
25 #include "pkg.h"
26 #include "pkg_hash.h"
27 #include "pkg_src_list.h"
28 #include "pkg_dest_list.h"
29 #include "nv_pair_list.h"
30
31 #define OPKG_CONF_DEFAULT_TMP_DIR_BASE "/tmp"
32 #define OPKG_CONF_TMP_DIR_SUFFIX "opkg-XXXXXX"
33 #define OPKG_CONF_LISTS_DIR  OPKG_STATE_DIR_PREFIX "/lists"
34
35 /* In case the config file defines no dest */
36 #define OPKG_CONF_DEFAULT_DEST_NAME "root"
37 #define OPKG_CONF_DEFAULT_DEST_ROOT_DIR "/"
38
39 #define OPKG_CONF_DEFAULT_HASH_LEN 1024
40
41 struct opkg_conf
42 {
43      int lock_fd; /* file descriptor for the lock file */
44      pkg_src_list_t pkg_src_list;
45      pkg_dest_list_t pkg_dest_list;
46      nv_pair_list_t arch_list;
47
48      int restrict_to_default_dest;
49      pkg_dest_t *default_dest;
50
51      char *tmp_dir;
52      char *lists_dir;
53
54      /* options */
55      int autoremove;
56      int force_depends;
57      int force_defaults;
58      int force_maintainer;
59      int force_overwrite;
60      int force_downgrade;
61      int force_reinstall;
62      int force_space;
63      int force_removal_of_dependent_packages;
64      int force_removal_of_essential_packages;
65      int check_signature;
66      int nodeps; /* do not follow dependences */
67      char *offline_root;
68      char *offline_root_path;
69      char *offline_root_pre_script_cmd;
70      char *offline_root_post_script_cmd;
71      int query_all;
72      int verbosity;
73      int noaction;
74      char *cache;
75
76 #ifdef HAVE_SSLCURL
77      /* some options could be used by
78       * wget if curl support isn't builtin
79       * If someone want to try...
80       */
81      char *ssl_engine;
82      char *ssl_cert;
83      char *ssl_cert_type;
84      char *ssl_key;
85      char *ssl_key_type;
86      char *ssl_key_passwd;
87      char *ssl_ca_file;
88      char *ssl_ca_path;
89      int ssl_dont_verify_peer;
90 #endif
91 #ifdef HAVE_PATHFINDER
92      int check_x509_path;
93 #endif
94
95      /* proxy options */
96      char *http_proxy;
97      char *ftp_proxy;
98      char *no_proxy;
99      char *proxy_user;
100      char *proxy_passwd;
101
102      char *signature_ca_file;
103      char *signature_ca_path;
104
105      hash_table_t pkg_hash;
106      hash_table_t file_hash;
107      hash_table_t obs_file_hash;
108 };
109
110 enum opkg_option_type {
111      OPKG_OPT_TYPE_BOOL,
112      OPKG_OPT_TYPE_INT,
113      OPKG_OPT_TYPE_STRING
114 };
115 typedef enum opkg_option_type opkg_option_type_t;
116
117 typedef struct opkg_option opkg_option_t;
118 struct opkg_option {
119      const char *name;
120      const opkg_option_type_t type;
121      const void *value;
122 };
123
124 int opkg_conf_init(opkg_conf_t *conf, const args_t *args);
125 void opkg_conf_deinit(opkg_conf_t *conf);
126
127 int opkg_conf_write_status_files(opkg_conf_t *conf);
128 char *root_filename_alloc(opkg_conf_t *conf, char *filename);
129
130
131 void opkg_init_options_array(const opkg_conf_t *conf, opkg_option_t **options);
132
133 #endif