| 157 | } |
| 158 | |
| 159 | static cell_t smn_KvSetString(IPluginContext *pCtx, const cell_t *params) |
| 160 | { |
| 161 | Handle_t hndl = static_cast<Handle_t>(params[1]); |
| 162 | HandleError herr; |
| 163 | HandleSecurity sec; |
| 164 | KeyValueStack *pStk; |
| 165 | |
| 166 | sec.pOwner = NULL; |
| 167 | sec.pIdentity = g_pCoreIdent; |
| 168 | |
| 169 | if ((herr=handlesys->ReadHandle(hndl, g_KeyValueType, &sec, (void **)&pStk)) |
| 170 | != HandleError_None) |
| 171 | { |
| 172 | return pCtx->ThrowNativeError("Invalid key value handle %x (error %d)", hndl, herr); |
| 173 | } |
| 174 | |
| 175 | char *key, *value; |
| 176 | pCtx->LocalToStringNULL(params[2], &key); |
| 177 | pCtx->LocalToString(params[3], &value); |
| 178 | |
| 179 | pStk->pCurRoot.front()->SetString(key, value); |
| 180 | |
| 181 | return 1; |
| 182 | } |
| 183 | |
| 184 | static cell_t smn_KvSetNum(IPluginContext *pCtx, const cell_t *params) |
| 185 | { |
nothing calls this directly
no test coverage detected