summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-10-01 13:25:38 +0300
committerPanu Matilainen <pmatilai@redhat.com>2010-10-01 13:25:38 +0300
commit1933cb5a9db89375fce7cfe5886b2873a4ffb438 (patch)
tree34ad1ea629efeb9527be6fb0a4f8f0095ef95cb8
parenta0444009a17635ffa04e6fc747f6e6cbfd4d409d (diff)
downloadlibrpm-tizen-1933cb5a9db89375fce7cfe5886b2873a4ffb438.tar.gz
librpm-tizen-1933cb5a9db89375fce7cfe5886b2873a4ffb438.tar.bz2
librpm-tizen-1933cb5a9db89375fce7cfe5886b2873a4ffb438.zip
Finish off our librpmbuild API mass-murder by turning everything opaque
- These huge structs have no business being visible to the public. Just brute-force split all remaining spec internal structures into another internal header, including where needed. - The only thing accessing these structs outside of librpmbuild is the python spec bindings. Temporarily permit direct access to rpmspec_internal.h until we have the necessary API in place.
-rw-r--r--build/rpmbuild_internal.h96
-rw-r--r--build/rpmspec.h96
-rw-r--r--python/spec-py.c1
3 files changed, 97 insertions, 96 deletions
diff --git a/build/rpmbuild_internal.h b/build/rpmbuild_internal.h
index 04380a5a2..1a3121559 100644
--- a/build/rpmbuild_internal.h
+++ b/build/rpmbuild_internal.h
@@ -38,6 +38,102 @@ struct speclines_s {
int sl_nlines;
};
+/** \ingroup rpmbuild
+ */
+struct Source {
+ char * fullSource;
+ char * source; /* Pointer into fullSource */
+ int flags;
+ uint32_t num;
+struct Source * next;
+};
+
+typedef struct spectags_s * spectags;
+typedef struct speclines_s * speclines;
+
+/** \ingroup rpmbuild
+ * The structure used to store values parsed from a spec file.
+ */
+struct rpmSpec_s {
+ char * specFile; /*!< Name of the spec file. */
+ char * buildRoot;
+ char * buildSubdir;
+ const char * rootDir;
+
+ speclines sl;
+ spectags st;
+
+ struct OpenFileInfo * fileStack;
+ char lbuf[10*BUFSIZ];
+ char *lbufPtr;
+ char nextpeekc;
+ char * nextline;
+ char * line;
+ int lineNum;
+
+ struct ReadLevelEntry * readStack;
+
+ Header buildRestrictions;
+ rpmSpec * BASpecs;
+ const char ** BANames;
+ int BACount;
+ int recursing; /*!< parse is recursive? */
+
+ rpmSpecFlags flags;
+
+ struct Source * sources;
+ int numSources;
+ int noSource;
+
+ char * sourceRpmName;
+ unsigned char * sourcePkgId;
+ Header sourceHeader;
+ rpmfi sourceCpioList;
+
+ rpmMacroContext macros;
+
+ StringBuf prep; /*!< %prep scriptlet. */
+ StringBuf build; /*!< %build scriptlet. */
+ StringBuf install; /*!< %install scriptlet. */
+ StringBuf check; /*!< %check scriptlet. */
+ StringBuf clean; /*!< %clean scriptlet. */
+
+ Package packages; /*!< Package list. */
+};
+
+/** \ingroup rpmbuild
+ * The structure used to store values for a package.
+ */
+struct Package_s {
+ Header header;
+ rpmds ds; /*!< Requires: N = EVR */
+ rpmfi cpioList;
+
+ struct Source * icon;
+
+ int autoReq;
+ int autoProv;
+
+ char * preInFile; /*!< %pre scriptlet. */
+ char * postInFile; /*!< %post scriptlet. */
+ char * preUnFile; /*!< %preun scriptlet. */
+ char * postUnFile; /*!< %postun scriptlet. */
+ char * preTransFile; /*!< %pretrans scriptlet. */
+ char * postTransFile; /*!< %posttrans scriptlet. */
+ char * verifyFile; /*!< %verifyscript scriptlet. */
+
+ StringBuf specialDoc;
+ char *specialDocDir;
+
+ struct TriggerFileEntry * triggerFiles;
+
+ StringBuf fileFile;
+ StringBuf fileList; /* If NULL, package will not be written */
+ StringBuf policyList;
+
+ Package next;
+};
+
#define PART_SUBNAME 0
#define PART_NAME 1
diff --git a/build/rpmspec.h b/build/rpmspec.h
index cc0596edf..09b3ced88 100644
--- a/build/rpmspec.h
+++ b/build/rpmspec.h
@@ -38,102 +38,6 @@ enum rpmSpecFlags_e {
typedef rpmFlags rpmSpecFlags;
/** \ingroup rpmbuild
- */
-struct Source {
- char * fullSource;
- char * source; /* Pointer into fullSource */
- int flags;
- uint32_t num;
-struct Source * next;
-};
-
-typedef struct spectags_s * spectags;
-typedef struct speclines_s * speclines;
-
-/** \ingroup rpmbuild
- * The structure used to store values parsed from a spec file.
- */
-struct rpmSpec_s {
- char * specFile; /*!< Name of the spec file. */
- char * buildRoot;
- char * buildSubdir;
- const char * rootDir;
-
- speclines sl;
- spectags st;
-
- struct OpenFileInfo * fileStack;
- char lbuf[10*BUFSIZ];
- char *lbufPtr;
- char nextpeekc;
- char * nextline;
- char * line;
- int lineNum;
-
- struct ReadLevelEntry * readStack;
-
- Header buildRestrictions;
- rpmSpec * BASpecs;
- const char ** BANames;
- int BACount;
- int recursing; /*!< parse is recursive? */
-
- rpmSpecFlags flags;
-
- struct Source * sources;
- int numSources;
- int noSource;
-
- char * sourceRpmName;
- unsigned char * sourcePkgId;
- Header sourceHeader;
- rpmfi sourceCpioList;
-
- rpmMacroContext macros;
-
- StringBuf prep; /*!< %prep scriptlet. */
- StringBuf build; /*!< %build scriptlet. */
- StringBuf install; /*!< %install scriptlet. */
- StringBuf check; /*!< %check scriptlet. */
- StringBuf clean; /*!< %clean scriptlet. */
-
- Package packages; /*!< Package list. */
-};
-
-/** \ingroup rpmbuild
- * The structure used to store values for a package.
- */
-struct Package_s {
- Header header;
- rpmds ds; /*!< Requires: N = EVR */
- rpmfi cpioList;
-
- struct Source * icon;
-
- int autoReq;
- int autoProv;
-
- char * preInFile; /*!< %pre scriptlet. */
- char * postInFile; /*!< %post scriptlet. */
- char * preUnFile; /*!< %preun scriptlet. */
- char * postUnFile; /*!< %postun scriptlet. */
- char * preTransFile; /*!< %pretrans scriptlet. */
- char * postTransFile; /*!< %posttrans scriptlet. */
- char * verifyFile; /*!< %verifyscript scriptlet. */
-
- StringBuf specialDoc;
- char *specialDocDir;
-
- struct TriggerFileEntry * triggerFiles;
-
- StringBuf fileFile;
- StringBuf fileList; /* If NULL, package will not be written */
- StringBuf policyList;
-
- Package next;
-};
-
-/** \ingroup rpmbuild
* Destroy Spec structure.
* @param spec spec file control structure
* @return NULL always
diff --git a/python/spec-py.c b/python/spec-py.c
index 606c23270..7ed0ebb3a 100644
--- a/python/spec-py.c
+++ b/python/spec-py.c
@@ -2,6 +2,7 @@
#include "header-py.h"
#include "spec-py.h"
+#include "build/rpmbuild_internal.h" /* XXX FIXME! */
/** \ingroup python
* \name Class: Rpmspec