libdebian-installer
system/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__SYSTEM__PACKAGES_H
21 #define DEBIAN_INSTALLER__SYSTEM__PACKAGES_H
22 
23 #include <debian-installer/package.h>
24 #include <debian-installer/packages.h>
25 
26 #include <stdbool.h>
27 
29 
39 {
44 };
45 
46 void di_system_package_destroy (di_system_package *package);
47 
48 di_packages *di_system_packages_alloc (void);
49 di_packages_allocator *di_system_packages_allocator_alloc (void);
50 
51 bool di_system_package_check_subarchitecture (di_package *package, const char *subarchitecture);
52 
53 extern const di_parser_fieldinfo *di_system_package_parser_fieldinfo[];
54 
55 di_parser_info *di_system_package_parser_info (void);
56 di_parser_info *di_system_packages_parser_info (void);
57 di_parser_info *di_system_packages_status_parser_info (void);
58 
65 static inline di_package *di_system_package_read_file (const char *file, di_packages *packages, di_packages_allocator *allocator)
66 {
67  return di_package_special_read_file (file, packages, allocator, di_system_package_parser_info);
68 }
69 
76 static inline di_packages *di_system_packages_read_file (const char *file, di_packages_allocator *allocator)
77 {
78  return di_packages_special_read_file (file, allocator, di_system_packages_parser_info);
79 }
80 
87 static inline di_packages *di_system_packages_status_read_file (const char *file, di_packages_allocator *allocator)
88 {
89  return di_packages_special_read_file (file, allocator, di_system_packages_status_parser_info);
90 }
91 
98 static inline int di_system_packages_write_file (di_packages *packages, const char *file)
99 {
100  return di_packages_special_write_file (packages, file, di_system_packages_parser_info);
101 }
102 
109 static inline int di_system_packages_status_write_file (di_packages *packages, const char *file)
110 {
111  return di_packages_special_write_file (packages, file, di_system_packages_status_parser_info);
112 }
113 
114 di_slist *di_system_packages_resolve_dependencies_array_permissive (di_packages *packages, di_package **array, di_packages_allocator *allocator);
115 void di_system_packages_resolve_dependencies_mark_anna (di_packages *packages, const char *subarchitecture, const char *kernel);
116 
118 #endif