commit
c2964e72e8
@ -1,30 +1,15 @@
|
||||
[submodule "plugins/stonesense"]
|
||||
path = plugins/stonesense
|
||||
url = git://github.com/DFHack/stonesense.git
|
||||
url = ../../DFHack/stonesense.git
|
||||
[submodule "plugins/isoworld"]
|
||||
path = plugins/isoworld
|
||||
url = git://github.com/DFHack/isoworld.git
|
||||
url = ../../DFHack/isoworld.git
|
||||
[submodule "library/xml"]
|
||||
path = library/xml
|
||||
url = git://github.com/DFHack/df-structures.git
|
||||
url = ../../DFHack/df-structures.git
|
||||
[submodule "depends/clsocket"]
|
||||
path = depends/clsocket
|
||||
url = git://github.com/DFHack/clsocket.git
|
||||
[submodule "scripts/3rdparty/lethosor"]
|
||||
path = scripts/3rdparty/lethosor
|
||||
url = git://github.com/DFHack/lethosor-scripts
|
||||
[submodule "scripts/3rdparty/roses"]
|
||||
path = scripts/3rdparty/roses
|
||||
url = git://github.com/DFHack/roses-scripts.git
|
||||
[submodule "scripts/3rdparty/maxthyme"]
|
||||
path = scripts/3rdparty/maxthyme
|
||||
url = git://github.com/DFHack/maxthyme-scripts.git
|
||||
[submodule "scripts/3rdparty/dscorbett"]
|
||||
path = scripts/3rdparty/dscorbett
|
||||
url = git://github.com/DFHack/dscorbett-scripts.git
|
||||
[submodule "scripts/3rdparty/kane-t"]
|
||||
path = scripts/3rdparty/kane-t
|
||||
url = git://github.com/DFHack/kane-t-scripts.git
|
||||
[submodule "scripts/3rdparty/maienm"]
|
||||
path = scripts/3rdparty/maienm
|
||||
url = git://github.com/DFHack/maienm-scripts.git
|
||||
url = ../../DFHack/clsocket.git
|
||||
[submodule "scripts2"]
|
||||
path = scripts
|
||||
url = ../../DFHack/scripts.git
|
||||
|
@ -0,0 +1,71 @@
|
||||
# Helper to download files as needed
|
||||
|
||||
function(file_md5_if_exists FILE VAR)
|
||||
if(EXISTS "${FILE}")
|
||||
file(MD5 "${FILE}" "${VAR}")
|
||||
set(${VAR} "${${VAR}}" PARENT_SCOPE)
|
||||
else()
|
||||
set(${VAR} "" PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(search_downloads FILE_MD5 VAR)
|
||||
set(${VAR} "" PARENT_SCOPE)
|
||||
file(GLOB FILES ${CMAKE_SOURCE_DIR}/CMake/downloads/*)
|
||||
foreach(FILE ${FILES})
|
||||
file(MD5 "${FILE}" CUR_MD5)
|
||||
if("${CUR_MD5}" STREQUAL "${FILE_MD5}")
|
||||
set(${VAR} ${FILE} PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endforeach()
|
||||
endfunction()
|
||||
|
||||
function(download_file URL DEST EXPECTED_MD5)
|
||||
get_filename_component(FILENAME "${URL}" NAME)
|
||||
file_md5_if_exists("${DEST}" CUR_MD5)
|
||||
|
||||
if(NOT "${EXPECTED_MD5}" STREQUAL "${CUR_MD5}")
|
||||
search_downloads(${EXPECTED_MD5} DLPATH)
|
||||
if(NOT("${DLPATH}" STREQUAL ""))
|
||||
message("* Copying ${FILENAME} from ${DLPATH}")
|
||||
execute_process(COMMAND "${CMAKE_COMMAND}" -E copy
|
||||
"${DLPATH}"
|
||||
"${DEST}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
message("* Downloading ${FILENAME}")
|
||||
file(DOWNLOAD "${URL}" "${DEST}" EXPECTED_MD5 "${EXPECTED_MD5}" SHOW_PROGRESS)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Download a file and uncompress it
|
||||
function(download_file_unzip URL ZIP_TYPE ZIP_DEST ZIP_MD5 UNZIP_DEST UNZIP_MD5)
|
||||
get_filename_component(FILENAME "${URL}" NAME)
|
||||
file_md5_if_exists("${UNZIP_DEST}" CUR_UNZIP_MD5)
|
||||
|
||||
# Redownload if the MD5 of the uncompressed file doesn't match
|
||||
if(NOT "${UNZIP_MD5}" STREQUAL "${CUR_UNZIP_MD5}")
|
||||
download_file("${URL}" "${ZIP_DEST}" "${ZIP_MD5}")
|
||||
|
||||
if(EXISTS "${ZIP_DEST}")
|
||||
message("* Decompressing ${FILENAME}")
|
||||
if("${ZIP_TYPE}" STREQUAL "gz")
|
||||
execute_process(COMMAND
|
||||
"${PERL_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/depends/gunzip.pl"
|
||||
"${ZIP_DEST}" --force)
|
||||
else()
|
||||
message(SEND_ERROR "Unknown ZIP_TYPE: ${ZIP_TYPE}")
|
||||
endif()
|
||||
if(NOT EXISTS "${UNZIP_DEST}")
|
||||
message(SEND_ERROR "File failed to unzip to ${UNZIP_DEST}")
|
||||
else()
|
||||
file(MD5 "${UNZIP_DEST}" CUR_UNZIP_MD5)
|
||||
if(NOT "${UNZIP_MD5}" STREQUAL "${CUR_UNZIP_MD5}")
|
||||
message(SEND_ERROR "MD5 mismatch: ${UNZIP_DEST}: expected ${UNZIP_MD5}, got ${CUR_UNZIP_MD5}")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
@ -1,28 +0,0 @@
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2009 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distributed this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
# We use MSBuild as the build tool for VS 10
|
||||
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
|
||||
NAMES MSBuild
|
||||
HINTS
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;ProductDir]
|
||||
"$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/"
|
||||
"c:/WINDOWS/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/"
|
||||
"$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\10.0;CLR Version]/"
|
||||
)
|
||||
|
||||
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
|
||||
SET(MSVC10 1)
|
||||
SET(MSVC_VERSION 1600)
|
||||
|
@ -1,23 +0,0 @@
|
||||
IF(Curses_FOUND)
|
||||
SET(Curses_FIND_QUIETLY TRUE)
|
||||
ENDIF()
|
||||
|
||||
FIND_PATH(Curses_INCLUDE_PATH
|
||||
NAMES ncurses.h curses.h
|
||||
PATH_SUFFIXES ncurses
|
||||
PATHS /usr/include/ncursesw /usr/include /usr/local/include /usr/pkg/include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(Curses_LIBRARY
|
||||
NAMES ncursesw
|
||||
PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib
|
||||
)
|
||||
|
||||
IF (Curses_INCLUDE_PATH AND Curses_LIBRARY)
|
||||
SET(Curses_FOUND TRUE)
|
||||
ENDIF()
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
Curses_INCLUDE_PATH
|
||||
Curses_LIBRARY
|
||||
)
|
@ -1,3 +0,0 @@
|
||||
FIND_PROGRAM(RST2HTML_EXECUTABLE NAMES rst2html rst2html.py)
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Docutils DEFAULT_MSG RST2HTML_EXECUTABLE)
|
@ -1,185 +0,0 @@
|
||||
# - This module looks for Doxygen and the path to Graphviz's dot
|
||||
# Doxygen is a documentation generation tool. Please see
|
||||
# http://www.doxygen.org
|
||||
#
|
||||
# This module accepts the following optional variables:
|
||||
#
|
||||
# DOXYGEN_SKIP_DOT = If true this module will skip trying to find Dot
|
||||
# (an optional component often used by Doxygen)
|
||||
#
|
||||
# This modules defines the following variables:
|
||||
#
|
||||
# DOXYGEN_EXECUTABLE = The path to the doxygen command.
|
||||
# DOXYGEN_FOUND = Was Doxygen found or not?
|
||||
#
|
||||
# DOXYGEN_DOT_EXECUTABLE = The path to the dot program used by doxygen.
|
||||
# DOXYGEN_DOT_FOUND = Was Dot found or not?
|
||||
# DOXYGEN_DOT_PATH = The path to dot not including the executable
|
||||
#
|
||||
#
|
||||
|
||||
#Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
||||
#All rights reserved.
|
||||
#
|
||||
#Redistribution and use in source and binary forms, with or without
|
||||
#modification, are permitted provided that the following conditions
|
||||
#are met:
|
||||
#
|
||||
#* Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
#* Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
#* Neither the names of Kitware, Inc., the Insight Software Consortium,
|
||||
# nor the names of their contributors may be used to endorse or promote
|
||||
# products derived from this software without specific prior written
|
||||
# permission.
|
||||
#
|
||||
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
#"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
#LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
#A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
#HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
#SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
#LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
#DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
#THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
#(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
#OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
#The above copyright and license notice applies to distributions of
|
||||
#CMake in source and binary form. Some source files contain additional
|
||||
#notices of original copyright by their contributors; see each source
|
||||
#for details. Third-party software packages supplied with CMake under
|
||||
#compatible licenses provide their own copyright notices documented in
|
||||
#corresponding subdirectories.
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
#CMake was initially developed by Kitware with the following sponsorship:
|
||||
#
|
||||
# * National Library of Medicine at the National Institutes of Health
|
||||
# as part of the Insight Segmentation and Registration Toolkit (ITK).
|
||||
#
|
||||
# * US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel
|
||||
# Visualization Initiative.
|
||||
#
|
||||
# * National Alliance for Medical Image Computing (NAMIC) is funded by the
|
||||
# National Institutes of Health through the NIH Roadmap for Medical Research,
|
||||
# Grant U54 EB005149.
|
||||
#
|
||||
# * Kitware, Inc.
|
||||
|
||||
|
||||
# For backwards compatibility support
|
||||
IF(Doxygen_FIND_QUIETLY)
|
||||
SET(DOXYGEN_FIND_QUIETLY TRUE)
|
||||
ENDIF(Doxygen_FIND_QUIETLY)
|
||||
|
||||
# ===== Rationale for OS X AppBundle mods below =====
|
||||
# With the OS X GUI version, Doxygen likes to be installed to /Applications and
|
||||
# it contains the doxygen executable in the bundle. In the versions I've
|
||||
# seen, it is located in Resources, but in general, more often binaries are
|
||||
# located in MacOS.
|
||||
#
|
||||
# NOTE: The official Doxygen.app that is distributed for OS X uses non-standard
|
||||
# conventions. Instead of the command-line "doxygen" tool being placed in
|
||||
# Doxygen.app/Contents/MacOS, "Doxywizard" is placed there instead and
|
||||
# "doxygen" is placed in Contents/Resources. This is most likely done
|
||||
# so that something happens when people double-click on the Doxygen.app
|
||||
# package. Unfortunately, CMake gets confused by this as when it sees the
|
||||
# bundle it uses "Doxywizard" as the executable to use instead of
|
||||
# "doxygen". Therefore to work-around this issue we temporarily disable
|
||||
# the app-bundle feature, just for this CMake module:
|
||||
if(APPLE)
|
||||
# Save the old setting
|
||||
SET(TEMP_DOXYGEN_SAVE_CMAKE_FIND_APPBUNDLE ${CMAKE_FIND_APPBUNDLE})
|
||||
# Disable the App-bundle detection feature
|
||||
SET(CMAKE_FIND_APPBUNDLE "NEVER")
|
||||
endif()
|
||||
# FYI:
|
||||
# In the older versions of OS X Doxygen, dot was included with the
|
||||
# Doxygen bundle. But the new versions require you to download
|
||||
# Graphviz.app which contains "dot" in it's bundle.
|
||||
# ============== End OSX stuff ================
|
||||
|
||||
#
|
||||
# Find Doxygen...
|
||||
#
|
||||
|
||||
FIND_PROGRAM(DOXYGEN_EXECUTABLE
|
||||
NAMES doxygen
|
||||
PATHS
|
||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\doxygen_is1;Inno Setup: App Path]/bin"
|
||||
/Applications/Doxygen.app/Contents/Resources
|
||||
/Applications/Doxygen.app/Contents/MacOS
|
||||
DOC "Doxygen documentation generation tool (http://www.doxygen.org)"
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Doxygen DEFAULT_MSG DOXYGEN_EXECUTABLE)
|
||||
|
||||
#
|
||||
# Find Dot...
|
||||
#
|
||||
|
||||
IF(NOT DOXYGEN_SKIP_DOT)
|
||||
FIND_PROGRAM(DOXYGEN_DOT_EXECUTABLE
|
||||
NAMES dot
|
||||
PATHS
|
||||
"$ENV{ProgramFiles}/Graphviz2.26.3/bin"
|
||||
"C:/Program Files/Graphviz2.26.3/bin"
|
||||
"$ENV{ProgramFiles}/Graphviz 2.21/bin"
|
||||
"C:/Program Files/Graphviz 2.21/bin"
|
||||
"$ENV{ProgramFiles}/ATT/Graphviz/bin"
|
||||
"C:/Program Files/ATT/Graphviz/bin"
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\ATT\\Graphviz;InstallPath]/bin
|
||||
/Applications/Graphviz.app/Contents/MacOS
|
||||
/Applications/Doxygen.app/Contents/Resources
|
||||
/Applications/Doxygen.app/Contents/MacOS
|
||||
DOC "Graphviz Dot tool for using Doxygen"
|
||||
)
|
||||
|
||||
if(DOXYGEN_DOT_EXECUTABLE)
|
||||
set(DOXYGEN_DOT_FOUND TRUE)
|
||||
# The Doxyfile wants the path to Dot, not the entire path and executable
|
||||
get_filename_component(DOXYGEN_DOT_PATH "${DOXYGEN_DOT_EXECUTABLE}" PATH CACHE)
|
||||
endif()
|
||||
|
||||
endif(NOT DOXYGEN_SKIP_DOT)
|
||||
|
||||
#
|
||||
# Backwards compatibility...
|
||||
#
|
||||
|
||||
if(APPLE)
|
||||
# Restore the old app-bundle setting setting
|
||||
SET(CMAKE_FIND_APPBUNDLE ${TEMP_DOXYGEN_SAVE_CMAKE_FIND_APPBUNDLE})
|
||||
endif()
|
||||
|
||||
# Maintain the _FOUND variables as "YES" or "NO" for backwards compatibility
|
||||
# (allows people to stuff them directly into Doxyfile with configure_file())
|
||||
if(DOXYGEN_FOUND)
|
||||
set(DOXYGEN_FOUND "YES")
|
||||
else()
|
||||
set(DOXYGEN_FOUND "NO")
|
||||
endif()
|
||||
if(DOXYGEN_DOT_FOUND)
|
||||
set(DOXYGEN_DOT_FOUND "YES")
|
||||
else()
|
||||
set(DOXYGEN_DOT_FOUND "NO")
|
||||
endif()
|
||||
|
||||
# For backwards compatibility support
|
||||
SET (DOXYGEN ${DOXYGEN_EXECUTABLE} )
|
||||
SET (DOT ${DOXYGEN_DOT_EXECUTABLE} )
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
DOXYGEN_EXECUTABLE
|
||||
DOXYGEN_DOT_EXECUTABLE
|
||||
DOXYGEN_DOT_PATH
|
||||
)
|
@ -0,0 +1,107 @@
|
||||
# Sourced from:
|
||||
# https://raw.githubusercontent.com/ros/cmake_modules/0.4-devel/cmake/Modules/FindTinyXML.cmake
|
||||
# under the following license: https://github.com/ros/cmake_modules/blob/0.4-devel/LICENSE,
|
||||
# reproduced here:
|
||||
|
||||
# Copyright (c) 2013, Open Source Robotics Foundation
|
||||
# All rights reserved.
|
||||
|
||||
# Redistribution and use in source and binary forms, with or without modification,
|
||||
# are permitted provided that the following conditions are met:
|
||||
|
||||
# Redistributions of source code must retain the above copyright notice, this
|
||||
# list of conditions and the following disclaimer.
|
||||
|
||||
# Redistributions in binary form must reproduce the above copyright notice, this
|
||||
# list of conditions and the following disclaimer in the documentation and/or
|
||||
# other materials provided with the distribution.
|
||||
|
||||
# Neither the name of the {organization} nor the names of its
|
||||
# contributors may be used to endorse or promote products derived from
|
||||
# this software without specific prior written permission.
|
||||
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
##################################################################################################
|
||||
#
|
||||
# CMake script for finding TinyXML.
|
||||
#
|
||||
# Input variables:
|
||||
#
|
||||
# - TinyXML_ROOT_DIR (optional): When specified, header files and libraries will be searched for in
|
||||
# ${TinyXML_ROOT_DIR}/include
|
||||
# ${TinyXML_ROOT_DIR}/libs
|
||||
# respectively, and the default CMake search order will be ignored. When unspecified, the default
|
||||
# CMake search order is used.
|
||||
# This variable can be specified either as a CMake or environment variable. If both are set,
|
||||
# preference is given to the CMake variable.
|
||||
# Use this variable for finding packages installed in a nonstandard location, or for enforcing
|
||||
# that one of multiple package installations is picked up.
|
||||
#
|
||||
#
|
||||
# Cache variables (not intended to be used in CMakeLists.txt files)
|
||||
#
|
||||
# - TinyXML_INCLUDE_DIR: Absolute path to package headers.
|
||||
# - TinyXML_LIBRARY: Absolute path to library.
|
||||
#
|
||||
#
|
||||
# Output variables:
|
||||
#
|
||||
# - TinyXML_FOUND: Boolean that indicates if the package was found
|
||||
# - TinyXML_INCLUDE_DIRS: Paths to the necessary header files
|
||||
# - TinyXML_LIBRARIES: Package libraries
|
||||
#
|
||||
#
|
||||
# Example usage:
|
||||
#
|
||||
# find_package(TinyXML)
|
||||
# if(NOT TinyXML_FOUND)
|
||||
# # Error handling
|
||||
# endif()
|
||||
# ...
|
||||
# include_directories(${TinyXML_INCLUDE_DIRS} ...)
|
||||
# ...
|
||||
# target_link_libraries(my_target ${TinyXML_LIBRARIES})
|
||||
#
|
||||
##################################################################################################
|
||||
|
||||
# Get package location hint from environment variable (if any)
|
||||
if(NOT TinyXML_ROOT_DIR AND DEFINED ENV{TinyXML_ROOT_DIR})
|
||||
set(TinyXML_ROOT_DIR "$ENV{TinyXML_ROOT_DIR}" CACHE PATH
|
||||
"TinyXML base directory location (optional, used for nonstandard installation paths)")
|
||||
endif()
|
||||
|
||||
# Search path for nonstandard package locations
|
||||
if(TinyXML_ROOT_DIR)
|
||||
set(TinyXML_INCLUDE_PATH PATHS "${TinyXML_ROOT_DIR}/include" NO_DEFAULT_PATH)
|
||||
set(TinyXML_LIBRARY_PATH PATHS "${TinyXML_ROOT_DIR}/lib" NO_DEFAULT_PATH)
|
||||
endif()
|
||||
|
||||
# Find headers and libraries
|
||||
find_path(TinyXML_INCLUDE_DIR NAMES tinyxml.h PATH_SUFFIXES "tinyxml" ${TinyXML_INCLUDE_PATH})
|
||||
find_library(TinyXML_LIBRARY NAMES tinyxml PATH_SUFFIXES "tinyxml" ${TinyXML_LIBRARY_PATH})
|
||||
|
||||
mark_as_advanced(TinyXML_INCLUDE_DIR
|
||||
TinyXML_LIBRARY)
|
||||
|
||||
# Output variables generation
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(TinyXML DEFAULT_MSG TinyXML_LIBRARY
|
||||
TinyXML_INCLUDE_DIR)
|
||||
|
||||
set(TinyXML_FOUND ${TINYXML_FOUND}) # Enforce case-correctness: Set appropriately cased variable...
|
||||
unset(TINYXML_FOUND) # ...and unset uppercase variable generated by find_package_handle_standard_args
|
||||
|
||||
if(TinyXML_FOUND)
|
||||
set(TinyXML_INCLUDE_DIRS ${TinyXML_INCLUDE_DIR})
|
||||
set(TinyXML_LIBRARIES ${TinyXML_LIBRARY})
|
||||
endif()
|
@ -0,0 +1,3 @@
|
||||
*
|
||||
!README.txt
|
||||
!.gitignore
|
@ -0,0 +1,3 @@
|
||||
This folder exists as an alternate location for downloaded files. Files will
|
||||
ordinarily not be downloaded here, but CMake will look for them here anyway to
|
||||
facilitate offline builds.
|
@ -1,518 +0,0 @@
|
||||
.. comment
|
||||
This is the changelog file for DFHack. If you add or change anything, note
|
||||
it here under the heading "DFHack Future", in the appropriate section.
|
||||
Items within each section are listed in alphabetical order to minimise merge
|
||||
conflicts. Try to match the style and level of detail of the other entries.
|
||||
|
||||
Sections for each release are added as required, and consist solely of the
|
||||
following in order as subheadings::
|
||||
|
||||
Internals
|
||||
Lua
|
||||
New [Internal Commands | Plugins | Scripts | Features]
|
||||
Fixes
|
||||
Misc Improvements
|
||||
Removed
|
||||
|
||||
When referring to a script, plugin, or command, use backticks (```) to
|
||||
create a link to the relevant documentation - and check that the docs are
|
||||
still up to date!
|
||||
|
||||
When adding a new release, change "DFHack future" to the appropriate title
|
||||
before releasing, and then add a new "DFHack future" section after releasing.
|
||||
|
||||
.. _changelog:
|
||||
|
||||
#########
|
||||
Changelog
|
||||
#########
|
||||
|
||||
.. contents::
|
||||
:depth: 2
|
||||
|
||||
DFHack future
|
||||
=============
|
||||
|
||||
Lua
|
||||
---
|
||||
- Label widgets can now easily register handlers for mouse clicks
|
||||
|
||||
New Features
|
||||
------------
|
||||
- `gui/gm-editor` it's now possible to insert default types to containers. For primitive types leave the type entry empty, for references use ``*``.
|
||||
|
||||
Fixes
|
||||
-----
|
||||
- `createitem`: Now moves multiple created items to cursor correctly
|
||||
- `exportlegends`: Improved handling of unknown enum items (fixes many errors)
|
||||
- `gui/create-item`: Fixed quality when creating multiple items
|
||||
- `gui/mod-manager`: Fixed error when mods folder doesn't exist
|
||||
- `modtools/item-trigger`: Fixed handling of items with subtypes
|
||||
|
||||
Misc Improvements
|
||||
-----------------
|
||||
- `fix/diplomats`: replaces ``fixdiplomats``
|
||||
- `fix/merchants`: replaces ``fixmerchants``
|
||||
|
||||
Removed
|
||||
-------
|
||||
- `tweak` manager-quantity: no longer needed
|
||||
|
||||
DFHack 0.42.06-r1
|
||||
=================
|
||||
|
||||
Internals
|
||||
---------
|
||||
- Commands to run on startup can be specified on the command line with ``+``
|
||||
|
||||
Example::
|
||||
|
||||
./dfhack +devel/print-args example
|
||||
"Dwarf Fortress.exe" +devel/print-args example
|
||||
|
||||
- Prevented plugins with active viewscreens from being unloaded and causing a crash
|
||||
- Additional script search paths can be specified in dfhack-config/script-paths.txt
|
||||
|
||||
Lua
|
||||
---
|
||||
- `building-hacks` now supports ``auto_gears`` flags. It automatically finds and animates gears in building definition
|
||||
- Changed how `eventful` triggers reaction complete. Now it has ``onReactionComplete`` and ``onReactionCompleting``. Second one can be canceled
|
||||
|
||||
New Plugins
|
||||
-----------
|
||||
- `autogems`: Creates a new Workshop Order setting, automatically cutting rough gems
|
||||
|
||||
New Scripts
|
||||
-----------
|
||||
- `devel/save-version`: Displays DF version information about the current save
|
||||
- `modtools/extra-gamelog`: replaces ``log-region``, ``soundsense-season``, and ``soundsense``
|
||||
|
||||
New Features
|
||||
------------
|
||||
- `buildingplan`: Support for floodgates, grates, and bars
|
||||
- `colonies`: new ``place`` subcommand and supports any vermin (default honey bees)
|
||||
- `confirm`: Added a confirmation for retiring locations
|
||||
- `exportlegends`: Exports more information (poetic/musical/dance forms, written/artifact content, landmasses, extra histfig information, and more)
|
||||
- `search-plugin`: Support for new screens:
|
||||
|
||||
- location occupation assignment
|
||||
- civilization animal training knowledge
|
||||
- animal trainer assignment
|
||||
|
||||
- `tweak`:
|
||||
|
||||
- ``tweak block-labors``: Prevents labors that can't be used from being toggled
|
||||
- ``tweak hide-priority``: Adds an option to hide designation priority indicators
|
||||
- ``tweak title-start-rename``: Adds a safe rename option to the title screen "Start Playing" menu
|
||||
|
||||
- `zone`:
|
||||
|
||||
- Added ``unassign`` subcommand
|
||||
- Added ``only`` option to ``assign`` subcommand
|
||||
|
||||
Fixes
|
||||
-----
|
||||
- Fixed a crash bug caused by the historical figures DFHack uses to store persistent data.
|
||||
- More plugins should recognize non-dwarf citizens
|
||||
- Fixed a possible crash from cloning jobs
|
||||
- moveToBuilding() now sets flags for items that aren't a structural part of the building properly
|
||||
- `autotrade`, `stocks`: Made trading work when multiple caravans are present but only some can trade
|
||||
- `confirm` note-delete: No longer interferes with name entry
|
||||
- `exportlegends`: Handles entities without specific races, and a few other fixes for things new to v0.42
|
||||
- `fastdwarf`: Fixed a bug involving teleporting mothers but not the babies they're holding.
|
||||
- `gaydar`: Fixed text display on OS X/Linux and failure with soul-less creatures
|
||||
- `manipulator`:
|
||||
|
||||
- allowed editing of non-dwarf citizens
|
||||
- stopped ghosts and visitors from being editable
|
||||
- fixed applying last custom profession
|
||||
|
||||
- `modtools/create-unit`: Stopped making units without civs historical figures
|
||||
- `modtools/force`:
|
||||
|
||||
- Removed siege option
|
||||
- Prevented a crash resulting from a bad civilization option
|
||||
|
||||
- `showmood`: Fixed name display on OS X/Linux
|
||||
- `view-item-info`: Fixed density units
|
||||
|
||||
Misc Improvements
|
||||
-----------------
|
||||
- `autochop`: Can now edit log minimum/maximum directly and remove limit entirely
|
||||
- `autolabor`, `autohauler`, `manipulator`: Added support for new jobs/labors/skills
|
||||
- `colonies`: now implemented by a script
|
||||
- `createitem`: Can now create items anywhere without specifying a unit, as long as a unit exists on the map
|
||||
- `devel/export-dt-ini`: Updated for 0.42.06
|
||||
- `devel/find-offsets`: Automated several more scans
|
||||
- `gui/gm-editor`: Now supports finding some items with a numeric ID (with ``i``)
|
||||
- `lua`: Now supports some built-in variables like `gui/gm-editor`, e.g. ``unit``, ``screen``
|
||||
- `remotefortressreader`: Can now trigger keyboard events
|
||||
- `stockflow`: Now offers better control over individual craft jobs
|
||||
- `weather`: now implemented by a script
|
||||
- `zone`: colored output
|
||||
|
||||
Removed
|
||||
-------
|
||||
- DFusion: legacy script system, obsolete or replaced by better alternatives
|
||||
|
||||
|
||||
DFHack 0.40.24-r5
|
||||
=================
|
||||
|
||||
New Features
|
||||
------------
|
||||
- `confirm`:
|
||||
|
||||
- Added a ``uniform-delete`` option for military uniform deletion
|
||||
- Added a basic in-game configuration UI
|
||||
|
||||
Fixes
|
||||
-----
|
||||
- Fixed a rare crash that could result from running `keybinding` in onLoadWorld.init
|
||||
- Script help that doesn't start with a space is now recognized correctly
|
||||
- `confirm`: Fixed issues with haul-delete, route-delete, and squad-disband confirmations intercepting keys too aggressively
|
||||
- `emigration` should work now
|
||||
- `fix-unit-occupancy`: Significantly optimized - up to 2,000 times faster in large fortresses
|
||||
- `gui/create-item`: Allow exiting quantity prompt
|
||||
- `gui/family-affairs`: Fixed an issue where lack of relationships wasn't recognized and other issues
|
||||
- `modtools/create-unit`: Fixed a possible issue in reclaim fortress mode
|
||||
- `search-plugin`: Fixed a crash on the military screen
|
||||
- `tweak` max-wheelbarrow: Fixed a minor display issue with large numbers
|
||||
- `workflow`: Fixed a crash related to job postings (and added a fix for existing, broken jobs)
|
||||
|
||||
Misc Improvements
|
||||
-----------------
|
||||
- Unrecognized command feedback now includes more information about plugins
|
||||
- `fix/dry-buckets`: replaces the ``drybuckets`` plugin
|
||||
- `feature`: now implemented by a script
|
||||
|
||||
DFHack 0.40.24-r4
|
||||
=================
|
||||
|
||||
Internals
|
||||
---------
|
||||
- A method for caching screen output is now available to Lua (and C++)
|
||||
- Developer plugins can be ignored on startup by setting the ``DFHACK_NO_DEV_PLUGINS`` environment variable
|
||||
- The console on Linux and OS X now recognizes keyboard input between prompts
|
||||
- JSON libraries available (C++ and Lua)
|
||||
- More DFHack build information used in plugin version checks and available to plugins and lua scripts
|
||||
- Fixed a rare overflow issue that could cause crashes on Linux and OS X
|
||||
- Stopped DF window from receiving input when unfocused on OS X
|
||||
- Fixed issues with keybindings involving :kbd:`Ctrl`:kbd:`A` and :kbd:`Ctrl`:kbd:`Z`,
|
||||
as well as :kbd:`Alt`:kbd:`E`/:kbd:`U`/:kbd:`N` on OS X
|
||||
- Multiple contexts can now be specified when adding keybindings
|
||||
- Keybindings can now use :kbd:`F10`-:kbd:`F12` and :kbd:`0`-:kbd:`9`
|
||||
- Plugin system is no longer restricted to plugins that exist on startup
|
||||
- :file:`dfhack.init` file locations significantly generalized
|
||||
|
||||
Lua
|
||||
---
|
||||
- Scripts can be enabled with the built-in `enable`/`disable <disable>` commands
|
||||
- A new function, ``reqscript()``, is available as a safer alternative to ``script_environment()``
|
||||
- Lua viewscreens can choose not to intercept the OPTIONS keybinding
|
||||
|
||||
New internal commands
|
||||
---------------------
|
||||
- `kill-lua`: Interrupt running Lua scripts
|
||||
- `type`: Show where a command is implemented
|
||||
|
||||
New plugins
|
||||
-----------
|
||||
- `confirm`: Adds confirmation dialogs for several potentially dangerous actions
|
||||
- `fix-unit-occupancy`: Fixes issues with unit occupancy, such as faulty "unit blocking tile" messages (:bug:`3499`)
|
||||
- `title-version` (formerly ``vshook``): Display DFHack version on title screen
|
||||
|
||||
New scripts
|
||||
-----------
|
||||
- `armoks-blessing`: Adjust all attributes, personality, age and skills of all dwarves in play
|
||||
- `brainwash`: brainwash a dwarf (modifying their personality)
|
||||
- `burial`: sets all unowned coffins to allow burial ("-pets" to allow pets too)
|
||||
- `deteriorateclothes`: make worn clothes on the ground wear far faster to boost FPS
|
||||
- `deterioratecorpses`: make body parts wear away far faster to boost FPS
|
||||
- `deterioratefood`: make food vanish after a few months if not used
|
||||
- `elevate-mental`: elevate all the mental attributes of a unit
|
||||
- `elevate-physical`: elevate all the physical attributes of a unit
|
||||
- `emigration`: stressed dwarves may leave your fortress if they see a chance
|
||||
- `fix-ster`: changes fertility/sterility of animals or dwarves
|
||||
- `gui/family-affairs`: investigate and alter romantic relationships
|
||||
- `make-legendary`: modify skill(s) of a single unit
|
||||
- `modtools/create-unit`: create new units from nothing
|
||||
- `modtools/equip-item`: a script to equip items on units
|
||||
- `points`: set number of points available at embark screen
|
||||
- `pref-adjust`: Adjust all preferences of all dwarves in play
|
||||
- `rejuvenate`: make any "old" dwarf 20 years old
|
||||
- `starvingdead`: make undead weaken after one month on the map, and crumble after six
|
||||
- `view-item-info`: adds information and customisable descriptions to item viewscreens
|
||||
- `warn-starving`: check for starving, thirsty, or very drowsy units and pause with warning if any are found
|
||||
|
||||
New tweaks
|
||||
----------
|
||||
- embark-profile-name: Allows the use of lowercase letters when saving embark profiles
|
||||
- kitchen-keys: Fixes DF kitchen meal keybindings
|
||||
- kitchen-prefs-color: Changes color of enabled items to green in kitchen preferences
|
||||
- kitchen-prefs-empty: Fixes a layout issue with empty kitchen tabs
|
||||
|
||||
Fixes
|
||||
-----
|
||||
- Plugins with vmethod hooks can now be reloaded on OS X
|
||||
- Lua's ``os.system()`` now works on OS X
|
||||
- Fixed default arguments in Lua gametype detection functions
|
||||
- Circular lua dependencies (reqscript/script_environment) fixed
|
||||
- Prevented crash in ``Items::createItem()``
|
||||
- `buildingplan`: Now supports hatch covers
|
||||
- `gui/create-item`: fixed assigning quality to items, made :kbd:`Esc` work properly
|
||||
- `gui/gm-editor`: handles lua tables properly
|
||||
- `help`: now recognizes built-in commands, like ``help``
|
||||
- `manipulator`: fixed crash when selecting custom professions when none are found
|
||||
- `remotefortressreader`: fixed crash when attempting to send map info when no map was loaded
|
||||
- `search-plugin`: fixed crash in unit list after cancelling a job; fixed crash when disabling stockpile category after searching in a subcategory
|
||||
- `stockpiles`: now checks/sanitizes filenames when saving
|
||||
- `stocks`: fixed a crash when right-clicking
|
||||
- `steam-engine`: fixed a crash on arena load; number keys (e.g. 2/8) take priority over cursor keys when applicable
|
||||
- tweak fps-min fixed
|
||||
- tweak farm-plot-select: Stopped controls from appearing when plots weren't fully built
|
||||
- `workflow`: Fixed some issues with stuck jobs. Existing stuck jobs must be cancelled and re-added
|
||||
- `zone`: Fixed a crash when using ``zone set`` (and a few other potential crashes)
|
||||
|
||||
Misc Improvements
|
||||
-----------------
|
||||
- DFHack documentation:
|
||||
|
||||
- massively reorganised, into files of more readable size
|
||||
- added many missing entries
|
||||
- indexes, internal links, offline search all documents
|
||||
- includes documentation of linked projects (df-structures, third-party scripts)
|
||||
- better HTML generation with Sphinx
|
||||
- documentation for scripts now located in source files
|
||||
|
||||
- `autolabor`:
|
||||
|
||||
- Stopped modification of labors that shouldn't be modified for brokers/diplomats
|
||||
- Prioritize skilled dwarves more efficiently
|
||||
- Prevent dwarves from running away with tools from previous jobs
|
||||
|
||||
- `automaterial`: Fixed several issues with constructions being allowed/disallowed incorrectly when using box-select
|
||||
- `dwarfmonitor`:
|
||||
|
||||
- widgets' positions, formats, etc. are now customizable
|
||||
- weather display now separated from the date display
|
||||
- New mouse cursor widget
|
||||
|
||||
- `gui/dfstatus`: Can enable/disable individual categories and customize metal bar list
|
||||
- `full-heal`: ``-r`` option removes corpses
|
||||
- `gui/gm-editor`
|
||||
|
||||
- Pointers can now be displaced
|
||||
- Added some useful aliases: "item" for the selected item, "screen" for the current screen, etc.
|
||||
- Now avoids errors with unrecognized types
|
||||
|
||||
- `gui/hack-wish`: renamed to `gui/create-item`
|
||||
- `keybinding list <keybinding>` accepts a context
|
||||
- `lever`:
|
||||
|
||||
- Lists lever names
|
||||
- ``lever pull`` can be used to pull the currently-selected lever
|
||||
|
||||
- ``memview``: Fixed display issue
|
||||
- `modtools/create-item`: arguments are named more clearly, and you can specify the creator to be the unit with id ``df.global.unit_next_id-1`` (useful in conjunction with `modtools/create-unit`)
|
||||
- ``nyan``: Can now be stopped with dfhack-run
|
||||
- `plug`: lists all plugins; shows state and number of commands in plugins
|
||||
- `prospect`: works from within command-prompt
|
||||
- `quicksave`: Restricted to fortress mode
|
||||
- `remotefortressreader`: Exposes more information
|
||||
- `search-plugin`:
|
||||
|
||||
- Supports noble suggestion screen (e.g. suggesting a baron)
|
||||
- Supports fortress mode loo[k] menu
|
||||
- Recognizes ? and ; keys
|
||||
|
||||
- `stocks`: can now match beginning and end of item names
|
||||
- `teleport`: Fixed cursor recognition
|
||||
- `tidlers`, `twaterlvl`: now implemented by scripts instead of a plugin
|
||||
- `tweak`:
|
||||
|
||||
- debug output now logged to stderr.log instead of console - makes DFHack start faster
|
||||
- farm-plot-select: Fixed issues with selecting undiscovered crops
|
||||
|
||||
- `workflow`: Improved handling of plant reactions
|
||||
|
||||
Removed
|
||||
-------
|
||||
- `embark-tools` nano: 1x1 embarks are now possible in vanilla 0.40.24
|
||||
|
||||
DFHack 0.40.24-r3
|
||||
=================
|
||||
|
||||
Internals
|
||||
---------
|
||||
- Ruby library now included on OS X - Ruby scripts should work on OS X 10.10
|
||||
- libstdc++ should work with older versions of OS X
|
||||
- Added support for `onMapLoad.init / onMapUnload.init <other_init_files>` scripts
|
||||
- game type detection functions are now available in the World module
|
||||
- The ``DFHACK_LOG_MEM_RANGES`` environment variable can be used to log information to ``stderr.log`` on OS X
|
||||
- Fixed adventure mode menu names
|
||||
- Fixed command usage information for some commands
|
||||
|
||||
Lua
|
||||
---
|
||||
- Lua scripts will only be reloaded if necessary
|
||||
- Added a ``df2console()`` wrapper, useful for printing DF (CP437-encoded) text to the console in a portable way
|
||||
- Added a ``strerror()`` wrapper
|
||||
|
||||
New Internal Commands
|
||||
---------------------
|
||||
- `hide`, `show`: hide and show the console on Windows
|
||||
- `sc-script`: Allows additional scripts to be run when certain events occur (similar to `onLoad.init` scripts)
|
||||
|
||||
New Plugins
|
||||
-----------
|
||||
- `autohauler`: A hauling-only version of autolabor
|
||||
|
||||
New Scripts
|
||||
-----------
|
||||
- `modtools/reaction-product-trigger`: triggers callbacks when products are produced (contrast with when reactions complete)
|
||||
|
||||
New Tweaks
|
||||
----------
|
||||
- `fps-min <tweak>`: Fixes the in-game minimum FPS setting
|
||||
- `shift-8-scroll <tweak>`: Gives Shift+8 (or ``*``) priority when scrolling menus, instead of scrolling the map
|
||||
- `tradereq-pet-gender <tweak>`: Displays pet genders on the trade request screen
|
||||
|
||||
Fixes
|
||||
-----
|
||||
- Fixed game type detection in `3dveins`, `gui/create-item`, `reveal`, `seedwatch`
|
||||
- ``PRELOAD_LIB``: More extensible on Linux
|
||||
- `add-spatter`, `eventful`: Fixed crash on world load
|
||||
- `add-thought`: Now has a proper subthought arg.
|
||||
- `building-hacks`: Made buildings produce/consume correct amount of power
|
||||
- `fix-armory`: compiles and is available again (albeit with issues)
|
||||
- `gui/gm-editor`: Added search option (accessible with "s")
|
||||
- `hack-wish <gui/create-item>`: Made items stack properly.
|
||||
- `modtools/skill-change`: Made level granularity work properly.
|
||||
- `show-unit-syndromes`: should work
|
||||
- `stockflow`:
|
||||
|
||||
- Fixed error message in Arena mode
|
||||
- no longer checks the DF version
|
||||
- fixed ballistic arrow head orders
|
||||
- convinces the bookkeeper to update records more often
|
||||
|
||||
- `zone`: Stopped crash when scrolling cage owner list
|
||||
|
||||
Misc Improvements
|
||||
-----------------
|
||||
- `autolabor`: A negative pool size can be specified to use the most unskilled dwarves
|
||||
- `building-hacks`:
|
||||
|
||||
- Added a way to allow building to work even if it consumes more power than is available.
|
||||
- Added setPower/getPower functions.
|
||||
|
||||
- `catsplosion`: Can now trigger pregnancies in (most) other creatures
|
||||
- `exportlegends`: ``info`` and ``all`` options export ``legends_plus.xml`` with more data for legends utilities
|
||||
- `manipulator`:
|
||||
|
||||
- Added ability to edit nicknames/profession names
|
||||
- added "Job" as a View Type, in addition to "Profession" and "Squad"
|
||||
- added custom profession templates with masking
|
||||
|
||||
- `remotefortressreader`: Exposes more information
|
||||
|
||||
|
||||
DFHack 0.40.24-r2
|
||||
=================
|
||||
|
||||
Internals
|
||||
---------
|
||||
- Lua scripts can set environment variables of each other with ``dfhack.run_script_with_env``
|
||||
- Lua scripts can now call each others internal nonlocal functions with ``dfhack.script_environment(scriptName).functionName(arg1,arg2)``
|
||||
- `eventful`: Lua reactions no longer require LUA_HOOK as a prefix; you can register a callback for the completion of any reaction with a name
|
||||
- Filesystem module now provides file access/modification times and can list directories (normally and recursively)
|
||||
- Units Module: New functions::
|
||||
|
||||
isWar
|
||||
isHunter
|
||||
isAvailableForAdoption
|
||||
isOwnCiv
|
||||
isOwnRace
|
||||
getRaceName
|
||||
getRaceNamePlural
|
||||
getRaceBabyName
|
||||
getRaceChildName
|
||||
isBaby
|
||||
isChild
|
||||
isAdult
|
||||
isEggLayer
|
||||
isGrazer
|
||||
isMilkable
|
||||
isTrainableWar
|
||||
isTrainableHunting
|
||||
isTamable
|
||||
isMale
|
||||
isFemale
|
||||
isMerchant
|
||||
isForest
|
||||
isMarkedForSlaughter
|
||||
|
||||
- Buildings Module: New Functions::
|
||||
|
||||
isActivityZone
|
||||
isPenPasture
|
||||
isPitPond
|
||||
isActive
|
||||
findPenPitAt
|
||||
|
||||
Fixes
|
||||
-----
|
||||
- ``dfhack.run_script`` should correctly find save-specific scripts now.
|
||||
- `add-thought`: updated to properly affect stress.
|
||||
- `hfs-pit`: should work now
|
||||
- `autobutcher`: takes gelding into account
|
||||
- :file:`init.lua` existence checks should be more reliable (notably when using non-English locales)
|
||||
|
||||
Misc Improvements
|
||||
-----------------
|
||||
Multiline commands are now possible inside dfhack.init scripts. See :file:`dfhack.init-example` for example usage.
|
||||
|
||||
|
||||
DFHack 0.40.24-r1
|
||||
=================
|
||||
|
||||
Internals
|
||||
---------
|
||||
CMake shouldn't cache DFHACK_RELEASE anymore. People may need to manually update/delete their CMake cache files to get rid of it.
|
||||
|
||||
|
||||
DFHack 0.40.24-r0
|
||||
=================
|
||||
|
||||
Internals
|
||||
---------
|
||||
- `EventManager`: fixed crash error with EQUIPMENT_CHANGE event.
|
||||
- key modifier state exposed to Lua (ie :kbd:`Ctrl`, :kbd:`Alt`, :kbd:`Shift`)
|
||||
|
||||
Fixes
|
||||
-----
|
||||
``dfhack.sh`` can now be run from other directories on OS X
|
||||
|
||||
New Plugins
|
||||
-----------
|
||||
- `blueprint`: export part of your fortress to quickfort .csv files
|
||||
|
||||
New Scripts
|
||||
-----------
|
||||
- `hotkey-notes`: print key, name, and jump position of hotkeys
|
||||
|
||||
Removed
|
||||
-------
|
||||
- needs_porting/*
|
||||
|
||||
Misc Improvements
|
||||
-----------------
|
||||
Added support for searching more lists
|
||||
|
||||
|
||||
Older Changelogs
|
||||
================
|
||||
Are kept in a seperate file: `HISTORY`
|
||||
|
||||
.. that's ``docs/history.rst``, if you're reading the raw text.
|
@ -1,4 +1,6 @@
|
||||
VC2010
|
||||
VC2015
|
||||
VC2015_32
|
||||
DF_PATH.txt
|
||||
_CPack_Packages
|
||||
*.tar.*
|
||||
|
@ -1,9 +0,0 @@
|
||||
@echo off
|
||||
IF EXIST DF_PATH.txt SET /P _DF_PATH=<DF_PATH.txt
|
||||
IF NOT EXIST DF_PATH.txt SET _DF_PATH=%CD%\DF
|
||||
mkdir VC2010
|
||||
cd VC2010
|
||||
echo generating a build folder
|
||||
rem for /f "delims=" %%a in ('DATE /T') do @set myvar=breakfast-%BUILD_NUMBER%
|
||||
set myvar=breakfast-%BUILD_NUMBER%
|
||||
cmake ..\.. -G"Visual Studio 10" -DDFHACK_RELEASE="%myvar%" -DCMAKE_INSTALL_PREFIX="%_DF_PATH%" -DBUILD_DEVEL=1 -DBUILD_DEV_PLUGINS=1 -DBUILD_DF2MC=1 -DBUILD_DFUSION=1 -DBUILD_STONESENSE=1 -DBUILD_SERVER=1
|
@ -1,6 +0,0 @@
|
||||
IF EXIST DF_PATH.txt SET /P _DF_PATH=<DF_PATH.txt
|
||||
IF NOT EXIST DF_PATH.txt SET _DF_PATH=%CD%\DF
|
||||
mkdir VC2010
|
||||
cd VC2010
|
||||
echo generating a build folder
|
||||
cmake ..\.. -G"Visual Studio 10" -DCMAKE_INSTALL_PREFIX="%_DF_PATH%" -DBUILD_DEVEL=1 -DBUILD_DEV_PLUGINS=1 -DBUILD_DF2MC=1 -DBUILD_DFUSION=1 -DBUILD_STONESENSE=1 -DBUILD_SERVER=1
|
@ -1,6 +0,0 @@
|
||||
IF EXIST DF_PATH.txt SET /P _DF_PATH=<DF_PATH.txt
|
||||
IF NOT EXIST DF_PATH.txt SET _DF_PATH=%CD%\DF
|
||||
mkdir VC2010
|
||||
cd VC2010
|
||||
echo generating a build folder
|
||||
cmake ..\.. -G"Visual Studio 10" -DCMAKE_INSTALL_PREFIX="%_DF_PATH%" -DBUILD_DEVEL=0 -DBUILD_DEV_PLUGINS=0 -DBUILD_DF2MC=0 -DBUILD_DFUSION=0 -DBUILD_STONESENSE=0 -DBUILD_SERVER=0
|
@ -1,6 +0,0 @@
|
||||
IF EXIST DF_PATH.txt SET /P _DF_PATH=<DF_PATH.txt
|
||||
IF NOT EXIST DF_PATH.txt SET _DF_PATH=%CD%\DF
|
||||
mkdir VC2010
|
||||
cd VC2010
|
||||
echo generating a build folder
|
||||
cmake ..\.. -G"Visual Studio 10" -DCMAKE_INSTALL_PREFIX="%_DF_PATH%" -DBUILD_DEVEL=0 -DBUILD_DEV_PLUGINS=0 -DBUILD_DF2MC=1 -DBUILD_DFUSION=1 -DBUILD_STONESENSE=1 -DBUILD_SERVER=1
|
@ -0,0 +1,34 @@
|
||||
{
|
||||
"folders":
|
||||
[
|
||||
{
|
||||
"path": "."
|
||||
}
|
||||
],
|
||||
"build_systems":
|
||||
[
|
||||
{
|
||||
"name": "DFHack make",
|
||||
"working_dir": "$project_path",
|
||||
"cmd": ["python", "$project_path/build/sublime/make.py", "$file"],
|
||||
"variants": [
|
||||
{
|
||||
"name": "Build all",
|
||||
"cmd": ["python", "$project_path/build/sublime/make.py", "-a"]
|
||||
},
|
||||
{
|
||||
"name": "Build+install all",
|
||||
"cmd": ["python", "$project_path/build/sublime/make.py", "-ai"]
|
||||
},
|
||||
{
|
||||
"name": "Build plugin",
|
||||
"cmd": ["python", "$project_path/build/sublime/make.py", "-ap", "$file"]
|
||||
},
|
||||
{
|
||||
"name": "Build+install plugin",
|
||||
"cmd": ["python", "$project_path/build/sublime/make.py", "-aip", "$file"]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
from __future__ import print_function
|
||||
import argparse
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
class BuildError(Exception): pass
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('file', nargs='?', default='', help='current filename')
|
||||
parser.add_argument('-a', '--all', action='store_true', help='Build all targets')
|
||||
parser.add_argument('-i', '--install', action='store_true', help='Install')
|
||||
parser.add_argument('-p', '--plugin', action='store_true', help='Build specified plugin')
|
||||
|
||||
def find_build_folder():
|
||||
# search for the one with the most recently modified Makefile
|
||||
folder = None
|
||||
mtime = 0
|
||||
for f in os.listdir('.'):
|
||||
if f.startswith('build'):
|
||||
makefile = os.path.join(f, 'Makefile')
|
||||
if os.path.isfile(makefile) and os.path.getmtime(makefile) > mtime:
|
||||
folder = f
|
||||
mtime = os.path.getmtime(makefile)
|
||||
if not folder:
|
||||
raise BuildError('No valid build folder found')
|
||||
return folder
|
||||
|
||||
def get_plugin_name(filename):
|
||||
filename = filename.replace('/devel', '')
|
||||
match = re.search(r'plugins/(.+?)[/\.]', filename)
|
||||
if match:
|
||||
return match.group(1)
|
||||
|
||||
def run_command(cmd):
|
||||
print('$ ' + ' '.join(cmd))
|
||||
sys.stdout.flush()
|
||||
if subprocess.call(cmd) != 0:
|
||||
raise BuildError('command execution failed: ' + ' '.join(cmd))
|
||||
|
||||
def main(args):
|
||||
os.chdir(find_build_folder())
|
||||
print('Build folder:', os.getcwd())
|
||||
cmd = ['make', '-j3']
|
||||
|
||||
if args.plugin:
|
||||
plugin = get_plugin_name(args.file)
|
||||
if not plugin:
|
||||
raise BuildError('Cannot determine current plugin name from %r' % args.file)
|
||||
cmd += [plugin + '/fast']
|
||||
|
||||
run_command(cmd)
|
||||
|
||||
if args.install:
|
||||
run_command(['make', 'install/fast'])
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
main(parser.parse_args())
|
||||
except BuildError as e:
|
||||
print('** Error: ' + str(e))
|
||||
sys.exit(1)
|
@ -1,4 +1,4 @@
|
||||
call "%VS100COMNTOOLS%vsvars32.bat"
|
||||
cd VC2010
|
||||
call "%VS140COMNTOOLS%vsvars32.bat"
|
||||
cd VC2015_32
|
||||
msbuild /m /p:Platform=Win32 /p:Configuration=RelWithDebInfo ALL_BUILD.vcxproj
|
||||
cd ..
|
@ -1,5 +1,5 @@
|
||||
call "%VS100COMNTOOLS%vsvars32.bat"
|
||||
cd VC2010
|
||||
call "%VS140COMNTOOLS%vsvars32.bat"
|
||||
cd VC2015_32
|
||||
msbuild /m /p:Platform=Win32 /p:Configuration=Release ALL_BUILD.vcxproj
|
||||
cd ..
|
||||
pause
|
@ -0,0 +1,6 @@
|
||||
IF EXIST DF_PATH.txt SET /P _DF_PATH=<DF_PATH.txt
|
||||
IF NOT EXIST DF_PATH.txt SET _DF_PATH=%CD%\DF
|
||||
mkdir VC2015_32
|
||||
cd VC2015_32
|
||||
echo generating a build folder
|
||||
cmake ..\..\.. -G"Visual Studio 14" -DCMAKE_INSTALL_PREFIX="%_DF_PATH%" -DBUILD_DEVEL=1 -DBUILD_DEV_PLUGINS=1 -DBUILD_STONESENSE=1
|
@ -1,7 +1,7 @@
|
||||
IF EXIST DF_PATH.txt SET /P _DF_PATH=<DF_PATH.txt
|
||||
IF NOT EXIST DF_PATH.txt SET _DF_PATH=%CD%\DF
|
||||
mkdir VC2010
|
||||
cd VC2010
|
||||
mkdir VC2015_32
|
||||
cd VC2015_32
|
||||
echo Pre-generating a build folder
|
||||
cmake ..\.. -G"Visual Studio 10" -DCMAKE_INSTALL_PREFIX="%_DF_PATH%"
|
||||
cmake ..\..\.. -G"Visual Studio 14" -DCMAKE_INSTALL_PREFIX="%_DF_PATH%"
|
||||
cmake-gui .
|
@ -0,0 +1,6 @@
|
||||
IF EXIST DF_PATH.txt SET /P _DF_PATH=<DF_PATH.txt
|
||||
IF NOT EXIST DF_PATH.txt SET _DF_PATH=%CD%\DF
|
||||
mkdir VC2015_32
|
||||
cd VC2015_32
|
||||
echo generating a build folder
|
||||
cmake ..\..\.. -G"Visual Studio 14" -DCMAKE_INSTALL_PREFIX="%_DF_PATH%" -DBUILD_DEVEL=0 -DBUILD_DEV_PLUGINS=0 -DBUILD_STONESENSE=0
|
@ -0,0 +1,6 @@
|
||||
IF EXIST DF_PATH.txt SET /P _DF_PATH=<DF_PATH.txt
|
||||
IF NOT EXIST DF_PATH.txt SET _DF_PATH=%CD%\DF
|
||||
mkdir VC2015_32
|
||||
cd VC2015_32
|
||||
echo generating a build folder
|
||||
cmake ..\..\.. -G"Visual Studio 14" -DCMAKE_INSTALL_PREFIX="%_DF_PATH%" -DBUILD_DEVEL=0 -DBUILD_DEV_PLUGINS=0 -DBUILD_DOCS=1 -DBUILD_STONESENSE=1
|
@ -1,4 +1,4 @@
|
||||
call "%VS100COMNTOOLS%vsvars32.bat"
|
||||
cd VC2010
|
||||
call "%VS140COMNTOOLS%vsvars32.bat"
|
||||
cd VC2015_32
|
||||
msbuild /m /p:Platform=Win32 /p:Configuration=RelWithDebInfo INSTALL.vcxproj
|
||||
cd ..
|
@ -1,4 +1,4 @@
|
||||
call "%VS100COMNTOOLS%vsvars32.bat"
|
||||
cd VC2010
|
||||
call "%VS140COMNTOOLS%vsvars32.bat"
|
||||
cd VC2015_32
|
||||
msbuild /m /p:Platform=Win32 /p:Configuration=Release INSTALL.vcxproj
|
||||
cd ..
|
@ -1,6 +1,6 @@
|
||||
@echo off
|
||||
call "%VS100COMNTOOLS%vsvars32.bat"
|
||||
cd VC2010
|
||||
call "%VS140COMNTOOLS%vsvars32.bat"
|
||||
cd VC2015_32
|
||||
msbuild /m /p:Platform=Win32 /p:Configuration=RelWithDebInfo PACKAGE.vcxproj
|
||||
cd ..
|
||||
exit %ERRORLEVEL%
|
@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
call "%VS100COMNTOOLS%vsvars32.bat"
|
||||
cd VC2010
|
||||
call "%VS140COMNTOOLS%vsvars32.bat"
|
||||
cd VC2015_32
|
||||
msbuild /m /p:Platform=Win32 /p:Configuration=Release PACKAGE.vcxproj
|
||||
cd ..
|
@ -0,0 +1,4 @@
|
||||
call "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
|
||||
cd VC2015
|
||||
msbuild /m /p:Platform=x64 /p:Configuration=RelWithDebInfo ALL_BUILD.vcxproj
|
||||
cd ..
|
@ -0,0 +1,5 @@
|
||||
call "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
|
||||
cd VC2015
|
||||
msbuild /m /p:Platform=x64 /p:Configuration=Release ALL_BUILD.vcxproj
|
||||
cd ..
|
||||
pause
|
@ -0,0 +1,6 @@
|
||||
IF EXIST DF_PATH.txt SET /P _DF_PATH=<DF_PATH.txt
|
||||
IF NOT EXIST DF_PATH.txt SET _DF_PATH=%CD%\DF
|
||||
mkdir VC2015
|
||||
cd VC2015
|
||||
echo generating a build folder
|
||||
cmake ..\..\.. -G"Visual Studio 14 Win64" -T v140_xp -DCMAKE_INSTALL_PREFIX="%_DF_PATH%" -DBUILD_DEVEL=1 -DBUILD_DEV_PLUGINS=1 -DBUILD_STONESENSE=1
|
@ -0,0 +1,7 @@
|
||||
IF EXIST DF_PATH.txt SET /P _DF_PATH=<DF_PATH.txt
|
||||
IF NOT EXIST DF_PATH.txt SET _DF_PATH=%CD%\DF
|
||||
mkdir VC2015
|
||||
cd VC2015
|
||||
echo Pre-generating a build folder
|
||||
cmake ..\..\.. -G"Visual Studio 14 Win64" -T v140_xp -DCMAKE_INSTALL_PREFIX="%_DF_PATH%"
|
||||
cmake-gui .
|
@ -0,0 +1,6 @@
|
||||
IF EXIST DF_PATH.txt SET /P _DF_PATH=<DF_PATH.txt
|
||||
IF NOT EXIST DF_PATH.txt SET _DF_PATH=%CD%\DF
|
||||
mkdir VC2015
|
||||
cd VC2015
|
||||
echo generating a build folder
|
||||
cmake ..\..\.. -G"Visual Studio 14 Win64" -T v140_xp -DCMAKE_INSTALL_PREFIX="%_DF_PATH%" -DBUILD_DEVEL=0 -DBUILD_DEV_PLUGINS=0 -DBUILD_STONESENSE=0
|
@ -0,0 +1,6 @@
|
||||
IF EXIST DF_PATH.txt SET /P _DF_PATH=<DF_PATH.txt
|
||||
IF NOT EXIST DF_PATH.txt SET _DF_PATH=%CD%\DF
|
||||
mkdir VC2015
|
||||
cd VC2015
|
||||
echo generating a build folder
|
||||
cmake ..\..\.. -G"Visual Studio 14 Win64" -T v140_xp -DCMAKE_INSTALL_PREFIX="%_DF_PATH%" -DBUILD_DEVEL=0 -DBUILD_DEV_PLUGINS=0 -DBUILD_DOCS=1 -DBUILD_STONESENSE=1
|
@ -0,0 +1,4 @@
|
||||
call "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
|
||||
cd VC2015
|
||||
msbuild /m /p:Platform=x64 /p:Configuration=RelWithDebInfo INSTALL.vcxproj
|
||||
cd ..
|
@ -0,0 +1,4 @@
|
||||
call "%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
|
||||
cd VC2015
|
||||
msbuild /m /p:Platform=x64 /p:Configuration=Release INSTALL.vcxproj
|
||||
cd ..
|
@ -0,0 +1,6 @@
|
||||
@echo off
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
|
||||
cd VC2015
|
||||
msbuild /m /p:Platform=x64 /p:Configuration=RelWithDebInfo PACKAGE.vcxproj
|
||||
cd ..
|
||||
exit %ERRORLEVEL%
|
@ -0,0 +1,5 @@
|
||||
@echo off
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
|
||||
cd VC2015
|
||||
msbuild /m /p:Platform=x64 /p:Configuration=Release PACKAGE.vcxproj
|
||||
cd ..
|
@ -0,0 +1,32 @@
|
||||
Option Explicit
|
||||
|
||||
Const BIF_returnonlyfsdirs = &H0001
|
||||
|
||||
Dim wsh, objDlg, objF, fso, spoFile
|
||||
Set objDlg = WScript.CreateObject("Shell.Application")
|
||||
Set objF = objDlg.BrowseForFolder (&H0,"Select your DF folder", BIF_returnonlyfsdirs)
|
||||
|
||||
Set fso = CreateObject("Scripting.FileSystemObject")
|
||||
If fso.FileExists("DF_PATH.txt") Then
|
||||
fso.DeleteFile "DF_PATH.txt", True
|
||||
End If
|
||||
|
||||
If IsValue(objF) Then
|
||||
If InStr(1, TypeName(objF), "Folder") > 0 Then
|
||||
Set spoFile = fso.CreateTextFile("DF_PATH.txt", True)
|
||||
spoFile.WriteLine(objF.Self.Path)
|
||||
End If
|
||||
End If
|
||||
|
||||
Function IsValue(obj)
|
||||
' Check whether the value has been returned.
|
||||
Dim tmp
|
||||
On Error Resume Next
|
||||
tmp = " " & obj
|
||||
If Err <> 0 Then
|
||||
IsValue = False
|
||||
Else
|
||||
IsValue = True
|
||||
End If
|
||||
On Error GoTo 0
|
||||
End Function
|
@ -1 +1 @@
|
||||
Subproject commit dc7ff5dadf7b1bf96a82149b201d3674c97631d9
|
||||
Subproject commit 6a9153d053a250be34996b3fd86ac1166c3e17cb
|
@ -0,0 +1,30 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
# A replacement for "cmake -E copy_if_different" that supports multiple files,
|
||||
# which old cmake versions do not support
|
||||
|
||||
# Usage: copy-if-different.pl src-file [src-file...] dest-dir
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Digest::SHA;
|
||||
use File::Basename;
|
||||
use File::Copy;
|
||||
|
||||
sub sha_file {
|
||||
my $filename = shift;
|
||||
my $sha = Digest::SHA->new(256);
|
||||
$sha->addfile($filename);
|
||||
return $sha->hexdigest;
|
||||
}
|
||||
|
||||
my $dest_dir = pop @ARGV or die "no destination dir";
|
||||
-d $dest_dir or die "not a directory: $dest_dir";
|
||||
my @src_files = @ARGV or die "no source files";
|
||||
|
||||
foreach my $file (@src_files) {
|
||||
my $dest = "$dest_dir/" . basename($file);
|
||||
next if -f $dest && sha_file($file) eq sha_file($dest);
|
||||
copy($file, $dest);
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use IO::Uncompress::Gunzip qw(gunzip $GunzipError);
|
||||
|
||||
my %args = map { $_ => 1 } @ARGV;
|
||||
|
||||
my $in_file = $ARGV[0] or die "no input file";
|
||||
# remove extension
|
||||
(my $out_file = $in_file) =~ s{\.[^.]+$}{};
|
||||
|
||||
if (! -f $in_file) {
|
||||
die "input file does not exist: \"$in_file\"\n";
|
||||
}
|
||||
if (-f $out_file and !exists($args{'--force'})) {
|
||||
die "output file exists, not overwriting: \"$out_file\"";
|
||||
}
|
||||
|
||||
gunzip $in_file => $out_file, BinModeOut => 1 or die "gunzip failed: $GunzipError\n";
|
@ -0,0 +1,45 @@
|
||||
/*
|
||||
** $Id: lprefix.h,v 1.2 2014/12/29 16:54:13 roberto Exp $
|
||||
** Definitions for Lua code that must come before any other header file
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
|
||||
#ifndef lprefix_h
|
||||
#define lprefix_h
|
||||
|
||||
|
||||
/*
|
||||
** Allows POSIX/XSI stuff
|
||||
*/
|
||||
#if !defined(LUA_USE_C89) /* { */
|
||||
|
||||
#if !defined(_XOPEN_SOURCE)
|
||||
#define _XOPEN_SOURCE 600
|
||||
#elif _XOPEN_SOURCE == 0
|
||||
#undef _XOPEN_SOURCE /* use -D_XOPEN_SOURCE=0 to undefine it */
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Allows manipulation of large files in gcc and some other compilers
|
||||
*/
|
||||
#if !defined(LUA_32BITS) && !defined(_FILE_OFFSET_BITS)
|
||||
#define _LARGEFILE_SOURCE 1
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
#endif
|
||||
|
||||
#endif /* } */
|
||||
|
||||
|
||||
/*
|
||||
** Windows stuff
|
||||
*/
|
||||
#if defined(_WIN32) /* { */
|
||||
|
||||
#if !defined(_CRT_SECURE_NO_WARNINGS)
|
||||
#define _CRT_SECURE_NO_WARNINGS /* avoid warnings about ISO C functions */
|
||||
#endif
|
||||
|
||||
#endif /* } */
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,173 +1,215 @@
|
||||
/*
|
||||
** $Id: ldump.c,v 2.17.1.1 2013/04/12 18:48:47 roberto Exp $
|
||||
** $Id: ldump.c,v 2.37 2015/10/08 15:53:49 roberto Exp $
|
||||
** save precompiled Lua chunks
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#define ldump_c
|
||||
#define LUA_CORE
|
||||
|
||||
#include "lprefix.h"
|
||||
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "lua.h"
|
||||
|
||||
#include "lobject.h"
|
||||
#include "lstate.h"
|
||||
#include "lundump.h"
|
||||
|
||||
|
||||
typedef struct {
|
||||
lua_State* L;
|
||||
lua_State *L;
|
||||
lua_Writer writer;
|
||||
void* data;
|
||||
void *data;
|
||||
int strip;
|
||||
int status;
|
||||
} DumpState;
|
||||
|
||||
#define DumpMem(b,n,size,D) DumpBlock(b,(n)*(size),D)
|
||||
#define DumpVar(x,D) DumpMem(&x,1,sizeof(x),D)
|
||||
|
||||
static void DumpBlock(const void* b, size_t size, DumpState* D)
|
||||
{
|
||||
if (D->status==0)
|
||||
{
|
||||
/*
|
||||
** All high-level dumps go through DumpVector; you can change it to
|
||||
** change the endianness of the result
|
||||
*/
|
||||
#define DumpVector(v,n,D) DumpBlock(v,(n)*sizeof((v)[0]),D)
|
||||
|
||||
#define DumpLiteral(s,D) DumpBlock(s, sizeof(s) - sizeof(char), D)
|
||||
|
||||
|
||||
static void DumpBlock (const void *b, size_t size, DumpState *D) {
|
||||
if (D->status == 0 && size > 0) {
|
||||
lua_unlock(D->L);
|
||||
D->status=(*D->writer)(D->L,b,size,D->data);
|
||||
D->status = (*D->writer)(D->L, b, size, D->data);
|
||||
lua_lock(D->L);
|
||||
}
|
||||
}
|
||||
|
||||
static void DumpChar(int y, DumpState* D)
|
||||
{
|
||||
char x=(char)y;
|
||||
DumpVar(x,D);
|
||||
|
||||
#define DumpVar(x,D) DumpVector(&x,1,D)
|
||||
|
||||
|
||||
static void DumpByte (int y, DumpState *D) {
|
||||
lu_byte x = (lu_byte)y;
|
||||
DumpVar(x, D);
|
||||
}
|
||||
|
||||
static void DumpInt(int x, DumpState* D)
|
||||
{
|
||||
DumpVar(x,D);
|
||||
|
||||
static void DumpInt (int x, DumpState *D) {
|
||||
DumpVar(x, D);
|
||||
}
|
||||
|
||||
static void DumpNumber(lua_Number x, DumpState* D)
|
||||
{
|
||||
DumpVar(x,D);
|
||||
|
||||
static void DumpNumber (lua_Number x, DumpState *D) {
|
||||
DumpVar(x, D);
|
||||
}
|
||||
|
||||
static void DumpVector(const void* b, int n, size_t size, DumpState* D)
|
||||
{
|
||||
DumpInt(n,D);
|
||||
DumpMem(b,n,size,D);
|
||||
|
||||
static void DumpInteger (lua_Integer x, DumpState *D) {
|
||||
DumpVar(x, D);
|
||||
}
|
||||
|
||||
static void DumpString(const TString* s, DumpState* D)
|
||||
{
|
||||
if (s==NULL)
|
||||
{
|
||||
size_t size=0;
|
||||
DumpVar(size,D);
|
||||
|
||||
static void DumpString (const TString *s, DumpState *D) {
|
||||
if (s == NULL)
|
||||
DumpByte(0, D);
|
||||
else {
|
||||
size_t size = tsslen(s) + 1; /* include trailing '\0' */
|
||||
const char *str = getstr(s);
|
||||
if (size < 0xFF)
|
||||
DumpByte(cast_int(size), D);
|
||||
else {
|
||||
DumpByte(0xFF, D);
|
||||
DumpVar(size, D);
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t size=s->tsv.len+1; /* include trailing '\0' */
|
||||
DumpVar(size,D);
|
||||
DumpBlock(getstr(s),size*sizeof(char),D);
|
||||
DumpVector(str, size - 1, D); /* no need to save '\0' */
|
||||
}
|
||||
}
|
||||
|
||||
#define DumpCode(f,D) DumpVector(f->code,f->sizecode,sizeof(Instruction),D)
|
||||
|
||||
static void DumpFunction(const Proto* f, DumpState* D);
|
||||
static void DumpCode (const Proto *f, DumpState *D) {
|
||||
DumpInt(f->sizecode, D);
|
||||
DumpVector(f->code, f->sizecode, D);
|
||||
}
|
||||
|
||||
|
||||
static void DumpConstants(const Proto* f, DumpState* D)
|
||||
{
|
||||
int i,n=f->sizek;
|
||||
DumpInt(n,D);
|
||||
for (i=0; i<n; i++)
|
||||
{
|
||||
const TValue* o=&f->k[i];
|
||||
DumpChar(ttypenv(o),D);
|
||||
switch (ttypenv(o))
|
||||
{
|
||||
static void DumpFunction(const Proto *f, TString *psource, DumpState *D);
|
||||
|
||||
static void DumpConstants (const Proto *f, DumpState *D) {
|
||||
int i;
|
||||
int n = f->sizek;
|
||||
DumpInt(n, D);
|
||||
for (i = 0; i < n; i++) {
|
||||
const TValue *o = &f->k[i];
|
||||
DumpByte(ttype(o), D);
|
||||
switch (ttype(o)) {
|
||||
case LUA_TNIL:
|
||||
break;
|
||||
case LUA_TBOOLEAN:
|
||||
DumpChar(bvalue(o),D);
|
||||
DumpByte(bvalue(o), D);
|
||||
break;
|
||||
case LUA_TNUMFLT:
|
||||
DumpNumber(fltvalue(o), D);
|
||||
break;
|
||||
case LUA_TNUMBER:
|
||||
DumpNumber(nvalue(o),D);
|
||||
case LUA_TNUMINT:
|
||||
DumpInteger(ivalue(o), D);
|
||||
break;
|
||||
case LUA_TSTRING:
|
||||
DumpString(rawtsvalue(o),D);
|
||||
case LUA_TSHRSTR:
|
||||
case LUA_TLNGSTR:
|
||||
DumpString(tsvalue(o), D);
|
||||
break;
|
||||
default: lua_assert(0);
|
||||
default:
|
||||
lua_assert(0);
|
||||
}
|
||||
}
|
||||
n=f->sizep;
|
||||
DumpInt(n,D);
|
||||
for (i=0; i<n; i++) DumpFunction(f->p[i],D);
|
||||
}
|
||||
|
||||
static void DumpUpvalues(const Proto* f, DumpState* D)
|
||||
{
|
||||
int i,n=f->sizeupvalues;
|
||||
DumpInt(n,D);
|
||||
for (i=0; i<n; i++)
|
||||
{
|
||||
DumpChar(f->upvalues[i].instack,D);
|
||||
DumpChar(f->upvalues[i].idx,D);
|
||||
|
||||
static void DumpProtos (const Proto *f, DumpState *D) {
|
||||
int i;
|
||||
int n = f->sizep;
|
||||
DumpInt(n, D);
|
||||
for (i = 0; i < n; i++)
|
||||
DumpFunction(f->p[i], f->source, D);
|
||||
}
|
||||
|
||||
|
||||
static void DumpUpvalues (const Proto *f, DumpState *D) {
|
||||
int i, n = f->sizeupvalues;
|
||||
DumpInt(n, D);
|
||||
for (i = 0; i < n; i++) {
|
||||
DumpByte(f->upvalues[i].instack, D);
|
||||
DumpByte(f->upvalues[i].idx, D);
|
||||
}
|
||||
}
|
||||
|
||||
static void DumpDebug(const Proto* f, DumpState* D)
|
||||
{
|
||||
int i,n;
|
||||
DumpString((D->strip) ? NULL : f->source,D);
|
||||
n= (D->strip) ? 0 : f->sizelineinfo;
|
||||
DumpVector(f->lineinfo,n,sizeof(int),D);
|
||||
n= (D->strip) ? 0 : f->sizelocvars;
|
||||
DumpInt(n,D);
|
||||
for (i=0; i<n; i++)
|
||||
{
|
||||
DumpString(f->locvars[i].varname,D);
|
||||
DumpInt(f->locvars[i].startpc,D);
|
||||
DumpInt(f->locvars[i].endpc,D);
|
||||
|
||||
static void DumpDebug (const Proto *f, DumpState *D) {
|
||||
int i, n;
|
||||
n = (D->strip) ? 0 : f->sizelineinfo;
|
||||
DumpInt(n, D);
|
||||
DumpVector(f->lineinfo, n, D);
|
||||
n = (D->strip) ? 0 : f->sizelocvars;
|
||||
DumpInt(n, D);
|
||||
for (i = 0; i < n; i++) {
|
||||
DumpString(f->locvars[i].varname, D);
|
||||
DumpInt(f->locvars[i].startpc, D);
|
||||
DumpInt(f->locvars[i].endpc, D);
|
||||
}
|
||||
n= (D->strip) ? 0 : f->sizeupvalues;
|
||||
DumpInt(n,D);
|
||||
for (i=0; i<n; i++) DumpString(f->upvalues[i].name,D);
|
||||
n = (D->strip) ? 0 : f->sizeupvalues;
|
||||
DumpInt(n, D);
|
||||
for (i = 0; i < n; i++)
|
||||
DumpString(f->upvalues[i].name, D);
|
||||
}
|
||||
|
||||
static void DumpFunction(const Proto* f, DumpState* D)
|
||||
{
|
||||
DumpInt(f->linedefined,D);
|
||||
DumpInt(f->lastlinedefined,D);
|
||||
DumpChar(f->numparams,D);
|
||||
DumpChar(f->is_vararg,D);
|
||||
DumpChar(f->maxstacksize,D);
|
||||
DumpCode(f,D);
|
||||
DumpConstants(f,D);
|
||||
DumpUpvalues(f,D);
|
||||
DumpDebug(f,D);
|
||||
|
||||
static void DumpFunction (const Proto *f, TString *psource, DumpState *D) {
|
||||
if (D->strip || f->source == psource)
|
||||
DumpString(NULL, D); /* no debug info or same source as its parent */
|
||||
else
|
||||
DumpString(f->source, D);
|
||||
DumpInt(f->linedefined, D);
|
||||
DumpInt(f->lastlinedefined, D);
|
||||
DumpByte(f->numparams, D);
|
||||
DumpByte(f->is_vararg, D);
|
||||
DumpByte(f->maxstacksize, D);
|
||||
DumpCode(f, D);
|
||||
DumpConstants(f, D);
|
||||
DumpUpvalues(f, D);
|
||||
DumpProtos(f, D);
|
||||
DumpDebug(f, D);
|
||||
}
|
||||
|
||||
static void DumpHeader(DumpState* D)
|
||||
{
|
||||
lu_byte h[LUAC_HEADERSIZE];
|
||||
luaU_header(h);
|
||||
DumpBlock(h,LUAC_HEADERSIZE,D);
|
||||
|
||||
static void DumpHeader (DumpState *D) {
|
||||
DumpLiteral(LUA_SIGNATURE, D);
|
||||
DumpByte(LUAC_VERSION, D);
|
||||
DumpByte(LUAC_FORMAT, D);
|
||||
DumpLiteral(LUAC_DATA, D);
|
||||
DumpByte(sizeof(int), D);
|
||||
DumpByte(sizeof(size_t), D);
|
||||
DumpByte(sizeof(Instruction), D);
|
||||
DumpByte(sizeof(lua_Integer), D);
|
||||
DumpByte(sizeof(lua_Number), D);
|
||||
DumpInteger(LUAC_INT, D);
|
||||
DumpNumber(LUAC_NUM, D);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** dump Lua function as precompiled chunk
|
||||
*/
|
||||
int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip)
|
||||
{
|
||||
int luaU_dump(lua_State *L, const Proto *f, lua_Writer w, void *data,
|
||||
int strip) {
|
||||
DumpState D;
|
||||
D.L=L;
|
||||
D.writer=w;
|
||||
D.data=data;
|
||||
D.strip=strip;
|
||||
D.status=0;
|
||||
D.L = L;
|
||||
D.writer = w;
|
||||
D.data = data;
|
||||
D.strip = strip;
|
||||
D.status = 0;
|
||||
DumpHeader(&D);
|
||||
DumpFunction(f,&D);
|
||||
DumpByte(f->sizeupvalues, &D);
|
||||
DumpFunction(f, NULL, &D);
|
||||
return D.status;
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue