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.

46 lines
984 B

21 years ago
21 years ago
21 years ago
21 years ago
21 years ago
  1. /* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
  2. #ifndef UINT32_H
  3. #define UINT32_H
  4. #include <inttypes.h>
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. typedef uint32_t uint32;
  9. typedef int32_t int32;
  10. #if (defined(__i386__) || defined(__x86_64__)) && !defined(NO_UINT32_MACROS)
  11. static inline void uint32_pack(char* out,uint32 in) {
  12. *(uint32*)out=in;
  13. }
  14. static inline void uint32_unpack(const char *in,uint32* out) {
  15. *out=*(uint32*)in;
  16. }
  17. static inline uint32 uint32_read(const char* in) {
  18. return *(uint32*)in;
  19. }
  20. void uint32_pack_big(char *out,uint32 in);
  21. void uint32_unpack_big(const char *in,uint32* out);
  22. uint32 uint32_read_big(const char *in);
  23. #else
  24. void uint32_pack(char *out,uint32 in);
  25. void uint32_pack_big(char *out,uint32 in);
  26. void uint32_unpack(const char *in,uint32* out);
  27. void uint32_unpack_big(const char *in,uint32* out);
  28. uint32 uint32_read(const char *in);
  29. uint32 uint32_read_big(const char *in);
  30. #endif
  31. #ifdef __cplusplus
  32. }
  33. #endif
  34. #endif