Imported Upstream version 4.14.1
[platform/upstream/rpm.git] / lib / misc.h
1 #ifndef H_MISC
2 #define H_MISC
3
4 /**
5  * \file lib/misc.h
6  *
7  */
8
9 #include <string.h>
10 #include <rpm/rpmtypes.h>
11 #include <rpm/header.h>         /* for headerGetFlags typedef, duh.. */
12 #include "lib/rpmfs.h"
13
14 typedef const struct headerFmt_s * headerFmt;
15
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
20 /* known arch? */
21 RPM_GNUC_INTERNAL
22 int rpmIsKnownArch(const char *name);
23
24 RPM_GNUC_INTERNAL
25 char * rpmVerifyString(uint32_t verifyResult, const char *pad);
26
27 RPM_GNUC_INTERNAL
28 char * rpmFFlagsString(uint32_t fflags, const char *pad);
29
30 typedef int (*headerTagTagFunction) (Header h, rpmtd td, headerGetFlags hgflags);
31
32 RPM_GNUC_INTERNAL
33 headerTagTagFunction rpmHeaderTagFunc(rpmTagVal tag);
34
35 RPM_GNUC_INTERNAL
36 headerFmt rpmHeaderFormatByName(const char *fmt);
37
38 RPM_GNUC_INTERNAL
39 headerFmt rpmHeaderFormatByValue(rpmtdFormats fmt);
40
41 RPM_GNUC_INTERNAL
42 char * rpmHeaderFormatCall(headerFmt fmt, rpmtd td);
43
44 RPM_GNUC_INTERNAL
45 int headerFindSpec(Header h);
46
47 /**
48  * Relocate files in header.
49  * @todo multilib file dispositions need to be checked.
50  * @param relocs                relocations
51  * @param numRelocations        number of relocations
52  * @param fs                    file state set
53  * @param h                     package header to relocate
54  */
55 RPM_GNUC_INTERNAL
56 void rpmRelocateFileList(rpmRelocation *relocs, int numRelocations, rpmfs fs, Header h);
57
58 RPM_GNUC_INTERNAL
59 int rpmRelocateSrpmFileList(Header h, const char *rootDir);
60
61 RPM_GNUC_INTERNAL
62 void rpmRelocationBuild(Header h, rpmRelocation *rawrelocs,
63                 int *rnrelocs, rpmRelocation **rrelocs, uint8_t **rbadrelocs);
64
65 RPM_GNUC_INTERNAL
66 void rpmAtExit(void);
67 #ifdef __cplusplus
68 }
69 #endif
70
71 #endif  /* H_MISC */