Main Page
Namespace List
Class Hierarchy
Alphabetical List
Compound List
File List
Namespace Members
Compound Members
File Members
Source
igtlutil
igtl_util.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: OpenIGTLink Library
4
Module: $HeadURL: http://svn.na-mic.org/NAMICSandBox/trunk/OpenIGTLink/Source/igtlutil/igtl_util.h $
5
Language: C
6
Date: $Date: 2010-01-25 00:18:45 -0500 (Mon, 25 Jan 2010) $
7
Version: $Revision: 5601 $
8
9
Copyright (c) Insight Software Consortium. All rights reserved.
10
11
This software is distributed WITHOUT ANY WARRANTY; without even
12
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13
PURPOSE. See the above copyright notices for more information.
14
15
=========================================================================*/
16
17
#ifndef __IGTL_UTIL_H
18
#define __IGTL_UTIL_H
19
20
#include <stdio.h>
21
#include "
igtl_win32header.h
"
22
#include "
igtl_types.h
"
23
24
#ifdef __cplusplus
25
extern
"C"
{
26
#endif
27
28
/*
29
* Byte order conversion macros
30
*
31
*/
32
33
#define BYTE_SWAP_INT16(S) (((S) & 0xFF) << 8 \
34
| (((S) >> 8) & 0xFF))
35
#define BYTE_SWAP_INT32(L) ((BYTE_SWAP_INT16 ((L) & 0xFFFF) << 16) \
36
| BYTE_SWAP_INT16 (((L) >> 16) & 0xFFFF))
37
#define BYTE_SWAP_INT64(LL) ((BYTE_SWAP_INT32 ((LL) & 0xFFFFFFFF) << 32) \
38
| BYTE_SWAP_INT32 (((LL) >> 32) & 0xFFFFFFFF))
39
40
/*
41
* Test endian of the host
42
*/
43
int
igtl_export
igtl_is_little_endian
();
44
igtl_uint64
igtl_export
crc64
(
unsigned
char
*data, igtl_uint64 len, igtl_uint64 crc);
45
46
47
/*
48
* Convert nanosecond to fraction / fraction to nanosec
49
*/
50
51
igtl_uint32
igtl_export
igtl_nanosec_to_frac
(igtl_uint32 nanosec);
52
igtl_uint32
igtl_export
igtl_frac_to_nanosec
(igtl_uint32 frac);
53
void
igtl_export
igtl_message_dump_hex
(FILE* stream,
const
void
* message,
int
max_size);
54
55
#ifdef __cplusplus
56
}
57
#endif
58
59
#endif
/*__IGTL_UTIL_H*/
60
61
Generated at Thu Mar 20 2014 16:32:06 for OpenIGTLink by
1.8.1.2 written by
Dimitri van Heesch
, © 1997-2000