MCPcopy Create free account
hub / github.com/MayaPosch/NymphCast / ListFunctions

Function ListFunctions

src/server/angelscript/samples/console/source/main.cpp:338–365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

336}
337
338void ListFunctions(asIScriptEngine *engine)
339{
340 asUINT n;
341
342 // List the application registered functions
343 cout << "Application functions:" << endl;
344 for( n = 0; n < (asUINT)engine->GetGlobalFunctionCount(); n++ )
345 {
346 asIScriptFunction *func = engine->GetGlobalFunctionByIndex(n);
347
348 // Skip the functions that start with _ as these are not meant to be called explicitly by the user
349 if( func->GetName()[0] != '_' )
350 cout << " " << func->GetDeclaration() << endl;
351 }
352
353 // List the user functions in the module
354 asIScriptModule *mod = engine->GetModule("console");
355 if( mod )
356 {
357 cout << endl;
358 cout << "User functions:" << endl;
359 for( n = 0; n < (asUINT)mod->GetFunctionCount(); n++ )
360 {
361 asIScriptFunction *func = mod->GetFunctionByIndex(n);
362 cout << " " << func->GetDeclaration() << endl;
363 }
364 }
365}
366
367void grab(int v)
368{

Callers 1

mainFunction · 0.85

Calls 7

GetDeclarationMethod · 0.80
GetFunctionCountMethod · 0.80
GetFunctionByIndexMethod · 0.80
GetNameMethod · 0.45
GetModuleMethod · 0.45

Tested by

no test coverage detected