rpm  5.4.15
Data Structures | Macros | Typedefs | Functions
rpmspec.h File Reference

The Spec and Package data structures used during build. More...

#include <sys/types.h>
#include <rpmtypes.h>
#include <rpmiotypes.h>
#include <rpmevr.h>
#include <rpmfi.h>
#include <rpmcli.h>
#include <rpmtag.h>
#include <rpmio.h>
Include dependency graph for rpmspec.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  TriggerFileEntry
 
struct  Source
 
struct  ReadLevelEntry
 
struct  OpenFileInfo
 
struct  spectag_s
 
struct  spectags_s
 
struct  speclines_s
 
struct  Spec_s
 The structure used to store values parsed from a spec file. More...
 
struct  Package_s
 The structure used to store values for a package. More...
 

Macros

#define RPMBUILD_DEFAULT_LANG   "C"
 
#define freeSpec(_spec)   ((Spec)rpmioFreePoolItem((rpmioItem)(_spec), __FUNCTION__, __FILE__, __LINE__))
 

Typedefs

typedef struct Package_sPackage
 
typedef struct SourceSpecSource
 
typedef struct ReadLevelEntry RLE_t
 
typedef struct OpenFileInfo OFI_t
 
typedef struct spectag_sspectag
 
typedef struct spectags_sspectags
 
typedef struct speclines_sspeclines
 

Functions

Spec freeSpec (Spec spec)
 Destroy a spec file control structure. More...
 
Spec newSpec (void)
 Create and initialize Spec structure. More...
 
int rpmspecQuery (rpmts ts, QVA_t qva, const char *arg)
 Function to query spec file(s). More...
 
struct OpenFileInfonewOpenFileInfo (void)
 
spectag stashSt (Spec spec, Header h, rpmTag tag, const char *lang)
 stashSt. More...
 
int addSource (Spec spec, Package pkg, const char *field, rpmTag tag)
 addSource. More...
 
int parseNoSource (Spec spec, const char *field, rpmTag tag)
 parseNoSource. More...
 
int SpecSourceCount (Spec spec)
 Return the count of source set in specfile. More...
 
SpecSource getSource (Spec spec, int num)
 Return a source control structure. More...
 
const char * specSourceName (SpecSource source)
 Return a ptr to the source file name. More...
 
const char * specFullSourceName (SpecSource source)
 Return a ptr to the full url of the source. More...
 
int specSourceNum (SpecSource source)
 Return the spec or source patch number. More...
 
int specSourceFlags (SpecSource source)
 Return flags set for the source. More...
 
const char * getSourceDir (rpmfileAttrs attr)
 Return the macro directory location from source file flags. More...
 

Detailed Description

The Spec and Package data structures used during build.

Definition in file rpmspec.h.

Macro Definition Documentation

#define freeSpec (   _spec)    ((Spec)rpmioFreePoolItem((rpmioItem)(_spec), __FUNCTION__, __FILE__, __LINE__))

Definition at line 276 of file rpmspec.h.

#define RPMBUILD_DEFAULT_LANG   "C"

Typedef Documentation

typedef struct OpenFileInfo OFI_t
typedef struct Package_s* Package

Definition at line 20 of file rpmspec.h.

typedef struct ReadLevelEntry RLE_t
typedef struct speclines_s * speclines
typedef struct Source* SpecSource

Definition at line 24 of file rpmspec.h.

typedef struct spectag_s * spectag
typedef struct spectags_s * spectags

Function Documentation

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

Destroy a spec file control structure.

Todo:
Rename to specFree.
Parameters
specspec file control structure
Returns
NULL on last dereference

Referenced by _spec_free(), _specQuery(), parseSpec(), spec_dealloc(), and specFini().

SpecSource getSource ( Spec  spec,
int  num 
)

Return a source control structure.

Parameters
specspec file control structure
numthe number of the wanted source (starting from 0)
Returns
a SpecSource structure, NULL if not found

Definition at line 275 of file spec.c.

References i, Source::next, num, and Spec_s::sources.

const char* getSourceDir ( rpmfileAttrs  attr)

Return the macro directory location from source file flags.

Parameters
attrrpmfileAttrs from source
Returns
string containings macros about location, NULL on failure

Definition at line 24 of file build.c.

References _free(), F_OK, RPMFILE_ICON, RPMFILE_PATCH, RPMFILE_SOURCE, and rpmGetPath().

Referenced by addSource(), doRmSource(), doUntar(), initSourceHeader(), and prepFetch().

struct OpenFileInfo* newOpenFileInfo ( void  )
Spec newSpec ( void  )
int parseNoSource ( Spec  spec,
const char *  field,
rpmTag  tag 
)

parseNoSource.

Parameters
specspec file control structure
fieldfield to parse
tagtag
Returns
0 on success

Definition at line 317 of file spec.c.

References _, field, findSource(), Source::flags, Spec_s::lineNum, name, num, parseNum(), RPMFILE_GHOST, RPMFILE_PATCH, RPMFILE_SOURCE, rpmlog(), RPMLOG_ERR, RPMRC_FAIL, RPMRC_OK, RPMTAG_NOSOURCE, SKIPNONWHITE, and SKIPWHITE.

Referenced by handlePreambleTag().

int rpmspecQuery ( rpmts  ts,
QVA_t  qva,
const char *  arg 
)

Function to query spec file(s).

Parameters
tstransaction set
qvaparsed query/verify options
argquery argument
Returns
0 on success, else no. of failures

Definition at line 968 of file spec.c.

References _, _specQuery(), alloca(), rpmQVKArguments_s::qva_showPackage, rpmcliTargets, rpmFreeMacros(), rpmFreeRpmrc(), rpmlog(), RPMLOG_DEBUG, and rpmReadConfigFiles().

Referenced by main().

const char* specFullSourceName ( SpecSource  source)

Return a ptr to the full url of the source.

Parameters
sourceSpecSource control structure
Returns
ptr to url

Definition at line 298 of file spec.c.

References Source::fullSource.

int SpecSourceCount ( Spec  spec)

Return the count of source set in specfile.

Parameters
specspec file control structure
Returns
the count of source

Definition at line 268 of file spec.c.

References Spec_s::numSources.

int specSourceFlags ( SpecSource  source)

Return flags set for the source.

Parameters
sourceSpecSource control structure
Returns
flags

Definition at line 312 of file spec.c.

References Source::flags.

const char* specSourceName ( SpecSource  source)

Return a ptr to the source file name.

Parameters
sourceSpecSource control structure
Returns
ptr to filename

Definition at line 291 of file spec.c.

References Source::source.

int specSourceNum ( SpecSource  source)

Return the spec or source patch number.

Parameters
sourceSpecSource control structure
Returns
the number of the source

Definition at line 305 of file spec.c.

References Source::num.

spectag stashSt ( Spec  spec,
Header  h,
rpmTag  tag,
const char *  lang 
)