convert_endian.h
1 /***************************************************************************
2  *
3  * Copyright (C) 1999 by Willem van Straten
4  * Licensed under the Academic Free License version 2.1
5  *
6  ***************************************************************************/
7 // psrchive/Base/Formats/Timer/convert_endian.h
8 
9 #ifndef __CONVERT_ENDIAN_H
10 #define __CONVERT_ENDIAN_H
11 
12 #include "machine_endian.h"
13 
14 #include "timer.h"
15 #include "band.h"
16 #include "mini.h"
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 void timerChangeEndian (struct timer * hdr);
22 void bandChangeEndian (struct band *b);
23 void miniChangeEndian (struct mini * m);
24 #ifdef __cplusplus
25 }
26 #endif
27 
28 #if MACHINE_LITTLE_ENDIAN
29 #define timer_toBigEndian(p) timerChangeEndian(p)
30 #define timer_toLittleEndian(p)
31 #define timer_fromBigEndian(p) timerChangeEndian(p)
32 #define timer_fromLittleEndian(p)
33 
34 #define mini_toBigEndian(p) miniChangeEndian(p)
35 #define mini_toLittleEndian(p)
36 #define mini_fromBigEndian(p) miniChangeEndian(p)
37 #define mini_fromLittleEndian(p)
38 
39 #define band_toBigEndian(p) bandChangeEndian(p)
40 #define band_toLittleEndian(p)
41 #define band_fromBigEndian(p) bandChangeEndian(p)
42 #define band_fromLittleEndian(p)
43 #else
44 #define timer_toBigEndian(p)
45 #define timer_toLittleEndian(p) timerChangeEndian(p)
46 #define timer_fromBigEndian(p)
47 #define timer_fromLittleEndian(p) timerChangeEndian(p)
48 
49 #define mini_toBigEndian(p)
50 #define mini_toLittleEndian(p) miniChangeEndian(p)
51 #define mini_fromBigEndian(p)
52 #define mini_fromLittleEndian(p) miniChangeEndian(p)
53 
54 #define band_toBigEndian(p)
55 #define band_toLittleEndian(p) bandChangeEndian(p)
56 #define band_fromBigEndian(p)
57 #define band_fromLittleEndian(p) bandChangeEndian(p)
58 #endif
59 
60 #endif /* ndef __CONVERT_ENDIAN_H */
61 

Generated using doxygen 1.8.17