Add error messages in case of signature error
[oweals/opkg-lede.git] / libopkg / pkg_vec.h
1 /* pkg_vec.h - the opkg 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_VEC_H
19 #define PKG_VEC_H
20
21 typedef struct pkg pkg_t;
22 typedef struct abstract_pkg abstract_pkg_t;
23 typedef struct pkg_vec pkg_vec_t;
24 typedef struct abstract_pkg_vec abstract_pkg_vec_t;
25
26 #include "opkg_conf.h"
27
28 struct pkg_vec
29 {
30     pkg_t **pkgs;
31     int len;
32 };
33
34 struct abstract_pkg_vec
35 {
36     abstract_pkg_t **pkgs;
37     int len;
38 };
39
40
41 pkg_vec_t * pkg_vec_alloc(void);
42 void pkg_vec_free(pkg_vec_t *vec);
43 void marry_two_packages(pkg_t * newpkg, pkg_t * oldpkg);
44
45 /* pkg_vec_insert_merge: might munge pkg.
46 *  returns the pkg that is in the pkg graph */
47 pkg_t *pkg_vec_insert_merge(pkg_vec_t *vec, pkg_t *pkg, int set_status, opkg_conf_t *conf);
48 /* this one never munges pkg */
49 void pkg_vec_insert(pkg_vec_t *vec, const pkg_t *pkg);
50 int pkg_vec_contains(pkg_vec_t *vec, pkg_t *apkg);
51
52 typedef int (*compare_fcn_t)(const void *, const void *);
53 void pkg_vec_sort(pkg_vec_t *vec, compare_fcn_t compar);
54
55 int pkg_vec_clear_marks(pkg_vec_t *vec);
56 int pkg_vec_mark_if_matches(pkg_vec_t *vec, const char *pattern);
57
58 abstract_pkg_vec_t * abstract_pkg_vec_alloc(void);
59 void abstract_pkg_vec_free(abstract_pkg_vec_t *vec);
60 void abstract_pkg_vec_insert(abstract_pkg_vec_t *vec, abstract_pkg_t *pkg);
61 abstract_pkg_t * abstract_pkg_vec_get(abstract_pkg_vec_t *vec, int i);
62 int abstract_pkg_vec_contains(abstract_pkg_vec_t *vec, abstract_pkg_t *apkg);
63 void abstract_pkg_vec_sort(pkg_vec_t *vec, compare_fcn_t compar);
64
65 int pkg_compare_names(const void *p1, const void *p2);
66 #endif
67