- Grand Renaming of rpm data types.
[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 "rpmbuild.h"
12
13 /**
14  */
15 typedef /*@abstract@*/ struct cpioSourceArchive_s {
16     unsigned int cpioArchiveSize;
17     FD_t        cpioFdIn;
18     rpmfi       cpioList;
19 /*@only@*/ struct rpmlead * lead;       /* XXX FIXME: exorcize lead/arch/os */
20 } * CSA_t;
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 /**
27  * Read rpm package components from file.
28  * @param fileName      file name of package (or NULL to use stdin)
29  * @retval specp        spec structure to carry package header (or NULL)
30  * @retval lead         package lead
31  * @retval sigs         package signature
32  * @param csa
33  * @return              0 on success
34  */
35 /*@unused@*/ int readRPM(/*@null@*/ const char * fileName,
36                 /*@out@*/ Spec * specp,
37                 /*@out@*/ struct rpmlead * lead,
38                 /*@out@*/ Header * sigs,
39                 CSA_t csa)
40         /*@globals rpmGlobalMacroContext,
41                 fileSystem, internalState @*/
42         /*@modifies *specp, *lead, *sigs, csa, csa->cpioFdIn,
43                 rpmGlobalMacroContext, fileSystem, internalState @*/;
44
45 /**
46  * Write rpm package to file.
47  *
48  * @warning The first argument (header) is now passed by reference in order to
49  * return a reloaded contiguous header to the caller.
50  *
51  * @retval hdrp         header to write (final header is returned).
52  * @param fileName      file name of package
53  * @param type          RPMLEAD_SOURCE/RPMLEAD_BINARY
54  * @param csa
55  * @param passPhrase
56  * @retval cookie       generated cookie (i.e build host/time)
57  * @return              0 on success
58  */
59 int writeRPM(Header * hdrp,
60                 const char * fileName,
61                 int type,
62                 CSA_t csa,
63                 /*@null@*/ char * passPhrase,
64                 /*@out@*/ const char ** cookie)
65         /*@globals rpmGlobalMacroContext,
66                 fileSystem, internalState @*/
67         /*@modifies *hdrp, *cookie, csa, csa->cpioArchiveSize,
68                 rpmGlobalMacroContext, fileSystem, internalState @*/;
69
70 #ifdef __cplusplus
71 }
72 #endif
73
74 #endif  /* _H_BUILDIO_ */