igtl_util.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __IGTL_UTIL_H
00018 #define __IGTL_UTIL_H
00019
00020 #include "igtl_win32header.h"
00021 #include "igtl_types.h"
00022
00023 #ifdef __cplusplus
00024 extern "C" {
00025 #endif
00026
00027
00028
00029
00030
00031
00032 #define BYTE_SWAP_INT16(S) (((S) & 0xFF) << 8 \
00033 | (((S) >> 8) & 0xFF))
00034 #define BYTE_SWAP_INT32(L) ((BYTE_SWAP_INT16 ((L) & 0xFFFF) << 16) \
00035 | BYTE_SWAP_INT16 (((L) >> 16) & 0xFFFF))
00036 #define BYTE_SWAP_INT64(LL) ((BYTE_SWAP_INT32 ((LL) & 0xFFFFFFFF) << 32) \
00037 | BYTE_SWAP_INT32 (((LL) >> 32) & 0xFFFFFFFF))
00038
00039
00040
00041
00042 int igtl_export igtl_is_little_endian();
00043 igtl_uint64 igtl_export crc64(unsigned char *data, int len, igtl_uint64 crc);
00044
00045
00046
00047
00048
00049
00050 igtl_uint32 igtl_export igtl_nanosec_to_frac(igtl_uint32 nanosec);
00051 igtl_uint32 igtl_export igtl_frac_to_nanosec(igtl_uint32 frac);
00052
00053 #ifdef __cplusplus
00054 }
00055 #endif
00056
00057 #endif
00058
00059