libdebian-installer
Main Page
Related Pages
Modules
Data Structures
Files
File List
include
debian-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
;
31
typedef
struct
di_packages_allocator
di_packages_allocator
;
32
41
struct
di_packages
42
{
43
di_hash_table
*
table
;
44
di_slist
list
;
45
unsigned
int
resolver
;
46
};
47
52
struct
di_packages_allocator
53
{
54
di_mem_chunk
*
package_mem_chunk
;
55
di_mem_chunk
*
package_dependency_mem_chunk
;
56
di_mem_chunk
*
slist_node_mem_chunk
;
57
};
58
59
#include <debian-installer/package.h>
60
61
di_packages
*
di_packages_alloc
(
void
);
62
void
di_packages_free
(
di_packages
*packages);
63
64
di_packages_allocator
*
di_packages_allocator_alloc
(
void
);
65
void
di_packages_allocator_free
(
di_packages_allocator
*packages);
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
77
di_parser_fields_function_read
78
di_packages_parser_read_name;
79
85
extern
const
di_parser_fieldinfo
*
di_packages_parser_fieldinfo
[];
86
extern
const
di_parser_fieldinfo
*
di_packages_status_parser_fieldinfo
[];
87
extern
const
di_parser_fieldinfo
*
di_packages_minimal_parser_fieldinfo
[];
88
89
di_parser_info
*
di_packages_parser_info
(
void
);
90
di_parser_info
*
di_packages_minimal_parser_info
(
void
);
91
di_parser_info
*
di_packages_status_parser_info
(
void
);
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
{
129
return
di_packages_special_read_file
(file, allocator,
di_packages_minimal_parser_info
);
130
}
131
138
static
inline
di_packages
*
di_packages_status_read_file
(
const
char
*file,
di_packages_allocator
*allocator)
139
{
140
return
di_packages_special_read_file
(file, allocator,
di_packages_status_parser_info
);
141
}
142
151
static
inline
int
di_packages_write_file
(
di_packages
*packages,
const
char
*file)
152
{
153
return
di_packages_special_write_file
(packages, file,
di_packages_parser_info
);
154
}
155
164
static
inline
int
di_packages_status_write_file
(
di_packages
*packages,
const
char
*file)
165
{
166
return
di_packages_special_write_file
(packages, file,
di_packages_status_parser_info
);
167
}
168
170
#endif
Generated on Fri Apr 12 2013 10:00:30 for libdebian-installer by
1.8.3.1