# RPMRC.

## Files
file | rpmlib.h
| In Memoriam: Steve Taylor <staylor@redhat.com> was here, now he's not.

file | macro.c
## RPMRC
enum | rpm_machtable_e { RPM_MACHTABLE_INSTARCH = 0, RPM_MACHTABLE_INSTOS = 1, RPM_MACHTABLE_BUILDARCH = 2, RPM_MACHTABLE_BUILDOS = 3 }
| Build and install arch/os table identifiers. More...
int | rpmReadConfigFiles (const char *file, const char *target)
| Read macro configuration file(s) for a target.
int | rpmPlatformScore (const char *platform, void *mi_re, int mi_nre)
| Return score of a platform string.
int | rpmShowRC (FILE *fp)
| Display current rpmrc (and macro) configuration.
void | rpmSetTables (int archTable, int osTable)
void | rpmFreeRpmrc (void)
## Functions
static int | rpmReadRC (void)
| Read macro configuration file(s).
## Variables
const char * | rpmMacrofiles
| List of macro files to read when configuring rpm.

## Enumeration Type Documentation

enum rpm_machtable_e

Build and install arch/os table identifiers.

Deprecated:
  Eliminate from API.

Todo:
  Eliminate in rpm-5.1.

Enumerator:

  RPM_MACHTABLE_INSTARCH | Install platform architecture.
  RPM_MACHTABLE_INSTOS | Install platform operating system.
  RPM_MACHTABLE_BUILDARCH | Build platform architecture.
  RPM_MACHTABLE_BUILDOS | Build platform operating system.

Definition at line 169 of file rpmlib.h.

## Function Documentation

void rpmFreeRpmrc | ( | void |  | ) |

Todo:
  Eliminate in rpm-5.1. Destroy rpmrc arch/os compatibility tables.

Todo:
  Eliminate from API.

Definition at line 835 of file rpmrc.c.

References _free(), ARCH, machCache_s::cache, tableType_s::cache, tableType_s::canons, tableType_s::canonsLength, machCacheEntry_s::count, machEquivTable_s::count, current, tableType_s::defaults, defaultsInitialized, tableType_s::defaultsLength, defaultEntry_s::defName, tableType_s::equiv, machCacheEntry_s::equivs, machEquivTable_s::list, mireFreeAll(), canonEntry_s::name, defaultEntry_s::name, machCacheEntry_s::name, machEquivInfo_s::name, nplatpat, OS, platpat, RPM_MACHTABLE_COUNT, canonEntry_s::short_name, and machCache_s::size.

Referenced by rpmcliFini(), and rpmspecQuery().

int rpmPlatformScore | ( | const char * | platform,
|  | void * | mi_re,
|  | int | mi_nre |
| ) |  |  |

Return score of a platform string.

A platform score measures the "nearness" of a platform string wrto configured platform patterns. The returned score is the line number of the 1st pattern in /etc/rpm/platform that matches the input string.

Parameters:

  | platform | cpu-vendor-os platform string
  | mi_re | pattern array (NULL uses /etc/rpm/platform patterns)
  | mi_nre | no. of patterns

Returns:
  platform score (0 is no match, lower is preferred)

Definition at line 519 of file rpmrc.c.

References nplatpat, and platpat.

Referenced by archScore(), platformScore(), and rpmtsAddInstallElement().

int rpmReadConfigFiles | ( | const char * | file,
|  | const char * | target |
| ) |  |  |

Read macro configuration file(s) for a target.

Parameters:

  | file | NULL always
  | target | target platform (NULL uses default)

Returns:
  0 on success, -1 on error

Definition at line 925 of file rpmrc.c.

References _free(), configTarget, rpmExpand(), rpmReadRC(), rpmRebuildTargetVars(), and rpmSetMachine().

Referenced by init_rpm(), rpmcliConfigured(), and rpmspecQuery().

static int rpmReadRC | ( | void |  | ) | `[static]`

Read macro configuration file(s).

Returns:
  0 on success

Definition at line 899 of file rpmrc.c.

References _free(), defaultsInitialized, rpmExpand(), rpmInitMacros(), rpmMacrofiles, and setDefaults().

Referenced by rpmReadConfigFiles().

void rpmSetTables | ( | int | archTable,
|  | int | osTable |
| ) |  |  |

Deprecated:
  Use addMacro to set _target_* macros.

Todo:
  Eliminate in rpm-5.1. #

Note:
  Only used by build code.

Parameters:

  | archTable |
  | osTable |

Definition at line 665 of file rpmrc.c.

References ARCH, currTables, defaultMachine(), OS, and rebuildCompatTables().

Referenced by rpmRebuildTargetVars().

int rpmShowRC | ( | FILE * | fp | ) |

Display current rpmrc (and macro) configuration.

Parameters:

  | fp | output file handle

Returns:
  0 always

Definition at line 969 of file rpmrc.c.

References _, _free(), ARCH, machEquivTable_s::count, current, tableType_s::equiv, machEquivTable_s::list, machEquivInfo_s::name, OS, RPM_MACHTABLE_BUILDARCH, RPM_MACHTABLE_BUILDOS, RPM_MACHTABLE_INSTARCH, RPM_MACHTABLE_INSTOS, rpmdsCpuinfo(), rpmdsDNEVR(), rpmdsFree(), rpmdsFreePRCO(), rpmdsFromPRCO(), rpmdsGetconf(), rpmdsInit(), rpmdsNewPRCO(), rpmdsNext(), rpmdsRpmlib(), rpmdsSysinfo(), rpmdsUname(), rpmDumpMacroTable(), rpmExpand(), rpmIsVerbose, rpmMacrofiles, and RPMTAG_PROVIDENAME.

Referenced by rpmcliAllArgCallback().

## Variable Documentation

const char* rpmMacrofiles

List of macro files to read when configuring rpm.

This is a colon separated list of files. URI's are permitted as well, identified by the token '://', so file paths must not begin with '//'.

Definition at line 58 of file macro.c.

Referenced by rpmReadRC(), and rpmShowRC().