The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]

Интерактивная система просмотра системных руководств (man-ов)

 ТемаНаборКатегория 
 
 [Cписок руководств | Печать]

misc.h (3)
  • >> misc.h (3) ( Linux man: Библиотечные вызовы )
  •  

    NAME

    lib/misc.h -  
     
    

    SYNOPSIS


    #include <string.h>
     

    Functions


    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.  

    DETAILED DESCRIPTION

    Definition in file misc.h.  

    FUNCTION DOCUMENTATION

     

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

    Parameters:

    h
    header

    Definition at line 465 of file misc.c.

    References doBuildFileList(), RPMTAG_ORIGBASENAMES, RPMTAG_ORIGDIRINDEXES, and RPMTAG_ORIGDIRNAMES.

    Referenced by psmStage().  

    void compressFilelist (Header h)

    Convert absolute path tag to (dirname,basename,dirindex) tags.

    Parameters:

    h
    header

    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().  

    char* currentDirectory (void)

    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().  

    int domd5 (const char * fn, unsigned char * digest, int asAscii)

    Calculate MD5 sum for file.

    Todo: Eliminate, use beecrypt instead.

    Parameters:

    fn
    file name

    Return values:

    digest
    address of md5sum

    Parameters:

    asAscii
    return md5sum as ascii string?

    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().  

    int doputenv (const char * str)

    Like the libc function, but malloc()'s the space needed.

    Parameters:

    str

    Returns: 0 on success

    Definition at line 98 of file misc.c.

    References xmalloc().

    Referenced by runScript().  

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

    Like the libc function, but malloc()'s the space needed.

    Parameters:

    name
    variable name
    value
    variable value
    overwrite
    should an existing variable be changed?

    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().  

    void expandFilelist (Header h)

    Convert (dirname,basename,dirindex) tags to absolute path tag.

    Parameters:

    h
    header

    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().  

    void freeSplitString (char ** list)

    Free split string argv array.

    Parameters:

    list
    argv array

    Definition at line 59 of file misc.c.

    References _free().

    Referenced by parsePrep(), processPackageFiles(), processSourceFiles(), and skipFiles().  

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

    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:

    prefix
    leading part of temp file path

    Return values:

    fnptr
    temp file name (or NULL)
    fdptr
    temp file handle

    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().  

    int mdbinfile (const char * fn, unsigned char * bindigest) [inline, static]

    Return MD5 sum of file as binary data.

    Todo: Eliminate, use beecrypt instead.

    Parameters:

    fn
    file name

    Return values:

    bindigest
    MD5 digest

    Returns: 0 on success, 1 on error

    Definition at line 177 of file misc.h.

    References domd5().

    Referenced by rpmAddSignature().  

    int mdfile (const char * fn, unsigned char * digest) [inline, static]

    Return MD5 sum of file as ASCII string.

    Todo: Eliminate, use beecrypt instead.

    Parameters:

    fn
    file name

    Return values:

    digest
    MD5 digest

    Returns: 0 on success, 1 on error

    Definition at line 162 of file misc.h.

    References domd5().  

    int myGlobPatternP (const char * patternURL)

    Definition at line 476 of file misc.c.

    References urlPath().

    Referenced by processBinaryFile(), and rpmGlob().  

    void providePackageNVR (Header h)

    Retrofit a Provides: name = version-release dependency into legacy packages.

    Parameters:

    h
    header

    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().  

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

    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().  

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

    Split string into fields separated by a character.

    Parameters:

    str
    string
    length
    length of string
    sep
    separator character

    Returns: (malloc'd) argv array

    Definition at line 23 of file misc.c.

    References xmalloc().

    Referenced by parsePrep(), processPackageFiles(), processSourceFiles(), and skipFiles().  

    char* stripTrailingChar (char * s, char c) [inline, static]

    Remove occurences of trailing character from string.

    Parameters:

    s
    string
    c
    character to strip

    Returns: string

    Definition at line 39 of file misc.h.

    Referenced by readPackageHeaders(), and relocateFileList().  

    AUTHOR

    Generated automatically by Doxygen for rpm from the source code.


     

    Index

    NAME
    SYNOPSIS
    Functions
    DETAILED DESCRIPTION
    FUNCTION DOCUMENTATION
    void buildOrigFileList (Header h, const char *** fileListPtr, int * fileCountPtr)
    void compressFilelist (Header h)
    char* currentDirectory (void)
    int domd5 (const char * fn, unsigned char * digest, int asAscii)
    int doputenv (const char * str)
    int dosetenv (const char * name, const char * value, int overwrite)
    void expandFilelist (Header h)
    void freeSplitString (char ** list)
    int makeTempFile (const char * prefix, const char ** fnptr, FD_t * fdptr)
    int mdbinfile (const char * fn, unsigned char * bindigest) [inline, static]
    int mdfile (const char * fn, unsigned char * digest) [inline, static]
    int myGlobPatternP (const char * patternURL)
    void providePackageNVR (Header h)
    int rpmGlob (const char * patterns, int * argcPtr, const char *** argvPtr)
    char** splitString (const char * str, int length, char sep)
    char* stripTrailingChar (char * s, char c) [inline, static]
    AUTHOR


    Поиск по тексту MAN-ов: 




    Партнёры:
    PostgresPro
    Inferno Solutions
    Hosting by Hoster.ru
    Хостинг:

    Закладки на сайте
    Проследить за страницей
    Created 1996-2024 by Maxim Chirkov
    Добавить, Поддержать, Вебмастеру