blob: fda108005de956280b621b0675a2d39e27d2b574 (
plain)
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
106
107
108
109
110
|
#ifndef _ALPM_PACKAGE_H
#define _ALPM_PACKAGE_H
#if defined(__APPLE__) || defined(__sun__)
#include <time.h>
#endif
#include "alpm.h"
#include "db.h"
typedef enum _pmpkgfrom_t {
PKG_FROM_CACHE = 1,
PKG_FROM_FILE
} pmpkgfrom_t;
#define PKG_FILENAME_LEN 512
#define PKG_NAME_LEN 256
#define PKG_VERSION_LEN 64
#define PKG_FULLNAME_LEN (PKG_NAME_LEN + PKG_VERSION_LEN)
#define PKG_DESC_LEN 512
#define PKG_URL_LEN 256
#define PKG_DATE_LEN 32
#define PKG_TYPE_LEN 32
#define PKG_PACKAGER_LEN 64
#define PKG_MD5SUM_LEN 33
#define PKG_SHA1SUM_LEN 41
#define PKG_ARCH_LEN 32
struct __pmpkg_t {
char filename[PKG_FILENAME_LEN];
char name[PKG_NAME_LEN];
char version[PKG_VERSION_LEN];
char desc[PKG_DESC_LEN];
char url[PKG_URL_LEN];
char builddate[PKG_DATE_LEN];
char buildtype[PKG_TYPE_LEN];
char installdate[PKG_DATE_LEN];
char packager[PKG_PACKAGER_LEN];
char md5sum[PKG_MD5SUM_LEN];
char sha1sum[PKG_SHA1SUM_LEN];
char arch[PKG_ARCH_LEN];
unsigned long size;
unsigned long isize;
unsigned short scriptlet;
unsigned short force;
time_t date;
pmpkgreason_t reason;
alpm_list_t *licenses;
alpm_list_t *replaces;
alpm_list_t *groups;
alpm_list_t *files;
alpm_list_t *backup;
alpm_list_t *depends;
alpm_list_t *requiredby;
alpm_list_t *conflicts;
alpm_list_t *provides;
pmpkgfrom_t origin;
void *data;
TODO
pmdbinfrq_t infolevel;
};
pmpkg_t* _alpm_pkg_new(const char *name, const char *version);
pmpkg_t *_alpm_pkg_dup(pmpkg_t *pkg);
void _alpm_pkg_free(pmpkg_t *pkg);
int _alpm_pkg_cmp(const void *p1, const void *p2);
int alpm_pkg_compare_versions(pmpkg_t *local_pkg, pmpkg_t *pkg);
pmpkg_t *_alpm_pkg_load(const char *pkgfile);
pmpkg_t *_alpm_pkg_find(const char *needle, alpm_list_t *haystack);
int _alpm_pkg_splitname(const char *target, char *name, char *version, int witharch);
int _alpm_pkg_istoonew(pmpkg_t *pkg);
void _alpm_pkg_update_requiredby(pmpkg_t *pkg);
#endif
|