Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

28 lines
746 B

  1. #ifndef UINT16_H
  2. #define UINT16_H
  3. #include <inttypes.h>
  4. typedef uint16_t uint16;
  5. typedef int16_t int16;
  6. #if (defined(__i386__) || defined(__x86_64__)) && !defined(NO_UINT16_MACROS)
  7. #define uint16_pack(out,in) (*(uint16*)(out)=(in))
  8. #define uint16_unpack(in,out) (*(out)=*(uint16*)(in))
  9. #define uint16_read(in) (*(uint16*)(in))
  10. void uint16_pack_big(char *out,uint16 in);
  11. void uint16_unpack_big(const char *in,uint16* out);
  12. uint16 uint16_read_big(const char *in);
  13. #else
  14. void uint16_pack(char *out,uint16 in);
  15. void uint16_pack_big(char *out,uint16 in);
  16. void uint16_unpack(const char *in,uint16* out);
  17. void uint16_unpack_big(const char *in,uint16* out);
  18. uint16 uint16_read(const char *in);
  19. uint16 uint16_read_big(const char *in);
  20. #endif
  21. #endif