93 lines
1.7 KiB
C
93 lines
1.7 KiB
C
#ifndef _ZD_TYPES_H_
|
|
#define _ZD_TYPES_H_
|
|
|
|
//various types
|
|
#if 0
|
|
typedef unsigned char BYTE;
|
|
typedef unsigned char BOOLEAN;
|
|
typedef unsigned short WORD;
|
|
typedef unsigned long DWORD;
|
|
typedef unsigned long long QWORD; /* Unsigned 64 bit quantity*/
|
|
#endif
|
|
#include <stdint.h>
|
|
|
|
typedef uint8_t BYTE;
|
|
typedef uint8_t BOOLEAN;
|
|
typedef uint16_t WORD;
|
|
typedef uint32_t DWORD;
|
|
typedef uint64_t QWORD;
|
|
|
|
typedef int8_t CHAR;
|
|
typedef int16_t SHORT;
|
|
typedef int32_t LONG;
|
|
typedef int64_t QLONG;
|
|
|
|
#pragma pack(1)
|
|
typedef union {
|
|
BYTE byte[3];
|
|
struct {
|
|
WORD millisecond;
|
|
BYTE minute : 6;
|
|
BYTE RES1 : 1;
|
|
BYTE IV : 1;
|
|
};
|
|
} unionCP24Time;
|
|
|
|
typedef union {
|
|
BYTE byte[4];
|
|
struct {
|
|
WORD millisecond;
|
|
BYTE minute : 6;
|
|
BYTE RES1 : 1;
|
|
BYTE IV : 1;
|
|
BYTE hour : 5;
|
|
BYTE RES2 : 2;
|
|
BYTE SU : 1;
|
|
};
|
|
} unionCP32Time;
|
|
|
|
typedef union {
|
|
BYTE byte[7];
|
|
struct {
|
|
WORD millisecond;
|
|
BYTE minute : 6;
|
|
BYTE RES1 : 1;
|
|
BYTE IV : 1;
|
|
BYTE hour : 5;
|
|
BYTE RES2 : 2;
|
|
BYTE SU : 1;
|
|
BYTE dayofmonth : 5;
|
|
BYTE dayofweek : 3;
|
|
BYTE month : 4;
|
|
BYTE RES3 : 4;
|
|
BYTE year : 7;
|
|
BYTE RES4 : 1;
|
|
};
|
|
} unionCP56Time;
|
|
#pragma pack()
|
|
|
|
/*
|
|
typedef struct {
|
|
WORD year;
|
|
WORD month;
|
|
WORD day;
|
|
WORD hour;
|
|
WORD minute;
|
|
WORD second;
|
|
WORD millsecond;
|
|
} SystemTime;
|
|
*/
|
|
//const various
|
|
#ifndef TRUE
|
|
#define TRUE (BOOLEAN)1
|
|
#endif
|
|
|
|
#ifndef FALSE
|
|
#define FALSE (BOOLEAN)0
|
|
#endif
|
|
|
|
#define NO_USE(a)
|
|
|
|
#endif //_ZD_TYPES_H_
|
|
|