Init
This commit is contained in:
parent
a5cc146c1c
commit
81d1154b8f
49
APP/blf.c
49
APP/blf.c
|
|
@ -10,15 +10,16 @@
|
|||
#include <time.h>
|
||||
|
||||
/* -------------------------------------------------------------------------
|
||||
* Упакованные структуры BLF (повторяем из оригинального заголовка)
|
||||
* Упакованные структуры BLF
|
||||
* ------------------------------------------------------------------------- */
|
||||
#if defined(_MSC_VER)
|
||||
#ifdef _MSC_VER
|
||||
#pragma pack(push, 1)
|
||||
#define PACKED_STRUCT
|
||||
#else
|
||||
#define PACKED __attribute__((packed))
|
||||
#define PACKED_STRUCT __attribute__((packed))
|
||||
#endif
|
||||
|
||||
typedef struct PACKED {
|
||||
typedef struct {
|
||||
uint16_t year;
|
||||
uint16_t month;
|
||||
uint16_t dayOfWeek;
|
||||
|
|
@ -27,9 +28,9 @@ typedef struct PACKED {
|
|||
uint16_t minute;
|
||||
uint16_t second;
|
||||
uint16_t milliseconds;
|
||||
} SYSTEMTIME_PACKED;
|
||||
} PACKED_STRUCT SYSTEMTIME_PACKED;
|
||||
|
||||
typedef struct PACKED {
|
||||
typedef struct {
|
||||
uint32_t signature;
|
||||
uint32_t statisticsSize;
|
||||
uint32_t apiNumber;
|
||||
|
|
@ -45,33 +46,33 @@ typedef struct PACKED {
|
|||
SYSTEMTIME_PACKED lastObjectTime;
|
||||
uint64_t restorePointsOffset;
|
||||
uint32_t reservedFileStatistics[16];
|
||||
} FileHeader;
|
||||
} PACKED_STRUCT FileHeader;
|
||||
|
||||
typedef struct PACKED {
|
||||
typedef struct {
|
||||
uint32_t mSignature;
|
||||
uint16_t mHeaderSize;
|
||||
uint16_t mHeaderVersion;
|
||||
uint32_t mObjectSize;
|
||||
uint32_t mObjectType;
|
||||
} VBLObjectHeaderBase;
|
||||
} PACKED_STRUCT VBLObjectHeaderBase;
|
||||
|
||||
typedef struct PACKED {
|
||||
typedef struct {
|
||||
VBLObjectHeaderBase mBase;
|
||||
uint32_t mObjectFlags;
|
||||
uint16_t mClientIndex;
|
||||
uint16_t mObjectVersion;
|
||||
uint64_t mObjectTimeStamp;
|
||||
} VBLObjectHeader;
|
||||
} PACKED_STRUCT VBLObjectHeader;
|
||||
|
||||
typedef struct PACKED {
|
||||
typedef struct {
|
||||
uint16_t mChannel;
|
||||
uint8_t mFlags;
|
||||
uint8_t mDLC;
|
||||
uint32_t mID;
|
||||
uint8_t mData[8];
|
||||
} VBLCANMessage;
|
||||
} PACKED_STRUCT VBLCANMessage;
|
||||
|
||||
typedef struct PACKED {
|
||||
typedef struct {
|
||||
uint16_t mChannel;
|
||||
uint8_t mID;
|
||||
uint8_t mDLC;
|
||||
|
|
@ -83,9 +84,9 @@ typedef struct PACKED {
|
|||
uint16_t mCRC;
|
||||
uint8_t mDir;
|
||||
uint8_t mReserved;
|
||||
} VBLLINMessage;
|
||||
} PACKED_STRUCT VBLLINMessage;
|
||||
|
||||
typedef struct PACKED {
|
||||
typedef struct {
|
||||
uint16_t mChannel;
|
||||
uint8_t mID;
|
||||
uint8_t mDLC;
|
||||
|
|
@ -93,31 +94,29 @@ typedef struct PACKED {
|
|||
uint8_t mFSMState;
|
||||
uint8_t mHeaderTime;
|
||||
uint8_t mFullTime;
|
||||
} VBLLINSendError;
|
||||
} PACKED_STRUCT VBLLINSendError;
|
||||
|
||||
typedef struct PACKED {
|
||||
typedef struct {
|
||||
uint16_t compressionMethod;
|
||||
uint16_t reserved1;
|
||||
uint32_t reserved2;
|
||||
uint32_t uncompressedFileSize;
|
||||
uint32_t reserved3;
|
||||
} LogContainerData;
|
||||
} PACKED_STRUCT LogContainerData;
|
||||
|
||||
typedef struct PACKED {
|
||||
typedef struct {
|
||||
VBLObjectHeaderBase base;
|
||||
LogContainerData data;
|
||||
} ContainerHeader;
|
||||
} PACKED_STRUCT ContainerHeader;
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#ifdef _MSC_VER
|
||||
#pragma pack(pop)
|
||||
#else
|
||||
#undef PACKED
|
||||
#endif
|
||||
|
||||
/* -------------------------------------------------------------------------
|
||||
* Контекст (полное определение)
|
||||
* ------------------------------------------------------------------------- */
|
||||
typedef struct {
|
||||
typedef struct BLFContext {
|
||||
FILE* fp;
|
||||
FileHeader header;
|
||||
long headerPos;
|
||||
|
|
|
|||
Loading…
Reference in New Issue