summaryrefslogtreecommitdiff
path: root/lib/rpmfi_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rpmfi_internal.h')
-rw-r--r--lib/rpmfi_internal.h180
1 files changed, 43 insertions, 137 deletions
diff --git a/lib/rpmfi_internal.h b/lib/rpmfi_internal.h
index 19484ec5a..dccc6ccbe 100644
--- a/lib/rpmfi_internal.h
+++ b/lib/rpmfi_internal.h
@@ -5,91 +5,21 @@
#include <rpm/rpmfi.h>
#include <rpm/rpmstrpool.h>
#include "lib/fprint.h"
+#include "lib/cpio.h"
#define RPMFIMAGIC 0x09697923
-/**
- * A package filename set.
- */
-struct rpmfi_s {
- int i; /*!< Current file index. */
- int j; /*!< Current directory index. */
-
- Header h; /*!< Header for file info set (or NULL) */
- rpmstrPool pool; /*!< String pool of this file info set */
-
- rpmsid * bnid; /*!< Index to base name(s) (pool) */
- rpmsid * dnid; /*!< Index to directory name(s) (pool) */
-
- rpmsid * flinks; /*!< Index to file link(s) (pool) */
-
- uint32_t * dil; /*!< Directory indice(s) (from header) */
- rpm_flag_t * fflags; /*!< File flag(s) (from header) */
- rpm_off_t * fsizes; /*!< File size(s) (from header) */
- rpm_time_t * fmtimes; /*!< File modification time(s) (from header) */
- rpm_mode_t * fmodes; /*!< File mode(s) (from header) */
- rpm_rdev_t * frdevs; /*!< File rdev(s) (from header) */
- rpm_ino_t * finodes; /*!< File inodes(s) (from header) */
-
- rpmsid * fuser; /*!< Index to file owner(s) (misc pool) */
- rpmsid * fgroup; /*!< Index to file group(s) (misc pool) */
- rpmsid * flangs; /*!< Index to file lang(s) (misc pool) */
-
- char * fstates; /*!< File state(s) (from header) */
-
- rpm_color_t * fcolors; /*!< File color bits (header) */
- char ** fcaps; /*!< File capability strings (header) */
-
- char ** cdict; /*!< File class dictionary (header) */
- rpm_count_t ncdict; /*!< No. of class entries. */
- uint32_t * fcdictx; /*!< File class dictionary index (header) */
-
- uint32_t * ddict; /*!< File depends dictionary (header) */
- rpm_count_t nddict; /*!< No. of depends entries. */
- uint32_t * fddictx; /*!< File depends dictionary start (header) */
- uint32_t * fddictn; /*!< File depends dictionary count (header) */
- rpm_flag_t * vflags; /*!< File verify flag(s) (from header) */
-
- rpm_count_t dc; /*!< No. of directories. */
- rpm_count_t fc; /*!< No. of files. */
-
- rpmfiFlags fiflags; /*!< file info set control flags */
-
- struct fingerPrint_s * fps; /*!< File fingerprint(s). */
-
- int digestalgo; /*!< File digest algorithm */
- unsigned char * digests; /*!< File digests in binary. */
-
- char * fn; /*!< File name buffer. */
-
- char ** apath;
- rpm_off_t * replacedSizes; /*!< (TR_ADDED) */
- int magic;
- int nrefs; /*!< Reference count. */
-};
-
#ifdef __cplusplus
extern "C" {
#endif
/** \ingroup rpmfi
- * Create and load a file info set.
- * @param pool shared string pool (or NULL for private pool)
- * @param h header
- * @param tagN unused
- * @param flags Flags to control what information is loaded.
- * @return new file info set
- */
-RPM_GNUC_INTERNAL
-rpmfi rpmfiNewPool(rpmstrPool pool, Header h, rpmTagVal tagN, rpmfiFlags flags);
-
-/** \ingroup rpmfi
* Return file info set string pool handle
* @param fi file info
* @return string pool handle (weak reference)
*/
RPM_GNUC_INTERNAL
-rpmstrPool rpmfiPool(rpmfi fi);
+rpmstrPool rpmfilesPool(rpmfiles fi);
/** \ingroup rpmfi
* Return current base name pool id from file info set.
@@ -108,99 +38,75 @@ RPM_GNUC_INTERNAL
rpmsid rpmfiDNId(rpmfi fi);
RPM_GNUC_INTERNAL
-int rpmfiDIIndex(rpmfi fi, int dx);
-
-RPM_GNUC_INTERNAL
-rpmsid rpmfiBNIdIndex(rpmfi fi, int ix);
-
-RPM_GNUC_INTERNAL
-rpmsid rpmfiDNIdIndex(rpmfi fi, int jx);
-
-RPM_GNUC_INTERNAL
-const char * rpmfiBNIndex(rpmfi fi, int ix);
-
-RPM_GNUC_INTERNAL
-const char * rpmfiDNIndex(rpmfi fi, int jx);
-
-RPM_GNUC_INTERNAL
-char * rpmfiFNIndex(rpmfi fi, int ix);
-
-RPM_GNUC_INTERNAL
-rpmVerifyAttrs rpmfiVFlagsIndex(rpmfi fi, int ix);
-
-RPM_GNUC_INTERNAL
-rpmfileState rpmfiFStateIndex(rpmfi fi, int ix);
+rpmsid rpmfilesBNId(rpmfiles fi, int ix);
RPM_GNUC_INTERNAL
-const char * rpmfiFLinkIndex(rpmfi fi, int ix);
-
-RPM_GNUC_INTERNAL
-rpm_loff_t rpmfiFSizeIndex(rpmfi fi, int ix);
-
-RPM_GNUC_INTERNAL
-rpm_color_t rpmfiFColorIndex(rpmfi fi, int ix);
-
-RPM_GNUC_INTERNAL
-const char * rpmfiFClassIndex(rpmfi fi, int ix);
-
-RPM_GNUC_INTERNAL
-uint32_t rpmfiFDependsIndex(rpmfi fi, int ix, const uint32_t ** fddictp);
-
-RPM_GNUC_INTERNAL
-uint32_t rpmfiFNlinkIndex(rpmfi fi, int ix);
-
-RPM_GNUC_INTERNAL
-const char * rpmfiFLangsIndex(rpmfi fi, int ix);
-
-RPM_GNUC_INTERNAL
-rpmfileAttrs rpmfiFFlagsIndex(rpmfi fi, int ix);
-
-RPM_GNUC_INTERNAL
-rpm_mode_t rpmfiFModeIndex(rpmfi fi, int ix);
-
-RPM_GNUC_INTERNAL
-const unsigned char * rpmfiFDigestIndex(rpmfi fi, int ix, int *algo, size_t *len);
+rpmsid rpmfilesDNId(rpmfiles fi, int jx);
+/** \ingroup rpmfi
+ * Return current original base name pool id from file info set.
+ * @param fi file info set
+ * @return current base name id, 0 on invalid
+ */
RPM_GNUC_INTERNAL
-rpm_rdev_t rpmfiFRdevIndex(rpmfi fi, int ix);
+rpmsid rpmfiOBNId(rpmfi fi);
+/** \ingroup rpmfi
+ * Return current original directory name pool id from file info set.
+ * @param fi file info set
+ * @return current base name id, 0 on invalid
+ */
RPM_GNUC_INTERNAL
-rpm_ino_t rpmfiFInodeIndex(rpmfi fi, int ix);
+rpmsid rpmfiODNId(rpmfi fi);
RPM_GNUC_INTERNAL
-rpm_time_t rpmfiFMtimeIndex(rpmfi fi, int ix);
+rpmsid rpmfilesOBNId(rpmfiles fi, int ix);
RPM_GNUC_INTERNAL
-const char * rpmfiFUserIndex(rpmfi fi, int ix);
+rpmsid rpmfilesODNId(rpmfiles fi, int jx);
RPM_GNUC_INTERNAL
-const char * rpmfiFGroupIndex(rpmfi fi, int ix);
+struct fingerPrint_s *rpmfilesFps(rpmfiles fi);
+/** \ingroup rpmfi
+ * Check if the file in new package, in old package and on the disk have the same contents.
+ * @param new file info set
+ * @param new file index
+ * @param old file info set
+ * @param old file index
+ * @return 1 if the condition is satisfied, 0 otherwise
+ */
RPM_GNUC_INTERNAL
-const char * rpmfiFCapsIndex(rpmfi fi, int ix);
+int rpmfileContentsEqual(rpmfiles ofi, int oix, rpmfiles nfi, int nix);
-RPM_GNUC_INTERNAL
-struct fingerPrint_s *rpmfiFps(rpmfi fi);
RPM_GNUC_INTERNAL
-rpmFileAction rpmfiDecideFateIndex(rpmfi ofi, int oix, rpmfi nfi, int nix,
+rpmFileAction rpmfilesDecideFate(rpmfiles ofi, int oix,
+ rpmfiles nfi, int nix,
int skipMissing);
RPM_GNUC_INTERNAL
-int rpmfiCompareIndex(rpmfi afi, int aix, rpmfi bfi, int bix);
+int rpmfilesConfigConflict(rpmfiles fi, int ix);
RPM_GNUC_INTERNAL
-int rpmfiConfigConflictIndex(rpmfi fi, int ix);
+void rpmfilesSetFReplacedSize(rpmfiles fi, int ix, rpm_loff_t newsize);
RPM_GNUC_INTERNAL
-void rpmfiSetFReplacedSizeIndex(rpmfi fi, int ix, rpm_loff_t newsize);
+rpm_loff_t rpmfilesFReplacedSize(rpmfiles fi, int ix);
RPM_GNUC_INTERNAL
-rpm_loff_t rpmfiFReplacedSizeIndex(rpmfi fi, int ix);
+void rpmfilesFpLookup(rpmfiles fi, fingerPrintCache fpc);
-RPM_GNUC_INTERNAL
-void rpmfiFpLookup(rpmfi fi, fingerPrintCache fpc);
+rpmfiles rpmfiFiles(rpmfi fi);
+/** \ingroup rpmfi
+ * Return file iterator through files starting with given prefix.
+ * @param fi file info set
+ * @param pfx prefix
+ * @return file iterator
+ */
+RPM_GNUC_INTERNAL
+rpmfi rpmfilesFindPrefix(rpmfiles fi, const char *pfx);
#ifdef __cplusplus
}
#endif