Could somebody point me in the right direction of how I could read a binary file that is defined by a C struct? It has a few #define inside of the struct, which makes me thing t
You can also use unions to do this parsing if you have the data you want to parse already in memory.
union A {
char* buffer;
Format format;
};
A a;
a.buffer = stuff_you_want_to_parse;
// You can now access the members of the struct through the union.
if (a.format.str_name == "...")
// do stuff
Also remember that long could be different sizes on different platforms. If you are depending on long being a certain size, consider using the types defined int stdint.h such as uint32_t.