From 2c3ce0c8b04938b7b35483d27a4e87eda9afa3e7 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 3 Dec 2007 09:46:51 +0200 Subject: Split rpmfi internals to separate header --- build/files.c | 2 +- build/pack.c | 3 +- lib/fsm.c | 3 +- lib/psm.c | 3 +- lib/rpmfi.c | 3 +- lib/rpmfi.h | 126 ------------------------------------------------- lib/rpmfi_internal.h | 130 +++++++++++++++++++++++++++++++++++++++++++++++++++ lib/transaction.c | 3 +- 8 files changed, 136 insertions(+), 137 deletions(-) create mode 100644 lib/rpmfi_internal.h diff --git a/build/files.c b/build/files.c index 83c2aeec5..1ca5f95dc 100644 --- a/build/files.c +++ b/build/files.c @@ -21,7 +21,7 @@ #include #include -#define _RPMFI_INTERNAL /* XXX pretty much all rpmfi internals... */ +#include "lib/rpmfi_internal.h" /* XXX pretty much all rpmfi internals... */ #include #define _RPMTE_INTERNAL /* XXX rpmte init */ diff --git a/build/pack.c b/build/pack.c index f314fd155..cea97b1cc 100644 --- a/build/pack.c +++ b/build/pack.c @@ -11,8 +11,7 @@ #include "lib/cpio.h" #include "lib/fsm.h" -#define _RPMFI_INTERNAL /* XXX fi->fsm */ -#include +#include "lib/rpmfi_internal.h" /* XXX fi->fsm */ #include #include "build/buildio.h" diff --git a/lib/fsm.c b/lib/fsm.c index 1bdac6a1c..441049f0c 100644 --- a/lib/fsm.c +++ b/lib/fsm.c @@ -15,8 +15,7 @@ #include -#define _RPMFI_INTERNAL /* XXX fi->apath, fi->action... */ -#include +#include "lib/rpmfi_internal.h" /* XXX fi->apath, fi->action... */ #include #include #include diff --git a/lib/psm.c b/lib/psm.c index 5a1ae77b0..dbf856739 100644 --- a/lib/psm.c +++ b/lib/psm.c @@ -16,8 +16,7 @@ #include -#define _RPMFI_INTERNAL /* XXX replaced/states, fi->hge, fi->te... */ -#include +#include "lib/rpmfi_internal.h" /* XXX replaced/states, fi->hge, fi->te... */ #define _RPMTE_INTERNAL /* XXX te->fd */ #include diff --git a/lib/rpmfi.c b/lib/rpmfi.c index 6f1cf3c25..1791dc57b 100644 --- a/lib/rpmfi.c +++ b/lib/rpmfi.c @@ -13,8 +13,7 @@ #include -#define _RPMFI_INTERNAL -#include +#include "lib/rpmfi_internal.h" #define _RPMTE_INTERNAL /* relocations */ #include diff --git a/lib/rpmfi.h b/lib/rpmfi.h index 2205cd811..cd4bf2d38 100644 --- a/lib/rpmfi.h +++ b/lib/rpmfi.h @@ -43,132 +43,6 @@ typedef enum rpmfileState_e { } rpmfileState; #define RPMFILE_STATE_MISSING -1 /* XXX used for unavailable data */ -#if defined(_RPMFI_INTERNAL) -/** - */ -typedef struct sharedFileInfo_s * sharedFileInfo; - -/** - */ -struct sharedFileInfo_s { - int pkgFileNum; - int otherFileNum; - int otherPkg; - int isRemoved; -}; - -/** - * A package filename set. - */ -struct rpmfi_s { - int i; /*!< Current file index. */ - int j; /*!< Current directory index. */ - - const char * Type; /*!< Tag name. */ - - rpmTag tagN; /*!< Header tag. */ - Header h; /*!< Header for file info set (or NULL) */ - -/*?null?*/ - const char ** bnl; /*!< Base name(s) (from header) */ -/*?null?*/ - const char ** dnl; /*!< Directory name(s) (from header) */ - - const char ** fmd5s; /*!< File MD5 sum(s) (from header) */ - const char ** flinks; /*!< File link(s) (from header) */ - const char ** flangs; /*!< File lang(s) (from header) */ - - uint32_t * dil; /*!< Directory indice(s) (from header) */ -/*?null?*/ - const uint32_t * fflags; /*!< File flag(s) (from header) */ -/*?null?*/ - const uint32_t * fsizes; /*!< File size(s) (from header) */ -/*?null?*/ - const uint32_t * fmtimes; /*!< File modification time(s) (from header) */ -/*?null?*/ - uint16_t * fmodes; /*!< File mode(s) (from header) */ -/*?null?*/ - const uint16_t * frdevs; /*!< File rdev(s) (from header) */ -/*?null?*/ - const uint32_t * finodes; /*!< File inodes(s) (from header) */ - - const char ** fuser; /*!< File owner(s) (from header) */ - const char ** fgroup; /*!< File group(s) (from header) */ - - char * fstates; /*!< File state(s) (from header) */ - - const uint32_t * fcolors; /*!< File color bits (header) */ - - const char ** fcontexts; /*! FIle security contexts. */ - - const char ** cdict; /*!< File class dictionary (header) */ - int32_t ncdict; /*!< No. of class entries. */ - const uint32_t * fcdictx; /*!< File class dictionary index (header) */ - - const uint32_t * ddict; /*!< File depends dictionary (header) */ - int32_t nddict; /*!< No. of depends entries. */ - const uint32_t * fddictx; /*!< File depends dictionary start (header) */ - const uint32_t * fddictn; /*!< File depends dictionary count (header) */ - -/*?null?*/ - const uint32_t * vflags; /*!< File verify flag(s) (from header) */ - - int32_t dc; /*!< No. of directories. */ - int32_t fc; /*!< No. of files. */ - -/*=============================*/ - rpmte te; - - HGE_t hge; /*!< Vector to headerGetEntry() */ - HAE_t hae; /*!< Vector to headerAddEntry() */ - HME_t hme; /*!< Vector to headerModifyEntry() */ - HRE_t hre; /*!< Vector to headerRemoveEntry() */ - HFD_t hfd; /*!< Vector to headerFreeData() */ -/*-----------------------------*/ - uid_t uid; /*!< File uid (default). */ - gid_t gid; /*!< File gid (default). */ - uint32_t flags; /*!< File flags (default). */ - rpmFileAction action; /*!< File disposition (default). */ - rpmFileAction * actions; /*!< File disposition(s). */ - struct fingerPrint_s * fps; /*!< File fingerprint(s). */ - const char ** obnl; /*!< Original basename(s) (from header) */ - const char ** odnl; /*!< Original dirname(s) (from header) */ - int32_t * odil; /*!< Original dirindex(s) (from header) */ - - unsigned char * md5s; /*!< File md5 sums in binary. */ - - const char * pretrans; - const char * pretransprog; - const char * posttrans; - const char * posttransprog; - - char * fn; /*!< File name buffer. */ - int fnlen; /*!< FIle name buffer length. */ - - int astriplen; - int striplen; - unsigned int archivePos; - unsigned int archiveSize; - mode_t dperms; /*!< Directory perms (0755) if not mapped. */ - mode_t fperms; /*!< File perms (0644) if not mapped. */ - const char ** apath; - int mapflags; - int * fmapflags; - FSM_t fsm; /*!< File state machine data. */ - int keep_header; /*!< Keep header? */ - uint32_t color; /*!< Color bit(s) from file color union. */ - sharedFileInfo replaced; /*!< (TR_ADDED) */ - uint32_t * replacedSizes; /*!< (TR_ADDED) */ - unsigned int record; /*!< (TR_REMOVED) */ - int magic; -#define RPMFIMAGIC 0x09697923 -/*=============================*/ - -int nrefs; /*!< Reference count. */ -}; - -#endif /* _RPMFI_INTERNAL */ - /** \ingroup rpmfi * Unreference a file info set instance. * @param fi file info set diff --git a/lib/rpmfi_internal.h b/lib/rpmfi_internal.h new file mode 100644 index 000000000..5beab2f2a --- /dev/null +++ b/lib/rpmfi_internal.h @@ -0,0 +1,130 @@ +#ifndef _RPMFI_INTERNAL_H +#define _RPMFI_INTERNAL_H + +#include + +/** + */ +typedef struct sharedFileInfo_s * sharedFileInfo; + +/** + */ +struct sharedFileInfo_s { + int pkgFileNum; + int otherFileNum; + int otherPkg; + int isRemoved; +}; + +/** + * A package filename set. + */ +struct rpmfi_s { + int i; /*!< Current file index. */ + int j; /*!< Current directory index. */ + + const char * Type; /*!< Tag name. */ + + rpmTag tagN; /*!< Header tag. */ + Header h; /*!< Header for file info set (or NULL) */ + +/*?null?*/ + const char ** bnl; /*!< Base name(s) (from header) */ +/*?null?*/ + const char ** dnl; /*!< Directory name(s) (from header) */ + + const char ** fmd5s; /*!< File MD5 sum(s) (from header) */ + const char ** flinks; /*!< File link(s) (from header) */ + const char ** flangs; /*!< File lang(s) (from header) */ + + uint32_t * dil; /*!< Directory indice(s) (from header) */ +/*?null?*/ + const uint32_t * fflags; /*!< File flag(s) (from header) */ +/*?null?*/ + const uint32_t * fsizes; /*!< File size(s) (from header) */ +/*?null?*/ + const uint32_t * fmtimes; /*!< File modification time(s) (from header) */ +/*?null?*/ + uint16_t * fmodes; /*!< File mode(s) (from header) */ +/*?null?*/ + const uint16_t * frdevs; /*!< File rdev(s) (from header) */ +/*?null?*/ + const uint32_t * finodes; /*!< File inodes(s) (from header) */ + + const char ** fuser; /*!< File owner(s) (from header) */ + const char ** fgroup; /*!< File group(s) (from header) */ + + char * fstates; /*!< File state(s) (from header) */ + + const uint32_t * fcolors; /*!< File color bits (header) */ + + const char ** fcontexts; /*! FIle security contexts. */ + + const char ** cdict; /*!< File class dictionary (header) */ + int32_t ncdict; /*!< No. of class entries. */ + const uint32_t * fcdictx; /*!< File class dictionary index (header) */ + + const uint32_t * ddict; /*!< File depends dictionary (header) */ + int32_t nddict; /*!< No. of depends entries. */ + const uint32_t * fddictx; /*!< File depends dictionary start (header) */ + const uint32_t * fddictn; /*!< File depends dictionary count (header) */ + +/*?null?*/ + const uint32_t * vflags; /*!< File verify flag(s) (from header) */ + + int32_t dc; /*!< No. of directories. */ + int32_t fc; /*!< No. of files. */ + +/*=============================*/ + rpmte te; + + HGE_t hge; /*!< Vector to headerGetEntry() */ + HAE_t hae; /*!< Vector to headerAddEntry() */ + HME_t hme; /*!< Vector to headerModifyEntry() */ + HRE_t hre; /*!< Vector to headerRemoveEntry() */ + HFD_t hfd; /*!< Vector to headerFreeData() */ +/*-----------------------------*/ + uid_t uid; /*!< File uid (default). */ + gid_t gid; /*!< File gid (default). */ + uint32_t flags; /*!< File flags (default). */ + rpmFileAction action; /*!< File disposition (default). */ + rpmFileAction * actions; /*!< File disposition(s). */ + struct fingerPrint_s * fps; /*!< File fingerprint(s). */ + const char ** obnl; /*!< Original basename(s) (from header) */ + const char ** odnl; /*!< Original dirname(s) (from header) */ + int32_t * odil; /*!< Original dirindex(s) (from header) */ + + unsigned char * md5s; /*!< File md5 sums in binary. */ + + const char * pretrans; + const char * pretransprog; + const char * posttrans; + const char * posttransprog; + + char * fn; /*!< File name buffer. */ + int fnlen; /*!< FIle name buffer length. */ + + int astriplen; + int striplen; + unsigned int archivePos; + unsigned int archiveSize; + mode_t dperms; /*!< Directory perms (0755) if not mapped. */ + mode_t fperms; /*!< File perms (0644) if not mapped. */ + const char ** apath; + int mapflags; + int * fmapflags; + FSM_t fsm; /*!< File state machine data. */ + int keep_header; /*!< Keep header? */ + uint32_t color; /*!< Color bit(s) from file color union. */ + sharedFileInfo replaced; /*!< (TR_ADDED) */ + uint32_t * replacedSizes; /*!< (TR_ADDED) */ + unsigned int record; /*!< (TR_REMOVED) */ + int magic; +#define RPMFIMAGIC 0x09697923 +/*=============================*/ + +int nrefs; /*!< Reference count. */ +}; + +#endif /* _RPMFI_INTERNAL_H */ + diff --git a/lib/transaction.c b/lib/transaction.c index d06fbf53c..5e7cbeb38 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -18,8 +18,7 @@ #include "lib/rpmlock.h" -#define _RPMFI_INTERNAL /* fi->replaced, fi->actions... */ -#include +#include "lib/rpmfi_internal.h" /* fi->replaced, fi->actions... */ #define _RPMTE_INTERNAL /* XXX te->h, te->fd, te->h */ #include -- cgit v1.2.3