rpm  4.8.1
Macros | Typedefs | Enumerations | Functions | Variables
rpmfc.h File Reference

Structures and methods for build-time file classification. More...

#include <rpm/rpmtypes.h>
#include <rpm/argv.h>
#include <rpm/rpmstring.h>
#include <rpm/rpmspec.h>
Include dependency graph for rpmfc.h:

Go to the source code of this file.

Macros

#define RPMFC_ELF   (RPMFC_ELF32|RPMFC_ELF64|RPMFC_ELFMIPSN32)
 

Typedefs

typedef struct rpmfc_s * rpmfc
 
typedef enum FCOLOR_e FCOLOR_t
 
typedef const struct rpmfcTokens_s * rpmfcToken
 

Enumerations

enum  FCOLOR_e {
  RPMFC_BLACK = 0, RPMFC_ELF32 = (1 << 0), RPMFC_ELF64 = (1 << 1), RPMFC_ELFMIPSN32 = (1 << 2),
  RPMFC_PSDRIVER = (1 << 6), RPMFC_OCAML = (1 << 7), 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_PPD = (10 << 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_const_t av, StringBuf sb_stdin, StringBuf *sb_stdoutp, int failnonzero)
 Return helper output. More...
 
int rpmfcColoring (const char *fmstr)
 Return file color given file(1) string. More...
 
void rpmfcPrint (const char *msg, rpmfc fc, FILE *fp)
 Print results of file classification. More...
 
rpmfc rpmfcFree (rpmfc fc)
 Destroy a file classifier. More...
 
rpmfc rpmfcNew (void)
 Create a file classifier. More...
 
rpmRC rpmfcClassify (rpmfc fc, ARGV_t argv, rpm_mode_t *fmode)
 Build file class dictionary and mappings. More...
 
rpmRC rpmfcApply (rpmfc fc)
 Build file/package dependency dictionary and mappings. More...
 
rpmRC rpmfcGenerateDepends (const rpmSpec spec, Package pkg)
 Generate package dependencies. More...
 
rpmds rpmfcProvides (rpmfc fc)
 Retrieve file classification provides. More...
 
rpmds rpmfcRequires (rpmfc fc)
 Retrieve file classification requires. More...
 

Variables

int _rpmfc_debug
 

Detailed Description

Structures and methods for build-time file classification.

Definition in file rpmfc.h.

Macro Definition Documentation

◆ RPMFC_ELF

#define RPMFC_ELF   (RPMFC_ELF32|RPMFC_ELF64|RPMFC_ELFMIPSN32)

Definition at line 31 of file rpmfc.h.

Typedef Documentation

◆ FCOLOR_t

typedef enum FCOLOR_e FCOLOR_t

Definition at line 77 of file rpmfc.h.

◆ rpmfc

typedef struct rpmfc_s* rpmfc

Definition at line 22 of file rpmfc.h.

◆ rpmfcToken

typedef const struct rpmfcTokens_s* rpmfcToken

Definition at line 81 of file rpmfc.h.

Enumeration Type Documentation

◆ FCOLOR_e

enum FCOLOR_e
Enumerator
RPMFC_BLACK 
RPMFC_ELF32 
RPMFC_ELF64 
RPMFC_ELFMIPSN32 
RPMFC_PSDRIVER 
RPMFC_OCAML 
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_PPD 
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 26 of file rpmfc.h.

Function Documentation

◆ rpmfcApply()

rpmRC rpmfcApply ( rpmfc  fc)

Build file/package dependency dictionary and mappings.

Parameters
fcfile classifier
Returns
RPMRC_OK on success

◆ rpmfcClassify()

rpmRC rpmfcClassify ( rpmfc  fc,
ARGV_t  argv,
rpm_mode_t fmode 
)

Build file class dictionary and mappings.

Parameters
fcfile classifier
argvfiles to classify
fmodefiles mode_t array (or NULL)
Returns
RPMRC_OK on success

◆ rpmfcColoring()

int rpmfcColoring ( const char *  fmstr)

Return file color given file(1) string.

Parameters
fmstrfile(1) string
Returns
file color

◆ rpmfcExec()

int rpmfcExec ( ARGV_const_t  av,
StringBuf  sb_stdin,
StringBuf sb_stdoutp,
int  failnonzero 
)

Return helper output.

Parameters
avhelper argv (with possible macros)
sb_stdinhelper input
Return values
*sb_stdoutphelper output
Parameters
failnonzeroIS non-zero helper exit status a failure?

◆ rpmfcFree()

rpmfc rpmfcFree ( rpmfc  fc)

Destroy a file classifier.

Parameters
fcfile classifier
Returns
NULL always

◆ rpmfcGenerateDepends()

rpmRC rpmfcGenerateDepends ( const rpmSpec  spec,
Package  pkg 
)

Generate package dependencies.

Parameters
specspec file control
pkgpackage control
Returns
RPMRC_OK on success

◆ rpmfcNew()

rpmfc rpmfcNew ( void  )

Create a file classifier.

Returns
new file classifier

◆ rpmfcPrint()

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

Print results of file classification.

Todo:
Remove debugging routine.
Parameters
msgmessage prefix (NULL for none)
fcfile classifier
fpoutput file handle (NULL for stderr)

◆ rpmfcProvides()

rpmds rpmfcProvides ( rpmfc  fc)

Retrieve file classification provides.

Parameters
fcfile classifier
Returns
rpmds dependency set of fc provides

◆ rpmfcRequires()

rpmds rpmfcRequires ( rpmfc  fc)

Retrieve file classification requires.

Parameters
fcfile classifier
Returns
rpmds dependency set of fc requires

Variable Documentation

◆ _rpmfc_debug

int _rpmfc_debug