OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
loghdr.h
Go to the documentation of this file.
1 /* loghdr.h - contains nebula file header structure definition */
2 
3 #include <stdint.h>
4 
5 struct LOGHDR {
6  unsigned short int headerVersion;
7  unsigned short int timeMode;
8  uint32_t blockSize;
9  uint32_t dataSize;
10  unsigned short int dataOffset;
11  unsigned short int headerMode;
12  uint32_t dataId;
13  uint32_t timeStamp;
14  unsigned short int timeXStamp;
15  unsigned short int statusWord;
16  unsigned short int dataMode;
17  unsigned short int groupNumber;
18  uint32_t localTimeStamp;
19  unsigned short int localTimeXStamp;
20  unsigned short int reserved;
21 };
22 
23 
24 typedef unsigned char BYTE;
25 typedef unsigned short int WORD;
26 typedef uint32_t DWORD;
27 typedef float IEEE_FLOAT;
28 typedef double IEEE_DOUBLE;
29 
30 #define LOBYTE(w) ((BYTE) (w & 0xFF))
31 #define HIBYTE(w) ((BYTE) (((WORD)(w) >> 8) & 0xFF))
32 #define LOWORD(l) ((WORD)(DWORD) (l & 0xFFFF))
33 #define HIWORD(l) ((WORD) (((DWORD)(l) >> 16) & 0xFFFF))
34 
35 #define SWAP_WORD(w) ((WORD) ((WORD)HIBYTE(w)|(((WORD)LOBYTE(w))<<8)))
36 #define SWAP_LONG(l) ((DWORD) ((DWORD)SWAP_WORD(HIWORD(l))) \
37  | ((DWORD)(SWAP_WORD(LOWORD(l)))<<16))
38 
39 #define HDR_WORD(w) ((swap)?SWAP_WORD(w):w)
40 #define HDR_LONG(l) ((swap)?SWAP_LONG(l):l)
41 
42 
Definition: loghdr.h:5
unsigned short int reserved
Definition: loghdr.h:20
uint32_t timeStamp
Definition: loghdr.h:13
unsigned char BYTE
Definition: loghdr.h:24
uint32_t localTimeStamp
Definition: loghdr.h:18
unsigned short int groupNumber
Definition: loghdr.h:17
unsigned short int dataMode
Definition: loghdr.h:16
uint32_t dataId
Definition: loghdr.h:12
float IEEE_FLOAT
Definition: loghdr.h:27
unsigned short int timeMode
Definition: loghdr.h:7
unsigned short int dataOffset
Definition: loghdr.h:10
uint32_t blockSize
Definition: loghdr.h:8
unsigned short int headerMode
Definition: loghdr.h:11
unsigned short int WORD
Definition: loghdr.h:25
unsigned short int statusWord
Definition: loghdr.h:15
unsigned short int timeXStamp
Definition: loghdr.h:14
double IEEE_DOUBLE
Definition: loghdr.h:28
uint32_t dataSize
Definition: loghdr.h:9
unsigned short int localTimeXStamp
Definition: loghdr.h:19
unsigned short int headerVersion
Definition: loghdr.h:6
uint32_t DWORD
Definition: loghdr.h:26