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

lib/misc.c File Reference

More...

#include "system.h"
#include <rpmlib.h>
#include <rpmurl.h>
#include <rpmmacro.h>
#include "misc.h"
#include "debug.h"

Go to the source code of this file.

Functions

void* _free (const void *this)
 Wrapper to free(3), hides const compilation noise, permit NULL, return NULL. More...

char** splitString (const char *str, int length, char sep)
void freeSplitString (char **list)
int rpmfileexists (const char *urlfn)
int rpmvercmp (const char *a, const char *b)
int doputenv (const char *str)
int dosetenv (const char *name, const char *value, int overwrite)
int rpmMkpath (const char *path, mode_t mode, uid_t uid, gid_t gid)
int makeTempFile (const char *prefix, const char **fnptr, FD_t *fdptr)
char* currentDirectory (void)
int dncmp (const void *a, const void *b)
void compressFilelist (Header h)
void doBuildFileList (Header h, const char ***fileListPtr, int *fileCountPtr, int baseNameTag, int dirNameTag, int dirIndexesTag)
void expandFilelist (Header h)
void rpmBuildFileList (Header h, const char ***fileListPtr, int *fileCountPtr)
 Retrieve file names from header. More...

void buildOrigFileList (Header h, const char ***fileListPtr, int *fileCountPtr)
int myGlobPatternP (const char *patternURL)
int glob_error (const char *foo, int bar)
int rpmGlob (const char *patterns, int *argcPtr, const char ***argvPtr)
int rpmHeaderGetEntry (Header h, int_32 tag, int_32 *type, void **p, int_32 *c)
 Retrieve tag info from header. More...

int rpmPackageGetEntry (void *leadp, Header sigs, Header h, int_32 tag, int_32 *type, void **p, int_32 *c)
 Retrieve tag info from header. More...

void providePackageNVR (Header h)

Variables

int _debug = 0
char* RPMVERSION = VERSION
int _noDirTokens = 0


Detailed Description

Definition in file misc.c.


Function Documentation

void * _free ( const void * this ) [static]
 

Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.

Parameters:
this   memory to free
Return values:
NULL   always

Definition at line 24 of file misc.c.

void buildOrigFileList ( Header h,
const char *** fileListPtr,
int * fileCountPtr )
 

Definition at line 547 of file misc.c.

void compressFilelist ( Header h )
 

Definition at line 396 of file misc.c.

char * currentDirectory ( void )
 

Returns:
cureent working directory (malloc'ed)

Definition at line 372 of file misc.c.

Referenced by rpmRunTransactions().

int dncmp ( const void * a,
const void * b ) [static]
 

Definition at line 389 of file misc.c.

void doBuildFileList ( Header h,
const char *** fileListPtr,
int * fileCountPtr,
int baseNameTag,
int dirNameTag,
int dirIndexesTag ) [static]
 

Definition at line 476 of file misc.c.

Referenced by buildOrigFileList(), expandFilelist(), and rpmBuildFileList().

int doputenv ( const char * str )
 

Definition at line 196 of file misc.c.

int dosetenv ( const char * name,
const char * value,
int overwrite )
 

Definition at line 208 of file misc.c.

void expandFilelist ( Header h )
 

Definition at line 520 of file misc.c.

void freeSplitString ( char ** list )
 

Definition at line 67 of file misc.c.

int glob_error ( const char * foo,
int bar ) [static]
 

Definition at line 585 of file misc.c.

int makeTempFile ( const char * prefix,
const char ** fnptr,
FD_t * fdptr )
 

Definition at line 276 of file misc.c.

int myGlobPatternP ( const char * patternURL )
 

Definition at line 558 of file misc.c.

void providePackageNVR ( Header h )
 

Definition at line 783 of file misc.c.

void rpmBuildFileList ( Header h,
const char *** fileListPtr,
int * fileCountPtr )
 

Retrieve file names from header.

The representation of file names in package headers changed in rpm-4.0. Originally, file names were stored as an array of paths. In rpm-4.0, file names are stored as separate arrays of dirname's and basename's, with a dirname index to associate the correct dirname with each basname. This function is used to retrieve file names independent of how the file names are represented in the package header.

Parameters:
h   header
Return values:
fileListPtr   address of array of file names
fileCountPtr   address of number of files

Definition at line 541 of file misc.c.

int rpmGlob ( const char * patterns,
int * argcPtr,
const char *** argvPtr )
 

Definition at line 590 of file misc.c.

int rpmHeaderGetEntry ( Header h,
int_32 tag,
int_32 * type,
void ** p,
int_32 * c )
 

Retrieve tag info from header.

This is a "dressed" entry to headerGetEntry to do: 1) DIRNAME/BASENAME/DIRINDICES -> FILENAMES tag conversions. 2) i18n lookaside (if enabled).

Parameters:
h   header
tag   tag
Return values:
type   address of tag value data type
p   address of pointer to tag value(s)
c   address of number of values
Returns:
0 on success, 1 on bad magic, 2 on error

Definition at line 698 of file misc.c.

int rpmMkpath ( const char * path,
mode_t mode,
uid_t uid,
gid_t gid ) [static]
 

Definition at line 228 of file misc.c.

Referenced by makeTempFile().

int rpmPackageGetEntry ( void * leadp,
Header sigs,
Header h,
int_32 tag,
int_32 * type,
void ** p,
int_32 * c )
 

Retrieve tag info from header.

Yet Another "dressed" entry to headerGetEntry in order to unify signature/header tag retrieval.

Deprecated:
Signature tags are now duplicated into header when installed.
Todo:
Eliminate from API.
Parameters:
leadp   rpm lead
h   header
sigs   signatures
tag   tag
Return values:
type   address of tag value data type
p   address of pointer to tag value(s)
c   address of number of values
Returns:
0 on success, 1 on bad magic, 2 on error

Definition at line 749 of file misc.c.

int rpmfileexists ( const char * filespec )
 

Definition at line 73 of file misc.c.

int rpmvercmp ( const char * one,
const char * two )
 

Definition at line 106 of file misc.c.

char ** splitString ( const char * str,
int length,
char sep )
 

Definition at line 31 of file misc.c.


Variable Documentation

char * RPMVERSION = VERSION
 

Definition at line 29 of file misc.c.

int _debug = 0 [static]
 

Definition at line 7 of file misc.c.

int _noDirTokens = 0
 

Definition at line 387 of file misc.c.


Generated at Thu Apr 19 15:29:46 2001 for rpm by doxygen1.2.6-20010408 written by Dimitri van Heesch, © 1997-2001