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

build/spec.c File Reference

Handle spec data structure. More...

#include "system.h"
#include "buildio.h"
#include "debug.h"

Go to the source code of this file.

Defines

#define SKIPWHITE(_x)   {while(*(_x) && (xisspace(*_x) || *(_x) == ',')) (_x)++;}
#define SKIPNONWHITE(_x)   {while(*(_x) &&!(xisspace(*_x) || *(_x) == ',')) (_x)++;}

Functions

TriggerFileEntry * freeTriggerFiles (struct TriggerFileEntry *p)
Source * freeSources (struct Source *s)
 Destroy source component chain.

int lookupPackage (Spec spec, const char *name, int flag, Package *pkg)
Package newPackage (Spec spec)
Package freePackage (Package pkg)
Package freePackages (Package packages)
Source * findSource (Spec spec, int num, int flag)
int parseNoSource (Spec spec, const char *field, int tag)
int addSource (Spec spec, Package pkg, const char *field, int tag)
speclines freeSl (speclines sl)
spectags freeSt (spectags st)
Spec freeSpec (Spec spec)
OpenFileInfo * newOpenFileInfo (void)

Variables

int specedit
speclines newSl (void)
spectags newSt (void)
Spec newSpec (void)


Detailed Description

Handle spec data structure.

Definition in file spec.c.


Define Documentation

#define SKIPNONWHITE (  _x    )     {while(*(_x) &&!(xisspace(*_x) || *(_x) == ',')) (_x)++;}
 

Definition at line 16 of file spec.c.

#define SKIPWHITE (  _x    )     {while(*(_x) && (xisspace(*_x) || *(_x) == ',')) (_x)++;}
 

Definition at line 15 of file spec.c.


Function Documentation

int addSource (  Spec    spec,
Package    pkg,
const char *    field,
int    tag
) 
 

Parameters:
spec  spec file control structure
pkg 
field 
tag 

Definition at line 254 of file spec.c.

References _, _free(), addMacro(), Source::flags, Source::fullSource, PackageStruct::icon, SpecStruct::line, SpecStruct::lineNum, SpecStruct::macros, Source::next, Source::num, SpecStruct::numSources, parseNum(), RMIL_SPEC, RPMBUILD_ISICON, RPMBUILD_ISPATCH, RPMBUILD_ISSOURCE, RPMERR_BADSPEC, rpmError, rpmGetPath(), RPMTAG_ICON, RPMTAG_PATCH, RPMTAG_SOURCE, SKIPSPACE, Source::source, SpecStruct::sources, xmalloc(), and xstrdup().

Referenced by handlePreambleTag().

struct Source* findSource (  Spec    spec,
int    num,
int    flag
)  [inline, static]
 

Definition at line 194 of file spec.c.

References Source::flags, Source::next, and Source::num.

Referenced by parseNoSource().

Package freePackage (  Package    pkg ) 
 

Destroy package control structure.

Parameters:
pkg  package control structure
Returns:
NULL

Definition at line 149 of file spec.c.

References _free(), PackageStruct::autoProv, PackageStruct::autoReq, PackageStruct::cpioList, PackageStruct::fileFile, PackageStruct::fileList, freeFi(), freeSources(), freeStringBuf(), freeTriggerFiles(), PackageStruct::header, headerFree(), PackageStruct::icon, PackageStruct::postInFile, PackageStruct::postUnFile, PackageStruct::preInFile, PackageStruct::preUnFile, PackageStruct::specialDoc, PackageStruct::triggerFiles, and PackageStruct::verifyFile.

Referenced by freePackages().

Package freePackages (  Package    packages ) 
 

Destroy all packages associated with spec file.

Parameters:
packages  package control structure chain
Returns:
NULL

Definition at line 180 of file spec.c.

References freePackage(), and PackageStruct::next.

Referenced by freeSpec().

speclines freeSl (  speclines    sl )  [inline, static]
 

Definition at line 376 of file spec.c.

References _free(), speclines_s::sl_lines, and speclines_s::sl_nlines.

Referenced by freeSpec().

struct Source* freeSources (  struct Source *    s )  [inline, static]
 

Destroy source component chain.

Parameters:
s  source component chain
Returns:
NULL always

Definition at line 47 of file spec.c.

References _free(), Source::fullSource, and Source::next.

Referenced by freePackage(), and freeSpec().

Spec freeSpec (  Spec    spec ) 
 

Destroy Spec structure.

Parameters:
spec  spec file control structure
Returns:
NULL always

Definition at line 479 of file spec.c.

References _free(), SpecStruct::BACount, SpecStruct::BANames, SpecStruct::BASpecs, SpecStruct::build, SpecStruct::buildRestrictions, SpecStruct::buildRootURL, SpecStruct::buildSubdir, SpecStruct::clean, closeSpec(), SpecStruct::cookie, OpenFileInfo::fileName, SpecStruct::fileStack, freeFi(), freePackages(), freeSl(), freeSources(), freeSt(), freeStringBuf(), headerFree(), SpecStruct::install, ReadLevelEntry::next, OpenFileInfo::next, SpecStruct::packages, SpecStruct::passPhrase, SpecStruct::prep, SpecStruct::readStack, SpecStruct::recursing, SpecStruct::rootURL, SpecStruct::sl, SpecStruct::sourceCpioList, SpecStruct::sourceHeader, SpecStruct::sourceRpmName, SpecStruct::sources, SpecStruct::specFile, and SpecStruct::st.

Referenced by buildForTarget(), parseSpec(), and readRPM().

spectags freeSt (  spectags    st )  [inline, static]
 

Definition at line 408 of file spec.c.

References _free(), spectags_s::st_ntags, spectags_s::st_t, spectag_s::t_lang, and spectag_s::t_msgid.

Referenced by freeSpec().

struct TriggerFileEntry* freeTriggerFiles (  struct TriggerFileEntry *    p )  [inline, static]
 

Parameters:
p  trigger file entries
Returns:
NULL always

Definition at line 25 of file spec.c.

References _free(), TriggerFileEntry::fileName, TriggerFileEntry::next, TriggerFileEntry::prog, and TriggerFileEntry::script.

Referenced by freePackage().

int lookupPackage (  Spec    spec,
const char *    name,
int    flag,
Package *    pkg
) 
 

Find sub-package control structure by name.

Parameters:
spec  spec file control structure
name  (sub-)package name
flag  if PART_SUBNAME, then 1st package name is prepended
Return values:
pkg  package control structure
Returns:
0 on success, 1 on failure

Definition at line 61 of file spec.c.

References alloca(), PackageStruct::header, headerNVR(), PackageStruct::next, SpecStruct::packages, and PART_SUBNAME.

Referenced by parseDescription(), parseFiles(), parsePreamble(), and parseScript().

struct OpenFileInfo* newOpenFileInfo (  void    ) 
 

Definition at line 558 of file spec.c.

References OpenFileInfo::fd, OpenFileInfo::fileName, OpenFileInfo::lineNum, OpenFileInfo::next, OpenFileInfo::readBuf, OpenFileInfo::readPtr, and xmalloc().

Referenced by forceIncludeFile(), and parseSpec().

Package newPackage (  Spec    spec ) 
 

Create and initialize package control structure.

Parameters:
spec  spec file control structure
Returns:
package control structure

Definition at line 102 of file spec.c.

References PackageStruct::autoProv, PackageStruct::autoReq, PackageStruct::cpioList, PackageStruct::fileFile, PackageStruct::fileList, PackageStruct::header, headerNew(), PackageStruct::icon, PackageStruct::next, SpecStruct::packages, PackageStruct::postInFile, PackageStruct::postUnFile, PackageStruct::preInFile, PackageStruct::preUnFile, PackageStruct::specialDoc, PackageStruct::triggerFiles, PackageStruct::verifyFile, xcalloc(), and xstrdup().

Referenced by parsePreamble(), and readRPM().

int parseNoSource (  Spec    spec,
const char *    field,
int    tag
) 
 

Parameters:
spec  spec file control structure
field 
tag 

Definition at line 205 of file spec.c.

References _, findSource(), Source::flags, SpecStruct::lineNum, parseNum(), RPMBUILD_ISNO, RPMBUILD_ISPATCH, RPMBUILD_ISSOURCE, RPMERR_BADSPEC, rpmError, RPMTAG_NOSOURCE, SKIPNONWHITE, and SKIPWHITE.

Referenced by handlePreambleTag(), and parseSpec().


Variable Documentation

speclines newSl(void) [static]
 

Definition at line 359 of file spec.c.

Spec newSpec(void)
 

Definition at line 422 of file spec.c.

Referenced by parseSpec(), and readRPM().

spectags newSt(void) [static]
 

Definition at line 391 of file spec.c.


Generated on Sun Feb 2 23:32:07 2003 for rpm by doxygen1.2.18