Well, I have an abstract virtual machine (" PAWN ") that runs from my code, and scripts can execute functions, these functions are registered in a script from C code that runs my C ++ code.
C ++ code must contain an array in the form
{ "name_i_want_the_function_to_have_in_the_script" , function_in_my_cpp_code }
if the function is not in the array, it cannot be executed. (because it does not exist ")
So this brings us to the following:
My functions look like this:
//Pawn Functions
and an array with information about script functions is in another file, for example:
AMX_NATIVE_INFO custom_Natives[] = { { "GetGameVersion", PawnFunc::GGV }, { 0,0 } };
and now the question is:
Is it possible to update this array? (before / during compilation or code initialization time)
since now I have to add each function manually. Which is sometimes annoying and more error prone.
I would like to change it so that I can:
//Pawn Functions
Is this even possible? If so, how can I achieve this?
maybe you can loop the namespace?
Edit: here is some kind of pseudo code: http://ideone.com/btG2lx
And also a note: I can do this at runtime, but then it needs to be done in DLLMain (my program is a DLL).