opkg: disable gpgme header if gpgme disabled from configure
[oweals/opkg-lede.git] / pkg_hash.h
1 /* pkg_hash.h - the itsy package management system
2
3    Steven M. Ayer
4    
5    Copyright (C) 2002 Compaq Computer Corporation
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 PKG_HASH_H
19 #define PKG_HASH_H
20
21 #include "pkg.h"
22 #include "pkg_vec.h"
23 #include "hash_table.h"
24
25
26 int pkg_hash_init(const char *name, hash_table_t *hash, int len);
27 void pkg_hash_deinit(hash_table_t *hash);
28 void pkg_hash_map(hash_table_t *hash, void (*f)(void *data, void *entry), void *data);
29
30 void pkg_hash_dump(hash_table_t *hash, void *data);
31 void pkg_hash_fetch_available(hash_table_t *hash, pkg_vec_t *available);
32
33 int pkg_hash_add_from_file(opkg_conf_t *conf, const char *file_name,
34                            pkg_src_t *src, pkg_dest_t *dest, int is_status_file);
35 pkg_t *hash_insert_pkg(hash_table_t *hash, pkg_t *pkg, int set_status,opkg_conf_t *conf);
36
37 abstract_pkg_t * ensure_abstract_pkg_by_name(hash_table_t * hash, const char * pkg_name);
38 abstract_pkg_t * abstract_pkg_fetch_by_name(hash_table_t * hash, const char * pkg_name);
39 pkg_vec_t *pkg_hash_fetch_by_name(hash_table_t *hash, const char *pkg_name);
40 void pkg_hash_fetch_all_installed(hash_table_t *hash, pkg_vec_t *installed);
41 pkg_t * pkg_hash_fetch_by_name_version(hash_table_t *hash, 
42                                        const char *pkg_name,
43                                        const char * version);
44 abstract_pkg_vec_t *pkg_hash_fetch_all_installation_candidates(hash_table_t *hash, const char *name);
45 pkg_t *pkg_hash_fetch_best_installation_candidate(opkg_conf_t *conf, abstract_pkg_t *apkg, 
46                                                   int (*constraint_fcn)(pkg_t *pkg, void *data), void *cdata, int quiet);
47 pkg_t *pkg_hash_fetch_best_installation_candidate_by_name(opkg_conf_t *conf, const char *name);
48 pkg_t *pkg_hash_fetch_installed_by_name(hash_table_t *hash,
49                                         const char *pkg_name);
50 pkg_t *pkg_hash_fetch_installed_by_name_dest(hash_table_t *hash,
51                                              const char *pkg_name,
52                                              pkg_dest_t *dest);
53
54 pkg_t *file_hash_get_file_owner(opkg_conf_t *conf, const char *file_name);
55 int file_hash_set_file_owner(opkg_conf_t *conf, const char *file_name, pkg_t *pkg);
56
57 /* XXX: shouldn't this go in pkg_vec.[ch]? */
58 pkg_vec_t *pkg_vec_fetch_by_name(hash_table_t *hash, const char *pkg_name);
59
60 #endif
61