2014-05-05 10:30:43 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include "nsAppFileLocationProvider.h"
|
|
|
|
#include "nsAppDirectoryServiceDefs.h"
|
|
|
|
#include "nsDirectoryServiceDefs.h"
|
|
|
|
#include "nsIAtom.h"
|
2012-06-05 19:08:30 -07:00
|
|
|
#include "nsIFile.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsString.h"
|
|
|
|
#include "nsXPIDLString.h"
|
|
|
|
#include "nsISimpleEnumerator.h"
|
|
|
|
#include "prenv.h"
|
|
|
|
#include "nsCRT.h"
|
|
|
|
|
2010-04-27 05:57:34 -07:00
|
|
|
#if defined(MOZ_WIDGET_COCOA)
|
2009-03-19 10:41:13 -07:00
|
|
|
#include <Carbon/Carbon.h>
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsILocalFileMac.h"
|
|
|
|
#elif defined(XP_WIN)
|
|
|
|
#include <windows.h>
|
|
|
|
#include <shlobj.h>
|
|
|
|
#elif defined(XP_UNIX)
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <sys/param.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// WARNING: These hard coded names need to go away. They need to
|
|
|
|
// come from localizable resources
|
|
|
|
|
2010-04-27 05:57:34 -07:00
|
|
|
#if defined(MOZ_WIDGET_COCOA)
|
2007-03-22 10:30:00 -07:00
|
|
|
#define APP_REGISTRY_NAME NS_LITERAL_CSTRING("Application Registry")
|
|
|
|
#define ESSENTIAL_FILES NS_LITERAL_CSTRING("Essential Files")
|
2014-02-10 14:57:01 -08:00
|
|
|
#elif defined(XP_WIN)
|
2007-03-22 10:30:00 -07:00
|
|
|
#define APP_REGISTRY_NAME NS_LITERAL_CSTRING("registry.dat")
|
|
|
|
#else
|
|
|
|
#define APP_REGISTRY_NAME NS_LITERAL_CSTRING("appreg")
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// define default product directory
|
|
|
|
#define DEFAULT_PRODUCT_DIR NS_LITERAL_CSTRING(MOZ_USER_DIR)
|
|
|
|
|
|
|
|
// Locally defined keys used by nsAppDirectoryEnumerator
|
|
|
|
#define NS_ENV_PLUGINS_DIR "EnvPlugins" // env var MOZ_PLUGIN_PATH
|
|
|
|
#define NS_USER_PLUGINS_DIR "UserPlugins"
|
|
|
|
|
2010-04-27 05:57:34 -07:00
|
|
|
#ifdef MOZ_WIDGET_COCOA
|
2007-03-22 10:30:00 -07:00
|
|
|
#define NS_MACOSX_USER_PLUGIN_DIR "OSXUserPlugins"
|
|
|
|
#define NS_MACOSX_LOCAL_PLUGIN_DIR "OSXLocalPlugins"
|
2009-09-08 14:22:49 -07:00
|
|
|
#define NS_MACOSX_JAVA2_PLUGIN_DIR "OSXJavaPlugins"
|
2008-10-10 08:54:33 -07:00
|
|
|
#elif XP_UNIX
|
|
|
|
#define NS_SYSTEM_PLUGINS_DIR "SysPlugins"
|
2007-03-22 10:30:00 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define DEFAULTS_DIR_NAME NS_LITERAL_CSTRING("defaults")
|
|
|
|
#define DEFAULTS_PREF_DIR_NAME NS_LITERAL_CSTRING("pref")
|
|
|
|
#define DEFAULTS_PROFILE_DIR_NAME NS_LITERAL_CSTRING("profile")
|
|
|
|
#define RES_DIR_NAME NS_LITERAL_CSTRING("res")
|
|
|
|
#define CHROME_DIR_NAME NS_LITERAL_CSTRING("chrome")
|
|
|
|
#define PLUGINS_DIR_NAME NS_LITERAL_CSTRING("plugins")
|
|
|
|
#define SEARCH_DIR_NAME NS_LITERAL_CSTRING("searchplugins")
|
|
|
|
|
|
|
|
//*****************************************************************************
|
|
|
|
// nsAppFileLocationProvider::Constructor/Destructor
|
|
|
|
//*****************************************************************************
|
|
|
|
|
|
|
|
nsAppFileLocationProvider::nsAppFileLocationProvider()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//*****************************************************************************
|
|
|
|
// nsAppFileLocationProvider::nsISupports
|
|
|
|
//*****************************************************************************
|
|
|
|
|
2014-05-14 13:15:46 -07:00
|
|
|
NS_IMPL_ISUPPORTS(nsAppFileLocationProvider,
|
|
|
|
nsIDirectoryServiceProvider,
|
|
|
|
nsIDirectoryServiceProvider2)
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
//*****************************************************************************
|
|
|
|
// nsAppFileLocationProvider::nsIDirectoryServiceProvider
|
|
|
|
//*****************************************************************************
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2014-05-14 13:15:46 -07:00
|
|
|
nsAppFileLocationProvider::GetFile(const char* aProp, bool* aPersistent,
|
|
|
|
nsIFile** aResult)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_WARN_IF(!aProp)) {
|
2014-05-05 10:30:43 -07:00
|
|
|
return NS_ERROR_INVALID_ARG;
|
2014-05-14 13:15:46 -07:00
|
|
|
}
|
2013-11-19 13:27:37 -08:00
|
|
|
|
2014-05-05 10:30:43 -07:00
|
|
|
nsCOMPtr<nsIFile> localFile;
|
|
|
|
nsresult rv = NS_ERROR_FAILURE;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-05-14 13:15:46 -07:00
|
|
|
*aResult = nullptr;
|
|
|
|
*aPersistent = true;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-04-27 05:57:34 -07:00
|
|
|
#ifdef MOZ_WIDGET_COCOA
|
2014-05-05 10:30:43 -07:00
|
|
|
FSRef fileRef;
|
|
|
|
nsCOMPtr<nsILocalFileMac> macFile;
|
2007-03-22 10:30:00 -07:00
|
|
|
#endif
|
2014-05-05 10:30:43 -07:00
|
|
|
|
2014-05-14 13:15:46 -07:00
|
|
|
if (nsCRT::strcmp(aProp, NS_APP_APPLICATION_REGISTRY_DIR) == 0) {
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = GetProductDirectory(getter_AddRefs(localFile));
|
2014-05-14 13:15:46 -07:00
|
|
|
} else if (nsCRT::strcmp(aProp, NS_APP_APPLICATION_REGISTRY_FILE) == 0) {
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = GetProductDirectory(getter_AddRefs(localFile));
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_SUCCEEDED(rv)) {
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = localFile->AppendNative(APP_REGISTRY_NAME);
|
2014-05-14 13:15:46 -07:00
|
|
|
}
|
|
|
|
} else if (nsCRT::strcmp(aProp, NS_APP_DEFAULTS_50_DIR) == 0) {
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = CloneMozBinDirectory(getter_AddRefs(localFile));
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_SUCCEEDED(rv)) {
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = localFile->AppendRelativeNativePath(DEFAULTS_DIR_NAME);
|
2014-05-14 13:15:46 -07:00
|
|
|
}
|
|
|
|
} else if (nsCRT::strcmp(aProp, NS_APP_PREF_DEFAULTS_50_DIR) == 0) {
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = CloneMozBinDirectory(getter_AddRefs(localFile));
|
|
|
|
if (NS_SUCCEEDED(rv)) {
|
|
|
|
rv = localFile->AppendRelativeNativePath(DEFAULTS_DIR_NAME);
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_SUCCEEDED(rv)) {
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = localFile->AppendRelativeNativePath(DEFAULTS_PREF_DIR_NAME);
|
2014-05-14 13:15:46 -07:00
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
2014-05-14 13:15:46 -07:00
|
|
|
} else if (nsCRT::strcmp(aProp, NS_APP_PROFILE_DEFAULTS_50_DIR) == 0 ||
|
|
|
|
nsCRT::strcmp(aProp, NS_APP_PROFILE_DEFAULTS_NLOC_50_DIR) == 0) {
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = CloneMozBinDirectory(getter_AddRefs(localFile));
|
|
|
|
if (NS_SUCCEEDED(rv)) {
|
|
|
|
rv = localFile->AppendRelativeNativePath(DEFAULTS_DIR_NAME);
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_SUCCEEDED(rv)) {
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = localFile->AppendRelativeNativePath(DEFAULTS_PROFILE_DIR_NAME);
|
2014-05-14 13:15:46 -07:00
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
2014-05-14 13:15:46 -07:00
|
|
|
} else if (nsCRT::strcmp(aProp, NS_APP_USER_PROFILES_ROOT_DIR) == 0) {
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = GetDefaultUserProfileRoot(getter_AddRefs(localFile));
|
2014-05-14 13:15:46 -07:00
|
|
|
} else if (nsCRT::strcmp(aProp, NS_APP_USER_PROFILES_LOCAL_ROOT_DIR) == 0) {
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = GetDefaultUserProfileRoot(getter_AddRefs(localFile), true);
|
2014-05-14 13:15:46 -07:00
|
|
|
} else if (nsCRT::strcmp(aProp, NS_APP_RES_DIR) == 0) {
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = CloneMozBinDirectory(getter_AddRefs(localFile));
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_SUCCEEDED(rv)) {
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = localFile->AppendRelativeNativePath(RES_DIR_NAME);
|
2014-05-14 13:15:46 -07:00
|
|
|
}
|
|
|
|
} else if (nsCRT::strcmp(aProp, NS_APP_CHROME_DIR) == 0) {
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = CloneMozBinDirectory(getter_AddRefs(localFile));
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_SUCCEEDED(rv)) {
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = localFile->AppendRelativeNativePath(CHROME_DIR_NAME);
|
2014-05-14 13:15:46 -07:00
|
|
|
}
|
|
|
|
} else if (nsCRT::strcmp(aProp, NS_APP_PLUGINS_DIR) == 0) {
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = CloneMozBinDirectory(getter_AddRefs(localFile));
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_SUCCEEDED(rv)) {
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = localFile->AppendRelativeNativePath(PLUGINS_DIR_NAME);
|
2014-05-14 13:15:46 -07:00
|
|
|
}
|
2014-05-05 10:30:43 -07:00
|
|
|
}
|
2010-04-27 05:57:34 -07:00
|
|
|
#ifdef MOZ_WIDGET_COCOA
|
2014-05-14 13:15:46 -07:00
|
|
|
else if (nsCRT::strcmp(aProp, NS_MACOSX_USER_PLUGIN_DIR) == 0) {
|
2014-05-05 10:30:43 -07:00
|
|
|
if (::FSFindFolder(kUserDomain, kInternetPlugInFolderType, false, &fileRef) == noErr) {
|
|
|
|
rv = NS_NewLocalFileWithFSRef(&fileRef, true, getter_AddRefs(macFile));
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_SUCCEEDED(rv)) {
|
2014-05-05 10:30:43 -07:00
|
|
|
localFile = macFile;
|
2014-05-14 13:15:46 -07:00
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
2014-05-14 13:15:46 -07:00
|
|
|
} else if (nsCRT::strcmp(aProp, NS_MACOSX_LOCAL_PLUGIN_DIR) == 0) {
|
2014-05-05 10:30:43 -07:00
|
|
|
if (::FSFindFolder(kLocalDomain, kInternetPlugInFolderType, false, &fileRef) == noErr) {
|
|
|
|
rv = NS_NewLocalFileWithFSRef(&fileRef, true, getter_AddRefs(macFile));
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_SUCCEEDED(rv)) {
|
2014-05-05 10:30:43 -07:00
|
|
|
localFile = macFile;
|
2014-05-14 13:15:46 -07:00
|
|
|
}
|
2009-09-08 14:22:49 -07:00
|
|
|
}
|
2014-05-14 13:15:46 -07:00
|
|
|
} else if (nsCRT::strcmp(aProp, NS_MACOSX_JAVA2_PLUGIN_DIR) == 0) {
|
|
|
|
static const char* const java2PluginDirPath =
|
2014-05-05 10:30:43 -07:00
|
|
|
"/System/Library/Java/Support/Deploy.bundle/Contents/Resources/";
|
|
|
|
rv = NS_NewNativeLocalFile(nsDependentCString(java2PluginDirPath), true, getter_AddRefs(localFile));
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
#else
|
2014-05-14 13:15:46 -07:00
|
|
|
else if (nsCRT::strcmp(aProp, NS_ENV_PLUGINS_DIR) == 0) {
|
2014-05-05 10:30:43 -07:00
|
|
|
NS_ERROR("Don't use nsAppFileLocationProvider::GetFile(NS_ENV_PLUGINS_DIR, ...). "
|
|
|
|
"Use nsAppFileLocationProvider::GetFiles(...).");
|
2014-05-14 13:15:46 -07:00
|
|
|
const char* pathVar = PR_GetEnv("MOZ_PLUGIN_PATH");
|
2014-05-05 10:30:43 -07:00
|
|
|
if (pathVar && *pathVar)
|
|
|
|
rv = NS_NewNativeLocalFile(nsDependentCString(pathVar), true,
|
|
|
|
getter_AddRefs(localFile));
|
2014-05-14 13:15:46 -07:00
|
|
|
} else if (nsCRT::strcmp(aProp, NS_USER_PLUGINS_DIR) == 0) {
|
2010-07-23 11:00:16 -07:00
|
|
|
#ifdef ENABLE_SYSTEM_EXTENSION_DIRS
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = GetProductDirectory(getter_AddRefs(localFile));
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_SUCCEEDED(rv)) {
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = localFile->AppendRelativeNativePath(PLUGINS_DIR_NAME);
|
2014-05-14 13:15:46 -07:00
|
|
|
}
|
2010-07-23 11:00:16 -07:00
|
|
|
#else
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = NS_ERROR_FAILURE;
|
2010-07-23 11:00:16 -07:00
|
|
|
#endif
|
2014-05-05 10:30:43 -07:00
|
|
|
}
|
2008-10-10 08:54:33 -07:00
|
|
|
#ifdef XP_UNIX
|
2014-05-14 13:15:46 -07:00
|
|
|
else if (nsCRT::strcmp(aProp, NS_SYSTEM_PLUGINS_DIR) == 0) {
|
2010-07-23 11:00:16 -07:00
|
|
|
#ifdef ENABLE_SYSTEM_EXTENSION_DIRS
|
2014-05-14 13:15:46 -07:00
|
|
|
static const char* const sysLPlgDir =
|
2009-06-24 00:21:43 -07:00
|
|
|
#if defined(HAVE_USR_LIB64_DIR) && defined(__LP64__)
|
2014-05-05 10:30:43 -07:00
|
|
|
"/usr/lib64/mozilla/plugins";
|
2012-11-14 11:02:07 -08:00
|
|
|
#elif defined(__OpenBSD__) || defined (__FreeBSD__)
|
2014-05-05 10:30:43 -07:00
|
|
|
"/usr/local/lib/mozilla/plugins";
|
2009-06-24 00:21:43 -07:00
|
|
|
#else
|
2014-05-05 10:30:43 -07:00
|
|
|
"/usr/lib/mozilla/plugins";
|
2009-06-24 00:21:43 -07:00
|
|
|
#endif
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = NS_NewNativeLocalFile(nsDependentCString(sysLPlgDir),
|
|
|
|
false, getter_AddRefs(localFile));
|
2010-07-23 11:00:16 -07:00
|
|
|
#else
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = NS_ERROR_FAILURE;
|
2010-07-23 11:00:16 -07:00
|
|
|
#endif
|
2014-05-05 10:30:43 -07:00
|
|
|
}
|
2008-10-10 08:54:33 -07:00
|
|
|
#endif
|
2007-03-22 10:30:00 -07:00
|
|
|
#endif
|
2014-05-14 13:15:46 -07:00
|
|
|
else if (nsCRT::strcmp(aProp, NS_APP_SEARCH_DIR) == 0) {
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = CloneMozBinDirectory(getter_AddRefs(localFile));
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_SUCCEEDED(rv)) {
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = localFile->AppendRelativeNativePath(SEARCH_DIR_NAME);
|
2014-05-14 13:15:46 -07:00
|
|
|
}
|
|
|
|
} else if (nsCRT::strcmp(aProp, NS_APP_USER_SEARCH_DIR) == 0) {
|
|
|
|
rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, aResult);
|
|
|
|
if (NS_SUCCEEDED(rv)) {
|
|
|
|
rv = (*aResult)->AppendNative(SEARCH_DIR_NAME);
|
|
|
|
}
|
|
|
|
} else if (nsCRT::strcmp(aProp, NS_APP_INSTALL_CLEANUP_DIR) == 0) {
|
2014-05-05 10:30:43 -07:00
|
|
|
// This is cloned so that embeddors will have a hook to override
|
|
|
|
// with their own cleanup dir. See bugzilla bug #105087
|
|
|
|
rv = CloneMozBinDirectory(getter_AddRefs(localFile));
|
|
|
|
}
|
|
|
|
|
2014-05-14 13:15:46 -07:00
|
|
|
if (localFile && NS_SUCCEEDED(rv)) {
|
|
|
|
return localFile->QueryInterface(NS_GET_IID(nsIFile), (void**)aResult);
|
|
|
|
}
|
2014-05-05 10:30:43 -07:00
|
|
|
|
|
|
|
return rv;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-05-14 13:15:46 -07:00
|
|
|
NS_METHOD
|
|
|
|
nsAppFileLocationProvider::CloneMozBinDirectory(nsIFile** aLocalFile)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_WARN_IF(!aLocalFile)) {
|
2014-05-05 10:30:43 -07:00
|
|
|
return NS_ERROR_INVALID_ARG;
|
2014-05-14 13:15:46 -07:00
|
|
|
}
|
2014-05-05 10:30:43 -07:00
|
|
|
nsresult rv;
|
|
|
|
|
2014-05-14 13:15:46 -07:00
|
|
|
if (!mMozBinDirectory) {
|
2014-05-05 10:30:43 -07:00
|
|
|
// Get the mozilla bin directory
|
|
|
|
// 1. Check the directory service first for NS_XPCOM_CURRENT_PROCESS_DIR
|
|
|
|
// This will be set if a directory was passed to NS_InitXPCOM
|
|
|
|
// 2. If that doesn't work, set it to be the current process directory
|
|
|
|
nsCOMPtr<nsIProperties>
|
|
|
|
directoryService(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv));
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_FAILED(rv)) {
|
2014-05-05 10:30:43 -07:00
|
|
|
return rv;
|
2014-05-14 13:15:46 -07:00
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-05-14 13:15:46 -07:00
|
|
|
rv = directoryService->Get(NS_XPCOM_CURRENT_PROCESS_DIR, NS_GET_IID(nsIFile),
|
|
|
|
getter_AddRefs(mMozBinDirectory));
|
2014-05-05 10:30:43 -07:00
|
|
|
if (NS_FAILED(rv)) {
|
2014-05-14 13:15:46 -07:00
|
|
|
rv = directoryService->Get(NS_OS_CURRENT_PROCESS_DIR, NS_GET_IID(nsIFile),
|
|
|
|
getter_AddRefs(mMozBinDirectory));
|
|
|
|
if (NS_FAILED(rv)) {
|
2014-05-05 10:30:43 -07:00
|
|
|
return rv;
|
2014-05-14 13:15:46 -07:00
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
2014-05-05 10:30:43 -07:00
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-05-05 10:30:43 -07:00
|
|
|
nsCOMPtr<nsIFile> aFile;
|
|
|
|
rv = mMozBinDirectory->Clone(getter_AddRefs(aFile));
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_FAILED(rv)) {
|
2014-05-05 10:30:43 -07:00
|
|
|
return rv;
|
2014-05-14 13:15:46 -07:00
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-05-05 10:30:43 -07:00
|
|
|
NS_IF_ADDREF(*aLocalFile = aFile);
|
|
|
|
return NS_OK;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------------------
|
|
|
|
// GetProductDirectory - Gets the directory which contains the application data folder
|
|
|
|
//
|
|
|
|
// UNIX : ~/.mozilla/
|
|
|
|
// WIN : <Application Data folder on user's machine>\Mozilla
|
|
|
|
// Mac : :Documents:Mozilla:
|
|
|
|
//----------------------------------------------------------------------------------------
|
2014-05-14 13:15:46 -07:00
|
|
|
NS_METHOD
|
|
|
|
nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
|
|
|
|
bool aLocal)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_WARN_IF(!aLocalFile)) {
|
2014-05-05 10:30:43 -07:00
|
|
|
return NS_ERROR_INVALID_ARG;
|
2014-05-14 13:15:46 -07:00
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-05-05 10:30:43 -07:00
|
|
|
nsresult rv;
|
|
|
|
bool exists;
|
|
|
|
nsCOMPtr<nsIFile> localDir;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-04-27 05:57:34 -07:00
|
|
|
#if defined(MOZ_WIDGET_COCOA)
|
2014-05-05 10:30:43 -07:00
|
|
|
FSRef fsRef;
|
|
|
|
OSType folderType = aLocal ? (OSType) kCachedDataFolderType : (OSType) kDomainLibraryFolderType;
|
|
|
|
OSErr err = ::FSFindFolder(kUserDomain, folderType, kCreateFolder, &fsRef);
|
2014-05-14 13:15:46 -07:00
|
|
|
if (err) {
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
2014-05-05 10:30:43 -07:00
|
|
|
NS_NewLocalFile(EmptyString(), true, getter_AddRefs(localDir));
|
2014-05-14 13:15:46 -07:00
|
|
|
if (!localDir) {
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
2014-05-05 10:30:43 -07:00
|
|
|
nsCOMPtr<nsILocalFileMac> localDirMac(do_QueryInterface(localDir));
|
|
|
|
rv = localDirMac->InitWithFSRef(&fsRef);
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
return rv;
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
#elif defined(XP_WIN)
|
2014-05-05 10:30:43 -07:00
|
|
|
nsCOMPtr<nsIProperties> directoryService =
|
|
|
|
do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
return rv;
|
|
|
|
}
|
2014-05-05 10:30:43 -07:00
|
|
|
const char* prop = aLocal ? NS_WIN_LOCAL_APPDATA_DIR : NS_WIN_APPDATA_DIR;
|
|
|
|
rv = directoryService->Get(prop, NS_GET_IID(nsIFile), getter_AddRefs(localDir));
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
return rv;
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
#elif defined(XP_UNIX)
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = NS_NewNativeLocalFile(nsDependentCString(PR_GetEnv("HOME")), true, getter_AddRefs(localDir));
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
return rv;
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
#else
|
|
|
|
#error dont_know_how_to_get_product_dir_on_your_platform
|
|
|
|
#endif
|
|
|
|
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = localDir->AppendRelativeNativePath(DEFAULT_PRODUCT_DIR);
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
return rv;
|
|
|
|
}
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = localDir->Exists(&exists);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_SUCCEEDED(rv) && !exists) {
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = localDir->Create(nsIFile::DIRECTORY_TYPE, 0700);
|
2014-05-14 13:15:46 -07:00
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
return rv;
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-05-05 10:30:43 -07:00
|
|
|
*aLocalFile = localDir;
|
|
|
|
NS_ADDREF(*aLocalFile);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-05-05 10:30:43 -07:00
|
|
|
return rv;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------------------
|
|
|
|
// GetDefaultUserProfileRoot - Gets the directory which contains each user profile dir
|
|
|
|
//
|
|
|
|
// UNIX : ~/.mozilla/
|
|
|
|
// WIN : <Application Data folder on user's machine>\Mozilla\Profiles
|
|
|
|
// Mac : :Documents:Mozilla:Profiles:
|
|
|
|
//----------------------------------------------------------------------------------------
|
2014-05-14 13:15:46 -07:00
|
|
|
NS_METHOD
|
|
|
|
nsAppFileLocationProvider::GetDefaultUserProfileRoot(nsIFile** aLocalFile,
|
|
|
|
bool aLocal)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_WARN_IF(!aLocalFile)) {
|
2014-05-05 10:30:43 -07:00
|
|
|
return NS_ERROR_INVALID_ARG;
|
2014-05-14 13:15:46 -07:00
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-05-05 10:30:43 -07:00
|
|
|
nsresult rv;
|
|
|
|
nsCOMPtr<nsIFile> localDir;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = GetProductDirectory(getter_AddRefs(localDir), aLocal);
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
return rv;
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-02-10 14:57:01 -08:00
|
|
|
#if defined(MOZ_WIDGET_COCOA) || defined(XP_WIN)
|
2014-05-05 10:30:43 -07:00
|
|
|
// These 3 platforms share this part of the path - do them as one
|
|
|
|
rv = localDir->AppendRelativeNativePath(NS_LITERAL_CSTRING("Profiles"));
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
return rv;
|
|
|
|
}
|
2014-05-05 10:30:43 -07:00
|
|
|
|
|
|
|
bool exists;
|
|
|
|
rv = localDir->Exists(&exists);
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_SUCCEEDED(rv) && !exists) {
|
2014-05-05 10:30:43 -07:00
|
|
|
rv = localDir->Create(nsIFile::DIRECTORY_TYPE, 0775);
|
2014-05-14 13:15:46 -07:00
|
|
|
}
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
return rv;
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
#endif
|
|
|
|
|
2014-05-05 10:30:43 -07:00
|
|
|
*aLocalFile = localDir;
|
|
|
|
NS_ADDREF(*aLocalFile);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-05-05 10:30:43 -07:00
|
|
|
return rv;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
//*****************************************************************************
|
|
|
|
// nsAppFileLocationProvider::nsIDirectoryServiceProvider2
|
|
|
|
//*****************************************************************************
|
|
|
|
|
|
|
|
class nsAppDirectoryEnumerator : public nsISimpleEnumerator
|
|
|
|
{
|
2014-05-05 10:30:43 -07:00
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
/**
|
|
|
|
* aKeyList is a null-terminated list of properties which are provided by aProvider
|
|
|
|
* They do not need to be publicly defined keys.
|
|
|
|
*/
|
2014-05-14 13:15:46 -07:00
|
|
|
nsAppDirectoryEnumerator(nsIDirectoryServiceProvider* aProvider,
|
2014-05-05 10:30:43 -07:00
|
|
|
const char* aKeyList[]) :
|
|
|
|
mProvider(aProvider),
|
|
|
|
mCurrentKey(aKeyList)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-05-14 13:15:46 -07:00
|
|
|
NS_IMETHOD HasMoreElements(bool* aResult)
|
2014-05-05 10:30:43 -07:00
|
|
|
{
|
2014-05-14 13:15:46 -07:00
|
|
|
while (!mNext && *mCurrentKey) {
|
2014-05-05 10:30:43 -07:00
|
|
|
bool dontCare;
|
|
|
|
nsCOMPtr<nsIFile> testFile;
|
|
|
|
(void)mProvider->GetFile(*mCurrentKey++, &dontCare, getter_AddRefs(testFile));
|
|
|
|
// Don't return a file which does not exist.
|
|
|
|
bool exists;
|
2014-05-14 13:15:46 -07:00
|
|
|
if (testFile && NS_SUCCEEDED(testFile->Exists(&exists)) && exists) {
|
2014-05-05 10:30:43 -07:00
|
|
|
mNext = testFile;
|
2014-05-14 13:15:46 -07:00
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
2014-05-14 13:15:46 -07:00
|
|
|
*aResult = mNext != nullptr;
|
2014-05-05 10:30:43 -07:00
|
|
|
return NS_OK;
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-05-14 13:15:46 -07:00
|
|
|
NS_IMETHOD GetNext(nsISupports** aResult)
|
2014-05-05 10:30:43 -07:00
|
|
|
{
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_WARN_IF(!aResult)) {
|
2014-05-05 10:30:43 -07:00
|
|
|
return NS_ERROR_INVALID_ARG;
|
2014-05-14 13:15:46 -07:00
|
|
|
}
|
|
|
|
*aResult = nullptr;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-05-05 10:30:43 -07:00
|
|
|
bool hasMore;
|
|
|
|
HasMoreElements(&hasMore);
|
2014-05-14 13:15:46 -07:00
|
|
|
if (!hasMore) {
|
2014-05-05 10:30:43 -07:00
|
|
|
return NS_ERROR_FAILURE;
|
2014-05-14 13:15:46 -07:00
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-05-14 13:15:46 -07:00
|
|
|
*aResult = mNext;
|
|
|
|
NS_IF_ADDREF(*aResult);
|
2014-05-05 10:30:43 -07:00
|
|
|
mNext = nullptr;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-05-14 13:15:46 -07:00
|
|
|
return *aResult ? NS_OK : NS_ERROR_FAILURE;
|
2014-05-05 10:30:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// Virtual destructor since subclass nsPathsDirectoryEnumerator
|
|
|
|
// does not re-implement Release()
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-05-05 10:30:43 -07:00
|
|
|
virtual ~nsAppDirectoryEnumerator()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
2014-05-14 13:15:46 -07:00
|
|
|
nsIDirectoryServiceProvider* mProvider;
|
2014-05-05 10:30:43 -07:00
|
|
|
const char** mCurrentKey;
|
|
|
|
nsCOMPtr<nsIFile> mNext;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
2014-04-27 00:06:00 -07:00
|
|
|
NS_IMPL_ISUPPORTS(nsAppDirectoryEnumerator, nsISimpleEnumerator)
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/* nsPathsDirectoryEnumerator and PATH_SEPARATOR
|
|
|
|
* are not used on MacOS/X. */
|
|
|
|
|
2014-02-10 14:57:01 -08:00
|
|
|
#if defined(XP_WIN) /* Win32 */
|
2007-03-22 10:30:00 -07:00
|
|
|
#define PATH_SEPARATOR ';'
|
Bug 627277 - Remove (broken) BeOS support. r=biesi,dwitte,gavin,joe,jorendorff,josh,khuey,mfinkle,neil,Pike,roc,shaver,smontagu,taras
2011-02-19 11:10:24 -08:00
|
|
|
#else
|
2007-03-22 10:30:00 -07:00
|
|
|
#define PATH_SEPARATOR ':'
|
|
|
|
#endif
|
|
|
|
|
|
|
|
class nsPathsDirectoryEnumerator : public nsAppDirectoryEnumerator
|
|
|
|
{
|
2014-05-05 10:30:43 -07:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* aKeyList is a null-terminated list.
|
|
|
|
* The first element is a path list.
|
|
|
|
* The remainder are properties provided by aProvider.
|
|
|
|
* They do not need to be publicly defined keys.
|
|
|
|
*/
|
2014-05-14 13:15:46 -07:00
|
|
|
nsPathsDirectoryEnumerator(nsIDirectoryServiceProvider* aProvider,
|
2014-05-05 10:30:43 -07:00
|
|
|
const char* aKeyList[]) :
|
2014-05-14 13:15:46 -07:00
|
|
|
nsAppDirectoryEnumerator(aProvider, aKeyList + 1),
|
2007-03-22 10:30:00 -07:00
|
|
|
mEndPath(aKeyList[0])
|
2014-05-05 10:30:43 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-05-14 13:15:46 -07:00
|
|
|
NS_IMETHOD HasMoreElements(bool* aResult)
|
2014-05-05 10:30:43 -07:00
|
|
|
{
|
|
|
|
if (mEndPath)
|
2014-05-14 13:15:46 -07:00
|
|
|
while (!mNext && *mEndPath) {
|
|
|
|
const char* pathVar = mEndPath;
|
2014-05-05 10:30:43 -07:00
|
|
|
|
|
|
|
// skip PATH_SEPARATORs at the begining of the mEndPath
|
2014-05-14 13:15:46 -07:00
|
|
|
while (*pathVar == PATH_SEPARATOR) {
|
|
|
|
++pathVar;
|
|
|
|
}
|
2014-05-05 10:30:43 -07:00
|
|
|
|
2014-05-14 13:15:46 -07:00
|
|
|
do {
|
|
|
|
++mEndPath;
|
|
|
|
} while (*mEndPath && *mEndPath != PATH_SEPARATOR);
|
2014-05-05 10:30:43 -07:00
|
|
|
|
|
|
|
nsCOMPtr<nsIFile> localFile;
|
|
|
|
NS_NewNativeLocalFile(Substring(pathVar, mEndPath),
|
|
|
|
true,
|
|
|
|
getter_AddRefs(localFile));
|
2014-05-14 13:15:46 -07:00
|
|
|
if (*mEndPath == PATH_SEPARATOR) {
|
2014-05-05 10:30:43 -07:00
|
|
|
++mEndPath;
|
2014-05-14 13:15:46 -07:00
|
|
|
}
|
2014-05-05 10:30:43 -07:00
|
|
|
// Don't return a "file" (directory) which does not exist.
|
|
|
|
bool exists;
|
|
|
|
if (localFile &&
|
|
|
|
NS_SUCCEEDED(localFile->Exists(&exists)) &&
|
2014-05-14 13:15:46 -07:00
|
|
|
exists) {
|
2014-05-05 10:30:43 -07:00
|
|
|
mNext = localFile;
|
2014-05-14 13:15:46 -07:00
|
|
|
}
|
2014-05-05 10:30:43 -07:00
|
|
|
}
|
2014-05-14 13:15:46 -07:00
|
|
|
if (mNext) {
|
|
|
|
*aResult = true;
|
|
|
|
} else {
|
|
|
|
nsAppDirectoryEnumerator::HasMoreElements(aResult);
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-05-05 10:30:43 -07:00
|
|
|
return NS_OK;
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-05-05 10:30:43 -07:00
|
|
|
protected:
|
2014-05-14 13:15:46 -07:00
|
|
|
const char* mEndPath;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2014-05-14 13:15:46 -07:00
|
|
|
nsAppFileLocationProvider::GetFiles(const char* aProp,
|
|
|
|
nsISimpleEnumerator** aResult)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2014-05-14 13:15:46 -07:00
|
|
|
if (NS_WARN_IF(!aResult)) {
|
2014-05-05 10:30:43 -07:00
|
|
|
return NS_ERROR_INVALID_ARG;
|
2014-05-14 13:15:46 -07:00
|
|
|
}
|
|
|
|
*aResult = nullptr;
|
2014-05-05 10:30:43 -07:00
|
|
|
nsresult rv = NS_ERROR_FAILURE;
|
|
|
|
|
2014-05-14 13:15:46 -07:00
|
|
|
if (!nsCRT::strcmp(aProp, NS_APP_PLUGINS_DIR_LIST)) {
|
2010-04-27 05:57:34 -07:00
|
|
|
#ifdef MOZ_WIDGET_COCOA
|
2014-05-05 10:30:43 -07:00
|
|
|
// As of Java for Mac OS X 10.5 Update 10, Apple has (in effect) deprecated Java Plugin2 on
|
|
|
|
// on OS X 10.5, and removed the soft link to it from /Library/Internet Plug-Ins/. Java
|
|
|
|
// Plugin2 is still present and usable, but there are no longer any links to it in the
|
|
|
|
// "normal" locations. So we won't be able to find it unless we look in the "non-normal"
|
|
|
|
// location where it actually is. Safari can use the WebKit-specific JavaPluginCocoa.bundle,
|
|
|
|
// which (of course) is still fully supported on OS X 10.5. But we have no alternative to
|
|
|
|
// using Java Plugin2. For more information see bug 668639.
|
2014-05-14 13:15:46 -07:00
|
|
|
static const char* keys[] = {
|
|
|
|
NS_APP_PLUGINS_DIR,
|
|
|
|
NS_MACOSX_USER_PLUGIN_DIR,
|
|
|
|
NS_MACOSX_LOCAL_PLUGIN_DIR,
|
|
|
|
IsOSXLeopard() ? NS_MACOSX_JAVA2_PLUGIN_DIR : nullptr,
|
|
|
|
nullptr
|
|
|
|
};
|
|
|
|
*aResult = new nsAppDirectoryEnumerator(this, keys);
|
2008-10-10 08:54:33 -07:00
|
|
|
#else
|
|
|
|
#ifdef XP_UNIX
|
2014-05-05 10:30:43 -07:00
|
|
|
static const char* keys[] = { nullptr, NS_USER_PLUGINS_DIR, NS_APP_PLUGINS_DIR, NS_SYSTEM_PLUGINS_DIR, nullptr };
|
2007-03-22 10:30:00 -07:00
|
|
|
#else
|
2014-05-05 10:30:43 -07:00
|
|
|
static const char* keys[] = { nullptr, NS_USER_PLUGINS_DIR, NS_APP_PLUGINS_DIR, nullptr };
|
2007-03-22 10:30:00 -07:00
|
|
|
#endif
|
2014-05-05 10:30:43 -07:00
|
|
|
if (!keys[0] && !(keys[0] = PR_GetEnv("MOZ_PLUGIN_PATH"))) {
|
|
|
|
static const char nullstr = 0;
|
|
|
|
keys[0] = &nullstr;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
2014-05-14 13:15:46 -07:00
|
|
|
*aResult = new nsPathsDirectoryEnumerator(this, keys);
|
2014-05-05 10:30:43 -07:00
|
|
|
#endif
|
2014-05-14 13:15:46 -07:00
|
|
|
NS_IF_ADDREF(*aResult);
|
|
|
|
rv = *aResult ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
|
2014-05-05 10:30:43 -07:00
|
|
|
}
|
2014-05-14 13:15:46 -07:00
|
|
|
if (!nsCRT::strcmp(aProp, NS_APP_SEARCH_DIR_LIST)) {
|
2014-05-05 10:30:43 -07:00
|
|
|
static const char* keys[] = { nullptr, NS_APP_SEARCH_DIR, NS_APP_USER_SEARCH_DIR, nullptr };
|
|
|
|
if (!keys[0] && !(keys[0] = PR_GetEnv("MOZ_SEARCH_ENGINE_PATH"))) {
|
|
|
|
static const char nullstr = 0;
|
|
|
|
keys[0] = &nullstr;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
2014-05-14 13:15:46 -07:00
|
|
|
*aResult = new nsPathsDirectoryEnumerator(this, keys);
|
|
|
|
NS_IF_ADDREF(*aResult);
|
|
|
|
rv = *aResult ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
|
2014-05-05 10:30:43 -07:00
|
|
|
}
|
|
|
|
return rv;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
2011-07-07 12:24:28 -07:00
|
|
|
|
2011-10-14 08:43:35 -07:00
|
|
|
#if defined(MOZ_WIDGET_COCOA)
|
2011-09-28 23:19:26 -07:00
|
|
|
bool
|
2011-07-07 12:24:28 -07:00
|
|
|
nsAppFileLocationProvider::IsOSXLeopard()
|
|
|
|
{
|
2014-05-05 10:30:43 -07:00
|
|
|
static SInt32 version = 0;
|
|
|
|
|
|
|
|
if (!version) {
|
|
|
|
OSErr err = ::Gestalt(gestaltSystemVersion, &version);
|
|
|
|
if (err != noErr) {
|
|
|
|
version = 0;
|
|
|
|
} else {
|
|
|
|
version &= 0xFFFF; // The system version is in the low order word
|
2011-07-07 12:24:28 -07:00
|
|
|
}
|
2014-05-05 10:30:43 -07:00
|
|
|
}
|
2011-07-07 12:24:28 -07:00
|
|
|
|
2014-05-05 10:30:43 -07:00
|
|
|
return ((version >= 0x1050) && (version < 0x1060));
|
2011-07-07 12:24:28 -07:00
|
|
|
}
|
|
|
|
#endif
|