A
Angel
Hi folks,
I'm writing a program that can manipulate files in the format as
described on this site:
http://www.ugcs.caltech.edu/~jedwin/baldur_ITM.html
Basically, the file contains four bytes that form a string, then two
four bytes that form a 32-bit integer, and so on.
Currently I read the file with the fread() call and structures declared
like this:
struct item_v1_header
{
char signature[4];
char version[4];
uint32_t generic_name_strref;
<...>
} __attribute__((__packed__));
This works just fine, but I was wondering if there is a more
elegant/portable way to do it.
Your thoughts?
And yes, I know there are already tools out there that can manipulate
Infinite Engine stuff, I'm just doing this for entertainment and
education.
I'm writing a program that can manipulate files in the format as
described on this site:
http://www.ugcs.caltech.edu/~jedwin/baldur_ITM.html
Basically, the file contains four bytes that form a string, then two
four bytes that form a 32-bit integer, and so on.
Currently I read the file with the fread() call and structures declared
like this:
struct item_v1_header
{
char signature[4];
char version[4];
uint32_t generic_name_strref;
<...>
} __attribute__((__packed__));
This works just fine, but I was wondering if there is a more
elegant/portable way to do it.
Your thoughts?
And yes, I know there are already tools out there that can manipulate
Infinite Engine stuff, I'm just doing this for entertainment and
education.