pando_endian.h 896 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*******************************************************
  2. * File name: pando_endian.h
  3. * Author: LIJIAN
  4. * Versions: 0.1
  5. * Description: APIs to change endian between net and host machine.
  6. Net is big endian, host endian depends machine.
  7. * History:
  8. * 1.Date:
  9. * Author:
  10. * Modification:
  11. *********************************************************/
  12. #ifndef PANDO_ENDIAN_H
  13. #define PANDO_ENDIAN_H
  14. #ifdef __cplusplus
  15. extern "C"
  16. {
  17. #endif
  18. #include "common_functions.h"
  19. uint16_t net16_to_host(uint16_t A);
  20. uint32_t net32_to_host(uint32_t A);
  21. uint64_t net64_to_host(uint64_t A);
  22. float net32f_to_host(float A);
  23. double net64f_to_host(double A);
  24. #define host16_to_net net16_to_host
  25. #define host32_to_net net32_to_host
  26. #define host64_to_net net64_to_host
  27. #define host32f_to_net net32f_to_host
  28. #define host64f_to_net net64f_to_host
  29. #ifdef __cplusplus
  30. }
  31. #endif
  32. #endif