https://github.com/dfhack/dfhooks
DF hook chainloader
https://github.com/dfhack/dfhooks
Last synced: 8 months ago
JSON representation
DF hook chainloader
- Host: GitHub
- URL: https://github.com/dfhack/dfhooks
- Owner: DFHack
- License: mit
- Created: 2024-04-21T07:23:01.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-07T23:18:59.000Z (12 months ago)
- Last Synced: 2025-03-08T00:23:49.871Z (12 months ago)
- Language: C++
- Size: 28.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dfhooks
Dwarf Fortress dfhooks API chainloader.
This library implements the dfhooks API as (defacto) defined in the DF
[g\_src](https://github.com/Putnam3145/Dwarf-Fortress--libgraphics--/blob/master/g_src/dfhooks.cpp)
sources and propagates the calls to other libraries that similarly implement
the API.
Those libraries must also be installed in the top-level Dwarf Fortress game
directory and conform to the following per-platform naming scheme:
- Windows: `dfhooks_{name}.dll` (e.g. `dfhooks_mylib.dll`)
- Linux: `libdfhooks_{name}.so`
- MacOS: `libdfhooks_{name}.dylib`
In addition to the symbols required by the dfhooks API, a library can also
export a `dfhooks_priority` symbol, which must be of type `int32_t`. Libraries
with lower values in the exported `dfhooks_priority` will be called first when
callbacks are propagated, except for shutdown, for which libraries with lower
values will be called last. If a library does not export a priority, the value
0 is used.
If you need to position yourself relative to DFHack, DFHack exports a priority
of 100.