VirtualBox

Changeset 33463 in vbox for trunk/src


Ignore:
Timestamp:
Oct 26, 2010 12:27:26 PM (14 years ago)
Author:
vboxsync
Message:

isofs.cpp: Use static! RTStrAPrintf fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/isofs.cpp

    r33453 r33463  
    3030*******************************************************************************/
    3131#include <iprt/isofs.h>
     32
     33#include <iprt/file.h>
     34#include <iprt/err.h>
     35#include <iprt/mem.h>
    3236#include <iprt/path.h>
    33 
    34 
    35 /**
    36  * Destroys the patch cache.
     37#include <iprt/string.h>
     38
     39
     40/**
     41 * Destroys the path cache.
    3742 *
    3843 * @param   pFile           ISO handle.
    3944 */
    40 RTR3DECL(void) rtIsoFsDestroyPathCache(PRTISOFSFILE pFile)
     45static void rtIsoFsDestroyPathCache(PRTISOFSFILE pFile)
    4146{
    4247    PRTISOFSPATHTABLEENTRY pNode = RTListNodeGetFirst(&pFile->listPaths, RTISOFSPATHTABLEENTRY, Node);
     
    6974 * @param   pHeader     Path header information to add.
    7075 */
    71 RTR3DECL(int) rtIsoFsAddToPathCache(PRTLISTNODE pList, const char *pszPath,
    72                                     RTISOFSPATHTABLEHEADER *pHeader)
     76static int rtIsoFsAddToPathCache(PRTLISTNODE pList, const char *pszPath,
     77                                 RTISOFSPATHTABLEHEADER *pHeader)
    7378{
    7479    AssertPtrReturn(pList, VERR_INVALID_PARAMETER);
     
    106111 * @param   ppszPath        Pointer to a pointer to store the retrieved full path to.
    107112 */
    108 RTR3DECL(int) rtIsoFsGetParentPathSub(PRTLISTNODE pList, PRTISOFSPATHTABLEENTRY pNode,
    109                                       char *pszPathNode, char **ppszPath)
     113static int rtIsoFsGetParentPathSub(PRTLISTNODE pList, PRTISOFSPATHTABLEENTRY pNode,
     114                                   char *pszPathNode, char **ppszPath)
    110115{
    111116    int rc = VINF_SUCCESS;
     
    119124            pNodeParent =  RTListNodeGetNext(&pNodeParent->Node, RTISOFSPATHTABLEENTRY, Node);
    120125        /* Construct intermediate path (parent + current path). */
    121         char *pszPath;
    122         if (RTStrAPrintf(&pszPath, "%s/%s", pNodeParent->path, pszPathNode))
     126        char *pszPath = RTPathJoinA(pNodeParent->path, pszPathNode);
     127        if (pszPath)
    123128        {
    124129            /* ... and do the same with the parent's parent until we reached the root. */
     
    127132        }
    128133        else
    129             rc = VERR_NO_MEMORY;
     134            rc = VERR_NO_STR_MEMORY;
    130135    }
    131136    else /* No parent (left), this must be the root path then. */
    132     {
    133         char *pszPath = RTStrDup(pszPathNode);
    134         *ppszPath = pszPath;
    135     }
     137        *ppszPath = RTStrDup(pszPathNode);
    136138    return rc;
    137139}
     
    144146 * @param   pFile                   ISO handle.
    145147 */
    146 RTR3DECL(int) rtIsoFsUpdatePathCache(PRTISOFSFILE pFile)
     148static int rtIsoFsUpdatePathCache(PRTISOFSFILE pFile)
    147149{
    148150    AssertPtrReturn(pFile, VERR_INVALID_PARAMETER);
     
    302304 *                                  rtIsoFsFreeDirectoryRecord().
    303305 */
    304 RTR3DECL(int) rtIsoFsFindEntry(PRTISOFSFILE pFile, const char *pszFileName,
    305                                uint32_t uExtentSector, uint32_t cbExtent /* Bytes */,
    306                                PRTISOFSDIRRECORD *ppRec)
     306static int rtIsoFsFindEntry(PRTISOFSFILE pFile, const char *pszFileName,
     307                            uint32_t uExtentSector, uint32_t cbExtent /* Bytes */,
     308                            PRTISOFSDIRRECORD *ppRec)
    307309{
    308310    AssertPtrReturn(pFile, VERR_INVALID_PARAMETER);
     
    398400 * @param   puSector            Pointer where to store the found sector to.
    399401 */
    400 RTR3DECL(int) rtIsoFsResolvePath(PRTISOFSFILE pFile, const char *pszPath, uint32_t *puSector)
     402static int rtIsoFsResolvePath(PRTISOFSFILE pFile, const char *pszPath, uint32_t *puSector)
    401403{
    402404    AssertPtrReturn(pFile, VERR_INVALID_PARAMETER);
     
    447449 * @return  Pointer to the newly allocated directory record.
    448450 */
    449 RTR3DECL(PRTISOFSDIRRECORD) rtIsoFsCreateDirectoryRecord(void)
     451static PRTISOFSDIRRECORD rtIsoFsCreateDirectoryRecord(void)
    450452{
    451453    PRTISOFSDIRRECORD pRecord = (PRTISOFSDIRRECORD)RTMemAlloc(sizeof(RTISOFSDIRRECORD));
     
    459461 * @return  IPRT status code.
    460462 */
    461 RTR3DECL(void) rtIsoFsFreeDirectoryRecord(PRTISOFSDIRRECORD pRecord)
     463static void rtIsoFsFreeDirectoryRecord(PRTISOFSDIRRECORD pRecord)
    462464{
    463465    RTMemFree(pRecord);
     
    475477 *                                  rtIsoFsFreeDirectoryRecord().
    476478 */
    477 RTR3DECL(int) rtIsoFsGetDirectoryRecord(PRTISOFSFILE pFile, const char *pszPath,
    478                                         PRTISOFSDIRRECORD *ppRecord)
     479static int rtIsoFsGetDirectoryRecord(PRTISOFSFILE pFile, const char *pszPath,
     480                                     PRTISOFSDIRRECORD *ppRecord)
    479481{
    480482    AssertPtrReturn(pFile, VERR_INVALID_PARAMETER);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette