Remove args_t and cleanup unused stuff.
[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 extern opkg_conf_t *conf;
23
24 #include "hash_table.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 #define OPKG_CONF_DEFAULT_CONF_FILE_DIR OPKGETCDIR"/opkg"
36
37 /* In case the config file defines no dest */
38 #define OPKG_CONF_DEFAULT_DEST_NAME "root"
39 #define OPKG_CONF_DEFAULT_DEST_ROOT_DIR "/"
40
41 #define OPKG_CONF_DEFAULT_HASH_LEN 1024
42
43 struct opkg_conf
44 {
45      pkg_src_list_t pkg_src_list;
46      pkg_dest_list_t pkg_dest_list;
47      nv_pair_list_t arch_list;
48
49      int restrict_to_default_dest;
50      pkg_dest_t *default_dest;
51      char *dest_str;
52
53      char *conf_file;
54
55      char *tmp_dir;
56      char *lists_dir;
57
58      uint pfm; /* package field mask */
59
60      /* options */
61      int autoremove;
62      int force_depends;
63      int force_defaults;
64      int force_maintainer;
65      int force_overwrite;
66      int force_downgrade;
67      int force_reinstall;
68      int force_space;
69      int force_removal_of_dependent_packages;
70      int force_removal_of_essential_packages;
71      int check_signature;
72      int nodeps; /* do not follow dependences */
73      char *offline_root;
74      int query_all;
75      int verbosity;
76      int noaction;
77      char *cache;
78
79 #ifdef HAVE_SSLCURL
80      /* some options could be used by
81       * wget if curl support isn't builtin
82       * If someone want to try...
83       */
84      char *ssl_engine;
85      char *ssl_cert;
86      char *ssl_cert_type;
87      char *ssl_key;
88      char *ssl_key_type;
89      char *ssl_key_passwd;
90      char *ssl_ca_file;
91      char *ssl_ca_path;
92      int ssl_dont_verify_peer;
93 #endif
94 #ifdef HAVE_PATHFINDER
95      int check_x509_path;
96 #endif
97
98      /* proxy options */
99      char *http_proxy;
100      char *ftp_proxy;
101      char *no_proxy;
102      char *proxy_user;
103      char *proxy_passwd;
104
105      char *signature_ca_file;
106      char *signature_ca_path;
107
108      hash_table_t pkg_hash;
109      hash_table_t file_hash;
110      hash_table_t obs_file_hash;
111 };
112
113 enum opkg_option_type {
114      OPKG_OPT_TYPE_BOOL,
115      OPKG_OPT_TYPE_INT,
116      OPKG_OPT_TYPE_STRING
117 };
118 typedef enum opkg_option_type opkg_option_type_t;
119
120 typedef struct opkg_option opkg_option_t;
121 struct opkg_option {
122      const char *name;
123      const opkg_option_type_t type;
124      void * const value;
125 };
126
127 int opkg_conf_init(void);
128 void opkg_conf_deinit(void);
129
130 int opkg_conf_write_status_files(void);
131 char *root_filename_alloc(char *filename);
132
133 #endif