#include <inttypes.h>
#include <string.h>
#define BE_32(x) ((((uint8_t*)(x))[0] << 24) | \
(((uint8_t*)(x))[1] << 16) | \
(((uint8_t*)(x))[2] << 8) | \
((uint8_t*)(x))[3])
void put_be32_x(char *buf, unsigned int val)
{
buf[0] = val >> 24;
buf[1] = val >> 16;
buf[2] = val >> 8;
buf[3] = val;
}
int main(int argc, char** argv)
{
char src[64]={0x00,0x00,0x00,0x8,'f','t','y','p',0x00,0x00,'0','1','m','o','o','v'};
int size = BE_32(src);
printf("%c\n",src[8]);
printf("%c\n",src[12]);
printf("size=%d\n",size);
return 0;
}