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.
This commit is contained in:
dveditz%netscape.com 1999-09-16 05:32:28 +00:00
Родитель 78b9f507f0
Коммит 7d68f66b73
3 изменённых файлов: 21 добавлений и 0 удалений

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

@ -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. |

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

@ -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. |

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

@ -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. |