From 408f0cb06e682c437dbe82b64eb229d41b65fe44 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Mon, 8 Oct 2012 12:10:02 +0400 Subject: [PATCH] Add a small stand-alone utility for managing binary patches. --- Lua API.html | 6 + Lua API.rst | 8 + NEWS | 2 + Readme.html | 577 ++++++++++++++++++++++------------------- Readme.rst | 30 +++ library/CMakeLists.txt | 3 +- library/binpatch.cpp | 308 ++++++++++++++++++++++ 7 files changed, 660 insertions(+), 274 deletions(-) create mode 100644 library/binpatch.cpp diff --git a/Lua API.html b/Lua API.html index 047ef9786..06fa5418e 100644 --- a/Lua API.html +++ b/Lua API.html @@ -1914,6 +1914,12 @@ utils.insert_or_update(soul.skills, {new=true, id=..., rating=...}, 'id')

(For an explanation of new=true, see table assignment in the wrapper section)

+
  • utils.erase_sorted_key(vector,key,field,cmpfun)

    +

    Removes the item with the given key from the list. Returns: did_erase, vector[idx], idx.

    +
  • +
  • utils.erase_sorted(vector,item,field,cmpfun)

    +

    Exactly like erase_sorted_key, but if field is specified, takes the key from item[field].

    +
  • utils.prompt_yes_no(prompt, default)

    Presents a yes/no prompt to the user. If default is not nil, allows just pressing Enter to submit the default choice. diff --git a/Lua API.rst b/Lua API.rst index bf7ee45a7..fbb4b7d82 100644 --- a/Lua API.rst +++ b/Lua API.rst @@ -1806,6 +1806,14 @@ utils (For an explanation of ``new=true``, see table assignment in the wrapper section) +* ``utils.erase_sorted_key(vector,key,field,cmpfun)`` + + Removes the item with the given key from the list. Returns: *did_erase, vector[idx], idx*. + +* ``utils.erase_sorted(vector,item,field,cmpfun)`` + + Exactly like ``erase_sorted_key``, but if field is specified, takes the key from ``item[field]``. + * ``utils.prompt_yes_no(prompt, default)`` Presents a yes/no prompt to the user. If ``default`` is not *nil*, diff --git a/NEWS b/NEWS index b36d2f121..5072cebc3 100644 --- a/NEWS +++ b/NEWS @@ -4,8 +4,10 @@ DFHack future - support for displaying active keybindings properly. Notable bugfixes: - autobutcher can be re-enabled again after being stopped. + - stopped Dwarf Manipulator from unmasking vampires. Misc improvements: - fastdwarf: new mode using debug flags, and some internal consistency fixes. + - added a small stand-alone utility for applying and removing binary patches. DFHack v0.34.11-r2 diff --git a/Readme.html b/Readme.html index caf1f6a0e..c1d2d0d3c 100644 --- a/Readme.html +++ b/Readme.html @@ -338,187 +338,190 @@ access DF memory and allow for easier development of new tools.

  • Getting DFHack
  • Compatibility
  • Installation/Removal
  • -
  • Using DFHack
  • -
  • Something doesn't work, help!
  • -
  • The init file