Thanks for using Compiler Explorer
Sponsors
Jakt
C++
Ada
Algol68
Analysis
Android Java
Android Kotlin
Assembly
C
C3
Carbon
C with Coccinelle
C++ with Coccinelle
C++ (Circle)
CIRCT
Clean
Clojure
CMake
CMakeScript
COBOL
C++ for OpenCL
MLIR
Cppx
Cppx-Blue
Cppx-Gold
Cpp2-cppfront
Crystal
C#
CUDA C++
D
Dart
Elixir
Erlang
Fortran
F#
GLSL
Go
Haskell
HLSL
Hook
Hylo
IL
ispc
Java
Julia
Kotlin
LLVM IR
LLVM MIR
Modula-2
Mojo
Nim
Numba
Nix
Objective-C
Objective-C++
OCaml
Odin
OpenCL C
Pascal
Pony
PTX
Python
Racket
Raku
Ruby
Rust
Sail
Snowball
Scala
Slang
Solidity
Spice
SPIR-V
Swift
LLVM TableGen
Toit
Triton
TypeScript Native
V
Vala
Visual Basic
Vyper
WASM
Yul (Solidity IR)
Zig
Javascript
GIMPLE
Ygen
sway
c++ source #1
Output
Compile to binary object
Link to binary
Execute the code
Intel asm syntax
Demangle identifiers
Verbose demangling
Filters
Unused labels
Library functions
Directives
Comments
Horizontal whitespace
Debug intrinsics
Compiler
6502-c++ 11.1.0
ARM GCC 10.2.0
ARM GCC 10.3.0
ARM GCC 10.4.0
ARM GCC 10.5.0
ARM GCC 11.1.0
ARM GCC 11.2.0
ARM GCC 11.3.0
ARM GCC 11.4.0
ARM GCC 12.1.0
ARM GCC 12.2.0
ARM GCC 12.3.0
ARM GCC 12.4.0
ARM GCC 12.5.0
ARM GCC 13.1.0
ARM GCC 13.2.0
ARM GCC 13.2.0 (unknown-eabi)
ARM GCC 13.3.0
ARM GCC 13.3.0 (unknown-eabi)
ARM GCC 13.4.0
ARM GCC 13.4.0 (unknown-eabi)
ARM GCC 14.1.0
ARM GCC 14.1.0 (unknown-eabi)
ARM GCC 14.2.0
ARM GCC 14.2.0 (unknown-eabi)
ARM GCC 14.3.0
ARM GCC 14.3.0 (unknown-eabi)
ARM GCC 15.1.0
ARM GCC 15.1.0 (unknown-eabi)
ARM GCC 15.2.0
ARM GCC 15.2.0 (unknown-eabi)
ARM GCC 4.5.4
ARM GCC 4.6.4
ARM GCC 5.4
ARM GCC 6.3.0
ARM GCC 6.4.0
ARM GCC 7.3.0
ARM GCC 7.5.0
ARM GCC 8.2.0
ARM GCC 8.5.0
ARM GCC 9.3.0
ARM GCC 9.4.0
ARM GCC 9.5.0
ARM GCC trunk
ARM gcc 10.2.1 (none)
ARM gcc 10.3.1 (2021.07 none)
ARM gcc 10.3.1 (2021.10 none)
ARM gcc 11.2.1 (none)
ARM gcc 5.4.1 (none)
ARM gcc 7.2.1 (none)
ARM gcc 8.2 (WinCE)
ARM gcc 8.3.1 (none)
ARM gcc 9.2.1 (none)
ARM msvc v19.0 (ex-WINE)
ARM msvc v19.10 (ex-WINE)
ARM msvc v19.14 (ex-WINE)
ARM64 Morello gcc 10.1 Alpha 2
ARM64 gcc 10.2
ARM64 gcc 10.3
ARM64 gcc 10.4
ARM64 gcc 10.5.0
ARM64 gcc 11.1
ARM64 gcc 11.2
ARM64 gcc 11.3
ARM64 gcc 11.4.0
ARM64 gcc 12.1
ARM64 gcc 12.2.0
ARM64 gcc 12.3.0
ARM64 gcc 12.4.0
ARM64 gcc 12.5.0
ARM64 gcc 13.1.0
ARM64 gcc 13.2.0
ARM64 gcc 13.3.0
ARM64 gcc 13.4.0
ARM64 gcc 14.1.0
ARM64 gcc 14.2.0
ARM64 gcc 14.3.0
ARM64 gcc 15.1.0
ARM64 gcc 15.2.0
ARM64 gcc 4.9.4
ARM64 gcc 5.4
ARM64 gcc 5.5.0
ARM64 gcc 6.3
ARM64 gcc 6.4
ARM64 gcc 7.3
ARM64 gcc 7.5
ARM64 gcc 8.2
ARM64 gcc 8.5
ARM64 gcc 9.3
ARM64 gcc 9.4
ARM64 gcc 9.5
ARM64 gcc trunk
ARM64 msvc v19.14 (ex-WINE)
AVR gcc 10.3.0
AVR gcc 11.1.0
AVR gcc 12.1.0
AVR gcc 12.2.0
AVR gcc 12.3.0
AVR gcc 12.4.0
AVR gcc 12.5.0
AVR gcc 13.1.0
AVR gcc 13.2.0
AVR gcc 13.3.0
AVR gcc 13.4.0
AVR gcc 14.1.0
AVR gcc 14.2.0
AVR gcc 14.3.0
AVR gcc 15.1.0
AVR gcc 15.2.0
AVR gcc 4.5.4
AVR gcc 4.6.4
AVR gcc 5.4.0
AVR gcc 9.2.0
AVR gcc 9.3.0
Arduino Mega (1.8.9)
Arduino Uno (1.8.9)
BPF clang (trunk)
BPF clang 13.0.0
BPF clang 14.0.0
BPF clang 15.0.0
BPF clang 16.0.0
BPF clang 17.0.1
BPF clang 18.1.0
BPF clang 19.1.0
BPF clang 20.1.0
BPF clang 21.1.0
EDG (experimental reflection)
EDG 6.5
EDG 6.5 (GNU mode gcc 13)
EDG 6.6
EDG 6.6 (GNU mode gcc 13)
EDG 6.7
EDG 6.7 (GNU mode gcc 14)
FRC 2019
FRC 2020
FRC 2023
HPPA gcc 14.2.0
HPPA gcc 14.3.0
HPPA gcc 15.1.0
HPPA gcc 15.2.0
KVX ACB 4.1.0 (GCC 7.5.0)
KVX ACB 4.1.0-cd1 (GCC 7.5.0)
KVX ACB 4.10.0 (GCC 10.3.1)
KVX ACB 4.11.1 (GCC 10.3.1)
KVX ACB 4.12.0 (GCC 11.3.0)
KVX ACB 4.2.0 (GCC 7.5.0)
KVX ACB 4.3.0 (GCC 7.5.0)
KVX ACB 4.4.0 (GCC 7.5.0)
KVX ACB 4.6.0 (GCC 9.4.1)
KVX ACB 4.8.0 (GCC 9.4.1)
KVX ACB 4.9.0 (GCC 9.4.1)
KVX ACB 5.0.0 (GCC 12.2.1)
KVX ACB 5.2.0 (GCC 13.2.1)
LoongArch64 clang (trunk)
LoongArch64 clang 17.0.1
LoongArch64 clang 18.1.0
LoongArch64 clang 19.1.0
LoongArch64 clang 20.1.0
LoongArch64 clang 21.1.0
M68K gcc 13.1.0
M68K gcc 13.2.0
M68K gcc 13.3.0
M68K gcc 13.4.0
M68K gcc 14.1.0
M68K gcc 14.2.0
M68K gcc 14.3.0
M68K gcc 15.1.0
M68K gcc 15.2.0
M68k clang (trunk)
MRISC32 gcc (trunk)
MSP430 gcc 4.5.3
MSP430 gcc 5.3.0
MSP430 gcc 6.2.1
MinGW clang 14.0.3
MinGW clang 14.0.6
MinGW clang 15.0.7
MinGW clang 16.0.0
MinGW clang 16.0.2
MinGW gcc 11.3.0
MinGW gcc 12.1.0
MinGW gcc 12.2.0
MinGW gcc 13.1.0
MinGW gcc 14.3.0
MinGW gcc 15.2.0
RISC-V (32-bits) gcc (trunk)
RISC-V (32-bits) gcc 10.2.0
RISC-V (32-bits) gcc 10.3.0
RISC-V (32-bits) gcc 11.2.0
RISC-V (32-bits) gcc 11.3.0
RISC-V (32-bits) gcc 11.4.0
RISC-V (32-bits) gcc 12.1.0
RISC-V (32-bits) gcc 12.2.0
RISC-V (32-bits) gcc 12.3.0
RISC-V (32-bits) gcc 12.4.0
RISC-V (32-bits) gcc 12.5.0
RISC-V (32-bits) gcc 13.1.0
RISC-V (32-bits) gcc 13.2.0
RISC-V (32-bits) gcc 13.3.0
RISC-V (32-bits) gcc 13.4.0
RISC-V (32-bits) gcc 14.1.0
RISC-V (32-bits) gcc 14.2.0
RISC-V (32-bits) gcc 14.3.0
RISC-V (32-bits) gcc 15.1.0
RISC-V (32-bits) gcc 15.2.0
RISC-V (32-bits) gcc 8.2.0
RISC-V (32-bits) gcc 8.5.0
RISC-V (32-bits) gcc 9.4.0
RISC-V (64-bits) gcc (trunk)
RISC-V (64-bits) gcc 10.2.0
RISC-V (64-bits) gcc 10.3.0
RISC-V (64-bits) gcc 11.2.0
RISC-V (64-bits) gcc 11.3.0
RISC-V (64-bits) gcc 11.4.0
RISC-V (64-bits) gcc 12.1.0
RISC-V (64-bits) gcc 12.2.0
RISC-V (64-bits) gcc 12.3.0
RISC-V (64-bits) gcc 12.4.0
RISC-V (64-bits) gcc 12.5.0
RISC-V (64-bits) gcc 13.1.0
RISC-V (64-bits) gcc 13.2.0
RISC-V (64-bits) gcc 13.3.0
RISC-V (64-bits) gcc 13.4.0
RISC-V (64-bits) gcc 14.1.0
RISC-V (64-bits) gcc 14.2.0
RISC-V (64-bits) gcc 14.3.0
RISC-V (64-bits) gcc 15.1.0
RISC-V (64-bits) gcc 15.2.0
RISC-V (64-bits) gcc 8.2.0
RISC-V (64-bits) gcc 8.5.0
RISC-V (64-bits) gcc 9.4.0
RISC-V rv32gc clang (trunk)
RISC-V rv32gc clang 10.0.0
RISC-V rv32gc clang 10.0.1
RISC-V rv32gc clang 11.0.0
RISC-V rv32gc clang 11.0.1
RISC-V rv32gc clang 12.0.0
RISC-V rv32gc clang 12.0.1
RISC-V rv32gc clang 13.0.0
RISC-V rv32gc clang 13.0.1
RISC-V rv32gc clang 14.0.0
RISC-V rv32gc clang 15.0.0
RISC-V rv32gc clang 16.0.0
RISC-V rv32gc clang 17.0.1
RISC-V rv32gc clang 18.1.0
RISC-V rv32gc clang 19.1.0
RISC-V rv32gc clang 20.1.0
RISC-V rv32gc clang 21.1.0
RISC-V rv32gc clang 9.0.0
RISC-V rv32gc clang 9.0.1
RISC-V rv64gc clang (trunk)
RISC-V rv64gc clang 10.0.0
RISC-V rv64gc clang 10.0.1
RISC-V rv64gc clang 11.0.0
RISC-V rv64gc clang 11.0.1
RISC-V rv64gc clang 12.0.0
RISC-V rv64gc clang 12.0.1
RISC-V rv64gc clang 13.0.0
RISC-V rv64gc clang 13.0.1
RISC-V rv64gc clang 14.0.0
RISC-V rv64gc clang 15.0.0
RISC-V rv64gc clang 16.0.0
RISC-V rv64gc clang 17.0.1
RISC-V rv64gc clang 18.1.0
RISC-V rv64gc clang 19.1.0
RISC-V rv64gc clang 20.1.0
RISC-V rv64gc clang 21.1.0
RISC-V rv64gc clang 9.0.0
RISC-V rv64gc clang 9.0.1
Raspbian Buster
Raspbian Stretch
SPARC LEON gcc 12.2.0
SPARC LEON gcc 12.3.0
SPARC LEON gcc 12.4.0
SPARC LEON gcc 12.5.0
SPARC LEON gcc 13.1.0
SPARC LEON gcc 13.2.0
SPARC LEON gcc 13.3.0
SPARC LEON gcc 13.4.0
SPARC LEON gcc 14.1.0
SPARC LEON gcc 14.2.0
SPARC LEON gcc 14.3.0
SPARC LEON gcc 15.1.0
SPARC LEON gcc 15.2.0
SPARC gcc 12.2.0
SPARC gcc 12.3.0
SPARC gcc 12.4.0
SPARC gcc 12.5.0
SPARC gcc 13.1.0
SPARC gcc 13.2.0
SPARC gcc 13.3.0
SPARC gcc 13.4.0
SPARC gcc 14.1.0
SPARC gcc 14.2.0
SPARC gcc 14.3.0
SPARC gcc 15.1.0
SPARC gcc 15.2.0
SPARC64 gcc 12.2.0
SPARC64 gcc 12.3.0
SPARC64 gcc 12.4.0
SPARC64 gcc 12.5.0
SPARC64 gcc 13.1.0
SPARC64 gcc 13.2.0
SPARC64 gcc 13.3.0
SPARC64 gcc 13.4.0
SPARC64 gcc 14.1.0
SPARC64 gcc 14.2.0
SPARC64 gcc 14.3.0
SPARC64 gcc 15.1.0
SPARC64 gcc 15.2.0
TI C6x gcc 12.2.0
TI C6x gcc 12.3.0
TI C6x gcc 12.4.0
TI C6x gcc 12.5.0
TI C6x gcc 13.1.0
TI C6x gcc 13.2.0
TI C6x gcc 13.3.0
TI C6x gcc 13.4.0
TI C6x gcc 14.1.0
TI C6x gcc 14.2.0
TI C6x gcc 14.3.0
TI C6x gcc 15.1.0
TI C6x gcc 15.2.0
TI CL430 21.6.1
Tricore gcc 11.3.0 (EEESlab)
VAX gcc NetBSDELF 10.4.0
VAX gcc NetBSDELF 10.5.0 (Nov 15 03:50:22 2023)
VAX gcc NetBSDELF 12.4.0 (Apr 16 05:27 2025)
WebAssembly clang (trunk)
Xtensa ESP32 gcc 11.2.0 (2022r1)
Xtensa ESP32 gcc 12.2.0 (20230208)
Xtensa ESP32 gcc 14.2.0 (20241119)
Xtensa ESP32 gcc 8.2.0 (2019r2)
Xtensa ESP32 gcc 8.2.0 (2020r1)
Xtensa ESP32 gcc 8.2.0 (2020r2)
Xtensa ESP32 gcc 8.4.0 (2020r3)
Xtensa ESP32 gcc 8.4.0 (2021r1)
Xtensa ESP32 gcc 8.4.0 (2021r2)
Xtensa ESP32-S2 gcc 11.2.0 (2022r1)
Xtensa ESP32-S2 gcc 12.2.0 (20230208)
Xtensa ESP32-S2 gcc 14.2.0 (20241119)
Xtensa ESP32-S2 gcc 8.2.0 (2019r2)
Xtensa ESP32-S2 gcc 8.2.0 (2020r1)
Xtensa ESP32-S2 gcc 8.2.0 (2020r2)
Xtensa ESP32-S2 gcc 8.4.0 (2020r3)
Xtensa ESP32-S2 gcc 8.4.0 (2021r1)
Xtensa ESP32-S2 gcc 8.4.0 (2021r2)
Xtensa ESP32-S3 gcc 11.2.0 (2022r1)
Xtensa ESP32-S3 gcc 12.2.0 (20230208)
Xtensa ESP32-S3 gcc 14.2.0 (20241119)
Xtensa ESP32-S3 gcc 8.4.0 (2020r3)
Xtensa ESP32-S3 gcc 8.4.0 (2021r1)
Xtensa ESP32-S3 gcc 8.4.0 (2021r2)
arm64 msvc v19.20 VS16.0
arm64 msvc v19.21 VS16.1
arm64 msvc v19.22 VS16.2
arm64 msvc v19.23 VS16.3
arm64 msvc v19.24 VS16.4
arm64 msvc v19.25 VS16.5
arm64 msvc v19.27 VS16.7
arm64 msvc v19.28 VS16.8
arm64 msvc v19.28 VS16.9
arm64 msvc v19.29 VS16.10
arm64 msvc v19.29 VS16.11
arm64 msvc v19.30 VS17.0
arm64 msvc v19.31 VS17.1
arm64 msvc v19.32 VS17.2
arm64 msvc v19.33 VS17.3
arm64 msvc v19.34 VS17.4
arm64 msvc v19.35 VS17.5
arm64 msvc v19.36 VS17.6
arm64 msvc v19.37 VS17.7
arm64 msvc v19.38 VS17.8
arm64 msvc v19.39 VS17.9
arm64 msvc v19.40 VS17.10
arm64 msvc v19.41 VS17.11
arm64 msvc v19.42 VS17.12
arm64 msvc v19.43 VS17.13
arm64 msvc v19.latest
armv7-a clang (trunk)
armv7-a clang 10.0.0
armv7-a clang 10.0.1
armv7-a clang 11.0.0
armv7-a clang 11.0.1
armv7-a clang 12.0.0
armv7-a clang 12.0.1
armv7-a clang 13.0.0
armv7-a clang 13.0.1
armv7-a clang 14.0.0
armv7-a clang 15.0.0
armv7-a clang 16.0.0
armv7-a clang 17.0.1
armv7-a clang 18.1.0
armv7-a clang 19.1.0
armv7-a clang 20.1.0
armv7-a clang 21.1.0
armv7-a clang 9.0.0
armv7-a clang 9.0.1
armv8-a clang (all architectural features, trunk)
armv8-a clang (trunk)
armv8-a clang 10.0.0
armv8-a clang 10.0.1
armv8-a clang 11.0.0
armv8-a clang 11.0.1
armv8-a clang 12.0.0
armv8-a clang 13.0.0
armv8-a clang 14.0.0
armv8-a clang 15.0.0
armv8-a clang 16.0.0
armv8-a clang 17.0.1
armv8-a clang 18.1.0
armv8-a clang 19.1.0
armv8-a clang 20.1.0
armv8-a clang 21.1.0
armv8-a clang 9.0.0
armv8-a clang 9.0.1
clad trunk (clang 21.1.0)
clad v1.10 (clang 20.1.0)
clad v1.8 (clang 18.1.0)
clad v1.9 (clang 19.1.0)
clad v2.00 (clang 20.1.0)
clad v2.1 (clang 21.1.0)
clang-cl 18.1.0
ellcc 0.1.33
ellcc 0.1.34
ellcc 2017-07-16
ez80-clang 15.0.0
ez80-clang 15.0.7
hexagon-clang 16.0.5
llvm-mos atari2600-3e
llvm-mos atari2600-4k
llvm-mos atari2600-common
llvm-mos atari5200-supercart
llvm-mos atari8-cart-megacart
llvm-mos atari8-cart-std
llvm-mos atari8-cart-xegs
llvm-mos atari8-common
llvm-mos atari8-dos
llvm-mos c128
llvm-mos c64
llvm-mos commodore
llvm-mos cpm65
llvm-mos cx16
llvm-mos dodo
llvm-mos eater
llvm-mos mega65
llvm-mos nes
llvm-mos nes-action53
llvm-mos nes-cnrom
llvm-mos nes-gtrom
llvm-mos nes-mmc1
llvm-mos nes-mmc3
llvm-mos nes-nrom
llvm-mos nes-unrom
llvm-mos nes-unrom-512
llvm-mos osi-c1p
llvm-mos pce
llvm-mos pce-cd
llvm-mos pce-common
llvm-mos pet
llvm-mos rp6502
llvm-mos rpc8e
llvm-mos supervision
llvm-mos vic20
loongarch64 gcc 12.2.0
loongarch64 gcc 12.3.0
loongarch64 gcc 12.4.0
loongarch64 gcc 12.5.0
loongarch64 gcc 13.1.0
loongarch64 gcc 13.2.0
loongarch64 gcc 13.3.0
loongarch64 gcc 13.4.0
loongarch64 gcc 14.1.0
loongarch64 gcc 14.2.0
loongarch64 gcc 14.3.0
loongarch64 gcc 15.1.0
loongarch64 gcc 15.2.0
mips clang 13.0.0
mips clang 14.0.0
mips clang 15.0.0
mips clang 16.0.0
mips clang 17.0.1
mips clang 18.1.0
mips clang 19.1.0
mips clang 20.1.0
mips clang 21.1.0
mips gcc 11.2.0
mips gcc 12.1.0
mips gcc 12.2.0
mips gcc 12.3.0
mips gcc 12.4.0
mips gcc 12.5.0
mips gcc 13.1.0
mips gcc 13.2.0
mips gcc 13.3.0
mips gcc 13.4.0
mips gcc 14.1.0
mips gcc 14.2.0
mips gcc 14.3.0
mips gcc 15.1.0
mips gcc 15.2.0
mips gcc 4.9.4
mips gcc 5.4
mips gcc 5.5.0
mips gcc 9.3.0 (codescape)
mips gcc 9.5.0
mips64 (el) gcc 12.1.0
mips64 (el) gcc 12.2.0
mips64 (el) gcc 12.3.0
mips64 (el) gcc 12.4.0
mips64 (el) gcc 12.5.0
mips64 (el) gcc 13.1.0
mips64 (el) gcc 13.2.0
mips64 (el) gcc 13.3.0
mips64 (el) gcc 13.4.0
mips64 (el) gcc 14.1.0
mips64 (el) gcc 14.2.0
mips64 (el) gcc 14.3.0
mips64 (el) gcc 15.1.0
mips64 (el) gcc 15.2.0
mips64 (el) gcc 4.9.4
mips64 (el) gcc 5.4.0
mips64 (el) gcc 5.5.0
mips64 (el) gcc 9.5.0
mips64 clang 13.0.0
mips64 clang 14.0.0
mips64 clang 15.0.0
mips64 clang 16.0.0
mips64 clang 17.0.1
mips64 clang 18.1.0
mips64 clang 19.1.0
mips64 clang 20.1.0
mips64 clang 21.1.0
mips64 gcc 11.2.0
mips64 gcc 12.1.0
mips64 gcc 12.2.0
mips64 gcc 12.3.0
mips64 gcc 12.4.0
mips64 gcc 12.5.0
mips64 gcc 13.1.0
mips64 gcc 13.2.0
mips64 gcc 13.3.0
mips64 gcc 13.4.0
mips64 gcc 14.1.0
mips64 gcc 14.2.0
mips64 gcc 14.3.0
mips64 gcc 15.1.0
mips64 gcc 15.2.0
mips64 gcc 4.9.4
mips64 gcc 5.4.0
mips64 gcc 5.5.0
mips64 gcc 9.5.0
mips64el clang 13.0.0
mips64el clang 14.0.0
mips64el clang 15.0.0
mips64el clang 16.0.0
mips64el clang 17.0.1
mips64el clang 18.1.0
mips64el clang 19.1.0
mips64el clang 20.1.0
mips64el clang 21.1.0
mipsel clang 13.0.0
mipsel clang 14.0.0
mipsel clang 15.0.0
mipsel clang 16.0.0
mipsel clang 17.0.1
mipsel clang 18.1.0
mipsel clang 19.1.0
mipsel clang 20.1.0
mipsel clang 21.1.0
mipsel gcc 12.1.0
mipsel gcc 12.2.0
mipsel gcc 12.3.0
mipsel gcc 12.4.0
mipsel gcc 12.5.0
mipsel gcc 13.1.0
mipsel gcc 13.2.0
mipsel gcc 13.3.0
mipsel gcc 13.4.0
mipsel gcc 14.1.0
mipsel gcc 14.2.0
mipsel gcc 14.3.0
mipsel gcc 15.1.0
mipsel gcc 15.2.0
mipsel gcc 4.9.4
mipsel gcc 5.4.0
mipsel gcc 5.5.0
mipsel gcc 9.5.0
nanoMIPS gcc 6.3.0 (mtk)
power gcc 11.2.0
power gcc 12.1.0
power gcc 12.2.0
power gcc 12.3.0
power gcc 12.4.0
power gcc 12.5.0
power gcc 13.1.0
power gcc 13.2.0
power gcc 13.3.0
power gcc 13.4.0
power gcc 14.1.0
power gcc 14.2.0
power gcc 14.3.0
power gcc 15.1.0
power gcc 15.2.0
power gcc 4.8.5
power64 AT12.0 (gcc8)
power64 AT13.0 (gcc9)
power64 gcc 11.2.0
power64 gcc 12.1.0
power64 gcc 12.2.0
power64 gcc 12.3.0
power64 gcc 12.4.0
power64 gcc 12.5.0
power64 gcc 13.1.0
power64 gcc 13.2.0
power64 gcc 13.3.0
power64 gcc 13.4.0
power64 gcc 14.1.0
power64 gcc 14.2.0
power64 gcc 14.3.0
power64 gcc 15.1.0
power64 gcc 15.2.0
power64 gcc trunk
power64le AT12.0 (gcc8)
power64le AT13.0 (gcc9)
power64le clang (trunk)
power64le gcc 11.2.0
power64le gcc 12.1.0
power64le gcc 12.2.0
power64le gcc 12.3.0
power64le gcc 12.4.0
power64le gcc 12.5.0
power64le gcc 13.1.0
power64le gcc 13.2.0
power64le gcc 13.3.0
power64le gcc 13.4.0
power64le gcc 14.1.0
power64le gcc 14.2.0
power64le gcc 14.3.0
power64le gcc 15.1.0
power64le gcc 15.2.0
power64le gcc 6.3.0
power64le gcc trunk
powerpc64 clang (trunk)
qnx 8.0.0
s390x gcc 11.2.0
s390x gcc 12.1.0
s390x gcc 12.2.0
s390x gcc 12.3.0
s390x gcc 12.4.0
s390x gcc 12.5.0
s390x gcc 13.1.0
s390x gcc 13.2.0
s390x gcc 13.3.0
s390x gcc 13.4.0
s390x gcc 14.1.0
s390x gcc 14.2.0
s390x gcc 14.3.0
s390x gcc 15.1.0
s390x gcc 15.2.0
sh gcc 12.2.0
sh gcc 12.3.0
sh gcc 12.4.0
sh gcc 12.5.0
sh gcc 13.1.0
sh gcc 13.2.0
sh gcc 13.3.0
sh gcc 13.4.0
sh gcc 14.1.0
sh gcc 14.2.0
sh gcc 14.3.0
sh gcc 15.1.0
sh gcc 15.2.0
sh gcc 4.9.4
sh gcc 9.5.0
vast (trunk)
x64 msvc v19.0 (ex-WINE)
x64 msvc v19.10 (ex-WINE)
x64 msvc v19.14 (ex-WINE)
x64 msvc v19.20 VS16.0
x64 msvc v19.21 VS16.1
x64 msvc v19.22 VS16.2
x64 msvc v19.23 VS16.3
x64 msvc v19.24 VS16.4
x64 msvc v19.25 VS16.5
x64 msvc v19.27 VS16.7
x64 msvc v19.28 VS16.8
x64 msvc v19.28 VS16.9
x64 msvc v19.29 VS16.10
x64 msvc v19.29 VS16.11
x64 msvc v19.30 VS17.0
x64 msvc v19.31 VS17.1
x64 msvc v19.32 VS17.2
x64 msvc v19.33 VS17.3
x64 msvc v19.34 VS17.4
x64 msvc v19.35 VS17.5
x64 msvc v19.36 VS17.6
x64 msvc v19.37 VS17.7
x64 msvc v19.38 VS17.8
x64 msvc v19.39 VS17.9
x64 msvc v19.40 VS17.10
x64 msvc v19.41 VS17.11
x64 msvc v19.42 VS17.12
x64 msvc v19.43 VS17.13
x64 msvc v19.latest
x86 djgpp 4.9.4
x86 djgpp 5.5.0
x86 djgpp 6.4.0
x86 djgpp 7.2.0
x86 msvc v19.0 (ex-WINE)
x86 msvc v19.10 (ex-WINE)
x86 msvc v19.14 (ex-WINE)
x86 msvc v19.20 VS16.0
x86 msvc v19.21 VS16.1
x86 msvc v19.22 VS16.2
x86 msvc v19.23 VS16.3
x86 msvc v19.24 VS16.4
x86 msvc v19.25 VS16.5
x86 msvc v19.27 VS16.7
x86 msvc v19.28 VS16.8
x86 msvc v19.28 VS16.9
x86 msvc v19.29 VS16.10
x86 msvc v19.29 VS16.11
x86 msvc v19.30 VS17.0
x86 msvc v19.31 VS17.1
x86 msvc v19.32 VS17.2
x86 msvc v19.33 VS17.3
x86 msvc v19.34 VS17.4
x86 msvc v19.35 VS17.5
x86 msvc v19.36 VS17.6
x86 msvc v19.37 VS17.7
x86 msvc v19.38 VS17.8
x86 msvc v19.39 VS17.9
x86 msvc v19.40 VS17.10
x86 msvc v19.41 VS17.11
x86 msvc v19.42 VS17.12
x86 msvc v19.43 VS17.13
x86 msvc v19.latest
x86 nvc++ 22.11
x86 nvc++ 22.7
x86 nvc++ 22.9
x86 nvc++ 23.1
x86 nvc++ 23.11
x86 nvc++ 23.3
x86 nvc++ 23.5
x86 nvc++ 23.7
x86 nvc++ 23.9
x86 nvc++ 24.1
x86 nvc++ 24.11
x86 nvc++ 24.3
x86 nvc++ 24.5
x86 nvc++ 24.7
x86 nvc++ 24.9
x86 nvc++ 25.1
x86 nvc++ 25.3
x86 nvc++ 25.5
x86 nvc++ 25.7
x86 nvc++ 25.9
x86-64 Zapcc 190308
x86-64 clang (-fimplicit-constexpr)
x86-64 clang (Chris Bazley N3089)
x86-64 clang (EricWF contracts)
x86-64 clang (amd-staging)
x86-64 clang (assertions trunk)
x86-64 clang (clangir)
x86-64 clang (experimental -Wlifetime)
x86-64 clang (experimental P1061)
x86-64 clang (experimental P1144)
x86-64 clang (experimental P1221)
x86-64 clang (experimental P2998)
x86-64 clang (experimental P3068)
x86-64 clang (experimental P3309)
x86-64 clang (experimental P3334)
x86-64 clang (experimental P3367)
x86-64 clang (experimental P3372)
x86-64 clang (experimental P3385)
x86-64 clang (experimental P3776)
x86-64 clang (experimental metaprogramming - P2632)
x86-64 clang (old concepts branch)
x86-64 clang (p1974)
x86-64 clang (pattern matching - P2688)
x86-64 clang (reflection - C++26)
x86-64 clang (reflection - TS)
x86-64 clang (resugar)
x86-64 clang (string interpolation - P3412)
x86-64 clang (thephd.dev)
x86-64 clang (trunk)
x86-64 clang (variadic friends - P2893)
x86-64 clang (widberg)
x86-64 clang 10.0.0
x86-64 clang 10.0.0 (assertions)
x86-64 clang 10.0.1
x86-64 clang 11.0.0
x86-64 clang 11.0.0 (assertions)
x86-64 clang 11.0.1
x86-64 clang 12.0.0
x86-64 clang 12.0.0 (assertions)
x86-64 clang 12.0.1
x86-64 clang 13.0.0
x86-64 clang 13.0.0 (assertions)
x86-64 clang 13.0.1
x86-64 clang 14.0.0
x86-64 clang 14.0.0 (assertions)
x86-64 clang 15.0.0
x86-64 clang 15.0.0 (assertions)
x86-64 clang 16.0.0
x86-64 clang 16.0.0 (assertions)
x86-64 clang 17.0.1
x86-64 clang 17.0.1 (assertions)
x86-64 clang 18.1.0
x86-64 clang 18.1.0 (assertions)
x86-64 clang 19.1.0
x86-64 clang 19.1.0 (assertions)
x86-64 clang 2.6.0 (assertions)
x86-64 clang 2.7.0 (assertions)
x86-64 clang 2.8.0 (assertions)
x86-64 clang 2.9.0 (assertions)
x86-64 clang 20.1.0
x86-64 clang 20.1.0 (assertions)
x86-64 clang 21.1.0
x86-64 clang 21.1.0 (assertions)
x86-64 clang 3.0.0
x86-64 clang 3.0.0 (assertions)
x86-64 clang 3.1
x86-64 clang 3.1 (assertions)
x86-64 clang 3.2
x86-64 clang 3.2 (assertions)
x86-64 clang 3.3
x86-64 clang 3.3 (assertions)
x86-64 clang 3.4 (assertions)
x86-64 clang 3.4.1
x86-64 clang 3.5
x86-64 clang 3.5 (assertions)
x86-64 clang 3.5.1
x86-64 clang 3.5.2
x86-64 clang 3.6
x86-64 clang 3.6 (assertions)
x86-64 clang 3.7
x86-64 clang 3.7 (assertions)
x86-64 clang 3.7.1
x86-64 clang 3.8
x86-64 clang 3.8 (assertions)
x86-64 clang 3.8.1
x86-64 clang 3.9.0
x86-64 clang 3.9.0 (assertions)
x86-64 clang 3.9.1
x86-64 clang 4.0.0
x86-64 clang 4.0.0 (assertions)
x86-64 clang 4.0.1
x86-64 clang 5.0.0
x86-64 clang 5.0.0 (assertions)
x86-64 clang 5.0.1
x86-64 clang 5.0.2
x86-64 clang 6.0.0
x86-64 clang 6.0.0 (assertions)
x86-64 clang 6.0.1
x86-64 clang 7.0.0
x86-64 clang 7.0.0 (assertions)
x86-64 clang 7.0.1
x86-64 clang 7.1.0
x86-64 clang 8.0.0
x86-64 clang 8.0.0 (assertions)
x86-64 clang 8.0.1
x86-64 clang 9.0.0
x86-64 clang 9.0.0 (assertions)
x86-64 clang 9.0.1
x86-64 clang rocm-4.5.2
x86-64 clang rocm-5.0.2
x86-64 clang rocm-5.1.3
x86-64 clang rocm-5.2.3
x86-64 clang rocm-5.3.3
x86-64 clang rocm-5.7.0
x86-64 clang rocm-6.0.2
x86-64 clang rocm-6.1.2
x86-64 clang rocm-6.2.4
x86-64 clang rocm-6.3.3
x86-64 clang rocm-6.4.0
x86-64 clang rocm-7.0.1
x86-64 gcc (C++26 reflection)
x86-64 gcc (P2034 lambdas)
x86-64 gcc (contract labels)
x86-64 gcc (contracts natural syntax)
x86-64 gcc (contracts)
x86-64 gcc (coroutines)
x86-64 gcc (modules)
x86-64 gcc (trunk)
x86-64 gcc 10.1
x86-64 gcc 10.2
x86-64 gcc 10.3
x86-64 gcc 10.3 (assertions)
x86-64 gcc 10.4
x86-64 gcc 10.4 (assertions)
x86-64 gcc 10.5
x86-64 gcc 10.5 (assertions)
x86-64 gcc 11.1
x86-64 gcc 11.1 (assertions)
x86-64 gcc 11.2
x86-64 gcc 11.2 (assertions)
x86-64 gcc 11.3
x86-64 gcc 11.3 (assertions)
x86-64 gcc 11.4
x86-64 gcc 11.4 (assertions)
x86-64 gcc 12.1
x86-64 gcc 12.1 (assertions)
x86-64 gcc 12.2
x86-64 gcc 12.2 (assertions)
x86-64 gcc 12.3
x86-64 gcc 12.3 (assertions)
x86-64 gcc 12.4
x86-64 gcc 12.4 (assertions)
x86-64 gcc 12.5
x86-64 gcc 12.5 (assertions)
x86-64 gcc 13.1
x86-64 gcc 13.1 (assertions)
x86-64 gcc 13.2
x86-64 gcc 13.2 (assertions)
x86-64 gcc 13.3
x86-64 gcc 13.3 (assertions)
x86-64 gcc 13.4
x86-64 gcc 13.4 (assertions)
x86-64 gcc 14.1
x86-64 gcc 14.1 (assertions)
x86-64 gcc 14.2
x86-64 gcc 14.2 (assertions)
x86-64 gcc 14.3
x86-64 gcc 14.3 (assertions)
x86-64 gcc 15.1
x86-64 gcc 15.1 (assertions)
x86-64 gcc 15.2
x86-64 gcc 15.2 (assertions)
x86-64 gcc 3.4.6
x86-64 gcc 4.0.4
x86-64 gcc 4.1.2
x86-64 gcc 4.4.7
x86-64 gcc 4.5.3
x86-64 gcc 4.6.4
x86-64 gcc 4.7.1
x86-64 gcc 4.7.2
x86-64 gcc 4.7.3
x86-64 gcc 4.7.4
x86-64 gcc 4.8.1
x86-64 gcc 4.8.2
x86-64 gcc 4.8.3
x86-64 gcc 4.8.4
x86-64 gcc 4.8.5
x86-64 gcc 4.9.0
x86-64 gcc 4.9.1
x86-64 gcc 4.9.2
x86-64 gcc 4.9.3
x86-64 gcc 4.9.4
x86-64 gcc 5.1
x86-64 gcc 5.2
x86-64 gcc 5.3
x86-64 gcc 5.4
x86-64 gcc 5.5
x86-64 gcc 6.1
x86-64 gcc 6.2
x86-64 gcc 6.3
x86-64 gcc 6.4
x86-64 gcc 6.5
x86-64 gcc 7.1
x86-64 gcc 7.2
x86-64 gcc 7.3
x86-64 gcc 7.4
x86-64 gcc 7.5
x86-64 gcc 8.1
x86-64 gcc 8.2
x86-64 gcc 8.3
x86-64 gcc 8.4
x86-64 gcc 8.5
x86-64 gcc 9.1
x86-64 gcc 9.2
x86-64 gcc 9.3
x86-64 gcc 9.4
x86-64 gcc 9.5
x86-64 icc 13.0.1
x86-64 icc 16.0.3
x86-64 icc 17.0.0
x86-64 icc 18.0.0
x86-64 icc 19.0.0
x86-64 icc 19.0.1
x86-64 icc 2021.1.2
x86-64 icc 2021.10.0
x86-64 icc 2021.2.0
x86-64 icc 2021.3.0
x86-64 icc 2021.4.0
x86-64 icc 2021.5.0
x86-64 icc 2021.6.0
x86-64 icc 2021.7.0
x86-64 icc 2021.7.1
x86-64 icc 2021.8.0
x86-64 icc 2021.9.0
x86-64 icx 2021.1.2
x86-64 icx 2021.2.0
x86-64 icx 2021.3.0
x86-64 icx 2021.4.0
x86-64 icx 2022.0.0
x86-64 icx 2022.1.0
x86-64 icx 2022.2.0
x86-64 icx 2022.2.1
x86-64 icx 2023.0.0
x86-64 icx 2023.1.0
x86-64 icx 2023.2.1
x86-64 icx 2024.0.0
x86-64 icx 2024.1.0
x86-64 icx 2024.2.0
x86-64 icx 2024.2.1
x86-64 icx 2025.0.0
x86-64 icx 2025.0.1
x86-64 icx 2025.0.3
x86-64 icx 2025.0.4
x86-64 icx 2025.1.0
x86-64 icx 2025.1.1
x86-64 icx 2025.2.0
x86-64 icx 2025.2.1
x86-64 icx 2025.2.1
z180-clang 15.0.0
z180-clang 15.0.7
z80-clang 15.0.0
z80-clang 15.0.7
zig c++ 0.10.0
zig c++ 0.11.0
zig c++ 0.12.0
zig c++ 0.12.1
zig c++ 0.13.0
zig c++ 0.14.0
zig c++ 0.14.1
zig c++ 0.15.1
zig c++ 0.6.0
zig c++ 0.7.0
zig c++ 0.7.1
zig c++ 0.8.0
zig c++ 0.9.0
zig c++ trunk
Options
Source code
#pragma pack(push,_CRT_PACKING) typedef __builtin_va_list __gnuc_va_list; typedef __gnuc_va_list va_list; #pragma pack(pop) void __attribute__((__cdecl__)) __debugbreak(void); extern __inline__ __attribute__((__always_inline__,__gnu_inline__)) void __attribute__((__cdecl__)) __debugbreak(void) { __asm__ __volatile__("int {$}3":); } const char *__mingw_get_crt_info (void); #pragma pack(push,_CRT_PACKING) __extension__ typedef unsigned long long size_t; __extension__ typedef long long ssize_t; typedef size_t rsize_t; __extension__ typedef long long intptr_t; __extension__ typedef unsigned long long uintptr_t; __extension__ typedef long long ptrdiff_t; typedef unsigned short wchar_t; typedef unsigned short wint_t; typedef unsigned short wctype_t; typedef int errno_t; typedef long __time32_t; __extension__ typedef long long __time64_t; typedef __time64_t time_t; struct threadlocaleinfostruct; struct threadmbcinfostruct; typedef struct threadlocaleinfostruct *pthreadlocinfo; typedef struct threadmbcinfostruct *pthreadmbcinfo; struct __lc_time_data; typedef struct localeinfo_struct { pthreadlocinfo locinfo; pthreadmbcinfo mbcinfo; } _locale_tstruct,*_locale_t; typedef struct tagLC_ID { unsigned short wLanguage; unsigned short wCountry; unsigned short wCodePage; } LC_ID,*LPLC_ID; typedef struct threadlocaleinfostruct { int refcount; unsigned int lc_codepage; unsigned int lc_collate_cp; unsigned long lc_handle[6]; LC_ID lc_id[6]; struct { char *locale; wchar_t *wlocale; int *refcount; int *wrefcount; } lc_category[6]; int lc_clike; int mb_cur_max; int *lconv_intl_refcount; int *lconv_num_refcount; int *lconv_mon_refcount; struct lconv *lconv; int *ctype1_refcount; unsigned short *ctype1; const unsigned short *pctype; const unsigned char *pclmap; const unsigned char *pcumap; struct __lc_time_data *lc_time_curr; } threadlocinfo; #pragma pack(pop) #pragma pack(push,_CRT_PACKING) struct _iobuf { char *_ptr; int _cnt; char *_base; int _flag; int _file; int _charbuf; int _bufsiz; char *_tmpfname; }; typedef struct _iobuf FILE; typedef long _off_t; typedef long off32_t; __extension__ typedef long long _off64_t; __extension__ typedef long long off64_t; typedef off32_t off_t; __attribute__ ((__dllimport__)) FILE *__attribute__((__cdecl__)) __acrt_iob_func(unsigned index); __attribute__ ((__dllimport__)) FILE *__attribute__((__cdecl__)) __iob_func(void); __extension__ typedef long long fpos_t; extern __attribute__((__format__ (gnu_scanf, 2, 3))) __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) __mingw_sscanf(const char * __restrict__ _Src,const char * __restrict__ _Format,...); extern __attribute__((__format__ (gnu_scanf, 2, 0))) __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) __mingw_vsscanf (const char * __restrict__ _Str,const char * __restrict__ Format,va_list argp); extern __attribute__((__format__ (gnu_scanf, 1, 2))) __attribute__ ((__nonnull__ (1))) int __attribute__((__cdecl__)) __mingw_scanf(const char * __restrict__ _Format,...); extern __attribute__((__format__ (gnu_scanf, 1, 0))) __attribute__ ((__nonnull__ (1))) int __attribute__((__cdecl__)) __mingw_vscanf(const char * __restrict__ Format, va_list argp); extern __attribute__((__format__ (gnu_scanf, 2, 3))) __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) __mingw_fscanf(FILE * __restrict__ _File,const char * __restrict__ _Format,...); extern __attribute__((__format__ (gnu_scanf, 2, 0))) __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) __mingw_vfscanf (FILE * __restrict__ fp, const char * __restrict__ Format,va_list argp); extern __attribute__((__format__ (gnu_printf, 3, 0))) __attribute__ ((__nonnull__ (3))) int __attribute__((__cdecl__)) __mingw_vsnprintf(char * __restrict__ _DstBuf,size_t _MaxCount,const char * __restrict__ _Format, va_list _ArgList); extern __attribute__((__format__ (gnu_printf, 3, 4))) __attribute__ ((__nonnull__ (3))) int __attribute__((__cdecl__)) __mingw_snprintf(char * __restrict__ s, size_t n, const char * __restrict__ format, ...); extern __attribute__((__format__ (gnu_printf, 1, 2))) __attribute__ ((__nonnull__ (1))) int __attribute__((__cdecl__)) __mingw_printf(const char * __restrict__ , ... ) __attribute__ ((__nothrow__)); extern __attribute__((__format__ (gnu_printf, 1, 0))) __attribute__ ((__nonnull__ (1))) int __attribute__((__cdecl__)) __mingw_vprintf (const char * __restrict__ , va_list) __attribute__ ((__nothrow__)); extern __attribute__((__format__ (gnu_printf, 2, 3))) __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) __mingw_fprintf (FILE * __restrict__ , const char * __restrict__ , ...) __attribute__ ((__nothrow__)); extern __attribute__((__format__ (gnu_printf, 2, 0))) __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) __mingw_vfprintf (FILE * __restrict__ , const char * __restrict__ , va_list) __attribute__ ((__nothrow__)); extern __attribute__((__format__ (gnu_printf, 2, 3))) __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) __mingw_sprintf (char * __restrict__ , const char * __restrict__ , ...) __attribute__ ((__nothrow__)); extern __attribute__((__format__ (gnu_printf, 2, 0))) __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) __mingw_vsprintf (char * __restrict__ , const char * __restrict__ , va_list) __attribute__ ((__nothrow__)); extern __attribute__((__format__ (gnu_printf, 2, 3))) __attribute__((nonnull (1,2))) int __attribute__((__cdecl__)) __mingw_asprintf(char ** __restrict__ , const char * __restrict__ , ...) __attribute__ ((__nothrow__)); extern __attribute__((__format__ (gnu_printf, 2, 0))) __attribute__((nonnull (1,2))) int __attribute__((__cdecl__)) __mingw_vasprintf(char ** __restrict__ , const char * __restrict__ , va_list) __attribute__ ((__nothrow__)); __attribute__((__format__ (ms_printf, 2, 3))) __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) fprintf(FILE * __restrict__ _File,const char * __restrict__ _Format,...); __attribute__((__format__ (ms_printf, 1, 2))) __attribute__ ((__nonnull__ (1))) int __attribute__((__cdecl__)) printf(const char * __restrict__ _Format,...); __attribute__((__format__ (ms_printf, 2, 3))) __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) sprintf(char * __restrict__ _Dest,const char * __restrict__ _Format,...) ; __attribute__((__format__ (ms_printf, 2, 0))) __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) vfprintf(FILE * __restrict__ _File,const char * __restrict__ _Format,va_list _ArgList); __attribute__((__format__ (ms_printf, 1, 0))) __attribute__ ((__nonnull__ (1))) int __attribute__((__cdecl__)) vprintf(const char * __restrict__ _Format,va_list _ArgList); __attribute__((__format__ (ms_printf, 2, 0))) __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) vsprintf(char * __restrict__ _Dest,const char * __restrict__ _Format,va_list _Args) ; __attribute__((__format__ (ms_scanf, 2, 3))) __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) fscanf(FILE * __restrict__ _File,const char * __restrict__ _Format,...) ; __attribute__((__format__ (ms_scanf, 1, 2))) __attribute__ ((__nonnull__ (1))) int __attribute__((__cdecl__)) scanf(const char * __restrict__ _Format,...) ; __attribute__((__format__ (ms_scanf, 2, 3))) __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) sscanf(const char * __restrict__ _Src,const char * __restrict__ _Format,...) ; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wshadow" __attribute__((__format__ (ms_scanf, 1, 0))) __attribute__ ((__nonnull__ (1))) int __attribute__((__cdecl__)) __ms_vscanf(const char * __restrict__ Format, va_list argp); __attribute__((__format__ (ms_scanf, 2, 0))) __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) __ms_vfscanf (FILE * __restrict__ fp, const char * __restrict__ Format,va_list argp); __attribute__((__format__ (ms_scanf, 2, 0))) __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) __ms_vsscanf (const char * __restrict__ _Str,const char * __restrict__ Format,va_list argp); static __attribute__ ((__unused__)) __inline__ __attribute__((__cdecl__)) __attribute__((__format__ (ms_scanf, 2, 0))) __attribute__ ((__nonnull__ (2))) int vfscanf (FILE *__stream, const char *__format, __builtin_va_list __local_argv) { return __ms_vfscanf (__stream, __format, __local_argv); } static __attribute__ ((__unused__)) __inline__ __attribute__((__cdecl__)) __attribute__((__format__ (ms_scanf, 2, 0))) __attribute__ ((__nonnull__ (2))) int vsscanf (const char * __restrict__ __source, const char * __restrict__ __format, __builtin_va_list __local_argv) { return __ms_vsscanf( __source, __format, __local_argv ); } static __attribute__ ((__unused__)) __inline__ __attribute__((__cdecl__)) __attribute__((__format__ (ms_scanf, 1, 0))) __attribute__ ((__nonnull__ (1))) int vscanf(const char *__format, __builtin_va_list __local_argv) { return __ms_vscanf (__format, __local_argv); } #pragma GCC diagnostic pop __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _filbuf(FILE *_File); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _flsbuf(int _Ch,FILE *_File); __attribute__ ((__dllimport__)) FILE *__attribute__((__cdecl__)) _fsopen(const char *_Filename,const char *_Mode,int _ShFlag); void __attribute__((__cdecl__)) clearerr(FILE *_File); int __attribute__((__cdecl__)) fclose(FILE *_File); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _fcloseall(void); __attribute__ ((__dllimport__)) FILE *__attribute__((__cdecl__)) _fdopen(int _FileHandle,const char *_Mode); int __attribute__((__cdecl__)) feof(FILE *_File); int __attribute__((__cdecl__)) ferror(FILE *_File); int __attribute__((__cdecl__)) fflush(FILE *_File); int __attribute__((__cdecl__)) fgetc(FILE *_File); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _fgetchar(void); int __attribute__((__cdecl__)) fgetpos(FILE * __restrict__ _File ,fpos_t * __restrict__ _Pos); int __attribute__((__cdecl__)) fgetpos64(FILE * __restrict__ _File ,fpos_t * __restrict__ _Pos); char *__attribute__((__cdecl__)) fgets(char * __restrict__ _Buf,int _MaxCount,FILE * __restrict__ _File); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _fileno(FILE *_File); __attribute__ ((__dllimport__)) char *__attribute__((__cdecl__)) _tempnam(const char *_DirName,const char *_FilePrefix); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _flushall(void); FILE *__attribute__((__cdecl__)) fopen(const char * __restrict__ _Filename,const char * __restrict__ _Mode) ; FILE *fopen64(const char * __restrict__ filename,const char * __restrict__ mode); int __attribute__((__cdecl__)) fputc(int _Ch,FILE *_File); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _fputchar(int _Ch); int __attribute__((__cdecl__)) fputs(const char * __restrict__ _Str,FILE * __restrict__ _File); size_t __attribute__((__cdecl__)) fread(void * __restrict__ _DstBuf,size_t _ElementSize,size_t _Count,FILE * __restrict__ _File); FILE *__attribute__((__cdecl__)) freopen(const char * __restrict__ _Filename,const char * __restrict__ _Mode,FILE * __restrict__ _File) ; int __attribute__((__cdecl__)) fsetpos(FILE *_File,const fpos_t *_Pos); int __attribute__((__cdecl__)) fsetpos64(FILE *_File,const fpos_t *_Pos); int __attribute__((__cdecl__)) fseek(FILE *_File,long _Offset,int _Origin); long __attribute__((__cdecl__)) ftell(FILE *_File); __extension__ int __attribute__((__cdecl__)) _fseeki64(FILE *_File,long long _Offset,int _Origin); __extension__ long long __attribute__((__cdecl__)) _ftelli64(FILE *_File); int fseeko64(FILE* stream, _off64_t offset, int whence); int fseeko(FILE* stream, _off_t offset, int whence); _off_t ftello(FILE * stream); _off64_t ftello64(FILE * stream); size_t __attribute__((__cdecl__)) fwrite(const void * __restrict__ _Str,size_t _Size,size_t _Count,FILE * __restrict__ _File); int __attribute__((__cdecl__)) getc(FILE *_File); int __attribute__((__cdecl__)) getchar(void); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _getmaxstdio(void); char *__attribute__((__cdecl__)) gets(char *_Buffer) ; int __attribute__((__cdecl__)) _getw(FILE *_File); void __attribute__((__cdecl__)) perror(const char *_ErrMsg); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _pclose(FILE *_File); __attribute__ ((__dllimport__)) FILE *__attribute__((__cdecl__)) _popen(const char *_Command,const char *_Mode); int __attribute__((__cdecl__)) putc(int _Ch,FILE *_File); int __attribute__((__cdecl__)) putchar(int _Ch); int __attribute__((__cdecl__)) puts(const char *_Str); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _putw(int _Word,FILE *_File); int __attribute__((__cdecl__)) remove(const char *_Filename); int __attribute__((__cdecl__)) rename(const char *_OldFilename,const char *_NewFilename); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _unlink(const char *_Filename); int __attribute__((__cdecl__)) unlink(const char *_Filename) ; void __attribute__((__cdecl__)) rewind(FILE *_File); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _rmtmp(void); void __attribute__((__cdecl__)) setbuf(FILE * __restrict__ _File,char * __restrict__ _Buffer) ; __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _setmaxstdio(int _Max); __attribute__ ((__dllimport__)) unsigned int __attribute__((__cdecl__)) _set_output_format(unsigned int _Format); __attribute__ ((__dllimport__)) unsigned int __attribute__((__cdecl__)) _get_output_format(void); int __attribute__((__cdecl__)) setvbuf(FILE * __restrict__ _File,char * __restrict__ _Buf,int _Mode,size_t _Size); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _scprintf(const char * __restrict__ _Format,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _snscanf(const char * __restrict__ _Src,size_t _MaxCount,const char * __restrict__ _Format,...) ; FILE *__attribute__((__cdecl__)) tmpfile(void) ; char *__attribute__((__cdecl__)) tmpnam(char *_Buffer); int __attribute__((__cdecl__)) ungetc(int _Ch,FILE *_File); __attribute__((__format__ (ms_printf, 3, 4))) __attribute__ ((__nonnull__ (3))) __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _snprintf(char * __restrict__ _Dest,size_t _Count,const char * __restrict__ _Format,...) ; __attribute__((__format__ (ms_printf, 3, 0))) __attribute__ ((__nonnull__ (3))) __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vsnprintf(char * __restrict__ _Dest,size_t _Count,const char * __restrict__ _Format,va_list _Args) ; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wshadow" __attribute__((__format__ (ms_printf, 3, 0))) __attribute__ ((__nonnull__ (3))) int __attribute__((__cdecl__)) __ms_vsnprintf(char * __restrict__ d,size_t n,const char * __restrict__ format,va_list arg) ; static __attribute__ ((__unused__)) __inline__ __attribute__((__cdecl__)) __attribute__((__format__ (ms_printf, 3, 0))) __attribute__ ((__nonnull__ (3))) int vsnprintf (char * __restrict__ __stream, size_t __n, const char * __restrict__ __format, va_list __local_argv) { return __ms_vsnprintf (__stream, __n, __format, __local_argv); } __attribute__((__format__ (ms_printf, 3, 4))) __attribute__ ((__nonnull__ (3))) int __attribute__((__cdecl__)) __ms_snprintf(char * __restrict__ s, size_t n, const char * __restrict__ format, ...); static __attribute__ ((__unused__)) __inline__ __attribute__((__cdecl__)) __attribute__((__format__ (ms_printf, 3, 4))) __attribute__ ((__nonnull__ (3))) int snprintf (char * __restrict__ __stream, size_t __n, const char * __restrict__ __format, ...) { int __retval; __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format ); __retval = __ms_vsnprintf (__stream, __n, __format, __local_argv); __builtin_va_end( __local_argv ); return __retval; } #pragma GCC diagnostic pop __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vscprintf(const char * __restrict__ _Format,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _set_printf_count_output(int _Value); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _get_printf_count_output(void); __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) __mingw_swscanf(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,...); __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) __mingw_vswscanf (const wchar_t * __restrict__ _Str,const wchar_t * __restrict__ Format,va_list argp); __attribute__ ((__nonnull__ (1))) int __attribute__((__cdecl__)) __mingw_wscanf(const wchar_t * __restrict__ _Format,...); __attribute__ ((__nonnull__ (1))) int __attribute__((__cdecl__)) __mingw_vwscanf(const wchar_t * __restrict__ Format, va_list argp); __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) __mingw_fwscanf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...); __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) __mingw_vfwscanf (FILE * __restrict__ fp, const wchar_t * __restrict__ Format,va_list argp); __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) __mingw_fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...); __attribute__ ((__nonnull__ (1))) int __attribute__((__cdecl__)) __mingw_wprintf(const wchar_t * __restrict__ _Format,...); __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) __mingw_vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList); __attribute__ ((__nonnull__ (1))) int __attribute__((__cdecl__)) __mingw_vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList); __attribute__ ((__nonnull__ (3))) int __attribute__((__cdecl__)) __mingw_snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...); __attribute__ ((__nonnull__ (3))) int __attribute__((__cdecl__)) __mingw_vsnwprintf (wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ , va_list); __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) __mingw_swprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ , ...); __attribute__ ((__nonnull__ (2))) int __attribute__((__cdecl__)) __mingw_vswprintf(wchar_t * __restrict__ , const wchar_t * __restrict__ ,va_list); int __attribute__((__cdecl__)) fwscanf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...) ; int __attribute__((__cdecl__)) swscanf(const wchar_t * __restrict__ _Src,const wchar_t * __restrict__ _Format,...) ; int __attribute__((__cdecl__)) wscanf(const wchar_t * __restrict__ _Format,...) ; int __attribute__((__cdecl__)) __ms_vwscanf (const wchar_t * __restrict__ , va_list); int __attribute__((__cdecl__)) __ms_vfwscanf (FILE * __restrict__ ,const wchar_t * __restrict__ ,va_list); int __attribute__((__cdecl__)) __ms_vswscanf (const wchar_t * __restrict__ ,const wchar_t * __restrict__ ,va_list); static __attribute__ ((__unused__)) __inline__ __attribute__((__cdecl__)) __attribute__ ((__nonnull__ (2))) int vfwscanf (FILE *__stream, const wchar_t *__format, __builtin_va_list __local_argv) { return __ms_vfwscanf (__stream, __format, __local_argv); } static __attribute__ ((__unused__)) __inline__ __attribute__((__cdecl__)) __attribute__ ((__nonnull__ (2))) int vswscanf (const wchar_t * __restrict__ __source, const wchar_t * __restrict__ __format, __builtin_va_list __local_argv) { return __ms_vswscanf( __source, __format, __local_argv ); } static __attribute__ ((__unused__)) __inline__ __attribute__((__cdecl__)) __attribute__ ((__nonnull__ (1))) int vwscanf(const wchar_t *__format, __builtin_va_list __local_argv) { return __ms_vwscanf (__format, __local_argv); } int __attribute__((__cdecl__)) fwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,...); int __attribute__((__cdecl__)) wprintf(const wchar_t * __restrict__ _Format,...); int __attribute__((__cdecl__)) vfwprintf(FILE * __restrict__ _File,const wchar_t * __restrict__ _Format,va_list _ArgList); int __attribute__((__cdecl__)) vwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList); __attribute__ ((__dllimport__)) FILE *__attribute__((__cdecl__)) _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode,int _ShFlag); wint_t __attribute__((__cdecl__)) fgetwc(FILE *_File); __attribute__ ((__dllimport__)) wint_t __attribute__((__cdecl__)) _fgetwchar(void); wint_t __attribute__((__cdecl__)) fputwc(wchar_t _Ch,FILE *_File); __attribute__ ((__dllimport__)) wint_t __attribute__((__cdecl__)) _fputwchar(wchar_t _Ch); wint_t __attribute__((__cdecl__)) getwc(FILE *_File); wint_t __attribute__((__cdecl__)) getwchar(void); wint_t __attribute__((__cdecl__)) putwc(wchar_t _Ch,FILE *_File); wint_t __attribute__((__cdecl__)) putwchar(wchar_t _Ch); wint_t __attribute__((__cdecl__)) ungetwc(wint_t _Ch,FILE *_File); wchar_t *__attribute__((__cdecl__)) fgetws(wchar_t * __restrict__ _Dst,int _SizeInWords,FILE * __restrict__ _File); int __attribute__((__cdecl__)) fputws(const wchar_t * __restrict__ _Str,FILE * __restrict__ _File); __attribute__ ((__dllimport__)) wchar_t *__attribute__((__cdecl__)) _getws(wchar_t *_String) ; __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _putws(const wchar_t *_Str); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _scwprintf(const wchar_t * __restrict__ _Format,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _swprintf_c(wchar_t * __restrict__ _DstBuf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vswprintf_c(wchar_t * __restrict__ _DstBuf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _snwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,...) ; __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vsnwprintf(wchar_t * __restrict__ _Dest,size_t _Count,const wchar_t * __restrict__ _Format,va_list _Args) ; __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vscwprintf(const wchar_t * __restrict__ _Format,va_list _ArgList); int __attribute__((__cdecl__)) __ms_snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...); int __attribute__((__cdecl__)) __ms_vsnwprintf (wchar_t * __restrict__ , size_t, const wchar_t * __restrict__ , va_list); static __attribute__ ((__unused__)) __inline__ __attribute__((__cdecl__)) int snwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, ...) { int r; va_list argp; __builtin_va_start (argp, format); r = _vsnwprintf (s, n, format, argp); __builtin_va_end (argp); return r; } static __attribute__ ((__unused__)) __inline__ __attribute__((__cdecl__)) int __attribute__((__cdecl__)) vsnwprintf (wchar_t * __restrict__ s, size_t n, const wchar_t * __restrict__ format, va_list arg) { return _vsnwprintf(s,n,format,arg); } __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _swprintf(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Format,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vswprintf(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Format,va_list _Args); static __attribute__ ((__unused__)) __inline__ __attribute__((__cdecl__)) __attribute__ ((__nonnull__ (3))) int vswprintf (wchar_t *__stream, size_t __count, const wchar_t *__format, __builtin_va_list __local_argv) { return vsnwprintf( __stream, __count, __format, __local_argv ); } static __attribute__ ((__unused__)) __inline__ __attribute__((__cdecl__)) __attribute__ ((__nonnull__ (3))) int swprintf (wchar_t *__stream, size_t __count, const wchar_t *__format, ...) { int __retval; __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format ); __retval = vswprintf( __stream, __count, __format, __local_argv ); __builtin_va_end( __local_argv ); return __retval; } __attribute__ ((__dllimport__)) wchar_t *__attribute__((__cdecl__)) _wtempnam(const wchar_t *_Directory,const wchar_t *_FilePrefix); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _snwscanf(const wchar_t * __restrict__ _Src,size_t _MaxCount,const wchar_t * __restrict__ _Format,...); __attribute__ ((__dllimport__)) FILE *__attribute__((__cdecl__)) _wfdopen(int _FileHandle ,const wchar_t *_Mode); __attribute__ ((__dllimport__)) FILE *__attribute__((__cdecl__)) _wfopen(const wchar_t * __restrict__ _Filename,const wchar_t *__restrict__ _Mode) ; __attribute__ ((__dllimport__)) FILE *__attribute__((__cdecl__)) _wfreopen(const wchar_t * __restrict__ _Filename,const wchar_t * __restrict__ _Mode,FILE * __restrict__ _OldFile) ; __attribute__ ((__dllimport__)) void __attribute__((__cdecl__)) _wperror(const wchar_t *_ErrMsg); __attribute__ ((__dllimport__)) FILE *__attribute__((__cdecl__)) _wpopen(const wchar_t *_Command,const wchar_t *_Mode); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wremove(const wchar_t *_Filename); __attribute__ ((__dllimport__)) wchar_t *__attribute__((__cdecl__)) _wtmpnam(wchar_t *_Buffer); __attribute__ ((__dllimport__)) wint_t __attribute__((__cdecl__)) _fgetwc_nolock(FILE *_File); __attribute__ ((__dllimport__)) wint_t __attribute__((__cdecl__)) _fputwc_nolock(wchar_t _Ch,FILE *_File); __attribute__ ((__dllimport__)) wint_t __attribute__((__cdecl__)) _ungetwc_nolock(wint_t _Ch,FILE *_File); __attribute__ ((__dllimport__)) void __attribute__((__cdecl__)) _lock_file(FILE *_File); __attribute__ ((__dllimport__)) void __attribute__((__cdecl__)) _unlock_file(FILE *_File); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _fclose_nolock(FILE *_File); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _fflush_nolock(FILE *_File); __attribute__ ((__dllimport__)) size_t __attribute__((__cdecl__)) _fread_nolock(void * __restrict__ _DstBuf,size_t _ElementSize,size_t _Count,FILE * __restrict__ _File); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _fseek_nolock(FILE *_File,long _Offset,int _Origin); __attribute__ ((__dllimport__)) long __attribute__((__cdecl__)) _ftell_nolock(FILE *_File); __extension__ __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _fseeki64_nolock(FILE *_File,long long _Offset,int _Origin); __extension__ __attribute__ ((__dllimport__)) long long __attribute__((__cdecl__)) _ftelli64_nolock(FILE *_File); __attribute__ ((__dllimport__)) size_t __attribute__((__cdecl__)) _fwrite_nolock(const void * __restrict__ _DstBuf,size_t _Size,size_t _Count,FILE * __restrict__ _File); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _ungetc_nolock(int _Ch,FILE *_File); char *__attribute__((__cdecl__)) tempnam(const char *_Directory,const char *_FilePrefix) ; int __attribute__((__cdecl__)) fcloseall(void) ; FILE *__attribute__((__cdecl__)) fdopen(int _FileHandle,const char *_Format) ; int __attribute__((__cdecl__)) fgetchar(void) ; int __attribute__((__cdecl__)) fileno(FILE *_File) ; int __attribute__((__cdecl__)) flushall(void) ; int __attribute__((__cdecl__)) fputchar(int _Ch) ; int __attribute__((__cdecl__)) getw(FILE *_File) ; int __attribute__((__cdecl__)) putw(int _Ch,FILE *_File) ; int __attribute__((__cdecl__)) rmtmp(void) ; int __attribute__((__cdecl__)) __mingw_str_wide_utf8 (const wchar_t * const wptr, char **mbptr, size_t * buflen); int __attribute__((__cdecl__)) __mingw_str_utf8_wide (const char *const mbptr, wchar_t ** wptr, size_t * buflen); void __attribute__((__cdecl__)) __mingw_str_free(void *ptr); __attribute__ ((__dllimport__)) intptr_t __attribute__((__cdecl__)) _wspawnl(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...); __attribute__ ((__dllimport__)) intptr_t __attribute__((__cdecl__)) _wspawnle(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...); __attribute__ ((__dllimport__)) intptr_t __attribute__((__cdecl__)) _wspawnlp(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...); __attribute__ ((__dllimport__)) intptr_t __attribute__((__cdecl__)) _wspawnlpe(int _Mode,const wchar_t *_Filename,const wchar_t *_ArgList,...); __attribute__ ((__dllimport__)) intptr_t __attribute__((__cdecl__)) _wspawnv(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList); __attribute__ ((__dllimport__)) intptr_t __attribute__((__cdecl__)) _wspawnve(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env); __attribute__ ((__dllimport__)) intptr_t __attribute__((__cdecl__)) _wspawnvp(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList); __attribute__ ((__dllimport__)) intptr_t __attribute__((__cdecl__)) _wspawnvpe(int _Mode,const wchar_t *_Filename,const wchar_t *const *_ArgList,const wchar_t *const *_Env); __attribute__ ((__dllimport__)) intptr_t __attribute__((__cdecl__)) _spawnv(int _Mode,const char *_Filename,const char *const *_ArgList); __attribute__ ((__dllimport__)) intptr_t __attribute__((__cdecl__)) _spawnve(int _Mode,const char *_Filename,const char *const *_ArgList,const char *const *_Env); __attribute__ ((__dllimport__)) intptr_t __attribute__((__cdecl__)) _spawnvp(int _Mode,const char *_Filename,const char *const *_ArgList); __attribute__ ((__dllimport__)) intptr_t __attribute__((__cdecl__)) _spawnvpe(int _Mode,const char *_Filename,const char *const *_ArgList,const char *const *_Env); #pragma pack(pop) __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) clearerr_s(FILE *_File); size_t __attribute__((__cdecl__)) fread_s(void *_DstBuf,size_t _DstSize,size_t _ElementSize,size_t _Count,FILE *_File); int __attribute__((__cdecl__)) fprintf_s(FILE *_File,const char *_Format,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _fscanf_s_l(FILE *_File,const char *_Format,_locale_t _Locale,...); int __attribute__((__cdecl__)) printf_s(const char *_Format,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _scanf_l(const char *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _scanf_s_l(const char *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _snprintf_c(char *_DstBuf,size_t _MaxCount,const char *_Format,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vsnprintf_c(char *_DstBuf,size_t _MaxCount,const char *_Format,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _fscanf_l(FILE *_File,const char *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _sscanf_l(const char *_Src,const char *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _sscanf_s_l(const char *_Src,const char *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) sscanf_s(const char *_Src,const char *_Format,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _snscanf_s(const char *_Src,size_t _MaxCount,const char *_Format,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _snscanf_l(const char *_Src,size_t _MaxCount,const char *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _snscanf_s_l(const char *_Src,size_t _MaxCount,const char *_Format,_locale_t _Locale,...); int __attribute__((__cdecl__)) vfprintf_s(FILE *_File,const char *_Format,va_list _ArgList); int __attribute__((__cdecl__)) vprintf_s(const char *_Format,va_list _ArgList); int __attribute__((__cdecl__)) vsnprintf_s(char *_DstBuf,size_t _DstSize,size_t _MaxCount,const char *_Format,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vsnprintf_s(char *_DstBuf,size_t _DstSize,size_t _MaxCount,const char *_Format,va_list _ArgList); __attribute__((dllimport)) int __attribute__((__cdecl__)) vsprintf_s(char *_DstBuf,size_t _Size,const char *_Format,va_list _ArgList); __attribute__((dllimport)) int __attribute__((__cdecl__)) sprintf_s(char *_DstBuf,size_t _DstSize,const char *_Format,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _snprintf_s(char *_DstBuf,size_t _DstSize,size_t _MaxCount,const char *_Format,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _fprintf_p(FILE *_File,const char *_Format,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _printf_p(const char *_Format,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _sprintf_p(char *_Dst,size_t _MaxCount,const char *_Format,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vfprintf_p(FILE *_File,const char *_Format,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vprintf_p(const char *_Format,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vsprintf_p(char *_Dst,size_t _MaxCount,const char *_Format,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _scprintf_p(const char *_Format,...); __attribute__((dllimport)) int __attribute__((__cdecl__)) _vscprintf_p(const char *_Format,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _printf_l(const char *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _printf_p_l(const char *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vprintf_l(const char *_Format,_locale_t _Locale,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vprintf_p_l(const char *_Format,_locale_t _Locale,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _fprintf_l(FILE *_File,const char *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _fprintf_p_l(FILE *_File,const char *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vfprintf_l(FILE *_File,const char *_Format,_locale_t _Locale,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vfprintf_p_l(FILE *_File,const char *_Format,_locale_t _Locale,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _sprintf_l(char *_DstBuf,const char *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _sprintf_p_l(char *_DstBuf,size_t _MaxCount,const char *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vsprintf_l(char *_DstBuf,const char *_Format,_locale_t,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vsprintf_p_l(char *_DstBuf,size_t _MaxCount,const char *_Format,_locale_t _Locale,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _scprintf_l(const char *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _scprintf_p_l(const char *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vscprintf_l(const char *_Format,_locale_t _Locale,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vscprintf_p_l(const char *_Format,_locale_t _Locale,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _printf_s_l(const char *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vprintf_s_l(const char *_Format,_locale_t _Locale,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _fprintf_s_l(FILE *_File,const char *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vfprintf_s_l(FILE *_File,const char *_Format,_locale_t _Locale,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _sprintf_s_l(char *_DstBuf,size_t _DstSize,const char *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vsprintf_s_l(char *_DstBuf,size_t _DstSize,const char *_Format,_locale_t _Locale,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _snprintf_s_l(char *_DstBuf,size_t _DstSize,size_t _MaxCount,const char *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vsnprintf_s_l(char *_DstBuf,size_t _DstSize,size_t _MaxCount,const char *_Format,_locale_t _Locale,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _snprintf_l(char *_DstBuf,size_t _MaxCount,const char *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _snprintf_c_l(char *_DstBuf,size_t _MaxCount,const char *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vsnprintf_l(char *_DstBuf,size_t _MaxCount,const char *_Format,_locale_t _Locale,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vsnprintf_c_l(char *_DstBuf,size_t _MaxCount,const char *,_locale_t _Locale,va_list _ArgList); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) fopen_s(FILE **_File,const char *_Filename,const char *_Mode); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) freopen_s(FILE** _File, const char *_Filename, const char *_Mode, FILE *_Stream); __attribute__ ((__dllimport__)) char* __attribute__((__cdecl__)) gets_s(char*,rsize_t); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) tmpnam_s(char*,rsize_t); __attribute__ ((__dllimport__)) wchar_t *__attribute__((__cdecl__)) _getws_s(wchar_t *_Str,size_t _SizeInWords); int __attribute__((__cdecl__)) fwprintf_s(FILE *_File,const wchar_t *_Format,...); int __attribute__((__cdecl__)) wprintf_s(const wchar_t *_Format,...); int __attribute__((__cdecl__)) vfwprintf_s(FILE *_File,const wchar_t *_Format,va_list _ArgList); int __attribute__((__cdecl__)) vwprintf_s(const wchar_t *_Format,va_list _ArgList); int __attribute__((__cdecl__)) vswprintf_s(wchar_t *_Dst,size_t _SizeInWords,const wchar_t *_Format,va_list _ArgList); int __attribute__((__cdecl__)) swprintf_s(wchar_t *_Dst,size_t _SizeInWords,const wchar_t *_Format,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vsnwprintf_s(wchar_t *_DstBuf,size_t _DstSizeInWords,size_t _MaxCount,const wchar_t *_Format,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _snwprintf_s(wchar_t *_DstBuf,size_t _DstSizeInWords,size_t _MaxCount,const wchar_t *_Format,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wprintf_s_l(const wchar_t *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vwprintf_s_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _fwprintf_s_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vfwprintf_s_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _swprintf_s_l(wchar_t *_DstBuf,size_t _DstSize,const wchar_t *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vswprintf_s_l(wchar_t *_DstBuf,size_t _DstSize,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _snwprintf_s_l(wchar_t *_DstBuf,size_t _DstSize,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vsnwprintf_s_l(wchar_t *_DstBuf,size_t _DstSize,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _fwscanf_s_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _swscanf_s_l(const wchar_t *_Src,const wchar_t *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) swscanf_s(const wchar_t *_Src,const wchar_t *_Format,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _snwscanf_s(const wchar_t *_Src,size_t _MaxCount,const wchar_t *_Format,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _snwscanf_s_l(const wchar_t *_Src,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wscanf_s_l(const wchar_t *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _wfopen_s(FILE **_File,const wchar_t *_Filename,const wchar_t *_Mode); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _wfreopen_s(FILE **_File,const wchar_t *_Filename,const wchar_t *_Mode,FILE *_OldFile); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _wtmpnam_s(wchar_t *_DstBuf,size_t _SizeInWords); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _fwprintf_p(FILE *_File,const wchar_t *_Format,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wprintf_p(const wchar_t *_Format,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vfwprintf_p(FILE *_File,const wchar_t *_Format,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vwprintf_p(const wchar_t *_Format,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _swprintf_p(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,...); __attribute__((dllimport)) int __attribute__((__cdecl__)) _vswprintf_p(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _scwprintf_p(const wchar_t *_Format,...); __attribute__((dllimport)) int __attribute__((__cdecl__)) _vscwprintf_p(const wchar_t *_Format,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wprintf_l(const wchar_t *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wprintf_p_l(const wchar_t *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vwprintf_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _fwprintf_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _fwprintf_p_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vfwprintf_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vfwprintf_p_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _swprintf_c_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _swprintf_p_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vswprintf_c_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vswprintf_p_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _scwprintf_l(const wchar_t *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _scwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vscwprintf_p_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _snwprintf_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vsnwprintf_l(wchar_t *_DstBuf,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) __swprintf_l(wchar_t *_Dest,const wchar_t *_Format,_locale_t _Plocinfo,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) __vswprintf_l(wchar_t *_Dest,const wchar_t *_Format,_locale_t _Plocinfo,va_list _Args); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _vscwprintf_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _fwscanf_l(FILE *_File,const wchar_t *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _swscanf_l(const wchar_t *_Src,const wchar_t *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _snwscanf_l(const wchar_t *_Src,size_t _MaxCount,const wchar_t *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wscanf_l(const wchar_t *_Format,_locale_t _Locale,...); __attribute__ ((__dllimport__)) size_t __attribute__((__cdecl__)) _fread_nolock_s(void *_DstBuf,size_t _DstSize,size_t _ElementSize,size_t _Count,FILE *_File); __attribute__ ((__dllimport__)) extern int *__attribute__((__cdecl__)) _errno(void); errno_t __attribute__((__cdecl__)) _set_errno(int _Value); errno_t __attribute__((__cdecl__)) _get_errno(int *_Value); __attribute__ ((__dllimport__)) extern unsigned long __attribute__((__cdecl__)) __threadid(void); __attribute__ ((__dllimport__)) extern uintptr_t __attribute__((__cdecl__)) __threadhandle(void); typedef struct { long long __max_align_ll __attribute__((__aligned__(__alignof__(long long)))); long double __max_align_ld __attribute__((__aligned__(__alignof__(long double)))); } max_align_t; typedef signed char int8_t; typedef unsigned char uint8_t; typedef short int16_t; typedef unsigned short uint16_t; typedef int int32_t; typedef unsigned uint32_t; __extension__ typedef long long int64_t; __extension__ typedef unsigned long long uint64_t; typedef signed char int_least8_t; typedef unsigned char uint_least8_t; typedef short int_least16_t; typedef unsigned short uint_least16_t; typedef int int_least32_t; typedef unsigned uint_least32_t; __extension__ typedef long long int_least64_t; __extension__ typedef unsigned long long uint_least64_t; typedef signed char int_fast8_t; typedef unsigned char uint_fast8_t; typedef short int_fast16_t; typedef unsigned short uint_fast16_t; typedef int int_fast32_t; typedef unsigned int uint_fast32_t; __extension__ typedef long long int_fast64_t; __extension__ typedef unsigned long long uint_fast64_t; __extension__ typedef long long intmax_t; __extension__ typedef unsigned long long uintmax_t; #pragma pack(push,_CRT_PACKING) typedef int (__attribute__((__cdecl__)) *_onexit_t)(void); typedef struct _div_t { int quot; int rem; } div_t; typedef struct _ldiv_t { long quot; long rem; } ldiv_t; #pragma pack(4) typedef struct { unsigned char ld[10]; } _LDOUBLE; #pragma pack() typedef struct { double x; } _CRT_DOUBLE; typedef struct { float f; } _CRT_FLOAT; typedef struct { long double x; } _LONGDOUBLE; #pragma pack(4) typedef struct { unsigned char ld12[12]; } _LDBL12; #pragma pack() extern int * __imp___mb_cur_max; __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) ___mb_cur_max_func(void); typedef void (__attribute__((__cdecl__)) *_purecall_handler)(void); __attribute__ ((__dllimport__)) _purecall_handler __attribute__((__cdecl__)) _set_purecall_handler(_purecall_handler _Handler); __attribute__ ((__dllimport__)) _purecall_handler __attribute__((__cdecl__)) _get_purecall_handler(void); typedef void (__attribute__((__cdecl__)) *_invalid_parameter_handler)(const wchar_t *,const wchar_t *,const wchar_t *,unsigned int,uintptr_t); __attribute__ ((__dllimport__)) _invalid_parameter_handler __attribute__((__cdecl__)) _set_invalid_parameter_handler(_invalid_parameter_handler _Handler); __attribute__ ((__dllimport__)) _invalid_parameter_handler __attribute__((__cdecl__)) _get_invalid_parameter_handler(void); __attribute__ ((__dllimport__)) unsigned long *__attribute__((__cdecl__)) __doserrno(void); errno_t __attribute__((__cdecl__)) _set_doserrno(unsigned long _Value); errno_t __attribute__((__cdecl__)) _get_doserrno(unsigned long *_Value); extern __attribute__((dllimport)) char *_sys_errlist[1]; extern __attribute__((dllimport)) int _sys_nerr; __attribute__ ((__dllimport__)) char ***__attribute__((__cdecl__)) __p___argv(void); __attribute__ ((__dllimport__)) int *__attribute__((__cdecl__)) __p__fmode(void); errno_t __attribute__((__cdecl__)) _get_pgmptr(char **_Value); errno_t __attribute__((__cdecl__)) _get_wpgmptr(wchar_t **_Value); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _set_fmode(int _Mode); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _get_fmode(int *_PMode); extern int * __imp___argc; extern char *** __imp___argv; extern wchar_t *** __imp___wargv; extern char *** __imp__environ; extern wchar_t *** __imp__wenviron; extern char ** __imp__pgmptr; extern wchar_t ** __imp__wpgmptr; extern unsigned int * __imp__osplatform; extern unsigned int * __imp__osver; extern unsigned int * __imp__winver; extern unsigned int * __imp__winmajor; extern unsigned int * __imp__winminor; errno_t __attribute__((__cdecl__)) _get_osplatform(unsigned int *_Value); errno_t __attribute__((__cdecl__)) _get_osver(unsigned int *_Value); errno_t __attribute__((__cdecl__)) _get_winver(unsigned int *_Value); errno_t __attribute__((__cdecl__)) _get_winmajor(unsigned int *_Value); errno_t __attribute__((__cdecl__)) _get_winminor(unsigned int *_Value); void __attribute__((__cdecl__)) __attribute__ ((__nothrow__)) exit(int _Code) __attribute__ ((__noreturn__)); void __attribute__((__cdecl__)) __attribute__ ((__nothrow__)) _exit(int _Code) __attribute__ ((__noreturn__)); void __attribute__((__cdecl__)) _Exit(int) __attribute__ ((__noreturn__)); extern inline __attribute__((__gnu_inline__)) __attribute__ ((__noreturn__)) void __attribute__((__cdecl__)) _Exit(int status) { _exit(status); } void __attribute__((__cdecl__)) __attribute__ ((__noreturn__)) abort(void); __attribute__ ((__dllimport__)) unsigned int __attribute__((__cdecl__)) _set_abort_behavior(unsigned int _Flags,unsigned int _Mask); int __attribute__((__cdecl__)) abs(int _X); long __attribute__((__cdecl__)) labs(long _X); __extension__ long long __attribute__((__cdecl__)) _abs64(long long); extern __inline__ __attribute__((__always_inline__,__gnu_inline__)) long long __attribute__((__cdecl__)) _abs64(long long x) { return __builtin_llabs(x); } int __attribute__((__cdecl__)) atexit(void (__attribute__((__cdecl__)) *)(void)); double __attribute__((__cdecl__)) atof(const char *_String); double __attribute__((__cdecl__)) _atof_l(const char *_String,_locale_t _Locale); int __attribute__((__cdecl__)) atoi(const char *_Str); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _atoi_l(const char *_Str,_locale_t _Locale); long __attribute__((__cdecl__)) atol(const char *_Str); __attribute__ ((__dllimport__)) long __attribute__((__cdecl__)) _atol_l(const char *_Str,_locale_t _Locale); void *__attribute__((__cdecl__)) bsearch(const void *_Key,const void *_Base,size_t _NumOfElements,size_t _SizeOfElements,int (__attribute__((__cdecl__)) *_PtFuncCompare)(const void *,const void *)); void __attribute__((__cdecl__)) qsort(void *_Base,size_t _NumOfElements,size_t _SizeOfElements,int (__attribute__((__cdecl__)) *_PtFuncCompare)(const void *,const void *)); unsigned short __attribute__((__cdecl__)) _byteswap_ushort(unsigned short _Short); unsigned long __attribute__((__cdecl__)) _byteswap_ulong (unsigned long _Long); __extension__ unsigned long long __attribute__((__cdecl__)) _byteswap_uint64(unsigned long long _Int64); div_t __attribute__((__cdecl__)) div(int _Numerator,int _Denominator); char *__attribute__((__cdecl__)) getenv(const char *_VarName) ; __attribute__ ((__dllimport__)) char *__attribute__((__cdecl__)) _itoa(int _Value,char *_Dest,int _Radix); __extension__ __attribute__ ((__dllimport__)) char *__attribute__((__cdecl__)) _i64toa(long long _Val,char *_DstBuf,int _Radix) ; __extension__ __attribute__ ((__dllimport__)) char *__attribute__((__cdecl__)) _ui64toa(unsigned long long _Val,char *_DstBuf,int _Radix) ; __extension__ __attribute__ ((__dllimport__)) long long __attribute__((__cdecl__)) _atoi64(const char *_String); __extension__ __attribute__ ((__dllimport__)) long long __attribute__((__cdecl__)) _atoi64_l(const char *_String,_locale_t _Locale); __extension__ __attribute__ ((__dllimport__)) long long __attribute__((__cdecl__)) _strtoi64(const char *_String,char **_EndPtr,int _Radix); __extension__ __attribute__ ((__dllimport__)) long long __attribute__((__cdecl__)) _strtoi64_l(const char *_String,char **_EndPtr,int _Radix,_locale_t _Locale); __extension__ __attribute__ ((__dllimport__)) unsigned long long __attribute__((__cdecl__)) _strtoui64(const char *_String,char **_EndPtr,int _Radix); __extension__ __attribute__ ((__dllimport__)) unsigned long long __attribute__((__cdecl__)) _strtoui64_l(const char *_String,char **_EndPtr,int _Radix,_locale_t _Locale); ldiv_t __attribute__((__cdecl__)) ldiv(long _Numerator,long _Denominator); __attribute__ ((__dllimport__)) char *__attribute__((__cdecl__)) _ltoa(long _Value,char *_Dest,int _Radix) ; int __attribute__((__cdecl__)) mblen(const char *_Ch,size_t _MaxCount); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _mblen_l(const char *_Ch,size_t _MaxCount,_locale_t _Locale); __attribute__ ((__dllimport__)) size_t __attribute__((__cdecl__)) _mbstrlen(const char *_Str); __attribute__ ((__dllimport__)) size_t __attribute__((__cdecl__)) _mbstrlen_l(const char *_Str,_locale_t _Locale); __attribute__ ((__dllimport__)) size_t __attribute__((__cdecl__)) _mbstrnlen(const char *_Str,size_t _MaxCount); __attribute__ ((__dllimport__)) size_t __attribute__((__cdecl__)) _mbstrnlen_l(const char *_Str,size_t _MaxCount,_locale_t _Locale); int __attribute__((__cdecl__)) mbtowc(wchar_t * __restrict__ _DstCh,const char * __restrict__ _SrcCh,size_t _SrcSizeInBytes); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _mbtowc_l(wchar_t * __restrict__ _DstCh,const char * __restrict__ _SrcCh,size_t _SrcSizeInBytes,_locale_t _Locale); size_t __attribute__((__cdecl__)) mbstowcs(wchar_t * __restrict__ _Dest,const char * __restrict__ _Source,size_t _MaxCount); __attribute__ ((__dllimport__)) size_t __attribute__((__cdecl__)) _mbstowcs_l(wchar_t * __restrict__ _Dest,const char * __restrict__ _Source,size_t _MaxCount,_locale_t _Locale); int __attribute__((__cdecl__)) mkstemp(char *template_name); int __attribute__((__cdecl__)) rand(void); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _set_error_mode(int _Mode); void __attribute__((__cdecl__)) srand(unsigned int _Seed); double __attribute__((__cdecl__)) __attribute__ ((__nothrow__)) strtod(const char * __restrict__ _Str,char ** __restrict__ _EndPtr); float __attribute__((__cdecl__)) __attribute__ ((__nothrow__)) strtof(const char * __restrict__ nptr, char ** __restrict__ endptr); long double __attribute__((__cdecl__)) __attribute__ ((__nothrow__)) strtold(const char * __restrict__ , char ** __restrict__ ); extern double __attribute__((__cdecl__)) __attribute__ ((__nothrow__)) __strtod (const char * __restrict__ , char ** __restrict__); float __attribute__((__cdecl__)) __mingw_strtof (const char * __restrict__, char ** __restrict__); double __attribute__((__cdecl__)) __mingw_strtod (const char * __restrict__, char ** __restrict__); long double __attribute__((__cdecl__)) __mingw_strtold(const char * __restrict__, char ** __restrict__); __attribute__ ((__dllimport__)) double __attribute__((__cdecl__)) _strtod_l(const char * __restrict__ _Str,char ** __restrict__ _EndPtr,_locale_t _Locale); long __attribute__((__cdecl__)) strtol(const char * __restrict__ _Str,char ** __restrict__ _EndPtr,int _Radix); __attribute__ ((__dllimport__)) long __attribute__((__cdecl__)) _strtol_l(const char * __restrict__ _Str,char ** __restrict__ _EndPtr,int _Radix,_locale_t _Locale); unsigned long __attribute__((__cdecl__)) strtoul(const char * __restrict__ _Str,char ** __restrict__ _EndPtr,int _Radix); __attribute__ ((__dllimport__)) unsigned long __attribute__((__cdecl__)) _strtoul_l(const char * __restrict__ _Str,char ** __restrict__ _EndPtr,int _Radix,_locale_t _Locale); int __attribute__((__cdecl__)) system(const char *_Command); __attribute__ ((__dllimport__)) char *__attribute__((__cdecl__)) _ultoa(unsigned long _Value,char *_Dest,int _Radix) ; int __attribute__((__cdecl__)) wctomb(char *_MbCh,wchar_t _WCh) ; __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wctomb_l(char *_MbCh,wchar_t _WCh,_locale_t _Locale) ; size_t __attribute__((__cdecl__)) wcstombs(char * __restrict__ _Dest,const wchar_t * __restrict__ _Source,size_t _MaxCount) ; __attribute__ ((__dllimport__)) size_t __attribute__((__cdecl__)) _wcstombs_l(char * __restrict__ _Dest,const wchar_t * __restrict__ _Source,size_t _MaxCount,_locale_t _Locale) ; void *__attribute__((__cdecl__)) calloc(size_t _NumOfElements,size_t _SizeOfElements); void __attribute__((__cdecl__)) free(void *_Memory); void *__attribute__((__cdecl__)) malloc(size_t _Size); void *__attribute__((__cdecl__)) realloc(void *_Memory,size_t _NewSize); __attribute__ ((__dllimport__)) void *__attribute__((__cdecl__)) _recalloc(void *_Memory,size_t _Count,size_t _Size); __attribute__ ((__dllimport__)) void __attribute__((__cdecl__)) _aligned_free(void *_Memory); __attribute__ ((__dllimport__)) void *__attribute__((__cdecl__)) _aligned_malloc(size_t _Size,size_t _Alignment); __attribute__ ((__dllimport__)) void *__attribute__((__cdecl__)) _aligned_offset_malloc(size_t _Size,size_t _Alignment,size_t _Offset); __attribute__ ((__dllimport__)) void *__attribute__((__cdecl__)) _aligned_realloc(void *_Memory,size_t _Size,size_t _Alignment); __attribute__ ((__dllimport__)) void *__attribute__((__cdecl__)) _aligned_recalloc(void *_Memory,size_t _Count,size_t _Size,size_t _Alignment); __attribute__ ((__dllimport__)) void *__attribute__((__cdecl__)) _aligned_offset_realloc(void *_Memory,size_t _Size,size_t _Alignment,size_t _Offset); __attribute__ ((__dllimport__)) void *__attribute__((__cdecl__)) _aligned_offset_recalloc(void *_Memory,size_t _Count,size_t _Size,size_t _Alignment,size_t _Offset); __attribute__ ((__dllimport__)) wchar_t *__attribute__((__cdecl__)) _itow(int _Value,wchar_t *_Dest,int _Radix) ; __attribute__ ((__dllimport__)) wchar_t *__attribute__((__cdecl__)) _ltow(long _Value,wchar_t *_Dest,int _Radix) ; __attribute__ ((__dllimport__)) wchar_t *__attribute__((__cdecl__)) _ultow(unsigned long _Value,wchar_t *_Dest,int _Radix) ; double __attribute__((__cdecl__)) __mingw_wcstod(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr); float __attribute__((__cdecl__)) __mingw_wcstof(const wchar_t * __restrict__ nptr, wchar_t ** __restrict__ endptr); long double __attribute__((__cdecl__)) __mingw_wcstold(const wchar_t * __restrict__, wchar_t ** __restrict__); double __attribute__((__cdecl__)) wcstod(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr); float __attribute__((__cdecl__)) wcstof(const wchar_t * __restrict__ nptr, wchar_t ** __restrict__ endptr); long double __attribute__((__cdecl__)) wcstold(const wchar_t * __restrict__, wchar_t ** __restrict__); __attribute__ ((__dllimport__)) double __attribute__((__cdecl__)) _wcstod_l(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,_locale_t _Locale); long __attribute__((__cdecl__)) wcstol(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix); __attribute__ ((__dllimport__)) long __attribute__((__cdecl__)) _wcstol_l(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix,_locale_t _Locale); unsigned long __attribute__((__cdecl__)) wcstoul(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix); __attribute__ ((__dllimport__)) unsigned long __attribute__((__cdecl__)) _wcstoul_l(const wchar_t * __restrict__ _Str,wchar_t ** __restrict__ _EndPtr,int _Radix,_locale_t _Locale); __attribute__ ((__dllimport__)) wchar_t *__attribute__((__cdecl__)) _wgetenv(const wchar_t *_VarName) ; __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wsystem(const wchar_t *_Command); __attribute__ ((__dllimport__)) double __attribute__((__cdecl__)) _wtof(const wchar_t *_Str); __attribute__ ((__dllimport__)) double __attribute__((__cdecl__)) _wtof_l(const wchar_t *_Str,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wtoi(const wchar_t *_Str); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wtoi_l(const wchar_t *_Str,_locale_t _Locale); __attribute__ ((__dllimport__)) long __attribute__((__cdecl__)) _wtol(const wchar_t *_Str); __attribute__ ((__dllimport__)) long __attribute__((__cdecl__)) _wtol_l(const wchar_t *_Str,_locale_t _Locale); __extension__ __attribute__ ((__dllimport__)) wchar_t *__attribute__((__cdecl__)) _i64tow(long long _Val,wchar_t *_DstBuf,int _Radix) ; __extension__ __attribute__ ((__dllimport__)) wchar_t *__attribute__((__cdecl__)) _ui64tow(unsigned long long _Val,wchar_t *_DstBuf,int _Radix) ; __extension__ __attribute__ ((__dllimport__)) long long __attribute__((__cdecl__)) _wtoi64(const wchar_t *_Str); __extension__ __attribute__ ((__dllimport__)) long long __attribute__((__cdecl__)) _wtoi64_l(const wchar_t *_Str,_locale_t _Locale); __extension__ __attribute__ ((__dllimport__)) long long __attribute__((__cdecl__)) _wcstoi64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix); __extension__ __attribute__ ((__dllimport__)) long long __attribute__((__cdecl__)) _wcstoi64_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale); __extension__ __attribute__ ((__dllimport__)) unsigned long long __attribute__((__cdecl__)) _wcstoui64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix); __extension__ __attribute__ ((__dllimport__)) unsigned long long __attribute__((__cdecl__)) _wcstoui64_l(const wchar_t *_Str ,wchar_t **_EndPtr,int _Radix,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _putenv(const char *_EnvString); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wputenv(const wchar_t *_EnvString); __attribute__ ((__dllimport__)) char *__attribute__((__cdecl__)) _fullpath(char *_FullPath,const char *_Path,size_t _SizeInBytes); __attribute__ ((__dllimport__)) char *__attribute__((__cdecl__)) _ecvt(double _Val,int _NumOfDigits,int *_PtDec,int *_PtSign) ; __attribute__ ((__dllimport__)) char *__attribute__((__cdecl__)) _fcvt(double _Val,int _NumOfDec,int *_PtDec,int *_PtSign) ; __attribute__ ((__dllimport__)) char *__attribute__((__cdecl__)) _gcvt(double _Val,int _NumOfDigits,char *_DstBuf) ; __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _atodbl(_CRT_DOUBLE *_Result,char *_Str); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _atoldbl(_LDOUBLE *_Result,char *_Str); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _atoflt(_CRT_FLOAT *_Result,char *_Str); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _atodbl_l(_CRT_DOUBLE *_Result,char *_Str,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _atoldbl_l(_LDOUBLE *_Result,char *_Str,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _atoflt_l(_CRT_FLOAT *_Result,char *_Str,_locale_t _Locale); unsigned long __attribute__((__cdecl__)) _lrotl(unsigned long,int); unsigned long __attribute__((__cdecl__)) _lrotr(unsigned long,int); __attribute__ ((__dllimport__)) void __attribute__((__cdecl__)) _makepath(char *_Path,const char *_Drive,const char *_Dir,const char *_Filename,const char *_Ext); _onexit_t __attribute__((__cdecl__)) _onexit(_onexit_t _Func); __extension__ unsigned long long __attribute__((__cdecl__)) _rotl64(unsigned long long _Val,int _Shift); __extension__ unsigned long long __attribute__((__cdecl__)) _rotr64(unsigned long long Value,int Shift); unsigned int __attribute__((__cdecl__)) _rotr(unsigned int _Val,int _Shift); unsigned int __attribute__((__cdecl__)) _rotl(unsigned int _Val,int _Shift); __extension__ unsigned long long __attribute__((__cdecl__)) _rotr64(unsigned long long _Val,int _Shift); __attribute__ ((__dllimport__)) void __attribute__((__cdecl__)) _searchenv(const char *_Filename,const char *_EnvVar,char *_ResultPath) ; __attribute__ ((__dllimport__)) void __attribute__((__cdecl__)) _splitpath(const char *_FullPath,char *_Drive,char *_Dir,char *_Filename,char *_Ext) ; __attribute__ ((__dllimport__)) void __attribute__((__cdecl__)) _swab(char *_Buf1,char *_Buf2,int _SizeInBytes); __attribute__ ((__dllimport__)) wchar_t *__attribute__((__cdecl__)) _wfullpath(wchar_t *_FullPath,const wchar_t *_Path,size_t _SizeInWords); __attribute__ ((__dllimport__)) void __attribute__((__cdecl__)) _wmakepath(wchar_t *_ResultPath,const wchar_t *_Drive,const wchar_t *_Dir,const wchar_t *_Filename,const wchar_t *_Ext); __attribute__ ((__dllimport__)) void __attribute__((__cdecl__)) _wsearchenv(const wchar_t *_Filename,const wchar_t *_EnvVar,wchar_t *_ResultPath) ; __attribute__ ((__dllimport__)) void __attribute__((__cdecl__)) _wsplitpath(const wchar_t *_FullPath,wchar_t *_Drive,wchar_t *_Dir,wchar_t *_Filename,wchar_t *_Ext) ; __attribute__ ((__dllimport__)) void __attribute__((__cdecl__)) _beep(unsigned _Frequency,unsigned _Duration) __attribute__ ((__deprecated__)); __attribute__ ((__dllimport__)) void __attribute__((__cdecl__)) _seterrormode(int _Mode) __attribute__ ((__deprecated__)); __attribute__ ((__dllimport__)) void __attribute__((__cdecl__)) _sleep(unsigned long _Duration) __attribute__ ((__deprecated__)); char *__attribute__((__cdecl__)) ecvt(double _Val,int _NumOfDigits,int *_PtDec,int *_PtSign) ; char *__attribute__((__cdecl__)) fcvt(double _Val,int _NumOfDec,int *_PtDec,int *_PtSign) ; char *__attribute__((__cdecl__)) gcvt(double _Val,int _NumOfDigits,char *_DstBuf) ; char *__attribute__((__cdecl__)) itoa(int _Val,char *_DstBuf,int _Radix) ; char *__attribute__((__cdecl__)) ltoa(long _Val,char *_DstBuf,int _Radix) ; int __attribute__((__cdecl__)) putenv(const char *_EnvString) ; void __attribute__((__cdecl__)) swab(char *_Buf1,char *_Buf2,int _SizeInBytes) ; char *__attribute__((__cdecl__)) ultoa(unsigned long _Val,char *_Dstbuf,int _Radix) ; _onexit_t __attribute__((__cdecl__)) onexit(_onexit_t _Func); typedef struct { __extension__ long long quot, rem; } lldiv_t; __extension__ lldiv_t __attribute__((__cdecl__)) lldiv(long long, long long); __extension__ long long __attribute__((__cdecl__)) llabs(long long); __extension__ extern inline __attribute__((__gnu_inline__)) long long __attribute__((__cdecl__)) llabs(long long _j) { return (_j >= 0 ? _j : -_j); } __extension__ long long __attribute__((__cdecl__)) strtoll(const char * __restrict__, char ** __restrict, int); __extension__ unsigned long long __attribute__((__cdecl__)) strtoull(const char * __restrict__, char ** __restrict__, int); __extension__ long long __attribute__((__cdecl__)) atoll (const char *); __extension__ long long __attribute__((__cdecl__)) wtoll (const wchar_t *); __extension__ char *__attribute__((__cdecl__)) lltoa (long long, char *, int); __extension__ char *__attribute__((__cdecl__)) ulltoa (unsigned long long , char *, int); __extension__ wchar_t *__attribute__((__cdecl__)) lltow (long long, wchar_t *, int); __extension__ wchar_t *__attribute__((__cdecl__)) ulltow (unsigned long long, wchar_t *, int); __extension__ extern inline __attribute__((__gnu_inline__)) long long __attribute__((__cdecl__)) atoll (const char * _c) { return _atoi64 (_c); } __extension__ extern inline __attribute__((__gnu_inline__)) char *__attribute__((__cdecl__)) lltoa (long long _n, char * _c, int _i) { return _i64toa (_n, _c, _i); } __extension__ extern inline __attribute__((__gnu_inline__)) char *__attribute__((__cdecl__)) ulltoa (unsigned long long _n, char * _c, int _i) { return _ui64toa (_n, _c, _i); } __extension__ extern inline __attribute__((__gnu_inline__)) long long __attribute__((__cdecl__)) wtoll (const wchar_t * _w) { return _wtoi64 (_w); } __extension__ extern inline __attribute__((__gnu_inline__)) wchar_t *__attribute__((__cdecl__)) lltow (long long _n, wchar_t * _w, int _i) { return _i64tow (_n, _w, _i); } __extension__ extern inline __attribute__((__gnu_inline__)) wchar_t *__attribute__((__cdecl__)) ulltow (unsigned long long _n, wchar_t * _w, int _i) { return _ui64tow (_n, _w, _i); } #pragma pack(pop) __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _dupenv_s(char **_PBuffer,size_t *_PBufferSizeInBytes,const char *_VarName); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _itoa_s(int _Value,char *_DstBuf,size_t _Size,int _Radix); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _i64toa_s(long long _Val,char *_DstBuf,size_t _Size,int _Radix); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _ui64toa_s(unsigned long long _Val,char *_DstBuf,size_t _Size,int _Radix); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _ltoa_s(long _Val,char *_DstBuf,size_t _Size,int _Radix); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) mbstowcs_s(size_t *_PtNumOfCharConverted,wchar_t *_DstBuf,size_t _SizeInWords,const char *_SrcBuf,size_t _MaxCount); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _mbstowcs_s_l(size_t *_PtNumOfCharConverted,wchar_t *_DstBuf,size_t _SizeInWords,const char *_SrcBuf,size_t _MaxCount,_locale_t _Locale); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _ultoa_s(unsigned long _Val,char *_DstBuf,size_t _Size,int _Radix); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _wctomb_s_l(int *_SizeConverted,char *_MbCh,size_t _SizeInBytes,wchar_t _WCh,_locale_t _Locale); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) wcstombs_s(size_t *_PtNumOfCharConverted,char *_Dst,size_t _DstSizeInBytes,const wchar_t *_Src,size_t _MaxCountInBytes); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _wcstombs_s_l(size_t *_PtNumOfCharConverted,char *_Dst,size_t _DstSizeInBytes,const wchar_t *_Src,size_t _MaxCountInBytes,_locale_t _Locale); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _itow_s (int _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _ltow_s (long _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _ultow_s (unsigned long _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _wgetenv_s(size_t *_ReturnSize,wchar_t *_DstBuf,size_t _DstSizeInWords,const wchar_t *_VarName); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _wdupenv_s(wchar_t **_Buffer,size_t *_BufferSizeInWords,const wchar_t *_VarName); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _i64tow_s(long long _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _ui64tow_s(unsigned long long _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _ecvt_s(char *_DstBuf,size_t _Size,double _Val,int _NumOfDights,int *_PtDec,int *_PtSign); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _fcvt_s(char *_DstBuf,size_t _Size,double _Val,int _NumOfDec,int *_PtDec,int *_PtSign); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _gcvt_s(char *_DstBuf,size_t _Size,double _Val,int _NumOfDigits); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _makepath_s(char *_PathResult,size_t _Size,const char *_Drive,const char *_Dir,const char *_Filename,const char *_Ext); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _putenv_s(const char *_Name,const char *_Value); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _searchenv_s(const char *_Filename,const char *_EnvVar,char *_ResultPath,size_t _SizeInBytes); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _splitpath_s(const char *_FullPath,char *_Drive,size_t _DriveSize,char *_Dir,size_t _DirSize,char *_Filename,size_t _FilenameSize,char *_Ext,size_t _ExtSize); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _wmakepath_s(wchar_t *_PathResult,size_t _SizeInWords,const wchar_t *_Drive,const wchar_t *_Dir,const wchar_t *_Filename,const wchar_t *_Ext); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _wputenv_s(const wchar_t *_Name,const wchar_t *_Value); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _wsearchenv_s(const wchar_t *_Filename,const wchar_t *_EnvVar,wchar_t *_ResultPath,size_t _SizeInWords); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _wsplitpath_s(const wchar_t *_FullPath,wchar_t *_Drive,size_t _DriveSizeInWords,wchar_t *_Dir,size_t _DirSizeInWords,wchar_t *_Filename,size_t _FilenameSizeInWords,wchar_t *_Ext,size_t _ExtSizeInWords); __attribute__ ((__dllimport__)) void __attribute__((__cdecl__)) qsort_s(void *_Base,size_t _NumOfElements,size_t _SizeOfElements,int (__attribute__((__cdecl__)) *_PtFuncCompare)(void *,const void *,const void *),void *_Context); #pragma pack(push,_CRT_PACKING) typedef struct _heapinfo { int *_pentry; size_t _size; int _useflag; } _HEAPINFO; extern unsigned int _amblksiz; void * __mingw_aligned_malloc (size_t _Size, size_t _Alignment); void __mingw_aligned_free (void *_Memory); void * __mingw_aligned_offset_realloc (void *_Memory, size_t _Size, size_t _Alignment, size_t _Offset); void * __mingw_aligned_realloc (void *_Memory, size_t _Size, size_t _Offset); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _resetstkoflw (void); __attribute__ ((__dllimport__)) unsigned long __attribute__((__cdecl__)) _set_malloc_crt_max_wait(unsigned long _NewValue); __attribute__ ((__dllimport__)) void *__attribute__((__cdecl__)) _expand(void *_Memory,size_t _NewSize); __attribute__ ((__dllimport__)) size_t __attribute__((__cdecl__)) _msize(void *_Memory); __attribute__ ((__dllimport__)) size_t __attribute__((__cdecl__)) _get_sbh_threshold(void); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _set_sbh_threshold(size_t _NewValue); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _set_amblksiz(size_t _Value); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _get_amblksiz(size_t *_Value); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _heapadd(void *_Memory,size_t _Size); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _heapchk(void); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _heapmin(void); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _heapset(unsigned int _Fill); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _heapwalk(_HEAPINFO *_EntryInfo); __attribute__ ((__dllimport__)) size_t __attribute__((__cdecl__)) _heapused(size_t *_Used,size_t *_Commit); __attribute__ ((__dllimport__)) intptr_t __attribute__((__cdecl__)) _get_heap_handle(void); static __inline void *_MarkAllocaS(void *_Ptr,unsigned int _Marker) { if(_Ptr) { *((unsigned int*)_Ptr) = _Marker; _Ptr = (char*)_Ptr + 16; } return _Ptr; } static __inline void __attribute__((__cdecl__)) _freea(void *_Memory) { unsigned int _Marker; if(_Memory) { _Memory = (char*)_Memory - 16; _Marker = *(unsigned int *)_Memory; if(_Marker==0xDDDD) { free(_Memory); } } } #pragma pack(pop) __attribute__ ((__dllimport__)) void *__attribute__((__cdecl__)) _memccpy(void *_Dst,const void *_Src,int _Val,size_t _MaxCount); void *__attribute__((__cdecl__)) memchr(const void *_Buf ,int _Val,size_t _MaxCount); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _memicmp(const void *_Buf1,const void *_Buf2,size_t _Size); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _memicmp_l(const void *_Buf1,const void *_Buf2,size_t _Size,_locale_t _Locale); int __attribute__((__cdecl__)) memcmp(const void *_Buf1,const void *_Buf2,size_t _Size); void * __attribute__((__cdecl__)) memcpy(void * __restrict__ _Dst,const void * __restrict__ _Src,size_t _Size) ; __attribute__((dllimport)) errno_t __attribute__((__cdecl__)) memcpy_s (void *_dest,size_t _numberOfElements,const void *_src,size_t _count); void * __attribute__((__cdecl__)) mempcpy (void *_Dst, const void *_Src, size_t _Size); void * __attribute__((__cdecl__)) memset(void *_Dst,int _Val,size_t _Size); void * __attribute__((__cdecl__)) memccpy(void *_Dst,const void *_Src,int _Val,size_t _Size) ; int __attribute__((__cdecl__)) memicmp(const void *_Buf1,const void *_Buf2,size_t _Size) ; char * __attribute__((__cdecl__)) _strset(char *_Str,int _Val) ; char * __attribute__((__cdecl__)) _strset_l(char *_Str,int _Val,_locale_t _Locale) ; char * __attribute__((__cdecl__)) strcpy(char * __restrict__ _Dest,const char * __restrict__ _Source); char * __attribute__((__cdecl__)) strcat(char * __restrict__ _Dest,const char * __restrict__ _Source); int __attribute__((__cdecl__)) strcmp(const char *_Str1,const char *_Str2); size_t __attribute__((__cdecl__)) strlen(const char *_Str); size_t __attribute__((__cdecl__)) strnlen(const char *_Str,size_t _MaxCount); void *__attribute__((__cdecl__)) memmove(void *_Dst,const void *_Src,size_t _Size) ; __attribute__ ((__dllimport__)) char *__attribute__((__cdecl__)) _strdup(const char *_Src); char *__attribute__((__cdecl__)) strchr(const char *_Str,int _Val); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _stricmp(const char *_Str1,const char *_Str2); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _strcmpi(const char *_Str1,const char *_Str2); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _stricmp_l(const char *_Str1,const char *_Str2,_locale_t _Locale); int __attribute__((__cdecl__)) strcoll(const char *_Str1,const char *_Str2); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _strcoll_l(const char *_Str1,const char *_Str2,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _stricoll(const char *_Str1,const char *_Str2); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _stricoll_l(const char *_Str1,const char *_Str2,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _strncoll (const char *_Str1,const char *_Str2,size_t _MaxCount); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _strncoll_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _strnicoll (const char *_Str1,const char *_Str2,size_t _MaxCount); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _strnicoll_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale); size_t __attribute__((__cdecl__)) strcspn(const char *_Str,const char *_Control); __attribute__ ((__dllimport__)) char *__attribute__((__cdecl__)) _strerror(const char *_ErrMsg) ; char *__attribute__((__cdecl__)) strerror(int) ; __attribute__ ((__dllimport__)) char *__attribute__((__cdecl__)) _strlwr(char *_String) ; char *strlwr_l(char *_String,_locale_t _Locale) ; char *__attribute__((__cdecl__)) strncat(char * __restrict__ _Dest,const char * __restrict__ _Source,size_t _Count) ; int __attribute__((__cdecl__)) strncmp(const char *_Str1,const char *_Str2,size_t _MaxCount); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _strnicmp(const char *_Str1,const char *_Str2,size_t _MaxCount); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _strnicmp_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale); char *strncpy(char * __restrict__ _Dest,const char * __restrict__ _Source,size_t _Count) ; __attribute__ ((__dllimport__)) char *__attribute__((__cdecl__)) _strnset(char *_Str,int _Val,size_t _MaxCount) ; __attribute__ ((__dllimport__)) char *__attribute__((__cdecl__)) _strnset_l(char *str,int c,size_t count,_locale_t _Locale) ; char *__attribute__((__cdecl__)) strpbrk(const char *_Str,const char *_Control); char *__attribute__((__cdecl__)) strrchr(const char *_Str,int _Ch); __attribute__ ((__dllimport__)) char *__attribute__((__cdecl__)) _strrev(char *_Str); size_t __attribute__((__cdecl__)) strspn(const char *_Str,const char *_Control); char *__attribute__((__cdecl__)) strstr(const char *_Str,const char *_SubStr); char *__attribute__((__cdecl__)) strtok(char * __restrict__ _Str,const char * __restrict__ _Delim) ; char *strtok_r(char * __restrict__ _Str, const char * __restrict__ _Delim, char ** __restrict__ __last); __attribute__ ((__dllimport__)) char *__attribute__((__cdecl__)) _strupr(char *_String) ; __attribute__ ((__dllimport__)) char *_strupr_l(char *_String,_locale_t _Locale) ; size_t __attribute__((__cdecl__)) strxfrm(char * __restrict__ _Dst,const char * __restrict__ _Src,size_t _MaxCount); __attribute__ ((__dllimport__)) size_t __attribute__((__cdecl__)) _strxfrm_l(char * __restrict__ _Dst,const char * __restrict__ _Src,size_t _MaxCount,_locale_t _Locale); char *__attribute__((__cdecl__)) strdup(const char *_Src) ; int __attribute__((__cdecl__)) strcmpi(const char *_Str1,const char *_Str2) ; int __attribute__((__cdecl__)) stricmp(const char *_Str1,const char *_Str2) ; char *__attribute__((__cdecl__)) strlwr(char *_Str) ; int __attribute__((__cdecl__)) strnicmp(const char *_Str1,const char *_Str,size_t _MaxCount) ; int __attribute__((__cdecl__)) strncasecmp (const char *, const char *, size_t); int __attribute__((__cdecl__)) strcasecmp (const char *, const char *); extern inline __attribute__((__gnu_inline__)) int __attribute__((__cdecl__)) strncasecmp (const char *__sz1, const char *__sz2, size_t __sizeMaxCompare) { return _strnicmp (__sz1, __sz2, __sizeMaxCompare); } extern inline __attribute__((__gnu_inline__)) int __attribute__((__cdecl__)) strcasecmp (const char *__sz1, const char *__sz2) { return _stricmp (__sz1, __sz2); } char *__attribute__((__cdecl__)) strnset(char *_Str,int _Val,size_t _MaxCount) ; char *__attribute__((__cdecl__)) strrev(char *_Str) ; char *__attribute__((__cdecl__)) strset(char *_Str,int _Val) ; char *__attribute__((__cdecl__)) strupr(char *_Str) ; __attribute__ ((__dllimport__)) wchar_t *__attribute__((__cdecl__)) _wcsdup(const wchar_t *_Str); wchar_t *__attribute__((__cdecl__)) wcscat(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source) ; wchar_t *__attribute__((__cdecl__)) wcschr(const wchar_t *_Str,wchar_t _Ch); int __attribute__((__cdecl__)) wcscmp(const wchar_t *_Str1,const wchar_t *_Str2); wchar_t *__attribute__((__cdecl__)) wcscpy(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source) ; size_t __attribute__((__cdecl__)) wcscspn(const wchar_t *_Str,const wchar_t *_Control); size_t __attribute__((__cdecl__)) wcslen(const wchar_t *_Str); size_t __attribute__((__cdecl__)) wcsnlen(const wchar_t *_Src,size_t _MaxCount); wchar_t *wcsncat(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source,size_t _Count) ; int __attribute__((__cdecl__)) wcsncmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); wchar_t *wcsncpy(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source,size_t _Count) ; wchar_t *__attribute__((__cdecl__)) _wcsncpy_l(wchar_t * __restrict__ _Dest,const wchar_t * __restrict__ _Source,size_t _Count,_locale_t _Locale) ; wchar_t *__attribute__((__cdecl__)) wcspbrk(const wchar_t *_Str,const wchar_t *_Control); wchar_t *__attribute__((__cdecl__)) wcsrchr(const wchar_t *_Str,wchar_t _Ch); size_t __attribute__((__cdecl__)) wcsspn(const wchar_t *_Str,const wchar_t *_Control); wchar_t *__attribute__((__cdecl__)) wcsstr(const wchar_t *_Str,const wchar_t *_SubStr); wchar_t *__attribute__((__cdecl__)) wcstok(wchar_t * __restrict__ _Str,const wchar_t * __restrict__ _Delim) ; __attribute__ ((__dllimport__)) wchar_t *__attribute__((__cdecl__)) _wcserror(int _ErrNum) ; __attribute__ ((__dllimport__)) wchar_t *__attribute__((__cdecl__)) __wcserror(const wchar_t *_Str) ; __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wcsicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wcsnicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale); __attribute__ ((__dllimport__)) wchar_t *__attribute__((__cdecl__)) _wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount) ; __attribute__ ((__dllimport__)) wchar_t *__attribute__((__cdecl__)) _wcsrev(wchar_t *_Str); __attribute__ ((__dllimport__)) wchar_t *__attribute__((__cdecl__)) _wcsset(wchar_t *_Str,wchar_t _Val) ; __attribute__ ((__dllimport__)) wchar_t *__attribute__((__cdecl__)) _wcslwr(wchar_t *_String) ; __attribute__ ((__dllimport__)) wchar_t *_wcslwr_l(wchar_t *_String,_locale_t _Locale) ; __attribute__ ((__dllimport__)) wchar_t *__attribute__((__cdecl__)) _wcsupr(wchar_t *_String) ; __attribute__ ((__dllimport__)) wchar_t *_wcsupr_l(wchar_t *_String,_locale_t _Locale) ; size_t __attribute__((__cdecl__)) wcsxfrm(wchar_t * __restrict__ _Dst,const wchar_t * __restrict__ _Src,size_t _MaxCount); __attribute__ ((__dllimport__)) size_t __attribute__((__cdecl__)) _wcsxfrm_l(wchar_t * __restrict__ _Dst,const wchar_t * __restrict__ _Src,size_t _MaxCount,_locale_t _Locale); int __attribute__((__cdecl__)) wcscoll(const wchar_t *_Str1,const wchar_t *_Str2); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wcscoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wcsicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wcsncoll(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wcsncoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wcsnicoll(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wcsnicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale); wchar_t *__attribute__((__cdecl__)) wcsdup(const wchar_t *_Str) ; int __attribute__((__cdecl__)) wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2) ; int __attribute__((__cdecl__)) wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount) ; wchar_t *__attribute__((__cdecl__)) wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount) ; wchar_t *__attribute__((__cdecl__)) wcsrev(wchar_t *_Str) ; wchar_t *__attribute__((__cdecl__)) wcsset(wchar_t *_Str,wchar_t _Val) ; wchar_t *__attribute__((__cdecl__)) wcslwr(wchar_t *_Str) ; wchar_t *__attribute__((__cdecl__)) wcsupr(wchar_t *_Str) ; int __attribute__((__cdecl__)) wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2) ; __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _strset_s(char *_Dst,size_t _DstSize,int _Value); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _strerror_s(char *_Buf,size_t _SizeInBytes,const char *_ErrMsg); __attribute__((dllimport)) errno_t __attribute__((__cdecl__)) strerror_s(char *_Buf,size_t _SizeInBytes,int _ErrNum); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _strlwr_s(char *_Str,size_t _Size); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _strlwr_s_l(char *_Str,size_t _Size,_locale_t _Locale); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _strnset_s(char *_Str,size_t _Size,int _Val,size_t _MaxCount); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _strupr_s(char *_Str,size_t _Size); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _strupr_s_l(char *_Str,size_t _Size,_locale_t _Locale); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) strncat_s(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _strncat_s_l(char *_Dst,size_t _DstSizeInChars,const char *_Src,size_t _MaxCount,_locale_t _Locale); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) strcpy_s(char *_Dst, rsize_t _SizeInBytes, const char *_Src); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) strncpy_s(char *_Dst, size_t _DstSizeInChars, const char *_Src, size_t _MaxCount); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _strncpy_s_l(char *_Dst, size_t _DstSizeInChars, const char *_Src, size_t _MaxCount, _locale_t _Locale); ; __attribute__ ((__dllimport__)) char *__attribute__((__cdecl__)) strtok_s(char *_Str,const char *_Delim,char **_Context); __attribute__ ((__dllimport__)) char *__attribute__((__cdecl__)) _strtok_s_l(char *_Str,const char *_Delim,char **_Context,_locale_t _Locale); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) strcat_s(char *_Dst, rsize_t _SizeInBytes, const char * _Src); __attribute__((dllimport)) errno_t __attribute__((__cdecl__)) memmove_s(void *_dest,size_t _numberOfElements,const void *_src,size_t _count); __attribute__ ((__dllimport__)) wchar_t *__attribute__((__cdecl__)) wcstok_s(wchar_t *_Str,const wchar_t *_Delim,wchar_t **_Context); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _wcserror_s(wchar_t *_Buf,size_t _SizeInWords,int _ErrNum); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) __wcserror_s(wchar_t *_Buffer,size_t _SizeInWords,const wchar_t *_ErrMsg); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _wcsnset_s(wchar_t *_Dst,size_t _DstSizeInWords,wchar_t _Val,size_t _MaxCount); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _wcsset_s(wchar_t *_Str,size_t _SizeInWords,wchar_t _Val); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _wcslwr_s(wchar_t *_Str,size_t _SizeInWords); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _wcslwr_s_l(wchar_t *_Str,size_t _SizeInWords,_locale_t _Locale); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _wcsupr_s(wchar_t *_Str,size_t _Size); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _wcsupr_s_l(wchar_t *_Str,size_t _Size,_locale_t _Locale); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) wcscpy_s(wchar_t *_Dst, rsize_t _SizeInWords, const wchar_t *_Src); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) wcscat_s(wchar_t * _Dst, rsize_t _SizeInWords, const wchar_t *_Src); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) wcsncat_s(wchar_t *_Dst,size_t _DstSizeInChars,const wchar_t *_Src,size_t _MaxCount); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _wcsncat_s_l(wchar_t *_Dst,size_t _DstSizeInChars,const wchar_t *_Src,size_t _MaxCount,_locale_t _Locale); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) wcsncpy_s(wchar_t *_Dst, size_t _DstSizeInChars, const wchar_t *_Src, size_t _MaxCount); ; __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _wcsncpy_s_l(wchar_t *_Dst, size_t _DstSizeInChars, const wchar_t *_Src, size_t _MaxCount, _locale_t _Locale); ; __attribute__ ((__dllimport__)) wchar_t *__attribute__((__cdecl__)) _wcstok_s_l(wchar_t *_Str,const wchar_t *_Delim,wchar_t **_Context,_locale_t _Locale); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _wcsset_s_l(wchar_t *_Str,size_t _SizeInChars,unsigned int _Val,_locale_t _Locale); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _wcsnset_s_l(wchar_t *_Str,size_t _SizeInChars,unsigned int _Val, size_t _Count,_locale_t _Locale); extern __inline__ __attribute__((__always_inline__,__gnu_inline__)) size_t __attribute__((__cdecl__)) wcsnlen_s(const wchar_t * _src, size_t _count) { return _src ? wcsnlen(_src, _count) : 0; } extern unsigned short ** __imp__pctype; extern unsigned short ** __imp__wctype; extern unsigned short ** __imp__pwctype; extern const unsigned char __newclmap[]; extern const unsigned char __newcumap[]; extern pthreadlocinfo __ptlocinfo; extern pthreadmbcinfo __ptmbcinfo; extern int __globallocalestatus; extern int __locale_changed; extern struct threadlocaleinfostruct __initiallocinfo; extern _locale_tstruct __initiallocalestructinfo; pthreadlocinfo __attribute__((__cdecl__)) __updatetlocinfo(void); pthreadmbcinfo __attribute__((__cdecl__)) __updatetmbcinfo(void); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _isctype(int _C,int _Type); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _isctype_l(int _C,int _Type,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) isalpha(int _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _isalpha_l(int _C,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) isupper(int _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _isupper_l(int _C,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) islower(int _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _islower_l(int _C,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) isdigit(int _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _isdigit_l(int _C,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) isxdigit(int _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _isxdigit_l(int _C,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) isspace(int _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _isspace_l(int _C,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) ispunct(int _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _ispunct_l(int _C,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) isalnum(int _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _isalnum_l(int _C,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) isprint(int _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _isprint_l(int _C,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) isgraph(int _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _isgraph_l(int _C,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) iscntrl(int _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _iscntrl_l(int _C,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) toupper(int _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) tolower(int _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _tolower(int _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _tolower_l(int _C,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _toupper(int _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _toupper_l(int _C,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) __isascii(int _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) __toascii(int _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) __iscsymf(int _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) __iscsym(int _C); int __attribute__((__cdecl__)) isblank(int _C); int __attribute__((__cdecl__)) iswalpha(wint_t _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _iswalpha_l(wint_t _C,_locale_t _Locale); int __attribute__((__cdecl__)) iswupper(wint_t _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _iswupper_l(wint_t _C,_locale_t _Locale); int __attribute__((__cdecl__)) iswlower(wint_t _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _iswlower_l(wint_t _C,_locale_t _Locale); int __attribute__((__cdecl__)) iswdigit(wint_t _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _iswdigit_l(wint_t _C,_locale_t _Locale); int __attribute__((__cdecl__)) iswxdigit(wint_t _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _iswxdigit_l(wint_t _C,_locale_t _Locale); int __attribute__((__cdecl__)) iswspace(wint_t _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _iswspace_l(wint_t _C,_locale_t _Locale); int __attribute__((__cdecl__)) iswpunct(wint_t _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _iswpunct_l(wint_t _C,_locale_t _Locale); int __attribute__((__cdecl__)) iswalnum(wint_t _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _iswalnum_l(wint_t _C,_locale_t _Locale); int __attribute__((__cdecl__)) iswprint(wint_t _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _iswprint_l(wint_t _C,_locale_t _Locale); int __attribute__((__cdecl__)) iswgraph(wint_t _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _iswgraph_l(wint_t _C,_locale_t _Locale); int __attribute__((__cdecl__)) iswcntrl(wint_t _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _iswcntrl_l(wint_t _C,_locale_t _Locale); int __attribute__((__cdecl__)) iswascii(wint_t _C); int __attribute__((__cdecl__)) isleadbyte(int _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _isleadbyte_l(int _C,_locale_t _Locale); wint_t __attribute__((__cdecl__)) towupper(wint_t _C); __attribute__ ((__dllimport__)) wint_t __attribute__((__cdecl__)) _towupper_l(wint_t _C,_locale_t _Locale); wint_t __attribute__((__cdecl__)) towlower(wint_t _C); __attribute__ ((__dllimport__)) wint_t __attribute__((__cdecl__)) _towlower_l(wint_t _C,_locale_t _Locale); int __attribute__((__cdecl__)) iswctype(wint_t _C,wctype_t _Type); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _iswctype_l(wint_t _C,wctype_t _Type,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) __iswcsymf(wint_t _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _iswcsymf_l(wint_t _C,_locale_t _Locale); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) __iswcsym(wint_t _C); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _iswcsym_l(wint_t _C,_locale_t _Locale); int __attribute__((__cdecl__)) is_wctype(wint_t _C,wctype_t _Type); int __attribute__((__cdecl__)) iswblank(wint_t _C); #pragma pack(push,_CRT_PACKING) typedef long clock_t; struct tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; }; extern __attribute__ ((__dllimport__)) int _daylight; extern __attribute__ ((__dllimport__)) long _dstbias; extern __attribute__ ((__dllimport__)) long _timezone; extern __attribute__ ((__dllimport__)) char * _tzname[2]; __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _get_daylight(int *_Daylight); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _get_dstbias(long *_Daylight_savings_bias); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _get_timezone(long *_Timezone); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _get_tzname(size_t *_ReturnValue,char *_Buffer,size_t _SizeInBytes,int _Index); char *__attribute__((__cdecl__)) asctime(const struct tm *_Tm) ; __attribute__((dllimport)) errno_t __attribute__((__cdecl__)) asctime_s (char *_Buf,size_t _SizeInWords,const struct tm *_Tm); char *__attribute__((__cdecl__)) _ctime32(const __time32_t *_Time) ; __attribute__((dllimport)) errno_t __attribute__((__cdecl__)) _ctime32_s (char *_Buf,size_t _SizeInBytes,const __time32_t *_Time); clock_t __attribute__((__cdecl__)) clock(void); double __attribute__((__cdecl__)) _difftime32(__time32_t _Time1,__time32_t _Time2); struct tm *__attribute__((__cdecl__)) _gmtime32(const __time32_t *_Time) ; __attribute__((dllimport)) errno_t __attribute__((__cdecl__)) _gmtime32_s (struct tm *_Tm,const __time32_t *_Time); struct tm *__attribute__((__cdecl__)) _localtime32(const __time32_t *_Time) ; __attribute__((dllimport)) errno_t __attribute__((__cdecl__)) _localtime32_s (struct tm *_Tm,const __time32_t *_Time); size_t __attribute__((__cdecl__)) strftime(char * __restrict__ _Buf,size_t _SizeInBytes,const char * __restrict__ _Format,const struct tm * __restrict__ _Tm); __attribute__ ((__dllimport__)) size_t __attribute__((__cdecl__)) _strftime_l(char * __restrict__ _Buf,size_t _Max_size,const char * __restrict__ _Format,const struct tm * __restrict__ _Tm,_locale_t _Locale); __attribute__ ((__dllimport__)) char *__attribute__((__cdecl__)) _strdate(char *_Buffer) ; __attribute__((dllimport)) errno_t __attribute__((__cdecl__)) _strdate_s (char *_Buf,size_t _SizeInBytes); __attribute__ ((__dllimport__)) char *__attribute__((__cdecl__)) _strtime(char *_Buffer) ; __attribute__((dllimport)) errno_t __attribute__((__cdecl__)) _strtime_s (char *_Buf ,size_t _SizeInBytes); __time32_t __attribute__((__cdecl__)) _time32(__time32_t *_Time); __time32_t __attribute__((__cdecl__)) _mktime32(struct tm *_Tm); __time32_t __attribute__((__cdecl__)) _mkgmtime32(struct tm *_Tm); void __attribute__((__cdecl__)) tzset(void) ; __attribute__ ((__dllimport__)) void __attribute__((__cdecl__)) _tzset(void); double __attribute__((__cdecl__)) _difftime64(__time64_t _Time1,__time64_t _Time2); __attribute__ ((__dllimport__)) char *__attribute__((__cdecl__)) _ctime64(const __time64_t *_Time) ; __attribute__((dllimport)) errno_t __attribute__((__cdecl__)) _ctime64_s (char *_Buf,size_t _SizeInBytes,const __time64_t *_Time); __attribute__ ((__dllimport__)) struct tm *__attribute__((__cdecl__)) _gmtime64(const __time64_t *_Time) ; __attribute__((dllimport)) errno_t __attribute__((__cdecl__)) _gmtime64_s (struct tm *_Tm,const __time64_t *_Time); __attribute__ ((__dllimport__)) struct tm *__attribute__((__cdecl__)) _localtime64(const __time64_t *_Time) ; __attribute__((dllimport)) errno_t __attribute__((__cdecl__)) _localtime64_s (struct tm *_Tm,const __time64_t *_Time); __attribute__ ((__dllimport__)) __time64_t __attribute__((__cdecl__)) _mktime64(struct tm *_Tm); __attribute__ ((__dllimport__)) __time64_t __attribute__((__cdecl__)) _mkgmtime64(struct tm *_Tm); __attribute__ ((__dllimport__)) __time64_t __attribute__((__cdecl__)) _time64(__time64_t *_Time); unsigned __attribute__((__cdecl__)) _getsystime(struct tm *_Tm); unsigned __attribute__((__cdecl__)) _setsystime(struct tm *_Tm,unsigned _MilliSec); __attribute__ ((__dllimport__)) wchar_t *__attribute__((__cdecl__)) _wasctime(const struct tm *_Tm); __attribute__((dllimport)) errno_t __attribute__((__cdecl__)) _wasctime_s (wchar_t *_Buf,size_t _SizeInWords,const struct tm *_Tm); wchar_t *__attribute__((__cdecl__)) _wctime32(const __time32_t *_Time) ; __attribute__((dllimport)) errno_t __attribute__((__cdecl__)) _wctime32_s (wchar_t *_Buf,size_t _SizeInWords,const __time32_t *_Time); size_t __attribute__((__cdecl__)) wcsftime(wchar_t * __restrict__ _Buf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,const struct tm * __restrict__ _Tm); __attribute__ ((__dllimport__)) size_t __attribute__((__cdecl__)) _wcsftime_l(wchar_t * __restrict__ _Buf,size_t _SizeInWords,const wchar_t * __restrict__ _Format,const struct tm * __restrict__ _Tm,_locale_t _Locale); __attribute__ ((__dllimport__)) wchar_t *__attribute__((__cdecl__)) _wstrdate(wchar_t *_Buffer) ; __attribute__((dllimport)) errno_t __attribute__((__cdecl__)) _wstrdate_s (wchar_t *_Buf,size_t _SizeInWords); __attribute__ ((__dllimport__)) wchar_t *__attribute__((__cdecl__)) _wstrtime(wchar_t *_Buffer) ; __attribute__((dllimport)) errno_t __attribute__((__cdecl__)) _wstrtime_s (wchar_t *_Buf,size_t _SizeInWords); __attribute__ ((__dllimport__)) wchar_t *__attribute__((__cdecl__)) _wctime64(const __time64_t *_Time) ; __attribute__((dllimport)) errno_t __attribute__((__cdecl__)) _wctime64_s (wchar_t *_Buf,size_t _SizeInWords,const __time64_t *_Time); wchar_t *__attribute__((__cdecl__)) _wctime(const time_t *) ; extern inline __attribute__((__gnu_inline__)) wchar_t *__attribute__((__cdecl__)) _wctime(const time_t *_Time) { return _wctime64(_Time); } errno_t __attribute__((__cdecl__)) _wctime_s(wchar_t *, size_t, const time_t *); extern inline __attribute__((__gnu_inline__)) errno_t __attribute__((__cdecl__)) _wctime_s (wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime64_s (_Buffer,_SizeInWords,_Time); } double __attribute__((__cdecl__)) difftime(time_t _Time1,time_t _Time2); char *__attribute__((__cdecl__)) ctime(const time_t *_Time) ; struct tm *__attribute__((__cdecl__)) gmtime(const time_t *_Time) ; struct tm *__attribute__((__cdecl__)) localtime(const time_t *_Time) ; time_t __attribute__((__cdecl__)) mktime(struct tm *_Tm); time_t __attribute__((__cdecl__)) _mkgmtime(struct tm *_Tm); time_t __attribute__((__cdecl__)) time(time_t *_Time); extern inline __attribute__((__gnu_inline__)) double __attribute__((__cdecl__)) difftime(time_t _Time1,time_t _Time2) { return _difftime64(_Time1,_Time2); } extern inline __attribute__((__gnu_inline__)) char *__attribute__((__cdecl__)) ctime(const time_t *_Time) { return _ctime64(_Time); } extern inline __attribute__((__gnu_inline__)) struct tm *__attribute__((__cdecl__)) gmtime(const time_t *_Time) { return _gmtime64(_Time); } extern inline __attribute__((__gnu_inline__)) struct tm *__attribute__((__cdecl__)) localtime(const time_t *_Time) { return _localtime64(_Time); } extern inline __attribute__((__gnu_inline__)) time_t __attribute__((__cdecl__)) mktime(struct tm *_Tm) { return _mktime64(_Tm); } extern inline __attribute__((__gnu_inline__)) time_t __attribute__((__cdecl__)) _mkgmtime(struct tm *_Tm) { return _mkgmtime64(_Tm); } extern inline __attribute__((__gnu_inline__)) time_t __attribute__((__cdecl__)) time(time_t *_Time) { return _time64(_Time); } extern __inline__ __attribute__((__always_inline__,__gnu_inline__)) errno_t __attribute__((__cdecl__)) localtime_s(struct tm *_Tm,const time_t *_Time) { return _localtime64_s(_Tm,_Time); } extern __inline__ __attribute__((__always_inline__,__gnu_inline__)) errno_t __attribute__((__cdecl__)) gmtime_s(struct tm *_Tm, const time_t *_Time) { return _gmtime64_s(_Tm, _Time); } extern __inline__ __attribute__((__always_inline__,__gnu_inline__)) errno_t __attribute__((__cdecl__)) ctime_s(char *_Buf,size_t _SizeInBytes,const time_t *_Time) { return _ctime64_s(_Buf,_SizeInBytes,_Time); } __attribute__ ((__dllimport__)) extern int daylight ; __attribute__ ((__dllimport__)) extern long timezone ; __attribute__ ((__dllimport__)) extern char *tzname[2] ; void __attribute__((__cdecl__)) tzset(void) ; struct timeval { long tv_sec; long tv_usec; }; struct timezone { int tz_minuteswest; int tz_dsttime; }; extern int __attribute__((__cdecl__)) mingw_gettimeofday (struct timeval *p, struct timezone *z); #pragma pack(pop) #pragma pack(push,_CRT_PACKING) struct __timeb32 { __time32_t time; unsigned short millitm; short timezone; short dstflag; }; struct timeb { time_t time; unsigned short millitm; short timezone; short dstflag; }; struct __timeb64 { __time64_t time; unsigned short millitm; short timezone; short dstflag; }; __attribute__ ((__dllimport__)) void __attribute__((__cdecl__)) _ftime64(struct __timeb64 *_Time); __attribute__ ((__dllimport__)) void __attribute__((__cdecl__)) _ftime(struct __timeb64 *); struct timespec { time_t tv_sec; long tv_nsec; }; struct itimerspec { struct timespec it_interval; struct timespec it_value; }; void __attribute__((__cdecl__)) ftime (struct timeb *); extern inline __attribute__((__gnu_inline__)) void __attribute__((__cdecl__)) ftime(struct timeb *_Tmb) { _ftime64((struct __timeb64 *)_Tmb); } #pragma pack(pop) __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _ftime_s(struct __timeb32 *_Time); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _ftime64_s(struct __timeb64 *_Time); typedef int clockid_t; int __attribute__((__cdecl__)) nanosleep(const struct timespec *request, struct timespec *remain); int __attribute__((__cdecl__)) clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *request, struct timespec *remain); int __attribute__((__cdecl__)) clock_getres(clockid_t clock_id, struct timespec *res); int __attribute__((__cdecl__)) clock_gettime(clockid_t clock_id, struct timespec *tp); int __attribute__((__cdecl__)) clock_settime(clockid_t clock_id, const struct timespec *tp); void replaceFn(void* oldFn, void* newFn); #pragma pack(1) typedef int ScreenCoord; typedef int RealScreenCoord; typedef signed char PlayerNumber; typedef unsigned char ThingClass; typedef unsigned char ThingModel; typedef unsigned short ThingIndex; typedef unsigned short CrtrStateId; typedef unsigned char CrtrExpLevel; typedef unsigned char AnnoyMotive; typedef unsigned char RoomKind; typedef unsigned long RoomRole; typedef unsigned short RoomIndex; typedef unsigned char SlabKind; typedef unsigned short SpellKind; typedef unsigned short PowerKind; typedef unsigned char EventKind; typedef unsigned short SpecialKind; typedef short EventIndex; typedef short BattleIndex; typedef long HitPoints; typedef short TngUpdateRet; typedef short CrStateRet; typedef short CrCheckRet; typedef unsigned long long CreatureJob; typedef short CrInstance; typedef short CrAttackType; typedef unsigned short CrDeathFlags; typedef long LevelNumber; typedef unsigned long GameTurn; typedef long GameTurnDelta; typedef int TextStringId; typedef long MapCoord; typedef long MapCoordDelta; typedef long MapSubtlCoord; typedef long MapSubtlDelta; typedef short MapSlabCoord; typedef unsigned long SubtlCodedCoords; typedef unsigned long SlabCodedCoords; typedef short ColumnIndex; typedef unsigned char PerPlayerFlags; typedef short MoveSpeed; typedef long GoldAmount; typedef long ActionPointId; typedef long FilterParam; typedef char ItemAvailability; typedef unsigned char DamageType; typedef unsigned char ThingHitType; typedef unsigned long HitTargetFlags; typedef char ActiveButtonID; typedef short FrontendMenuState; typedef unsigned short SpDiggerTaskType; typedef unsigned char NaviRouteFlags; struct Coord2d { union { unsigned short val; struct { unsigned char pos; unsigned char num; } stl; } x; union { unsigned short val; struct { unsigned char pos; unsigned char num; } stl; } y; }; struct Coord3d { union { unsigned short val; struct { unsigned char pos; unsigned char num; } stl; } x; union { unsigned short val; struct { unsigned char pos; unsigned char num; } stl; } y; union { unsigned short val; struct { unsigned char pos; unsigned char num; } stl; } z; }; struct CoordDelta3d { union { short val; struct { unsigned char pos; char num; } stl; } x; union { short val; struct { unsigned char pos; char num; } stl; } y; union { short val; struct { unsigned char pos; char num; } stl; } z; }; struct Around { signed char delta_x; signed char delta_y; }; struct AroundLByte { signed short delta_x; signed short delta_y; }; #pragma pack() struct IPOINT_2D { int x; int y; }; struct IPOINT_3D { int x; int y; int z; }; struct UPOINT_2D { unsigned int x; unsigned int y; }; struct UPOINT_3D { unsigned int x; unsigned int y; unsigned int z; }; struct USPOINT_2D { unsigned short x; unsigned short y; }; struct IRECT_2D { int l; int r; int t; int b; }; #pragma pack(push,_CRT_PACKING) __attribute__ ((__dllimport__)) char* __attribute__((__cdecl__)) _getcwd (char*, int); typedef unsigned long _fsize_t; struct _finddata32_t { unsigned attrib; __time32_t time_create; __time32_t time_access; __time32_t time_write; _fsize_t size; char name[260]; }; struct _finddata32i64_t { unsigned attrib; __time32_t time_create; __time32_t time_access; __time32_t time_write; __extension__ long long size; char name[260]; }; struct _finddata64i32_t { unsigned attrib; __time64_t time_create; __time64_t time_access; __time64_t time_write; _fsize_t size; char name[260]; }; struct __finddata64_t { unsigned attrib; __time64_t time_create; __time64_t time_access; __time64_t time_write; __extension__ long long size; char name[260]; }; struct _wfinddata32_t { unsigned attrib; __time32_t time_create; __time32_t time_access; __time32_t time_write; _fsize_t size; wchar_t name[260]; }; struct _wfinddata32i64_t { unsigned attrib; __time32_t time_create; __time32_t time_access; __time32_t time_write; __extension__ long long size; wchar_t name[260]; }; struct _wfinddata64i32_t { unsigned attrib; __time64_t time_create; __time64_t time_access; __time64_t time_write; _fsize_t size; wchar_t name[260]; }; struct _wfinddata64_t { unsigned attrib; __time64_t time_create; __time64_t time_access; __time64_t time_write; __extension__ long long size; wchar_t name[260]; }; __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _access(const char *_Filename,int _AccessMode); __attribute__((dllimport)) errno_t __attribute__((__cdecl__)) _access_s(const char *_Filename,int _AccessMode); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _chmod(const char *_Filename,int _Mode); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _chsize(int _FileHandle,long _Size) ; __attribute__((dllimport)) errno_t __attribute__((__cdecl__)) _chsize_s (int _FileHandle,long long _Size); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _close(int _FileHandle); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _commit(int _FileHandle); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _creat(const char *_Filename,int _PermissionMode) ; __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _dup(int _FileHandle); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _dup2(int _FileHandleSrc,int _FileHandleDst); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _eof(int _FileHandle); __attribute__ ((__dllimport__)) long __attribute__((__cdecl__)) _filelength(int _FileHandle); __attribute__ ((__dllimport__)) intptr_t __attribute__((__cdecl__)) _findfirst32(const char *_Filename,struct _finddata32_t *_FindData); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _findnext32(intptr_t _FindHandle,struct _finddata32_t *_FindData); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _findclose(intptr_t _FindHandle); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _isatty(int _FileHandle); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _locking(int _FileHandle,int _LockMode,long _NumOfBytes); __attribute__ ((__dllimport__)) long __attribute__((__cdecl__)) _lseek(int _FileHandle,long _Offset,int _Origin); _off64_t lseek64(int fd,_off64_t offset, int whence); __attribute__ ((__dllimport__)) char *__attribute__((__cdecl__)) _mktemp(char *_TemplateName) ; __attribute__((dllimport)) errno_t __attribute__((__cdecl__)) _mktemp_s (char *_TemplateName,size_t _Size); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _pipe(int *_PtHandles,unsigned int _PipeSize,int _TextMode); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _read(int _FileHandle,void *_DstBuf,unsigned int _MaxCharCount); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _setmode(int _FileHandle,int _Mode); __attribute__ ((__dllimport__)) long __attribute__((__cdecl__)) _tell(int _FileHandle); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _umask(int _Mode) ; __attribute__((dllimport)) errno_t __attribute__((__cdecl__)) _umask_s (int _NewMode,int *_OldMode); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _write(int _FileHandle,const void *_Buf,unsigned int _MaxCharCount); __extension__ __attribute__ ((__dllimport__)) long long __attribute__((__cdecl__)) _filelengthi64(int _FileHandle); __attribute__ ((__dllimport__)) intptr_t __attribute__((__cdecl__)) _findfirst32i64(const char *_Filename,struct _finddata32i64_t *_FindData); __attribute__ ((__dllimport__)) intptr_t __attribute__((__cdecl__)) _findfirst64(const char *_Filename,struct __finddata64_t *_FindData); intptr_t __attribute__((__cdecl__)) _findfirst64i32(const char *_Filename,struct _finddata64i32_t *_FindData); extern inline __attribute__((__gnu_inline__)) intptr_t __attribute__((__cdecl__)) _findfirst64i32(const char *_Filename,struct _finddata64i32_t *_FindData) { struct __finddata64_t fd; intptr_t ret = _findfirst64(_Filename,&fd); if (ret == -1) { memset(_FindData,0,sizeof(struct _finddata64i32_t)); return -1; } _FindData->attrib=fd.attrib; _FindData->time_create=fd.time_create; _FindData->time_access=fd.time_access; _FindData->time_write=fd.time_write; _FindData->size=(_fsize_t) fd.size; strncpy(_FindData->name,fd.name,260); return ret; } __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _findnext32i64(intptr_t _FindHandle,struct _finddata32i64_t *_FindData); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _findnext64(intptr_t _FindHandle,struct __finddata64_t *_FindData); int __attribute__((__cdecl__)) _findnext64i32(intptr_t _FindHandle,struct _finddata64i32_t *_FindData); extern inline __attribute__((__gnu_inline__)) int __attribute__((__cdecl__)) _findnext64i32(intptr_t _FindHandle,struct _finddata64i32_t *_FindData) { struct __finddata64_t fd; int ret = _findnext64(_FindHandle,&fd); if (ret == -1) { memset(_FindData,0,sizeof(struct _finddata64i32_t)); return -1; } _FindData->attrib=fd.attrib; _FindData->time_create=fd.time_create; _FindData->time_access=fd.time_access; _FindData->time_write=fd.time_write; _FindData->size=(_fsize_t) fd.size; strncpy(_FindData->name,fd.name,260); return ret; } __extension__ long long __attribute__((__cdecl__)) _lseeki64(int _FileHandle,long long _Offset,int _Origin); __extension__ long long __attribute__((__cdecl__)) _telli64(int _FileHandle); int __attribute__((__cdecl__)) chdir (const char *) ; char *__attribute__((__cdecl__)) getcwd (char *, int) ; int __attribute__((__cdecl__)) mkdir (const char *) ; char *__attribute__((__cdecl__)) mktemp(char *) ; int __attribute__((__cdecl__)) rmdir (const char*) ; int __attribute__((__cdecl__)) chmod (const char *, int) ; __attribute__((dllimport)) errno_t __attribute__((__cdecl__)) _sopen_s(int *_FileHandle,const char *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionMode); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _open(const char *_Filename,int _OpenFlag,...) ; __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _sopen(const char *_Filename,int _OpenFlag,int _ShareFlag,...) ; __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _waccess(const wchar_t *_Filename,int _AccessMode); __attribute__((dllimport)) errno_t __attribute__((__cdecl__)) _waccess_s (const wchar_t *_Filename,int _AccessMode); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wchmod(const wchar_t *_Filename,int _Mode); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wcreat(const wchar_t *_Filename,int _PermissionMode) ; __attribute__ ((__dllimport__)) intptr_t __attribute__((__cdecl__)) _wfindfirst32(const wchar_t *_Filename,struct _wfinddata32_t *_FindData); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wfindnext32(intptr_t _FindHandle,struct _wfinddata32_t *_FindData); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wunlink(const wchar_t *_Filename); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wrename(const wchar_t *_OldFilename,const wchar_t *_NewFilename); __attribute__ ((__dllimport__)) wchar_t *__attribute__((__cdecl__)) _wmktemp(wchar_t *_TemplateName) ; __attribute__((dllimport)) errno_t __attribute__((__cdecl__)) _wmktemp_s (wchar_t *_TemplateName, size_t _SizeInWords); __attribute__ ((__dllimport__)) intptr_t __attribute__((__cdecl__)) _wfindfirst32i64(const wchar_t *_Filename,struct _wfinddata32i64_t *_FindData); intptr_t __attribute__((__cdecl__)) _wfindfirst64i32(const wchar_t *_Filename,struct _wfinddata64i32_t *_FindData); __attribute__ ((__dllimport__)) intptr_t __attribute__((__cdecl__)) _wfindfirst64(const wchar_t *_Filename,struct _wfinddata64_t *_FindData); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wfindnext32i64(intptr_t _FindHandle,struct _wfinddata32i64_t *_FindData); int __attribute__((__cdecl__)) _wfindnext64i32(intptr_t _FindHandle,struct _wfinddata64i32_t *_FindData); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wfindnext64(intptr_t _FindHandle,struct _wfinddata64_t *_FindData); __attribute__ ((__dllimport__)) errno_t __attribute__((__cdecl__)) _wsopen_s(int *_FileHandle,const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionFlag); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wopen(const wchar_t *_Filename,int _OpenFlag,...) ; __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _wsopen(const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,...) ; int __attribute__((__cdecl__)) __lock_fhandle(int _Filehandle); void __attribute__((__cdecl__)) _unlock_fhandle(int _Filehandle); __attribute__ ((__dllimport__)) intptr_t __attribute__((__cdecl__)) _get_osfhandle(int _FileHandle); __attribute__ ((__dllimport__)) int __attribute__((__cdecl__)) _open_osfhandle(intptr_t _OSFileHandle,int _Flags); int __attribute__((__cdecl__)) access(const char *_Filename,int _AccessMode) ; int __attribute__((__cdecl__)) chmod(const char *_Filename,int _AccessMode) ; int __attribute__((__cdecl__)) chsize(int _FileHandle,long _Size) ; int __attribute__((__cdecl__)) close(int _FileHandle) ; int __attribute__((__cdecl__)) creat(const char *_Filename,int _PermissionMode) ; int __attribute__((__cdecl__)) dup(int _FileHandle) ; int __attribute__((__cdecl__)) dup2(int _FileHandleSrc,int _FileHandleDst) ; int __attribute__((__cdecl__)) eof(int _FileHandle) ; long __attribute__((__cdecl__)) filelength(int _FileHandle) ; int __attribute__((__cdecl__)) isatty(int _FileHandle) ; int __attribute__((__cdecl__)) locking(int _FileHandle,int _LockMode,long _NumOfBytes) ; long __attribute__((__cdecl__)) lseek(int _FileHandle,long _Offset,int _Origin) ; char *__attribute__((__cdecl__)) mktemp(char *_TemplateName) ; int __attribute__((__cdecl__)) open(const char *_Filename,int _OpenFlag,...) ; int __attribute__((__cdecl__)) read(int _FileHandle,void *_DstBuf,unsigned int _MaxCharCount) ; int __attribute__((__cdecl__)) setmode(int _FileHandle,int _Mode) ; int __attribute__((__cdecl__)) sopen(const char *_Filename,int _OpenFlag,int _ShareFlag,...) ; long __attribute__((__cdecl__)) tell(int _FileHandle) ; int __attribute__((__cdecl__)) umask(int _Mode) ; int __attribute__((__cdecl__)) write(int _Filehandle,const void *_Buf,unsigned int _MaxCharCount) ; #pragma pack(pop) enum TbErrorLogFlags { Lb_ERROR_LOG_APPEND = 0, Lb_ERROR_LOG_NEW = 1, }; enum TbLogFlags { LbLog_DateInHeader = 0x0010, LbLog_TimeInHeader = 0x0020, LbLog_DateInLines = 0x0040, LbLog_TimeInLines = 0x0080, LbLog_LoopedFile = 0x0100, }; enum TbErrorCode { Lb_FAIL = -1, Lb_OK = 0, Lb_SUCCESS = 1, }; #pragma pack(1) typedef unsigned long ulong; typedef unsigned int uint; typedef unsigned short ushort; typedef unsigned char uchar; struct TbTime { unsigned char Hour; unsigned char Minute; unsigned char Second; unsigned char HSecond; }; struct TbDate { unsigned char Day; unsigned char Month; unsigned short Year; unsigned char DayOfWeek; }; typedef long TbClockMSec; typedef time_t TbTimeSec; typedef unsigned char TbChecksum; typedef unsigned long TbBigChecksum; typedef long Offset; typedef int TbFileHandle; typedef unsigned char TbBool; typedef short TbScreenPos; struct TbFileFind { char Filename[144]; char AlternateFilename[14]; unsigned long Attributes; unsigned long Length; struct TbDate CreationDate; struct TbTime CreationTime; struct TbDate LastWriteDate; struct TbTime LastWriteTime; unsigned long ReservedHandle; struct _finddata64i32_t Reserved; }; struct TbLog { char filename[144]; char prefix[32]; ulong flags; TbBool Initialised; TbBool Created; TbBool Suspended; long position; }; struct TbNetworkCallbackData; typedef int TbError; typedef int TbResult; typedef size_t TbSize; #pragma pack() extern const char *log_file_name; void error(const char *codefile,const int ecode,const char *message); short error_dialog(const char *codefile,const int ecode,const char *message); short error_dialog_fatal(const char *codefile,const int ecode,const char *message); char *buf_sprintf(const char *format, ...); int LbErrorLog(const char *format, ...); int LbWarnLog(const char *format, ...); int LbSyncLog(const char *format, ...); int LbNetLog(const char *format, ...); int LbJustLog(const char *format, ...); int LbAiLog(const char *format, ...); int LbNaviLog(const char *format, ...); int LbScriptLog(unsigned long line,const char *format, ...); int LbConfigLog(unsigned long line,const char *format, ...); int LbErrorLogSetup(const char *directory, const char *filename, TbBool flag); int LbErrorLogClose(void); int LbLogClose(struct TbLog *log); int LbLogSetup(struct TbLog *log, const char *filename, ulong flags); int LbLogSetPrefix(struct TbLog *log, const char *prefix); int LbLogSetPrefixFmt(struct TbLog *log, const char *format, ...); typedef void ( *TbNetworkCallbackFunc)(struct TbNetworkCallbackData *, void *); unsigned long blong (unsigned char *p); unsigned long llong (unsigned char *p); unsigned long bword (unsigned char *p); unsigned long lword (unsigned char *p); void set_flag_byte(unsigned char *flags,unsigned char mask,short value); void set_flag_word(unsigned short *flags,unsigned short mask,short value); void set_flag_dword(unsigned long *flags,unsigned long mask,short value); void toggle_flag_byte(unsigned char *flags,unsigned char mask); void toggle_flag_dword(unsigned long *flags,unsigned long mask); long saturate_set_signed(long long val,unsigned short nbits); unsigned long saturate_set_unsigned(unsigned long long val,unsigned short nbits); typedef char TbLocChar; typedef int TbCharCount; TbCharCount LbLocTextStringLength(const TbLocChar *s); TbSize LbLocTextStringSize(const TbLocChar *s); TbSize LbLocTextPosToLength(const TbLocChar *s, TbCharCount pos); TbLocChar *LbLocTextStringConcat(TbLocChar *str, const TbLocChar *catstr, TbSize maxlen); TbLocChar *LbLocTextStringInsert(TbLocChar *str, const TbLocChar *catstr, TbCharCount pos, TbSize maxlen); TbLocChar *LbLocTextStringDelete(TbLocChar *str, TbCharCount pos, TbCharCount count); #pragma pack(1) struct GuiButton; struct GuiMenu; struct GuiBox; struct GuiBoxOption; enum TbButtonType { LbBtnT_NormalBtn = 0, LbBtnT_HoldableBtn, LbBtnT_ToggleBtn, LbBtnT_RadioBtn, LbBtnT_HorizSlider, LbBtnT_EditBox, LbBtnT_Unknown6, }; enum TbButtonFlags { LbBtnF_Unknown01 = 0x01, LbBtnF_Unknown02 = 0x02, LbBtnF_Visible = 0x04, LbBtnF_Enabled = 0x08, LbBtnF_Unknown10 = 0x10, LbBtnF_Unknown20 = 0x20, LbBtnF_Unknown40 = 0x40, LbBtnF_Unknown80 = 0x80, }; union GuiVariant { long lval; long *lptr; char *str; }; typedef long (*Gf_OptnBox_4Callback)(struct GuiBox *, struct GuiBoxOption *, unsigned char, long *); typedef long (*Gf_OptnBox_3Callback)(struct GuiBox *, struct GuiBoxOption *, long *); typedef void (*Gf_Btn_Callback)(struct GuiButton *gbtn); typedef void (*Gf_Mnu_Callback)(struct GuiMenu *gmnu); struct GuiBoxOption { const char *label; unsigned char numfield_4; Gf_OptnBox_3Callback active_cb; Gf_OptnBox_4Callback callback; long field_D; long field_11; long field_15; long field_19; long field_1D; long field_21; char active; char field_26; }; struct GuiBox { char field_0; short field_1; long pos_x; long pos_y; long width; long height; struct GuiBoxOption *optn_list; struct GuiBox *next_box; struct GuiBox *prev_box; }; struct DraggingBox { struct GuiBox *gbox; long start_x; long start_y; }; struct GuiButtonInit { char gbtype; short id_num; short gbifield_3; unsigned short gbifield_5; Gf_Btn_Callback click_event; Gf_Btn_Callback rclick_event; Gf_Btn_Callback ptover_event; unsigned short btype_value; short scr_pos_x; short scr_pos_y; short pos_x; short pos_y; short width; short height; Gf_Btn_Callback draw_call; short sprite_idx; short tooltip_stridx; struct GuiMenu *parent_menu; union GuiVariant content; short gbifield_31; Gf_Btn_Callback maintain_call; }; struct GuiButton { unsigned char flags; unsigned char gbactn_1; unsigned char gbactn_2; char gmenu_idx; short id_num; unsigned char gbtype; Gf_Btn_Callback click_event; Gf_Btn_Callback rclick_event; Gf_Btn_Callback ptover_event; Gf_Btn_Callback draw_call; Gf_Btn_Callback maintain_call; unsigned short btype_value; short scr_pos_x; short scr_pos_y; short pos_x; short pos_y; short width; short height; short sprite_idx; short tooltip_stridx; unsigned short field_2D; struct GuiMenu *parent_menu; unsigned long *content; unsigned short slide_val; }; struct GuiMenu { char ident; unsigned char visual_state; short fade_time; struct GuiButtonInit *buttons; short pos_x; short pos_y; short width; short height; Gf_Mnu_Callback draw_cb; char number; struct GuiMenu *menu_init; Gf_Mnu_Callback create_cb; unsigned char is_turned_on; unsigned char is_monopoly_menu; char field_1F; }; struct ToolTipBox { unsigned char flags; char text[2048]; struct GuiButton *gbutton; void *target; unsigned char field_809; short pos_x; short pos_y; }; struct FrontEndButtonData { unsigned short capstr_idx; unsigned char font_index; }; struct EventTypeInfo { int field_0; unsigned short tooltip_stridx; unsigned short msg_stridx; int lifespan_turns; int turns_between_events; unsigned char replace_event_kind_button; }; __attribute__((dllimport)) extern struct GuiButton *_DK_input_button; __attribute__((dllimport)) char _DK_backup_input_field[40]; #pragma pack() extern TbCharCount input_field_pos; void do_sound_menu_click(void); void do_sound_button_click(struct GuiButton *gbtn); void setup_input_field(struct GuiButton *gbtn, const char * empty_text); TbBool check_if_pos_is_over_button(const struct GuiButton *gbtn, TbScreenPos pos_x, TbScreenPos pos_y); extern void do_button_click_actions(struct GuiButton *, unsigned char *, Gf_Btn_Callback); void do_button_press_actions(struct GuiButton *, unsigned char *, Gf_Btn_Callback); extern void do_button_release_actions(struct GuiButton *, unsigned char *, Gf_Btn_Callback); #pragma pack(1) enum OptionsButtonDesignationIDs { BID_SOUND_VOL = 0 +75, }; struct GuiMenu; struct GuiButton; __attribute__((dllimport)) long _DK_fe_mouse_sensitivity; __attribute__((dllimport)) long _DK_sound_level; __attribute__((dllimport)) long _DK_music_level; __attribute__((dllimport)) char _DK_video_cluedo_mode; __attribute__((dllimport)) char _DK_video_shadows; __attribute__((dllimport)) char _DK_video_textures; __attribute__((dllimport)) char _DK_video_view_distance_level; #pragma pack() extern struct GuiMenu frontend_define_keys_menu; extern struct GuiMenu frontend_option_menu; void frontend_define_key_up(struct GuiButton *gbtn); void frontend_define_key_down(struct GuiButton *gbtn); void frontend_define_key_scroll(struct GuiButton *gbtn); void frontend_define_key(struct GuiButton *gbtn); void frontend_define_key_up_maintain(struct GuiButton *gbtn); void frontend_define_key_down_maintain(struct GuiButton *gbtn); void frontend_define_key_maintain(struct GuiButton *gbtn); void frontend_draw_define_key_scroll_tab(struct GuiButton *gbtn); void frontend_draw_define_key(struct GuiButton *gbtn); void frontend_set_mouse_sensitivity(struct GuiButton *gbtn); void frontend_invert_mouse(struct GuiButton *gbtn); void frontend_draw_invert_mouse(struct GuiButton *gbtn); void gui_video_shadows(struct GuiButton *gbtn); void gui_video_view_distance_level(struct GuiButton *gbtn); void gui_video_rotate_mode(struct GuiButton *gbtn); void gui_video_cluedo_mode(struct GuiButton *gbtn); void gui_video_gamma_correction(struct GuiButton *gbtn); void gui_video_cluedo_maintain(struct GuiButton *gbtn); void gui_set_sound_volume(struct GuiButton *gbtn); void gui_set_music_volume(struct GuiButton *gbtn); void init_video_menu(struct GuiMenu *gmnu); void init_audio_menu(struct GuiMenu *gmnu); #pragma pack(1) typedef unsigned char * TbSpriteData; struct TbSprite { TbSpriteData Data; unsigned char SWidth; unsigned char SHeight; }; struct TbSetupSprite { struct TbSprite **Start; struct TbSprite **End; TbSpriteData *Data; }; struct TbHugeSprite { TbSpriteData Data; long * Lines; unsigned long SWidth; unsigned long SHeight; }; struct TiledSprite { unsigned char x_num; unsigned char y_num; unsigned short spr_idx[10][10]; }; #pragma pack() int LbSpriteSetupAll(struct TbSetupSprite t_setup[]); int LbSpriteClearAll(struct TbSetupSprite t_setup[]); short LbSpriteSetup(struct TbSprite *start, const struct TbSprite *end, const unsigned char * data); enum TbFontDrawFlags { Fnt_LeftJustify = 0x00, Fnt_RightJustify = 0x01, Fnt_CenterPos = 0x02, }; #pragma pack(1) struct TbSprite; struct TbSetupSprite; struct AsianFont { const char *fname; unsigned char *data; unsigned long data_length; unsigned long chars_count; unsigned long ndata_shift; unsigned long ndata_scanline; unsigned long sdata_shift; unsigned long sdata_scanline; unsigned long field_20; unsigned long field_24; unsigned long field_28; unsigned long bits_width; unsigned long field_30; unsigned long field_34; unsigned long field_38; unsigned long field_3C; unsigned long field_40; unsigned long field_44; }; struct AsianDraw { unsigned long draw_char; unsigned long bits_width; unsigned long field_8; unsigned long field_C; unsigned long field_10; unsigned long field_14; unsigned char *sprite_data; unsigned long field_1C; unsigned long field_20; }; struct AsianFontWindow { long width; long height; long scanline; unsigned char *buf_ptr; }; __attribute__((dllimport)) extern const struct TbSprite *_DK_lbFontPtr; __attribute__((dllimport)) extern unsigned char _DK_lbSpacesPerTab; #pragma pack() TbBool LbTextDraw(int posx, int posy, const char *text); TbBool LbTextDrawFmt(int posx, int posy, const char *fmt, ...); TbBool LbTextDrawResized(int posx, int posy, int units_per_px, const char *text); TbBool LbTextDrawResizedFmt(int posx, int posy, int units_per_px, const char *fmt, ...); int LbTextHeight(const char *text); int LbTextLineHeight(void); int LbTextSetWindow(int posx, int posy, int width, int height); TbResult LbTextSetJustifyWindow(int pos_x, int pos_y, int width); TbResult LbTextSetClipWindow(int x1, int y1, int x2, int y2); TbBool LbTextSetFont(const struct TbSprite *font); unsigned char LbTextGetFontFaceColor(void); unsigned char LbTextGetFontBackColor(void); int LbTextStringWidth(const char *str); int LbTextStringPartWidth(const char *text, int part); int LbTextStringHeight(const char *str); int LbTextWordWidth(const char *str); int LbTextCharWidth(const long chr); int LbTextCharHeight(const long chr); int LbTextNumberDraw(int pos_x, int pos_y, int units_per_px, long number, unsigned short fdflags); int LbTextStringDraw(int pos_x, int pos_y, int units_per_px, const char *text, unsigned short fdflags); TbBool LbAlignMethodSet(unsigned short fdflags); long LbGetJustifiedCharPosX(long startx, long all_chars_width, long spr_width, long mul_width, unsigned short fdflags); long LbGetJustifiedCharPosY(long starty, long all_lines_height, long spr_height, unsigned short fdflags); long LbGetJustifiedCharWidth(long all_chars_width, long spr_width, long words_count, int units_per_px, unsigned short fdflags); long LbGetJustifiedCharHeight(long all_lines_height, long spr_height, long lines_count, unsigned short fdflags); int LbSprFontWordWidth(const struct TbSprite *font,const char *text); int LbSprFontCharWidth(const struct TbSprite *font,const unsigned long chr); int LbSprFontCharHeight(const struct TbSprite *font,const unsigned long chr); const struct TbSprite *LbFontCharSprite(const struct TbSprite *font,const unsigned long chr); void LbTextUseByteCoding(TbBool is_enabled); long text_string_height(int units_per_px, const char *text); void dbc_set_language(short ilng); short dbc_initialize(const char *fpath); #pragma pack(1) typedef unsigned char TbPixel; enum ScreenMode { Lb_SCREEN_MODE_INVALID = 0x00, Lb_SCREEN_MODE_320_200_8 = 0x01, Lb_SCREEN_MODE_320_200_16 = 0x02, Lb_SCREEN_MODE_320_200_24 = 0x03, Lb_SCREEN_MODE_512_384_16 = 0x08, Lb_SCREEN_MODE_512_384_24 = 0x09, Lb_SCREEN_MODE_640_400_8 = 0x0A, Lb_SCREEN_MODE_640_400_16 = 0x0B, Lb_SCREEN_MODE_320_240_8 = 0x04, Lb_SCREEN_MODE_320_240_16 = 0x05, Lb_SCREEN_MODE_320_240_24 = 0x06, Lb_SCREEN_MODE_512_384_8 = 0x07, Lb_SCREEN_MODE_640_400_24 = 0x0C, Lb_SCREEN_MODE_640_480_8 = 0x0D, Lb_SCREEN_MODE_640_480_16 = 0x0E, Lb_SCREEN_MODE_640_480_24 = 0x0F, Lb_SCREEN_MODE_800_600_8 = 0x10, Lb_SCREEN_MODE_800_600_16 = 0x11, Lb_SCREEN_MODE_800_600_24 = 0x12, Lb_SCREEN_MODE_1024_768_8 = 0x13, Lb_SCREEN_MODE_1024_768_16 = 0x14, Lb_SCREEN_MODE_1024_768_24 = 0x15, Lb_SCREEN_MODE_1200_1024_8 = 0x16, Lb_SCREEN_MODE_1200_1024_16 = 0x17, Lb_SCREEN_MODE_1200_1024_24 = 0x18, Lb_SCREEN_MODE_1600_1200_8 = 0x19, Lb_SCREEN_MODE_1600_1200_16 = 0x1A, Lb_SCREEN_MODE_1600_1200_24 = 0x1B, }; typedef unsigned short TbScreenMode; typedef long TbScreenCoord; enum TbPaletteFadeFlag { Lb_PALETTE_FADE_OPEN = 0, Lb_PALETTE_FADE_CLOSED = 1, }; enum TbDrawFlags { Lb_SPRITE_FLIP_HORIZ = 0x0001, Lb_SPRITE_FLIP_VERTIC = 0x0002, Lb_SPRITE_TRANSPAR4 = 0x0004, Lb_SPRITE_TRANSPAR8 = 0x0008, Lb_SPRITE_OUTLINE = 0x0010, Lb_TEXT_HALIGN_LEFT = 0x0020, Lb_TEXT_ONE_COLOR = 0x0040, Lb_TEXT_HALIGN_RIGHT = 0x0080, Lb_TEXT_HALIGN_CENTER = 0x0100, Lb_TEXT_HALIGN_JUSTIFY = 0x0200, Lb_TEXT_UNDERLINE = 0x0400, Lb_TEXT_UNDERLNSHADOW = 0x0800, }; enum TbVideoModeFlags { Lb_VF_DEFAULT = 0x0000, Lb_VF_RGBCOLOR = 0x0001, Lb_VF_TRUCOLOR = 0x0002, Lb_VF_PALETTE = 0x0004, Lb_VF_WINDOWED = 0x0010, }; struct GraphicsWindow { long x; long y; long width; long height; TbPixel *ptr; }; typedef struct GraphicsWindow TbGraphicsWindow; struct ScreenModeInfo { TbScreenCoord Width; TbScreenCoord Height; unsigned short BitsPerPixel; int Available; unsigned long VideoFlags; char Desc[23]; }; typedef struct ScreenModeInfo TbScreenModeInfo; struct DisplayStruct { uchar *PhysicalScreen; uchar *WScreen; uchar *GlassMap; uchar *FadeTable; uchar *GraphicsWindowPtr; struct TbSprite *MouseSprite; long PhysicalScreenWidth; long PhysicalScreenHeight; long GraphicsScreenWidth; long GraphicsScreenHeight; long GraphicsWindowX; long GraphicsWindowY; long GraphicsWindowWidth; long GraphicsWindowHeight; long MouseWindowX; long MouseWindowY; long MouseWindowWidth; long MouseWindowHeight; long MouseX; long MouseY; long MMouseX; long MMouseY; long RMouseX; long RMouseY; ushort DrawFlags; short MouseMoveRatio; ushort ScreenMode; uchar VesaIsSetUp; uchar LeftButton; uchar RightButton; uchar MiddleButton; uchar MLeftButton; uchar MRightButton; uchar MMiddleButton; uchar RLeftButton; uchar RMiddleButton; uchar RRightButton; uchar FadeStep; uchar DrawColour; uchar *Palette; }; typedef struct DisplayStruct TbDisplayStruct; struct DisplayStructEx { short WhellPosition; ushort WhellMoveUp; ushort WhellMoveDown; uchar ShadowColour; }; typedef struct DisplayStructEx TbDisplayStructEx; struct SSurface; typedef struct SSurface TSurface; __attribute__((dllimport)) extern TbDisplayStruct _DK_lbDisplay; __attribute__((dllimport)) extern unsigned short _DK_MyScreenWidth; __attribute__((dllimport)) extern unsigned short _DK_MyScreenHeight; __attribute__((dllimport)) extern unsigned short _DK_pixel_size; __attribute__((dllimport)) unsigned short _DK_pixels_per_block; __attribute__((dllimport)) unsigned short _DK_units_per_pixel; __attribute__((dllimport)) extern int _DK_lbUseSdk; __attribute__((dllimport)) unsigned char _DK_fade_started; __attribute__((dllimport)) unsigned char _DK_from_pal[(3*256)]; __attribute__((dllimport)) unsigned char _DK_to_pal[(3*256)]; __attribute__((dllimport)) long _DK_fade_count; __attribute__((dllimport)) TbGraphicsWindow _DK_lbTextJustifyWindow; __attribute__((dllimport)) TbGraphicsWindow _DK_lbTextClipWindow; #pragma pack() extern volatile TbBool lbScreenInitialised; extern volatile TbBool lbUseSdk; extern volatile TbBool lbInteruptMouse; extern volatile TbDisplayStructEx lbDisplayEx; extern unsigned char lbPalette[(3*256)]; TbResult LbScreenHardwareConfig(const char *driver, short engine_bpp); TbResult LbScreenInitialize(void); TbResult LbScreenSetDoubleBuffering(TbBool state); TbBool LbScreenIsDoubleBufferred(void); TbResult LbScreenSetup(TbScreenMode mode, TbScreenCoord width, TbScreenCoord height, unsigned char *palette, short buffers_count, TbBool wscreen_vid); TbResult LbScreenReset(void); TbResult LbScreenFindVideoModes(void); TbBool LbScreenIsModeAvailable(TbScreenMode mode); TbScreenMode LbRecogniseVideoModeString(const char *desc); TbScreenMode LbRegisterVideoMode(const char *desc, TbScreenCoord width, TbScreenCoord height, unsigned short bpp, unsigned long flags); TbScreenMode LbRegisterVideoModeString(const char *desc); TbScreenModeInfo *LbScreenGetModeInfo(TbScreenMode mode); TbScreenMode LbScreenActiveMode(void); TbScreenCoord LbScreenWidth(void); TbScreenCoord LbScreenHeight(void); unsigned short LbGraphicsScreenBPP(void); TbScreenCoord LbGraphicsScreenWidth(void); TbScreenCoord LbGraphicsScreenHeight(void); TbResult LbScreenLock(void); TbResult LbScreenUnlock(void); TbBool LbScreenIsLocked(void); TbResult LbScreenSwap(void); TbResult LbScreenClear(TbPixel colour); TbResult LbScreenWaitVbi(void); long LbPaletteFade(unsigned char *pal, long n, enum TbPaletteFadeFlag flg); TbResult LbPaletteStopOpenFade(void); TbResult LbPaletteSet(unsigned char *palette); TbResult LbPaletteGet(unsigned char *palette); TbPixel LbPaletteFindColour(const unsigned char *pal, unsigned char r, unsigned char g, unsigned char b); TbResult LbPaletteDataFillBlack(unsigned char *palette); TbResult LbPaletteDataFillWhite(unsigned char *palette); TbResult LbScreenStoreGraphicsWindow(TbGraphicsWindow *grwnd); TbResult LbScreenLoadGraphicsWindow(TbGraphicsWindow *grwnd); TbResult LbScreenSetGraphicsWindow(TbScreenCoord x, TbScreenCoord y, TbScreenCoord width, TbScreenCoord height); TbResult LbSetTitle(const char *title); TbResult LbSetIcon(unsigned short nicon); #pragma pack(1) struct TiledSprite; struct TbSprite; struct TbHugeSprite; typedef void __attribute__((__fastcall__)) FlicFunc(void); struct StartScreenPoint { short X; short Y; }; struct LongPoint { long X; long Y; }; struct EnginePoint { long X; long Y; long TMapX; long TMapY; long Shade; long X3d; long Y3d; long Z3d; long DistSqr; unsigned short padw; unsigned char Flags; unsigned char padb; }; struct TbDItmHotspot { short X; short Y; }; struct TbDItmFlic { FlicFunc *Function; TbPixel Colour; }; struct TbDItmText { short WindowX; short WindowY; short Width; short Height; short X; short Y; const char *Text; struct TbSprite *Font; unsigned short Line; TbPixel Colour; }; struct TbDItmSprite { short X; short Y; struct TbSprite *Sprite; TbPixel Colour; }; struct TbDItmTrig { short X2; short Y2; short X3; short Y3; TbPixel Colour; }; struct TbDItmTriangle { short X1; short Y1; short X2; short Y2; short X3; short Y3; TbPixel Colour; }; struct TbDItmBox { short X; short Y; short Width; short Height; TbPixel Colour; }; struct TbDItmLine { short X1; short Y1; short X2; short Y2; TbPixel Colour; }; union TbDItmU { struct TbDItmTrig Trig; struct TbDItmTriangle Triangle; struct TbDItmBox Box; struct TbDItmLine Line; struct TbDItmSprite Sprite; struct TbDItmText Text; struct TbDItmFlic Flic; struct TbDItmHotspot Hotspot; }; struct PurpleDrawItem { union TbDItmU U; unsigned char Type; unsigned short Flags; }; __attribute__((dllimport)) unsigned char *_DK_poly_screen; __attribute__((dllimport)) unsigned char *_DK_vec_screen; __attribute__((dllimport)) unsigned char *_DK_vec_map; __attribute__((dllimport)) unsigned long _DK_vec_screen_width; __attribute__((dllimport)) unsigned long _DK_vec_window_width; __attribute__((dllimport)) unsigned long _DK_vec_window_height; __attribute__((dllimport)) unsigned char *_DK_dither_map; __attribute__((dllimport)) unsigned char *_DK_dither_end; __attribute__((dllimport)) unsigned char *_DK_lbSpriteReMapPtr; __attribute__((dllimport)) long _DK_scale_up; __attribute__((dllimport)) long _DK_xsteps_array[2*256]; __attribute__((dllimport)) long _DK_ysteps_array[2*320]; __attribute__((dllimport)) long _DK_alpha_scale_up; __attribute__((dllimport)) long _DK_alpha_xsteps_array[2*256]; __attribute__((dllimport)) long _DK_alpha_ysteps_array[2*320]; #pragma pack() TbResult LbDrawBox(long x, long y, unsigned long width, unsigned long height, TbPixel colour); void LbDrawHVLine(long xpos1, long ypos1, long xpos2, long ypos2, TbPixel colour); void LbDrawPixel(long x, long y, TbPixel colour); void LbDrawCircle(long x, long y, long radius, TbPixel colour); TbResult LbDrawLine(long x1, long y1, long x2, long y2, TbPixel colour); void setup_vecs(unsigned char *screenbuf, unsigned char *nvec_map, unsigned int line_len, unsigned int width, unsigned int height); TbResult LbSpriteDrawUsingScalingData(long posx, long posy, const struct TbSprite *sprite); TbResult LbSpriteDrawRemapUsingScalingData(long posx, long posy, const struct TbSprite *sprite, const TbPixel *cmap); TbResult LbSpriteDrawOneColourUsingScalingData(long posx, long posy, const struct TbSprite *sprite, TbPixel colour); void LbSpriteSetScalingData(long x, long y, long swidth, long sheight, long dwidth, long dheight); TbResult DrawAlphaSpriteUsingScalingData(long posx, long posy, struct TbSprite *sprite); void SetAlphaScalingData(long a1, long a2, long a3, long a4, long a5, long a6); void LbSpriteSetScalingWidthSimpleArray(long * xsteps_arr, long x, long swidth, long dwidth); void LbSpriteSetScalingWidthClippedArray(long * xsteps_arr, long x, long swidth, long dwidth, long gwidth); void LbSpriteSetScalingHeightSimpleArray(long * ysteps_arr, long y, long sheight, long dheight); void LbSpriteSetScalingHeightClippedArray(long * ysteps_arr, long y, long sheight, long dheight, long gheight); TbResult LbSpriteDraw(long x, long y, const struct TbSprite *spr); TbResult LbSpriteDrawOneColour(long x, long y, const struct TbSprite *spr, const TbPixel colour); int LbSpriteDrawRemap(long x, long y, const struct TbSprite *spr,const unsigned char *cmap); TbResult LbSpriteDrawScaled(long xpos, long ypos, const struct TbSprite *sprite, long dest_width, long dest_height); TbResult LbSpriteDrawScaledOneColour(long xpos, long ypos, const struct TbSprite *sprite, long dest_width, long dest_height, const TbPixel colour); int LbSpriteDrawScaledRemap(long xpos, long ypos, const struct TbSprite *sprite, long dest_width, long dest_height, const unsigned char *cmap); TbResult LbHugeSpriteDraw(const struct TbHugeSprite * spr, long sp_len, unsigned char *r, int r_row_delta, int r_height, short xshift, short yshift, int units_per_px); void LbTiledSpriteDraw(long x, long y, long units_per_px, struct TiledSprite *bigspr, struct TbSprite *sprite); int LbTiledSpriteHeight(struct TiledSprite *bigspr, struct TbSprite *sprite); #pragma pack(1) struct HeapMgrHeader; struct HeapMgrHandle; struct SampleInfo { long field_0; unsigned char field_4[4]; unsigned char field_8; unsigned char field_9[9]; unsigned short field_12; unsigned char field_14[3]; unsigned char flags_17; unsigned long field_18; unsigned char field_1C; }; #pragma pack() int FreeAudio(void); int SetRedbookVolume(int volume); int SetSoundMasterVolume(int volume); int SetMusicMasterVolume(int volume); int GetSoundInstalled(void); int PlayRedbookTrack(int); int MonitorStreamedSoundTrack(void); int StopRedbookTrack(void); void * GetSoundDriver(void); int StopAllSamples(void); struct SampleInfo * GetFirstSampleInfoStructure(void); int LoadMusic(int); int InitAudio(void *); int SetupAudioOptionDefaults(void *); int PlayStreamedSample(char *fname, int a2, int a3, int a4); int IsSamplePlaying(int a1, int a2, int a3); int StopStreamedSample(void); int StreamedSampleFinished(void); int SetStreamedSampleVolume(int); struct SampleInfo * GetLastSampleInfoStructure(void); int GetCurrentSoundMasterVolume(void); int StopMusic(void); int LoadAwe32Soundfont(const char *fname); int StartMusic(int i,int v); int StopSample(int a,int b); int SetSampleVolume(int a,int b,int c,int d); int SetSamplePan(int a,int b,int c,int d); int SetSamplePitch(int a,int b,int c,int d); struct SampleInfo * PlaySampleFromAddress(int a1, int smpl_idx, int a3, int a4, int a5, unsigned char a6, unsigned char a7, void * buf, int a9); #pragma pack(1) struct EngineCoord; struct M33; struct EngineCol; struct PlayerInfo; enum CameraIndexValues { CamIV_Isometric = 0, CamIV_FirstPerson, CamIV_Parchment, CamIV_FrontView, CamIV_EndList }; struct MinMax { long min; long max; }; struct ComponentVector { short x; short y; short z; }; struct Camera { struct Coord3d mappos; unsigned char view_mode; int orient_a; int orient_b; int orient_c; int field_13; int zoom; int field_1B; unsigned char field_1F; long field_20; unsigned char field_24; long field_25; unsigned char field_29; }; __attribute__((dllimport)) extern struct M33 _DK_camera_matrix; __attribute__((dllimport)) extern struct EngineCoord _DK_object_origin; __attribute__((dllimport)) extern struct MinMax _DK_minmaxs[64]; #pragma pack() extern long camera_zoom; MapCoordDelta get_3d_box_distance(const struct Coord3d *pos1, const struct Coord3d *pos2); MapCoordDelta get_2d_box_distance(const struct Coord3d *pos1, const struct Coord3d *pos2); MapCoordDelta get_2d_box_distance_xy(long pos1_x, long pos1_y, long pos2_x, long pos2_y); void angles_to_vector(short theta, short phi, long dist, struct ComponentVector *cvect); long get_angle_xy_to(const struct Coord3d *pos1, const struct Coord3d *pos2); long get_angle_yz_to(const struct Coord3d *pos1, const struct Coord3d *pos2); MapCoordDelta get_2d_distance(const struct Coord3d *pos1, const struct Coord3d *pos2); MapCoordDelta get_2d_distance_squared(const struct Coord3d *pos1, const struct Coord3d *pos2); long get_angle_xy_to_vec(const struct CoordDelta3d *vec); long get_angle_yz_to_vec(const struct CoordDelta3d *vec); void project_point_to_wall_on_angle(const struct Coord3d *pos1, struct Coord3d *pos2, long a3, long a4, long a5, long a6); void view_zoom_camera_in(struct Camera *cam, long limit_max, long limit_min); void set_camera_zoom(struct Camera *cam, long val); void view_zoom_camera_out(struct Camera *cam, long limit_max, long limit_min); long get_camera_zoom(struct Camera *cam); unsigned long scale_camera_zoom_to_screen(unsigned long zoom_lvl); void update_camera_zoom_bounds(struct Camera *cam,unsigned long zoom_max,unsigned long zoom_min); void view_set_camera_y_inertia(struct Camera *cam, long a2, long a3); void view_set_camera_x_inertia(struct Camera *cam, long a2, long a3); void view_set_camera_rotation_inertia(struct Camera *cam, long a2, long a3); void init_player_cameras(struct PlayerInfo *player); enum PlayerInitFlags { PlaF_Allocated = 0x01, PlaF_Unknown2 = 0x02, PlaF_NewMPMessage = 0x04, PlaF_Unknown8 = 0x08, PlaF_Unknown10 = 0x10, PlaF_Unknown20 = 0x20, PlaF_CompCtrl = 0x40, PlaF_Unknown80 = 0x80, }; enum PlayerField6Flags { PlaF6_Unknown01 = 0x01, PlaF6_PlyrHasQuit = 0x02, PlaF6_Unknown04 = 0x04, PlaF6_Unknown08 = 0x08, PlaF6_Unknown10 = 0x10, PlaF6_Unknown20 = 0x20, PlaF6_Unknown40 = 0x40, PlaF6_Unknown80 = 0x80, }; enum PlayerViewModes { PVM_EmptyView = 0, PVM_CreatureView, PVM_IsometricView, PVM_ParchmentView, PVM_Unknown4, PVM_FrontView, PVM_ParchFadeIn, PVM_ParchFadeOut, }; enum PlayerViewType { PVT_None = 0, PVT_DungeonTop, PVT_CreatureContrl, PVT_CreaturePasngr, PVT_MapScreen, PVT_MapFadeIn, PVT_MapFadeOut, }; enum PlayerVictoryState { VicS_Undecided = 0, VicS_WonLevel, VicS_LostLevel, VicS_State3, }; enum PlayerField454Val { P454_Unkn0 = 0, P454_Unkn1, P454_Unkn2, P454_Unkn3, }; enum PlayerField3Flags { Pf3F_None = 0x00, Pf3F_Unkn01 = 0x01, Pf3F_Unkn02 = 0x02, Pf3F_Unkn04 = 0x04, Pf3F_Unkn08 = 0x08, Pf3F_Unkn10 = 0x10, Pf3F_Unkn20 = 0x20, Pf3F_Unkn40 = 0x40, Pf3F_Unkn80 = 0x80, }; #pragma pack(1) struct SubtileXY { unsigned char stl_x; unsigned char stl_y; }; struct Wander { unsigned long points_count; unsigned long point_insert_idx; unsigned long last_checked_slb_num; unsigned long num_check_per_run; unsigned long max_found_per_check; unsigned char wdrfield_14; unsigned char wandr_slot; unsigned char plyr_idx; unsigned char plyr_bit; struct SubtileXY points[200]; }; struct PlayerInfo { unsigned char allocflags; unsigned char field_1; unsigned char field_2; unsigned char field_3; unsigned char input_crtr_control; unsigned char input_crtr_query; unsigned char flgfield_6; unsigned char *field_7; unsigned char packet_num; long field_C; unsigned int hand_busy_until_turn; unsigned char field_14; char field_15[20]; unsigned char victory_state; unsigned char allied_players; unsigned char id_number; unsigned char field_2C; unsigned char field_2D[2]; short controlled_thing_idx; long controlled_thing_creatrn; short thing_under_hand; unsigned char view_mode; struct Camera *acamera; struct Camera cameras[4]; unsigned short zoom_to_pos_x; unsigned short zoom_to_pos_y; char field_E8[2]; struct Wander wandr_within; struct Wander wandr_outside; short hand_thing_idx; short field_43C; short influenced_thing_idx; long influenced_thing_creation; short engine_window_width; short engine_window_height; short engine_window_x; short engine_window_y; short minimap_pos_x; short minimap_pos_y; unsigned short minimap_zoom; unsigned char view_type; unsigned char work_state; unsigned char field_454; unsigned char field_455; unsigned char continue_work_state; char field_457[8]; char field_45F; short field_460; char field_462; char mp_message_text[64]; unsigned char chosen_room_kind; unsigned char field_4A4; char chosen_trap_kind; char chosen_door_kind; char field_4A7[4]; short field_4AB; short field_4AD; unsigned char field_4AF; unsigned char instance_num; unsigned long instance_remain_rurns; char view_mode_restore; long dungeon_camera_zoom; char field_4BA[3]; long field_4BD; long field_4C1; long field_4C5; unsigned char *palette; long field_4CD; char field_4D1; long cast_expand_level; long field_4D6; char video_cluedo_mode; long field_4DB; long field_4DF; long field_4E3; long field_4E7; long field_4EB; }; __attribute__((dllimport)) extern unsigned char _DK_my_player_number; #pragma pack() extern unsigned short player_colors_map[]; extern TbPixel player_path_colours[]; extern TbPixel player_room_colours[]; extern TbPixel player_flash_colours[]; extern TbPixel player_highlight_colours[]; extern unsigned short const player_cubes[]; extern long neutral_player_number; extern long hero_player_number; extern struct PlayerInfo bad_player; struct PlayerInfo *get_player_f(long plyr_idx,const char *func_name); TbBool player_invalid(const struct PlayerInfo *player); TbBool player_exists(const struct PlayerInfo *player); TbBool is_my_player(const struct PlayerInfo *player); TbBool is_my_player_number(PlayerNumber plyr_num); TbBool player_allied_with(const struct PlayerInfo *player, PlayerNumber ally_idx); TbBool players_are_enemies(long plyr1_idx, long plyr2_idx); TbBool players_are_mutual_allies(PlayerNumber plyr1_idx, PlayerNumber plyr2_idx); TbBool players_creatures_tolerate_each_other(PlayerNumber plyr1_idx, PlayerNumber plyr2_idx); TbBool player_is_friendly_or_defeated(PlayerNumber check_plyr_idx, PlayerNumber origin_plyr_idx); TbBool set_ally_with_player(PlayerNumber plyridx, PlayerNumber ally_idx, TbBool state); void toggle_ally_with_player(long plyridx, unsigned int allyidx); void set_player_state(struct PlayerInfo *player, short a1, long a2); void set_player_mode(struct PlayerInfo *player, unsigned short nview); void reset_player_mode(struct PlayerInfo *player, unsigned short nview); void clear_players(void); #pragma pack(1) struct TbLoadFiles; typedef char *ModifyDataLoadFnameFunc(struct TbLoadFiles *); struct TbLoadFiles { char FName[28]; unsigned char **Start; unsigned char **SEnd; unsigned long SLength; unsigned short Flags; unsigned short Spare; }; #pragma pack() char *defaultModifyDataLoadFilename(struct TbLoadFiles *ldfiles); ModifyDataLoadFnameFunc *LbDataLoadSetModifyFilenameFunction(ModifyDataLoadFnameFunc *newfunc); short LbDataFree(struct TbLoadFiles *load_file); short LbDataFreeAll(struct TbLoadFiles load_files[]); short LbDataLoad(struct TbLoadFiles *load_file); short LbDataLoadAll(struct TbLoadFiles load_files[]); int LbDataFindNameIndex(struct TbLoadFiles load_files[],char *fname); int LbDataFindStartIndex(struct TbLoadFiles load_files[],unsigned char **start); enum MousePointerGraphics { MousePG_Unkn00 = 0, MousePG_Arrow, MousePG_Pickaxe, MousePG_Sell, MousePG_Query, MousePG_PlaceTrap01, MousePG_PlaceTrap02, MousePG_PlaceTrap03, MousePG_PlaceTrap04, MousePG_PlaceTrap05, MousePG_PlaceTrap06, MousePG_PlaceDoor01, MousePG_PlaceDoor02, MousePG_PlaceDoor03, MousePG_PlaceDoor04, MousePG_DenyMark, MousePG_SpellCharge0, MousePG_SpellCharge1, MousePG_SpellCharge2, MousePG_SpellCharge3, MousePG_SpellCharge4, MousePG_SpellCharge5, MousePG_SpellCharge6, MousePG_SpellCharge7, MousePG_SpellCharge8, MousePG_PlaceRoom01, MousePG_PlaceRoom02, MousePG_PlaceRoom03, MousePG_PlaceRoom04, MousePG_PlaceRoom05, MousePG_PlaceRoom06, MousePG_PlaceRoom07, MousePG_PlaceRoom08, MousePG_PlaceRoom09, MousePG_PlaceRoom10, MousePG_PlaceRoom11, MousePG_PlaceRoom12, MousePG_PlaceRoom13, MousePG_PlaceRoom14, MousePG_LockMark, MousePG_Unkn40, MousePG_Unkn41, MousePG_Unkn42, MousePG_Unkn43, MousePG_Unkn44, MousePG_Unkn45, MousePG_Unkn46, MousePG_Unkn47, MousePG_Unkn48, MousePG_Unkn49, }; #pragma pack(1) struct TbColorTables { unsigned char fade_tables[64*256]; unsigned char ghost[256*256]; unsigned char flat_colours_tl[2*256]; unsigned char flat_colours_tr[2*256]; unsigned char flat_colours_br[2*256]; unsigned char flat_colours_bl[2*256]; unsigned char robs_bollocks[256]; }; struct TbAlphaTables { unsigned char black[256]; unsigned char grey[8*256]; unsigned char orange[8*256]; unsigned char red[8*256]; unsigned char blue[8*256]; unsigned char green[8*256]; }; __attribute__((dllimport)) int _DK_MinimalResolutionSetup; __attribute__((dllimport)) struct TbColorTables _DK_pixmap; __attribute__((dllimport)) struct TbAlphaTables _DK_alpha_sprite_table; __attribute__((dllimport)) unsigned char _DK_white_pal[256]; __attribute__((dllimport)) unsigned char _DK_red_pal[256]; #pragma pack() extern struct TbSprite *pointer_sprites; extern struct TbLoadFiles legal_load_files[]; extern struct TbLoadFiles map_flag_load_files[]; extern struct TbLoadFiles netmap_flag_load_files[]; extern struct TbLoadFiles game_load_files[]; extern unsigned short units_per_pixel_min; extern long base_mouse_sensitivity; TbScreenMode switch_to_next_video_mode(void); void set_game_vidmode(unsigned short i,unsigned short nmode); unsigned short max_game_vidmode_count(void); TbScreenMode reenter_video_mode(void); TbScreenMode get_next_vidmode(TbScreenMode mode); TbScreenMode get_higher_vidmode(TbScreenMode curr_mode); TbScreenMode validate_vidmode(TbScreenMode mode); TbScreenMode get_failsafe_vidmode(void); TbScreenMode get_movies_vidmode(void); TbScreenMode get_frontend_vidmode(void); void set_failsafe_vidmode(unsigned short nmode); void set_movies_vidmode(unsigned short nmode); void set_frontend_vidmode(unsigned short nmode); char *get_vidmode_name(unsigned short mode); TbBool setup_screen_mode(unsigned short nmode); short setup_screen_mode_minimal(unsigned short nmode); TbBool setup_screen_mode_zero(unsigned short nmode); short LoadMcgaData(void); short LoadMcgaDataMinimal(void); TbBool update_screen_mode_data(long width, long height); void load_pointer_file(short hi_res); TbBool load_testfont_fonts(void); void free_testfont_fonts(void); TbBool init_fades_table(void); TbBool init_alpha_table(void); void init_colours(void); TbBool set_pointer_graphic_none(void); TbBool set_pointer_graphic_menu(void); TbBool set_pointer_graphic_spell(long group_idx, long frame); TbBool set_pointer_graphic(long ptr_idx); #pragma pack(1) struct GuiButton; __attribute__((dllimport)) struct TbSprite *_DK_gui_panel_sprites; __attribute__((dllimport)) struct TbSprite *_DK_end_gui_panel_sprites; __attribute__((dllimport)) extern unsigned char * _DK_gui_panel_sprite_data; __attribute__((dllimport)) extern unsigned char * _DK_end_gui_panel_sprite_data; __attribute__((dllimport)) unsigned char *_DK_gui_slab; __attribute__((dllimport)) extern unsigned char *_DK_frontend_background; __attribute__((dllimport)) struct TbSprite *_DK_frontend_sprite; __attribute__((dllimport)) struct TbSprite *_DK_frontend_end_sprite; __attribute__((dllimport)) extern unsigned char * _DK_frontend_sprite_data; __attribute__((dllimport)) extern unsigned char * _DK_frontend_end_sprite_data; #pragma pack() extern char gui_textbuf[2048]; int get_bitmap_max_scale(int img_w,int img_h,int rect_w,int rect_h); int simple_button_sprite_height_units_per_px(const struct GuiButton *gbtn, long spridx, int fraction); int simple_button_sprite_width_units_per_px(const struct GuiButton *gbtn, long spridx, int fraction); int simple_frontend_sprite_height_units_per_px(const struct GuiButton *gbtn, long spridx, int fraction); int simple_frontend_sprite_width_units_per_px(const struct GuiButton *gbtn, long spridx, int fraction); int simple_gui_panel_sprite_height_units_per_px(const struct GuiButton *gbtn, long spridx, int fraction); int simple_gui_panel_sprite_width_units_per_px(const struct GuiButton *gbtn, long spridx, int fraction); void draw_bar64k(long pos_x, long pos_y, int units_per_px, long width); void draw_lit_bar64k(long pos_x, long pos_y, int units_per_px, long width); void draw_slab64k(long pos_x, long pos_y, int units_per_px, long width, long height); void draw_ornate_slab64k(long pos_x, long pos_y, int units_per_px, long width, long height); void draw_ornate_slab_outline64k(long pos_x, long pos_y, int units_per_px, long width, long height); void draw_round_slab64k(long pos_x, long pos_y, int units_per_px, long width, long height); void draw_string64k(long x, long y, int units_per_px, const char * text); void draw_button_string(struct GuiButton *gbtn, int base_width, const char *text); TbBool draw_text_box(const char *text); void draw_scroll_box(struct GuiButton *gbtn, int units_per_px, int num_rows); int scroll_box_get_units_per_px(struct GuiButton *gbtn); void draw_gui_panel_sprite_left(long x, long y, int units_per_px, long spridx); void draw_gui_panel_sprite_rmleft(long x, long y, int units_per_px, long spridx, unsigned long remap); void draw_gui_panel_sprite_ocleft(long x, long y, int units_per_px, long spridx, TbPixel color); void draw_gui_panel_sprite_centered(long x, long y, int units_per_px, long spridx); void draw_gui_panel_sprite_occentered(long x, long y, int units_per_px, long spridx, TbPixel color); void draw_button_sprite_left(long x, long y, int units_per_px, long spridx); void draw_button_sprite_rmleft(long x, long y, int units_per_px, long spridx, unsigned long remap); void draw_frontend_sprite_left(long x, long y, int units_per_px, long spridx); void draw_frontmenu_background(int rect_x,int rect_y,int rect_w,int rect_h); struct GameCampaign; enum GUIStrings { GUIStr_SuccessLandIsYours = 1000 +0, GUIStr_LevelEventMessage = 1000 +1, GUIStr_Empty = 1000 +201, GUIStr_NameAndHealthDesc = 1000 +222, GUIStr_ExperienceDesc, GUIStr_HungerDesc, GUIStr_Cancel, GUIStr_CreatureQueryDesc = 1000 +287, GUIStr_SelectGame, GUIStr_NetworkMenu, GUIStr_MainMenu, GUIStr_CreatureAngerDesc = 1000 +291, GUIStr_CreatureKillsDesc, GUIStr_CreatureStrengthDesc, GUIStr_CreatureWageDesc, GUIStr_CreatureGoldHeldDesc, GUIStr_CreatureDefenceDesc, GUIStr_CreatureSkillDesc, GUIStr_CreatureTimeInDungeonDesc, GUIStr_CreatureDexterityDesc, GUIStr_CreatureLuckDesc, GUIStr_CreatureBloodTypeDesc, GUIStr_CreatureIdleDesc, GUIStr_CreatureWorkingDesc, GUIStr_CreatureFightingDesc, GUIStr_CreatureFightDesc, GUIStr_CreatureFleeDesc, GUIStr_CreatureImprisonDesc, GUIStr_CreatureDefendingDesc, GUIStr_ConfirmYouSure = 1000 +309, GUIStr_ConfirmYes, GUIStr_ConfirmNo, GUIStr_For, GUIStr_OptionShadowsDesc = 1000 +313, GUIStr_OptionViewTypeDesc, GUIStr_OptionWallHeightDesc, GUIStr_OptionViewDistanceDesc, GUIStr_OptionGammaCorrectionDesc, GUIStr_Of, GUIStr_PausedMsg = 1000 +320, GUIStr_PaneZoomInDesc, GUIStr_PaneZoomOutDesc, GUIStr_PaneLargeMapDesc, GUIStr_PaneMore = 1000 +333, GUIStr_RecMovie = 1000 +336, GUIStr_RecMovieFail, GUIStr_RecMovieDone, GUIStr_OptionSoundFx = 1000 +340, GUIStr_OptionMusic, GUIStr_SlotUnused = 1000 +342, GUIStr_MnuMainMenu = 1000 +343, GUIStr_MnuLoadMenu, GUIStr_MnuLoadGame, GUIStr_MnuContinueGame, GUIStr_MnuMultiplayer = 1000 +347, GUIStr_MnuReturnToMain, GUIStr_MnuPlayIntro, GUIStr_NetServiceMenu, GUIStr_NetSessionMenu, GUIStr_NetSpeed = 1000 +352, GUIStr_NetComPort, GUIStr_NetPhoneNumber, GUIStr_NetIrq, GUIStr_MnuStatistics = 1000 +356, GUIStr_LevelCompleted = 1000 +357, GUIStr_MnuUnused = 1000 +358, GUIStr_MnuQuit = 1000 +359, GUIStr_MnuStartNewGame = 1000 +360, GUIStr_TastyHeroes = 1000 +361, GUIStr_CreditsHead1 = 1000 +362, GUIStr_NetSessions = 1000 +395, GUIStr_NetName, GUIStr_NetServices, GUIStr_NetMessages, GUIStr_NetCreateGame, GUIStr_NetJoinGame, GUIStr_NetStartGame, GUIStr_MnuGameMenu = 1000 +402, GUIStr_MnuCancel, GUIStr_MnuNoName, GUIStr_MnuPlayers, GUIStr_MnuLevel, GUIStr_MnuLevels, GUIStr_MnuGames = 1000 +408, GUIStr_NetModemMenu = 1000 +409, GUIStr_NetSerialMenu, GUIStr_NetInit = 1000 +411, GUIStr_NetHangup, GUIStr_NetClear, GUIStr_NetAnswer, GUIStr_NetStart, GUIStr_NetAlly = 1000 +416, GUIStr_NetAlliance, GUIStr_Credits = 1000 +418, GUIStr_MnuOk = 1000 +419, GUIStr_SpecRevealMapDesc = 1000 +420, GUIStr_SpecResurrectCreatureDesc, GUIStr_SpecTransferCreatureDesc, GUIStr_SpecStealHeroDesc, GUIStr_SpecMultiplyCreaturesDesc, GUIStr_SpecIncreaseLevelDesc, GUIStr_SpecMakeSafeDesc, GUIStr_SpecLocateHiddenWorldDesc, GUIStr_SpecResurrectCreature, GUIStr_SpecTransferCreature, GUIStr_MnuHighScoreTable = 1000 +431, GUIStr_GoToQueryMode, GUIStr_MoreInformation = 1000 +433, GUIStr_BackToMainQueryScreen, GUIStr_SelectedAction, GUIStr_TeamChooseParty = 1000 +436, GUIStr_TeamEnterDungeon, GUIStr_TeamPartyMembers, GUIStr_TeamAvailCreatures, GUIStr_TeamCreature, GUIStr_TeamMoneyAvailable, GUIStr_TeamLeader, GUIStr_TeamHire, GUIStr_TeamFire, GUIStr_TeamCost, GUIStr_TeamType, GUIStr_InformationPanelDesc = 1000 +447, GUIStr_RoomPanelDesc = 1000 +448, GUIStr_ResearchPanelDesc = 1000 +449, GUIStr_WorkshopPanelDesc = 1000 +450, GUIStr_CreaturePanelDesc = 1000 +451, GUIStr_ResearchTimeDesc = 1000 +452, GUIStr_WorkshopTimeDesc = 1000 +453, GUIStr_PayTimeDesc = 1000 +454, GUIStr_NumberOfRoomsDesc = 1000 +455, GUIStr_NumberOfCreaturesDesc = 1000 +456, GUIStr_TeamChooseGame, GUIStr_TeamGameType, GUIStr_TeamKeeperVsKeeper, GUIStr_TeamKeeperVsHeroes, GUIStr_TeamDeathmatch, GUIStr_SellRoomDesc = 1000 +462, GUIStr_SellItemDesc, GUIStr_NextBattleDesc, GUIStr_CloseWindow, GUIStr_ZoomToArea, GUIStr_NoMouseInstalled, GUIStr_DefineKeys, GUIStr_AllyWithPlayer, GUIStr_PressAKey = 1000 +470, GUIStr_CtrlUp, GUIStr_CtrlDown, GUIStr_CtrlLeft, GUIStr_CtrlRight, GUIStr_CtrlRotate, GUIStr_CtrlSpeed, GUIStr_CtrlRotateLeft, GUIStr_CtrlRotateRight, GUIStr_CtrlZoomIn, GUIStr_CtrlZoomOut, GUIStr_KeyLeftControl = 1000 +481, GUIStr_KeyRightControl, GUIStr_KeyLeftShift, GUIStr_KeyRightShift, GUIStr_KeyLeftAlt, GUIStr_KeyRightAlt, GUIStr_KeySpace, GUIStr_KeyReturn, GUIStr_KeyTab, GUIStr_KeyCapsLock = 1000 +490, GUIStr_KeyBackspace, GUIStr_KeyInsert, GUIStr_KeyDelete, GUIStr_KeyHome, GUIStr_KeyEnd, GUIStr_KeyPageUp, GUIStr_KeyPageDown, GUIStr_KeyNumLock = 1000 +498, GUIStr_KeyNumSlash, GUIStr_KeyNumMul, GUIStr_KeyNumSub, GUIStr_KeyNumAdd, GUIStr_KeyNumEnter, GUIStr_KeyNumDelete, GUIStr_KeyNum1, GUIStr_KeyNum2, GUIStr_KeyNum3, GUIStr_KeyNum4, GUIStr_KeyNum5, GUIStr_KeyNum6, GUIStr_KeyNum7, GUIStr_KeyNum8, GUIStr_KeyNum9, GUIStr_KeyNum0, GUIStr_KeyF1 = 1000 +515, GUIStr_KeyF2, GUIStr_KeyF3, GUIStr_KeyF4, GUIStr_KeyF5, GUIStr_KeyF6, GUIStr_KeyF7, GUIStr_KeyF8, GUIStr_KeyF9, GUIStr_KeyF10, GUIStr_KeyF11, GUIStr_KeyF12, GUIStr_KeyUp, GUIStr_KeyDown, GUIStr_KeyLeft, GUIStr_KeyRight, GUIStr_NetInitingModem = 1000 +531, GUIStr_NetConnectnModem, GUIStr_NetDial, GUIStr_NetContinue, GUIStr_NetLineEngaged, GUIStr_NetUnknownError, GUIStr_NetNoCarrier, GUIStr_NetNoDialTone, GUIStr_NetNoResponse, GUIStr_NetNoServer, GUIStr_NetUnableToInit = 1000 +541, GUIStr_NetUnableToCrGame, GUIStr_NetUnableToJoin, GUIStr_CompAssNowAggressive = 1000 +548, GUIStr_CompAssNowDefensive, GUIStr_CompAssNowConstruction, GUIStr_CompAssNowMoveOnly, GUIStr_StateFight = 1000 +567, GUIStr_StateAnnoyed = 1000 +568, GUIStr_KeyShift = 1000 +569, GUIStr_KeyControl, GUIStr_KeyAlt, GUIStr_CreditsHead2 = 1000 +572, GUIStr_EventTreasureRoomFull = 1000 +664, GUIStr_EventScavengingDetected, GUIStr_EventCreaturePayday, GUIStr_EventNewSpellPickedUp, GUIStr_EventNewRoomTakenOver, GUIStr_EventAreaDiscovered, GUIStr_EventInformation = 1000 +670, GUIStr_EventRoomLost, GUIStr_EventHeartAttacked, GUIStr_EventFight, GUIStr_EventObjective, GUIStr_EventBreach, GUIStr_EventNewSpellResearched, GUIStr_EventNewRoomResearched = 1000 +677, GUIStr_EventNewTrap, GUIStr_EventNewDoor, GUIStr_EventNewCreature = 1000 +680, GUIStr_EventCreatureAnnoyed, GUIStr_EventNoMoreLivingSpace, GUIStr_EventAlarmTriggered, GUIStr_EventRoomUnderAttack, GUIStr_EventTreasureRoomNeeded, GUIStr_EventCreaturesHungry, GUIStr_EventTrapCrateFound, GUIStr_EventDoorCrateFound, GUIStr_EventDnSpecialFound = 1000 +689, GUIStr_EventTreasrRoomFullDesc = 1000 +690, GUIStr_EventCreatrScavngDesc, GUIStr_EventCreaturePaydayDesc, GUIStr_EventSpellPickedUpDesc, GUIStr_EventRoomTakenOverDesc, GUIStr_EventAreaDiscoveredDesc, GUIStr_EventInformationDesc, GUIStr_EventRoomLostDesc, GUIStr_EventDnHeartAttackedDesc = 1000 +698, GUIStr_EventFightDesc, GUIStr_EventObjectiveDesc = 1000 +700, GUIStr_EventBreachDesc, GUIStr_EventNewSpellResrchDesc, GUIStr_EventNewRoomResrchDesc, GUIStr_EventNewTrapDesc, GUIStr_EventNewDoorDesc, GUIStr_EventNewCreatureDesc, GUIStr_EventCreatrAnnoyedDesc, GUIStr_EventNoMoreLivingSetDesc, GUIStr_EventAlarmTriggeredDesc, GUIStr_EventRoomUnderAttackDesc = 1000 +710, GUIStr_EventNeedTreasrRoomDesc, GUIStr_EventCreaturesHungryDesc, GUIStr_EventTrapCrateFoundDesc, GUIStr_EventDoorCrateFoundDesc, GUIStr_EventDnSpecialFoundDesc = 1000 +715, GUIStr_MnuOptions = 1000 +716, GUIStr_MnuGraphicsOptions, GUIStr_MnuSoundOptions, GUIStr_MnuLoad, GUIStr_MnuSave, GUIStr_MnuComputerAssist, GUIStr_MnuOptionsDesc = 1000 +722, GUIStr_GraphicsMenuDesc = 1000 +723, GUIStr_SoundMenuDesc, GUIStr_LoadGameDesc, GUIStr_SaveGameDesc, GUIStr_QuitGameDesc = 1000 +727, GUIStr_ComputerAssistDesc = 1000 +728, GUIStr_AggressiveAssistDesc, GUIStr_DefensiveAssistDesc, GUIStr_ConstructionAssistDesc, GUIStr_MoveOnlyAssistDesc, GUIStr_PickCreatrMostExpDesc = 1000 +733, GUIStr_PickCreatrIdleDesc, GUIStr_PickCreatrWorkingDesc, GUIStr_PickCreatrFightingDesc, GUIStr_OptionsInvertMouse = 1000 +737, GUIStr_OptionsPossessMouseSensitivity, GUIStr_OptionsMoreSensitive, GUIStr_OptionsLessSensitive = 1000 +740, GUIStr_StatisticsNames1 = 1000 +741, GUIStr_EasterPoems = 1000 +803, GUIStr_GameHints = 1000 +829, GUIStr_MnuRetToOptions = 1000 +840, GUIStr_MnuExit = 1000 +841, GUIStr_MnuAudio, GUIStr_MnuInvertMouse, GUIStr_MnuMouseSensitivity, GUIStr_MnuComputer, GUIStr_MnuComputerPlayers, GUIStr_On = 1000 +847, GUIStr_Off = 1000 +848, GUIStr_Sensitivity, GUIStr_MouseOptions, GUIStr_Mouse, GUIStr_UndoPickup, GUIStr_Pause, GUIStr_Map = 1000 +854, GUIStr_InsufficientMemory, GUIStr_UnableToChangeRes, GUIStr_Query = 1000 +857, GUIStr_CreditsHead3 = 1000 +858, GUIStr_NetAttemptingToJoin = 1000 +868, GUIStr_NetResyncing, GUIStr_Net1Player = 1000 +870, GUIStr_Net2Players, GUIStr_Net3Players, GUIStr_Net4Players, GUIStr_NetSerial = 1000 +874, GUIStr_NetModem, GUIStr_NetIpx, GUIStr_MapN = 1000 +877, GUIStr_MapE, GUIStr_MapS, GUIStr_MapW, GUIStr_Vs = 1000 +881, GUIStr_CreditsHead4 = 1000 +882, GUIStr_HappyBirthday = 1000 +885, GUIStr_Error, GUIStr_ErrorSaving, GUIStr_NewLevels = 1000 +888, GUIStr_InsertDataCD = 1000 +889, GUIStr_InsertKeeperCD, GUIStr_InbsertDeeperCD, GUIStr_LevelEventMessageDD = 1000 +892, GUIStr_MnuFreePlayLevels = 1000 +941, GUIStr_MnuLandSelection = 1000 +942, GUIStr_MnuCampaigns = 1000 +943, GUIStr_MnuAddComputer = 1000 +944, GUIStr_EventWorkRoomUnreachbl, GUIStr_EventWorkRoomUnreachblDesc, GUIStr_EventStorgRoomUnreachbl, GUIStr_EventStorgRoomUnreachblDesc, GUIStr_CreatureArmourDesc = 1000 +949, GUIStr_CreatureSpeedDesc, GUIStr_CreatureLoyaltyDesc, GUIStr_CreatureResrchSkillDesc, GUIStr_CreatureManfctrSkillDesc, GUIStr_CreatureTraingSkillDesc, GUIStr_CreatureScavngSkillDesc, GUIStr_CreatureTraingCostDesc, GUIStr_CreatureScavngCostDesc, GUIStr_CreatureBestDmgDesc, GUIStr_CreatureWeightDesc, GUIStr_CreatureScoreDesc = 1000 +960, GUIStr_CreatureHealthDesc = 1000 +965, GUIStr_CreatureMaxHealthDesc = 1000 +966, GUIStr_ToggleMessage = 1000 +967, }; enum CampaignStrings { CpgStr_SuccessLandIsYours = 0, CpgStr_LevelEventMessage = 1, CpgStr_Empty = 201, CpgStr_LevelName = 202, CpgStr_CreatureSpellDesc = 226, CpgStr_CreatureKind1 = 258, CpgStr_TerrainEmptyLairDesc = 319, CpgStr_TerrainVarDesc1 = 324, CpgStr_LevelWon = 334, CpgStr_LevelLost, CpgStr_CreditsHead1 = 362, CpgStr_SpecRevealMapDesc = 420, CpgStr_SpecResurrectCreatureDesc, CpgStr_SpecTransferCreatureDesc, CpgStr_SpecStealHeroDesc, CpgStr_SpecMultiplyCreaturesDesc, CpgStr_SpecIncreaseLevelDesc, CpgStr_SpecMakeSafeDesc, CpgStr_SpecLocateHiddenWorldDesc, CpgStr_SpecResurrectCreature, CpgStr_SpecTransferCreature, CpgStr_BonusLevel = 430, CpgStr_TerrainGemsDesc = 544, CpgStr_TerrainHeroEntranceDesc, CpgStr_CreatureKind2 = 546, CpgStr_RoomKind1 = 552, CpgStr_BoulderTrap = 578, CpgStr_TrapKindAlarm, CpgStr_TrapKindPoisonGas, CpgStr_TrapKindLightning, CpgStr_TrapKindWordOfPower, CpgStr_TrapKindLava, CpgStr_TrapBoulderDesc = 584, CpgStr_AlarmTrapDesc, CpgStr_PoisonGasTrapDesc, CpgStr_LightningTrapDesc, CpgStr_WordOfPowerTrapDesc, CpgStr_LavaTrapDesc, CpgStr_DoorKindWooden = 590, CpgStr_DoorKindBraced, CpgStr_DoorKindIron, CpgStr_DoorKindMagic, CpgStr_WoodenDoorDesc = 594, CpgStr_BracedDoorDesc, CpgStr_IronDoorDesc, CpgStr_MagicDoorDesc, CpgStr_RoomKind2 = 598, CpgStr_RoomDesc1 = 615, CpgStr_PowerKind1 = 630, CpgStr_PowerDesc1 = 647, }; TbBool setup_gui_strings_data(void); TbBool free_gui_strings_data(void); TbBool reset_strings(char **strings); const char * get_string(TextStringId stridx); TbBool setup_campaign_strings_data(struct GameCampaign *campgn); #pragma pack(1) #pragma pack() int guibutton_get_unused_slot(void); void gui_clear_buttons_not_over_mouse(int gmbtn_idx); TbBool gui_button_release_inputs(int gmbtn_idx); TbBool gui_slider_button_inputs(int gbtn_idx); TbBool gui_slider_button_mouse_over_slider_tracker(int gbtn_idx); TbBool gui_button_click_inputs(int gmbtn_idx); void fake_button_click(int gmbtn_idx); void gui_set_menu_mode(struct GuiButton *gbtn); void gui_pretty_background(struct GuiMenu *gmnu); void gui_round_glass_background(struct GuiMenu *gmnu); void frontend_copy_mnu_background(struct GuiMenu *gmnu); void frontend_copy_background(void); void gui_area_new_normal_button(struct GuiButton *gbtn); void gui_area_new_vertical_button(struct GuiButton *gbtn); void gui_area_new_null_button(struct GuiButton *gbtn); void gui_area_new_no_anim_button(struct GuiButton *gbtn); void gui_area_creatrmodel_button(struct GuiButton *gbtn); void gui_area_compsetting_button(struct GuiButton *gbtn); void gui_area_no_anim_button(struct GuiButton *gbtn); void gui_area_normal_button(struct GuiButton *gbtn); void gui_area_null(struct GuiButton *gbtn); void gui_area_flash_cycle_button(struct GuiButton *gbtn); void gui_draw_tab(struct GuiButton *gbtn); void frontend_over_button(struct GuiButton *gbtn); void frontend_draw_button(struct GuiButton *gbtn, unsigned short btntype, const char *text, unsigned int drw_flags); void frontend_draw_large_menu_button(struct GuiButton *gbtn); void frontend_draw_vlarge_menu_button(struct GuiButton *gbtn); void frontend_draw_scroll_box_tab(struct GuiButton *gbtn); void frontend_draw_scroll_box(struct GuiButton *gbtn); void reset_scroll_window(struct GuiMenu *gmnu); void clear_radio_buttons(struct GuiMenu *gmnu); void update_radio_button_data(struct GuiMenu *gmnu); void frontend_draw_slider(struct GuiButton *gbtn); void frontend_draw_small_slider(struct GuiButton *gbtn); void frontend_draw_slider_button(struct GuiButton *gbtn); void init_slider_bars(struct GuiMenu *gmnu); void init_menu_buttons(struct GuiMenu *gmnu); void kill_button_area_input(void); void kill_button(struct GuiButton *gbtn); void setup_radio_buttons(struct GuiMenu *gmnu); typedef enum { SDL_FALSE = 0, SDL_TRUE = 1 } SDL_bool; typedef int8_t Sint8; typedef uint8_t Uint8; typedef int16_t Sint16; typedef uint16_t Uint16; typedef int32_t Sint32; typedef uint32_t Uint32; typedef int64_t Sint64; typedef uint64_t Uint64; typedef int SDL_dummy_uint8[(sizeof(Uint8) == 1) * 2 - 1]; typedef int SDL_dummy_sint8[(sizeof(Sint8) == 1) * 2 - 1]; typedef int SDL_dummy_uint16[(sizeof(Uint16) == 2) * 2 - 1]; typedef int SDL_dummy_sint16[(sizeof(Sint16) == 2) * 2 - 1]; typedef int SDL_dummy_uint32[(sizeof(Uint32) == 4) * 2 - 1]; typedef int SDL_dummy_sint32[(sizeof(Sint32) == 4) * 2 - 1]; typedef int SDL_dummy_uint64[(sizeof(Uint64) == 8) * 2 - 1]; typedef int SDL_dummy_sint64[(sizeof(Sint64) == 8) * 2 - 1]; typedef enum { DUMMY_ENUM_VALUE } SDL_DUMMY_ENUM; typedef int SDL_dummy_enum[(sizeof(SDL_DUMMY_ENUM) == sizeof(int)) * 2 - 1]; extern __attribute__((dllexport)) char * SDL_getenv(const char *name); extern __attribute__((dllexport)) int SDL_putenv(const char *variable); extern __attribute__((dllexport)) void * SDL_revcpy(void *dst, const void *src, size_t len); extern __attribute__((dllexport)) size_t SDL_strlcpy(char *dst, const char *src, size_t maxlen); extern __attribute__((dllexport)) size_t SDL_strlcat(char *dst, const char *src, size_t maxlen); extern __attribute__((dllexport)) char * SDL_strdup(const char *string); extern __attribute__((dllexport)) char* SDL_lltoa(Sint64 value, char *string, int radix); extern __attribute__((dllexport)) char* SDL_ulltoa(Uint64 value, char *string, int radix); extern __attribute__((dllexport)) Uint64 SDL_strtoull(const char *string, char **endp, int base); extern __attribute__((dllexport)) int SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...); extern __attribute__((dllexport)) int SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap); typedef struct _SDL_iconv_t *SDL_iconv_t; extern __attribute__((dllexport)) SDL_iconv_t SDL_iconv_open(const char *tocode, const char *fromcode); extern __attribute__((dllexport)) int SDL_iconv_close(SDL_iconv_t cd); extern __attribute__((dllexport)) size_t SDL_iconv(SDL_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); extern __attribute__((dllexport)) char * SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft); extern __attribute__((dllexport)) void SDL_SetError(const char *fmt, ...); extern __attribute__((dllexport)) char * SDL_GetError(void); extern __attribute__((dllexport)) void SDL_ClearError(void); typedef enum { SDL_ENOMEM, SDL_EFREAD, SDL_EFWRITE, SDL_EFSEEK, SDL_UNSUPPORTED, SDL_LASTERROR } SDL_errorcode; extern __attribute__((dllexport)) void SDL_Error(SDL_errorcode code); typedef struct SDL_RWops { int ( *seek)(struct SDL_RWops *context, int offset, int whence); int ( *read)(struct SDL_RWops *context, void *ptr, int size, int maxnum); int ( *write)(struct SDL_RWops *context, const void *ptr, int size, int num); int ( *close)(struct SDL_RWops *context); Uint32 type; union { struct { int append; void *h; struct { void *data; int size; int left; } buffer; } win32io; struct { int autoclose; FILE *fp; } stdio; struct { Uint8 *base; Uint8 *here; Uint8 *stop; } mem; struct { void *data1; } unknown; } hidden; } SDL_RWops; extern __attribute__((dllexport)) SDL_RWops * SDL_RWFromFile(const char *file, const char *mode); extern __attribute__((dllexport)) SDL_RWops * SDL_RWFromFP(FILE *fp, int autoclose); extern __attribute__((dllexport)) SDL_RWops * SDL_RWFromMem(void *mem, int size); extern __attribute__((dllexport)) SDL_RWops * SDL_RWFromConstMem(const void *mem, int size); extern __attribute__((dllexport)) SDL_RWops * SDL_AllocRW(void); extern __attribute__((dllexport)) void SDL_FreeRW(SDL_RWops *area); extern __attribute__((dllexport)) Uint16 SDL_ReadLE16(SDL_RWops *src); extern __attribute__((dllexport)) Uint16 SDL_ReadBE16(SDL_RWops *src); extern __attribute__((dllexport)) Uint32 SDL_ReadLE32(SDL_RWops *src); extern __attribute__((dllexport)) Uint32 SDL_ReadBE32(SDL_RWops *src); extern __attribute__((dllexport)) Uint64 SDL_ReadLE64(SDL_RWops *src); extern __attribute__((dllexport)) Uint64 SDL_ReadBE64(SDL_RWops *src); extern __attribute__((dllexport)) int SDL_WriteLE16(SDL_RWops *dst, Uint16 value); extern __attribute__((dllexport)) int SDL_WriteBE16(SDL_RWops *dst, Uint16 value); extern __attribute__((dllexport)) int SDL_WriteLE32(SDL_RWops *dst, Uint32 value); extern __attribute__((dllexport)) int SDL_WriteBE32(SDL_RWops *dst, Uint32 value); extern __attribute__((dllexport)) int SDL_WriteLE64(SDL_RWops *dst, Uint64 value); extern __attribute__((dllexport)) int SDL_WriteBE64(SDL_RWops *dst, Uint64 value); static __inline__ Uint16 SDL_Swap16(Uint16 x) { __asm__("xchgb %b0,%h0" : "=Q" (x) : "0" (x)); return x; } static __inline__ Uint32 SDL_Swap32(Uint32 x) { __asm__("bswapl %0" : "=r" (x) : "0" (x)); return x; } static __inline__ Uint64 SDL_Swap64(Uint64 x) { __asm__("bswapq %0" : "=r" (x) : "0" (x)); return x; } struct SDL_mutex; typedef struct SDL_mutex SDL_mutex; extern __attribute__((dllexport)) SDL_mutex * SDL_CreateMutex(void); extern __attribute__((dllexport)) int SDL_mutexP(SDL_mutex *mutex); extern __attribute__((dllexport)) int SDL_mutexV(SDL_mutex *mutex); extern __attribute__((dllexport)) void SDL_DestroyMutex(SDL_mutex *mutex); struct SDL_semaphore; typedef struct SDL_semaphore SDL_sem; extern __attribute__((dllexport)) SDL_sem * SDL_CreateSemaphore(Uint32 initial_value); extern __attribute__((dllexport)) void SDL_DestroySemaphore(SDL_sem *sem); extern __attribute__((dllexport)) int SDL_SemWait(SDL_sem *sem); extern __attribute__((dllexport)) int SDL_SemTryWait(SDL_sem *sem); extern __attribute__((dllexport)) int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 ms); extern __attribute__((dllexport)) int SDL_SemPost(SDL_sem *sem); extern __attribute__((dllexport)) Uint32 SDL_SemValue(SDL_sem *sem); struct SDL_cond; typedef struct SDL_cond SDL_cond; extern __attribute__((dllexport)) SDL_cond * SDL_CreateCond(void); extern __attribute__((dllexport)) void SDL_DestroyCond(SDL_cond *cond); extern __attribute__((dllexport)) int SDL_CondSignal(SDL_cond *cond); extern __attribute__((dllexport)) int SDL_CondBroadcast(SDL_cond *cond); extern __attribute__((dllexport)) int SDL_CondWait(SDL_cond *cond, SDL_mutex *mut); extern __attribute__((dllexport)) int SDL_CondWaitTimeout(SDL_cond *cond, SDL_mutex *mutex, Uint32 ms); struct SDL_Thread; typedef struct SDL_Thread SDL_Thread; extern __attribute__((dllexport)) SDL_Thread * SDL_CreateThread(int ( *fn)(void *), void *data); extern __attribute__((dllexport)) Uint32 SDL_ThreadID(void); extern __attribute__((dllexport)) Uint32 SDL_GetThreadID(SDL_Thread *thread); extern __attribute__((dllexport)) void SDL_WaitThread(SDL_Thread *thread, int *status); extern __attribute__((dllexport)) void SDL_KillThread(SDL_Thread *thread); typedef struct SDL_AudioSpec { int freq; Uint16 format; Uint8 channels; Uint8 silence; Uint16 samples; Uint16 padding; Uint32 size; void ( *callback)(void *userdata, Uint8 *stream, int len); void *userdata; } SDL_AudioSpec; typedef struct SDL_AudioCVT { int needed; Uint16 src_format; Uint16 dst_format; double rate_incr; Uint8 *buf; int len; int len_cvt; int len_mult; double len_ratio; void ( *filters[10])(struct SDL_AudioCVT *cvt, Uint16 format); int filter_index; } SDL_AudioCVT; extern __attribute__((dllexport)) int SDL_AudioInit(const char *driver_name); extern __attribute__((dllexport)) void SDL_AudioQuit(void); extern __attribute__((dllexport)) char * SDL_AudioDriverName(char *namebuf, int maxlen); extern __attribute__((dllexport)) int SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained); typedef enum { SDL_AUDIO_STOPPED = 0, SDL_AUDIO_PLAYING, SDL_AUDIO_PAUSED } SDL_audiostatus; extern __attribute__((dllexport)) SDL_audiostatus SDL_GetAudioStatus(void); extern __attribute__((dllexport)) void SDL_PauseAudio(int pause_on); extern __attribute__((dllexport)) SDL_AudioSpec * SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); extern __attribute__((dllexport)) void SDL_FreeWAV(Uint8 *audio_buf); extern __attribute__((dllexport)) int SDL_BuildAudioCVT(SDL_AudioCVT *cvt, Uint16 src_format, Uint8 src_channels, int src_rate, Uint16 dst_format, Uint8 dst_channels, int dst_rate); extern __attribute__((dllexport)) int SDL_ConvertAudio(SDL_AudioCVT *cvt); extern __attribute__((dllexport)) void SDL_MixAudio(Uint8 *dst, const Uint8 *src, Uint32 len, int volume); extern __attribute__((dllexport)) void SDL_LockAudio(void); extern __attribute__((dllexport)) void SDL_UnlockAudio(void); extern __attribute__((dllexport)) void SDL_CloseAudio(void); typedef struct SDL_version { Uint8 major; Uint8 minor; Uint8 patch; } SDL_version; extern __attribute__((dllexport)) const SDL_version * SDL_Linked_Version(void); extern __attribute__((dllexport)) const SDL_version * Mix_Linked_Version(void); typedef enum { MIX_INIT_FLAC = 0x00000001, MIX_INIT_MOD = 0x00000002, MIX_INIT_MP3 = 0x00000004, MIX_INIT_OGG = 0x00000008, MIX_INIT_FLUIDSYNTH = 0x00000010 } MIX_InitFlags; extern __attribute__((dllexport)) int Mix_Init(int flags); extern __attribute__((dllexport)) void Mix_Quit(void); typedef struct Mix_Chunk { int allocated; Uint8 *abuf; Uint32 alen; Uint8 volume; } Mix_Chunk; typedef enum { MIX_NO_FADING, MIX_FADING_OUT, MIX_FADING_IN } Mix_Fading; typedef enum { MUS_NONE, MUS_CMD, MUS_WAV, MUS_MOD, MUS_MID, MUS_OGG, MUS_MP3, MUS_MP3_MAD, MUS_FLAC, MUS_MODPLUG } Mix_MusicType; typedef struct _Mix_Music Mix_Music; extern __attribute__((dllexport)) int Mix_OpenAudio(int frequency, Uint16 format, int channels, int chunksize); extern __attribute__((dllexport)) int Mix_AllocateChannels(int numchans); extern __attribute__((dllexport)) int Mix_QuerySpec(int *frequency,Uint16 *format,int *channels); extern __attribute__((dllexport)) Mix_Chunk * Mix_LoadWAV_RW(SDL_RWops *src, int freesrc); extern __attribute__((dllexport)) Mix_Music * Mix_LoadMUS(const char *file); extern __attribute__((dllexport)) Mix_Music * Mix_LoadMUS_RW(SDL_RWops *rw); extern __attribute__((dllexport)) Mix_Music * Mix_LoadMUSType_RW(SDL_RWops *rw, Mix_MusicType type, int freesrc); extern __attribute__((dllexport)) Mix_Chunk * Mix_QuickLoad_WAV(Uint8 *mem); extern __attribute__((dllexport)) Mix_Chunk * Mix_QuickLoad_RAW(Uint8 *mem, Uint32 len); extern __attribute__((dllexport)) void Mix_FreeChunk(Mix_Chunk *chunk); extern __attribute__((dllexport)) void Mix_FreeMusic(Mix_Music *music); extern __attribute__((dllexport)) int Mix_GetNumChunkDecoders(void); extern __attribute__((dllexport)) const char * Mix_GetChunkDecoder(int index); extern __attribute__((dllexport)) int Mix_GetNumMusicDecoders(void); extern __attribute__((dllexport)) const char * Mix_GetMusicDecoder(int index); extern __attribute__((dllexport)) Mix_MusicType Mix_GetMusicType(const Mix_Music *music); extern __attribute__((dllexport)) void Mix_SetPostMix(void (*mix_func) (void *udata, Uint8 *stream, int len), void *arg); extern __attribute__((dllexport)) void Mix_HookMusic(void (*mix_func) (void *udata, Uint8 *stream, int len), void *arg); extern __attribute__((dllexport)) void Mix_HookMusicFinished(void (*music_finished)(void)); extern __attribute__((dllexport)) void * Mix_GetMusicHookData(void); extern __attribute__((dllexport)) void Mix_ChannelFinished(void (*channel_finished)(int channel)); typedef void (*Mix_EffectFunc_t)(int chan, void *stream, int len, void *udata); typedef void (*Mix_EffectDone_t)(int chan, void *udata); extern __attribute__((dllexport)) int Mix_RegisterEffect(int chan, Mix_EffectFunc_t f, Mix_EffectDone_t d, void *arg); extern __attribute__((dllexport)) int Mix_UnregisterEffect(int channel, Mix_EffectFunc_t f); extern __attribute__((dllexport)) int Mix_UnregisterAllEffects(int channel); extern __attribute__((dllexport)) int Mix_SetPanning(int channel, Uint8 left, Uint8 right); extern __attribute__((dllexport)) int Mix_SetPosition(int channel, Sint16 angle, Uint8 distance); extern __attribute__((dllexport)) int Mix_SetDistance(int channel, Uint8 distance); extern __attribute__((dllexport)) int Mix_SetReverseStereo(int channel, int flip); extern __attribute__((dllexport)) int Mix_ReserveChannels(int num); extern __attribute__((dllexport)) int Mix_GroupChannel(int which, int tag); extern __attribute__((dllexport)) int Mix_GroupChannels(int from, int to, int tag); extern __attribute__((dllexport)) int Mix_GroupAvailable(int tag); extern __attribute__((dllexport)) int Mix_GroupCount(int tag); extern __attribute__((dllexport)) int Mix_GroupOldest(int tag); extern __attribute__((dllexport)) int Mix_GroupNewer(int tag); extern __attribute__((dllexport)) int Mix_PlayChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ticks); extern __attribute__((dllexport)) int Mix_PlayMusic(Mix_Music *music, int loops); extern __attribute__((dllexport)) int Mix_FadeInMusic(Mix_Music *music, int loops, int ms); extern __attribute__((dllexport)) int Mix_FadeInMusicPos(Mix_Music *music, int loops, int ms, double position); extern __attribute__((dllexport)) int Mix_FadeInChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ms, int ticks); extern __attribute__((dllexport)) int Mix_Volume(int channel, int volume); extern __attribute__((dllexport)) int Mix_VolumeChunk(Mix_Chunk *chunk, int volume); extern __attribute__((dllexport)) int Mix_VolumeMusic(int volume); extern __attribute__((dllexport)) int Mix_HaltChannel(int channel); extern __attribute__((dllexport)) int Mix_HaltGroup(int tag); extern __attribute__((dllexport)) int Mix_HaltMusic(void); extern __attribute__((dllexport)) int Mix_ExpireChannel(int channel, int ticks); extern __attribute__((dllexport)) int Mix_FadeOutChannel(int which, int ms); extern __attribute__((dllexport)) int Mix_FadeOutGroup(int tag, int ms); extern __attribute__((dllexport)) int Mix_FadeOutMusic(int ms); extern __attribute__((dllexport)) Mix_Fading Mix_FadingMusic(void); extern __attribute__((dllexport)) Mix_Fading Mix_FadingChannel(int which); extern __attribute__((dllexport)) void Mix_Pause(int channel); extern __attribute__((dllexport)) void Mix_Resume(int channel); extern __attribute__((dllexport)) int Mix_Paused(int channel); extern __attribute__((dllexport)) void Mix_PauseMusic(void); extern __attribute__((dllexport)) void Mix_ResumeMusic(void); extern __attribute__((dllexport)) void Mix_RewindMusic(void); extern __attribute__((dllexport)) int Mix_PausedMusic(void); extern __attribute__((dllexport)) int Mix_SetMusicPosition(double position); extern __attribute__((dllexport)) int Mix_Playing(int channel); extern __attribute__((dllexport)) int Mix_PlayingMusic(void); extern __attribute__((dllexport)) int Mix_SetMusicCMD(const char *command); extern __attribute__((dllexport)) int Mix_SetSynchroValue(int value); extern __attribute__((dllexport)) int Mix_GetSynchroValue(void); extern __attribute__((dllexport)) int Mix_SetSoundFonts(const char *paths); extern __attribute__((dllexport)) const char* Mix_GetSoundFonts(void); extern __attribute__((dllexport)) int Mix_EachSoundFont(int (*function)(const char*, void*), void *data); extern __attribute__((dllexport)) Mix_Chunk * Mix_GetChunk(int channel); extern __attribute__((dllexport)) void Mix_CloseAudio(void); extern int max_track; int InitializeMusicPlayer(void); void ShutdownMusicPlayer(void); void PlayMusicPlayer(int track); void StopMusicPlayer(void); void SetMusicPlayerVolume(int volume); enum GUI_Menus { GMnu_MAIN = 1, GMnu_ROOM = 2, GMnu_SPELL = 3, GMnu_TRAP = 4, GMnu_CREATURE = 5, GMnu_EVENT = 6, GMnu_QUERY = 7, GMnu_OPTIONS = 8, GMnu_INSTANCE = 9, GMnu_QUIT = 10, GMnu_LOAD = 11, GMnu_SAVE = 12, GMnu_VIDEO = 13, GMnu_SOUND = 14, GMnu_ERROR_BOX = 15, GMnu_TEXT_INFO = 16, GMnu_HOLD_AUDIENCE = 17, GMnu_FEMAIN = 18, GMnu_FELOAD = 19, GMnu_FENET_SERVICE = 20, GMnu_FENET_SESSION = 21, GMnu_FENET_START = 22, GMnu_FENET_MODEM = 23, GMnu_FENET_SERIAL = 24, GMnu_FESTATISTICS = 25, GMnu_FEHIGH_SCORE_TABLE = 26, GMnu_DUNGEON_SPECIAL = 27, GMnu_RESURRECT_CREATURE = 28, GMnu_TRANSFER_CREATURE = 29, GMnu_ARMAGEDDON = 30, GMnu_CREATURE_QUERY1 = 31, GMnu_CREATURE_QUERY3 = 32, GMnu_CREATURE_QUERY4 = 33, GMnu_BATTLE = 34, GMnu_CREATURE_QUERY2 = 35, GMnu_FEDEFINE_KEYS = 36, GMnu_AUTOPILOT = 37, GMnu_SPELL_LOST = 38, GMnu_FEOPTION = 39, GMnu_FELEVEL_SELECT = 40, GMnu_FECAMPAIGN_SELECT = 41, GMnu_FEERROR_BOX = 42, GMnu_FEADD_SESSION = 43, }; #pragma pack(1) struct GuiMenu; struct GuiButton; typedef long MenuID; typedef long MenuNumber; __attribute__((dllimport)) struct GuiMenu _DK_main_menu; __attribute__((dllimport)) struct GuiMenu _DK_room_menu; __attribute__((dllimport)) struct GuiMenu _DK_spell_menu; __attribute__((dllimport)) struct GuiMenu _DK_spell_lost_menu; __attribute__((dllimport)) struct GuiMenu _DK_trap_menu; __attribute__((dllimport)) struct GuiMenu _DK_creature_menu; __attribute__((dllimport)) struct GuiMenu _DK_event_menu; __attribute__((dllimport)) struct GuiMenu _DK_options_menu; __attribute__((dllimport)) struct GuiMenu _DK_instance_menu; __attribute__((dllimport)) struct GuiMenu _DK_query_menu; __attribute__((dllimport)) struct GuiMenu _DK_quit_menu; __attribute__((dllimport)) struct GuiMenu _DK_load_menu; __attribute__((dllimport)) struct GuiMenu _DK_save_menu; __attribute__((dllimport)) struct GuiMenu _DK_video_menu; __attribute__((dllimport)) struct GuiMenu _DK_sound_menu; __attribute__((dllimport)) struct GuiMenu _DK_error_box; __attribute__((dllimport)) struct GuiMenu _DK_text_info_menu; __attribute__((dllimport)) struct GuiMenu _DK_hold_audience_menu; __attribute__((dllimport)) struct GuiMenu _DK_dungeon_special_menu; __attribute__((dllimport)) struct GuiMenu _DK_resurrect_creature_menu; __attribute__((dllimport)) struct GuiMenu _DK_transfer_creature_menu; __attribute__((dllimport)) struct GuiMenu _DK_armageddon_menu; __attribute__((dllimport)) struct GuiMenu _DK_frontend_main_menu; __attribute__((dllimport)) struct GuiMenu _DK_frontend_load_menu; __attribute__((dllimport)) struct GuiMenu _DK_frontend_net_service_menu; __attribute__((dllimport)) struct GuiMenu _DK_frontend_net_session_menu; __attribute__((dllimport)) struct GuiMenu _DK_frontend_net_start_menu; __attribute__((dllimport)) struct GuiMenu _DK_frontend_net_modem_menu; __attribute__((dllimport)) struct GuiMenu _DK_frontend_net_serial_menu; __attribute__((dllimport)) struct GuiMenu _DK_frontend_statistics_menu; __attribute__((dllimport)) struct GuiMenu _DK_frontend_high_score_table_menu; __attribute__((dllimport)) struct GuiMenu _DK_creature_query_menu1; __attribute__((dllimport)) struct GuiMenu _DK_creature_query_menu2; __attribute__((dllimport)) struct GuiMenu _DK_creature_query_menu3; __attribute__((dllimport)) struct GuiMenu _DK_battle_menu; __attribute__((dllimport)) struct GuiMenu _DK_frontend_define_keys_menu; __attribute__((dllimport)) struct GuiMenu _DK_autopilot_menu; __attribute__((dllimport)) struct GuiMenu _DK_frontend_option_menu; __attribute__((dllimport)) struct GuiMenu *_DK_menu_list[40]; __attribute__((dllimport)) char _DK_no_of_active_menus; __attribute__((dllimport)) unsigned char _DK_menu_stack[8]; __attribute__((dllimport)) extern struct GuiMenu _DK_active_menus[8]; #pragma pack() struct GuiMenu *get_active_menu(MenuNumber num); MenuNumber menu_id_to_number(MenuID menu_id); int first_monopoly_menu(void); void update_busy_doing_gui_on_menu(void); void turn_on_menu(MenuID idx); void turn_off_menu(MenuID mnu_idx); void turn_off_query_menus(void); void turn_off_all_menus(void); short turn_off_all_window_menus(void); short turn_off_all_bottom_menus(void); void turn_on_main_panel_menu(void); void turn_off_all_panel_menus(void); void set_menu_mode(long mnu_idx); void set_menu_visible_on(MenuID menu_id); void set_menu_visible_off(MenuID menu_id); void turn_off_event_box_if_necessary(PlayerNumber plyr_idx, unsigned char event_idx); void kill_menu(struct GuiMenu *gmnu); void remove_from_menu_stack(short mnu_id); void add_to_menu_stack(unsigned char mnu_idx); long first_available_menu(void); #pragma pack(1) enum DemoItem_Kind { DIK_PlaySmkVideo, DIK_LoadPacket, DIK_SwitchState, DIK_ListEnd, }; enum FrontendMenuStates { FeSt_INITIAL = 0, FeSt_MAIN_MENU, FeSt_FELOAD_GAME, FeSt_LAND_VIEW, FeSt_NET_SERVICE, FeSt_NET_SESSION, FeSt_NET_START, FeSt_START_KPRLEVEL, FeSt_START_MPLEVEL, FeSt_UNKNOWN09, FeSt_LOAD_GAME, FeSt_INTRO, FeSt_STORY_POEM, FeSt_CREDITS, FeSt_DEMO, FeSt_NET_MODEM, FeSt_NET_SERIAL, FeSt_LEVEL_STATS, FeSt_HIGH_SCORES, FeSt_TORTURE, FeSt_UNKNOWN20, FeSt_OUTRO, FeSt_UNKNOWN22, FeSt_UNKNOWN23, FeSt_NETLAND_VIEW, FeSt_PACKET_DEMO, FeSt_FEDEFINE_KEYS, FeSt_FEOPTIONS, FeSt_UNKNOWN28, FeSt_STORY_BIRTHDAY, FeSt_LEVEL_SELECT, FeSt_CAMPAIGN_SELECT, FeSt_DRAG, FeSt_CAMPAIGN_INTRO, FeSt_FONT_TEST = 255, }; struct GuiMenu; struct GuiButton; struct TbLoadFiles; struct DemoItem { unsigned char numfield_0; const char *fname; }; struct NetMessage { unsigned char plyr_idx; char text[64]; }; __attribute__((dllimport)) struct GuiButtonInit _DK_event_menu_buttons[]; __attribute__((dllimport)) struct GuiButtonInit _DK_options_menu_buttons[]; __attribute__((dllimport)) struct GuiButtonInit _DK_instance_menu_buttons[]; __attribute__((dllimport)) struct GuiButtonInit _DK_quit_menu_buttons[]; __attribute__((dllimport)) struct GuiButtonInit _DK_load_menu_buttons[]; __attribute__((dllimport)) struct GuiButtonInit _DK_save_menu_buttons[]; __attribute__((dllimport)) struct GuiButtonInit _DK_video_menu_buttons[]; __attribute__((dllimport)) struct GuiButtonInit _DK_sound_menu_buttons[]; __attribute__((dllimport)) struct GuiButtonInit _DK_error_box_buttons[]; __attribute__((dllimport)) struct GuiButtonInit _DK_pause_buttons[]; __attribute__((dllimport)) struct GuiButtonInit _DK_hold_audience_buttons[]; __attribute__((dllimport)) struct GuiButtonInit _DK_armageddon_buttons[]; __attribute__((dllimport)) struct GuiButtonInit _DK_dungeon_special_buttons[]; __attribute__((dllimport)) struct GuiButtonInit _DK_resurrect_creature_buttons[]; __attribute__((dllimport)) struct GuiButtonInit _DK_transfer_creature_buttons[]; __attribute__((dllimport)) struct GuiButtonInit _DK_frontend_main_menu_buttons[]; __attribute__((dllimport)) struct GuiButtonInit _DK_frontend_load_menu_buttons[]; __attribute__((dllimport)) struct GuiButtonInit _DK_frontend_net_service_buttons[]; __attribute__((dllimport)) struct GuiButtonInit _DK_frontend_net_session_buttons[]; __attribute__((dllimport)) struct GuiButtonInit _DK_frontend_net_start_buttons[]; __attribute__((dllimport)) struct GuiButtonInit _DK_frontend_net_modem_buttons[37]; __attribute__((dllimport)) struct GuiButtonInit _DK_frontend_net_serial_buttons[22]; __attribute__((dllimport)) struct GuiButtonInit _DK_frontend_statistics_buttons[]; __attribute__((dllimport)) struct GuiButtonInit _DK_autopilot_menu_buttons[]; __attribute__((dllimport)) struct GuiButtonInit _DK_frontend_define_keys_buttons[]; __attribute__((dllimport)) struct GuiButtonInit _DK_frontend_option_buttons[]; __attribute__((dllimport)) char _DK_info_tag; __attribute__((dllimport)) char _DK_room_tag; __attribute__((dllimport)) char _DK_spell_tag; __attribute__((dllimport)) char _DK_trap_tag; __attribute__((dllimport)) char _DK_creature_tag; __attribute__((dllimport)) char _DK_input_string[8][16]; __attribute__((dllimport)) char _DK_gui_error_text[256]; __attribute__((dllimport)) long _DK_net_service_scroll_offset; __attribute__((dllimport)) long _DK_net_number_of_services; __attribute__((dllimport)) long _DK_net_comport_index_active; __attribute__((dllimport)) long _DK_net_speed_index_active; __attribute__((dllimport)) long _DK_net_number_of_players; __attribute__((dllimport)) long _DK_net_number_of_enum_players; __attribute__((dllimport)) long _DK_net_map_slap_frame; __attribute__((dllimport)) long _DK_net_level_hilighted; __attribute__((dllimport)) struct NetMessage _DK_net_message[8]; __attribute__((dllimport)) long _DK_net_number_of_messages; __attribute__((dllimport)) long _DK_net_message_scroll_offset; __attribute__((dllimport)) long _DK_net_session_index_active_id; __attribute__((dllimport)) long _DK_net_session_scroll_offset; __attribute__((dllimport)) long _DK_net_player_scroll_offset; __attribute__((dllimport)) extern struct GuiButton _DK_active_buttons[86]; __attribute__((dllimport)) long _DK_frontend_mouse_over_button_start_time; __attribute__((dllimport)) short _DK_old_menu_mouse_x; __attribute__((dllimport)) short _DK_old_menu_mouse_y; __attribute__((dllimport)) unsigned char _DK_menu_ids[3]; __attribute__((dllimport)) unsigned char _DK_new_objective; __attribute__((dllimport)) char _DK_gui_error_text[256]; __attribute__((dllimport)) extern int _DK_frontend_menu_state; __attribute__((dllimport)) extern int _DK_load_game_scroll_offset; __attribute__((dllimport)) unsigned char _DK_video_gamma_correction; __attribute__((dllimport)) struct TbSprite *_DK_font_sprites; __attribute__((dllimport)) struct TbSprite *_DK_end_font_sprites; __attribute__((dllimport)) unsigned char * _DK_font_data; __attribute__((dllimport)) extern struct TbSprite *_DK_frontend_font[4]; __attribute__((dllimport)) extern struct TbSprite *_DK_frontend_end_font[4]; __attribute__((dllimport)) extern unsigned char * _DK_frontend_font_data[4]; __attribute__((dllimport)) extern unsigned char * _DK_frontend_end_font_data[4]; __attribute__((dllimport)) extern struct TbSprite *_DK_button_sprite; __attribute__((dllimport)) extern struct TbSprite *_DK_end_button_sprites; __attribute__((dllimport)) extern unsigned char * _DK_button_sprite_data; __attribute__((dllimport)) extern unsigned long _DK_end_button_sprite_data; __attribute__((dllimport)) extern struct TbSprite *_DK_winfont; __attribute__((dllimport)) extern struct TbSprite *_DK_end_winfonts; __attribute__((dllimport)) unsigned char * _DK_winfont_data; __attribute__((dllimport)) unsigned char * _DK_end_winfont_data; __attribute__((dllimport)) struct TbSprite *_DK_edit_icon_sprites; __attribute__((dllimport)) struct TbSprite *_DK_end_edit_icon_sprites; __attribute__((dllimport)) unsigned char * _DK_edit_icon_data; __attribute__((dllimport)) extern struct TbSprite *_DK_port_sprite; __attribute__((dllimport)) extern struct TbSprite *_DK_end_port_sprites; __attribute__((dllimport)) extern unsigned char * _DK_port_sprite_data; __attribute__((dllimport)) extern unsigned long _DK_playing_bad_descriptive_speech; __attribute__((dllimport)) extern unsigned long _DK_playing_good_descriptive_speech; __attribute__((dllimport)) extern long _DK_scrolling_index; __attribute__((dllimport)) extern long _DK_scrolling_offset; __attribute__((dllimport)) extern long _DK_packet_left_button_double_clicked[6]; __attribute__((dllimport)) extern long _DK_packet_left_button_click_space_count[6]; __attribute__((dllimport)) extern char _DK_frontend_alliances; __attribute__((dllimport)) extern char _DK_busy_doing_gui; __attribute__((dllimport)) extern long _DK_gui_last_left_button_pressed_id; __attribute__((dllimport)) extern long _DK_gui_last_right_button_pressed_id; __attribute__((dllimport)) int _DK_fe_computer_players; __attribute__((dllimport)) extern long _DK_old_mouse_over_button; __attribute__((dllimport)) extern long _DK_frontend_mouse_over_button; #pragma pack() extern struct GuiMenu frontend_main_menu; extern struct GuiMenu frontend_statistics_menu; extern struct GuiMenu frontend_high_score_table_menu; extern struct FrontEndButtonData frontend_button_info[111]; extern char gui_message_text[]; extern struct GuiMenu *menu_list[45]; extern int status_panel_width; extern const unsigned long alliance_grid[4][4]; extern struct TbSprite *testfont[12]; extern struct TbSprite *testfont_end[12]; extern unsigned char * testfont_data[12]; extern unsigned char *testfont_palette[3]; __attribute__((dllimport)) char *_DK_mdlf_for_cd(struct TbLoadFiles *); __attribute__((dllimport)) char *_DK_mdlf_default(struct TbLoadFiles *); int frontend_font_char_width(int fnt_idx,char c); int frontend_font_string_width(int fnt_idx, const char *str); TbBool frontend_font_string_draw(int scr_x, int scr_y, int dst_width, int dst_height, int fnt_idx, const char *str, unsigned short fdflags); void create_error_box(TextStringId msg_idx); void gui_area_text(struct GuiButton *gbtn); TbBool get_button_area_input(struct GuiButton *gbtn, int a2); const char *frontend_button_caption_text(const struct GuiButton *gbtn); int frontend_button_caption_font(const struct GuiButton *gbtn, long mouse_over_btn_idx); void maintain_loadsave(struct GuiButton *gbtn); void gui_video_cluedo_maintain(struct GuiButton *gbtn); void maintain_zoom_to_event(struct GuiButton *gbtn); void maintain_scroll_up(struct GuiButton *gbtn); void maintain_scroll_down(struct GuiButton *gbtn); void frontend_continue_game_maintain(struct GuiButton *gbtn); void frontend_main_menu_load_game_maintain(struct GuiButton *gbtn); void frontend_main_menu_netservice_maintain(struct GuiButton *gbtn); void frontend_main_menu_highscores_maintain(struct GuiButton *gbtn); void maintain_loadsave(struct GuiButton *gbtn); void gui_quit_game(struct GuiButton *gbtn); void gui_area_slider(struct GuiButton *gbtn); void frontend_draw_icon(struct GuiButton *gbtn); void frontend_draw_error_text_box(struct GuiButton *gbtn); void frontend_maintain_error_text_box(struct GuiButton *gbtn); short is_toggleable_menu(short mnu_idx); void activate_room_build_mode(RoomKind rkind, TextStringId tooltip_id); void choose_spell(PowerKind pwkind, TextStringId tooltip_id); TbBool is_special_power(PowerKind pwkind); void choose_special_spell(PowerKind pwkind, TextStringId tooltip_id); void choose_workshop_item(int manufctr_idx, TextStringId tooltip_id); int frontend_load_data(void); void frontend_draw_scroll_tab(struct GuiButton *gbtn, long scroll_offset, long first_elem, long last_elem); long frontend_scroll_tab_to_offset(struct GuiButton *gbtn, long scr_pos, long first_elem, long last_elem); TbBool frontend_should_all_players_quit(void); void frontend_init_options_menu(struct GuiMenu *gmnu); void frontend_draw_text(struct GuiButton *gbtn); void frontend_change_state(struct GuiButton *gbtn); void frontend_draw_enter_text(struct GuiButton *gbtn); void frontend_draw_small_menu_button(struct GuiButton *gbtn); void frontend_toggle_computer_players(struct GuiButton *gbtn); void frontend_draw_computer_players(struct GuiButton *gbtn); void set_packet_start(struct GuiButton *gbtn); void gui_area_scroll_window(struct GuiButton *gbtn); void gui_go_to_event(struct GuiButton *gbtn); void maintain_zoom_to_event(struct GuiButton *gbtn); void gui_close_objective(struct GuiButton *gbtn); void gui_scroll_text_up(struct GuiButton *gbtn); void gui_scroll_text_down(struct GuiButton *gbtn); void maintain_scroll_up(struct GuiButton *gbtn); void maintain_scroll_down(struct GuiButton *gbtn); void gui_scroll_text_down(struct GuiButton *gbtn); void frontend_ldcampaign_change_state(struct GuiButton *gbtn); void frontend_netservice_change_state(struct GuiButton *gbtn); void frontend_start_new_game(struct GuiButton *gbtn); void frontend_load_continue_game(struct GuiButton *gbtn); short frontend_save_continue_game(short allow_lvnum_grow); void frontend_continue_game_maintain(struct GuiButton *gbtn); void frontend_main_menu_load_game_maintain(struct GuiButton *gbtn); void frontend_main_menu_netservice_maintain(struct GuiButton *gbtn); void frontend_main_menu_highscores_maintain(struct GuiButton *gbtn); void frontend_load_data_from_cd(void); void frontend_load_data_reset(void); void init_load_menu(struct GuiMenu *gmnu); void init_save_menu(struct GuiMenu *gmnu); void init_video_menu(struct GuiMenu *gmnu); void init_audio_menu(struct GuiMenu *gmnu); void frontend_init_options_menu(struct GuiMenu *gmnu); TbBool frontend_is_player_allied(long idx1, long idx2); void frontend_set_alliance(long idx1, long idx2); char update_menu_fade_level(struct GuiMenu *gmnu); void draw_menu_buttons(struct GuiMenu *gmnu); MenuNumber create_menu(struct GuiMenu *mnu); void do_button_release_actions(struct GuiButton *gbtn, unsigned char *, Gf_Btn_Callback callback); void draw_gui(void); void init_gui(void); void reinit_all_menus(void); void gui_set_autopilot(struct GuiButton *gbtn); FrontendMenuState frontend_set_state(FrontendMenuState nstate); FrontendMenuState get_startup_menu_state(void); FrontendMenuState get_menu_state_when_back_from_substate(FrontendMenuState substate); void frontend_input(void); void frontend_update(short *finish_menu); short frontend_draw(void); void create_frontend_error_box(long showTime, const char * text); short menu_is_active(short idx); TbBool a_menu_window_is_active(void); void get_player_gui_clicks(void); short game_is_busy_doing_gui(void); void set_gui_visible(TbBool visible); void toggle_gui(void); void add_message(long plyr_idx, char *msg); TbBool validate_versions(void); void versions_different_error(void); unsigned long toggle_status_menu(short visib); TbBool toggle_first_person_menu(TbBool visible); void toggle_gui_overlay_map(void); void update_player_objectives(PlayerNumber plyr_idx); void set_level_objective(const char *msg_text); void display_objectives(PlayerNumber plyr_idx,long x,long y); short toggle_main_cheat_menu(void); short toggle_instance_cheat_menu(void); TbBool open_creature_cheat_menu(void); TbBool close_creature_cheat_menu(void); TbBool toggle_creature_cheat_menu(void); void initialise_tab_tags(MenuID menu_id); void initialise_tab_tags_and_menu(MenuID menu_id); void turn_off_roaming_menus(void); void frontend_set_player_number(long plr_num); TbBool frontend_start_new_campaign(const char *cmpgn_fname); #pragma pack(1) enum GameKeys { Gkey_MoveUp = 0, Gkey_MoveDown, Gkey_MoveLeft, Gkey_MoveRight, Gkey_RotateMod, Gkey_SpeedMod, Gkey_RotateCW, Gkey_RotateCCW, Gkey_ZoomIn, Gkey_ZoomOut, Gkey_ZoomRoom00, Gkey_ZoomRoom01, Gkey_ZoomRoom02, Gkey_ZoomRoom03, Gkey_ZoomRoom04, Gkey_ZoomRoom05, Gkey_ZoomRoom06, Gkey_ZoomRoom07, Gkey_ZoomRoom08, Gkey_ZoomRoom09, Gkey_ZoomRoom10, Gkey_ZoomRoom11, Gkey_ZoomRoom12, Gkey_ZoomRoom13, Gkey_ZoomRoom14, Gkey_ZoomToFight, Gkey_ZoomCrAnnoyed, Gkey_CrtrContrlMod, Gkey_CrtrQueryMod, Gkey_DumpToOldPos, Gkey_TogglePause, Gkey_SwitchToMap, Gkey_ToggleMessage, }; enum TbButtonFrontendFlags { LbBFeF_IntValueMask = 0x3fff, LbBFeF_NoMouseOver = 0x4000, LbBFeF_NoTooltip = 0x8000, }; struct GuiMenu; struct GuiButton; #pragma pack() __attribute__((dllimport)) long _DK_old_mx; __attribute__((dllimport)) long _DK_old_my; void input(void); short get_inputs(void); short get_screen_capture_inputs(void); int is_game_key_pressed(long key_id, long *val, TbBool ignore_mods); short game_is_busy_doing_gui_string_input(void); short get_gui_inputs(short gameplay_on); TbBool check_if_mouse_is_over_button(const struct GuiButton *gbtn); enum KeyCodes { KC_UNASSIGNED = 0x00, KC_ESCAPE = 0x01, KC_1 = 0x02, KC_2 = 0x03, KC_3 = 0x04, KC_4 = 0x05, KC_5 = 0x06, KC_6 = 0x07, KC_7 = 0x08, KC_8 = 0x09, KC_9 = 0x0A, KC_0 = 0x0B, KC_MINUS = 0x0C, KC_EQUALS = 0x0D, KC_BACK = 0x0E, KC_TAB = 0x0F, KC_Q = 0x10, KC_W = 0x11, KC_E = 0x12, KC_R = 0x13, KC_T = 0x14, KC_Y = 0x15, KC_U = 0x16, KC_I = 0x17, KC_O = 0x18, KC_P = 0x19, KC_LBRACKET = 0x1A, KC_RBRACKET = 0x1B, KC_RETURN = 0x1C, KC_LCONTROL = 0x1D, KC_A = 0x1E, KC_S = 0x1F, KC_D = 0x20, KC_F = 0x21, KC_G = 0x22, KC_H = 0x23, KC_J = 0x24, KC_K = 0x25, KC_L = 0x26, KC_SEMICOLON = 0x27, KC_APOSTROPHE = 0x28, KC_GRAVE = 0x29, KC_LSHIFT = 0x2A, KC_BACKSLASH = 0x2B, KC_Z = 0x2C, KC_X = 0x2D, KC_C = 0x2E, KC_V = 0x2F, KC_B = 0x30, KC_N = 0x31, KC_M = 0x32, KC_COMMA = 0x33, KC_PERIOD = 0x34, KC_SLASH = 0x35, KC_RSHIFT = 0x36, KC_MULTIPLY = 0x37, KC_LALT = 0x38, KC_SPACE = 0x39, KC_CAPITAL = 0x3A, KC_F1 = 0x3B, KC_F2 = 0x3C, KC_F3 = 0x3D, KC_F4 = 0x3E, KC_F5 = 0x3F, KC_F6 = 0x40, KC_F7 = 0x41, KC_F8 = 0x42, KC_F9 = 0x43, KC_F10 = 0x44, KC_NUMLOCK = 0x45, KC_SCROLL = 0x46, KC_NUMPAD7 = 0x47, KC_NUMPAD8 = 0x48, KC_NUMPAD9 = 0x49, KC_SUBTRACT = 0x4A, KC_NUMPAD4 = 0x4B, KC_NUMPAD5 = 0x4C, KC_NUMPAD6 = 0x4D, KC_ADD = 0x4E, KC_NUMPAD1 = 0x4F, KC_NUMPAD2 = 0x50, KC_NUMPAD3 = 0x51, KC_NUMPAD0 = 0x52, KC_DECIMAL = 0x53, KC_OEM_102 = 0x56, KC_F11 = 0x57, KC_F12 = 0x58, KC_F13 = 0x64, KC_F14 = 0x65, KC_F15 = 0x66, KC_KANA = 0x70, KC_ABNT_C1 = 0x73, KC_CONVERT = 0x79, KC_NOCONVERT = 0x7B, KC_YEN = 0x7D, KC_ABNT_C2 = 0x7E, KC_NUMPADEQUALS= 0x8D, KC_PREVTRACK = 0x90, KC_AT = 0x91, KC_COLON = 0x92, KC_UNDERLINE = 0x93, KC_KANJI = 0x94, KC_STOP = 0x95, KC_AX = 0x96, KC_UNLABELED = 0x97, KC_NEXTTRACK = 0x99, KC_NUMPADENTER = 0x9C, KC_RCONTROL = 0x9D, KC_MUTE = 0xA0, KC_CALCULATOR = 0xA1, KC_PLAYPAUSE = 0xA2, KC_MEDIASTOP = 0xA4, KC_VOLUMEDOWN = 0xAE, KC_VOLUMEUP = 0xB0, KC_WEBHOME = 0xB2, KC_NUMPADCOMMA = 0xB3, KC_DIVIDE = 0xB5, KC_SYSRQ = 0xB7, KC_RALT = 0xB8, KC_PAUSE = 0xC5, KC_HOME = 0xC7, KC_UP = 0xC8, KC_PGUP = 0xC9, KC_LEFT = 0xCB, KC_RIGHT = 0xCD, KC_END = 0xCF, KC_DOWN = 0xD0, KC_PGDOWN = 0xD1, KC_INSERT = 0xD2, KC_DELETE = 0xD3, KC_LWIN = 0xDB, KC_RWIN = 0xDC, KC_APPS = 0xDD, KC_POWER = 0xDE, KC_SLEEP = 0xDF, KC_WAKE = 0xE3, }; enum KeyAction { KActn_NONE = 0, KActn_KEYDOWN, KActn_KEYUP, }; enum KeyModifiers { KMod_NONE = 0x00, KMod_SHIFT = 0x10, KMod_CONTROL = 0x20, KMod_ALT = 0x40, }; #pragma pack(1) typedef unsigned char TbKeyCode; typedef short TbKeyMods; __attribute__((dllimport)) extern unsigned char _DK_lbKeyOn[256]; __attribute__((dllimport)) extern unsigned char _DK_lbInkey; __attribute__((dllimport)) unsigned char _DK_lbInkeyFlags; __attribute__((dllimport)) extern unsigned char _DK_lbIInkey; __attribute__((dllimport)) unsigned char _DK_lbIInkeyFlags; __attribute__((dllimport)) int _DK_lbKeyboardLang; __attribute__((dllimport)) unsigned char _DK_lbExtendedKeyPress; #pragma pack() extern const char AsciiToInkey[]; extern char lbInkeyToAscii[]; extern char lbInkeyToAsciiShift[]; short LbIKeyboardOpen(void); short LbIKeyboardClose(void); void LbKeyboardSetLanguage(int lngnum); short LbKeyCodeValid(TbKeyCode key); void keyboardControl(unsigned int action, TbKeyCode code, TbKeyMods modifiers); long KeyboardProc(int, unsigned int, long); #pragma pack(1) struct KeyToStringInit { unsigned char chr; long str_idx; }; __attribute__((dllimport)) extern unsigned long _DK_key_modifiers; __attribute__((dllimport)) extern int _DK_defining_a_key; __attribute__((dllimport)) extern long _DK_defining_a_key_id; __attribute__((dllimport)) extern long _DK_left_button_held_x; __attribute__((dllimport)) extern long _DK_left_button_held_y; __attribute__((dllimport)) extern long _DK_left_button_double_clicked_y; __attribute__((dllimport)) extern long _DK_left_button_double_clicked_x; __attribute__((dllimport)) extern long _DK_right_button_double_clicked_y; __attribute__((dllimport)) extern long _DK_right_button_double_clicked_x; __attribute__((dllimport)) extern char _DK_right_button_clicked; __attribute__((dllimport)) extern char _DK_left_button_clicked; __attribute__((dllimport)) extern long _DK_right_button_released_x; __attribute__((dllimport)) extern long _DK_right_button_released_y; __attribute__((dllimport)) extern char _DK_right_button_double_clicked; __attribute__((dllimport)) extern long _DK_left_button_released_y; __attribute__((dllimport)) extern long _DK_left_button_released_x; __attribute__((dllimport)) extern char _DK_left_button_double_clicked; __attribute__((dllimport)) extern char _DK_right_button_released; __attribute__((dllimport)) extern char _DK_right_button_held; __attribute__((dllimport)) extern long _DK_right_button_click_space_count; __attribute__((dllimport)) extern long _DK_right_button_held_y; __attribute__((dllimport)) extern long _DK_left_button_clicked_y; __attribute__((dllimport)) extern long _DK_left_button_clicked_x; __attribute__((dllimport)) extern long _DK_left_button_click_space_count; __attribute__((dllimport)) extern long _DK_right_button_held_x; __attribute__((dllimport)) extern char _DK_left_button_released; __attribute__((dllimport)) extern long _DK_right_button_clicked_y; __attribute__((dllimport)) extern long _DK_right_button_clicked_x; __attribute__((dllimport)) extern char _DK_left_button_held; __attribute__((dllimport)) long _DK_key_to_string[256]; #pragma pack() extern TbBool wheel_scrolled_up; extern TbBool wheel_scrolled_down; long GetMouseX(void); long GetMouseY(void); short is_mouse_pressed_leftbutton(void); short is_mouse_pressed_rightbutton(void); short is_mouse_pressed_lrbutton(void); void clear_mouse_pressed_lrbutton(void); void update_mouse(void); void update_wheel_scrolled(void); short is_key_pressed(TbKeyCode key, TbKeyMods kmodif); unsigned short key_to_ascii(TbKeyCode key, TbKeyMods kmodif); void clear_key_pressed(long key); void update_key_modifiers(void); void define_key_input(void); void init_key_to_strings(void); TbBool mouse_is_over_pannel_map(ScreenCoord x, ScreenCoord y); enum TbPacketAction { PckA_None = 0, PckA_Unknown001, PckA_Unknown002, PckA_Unknown003, PckA_Unknown004, PckA_FinishGame, PckA_Unknown006, PckA_Unknown007, PckA_Unknown008, PckA_Unknown009, PckA_InitPlayerNum, PckA_Unknown011, PckA_LevelExactCheck, PckA_PlyrMsgBegin, PckA_PlyrMsgEnd, PckA_Unknown015, PckA_Unknown016, PckA_Unknown017, PckA_Unknown018, PckA_Unknown019, PckA_ToggleLights, PckA_SwitchScrnRes, PckA_TogglePause, PckA_Unknown023, PckA_SetCluedo, PckA_Unknown025, PckA_BookmarkLoad, PckA_SetGammaLevel, PckA_SetMinimapConf, PckA_SetMapRotation, PckA_Unknown030, PckA_Unknown031, PckA_PasngrCtrlExit, PckA_Unknown033, PckA_Unknown034, PckA_Unknown035, PckA_SetPlyrState, PckA_SwitchView, PckA_Unknown038, PckA_CtrlCrtrSetInstnc, PckA_Unknown040, PckA_HoldAudience, PckA_Unknown042, PckA_Unknown043, PckA_Unknown044, PckA_Unknown045, PckA_Unknown046, PckA_Unknown047, PckA_Unknown048, PckA_Unknown049, PckA_Unknown050, PckA_Unknown051, PckA_Unknown052, PckA_Unknown053, PckA_Unknown054, PckA_ToggleTendency, PckA_Unknown056, PckA_Unknown057, PckA_Unknown058, PckA_Unknown059, PckA_CheatEnter, PckA_CheatAllFree, PckA_CheatCrtSpells, PckA_CheatRevealMap, PckA_CheatCrAllSpls, PckA_Unknown065, PckA_CheatAllMagic, PckA_CheatAllRooms, PckA_Unknown068, PckA_Unknown069, PckA_CheatAllResrchbl, PckA_Unknown071, PckA_Unknown072, PckA_Unknown073, PckA_Unknown074, PckA_Unknown075, PckA_Unknown076, PckA_Unknown077, PckA_Unknown078, PckA_Unknown079, PckA_SetViewType, PckA_ZoomFromMap, PckA_UpdatePause, PckA_Unknown083, PckA_ZoomToRoom, PckA_ZoomToTrap, PckA_ZoomToDoor, PckA_Unknown087, PckA_Unknown088, PckA_PwrCTADis, PckA_UsePwrHandPick, PckA_UsePwrHandDrop, PckA_Unknown092, PckA_UseSpecialBox, PckA_Unknown094, PckA_ResurrectCrtr, PckA_TransferCreatr, PckA_UsePwrObey, PckA_UsePwrArmageddon, PckA_Unknown099, PckA_Unknown100, PckA_Unknown101, PckA_Unknown102, PckA_Unknown103, PckA_Unknown104, PckA_Unknown105, PckA_ZoomToSpell, PckA_ToggleComputer, PckA_PlyrFastMsg, PckA_SetComputerKind, PckA_GoSpectator, PckA_DumpHeldThingToOldPos, PckA_Unknown112, PckA_Unknown113, PckA_PwrSOEDis, PckA_EventBoxActivate, PckA_EventBoxClose, PckA_UsePwrOnThing, PckA_PlyrToggleAlly, PckA_SaveViewType, PckA_LoadViewType, PckA_PlyrMsgChar = 121, }; enum TbPacketControl { PCtr_None = 0x0000, PCtr_ViewRotateCW = 0x0001, PCtr_ViewRotateCCW = 0x0002, PCtr_MoveUp = 0x0004, PCtr_MoveDown = 0x0008, PCtr_MoveLeft = 0x0010, PCtr_MoveRight = 0x0020, PCtr_ViewZoomIn = 0x0040, PCtr_ViewZoomOut = 0x0080, PCtr_LBtnClick = 0x0100, PCtr_RBtnClick = 0x0200, PCtr_LBtnHeld = 0x0400, PCtr_RBtnHeld = 0x0800, PCtr_LBtnRelease = 0x1000, PCtr_RBtnRelease = 0x2000, PCtr_Unknown4000 = 0x4000, PCtr_MapCoordsValid = 0x8000, }; enum TbPacketAddValues { PCAdV_None = 0x00, PCAdV_SpeedupPressed = 0x01, PCAdV_ContextMask = 0x1E, PCAdV_CrtrContrlPressed = 0x20, PCAdV_CrtrQueryPressed = 0x40, PCAdV_Unknown80 = 0x80, }; #pragma pack(1) struct PlayerInfo; struct CatalogueEntry; struct Packet { int field_0; TbChecksum chksum; unsigned char action; unsigned short actn_par1; unsigned short actn_par2; short pos_x; short pos_y; unsigned short control_flags; unsigned char field_10; }; struct PacketSaveHead { unsigned short game_ver_major; unsigned short game_ver_minor; unsigned short game_ver_release; unsigned short game_ver_build; unsigned long level_num; unsigned char players_exist; unsigned char players_comp; TbBool chksum_available; }; #pragma pack() struct Packet *get_packet_direct(long pckt_idx); struct Packet *get_packet(long plyr_idx); void set_packet_action(struct Packet *pckt, unsigned char pcktype, unsigned short par1, unsigned short par2, unsigned short par3, unsigned short par4); void set_players_packet_action(struct PlayerInfo *player, unsigned char pcktype, unsigned short par1, unsigned short par2, unsigned short par3, unsigned short par4); void set_packet_control(struct Packet *pckt, unsigned long flag); void set_players_packet_control(struct PlayerInfo *player, unsigned long flag); unsigned char get_players_packet_action(struct PlayerInfo *player); void unset_packet_control(struct Packet *pckt, unsigned long flag); void unset_players_packet_control(struct PlayerInfo *player, unsigned long flag); void set_players_packet_position(struct PlayerInfo *player, long x, long y); short set_packet_pause_toggle(void); TbBool process_dungeon_control_packet_clicks(long idx); TbBool process_players_dungeon_control_packet_action(long idx); void process_players_creature_control_packet_control(long idx); void process_players_creature_passenger_packet_action(long idx); void process_players_creature_control_packet_action(long idx); void process_frontend_packets(void); void process_map_packet_clicks(long idx); void process_pause_packet(long a1, long a2); void process_quit_packet(struct PlayerInfo *player, short complete_quit); void process_packets(void); void clear_packets(void); TbBigChecksum compute_players_checksum(void); void player_packet_checksum_add(PlayerNumber plyr_idx, TbBigChecksum sum, const char *area_name); short checksums_different(void); void post_init_packets(void); TbBool open_new_packet_file_for_save(void); void load_packets_for_turn(GameTurn nturn); TbBool open_packet_file_for_load(char *fname, struct CatalogueEntry *centry); short save_packets(void); void close_packet_file(void); TbBool reinit_packets_after_load(void); #pragma pack(1) struct GameKey { unsigned char code; unsigned char mods; }; struct GameSettings { unsigned char field_0; unsigned char video_shadows; unsigned char view_distance; unsigned char video_rotate_mode; unsigned char video_textures; unsigned char video_cluedo_mode; unsigned char sound_volume; unsigned char redbook_volume; unsigned char roomflags_on; unsigned short gamma_correction; int video_scrnmode; struct GameKey kbkeys[33]; unsigned char tooltips_on; unsigned char first_person_move_invert; unsigned char first_person_move_sensitivity; }; #pragma pack() __attribute__((dllimport)) extern struct GameSettings _DK_settings; TbBool load_settings(void); short save_settings(void); int get_creature_can_see_subtiles(void); enum ThingAllocFlags { TAlF_Exists = 0x01, TAlF_IsInMapWho = 0x02, TAlF_IsInStrucList = 0x04, TAlF_InDungeonList = 0x08, TAlF_IsInLimbo = 0x10, TAlF_IsControlled = 0x20, TAlF_IsFollowingLeader = 0x40, TAlF_IsDragged = 0x80, }; enum ThingFlags1 { TF1_IsDragged1 = 0x01, TF1_InCtrldLimbo = 0x02, TF1_PushAdd = 0x04, TF1_PushOnce = 0x08, TF1_Unkn10 = 0x10, TF1_DoFootsteps = 0x20, }; enum ThingFlags2 { TF2_Unkn01 = 0x01, TF2_Spectator = 0x02, }; enum ThingFlags4F { TF4F_Unknown01 = 0x01, TF4F_Unknown02 = 0x02, TF4F_Unknown04 = 0x04, TF4F_Unknown08 = 0x08, TF4F_Unknown10 = 0x10, TF4F_Unknown20 = 0x20, TF4F_Unknown40 = 0x40, TF4F_Unknown80 = 0x80, }; enum FreeThingAllocFlags { FTAF_Default = 0x00, FTAF_FreeEffectIfNoSlots = 0x01, FTAF_LogFailures = 0x80, }; enum ThingMovementFlags { TMvF_Default = 0x00, TMvF_IsOnWater = 0x01, TMvF_IsOnLava = 0x02, TMvF_Unknown04 = 0x04, TMvF_Unknown08 = 0x08, TMvF_Unknown10 = 0x10, TMvF_Flying = 0x20, TMvF_Unknown40 = 0x40, TMvF_Unknown80 = 0x80, }; #pragma pack(1) struct Room; struct Thing { unsigned char alloc_flags; unsigned char state_flags; unsigned short next_on_mapblk; unsigned short prev_on_mapblk; unsigned char owner; unsigned char active_state; unsigned char continue_state; long creation_turn; struct Coord3d mappos; union { struct { long gold_carried; short health_bar_turns; } creature; struct { long gold_stored; short word_17v; } valuable; struct { short word_13; char byte_15; unsigned char byte_16; unsigned char byte_17; unsigned short word_18; } food; struct { unsigned char num_shots; long long_14t; unsigned char byte_18t; unsigned char byte_19t; } trap; struct { long number; short word_17e; unsigned char byte_19e; } price; struct { unsigned char dexterity; short damage; unsigned char hit_type; short target_idx; unsigned char byte_19; } shot; struct { short orientation; unsigned char byte_15d; short word_16d; unsigned char is_locked; unsigned char byte_19d; } door; struct { long room_idx; short word_17r; unsigned char byte_19r; } roomflag; struct { long long_13; short word_17a; }; struct { short word_13a; long long_15; }; struct { short word_13; short word_15; short word_17; }; struct { unsigned char byte_13b; short word_14; short word_16; unsigned char byte_18b; unsigned char byte_19b; }; struct { unsigned char byte_13a; long long_14; unsigned char byte_18a; unsigned char byte_19a; }; struct { unsigned char byte_13; unsigned char byte_14; unsigned char byte_15; unsigned char byte_16; unsigned char byte_17; unsigned char byte_18; unsigned char byte_19; }; }; unsigned char model; unsigned short index; short parent_idx; unsigned char class_id; unsigned char field_20; unsigned char field_21; unsigned char field_22; unsigned char field_23; unsigned char field_24; unsigned char movement_flags; struct CoordDelta3d veloc_push_once; struct CoordDelta3d veloc_base; struct CoordDelta3d veloc_push_add; struct CoordDelta3d velocity; short field_3E; long field_40; unsigned short anim_sprite; unsigned short sprite_size; unsigned char field_48; unsigned char field_49; char field_4A; unsigned short field_4B; unsigned short field_4D; unsigned char field_4F; unsigned char field_50; unsigned char field_51; short move_angle_xy; short move_angle_z; unsigned short clipbox_size_xy; unsigned short clipbox_size_yz; unsigned short solid_size_xy; unsigned short field_5C; short health; unsigned short field_60; unsigned short light_id; short ccontrol_idx; unsigned char snd_emitter_id; short next_of_class; short prev_of_class; }; #pragma pack() struct Thing *allocate_free_thing_structure_f(unsigned char a1, const char *func_name); TbBool i_can_allocate_free_thing_structure(unsigned char allocflags); void delete_thing_structure_f(struct Thing *thing, long a2, const char *func_name); TbBool is_in_free_things_list(long tng_idx); struct Thing *thing_get_f(long tng_idx, const char *func_name); TbBool thing_exists_idx(long tng_idx); TbBool thing_exists(const struct Thing *thing); short thing_is_invalid(const struct Thing *thing); long thing_get_index(const struct Thing *thing); TbBool thing_is_dragged_or_pulled(const struct Thing *thing); struct PlayerInfo *get_player_thing_is_controlled_by(const struct Thing *thing); void set_thing_draw(struct Thing *thing, long anim, long speed, long scale, char a5, char start_frame, unsigned char a7); enum ThingClassIndex { TCls_Empty = 0, TCls_Object = 1, TCls_Shot = 2, TCls_EffectElem = 3, TCls_DeadCreature = 4, TCls_Creature = 5, TCls_Effect = 6, TCls_EffectGen = 7, TCls_Trap = 8, TCls_Door = 9, TCls_Unkn10 = 10, TCls_Unkn11 = 11, TCls_AmbientSnd = 12, TCls_CaveIn = 13, }; enum ThingListIndex { TngList_Creatures = 0, TngList_Shots = 1, TngList_Objects = 2, TngList_EffectElems = 3, TngList_DeadCreatrs = 4, TngList_Effects = 5, TngList_EffectGens = 6, TngList_Traps = 7, TngList_Doors = 8, TngList_AmbientSnds = 9, TngList_CaveIns = 10, TngList_StaticLights = 11, TngList_DynamLights = 12, }; enum ThingUpdateFuncReturns { TUFRet_Deleted = -1, TUFRet_Unchanged = 0, TUFRet_Modified = 1, }; enum CreatureSelectCriteria { CSelCrit_Any = 0, CSelCrit_MostExperienced = 1, CSelCrit_MostExpWandering = 2, CSelCrit_MostExpWorking = 3, CSelCrit_MostExpFighting = 4, CSelCrit_LeastExperienced = 5, CSelCrit_LeastExpWandering = 6, CSelCrit_LeastExpWorking = 7, CSelCrit_LeastExpFighting = 8, CSelCrit_NearOwnHeart = 9, CSelCrit_NearEnemyHeart = 10, CSelCrit_OnEnemyGround = 11, CSelCrit_OnFriendlyGround = 12, }; enum HitTargetFlagsList { HitTF_None = 0x00000000, HitTF_EnemyCreatures = 0x00000001, HitTF_AlliedCreatures = 0x00000002, HitTF_OwnedCreatures = 0x00000004, HitTF_ArmourAffctdCreatrs = 0x00000008, HitTF_PreventDmgCreatrs = 0x00000010, HitTF_EnemyShotsCollide = 0x00000400, HitTF_AlliedShotsCollide = 0x00000800, HitTF_OwnedShotsCollide = 0x00001000, HitTF_EnemySoulContainer = 0x00002000, HitTF_AlliedSoulContainer = 0x00004000, HitTF_OwnedSoulContainer = 0x00008000, HitTF_AnyWorkshopBoxes = 0x00040000, HitTF_AnySpellbooks = 0x00080000, HitTF_AnyDnSpecialBoxes = 0x00100000, HitTF_AnyGoldHoards = 0x00200000, HitTF_AnyFoodObjects = 0x00400000, HitTF_AnyGoldPiles = 0x00800000, HitTF_AnyDecorations = 0x01000000, HitTF_EnemyDeployedDoors = 0x02000000, HitTF_AlliedDeployedDoors = 0x04000000, HitTF_OwnedDeployedDoors = 0x08000000, HitTF_EnemyDeployedTraps = 0x10000000, HitTF_AlliedDeployedTraps = 0x20000000, HitTF_OwnedDeployedTraps = 0x40000000, HitTF_CreatureDeadBodies = 0x80000000, }; #pragma pack(1) struct PlayerInfo; struct Thing; struct CompoundTngFilterParam; struct Dungeon; struct Map; typedef struct CompoundTngFilterParam * MaxTngFilterParam; typedef struct CompoundTngFilterParam * ModTngFilterParam; typedef long (*Thing_State_Func)(struct Thing *); typedef TngUpdateRet (*Thing_Class_Func)(struct Thing *); typedef TngUpdateRet (*Thing_Modifier_Func)(struct Thing *, ModTngFilterParam); typedef long (*Thing_Filter)(const struct Thing *, FilterParam); typedef TbBool (*Thing_Bool_Filter)(const struct Thing *); typedef long (*Thing_Maximizer_Filter)(const struct Thing *, MaxTngFilterParam, long); typedef long (*Thing_Collide_Func)(const struct Thing *, const struct Thing *, long, long); typedef TbBool (*Thing_Bool_Modifier)(struct Thing *); struct CompoundTngFilterParam { long plyr_idx; long class_id; long model_id; union { long num1; void *ptr1; }; union { long num2; void *ptr2; }; union { long num3; void *ptr3; }; }; struct StructureList { unsigned long count; unsigned long index; }; struct Things { struct Thing *lookup[2048]; struct Thing *end; }; #pragma pack() extern Thing_Class_Func class_functions[]; extern unsigned long thing_create_errors; void add_thing_to_list(struct Thing *thing, struct StructureList *list); void remove_thing_from_list(struct Thing *thing, struct StructureList *slist); void remove_thing_from_its_class_list(struct Thing *thing); void add_thing_to_its_class_list(struct Thing *thing); ThingIndex get_thing_class_list_head(ThingClass class_id); struct StructureList *get_list_for_thing_class(ThingClass class_id); long creature_near_filter_is_enemy_of_and_not_specdigger(const struct Thing *thing, FilterParam val); long creature_near_filter_is_owned_by(const struct Thing *thing, FilterParam val); struct Thing *get_player_list_creature_with_filter(ThingIndex thing_idx, Thing_Maximizer_Filter filter, MaxTngFilterParam param); struct Thing *get_player_list_random_creature_with_filter(ThingIndex thing_idx, Thing_Maximizer_Filter filter, MaxTngFilterParam param); long count_player_list_creatures_with_filter(long thing_idx, Thing_Maximizer_Filter filter, MaxTngFilterParam param); long count_player_list_creatures_of_model_matching_bool_filter(PlayerNumber plyr_idx, int tngmodel, Thing_Bool_Filter matcher_cb); struct Thing *get_player_list_nth_creature_of_model(long thing_idx, ThingModel crmodel, long crtr_idx); struct Thing *get_player_list_nth_creature_of_model_on_territory(long thing_idx, ThingModel crmodel, long crtr_idx, int friendly); struct Thing *get_random_players_creature_of_model(PlayerNumber plyr_idx, ThingModel crmodel); struct Thing *get_random_players_creature_of_model_on_territory(PlayerNumber plyr_idx, ThingModel crmodel,int friendly); struct Thing *find_players_highest_level_creature_of_breed_and_gui_job(long crmodel, long job_idx, PlayerNumber plyr_idx, unsigned char pick_check); struct Thing *find_players_lowest_level_creature_of_breed_and_gui_job(long crmodel, long job_idx, PlayerNumber plyr_idx, unsigned char pick_check); long do_to_players_all_creatures_of_model(PlayerNumber plyr_idx, int crmodel, Thing_Bool_Modifier do_cb); TbBool heal_completely_all_players_creatures(PlayerNumber plyr_idx, ThingModel crmodel); void setup_all_player_creatures_and_diggers_leave_or_die(PlayerNumber plyr_idx); TbBool reset_all_players_creatures_affected_by_cta(PlayerNumber plyr_idx); long count_player_creatures_not_counting_to_total(PlayerNumber plyr_idx); long count_player_diggers_not_counting_to_total(PlayerNumber plyr_idx); struct Thing *get_thing_on_map_block_with_filter(long thing_idx, Thing_Maximizer_Filter filter, MaxTngFilterParam param, long *maximizer); struct Thing *get_thing_near_revealed_map_block_with_filter(MapCoord x, MapCoord y, Thing_Maximizer_Filter filter, MaxTngFilterParam param); struct Thing *get_thing_spiral_near_map_block_with_filter(MapCoord x, MapCoord y, long spiral_len, Thing_Maximizer_Filter filter, MaxTngFilterParam param); long count_things_spiral_near_map_block_with_filter(MapCoord x, MapCoord y, long spiral_len, Thing_Maximizer_Filter filter, MaxTngFilterParam param); long do_to_things_on_map_block(long thing_idx, Thing_Bool_Modifier do_cb); long do_to_things_with_param_on_map_block(ThingIndex thing_idx, Thing_Modifier_Func do_cb, ModTngFilterParam param); long do_to_things_spiral_near_map_block(MapCoord x, MapCoord y, long spiral_len, Thing_Bool_Modifier do_cb); long do_to_things_with_param_spiral_near_map_block(const struct Coord3d *center_pos, MapCoordDelta max_dist, Thing_Modifier_Func do_cb, ModTngFilterParam param); long do_to_things_with_param_around_map_block(const struct Coord3d *center_pos, Thing_Modifier_Func do_cb, ModTngFilterParam param); struct Thing *get_creature_near_but_not_specdigger(MapCoord pos_x, MapCoord pos_y, PlayerNumber plyr_idx); struct Thing *get_creature_near_who_is_enemy_of_and_not_specdigger(MapCoord pos_x, MapCoord pos_y, PlayerNumber plyr_idx); struct Thing *get_creature_near_to_be_keeper_power_target(MapCoord pos_x, MapCoord pos_y, PowerKind pwmodel, PlayerNumber plyr_idx); struct Thing *get_nearest_thing_for_slap(PlayerNumber plyr_idx, MapCoord pos_x, MapCoord pos_y); struct Thing *get_creature_near_and_owned_by(MapCoord pos_x, MapCoord pos_y, PlayerNumber plyr_idx); struct Thing *get_creature_in_range_and_owned_by_or_allied_with(MapCoord pos_x, MapCoord pos_y, MapSubtlDelta distance_stl, PlayerNumber plyr_idx); struct Thing *get_creature_in_range_of_model_owned_and_controlled_by(MapCoord pos_x, MapCoord pos_y, MapSubtlDelta distance_stl, long crmodel, PlayerNumber plyr_idx); struct Thing *get_creature_in_range_who_is_enemy_of_able_to_attack_and_not_specdigger(MapCoord pos_x, MapCoord pos_y, long distance_stl, PlayerNumber plyr_idx); struct Thing *get_creature_of_model_training_at_subtile_and_owned_by(MapSubtlCoord stl_x, MapSubtlCoord stl_y, long model_id, PlayerNumber plyr_idx, long skip_thing_id); struct Thing *get_object_at_subtile_of_model_and_owned_by(MapSubtlCoord stl_x, MapSubtlCoord stl_y, long tngmodel, PlayerNumber plyr_idx); struct Thing *get_cavein_at_subtile_owned_by(MapSubtlCoord stl_x, MapSubtlCoord stl_y, PlayerNumber plyr_idx); struct Thing *get_object_around_owned_by_and_matching_bool_filter(MapCoord pos_x, MapCoord pos_y, PlayerNumber plyr_idx, Thing_Bool_Filter matcher_cb); struct Thing *get_food_at_subtile_available_to_eat_and_owned_by(MapSubtlCoord stl_x, MapSubtlCoord stl_y, long plyr_idx); struct Thing *get_trap_at_subtile_of_model_and_owned_by(MapSubtlCoord stl_x, MapSubtlCoord stl_y, long model, long plyr_idx); struct Thing *get_trap_around_of_model_and_owned_by(MapCoord pos_x, MapCoord pos_y, long model, PlayerNumber plyr_idx); struct Thing *get_door_for_position(MapSubtlCoord stl_x, MapSubtlCoord stl_y); TbBool slab_has_door_thing_on(MapSlabCoord slb_x, MapSlabCoord slb_y); struct Thing *get_nearest_object_at_position(MapSubtlCoord stl_x, MapSubtlCoord stl_y); void remove_dead_creatures_from_slab(MapSlabCoord slb_x, MapSlabCoord slb_y); long count_creatures_near_and_owned_by_or_allied_with(MapCoord pos_x, MapCoord pos_y, long distance_stl, PlayerNumber plyr_idx); long switch_owned_objects_on_destoyed_slab_to_neutral(MapSlabCoord slb_x, MapSlabCoord slb_y, PlayerNumber prev_owner); struct Thing *get_random_thing_of_class_with_filter(Thing_Maximizer_Filter filter, MaxTngFilterParam param); struct Thing *get_nth_thing_of_class_with_filter(Thing_Maximizer_Filter filter, MaxTngFilterParam param, long tngindex); long count_things_of_class_with_filter(Thing_Maximizer_Filter filter, MaxTngFilterParam param); long do_to_all_things_of_class_and_model(int tngclass, int tngmodel, Thing_Bool_Modifier do_cb); struct Thing *get_nearest_object_owned_by_and_matching_bool_filter(MapCoord pos_x, MapCoord pos_y, PlayerNumber plyr_idx, Thing_Bool_Filter matcher_cb); struct Thing *get_nearest_thing_of_class_and_model_owned_by(MapCoord pos_x, MapCoord pos_y, PlayerNumber plyr_idx, int tngclass, int tngmodel); struct Thing *get_random_trap_of_model_owned_by_and_armed(ThingModel tngmodel, PlayerNumber plyr_idx, TbBool armed); struct Thing *get_random_door_of_model_owned_by_and_locked(ThingModel tngmodel, PlayerNumber plyr_idx, TbBool locked); struct Thing *find_gold_laying_in_dungeon(const struct Dungeon *dungeon); struct Thing *get_nearest_enemy_creature_possible_to_attack_by(struct Thing *creatng); struct Thing *get_highest_score_enemy_creature_within_distance_possible_to_attack_by(struct Thing *creatng, MapCoordDelta dist); struct Thing *get_nth_creature_owned_by_and_matching_bool_filter(PlayerNumber plyr_idx, Thing_Bool_Filter matcher_cb, long n); struct Thing *get_nth_creature_owned_by_and_failing_bool_filter(PlayerNumber plyr_idx, Thing_Bool_Filter matcher_cb, long n); long count_creatures_in_dungeon_of_model_flags(const struct Dungeon *dungeon, unsigned long need_mdflags, unsigned long excl_mdflags); long count_creatures_in_dungeon_controlled_and_of_model_flags(const struct Dungeon *dungeon, unsigned long need_mdflags, unsigned long excl_mdflags); unsigned long update_things_sounds_in_list(struct StructureList *list); void stop_all_things_playing_samples(void); unsigned long update_cave_in_things(void); unsigned long update_creatures_not_in_list(void); unsigned long update_things_in_list(struct StructureList *list); void init_player_start(struct PlayerInfo *player, TbBool keep_prev); void setup_computer_players(void); void setup_zombie_players(void); void init_all_creature_states(void); TbBool perform_action_on_all_creatures_in_group(struct Thing *thing, Thing_Bool_Modifier action); long creature_of_model_in_prison_or_tortured(ThingModel crmodel); long count_player_creatures_of_model(PlayerNumber plyr_idx, int crmodel); long count_player_list_creatures_of_model(long thing_idx, ThingModel crmodel); long count_player_list_creatures_of_model_on_territory(long thing_idx, ThingModel crmodel, int friendly); GoldAmount compute_player_payday_total(const struct Dungeon *dungeon); TbBool lord_of_the_land_in_prison_or_tortured(void); struct Thing *lord_of_the_land_find(void); long electricity_affecting_area(const struct Coord3d *pos, PlayerNumber immune_plyr_idx, long range, long max_damage); void update_things(void); struct Thing *find_base_thing_on_mapwho(ThingClass oclass, ThingModel okind, MapSubtlCoord stl_x, MapSubtlCoord stl_y); void remove_thing_from_mapwho(struct Thing *thing); void place_thing_in_mapwho(struct Thing *thing); struct Thing *find_hero_gate_of_number(long num); long get_free_hero_gate_number(void); struct Thing *find_creature_lair_totem_at_subtile(MapSubtlCoord stl_x, MapSubtlCoord stl_y, ThingModel crmodel); TbBool thing_is_shootable(const struct Thing *thing, PlayerNumber shot_owner, HitTargetFlags hit_targets); unsigned long hit_type_to_hit_targets(long hit_type); long collide_filter_thing_is_of_type(const struct Thing *thing, const struct Thing *sectng, long a3, long a4); TbBool imp_already_digging_at_excluding(struct Thing *excltng, MapSubtlCoord stl_x, MapSubtlCoord stl_y); TbBool gold_pile_with_maximum_at_xy(MapSubtlCoord stl_x, MapSubtlCoord stl_y); struct Thing *smallest_gold_pile_at_xy(MapSubtlCoord stl_x, MapSubtlCoord stl_y); TbBool update_speed_of_player_creatures_of_model(PlayerNumber plyr_idx, int crmodel); TbBool apply_anger_to_all_players_creatures_excluding(PlayerNumber plyr_idx, long anger, long reason, const struct Thing *excltng); void break_mapwho_infinite_chain(const struct Map *mapblk); TbBool update_thing(struct Thing *thing); TbBigChecksum get_thing_checksum(const struct Thing *thing); short update_thing_sound(struct Thing *thing); #pragma pack(1) enum DoorStates { DorSt_Unused = 0, DorSt_Open, DorSt_Closed, DorSt_Opening, DorSt_Closing, DorSt_Unknown05, }; struct Thing; struct DoorStats { unsigned short slbkind; long health; unsigned short field_6; }; __attribute__((dllimport)) extern struct DoorStats _DK_door_stats[5][2]; __attribute__((dllimport)) extern unsigned char _DK_door_to_object[5]; #pragma pack() TbBool subtile_has_door_thing_on(MapSubtlCoord stl_x, MapSubtlCoord stl_y); TbBool subtile_has_locked_door(MapSubtlCoord stl_x, MapSubtlCoord stl_y); struct Thing *create_door(struct Coord3d *pos, unsigned short a1, unsigned char a2, unsigned short a3, unsigned char a4); TbBool thing_is_deployed_door(const struct Thing *thing); void lock_door(struct Thing *thing); void unlock_door(struct Thing *thing); long destroy_door(struct Thing *thing); TngUpdateRet process_door(struct Thing *thing); char find_door_angle(MapSubtlCoord stl_x, MapSubtlCoord stl_y, PlayerNumber plyr_idx); TbBool player_has_deployed_door_of_model(PlayerNumber owner, int model, short locked); long count_player_deployed_doors_of_model(PlayerNumber owner, int model); TbBool player_has_deployed_trap_of_model(PlayerNumber owner, int model); long count_player_deployed_traps_of_model(PlayerNumber owner, int model); #pragma pack(1) struct LevelStats { unsigned long things_researched; unsigned long field_4; unsigned long field_8; unsigned long field_C; unsigned long field_10; unsigned long field_14; unsigned long field_18; unsigned long field_1C; unsigned long field_20; unsigned long field_24; unsigned long field_28; unsigned long field_2C; unsigned long field_30; unsigned long field_34; unsigned long field_38; unsigned long field_3C; unsigned long field_40; unsigned long field_44; unsigned long field_48; unsigned long field_4C; unsigned long field_50; unsigned long field_54; unsigned long field_58; unsigned long field_5C; unsigned long field_60; unsigned long field_64; unsigned long field_68; unsigned long field_6C; unsigned long field_70; unsigned long field_74; unsigned long field_78; unsigned long field_7C; unsigned long field_80; unsigned long field_84; unsigned long field_88; unsigned long gold_mined; unsigned long field_90; unsigned long manufactured_doors; unsigned long manufactured_traps; unsigned long manufactured_items; unsigned long start_time; unsigned long end_time; unsigned long creatures_trained; unsigned long creatures_tortured; unsigned long creatures_sacrificed; unsigned long creatures_converted; unsigned long creatures_summoned; unsigned long num_slaps; unsigned long num_caveins; unsigned long bridges_built; unsigned long rock_dug_out; unsigned long salary_cost; unsigned long flies_killed_by_spiders; unsigned long territory_destroyed; unsigned long territory_lost; unsigned long rooms_constructed; unsigned long traps_used; unsigned long traps_armed; unsigned long doors_used; unsigned long keepers_destroyed; unsigned long area_claimed; unsigned long backs_stabbed; unsigned long chickens_hatched; unsigned long chickens_eaten; unsigned long chickens_wasted; unsigned long promises_broken; unsigned long ghosts_raised; unsigned long skeletons_raised; unsigned long friendly_kills; unsigned long lies_told; unsigned long creatures_annoyed; unsigned long graveyard_bodys; unsigned long vamps_created; unsigned long num_creatures; unsigned long imps_deployed; unsigned long battles_won; unsigned long battles_lost; unsigned long money; unsigned long dngn_breached_count; unsigned long doors_destroyed; unsigned long rooms_destroyed; unsigned long dungeon_area; unsigned long ideas_researched; unsigned long creatures_scavenged; unsigned long creatures_from_sacrifice; unsigned long spells_stolen; unsigned long gold_pots_stolen; unsigned long average_room_efficiency; unsigned long player_rating; unsigned long player_style; unsigned long doors_unused; unsigned long traps_unused; unsigned long num_rooms; unsigned long gameplay_time; unsigned long num_entrances; unsigned long hopes_dashed; unsigned long allow_save_score; unsigned long player_score; }; #pragma pack() long update_dungeons_scores(void); TbBool load_stats_files(void); #pragma pack(1) struct Thing; enum ThingPickFlags { TPF_PickableCheck = 0x01, TPF_OrderedPick = 0x02, TPF_ReverseOrder = 0x04, }; enum CreatureDeathFlags { CrDed_Default = 0x00, CrDed_NoEffects = 0x01, CrDed_DiedInBattle = 0x02, CrDed_NoUnconscious = 0x04, CrDed_NotReallyDying = 0x08, }; struct CreatureStorage { unsigned char model; unsigned char explevel; }; #pragma pack() extern struct TbSprite *swipe_sprites; extern struct TbSprite *end_swipe_sprites; extern int creature_swap_idx[32]; extern unsigned long creature_create_errors; struct Thing *create_creature(struct Coord3d *pos, ThingModel model, PlayerNumber owner); long move_creature(struct Thing *thing); TbBool kill_creature(struct Thing *creatng, struct Thing *killertng, PlayerNumber killer_plyr_idx, CrDeathFlags flags); TbBool kill_creature_compat(struct Thing *creatng, struct Thing *killertng, PlayerNumber killer_plyr_idx, TbBool no_effects, TbBool died_in_battle, TbBool disallow_unconscious); void update_creature_count(struct Thing *thing); TngUpdateRet process_creature_state(struct Thing *thing); TbBool create_random_evil_creature(MapCoord x, MapCoord y, PlayerNumber owner, CrtrExpLevel max_lv); TbBool create_random_hero_creature(MapCoord x, MapCoord y, PlayerNumber owner, CrtrExpLevel max_lv); TbBool create_owned_special_digger(MapCoord x, MapCoord y, PlayerNumber owner); TbBool creature_increase_level(struct Thing *thing); TbBool creature_increase_multiple_levels(struct Thing *thing, int count); void set_creature_level(struct Thing *thing, long nlvl); void init_creature_level(struct Thing *thing, long nlev); long get_creature_speed(const struct Thing *thing); TbBool control_creature_as_controller(struct PlayerInfo *player, struct Thing *thing); TbBool control_creature_as_passenger(struct PlayerInfo *player, struct Thing *thing); void leave_creature_as_controller(struct PlayerInfo *player, struct Thing *thing); long get_human_controlled_creature_target(struct Thing *thing, long a2); struct Thing *get_creature_near_for_controlling(unsigned char a1, long a2, long a3); TbBool load_swipe_graphic_for_creature(const struct Thing *thing); void free_swipe_graphic(void); void draw_swipe_graphic(void); long creature_available_for_combat_this_turn(struct Thing *thing); TbBool set_creature_object_combat(struct Thing *crthing, struct Thing *obthing); TbBool set_creature_door_combat(struct Thing *crthing, struct Thing *obthing); void creature_fire_shot(struct Thing *firing,struct Thing *target, ThingModel shot_model, char a2, unsigned char hit_type); void creature_cast_spell_at_thing(struct Thing *caster, struct Thing *target, long a3, long a4); void creature_cast_spell(struct Thing *caster, long trg_x, long trg_y, long a4, long a5); unsigned int get_creature_blocked_flags_at(struct Thing *thing, struct Coord3d *newpos); struct Thing *get_enemy_soul_container_creature_can_see(struct Thing *thing); TbBool thing_can_be_eaten(struct Thing *thing); void food_eaten_by_creature(struct Thing *foodtng, struct Thing *creatng); short creature_take_wage_from_gold_pile(struct Thing *crthing,struct Thing *obthing); struct Thing *get_creature_near(unsigned short pos_x, unsigned short pos_y); struct Thing *get_creature_near_with_filter(unsigned short pos_x, unsigned short pos_y, Thing_Filter filter, FilterParam param); void anger_apply_anger_to_creature_f(struct Thing *thing, long anger, AnnoyMotive reason, long a3, const char *func_name); HitPoints apply_damage_to_thing_and_display_health(struct Thing *thing, HitPoints dmg, DamageType damage_type, PlayerNumber inflicting_plyr_idx); void process_creature_standing_on_corpses_at(struct Thing *thing, struct Coord3d *pos); long creature_instance_has_reset(const struct Thing *thing, long a2); void set_creature_instance(struct Thing *thing, CrInstance inst_idx, long a2, long targtng_idx, const struct Coord3d *pos); unsigned short find_next_annoyed_creature(unsigned char a1, unsigned short a2); void draw_creature_view(struct Thing *thing); TbBool creature_is_for_dungeon_diggers_list(const struct Thing *creatng); TbBool creature_kind_is_for_dungeon_diggers_list(PlayerNumber plyr_idx, ThingModel crmodel); void set_first_creature(struct Thing *thing); void remove_first_creature(struct Thing *thing); long player_list_creature_filter_needs_to_be_placed_in_room_for_job(const struct Thing *thing, MaxTngFilterParam param, long maximizer); TbBool creature_has_lair_room(const struct Thing *creatng); struct Room *get_creature_lair_room(const struct Thing *creatng); TbBool remove_creature_lair(struct Thing *thing); TbBool creature_affected_by_spell(const struct Thing *thing, SpellKind spkind); TbBool creature_affected_by_slap(const struct Thing *thing); void apply_spell_effect_to_thing(struct Thing *thing, SpellKind spell_idx, long spell_lev); void terminate_thing_spell_effect(struct Thing *thing, SpellKind spkind); void process_thing_spell_effects(struct Thing *thing); void process_thing_spell_effects_while_blocked(struct Thing *thing); void delete_effects_attached_to_creature(struct Thing *creatng); TbBool thing_affected_by_spell(const struct Thing *thing, SpellKind spkind); GameTurnDelta get_spell_duration_left_on_thing_f(const struct Thing *thing, SpellKind spkind, const char *func_name); void anger_set_creature_anger_all_types(struct Thing *thing, long a2); void change_creature_owner(struct Thing *thing, PlayerNumber nowner); struct Thing *find_players_next_creature_of_breed_and_gui_job(long breed_idx, long job_idx, PlayerNumber plyr_idx, unsigned char pick_flags); struct Thing *pick_up_creature_of_model_and_gui_job(long breed_idx, long job_idx, PlayerNumber owner, unsigned char pick_flags); void go_to_next_creature_of_model_and_gui_job(long crmodel, long job_idx); struct Thing *find_players_creature_dragging_thing(PlayerNumber plyr_idx, const struct Thing *dragtng); struct Thing *find_creature_dragging_thing(const struct Thing *dragtng); struct Thing *find_players_highest_score_creature_in_fight_not_affected_by_spell(PlayerNumber plyr_idx, PowerKind pwkind); int claim_neutral_creatures_in_sight(struct Thing *creatng, struct Coord3d *pos, int can_see_slabs); TbBool change_creature_owner_if_near_dungeon_heart(struct Thing *creatng); void init_creature_scores(void); long get_creature_thing_score(const struct Thing *thing); TbBool add_creature_score_to_owner(struct Thing *thing); TbBool remove_creature_score_from_owner(struct Thing *thing); long calculate_melee_damage(const struct Thing *thing); long project_melee_damage(const struct Thing *thing); long calculate_shot_damage(const struct Thing *thing, ThingModel shot_model); long project_creature_shot_damage(const struct Thing *thing, ThingModel shot_model); long update_creature_levels(struct Thing *thing); TngUpdateRet update_creature(struct Thing *thing); TbBool creature_stats_debug_dump(void); TbBool thing_is_creature(const struct Thing *thing); TbBool thing_is_dead_creature(const struct Thing *thing); TbBool thing_is_creature_special_digger(const struct Thing *thing); TbBool creature_is_slappable(const struct Thing *thing, PlayerNumber plyr_idx); TbBool creature_is_invisible(const struct Thing *thing); TbBool creature_can_see_invisible(const struct Thing *thing); int get_creature_health_permil(const struct Thing *thing); enum RoomFlags { RoF_Allocated = 0x01, }; enum RoomKinds { RoK_NONE = 0, RoK_ENTRANCE = 1, RoK_TREASURE = 2, RoK_LIBRARY = 3, RoK_PRISON = 4, RoK_TORTURE = 5, RoK_TRAINING = 6, RoK_DUNGHEART = 7, RoK_WORKSHOP = 8, RoK_SCAVENGER = 9, RoK_TEMPLE = 10, RoK_GRAVEYARD = 11, RoK_BARRACKS = 12, RoK_GARDEN = 13, RoK_LAIR = 14, RoK_BRIDGE = 15, RoK_GUARDPOST = 16, RoK_TYPES_COUNT = 17, }; enum RoomAreaChoose { RoArC_ANY = 0, RoArC_BORDER, RoArC_CENTER, }; #pragma pack(1) struct Thing; struct Coord3d; struct Room; struct Dungeon; typedef void (*Room_Update_Func)(struct Room *); struct RoomInfo { unsigned short field_0; unsigned short field_2; unsigned short ambient_snd_smp_id; }; struct Room { unsigned char alloc_flags; unsigned short index; unsigned char owner; short prev_of_owner; short next_of_owner; unsigned char central_stl_x; unsigned char central_stl_y; unsigned short kind; unsigned short health; short total_capacity; unsigned short used_capacity; unsigned char player_interested[5]; union { struct { long capacity_used_for_storage; short hatchfield_1B; unsigned char field_1D[26]; }; struct { short prev_of_kind; short next_of_kind; unsigned char field_1Bx[28]; }; struct { unsigned char content_per_model[32]; }; struct { long hatch_gameturn; unsigned char field_1Bh[28]; }; }; unsigned short slabs_list; unsigned short slabs_list_tail; unsigned short slabs_count; unsigned short creatures_list; unsigned short efficiency; unsigned short field_41; unsigned char field_43; unsigned char flame_stl; }; struct RoomData { unsigned char assigned_slab; short medsym_sprite_idx; Room_Update_Func update_total_capacity; Room_Update_Func update_storage_in_room; Room_Update_Func update_workers_in_room; unsigned char field_F; unsigned char field_10; short field_11; short name_stridx; short tooltip_stridx; }; struct RoomStats { short cost; unsigned short health; }; struct RoomReposition { int used; ThingModel models[16]; CrtrExpLevel explevels[16]; }; __attribute__((dllimport)) extern struct RoomData _DK_room_data[]; #pragma pack() extern unsigned short const room_effect_elements[]; extern struct AroundLByte const room_spark_offset[]; extern struct RoomData room_data[]; extern RoomKind look_through_rooms[18]; struct Room *room_get(long room_idx); struct Room *subtile_room_get(MapSubtlCoord stl_x, MapSubtlCoord stl_y); struct Room *slab_room_get(long slb_x, long slb_y); TbBool room_is_invalid(const struct Room *room); TbBool room_exists(const struct Room *room); struct RoomData *room_data_get_for_kind(RoomKind rkind); struct RoomData *room_data_get_for_room(const struct Room *room); struct RoomStats *room_stats_get_for_kind(RoomKind rkind); struct RoomStats *room_stats_get_for_room(const struct Room *room); long get_room_look_through(RoomKind rkind); long compute_room_max_health(long slabs_count,unsigned short efficiency); void set_room_efficiency(struct Room *room); void set_room_capacity(struct Room *room, TbBool skip_integration); long get_room_slabs_count(PlayerNumber plyr_idx, RoomKind rkind); long get_room_kind_used_capacity_fraction(PlayerNumber plyr_idx, RoomKind room_kind); void get_room_kind_total_and_used_capacity(struct Dungeon *dungeon, RoomKind room_kind, long *total_cap, long *used_cap); TbBool thing_is_on_any_room_tile(const struct Thing *thing); TbBool thing_is_on_own_room_tile(const struct Thing *thing); struct Room *get_room_thing_is_on(const struct Thing *thing); void reinitialise_map_rooms(void); TbBool find_random_valid_position_for_thing_in_room(struct Thing *thing, struct Room *room, struct Coord3d *pos); TbBool find_first_valid_position_for_thing_anywhere_in_room(const struct Thing *thing, struct Room *room, struct Coord3d *pos); TbBool find_random_position_at_area_of_room(struct Coord3d *pos, const struct Room *room, unsigned char room_area); TbBool creature_can_get_to_any_of_players_rooms(struct Thing *thing, PlayerNumber owner); struct Room *find_room_with_spare_room_item_capacity(PlayerNumber plyr_idx, RoomKind rkind); struct Room *find_nth_room_of_owner_with_spare_item_capacity_starting_with(long room_idx, long n, long spare); struct Room *find_room_with_spare_capacity(PlayerNumber owner, RoomKind rkind, long spare); struct Room *find_nth_room_of_owner_with_spare_capacity_starting_with(long room_idx, long n, long spare); struct Room *find_room_with_most_spare_capacity_starting_with(long room_idx, long *total_spare_cap); struct Room *find_room_nearest_to_position(PlayerNumber plyr_idx, RoomKind rkind, const struct Coord3d *pos, long *room_distance); struct Room *find_room_for_thing_with_used_capacity(const struct Thing *creatng, PlayerNumber plyr_idx, RoomKind rkind, unsigned char nav_flags, long min_used_cap); struct Room *find_random_room_with_used_capacity_creature_can_navigate_to(struct Thing *thing, PlayerNumber owner, RoomKind rkind, unsigned char nav_flags); struct Room *find_nearest_room_for_thing_with_spare_capacity(struct Thing *thing, signed char owner, RoomKind rkind, unsigned char nav_flags, long spare); void create_room_flag(struct Room *room); void delete_room_flag(struct Room *room); struct Room *allocate_free_room_structure(void); unsigned short i_can_allocate_free_room_structure(void); void add_slab_to_room_tiles_list(struct Room *room, MapSlabCoord slb_x, MapSlabCoord slb_y); void remove_slab_from_room_tiles_list(struct Room *room, MapSlabCoord slb_x, MapSlabCoord slb_y); void add_slab_list_to_room_tiles_list(struct Room *room, SlabCodedCoords slb_num); void delete_all_room_structures(void); void delete_room_structure(struct Room *room); void delete_room_slabbed_objects(SlabCodedCoords slb_num); struct Room *link_adjacent_rooms_of_type(PlayerNumber owner, MapSubtlCoord x, MapSubtlCoord y, RoomKind rkind); struct Room *create_room(PlayerNumber owner, RoomKind rkind, MapSubtlCoord stl_x, MapSubtlCoord stl_y); short room_grow_food(struct Room *room); void update_room_efficiency(struct Room *room); struct Room *get_room_of_given_role_for_thing(const struct Thing *thing, const struct Dungeon *dungeon, RoomRole rrole, int needed_capacity); struct Thing *find_lair_totem_at(MapSubtlCoord stl_x, MapSubtlCoord stl_y); struct Room *place_room(PlayerNumber owner, RoomKind rkind, MapSubtlCoord stl_x, MapSubtlCoord stl_y); TbBool slab_is_area_outer_border(MapSlabCoord slb_x, MapSlabCoord slb_y); TbBool slab_is_area_inner_fill(MapSlabCoord slb_x, MapSlabCoord slb_y); MapCoordDelta get_distance_to_room(const struct Coord3d *pos, const struct Room *room); TbBool initialise_map_rooms(void); void init_room_sparks(struct Room *room); void replace_room_slab(struct Room *room, MapSlabCoord slb_x, MapSlabCoord slb_y, unsigned char owner, unsigned char a5); short delete_room_slab_when_no_free_room_structures(long a1, long a2, unsigned char a3); long calculate_room_efficiency(const struct Room *room); void kill_room_slab_and_contents(PlayerNumber plyr_idx, MapSlabCoord slb_x, MapSlabCoord slb_y); void free_room_structure(struct Room *room); void reset_creatures_rooms(struct Room *room); TbBool remove_item_from_room_capacity(struct Room *room); TbBool add_item_to_room_capacity(struct Room *room, TbBool force); TbBool room_has_enough_free_capacity_for_creature_job(const struct Room *room, const struct Thing *creatng, CreatureJob jobpref); long count_slabs_of_room_type(PlayerNumber plyr_idx, RoomKind rkind); long claim_enemy_room(struct Room *room,struct Thing *claimtng); long claim_room(struct Room *room,struct Thing *claimtng); TbBool create_effects_on_room_slabs(struct Room *room, ThingModel effkind, long effrange, PlayerNumber effowner); TbBool clear_dig_on_room_slabs(struct Room *room, PlayerNumber plyr_idx); void do_room_integration(struct Room *room); void destroy_dungeon_heart_room(PlayerNumber plyr_idx, const struct Thing *heartng); struct Room *find_nearest_room_for_thing_with_spare_item_capacity(struct Thing *thing, PlayerNumber plyr_idx, RoomKind rkind, unsigned char nav_flags); struct Room *find_random_room_for_thing(struct Thing *thing, PlayerNumber owner, RoomKind rkind, unsigned char nav_flags); struct Room * find_random_room_for_thing_with_spare_room_item_capacity(struct Thing *thing, PlayerNumber owner, RoomKind rkind, unsigned char nav_flags); struct Room * pick_random_room(PlayerNumber plyr_idx, RoomKind rkind); enum EventKinds { EvKind_Nothing = 0, EvKind_HeartAttacked, EvKind_EnemyFight, EvKind_Objective, EvKind_Breach, EvKind_NewRoomResrch, EvKind_NewCreature, EvKind_NewSpellResrch, EvKind_NewTrap, EvKind_NewDoor, EvKind_CreatrScavenged, EvKind_TreasureRoomFull, EvKind_CreaturePayday, EvKind_AreaDiscovered, EvKind_SpellPickedUp, EvKind_RoomTakenOver, EvKind_CreatrIsAnnoyed, EvKind_NoMoreLivingSet, EvKind_AlarmTriggered, EvKind_RoomUnderAttack, EvKind_NeedTreasureRoom, EvKind_Information, EvKind_RoomLost, EvKind_CreatrHungry, EvKind_TrapCrateFound, EvKind_DoorCrateFound, EvKind_DnSpecialFound, EvKind_QuickInformation, EvKind_FriendlyFight, EvKind_WorkRoomUnreachable, EvKind_StorageRoomUnreachable, }; enum EventFlags { EvF_Exists = 0x0001, EvF_BtnFirstFall = 0x0002, }; #pragma pack(1) struct Thing; struct Dungeon; struct PlayerInfo; struct Event { unsigned char flags; unsigned char index; long mappos_x; long mappos_y; unsigned char owner; unsigned char kind; long target; unsigned long lifespan_turns; unsigned char falling_button; }; struct Bookmark { unsigned char x; unsigned char y; unsigned char flags; }; #pragma pack() extern struct EventTypeInfo event_button_info[31]; struct Event *get_event_of_type_for_player(EventKind evkind, PlayerNumber plyr_idx); struct Event *get_event_of_target_and_type_for_player(long target, EventKind evkind, PlayerNumber plyr_idx); struct Event *get_event_nearby_of_type_for_player(MapCoord map_x, MapCoord map_y, long max_dist, EventKind evkind, PlayerNumber plyr_idx); TbBool event_is_invalid(const struct Event *event); EventIndex event_create_event_or_update_nearby_existing_event(MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, long target); EventIndex event_create_event_or_update_same_target_existing_event(MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, long target); EventIndex event_create_event_or_update_old_event(MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, long target); void event_initialise_all(void); long event_move_player_towards_event(struct PlayerInfo *player, long var); struct Event *event_create_event(MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, long msg_id); struct Event *event_allocate_free_event_structure(void); void event_initialise_event(struct Event *event, MapCoord map_x, MapCoord map_y, EventKind evkind, unsigned char dngn_id, long msg_id); void event_add_to_event_buttons_list(struct Event *event, struct Dungeon *dungeon); void event_add_to_event_buttons_list_or_replace_button(struct Event *event, struct Dungeon *dungeon); void event_update_on_battle_removal(void); void event_delete_event(long plridx, EventIndex evidx); void event_update_last_use(struct Event *event); void go_on_then_activate_the_event_box(PlayerNumber plyr_idx, EventIndex evidx); int event_get_button_index(const struct Dungeon *dungeon, EventIndex evidx); void clear_events(void); void remove_events_thing_is_attached_to(struct Thing *thing); struct Thing *event_is_attached_to_thing(EventIndex evidx); void maintain_my_event_list(struct Dungeon *dungeon); void kill_oldest_my_event(struct Dungeon *dungeon); void event_kill_all_players_events(long plyr_idx); void event_process_events(void); void update_all_events(void); #pragma pack(1) struct Dungeon; struct MapTask { unsigned char kind; unsigned short coords; }; #pragma pack() extern struct MapTask bad_map_task; struct MapTask *get_task_list_entry(long plyr_idx, long task_idx); struct MapTask *get_dungeon_task_list_entry(struct Dungeon *dungeon, long task_idx); void add_task_list_entry(PlayerNumber plyr_idx, unsigned char kind, SubtlCodedCoords stl_num); TbBool task_list_entry_invalid(struct MapTask *task); long find_from_task_list(PlayerNumber plyr_idx, SubtlCodedCoords srch_tsk); long find_from_task_list_by_slab(PlayerNumber plyr_idx, MapSlabCoord slb_x, MapSlabCoord slb_y); long find_from_task_list_by_subtile(PlayerNumber plyr_idx, MapSlabCoord stl_x, MapSlabCoord stl_y); long find_dig_from_task_list(PlayerNumber plyr_idx, SubtlCodedCoords srch_tsk); long remove_from_task_list(long a1, long a2); long find_next_dig_in_dungeon_task_list(struct Dungeon *dungeon, long last_dig); #pragma pack(1) enum ThingTrapModels { TngTrp_None = 0, TngTrp_Unknown01, TngTrp_Unknown02, TngTrp_Unknown03, TngTrp_Unknown04, TngTrp_Unknown05, TngTrp_Unknown06, TngTrp_Unknown07, TngTrp_Unknown08, TngTrp_Unknown09, TngTrp_Unknown10, }; struct Thing; struct TrapStats { unsigned long field_0; unsigned long sprite_anim_idx; unsigned long sprite_size_max; unsigned char field_C; unsigned long anim_speed; unsigned char field_11; unsigned char field_12; unsigned char field_13; short size_xy; short field_16; unsigned char trigger_type; unsigned char activation_type; unsigned char created_itm_model; unsigned char field_1B; short field_1C; unsigned char field_1E; unsigned char field_1F; unsigned char field_20[8]; unsigned char field_28[8]; short field_30; short field_32; short field_34; }; __attribute__((dllimport)) extern unsigned char _DK_trap_to_object[8]; __attribute__((dllimport)) struct TrapStats _DK_trap_stats[7]; #pragma pack() TbBool slab_has_trap_on(MapSlabCoord slb_x, MapSlabCoord slb_y); TbBool can_place_trap_on(PlayerNumber plyr_idx, MapSubtlCoord stl_x, MapSubtlCoord stl_y); TbBool destroy_trap(struct Thing *thing); struct Thing *create_trap(struct Coord3d *pos, ThingModel trpkind, PlayerNumber plyr_idx); struct Thing *get_trap_for_position(MapSubtlCoord stl_x, MapSubtlCoord stl_y); struct Thing *get_trap_for_slab_position(MapSlabCoord slb_x, MapSlabCoord slb_y); TbBool trap_is_active(const struct Thing *thing); TbBool trap_is_slappable(const struct Thing *thing, PlayerNumber plyr_idx); TbBool thing_is_deployed_trap(const struct Thing *thing); TbBool rearm_trap(struct Thing *traptng); TngUpdateRet update_trap(struct Thing *thing); void init_traps(void); void activate_trap(struct Thing *traptng, struct Thing *creatng); long remove_traps_around_subtile(MapSubtlCoord stl_x, MapSubtlCoord stl_y, long *sell_value); void external_activate_trap_shot_at_angle(struct Thing *thing, long a2); TbBool tag_cursor_blocks_place_trap(PlayerNumber plyr_idx, MapSubtlCoord stl_x, MapSubtlCoord stl_y); enum CreatureGUIJob { CrGUIJob_Any =-1, CrGUIJob_Wandering = 0, CrGUIJob_Working = 1, CrGUIJob_Fighting = 2, }; enum DungeonCreatureTendencies { CrTend_None = 0, CrTend_Imprison = 1, CrTend_Flee = 2, }; enum DungeonResearchCategory { RsCat_None = 0, RsCat_Power = 1, RsCat_Room = 2, RsCat_Creature = 3, }; enum DungeonManufactureBuildFlags { MnfBldF_Manufacturable = 0x01, MnfBldF_Built = 0x02, MnfBldF_Used = 0x04, }; #pragma pack(1) struct DiggerStack { unsigned short stl_num; SpDiggerTaskType task_type; }; struct ResearchVal { unsigned char rtyp; unsigned char rkind; long req_amount; }; struct TurnTimer { unsigned long count; unsigned char state; }; struct Dungeon { unsigned short dnheart_idx; struct Coord3d mappos; unsigned char creature_tendencies; unsigned char field_9; unsigned char computer_enabled; unsigned short room_kind[17]; short creatr_list_start; short digger_list_start; short field_31; short things_in_hand[8]; short field_43; int field_45; int field_49; int field_4D; short field_51; short field_53; int field_55; int field_59; int field_5D; short field_61; unsigned char num_things_in_hand; unsigned short field_64[32][15]; unsigned short guijob_all_creatrs_count[32][3]; unsigned short guijob_angry_creatrs_count[32][3]; short field_5A4[9]; unsigned char trap_amount_offmap[7]; unsigned char door_amount_offmap[5]; unsigned char room_slabs_count[17 +1]; int sight_casted_gameturn; short sight_casted_thing_idx; unsigned char sight_casted_splevel; unsigned char sight_casted_stl_x; unsigned char sight_casted_stl_y; unsigned char soe_explored_flags[2*13][2*13]; unsigned char cta_stl_x; unsigned char cta_stl_y; unsigned char cta_splevel; unsigned long cta_start_turn; unsigned long must_obey_turn; int hold_audience_cast_turn; int scavenge_counters_turn; unsigned char creatures_scavenging[32]; unsigned char creatures_praying[32]; unsigned char chickens_sacrificed; unsigned char gold_piles_sacrificed; unsigned char creature_sacrifice[32]; unsigned char creature_sacrifice_exp[32]; unsigned char field_916[2]; unsigned char num_active_diggers; unsigned char num_active_creatrs; unsigned char owned_creatures_of_model[32]; unsigned char total_rooms; unsigned short total_doors; unsigned short total_area; unsigned short total_creatures_left; int field_941; int doors_destroyed; short room_manage_area; short creatures_scavenged[32]; short creatures_scavenge_gain; short creatures_scavenge_lost; long scavenge_turn_points[32]; short scavenge_targets[32]; int creature_max_level[32]; unsigned short creatures_annoyed; unsigned short battles_lost; unsigned short battles_won; unsigned short rooms_destroyed; unsigned short spells_stolen; unsigned short times_broken_into; unsigned short gold_pots_stolen; int last_entrance_generation_gameturn; int turns_between_entrance_generation; int field_AE5; int manage_score; int total_score; unsigned long max_gameplay_score; short field_AF5; short field_AF7; int total_money_owned; int offmap_money_owned; short hates_player[5]; struct MapTask task_list[300]; int field_E8F; int field_E93[3]; unsigned char owner; int camera_deviate_quake; int camera_deviate_jump; long score; struct ResearchVal research[34]; int current_research_idx; unsigned char research_num; unsigned char field_F7D; unsigned char room_buildable[17]; unsigned char room_resrchable[17]; unsigned char creature_force_enabled[32]; unsigned char creature_allowed[32]; unsigned char magic_level[20]; unsigned char magic_resrchable[20]; unsigned char trap_amount_stored[7]; unsigned char trap_build_flags[7]; unsigned char trap_amount_placeable[7]; unsigned char door_amount_stored[5]; unsigned char door_build_flags[5]; unsigned char door_amount_placeable[5]; struct TurnTimer turn_timers[8]; unsigned char script_flags[8]; long max_creatures_attracted; unsigned char heart_destroy_state; long heart_destroy_turn; struct Coord3d essential_pos; struct DiggerStack digger_stack[64]; unsigned long digger_stack_update_turn; unsigned long digger_stack_length; unsigned char visible_event_idx; unsigned char visible_battles[3]; short zoom_annoyed_creature_idx; long total_experience_creatures_gained; long total_research_points; long field_1181; long manufacture_progress; unsigned char manufacture_class; unsigned char manufacture_kind; long field_118B; long manufacture_level; long research_progress; struct LevelStats lvstats; struct CreatureStorage dead_creatures[64]; long dead_creatures_count; long dead_creature_idx; unsigned char event_button_index[12 +1]; long field_13B4[31 -4]; unsigned short tortured_creatures[32]; unsigned char bodies_rotten_for_vampire; unsigned char field_1461[36]; long field_1485; unsigned char creature_models_joined[32]; unsigned long fights_num; unsigned char research_override; int field_14AE; unsigned char devastation_centr_x; unsigned char devastation_centr_y; unsigned long devastation_turn; long creatures_total_pay; unsigned short field_14BC; unsigned long field_14BE; unsigned short selected_creatures_of_model[32]; unsigned short selected_creatures_of_gui_job[3]; }; #pragma pack() extern struct Dungeon bad_dungeon; struct Dungeon *get_players_num_dungeon_f(long plyr_idx,const char *func_name); struct Dungeon *get_players_dungeon_f(const struct PlayerInfo *player,const char *func_name); struct Dungeon *get_dungeon_f(PlayerNumber plyr_num,const char *func_name); TbBool dungeon_invalid(const struct Dungeon *dungeon); void clear_dungeons(void); void init_dungeons(void); void decrease_dungeon_area(PlayerNumber plyr_idx, long value); void increase_room_area(PlayerNumber plyr_idx, long value); void decrease_room_area(PlayerNumber plyr_idx, long value); void increase_dungeon_area(PlayerNumber plyr_idx, long value); TbBool mark_creature_joined_dungeon(struct Thing *creatng); void player_add_offmap_gold(PlayerNumber plyr_idx, GoldAmount value); void init_dungeons_essential_position(void); const struct Coord3d *dungeon_get_essential_pos(PlayerNumber plyr_idx); TbBool player_has_heart(PlayerNumber plyr_idx); struct Thing *get_player_soul_container(PlayerNumber plyr_idx); TbBool player_has_room(PlayerNumber plyr_idx, RoomKind rkind); TbBool player_has_room_of_role(PlayerNumber plyr_idx, RoomRole rrole); TbBool dungeon_has_room(const struct Dungeon *dungeon, RoomKind rkind); TbBool set_creature_tendencies(struct PlayerInfo *player, unsigned short tend_type, TbBool val); TbBool toggle_creature_tendencies(struct PlayerInfo *player, unsigned short tend_type); TbBool player_creature_tends_to(PlayerNumber plyr_idx, unsigned short tend_type); TbBool set_trap_buildable_and_add_to_amount(PlayerNumber plyr_idx, ThingModel trap_kind, long buildable, long amount); TbBool set_door_buildable_and_add_to_amount(PlayerNumber plyr_idx, ThingModel door_kind, long buildable, long amount); TbBool dungeon_has_any_buildable_traps(struct Dungeon *dungeon); TbBool dungeon_has_any_buildable_doors(struct Dungeon *dungeon); TbBool restart_script_timer(PlayerNumber plyr_idx, long timer_id); TbBool set_script_flag(PlayerNumber plyr_idx, long flag_id, long value); struct CreditsItem; struct GameCampaign; enum TbFileGroups { FGrp_None, FGrp_StdData, FGrp_LrgData, FGrp_FxData, FGrp_LoData, FGrp_HiData, FGrp_VarLevels, FGrp_Save, FGrp_SShots, FGrp_StdSound, FGrp_LrgSound, FGrp_AtlSound, FGrp_Main, FGrp_Campgn, FGrp_CmpgLvls, FGrp_LandView, FGrp_CrtrData, FGrp_CmpgCrtrs, FGrp_CmpgConfig, FGrp_CmpgMedia, FGrp_Music, }; enum TbFeature { Ft_EyeLens = 0x0001, Ft_HiResVideo = 0x0002, Ft_BigPointer = 0x0004, Ft_HiResCreatr = 0x0008, Ft_AdvAmbSound = 0x0010, Ft_Censorship = 0x0020, Ft_Atmossounds = 0x0040, Ft_Resizemovies = 0x0080, }; enum TbExtraLevels { ExLv_None = 0, ExLv_FullMoon = 1, ExLv_NewMoon = 2, }; enum TbLevelOptions { LvOp_None = 0x00, LvOp_IsSingle = 0x01, LvOp_IsMulti = 0x02, LvOp_IsBonus = 0x04, LvOp_IsExtra = 0x08, LvOp_IsFree = 0x10, LvOp_AlwsVisbl = 0x20, LvOp_Tutorial = 0x40, }; enum TbLevelState { LvSt_Hidden = 0, LvSt_HalfShow = 1, LvSt_Visible = 2, }; enum TbLevelLocation { LvLc_VarLevels = 0, LvLc_Campaign = 1, LvLc_Custom = 2, }; enum TbLanguage { Lang_Unset = 0, Lang_English, Lang_French, Lang_German, Lang_Italian, Lang_Spanish, Lang_Swedish, Lang_Polish, Lang_Dutch, Lang_Hungarian, Lang_Korean, Lang_Danish, Lang_Norwegian, Lang_Czech, Lang_Arabic, Lang_Russian, Lang_Japanese, Lang_ChineseInt, Lang_ChineseTra, Lang_Portuguese, Lang_Hindi, Lang_Bengali, Lang_Javanese, Lang_Latin, }; enum TbConfigLoadFlags { CnfLd_Standard = 0x00, CnfLd_ListOnly = 0x01, CnfLd_AcceptPartial = 0x02, CnfLd_IgnoreErrors = 0x04, }; #pragma pack(1) struct CommandWord { char text[32]; }; struct NamedCommand { const char *name; int num; }; struct InstallInfo { char inst_path[150]; int lang_id; int field_9A; }; struct NetLevelDesc { unsigned char lvnum; unsigned char field_1; unsigned long field_2; unsigned long field_6; char *text; }; extern unsigned short AtmosRepeat; extern unsigned short AtmosStart; extern unsigned short AtmosEnd; __attribute__((dllimport)) extern float _DK_phase_of_moon; __attribute__((dllimport)) extern long _DK_net_number_of_levels; __attribute__((dllimport)) extern struct NetLevelDesc _DK_net_level_desc[100]; __attribute__((dllimport)) extern struct InstallInfo _DK_install_info; __attribute__((dllimport)) extern char _DK_keeper_runtime_directory[152]; #pragma pack() extern unsigned long features_enabled; extern short is_full_moon; extern short is_near_full_moon; extern short is_new_moon; extern short is_near_new_moon; extern unsigned long text_line_number; extern const struct NamedCommand lang_type[]; char *prepare_file_path_buf(char *ffullpath,short fgroup,const char *fname); char *prepare_file_path(short fgroup,const char *fname); char *prepare_file_fmtpath(short fgroup, const char *fmt_str, ...); unsigned char *load_data_file_to_buffer(long *ldsize, short fgroup, const char *fmt_str, ...); TbBool update_features(unsigned long mem_size); TbBool is_feature_on(unsigned long feature); TbBool censorship_enabled(void); TbBool atmos_sounds_enabled(void); TbBool resize_movies_enabled(void); short load_configuration(void); short calculate_moon_phase(short do_calculate,short add_to_log); void load_or_create_high_score_table(void); TbBool load_high_score_table(void); TbBool save_high_score_table(void); TbBool create_empty_high_score_table(void); int add_high_score_entry(unsigned long score, LevelNumber lvnum, const char *name); unsigned long get_level_highest_score(LevelNumber lvnum); short is_bonus_level(LevelNumber lvnum); short is_extra_level(LevelNumber lvnum); short is_singleplayer_level(LevelNumber lvnum); short is_singleplayer_like_level(LevelNumber lvnum); short is_multiplayer_level(LevelNumber lvnum); short is_campaign_level(LevelNumber lvnum); short is_freeplay_level(LevelNumber lvnum); int array_index_for_bonus_level(LevelNumber bn_lvnum); int array_index_for_extra_level(LevelNumber ex_lvnum); int array_index_for_singleplayer_level(LevelNumber sp_lvnum); int array_index_for_multiplayer_level(LevelNumber mp_lvnum); int array_index_for_freeplay_level(LevelNumber fp_lvnum); int storage_index_for_bonus_level(LevelNumber bn_lvnum); LevelNumber first_singleplayer_level(void); LevelNumber last_singleplayer_level(void); LevelNumber next_singleplayer_level(LevelNumber sp_lvnum); LevelNumber prev_singleplayer_level(LevelNumber sp_lvnum); LevelNumber bonus_level_for_singleplayer_level(LevelNumber sp_lvnum); LevelNumber first_multiplayer_level(void); LevelNumber last_multiplayer_level(void); LevelNumber next_multiplayer_level(LevelNumber mp_lvnum); LevelNumber prev_multiplayer_level(LevelNumber mp_lvnum); LevelNumber first_freeplay_level(void); LevelNumber last_freeplay_level(void); LevelNumber next_freeplay_level(LevelNumber fp_lvnum); LevelNumber prev_freeplay_level(LevelNumber fp_lvnum); LevelNumber first_extra_level(void); LevelNumber next_extra_level(LevelNumber ex_lvnum); LevelNumber get_extra_level(unsigned short elv_kind); struct LevelInformation *get_level_info(LevelNumber lvnum); struct LevelInformation *get_or_create_level_info(LevelNumber lvnum, unsigned long lvoptions); struct LevelInformation *get_first_level_info(void); struct LevelInformation *get_last_level_info(void); struct LevelInformation *get_next_level_info(struct LevelInformation *previnfo); struct LevelInformation *get_prev_level_info(struct LevelInformation *nextinfo); short set_level_info_text_name(LevelNumber lvnum, char *name, unsigned long lvoptions); short get_level_fgroup(LevelNumber lvnum); const char *get_current_language_str(void); const char *get_language_lwrstr(int lang_id); TbBool reset_credits(struct CreditsItem *credits); TbBool setup_campaign_credits_data(struct GameCampaign *campgn); short find_conf_block(const char *buf,long *pos,long buflen,const char *blockname); int recognize_conf_command(const char *buf,long *pos,long buflen,const struct NamedCommand *commands); TbBool skip_conf_to_next_line(const char *buf,long *pos,long buflen); int get_conf_parameter_single(const char *buf,long *pos,long buflen,char *dst,long dstlen); int get_conf_parameter_whole(const char *buf,long *pos,long buflen,char *dst,long dstlen); int recognize_conf_parameter(const char *buf,long *pos,long buflen,const struct NamedCommand *commands); const char *get_conf_parameter_text(const struct NamedCommand commands[],int num); long get_id(const struct NamedCommand *desc, const char *itmname); long get_rid(const struct NamedCommand *desc, const char *itmname); enum ComputerTaskTypes { CTT_None = 0, CTT_DigRoomPassage, CTT_DigRoom, CTT_CheckRoomDug, CTT_PlaceRoom, CTT_DigToEntrance, CTT_DigToGold, CTT_DigToAttack, CTT_MagicCallToArms, CTT_PickupForAttack, CTT_MoveCreatureToRoom, CTT_MoveCreatureToPos, CTT_MoveCreaturesToDefend, CTT_SlapDiggers, CTT_DigToNeutral, CTT_MagicSpeedUp, CTT_WaitForBridge, CTT_AttackMagic, CTT_SellTrapsAndDoors, CTT_MoveGoldToTreasury, }; enum TrapDoorSellingCategory { TDSC_EndList = 0, TDSC_DoorCrate, TDSC_TrapCrate, TDSC_DoorPlaced, TDSC_TrapPlaced, }; enum GameActionTypes { GA_None = 0, GA_Unk01, GA_UsePwrHandPick, GA_UsePwrHandDrop, GA_UseMkDigger, GA_UseSlap, GA_UsePwrSight, GA_UsePwrObey, GA_UsePwrHealCrtr, GA_UsePwrCall2Arms, GA_UsePwrCaveIn, GA_StopPwrCall2Arms, GA_StopPwrHoldAudnc, GA_Unk13, GA_MarkDig, GA_Unk15, GA_PlaceRoom, GA_SetTendencies, GA_PlaceTrap, GA_PlaceDoor, GA_UsePwrLightning, GA_UsePwrSpeedUp, GA_UsePwrArmour, GA_UsePwrConceal, GA_UsePwrHoldAudnc, GA_UsePwrDisease, GA_UsePwrChicken, GA_Unk27, GA_UsePwrSlap, GA_SellTrap, GA_SellDoor, }; enum ToolDigFlags { ToolDig_BasicOnly = 0x00, ToolDig_AllowValuable = 0x01, ToolDig_AllowLiquidWBridge = 0x02, }; enum CompProcessFlags { ComProc_Unkn0001 = 0x0001, ComProc_Unkn0002 = 0x0002, ComProc_Unkn0004 = 0x0004, ComProc_Unkn0008 = 0x0008, ComProc_Unkn0010 = 0x0010, ComProc_Unkn0020 = 0x0020, ComProc_Unkn0040 = 0x0040, ComProc_Unkn0080 = 0x0080, ComProc_Unkn0100 = 0x0100, ComProc_Unkn0200 = 0x0200, ComProc_Unkn0400 = 0x0400, ComProc_Unkn0800 = 0x0800, }; enum CompCheckFlags { ComChk_Unkn0001 = 0x0001, ComChk_Unkn0002 = 0x0002, ComChk_Unkn0004 = 0x0004, ComChk_Unkn0008 = 0x0008, ComChk_Unkn0010 = 0x0010, ComChk_Unkn0020 = 0x0020, ComChk_Unkn0040 = 0x0040, ComChk_Unkn0080 = 0x0080, ComChk_Unkn0100 = 0x0100, ComChk_Unkn0200 = 0x0200, ComChk_Unkn0400 = 0x0400, ComChk_Unkn0800 = 0x0800, }; enum CompTaskFlags { ComTsk_Unkn0001 = 0x0001, ComTsk_Unkn0002 = 0x0002, ComTsk_Unkn0004 = 0x0004, ComTsk_Unkn0008 = 0x0008, ComTsk_Unkn0010 = 0x0010, ComTsk_Unkn0020 = 0x0020, ComTsk_Unkn0040 = 0x0040, ComTsk_Unkn0080 = 0x0080, }; enum CompTaskStates { CTaskSt_None = 0, CTaskSt_Wait, CTaskSt_Select, CTaskSt_Perform, }; enum CompTaskRet { CTaskRet_Unk0 = 0, CTaskRet_Unk1, CTaskRet_Unk2, CTaskRet_Unk3, CTaskRet_Unk4, }; enum CompProcRet { CProcRet_Fail = 0, CProcRet_Continue, CProcRet_Finish, CProcRet_Unk3, CProcRet_Wait, }; enum ItemAvailabilityRet { IAvail_Never = 0, IAvail_Now = 1, IAvail_NeedResearch = 4, }; enum CompChatFlags { CChat_None = 0x00, CChat_TasksScarce = 0x01, CChat_TasksFrequent = 0x02, }; #pragma pack(1) struct Computer2; struct ComputerProcess; struct ComputerCheck; struct ComputerEvent; struct Event; struct Thing; struct Room; struct ComputerTask; struct GoldLookup; struct THate; typedef unsigned char ComputerType; typedef unsigned short ComputerTaskType; typedef char ComputerName[160]; typedef long (*Comp_Process_Func)(struct Computer2 *, struct ComputerProcess *); typedef long (*Comp_Check_Func)(struct Computer2 *, struct ComputerCheck *); typedef long (*Comp_Event_Func)(struct Computer2 *, struct ComputerEvent *,struct Event *); typedef long (*Comp_EvntTest_Func)(struct Computer2 *, struct ComputerEvent *); typedef long (*Comp_Task_Func)(struct Computer2 *, struct ComputerTask *); typedef TbBool (*Comp_HateTest_Func)(const struct Computer2 *, const struct ComputerProcess *, const struct THate *); struct Comp_Check_Func_ListItem { const char *name; Comp_Check_Func func; }; struct TaskFunctions { const char *name; Comp_Task_Func func; }; struct ComputerProcess { char *name; long priority; long confval_2; long confval_3; long confval_4; long confval_5; Comp_Process_Func func_check; Comp_Process_Func func_setup; Comp_Process_Func func_task; Comp_Process_Func func_complete; Comp_Process_Func func_pause; struct ComputerProcess *parent; unsigned long param_1; unsigned long param_2; unsigned long param_3; unsigned long last_run_turn; long param_5; unsigned long flags; }; struct ComputerCheck { char *name; unsigned long flags; long turns_interval; Comp_Check_Func func; long param1; long param2; long param3; long last_run_turn; }; struct ComputerEvent { char *name; unsigned long cetype; unsigned long mevent_kind; Comp_Event_Func func_event; Comp_EvntTest_Func func_test; long test_interval; struct ComputerProcess *process; long param1; long param2; long param3; long last_test_gameturn; }; struct ValidRooms { long rkind; struct ComputerProcess *process; }; struct ComputerProcessMnemonic { char name[16]; struct ComputerProcess *process; }; struct ComputerCheckMnemonic { char name[16]; struct ComputerCheck *check; }; struct ComputerEventMnemonic { char name[16]; struct ComputerEvent *event; }; struct ComputerDig { struct Coord3d pos_E; struct Coord3d pos_dest; struct Coord3d pos_begin; struct Coord3d pos_next; long distance; unsigned char hug_side; unsigned char direction_around; unsigned long subfield_2C; long subfield_30; long subfield_34; long subfield_38; long subfield_3C; long subfield_40; long subfield_44; long subfield_48; long sub4C_stl_x; long sub4C_stl_y; long calls_count; long valuable_slabs_tagged; }; struct ComputerTask { unsigned char flags; unsigned char task_state; unsigned char ttype; unsigned char ottype; unsigned char rkind; unsigned char field_5[5]; long created_turn; union { struct ComputerDig dig; struct { unsigned char field_E[21]; unsigned char field_23[32]; unsigned char field_43[6]; unsigned char field_49[19]; }; }; long lastrun_turn; long field_60; struct Coord3d pos_64; struct Coord3d pos_6A; union { struct { long items_amount; short field_74; long gold_gain; short field_7A; long gold_gain_limit; long total_money_limit; short allow_deployed; long sell_idx; unsigned char field_8A[2]; } sell_traps_doors; struct { long items_amount; short room_idx; long gold_gain; short field_7A; long gold_gain_limit; long total_money_limit; short field_84; long field_86; unsigned char field_8A[2]; } move_gold; struct { struct Coord3d pos_70; struct Coord3d target_pos; long repeat_num; long long_80; short field_84; short word_86; long field_88; } magic_cta; struct { long splevel; short field_74; short target_thing_idx; short word_78; short field_7A; long repeat_num; long gaction; short field_84; long pwkind; unsigned char field_8A[2]; } attack_magic; struct { short room_idx1; short word_72; short field_74; short word_76; short word_78; short field_7Ac; long repeat_num; short room_idx2; short word_82; unsigned char field_84[2]; struct Coord3d pos_86; } move_to_room; struct { long field_70; short field_74; struct Coord3d target_pos; long repeat_num; short word_80; short word_82; unsigned char field_84[2]; struct Coord3d pos_86; } move_to_defend; struct { long field_70; short field_74; short target_thing_idx; short word_78; short field_7Ac; long repeat_num; short word_80; short word_82; unsigned char field_84[2]; struct Coord3d pos_86; } move_to_pos; struct { long field_70; short field_74; struct Coord3d target_pos; long repeat_num; short word_80; short word_82; unsigned char field_84[2]; long long_86; short word_8A; } pickup_for_attack; struct { struct Coord3d startpos; struct Coord3d endpos; long field_7C; short target_room_idx; short word_82; short word_84; short target_plyr_idx; long field_88; } dig_to_room; struct { struct Coord3d startpos; struct Coord3d endpos; long field_7C; short target_lookup_idx; short word_82; short word_84; long slabs_dig_count; short word_8A; } dig_to_gold; struct { struct Coord3d startpos; struct Coord3d endpos; long field_7C; unsigned char byte_80; unsigned char byte_81; short word_82; short word_84; short target_plyr_idx; long field_88; } dig_somewhere; struct { struct Coord3d startpos; struct Coord3d endpos; short width; short height; long long_80; short word_84; long area; short word_8A; } create_room; }; unsigned short field_8C; long field_8E; unsigned short next_task; }; struct OpponentRelation { unsigned long field_0; short field_4; long hate_amount; struct Coord3d pos_A[64]; }; struct Computer2 { long task_state; unsigned long gameturn_delay; unsigned long gameturn_wait; unsigned long field_C; unsigned long tasks_did; unsigned long field_14; unsigned long field_18; unsigned long field_1C; unsigned long sim_before_dig; struct Dungeon *dungeon; unsigned long model; unsigned long field_2C; unsigned long max_room_build_tasks; unsigned long field_34; struct ComputerProcess processes[20 +1]; struct ComputerCheck checks[15]; struct ComputerEvent events[12]; struct OpponentRelation opponent_relations[6]; struct Coord3d trap_locations[20]; unsigned long soe_targets[8]; unsigned char field_13E4[224]; short ongoing_process; short task_idx; short held_thing_idx; }; struct THate { long amount; long plyr_idx; struct Coord3d *pos_near; long distance_near; }; struct ExpandRooms { RoomKind rkind; short max_slabs; }; #pragma pack() struct ComputerPlayerConfig { int processes_count; int checks_count; int events_count; int computers_count; int skirmish_first; int skirmish_last; }; extern unsigned short computer_types_tooltip_stridx[]; extern struct ValidRooms valid_rooms_to_build[]; extern struct ComputerProcessMnemonic computer_process_config_list[]; extern const struct NamedCommand computer_process_func_type[]; extern Comp_Process_Func computer_process_func_list[]; extern const struct NamedCommand computer_event_func_type[]; extern Comp_Event_Func computer_event_func_list[]; extern const struct NamedCommand computer_event_test_func_type[]; extern Comp_EvntTest_Func computer_event_test_func_list[]; extern const struct NamedCommand computer_check_func_type[]; extern Comp_Check_Func computer_check_func_list[]; struct Computer2 *get_computer_player_f(long plyr_idx,const char *func_name); TbBool computer_player_invalid(const struct Computer2 *comp); long set_autopilot_type(PlayerNumber plridx, long aptype); void shut_down_process(struct Computer2 *comp, struct ComputerProcess *cproc); void reset_process(struct Computer2 *comp, struct ComputerProcess *cproc); void suspend_process(struct Computer2 *comp, struct ComputerProcess *cproc); long computer_process_index(const struct Computer2 *comp, const struct ComputerProcess *cproc); struct ComputerProcess *get_computer_process(struct Computer2 *comp, int cproc_idx); TbBool computer_player_in_emergency_state(const struct Computer2 *comp); TbBool is_there_an_attack_task(const struct Computer2 *comp); struct ComputerTask *computer_setup_build_room(struct Computer2 *comp, RoomKind rkind, long width_slabs, long height_slabs, long a5); struct ComputerTask * able_to_build_room(struct Computer2 *comp, struct Coord3d *pos, RoomKind rkind, long width_slabs, long height_slabs, long a6, long a7); long computer_finds_nearest_room_to_gold(struct Computer2 *comp, struct Coord3d *pos, struct GoldLookup **gldlookref); void setup_dig_to(struct ComputerDig *cdig, const struct Coord3d startpos, const struct Coord3d endpos); long move_imp_to_dig_here(struct Computer2 *comp, struct Coord3d *pos, long max_amount); long move_imp_to_mine_here(struct Computer2 *comp, struct Coord3d *pos, long max_amount); void get_opponent(struct Computer2 *comp, struct THate hate[]); long add_to_trap_location(struct Computer2 *, struct Coord3d *); long set_next_process(struct Computer2 *comp); void computer_check_events(struct Computer2 *comp); TbBool process_checks(struct Computer2 *comp); GoldAmount get_computer_money_less_cost(const struct Computer2 *comp); GoldAmount get_dungeon_money_less_cost(const struct Dungeon *dungeon); TbBool creature_could_be_placed_in_better_room(const struct Computer2 *comp, const struct Thing *thing); CreatureJob get_job_to_place_creature_in_room(const struct Computer2 *comp, const struct Thing *thing); long xy_walkable(MapSubtlCoord stl_x, MapSubtlCoord stl_y, long plyr_idx); struct ComputerTask *get_computer_task(long idx); struct ComputerTask *get_task_in_progress(struct Computer2 *comp, ComputerTaskType ttype); struct ComputerTask *get_task_in_progress_in_list(const struct Computer2 *comp, const ComputerTaskType *ttypes); TbBool is_task_in_progress(struct Computer2 *comp, ComputerTaskType ttype); TbBool is_task_in_progress_using_hand(struct Computer2 *comp); struct ComputerTask *get_free_task(struct Computer2 *comp, long a2); TbBool computer_task_invalid(const struct ComputerTask *ctask); TbBool remove_task(struct Computer2 *comp, struct ComputerTask *ctask); void shut_down_task_process(struct Computer2 *comp, struct ComputerTask *ctask); const char *computer_task_code_name(int ctask_type); TbBool create_task_move_creatures_to_defend(struct Computer2 *comp, struct Coord3d *pos, long creatrs_num, unsigned long evflags); TbBool create_task_move_creatures_to_room(struct Computer2 *comp, int room_idx, long creatrs_num); TbBool create_task_magic_battle_call_to_arms(struct Computer2 *comp, struct Coord3d *pos, long par2, long creatrs_num); TbBool create_task_magic_support_call_to_arms(struct Computer2 *comp, struct Coord3d *pos, long par2, long par3, long creatrs_num); TbBool create_task_pickup_for_attack(struct Computer2 *comp, struct Coord3d *pos, long par3, long creatrs_num); TbBool create_task_sell_traps_and_doors(struct Computer2 *comp, long num_to_sell, GoldAmount gold_up_to, TbBool allow_deployed); TbBool create_task_move_gold_to_treasury(struct Computer2 *comp, long num_to_move, long gold_up_to); TbBool create_task_move_creature_to_subtile(struct Computer2 *comp, const struct Thing *thing, MapSubtlCoord stl_x, MapSubtlCoord stl_y, CrtrStateId dst_state); TbBool create_task_move_creature_to_pos(struct Computer2 *comp, const struct Thing *thing, const struct Coord3d pos, CrtrStateId dst_state); TbBool create_task_dig_to_attack(struct Computer2 *comp, const struct Coord3d startpos, const struct Coord3d endpos, PlayerNumber victim_plyr_idx, long parent_cproc_idx); TbBool create_task_slap_imps(struct Computer2 *comp, long creatrs_num); TbBool create_task_dig_to_neutral(struct Computer2 *comp, const struct Coord3d startpos, const struct Coord3d endpos); TbBool create_task_dig_to_gold(struct Computer2 *comp, const struct Coord3d startpos, const struct Coord3d endpos, long parent_cproc_idx, long par1, long gold_lookup_idx); TbBool create_task_dig_to_entrance(struct Computer2 *comp, const struct Coord3d startpos, const struct Coord3d endpos, long parent_cproc_idx, long entroom_idx); TbBool create_task_magic_speed_up(struct Computer2 *comp, const struct Thing *creatng, long splevel); TbBool create_task_attack_magic(struct Computer2 *comp, const struct Thing *creatng, PowerKind pwkind, int repeat_num, int splevel, int gaction); TbBool computer_able_to_use_power(struct Computer2 *comp, PowerKind pwkind, long pwlevel, long amount); long computer_get_room_kind_total_capacity(struct Computer2 *comp, RoomKind room_kind); long computer_get_room_kind_free_capacity(struct Computer2 *comp, RoomKind room_kind); long computer_finds_nearest_room_to_pos(struct Computer2 *comp, struct Room **retroom, struct Coord3d *nearpos); long process_tasks(struct Computer2 *comp); TbResult game_action(PlayerNumber plyr_idx, unsigned short gaction, unsigned short alevel, MapSubtlCoord stl_x, MapSubtlCoord stl_y, unsigned short param1, unsigned short param2); TbResult try_game_action(struct Computer2 *comp, PlayerNumber plyr_idx, unsigned short gaction, unsigned short alevel, MapSubtlCoord stl_x, MapSubtlCoord stl_y, unsigned short param1, unsigned short param2); short tool_dig_to_pos2_f(struct Computer2 * comp, struct ComputerDig * cdig, TbBool simulation, unsigned short digflags, const char *func_name); int search_spiral_f(struct Coord3d *pos, PlayerNumber owner, int i3, long (*cb)(MapSubtlCoord, MapSubtlCoord, long), const char *func_name); ItemAvailability computer_check_room_available(const struct Computer2 * comp, long rkind); TbBool computer_find_non_solid_block(const struct Computer2 *comp, struct Coord3d *pos); long count_creatures_in_dungeon(const struct Dungeon *dungeon); long count_entrances(const struct Computer2 *comp, PlayerNumber plyr_idx); long count_diggers_in_dungeon(const struct Dungeon *dungeon); long check_call_to_arms(struct Computer2 *comp); long count_creatures_for_defend_pickup(struct Computer2 *comp); long count_creatures_for_pickup(struct Computer2 *comp, struct Coord3d *pos, struct Room *room, long a4); long count_creatures_availiable_for_fight(struct Computer2 *comp, struct Coord3d *pos); long setup_computer_attack(struct Computer2 *comp, struct ComputerProcess *cproc, struct Coord3d *pos, long victim_plyr_idx); TbBool setup_a_computer_player(PlayerNumber plyr_idx, long comp_model); void process_computer_players2(void); void setup_computer_players2(void); void restore_computer_player_after_load(void); TbBool computer_force_dump_held_things_on_map(struct Computer2 *comp, const struct Coord3d *pos); TbBool computer_force_dump_specific_held_thing(struct Computer2 *comp, struct Thing *thing, const struct Coord3d *pos); TbBool thing_is_in_computer_power_hand_list(const struct Thing *thing, PlayerNumber plyr_idx); enum CreatureModelFlags { CMF_IsSpecDigger = 0x0001, CMF_IsArachnid = 0x0002, CMF_IsDiptera = 0x0004, CMF_IsLordOTLand = 0x0008, CMF_IsSpectator = 0x0010, CMF_IsEvil = 0x0020, CMF_NeverChickens = 0x0040, CMF_ImmuneToBoulder = 0x0080, CMF_NoCorpseRotting = 0x0100, CMF_NoEnmHeartAttack = 0x0200, CMF_TremblingFat = 0x0400, CMF_Female = 0x0800, CMF_Insect = 0x1000, CMF_OneOfKind = 0x2000, }; enum CreatureJobFlags { Job_NULL = 0LL, Job_TUNNEL = 1LL<<0, Job_DIG = 1LL<<1, Job_RESEARCH = 1LL<<2, Job_TRAIN = 1LL<<3, Job_MANUFACTURE = 1LL<<4, Job_SCAVENGE = 1LL<<5, Job_KINKY_TORTURE = 1LL<<6, Job_JOIN_FIGHT = 1LL<<7, Job_SEEK_THE_ENEMY = 1LL<<8, Job_GUARD = 1LL<<9, Job_GROUP = 1LL<<10, Job_BARRACK = 1LL<<11, Job_TEMPLE_PRAY = 1LL<<12, Job_FREEZE_PRISONERS = 1LL<<13, Job_EXPLORE = 1LL<<14, Job_EXEMPT = 1LL<<15, Job_TEMPLE_SACRIFICE = 1LL<<16, Job_PAINFUL_TORTURE = 1LL<<17, Job_CAPTIVITY = 1LL<<18, Job_PLACE_IN_VAULT = 1LL<<19, Job_TAKE_SALARY = 1LL<<20, Job_TAKE_FEED = 1LL<<21, Job_TAKE_SLEEP = 1LL<<22, Job_MINE = 1LL<<23, Job_CONVERT_GROUND = 1LL<<24, Job_IMPROVE_GROUND = 1LL<<25, Job_REINFORCE_WALL = 1LL<<26, Job_KILL_OWN_CREATURE= 1LL<<27, Job_DESTROY_OWN_ROOM = 1LL<<28, Job_LEAVE_DUNGEON = 1LL<<29, Job_STEAL_OWN_GOLD = 1LL<<30, Job_DAMAGE_OWN_WALLS = 1LL<<31, Job_MAD_PSYCHO = 1LL<<32, Job_PERSUADE_LEAVE = 1LL<<33, Job_JOIN_ENEMY = 1LL<<34, Job_ATTACK_ROOM = 1LL<<35, Job_ATTACK_CREATURE = 1LL<<36, Job_ATTACK_DNHEART = 1LL<<37, Job_STEAL_GOLD = 1LL<<38, Job_STEAL_SPELLS = 1LL<<39, Job_DEFEND_PARTY = 1LL<<40, }; enum JobKindFlags { JoKF_None = 0x00000000, JoKF_AssignHumanDrop = 0x00000001, JoKF_AssignComputerDrop = 0x00000002, JoKF_AssignCeatureInit = 0x00000004, JoKF_AssignAreaWithinRoom = 0x00000008, JoKF_AssignAreaOutsideRoom = 0x00000010, JoKF_AssignOnAreaBorder = 0x00000040, JoKF_AssignOnAreaCenter = 0x00000080, JoKF_OwnedCreatures = 0x00000200, JoKF_EnemyCreatures = 0x00000400, JoKF_OwnedDiggers = 0x00000800, JoKF_EnemyDiggers = 0x00001000, JoKF_AssignOneTime = 0x00002000, JoKF_NeedsHaveJob = 0x00004000, JoKF_NeedsCapacity = 0x00010000, JoKF_WorkOnAreaBorder = 0x00020000, JoKF_WorkOnAreaCenter = 0x00040000, JoKF_NoSelfControl = 0x00080000, JoKF_NoGroups = 0x00100000, JoKF_AllowChickenized = 0x00200000, }; enum InstancePropertiesFlags { InstPF_None = 0x00, InstPF_RepeatTrigger = 0x01, InstPF_RangedAttack = 0x02, InstPF_MeleeAttack = 0x04, InstPF_SelfBuff = 0x08, InstPF_RangedDebuff = 0x10, }; enum CreatureDeathKind { Death_Unset = 0, Death_Normal, Death_FleshExplode, Death_GasFleshExplode, Death_SmokeExplode, Death_IceExplode, }; enum CreatureAttackType { AttckT_Unset = 0, AttckT_Melee, AttckT_Ranged, }; #pragma pack(1) struct Thing; struct CreatureData { unsigned char flags; short lair_tngmodel; short namestr_idx; }; struct Creatures { unsigned short evil_start_state; unsigned short good_start_state; unsigned char natural_death_kind; unsigned char field_5; unsigned char field_6; unsigned char field_7; unsigned char swipe_idx; short shot_shift_x; short shot_shift_y; short shot_shift_z; unsigned char field_F; }; __attribute__((dllimport)) struct Creatures _DK_creatures[32]; __attribute__((dllimport)) unsigned short _DK_breed_activities[32]; #pragma pack() struct CreatureStateConfig { char name[32]; }; struct CreatureInstanceConfig { char name[32]; }; typedef TbBool (*Creature_Job_Player_Check_Func)(const struct Thing *, PlayerNumber, CreatureJob); typedef TbBool (*Creature_Job_Player_Assign_Func)(struct Thing *, PlayerNumber, CreatureJob); typedef TbBool (*Creature_Job_Coords_Check_Func)(const struct Thing *creatng, MapSubtlCoord stl_x, MapSubtlCoord stl_y, CreatureJob jobpref, unsigned long flags); typedef TbBool (*Creature_Job_Coords_Assign_Func)(struct Thing *creatng, MapSubtlCoord stl_x, MapSubtlCoord stl_y, CreatureJob jobpref); struct CreatureJobConfig { char name[32]; Creature_Job_Player_Check_Func func_plyr_check; Creature_Job_Player_Assign_Func func_plyr_assign; Creature_Job_Coords_Check_Func func_cord_check; Creature_Job_Coords_Assign_Func func_cord_assign; RoomRole room_role; EventKind event_kind; CrtrStateId initial_crstate; CrtrStateId continue_crstate; unsigned long job_flags; }; struct CreatureAngerJobConfig { char name[32]; }; struct CreatureModelConfig { char name[32]; long namestr_idx; unsigned short model_flags; }; struct CreatureExperience { long pay_increase_on_exp; long spell_damage_increase_on_exp; long range_increase_on_exp; long job_value_increase_on_exp; long health_increase_on_exp; long strength_increase_on_exp; long dexterity_increase_on_exp; long defense_increase_on_exp; long loyalty_increase_on_exp; long armour_increase_on_exp; }; struct CreatureConfig { long model_count; struct CreatureModelConfig model[64]; long states_count; struct CreatureStateConfig states[256]; long instances_count; struct CreatureInstanceConfig instances[64]; long jobs_count; struct CreatureJobConfig jobs[64]; long angerjobs_count; struct CreatureAngerJobConfig angerjobs[64]; long attacktypes_count; struct CommandWord attacktypes[64]; struct CreatureExperience exp; ThingModel special_digger_good; ThingModel special_digger_evil; ThingModel spectator_breed; }; extern const char keeper_creaturetp_file[]; extern struct NamedCommand creature_desc[]; extern struct NamedCommand angerjob_desc[]; extern struct NamedCommand creaturejob_desc[]; extern struct NamedCommand attackpref_desc[]; extern struct NamedCommand instance_desc[]; extern const struct NamedCommand creature_graphics_desc[]; extern struct CreatureConfig crtr_conf; extern struct CreatureData creature_data[]; struct CreatureStats *creature_stats_get(ThingModel crstat_idx); struct CreatureStats *creature_stats_get_from_thing(const struct Thing *thing); struct CreatureData *creature_data_get(ThingModel crstat_idx); struct CreatureData *creature_data_get_from_thing(const struct Thing *thing); TbBool creature_stats_invalid(const struct CreatureStats *crstat); void creature_stats_updated(ThingModel crstat_idx); void check_and_auto_fix_stats(void); const char *creature_code_name(ThingModel crmodel); long creature_model_id(const char * name); const char *creature_own_name(const struct Thing *creatng); TbBool load_creaturetypes_config(const char *conf_fname, unsigned short flags); unsigned short get_creature_model_flags(const struct Thing *thing); TbBool set_creature_available(PlayerNumber plyr_idx, ThingModel crtr_model, long can_be_avail, long force_avail); ThingModel get_players_special_digger_model(PlayerNumber plyr_idx); ThingModel get_players_spectator_model(PlayerNumber plyr_idx); ThingModel get_creature_model_with_model_flags(unsigned short needflags); struct CreatureInstanceConfig *get_config_for_instance(CrInstance inst_id); const char *creature_instance_code_name(CrInstance inst_id); struct CreatureJobConfig *get_config_for_job(CreatureJob job_flags); RoomKind get_room_for_job(CreatureJob job_flags); RoomRole get_room_role_for_job(CreatureJob job_flags); EventKind get_event_for_job(CreatureJob job_flags); CrtrStateId get_initial_state_for_job(CreatureJob jobpref); CrtrStateId get_arrive_at_state_for_job(CreatureJob jobpref); CrtrStateId get_continue_state_for_job(CreatureJob jobpref); CreatureJob get_job_for_creature_state(CrtrStateId crstat_id); CreatureJob get_jobs_enemies_may_do_in_room(RoomKind rkind); CreatureJob get_jobs_enemies_may_do_in_room_role(RoomRole rrole); unsigned long get_flags_for_job(CreatureJob jobpref); int get_required_room_capacity_for_job(CreatureJob jobpref, ThingModel crmodel); CreatureJob get_creature_job_causing_going_postal(CreatureJob job_flags, RoomKind rkind); CreatureJob get_creature_job_causing_stress(CreatureJob job_flags, RoomKind rkind); CreatureJob get_job_for_subtile(const struct Thing *creatng, MapSubtlCoord stl_x, MapSubtlCoord stl_y, unsigned long drop_kind_flags); CreatureJob get_job_for_room(RoomKind rkind, unsigned long required_kind_flags, CreatureJob has_jobs); CreatureJob get_job_for_room_role(RoomRole rrole, unsigned long required_kind_flags, CreatureJob has_jobs); CreatureJob get_job_which_qualify_for_room(RoomKind rkind, unsigned long qualify_flags, unsigned long prevent_flags); CreatureJob get_job_which_qualify_for_room_role(RoomRole rrole, unsigned long qualify_flags, unsigned long prevent_flags); const char *creature_job_code_name(CreatureJob job_flag); const char *attack_type_job_code_name(CrAttackType attack_type); TbBool load_creaturemodel_config(long crmodel,unsigned short flags); TbBool make_all_creatures_free(void); TbBool change_max_health_of_creature_kind(ThingModel crmodel, long new_max); enum SacrificeAction { SacA_None = 0, SacA_MkCreature, SacA_MkGoodHero, SacA_NegSpellAll, SacA_PosSpellAll, SacA_NegUniqFunc, SacA_PosUniqFunc, }; enum UniqueFunctions { UnqF_None = 0, UnqF_MkAllAngry, UnqF_ComplResrch, UnqF_ComplManufc, UnqF_KillChickns, UnqF_CheaperImp, }; enum SacrificeReturn { SacR_AngryWarn = -1, SacR_DontCare = 0, SacR_Pleased = 1, SacR_Awarded = 2, SacR_Punished = 3, }; struct SacrificeRecipe { long victims[6]; long action; long param; }; extern const char keeper_rules_file[]; extern const struct NamedCommand research_desc[]; long get_research_id(long item_type, const char *trg_name, const char *func_name); TbBool load_rules_config(const char *conf_fname, unsigned short flags); const char *player_code_name(PlayerNumber plyr_idx); #pragma pack(1) struct Thing; typedef unsigned char AriadneReturn; typedef unsigned char AriadneRouteFlags; enum AriadneReturnValues { AridRet_OK = 0, AridRet_FinalOK, AridRet_Val2, AridRet_PartOK, }; enum AriadneRouteFlagValues { AridRtF_Default = 0x00, AridRtF_NoOwner = 0x01, }; enum AriadneUpdateStateValues { AridUpSt_Unset = 0, AridUpSt_OnLine, AridUpSt_Wallhug, AridUpSt_Manoeuvre, }; enum AriadneUpdateSubStateManoeuvreValues { AridUpSStM_Unset = 0, AridUpSStM_Unkn1, AridUpSStM_Unkn2, }; struct Ariadne { struct Coord3d startpos; struct Coord3d endpos; struct Coord3d current_waypoint_pos; struct Coord3d pos_12; struct Coord3d pos_18; unsigned char route_flags; unsigned char field_1F; unsigned char field_20; unsigned char update_state; unsigned char field_22; unsigned char field_23; short field_24; unsigned short move_speed; unsigned char current_waypoint; struct Coord2d waypoints[10]; unsigned char stored_waypoints; unsigned char total_waypoints; struct Coord3d pos_53; struct Coord3d pos_59; unsigned char manoeuvre_state; short wallhug_angle; long field_62; }; struct PathWayPoint { long x; long y; }; struct Path { struct PathWayPoint start; struct PathWayPoint finish; long waypoints_num; struct PathWayPoint waypoints[256]; }; struct Gate { long field_0; long field_4; long field_8; long field_C; long field_10; long field_14; long field_18; }; struct Pathway { long field_0; long field_4; long field_8; long field_C; struct Gate points[256]; long points_num; long field_1C14; }; struct WayPoints { long wpfield_0; long wpfield_4; long wpfield_8; long wpfield_C; long wpfield_10[256]; }; struct Navigation { unsigned char navstate; unsigned char field_1[3]; unsigned char field_4; long field_5; long field_9; long field_D; unsigned char field_11[4]; unsigned short field_15; unsigned short field_17; unsigned char field_19[2]; struct Coord3d pos_next; struct Coord3d pos_final; }; struct FOV { struct PathWayPoint tipA; struct PathWayPoint tipB; struct PathWayPoint tipC; }; __attribute__((dllimport)) unsigned long *_DK_EdgeFit; __attribute__((dllimport)) struct Pathway _DK_ap_GPathway; __attribute__((dllimport)) long _DK_tree_routelen; __attribute__((dllimport)) long _DK_tree_route[3517]; __attribute__((dllimport)) long _DK_tree_routecost; __attribute__((dllimport)) long _DK_tree_triA; __attribute__((dllimport)) long _DK_tree_triB; __attribute__((dllimport)) long _DK_tree_altA; __attribute__((dllimport)) long _DK_tree_altB; __attribute__((dllimport)) long _DK_tree_Ax8; __attribute__((dllimport)) long _DK_tree_Ay8; __attribute__((dllimport)) long _DK_tree_Bx8; __attribute__((dllimport)) long _DK_tree_By8; __attribute__((dllimport)) unsigned char *_DK_LastTriangulatedMap; __attribute__((dllimport)) unsigned char *_DK_fringe_map; __attribute__((dllimport)) long _DK_fringe_y1; __attribute__((dllimport)) long _DK_fringe_y2; __attribute__((dllimport)) long _DK_fringe_x1; __attribute__((dllimport)) long _DK_fringe_x2; __attribute__((dllimport)) long _DK_fringe_y[256]; __attribute__((dllimport)) long _DK_ix_Border; __attribute__((dllimport)) long _DK_Border[100]; __attribute__((dllimport)) long _DK_route_fwd[12000]; __attribute__((dllimport)) long _DK_route_bak[12000]; __attribute__((dllimport)) struct Path _DK_fwd_path; __attribute__((dllimport)) struct Path _DK_bak_path; #pragma pack() extern unsigned char const actual_sizexy_to_nav_block_sizexy_table[]; extern struct Path fwd_path; extern struct Path bak_path; long init_navigation(void); long update_navigation_triangulation(long start_x, long start_y, long end_x, long end_y); TbBool triangulate_area(unsigned char *imap, long sx, long sy, long ex, long ey); AriadneReturn ariadne_initialise_creature_route_f(struct Thing *thing, const struct Coord3d *pos, long speed, AriadneRouteFlags flags, const char *func_name); AriadneReturn creature_follow_route_to_using_gates(struct Thing *thing, struct Coord3d *finalpos, struct Coord3d *nextpos, long speed, AriadneRouteFlags flags); AriadneReturn ariadne_prepare_creature_route_to_target_f(const struct Thing *thing, struct Ariadne *arid, const struct Coord3d *srcpos, const struct Coord3d *dstpos, long speed, AriadneRouteFlags flags, const char *func_name); long ariadne_count_waypoints_on_creature_route_to_target_f(const struct Thing *thing, const struct Coord3d *srcpos, const struct Coord3d *dstpos, AriadneRouteFlags flags, const char *func_name); AriadneReturn ariadne_invalidate_creature_route(struct Thing *thing); TbBool navigation_points_connected(struct Coord3d *pt1, struct Coord3d *pt2); void path_init8_wide_f(struct Path *path, long start_x, long start_y, long end_x, long end_y, long a6, unsigned char nav_size, const char *func_name); void nearest_search_f(long sizexy, long srcx, long srcy, long dstx, long dsty, long *px, long *py, const char *func_name); long get_navigation_colour(long stl_x, long stl_y); TbBool border_clip_horizontal(const unsigned char *imap, long a1, long a2, long a3, long a4); TbBool border_clip_vertical(const unsigned char *imap, long a1, long a2, long a3, long a4); TbBool edge_lock_f(long ptend_x, long ptend_y, long ptstart_x, long ptstart_y, const char *func_name); TbBool edge_unlock_record_and_regions_f(long ptend_x, long ptend_y, long ptstart_x, long ptstart_y, const char *func_name); void border_internal_points_delete(long a1, long a2, long a3, long a4); TbBool tri_set_rectangle(long start_x, long start_y, long end_x, long end_y, unsigned char a5); long fringe_get_rectangle(long *a1, long *a2, long *a3, long *a4, unsigned char *a5); long delaunay_seeded(long a1, long a2, long a3, long a4); void border_unlock(long a1, long a2, long a3, long a4); TbBool triangulation_border_start(long *a1, long *a2); void triangulation_init(void); void triangulation_initxy(long sx, long sy, long ex, long ey); long pointed_at8(long pos_x, long pos_y, long *ret_tri, long *ret_pt); long angle_to_quadrant(long angle); long thing_nav_block_sizexy(const struct Thing *thing); long thing_nav_sizexy(const struct Thing *thing); void clear_wallhugging_path(struct Navigation *navi); void initialise_wallhugging_path_from_to(struct Navigation *navi, struct Coord3d *mvstart, struct Coord3d *mvend); enum TriggerFlags { TrgF_NONE = 0x00, TrgF_REUSABLE = 0x01, TrgF_DISABLED = 0x02, }; #pragma pack(1) struct Thing; struct MemberPos { unsigned short stl_num; unsigned char flags; }; #pragma pack() struct Thing *get_highest_experience_and_score_creature_in_group(struct Thing *grptng); long get_no_creatures_in_group(const struct Thing *grptng); TbBool get_free_position_behind_leader(struct Thing *leadtng, struct Coord3d *pos); TbBool add_creature_to_group(struct Thing *crthing, struct Thing *grthing); long add_creature_to_group_as_leader(struct Thing *thing1, struct Thing *thing2); TbBool remove_creature_from_group(struct Thing *thing); TbBool remove_creature_from_group_without_leader_consideration(struct Thing *creatng); TbBool creature_is_group_member(const struct Thing *thing); TbBool creature_is_group_leader(const struct Thing *thing); struct Thing *get_group_leader(const struct Thing *thing); struct Thing *get_first_follower_creature_in_group(const struct Thing *grptng); struct Thing *get_last_follower_creature_in_group(const struct Thing *grptng); TbBool make_group_member_leader(struct Thing *leadtng); TbBool create_party(const char *prtname); int get_party_index_of_name(const char *prtname); TbBool add_member_to_party_name(const char *prtname, long crtr_model, long crtr_level, long carried_gold, long objctv_id, long countdown); long process_obey_leader(struct Thing *thing); void leader_find_positions_for_followers(struct Thing *leadtng); enum CreatureLiveStatistics { CrLStat_FirstName, CrLStat_BloodType, CrLStat_ExpLevel, CrLStat_Health, CrLStat_MaxHealth, CrLStat_Strength, CrLStat_Armour, CrLStat_Defence, CrLStat_Dexterity, CrLStat_Luck, CrLStat_Speed, CrLStat_Loyalty, CrLStat_AgeTime, CrLStat_Kills, CrLStat_GoldHeld, CrLStat_GoldWage, CrLStat_ResearchSkill, CrLStat_ManufactureSkill, CrLStat_TrainingSkill, CrLStat_ScavengeSkill, CrLStat_TrainingCost, CrLStat_ScavengeCost, CrLStat_BestDamage, CrLStat_Weight, CrLStat_Score, }; #pragma pack(1) struct Thing; struct SlabMap; typedef short CreatureLiveStatId; #pragma pack() extern const char *blood_types[15]; const char *thing_model_name(const struct Thing *thing); const char *thing_class_and_model_name(int class_id, int model); const char *thing_class_code_name(int class_id); const char *creatrtng_actstate_name(const struct Thing *thing); const char *creatrtng_realstate_name(const struct Thing *thing); TbBool things_stats_debug_dump(void); TbBool is_neutral_thing(const struct Thing *thing); TbBool is_hero_thing(const struct Thing *thing); long compute_creature_kind_score(ThingModel crkind,unsigned short crlevel); long compute_creature_max_pay(long base_pay,unsigned short crlevel); long compute_creature_max_health(long base_health,unsigned short crlevel); long compute_creature_attack_melee_damage(long base_param, long luck, unsigned short crlevel); long compute_creature_attack_spell_damage(long base_param,long luck,unsigned short crlevel); long project_creature_attack_melee_damage(long base_param,long luck,unsigned short crlevel); long project_creature_attack_spell_damage(long base_param,long luck,unsigned short crlevel); long compute_creature_attack_range(long base_param,long luck,unsigned short crlevel); long compute_creature_work_value(long base_param,long efficiency,unsigned short crlevel); long compute_creature_max_dexterity(long base_param,unsigned short crlevel); long compute_creature_max_defense(long base_param,unsigned short crlevel); long compute_creature_max_strength(long base_param,unsigned short crlevel); long compute_creature_max_loyalty(long base_param,unsigned short crlevel); long compute_creature_max_armour(long base_param, unsigned short crlevel, TbBool armour_spell); long compute_creature_max_unaffected(long base_param,unsigned short crlevel); long compute_controlled_speed_increase(long prev_speed, long speed_limit); long compute_controlled_speed_decrease(long prev_speed, long speed_limit); long compute_value_percentage(long base_val, short npercent); long compute_value_8bpercentage(long base_val, short npercent); long calculate_correct_creature_maxspeed(const struct Thing *thing); long calculate_correct_creature_pay(const struct Thing *thing); long calculate_correct_creature_scavenge_required(const struct Thing *thing, PlayerNumber callplyr_idx); long compute_creature_work_value_for_room_role(const struct Thing *creatng, RoomRole rrole, long efficiency); const char *creature_statistic_text(const struct Thing *creatng, CreatureLiveStatId cstat_id); long calculate_damage_did_to_slab_with_single_hit(const struct Thing *diggertng, const struct SlabMap *slb); long calculate_gold_digged_out_of_slab_with_single_hit(long damage_did_to_slab, PlayerNumber plyr_idx, unsigned short crlevel, const struct SlabMap *slb); HitPoints calculate_shot_real_damage_to_door(const struct Thing *doortng, const struct Thing *shotng); long get_radially_decaying_value(long magnitude,long decay_start,long decay_length,long distance); TbBool update_creature_health_to_max(struct Thing *thing); TbBool apply_health_to_thing(struct Thing *thing, long amount); void apply_health_to_thing_and_display_health(struct Thing *thing, long amount); HitPoints apply_damage_to_thing(struct Thing *thing, HitPoints dmg, DamageType damage_type, PlayerNumber dealing_plyr_idx); #pragma pack(1) struct Thing; struct PlayerInfo; enum CreatureSoundTypes { CrSnd_None = 0, CrSnd_Hurt = 1, CrSnd_Hit = 2, CrSnd_Happy = 3, CrSnd_Sad = 4, CrSnd_Hang = 5, CrSnd_Drop = 6, CrSnd_Torture = 7, CrSnd_Slap = 8, CrSnd_Die = 9, CrSnd_Foot = 10, CrSnd_Fight = 11, }; enum CreatureControlFlags { CCFlg_Exists = 0x01, CCFlg_NoCompControl = 0x02, CCFlg_PreventDamage = 0x04, CCFlg_Unknown08 = 0x08, CCFlg_Unknown10 = 0x10, CCFlg_IsInRoomList = 0x20, CCFlg_Unknown40 = 0x40, CCFlg_Unknown80 = 0x80, }; enum CreatureControlSpells { CCSpl_ChickenRel = 0x01, CCSpl_Freeze = 0x02, CCSpl_Teleport = 0x04, CCSpl_Unknown08 = 0x08, CCSpl_Unknown10 = 0x10, CCSpl_Unknown20 = 0x20, CCSpl_Unknown40 = 0x40, CCSpl_Unknown80 = 0x80, }; enum CreatureControlMoodFlags { CCMoo_None = 0x00, CCMoo_Angry = 0x01, CCMoo_Livid = 0x02, }; enum CreatureCombatFlags { CmbtF_Melee = 0x01, CmbtF_Ranged = 0x02, CmbtF_Waiting = 0x04, CmbtF_ObjctFight = 0x08, CmbtF_DoorFight = 0x10, CmbtF_Unknown20 = 0x20, CmbtF_Unknown40 = 0x40, CmbtF_Unknown80 = 0x80, }; enum CreatureAngerReasons { AngR_None = 0, AngR_NotPaid, AngR_Hungry, AngR_NoLair, AngR_Other, AngR_ListEnd, }; enum CreatureCombatStates { CmbtSt_Unset = 0, CmbtSt_Waiting, CmbtSt_Ranged, CmbtSt_Melee, }; enum ObjectCombatStates { ObjCmbtSt_Unset = 0, ObjCmbtSt_Melee, ObjCmbtSt_Ranged, }; struct CastedSpellData { unsigned char spkind; short duration; unsigned char field_3; }; struct CreatureControl { unsigned char index; unsigned char flgfield_1; unsigned char flgfield_2; unsigned char combat_flags; unsigned char party_objective; long field_5; short field_9; short opponents_melee[4]; short opponents_ranged[4]; unsigned char opponents_melee_count; unsigned char opponents_ranged_count; unsigned short players_prev_creature_idx; unsigned short players_next_creature_idx; unsigned short slap_turns; unsigned char explevel; long exp_points; long prev_exp_points; unsigned char field_2C; struct Coord3d moveto_pos; unsigned char field_33[2]; short field_35; unsigned char field_37[2]; long hunger_level; long temple_cure_gameturn; unsigned char hunger_amount; unsigned char hunger_loss; long field_43; unsigned char field_47; unsigned char field_48; unsigned char field_49; long annoy_untrained_turn; unsigned long last_roar_turn; long annoyance_level[5]; unsigned char mood_flags; unsigned char field_67; unsigned short lair_room_id; unsigned short lairtng_idx; short field_6C; short dragtng_idx; unsigned short arming_thing_id; unsigned short pickup_object_id; unsigned short pickup_creature_id; unsigned short next_in_group; unsigned short prev_in_group; unsigned short group_info; short last_work_room_id; short work_room_id; short target_room_id; long field_82; short field_86; unsigned char move_flags; union { struct { char target_plyr_idx; unsigned char byte_8Ax; long long_8B; unsigned char byte_8F; unsigned short member_pos_stl[5]; } party; struct { long stack_update_turn; short working_stl; unsigned short task_stl; unsigned short task_idx; unsigned char byte_93; unsigned char last_did_job; unsigned char task_stack_pos; unsigned short task_repeats; unsigned char field_98[2]; } digger; struct { short word_89; short word_8B; short word_8D; unsigned char byte_8F; unsigned short word_90[5]; } patrol; struct { char sbyte_89; unsigned char byte_8A; unsigned char byte_8B; unsigned char byte_8C; short word_8D; unsigned short word_8F; short word_91; short word_93; unsigned char field_95; unsigned char field_96[4]; }; struct { long long_89; long long_8D; long long_91; unsigned char field_95x; unsigned char field_96x[4]; }; }; union { struct { long start_gameturn; long long_9Ex; long long_A2x; short word_A6; unsigned char vis_state; } tortured; struct { long start_gameturn; long long_9Ex; long long_A2x; } idle; struct { unsigned char byte_9A; unsigned char byte_9B; unsigned char byte_9C; unsigned char byte_9D; unsigned char byte_9E; unsigned char byte_9F; unsigned char byte_A0; unsigned char byte_A1; unsigned char byte_A2; unsigned char byte_A3; unsigned char byte_A4; unsigned char byte_A5; }; struct { unsigned char byte_9A_scv; unsigned char byte_9B_scv; unsigned char byte_9C_scv; unsigned char stl_9D_x; unsigned char stl_9D_y; unsigned char byte_9F_scv; unsigned char byte_A0_scv; unsigned char byte_A1_scv; unsigned char byte_A2_scv; unsigned char byte_A3_scv; unsigned char byte_A4_scv; unsigned char byte_A5_scv; } scavenge; struct { unsigned char mode; unsigned char train_timeout; unsigned char pole_stl_x; unsigned char pole_stl_y; unsigned char search_timeout; short partner_idx; long partner_creation; unsigned char byte_A5x; } training; struct { long seen_enemy_turn; long battle_enemy_crtn; short battle_enemy_idx; short seen_enemy_idx; unsigned char state_id; unsigned char attack_type; unsigned char seen_enemy_los; } combat; struct { unsigned long start_gameturn; unsigned long last_mood_sound_turn; } imprison; struct { short word_9A; short word_9C; short word_9E; long long_A0; short word_A4; short word_A6; }; struct { short word_9A_cp2; long long_9C; long long_A0_cp2; short word_A4_cp2; short word_A6_cp2; }; struct { long long_9A; long long_9E; long long_A2; }; struct { unsigned long last_mood_sound_turn; long long_9E_cp2; long long_A2_cp2; short word_A6_cp3; }; struct { unsigned char byte_9A_cp2; long long_9B; short word_9F_cp2; long long_A1; unsigned char byte_A5_cp2; short word_A6_cp4; }; struct { unsigned char byte_9A_cp3; short word_9B; short word_9D; short word_9F; short word_A1; short word_A3; unsigned char byte_A5_cp3; short word_A6_cp5; }; }; unsigned char fight_til_death; unsigned char field_AA; unsigned char stateblock_flags; unsigned short spell_flags; unsigned char field_AE; short force_visible; unsigned char field_B1; long field_B2; unsigned char disease_caster_plyridx; unsigned char teleport_x; unsigned char teleport_y; unsigned short field_B9; struct CoordDelta3d moveaccel; unsigned char bloody_footsteps_turns; short kills_num; short max_speed; short max_health; short move_speed; short orthogn_speed; short field_CC; unsigned long field_CE; unsigned char instance_id; unsigned char inst_repeat; unsigned short inst_turn; unsigned short inst_action_turns; unsigned short inst_total_turns; unsigned short targtng_idx; unsigned char targtstl_x; unsigned char targtstl_y; unsigned long instance_use_turn[48]; char instance_available[48]; unsigned short instance_anim_step_turns; unsigned short collided_door_subtile; char fighting_player_idx; unsigned char shot_model; struct CastedSpellData casted_spells[5]; char active_instance_id; unsigned char field_1E9; struct Navigation navi; unsigned char field_211[6]; struct Ariadne arid; unsigned char active_state_bkp; unsigned char continue_state_bkp; unsigned char field_27F; short conscious_back_turns; short countdown_282; unsigned short field_284; unsigned char joining_age; unsigned char blood_type; struct Coord3d flee_pos; long start_turn_28E; struct MemberPos followers_pos[8]; unsigned short next_in_room; unsigned short prev_in_room; short field_2AE; unsigned char field_2B0; unsigned short job_assigned; unsigned short spell_tngidx_armour[3]; unsigned short spell_tngidx_disease[3]; unsigned char field_2BF[2]; unsigned short shot_shift_x; unsigned short shot_shift_y; unsigned short shot_shift_z; unsigned long tasks_check_turn; unsigned long wander_around_check_turn; unsigned long job_primary_check_turn; unsigned long job_secondary_check_turn; unsigned long healing_sleep_check_turn; unsigned long garden_eat_check_turn; unsigned long temple_pray_check_turn; unsigned long sulking_sleep_check_turn; unsigned long job_assigned_check_turn; unsigned long disease_start_turn; unsigned long armageddon_teleport_turn; short battle_prev_creatr; short battle_next_creatr; unsigned char battle_id; unsigned char alarm_stl_x; unsigned char alarm_stl_y; unsigned long field_2FA; unsigned long field_2FE; unsigned char field_302; long field_303; unsigned char field_307; }; struct CreatureStatsOLD { unsigned short job_primary; unsigned short job_secondary; unsigned short jobs_not_do; unsigned char eye_effect; unsigned short health; unsigned char heal_requirement; unsigned char heal_threshold; unsigned char strength; unsigned char armour; unsigned char dexterity; unsigned char fear_wounded; unsigned char defense; unsigned char luck; unsigned char sleep_recovery; unsigned short hunger_rate; unsigned char hunger_fill; unsigned short annoy_level; unsigned char lair_size; unsigned char hurt_by_lava; unsigned char sleep_exp_slab; unsigned char sleep_experience; short exp_for_hitting; short gold_hold; short training_cost; short scavenger_cost; short scavenge_require; unsigned char scavenge_value; unsigned long to_level[10]; unsigned char base_speed; short grow_up; unsigned char grow_up_level; unsigned char entrance_force; short max_angle_change; short eye_height; short field_57[14]; short field_73; unsigned short size_xy; unsigned short size_yz; unsigned short walking_anim_speed; unsigned char flying; unsigned char immune_to_gas; unsigned char attack_preference; short field_of_view; unsigned char learned_instance_id[10]; unsigned char learned_instance_level[10]; unsigned char research_value; unsigned char humanoid_creature; unsigned char piss_on_dead; unsigned char training_value; short pay; unsigned char manufacture_value; unsigned char hearing; unsigned char entrance_rooms[3]; unsigned char entrance_slabs_req[3]; unsigned char visual_range; unsigned char partner_training; short torture_time; short annoy_no_lair; short annoy_no_hatchery; short annoy_woken_up; short annoy_on_dead_friend; short annoy_sulking; short annoy_no_salary; short annoy_slapped; short annoy_on_dead_enemy; short annoy_in_temple; short annoy_sleeping; short annoy_got_wage; short annoy_in_torture; short annoy_win_battle; short annoy_untrained_time; short annoy_untrained; short field_C4; short annoy_queue; short annoy_will_not_do_job; unsigned short job_stress; short annoy_job_stress; unsigned short jobs_anger; short annoy_others_leaving; unsigned char slaps_to_kill; short lair_enemy; short hero_vs_keeper_cost; unsigned char rebirth; unsigned char can_see_invisible; unsigned char can_go_locked_doors; unsigned char bleeds; unsigned char affected_by_wind; unsigned short thing_size_xy; unsigned short thing_size_yz; short annoy_eat_food; short annoy_in_hand; short damage_to_boulder; }; struct CreatureStats { unsigned short job_primary; unsigned short job_secondary; unsigned short jobs_not_do; unsigned char eye_effect; unsigned short health; unsigned char heal_requirement; unsigned char heal_threshold; unsigned char strength; unsigned char armour; unsigned char dexterity; unsigned char fear_wounded; unsigned char defense; unsigned char luck; unsigned char sleep_recovery; unsigned short hunger_rate; unsigned char hunger_fill; unsigned short annoy_level; unsigned char lair_size; unsigned char hurt_by_lava; unsigned char sleep_exp_slab; unsigned char sleep_experience; short exp_for_hitting; short gold_hold; short training_cost; short scavenger_cost; short scavenge_require; unsigned char scavenge_value; unsigned long to_level[10]; unsigned char base_speed; short grow_up; unsigned char grow_up_level; unsigned char entrance_force; short max_angle_change; short eye_height; short field_57[14]; short field_73; unsigned short size_xy; unsigned short size_yz; unsigned short walking_anim_speed; unsigned char flying; unsigned char immune_to_gas; unsigned char attack_preference; short field_of_view; unsigned char learned_instance_id[10]; unsigned char learned_instance_level[10]; unsigned char research_value; unsigned char humanoid_creature; unsigned char piss_on_dead; unsigned char training_value; short pay; unsigned char manufacture_value; unsigned char hearing; unsigned char entrance_rooms[3]; unsigned char entrance_slabs_req[3]; unsigned char visual_range; unsigned char partner_training; short torture_break_time; short annoy_no_lair; short annoy_no_hatchery; short annoy_woken_up; short annoy_on_dead_friend; short annoy_sulking; short annoy_no_salary; short annoy_slapped; short annoy_on_dead_enemy; short annoy_in_temple; short annoy_sleeping; short annoy_got_wage; short annoy_in_torture; short annoy_win_battle; short annoy_untrained_time; short annoy_untrained; short field_C4; short annoy_queue; short annoy_will_not_do_job; unsigned short job_stress; short annoy_job_stress; unsigned short jobs_anger; short annoy_others_leaving; unsigned char slaps_to_kill; short lair_enemy; short hero_vs_keeper_cost; unsigned char rebirth; unsigned char can_see_invisible; unsigned char can_go_locked_doors; unsigned char bleeds; unsigned char affected_by_wind; unsigned short thing_size_xy; unsigned short thing_size_yz; short annoy_eat_food; short annoy_in_hand; short damage_to_boulder; unsigned short fear_stronger; unsigned short fearsome_factor; short entrance_score; short annoy_going_postal; short toking_recovery; }; struct Persons { struct CreatureControl *cctrl_lookup[256]; struct CreatureControl *cctrl_end; }; struct CreatureSound { long index; long count; }; struct CreatureSounds { struct CreatureSound foot; struct CreatureSound hit; struct CreatureSound happy; struct CreatureSound sad; struct CreatureSound hurt; struct CreatureSound die; struct CreatureSound hang; struct CreatureSound drop; struct CreatureSound torture; struct CreatureSound slap; struct CreatureSound fight; }; #pragma pack() extern struct CreatureSounds creature_sounds[]; struct CreatureControl *creature_control_get(long cctrl_idx); struct CreatureControl *creature_control_get_from_thing(const struct Thing *thing); TbBool creature_control_invalid(const struct CreatureControl *cctrl); TbBool creature_control_exists(const struct CreatureControl *cctrl); TbBool creature_control_exists_in_thing(const struct Thing *thing); void clear_creature_instance(struct Thing *thing); long i_can_allocate_free_control_structure(void); struct CreatureControl *allocate_free_control_structure(void); void delete_control_structure(struct CreatureControl *cctrl); void delete_all_control_structures(void); struct Thing *create_and_control_creature_as_controller(struct PlayerInfo *player, long a2, struct Coord3d *pos); TbBool disband_creatures_group(struct Thing *thing); struct Thing *get_group_last_member(struct Thing *thing); void play_creature_sound(struct Thing *thing, long snd_idx, long a3, long a4); void stop_creature_sound(struct Thing *thing, long snd_idx); void play_creature_sound_and_create_sound_thing(struct Thing *thing, long snd_idx, long a2); struct CreatureSound *get_creature_sound(struct Thing *thing, long snd_idx); void reset_creature_eye_lens(struct Thing *thing); TbBool creature_can_gain_experience(const struct Thing *thing); #pragma pack(1) struct StructureList; enum ShadowCacheFlags { ShCF_Allocated = 0x01, }; enum LightFlags { LgtF_Allocated = 0x01, LgtF_Unkn02 = 0x02, LgtF_Dynamic = 0x04, LgtF_Unkn08 = 0x08, }; struct Light { unsigned char flags; unsigned char field_1; unsigned char field_2; unsigned char field_3[2]; unsigned char range; unsigned char field_6; unsigned short field_7; unsigned char field_9[5]; unsigned short index; unsigned short shadow_index; long field_12; unsigned short field_16; short field_18; short field_1A; unsigned char field_1C[10]; unsigned short field_26; struct Coord3d mappos; }; struct InitLight { short field_0; unsigned char field_2; unsigned char field_3; short field_4; short field_6; short field_8; struct Coord3d mappos; unsigned char field_10; unsigned char is_dynamic; short field_12; }; struct LightSystemState { long bitmask[32]; long static_light_needs_updating; long total_dynamic_lights; long total_stat_lights; long rendered_dynamic_lights; long rendered_optimised_dynamic_lights; long updated_stat_lights; long out_of_date_stat_lights; }; __attribute__((dllimport)) long _DK_light_bitmask[32]; __attribute__((dllimport)) long _DK_stat_light_needs_updating; __attribute__((dllimport)) long _DK_light_total_dynamic_lights; __attribute__((dllimport)) long _DK_light_total_stat_lights; __attribute__((dllimport)) long _DK_light_rendered_dynamic_lights; __attribute__((dllimport)) long _DK_light_rendered_optimised_dynamic_lights; __attribute__((dllimport)) long _DK_light_updated_stat_lights; __attribute__((dllimport)) long _DK_light_out_of_date_stat_lights; #pragma pack() void clear_stat_light_map(void); void update_light_render_area(void); void light_delete_light(long idx); void light_initialise_lighting_tables(void); void light_initialise(void); void light_turn_light_off(long num); void light_turn_light_on(long num); long light_get_light_intensity(long idx); long light_set_light_intensity(long a1, long a2); long light_create_light(struct InitLight *ilght); void light_set_light_never_cache(long lgt_id); long light_is_light_allocated(long lgt_id); void light_set_light_position(long lgt_id, struct Coord3d *pos); void light_set_lights_on(char state); void light_set_light_minimum_size_to_cache(long a1, long a2, long a3); void light_signal_update_in_area(long sx, long sy, long ex, long ey); long light_get_total_dynamic_lights(void); void light_export_system_state(struct LightSystemState *lightst); void light_import_system_state(const struct LightSystemState *lightst); TbBool lights_stats_debug_dump(void); enum GameSystemFlags { GSF_NetworkActive = 0x0001, GSF_NetGameNoSync = 0x0002, GSF_NetSeedNoSync = 0x0004, GSF_CaptureMovie = 0x0008, GSF_CaptureSShot = 0x0010, GSF_AllowOnePlayer = 0x0040, GSF_RunAfterVictory = 0x0080, }; enum GameGUIFlags { GGUI_CountdownTimer = 0x0002, }; enum ClassicBugFlags { ClscBug_None = 0x0000, ClscBug_ResurrectForever = 0x0001, ClscBug_Overflow8bitVal = 0x0002, ClscBug_ClaimRoomAllThings = 0x0004, ClscBug_ResurrectRemoved = 0x0008, ClscBug_NoHandPurgeOnDefeat = 0x0010, ClscBug_MustObeyKeepsNotDoJobs = 0x0020, ClscBug_BreakNeutralWalls = 0x0040, }; #pragma pack(1) struct PlayerInfo; struct TextScrollWindow { char text[1024]; long start_y; char action; long text_height; long window_height; }; struct IntralevelData { unsigned char bonuses_found[6]; struct CreatureStorage transferred_creature; long campaign_flags[5][8]; }; struct GameAdd { struct CreatureStats creature_stats[64]; unsigned long turn_last_checked_for_gold; unsigned long flee_zone_radius; unsigned long time_between_prison_break; unsigned long time_in_prison_without_break; unsigned char prison_break_chance; unsigned short game_turns_unconscious; long critical_health_permil; long friendly_fight_area_damage_permil; long friendly_fight_area_range_permil; unsigned char torture_convert_chance; TbBool scavenge_good_allowed; TbBool scavenge_neutral_allowed; TbBool armegeddon_teleport_neutrals; unsigned short classic_bugs_flags; unsigned short computer_chat_flags; ThingModel cheaper_diggers_sacrifice_model; char quick_messages[50][1024]; struct SacrificeRecipe sacrifice_recipes[60]; struct LightSystemState lightst; }; #pragma pack() extern struct GameAdd gameadd; extern struct IntralevelData intralvl; LevelNumber get_loaded_level_number(void); LevelNumber set_loaded_level_number(LevelNumber lvnum); LevelNumber get_continue_level_number(void); LevelNumber set_continue_level_number(LevelNumber lvnum); LevelNumber get_selected_level_number(void); LevelNumber set_selected_level_number(LevelNumber lvnum); TbBool activate_bonus_level(struct PlayerInfo *player); TbBool is_bonus_level_visible(struct PlayerInfo *player, long bn_lvnum); void hide_all_bonus_levels(struct PlayerInfo *player); unsigned short get_extra_level_kind_visibility(unsigned short elv_kind); short is_extra_level_visible(struct PlayerInfo *player, long ex_lvnum); void update_extra_levels_visibility(void); TbBool set_bonus_level_visibility_for_singleplayer_level(struct PlayerInfo *player, unsigned long sp_lvnum, short visible); enum SaveGameChunks { SGC_InfoBlock = 0x4F464E49, SGC_GameOrig = 0x53444C4F, SGC_GameAdd = 0x44444147, SGC_PacketHeader = 0x52444850, SGC_PacketData = 0x544B4350, SGC_IntralevelData = 0x4C564C49, }; enum SaveGameChunkFlags { SGF_InfoBlock = 0x0001, SGF_GameOrig = 0x0002, SGF_GameAdd = 0x0004, SGF_PacketHeader = 0x0100, SGF_PacketData = 0x0200, SGF_IntralevelData = 0x0400, }; enum GameLoadStatus { GLoad_Failed = 0, GLoad_SavedGame, GLoad_ContinueGame, GLoad_PacketStart, GLoad_PacketContinue, }; #pragma pack(1) struct Game; enum CatalogueEntryFlags { CEF_InUse = 0x0001, }; struct CatalogueEntry { unsigned short flags; unsigned long version; char textname[15]; LevelNumber level_num; char campaign_name[160]; char campaign_fname[144]; char player_name[64]; }; struct FileChunkHeader { unsigned long len; unsigned long id; unsigned long ver; }; __attribute__((dllimport)) extern int _DK_number_of_saved_games; #pragma pack() extern long const VersionMajor; extern long const VersionMinor; extern struct CatalogueEntry save_game_catalogue[]; int load_game_chunks(TbFileHandle fhandle,struct CatalogueEntry *centry); TbBool fill_game_catalogue_entry(struct CatalogueEntry *centry,const char *textname); TbBool save_game_chunks(TbFileHandle fhandle,struct CatalogueEntry *centry); TbBool save_packet_chunks(TbFileHandle fhandle,struct CatalogueEntry *centry); TbBool load_game(long slot_idx); TbBool save_game(long slot_idx); TbBool initialise_load_game_slots(void); int count_valid_saved_games(void); TbBool is_save_game_loadable(long slot_num); TbBool save_catalogue_slot_disable(unsigned int slot_idx); TbBool save_game_save_catalogue(void); TbBool load_game_save_catalogue(void); TbBool fill_game_catalogue_slot(long slot_num,const char *textname); TbBool set_transfered_creature(PlayerNumber plyr_idx, ThingModel model, long explevel); void clear_transfered_creature(void); LevelNumber move_campaign_to_next_level(void); LevelNumber move_campaign_to_prev_level(void); TbBool continue_game_available(void); short load_continue_game(void); short save_continue_game(LevelNumber lv_num); short read_continue_game_part(unsigned char *buf,long pos,long buf_len); #pragma pack(1) struct UnkStruc6 { unsigned char field_0; unsigned char field_1; unsigned char field_2; unsigned char field_3; unsigned long field_4; }; struct ShadowCache { unsigned char flags; unsigned char field_1[127]; unsigned char field_80; }; struct LightsShadows { struct UnkStruc6 field_1DD41[1024]; unsigned char shadow_limits[2048]; struct Light lights[400]; struct ShadowCache shadow_cache[40]; unsigned short stat_light_map[256*256]; long field_46149; char field_4614D; char field_4614E; int field_4614F; int field_46153; unsigned short subtile_lightness[256*256]; }; #pragma pack() long get_subtile_lightness(const struct LightsShadows * lish, MapSubtlCoord stl_x, MapSubtlCoord stl_y); void clear_subtiles_lightness(struct LightsShadows * lish); void create_shadow_limits(struct LightsShadows * lish, long start, long end); void clear_shadow_limits(struct LightsShadows * lish); void clear_light_system(struct LightsShadows * lish); #pragma pack(1) struct Thing; struct PlayerInfo; struct CreatureBattle { unsigned long fighters_num; unsigned char field_4[9]; unsigned short first_creatr; unsigned short last_creatr; }; #pragma pack() __attribute__((dllimport)) extern unsigned short _DK_friendly_battler_list[3*8]; __attribute__((dllimport)) extern unsigned short _DK_enemy_battler_list[3*8]; struct CreatureBattle *creature_battle_get(BattleIndex battle_id); struct CreatureBattle *creature_battle_get_from_thing(const struct Thing *thing); TbBool creature_battle_invalid(const struct CreatureBattle *battle); TbBool creature_battle_exists(BattleIndex battle_idx); BattleIndex find_first_battle_of_mine(PlayerNumber plyr_idx); BattleIndex find_last_battle_of_mine(PlayerNumber plyr_idx); BattleIndex find_next_battle_of_mine(PlayerNumber plyr_idx, BattleIndex prev_idx); BattleIndex find_previous_battle_of_mine(PlayerNumber plyr_idx, BattleIndex next_idx); BattleIndex find_next_battle_of_mine_excluding_current_list(PlayerNumber plyr_idx, BattleIndex prev_idx); BattleIndex find_previous_battle_of_mine_excluding_current_list(PlayerNumber plyr_idx, BattleIndex next_idx); TbBool has_melee_combat_attackers(struct Thing *victim); TbBool can_add_melee_combat_attacker(struct Thing *victim); TbBool has_ranged_combat_attackers(const struct Thing *victim); TbBool can_add_ranged_combat_attacker(const struct Thing *victim); void setup_combat_flee_position(struct Thing *thing); long get_flee_position(struct Thing *creatng, struct Coord3d *pos); void set_creature_in_combat(struct Thing *fightng, struct Thing *enmtng, CrAttackType attack_type); long get_combat_state_for_combat(struct Thing *fightng, struct Thing *enmtng, CrAttackType attack_pref); TbBool active_battle_exists(PlayerNumber plyr_idx); void maintain_my_battle_list(void); TbBool step_battles_forward(PlayerNumber plyr_idx); long battle_move_player_towards_battle(struct PlayerInfo *player, BattleIndex battle_id); void battle_initialise(void); enum SlabTypes { SlbT_ROCK = 0, SlbT_GOLD = 1, SlbT_EARTH = 2, SlbT_TORCHDIRT = 3, SlbT_WALLDRAPE = 4, SlbT_WALLTORCH = 5, SlbT_WALLWTWINS = 6, SlbT_WALLWWOMAN = 7, SlbT_WALLPAIRSHR = 8, SlbT_PATH = 10, SlbT_CLAIMED = 11, SlbT_LAVA = 12, SlbT_WATER = 13, SlbT_ENTRANCE = 14, SlbT_TREASURE = 16, SlbT_LIBRARY = 18, SlbT_PRISON = 20, SlbT_TORTURE = 22, SlbT_TRAINING = 24, SlbT_DUNGHEART = 26, SlbT_WORKSHOP = 28, SlbT_SCAVENGER = 30, SlbT_TEMPLE = 32, SlbT_GRAVEYARD = 34, SlbT_GARDEN = 36, SlbT_LAIR = 38, SlbT_BARRACKS = 40, SlbT_DOORWOOD1 = 42, SlbT_DOORWOOD2 = 43, SlbT_DOORBRACE1 = 44, SlbT_DOORBRACE2 = 45, SlbT_DOORIRON1 = 46, SlbT_DOORIRON2 = 47, SlbT_DOORMAGIC1 = 48, SlbT_DOORMAGIC2 = 49, SlbT_BRIDGE = 51, SlbT_GEMS = 52, SlbT_GUARDPOST = 53, }; #pragma pack(1) struct PlayerInfo; struct Thing; struct SlabMap { SlabKind kind; short next_in_room; unsigned char room_index; unsigned char health; unsigned char field_5; }; struct SlabSet { short col_idx[9]; }; struct SlabObj { unsigned char field_0; short field_1; unsigned char field_3; short field_4; short field_6; short field_8; unsigned char field_A; unsigned char sofield_B; unsigned char sofield_C; }; #pragma pack() extern const short around_slab[]; extern const short small_around_slab[]; SlabCodedCoords get_slab_number(MapSlabCoord slb_x, MapSlabCoord slb_y); MapSlabCoord slb_num_decode_x(SlabCodedCoords slb_num); MapSlabCoord slb_num_decode_y(SlabCodedCoords slb_num); TbBool slab_kind_is_animated(SlabKind slbkind); struct SlabMap *get_slabmap_block(MapSlabCoord slb_x, MapSlabCoord slb_y); struct SlabMap *get_slabmap_for_subtile(MapSubtlCoord stl_x, MapSubtlCoord stl_y); struct SlabMap *get_slabmap_direct(SlabCodedCoords slab_num); struct SlabMap *get_slabmap_thing_is_on(const struct Thing *thing); TbBool slabmap_block_invalid(const struct SlabMap *slb); TbBool slab_coords_invalid(MapSlabCoord slb_x, MapSlabCoord slb_y); long slabmap_owner(const struct SlabMap *slb); void slabmap_set_owner(struct SlabMap *slb, PlayerNumber owner); void set_whole_slab_owner(MapSlabCoord slb_x, MapSlabCoord slb_y, PlayerNumber owner); PlayerNumber get_slab_owner_thing_is_on(const struct Thing *thing); unsigned long slabmap_wlb(struct SlabMap *slb); void slabmap_set_wlb(struct SlabMap *slb, unsigned long wlbflag); long get_next_slab_number_in_room(SlabCodedCoords slab_num); long calculate_effeciency_score_for_room_slab(SlabCodedCoords slab_num, PlayerNumber plyr_idx); TbBool slab_is_safe_land(PlayerNumber plyr_idx, MapSlabCoord slb_x, MapSlabCoord slb_y); TbBool slab_is_door(MapSlabCoord slb_x, MapSlabCoord slb_y); TbBool slab_is_liquid(MapSlabCoord slb_x, MapSlabCoord slb_y); TbBool can_build_room_at_slab(PlayerNumber plyr_idx, RoomKind rkind, MapSlabCoord slb_x, MapSlabCoord slb_y); void clear_slabs(void); void reveal_whole_map(struct PlayerInfo *player); void update_blocks_in_area(MapSubtlCoord sx, MapSubtlCoord sy, MapSubtlCoord ex, MapSubtlCoord ey); void update_blocks_around_slab(MapSlabCoord slb_x, MapSlabCoord slb_y); void update_map_collide(SlabKind slbkind, MapSubtlCoord stl_x, MapSubtlCoord stl_y); void copy_block_with_cube_groups(short itm_idx, MapSubtlCoord stl_x, MapSubtlCoord stl_y); void do_slab_efficiency_alteration(MapSlabCoord slb_x, MapSlabCoord slb_y); void do_unprettying(PlayerNumber plyr_idx, MapSlabCoord slb_x, MapSlabCoord slb_y); #pragma pack(1) enum ActionPointFlags { AptF_Exists = 0x01, }; struct InitActionPoint { struct Coord2d mappos; unsigned short range; unsigned short num; }; struct ActionPoint { unsigned char flags; struct Coord2d mappos; unsigned short range; unsigned short num; unsigned char activated; }; #pragma pack() struct ActionPoint *allocate_free_action_point_structure_with_number(long apt_num); struct ActionPoint *actnpoint_create_actnpoint(struct InitActionPoint *iapt); struct ActionPoint *action_point_get(ActionPointId apt_idx); struct ActionPoint *action_point_get_by_number(long apt_num); TbBool action_point_exists(const struct ActionPoint *apt); TbBool action_point_exists_idx(ActionPointId apt_idx); TbBool action_point_exists_number(long apt_num); ActionPointId action_point_number_to_index(long apt_num); TbBool action_point_is_invalid(const struct ActionPoint *apt); TbBool action_point_reset_idx(ActionPointId apt_idx); unsigned long get_action_point_activated_by_players_mask(ActionPointId apt_idx); void clear_action_points(void); void delete_all_action_point_structures(void); TbBool process_action_points(void); #pragma pack(1) enum MapCoordClipFlags { MapCoord_None = 0x00, MapCoord_ClipX = 0x01, MapCoord_ClipY = 0x02, MapCoord_ClipZ = 0x04, }; struct Map { unsigned char flags; unsigned long data; }; #pragma pack() extern struct Map bad_map_block; extern const long map_to_slab[]; extern MapSubtlCoord map_subtiles_x; extern MapSubtlCoord map_subtiles_y; extern MapSubtlCoord map_subtiles_z; extern MapSlabCoord map_tiles_x; extern MapSlabCoord map_tiles_y; extern long navigation_map_size_x; extern long navigation_map_size_y; extern unsigned char *IanMap; extern long nav_map_initialised; struct Map *get_map_block_at(MapSubtlCoord stl_x, MapSubtlCoord stl_y); struct Map *get_map_block_at_pos(long stl_num); TbBool map_block_invalid(const struct Map *mapblk); void reveal_map_subtile(MapSubtlCoord stl_x, MapSubtlCoord stl_y, PlayerNumber plyr_idx); TbBool subtile_revealed(MapSubtlCoord stl_x, MapSubtlCoord stl_y, PlayerNumber plyr_idx); void reveal_map_block(struct Map *mapblk, PlayerNumber plyr_idx); TbBool map_block_revealed(const struct Map *mapblk, PlayerNumber plyr_idx); TbBool map_block_revealed_bit(const struct Map *mapblk, long plyr_bit); TbBool valid_dig_position(PlayerNumber plyr_idx, long stl_x, long stl_y); long get_ceiling_height(const struct Coord3d *pos); long get_mapwho_thing_index(const struct Map *mapblk); void set_mapwho_thing_index(struct Map *map, long thing_idx); long get_mapblk_column_index(const struct Map *map); void set_mapblk_column_index(struct Map *map, long column_idx); long get_mapblk_filled_subtiles(const struct Map *mapblk); void set_mapblk_filled_subtiles(struct Map *map, long height); long get_mapblk_wibble_value(const struct Map *mapblk); void set_mapblk_wibble_value(struct Map *mapblk, long wib); unsigned long get_navigation_map(MapSubtlCoord stl_x, MapSubtlCoord stl_y); void set_navigation_map(MapSubtlCoord stl_x, MapSubtlCoord stl_y, unsigned long navcolour); unsigned long get_navigation_map_floor_height(MapSubtlCoord stl_x, MapSubtlCoord stl_y); TbBool set_coords_with_clip(struct Coord3d *pos, MapCoord cor_x, MapCoord cor_y, MapCoord cor_z); TbBool subtile_has_slab(MapSubtlCoord stl_x, MapSubtlCoord stl_y); TbBool subtile_coords_invalid(MapSubtlCoord stl_x, MapSubtlCoord stl_y); TbBool set_coords_to_subtile_center(struct Coord3d *pos, MapSubtlCoord stl_x, MapSubtlCoord stl_y, MapSubtlCoord stl_z); TbBool set_coords_to_subtile_start(struct Coord3d *pos, long x, long y, long z); TbBool set_coords_to_subtile_end(struct Coord3d *pos, long x, long y, long z); TbBool set_coords_to_slab_center(struct Coord3d *pos, MapSubtlCoord slb_x, MapSubtlCoord slb_y); TbBool set_coords_to_cylindric_shift(struct Coord3d *pos, const struct Coord3d *source, long radius, long angle, long z); TbBool set_coords_add_velocity(struct Coord3d *pos, const struct Coord3d *source, const struct CoordDelta3d *velocity, unsigned short flags); SubtlCodedCoords get_subtile_number(MapSubtlCoord stl_x, MapSubtlCoord stl_y); SubtlCodedCoords get_subtile_number_at_slab_center(long slb_x, long slb_y); MapSubtlCoord stl_num_decode_x(SubtlCodedCoords stl_num); MapSubtlCoord stl_num_decode_y(SubtlCodedCoords stl_num); MapSubtlCoord stl_slab_center_subtile(MapSubtlCoord stl_v); MapSubtlCoord stl_slab_starting_subtile(MapSubtlCoord stl_v); MapSubtlCoord stl_slab_ending_subtile(MapSubtlCoord stl_v); TbBool map_pos_is_lava(MapSubtlCoord stl_x, MapSubtlCoord stl_y); TbBool lava_at_position(const struct Coord3d *pos); TbBool subtile_is_room(MapSubtlCoord stl_x, MapSubtlCoord stl_y); TbBool subtile_is_player_room(PlayerNumber plyr_idx, MapSubtlCoord stl_x, MapSubtlCoord stl_y); TbBool subtile_is_sellable_room(PlayerNumber plyr_idx, MapSubtlCoord stl_x, MapSubtlCoord stl_y); TbBool subtile_is_door(MapSubtlCoord stl_x, MapSubtlCoord stl_y); TbBool subtile_is_diggable_for_player(PlayerNumber plyr_idx, MapSubtlCoord stl_x, MapSubtlCoord stl_y); void clear_dig_for_map_rect(long plyr_idx,MapSubtlCoord start_x,MapSubtlCoord end_x,MapSubtlCoord start_y,MapSubtlCoord end_y); void clear_slab_dig(long a1, long a2, char a3); void reveal_map_rect(PlayerNumber plyr_idx,MapSubtlCoord start_x,MapSubtlCoord end_x,MapSubtlCoord start_y,MapSubtlCoord end_y); void reveal_map_area(PlayerNumber plyr_idx,MapSubtlCoord start_x,MapSubtlCoord end_x,MapSubtlCoord start_y,MapSubtlCoord end_y); void clear_mapwho(void); void clear_mapmap(void); #pragma pack(1) struct Map; struct Column { short use; unsigned char bitfields; unsigned short solidmask; unsigned short baseblock; unsigned char orient; unsigned short cubes[8]; }; struct Columns { struct Column *lookup[2048]; struct Column *end; }; #pragma pack() struct Column *get_column_at(MapSubtlCoord stl_x, MapSubtlCoord stl_y); struct Column *get_map_column(const struct Map *map); struct Column *get_column(long idx); TbBool column_invalid(const struct Column *col); void make_solidmask(struct Column *col); void clear_columns(void); void init_columns(void); long find_column(struct Column *col); long create_column(struct Column *col); unsigned short find_column_height(struct Column *col); void init_whole_blocks(void); void init_top_texture_to_cube_table(void); long get_column_floor_filled_subtiles(const struct Column *col); long get_map_floor_filled_subtiles(const struct Map *mapblk); long get_floor_filled_subtiles_at(MapSubtlCoord stl_x, MapSubtlCoord stl_y); void set_column_floor_filled_subtiles(struct Column *col, MapSubtlCoord n); void set_map_floor_filled_subtiles(struct Map *mapblk, MapSubtlCoord n); long get_column_ceiling_filled_subtiles(const struct Column *col); long get_map_ceiling_filled_subtiles(const struct Map *mapblk); long get_ceiling_filled_subtiles_at(MapSubtlCoord stl_x, MapSubtlCoord stl_y); void set_column_ceiling_filled_subtiles(struct Column *col, MapSubtlCoord n); void set_map_ceiling_filled_subtiles(struct Map *mapblk, MapSubtlCoord n); TbBool map_pos_solid_at_ceiling(MapSubtlCoord stl_x, MapSubtlCoord stl_y); long get_top_cube_at_pos(long mpos); long get_top_cube_at(MapSubtlCoord stl_x, MapSubtlCoord stl_y, long *cube_pos); long get_map_floor_height(const struct Map *mapblk); long get_floor_height(MapSubtlCoord stl_x, MapSubtlCoord stl_y); long get_floor_height_at(const struct Coord3d *pos); long get_map_ceiling_height(const struct Map *mapblk); long get_ceiling_height_at(const struct Coord3d *pos); TbBool cube_is_water(long cube_id); TbBool cube_is_lava(long cube_id); TbBool cube_is_sacrificial(long cube_id); TbBool subtile_has_water_on_top(MapSubtlCoord stl_x, MapSubtlCoord stl_y); TbBool subtile_has_lava_on_top(MapSubtlCoord stl_x, MapSubtlCoord stl_y); TbBool subtile_has_sacrificial_on_top(MapSubtlCoord stl_x, MapSubtlCoord stl_y); enum SpellKinds { SplK_None = 0, SplK_Fireball, SplK_FireBomb, SplK_Freeze, SplK_Armour, SplK_Lightning, SplK_Rebound, SplK_Heal, SplK_PoisonCloud, SplK_Invisibility, SplK_Teleport, SplK_Speed, SplK_Slow, SplK_Drain, SplK_Fear, SplK_Missile, SplK_NavigMissile, SplK_FlameBreath, SplK_Wind, SplK_Light, SplK_Fly, SplK_Sight, SplK_Grenade, SplK_Hailstorm, SplK_WordOfPower, SplK_CrazyGas, SplK_Disease, SplK_Chicken, SplK_TimeBomb, }; enum CreatureSpellAffectedFlags { CSAfF_Slow = 0x0001, CSAfF_Speed = 0x0002, CSAfF_Armour = 0x0004, CSAfF_Rebound = 0x0008, CSAfF_Flying = 0x0010, CSAfF_Invisibility = 0x0020, CSAfF_Sight = 0x0040, CSAfF_Unkn0080 = 0x0080, CSAfF_Disease = 0x0100, CSAfF_Chicken = 0x0200, CSAfF_PoisonCloud = 0x0400, CSAfF_CalledToArms = 0x0800, CSAfF_MadKilling = 0x1000, CSAfF_MagicFall = 0x2000, CSAfF_ExpLevelUp = 0x4000, CSAfF_Grounded = 0x8000, }; enum PowerKinds { PwrK_None = 0, PwrK_HAND, PwrK_MKDIGGER, PwrK_OBEY, PwrK_SLAP, PwrK_SIGHT, PwrK_CALL2ARMS, PwrK_CAVEIN, PwrK_HEALCRTR, PwrK_HOLDAUDNC, PwrK_LIGHTNING, PwrK_SPEEDCRTR, PwrK_PROTECT, PwrK_CONCEAL, PwrK_DISEASE, PwrK_CHICKEN, PwrK_DESTRWALLS, PwrK_TIMEBOMB, PwrK_POSSESS, PwrK_ARMAGEDDON, PwrK_PICKUPCRTR, PwrK_PICKUPGOLD, PwrK_PICKUPFOOD, }; enum ShotModelFlags { ShMF_Slappable = 0x0001, ShMF_Navigable = 0x0002, ShMF_Boulder = 0x0004, }; enum PowerCanCastFlags { PwCast_None = 0x00000000, PwCast_CustodyCrtrs = 0x00000001, PwCast_OwnedCrtrs = 0x00000002, PwCast_AlliedCrtrs = 0x00000004, PwCast_EnemyCrtrs = 0x00000008, PwCast_NConscCrtrs = 0x00000010, PwCast_BoundCrtrs = 0x00000020, PwCast_UnclmdGround = 0x00000080, PwCast_NeutrlGround = 0x00000100, PwCast_OwnedGround = 0x00000200, PwCast_AlliedGround = 0x00000400, PwCast_EnemyGround = 0x00000800, PwCast_NeutrlTall = 0x00001000, PwCast_OwnedTall = 0x00002000, PwCast_AlliedTall = 0x00004000, PwCast_EnemyTall = 0x00008000, PwCast_OwnedFood = 0x00020000, PwCast_NeutrlFood = 0x00040000, PwCast_EnemyFood = 0x00080000, PwCast_OwnedGold = 0x00100000, PwCast_NeutrlGold = 0x00200000, PwCast_EnemyGold = 0x00400000, PwCast_OwnedSpell = 0x00800000, PwCast_OwnedBoulders = 0x01000000, PwCast_NeedsDelay = 0x04000000, PwCast_Claimable = 0x08000000, PwCast_Unrevealed = 0x10000000, PwCast_RevealedTemp = 0x20000000, PwCast_ThingOrMap = 0x40000000, PwCast_Anywhere = 0x80000000, }; enum PowerConfigFlags { PwCF_Instinctive = 0x0001, PwCF_HasProgress = 0x0002, PwCF_IsParent = 0x0004, }; struct SpellConfigStats { char code_name[32]; }; struct ShotConfigStats { char code_name[32]; unsigned long model_flags; HitPoints health; MapCoordDelta area_range; HitPoints area_damage; ThingHitType area_hit_type; MapCoordDelta area_blow; DamageType damage_type; struct ShotStats *old; }; typedef unsigned char (*Expand_Check_Func)(void); struct PowerConfigStats { char code_name[32]; ThingModel artifact_model; unsigned long can_cast_flags; unsigned long config_flags; Expand_Check_Func overcharge_check; long work_state; PowerKind parent_power; short bigsym_sprite_idx; short medsym_sprite_idx; unsigned short name_stridx; unsigned short tooltip_stridx; short select_sample_idx; short pointer_sprite_idx; long panel_tab_idx; unsigned short select_sound_idx; }; struct SpecialConfigStats { char code_name[32]; ThingModel artifact_model; TextStringId tooltip_stridx; }; struct MagicConfig { long spell_types_count; struct SpellConfigStats spell_cfgstats[64]; long shot_types_count; struct ShotConfigStats shot_cfgstats[64]; long power_types_count; struct PowerConfigStats power_cfgstats[64]; long special_types_count; struct SpecialConfigStats special_cfgstats[64]; }; #pragma pack(1) struct SpellConfig { int duration; }; struct ShotHitConfig { short effect_model; short sndsample_idx; unsigned char sndsample_range; unsigned char destroyed; }; struct ShotStats { short sprite_anim_idx; short sprite_size_max; unsigned char field_4[2]; unsigned char field_6; unsigned char field_7; unsigned char field_8; short size_xy; short field_B; short field_D; unsigned char field_F; unsigned char field_10; unsigned char field_11; unsigned char field_12; unsigned char field_13; short health_UNUSED; short damage; unsigned char destroy_on_first_hit; short speed; short firing_sound; unsigned char firing_sound_variants; short shot_sound; short field_20; short hit_sound; unsigned char field_24; short cast_spell_kind; unsigned char health_drain; unsigned char cannot_hit_thing; unsigned char field_29; unsigned char push_on_hit; struct ShotHitConfig hit_generic; struct ShotHitConfig hit_door; short hit_water_effect_model; short hit_water_sndsample_idx; unsigned char hit_water_destroyed; short hit_lava_effect_model; short hit_lava_sndsample_idx; unsigned char hit_lava_destroyed; short area_range_UNUSED; short area_damage_UNUSED; short is_boulder; unsigned char field_47; unsigned char is_melee; unsigned char field_49; unsigned char area_hit_type_UNUSED; unsigned char group_with_shooter; unsigned char deals_magic_damage; unsigned char cannot_make_target_unconscious; short experience_given_to_shooter; short field_50; unsigned char field_52; unsigned char field_53; unsigned char field_54[4]; unsigned char field_58[8]; unsigned char field_60[4]; unsigned char affected_by_wind; }; struct MagicStats { long cost[(8 +1)]; long time; long strength[(8 +1)]; }; struct SpellInfo { unsigned char cast_at_thing; unsigned char shot_model; unsigned char caster_affected; unsigned char cast_effect_model; unsigned short cast_field_4; unsigned short caster_affect_sound; short bigsym_sprite_idx; short medsym_sprite_idx; }; struct SpellData { long pcktype; long work_state; unsigned char has_progress; short bigsym_sprite_idx; short medsym_sprite_idx; unsigned short name_stridx; unsigned short tooltip_stridx; short select_sample_idx; short pointer_sprite_idx; Expand_Check_Func overcharge_check; unsigned long can_cast_flags; }; #pragma pack() __attribute__((dllimport)) struct ShotStats _DK_shot_stats[30]; extern struct MagicConfig magic_conf; extern const char keeper_magic_file[]; extern struct NamedCommand spell_desc[]; extern struct NamedCommand shot_desc[]; extern struct NamedCommand power_desc[]; extern struct SpellData spell_data[]; extern struct SpellInfo spell_info[]; struct SpellInfo *get_magic_info(int mgc_idx); TbBool magic_info_is_invalid(const struct SpellInfo *mgcinfo); struct SpellData *get_power_data(int pwkind); TextStringId get_power_description_strindex(PowerKind pwkind); TextStringId get_power_name_strindex(PowerKind pwkind); TbBool power_is_instinctive(int pwkind); long get_power_index_for_work_state(long work_state); long get_special_description_strindex(int spckind); struct SpellConfigStats *get_spell_model_stats(SpellKind spmodel); struct ShotConfigStats *get_shot_model_stats(ThingModel tngmodel); struct PowerConfigStats *get_power_model_stats(PowerKind pwmodel); TbBool power_model_stats_invalid(const struct PowerConfigStats *powerst); struct MagicStats *get_power_dynamic_stats(PowerKind pwkind); struct SpecialConfigStats *get_special_model_stats(SpecialKind spckind); const char *spell_code_name(SpellKind spmodel); const char *shot_code_name(ThingModel tngmodel); const char *power_code_name(PowerKind pwkind); int power_model_id(const char * code_name); TbBool load_magic_config(const char *conf_fname,unsigned short flags); TbBool make_all_powers_cost_free(void); TbBool make_all_powers_researchable(PlayerNumber plyr_idx); TbBool set_power_available(PlayerNumber plyr_idx, PowerKind spl_idx, long resrch, long avail); TbBool is_power_available(PlayerNumber plyr_idx, PowerKind spl_idx); TbBool is_power_obtainable(PlayerNumber plyr_idx, PowerKind pwkind); TbBool add_power_to_player(PowerKind spl_idx, PlayerNumber plyr_idx); void remove_power_from_player(PowerKind spl_idx, PlayerNumber plyr_idx); TbBool make_available_all_researchable_powers(PlayerNumber plyr_idx); TbBool shot_can_collide_other_shots(ThingModel shotkind); typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; typedef GUID *LPGUID; typedef const GUID *LPCGUID; typedef GUID IID; typedef IID *LPIID; typedef GUID CLSID; typedef CLSID *LPCLSID; typedef GUID FMTID; typedef FMTID *LPFMTID; typedef unsigned long error_status_t; #pragma pack(1) typedef int NetUserId; enum NetDropReason { NETDROP_MANUAL, NETDROP_ERROR }; typedef TbBool (*NetNewUserCallback)(NetUserId * assigned_id); typedef void (*NetDropCallback)(NetUserId id, enum NetDropReason reason); struct NetSP { TbError (*init)(NetDropCallback drop_callback); void (*exit)(void); TbError (*host)(const char * session, void * options); TbError (*join)(const char * session, void * options); void (*update)(NetNewUserCallback new_user); void (*sendmsg_single)(NetUserId destination, const char * buffer, size_t size); void (*sendmsg_all)(const char * buffer, size_t size); size_t (*msgready)(NetUserId source, unsigned timeout); size_t (*readmsg)(NetUserId source, char * buffer, size_t max_size); void (*drop_user)(NetUserId id); }; extern const struct NetSP tcpSP; struct TbNetworkSessionNameEntry; typedef long (*Net_Callback_Func)(void); enum TbNetworkService { NS_Serial, NS_Modem, NS_IPX, NS_TCP_IP, }; struct ClientDataEntry { unsigned long plyrid; unsigned long isactive; unsigned long field_8; char name[32]; }; struct ConfigInfo { char numfield_0; unsigned char numfield_1[8]; char numfield_9; char str_atz[20]; char str_atdt[20]; char str_ath[20]; char str_ats[20]; char str_join[20]; char str_u2[20]; }; struct TbModemDev { unsigned long field_0; unsigned long field_4; char field_8[80]; char field_58[80]; unsigned long field_A8; Net_Callback_Func field_AC; Net_Callback_Func field_B0; }; struct ModemResponse { unsigned char field_0[8]; unsigned char field_8[8]; unsigned char field_10[8]; unsigned char field_18[8]; unsigned char field_20[8]; unsigned char field_28[8]; unsigned char field_30[8]; unsigned char field_38[8]; }; struct TbNetworkPlayerInfo { char name[32]; long active; }; struct TbNetworkCallbackData { char svc_name[12]; char plyr_name[20]; char field_20[32]; }; struct TbNetworkPlayerName { char name[20]; }; struct TbNetworkPlayerNameEntry { unsigned char id; unsigned long islocal; unsigned long ishost; unsigned long field_9; char name[19]; unsigned char field_20[20]; unsigned char field_34[4]; }; struct SystemUserMsg { unsigned char type; struct ClientDataEntry client_data_table[32]; }; struct UnidirectionalDataMessage { unsigned long field_0; unsigned long field_4; unsigned long field_8; unsigned long field_C; unsigned long field_10; unsigned char field_14[492]; unsigned char field_200[12]; }; struct UnidirectionalRTSMessage { unsigned long field_0; unsigned long field_4; unsigned long field_8; unsigned long field_C; unsigned long field_10; }; struct ServiceInitData { long field_0; long numfield_4; long field_8; long field_C; char *str_phone; char *str_dial; char *str_hang; char *str_answr; }; __attribute__((dllimport)) extern int _DK_network_initialized; #pragma pack() void LbNetwork_InitSessionsFromCmdLine(const char * str); TbError LbNetwork_Init(unsigned long srvcindex, unsigned long maxplayrs, void *exchng_buf, unsigned long exchng_size, struct TbNetworkPlayerInfo *locplayr, struct ServiceInitData *init_data); TbError LbNetwork_Join(struct TbNetworkSessionNameEntry *nsname, char *playr_name, unsigned long *playr_num, void *optns); TbError LbNetwork_Create(char *nsname_str, char *plyr_name, unsigned long *plyr_num, void *optns); TbError LbNetwork_Exchange(void *buf); TbBool LbNetwork_Resync(void * buf, size_t len); void LbNetwork_ChangeExchangeTimeout(unsigned long tmout); TbError LbNetwork_ChangeExchangeBuffer(void *buf, unsigned long a2); void LbNetwork_EnableLag(TbBool lag); TbError LbNetwork_EnableNewPlayers(TbBool allow); TbError LbNetwork_EnumerateServices(TbNetworkCallbackFunc callback, void *a2); TbError LbNetwork_EnumeratePlayers(struct TbNetworkSessionNameEntry *sesn, TbNetworkCallbackFunc callback, void *a2); TbError LbNetwork_EnumerateSessions(TbNetworkCallbackFunc callback, void *ptr); TbError LbNetwork_Stop(void); #pragma pack(1) struct TbNetworkSessionNameEntry; __attribute__((dllimport)) struct TbNetworkPlayerInfo _DK_net_player_info[4]; __attribute__((dllimport)) struct TbNetworkSessionNameEntry *_DK_net_session[32]; __attribute__((dllimport)) long _DK_net_number_of_sessions; __attribute__((dllimport)) long _DK_net_session_index_active; __attribute__((dllimport)) struct TbNetworkPlayerName _DK_net_player[4]; __attribute__((dllimport)) struct ConfigInfo _DK_net_config_info; __attribute__((dllimport)) char _DK_net_service[16][64]; __attribute__((dllimport)) char _DK_net_player_name[20]; __attribute__((dllimport)) struct ServiceInitData _DK_net_serial_data; __attribute__((dllimport)) struct ServiceInitData _DK_net_modem_data; __attribute__((dllimport)) struct TbModemDev _DK_modem_dev; #pragma pack() extern long number_of_comports; extern long number_of_speeds; extern long net_comport_scroll_offset; extern long net_speed_scroll_offset; extern char tmp_net_irq[8]; extern char net_current_message[64]; extern long net_current_message_index; short setup_network_service(int srvidx); int setup_old_network_service(void); void init_players_network_game(void); void setup_count_players(void); long network_session_join(void); TbBool network_player_active(int plyr_idx); const char *network_player_name(int plyr_idx); void set_network_player_name(int plyr_idx, const char *name); #pragma pack(1) struct Thing; struct SoundSettings { char *sound_data_path; char *music_data_path; char *dir3; unsigned short sound_type; unsigned short field_E; unsigned char max_number_of_samples; unsigned char stereo; unsigned char field_12; unsigned char danger_music; unsigned char no_load_sounds; unsigned char no_load_music; unsigned char field_16; unsigned char sound_system; unsigned char field_18; unsigned char redbook_enable; }; struct SoundBankHead { unsigned char field_0[14]; unsigned long field_E; }; struct SoundBankSample { unsigned char filename[18]; unsigned long field_12; unsigned long field_16; unsigned long data_size; unsigned char sfxid; unsigned char field_1F; }; struct SoundBankEntry { unsigned long field_0; unsigned long field_4; unsigned long field_8; unsigned long field_C; }; extern int atmos_sound_frequency; #pragma pack() __attribute__((dllimport)) unsigned long _DK_sound_seed; TbBool init_sound_heap_two_banks(unsigned char *heap_mem, long heap_size, char *snd_fname, char *spc_fname, long a5); TbBool init_sound(void); void randomize_sound_font(void); void sound_reinit_after_load(void); void update_player_sounds(void); void process_3d_sounds(void); void process_sound_heap(void); void thing_play_sample(struct Thing *thing, short smptbl_idx, unsigned short a3, char a4, unsigned char a5, unsigned char a6, long a7, long loudness); void stop_thing_playing_sample(struct Thing *heartng, short a2); void play_thing_walking(struct Thing *thing); TbBool ambient_sound_prepare(void); TbBool ambient_sound_stop(void); struct Thing *create_ambient_sound(const struct Coord3d *pos, ThingModel model, PlayerNumber owner); enum ModeFlags { MFlg_IsDemoMode = 0x01, MFlg_EyeLensReady = 0x02, MFlg_unk04 = 0x04, MFlg_DeadBackToPool = 0x08, MFlg_NoCdMusic = 0x10, MFlg_unk20 = 0x20, MFlg_unk40 = 0x40, MFlg_NoHeroHealthFlower = 0x80, }; enum FFlags { FFlg_unk01 = 0x01, FFlg_unk02 = 0x02, FFlg_unk04 = 0x04, FFlg_unk08 = 0x08, FFlg_unk10 = 0x10, FFlg_AlexCheat = 0x20, FFlg_UsrSndFont = 0x40, FFlg_unk80 = 0x80, }; enum DebugFlags { DFlg_ShotsDamage = 0x01, DFlg_CreatrPaths = 0x02, }; #pragma pack(1) struct TbLoadFiles; struct RoomFlag; struct Number; struct JontySpr; struct StartupParameters { LevelNumber selected_level_number; unsigned char no_intro; unsigned char one_player; unsigned char operation_flags; unsigned char flags_font; unsigned char flags_cd; unsigned char debug_flags; unsigned short computer_chat_flags; long num_fps; unsigned char packet_save_enable; unsigned char packet_load_enable; char packet_fname[150]; unsigned char packet_checksum_verify; unsigned char force_ppro_poly; }; __attribute__((dllimport)) extern unsigned char *_DK_blue_palette; __attribute__((dllimport)) extern unsigned char *_DK_red_palette; __attribute__((dllimport)) extern unsigned char *_DK_dog_palette; __attribute__((dllimport)) extern unsigned char *_DK_vampire_palette; __attribute__((dllimport)) extern unsigned char _DK_exit_keeper; __attribute__((dllimport)) extern unsigned char _DK_quit_game; __attribute__((dllimport)) extern int _DK_continue_game_option_available; __attribute__((dllimport)) extern long _DK_last_mouse_x; __attribute__((dllimport)) extern long _DK_last_mouse_y; __attribute__((dllimport)) extern int _DK_FatalError; __attribute__((dllimport)) extern long _DK_define_key_scroll_offset; __attribute__((dllimport)) extern unsigned long _DK_time_last_played_demo; __attribute__((dllimport)) extern short _DK_drag_menu_x; __attribute__((dllimport)) extern short _DK_drag_menu_y; __attribute__((dllimport)) extern unsigned short _DK_tool_tip_time; __attribute__((dllimport)) extern unsigned short _DK_help_tip_time; __attribute__((dllimport)) extern long _DK_pointer_x; __attribute__((dllimport)) extern long _DK_pointer_y; __attribute__((dllimport)) extern long _DK_block_pointed_at_x; __attribute__((dllimport)) extern long _DK_block_pointed_at_y; __attribute__((dllimport)) extern long _DK_pointed_at_frac_x; __attribute__((dllimport)) extern long _DK_pointed_at_frac_y; __attribute__((dllimport)) extern long _DK_top_pointed_at_x; __attribute__((dllimport)) extern long _DK_top_pointed_at_y; __attribute__((dllimport)) extern long _DK_top_pointed_at_frac_x; __attribute__((dllimport)) extern long _DK_top_pointed_at_frac_y; __attribute__((dllimport)) long _DK_frame_number; __attribute__((dllimport)) long _DK_draw_spell_cost; __attribute__((dllimport)) char _DK_level_name[88]; __attribute__((dllimport)) char _DK_top_of_breed_list; __attribute__((dllimport)) char _DK_no_of_breeds_owned; __attribute__((dllimport)) long _DK_optimised_lights; __attribute__((dllimport)) long _DK_total_lights; __attribute__((dllimport)) unsigned char _DK_do_lights; __attribute__((dllimport)) struct Thing *_DK_thing_pointed_at; __attribute__((dllimport)) struct Map *_DK_me_pointed_at; __attribute__((dllimport)) long _DK_my_mouse_x; __attribute__((dllimport)) long _DK_my_mouse_y; __attribute__((dllimport)) char *_DK_level_names_data; __attribute__((dllimport)) char *_DK_end_level_names_data; __attribute__((dllimport)) unsigned char *_DK_frontend_backup_palette; __attribute__((dllimport)) long _DK_dummy_x; __attribute__((dllimport)) long _DK_dummy_y; __attribute__((dllimport)) long _DK_dummy; __attribute__((dllimport)) unsigned char _DK_zoom_to_heart_palette[768]; __attribute__((dllimport)) unsigned char _DK_EngineSpriteDrawUsingAlpha; __attribute__((dllimport)) unsigned char _DK_temp_pal[768]; __attribute__((dllimport)) unsigned char *_DK_lightning_palette; #pragma pack() extern TbClockMSec last_loop_time; extern short default_loc_player; extern struct GuiBox *gui_box; extern struct GuiBox *gui_cheat_box; extern int test_variable; extern struct StartupParameters start_params; short setup_game(void); void game_loop(void); short reset_game(void); void update(void); int can_thing_be_queried(struct Thing *thing, long a2); struct Thing *get_queryable_object_near(MapCoord pos_x, MapCoord pos_y, long plyr_idx); void tag_cursor_blocks_sell_area(unsigned char a1, long a2, long a3, long a4); long packet_place_door(MapSubtlCoord stl_x, MapSubtlCoord stl_y, PlayerNumber plyr_idx, ThingModel dormodel, unsigned char a5); unsigned char tag_cursor_blocks_place_door(unsigned char a1, long a2, long a3); TbBool tag_cursor_blocks_place_room(PlayerNumber plyr_idx, MapSubtlCoord stl_x, MapSubtlCoord stl_y, long a4); TbBool all_dungeons_destroyed(const struct PlayerInfo *win_player); void reset_gui_based_on_player_mode(void); void reinit_tagged_blocks_for_player(PlayerNumber plyr_idx); void draw_flame_breath(struct Coord3d *pos1, struct Coord3d *pos2, long a3, long a4); void draw_lightning(const struct Coord3d *pos1, const struct Coord3d *pos2, long a3, long a4); void toggle_hero_health_flowers(void); void check_players_won(void); void check_players_lost(void); void process_dungeon_devastation_effects(void); void process_things_in_dungeon_hand(void); void process_payday(void); TbBool toggle_computer_player(PlayerNumber plyr_idx); void PaletteSetPlayerPalette(struct PlayerInfo *player, unsigned char *pal); void set_player_cameras_position(struct PlayerInfo *player, long pos_x, long pos_y); void init_good_player_as(PlayerNumber plr_idx); void init_keepers_map_exploration(void); void clear_creature_pool(void); void reset_creature_max_levels(void); void reset_script_timers_and_flags(void); void add_creature_to_pool(long kind, long amount, unsigned long a3); void draw_texture(long a1, long a2, long a3, long a4, long a5, long a6, long a7); void tag_cursor_blocks_dig(PlayerNumber plyr_idx, MapSubtlCoord stl_x, MapSubtlCoord stl_y, long a4); void tag_cursor_blocks_thing_in_hand(unsigned char a1, long a2, long a3, int a4, long a5); short zoom_to_next_annoyed_creature(void); short ceiling_set_info(long height_max, long height_min, long step); void set_mouse_light(struct PlayerInfo *player); void delete_all_structures(void); void clear_map(void); void clear_game(void); void clear_game_for_save(void); void clear_complete_game(void); void clear_things_and_persons_data(void); void clear_computer(void); TbBool swap_creature(long ncrt_id, long crtr_id); void engine(struct PlayerInfo *player, struct Camera *cam); void draw_gold_total(PlayerNumber plyr_idx, long scr_x, long scr_y, long units_per_px, long long value); void draw_mini_things_in_hand(long x, long y); TbBool screen_to_map(struct Camera *camera, long screen_x, long screen_y, struct Coord3d *mappos); void update_creatr_model_activities_list(void); void find_map_location_coords(long location, long *x, long *y, const char *func_name); TbBool any_player_close_enough_to_see(const struct Coord3d *pos); void affect_nearby_enemy_creatures_with_wind(struct Thing *thing); void affect_nearby_stuff_with_vortex(struct Thing *thing); void affect_nearby_friends_with_alarm(struct Thing *thing); long apply_wallhug_force_to_boulder(struct Thing *thing); void lightning_modify_palette(struct Thing *thing); unsigned long lightning_is_close_to_player(struct PlayerInfo *player, struct Coord3d *pos); unsigned long seed_check_random(unsigned long range, unsigned long *seed, const char *func_name, unsigned long place); void init_lookups(void); void place_single_slab_type_on_map(SlabKind slbkind, MapSlabCoord slb_x, MapSlabCoord slb_y, PlayerNumber plyr_idx); void shuffle_unattached_things_on_slab(long a1, long a2); void turn_off_query(PlayerNumber plyr_idx); TbBool set_gamma(char corrlvl, TbBool do_set); void level_lost_go_first_person(PlayerNumber plyr_idx); short winning_player_quitting(struct PlayerInfo *player, long *plyr_count); short lose_level(struct PlayerInfo *player); short resign_level(struct PlayerInfo *player); short complete_level(struct PlayerInfo *player); void set_general_information(long msg_id, long target, long x, long y); void set_quick_information(long msg_id, long target, long x, long y); void process_objective(const char *msg_text, long target, long x, long y); void set_general_objective(long msg_id, long target, long x, long y); void turn_off_power_sight_of_evil(PlayerNumber plridx); void turn_off_power_obey(PlayerNumber plyr_idx); short dump_first_held_thing_on_map(PlayerNumber plyr_idx, MapSubtlCoord stl_x, MapSubtlCoord stl_y, TbBool update_hand); int dump_all_held_things_on_map(PlayerNumber plyr_idx, MapSubtlCoord stl_x, MapSubtlCoord stl_y); void dump_thing_held_by_any_player(struct Thing *thing); void instant_instance_selected(CrInstance check_inst_id); void centre_engine_window(void); void change_engine_window_relative_size(long w_delta, long h_delta); void init_messages(void); void update_thing_animation(struct Thing *thing); long update_cave_in(struct Thing *thing); void initialise_map_collides(void); void initialise_map_health(void); void setup_3d(void); void setup_stuff(void); long ceiling_init(unsigned long a1, unsigned long a2); void process_dungeon_destroy(struct Thing *thing); void give_shooter_drained_health(struct Thing *shooter, long health_delta); long get_foot_creature_has_down(struct Thing *thing); void process_keeper_spell_effect(struct Thing *thing); TbBool setup_move_off_lava(struct Thing *thing); TbPixel get_player_path_colour(unsigned short owner); void startup_network_game(TbBool local); void startup_saved_packet_game(void); void faststartup_saved_packet_game(void); void reinit_level_after_load(void); const long definable_key_string[] = { GUIStr_CtrlUp, GUIStr_CtrlDown, GUIStr_CtrlLeft, GUIStr_CtrlRight, GUIStr_CtrlRotate, GUIStr_CtrlSpeed, GUIStr_CtrlRotateLeft, GUIStr_CtrlRotateRight, GUIStr_CtrlZoomIn, GUIStr_CtrlZoomOut, CpgStr_RoomKind1+0, CpgStr_RoomKind1+1, CpgStr_RoomKind1+2, CpgStr_RoomKind1+3, CpgStr_RoomKind1+4, CpgStr_RoomKind1+5, CpgStr_RoomKind1+6, CpgStr_RoomKind1+7, CpgStr_RoomKind1+8, CpgStr_RoomKind1+9, CpgStr_RoomKind1+10, CpgStr_RoomKind1+11, CpgStr_RoomKind1+12, CpgStr_RoomKind1+13, CpgStr_RoomKind1+14, GUIStr_StateFight, GUIStr_StateAnnoyed, CpgStr_PowerKind1, GUIStr_Query, GUIStr_UndoPickup, GUIStr_Pause, GUIStr_Map, GUIStr_ToggleMessage, }; void frontend_define_key_up_maintain(struct GuiButton *gbtn) { gbtn->flags ^= (gbtn->flags ^ LbBtnF_Enabled * (_DK_define_key_scroll_offset != 0)) & LbBtnF_Enabled; if ((wheel_scrolled_up || is_key_pressed(KC_UP,KMod_NONE)) & (_DK_define_key_scroll_offset != 0)) { _DK_define_key_scroll_offset--; } } void frontend_define_key_down_maintain(struct GuiButton *gbtn) { gbtn->flags ^= (gbtn->flags ^ LbBtnF_Enabled * (_DK_define_key_scroll_offset < 33 -1)) & LbBtnF_Enabled; if ((wheel_scrolled_down || is_key_pressed(KC_DOWN,KMod_NONE)) & (_DK_define_key_scroll_offset < 33 -(10 -1))) { _DK_define_key_scroll_offset++; } } void frontend_define_key_maintain(struct GuiButton *gbtn) { long key_id = _DK_define_key_scroll_offset - ((long)gbtn->content) - 1; gbtn->flags ^= (gbtn->flags ^ LbBtnF_Enabled * (key_id < 33)) & LbBtnF_Enabled; } void frontend_define_key_up(struct GuiButton *gbtn) { if (_DK_define_key_scroll_offset > 0) { _DK_define_key_scroll_offset--; } } void frontend_define_key_down(struct GuiButton *gbtn) { if (_DK_define_key_scroll_offset < 33 -(10 -1)) { _DK_define_key_scroll_offset++; } } void frontend_define_key_scroll(struct GuiButton *gbtn) { _DK_define_key_scroll_offset = frontend_scroll_tab_to_offset(gbtn, GetMouseY(), 10 -2, 33); } void frontend_define_key(struct GuiButton *gbtn) { long key_id = _DK_define_key_scroll_offset - ((long)gbtn->content) - 1; _DK_defining_a_key = 1; _DK_defining_a_key_id = key_id; _DK_lbInkey = 0; } void frontend_draw_define_key_scroll_tab(struct GuiButton *gbtn) { frontend_draw_scroll_tab(gbtn, _DK_define_key_scroll_offset, 10 -2, 33); } void frontend_draw_define_key(struct GuiButton *gbtn) { long content = (long)gbtn->content; long key_id = _DK_define_key_scroll_offset - content - 1; if (key_id >= 33) { return; } unsigned char code = _DK_settings.kbkeys[key_id].code; const char * keyname; long i = _DK_key_to_string[code]; if (i >= 0) { keyname = get_string(i); } else { char chbuf[4]; chbuf[0] = -(char)i; chbuf[1] = 0; keyname = chbuf; } if (_DK_frontend_mouse_over_button == content) { LbTextSetFont(_DK_frontend_font[2]); } else { LbTextSetFont(_DK_frontend_font[1]); } _DK_lbDisplay.DrawFlags = Lb_TEXT_HALIGN_LEFT; int tx_units_per_px = (gbtn->height * 13 / 11) * 16 / LbTextLineHeight(); LbTextSetWindow(gbtn->scr_pos_x, gbtn->scr_pos_y, gbtn->width, gbtn->height); int height = LbTextLineHeight() * tx_units_per_px / 16; LbTextDrawResized(0, (gbtn->height - height) / 2, tx_units_per_px, get_string(definable_key_string[key_id])); unsigned char mods = _DK_settings.kbkeys[key_id].mods; _DK_lbDisplay.DrawFlags = Lb_TEXT_HALIGN_RIGHT; char text[255]; text[0] = '\0'; if (mods & KMod_CONTROL) { strcat(text, get_string(GUIStr_KeyControl)); strcat(text, " "); } if (mods & KMod_ALT) { strcat(text, get_string(GUIStr_KeyAlt)); strcat(text, " "); } if (mods & KMod_SHIFT) { strcat(text, get_string(GUIStr_KeyShift)); strcat(text, " "); } const char *keytext; switch (code) { case KC_LSHIFT: case KC_RSHIFT: keytext = get_string(GUIStr_KeyShift); break; case KC_LCONTROL: case KC_RCONTROL: keytext = get_string(GUIStr_KeyControl); break; case KC_LALT: case KC_RALT: keytext = get_string(GUIStr_KeyAlt); break; default: keytext = keyname; break; } strcat(text, keytext); height = LbTextLineHeight() * tx_units_per_px / 16; LbTextDrawResized(0, (gbtn->height - height) / 2, tx_units_per_px, text); } void gui_video_shadows(struct GuiButton *gbtn) { _DK_settings.video_shadows = _DK_video_shadows; } void gui_video_view_distance_level(struct GuiButton *gbtn) { _DK_settings.view_distance = _DK_video_view_distance_level; } void gui_video_rotate_mode(struct GuiButton *gbtn) { struct Packet* pckt = get_packet(_DK_my_player_number); if (_DK_settings.video_rotate_mode) { set_packet_action(pckt, PckA_SwitchView, 5, 0, 0, 0); } else { set_packet_action(pckt, PckA_SwitchView, 2, 0, 0, 0); } save_settings(); } void gui_video_cluedo_mode(struct GuiButton *gbtn) { struct Packet* pckt = get_packet(_DK_my_player_number); set_packet_action(pckt, PckA_SetCluedo, _DK_video_cluedo_mode, 0, 0, 0); } void gui_video_gamma_correction(struct GuiButton *gbtn) { struct PlayerInfo* player = get_player_f(_DK_my_player_number,__func__); _DK_video_gamma_correction = (_DK_video_gamma_correction + 1) % 5; set_players_packet_action(player, PckA_SetGammaLevel, _DK_video_gamma_correction, 0, 0, 0); } void gui_set_sound_volume(struct GuiButton *gbtn) { if (gbtn->id_num == BID_SOUND_VOL) { if (_DK_settings.sound_volume != _DK_sound_level) do_sound_menu_click(); } _DK_settings.sound_volume = _DK_sound_level; save_settings(); SetSoundMasterVolume(_DK_settings.sound_volume); SetMusicMasterVolume(_DK_settings.sound_volume); } void gui_set_music_volume(struct GuiButton *gbtn) { _DK_settings.redbook_volume = _DK_music_level; save_settings(); SetMusicPlayerVolume(_DK_settings.redbook_volume); } void gui_video_cluedo_maintain(struct GuiButton *gbtn) { struct PlayerInfo* player = get_player_f(_DK_my_player_number,__func__); if (player->view_mode == PVM_FrontView) { gbtn->btype_value |= LbBFeF_NoTooltip; gbtn->flags &= ~LbBtnF_Enabled; } else { gbtn->btype_value &= LbBFeF_IntValueMask; gbtn->flags |= LbBtnF_Enabled; } } void frontend_set_mouse_sensitivity(struct GuiButton *gbtn) { _DK_settings.first_person_move_sensitivity = _DK_fe_mouse_sensitivity; save_settings(); } void frontend_invert_mouse(struct GuiButton *gbtn) { _DK_settings.first_person_move_invert = !_DK_settings.first_person_move_invert; save_settings(); } void frontend_draw_invert_mouse(struct GuiButton *gbtn) { int font_idx = frontend_button_caption_font(gbtn, _DK_frontend_mouse_over_button); LbTextSetFont(_DK_frontend_font[font_idx]); LbTextSetWindow(gbtn->scr_pos_x, gbtn->scr_pos_y, gbtn->width, gbtn->height); int tx_units_per_px = gbtn->height * 16 / LbTextLineHeight(); const char *text; if (_DK_settings.first_person_move_invert) { text = get_string(GUIStr_On); } else { text = get_string(GUIStr_Off); } LbTextDrawResized(0, 0, tx_units_per_px, text); } void init_video_menu(struct GuiMenu *gmnu) { _DK_video_shadows = _DK_settings.video_shadows; _DK_video_view_distance_level = _DK_settings.view_distance; _DK_video_textures = _DK_settings.video_textures; _DK_video_cluedo_mode = _DK_settings.video_cluedo_mode; _DK_video_gamma_correction = _DK_settings.gamma_correction; } void init_audio_menu(struct GuiMenu *gmnu) { _DK_music_level = _DK_settings.redbook_volume; _DK_sound_level = _DK_settings.sound_volume; }
Become a Patron
Sponsor on GitHub
Donate via PayPal
Compiler Explorer Shop
Source on GitHub
Mailing list
Installed libraries
Wiki
Report an issue
How it works
Contact the author
CE on Mastodon
CE on Bluesky
Statistics
Changelog
Version tree