ocssw  1.0
/disk01/web/ocssw/build/src/neb2raw_seawifs/loghdr.h (r8090/r2592)
Go to the documentation of this file.
00001 /* loghdr.h - contains nebula file header structure definition */
00002 
00003 #include <stdint.h>
00004 
00005 struct LOGHDR {
00006     unsigned short int  headerVersion;
00007     unsigned short int  timeMode;
00008     uint32_t    blockSize;
00009     uint32_t    dataSize;
00010     unsigned short int  dataOffset;
00011     unsigned short int  headerMode;
00012     uint32_t    dataId;
00013     uint32_t    timeStamp;
00014     unsigned short int  timeXStamp;
00015     unsigned short int  statusWord;
00016     unsigned short int  dataMode;
00017     unsigned short int  groupNumber;
00018     uint32_t    localTimeStamp;
00019     unsigned short int  localTimeXStamp;
00020     unsigned short int  reserved;
00021 };
00022 
00023 
00024 typedef unsigned char           BYTE;
00025 typedef unsigned short int      WORD;
00026 typedef uint32_t      DWORD;
00027 typedef float                   IEEE_FLOAT;
00028 typedef double                  IEEE_DOUBLE;
00029 
00030 #define LOBYTE(w)           ((BYTE) (w & 0xFF))
00031 #define HIBYTE(w)           ((BYTE) (((WORD)(w) >> 8) & 0xFF))
00032 #define LOWORD(l)           ((WORD)(DWORD) (l & 0xFFFF))
00033 #define HIWORD(l)           ((WORD) (((DWORD)(l) >> 16) & 0xFFFF))
00034 
00035 #define SWAP_WORD(w)        ((WORD) ((WORD)HIBYTE(w)|(((WORD)LOBYTE(w))<<8)))
00036 #define SWAP_LONG(l)        ((DWORD) ((DWORD)SWAP_WORD(HIWORD(l))) \
00037                                     | ((DWORD)(SWAP_WORD(LOWORD(l)))<<16))
00038 
00039 #define HDR_WORD(w)         ((swap)?SWAP_WORD(w):w)
00040 #define HDR_LONG(l)         ((swap)?SWAP_LONG(l):l)
00041 
00042