From c3353c2af418398fe92c0f4febca555ee035474e Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 17 Dec 2007 13:15:53 +0200 Subject: [PATCH] Stuff hardLink_s inside fsm.c, add pointer typedef to fsm.h - nothing outside fsm.c needs except for the declaration in fsm_s --- lib/fsm.c | 18 ++++++++++++++++-- lib/fsm.h | 18 +++--------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/lib/fsm.c b/lib/fsm.c index a6d8bd0..bba6b8e 100644 --- a/lib/fsm.c +++ b/lib/fsm.c @@ -34,6 +34,20 @@ int _fsm_threads = 0; /* XXX Failure to remove is not (yet) cause for failure. */ int strict_erasures = 0; +/** \ingroup payload + * Keeps track of the set of all hard links to a file in an archive. + */ +struct hardLink_s { + hardLink_t next; + const char ** nsuffix; + int * filex; + struct stat sb; + int nlink; + int linksLeft; + int linkIndex; + int createdPath; +}; + rpmts fsmGetTs(const FSM_t fsm) { const FSMI_t iter = fsm->iter; return (iter ? iter->ts : NULL); @@ -436,7 +450,7 @@ static int saveHardLink(FSM_t fsm) * @param li set of hard links * @return NULL always */ -static void * freeHardLink(struct hardLink_s * li) +static void * freeHardLink(hardLink_t li) { if (li) { li->nsuffix = _free(li->nsuffix); /* XXX elements are shared */ @@ -1549,7 +1563,7 @@ int fsmStage(FSM_t fsm, fileStage stage) if (fsm->fflags & RPMFILE_GHOST) /* XXX Don't if %ghost file. */ break; if (!S_ISDIR(st->st_mode) && st->st_nlink > 1) { - struct hardLink_s * li, * prev; + hardLink_t li, prev; if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS)) break; rc = writeLinkedFile(fsm); diff --git a/lib/fsm.h b/lib/fsm.h index a100a7a..7da9f50 100644 --- a/lib/fsm.h +++ b/lib/fsm.h @@ -88,19 +88,7 @@ typedef enum fileStage_e { #undef _fs #undef _fd -/** \ingroup payload - * Keeps track of the set of all hard links to a file in an archive. - */ -struct hardLink_s { - struct hardLink_s * next; - const char ** nsuffix; - int * filex; - struct stat sb; - int nlink; - int linksLeft; - int linkIndex; - int createdPath; -}; +typedef struct hardLink_s * hardLink_t; /** \ingroup payload * Iterator across package file info, forward on install, backward on erase. @@ -134,8 +122,8 @@ struct fsm_s { size_t wrnb; /*!< write: Number of bytes returned. */ FSMI_t iter; /*!< File iterator. */ int ix; /*!< Current file iterator index. */ - struct hardLink_s * links; /*!< Pending hard linked file(s). */ - struct hardLink_s * li; /*!< Current hard linked file(s). */ + hardLink_t links; /*!< Pending hard linked file(s). */ + hardLink_t li; /*!< Current hard linked file(s). */ unsigned int * archiveSize; /*!< Pointer to archive size. */ const char ** failedFile; /*!< First file name that failed. */ const char * subdir; /*!< Current file sub-directory. */ -- 2.7.4