VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
trpage_swap.h
Go to the documentation of this file.
1 /* ************************
2  Copyright Terrain Experts Inc.
3  Terrain Experts Inc (TERREX) reserves all rights to this source code
4  unless otherwise specified in writing by the President of TERREX.
5  This copyright may be updated in the future, in which case that version
6  supercedes this one.
7  -------------------
8  Terrex Experts Inc.
9  4400 East Broadway #314
10  Tucson, AZ 85711
11  info@terrex.com
12  Tel: (520) 323-7990
13  ************************
14  */
15 
16 #ifndef trpage_swap_h_
17 #define trpage_swap_h_
18 
19 /* trpage_swap.h
20  Byte swapping utility functions.
21  */
22 
24 
25 #include <osgdb_vrftxp/trpage_io.h>
26 
29 short trpg_byteswap_short( short number );
32 TX_CPPDECL int trpg_byteswap_int( int number );
35 long trpg_byteswap_long( long number );
41 void trpg_byteswap_float_to_4bytes( float number, char result[4] );
44 void trpg_byteswap_double_to_8bytes( double number, char result[8] );
47 float trpg_byteswap_4bytes_to_float( const char result[4] );
50 double trpg_byteswap_8bytes_to_double( const char result[8] );
54 
57 void trpg_swap_two ( const char *in, char *out );
60 void trpg_swap_four ( const char *in, char *out );
63 void trpg_swap_eight ( const char *in, char *out );
66 void trpg_swap_sixteen ( const char *in, char *out );
67 
68 #endif
trpgllong trpg_byteswap_llong(trpgllong number)
Byte swap and return a 64 bit long {group:Byte Ordering Utilities}.
trpgEndian
Used to specify machine endianess.
Definition: trpage_io.h:314
void trpg_swap_sixteen(const char *in, char *out)
Swap sixteen chars {group:Byte Ordering Utilities}.
void trpg_swap_four(const char *in, char *out)
Swap 4 chars {group:Byte Ordering Utilities}.
double trpg_byteswap_8bytes_to_double(const char result[8])
Swap 8 bytes into a double and return it {group:Byte Ordering Utilities}.
short trpg_byteswap_short(short number)
Byte swap and return a short {group:Byte Ordering Utilities}.
long trpg_byteswap_long(long number)
Byte swap and return a long {group:Byte Ordering Utilities}.
#define TX_CPPDECL
Exports a C++ function properly in a windows DLL.
Definition: trdll.h:71
void trpg_swap_eight(const char *in, char *out)
Swap 8 chars {group:Byte Ordering Utilities}.
int64 trpgllong
We use long longs for addresses within a paging file.
Definition: trpage_sys.h:96
void trpg_byteswap_double_to_8bytes(double number, char result[8])
Byte swap a double value into 8 characters. We do it this way to avoid floating point exceptions...
void trpg_swap_two(const char *in, char *out)
Swap two chars {group:Byte Ordering Utilities}.
float trpg_byteswap_4bytes_to_float(const char result[4])
Swap 4 bytes into a float and return it {group:Byte Ordering Utilities}.
TX_CPPDECL int trpg_byteswap_int(int number)
Byte swap and return an integer {group:Byte Ordering Utilities}.
void trpg_byteswap_float_to_4bytes(float number, char result[4])
Byte swap a float value into 4 characters. We do it this way to avoid floating point exceptions...
TX_CPPDECL trpgEndian trpg_cpu_byte_order(void)
Determine the current CPU&#39;s byte ordering {group:Byte Ordering Utilities}.

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)