Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

rpmfc.h File Reference

#include "rpmfile.h"

Go to the source code of this file.

Data Structures

struct  rpmfc_s
struct  rpmfcTokens_s

Defines

#define RPMFC_ELF   (RPMFC_ELF32|RPMFC_ELF64)

Typedefs

typedef rpmfc_srpmfc
typedef rpmfcTokens_srpmfcToken

Enumerations

enum  FCOLOR_e {
  RPMFC_BLACK = 0, RPMFC_ELF32 = (1 << 0), RPMFC_ELF64 = (1 << 1), RPMFC_MODULE = (1 << 7),
  RPMFC_EXECUTABLE = (1 << 8), RPMFC_SCRIPT = (1 << 9), RPMFC_TEXT = (1 << 10), RPMFC_DATA = (1 << 11),
  RPMFC_DOCUMENT = (1 << 12), RPMFC_STATIC = (1 << 13), RPMFC_NOTSTRIPPED = (1 << 14), RPMFC_COMPRESSED = (1 << 15),
  RPMFC_DIRECTORY = (1 << 16), RPMFC_SYMLINK = (1 << 17), RPMFC_DEVICE = (1 << 18), RPMFC_LIBRARY = (1 << 19),
  RPMFC_ARCHIVE = (1 << 20), RPMFC_FONT = (1 << 21), RPMFC_IMAGE = (1 << 22), RPMFC_MANPAGE = (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.
int rpmfcClassify (rpmfc fc, ARGV_t argv)
 Build file class dictionary and mappings.
int rpmfcApply (rpmfc fc)
 Build file/package dependency dictionary and mappings.
int rpmfcGenerateDepends (const Spec spec, Package pkg)
 Generate package dependencies.

Variables

int _rpmfc_debug


Define Documentation

#define RPMFC_ELF   (RPMFC_ELF32|RPMFC_ELF64)
 


Typedef Documentation

typedef struct rpmfc_s* rpmfc
 

Definition at line 13 of file rpmfc.h.

Referenced by main(), rpmfcApply(), rpmfcClassify(), rpmfcELF(), rpmfcFree(), rpmfcGenerateDepends(), rpmfcHelper(), rpmfcNew(), rpmfcPrint(), and rpmfcSCRIPT().

typedef struct rpmfcTokens_s* rpmfcToken
 

Definition at line 95 of file rpmfc.h.

Referenced by rpmfcColoring().


Enumeration Type Documentation

enum FCOLOR_e
 

Enumeration values:
RPMFC_BLACK 
RPMFC_ELF32 
RPMFC_ELF64 
RPMFC_MODULE 
RPMFC_EXECUTABLE 
RPMFC_SCRIPT 
RPMFC_TEXT 
RPMFC_DATA 
RPMFC_DOCUMENT 
RPMFC_STATIC 
RPMFC_NOTSTRIPPED 
RPMFC_COMPRESSED 
RPMFC_DIRECTORY 
RPMFC_SYMLINK 
RPMFC_DEVICE 
RPMFC_LIBRARY 
RPMFC_ARCHIVE 
RPMFC_FONT 
RPMFC_IMAGE 
RPMFC_MANPAGE 
RPMFC_PERL 
RPMFC_JAVA 
RPMFC_PYTHON 
RPMFC_PHP 
RPMFC_TCL 
RPMFC_WHITE 
RPMFC_INCLUDE 
RPMFC_ERROR 

Definition at line 48 of file rpmfc.h.


Function Documentation

int rpmfcApply rpmfc  fc  ) 
 

Build file/package dependency dictionary and mappings.

Parameters:
fc file classifier
Returns:
0 on success

Definition at line 1091 of file rpmfc.c.

References argiAdd(), argiCount(), argvCount(), rpmfcApplyTbl_s::colormask, rpmfc_s::ddict, rpmfc_s::ddictx, rpmfc_s::fcolor, rpmfc_s::fddictn, rpmfc_s::fddictx, rpmfc_s::fn, rpmfcApplyTbl_s::func, int_32, rpmfc_s::ix, rpmfc_s::provides, rpmfc_s::requires, rpmds, rpmdsFind(), rpmdsFree(), rpmdsSingle(), rpmfc, rpmfcApplyTbl, RPMTAG_PROVIDENAME, RPMTAG_REQUIRENAME, and ARGI_s::vals.

Referenced by main(), and rpmfcGenerateDepends().

int rpmfcClassify rpmfc  fc,
ARGV_t  argv
 

Build file class dictionary and mappings.

Parameters:
fc file classifier
argv files to classify
Returns:
0 on success

Definition at line 1180 of file rpmfc.c.

References argiAdd(), argv, ARGV_t, argvAdd(), argvCount(), argvFree(), argvSearch(), rpmfc_s::cdict, rpmfc_s::fcdictx, rpmfc_s::fcolor, rpmfc_s::fddictn, rpmfc_s::fddictx, rpmfc_s::fknown, fmagic, fmagicProcess(), fmagicSetup(), rpmfc_s::fn, rpmfc_s::fwhite, rpmfc_s::ix, fmagic_s::magicfile, rpmfc_s::nfiles, fmagic_s::nob, fmagic_s::obp, fmagic_s::obuf, rpmfc, RPMFC_WHITE, rpmfcColoring(), rpmfcSaveArg(), RPMMESS_DEBUG, and rpmMessage.

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 547 of file rpmfc.c.

References rpmfcTokens_s::colors, rpmfcToken, and rpmfcTokens_s::token.

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 236 of file rpmfc.c.

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

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

rpmfc rpmfcFree rpmfc  fc  ) 
 

Destroy a file classifier.

Parameters:
fc file classifier
Returns:
NULL always

Definition at line 639 of file rpmfc.c.

References _free(), argiFree(), argvFree(), rpmfc_s::cdict, rpmfc_s::ddict, rpmfc_s::ddictx, rpmfc_s::fcdictx, rpmfc_s::fcolor, rpmfc_s::fddictn, rpmfc_s::fddictx, rpmfc_s::fn, freeStringBuf(), rpmfc_s::provides, rpmfc_s::requires, rpmdsFree(), rpmfc, rpmfc_s::sb_java, rpmfc_s::sb_perl, and rpmfc_s::sb_python.

Referenced by main(), and rpmfcGenerateDepends().

int rpmfcGenerateDepends const Spec  spec,
Package  pkg
 

Generate package dependencies.

Parameters:
spec spec file control
pkg package control
Returns:
0 on success

Definition at line 1460 of file rpmfc.c.

References argiCount(), argiData(), ARGV_t, argvCount(), argvData(), argvFree(), Package_s::autoProv, Package_s::autoReq, rpmfc_s::cdict, Package_s::cpioList, rpmfc_s::ddictx, Package_s::ds, rpmfc_s::fcdictx, rpmfc_s::fcolor, rpmfc_s::fddictn, rpmfc_s::fddictx, rpmfc_s::fknown, Package_s::header, headerAddEntry(), headerRemoveEntry(), int_32, rpmfc_s::nfiles, Package, printDeps(), rpmfc_s::provides, rpmfc_s::requires, RPM_INT32_TYPE, RPM_STRING_ARRAY_TYPE, rpmds, rpmdsCount(), rpmdsEVR(), rpmdsFree(), rpmdsMerge(), rpmdsN(), rpmdsNew(), rpmdsSingle(), rpmExpandNumeric(), rpmfc, rpmfcApply(), rpmfcClassify(), rpmfcFree(), rpmfcGenerateDependsHelper(), rpmfcNew(), rpmfcPrint(), rpmfi, rpmfiFC(), rpmfiFFlags(), rpmfiFN(), rpmfiInit(), rpmfileAttrs, rpmfiNext(), RPMSENSE_CONFIG, 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, rpmfc_s::skipProv, rpmfc_s::skipReq, Spec, rpmfc_s::tracked, xcalloc(), and xstrdup().

Referenced by processBinaryFiles().

rpmfc rpmfcNew void   ) 
 

Create a file classifier.

Returns:
new file classifier

Definition at line 663 of file rpmfc.c.

References rpmfc, and 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 562 of file rpmfc.c.

References rpmfc_s::cdict, rpmfc_s::ddictx, rpmfc_s::fcdictx, rpmfc_s::fcolor, rpmfc_s::fddictn, rpmfc_s::fddictx, rpmfc_s::fn, rpmfc_s::nfiles, rpmfc_s::provides, rpmfc_s::requires, rpmdsCount(), rpmdsDNEVR(), rpmdsNext(), rpmdsSetIx(), rpmfc, and ARGI_s::vals.

Referenced by main(), and rpmfcGenerateDepends().


Variable Documentation

int _rpmfc_debug
 

Definition at line 59 of file poptALL.c.


Generated on Fri May 4 07:49:31 2007 for rpm by  doxygen 1.3.9.1