apply some patch for pythons rpm from opensource
[platform/upstream/rpm.git] / lib / misc.h
index 8cb4356..74e94a2 100644 (file)
@@ -6,96 +6,64 @@
  *
  */
 
-#include <unistd.h>
-#include <sys/types.h>
+#include <string.h>
+#include <rpm/rpmtypes.h>
+#include <rpm/header.h>                /* for headerGetFlags typedef, duh.. */
+#include "lib/rpmfs.h"
 
-#include "header.h"
-#include "ugid.h"
+typedef const struct headerFmt_s * headerFmt;
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-/**
- */
-/*@only@*/ char ** splitString(const char * str, int length, char sep);
+/* known arch? */
+RPM_GNUC_INTERNAL
+int rpmIsKnownArch(const char *name);
 
-/**
- */
-void   freeSplitString( /*@only@*/ char ** list);
+RPM_GNUC_INTERNAL
+char * rpmVerifyString(uint32_t verifyResult, const char *pad);
 
-/**
- * Remove occurences of trailing character from string.
- * @param s            string
- * @param c            character to strip
- * @return             string
- */
-/*@unused@*/ static inline
-/*@only@*/ char * stripTrailingChar(/*@only@*/ char * s, char c)
-       /*@modifies *s */
-{
-    char * t;
-    for (t = s + strlen(s) - 1; *t == c && t >= s; t--)
-       *t = '\0';
-    return s;
-}
+RPM_GNUC_INTERNAL
+char * rpmFFlagsString(uint32_t fflags, const char *pad);
 
-/**
- */
-int    rpmfileexists(const char * filespec)    /*@*/;
+typedef int (*headerTagTagFunction) (Header h, rpmtd td, headerGetFlags hgflags);
 
-/**
- */
-int    rpmvercmp(const char * one, const char * two);
+RPM_GNUC_INTERNAL
+headerTagTagFunction rpmHeaderTagFunc(rpmTagVal tag);
 
-/* these are like the normal functions, but they malloc() the space which
-   is needed */
+RPM_GNUC_INTERNAL
+headerFmt rpmHeaderFormatByName(const char *fmt);
 
-/**
- */
-int    dosetenv(const char *name, const char *value, int overwrite);
+RPM_GNUC_INTERNAL
+headerFmt rpmHeaderFormatByValue(rpmtdFormats fmt);
 
-/**
- */
-int    doputenv(const char * str);
+RPM_GNUC_INTERNAL
+char * rpmHeaderFormatCall(headerFmt fmt, rpmtd td);
 
-/**
- */
-int    makeTempFile(const char * prefix, /*@out@*/ const char ** fnptr,
-                       /*@out@*/ FD_t * fdptr);
+RPM_GNUC_INTERNAL
+int headerFindSpec(Header h);
 
 /**
- * @return             cureent working directory (malloc'ed)
+ * Relocate files in header.
+ * @todo multilib file dispositions need to be checked.
+ * @param relocs               relocations
+ * @param numRelocations       number of relocations
+ * @param fs                   file state set
+ * @param h                    package header to relocate
  */
-/*@only@*/ char * currentDirectory(void);
+RPM_GNUC_INTERNAL
+void rpmRelocateFileList(rpmRelocation *relocs, int numRelocations, rpmfs fs, Header h);
 
-/**
- */
-void   compressFilelist(Header h);
-
-/**
- */
-void   expandFilelist(Header h);
-
-/**
- */
-void   buildOrigFileList(Header h, /*@out@*/ const char *** fileListPtr, 
-                       /*@out@*/ int * fileCountPtr);
+RPM_GNUC_INTERNAL
+int rpmRelocateSrpmFileList(Header h, const char *rootDir);
 
-/**
- */
-int myGlobPatternP (const char *patternURL)    /*@*/;
-
-/**
- */
-int rpmGlob(const char * patterns, /*@out@*/ int * argcPtr,
-       /*@out@*/ const char *** argvPtr)
-               /*@modifies *argcPtr, *argvPtr @*/;
-
-/**
- */
-void providePackageNVR(Header h);
+RPM_GNUC_INTERNAL
+void rpmRelocationBuild(Header h, rpmRelocation *rawrelocs,
+               int *rnrelocs, rpmRelocation **rrelocs, uint8_t **rbadrelocs);
 
+RPM_GNUC_INTERNAL
+void rpmAtExit(void);
 #ifdef __cplusplus
 }
 #endif