core/smn_keyvalues.cpp
changeset 682 a70055d6d3b3
parent 654 e00dd6df311e
child 703 cddbff919185
     1.1 --- a/core/smn_keyvalues.cpp	Wed Apr 11 20:07:20 2007 +0000
     1.2 +++ b/core/smn_keyvalues.cpp	Thu Apr 12 00:45:53 2007 +0000
     1.3 @@ -48,6 +48,33 @@
     1.4  	}
     1.5  };
     1.6  
     1.7 +KeyValues *SourceModBase::ReadKeyValuesHandle(Handle_t hndl, HandleError *err, bool root)
     1.8 +{
     1.9 +	HandleError herr;
    1.10 +	HandleSecurity sec;
    1.11 +	KeyValueStack *pStk;
    1.12 +
    1.13 +	sec.pOwner = NULL;
    1.14 +	sec.pIdentity = g_pCoreIdent;
    1.15 +
    1.16 +	if ((herr=g_HandleSys.ReadHandle(hndl, g_KeyValueType, &sec, (void **)&pStk))
    1.17 +		!= HandleError_None)
    1.18 +	{
    1.19 +		if (err)
    1.20 +		{
    1.21 +			*err = herr;
    1.22 +		}
    1.23 +		return NULL;
    1.24 +	}
    1.25 +
    1.26 +	if (err)
    1.27 +	{
    1.28 +		*err = HandleError_None;
    1.29 +	}
    1.30 +
    1.31 +	return (root) ? pStk->pBase : pStk->pCurRoot.front();
    1.32 +}
    1.33 +
    1.34  static cell_t smn_KvSetString(IPluginContext *pCtx, const cell_t *params)
    1.35  {
    1.36  	Handle_t hndl = static_cast<Handle_t>(params[1]);