added amb260
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40756
This commit is contained in:
parent
67a0cdf1c3
commit
e69edf05eb
@ -637,6 +637,25 @@ static cell_t smn_KvSetEscapeSequences(IPluginContext *pCtx, const cell_t *param
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static cell_t smn_KvNodesInStack(IPluginContext *pCtx, const cell_t *params)
|
||||||
|
{
|
||||||
|
Handle_t hndl = static_cast<Handle_t>(params[1]);
|
||||||
|
HandleError herr;
|
||||||
|
HandleSecurity sec;
|
||||||
|
KeyValueStack *pStk;
|
||||||
|
|
||||||
|
sec.pOwner = NULL;
|
||||||
|
sec.pIdentity = g_pCoreIdent;
|
||||||
|
|
||||||
|
if ((herr=g_HandleSys.ReadHandle(hndl, g_KeyValueType, &sec, (void **)&pStk))
|
||||||
|
!= HandleError_None)
|
||||||
|
{
|
||||||
|
return pCtx->ThrowNativeError("Invalid key value handle %x (error %d)", hndl, herr);
|
||||||
|
}
|
||||||
|
|
||||||
|
return pStk->pCurRoot.size();
|
||||||
|
}
|
||||||
|
|
||||||
static cell_t smn_KvDeleteThis(IPluginContext *pContext, const cell_t *params)
|
static cell_t smn_KvDeleteThis(IPluginContext *pContext, const cell_t *params)
|
||||||
{
|
{
|
||||||
Handle_t hndl = static_cast<Handle_t>(params[1]);
|
Handle_t hndl = static_cast<Handle_t>(params[1]);
|
||||||
@ -731,5 +750,6 @@ REGISTER_NATIVES(keyvaluenatives)
|
|||||||
{"KvSetEscapeSequences", smn_KvSetEscapeSequences},
|
{"KvSetEscapeSequences", smn_KvSetEscapeSequences},
|
||||||
{"KvDeleteThis", smn_KvDeleteThis},
|
{"KvDeleteThis", smn_KvDeleteThis},
|
||||||
{"KvDeleteKey", smn_KvDeleteKey},
|
{"KvDeleteKey", smn_KvDeleteKey},
|
||||||
|
{"KvNodesInStack", smn_KvNodesInStack},
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
|
@ -298,3 +298,14 @@ native bool:FileToKeyValues(Handle:kv, const String:file[]);
|
|||||||
* @error Invalid Handle.
|
* @error Invalid Handle.
|
||||||
*/
|
*/
|
||||||
native KvSetEscapeSequences(Handle:kv, bool:useEscapes);
|
native KvSetEscapeSequences(Handle:kv, bool:useEscapes);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the position in the jump stack; I.e. the number of calls
|
||||||
|
* required for KvGoBack to return to the root node. If at the root node,
|
||||||
|
* 0 is returned.
|
||||||
|
*
|
||||||
|
* @param kv KeyValues Handle.
|
||||||
|
* @return Number of non-root nodes in the jump stack.
|
||||||
|
* @error Invalid Handle.
|
||||||
|
*/
|
||||||
|
native KvNodesInStack(Handle:kv);
|
Loading…
Reference in New Issue
Block a user