Permit file objects in python header constructor
[platform/upstream/rpm.git] / build / buildio.h
1 #ifndef _H_BUILDIO_
2 #define _H_BUILDIO_
3
4 /** \ingroup rpmbuild
5  * \file build/buildio.h
6  * Routines to read and write packages.
7  * @deprecated this information will move elsewhere eventually.
8  * @todo Eliminate, merge into rpmlib.
9  */
10
11 #include <rpm/rpmbuild.h>
12
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16
17 /**
18  */
19 typedef struct cpioSourceArchive_s {
20     rpm_loff_t  cpioArchiveSize;
21     FD_t        cpioFdIn;
22     rpmfi       cpioList;
23 } * CSA_t;
24
25 /**
26  * Read rpm package components from file.
27  * @param fileName      file name of package (or NULL to use stdin)
28  * @retval specp        spec structure to carry package header (or NULL)
29  * @retval sigs         package signature
30  * @param csa
31  * @return              RPMRC_OK on success
32  */
33 rpmRC readRPM(const char * fileName,
34                 rpmSpec * specp,
35                 Header * sigs,
36                 CSA_t csa);
37
38 /**
39  * Write rpm package to file.
40  *
41  * @warning The first argument (header) is now passed by reference in order to
42  * return a reloaded contiguous header to the caller.
43  *
44  * @retval *hdrp        header to write (final header is returned).
45  * @retval *pkgidp      header+payload MD5 of package (NULL to disable).
46  * @param fileName      file name of package
47  * @param csa
48  * @param passPhrase
49  * @retval cookie       generated cookie (i.e build host/time)
50  * @return              RPMRC_OK on success
51  */
52 rpmRC writeRPM(Header * hdrp, unsigned char ** pkgidp,
53                 const char * fileName,
54                 CSA_t csa,
55                 char * passPhrase,
56                 char ** cookie);
57
58 #ifdef __cplusplus
59 }
60 #endif
61
62 #endif  /* _H_BUILDIO_ */