dd80378f29bc25a87dd8da7aeb4e3670a53679d2
[tools/librpm-tizen.git] / build / buildio.h
1 #ifndef _H_BUILDIO_
2 #define _H_BUILDIO_
3
4 /** \ingroup rpmbuild
5  * \file build/buildio.h
6  *  XXX this information will move elsewhere eventually
7  */
8
9 #include "psm.h"
10
11 /**
12  */
13 typedef struct cpioSourceArchive {
14     unsigned int cpioArchiveSize;
15     FD_t        cpioFdIn;
16 /*@dependent@*/ TFI_t cpioList;
17     struct rpmlead * lead;      /* XXX FIXME: exorcize lead/arch/os */
18 } CSA_t;
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 /**
25  * Read rpm package components from file.
26  * @param filename      file name of package (or NULL to use stdin)
27  * @retval specp        spec structure to carry package header (or NULL)
28  * @retval lead         package lead
29  * @retval sigs         package signature
30  * @param csa
31  * @return              0 on success
32  */
33 int readRPM(const char *fileName, /*@out@*/ Spec *specp, /*@out@*/ struct rpmlead *lead,
34                 /*@out@*/ Header *sigs, CSA_t *csa);
35
36 /**
37  * Write rpm package to file.
38  *
39  * @warning The first header argument is now passed by reference in order to
40  * return a reloaded contiguous header to the caller.
41  *
42  * @retval hdrp         header to write (final header is returned).
43  * @param filename      file name of package
44  * @param type          RPMLEAD_SOURCE/RPMLEAD_BINARY
45  * @param csa
46  * @param passPhrase
47  * @retval cookie       generated cookie (i.e build host/time)
48  * @return              0 on success
49  */
50 int writeRPM(Header *hdrp, const char *fileName, int type,
51                 CSA_t *csa, char *passPhrase, /*@out@*/ const char **cookie);
52
53 #ifdef __cplusplus
54 }
55 #endif
56
57 #endif  /* _H_BUILDIO_ */