I am working on a networking plugin for gamestudio. To implement remote procedure calls with an arbitrary number and types of parameters, I have to know some things about lite-c internals.

I've done a small test which confirms that the parameters of a function are stored in a single, contiguous piece of memory, and that each parameter takes 4 bytes.

Here is my test code:
Code:

void testfunc(char x, int y)
{
char* chrPtr = &x;
int* intPtr = chrPtr + 4;

STRING* tmp = str_create("");
error(str_for_num(tmp, *intPtr)); // prints y
}


I'd like to know if this is guaranteed to be that way, or if you plan to make changes. Are there any exceptions where such code would not behave as expected?

On the receiving end, I have to call a function from a lite-c function pointer in C++, with the received parameters (the parameters are stored in an array of bytes). Calling Lite-C functions from C++ with a Lite-C function pointer works, but I don't know how to pass the parameters if they are stored in a char array and I don't know the exact function signature.

So, given an array of bytes that contains the parameter data (in C++), how could I call a Lite-C function from a function pointer and set the parameters to the data in array? Basicly I need some way to copy over the data in the array to the piece of memory where the parameters are stored. Where is that piece of memory?

Do you think this kind of coding is dangerous? Should I just let the users serialize their own parameters into a char array and always use that as the parameter for a remote procedure call? (Less convenient for the users)