VirtualBox

Ignore:
Timestamp:
Nov 8, 2023 12:01:00 PM (16 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
160059
Message:

libs/xpcom: Convert PR_GetEnv/PR_SetEnv to IPRT RTEnv* API, bugref:10545

Location:
trunk/src/libs/xpcom18a4/xpcom/io
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/xpcom/io/SpecialSystemDirectory.cpp

    r101866 r101962  
    4949#include <stdlib.h>
    5050#include <sys/param.h>
    51 #include "prenv.h"
    5251# if defined(XP_MACOSX) && defined(VBOX_WITH_NEWER_OSX_SDK)
    5352# include <Folders.h>
     
    5554
    5655#endif
     56
     57#include <iprt/env.h>
    5758
    5859NS_COM void StartupSpecialSystemDirectory()
     
    8586            static const char *tPath = nsnull;
    8687            if (!tPath) {
    87                 tPath = PR_GetEnv("TMPDIR");
     88                tPath = RTEnvGet("TMPDIR");
    8889                if (!tPath || !*tPath) {
    89                     tPath = PR_GetEnv("TMP");
     90                    tPath = RTEnvGet("TMP");
    9091                    if (!tPath || !*tPath) {
    91                         tPath = PR_GetEnv("TEMP");
     92                        tPath = RTEnvGet("TEMP");
    9293                        if (!tPath || !*tPath) {
    9394                            tPath = "/tmp/";
     
    115116
    116117        case Unix_HomeDirectory:
    117             return NS_NewNativeLocalFile(nsDependentCString(PR_GetEnv("HOME")),
     118            return NS_NewNativeLocalFile(nsDependentCString(RTEnvGet("HOME")),
    118119                                             PR_TRUE,
    119120                                             aFile);
  • trunk/src/libs/xpcom18a4/xpcom/io/nsAppFileLocationProvider.cpp

    r87254 r101962  
    4646#include "nsXPIDLString.h"
    4747#include "nsISimpleEnumerator.h"
    48 #include "prenv.h"
    4948#include "nsCRT.h"
    5049
     
    7271#endif
    7372
     73#include <iprt/env.h>
    7474
    7575// WARNING: These hard coded names need to go away. They need to
     
    251251        NS_ERROR("Don't use nsAppFileLocationProvider::GetFile(NS_ENV_PLUGINS_DIR, ...). "
    252252                 "Use nsAppFileLocationProvider::GetFiles(...).");
    253         const char *pathVar = PR_GetEnv("VBOX_XPCOM_PLUGIN_PATH");
     253        const char *pathVar = RTEnvGet("VBOX_XPCOM_PLUGIN_PATH");
    254254        if (pathVar)
    255255            rv = NS_NewNativeLocalFile(nsDependentCString(pathVar), PR_TRUE, getter_AddRefs(localFile));
     
    380380    if (NS_FAILED(rv)) return rv;
    381381#elif defined(XP_UNIX)
    382     rv = NS_NewNativeLocalFile(nsDependentCString(PR_GetEnv("HOME")), PR_TRUE, getter_AddRefs(localDir));
     382    rv = NS_NewNativeLocalFile(nsDependentCString(RTEnvGet("HOME")), PR_TRUE, getter_AddRefs(localDir));
    383383    if (NS_FAILED(rv)) return rv;
    384384#elif defined(XP_BEOS)
     
    596596#else
    597597        static const char* keys[] = { nsnull, NS_APP_PLUGINS_DIR, nsnull };
    598         if (!keys[0] && !(keys[0] = PR_GetEnv("VBOX_XPCOM_PLUGIN_PATH"))) {
     598        if (!keys[0] && !(keys[0] = RTEnvGet("VBOX_XPCOM_PLUGIN_PATH"))) {
    599599            static const char nullstr = 0;
    600600            keys[0] = &nullstr;
  • trunk/src/libs/xpcom18a4/xpcom/io/nsDirectoryService.cpp

    r101866 r101962  
    4949#include <sys/param.h>
    5050#include <dlfcn.h>
    51 #include "prenv.h"
    5251#ifdef XP_MACOSX
    5352#include <CoreServices/CoreServices.h>
     
    6362#endif
    6463#endif
     64
     65#include <iprt/env.h>
    6566
    6667#include "SpecialSystemDirectory.h"
     
    173174    // we only do this if it is not already set.
    174175#ifdef MOZ_DEFAULT_VBOX_XPCOM_HOME
    175     if (PR_GetEnv("VBOX_XPCOM_HOME") == nsnull)
    176         PR_SetEnv("VBOX_XPCOM_HOME=" MOZ_DEFAULT_VBOX_XPCOM_HOME);
     176    if (RTEnvGet("VBOX_XPCOM_HOME") == nsnull)
     177        RTEnvPut("VBOX_XPCOM_HOME=" MOZ_DEFAULT_VBOX_XPCOM_HOME);
    177178#endif
    178179
    179     char *moz5 = PR_GetEnv("VBOX_XPCOM_HOME");
     180    const char *moz5 = RTEnvGet("VBOX_XPCOM_HOME");
    180181
    181182    if (moz5)
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