I have a file named Point.c which has a structure defined named as:
Point
Also, it has functions in it named point_str, point_deserialize.
Now, there are similar files like these like
LinkedList.c, Node.c etc with similar definitions.
Now, I am calling these functions dynamically in another file by using dlopen.
So, if I find that the type is Point, I will create a string:
point_str
and call the function by giving the path to the .so file using dlopen.
But, I am not able to know the size of the structure dynamically. Is there a way to do it? I want to do something like
int size = givemesize("Point", "path_to_so");
Which is just like dlopen but to know the size of a structure.
Edit: why I want to know the size?
With that size I am deserializing anything from string to its actual type. That's why I need the size. So, from command line it comes to deserialize a Point object. So, with that string I want to know the actual size of the Point object which resides in Point.c and has a libpoint.so