libdebian-installer
packages.h
1 /*
2  * packages.h
3  *
4  * Copyright (C) 2003 Bastian Blank <waldi@debian.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef DEBIAN_INSTALLER__PACKAGES_H
21 #define DEBIAN_INSTALLER__PACKAGES_H
22 
23 #include <debian-installer/hash.h>
24 #include <debian-installer/parser.h>
25 #include <debian-installer/slist.h>
26 
27 #include <stddef.h>
28 #include <string.h>
29 
30 typedef struct di_packages di_packages;
32 
42 {
45  unsigned int resolver;
46 };
47 
53 {
57 };
58 
59 #include <debian-installer/package.h>
60 
62 void di_packages_free (di_packages *packages);
63 
66 
67 void di_packages_append_package (di_packages *packages, di_package *package, di_packages_allocator *allocator);
68 di_package *di_packages_get_package (di_packages *packages, const char *name, size_t n);
69 di_package *di_packages_get_package_new (di_packages *packages, di_packages_allocator *allocator, char *name, size_t n);
70 
71 di_slist *di_packages_resolve_dependencies (di_packages *packages, di_slist *list, di_packages_allocator *allocator);
72 di_slist *di_packages_resolve_dependencies_array (di_packages *packages, di_package **array, di_packages_allocator *allocator);
73 void di_packages_resolve_dependencies_mark (di_packages *packages);
74 
78  di_packages_parser_read_name;
79 
88 
92 
98 di_packages *di_packages_special_read_file (const char *file, di_packages_allocator *allocator, di_parser_info *(info) (void));
99 
108 int di_packages_special_write_file (di_packages *packages, const char *file, di_parser_info *(info) (void));
109 
116 static inline di_packages *di_packages_read_file (const char *file, di_packages_allocator *allocator)
117 {
118  return di_packages_special_read_file (file, allocator, di_packages_parser_info);
119 }
120 
127 static inline di_packages *di_packages_minimal_read_file (const char *file, di_packages_allocator *allocator)
128 {
130 }
131 
138 static inline di_packages *di_packages_status_read_file (const char *file, di_packages_allocator *allocator)
139 {
141 }
142 
151 static inline int di_packages_write_file (di_packages *packages, const char *file)
152 {
154 }
155 
164 static inline int di_packages_status_write_file (di_packages *packages, const char *file)
165 {
167 }
168 
170 #endif