MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / FrameIterator_GetFunctionName

Function FrameIterator_GetFunctionName

core/logic/smn_core.cpp:1144–1171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1142}
1143
1144static cell_t FrameIterator_GetFunctionName(IPluginContext *pContext, const cell_t *params)
1145{
1146 Handle_t hndl = (Handle_t)params[1];
1147 HandleError err;
1148 SafeFrameIterator *iterator;
1149
1150 HandleSecurity sec;
1151 sec.pIdentity = g_pCoreIdent;
1152 sec.pOwner = pContext->GetIdentity();
1153
1154 if ((err=handlesys->ReadHandle(hndl, g_FrameIter, &sec, (void **)&iterator)) != HandleError_None)
1155 {
1156 return pContext->ThrowNativeError("Could not read Handle %x (error %d)", hndl, err);
1157 }
1158
1159 const char* functionName = iterator->FunctionName();
1160 if (!functionName)
1161 {
1162 return pContext->ThrowNativeError("Iterator out of bounds. Check return value of FrameIterator.Next");
1163 }
1164
1165 char* buffer;
1166 pContext->LocalToString(params[2], &buffer);
1167 size_t size = static_cast<size_t>(params[3]);
1168
1169 ke::SafeStrcpy(buffer, size, functionName);
1170 return 0;
1171}
1172
1173static cell_t FrameIterator_GetFilePath(IPluginContext *pContext, const cell_t *params)
1174{

Callers

nothing calls this directly

Calls 3

FunctionNameMethod · 0.80
GetIdentityMethod · 0.45
ReadHandleMethod · 0.45

Tested by

no test coverage detected