# lib/rpmfc.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Defines
#define | RPMFC_ELF (RPMFC_ELF32|RPMFC_ELF64|RPMFC_ELFMIPSN32)
## Typedefs
typedef struct rpmfc_s * | rpmfc
typedef enum FCOLOR_e | FCOLOR_t
typedef struct rpmfcTokens_s * | rpmfcToken
## Enumerations
enum | FCOLOR_e { RPMFC_BLACK = 0, RPMFC_ELF32 = (1 << 0), RPMFC_ELF64 = (1 << 1), RPMFC_ELFMIPSN32 = (1 << 2), RPMFC_PKGCONFIG = (1 << 8), RPMFC_LIBTOOL = (1 << 9), RPMFC_BOURNE = (1 << 10), RPMFC_MONO = (1 << 11), RPMFC_SCRIPT = (1 << 12), RPMFC_STATIC = (1 << 13), RPMFC_NOTSTRIPPED = (1 << 14), RPMFC_DIRECTORY = (1 << 16), RPMFC_SYMLINK = (2 << 16), RPMFC_DEVICE = (3 << 16), RPMFC_LIBRARY = (4 << 16), RPMFC_FONT = (5 << 16), RPMFC_IMAGE = (6 << 16), RPMFC_MANPAGE = (7 << 16), RPMFC_TEXT = (8 << 16), RPMFC_DOCUMENT = (9 << 16), RPMFC_ARCHIVE = (1 << 20), RPMFC_COMPRESSED = (1 << 21), RPMFC_MODULE = (1 << 22), RPMFC_EXECUTABLE = (1 << 23), RPMFC_PERL = (1 << 24), RPMFC_JAVA = (1 << 25), RPMFC_PYTHON = (1 << 26), RPMFC_PHP = (1 << 27), RPMFC_TCL = (1 << 28), RPMFC_WHITE = (1 << 29), RPMFC_INCLUDE = (1 << 30), RPMFC_ERROR = (1 << 31) }
## Functions
int | rpmfcExec (ARGV_t av, StringBuf sb_stdin, StringBuf *sb_stdoutp, int failnonzero)
| Return helper output.
int | rpmfcColoring (const char *fmstr)
| Return file color given file(1) string.
void | rpmfcPrint (const char *msg, rpmfc fc, FILE *fp)
| Print results of file classification.
rpmfc | rpmfcFree (rpmfc fc)
| Destroy a file classifier.
rpmfc | rpmfcNew (void)
| Create a file classifier.
rpmRC | rpmfcClassify (rpmfc fc, ARGV_t argv, uint16_t *fmode)
| Build file class dictionary and mappings.
rpmRC | rpmfcApply (rpmfc fc)
| Build file/package dependency dictionary and mappings.
rpmRC | rpmfcGenerateDepends (void *specp, void *pkgp)
| Generate package dependencies.
## Variables
int | _rpmfc_debug

## Define Documentation

#define RPMFC_ELF (RPMFC_ELF32|RPMFC_ELF64|RPMFC_ELFMIPSN32)

## Typedef Documentation

typedef enum FCOLOR_e FCOLOR_t

Definition at line 15 of file rpmfc.h.

typedef struct rpmfc_s* rpmfc

Definition at line 11 of file rpmfc.h.

typedef struct rpmfcTokens_s* rpmfcToken

Definition at line 19 of file rpmfc.h.

## Enumeration Type Documentation

enum FCOLOR_e

Enumerator:

  RPMFC_BLACK |
  RPMFC_ELF32 |
  RPMFC_ELF64 |
  RPMFC_ELFMIPSN32 |
  RPMFC_PKGCONFIG |
  RPMFC_LIBTOOL |
  RPMFC_BOURNE |
  RPMFC_MONO |
  RPMFC_SCRIPT |
  RPMFC_STATIC |
  RPMFC_NOTSTRIPPED |
  RPMFC_DIRECTORY |
  RPMFC_SYMLINK |
  RPMFC_DEVICE |
  RPMFC_LIBRARY |
  RPMFC_FONT |
  RPMFC_IMAGE |
  RPMFC_MANPAGE |
  RPMFC_TEXT |
  RPMFC_DOCUMENT |
  RPMFC_ARCHIVE |
  RPMFC_COMPRESSED |
  RPMFC_MODULE |
  RPMFC_EXECUTABLE |
  RPMFC_PERL |
  RPMFC_JAVA |
  RPMFC_PYTHON |
  RPMFC_PHP |
  RPMFC_TCL |
  RPMFC_WHITE |
  RPMFC_INCLUDE |
  RPMFC_ERROR |

Definition at line 23 of file rpmfc.h.

## Function Documentation

rpmRC rpmfcApply | ( | rpmfc | fc | ) |

Build file/package dependency dictionary and mappings.

Parameters:

  | fc | file classifier

Returns:
  RPMRC_OK on success

Definition at line 863 of file rpmfc.c.

References argiAdd(), argiCount(), argvCount(), rpmfcApplyTbl_s::colormask, rpmfcApplyTbl_s::func, rpmdsFind(), rpmdsFree(), rpmdsSingle(), RPMFC_PYTHON, RPMRC_OK, RPMTAG_PROVIDENAME, and RPMTAG_REQUIRENAME.

Referenced by main(), and rpmfcGenerateDepends().

rpmRC rpmfcClassify | ( | rpmfc | fc,
|  | ARGV_t | argv,
|  | uint16_t * | fmode |
| ) |  |  |

Build file class dictionary and mappings.

Parameters:

  | fc | file classifier
  | argv | files to classify
  | fmode | files mode_t array (or NULL)

Returns:
  RPMRC_OK on success

Definition at line 970 of file rpmfc.c.

References _free(), _suffix, argiAdd(), argvAdd(), argvCount(), argvFree(), argvSearch(), rpmExpand(), RPMFC_INCLUDE, RPMFC_WHITE, rpmfcColoring(), rpmfcSaveArg(), rpmlog(), RPMLOG_DEBUG, rpmmgFile(), rpmmgFree(), rpmmgNew(), RPMRC_OK, S_IFSOCK, and urlPath().

Referenced by main(), and rpmfcGenerateDepends().

int rpmfcColoring | ( | const char * | fmstr | ) |

Return file color given file(1) string.

Parameters:

  | fmstr | file(1) string

Returns:
  file color

Definition at line 531 of file rpmfc.c.

References RPMFC_BLACK, RPMFC_INCLUDE, and rpmfcTokens.

Referenced by rpmfcClassify().

int rpmfcExec | ( | ARGV_t | av,
|  | StringBuf | sb_stdin,
|  | StringBuf * | sb_stdoutp,
|  | int | failnonzero |
| ) |  |  |

Return helper output.

Parameters:

  | av | helper argv (with possible macros)
  | sb_stdin | helper input

Return values:

  | *sb_stdoutp | helper output

Parameters:

  | failnonzero | Is non-zero helper exit status a failure?

Definition at line 207 of file rpmfc.c.

References _free(), argvAppend(), argvFree(), freeStringBuf(), getOutputFrom(), getStringBuf(), rpmExpand(), and rpmfcExpandAppend().

Referenced by checkFiles(), rpmfcGenerateDependsHelper(), rpmfcGenerateScriptletDeps(), and rpmfcHelper().

rpmfc rpmfcFree | ( | rpmfc | fc | ) |

Destroy a file classifier.

Parameters:

  | fc | file classifier

Returns:
  NULL always

Definition at line 623 of file rpmfc.c.

References _free(), argiFree(), argvFree(), freeStringBuf(), and rpmdsFree().

Referenced by main(), and rpmfcGenerateDepends().

rpmRC rpmfcGenerateDepends | ( | void * | specp,
|  | void * | pkgp |
| ) |  |  |

Generate package dependencies.

Parameters:

  | specp | spec file control
  | pkgp | package control

Returns:
  RPMRC_OK on success

Definition at line 1394 of file rpmfc.c.

References _free(), _rpmfc_debug, alloca(), argiCount(), argiData(), rpmDataType_u::argv, argvCount(), argvData(), argvFree(), Package_s::autoProv, Package_s::autoReq, _HE_s::c, Package_s::cpioList, Package_s::ds, Package_s::header, headerDel(), headerPut(), DepMsg_s::msg, _HE_s::p, printDeps(), rpmDataType_u::ptr, Spec_s::rootURL, RPM_STRING_ARRAY_TYPE, RPM_UINT32_TYPE, rpmdsCount(), rpmdsEVR(), rpmdsFree(), rpmdsMerge(), rpmdsN(), rpmdsNew(), rpmdsSingle(), rpmExpandNumeric(), rpmfcApply(), rpmfcClassify(), rpmfcFree(), rpmfcGenerateDependsHelper(), rpmfcGenerateScriptletDeps(), rpmfcNew(), rpmfcPrint(), rpmfiFC(), rpmfiFFlags(), rpmfiFMode(), rpmfiFN(), rpmfiInit(), RPMFILE_CONFIG, rpmfiNext(), rpmGenPath(), RPMRC_OK, RPMSENSE_EQUAL, RPMTAG_CLASSDICT, RPMTAG_DEPENDSDICT, RPMTAG_FILECLASS, RPMTAG_FILECOLORS, RPMTAG_FILEDEPENDSN, RPMTAG_FILEDEPENDSX, RPMTAG_PROVIDEFLAGS, RPMTAG_PROVIDENAME, RPMTAG_PROVIDEVERSION, RPMTAG_REQUIREFLAGS, RPMTAG_REQUIRENAME, RPMTAG_REQUIREVERSION, _HE_s::t, _HE_s::tag, rpmDataType_u::ui32p, urlPath(), xcalloc(), and xstrdup().

Referenced by processBinaryFiles().

rpmfc rpmfcNew | ( | void |  | ) |

Create a file classifier.

Returns:
  new file classifier

Definition at line 648 of file rpmfc.c.

References xcalloc().

Referenced by main(), and rpmfcGenerateDepends().

void rpmfcPrint | ( | const char * | msg,
|  | rpmfc | fc,
|  | FILE * | fp |
| ) |  |  |

Print results of file classification.

Todo:
  Remove debugging routine.

Parameters:

  | msg | message prefix (NULL for none)
  | fc | file classifier
  | fp | output file handle (NULL for stderr)

Definition at line 546 of file rpmfc.c.

References rpmdsCount(), rpmdsDNEVR(), rpmdsNext(), rpmdsSetIx(), and RPMFC_BLACK.

Referenced by main(), and rpmfcGenerateDepends().

## Variable Documentation

int _rpmfc_debug

Definition at line 94 of file poptALL.c.

Referenced by main(), rpmdepPrint(), rpmfcGenerateDepends(), and rpmfcMergePR().