srv.h

来自「3号作品是分析WarCraft III游戏的replay文件的命令行工具」· C头文件 代码 · 共 63 行

H
63
字号
/* the public header file for project SRV */

#ifndef __SRV_H__
#define __SRV_H__

#include <stdio.h>

typedef unsigned long  DWORD;
typedef unsigned short WORD;
typedef unsigned char  BYTE;

extern FILE  *in;

struct replay_sub_header_0 __attribute__ ((__packed__)) {
  WORD  minor_ver;  // 0 so far
  WORD  major_ver;  // For patch 1.xx
  WORD  build;
  WORD  flags; // 0x8000 in LAN/multi, 0x0000 in single
  DWORD length_ms;
  DWORD checksum; // CRC32 checksum of header
};

struct replay_sub_header_1 __attribute__ ((__packed__)) {
  DWORD ver_str; // WAR3 or W3XP for normal vs. expansion
  DWORD major_ver;  // For patch 1.xx
  WORD  build;
  WORD  flags; // 0x8000 in LAN/multi, 0x0000 in single
  DWORD length_ms;
  DWORD checksum; // CRC32 checksum of header
};

struct replay_header __attribute__ ((__packed__)) {
  char  header[28]; // reads Warcraft III recorded game...
  DWORD offset;
  DWORD size;
  DWORD header_ver;
  DWORD uncomp_size;
  DWORD blocks; // number of 8192K blocks
  union {
    struct replay_sub_header_0 sub_0;
    struct replay_sub_header_1 sub_1;
  };
};

struct replay_block_header __attribute__ ((__packed__)) {
  WORD  size;
  WORD  uncomp_size;
  DWORD unknown; // possible checksum?
  void *data;
};

struct slot_s {
  int  status; /* status == -1: not exist *
                *            0: open      *
                *            1: closed    *
                *            2: computer  *
                *            3: observer  *
                *            4: player    */
  char *name;
};

#endif //__SRV_H__

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?