summaryrefslogtreecommitdiff
path: root/lib/misc.h
blob: 74e94a2e78c68afefa91f7867ea9bf0c01f1cbaf (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
#ifndef H_MISC
#define H_MISC

/**
 * \file lib/misc.h
 *
 */

#include <string.h>
#include <rpm/rpmtypes.h>
#include <rpm/header.h>		/* for headerGetFlags typedef, duh.. */
#include "lib/rpmfs.h"

typedef const struct headerFmt_s * headerFmt;

#ifdef __cplusplus
extern "C" {
#endif

/* known arch? */
RPM_GNUC_INTERNAL
int rpmIsKnownArch(const char *name);

RPM_GNUC_INTERNAL
char * rpmVerifyString(uint32_t verifyResult, const char *pad);

RPM_GNUC_INTERNAL
char * rpmFFlagsString(uint32_t fflags, const char *pad);

typedef int (*headerTagTagFunction) (Header h, rpmtd td, headerGetFlags hgflags);

RPM_GNUC_INTERNAL
headerTagTagFunction rpmHeaderTagFunc(rpmTagVal tag);

RPM_GNUC_INTERNAL
headerFmt rpmHeaderFormatByName(const char *fmt);

RPM_GNUC_INTERNAL
headerFmt rpmHeaderFormatByValue(rpmtdFormats fmt);

RPM_GNUC_INTERNAL
char * rpmHeaderFormatCall(headerFmt fmt, rpmtd td);

RPM_GNUC_INTERNAL
int headerFindSpec(Header h);

/**
 * Relocate files in header.
 * @todo multilib file dispositions need to be checked.
 * @param relocs		relocations
 * @param numRelocations	number of relocations
 * @param fs			file state set
 * @param h			package header to relocate
 */
RPM_GNUC_INTERNAL
void rpmRelocateFileList(rpmRelocation *relocs, int numRelocations, rpmfs fs, Header h);

RPM_GNUC_INTERNAL
int rpmRelocateSrpmFileList(Header h, const char *rootDir);

RPM_GNUC_INTERNAL
void rpmRelocationBuild(Header h, rpmRelocation *rawrelocs,
		int *rnrelocs, rpmRelocation **rrelocs, uint8_t **rbadrelocs);

RPM_GNUC_INTERNAL
void rpmAtExit(void);
#ifdef __cplusplus
}
#endif

#endif	/* H_MISC */