| 488 | } |
| 489 | |
| 490 | static cell_t smn_BfReadString(IPluginContext *pCtx, const cell_t *params) |
| 491 | { |
| 492 | Handle_t hndl = static_cast<Handle_t>(params[1]); |
| 493 | HandleError herr; |
| 494 | HandleSecurity sec; |
| 495 | bf_read *pBitBuf; |
| 496 | int numChars = 0; |
| 497 | char *buf; |
| 498 | |
| 499 | sec.pOwner = NULL; |
| 500 | sec.pIdentity = g_pCoreIdent; |
| 501 | |
| 502 | if ((herr=handlesys->ReadHandle(hndl, g_RdBitBufType, &sec, (void **)&pBitBuf)) |
| 503 | != HandleError_None) |
| 504 | { |
| 505 | return pCtx->ThrowNativeError("Invalid bit buffer handle %x (error %d)", hndl, herr); |
| 506 | } |
| 507 | |
| 508 | pCtx->LocalToPhysAddr(params[2], (cell_t **)&buf); |
| 509 | pBitBuf->ReadString(buf, params[3], params[4] ? true : false, &numChars); |
| 510 | |
| 511 | if (pBitBuf->IsOverflowed()) |
| 512 | { |
| 513 | return -numChars - 1; |
| 514 | } |
| 515 | |
| 516 | return numChars; |
| 517 | } |
| 518 | |
| 519 | static cell_t smn_BfReadEntity(IPluginContext *pCtx, const cell_t *params) |
| 520 | { |
nothing calls this directly
no test coverage detected