Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

igtl_util.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   OpenIGTLink Library
00004   Module:    $HeadURL: http://svn.na-mic.org/NAMICSandBox/trunk/OpenIGTLink/Source/igtlutil/igtl_util.h $
00005   Language:  C
00006   Date:      $Date: 2010-01-25 00:18:45 -0500 (Mon, 25 Jan 2010) $
00007   Version:   $Revision: 5601 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010 
00011   This software is distributed WITHOUT ANY WARRANTY; without even
00012   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00013   PURPOSE.  See the above copyright notices for more information.
00014 
00015 =========================================================================*/
00016 
00017 #ifndef __IGTL_UTIL_H
00018 #define __IGTL_UTIL_H
00019 
00020 #include <stdio.h>
00021 #include "igtl_win32header.h"
00022 #include "igtl_types.h"
00023 
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027 
00028 /*
00029  * Byte order conversion macros
00030  *
00031  */
00032 
00033 #define BYTE_SWAP_INT16(S) (((S) & 0xFF) << 8 \
00034                             | (((S) >> 8) & 0xFF))
00035 #define BYTE_SWAP_INT32(L) ((BYTE_SWAP_INT16 ((L) & 0xFFFF) << 16) \
00036                             | BYTE_SWAP_INT16 (((L) >> 16) & 0xFFFF))
00037 #define BYTE_SWAP_INT64(LL) ((BYTE_SWAP_INT32 ((LL) & 0xFFFFFFFF) << 32) \
00038                              | BYTE_SWAP_INT32 (((LL) >> 32) & 0xFFFFFFFF))
00039 
00040 /*
00041  * Test endian of the host
00042  */
00043 int igtl_export igtl_is_little_endian();
00044 igtl_uint64 igtl_export crc64(unsigned char *data, igtl_uint64 len, igtl_uint64 crc);
00045 
00046 
00047 /*
00048  * Convert nanosecond to fraction / fraction to nanosec
00049  */
00050 
00051 igtl_uint32 igtl_export igtl_nanosec_to_frac(igtl_uint32 nanosec);
00052 igtl_uint32 igtl_export igtl_frac_to_nanosec(igtl_uint32 frac);
00053 void igtl_export igtl_message_dump_hex(FILE* stream, const void* message, int max_size);
00054 
00055 #ifdef __cplusplus
00056 }
00057 #endif
00058 
00059 #endif  /*__IGTL_UTIL_H*/
00060 
00061 

Generated at Mon May 2 2011 03:56:12 for OpenIGTLink by doxygen 1.7.3 written by Dimitri van Heesch, © 1997-2000