lib/misc.h -
#include <string.h>
char ** splitString (const char *str, int length, char sep)
Split string into fields separated by a character.
void freeSplitString (char **list)
Free split string argv array.
char * stripTrailingChar (char *s, char c)
Remove occurences of trailing character from string.
int dosetenv (const char *name, const char *value, int overwrite)
Like the libc function, but malloc()'s the space needed.
int doputenv (const char *str)
Like the libc function, but malloc()'s the space needed.
int makeTempFile (const char *prefix, const char **fnptr, FD_t *fdptr)
Return file handle for a temporaray file.
char * currentDirectory (void)
Return (malloc'd) current working directory.
void compressFilelist (Header h)
Convert absolute path tag to (dirname,basename,dirindex) tags.
void expandFilelist (Header h)
Convert (dirname,basename,dirindex) tags to absolute path tag.
void buildOrigFileList (Header h, const char ***fileListPtr, int *fileCountPtr)
int myGlobPatternP (const char *patternURL)
int rpmGlob (const char *patterns, int *argcPtr, const char ***argvPtr)
void providePackageNVR (Header h)
Retrofit a Provides: name = version-release dependency into legacy packages.
int domd5 (const char *fn, unsigned char *digest, int asAscii)
Calculate MD5 sum for file.
int mdfile (const char *fn, unsigned char *digest)
Return MD5 sum of file as ASCII string.
int mdbinfile (const char *fn, unsigned char *bindigest)
Return MD5 sum of file as binary data.
Parameters:
Definition at line 465 of file misc.c.
References doBuildFileList(), RPMTAG_ORIGBASENAMES, RPMTAG_ORIGDIRINDEXES, and RPMTAG_ORIGDIRNAMES.
Convert absolute path tag to (dirname,basename,dirindex) tags.
Parameters:
Definition at line 298 of file misc.c.
References alloca(), dncmp(), HAE_t, headerIsEntry(), HFD_t, HGE_t, HRE_t, int_32, RPM_INT32_TYPE, RPM_STRING_ARRAY_TYPE, RPMTAG_BASENAMES, RPMTAG_DIRINDEXES, RPMTAG_DIRNAMES, RPMTAG_OLDFILENAMES, and rpmTagType.
Referenced by doGetRecord(), genCpioListAndHeader(), and readPackageHeaders().
Return (malloc'd) current working directory.
Returns: current working directory (malloc'ed)
Definition at line 274 of file misc.c.
References errno, xmalloc(), and xrealloc().
Referenced by rpmRunTransactions().
Calculate MD5 sum for file.
Todo: Eliminate, use beecrypt instead.
Parameters:
Return values:
Parameters:
Returns: 0 on success, 1 on error
Definition at line 791 of file misc.c.
References _free(), Fclose(), fdFiniDigest(), fdInitDigest(), Ferror(), Fopen(), Fread(), and PGPHASHALGO_MD5.
Referenced by decideFileFate(), genCpioListAndHeader(), mdbinfile(), mdfile(), and rpmVerifyFile().
Like the libc function, but malloc()'s the space needed.
Parameters:
Returns: 0 on success
Definition at line 98 of file misc.c.
References xmalloc().
Like the libc function, but malloc()'s the space needed.
Parameters:
Returns: 0 on success
Definition at line 108 of file misc.c.
References getenv(), stpcpy(), and xmalloc().
Referenced by checkPassPhrase(), do_verifyGPGSignature(), makeGPGSignature(), makePGPSignature(), runScript(), and verifyPGPSignature().
Convert (dirname,basename,dirindex) tags to absolute path tag.
Parameters:
Definition at line 436 of file misc.c.
References _free(), doBuildFileList(), HAE_t, headerIsEntry(), HRE_t, RPM_STRING_ARRAY_TYPE, RPMTAG_BASENAMES, RPMTAG_DIRINDEXES, RPMTAG_DIRNAMES, and RPMTAG_OLDFILENAMES.
Referenced by dbiUpdateRecord(), genCpioListAndHeader(), and rpmdbAdd().
Free split string argv array.
Parameters:
Definition at line 59 of file misc.c.
References _free().
Referenced by parsePrep(), processPackageFiles(), processSourceFiles(), and skipFiles().
Return file handle for a temporaray file.
A unique temporaray file path will be generated using rpmGenPath(prefix, '%{_tmppath}/', 'rpm-tmp.XXXXX') where 'XXXXXX' is filled in using rand(3). The file is opened, and the link count and (dev,ino) location are verified after opening. The file name and the open file handle are returned.
Parameters:
Return values:
Returns: 0 on success
Definition at line 170 of file misc.c.
References _, _free(), errno, Fclose(), Ferror(), Fileno(), Fopen(), RPMERR_SCRIPT, rpmError, rpmGenPath(), rpmMkpath(), S_ISLNK, URL_IS_DASH, URL_IS_HTTP, URL_IS_PATH, URL_IS_UNKNOWN, and urlPath().
Referenced by doScript(), generateDepends(), manageFile(), runScript(), verifyGPGSignature(), verifyPGPSignature(), and writeRPM().
Return MD5 sum of file as binary data.
Todo: Eliminate, use beecrypt instead.
Parameters:
Return values:
Returns: 0 on success, 1 on error
Definition at line 177 of file misc.h.
References domd5().
Referenced by rpmAddSignature().
Return MD5 sum of file as ASCII string.
Todo: Eliminate, use beecrypt instead.
Parameters:
Return values:
Returns: 0 on success, 1 on error
Definition at line 162 of file misc.h.
Definition at line 476 of file misc.c.
References urlPath().
Referenced by processBinaryFile(), and rpmGlob().
Retrofit a Provides: name = version-release dependency into legacy packages.
Parameters:
Definition at line 712 of file misc.c.
References alloca(), headerAddOrAppendEntry(), headerNVR(), HFD_t, HGE_t, int_32, RPM_INT32_TYPE, RPM_STRING_ARRAY_TYPE, RPMSENSE_ANY, RPMSENSE_EQUAL, RPMTAG_EPOCH, RPMTAG_PROVIDEFLAGS, RPMTAG_PROVIDENAME, RPMTAG_PROVIDEVERSION, rpmTagType, and stpcpy().
Referenced by doGetRecord(), packageBinaries(), readPackageHeaders(), and writeRPM().
Definition at line 508 of file misc.c.
References _free(), Glob(), glob_error(), Globfree(), myGlobPatternP(), URL_IS_DASH, URL_IS_FTP, URL_IS_HTTP, URL_IS_PATH, URL_IS_UNKNOWN, urlPath(), xmalloc(), xrealloc(), and xstrdup().
Referenced by IDTXglob(), processBinaryFile(), rpmInstall(), rpmQueryVerify(), and rpmReadPackageManifest().
Split string into fields separated by a character.
Parameters:
Returns: (malloc'd) argv array
Definition at line 23 of file misc.c.
References xmalloc().
Referenced by parsePrep(), processPackageFiles(), processSourceFiles(), and skipFiles().
Remove occurences of trailing character from string.
Parameters:
Returns: string
Definition at line 39 of file misc.h.
Referenced by readPackageHeaders(), and relocateFileList().
Generated automatically by Doxygen for rpm from the source code.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |