Doxygen annotations.

CVS patchset: 4130
CVS date: 2000/08/27 19:18:25
This commit is contained in:
jbj 2000-08-27 19:18:25 +00:00
parent 918188a90c
commit a131131381
27 changed files with 143 additions and 62 deletions

View File

@ -1,4 +1,5 @@
/** \file build/build.c
/** \ingroup rpmbuild
* \file build/build.c
* Top-level build dispatcher.
*/

View File

@ -1,7 +1,8 @@
#ifndef _H_BUILDIO_
#define _H_BUILDIO_
/** \file build/buildio.h
/** \ingroup rpmbuild
* \file build/buildio.h
* XXX this information will move elsewhere eventually
*/

View File

@ -1,17 +1,13 @@
/** \file build/expression.c
/** \ingroup rpmbuild
* \file build/expression.c
* Simple logical expression parser.
*/
/*
* Simple Expression Parser
* Copyright (C) 1998 Tom Dyas <tdyas@eden.rutgers.edu>
*
* This module implements a basic expression parser with support for
* integer and string datatypes. For ease of programming, we use the
* top-down "recursive descent" method of parsing. While a
* table-driven bottom-up parser might be faster, it does not really
* matter for the expressions we will be parsing.
*
* Copyright (C) 1998 Tom Dyas <tdyas@eden.rutgers.edu>
* This work is provided under the GPL or LGPL at your choice.
*/

View File

@ -1,4 +1,5 @@
/** \file build/files.c
/** \ingroup rpmbuild
* \file build/files.c
* The post-build, pre-packaging file tree walk to assemble the package
* manifest.
*/

View File

@ -1,3 +1,6 @@
/** \ingroup rpmbuild
* \file build/misc.c
*/
#include "system.h"
#include "rpmbuild.h"

View File

@ -1,4 +1,7 @@
/* Modified ftw() -- uses Lstat() instead of stat() */
/** \ingroup rpmbuild
* \file build/myftw.c
* Modified ftw() -- uses Lstat() instead of stat().
*/
/* Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
This file is part of the GNU C Library.

View File

@ -1,7 +1,8 @@
#ifndef _H_MYFTW_
#define _H_MYFTW_
/** \file build/myftw.h
/** \ingroup rpmbuild
* \file build/myftw.h
* Portable ftw(3) using lstat() instead of stat().
*/

View File

@ -1,4 +1,5 @@
/** \file build/names.c
/** \ingroup rpmbuild
* \file build/names.c
* Simple user/group name/id cache (plus hostname and buildtime)
*/

View File

@ -1,4 +1,5 @@
/** \file build/pack.c
/** \ingroup rpmbuild
* \file build/pack.c
* Assemble components of an RPM package.
*/
@ -415,8 +416,10 @@ int writeRPM(Header h, const char *fileName, int type,
archnum = -1;
osnum = -1;
if (Fileno(csa->cpioFdIn) < 0) {
#ifndef DYING
rpmGetArchInfo(NULL, &archnum);
rpmGetOsInfo(NULL, &osnum);
#endif
} else if (csa->lead != NULL) { /* XXX FIXME: exorcize lead/arch/os */
archnum = csa->lead->archnum;
osnum = csa->lead->osnum;

View File

@ -1,4 +1,5 @@
/** \file build/parseBuildInstallClean.c
/** \ingroup rpmbuild
* \file build/parseBuildInstallClean.c
* Parse %build/%install/%clean section from spec file.
*/
#include "system.h"

View File

@ -1,4 +1,5 @@
/** \file build/parseChangelog.c
/** \ingroup rpmbuild
* \file build/parseChangelog.c
* Parse %changelog section from spec file.
*/

View File

@ -1,4 +1,5 @@
/** \file build/parseDescription.c
/** \ingroup rpmbuild
* \file build/parseDescription.c
* Parse %description section from spec file.
*/

View File

@ -1,4 +1,5 @@
/** \file build/parseFiles.c
/** \ingroup rpmbuild
* \file build/parseFiles.c
* Parse %files section from spec file.
*/

View File

@ -1,4 +1,5 @@
/** \file build/parsePreamble.c
/** \ingroup rpmbuild
* \file build/parsePreamble.c
* Parse tags in global section from spec file.
*/
@ -131,11 +132,17 @@ static int isMemberInEntry(Header header, const char *name, int tag)
static int checkForValidArchitectures(Spec spec)
{
#ifndef DYING
const char *arch = NULL;
const char *os = NULL;
rpmGetArchInfo(&arch, NULL);
rpmGetOsInfo(&os, NULL);
#else
const char *arch = rpmExpand("%{_target_cpu}", NULL);
const char *os = rpmExpand("%{_target_os}", NULL);
/* XXX FIXME memory leak here. */
#endif
if (isMemberInEntry(spec->buildRestrictions,
arch, RPMTAG_EXCLUDEARCH) == 1) {

View File

@ -1,4 +1,5 @@
/** \file build/parsePrep.c
/** \ingroup rpmbuild
* \file build/parsePrep.c
* Parse %prep section from spec file.
*/

View File

@ -1,4 +1,5 @@
/** \file build/parseReqs.c
/** \ingroup rpmbuild
* \file build/parseReqs.c
* Parse dependency tag from spec file or from auto-dependency generator.
*/

View File

@ -1,4 +1,5 @@
/** \file build/parseScript.c
/** \ingroup rpmbuild
* \file build/parseScript.c
* Parse install-time script section from spec file.
*/

View File

@ -1,4 +1,5 @@
/** \file build/parseSpec.c
/** \ingroup rpmbuild
* \file build/parseSpec.c
* Top level dispatcher for spec file parsing.
*/
@ -40,7 +41,6 @@ static inline void initParts(struct PartRec *p)
p->len = strlen(p->token);
}
/** */
int isPart(char *line)
{
char c;
@ -91,7 +91,6 @@ static int matchTok(const char *token, const char *line)
return rc;
}
/** */
void handleComments(char *s)
{
SKIPSPACE(s);
@ -168,11 +167,12 @@ static int copyNextLine(Spec spec, OFI_t *ofi, int strip)
/* 1 - EOF */
/* <0 - error */
/** */
int readLine(Spec spec, int strip)
{
#ifdef DYING
const char *arch;
const char *os;
#endif
char *s;
int match;
struct ReadLevelEntry *rl;
@ -229,10 +229,12 @@ retry:
}
}
#ifdef DYING
arch = NULL;
rpmGetArchInfo(&arch, NULL);
os = NULL;
rpmGetOsInfo(&os, NULL);
#endif
/* Copy next file line into the spec line buffer */
if ((rc = copyNextLine(spec, ofi, strip)) != 0)
@ -243,17 +245,25 @@ retry:
match = -1;
if (! strncmp("%ifarch", s, sizeof("%ifarch")-1)) {
const char *arch = rpmExpand("%{_target_cpu}", NULL);
s += 7;
match = matchTok(arch, s);
xfree(arch);
} else if (! strncmp("%ifnarch", s, sizeof("%ifnarch")-1)) {
const char *arch = rpmExpand("%{_target_cpu}", NULL);
s += 8;
match = !matchTok(arch, s);
xfree(arch);
} else if (! strncmp("%ifos", s, sizeof("%ifos")-1)) {
const char *os = rpmExpand("%{_target_os}", NULL);
s += 5;
match = matchTok(os, s);
xfree(os);
} else if (! strncmp("%ifnos", s, sizeof("%ifnos")-1)) {
const char *os = rpmExpand("%{_target_os}", NULL);
s += 6;
match = !matchTok(os, s);
xfree(os);
} else if (! strncmp("%if", s, sizeof("%if")-1)) {
s += 3;
match = parseExpressionBoolean(spec, s);
@ -326,7 +336,6 @@ retry:
return 0;
}
/** */
void closeSpec(Spec spec)
{
OFI_t *ofi;
@ -342,14 +351,15 @@ void closeSpec(Spec spec)
extern int noLang; /* XXX FIXME: pass as arg */
/** */
int parseSpec(Spec *specp, const char *specFile, const char *rootURL,
const char *buildRootURL, int inBuildArch, const char *passPhrase,
char *cookie, int anyarch, int force)
{
int parsePart = PART_PREAMBLE;
int initialPackage = 1;
#ifdef DYING
const char *saveArch;
#endif
Package pkg;
int x, index;
Spec spec;
@ -450,9 +460,13 @@ fprintf(stderr, "*** PS buildRootURL(%s) %p macro set to %s\n", spec->buildRootU
for (x = 0; x < spec->buildArchitectureCount; x++) {
if (rpmMachineScore(RPM_MACHTABLE_BUILDARCH,
spec->buildArchitectures[x])) {
#ifdef DYING
rpmGetMachine(&saveArch, NULL);
saveArch = xstrdup(saveArch);
rpmSetMachine(spec->buildArchitectures[x], NULL);
#else
addMacro(NULL, "_target_cpu", NULL, spec->buildArchitectures[x], RMIL_RPMRC);
#endif
if (parseSpec(&(spec->buildArchitectureSpecs[index]),
specFile, spec->rootURL, buildRootURL, 1,
passPhrase, cookie, anyarch, force)) {
@ -460,8 +474,12 @@ fprintf(stderr, "*** PS buildRootURL(%s) %p macro set to %s\n", spec->buildRootU
freeSpec(spec);
return RPMERR_BADSPEC;
}
#ifdef DYING
rpmSetMachine(saveArch, NULL);
xfree(saveArch);
#else
delMacro(NULL, "_target_cpu");
#endif
index++;
}
}
@ -495,23 +513,29 @@ fprintf(stderr, "*** PS buildRootURL(%s) %p macro set to %s\n", spec->buildRootU
}
/* Check for description in each package and add arch and os */
{ const char *arch = NULL;
const char *os = NULL;
char *myos = NULL;
{
#ifdef DYING
const char *arch = NULL;
const char *os = NULL;
char *myos = NULL;
rpmGetArchInfo(&arch, NULL);
rpmGetOsInfo(&os, NULL);
/*
* XXX Capitalizing the 'L' is needed to insure that old
* XXX os-from-uname (e.g. "Linux") is compatible with the new
* XXX os-from-platform (e.g "linux" from "sparc-*-linux").
* XXX A copy of this string is embedded in headers.
*/
if (!strcmp(os, "linux")) {
rpmGetArchInfo(&arch, NULL);
rpmGetOsInfo(&os, NULL);
/*
* XXX Capitalizing the 'L' is needed to insure that old
* XXX os-from-uname (e.g. "Linux") is compatible with the new
* XXX os-from-platform (e.g "linux" from "sparc-*-linux").
* XXX A copy of this string is embedded in headers.
*/
if (!strcmp(os, "linux")) {
myos = xstrdup(os);
*myos = 'L';
os = myos;
}
}
#else
const char *arch = rpmExpand("%{_target_cpu}", NULL);
const char *os = rpmExpand("%{_target_os}", NULL);
#endif
for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
if (!headerIsEntry(pkg->header, RPMTAG_DESCRIPTION)) {
@ -524,9 +548,14 @@ fprintf(stderr, "*** PS buildRootURL(%s) %p macro set to %s\n", spec->buildRootU
headerAddEntry(pkg->header, RPMTAG_OS, RPM_STRING_TYPE, os, 1);
headerAddEntry(pkg->header, RPMTAG_ARCH, RPM_STRING_TYPE, arch, 1);
}
FREE(myos);
}
#ifdef DYING
FREE(myos);
#else
xfree(arch);
xfree(os);
#endif
}
closeSpec(spec);
*specp = spec;

View File

@ -1,4 +1,5 @@
/** \file build/reqprov.c
/** \ingroup rpmbuild
* \file build/reqprov.c
* Add dependency tags to package header(s).
*/

View File

@ -1,7 +1,8 @@
#ifndef _H_RPMBUILD_
#define _H_RPMBUILD_
/** \file build/rpmbuild.h
/** \ingroup rpmbuild
* \file build/rpmbuild.h
* This is the *only* module users of librpmbuild should need to include.
*/

View File

@ -1,7 +1,8 @@
#ifndef _H_SPEC_
#define _H_SPEC_
/** \file build/rpmspec.h
/** \ingroup rpmbuild
* \file build/rpmspec.h
* The Spec and Package data structures used during build.
*/

View File

@ -1,4 +1,5 @@
/** \file build/spec.c
/** \ingroup rpmbuild
* \file build/spec.c
* Handle spec data structure.
*/

View File

@ -1,7 +1,8 @@
/** \file lib/cpio.c
/** \ingroup payload rpmio
* \file lib/cpio.c
* Handle cpio payloads within rpm packages.
*
* @warning FIXME: We don't translate between cpio and system mode bits! These
* \warning FIXME: We don't translate between cpio and system mode bits! These
* should both be the same, but really odd things are going to happen if
* that's not true!
*/
@ -16,7 +17,7 @@
#define CPIO_CRC_MAGIC "070702"
#define TRAILER "TRAILER!!!"
/**
/** \ingroup payload
* Keeps track of set of all hard linked files in archive.
*/
struct hardLink {
@ -33,7 +34,7 @@ struct hardLink {
enum hardLinkType { HARDLINK_INSTALL=1, HARDLINK_BUILD };
/**
/** \ingroup payload
* Cpio archive header information.
*/
struct cpioCrcPhysicalHeader {
@ -55,7 +56,7 @@ struct cpioCrcPhysicalHeader {
#define PHYS_HDR_SIZE 110 /* don't depend on sizeof(struct) */
/**
/** \ingroup payload
* File name and stat information.
*/
struct cpioHeader {

View File

@ -1,7 +1,8 @@
#ifndef H_CPIO
#define H_CPIO
/** \file lib/cpio.h
/** \ingroup payload
* \file lib/cpio.h
* Structures used to handle cpio payloads within rpm packages.
*
* Warning: Don't think that rpm's cpio implementation behaves just like
@ -17,7 +18,7 @@
#include <rpmio_internal.h>
/**
/** \ingroup payload
* Note: CPIO_CHECK_ERRNO bit is set only if errno is valid. These have to
* be positive numbers or this setting the high bit stuff is a bad idea.
*/
@ -53,7 +54,7 @@
#define CPIO_FOLLOW_SYMLINKS (1 << 4) /* only for building */
#define CPIO_MULTILIB (1 << 31) /* internal, only for building */
/**
/** \ingroup payload
* Defines a single file to be included in a cpio payload.
*/
struct cpioFileMapping {
@ -65,7 +66,7 @@ struct cpioFileMapping {
int mapFlags;
};
/**
/** \ingroup payload
* The first argument passed in a cpio progress callback.
*
* Note: When building the cpio payload, only "file" is filled in.
@ -81,11 +82,11 @@ struct cpioCallbackInfo {
extern "C" {
#endif
/**
/** \ingroup payload
*/
typedef void (*cpioCallback) (struct cpioCallbackInfo * filespec, void * data);
/**
/** \ingroup payload
* The RPM internal equivalent of the command line "cpio -i".
* If no mappings are passed, this installs everything! If one is passed
* it should be sorted according to cpioFileMapCmp() and only files included
@ -108,7 +109,7 @@ int cpioInstallArchive(FD_t cfd, const struct cpioFileMapping * mappings,
/*@out@*/const char ** failedFile)
/*@modifies fileSystem, cfd, *failedFile @*/;
/**
/** \ingroup payload
* The RPM internal equivalent of the command line "cpio -o".
*
* @param cfd file handle
@ -124,7 +125,7 @@ int cpioBuildArchive(FD_t cfd, const struct cpioFileMapping * mappings,
unsigned int * archiveSize, /*@out@*/const char ** failedFile)
/*@modifies fileSystem, cfd, *archiveSize, *failedFile @*/;
/**
/** \ingroup payload
* Compare two cpio file map entries (qsort/bsearch).
* This is designed to be qsort/bsearch compatible.
* @param a 1st map
@ -133,7 +134,7 @@ int cpioBuildArchive(FD_t cfd, const struct cpioFileMapping * mappings,
*/
int cpioFileMapCmp(const void * a, const void * b) /*@*/;
/**
/** \ingroup payload
* Return fornmatted error message on payload handling failure.
*/
/*@observer@*/ const char *cpioStrerror(int rc) /*@*/;

View File

@ -1,5 +1,9 @@
#include "system.h"
/** \ingroup db1
* \file lib/db1.c
*/
static int _debug = 1; /* XXX if < 0 debugging, > 0 unusual error returns */
#include <db1/db.h>
@ -37,6 +41,8 @@ static inline DBTYPE db3_to_dbtype(int dbitype)
/*@notreached@*/ return DB_HASH;
}
/** \ingroup db1
*/
char * db1basename (int rpmtag) {
char * base = NULL;
switch (rpmtag) {
@ -487,6 +493,8 @@ exit:
return rc;
}
/** \ingroup db1
*/
struct _dbiVec db1vec = {
DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
db1open, db1close, db1sync, db1copen, db1cclose, db1cdel, db1cget, db1cput,

View File

@ -1,5 +1,9 @@
#include "system.h"
/** \ingroup db2
* \file lib/db2.c
*/
static int _debug = 1; /* XXX if < 0 debugging, > 0 unusual error returns */
#include <db2/db.h>

View File

@ -1,5 +1,9 @@
#include "system.h"
/** \ingroup db3
* \file lib/db3.c
*/
static int _debug = 1; /* XXX if < 0 debugging, > 0 unusual error returns */
#ifdef __LCLINT__
@ -25,7 +29,9 @@ typedef int int32_t;
struct _dbiIndex db3dbi;
/* Analogue to struct poptOption */
/** \ingroup db3
* Analogue to struct poptOption
*/
struct dbOption {
const char * longName; /* may be NULL */
int argInfo;
@ -36,6 +42,8 @@ struct dbOption {
#define _POPT_SET_BIT (POPT_ARG_VAL|POPT_ARGFLAG_OR)
/*@-immediatetrans@*/
/** \ingroup db3
*/
struct dbOption rdbOptions[] = {
/* XXX DB_CXX_NO_EXCEPTIONS */
{ "xa_create", _POPT_SET_BIT, &db3dbi.dbi_cflags, DB_XA_CREATE },
@ -1168,6 +1176,8 @@ static int db3open(/*@keep@*/ rpmdb rpmdb, int rpmtag, dbiIndex * dbip)
return rc;
}
/** \ingroup db3
*/
struct _dbiVec db3vec = {
DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
db3open, db3close, db3sync, db3copen, db3cclose, db3cdel, db3cget, db3cput,