-
Notifications
You must be signed in to change notification settings - Fork 0
/
poldek_intern.h
105 lines (74 loc) · 3.55 KB
/
poldek_intern.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/*
Copyright (C) 2000 - 2008 Pawel A. Gajda <[email protected]>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License, version 2 as
published by the Free Software Foundation (see file COPYING for details).
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef POLDEK_INTERNAL_H
#define POLDEK_INTERNAL_H
#include <trurl/narray.h>
#include <trurl/nhash.h>
// pkgdir.h structures
struct source;
struct pkgdir;
// pkgset.h structures
struct pkgset;
struct pm_ctx;
struct poldek_ts;
struct poldek_ctx {
tn_hash *htconf; /* poldek configuration */
tn_array *sources; /* struct source *[] */
tn_array *pkgdirs; /* struct pkgdir *[] */
tn_array *dest_sources; /* for "pset" PM, struct source *[] */
struct poldek_ts *ts; /* main, internal ts */
unsigned ps_flags;
unsigned ps_setup_flags;
struct pkgset *ps;
struct pm_ctx *pmctx; /* package manager context */
int _rpm_tscolor; /* rpm transaction color */
int _depsolver;
/* callbacks, don't call them directly */
void *data_confirm_fn;
int (*confirm_fn)(void *data, const struct poldek_ts *ts, int hint,
const char *message); /* confirm anything */
void *data_ts_confirm_fn;
int (*ts_confirm_fn)(void *data, const struct poldek_ts *ts); /* confirm transaction */
void *data_choose_equiv_fn;
int (*choose_equiv_fn)(void *data, const struct poldek_ts *ts,
const struct pkg *pkg, const char *cap,
tn_array *candidates, int hint);
void *data_choose_suggests_fn;
int (*choose_suggests_fn)(void *data, const struct poldek_ts *ts,
const struct pkg *pkg, tn_array *caps,
tn_array *choices, int hint);
tn_hash *_cnf; /* runtime config */
unsigned _iflags; /* internal flags */
int _refcnt;
};
int poldek__is_setup_done(struct poldek_ctx *ctx);
void poldek__ts_postconf(struct poldek_ctx *ctx, struct poldek_ts *ts);
struct pkgdb;
struct pkgdb *poldek_ts_dbopen(struct poldek_ts *ts, mode_t mode);
void poldek_ts_xsetop(struct poldek_ts *ts, int optv, int on, int touch);
void poldek__ts_dump_settings(struct poldek_ctx *ctx, struct poldek_ts *ts);
tn_array *poldek__ts_install_ordered_packages(const struct poldek_ts *ts);
void poldek__ts_update_summary(struct poldek_ts *ts,
const char *prefix, const tn_array *pkgs,
unsigned pmsflags, const struct pkgmark_set *pms);
void poldek__ts_display_summary(struct poldek_ts *ts);
/* ask.c */
int poldek__confirm(const struct poldek_ts *ts,
int default_answer, const char *message);
int poldek__ts_confirm(const struct poldek_ts *ts);
int poldek__choose_equiv(const struct poldek_ts *ts,
const struct pkg *pkg, const char *capname,
tn_array *pkgs, struct pkg *hint);
int poldek__choose_suggests(const struct poldek_ts *ts,
const struct pkg *pkg, tn_array *caps,
tn_array *choices, int hint);
void poldek__setup_default_ask_callbacks(struct poldek_ctx *ctx);
int poldek__load_sources_internal(struct poldek_ctx *ctx);
#endif