I'm building a Swift wrapper / interface for a pre-compiled C library that is shipped with its' own header file. I have every function working except for the following. The library reads given parts of the loaded file's header. I have a struct that looks like this:
typedef struct {
DWORD width;
DWORD height;
DWORD length;
const void *data;
} T_PICTURE;
and a function in said library that returns a UnsafePointer<Int8> pointer when it is given a readable file (a part of a specific metadata, a picture to be exact).
My question is: how am I able to assign the data at the given memory location to a struct of that kind?
I would like to assign that space in memory to a struct of that kind, but so far I have been unable to.
I'm positive that because I'm relatively new to programming I'm missing something crucial or at the very least I don't see something fundamental. Been looking around for days now before deciding to ask, thank you in advance!