nsIRegistry scriptability update, r=dveditz,dp,alecf a=leaf,chofmann

This commit is contained in:
shaver%netscape.com 1999-09-29 02:36:54 +00:00
Родитель f28337480b
Коммит 7a5b9d5e55
21 изменённых файлов: 65 добавлений и 66 удалений

Просмотреть файл

@ -204,7 +204,7 @@ nsresult nsCharsetConverterManager::CreateMapping()
nsresult res = NS_OK;
nsIRegistry * registry = NULL;
nsIEnumerator * components = NULL;
nsIRegistry::Key uconvKey, key;
nsRegistryKey uconvKey, key;
// XXX hack; make these dynamic
mEncSize = mDecSize = 0;

Просмотреть файл

@ -279,7 +279,7 @@ void nsCharsetMenu::CreateDefaultCharsetList(CharsetInfo *** aArray,
nsresult res = NS_OK;
nsIEnumerator * components = NULL;
nsIRegistry * registry = NULL;
nsIRegistry::Key uconvKey, key;
nsRegistryKey uconvKey, key;
// get the registry
res = nsServiceManager::GetService(NS_REGISTRY_PROGID,

Просмотреть файл

@ -231,7 +231,7 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports * aServMgr,
PRUint32 i;
nsIComponentManager * compMgr = NULL;
nsIRegistry * registry = NULL;
nsIRegistry::Key key;
nsRegistryKey key;
char buff[1024];
// get the service manager

Просмотреть файл

@ -266,7 +266,7 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports * aServMgr,
PRUint32 i;
nsIComponentManager * compMgr = NULL;
nsIRegistry * registry = NULL;
nsIRegistry::Key key;
nsRegistryKey key;
char buff[1024];
// get the service manager

Просмотреть файл

@ -198,7 +198,7 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports * aServMgr,
PRUint32 i;
nsIComponentManager * compMgr = NULL;
nsIRegistry * registry = NULL;
nsIRegistry::Key key;
nsRegistryKey key;
char buff[1024];
// get the service manager

Просмотреть файл

@ -897,7 +897,7 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports * aServMgr,
PRUint32 i;
nsIComponentManager * compMgr = NULL;
nsIRegistry * registry = NULL;
nsIRegistry::Key key;
nsRegistryKey key;
char buff[1024];
// get the service manager

Просмотреть файл

@ -187,7 +187,7 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports * aServMgr,
PRUint32 i;
nsIComponentManager * compMgr = NULL;
nsIRegistry * registry = NULL;
nsIRegistry::Key key;
nsRegistryKey key;
char buff[1024];
// get the service manager

Просмотреть файл

@ -266,7 +266,7 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports * aServMgr,
PRUint32 i;
nsIComponentManager * compMgr = NULL;
nsIRegistry * registry = NULL;
nsIRegistry::Key key;
nsRegistryKey key;
char buff[1024];
// get the service manager

Просмотреть файл

@ -346,7 +346,7 @@ mozJSComponentLoader::SetRegistryInfo(const char *registryLocation,
return NS_OK; // silent failure
nsresult rv;
nsIRegistry::Key key;
nsRegistryKey key;
rv = mRegistry->GetSubtreeRaw(mXPCOMKey, registryLocation,
&key);
@ -383,7 +383,7 @@ mozJSComponentLoader::HasChanged(const char *registryLocation,
if (!mRegistry)
return PR_TRUE;
nsIRegistry::Key key;
nsRegistryKey key;
if (NS_FAILED(mRegistry->GetSubtreeRaw(mXPCOMKey, registryLocation, &key)))
return PR_TRUE;
@ -559,8 +559,7 @@ mozJSComponentLoader::GlobalForLocation(const char *aLocation,
NS_FAILED(ReallyInit()))
return nsnull;
JSObject *obj = JS_NewObject(mContext, &gGlobalClass, mSuperGlobal,
mSuperGlobal);
JSObject *obj = JS_NewObject(mContext, &gGlobalClass, mSuperGlobal, NULL);
if (!obj)
return nsnull;

Просмотреть файл

@ -63,7 +63,7 @@ public:
PLHashTable *mModules;
PLHashTable *mGlobals;
nsIRegistry::Key mXPCOMKey;
nsRegistryKey mXPCOMKey;
PRBool mInitialized;
};

Просмотреть файл

@ -395,7 +395,7 @@ NSRegisterSelf(nsISupports* aServMgr, const char* path)
NS_IAPPSHELLCOMPONENT_KEY,
cid ? cid : "unknown" );
nsCRT::free(cid);
nsIRegistry::Key key;
nsRegistryKey key;
rv = registry->AddSubtree( nsIRegistry::Common,
buffer,
&key );

Просмотреть файл

@ -170,9 +170,9 @@ NSGetFactory(nsISupports* aServMgr,
}
nsresult GetImportModulesRegKey( nsIRegistry *reg, nsIRegistry::Key *pKey)
nsresult GetImportModulesRegKey( nsIRegistry *reg, nsRegistryKey *pKey)
{
nsIRegistry::Key nScapeKey;
nsRegistryKey nScapeKey;
nsresult rv = reg->GetSubtree( nsIRegistry::Common, "Netscape", &nScapeKey);
if (NS_FAILED(rv)) {
@ -181,7 +181,7 @@ nsresult GetImportModulesRegKey( nsIRegistry *reg, nsIRegistry::Key *pKey)
if (NS_FAILED( rv))
return( rv);
nsIRegistry::Key iKey;
nsRegistryKey iKey;
rv = reg->GetSubtree( nScapeKey, "Import", &iKey);
if (NS_FAILED( rv)) {
rv = reg->AddSubtree( nScapeKey, "Import", &iKey);
@ -240,7 +240,7 @@ NSRegisterSelf(nsISupports* aServMgr , const char* aPath)
return( rv);
}
nsIRegistry::Key importKey;
nsRegistryKey importKey;
rv = GetImportModulesRegKey( reg, &importKey);
if (NS_FAILED( rv)) {
@ -248,7 +248,7 @@ NSRegisterSelf(nsISupports* aServMgr , const char* aPath)
return( rv);
}
nsIRegistry::Key key;
nsRegistryKey key;
rv = reg->AddSubtree( importKey, "Outlook Express", &key);
if (NS_FAILED(rv)) return( rv);

Просмотреть файл

@ -93,8 +93,8 @@ public:
private:
nsresult LoadModuleInfo( char *pClsId, const char *pSupports);
nsresult DoDiscover( void);
nsresult GetImportRegKey( nsIRegistry *reg, nsIRegistry::Key *pKey);
nsresult GetImportModulesRegKey( nsIRegistry *reg, nsIRegistry::Key *pKey);
nsresult GetImportRegKey( nsIRegistry *reg, nsRegistryKey *pKey);
nsresult GetImportModulesRegKey( nsIRegistry *reg, nsRegistryKey *pKey);
private:
nsImportModuleList * m_pModules;
@ -385,9 +385,9 @@ NS_IMETHODIMP nsImportService::GetModule( const char *filter, PRInt32 index, nsI
nsresult nsImportService::GetImportRegKey( nsIRegistry *reg, nsIRegistry::Key *pKey)
nsresult nsImportService::GetImportRegKey( nsIRegistry *reg, nsRegistryKey *pKey)
{
nsIRegistry::Key nScapeKey;
nsRegistryKey nScapeKey;
nsresult rv = reg->GetSubtree( nsIRegistry::Common, "Netscape", &nScapeKey);
if (NS_FAILED(rv)) {
@ -404,9 +404,9 @@ nsresult nsImportService::GetImportRegKey( nsIRegistry *reg, nsIRegistry::Key *p
return( rv);
}
nsresult nsImportService::GetImportModulesRegKey( nsIRegistry *reg, nsIRegistry::Key *pKey)
nsresult nsImportService::GetImportModulesRegKey( nsIRegistry *reg, nsRegistryKey *pKey)
{
nsIRegistry::Key iKey;
nsRegistryKey iKey;
nsresult rv = GetImportRegKey( reg, &iKey);
if (NS_FAILED( rv))
return( rv);
@ -437,7 +437,7 @@ nsresult nsImportService::DoDiscover( void)
rv = reg->OpenDefault();
if (NS_FAILED(rv)) return( rv);
nsIRegistry::Key modulesKey;
nsRegistryKey modulesKey;
rv = GetImportModulesRegKey( reg, &modulesKey);
if (NS_FAILED(rv)) return( rv);
@ -464,7 +464,7 @@ nsresult nsImportService::DoDiscover( void)
pNodeName = nsnull;
rv = node->GetName( &pNodeName);
if (NS_SUCCEEDED( rv) && (pNodeName != nsnull)) {
nsIRegistry::Key key;
nsRegistryKey key;
rv = reg->GetSubtree( modulesKey, pNodeName, &key);
PR_Free( pNodeName);
if (NS_SUCCEEDED( rv)) {

Просмотреть файл

@ -192,7 +192,7 @@ NSRegisterSelf(nsISupports* aServMgr, const char* path)
if (NS_SUCCEEDED(rv))
{
// set the key
nsIRegistry::Key key, key1;
nsRegistryKey key, key1;
rv = NS_OK;
if (NS_FAILED(registry->GetSubtree(nsIRegistry::Common, NS_IMIME_MISC_STATUS_KEY, &key)))
rv = registry->AddSubtree(nsIRegistry::Common, NS_IMIME_MISC_STATUS_KEY, &key);

Просмотреть файл

@ -1207,7 +1207,7 @@ nsMimeXULEmitter::BuildListOfStatusProviders()
// enumerate the registry subkeys
nsIRegistry *registry = nsnull;
nsIRegistry::Key key;
nsRegistryKey key;
nsIEnumerator *components = nsnull;
miscStatusType *newInfo = nsnull;

Просмотреть файл

@ -70,7 +70,7 @@ NSRegisterSelf(nsISupports* aServMgr , const char* aPath)
if (NS_FAILED(rv)) return rv;
// set the key
nsIRegistry::Key key, key1;
nsRegistryKey key, key1;
// root key addition
rv = registry->AddSubtree(nsIRegistry::Common, NS_ISTREAMCONVERTER_KEY, &key);

Просмотреть файл

@ -96,7 +96,7 @@ nsStreamConverterService::BuildGraph() {
nsresult rv;
// enumerate the registry subkeys
nsIRegistry *registry = nsnull;
nsIRegistry::Key key;
nsRegistryKey key;
nsIEnumerator *components = nsnull;
rv = nsServiceManager::GetService(NS_REGISTRY_PROGID,
NS_GET_IID(nsIRegistry),

Просмотреть файл

@ -214,7 +214,7 @@ main(int argc, char* argv[])
if (NS_FAILED(rv)) return rv;
// set the key
nsIRegistry::Key key, key1;
nsRegistryKey key, key1;
rv = registry->AddSubtree(nsIRegistry::Common, NS_ISTREAMCONVERTER_KEY, &key);
if (NS_FAILED(rv)) return rv;

Просмотреть файл

@ -274,7 +274,7 @@ main(int argc, char* argv[])
if (NS_FAILED(rv)) return rv;
// set the key
nsIRegistry::Key key, key1;
nsRegistryKey key, key1;
rv = registry->AddSubtree(nsIRegistry::Common, NS_ISTREAMCONVERTER_KEY, &key);
if (NS_FAILED(rv)) return rv;

Просмотреть файл

@ -242,7 +242,7 @@ NS_IMETHODIMP nsProfile::Startup(const char *filename)
if (NS_FAILED(rv)) return rv;
// Add the root Profiles node in the registry
nsIRegistry::Key key;
nsRegistryKey key;
rv = m_reg->AddSubtree(nsIRegistry::Common, REGISTRY_PROFILE_SUBTREE_STRING, &key);
return rv;
}
@ -554,14 +554,14 @@ NS_IMETHODIMP nsProfile::GetProfileDir(const char *profileName, nsFileSpec* prof
rv = OpenRegistry();
if (NS_FAILED(rv)) return rv;
nsIRegistry::Key key;
nsRegistryKey key;
// Get handle to subtree REGISTRY_PROFILE_SUBTREE_STRING
rv = m_reg->GetSubtree(nsIRegistry::Common, REGISTRY_PROFILE_SUBTREE_STRING, &key);
if (NS_SUCCEEDED(rv))
{
nsIRegistry::Key newKey;
nsRegistryKey newKey;
// Get handle to <profileName> passed
rv = m_reg->GetSubtree(key, profileName, &newKey);
@ -671,7 +671,7 @@ NS_IMETHODIMP nsProfile::GetProfileCount(PRInt32 *numProfiles)
// Enumerate all subkeys (immediately) under the given node.
nsCOMPtr<nsIEnumerator> enumKeys;
nsIRegistry::Key key;
nsRegistryKey key;
rv = m_reg->GetSubtree(nsIRegistry::Common, REGISTRY_PROFILE_SUBTREE_STRING, &key);
@ -709,7 +709,7 @@ NS_IMETHODIMP nsProfile::GetProfileCount(PRInt32 *numProfiles)
if (NS_SUCCEEDED(rv) && (profile))
{
nsIRegistry::Key profKey;
nsRegistryKey profKey;
rv = m_reg->GetSubtree(key, profile, &profKey);
@ -763,7 +763,7 @@ NS_IMETHODIMP nsProfile::GetSingleProfile(char **profileName)
// Enumerate all subkeys (immediately) under the given node.
nsCOMPtr<nsIEnumerator> enumKeys;
nsIRegistry::Key key;
nsRegistryKey key;
rv = m_reg->GetSubtree(nsIRegistry::Common, REGISTRY_PROFILE_SUBTREE_STRING, &key);
@ -791,7 +791,7 @@ NS_IMETHODIMP nsProfile::GetSingleProfile(char **profileName)
if (NS_SUCCEEDED(rv))
{
nsXPIDLCString isMigrated;
nsIRegistry::Key profKey;
nsRegistryKey profKey;
// Get node name.
rv = node->GetName(profileName );
@ -894,7 +894,7 @@ nsProfile::GetCurrentProfile(char **profileName)
rv = OpenRegistry();
if (NS_FAILED(rv)) return rv;
nsIRegistry::Key key;
nsRegistryKey key;
rv = m_reg->GetSubtree(nsIRegistry::Common, REGISTRY_PROFILE_SUBTREE_STRING, &key);
@ -1000,13 +1000,13 @@ NS_IMETHODIMP nsProfile::SetProfileDir(const char *profileName, nsFileSpec& prof
rv = OpenRegistry();
if (NS_FAILED(rv)) return rv;
nsIRegistry::Key key;
nsRegistryKey key;
rv = m_reg->GetSubtree(nsIRegistry::Common, REGISTRY_PROFILE_SUBTREE_STRING, &key);
if (NS_SUCCEEDED(rv))
{
nsIRegistry::Key newKey;
nsRegistryKey newKey;
rv = m_reg->AddSubtree(key, profileName, &newKey);
@ -1380,7 +1380,7 @@ NS_IMETHODIMP nsProfile::RenameProfile(const char* oldName, const char* newName)
if (NS_SUCCEEDED(rv))
{
nsIRegistry::Key profileRootKey;
nsRegistryKey profileRootKey;
rv = m_reg->GetSubtree(nsIRegistry::Common, REGISTRY_PROFILE_SUBTREE_STRING, &profileRootKey);
@ -1399,7 +1399,7 @@ NS_IMETHODIMP nsProfile::RenameProfile(const char* oldName, const char* newName)
nsresult nsProfile::CopyRegKey(const char *oldProfile, const char *newProfile)
{
nsCOMPtr<nsIEnumerator> enumKeys;
nsIRegistry::Key sourceKey, destKey, profileRootKey;
nsRegistryKey sourceKey, destKey, profileRootKey;
nsresult rv;
rv = OpenRegistry();
@ -1478,7 +1478,7 @@ NS_IMETHODIMP nsProfile::DeleteProfile(const char* profileName, const char* canD
GetProfileDir(profileName, &profileDirSpec);
nsIRegistry::Key key;
nsRegistryKey key;
rv = m_reg->GetSubtree(nsIRegistry::Common, REGISTRY_PROFILE_SUBTREE_STRING, &key);
if (NS_FAILED(rv)) return rv;
@ -1554,7 +1554,7 @@ void nsProfile::GetAllProfiles()
// Enumerate all subkeys (immediately) under the given node.
nsCOMPtr<nsIEnumerator> enumKeys;
nsIRegistry::Key key;
nsRegistryKey key;
rv = m_reg->GetSubtree(nsIRegistry::Common, REGISTRY_PROFILE_SUBTREE_STRING, &key);
@ -1591,7 +1591,7 @@ void nsProfile::GetAllProfiles()
if (NS_SUCCEEDED(rv) && (profile))
{
nsIRegistry::Key profKey;
nsRegistryKey profKey;
rv = m_reg->GetSubtree(key, profile, &profKey);
@ -1683,7 +1683,7 @@ NS_IMETHODIMP nsProfile::StartCommunicator(const char* profileName)
// First, set the profile to be the current profile.
// So that FileLocation services grabs right directory when it needs to.
nsIRegistry::Key profileRootKey;
nsRegistryKey profileRootKey;
rv = m_reg->GetSubtree(nsIRegistry::Common, REGISTRY_PROFILE_SUBTREE_STRING, &profileRootKey);
if (NS_FAILED(rv)) return rv;
@ -1797,7 +1797,7 @@ NS_IMETHODIMP nsProfile::MigrateProfileInfo()
printf("oldProflie = %s\n", profile);
#endif
nsIRegistry::Key key;
nsRegistryKey key;
rv = oldReg->GetSubtree(nsIRegistry::Users, profile, &key);
@ -1876,12 +1876,12 @@ NS_IMETHODIMP nsProfile::UpdateMozProfileRegistry()
for (PRInt32 idx = 0; idx < mNumOldProfiles; idx++)
{
nsIRegistry::Key key;
nsRegistryKey key;
rv = m_reg->GetSubtree(nsIRegistry::Common, REGISTRY_PROFILE_SUBTREE_STRING, &key);
if (NS_SUCCEEDED(rv))
{
nsIRegistry::Key newKey;
nsRegistryKey newKey;
rv = m_reg->SetString(key, REGISTRY_NEED_MIGRATION_STRING, REGISTRY_TRUE_STRING);
@ -2019,13 +2019,13 @@ NS_IMETHODIMP nsProfile::MigrateProfile(const char* profileName)
if (NS_FAILED(rv)) return rv;
//unmark migrate flag
nsIRegistry::Key key;
nsRegistryKey key;
rv = m_reg->GetSubtree(nsIRegistry::Common, REGISTRY_PROFILE_SUBTREE_STRING, &key);
if (NS_SUCCEEDED(rv))
{
nsIRegistry::Key newKey;
nsRegistryKey newKey;
rv = m_reg->GetSubtree(key, profileName, &newKey);
if (NS_SUCCEEDED(rv))
@ -2192,13 +2192,13 @@ NS_IMETHODIMP nsProfile::ProcessPREGInfo(const char* data)
if (NS_SUCCEEDED(rv))
{
nsIRegistry::Key key;
nsRegistryKey key;
rv = m_reg->GetSubtree(nsIRegistry::Common, REGISTRY_PROFILE_SUBTREE_STRING, &key);
if (NS_SUCCEEDED(rv))
{
nsIRegistry::Key newKey;
nsRegistryKey newKey;
if (userProfileName.mLength > 0)
{
@ -2257,7 +2257,7 @@ NS_IMETHODIMP nsProfile::IsPregCookieSet(char **pregSet)
rv = OpenRegistry();
if (NS_FAILED(rv)) return rv;
nsIRegistry::Key key;
nsRegistryKey key;
rv = m_reg->GetSubtree(nsIRegistry::Common, REGISTRY_PROFILE_SUBTREE_STRING, &key);
@ -2281,13 +2281,13 @@ NS_IMETHODIMP nsProfile::ProfileExists(const char *profileName)
rv = OpenRegistry();
if (NS_FAILED(rv)) return rv;
nsIRegistry::Key key;
nsRegistryKey key;
rv = m_reg->GetSubtree(nsIRegistry::Common, REGISTRY_PROFILE_SUBTREE_STRING, &key);
if (NS_SUCCEEDED(rv))
{
nsIRegistry::Key newKey;
nsRegistryKey newKey;
// Get handle to <profileName> passed
rv = m_reg->GetSubtree(key, profileName, &newKey);
@ -2318,7 +2318,7 @@ NS_IMETHODIMP nsProfile::Get4xProfileCount(PRInt32 *numProfiles)
// Enumerate all subkeys (immediately) under the given node.
nsCOMPtr<nsIEnumerator> enumKeys;
nsIRegistry::Key key;
nsRegistryKey key;
rv = m_reg->GetSubtree(nsIRegistry::Common, REGISTRY_PROFILE_SUBTREE_STRING, &key);
@ -2356,7 +2356,7 @@ NS_IMETHODIMP nsProfile::Get4xProfileCount(PRInt32 *numProfiles)
if (NS_SUCCEEDED(rv) && (profile))
{
nsIRegistry::Key profKey;
nsRegistryKey profKey;
rv = m_reg->GetSubtree(key, profile, &profKey);

Просмотреть файл

@ -25,8 +25,8 @@
#include "prmem.h"
#include "plstr.h"
static void display( nsIRegistry *reg, nsIRegistry::Key root, const char *name );
static void displayValues( nsIRegistry *reg, nsIRegistry::Key root );
static void display( nsIRegistry *reg, nsRegistryKey root, const char *name );
static void displayValues( nsIRegistry *reg, nsRegistryKey root );
static void printString( const char *value, int indent );
int main( int argc, char *argv[] ) {
@ -115,7 +115,7 @@ int main( int argc, char *argv[] ) {
return rv;
}
void display( nsIRegistry *reg, nsIRegistry::Key root, const char *rootName ) {
void display( nsIRegistry *reg, nsRegistryKey root, const char *rootName ) {
// Print out key name.
printf( "%s\n", rootName );
@ -160,7 +160,7 @@ void display( nsIRegistry *reg, nsIRegistry::Key root, const char *rootName ) {
PL_strcat( fullName, " - " );
PL_strcat( fullName, name );
// Display contents under this subkey.
nsIRegistry::Key key;
nsRegistryKey key;
rv = reg->GetSubtreeRaw( root, name, &key );
if ( rv == NS_OK ) {
display( reg, key, fullName );
@ -200,7 +200,7 @@ void display( nsIRegistry *reg, nsIRegistry::Key root, const char *rootName ) {
return;
}
static void displayValues( nsIRegistry *reg, nsIRegistry::Key root ) {
static void displayValues( nsIRegistry *reg, nsRegistryKey root ) {
// Emumerate values at this registry location.
nsIEnumerator *values;
nsresult rv = reg->EnumerateValues( root, &values );