#include #include #include void int16_store(unsigned char *s,int16_t x) { x = htole16(x); memcpy(s,&x,sizeof x); }