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