Add (and use) rpmfiles counterpart for rpmfiColor()
This commit is contained in:
parent
c29ce0dcc0
commit
dbc2ed980a
13
lib/rpmfi.c
13
lib/rpmfi.c
|
@ -445,19 +445,24 @@ rpm_ino_t rpmfilesFInode(rpmfiles fi, int ix)
|
|||
return finode;
|
||||
}
|
||||
|
||||
rpm_color_t rpmfiColor(rpmfi fi)
|
||||
rpm_color_t rpmfilesColor(rpmfiles files)
|
||||
{
|
||||
rpm_color_t color = 0;
|
||||
|
||||
if (fi != NULL && fi->files->fcolors != NULL) {
|
||||
for (int i = 0; i < fi->files->fc; i++)
|
||||
color |= fi->files->fcolors[i];
|
||||
if (files != NULL && files->fcolors != NULL) {
|
||||
for (int i = 0; i < files->fc; i++)
|
||||
color |= files->fcolors[i];
|
||||
/* XXX ignore all but lsnibble for now. */
|
||||
color &= 0xf;
|
||||
}
|
||||
return color;
|
||||
}
|
||||
|
||||
rpm_color_t rpmfiColor(rpmfi fi)
|
||||
{
|
||||
return (fi != NULL) ? rpmfilesColor(fi->files) : 0;
|
||||
}
|
||||
|
||||
rpm_color_t rpmfilesFColor(rpmfiles fi, int ix)
|
||||
{
|
||||
rpm_color_t fcolor = 0;
|
||||
|
|
|
@ -151,6 +151,8 @@ rpmfi rpmfilesIter(rpmfiles files, int flags);
|
|||
|
||||
int rpmfilesDigestAlgo(rpmfiles fi);
|
||||
|
||||
rpm_color_t rpmfilesColor(rpmfiles files);
|
||||
|
||||
/* Temporary ugly kludge to eliminate direct struct rpmfi access... */
|
||||
void rpmfiSetApath(rpmfi fi, char **apath);
|
||||
|
||||
|
|
Loading…
Reference in New Issue