82e7b8300a
vsnprintf man page claims: "If an output error is encountered, a negative value is returned." That means we has to call vsnprintf twice at most to have whole output written to a string. But in case of error we return an empty string. The code also optimizes an expected common case of outputting single line with a small stack allocated buffer. If the stack buffer is too small then it uses std::string::resize to allocate exactly enough memory and writes directly to std::string. Second call could use vsprintf because memory is known to be large enough. But I think that difference isn't detectable outside micro benchmarks. |
||
---|---|---|
CMake | ||
build | ||
depends | ||
dfhack-config | ||
docs | ||
library | ||
package | ||
plugins | ||
reversing | ||
scripts@7f18d2ce0d | ||
test | ||
travis | ||
.gitignore | ||
.gitmodules | ||
.travis.yml | ||
.ycm_extra_conf.py | ||
CMakeLists.txt | ||
Contributing.rst | ||
LICENSE.rst | ||
README.html | ||
README.md | ||
conf.py | ||
dfhack.init-example | ||
index.rst | ||
onLoad.init-example |
README.md
DFHack Readme
DFHack is a Dwarf Fortress memory access library, distributed with scripts and plugins implementing a wide variety of useful functions and tools.
The full documentation is available online here,
from the README.html page in the DFHack distribution, or as raw text in the ./docs
folder.
If you're an end-user, modder, or interested in contributing to DFHack -
go read those docs.
If that's unclear or you need more help, try the Bay12 forums thread or the #dfhack IRC channel on freenode.