expose whether the registry is already open or not, which enables the profile

manager to avoid opening and closing the registry ~20 times at startup.


git-svn-id: svn://10.0.0.236/trunk@47736 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dveditz%netscape.com 1999-09-16 05:32:28 +00:00
parent 96ec5ef98f
commit 1653f8692f
3 changed files with 21 additions and 0 deletions

View File

@ -55,6 +55,7 @@ struct nsRegistry : public nsIRegistry {
NS_IMETHOD OpenWellKnownRegistry( uint32 regid );
NS_IMETHOD OpenDefault();
NS_IMETHOD Close();
NS_IMETHOD IsOpen( PRBool *result );
NS_IMETHOD GetString( Key baseKey, const char *path, char **result );
NS_IMETHOD SetString( Key baseKey, const char *path, const char *value );
@ -492,6 +493,15 @@ NS_IMETHODIMP nsRegistry::Close() {
return regerr2nsresult( err );
}
/*----------------------------- nsRegistry::IsOpen -----------------------------
| Tests the mReg handle and returns whether the registry is open or not. |
------------------------------------------------------------------------------*/
NS_IMETHODIMP nsRegistry::IsOpen( PRBool *result ) {
*result = ( mReg != 0 );
return NS_OK;
}
/*--------------------------- nsRegistry::GetString ----------------------------
| First, look for the entry using GetValueInfo. If found, and it's a string, |
| allocate space for it and fetch the value. |

View File

@ -168,6 +168,7 @@ struct nsIRegistry : public nsISupports {
NS_IMETHOD OpenWellKnownRegistry( uint32 regid ) = 0;
NS_IMETHOD OpenDefault() = 0;
NS_IMETHOD Close() = 0;
NS_IMETHOD IsOpen( PRBool *result ) = 0;
/*----------------------- Reading/Writing Values ---------------------------
| These functions read/write the registry values at a given node. |

View File

@ -55,6 +55,7 @@ struct nsRegistry : public nsIRegistry {
NS_IMETHOD OpenWellKnownRegistry( uint32 regid );
NS_IMETHOD OpenDefault();
NS_IMETHOD Close();
NS_IMETHOD IsOpen( PRBool *result );
NS_IMETHOD GetString( Key baseKey, const char *path, char **result );
NS_IMETHOD SetString( Key baseKey, const char *path, const char *value );
@ -492,6 +493,15 @@ NS_IMETHODIMP nsRegistry::Close() {
return regerr2nsresult( err );
}
/*----------------------------- nsRegistry::IsOpen -----------------------------
| Tests the mReg handle and returns whether the registry is open or not. |
------------------------------------------------------------------------------*/
NS_IMETHODIMP nsRegistry::IsOpen( PRBool *result ) {
*result = ( mReg != 0 );
return NS_OK;
}
/*--------------------------- nsRegistry::GetString ----------------------------
| First, look for the entry using GetValueInfo. If found, and it's a string, |
| allocate space for it and fetch the value. |