summaryrefslogtreecommitdiff
path: root/lib/header_internal.h
blob: 63e4fd80cd847268555ff1e2763a4ac28f25b789 (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
#ifndef H_HEADER_INTERNAL
#define H_HEADER_INTERNAL

/** \ingroup header
 * \file header_internal.h
 */

#include <rpm/header.h>
#include <rpm/rpmcrypto.h>

typedef struct entryInfo_s * entryInfo;
typedef struct hdrblob_s * hdrblob;
struct hdrblob_s {
    uint32_t *ei;
    uint32_t il;
    uint32_t dl;
    entryInfo pe;
    uint32_t pvlen;
    uint8_t *dataStart;
    uint8_t *dataEnd;

    rpmTagVal regionTag;
    uint32_t ril;
    uint32_t rdl;
};

#ifdef __cplusplus
extern "C" {
#endif

RPM_GNUC_INTERNAL
hdrblob hdrblobCreate(void);

RPM_GNUC_INTERNAL
hdrblob hdrblobFree(hdrblob blob);

RPM_GNUC_INTERNAL
rpmRC hdrblobInit(const void *uh, size_t uc,
		rpmTagVal regionTag, int exact_size,
		struct hdrblob_s *blob, char **emsg);

RPM_GNUC_INTERNAL
rpmRC hdrblobRead(FD_t fd, int magic, int exact_size, rpmTagVal regionTag, hdrblob blob, char **emsg);

RPM_GNUC_INTERNAL
rpmRC hdrblobImport(hdrblob blob, int fast, Header *hdrp, char **emsg);

RPM_GNUC_INTERNAL
rpmRC hdrblobGet(hdrblob blob, uint32_t tag, rpmtd td);

RPM_GNUC_INTERNAL
void hdrblobDigestUpdate(rpmDigestBundle bundle, struct hdrblob_s *blob);

/** \ingroup header
 * Set header instance (rpmdb record number)
 * @param h		header
 * @param instance	record number
 */
RPM_GNUC_INTERNAL
void headerSetInstance(Header h, unsigned int instance);

/* Package IO helper to consolidate partial read and error handling */
RPM_GNUC_INTERNAL
ssize_t Freadall(FD_t fd, void * buf, ssize_t size);

RPM_GNUC_INTERNAL
int headerIsSourceHeuristic(Header h);
#ifdef __cplusplus
}   
#endif

#endif  /* H_HEADER_INTERNAL */