diff --git a/.gitignore b/.gitignore index b38a3f1e3..ca18feb5b 100644 --- a/.gitignore +++ b/.gitignore @@ -29,7 +29,9 @@ build_xc *.user.* *~ +# build system build.*/ +extdep/install *.pyc diff --git a/CMakeLists.txt b/CMakeLists.txt index e3a7d9b83..02e3a1a05 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,8 @@ # cmake global -cmake_minimum_required(VERSION 2.8.9) +cmake_minimum_required(VERSION 2.8.12) +# let cmake autolink dependencies on windows +# it's specified globally, cause qt libraries requires that on windows and they are also found globally +cmake_policy(SET CMP0020 NEW) project(ethereum) @@ -12,18 +15,14 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") # Normally, set(...CACHE...) creates cache variables, but does not modify them. function(createDefaultCacheConfig) set(HEADLESS OFF CACHE BOOL "Do not compile GUI (AlethZero)") - set(LANGUAGES OFF CACHE BOOL "Limit build to Serpent/LLL tools") set(VMTRACE OFF CACHE BOOL "VM tracing and run-time checks (useful for cross-implementation VM debugging)") set(PARANOIA OFF CACHE BOOL "Additional run-time checks") + set(JSONRPC ON CACHE BOOL "Build with jsonprc. default on") endfunction() # propagates CMake configuration options to the compiler function(configureProject) - if (LANGUAGES) - add_definitions(-DETH_LANGUAGES) - endif () - if (PARANOIA) if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") add_definitions(-DETH_PARANOIA) @@ -42,6 +41,7 @@ function(configureProject) endfunction() + function(createBuildInfo) # Set build platform; to be written to BuildInfo.h if (CMAKE_COMPILER_IS_MINGW) @@ -50,7 +50,7 @@ function(createBuildInfo) set(ETH_BUILD_PLATFORM "${ETH_BUILD_PLATFORM}/msys") elseif (CMAKE_COMPILER_IS_GNUCXX) set(ETH_BUILD_PLATFORM "${ETH_BUILD_PLATFORM}/g++") - elseif (CMAKE_COMPILER_IS_MSVC) + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") set(ETH_BUILD_PLATFORM "${ETH_BUILD_PLATFORM}/msvc") elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") set(ETH_BUILD_PLATFORM "${ETH_BUILD_PLATFORM}/clang") @@ -58,14 +58,23 @@ function(createBuildInfo) set(ETH_BUILD_PLATFORM "${ETH_BUILD_PLATFORM}/unknown") endif () + #cmake build type may be not specified when using msvc + if (${CMAKE_BUILD_TYPE}) + set(_cmake_build_type ${CMAKE_BUILD_TYPE}) + else() + set(_cmake_build_type "undefined") + endif() + # Generate header file containing useful build information - add_custom_target(BuildInfo.h ALL COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/BuildInfo.sh ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_BUILD_TYPE} ${ETH_BUILD_PLATFORM}) + add_custom_target(BuildInfo.h ALL COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/BuildInfo.sh ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${_cmake_build_type} ${ETH_BUILD_PLATFORM}) include_directories(${CMAKE_CURRENT_BINARY_DIR}) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(SRC_LIST BuildInfo.h) endfunction() + + ###################################################################################################### @@ -75,7 +84,7 @@ cmake_policy(SET CMP0015 NEW) createDefaultCacheConfig() configureProject() -message("-- LANGUAGES: ${LANGUAGES}; VMTRACE: ${VMTRACE}; PARANOIA: ${PARANOIA}; HEADLESS: ${HEADLESS}") +message("-- VMTRACE: ${VMTRACE}; PARANOIA: ${PARANOIA}; HEADLESS: ${HEADLESS}; JSONRPC: ${JSONRPC}") # Default TARGET_PLATFORM to "linux". @@ -88,20 +97,13 @@ if ("${TARGET_PLATFORM}" STREQUAL "linux") set(CMAKE_THREAD_LIBS_INIT pthread) endif () -# Set default build type to Release w/debug info -# if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) -# set(CMAKE_BUILD_TYPE RelWithDebInfo) -# endif() - - include(EthCompilerSettings) message("-- CXXFLAGS: ${CMAKE_CXX_FLAGS}") -#add_definitions("-DETH_BUILD_TYPE=${ETH_BUILD_TYPE}") -#add_definitions("-DETH_BUILD_PLATFORM=${ETH_BUILD_PLATFORM}") - -include(EthDependenciesDeprecated) +# this must be an include, as a function it would messs up with variable scope! +include(EthDependencies) +include(EthExecutableHelper) createBuildInfo() @@ -110,62 +112,44 @@ add_subdirectory(libevmcore) add_subdirectory(liblll) add_subdirectory(libserpent) add_subdirectory(libsolidity) -if(NOT APPLE) - if(PYTHON_LS) - add_subdirectory(libpyserpent) - endif() -endif() - add_subdirectory(lllc) add_subdirectory(solc) add_subdirectory(sc) -if (JSONRPC_LS) + +if (JSONRPC) add_subdirectory(libweb3jsonrpc) endif() -if (NOT LANGUAGES) - add_subdirectory(secp256k1) - add_subdirectory(libp2p) - add_subdirectory(libdevcrypto) - add_subdirectory(libwhisper) - - add_subdirectory(libethcore) - add_subdirectory(libevm) - add_subdirectory(libethereum) -# add_subdirectory(libethereumx) # TODO remove - - add_subdirectory(libwebthree) - add_subdirectory(test) - add_subdirectory(eth) - if("x${CMAKE_BUILD_TYPE}" STREQUAL "xDebug") - add_subdirectory(exp) - endif () - if(NOT ("${TARGET_PLATFORM}" STREQUAL "w64")) - add_subdirectory(neth) - endif () - if(QTQML) - add_definitions(-DETH_QTQML) - endif() - if(NOT HEADLESS) - if ("${TARGET_PLATFORM}" STREQUAL "w64") - cmake_policy(SET CMP0020 NEW) - endif () - if (NOT JSONRPC_LS) - message(FATAL_ERROR "Alethzero requires jsonrpc.") - endif() - - add_subdirectory(libjsqrc) - add_subdirectory(libqethereum) - add_subdirectory(alethzero) - add_subdirectory(third) - add_subdirectory(mix) - if(QTQML) - #add_subdirectory(iethxi) - #add_subdirectory(walleth) // resurect once we want to submit ourselves to QML. - endif() - endif() -endif() +add_subdirectory(secp256k1) +add_subdirectory(libp2p) +add_subdirectory(libdevcrypto) +add_subdirectory(libwhisper) +add_subdirectory(libethcore) +add_subdirectory(libevm) +add_subdirectory(libethereum) + +add_subdirectory(libwebthree) +add_subdirectory(test) +add_subdirectory(eth) +if("x${CMAKE_BUILD_TYPE}" STREQUAL "xDebug") + add_subdirectory(exp) +endif () + +# TODO check msvc +if(NOT ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")) + add_subdirectory(neth) +endif () + +if (NOT HEADLESS) + + add_subdirectory(libjsqrc) + add_subdirectory(libqethereum) + add_subdirectory(alethzero) + add_subdirectory(third) + add_subdirectory(mix) + +endif() enable_testing() add_test(NAME alltests WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/test COMMAND testeth) diff --git a/alethzero/EthereumMacOSXBundleInfo.plist.in b/EthereumMacOSXBundleInfo.plist.in similarity index 100% rename from alethzero/EthereumMacOSXBundleInfo.plist.in rename to EthereumMacOSXBundleInfo.plist.in diff --git a/README.md b/README.md index 23a202510..8b5ff903d 100644 --- a/README.md +++ b/README.md @@ -36,5 +36,5 @@ Please read [CodingStandards.txt](CodingStandards.txt) thoroughly before making libweb3jsonrpc/abstractwebthreestubserver.h is autogenerated from the jsonrpcstub executable that comes with the libjsonrpc library (json-rpc-cpp project). It shouldn't be maually altered. ```bash -jsonrpcstub -s -c spec.json WebThreeStub +jsonrpcstub spec.json --cpp-server=AbstractWebThreeStubServer ``` diff --git a/alethzero/CMakeLists.txt b/alethzero/CMakeLists.txt index 01dfb88dc..c4237eaee 100644 --- a/alethzero/CMakeLists.txt +++ b/alethzero/CMakeLists.txt @@ -1,101 +1,53 @@ +cmake_policy(SET CMP0015 NEW) +# let cmake autolink dependencies on windows +cmake_policy(SET CMP0020 NEW) +# this policy was introduced in cmake 3.0 +# remove if, once 3.0 will be used on unix +if (${CMAKE_MAJOR_VERSION} GREATER 2) + cmake_policy(SET CMP0043 OLD) +endif() + set(CMAKE_INCLUDE_CURRENT_DIR ON) aux_source_directory(. SRC_LIST) -include_directories(..) -if (APPLE) - # Add homebrew path for qt5 - set(CMAKE_PREFIX_PATH /usr/local/opt/qt5) - include_directories(/usr/local/opt/qt5/include /usr/local/include) -elseif ("${TARGET_PLATFORM}" STREQUAL "w64") - set(SRC_LIST ${SRC_LIST} ../windows/qt_plugin_import.cpp) - include_directories(/usr/x86_64-w64-mingw32/include /usr/x86_64-w64-mingw32/include/QtCore /usr/x86_64-w64-mingw32/include/QtGui /usr/x86_64-w64-mingw32/include/QtQuick /usr/x86_64-w64-mingw32/include/QtQml /usr/x86_64-w64-mingw32/include/QtNetwork /usr/x86_64-w64-mingw32/include/QtWidgets /usr/x86_64-w64-mingw32/include/QtWebKit /usr/x86_64-w64-mingw32/include/QtWebKitWidgets) -elseif (UNIX) - set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ";$ENV{QTDIR}/lib/cmake") -endif () - -find_package(Qt5Core REQUIRED) -find_package(Qt5Gui REQUIRED) -find_package(Qt5Quick REQUIRED) -find_package(Qt5Qml REQUIRED) -find_package(Qt5Network REQUIRED) -find_package(Qt5Widgets REQUIRED) -find_package(Qt5WebKit REQUIRED) -find_package(Qt5WebKitWidgets REQUIRED) +include_directories(${JSON_RPC_CPP_INCLUDE_DIRS}) +include_directories(..) qt5_wrap_ui(ui_Main.h Main.ui) -# Set name of binary and add_executable() file(GLOB HEADERS "*.h") -if (APPLE) - set(EXECUTEABLE AlethZero) - set(BIN_INSTALL_DIR ".") - set(DOC_INSTALL_DIR ".") - - set(PROJECT_VERSION "${ETH_VERSION}") - set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME} ${PROJECT_VERSION}") - set(MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_NAME} ${PROJECT_VERSION}") - set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME} ${PROJECT_VERSION}") - set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}") - set(MACOSX_BUNDLE_COPYRIGHT "${PROJECT_COPYRIGHT_YEAR} ${PROJECT_VENDOR}") - set(MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_DOMAIN_SECOND}.${PROJECT_DOMAIN_FIRST}") - set(MACOSX_BUNDLE_BUNDLE_NAME ${EXECUTEABLE}) - set(MACOSX_BUNDLE_ICON_FILE alethzero) - include(BundleUtilities) - - add_executable(${EXECUTEABLE} MACOSX_BUNDLE alethzero.icns Main.ui ${SRC_LIST} ${HEADERS}) - set_target_properties(${EXECUTEABLE} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/EthereumMacOSXBundleInfo.plist.in") - SET_SOURCE_FILES_PROPERTIES(${EXECUTEABLE} PROPERTIES MACOSX_PACKAGE_LOCATION MacOS) - SET_SOURCE_FILES_PROPERTIES(${MACOSX_BUNDLE_ICON_FILE}.icns PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") - -else () - set(EXECUTEABLE alethzero) - add_executable(${EXECUTEABLE} Main.ui ${SRC_LIST} ${HEADERS}) -endif () - -qt5_use_modules(${EXECUTEABLE} Core)# Gui Widgets Network WebKit WebKitWidgets) -target_link_libraries(${EXECUTEABLE} webthree qethereum ethereum evm ethcore devcrypto secp256k1 gmp ${CRYPTOPP_LS} serpent lll solidity evmcore devcore web3jsonrpc jsqrc) if (APPLE) - # First have qt5 install plugins and frameworks - add_custom_command(TARGET ${EXECUTEABLE} POST_BUILD - COMMAND /usr/local/opt/qt5/bin/macdeployqt ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTEABLE}.app - WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) - - # This tool and next will inspect linked libraries in order to determine which dependencies are required - if (${CMAKE_CFG_INTDIR} STREQUAL ".") - set(APP_BUNDLE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTEABLE}.app") - else () - set(APP_BUNDLE_PATH "${CMAKE_CURRENT_BINARY_DIR}/\$ENV{CONFIGURATION}/${EXECUTEABLE}.app") - endif () - install(CODE " - include(BundleUtilities) - set(BU_CHMOD_BUNDLE_ITEMS 1) - fixup_bundle(\"${APP_BUNDLE_PATH}\" \"${BUNDLELIBS}\" \"../libqethereum ../libethereum ../secp256k1\") - " COMPONENT RUNTIME ) - # Cleanup duplicate libs from macdeployqt - install(CODE " - file(GLOB LINGER_RM \"${APP_BUNDLE_PATH}/Contents/Frameworks/*.dylib\") - if (LINGER_RM) - file(REMOVE \${LINGER_RM}) - endif () - ") -elseif ("${TARGET_PLATFORM}" STREQUAL "w64") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-keep-inline-dllexport -static-libgcc -static-libstdc++ -static") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-s -Wl,-subsystem,windows -mthreads -L/usr/x86_64-w64-mingw32/plugins/platforms") - target_link_libraries(${EXECUTEABLE} gcc) - target_link_libraries(${EXECUTEABLE} mingw32 qtmain mswsock iphlpapi qwindows shlwapi Qt5PlatformSupport opengl32 gdi32 comdlg32 oleaut32 imm32 winmm ole32 uuid ws2_32) - target_link_libraries(${EXECUTEABLE} boost_system-mt-s) - target_link_libraries(${EXECUTEABLE} boost_filesystem-mt-s) - target_link_libraries(${EXECUTEABLE} boost_thread_win32-mt-s) - target_link_libraries(${EXECUTEABLE} crypt32) - target_link_libraries(${EXECUTEABLE} Qt5PlatformSupport) - set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) -elseif (UNIX) + set(EXECUTABLE AlethZero) else () - target_link_libraries(${EXECUTEABLE} boost_system) - target_link_libraries(${EXECUTEABLE} boost_filesystem) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTEABLE} ${CMAKE_THREAD_LIBS_INIT}) - install( TARGETS ${EXECUTEABLE} RUNTIME DESTINATION bin ) + set(EXECUTABLE alethzero) endif () + +# eth_add_executable is defined in cmake/EthExecutableHelper.cmake +eth_add_executable(${EXECUTABLE} + ICON alethzero + UI_RESOURCES alethzero.icns Main.ui +) + +add_dependencies(${EXECUTABLE} BuildInfo.h) + +target_link_libraries(${EXECUTABLE} Qt5::Core) +target_link_libraries(${EXECUTABLE} ${JSONCPP_LIBRARIES}) +target_link_libraries(${EXECUTABLE} webthree) +target_link_libraries(${EXECUTABLE} qethereum) +target_link_libraries(${EXECUTABLE} ethereum) +target_link_libraries(${EXECUTABLE} evm) +target_link_libraries(${EXECUTABLE} ethcore) +target_link_libraries(${EXECUTABLE} devcrypto) +target_link_libraries(${EXECUTABLE} secp256k1) +target_link_libraries(${EXECUTABLE} serpent) +target_link_libraries(${EXECUTABLE} lll) +target_link_libraries(${EXECUTABLE} solidity) +target_link_libraries(${EXECUTABLE} evmcore) +target_link_libraries(${EXECUTABLE} devcore) +target_link_libraries(${EXECUTABLE} web3jsonrpc) +target_link_libraries(${EXECUTABLE} jsqrc) + +# eth_install_executable is defined in cmake/EthExecutableHelper.cmake +eth_install_executable(${EXECUTABLE}) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index a240f64e1..122085225 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -153,9 +154,8 @@ Main::Main(QWidget *parent) : m_webThree.reset(new WebThreeDirect(string("AlethZero/v") + dev::Version + "/" DEV_QUOTED(ETH_BUILD_TYPE) "/" DEV_QUOTED(ETH_BUILD_PLATFORM), getDataDir() + "/AlethZero", false, {"eth", "shh"})); - // w3stubserver, on dealloc, deletes m_qwebConnector - m_qwebConnector = new QWebThreeConnector(); // owned by WebThreeStubServer - m_server.reset(new OurWebThreeStubServer(m_qwebConnector, *web3(), keysAsVector(m_myKeys))); + m_qwebConnector.reset(new QWebThreeConnector()); + m_server.reset(new OurWebThreeStubServer(*m_qwebConnector, *web3(), keysAsVector(m_myKeys))); connect(&*m_server, SIGNAL(onNewId(QString)), SLOT(addNewId(QString))); m_server->setIdentities(keysAsVector(owned())); m_server->StartListening(); @@ -1350,7 +1350,7 @@ void Main::on_debugCurrent_triggered() { unsigned txi = item->data(Qt::UserRole + 1).toInt(); m_executiveState = ethereum()->state(txi + 1, h); - m_currentExecution = unique_ptr(new Executive(m_executiveState)); + m_currentExecution = unique_ptr(new Executive(m_executiveState, 0)); Transaction t = m_executiveState.pending()[txi]; m_executiveState = m_executiveState.fromPending(txi); auto r = t.rlp(); @@ -1500,58 +1500,6 @@ void Main::on_destination_currentTextChanged() // updateFee(); } -static bytes dataFromText(QString _s) -{ - bytes ret; - while (_s.size()) - { - QRegExp r("(@|\\$)?\"([^\"]*)\"(\\s.*)?"); - QRegExp d("(@|\\$)?([0-9]+)(\\s*(ether)|(finney)|(szabo))?(\\s.*)?"); - QRegExp h("(@|\\$)?(0x)?(([a-fA-F0-9])+)(\\s.*)?"); - if (r.exactMatch(_s)) - { - for (auto i: r.cap(2)) - ret.push_back((byte)i.toLatin1()); - if (r.cap(1) != "$") - for (int i = r.cap(2).size(); i < 32; ++i) - ret.push_back(0); - else - ret.push_back(0); - _s = r.cap(3); - } - else if (d.exactMatch(_s)) - { - u256 v(d.cap(2).toStdString()); - if (d.cap(6) == "szabo") - v *= dev::eth::szabo; - else if (d.cap(5) == "finney") - v *= dev::eth::finney; - else if (d.cap(4) == "ether") - v *= dev::eth::ether; - bytes bs = dev::toCompactBigEndian(v); - if (d.cap(1) != "$") - for (auto i = bs.size(); i < 32; ++i) - ret.push_back(0); - for (auto b: bs) - ret.push_back(b); - _s = d.cap(7); - } - else if (h.exactMatch(_s)) - { - bytes bs = fromHex((((h.cap(3).size() & 1) ? "0" : "") + h.cap(3)).toStdString()); - if (h.cap(1) != "$") - for (auto i = bs.size(); i < 32; ++i) - ret.push_back(0); - for (auto b: bs) - ret.push_back(b); - _s = h.cap(5); - } - else - _s = _s.mid(1); - } - return ret; -} - static shh::Topic topicFromText(QString _s) { shh::BuildTopic ret; @@ -1679,7 +1627,7 @@ void Main::on_data_textChanged() } else { - m_data = dataFromText(ui->data->toPlainText()); + m_data = parseData(ui->data->toPlainText().toStdString()); ui->code->setHtml(QString::fromStdString(dev::memDump(m_data, 8, true))); if (ethereum()->codeAt(fromString(ui->destination->currentText()), 0).size()) { @@ -1855,7 +1803,7 @@ void Main::on_debug_clicked() { Secret s = i.secret(); m_executiveState = ethereum()->postState(); - m_currentExecution = unique_ptr(new Executive(m_executiveState)); + m_currentExecution = unique_ptr(new Executive(m_executiveState, 0)); Transaction t = isCreation() ? Transaction(value(), gasPrice(), ui->gas->value(), m_data, m_executiveState.transactionsFrom(dev::toAddress(s)), s) : Transaction(value(), gasPrice(), ui->gas->value(), fromString(ui->destination->currentText()), m_data, m_executiveState.transactionsFrom(dev::toAddress(s)), s); @@ -2207,7 +2155,7 @@ void Main::on_post_clicked() { shh::Message m; m.setTo(stringToPublic(ui->shhTo->currentText())); - m.setPayload(dataFromText(ui->shhData->toPlainText())); + m.setPayload(parseData(ui->shhData->toPlainText().toStdString())); Public f = stringToPublic(ui->shhFrom->currentText()); Secret from; if (m_server->ids().count(f)) @@ -2243,18 +2191,3 @@ void Main::refreshWhispers() ui->whispers->addItem(item); } } - -// extra bits needed to link on VS -#ifdef _MSC_VER - -// include moc file, ofuscated to hide from automoc -#include\ -"moc_MainWin.cpp" - -#include\ -"moc_MiningView.cpp" - -#include\ -"moc_DownloadView.cpp" - -#endif diff --git a/alethzero/MainWin.h b/alethzero/MainWin.h index fffc5843f..b39b65106 100644 --- a/alethzero/MainWin.h +++ b/alethzero/MainWin.h @@ -44,7 +44,6 @@ class Main; namespace dev { namespace eth { class Client; class State; -class MessageFilter; }} class QQuickView; @@ -257,7 +256,7 @@ private: QString m_logHistory; bool m_logChanged = true; - QWebThreeConnector* m_qwebConnector; + std::unique_ptr m_qwebConnector; std::unique_ptr m_server; QWebThree* m_qweb = nullptr; }; diff --git a/alethzero/OurWebThreeStubServer.cpp b/alethzero/OurWebThreeStubServer.cpp index a40727e1e..0c6f42b5a 100644 --- a/alethzero/OurWebThreeStubServer.cpp +++ b/alethzero/OurWebThreeStubServer.cpp @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file OurWebThreeStubServer.h +/** @file OurWebThreeStubServer.cpp * @author Gav Wood * @date 2014 */ @@ -24,7 +24,7 @@ using namespace std; using namespace dev; using namespace dev::eth; -OurWebThreeStubServer::OurWebThreeStubServer(jsonrpc::AbstractServerConnector* _conn, dev::WebThreeDirect& _web3, std::vector const& _accounts): +OurWebThreeStubServer::OurWebThreeStubServer(jsonrpc::AbstractServerConnector& _conn, dev::WebThreeDirect& _web3, std::vector const& _accounts): WebThreeStubServer(_conn, _web3, _accounts) {} diff --git a/alethzero/OurWebThreeStubServer.h b/alethzero/OurWebThreeStubServer.h index b3492df5e..fb026d07e 100644 --- a/alethzero/OurWebThreeStubServer.h +++ b/alethzero/OurWebThreeStubServer.h @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file OurWebThreeStubServer.cpp +/** @file OurWebThreeStubServer.h * @author Gav Wood * @date 2014 */ @@ -29,7 +29,7 @@ class OurWebThreeStubServer: public QObject, public WebThreeStubServer Q_OBJECT public: - OurWebThreeStubServer(jsonrpc::AbstractServerConnector* _conn, dev::WebThreeDirect& _web3, std::vector const& _accounts); + OurWebThreeStubServer(jsonrpc::AbstractServerConnector& _conn, dev::WebThreeDirect& _web3, std::vector const& _accounts); virtual std::string shh_newIdentity() override; diff --git a/build.py b/build.py new file mode 100755 index 000000000..099a8721d --- /dev/null +++ b/build.py @@ -0,0 +1,27 @@ +#!/usr/bin/python +# cpp-ethereum build script +# to be used from CI server, or to build locally +# uses python instead of bash script for better cross-platform support + +# TODO Initial version. Needs much more improvements + +import argparse +import os +import subprocess + +def build_dependencies(): + if os.path.exists("extdep"): + os.chdir("extdep") + if not os.path.exists("build"): + os.makedirs("build") + os.chdir("build") + subprocess.check_call(["cmake", ".."]) + subprocess.check_call("make") + +parser = argparse.ArgumentParser() +parser.add_argument("cmd", help="what to build") + +args = parser.parse_args() +if args.cmd == "dep": + build_dependencies() + diff --git a/cmake/EthCompilerSettings.cmake b/cmake/EthCompilerSettings.cmake index 6103970c4..24252cc0b 100644 --- a/cmake/EthCompilerSettings.cmake +++ b/cmake/EthCompilerSettings.cmake @@ -1,59 +1,39 @@ # Set necessary compile and link flags - # C++11 check and activation if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") + + set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wno-unknown-pragmas -Wextra -DSHAREDLIB -fPIC") + set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -DETH_DEBUG") + set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG -DETH_RELEASE") + set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -DETH_RELEASE") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DETH_DEBUG") + set(ETH_SHARED 1) + execute_process( COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) if (NOT (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)) message(FATAL_ERROR "${PROJECT_NAME} requires g++ 4.7 or greater.") endif () -elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") -else () - message(FATAL_ERROR "Your C++ compiler does not support C++11.") -endif () - - - -# Initialize CXXFLAGS -set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wno-unknown-pragmas -Wextra -DSHAREDLIB") -set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -DETH_DEBUG") -set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG -DETH_RELEASE") -set(CMAKE_CXX_FLAGS_RELEASE "-O4 -DNDEBUG -DETH_RELEASE") -set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DETH_DEBUG") -# Windows -if ("${TARGET_PLATFORM}" STREQUAL "w64") - set(CMAKE_SYSTEM_NAME Windows) - - set(CMAKE_CXX_LIBRARY_ARCHITECTURE x86_64-w64-mingw32) - set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc) - set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++) - set(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres) - set(CMAKE_AR x86_64-w64-mingw32-ar) - set(CMAKE_RANLIB x86_64-w64-mingw32-ranlib) - - set(CMAKE_EXECUTABLE_SUFFIX .exe) - - set(CMAKE_FIND_ROOT_PATH - /usr/x86_64-w64-mingw32 - ) +elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") - include_directories(/usr/x86_64-w64-mingw32/include/cryptopp) + set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wno-unknown-pragmas -Wextra -DSHAREDLIB -fPIC") + set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -DETH_DEBUG") + set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG -DETH_RELEASE") + set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -DETH_RELEASE") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DETH_DEBUG") + set(ETH_SHARED 1) - set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) - set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) - set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") - set(CMAKE_INSTALL_PREFIX /usr/x86_64-w64-mingw32) - set(ETH_BUILD_PLATFORM "windows") + # specify Exception Handling Model in msvc + set(CMAKE_C_FLAGS "/EHsc") + set(CMAKE_CXX_FLAGS "/EHsc") + # windows likes static set(ETH_STATIC 1) -else () - set(ETH_BUILD_PLATFORM ${CMAKE_SYSTEM_NAME}) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") - set(ETH_SHARED 1) -endif() - +else () + message(WARNING "Your compiler is not tested, if you run into any issues, we'd welcome any patches.") +endif () diff --git a/cmake/EthDependencies.cmake b/cmake/EthDependencies.cmake new file mode 100644 index 000000000..ee93a5311 --- /dev/null +++ b/cmake/EthDependencies.cmake @@ -0,0 +1,148 @@ +# all dependencies that are not directly included in the cpp-ethereum distribution are defined here +# for this to work, download the dependency via the cmake script in extdep or install them manually! + +# by defining this variable, cmake will look for dependencies first in our own repository before looking in system paths like /usr/local/ ... +# this must be set to point to the same directory as $ETH_DEPENDENCY_INSTALL_DIR in /extdep directory +string(TOLOWER ${CMAKE_SYSTEM_NAME} _system_name) +set (ETH_DEPENDENCY_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/extdep/install/${_system_name}") +set (CMAKE_PREFIX_PATH ${ETH_DEPENDENCY_INSTALL_DIR}) + +# Qt5 requires opengl +# TODO use proper version of windows SDK (32 vs 64) +# TODO make it possible to use older versions of windows SDK (7.0+ should also work) +# TODO it windows SDK is NOT FOUND, throw ERROR +if (WIN32) + set (CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "C:/Program Files/Windows Kits/8.1/Lib/winv6.3/um/x86") + message(" - Found windows 8.1 SDK") + #set (CMAKE_PREFIX_PATH "C:/Program Files/Windows Kits/8.1/Lib/winv6.3/um/x64") +endif() + +# homebrew installs qts in opt +if (APPLE) + set (CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "/usr/local/opt/qt5") +endif() + +# Dependencies must have a version number, to ensure reproducible build. The version provided here is the one that is in the extdep repository. If you use system libraries, version numbers may be different. + +find_package (CryptoPP 5.6.2 EXACT REQUIRED) +message(" - CryptoPP header: ${CRYPTOPP_INCLUDE_DIRS}") +message(" - CryptoPP lib : ${CRYPTOPP_LIBRARIES}") + +find_package (LevelDB REQUIRED) +message(" - LevelDB header: ${LEVELDB_INCLUDE_DIRS}") +message(" - LevelDB lib: ${LEVELDB_LIBRARIES}") + +# TODO the Jsoncpp package does not yet check for correct version number +find_package (Jsoncpp 0.60 REQUIRED) +message(" - Jsoncpp header: ${JSONCPP_INCLUDE_DIRS}") +message(" - Jsoncpp lib : ${JSONCPP_LIBRARIES}") + +# TODO the JsonRpcCpp package does not yet check for correct version number +# json-rpc-cpp support is currently not mandatory +# TODO make headless client optional +# TODO get rid of -DETH_JSONRPC +if (JSONRPC) + + find_package (JsonRpcCpp 0.3.2) + if (NOT JSON_RPC_CPP_FOUND) + message (FATAL_ERROR "JSONRPC 0.3.2. not found") + endif() + message (" - json-rpc-cpp header: ${JSON_RPC_CPP_INCLUDE_DIRS}") + message (" - json-rpc-cpp lib : ${JSON_RPC_CPP_LIBRARIES}") + add_definitions(-DETH_JSONRPC) + +endif() #JSONRPC + +# TODO readline package does not yet check for correct version number +# TODO make readline package dependent on cmake options +# TODO get rid of -DETH_READLINE +find_package (Readline 6.3.8) +if (READLINE_FOUND) + message (" - readline header: ${READLINE_INCLUDE_DIRS}") + message (" - readline lib : ${READLINE_LIBRARIES}") + add_definitions(-DETH_READLINE) +endif () + +# TODO miniupnpc package does not yet check for correct version number +# TODO make miniupnpc package dependent on cmake options +# TODO get rid of -DMINIUPNPC +find_package (Miniupnpc 1.8.2013) +if (MINIUPNPC_FOUND) + message (" - miniupnpc header: ${MINIUPNPC_INCLUDE_DIRS}") + message (" - miniupnpc lib : ${MINIUPNPC_LIBRARIES}") + add_definitions(-DETH_MINIUPNPC) +endif() + +# TODO gmp package does not yet check for correct version number +# TODO it is also not required in msvc build +find_package (Gmp 6.0.0) +if (GMP_FOUND) + message(" - gmp Header: ${GMP_INCLUDE_DIRS}") + message(" - gmp lib : ${GMP_LIBRARIES}") +endif() + +# curl is only requried for tests +# TODO specify min curl version, on windows we are currenly using 7.29 +find_package (CURL) +message(" - curl header: ${CURL_INCLUDE_DIRS}") +message(" - curl lib : ${CURL_LIBRARIES}") + +# do not compile GUI +if (NOT HEADLESS) + +# we need json rpc to build alethzero + if (NOT JSON_RPC_CPP_FOUND) + message (FATAL_ERROR "JSONRPC is required for GUI client") + endif() + +# find all of the Qt packages +# remember to use 'Qt' instead of 'QT', cause unix is case sensitive +# TODO make headless client optional + find_package (Qt5Core REQUIRED) + find_package (Qt5Gui REQUIRED) + find_package (Qt5Quick REQUIRED) + find_package (Qt5Qml REQUIRED) + find_package (Qt5Network REQUIRED) + find_package (Qt5Widgets REQUIRED) + find_package (Qt5WebKit REQUIRED) + find_package (Qt5WebKitWidgets REQUIRED) + + # we need to find path to macdeployqt on mac + if (APPLE) + set (MACDEPLOYQT_APP ${Qt5Core_DIR}/../../../bin/macdeployqt) + message(" - macdeployqt path: ${MACDEPLOYQT_APP}") + endif() + +endif() #HEADLESS + +# use multithreaded boost libraries, with -mt suffix +set(Boost_USE_MULTITHREADED ON) + +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + +# TODO hanlde other msvc versions or it will fail find them + set(Boost_COMPILER -vc120) +# use static boost libraries *.lib + set(Boost_USE_STATIC_LIBS ON) + +elseif (APPLE) + +# use static boost libraries *.a + set(Boost_USE_STATIC_LIBS ON) + +elseif (UNIX) +# use dynamic boost libraries .dll + set(Boost_USE_STATIC_LIBS OFF) + +endif() + +find_package(Boost 1.54.0 REQUIRED COMPONENTS thread date_time system regex chrono filesystem unit_test_framework program_options) + +message(" - boost header: ${Boost_INCLUDE_DIRS}") +message(" - boost lib : ${Boost_LIBRARIES}") + +if (APPLE) + link_directories(/usr/local/lib) + include_directories(/usr/local/include) +endif() + diff --git a/cmake/EthDependenciesDeprecated.cmake b/cmake/EthDependenciesDeprecated.cmake deleted file mode 100644 index 17b937c5c..000000000 --- a/cmake/EthDependenciesDeprecated.cmake +++ /dev/null @@ -1,210 +0,0 @@ -# search for and configure dependencies - -# deprecated. TODO will rewrite to proper CMake packages - - - -if("${TARGET_PLATFORM}" STREQUAL "w64") -# set(MINIUPNPC_LS /usr/x86_64-w64-mingw32/lib/libminiupnpc.a) - set(LEVELDB_LS leveldb) - set(CRYPTOPP_LS cryptopp) - set(CRYPTOPP_ID /usr/x86_64-w64-mingw32/include/cryptopp) -else() - # Look for available Crypto++ version and if it is >= 5.6.2 - find_path(ID cryptlib.h - ../cryptopp/src - ../../cryptopp/src - /usr/include/cryptopp - /usr/include/crypto++ - /usr/local/include/cryptopp - /usr/local/include/crypto++ - /opt/local/include/cryptopp - /opt/local/include/crypto++ - ) - find_library(LS NAMES cryptoppeth cryptopp - ../cryptopp/src/../target/build/release - ../../cryptopp/src/../target/build/release - PATHS - /usr/lib - /usr/local/lib - /opt/local/lib - ) - - if (ID AND LS) - message(STATUS "Found Crypto++: ${ID}, ${LS}") - set(_CRYPTOPP_VERSION_HEADER ${ID}/config.h) - if(EXISTS ${_CRYPTOPP_VERSION_HEADER}) - file(STRINGS ${_CRYPTOPP_VERSION_HEADER} _CRYPTOPP_VERSION REGEX "^#define CRYPTOPP_VERSION[ \t]+[0-9]+$") - string(REGEX REPLACE "^#define CRYPTOPP_VERSION[ \t]+([0-9]+)" "\\1" _CRYPTOPP_VERSION ${_CRYPTOPP_VERSION}) - if(${_CRYPTOPP_VERSION} LESS 562) - message(FATAL_ERROR "Crypto++ version found is smaller than 5.6.2.") - else() - set(CRYPTOPP_ID ${ID} CACHE FILEPATH "") - set(CRYPTOPP_LS ${LS} CACHE FILEPATH "") - message(STATUS "Crypto++ found and version greater or equal to 5.6.2") - endif() - endif() - else() - message(STATUS "Crypto++ Not Found: ${CRYPTOPP_ID}, ${CRYPTOPP_LS}") - endif() - - find_path( LEVELDB_ID leveldb/db.h - /usr/include - /usr/local/include - ) - if ( LEVELDB_ID STREQUAL "LEVELDB_ID-NOTFOUND" ) - message(FATAL_ERROR "Failed to find the LevelDB headers") - else () - message(STATUS "Found LevelDB Headers") - - # Check for accessory dev libraries leveldb and miniupnpc - find_library( LEVELDB_LS NAMES leveldb - PATHS - /usr/lib - /usr/local/lib - /opt/local/lib - /usr/lib/*/ - ) - if ( LEVELDB_LS STREQUAL "LEVELDB_LS-NOTFOUND" ) - message(FATAL_ERROR "Failed to find the LevelDB Library!") - else () - message(STATUS "Found LevelDB Library: ${LEVELDB_LS}") - add_definitions(-DETH_LEVELDB) - endif () - endif () - - find_path( PYTHON_ID pyconfig.h - ${PYTHON_INCLUDE_DIR} - /usr/include/python2.7 - /usr/local/include/python2.7 - ) - if ( PYTHON_ID STREQUAL "PYTHON_ID-NOTFOUND" ) - message(STATUS "Failed to find the Python-2.7 headers") - else () - message(STATUS "Found Python-2.7 Headers: ${PYTHON_ID}") - - # Check for accessory dev libraries leveldb and miniupnpc - find_library( PYTHON_LS NAMES python2.7 - PATHS - /usr/lib - /usr/local/lib - /opt/local/lib - /usr/lib/*/ - ) - if ( PYTHON_LS STREQUAL "PYTHON_LS-NOTFOUND" ) - message(STATUS "Failed to find the Python-2.7 Library!") - set(PYTHON_ID) - set(PYTHON_LS) - else () - message(STATUS "Found Python-2.7 Library: ${PYTHON_LS}") - add_definitions(-DETH_PYTHON) - endif () - endif () - - find_path( MINIUPNPC_ID miniupnpc/miniwget.h - /usr/include - /usr/local/include - ) - if ( MINIUPNPC_ID ) - message(STATUS "Found miniupnpc headers") - - find_library( MINIUPNPC_LS NAMES miniupnpc - PATHS - /usr/lib - /usr/local/lib - /opt/local/lib - /usr/lib/*/ - ) - if ( MINIUPNPC_LS ) - message(STATUS "Found miniupnpc library: ${MINIUPNPC_LS}") - add_definitions(-DETH_MINIUPNPC) - else () - message(STATUS "Failed to find the miniupnpc library!") - endif () - else () - message(STATUS "Failed to find the miniupnpc headers!") - endif () - - find_path( JSONRPC_ID jsonrpc/rpc.h - /usr/include - /usr/local/include - ../libjson-rpc-cpp/src - ) - if ( JSONRPC_ID ) - message(STATUS "Found jsonrpc headers") - find_library( JSONRPC_LS NAMES jsonrpc - PATHS - /usr/lib - /usr/local/lib - /opt/local/lib - /usr/lib/*/ - ../libjson-rpc-cpp/build/out - ) - if ( JSONRPC_LS ) - message(STATUS "Found jsonrpc library: ${JSONRPC_LS}") - add_definitions(-DETH_JSONRPC) - else () - message(STATUS "Failed to find the jsonrpc library!") - endif () - else () - message(STATUS "Failed to find the jsonrpc headers!") - endif () - - find_path( READLINE_ID readline/readline.h - /usr/include - /usr/local/include - ) - if ( READLINE_ID ) - message(STATUS "Found readline headers") - find_library( READLINE_LS NAMES readline - PATHS - /usr/lib - /usr/local/lib - /opt/local/lib - /usr/lib/*/ - ) - if ( READLINE_LS ) - message(STATUS "Found readline library: ${READLINE_LS}") - add_definitions(-DETH_READLINE) - else () - message(STATUS "Failed to find the readline library!") - endif () - else () - message(STATUS "Failed to find the readline headers!") - endif () - - if (LANGUAGES) - find_package(Boost 1.53 REQUIRED COMPONENTS thread date_time) - else() - find_package(Boost 1.53 REQUIRED COMPONENTS thread date_time system regex) - endif() - - set(QTQML 1) -endif() - -if(CRYPTOPP_ID) - include_directories(${CRYPTOPP_ID}) -endif() -if(PYTHON_ID) - include_directories(${PYTHON_ID}) -endif() -if(MINIUPNPC_ID) - include_directories(${MINIUPNPC_ID}) -endif() -if(LEVELDB_ID) - include_directories(${LEVELDB_ID}) -endif() -if(READLINE_ID) - include_directories(${READLINE_ID}) -endif() -if(JSONRPC_ID) - include_directories(${JSONRPC_ID}) -endif() - - - - -if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - link_directories(/usr/local/lib) - include_directories(/usr/local/include) -endif() diff --git a/cmake/EthExecutableHelper.cmake b/cmake/EthExecutableHelper.cmake new file mode 100644 index 000000000..56aa3f6c3 --- /dev/null +++ b/cmake/EthExecutableHelper.cmake @@ -0,0 +1,118 @@ +# +# this function requires the following variables to be specified: +# ETH_VERSION +# PROJECT_NAME +# PROJECT_VERSION +# PROJECT_COPYRIGHT_YEAR +# PROJECT_VENDOR +# PROJECT_DOMAIN_SECOND +# PROJECT_DOMAIN_FIRST +# SRC_LIST +# HEADERS +# +# params: +# ICON +# + +macro(eth_add_executable EXECUTABLE) + set (extra_macro_args ${ARGN}) + set (options) + set (one_value_args ICON) + set (multi_value_args UI_RESOURCES) + cmake_parse_arguments (ETH_ADD_EXECUTABLE "${options}" "${one_value_args}" "${multi_value_args}" "${extra_macro_args}") + + if (APPLE) + + add_executable(${EXECUTABLE} MACOSX_BUNDLE ${SRC_LIST} ${HEADERS} ${ETH_ADD_EXECUTABLE_UI_RESOURCES}) + set(PROJECT_VERSION "${ETH_VERSION}") + set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME} ${PROJECT_VERSION}") + set(MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_NAME} ${PROJECT_VERSION}") + set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME} ${PROJECT_VERSION}") + set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}") + set(MACOSX_BUNDLE_COPYRIGHT "${PROJECT_COPYRIGHT_YEAR} ${PROJECT_VENDOR}") + set(MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_DOMAIN_SECOND}.${PROJECT_DOMAIN_FIRST}") + set(MACOSX_BUNDLE_BUNDLE_NAME ${EXECUTABLE}) + set(MACOSX_BUNDLE_ICON_FILE ${ETH_ADD_EXECUTABLE_ICON}) + set_target_properties(${EXECUTABLE} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/EthereumMacOSXBundleInfo.plist.in") + set_source_files_properties(${EXECUTABLE} PROPERTIES MACOSX_PACKAGE_LOCATION MacOS) + set_source_files_properties(${MACOSX_BUNDLE_ICON_FILE}.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources) + + else () + add_executable(${EXECUTABLE} ${ETH_ADD_EXECUTABLE_UI_RESOURCES} ${SRC_LIST} ${HEADERS}) + endif() + +endmacro() + +# +# this function requires the following variables to be specified: +# ETH_DEPENDENCY_INSTALL_DIR +# +# params: +# QMLDIR +# + +macro(eth_install_executable EXECUTABLE) + + set (extra_macro_args ${ARGN}) + set (options) + set (one_value_args QMLDIR) + set (multi_value_args) + cmake_parse_arguments (ETH_INSTALL_EXECUTABLE "${options}" "${one_value_args}" "${multi_value_args}" "${extra_macro_args}") + + if (ETH_INSTALL_EXECUTABLE_QMLDIR) + set(eth_qml_dir "-qmldir=${ETH_INSTALL_EXECUTABLE_QMLDIR}") + endif() + + if (APPLE) + # First have qt5 install plugins and frameworks + add_custom_command(TARGET ${EXECUTABLE} POST_BUILD + COMMAND ${MACDEPLOYQT_APP} ${eth_qml_dir} ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTABLE}.app + WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + + # This tool and next will inspect linked libraries in order to determine which dependencies are required + if (${CMAKE_CFG_INTDIR} STREQUAL ".") + set(APP_BUNDLE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE}.app") + else () + set(APP_BUNDLE_PATH "${CMAKE_CURRENT_BINARY_DIR}/\$ENV{CONFIGURATION}/${EXECUTABLE}.app") + endif () + + # TODO check, how fixup_bundle works and if it is required + install(CODE " + include(BundleUtilities) + set(BU_CHMOD_BUNDLE_ITEMS 1) + fixup_bundle(\"${APP_BUNDLE_PATH}\" \"${BUNDLELIBS}\" \"../libqethereum ../libethereum ../secp256k1\") + " COMPONENT RUNTIME ) + # Cleanup duplicate libs from macdeployqt + install(CODE " + file(GLOB LINGER_RM \"${APP_BUNDLE_PATH}/Contents/Frameworks/*.dylib\") + if (LINGER_RM) + file(REMOVE \${LINGER_RM}) + endif () + ") + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + + # copy all dlls to executable directory + # TODO improve that by copying only required dlls + file (GLOB DLLS ${ETH_DEPENDENCY_INSTALL_DIR}/bin/*.dll) + + foreach(DLL ${DLLS}) + add_custom_command(TARGET ${EXECUTABLE} POST_BUILD + COMMAND cmake -E copy "${DLL}" "$" + ) + endforeach() + + add_custom_command(TARGET ${EXECUTABLE} POST_BUILD + COMMAND cmake -E copy_directory + "${ETH_DEPENDENCY_INSTALL_DIR}/plugins/platforms" + $/platforms + ) + + install( TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin) + + else() + install( TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin) + endif () + +endmacro() + + diff --git a/cmake/FindCryptoPP.cmake b/cmake/FindCryptoPP.cmake new file mode 100644 index 000000000..a9e7183c0 --- /dev/null +++ b/cmake/FindCryptoPP.cmake @@ -0,0 +1,108 @@ +# Module for locating the Crypto++ encryption library. +# +# Customizable variables: +# CRYPTOPP_ROOT_DIR +# This variable points to the CryptoPP root directory. On Windows the +# library location typically will have to be provided explicitly using the +# -D command-line option. The directory should include the include/cryptopp, +# lib and/or bin sub-directories. +# +# Read-only variables: +# CRYPTOPP_FOUND +# Indicates whether the library has been found. +# +# CRYPTOPP_INCLUDE_DIRS +# Points to the CryptoPP include directory. +# +# CRYPTOPP_LIBRARIES +# Points to the CryptoPP libraries that should be passed to +# target_link_libararies. +# +# +# Copyright (c) 2012 Sergiu Dotenco +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +INCLUDE (FindPackageHandleStandardArgs) + +FIND_PATH (CRYPTOPP_ROOT_DIR + NAMES cryptopp/cryptlib.h include/cryptopp/cryptlib.h + PATHS ENV CRYPTOPPROOT + DOC "CryptoPP root directory") + +# Re-use the previous path: +FIND_PATH (CRYPTOPP_INCLUDE_DIR + NAMES cryptopp/cryptlib.h + HINTS ${CRYPTOPP_ROOT_DIR} + PATH_SUFFIXES include + DOC "CryptoPP include directory") + +FIND_LIBRARY (CRYPTOPP_LIBRARY_DEBUG + NAMES cryptlibd cryptoppd + HINTS ${CRYPTOPP_ROOT_DIR} + PATH_SUFFIXES lib + DOC "CryptoPP debug library") + +FIND_LIBRARY (CRYPTOPP_LIBRARY_RELEASE + NAMES cryptlib cryptopp + HINTS ${CRYPTOPP_ROOT_DIR} + PATH_SUFFIXES lib + DOC "CryptoPP release library") + +IF (CRYPTOPP_LIBRARY_DEBUG AND CRYPTOPP_LIBRARY_RELEASE) + SET (CRYPTOPP_LIBRARY + optimized ${CRYPTOPP_LIBRARY_RELEASE} + debug ${CRYPTOPP_LIBRARY_DEBUG} CACHE DOC "CryptoPP library") +ELSEIF (CRYPTOPP_LIBRARY_RELEASE) + SET (CRYPTOPP_LIBRARY ${CRYPTOPP_LIBRARY_RELEASE} CACHE DOC + "CryptoPP library") +ENDIF (CRYPTOPP_LIBRARY_DEBUG AND CRYPTOPP_LIBRARY_RELEASE) + +IF (CRYPTOPP_INCLUDE_DIR) + SET (_CRYPTOPP_VERSION_HEADER ${CRYPTOPP_INCLUDE_DIR}/cryptopp/config.h) + + IF (EXISTS ${_CRYPTOPP_VERSION_HEADER}) + FILE (STRINGS ${_CRYPTOPP_VERSION_HEADER} _CRYPTOPP_VERSION_TMP REGEX + "^#define CRYPTOPP_VERSION[ \t]+[0-9]+$") + + STRING (REGEX REPLACE + "^#define CRYPTOPP_VERSION[ \t]+([0-9]+)" "\\1" _CRYPTOPP_VERSION_TMP + ${_CRYPTOPP_VERSION_TMP}) + + STRING (REGEX REPLACE "([0-9]+)[0-9][0-9]" "\\1" CRYPTOPP_VERSION_MAJOR + ${_CRYPTOPP_VERSION_TMP}) + STRING (REGEX REPLACE "[0-9]([0-9])[0-9]" "\\1" CRYPTOPP_VERSION_MINOR + ${_CRYPTOPP_VERSION_TMP}) + STRING (REGEX REPLACE "[0-9][0-9]([0-9])" "\\1" CRYPTOPP_VERSION_PATCH + ${_CRYPTOPP_VERSION_TMP}) + + SET (CRYPTOPP_VERSION_COUNT 3) + SET (CRYPTOPP_VERSION + ${CRYPTOPP_VERSION_MAJOR}.${CRYPTOPP_VERSION_MINOR}.${CRYPTOPP_VERSION_PATCH}) + ENDIF (EXISTS ${_CRYPTOPP_VERSION_HEADER}) +ENDIF (CRYPTOPP_INCLUDE_DIR) + +SET (CRYPTOPP_INCLUDE_DIRS ${CRYPTOPP_INCLUDE_DIR}) +SET (CRYPTOPP_LIBRARIES ${CRYPTOPP_LIBRARY}) + +MARK_AS_ADVANCED (CRYPTOPP_INCLUDE_DIR CRYPTOPP_LIBRARY CRYPTOPP_LIBRARY_DEBUG + CRYPTOPP_LIBRARY_RELEASE) + +FIND_PACKAGE_HANDLE_STANDARD_ARGS (CryptoPP REQUIRED_VARS + CRYPTOPP_INCLUDE_DIR CRYPTOPP_LIBRARY VERSION_VAR CRYPTOPP_VERSION) diff --git a/cmake/FindGmp.cmake b/cmake/FindGmp.cmake new file mode 100644 index 000000000..4dc8f48c4 --- /dev/null +++ b/cmake/FindGmp.cmake @@ -0,0 +1,34 @@ +# Find gmp +# +# Find the gmp includes and library +# +# if you nee to add a custom library search path, do it via via CMAKE_FIND_ROOT_PATH +# +# This module defines +# GMP_INCLUDE_DIRS, where to find header, etc. +# GMP_LIBRARIES, the libraries needed to use gmp. +# GMP_FOUND, If false, do not try to use gmp. + +# only look in default directories +find_path( + GMP_INCLUDE_DIR + NAMES gmp.h + DOC "gmp include dir" + ) + +find_library( + GMP_LIBRARY + NAMES gmp + DOC "gmp library" + ) + +set(GMP_INCLUDE_DIRS ${GMP_INCLUDE_DIR}) +set(GMP_LIBRARIES ${GMP_LIBRARY}) + +# handle the QUIETLY and REQUIRED arguments and set GMP_FOUND to TRUE +# if all listed variables are TRUE, hide their existence from configuration view +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(gmp DEFAULT_MSG + GMP_INCLUDE_DIR GMP_LIBRARY) +mark_as_advanced (GMP_INCLUDE_DIR GMP_LIBRARY) + diff --git a/cmake/FindJsonRpcCpp.cmake b/cmake/FindJsonRpcCpp.cmake new file mode 100644 index 000000000..eecf518f8 --- /dev/null +++ b/cmake/FindJsonRpcCpp.cmake @@ -0,0 +1,52 @@ +# Find json-rcp-cpp +# +# Find the json-rpc-cpp includes and library +# +# if you nee to add a custom library search path, do it via via CMAKE_FIND_ROOT_PATH +# +# This module defines +# JSON_RCP_CPP_INCLUDE_DIRS, where to find header, etc. +# JSON_RCP_CPP_LIBRARIES, the libraries needed to use json-rpc-cpp. +# JSON_RPC_CPP_SERVER_LIBRARIES, the libraries needed to use json-rpc-cpp-server +# JSON_RPC_CPP_CLIENT_LIBRARIES, the libraries needed to use json-rpc-cpp-client +# JSON_RCP_CPP_FOUND, If false, do not try to use json-rpc-cpp. + +# only look in default directories +find_path( + JSON_RPC_CPP_INCLUDE_DIR + NAMES jsonrpccpp/server.h + PATH_SUFFIXES jsonrpc + DOC "json-rpc-cpp include dir" +) + +find_library( + JSON_RPC_CPP_COMMON_LIBRARY + NAMES jsonrpccpp-common + DOC "json-rpc-cpp common library" +) + +find_library( + JSON_RPC_CPP_SERVER_LIBRARY + NAMES jsonrpccpp-server + DOC "json-rpc-cpp server library" +) + +find_library( + JSON_RPC_CPP_CLIENT_LIBRARY + NAMES jsonrpccpp-client + DOC "json-rpc-cpp client library" +) + +# these are the variables to be uses by the calling script +set (JSON_RPC_CPP_INCLUDE_DIRS ${JSON_RPC_CPP_INCLUDE_DIR}) +set (JSON_RPC_CPP_LIBRARIES ${JSON_RPC_CPP_COMMON_LIBRARY} ${JSON_RPC_CPP_SERVER_LIBRARY} ${JSON_RPC_CPP_CLIENT_LIBRARY}) +set (JSON_RPC_CPP_SERVER_LIBRARIES ${JSON_RPC_CPP_COMMON_LIBRARY} ${JSON_RPC_CPP_SERVER_LIBRARY}) +set (JSON_RPC_CPP_CLIENT_LIBRARIES ${JSON_RPC_CPP_COMMON_LIBRARY} ${JSON_RPC_CPP_CLIENT_LIBRARY}) + +# handle the QUIETLY and REQUIRED arguments and set JSON_RPC_CPP_FOUND to TRUE +# if all listed variables are TRUE, hide their existence from configuration view +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(json_rpc_cpp DEFAULT_MSG + JSON_RPC_CPP_COMMON_LIBRARY JSON_RPC_CPP_SERVER_LIBRARY JSON_RPC_CPP_CLIENT_LIBRARY JSON_RPC_CPP_INCLUDE_DIR) +mark_as_advanced (JSON_RPC_CPP_COMMON_LIBRARY JSON_RPC_CPP_SERVER_LIBRARY JSON_RPC_CPP_CLIENT_LIBRARY JSON_RPC_CPP_INCLUDE_DIR) + diff --git a/cmake/FindJsoncpp.cmake b/cmake/FindJsoncpp.cmake new file mode 100644 index 000000000..fe72a9042 --- /dev/null +++ b/cmake/FindJsoncpp.cmake @@ -0,0 +1,103 @@ +# - try to find JSONCPP library +# +# Cache Variables: (probably not for direct use in your scripts) +# JSONCPP_INCLUDE_DIR +# JSONCPP_LIBRARY +# +# Non-cache variables you might use in your CMakeLists.txt: +# JSONCPP_FOUND +# JSONCPP_INCLUDE_DIRS +# JSONCPP_LIBRARIES +# +# Requires these CMake modules: +# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) +# +# Author: +# 2011 Philippe Crassous (ENSAM ParisTech / Institut Image) p.crassous _at_ free.fr +# +# Adapted from the Virtual Reality Peripheral Network library. +# https://github.com/rpavlik/vrpn/blob/master/README.Legal +# + +set(JSONCPP_ROOT_DIR + "${JSONCPP_ROOT_DIR}" + CACHE + PATH + "Directory to search for JSONCPP") +set(_jsoncppnames) +set(_pathsuffixes + suncc + vacpp + mingw + msvc6 + msvc7 + msvc71 + msvc80 + msvc90 + linux-gcc) +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + execute_process(COMMAND + ${CMAKE_CXX_COMPILER} + -dumpversion + OUTPUT_VARIABLE + _gnucxx_ver + OUTPUT_STRIP_TRAILING_WHITESPACE) + list(APPEND + _jsoncppnames + json_linux-gcc-${_gnucxx_ver}_libmt + json_linux-gcc_libmt) + list(APPEND _pathsuffixes linux-gcc-${_gnucxx_ver}) +elseif(MSVC) + if(MSVC_VERSION EQUAL 1200) + list(APPEND _jsoncppnames json_vc6_libmt) + elseif(MSVC_VERSION EQUAL 1300) + list(APPEND _jsoncppnames json_vc7_libmt) + elseif(MSVC_VERSION EQUAL 1310) + list(APPEND _jsoncppnames json_vc71_libmt) + elseif(MSVC_VERSION EQUAL 1400) + list(APPEND _jsoncppnames json_vc8_libmt) + elseif(MSVC_VERSION EQUAL 1500) + list(APPEND _jsoncppnames json_vc9_libmt) + elseif(MSVC_VERSION EQUAL 1600) + list(APPEND _jsoncppnames json_vc10_libmt) + endif() +else() + list(APPEND _jsoncppnames + json_suncc_libmt + json_vacpp_libmt) +endif() + +list(APPEND _jsoncppnames + json_mingw_libmt + jsoncpp) + +find_library(JSONCPP_LIBRARY + NAMES + ${_jsoncppnames} + PATHS + "${JSONCPP_ROOT_DIR}/libs" + PATH_SUFFIXES + ${_pathsuffixes}) + +find_path(JSONCPP_INCLUDE_DIR + NAMES + json/json.h + PATHS + "${JSONCPP_ROOT_DIR}" + PATH_SUFFIXES jsoncpp + include) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(JSONCPP + DEFAULT_MSG + JSONCPP_LIBRARY + JSONCPP_INCLUDE_DIR) + +if(JSONCPP_FOUND) + set(JSONCPP_LIBRARIES "${JSONCPP_LIBRARY}") + set(JSONCPP_INCLUDE_DIRS "${JSONCPP_INCLUDE_DIR}") + mark_as_advanced(JSONCPP_ROOT_DIR) +endif() + +mark_as_advanced(JSONCPP_INCLUDE_DIR JSONCPP_LIBRARY) + diff --git a/cmake/FindLevelDB.cmake b/cmake/FindLevelDB.cmake new file mode 100644 index 000000000..6bd373a9f --- /dev/null +++ b/cmake/FindLevelDB.cmake @@ -0,0 +1,34 @@ +# Find leveldb +# +# Find the leveldb includes and library +# +# if you nee to add a custom library search path, do it via via CMAKE_FIND_ROOT_PATH +# +# This module defines +# LEVELDB_INCLUDE_DIRS, where to find header, etc. +# LEVELDB_LIBRARIES, the libraries needed to use leveldb. +# LEVELDB_FOUND, If false, do not try to use leveldb. + +# only look in default directories +find_path( + LEVELDB_INCLUDE_DIR + NAMES leveldb/db.h + DOC "leveldb include dir" +) + +find_library( + LEVELDB_LIBRARY + NAMES leveldb + DOC "leveldb library" +) + +set(LEVELDB_INCLUDE_DIRS ${LEVELDB_INCLUDE_DIR}) +set(LEVELDB_LIBRARIES ${LEVELDB_LIBRARY}) + +# handle the QUIETLY and REQUIRED arguments and set LEVELDB_FOUND to TRUE +# if all listed variables are TRUE, hide their existence from configuration view +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(leveldb DEFAULT_MSG + LEVELDB_INCLUDE_DIR LEVELDB_LIBRARY) +mark_as_advanced (LEVELDB_INCLUDE_DIR LEVELDB_LIBRARY) + diff --git a/cmake/FindMiniupnpc.cmake b/cmake/FindMiniupnpc.cmake new file mode 100644 index 000000000..4ecbb0c4a --- /dev/null +++ b/cmake/FindMiniupnpc.cmake @@ -0,0 +1,34 @@ +# Find miniupnpc +# +# Find the miniupnpc includes and library +# +# if you nee to add a custom library search path, do it via via CMAKE_FIND_ROOT_PATH +# +# This module defines +# MINIUPNPC_INCLUDE_DIRS, where to find header, etc. +# MINIUPNPC_LIBRARIES, the libraries needed to use gmp. +# MINIUPNPC_FOUND, If false, do not try to use gmp. + +# only look in default directories +find_path( + MINIUPNPC_INCLUDE_DIR + NAMES miniupnpc/miniupnpc.h + DOC "miniupnpc include dir" + ) + +find_library( + MINIUPNPC_LIBRARY + NAMES miniupnpc + DOC "miniupnpc library" + ) + +set(MINIUPNPC_INCLUDE_DIRS ${MINIUPNPC_INCLUDE_DIR}) +set(MINIUPNPC_LIBRARIES ${MINIUPNPC_LIBRARY}) + +# handle the QUIETLY and REQUIRED arguments and set MINIUPNPC_FOUND to TRUE +# if all listed variables are TRUE, hide their existence from configuration view +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(miniupnpc DEFAULT_MSG + MINIUPNPC_INCLUDE_DIR MINIUPNPC_LIBRARY) +mark_as_advanced (MINIUPNPC_INCLUDE_DIR MINIUPNPC_LIBRARY) + diff --git a/cmake/FindReadline.cmake b/cmake/FindReadline.cmake new file mode 100644 index 000000000..1f47db4a7 --- /dev/null +++ b/cmake/FindReadline.cmake @@ -0,0 +1,34 @@ +# Find readline +# +# Find the readline includes and library +# +# if you nee to add a custom library search path, do it via via CMAKE_FIND_ROOT_PATH +# +# This module defines +# READLINE_INCLUDE_DIRS, where to find header, etc. +# READLINE_LIBRARIES, the libraries needed to use readline. +# READLINE_FOUND, If false, do not try to use readline. + +# only look in default directories +find_path( + READLINE_INCLUDE_DIR + NAMES readline/readline.h + DOC "readling include dir" + ) + +find_library( + READLINE_LIBRARY + NAMES readline + DOC "readline library" + ) + +set(READLINE_INCLUDE_DIRS ${READLINE_INCLUDE_DIR}) +set(READLINE_LIBRARIES ${READLINE_LIBRARY}) + +# handle the QUIETLY and REQUIRED arguments and set READLINE_FOUND to TRUE +# if all listed variables are TRUE, hide their existence from configuration view +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(readline DEFAULT_MSG + READLINE_INCLUDE_DIR READLINE_LIBRARY) +mark_as_advanced (READLINE_INCLUDE_DIR READLINE_LIBRARY) + diff --git a/eth/CMakeLists.txt b/eth/CMakeLists.txt index 7c997b256..739c2991c 100644 --- a/eth/CMakeLists.txt +++ b/eth/CMakeLists.txt @@ -1,48 +1,32 @@ cmake_policy(SET CMP0015 NEW) +set(CMAKE_AUTOMOC OFF) aux_source_directory(. SRC_LIST) +include_directories(${JSON_RPC_CPP_INCLUDE_DIRS}) include_directories(..) set(EXECUTABLE eth) file(GLOB HEADERS "*.h") + add_executable(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) -target_link_libraries(${EXECUTABLE} webthree) -target_link_libraries(${EXECUTABLE} secp256k1) -target_link_libraries(${EXECUTABLE} gmp) -if(MINIUPNPC_LS) - target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS}) -endif() -target_link_libraries(${EXECUTABLE} ${LEVELDB_LS}) -target_link_libraries(${EXECUTABLE} ${CRYPTOPP_LS}) -if(JSONRPC_LS) -target_link_libraries(${EXECUTABLE} web3jsonrpc) +add_dependencies(${EXECUTABLE} BuildInfo.h) + +target_link_libraries(${EXECUTABLE} ${Boost_REGEX_LIBRARY_RELEASE}) +target_link_libraries(${EXECUTABLE} ${Boost_DATE_TIME_LIBRARY_RELEASE}) + +if (READLINE_FOUND) + target_link_libraries(${EXECUTABLE} ${READLINE_LIBRARIES}) endif() -if(READLINE_LS) -target_link_libraries(${EXECUTABLE} ${READLINE_LS}) + +if (JSONRPC) + target_link_libraries(${EXECUTABLE} web3jsonrpc) endif() -if ("${TARGET_PLATFORM}" STREQUAL "w64") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++") - target_link_libraries(${EXECUTABLE} boost_system-mt-s) - target_link_libraries(${EXECUTABLE} boost_filesystem-mt-s) - target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) - target_link_libraries(${EXECUTABLE} gcc) - target_link_libraries(${EXECUTABLE} gdi32) - target_link_libraries(${EXECUTABLE} ws2_32) - target_link_libraries(${EXECUTABLE} mswsock) - target_link_libraries(${EXECUTABLE} shlwapi) - target_link_libraries(${EXECUTABLE} iphlpapi) - set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) -elseif (UNIX) -else () - target_link_libraries(${EXECUTABLE} boost_system) - target_link_libraries(${EXECUTABLE} boost_filesystem) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -endif () +target_link_libraries(${EXECUTABLE} webthree) +target_link_libraries(${EXECUTABLE} secp256k1) install( TARGETS ${EXECUTABLE} DESTINATION bin ) diff --git a/eth/main.cpp b/eth/main.cpp index 0113fa1a5..49eac8876 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -27,10 +27,6 @@ #include #include #include -#if ETH_JSONRPC -#include -#include -#endif #include #include #include @@ -42,6 +38,7 @@ #endif #if ETH_JSONRPC #include +#include #endif #include "BuildInfo.h" using namespace std; @@ -338,9 +335,11 @@ int main(int argc, char** argv) #if ETH_JSONRPC shared_ptr jsonrpcServer; + unique_ptr jsonrpcConnector; if (jsonrpc > -1) { - jsonrpcServer = shared_ptr(new WebThreeStubServer(new jsonrpc::CorsHttpServer(jsonrpc), web3, {us})); + jsonrpcConnector = unique_ptr(new jsonrpc::HttpServer(jsonrpc)); + jsonrpcServer = shared_ptr(new WebThreeStubServer(*jsonrpcConnector.get(), web3, vector({us}))); jsonrpcServer->setIdentities({us}); jsonrpcServer->StartListening(); } @@ -428,7 +427,8 @@ int main(int argc, char** argv) { if (jsonrpc < 0) jsonrpc = 8080; - jsonrpcServer = make_shared(new jsonrpc::CorsHttpServer(jsonrpc), web3, vector({us})); + jsonrpcConnector = unique_ptr(new jsonrpc::HttpServer(jsonrpc)); + jsonrpcServer = shared_ptr(new WebThreeStubServer(*jsonrpcConnector.get(), web3, vector({us}))); jsonrpcServer->setIdentities({us}); jsonrpcServer->StartListening(); } @@ -620,7 +620,7 @@ int main(int argc, char** argv) dev::eth::State state =c->state(index + 1,c->blockChain().numberHash(block)); if (index < state.pending().size()) { - Executive e(state); + Executive e(state, 0); Transaction t = state.pending()[index]; state = state.fromPending(index); bytes r = t.rlp(); diff --git a/exp/CMakeLists.txt b/exp/CMakeLists.txt index da6775798..d0aadc8ae 100644 --- a/exp/CMakeLists.txt +++ b/exp/CMakeLists.txt @@ -1,7 +1,9 @@ cmake_policy(SET CMP0015 NEW) +set(CMAKE_AUTOMOC OFF) aux_source_directory(. SRC_LIST) +include_directories(${LEVELDB_INCLUDE_DIRS}) include_directories(..) set(EXECUTABLE exp) @@ -10,32 +12,6 @@ add_executable(${EXECUTABLE} ${SRC_LIST}) target_link_libraries(${EXECUTABLE} ethereum) target_link_libraries(${EXECUTABLE} p2p) -target_link_libraries(${EXECUTABLE} gmp) -target_link_libraries(${EXECUTABLE} ${CRYPTOPP_LS}) -if(MINIUPNPC_LS) -target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS}) -endif() -target_link_libraries(${EXECUTABLE} ${LEVELDB_LS}) -if ("${TARGET_PLATFORM}" STREQUAL "w64") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++") - target_link_libraries(${EXECUTABLE} gcc) - target_link_libraries(${EXECUTABLE} gdi32) - target_link_libraries(${EXECUTABLE} ws2_32) - target_link_libraries(${EXECUTABLE} mswsock) - target_link_libraries(${EXECUTABLE} shlwapi) - target_link_libraries(${EXECUTABLE} iphlpapi) - target_link_libraries(${EXECUTABLE} boost_system-mt-s) - target_link_libraries(${EXECUTABLE} boost_filesystem-mt-s) - target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) - set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) -elseif (UNIX) -else () - target_link_libraries(${EXECUTABLE} boost_system) - target_link_libraries(${EXECUTABLE} boost_filesystem) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -endif () - -install( TARGETS ${EXECUTABLE} DESTINATION bin ) +install( TARGETS ${EXECUTABLE} DESTINATION bin) diff --git a/exp/main.cpp b/exp/main.cpp index 8be79cad5..27707decb 100644 --- a/exp/main.cpp +++ b/exp/main.cpp @@ -20,6 +20,7 @@ * Ethereum client. */ #include +#include #include #include #include @@ -28,6 +29,8 @@ #include #include #include +#include +#include #include #include using namespace std; @@ -36,7 +39,7 @@ using namespace dev::eth; using namespace dev::p2p; using namespace dev::shh; -#if 1 +#if 0 int main() { DownloadMan man; @@ -72,72 +75,25 @@ int main() cnote << i;*/ return 0; } -#endif - -/*int other(bool& o_started) +#else +int main() { - setThreadName("other"); - - short listenPort = 30300; - - Host ph("Test", NetworkPreferences(listenPort, "", false, true)); - auto wh = ph.registerCapability(new WhisperHost()); - - ph.start(); - - o_started = true; - - /// Only interested in odd packets - auto w = wh->installWatch(BuildTopicMask()("odd")); - - unsigned last = 0; - unsigned total = 0; - - for (int i = 0; i < 100 && last < 81; ++i) - { - for (auto i: wh->checkWatch(w)) - { - Message msg = wh->envelope(i).open(); - last = RLP(msg.payload()).toInt(); - cnote << "New message from:" << msg.from().abridged() << RLP(msg.payload()).toInt(); - total += last; - } - this_thread::sleep_for(chrono::milliseconds(50)); - } - return total; + KeyPair u = KeyPair::create(); + KeyPair cb = KeyPair::create(); + OverlayDB db; + State s(cb.address(), db, BaseState::Empty); + cnote << s.rootHash(); + s.addBalance(u.address(), 1 * ether); + Address c = s.newContract(1000 * ether, compileLLL("(suicide (caller))")); + s.commit(); + State before = s; + cnote << "State before transaction: " << before; + Transaction t(0, 10000, 10000, c, bytes(), 0, u.secret()); + cnote << "Transaction: " << t; + cnote << s.balance(c); + s.execute(t.rlp()); + cnote << "State after transaction: " << s; + cnote << before.diff(s); } +#endif -int main(int, char**) -{ - g_logVerbosity = 0; - - bool started = false; - unsigned result; - std::thread listener([&](){ return (result = other(started)); }); - while (!started) - this_thread::sleep_for(chrono::milliseconds(50)); - - short listenPort = 30303; - string remoteHost = "127.0.0.1"; - short remotePort = 30300; - - Host ph("Test", NetworkPreferences(listenPort, "", false, true)); - auto wh = ph.registerCapability(new WhisperHost()); - - ph.start(); - - if (!remoteHost.empty()) - ph.connect(remoteHost, remotePort); - - KeyPair us = KeyPair::create(); - for (int i = 0; i < 10; ++i) - { - wh->post(us.sec(), RLPStream().append(i * i).out(), BuildTopic(i)(i % 2 ? "odd" : "even")); - this_thread::sleep_for(chrono::milliseconds(250)); - } - - listener.join(); - assert(result == 1 + 9 + 25 + 49 + 81); - - return 0; -}*/ diff --git a/extdep/CMakeLists.txt b/extdep/CMakeLists.txt new file mode 100644 index 000000000..19cd00f7b --- /dev/null +++ b/extdep/CMakeLists.txt @@ -0,0 +1,55 @@ +cmake_minimum_required(VERSION 2.8.12) + +include(ExternalProject) +include(CMakeParseArguments) +include(eth_download.cmake) + +# all dependencies will be installed into this directory, separated by platform +string(TOLOWER ${CMAKE_SYSTEM_NAME} _system_name) +set(ETH_DEPENDENCY_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/install/${_system_name}") +set(ETH_DEPENDENCY_SERVER "http://poc-7.ethdev.com/precompiled/${_system_name}") +file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/lib) +file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/include) +file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/bin) + +if (ETH_COMPILE) + # json-rpc-cpp and its dependencies + include(compile/jsoncpp.cmake) + include(compile/argtable2.cmake) + include(compile/curl.cmake) + include(compile/json-rpc-cpp.cmake) + + # qt and its dependencies + include(compile/icu.cmake) + include(compile/jom.cmake) + include(compile/qt.cmake) + + # leveldb and its dependencies + include(compile/snappy.cmake) + include(compile/leveldb.cmake) + + # cryptopp + include(compile/cryptopp.cmake) + + # boost + include(compile/boost.cmake) +else() + eth_download(jsoncpp) + eth_download(json-rpc-cpp OSX_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/scripts/json-rpc-cpp_osx.sh) + + if (APPLE) + eth_download(snappy OSX_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/scripts/snappy_osx.sh) + endif() + + eth_download(leveldb OSX_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/scripts/leveldb_osx.sh) + eth_download(qt) + eth_download(cryptopp) + eth_download(boost) + eth_download(curl) + +endif() + +# will be re-eanbled later +# include(miniupnpc.cmake) +# if install phase of extep fails, even if libs are already created, the ethereum install will fail + diff --git a/extdep/Readme.md b/extdep/Readme.md new file mode 100644 index 000000000..1706f1fb9 --- /dev/null +++ b/extdep/Readme.md @@ -0,0 +1,16 @@ +# cpp-ethereum external dependencies + +**This is Work-in-Progress!** + +This directory hosts the external libraries that are needed to build cpp-ethereum. + +To automatically download, build, and link libraries, do +``` +cd extdep; mkdir build; cd build; cmake ..; make +``` +this will take some time. + + +To check which libraries are already included, check `CMakeLists.txt`. Other libraries still need to be fetched via the system's package manager. + +Libraries will be installed in `cpp-ethereum/extdep/install/` diff --git a/extdep/cmake/FindCURL.cmake b/extdep/cmake/FindCURL.cmake new file mode 100644 index 000000000..22d51591c --- /dev/null +++ b/extdep/cmake/FindCURL.cmake @@ -0,0 +1,9 @@ +# hacky way to resolve nested dependencies - needed for json-rpc-cpp +find_library(CURL_LIBRARY NAMES curl + PATHS + ${ETH_DEPENDENCY_INSTALL_DIR}/lib + ) + +set(CURL_LIBRARIES ${CURL_LIBRARY}) +set(CURL_INCLUDE_DIRS ${ETH_DEPENDENCY_INSTALL_DIR}/include) + diff --git a/extdep/compile/argtable2.cmake b/extdep/compile/argtable2.cmake new file mode 100644 index 000000000..778d6a299 --- /dev/null +++ b/extdep/compile/argtable2.cmake @@ -0,0 +1,13 @@ +if (APPLE) + +elseif (WIN32) +ExternalProject_Add(argtable2 + GIT_REPOSITORY https://github.com/debris/argtable.git + GIT_TAG master + BINARY_DIR argtable2-prefix/src/argtable2 + CONFIGURE_COMMAND cmake . + BUILD_COMMAND devenv argtable2.sln /build release + INSTALL_COMMAND cmd /c cp src/Release/argtable2.lib ${ETH_DEPENDENCY_INSTALL_DIR}/lib && cp src/argtable2.h ${ETH_DEPENDENCY_INSTALL_DIR}/include +) +else() +endif() diff --git a/extdep/compile/boost.cmake b/extdep/compile/boost.cmake new file mode 100644 index 000000000..7449cf47b --- /dev/null +++ b/extdep/compile/boost.cmake @@ -0,0 +1,19 @@ +if (APPLE) + +elseif (WIN32) +set(boost_address_model) +# on windows 64: +# set(boost_address_model address-model=64) + +set(boost_targets --with-filesystem --with-system --with-thread --with-date_time --with-regex --with-test --with-chrono --with-program_options) +ExternalProject_Add(boost + URL http://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.gz + BINARY_DIR boost-prefix/src/boost + CONFIGURE_COMMAND ./bootstrap.bat + BUILD_COMMAND ./b2.exe -j4 --build-type=complete link=static runtime-link=shared variant=debug,release threading=multi ${boost_addressModel} ${boost_targets} install --prefix=${ETH_DEPENDENCY_INSTALL_DIR} + INSTALL_COMMAND cmake -E rename ${ETH_DEPENDENCY_INSTALL_DIR}/include/boost-1_55/boost ${ETH_DEPENDENCY_INSTALL_DIR}/include/boost + ) +else() + +endif() + diff --git a/extdep/compile/cryptopp.cmake b/extdep/compile/cryptopp.cmake new file mode 100644 index 000000000..a7e65d6c6 --- /dev/null +++ b/extdep/compile/cryptopp.cmake @@ -0,0 +1,33 @@ +# CryptoPP does not have good cross-platform support, there exist several different other projects to make it work ... + +# TODO the OS X build throws a lot of warnings, but compiles fine +if (APPLE) + ExternalProject_Add(cryptopp + URL https://downloads.sourceforge.net/project/cryptopp/cryptopp/5.6.2/cryptopp562.zip + BINARY_DIR cryptopp-prefix/src/cryptopp + CONFIGURE_COMMAND "" + BUILD_COMMAND make CXX=clang++ CXXFLAGS=-DCRYPTOPP_DISABLE_ASM + INSTALL_COMMAND make install PREFIX=${ETH_DEPENDENCY_INSTALL_DIR} + ) +elseif (WIN32) + file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/include/cryptopp) + + ExternalProject_Add(cryptopp + SVN_REPOSITORY http://svn.code.sf.net/p/cryptopp/code/trunk/c5 + SVN_REVISION -r "541" + BINARY_DIR cryptopp-prefix/src/cryptopp + CONFIGURE_COMMAND devenv cryptest.sln /upgrade + BUILD_COMMAND devenv cryptest.sln /build release + INSTALL_COMMAND cmd /c cp Win32/DLL_Output/Release/cryptopp.dll ${ETH_DEPENDENCY_INSTALL_DIR}/lib && cp Win32/DLL_Output/Release/cryptopp.lib ${ETH_DEPENDENCY_INSTALL_DIR}/lib && cp *.h ${ETH_DEPENDENCY_INSTALL_DIR}/include/cryptopp + ) +# on Linux, the default Makefile does not work. +else() + ExternalProject_Add(cryptopp + URL https://github.com/mmoss/cryptopp/archive/v5.6.2.zip + BINARY_DIR cryptopp-prefix/src/cryptopp + CONFIGURE_COMMAND "" + BUILD_COMMAND scons --shared --prefix=${ETH_DEPENDENCY_INSTALL_DIR} + INSTALL_COMMAND "" + ) +endif() + diff --git a/extdep/compile/curl.cmake b/extdep/compile/curl.cmake new file mode 100644 index 000000000..64f253d43 --- /dev/null +++ b/extdep/compile/curl.cmake @@ -0,0 +1,29 @@ +if (APPLE) + ExternalProject_Add(curl + URL http://curl.haxx.se/download/curl-7.38.0.tar.bz2 + BINARY_DIR curl-prefix/src/curl + CONFIGURE_COMMAND ./configure --with-darwinssl --prefix=${ETH_DEPENDENCY_INSTALL_DIR} --exec-prefix=${ETH_DEPENDENCY_INSTALL_DIR} + BUILD_COMMAND make -j 3 + INSTALL_COMMAND make install + ) +elseif (WIN32) + ExternalProject_Add(curl + GIT_REPOSITORY https://github.com/debris/libcurl-7.29 + GIT_TAG master + BINARY_DIR curl-prefix/src/curl + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND cmd /c cp lib/release/libcurl.lib ${ETH_DEPENDENCY_INSTALL_DIR}/lib && cp -R include/curl ${ETH_DEPENDENCY_INSTALL_DIR}/include + ) + +else() + ExternalProject_Add(curl + URL http://curl.haxx.se/download/curl-7.38.0.tar.bz2 + BINARY_DIR curl-prefix/src/curl + CONFIGURE_COMMAND CONFIG_CMD ./configure --prefix=${ETH_DEPENDENCY_INSTALL_DIR} --exec-prefix=${ETH_DEPENDENCY_INSTALL_DIR} + BUILD_COMMAND make -j 3 + INSTALL_COMMAND make install + ) + +endif() + diff --git a/extdep/compile/icu.cmake b/extdep/compile/icu.cmake new file mode 100644 index 000000000..ba3f3a9f0 --- /dev/null +++ b/extdep/compile/icu.cmake @@ -0,0 +1,17 @@ +if (APPLE) + +elseif (WIN32) + ExternalProject_Add(icu + GIT_REPOSITORY https://github.com/debris/icu-win32.git + GIT_TAG master + BINARY_DIR icu-prefix/src/icu + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND cmake -E copy_directory . ${ETH_DEPENDENCY_INSTALL_DIR} + ) + +else() + +endif() + + diff --git a/extdep/compile/jom.cmake b/extdep/compile/jom.cmake new file mode 100644 index 000000000..f300fb2ad --- /dev/null +++ b/extdep/compile/jom.cmake @@ -0,0 +1,16 @@ +if (APPLE) + + +elseif (WIN32) + ExternalProject_Add(jom + URL http://download.qt-project.org/official_releases/jom/jom.zip + BINARY_DIR jom-prefix/src/jom + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND cmake -E copy jom.exe ${ETH_DEPENDENCY_INSTALL_DIR}/bin + ) + +else() + +endif() + diff --git a/extdep/compile/json-rpc-cpp.cmake b/extdep/compile/json-rpc-cpp.cmake new file mode 100644 index 000000000..9d56b0dac --- /dev/null +++ b/extdep/compile/json-rpc-cpp.cmake @@ -0,0 +1,40 @@ +# json-rpc-cpp is under heavy development, not yet stable, and multiplatform builds are not yet available. +# DO NOT MESS WITH THESE SETTINGS! IF YOU HAVE TO MAKE CHANGES HERE, CONSULT sven@ethdev.com BEFOREHAND!! + +# DO NOT CHANGE ANYTHING HERE! +if(APPLE) + ExternalProject_Add(json-rpc-cpp + # DEPENDS argtable2 jsoncpp + # DEPENDS curl # re-enable later, when we build curl again + GIT_REPOSITORY https://github.com/cinemast/libjson-rpc-cpp.git + GIT_TAG v0.3.2 + BINARY_DIR json-rpc-cpp-prefix/src/json-rpc-cpp + CONFIGURE_COMMAND cmake -DCMAKE_INSTALL_PREFIX=${ETH_DEPENDENCY_INSTALL_DIR} -DCMAKE_MODULE_PATH:PATH=${CMAKE_CURRENT_SOURCE_DIR}/cmake -DETH_DEPENDENCY_INSTALL_DIR:PATH=${ETH_DEPENDENCY_INSTALL_DIR} -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -Wno-dev . + BUILD_COMMAND make -j 3 + INSTALL_COMMAND make install && ${CMAKE_CURRENT_SOURCE_DIR}/scripts/json-rpc-cpp_osx.sh . ${ETH_DEPENDENCY_INSTALL_DIR} + ) + +elseif (WIN32) + ExternalProject_Add(json-rpc-cpp + DEPENDS argtable2 jsoncpp curl + GIT_REPOSITORY https://github.com/debris/libjson-rpc-cpp.git + GIT_TAG windows + BINARY_DIR json-rpc-cpp-prefix/src/json-rpc-cpp + CONFIGURE_COMMAND cmake -DCMAKE_PREFIX_PATH=${ETH_DEPENDENCY_INSTALL_DIR} -DCURL_LIBRARIES=${ETH_DEPENDENCY_INSTALL_DIR}/lib/libcurl.lib . + BUILD_COMMAND devenv libjson-rpc-cpp.sln /build release + INSTALL_COMMAND cmd /c cp lib/Release/* ${ETH_DEPENDENCY_INSTALL_DIR}/lib && cp -R src/jsonrpccpp ${ETH_DEPENDENCY_INSTALL_DIR}/include + ) +else() + ExternalProject_Add(json-rpc-cpp + # DEPENDS argtable2 jsoncpp + # DEPENDS curl # re-enable later, when we build curl again + GIT_REPOSITORY https://github.com/cinemast/libjson-rpc-cpp.git + GIT_TAG v0.3.2 + BINARY_DIR json-rpc-cpp-prefix/src/json-rpc-cpp + CONFIGURE_COMMAND cmake -DCMAKE_INSTALL_PREFIX=${ETH_DEPENDENCY_INSTALL_DIR} -DCMAKE_MODULE_PATH:PATH=${CMAKE_CURRENT_SOURCE_DIR}/cmake -DETH_DEPENDENCY_INSTALL_DIR:PATH=${ETH_DEPENDENCY_INSTALL_DIR} -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST . + BUILD_COMMAND make -j 3 + INSTALL_COMMAND make install + ) + +endif() + diff --git a/extdep/compile/jsoncpp.cmake b/extdep/compile/jsoncpp.cmake new file mode 100644 index 000000000..c0d6c97cd --- /dev/null +++ b/extdep/compile/jsoncpp.cmake @@ -0,0 +1,16 @@ +if (APPLE) + +elseif (WIN32) + + file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/include/jsoncpp) + ExternalProject_Add(jsoncpp + GIT_REPOSITORY https://github.com/open-source-parsers/jsoncpp + GIT_TAG svn-import + BINARY_DIR jsoncpp-prefix/src/jsoncpp + CONFIGURE_COMMAND cmake . + BUILD_COMMAND devenv jsoncpp.sln /build release + INSTALL_COMMAND cmd /c cp lib/Release/jsoncpp.lib ${ETH_DEPENDENCY_INSTALL_DIR}/lib && cp -R include/json ${ETH_DEPENDENCY_INSTALL_DIR}/include/jsoncpp + ) + +else() +endif() diff --git a/extdep/compile/leveldb.cmake b/extdep/compile/leveldb.cmake new file mode 100644 index 000000000..2f5388c14 --- /dev/null +++ b/extdep/compile/leveldb.cmake @@ -0,0 +1,23 @@ +if (APPLE) + ExternalProject_Add(leveldb + #DEPENDS snappy + URL https://leveldb.googlecode.com/files/leveldb-1.15.0.tar.gz + BINARY_DIR leveldb-prefix/src/leveldb + #CONFIGURE_COMMAND patch < ${CMAKE_CURRENT_SOURCE_DIR}/compile/leveldb_osx.patch + CONFIGURE_COMMAND "" + BUILD_COMMAND export ETH_DEPENDENCY_INSTALL_DIR=${ETH_DEPENDENCY_INSTALL_DIR} && make -j 3 + INSTALL_COMMAND cp -rf include/leveldb ${ETH_DEPENDENCY_INSTALL_DIR}/include/ && cp libleveldb.a ${ETH_DEPENDENCY_INSTALL_DIR}/lib && cp libleveldb.dylib.1.15 ${ETH_DEPENDENCY_INSTALL_DIR}/lib/libleveldb.dylib + ) +elseif (WIN32) + ExternalProject_Add(leveldb + GIT_REPOSITORY https://github.com/debris/leveldb-win32.git + GIT_TAG master + BINARY_DIR leveldb-prefix/src/leveldb + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND cmd /c cp lib/LibLevelDB.lib ${ETH_DEPENDENCY_INSTALL_DIR}/lib/leveldb.lib && cp -R include/leveldb ${ETH_DEPENDENCY_INSTALL_DIR}/include + ) +else() + +endif() + diff --git a/extdep/compile/leveldb_osx.patch b/extdep/compile/leveldb_osx.patch new file mode 100644 index 000000000..ac9e8f528 --- /dev/null +++ b/extdep/compile/leveldb_osx.patch @@ -0,0 +1,18 @@ +--- Makefile 2014-11-07 00:54:05.000000000 +0100 ++++ MakefilePatch 2014-11-07 00:56:59.000000000 +0100 +@@ -17,11 +17,11 @@ + # this file is generated by the previous line to set build flags and sources + include build_config.mk + +-CFLAGS += -I. -I./include $(PLATFORM_CCFLAGS) $(OPT) +-CXXFLAGS += -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT) ++CFLAGS += -I. -I./include $(PLATFORM_CCFLAGS) $(OPT) ++CXXFLAGS += -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT) -DSNAPPY -I$(ETH_DEPENDENCY_INSTALL_DIR)/include + +-LDFLAGS += $(PLATFORM_LDFLAGS) +-LIBS += $(PLATFORM_LIBS) ++LDFLAGS += $(PLATFORM_LDFLAGS) -L$(ETH_DEPENDENCY_INSTALL_DIR)/lib ++LIBS += $(PLATFORM_LIBS) -lsnappy + + LIBOBJECTS = $(SOURCES:.cc=.o) + MEMENVOBJECTS = $(MEMENV_SOURCES:.cc=.o) diff --git a/extdep/compile/qt.cmake b/extdep/compile/qt.cmake new file mode 100644 index 000000000..5fb8a1440 --- /dev/null +++ b/extdep/compile/qt.cmake @@ -0,0 +1,32 @@ +if (APPLE) + ExternalProject_add(qt + URL http://qtmirror.ics.com/pub/qtproject/official_releases/qt/5.3/5.3.2/single/qt-everywhere-opensource-src-5.3.2.tar.gz + BINARY_DIR qt-prefix/src/qt + PATCH_COMMAND patch -d qtmultimedia/src/plugins/avfoundation/mediaplayer < ${CMAKE_CURRENT_SOURCE_DIR}/compile/qt_osx.patch + CONFIGURE_COMMAND ./configure -prefix ${ETH_DEPENDENCY_INSTALL_DIR} -system-zlib -qt-libpng -qt-libjpeg -confirm-license -opensource -nomake tests -release -nomake examples -no-xcb -arch x86_64 + BUILD_COMMAND make + INSTALL_COMMAND make install + ) +elseif(WIN32) + ExternalProject_Add(qt + DEPENDS icu jom + URL http://qtmirror.ics.com/pub/qtproject/official_releases/qt/5.3/5.3.2/single/qt-everywhere-opensource-src-5.3.2.tar.gz + BINARY_DIR qt-prefix/src/qt + UPDATE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/compile/qt_tools.bat + #PATCH_COMMAND cmake -E copy ${CMAKE_CURRENT_SOURCE_DIR}/compile/qt_configure.bat qtbase/configure.bat + CONFIGURE_COMMAND configure -prefix ${ETH_DEPENDENCY_INSTALL_DIR} -opensource -confirm-license -release -opengl desktop -platform win32-msvc2013 -icu -I ${ETH_DEPENDENCY_INSTALL_DIR}/include -L ${ETH_DEPENDENCY_INSTALL_DIR}/lib -nomake tests -nomake examples + BUILD_COMMAND nmake + INSTALL_COMMAND nmake install + ) + + ExternalProject_Add_Step(qt configure_paths + COMMAND set PATH=${ETH_DEPENDENCY_INSTALL_DIR}/bin;%cd%/gnuwin32/bin;%cd%/qtbase/bin;%PATH% + DEPENDEES patch + DEPENDERS configure + ) + +else() + +endif() + + diff --git a/extdep/compile/qt_configure.bat b/extdep/compile/qt_configure.bat new file mode 100644 index 000000000..bd810938a --- /dev/null +++ b/extdep/compile/qt_configure.bat @@ -0,0 +1,111 @@ +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: +:: Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +:: Contact: http://www.qt-project.org/legal +:: +:: This file is part of the tools applications of the Qt Toolkit. +:: +:: $QT_BEGIN_LICENSE:LGPL$ +:: Commercial License Usage +:: Licensees holding valid commercial Qt licenses may use this file in +:: accordance with the commercial license agreement provided with the +:: Software or, alternatively, in accordance with the terms contained in +:: a written agreement between you and Digia. For licensing terms and +:: conditions see http://qt.digia.com/licensing. For further information +:: use the contact form at http://qt.digia.com/contact-us. +:: +:: GNU Lesser General Public License Usage +:: Alternatively, this file may be used under the terms of the GNU Lesser +:: General Public License version 2.1 as published by the Free Software +:: Foundation and appearing in the file LICENSE.LGPL included in the +:: packaging of this file. Please review the following information to +:: ensure the GNU Lesser General Public License version 2.1 requirements +:: will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +:: +:: In addition, as a special exception, Digia gives you certain additional +:: rights. These rights are described in the Digia Qt LGPL Exception +:: version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +:: +:: GNU General Public License Usage +:: Alternatively, this file may be used under the terms of the GNU +:: General Public License version 3.0 as published by the Free Software +:: Foundation and appearing in the file LICENSE.GPL included in the +:: packaging of this file. Please review the following information to +:: ensure the GNU General Public License version 3.0 requirements will be +:: met: http://www.gnu.org/copyleft/gpl.html. +:: +:: +:: $QT_END_LICENSE$ +:: +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +@echo off +set QTSRC=%~dp0 +set QTDIR=%CD% +::if not exist %QTSRC%\.gitignore goto sconf +echo Please wait while bootstrapping configure ... + +for %%C in (cl.exe icl.exe g++.exe perl.exe) do set %%C=%%~$PATH:C + +if "%perl.exe%" == "" ( + echo Perl not found in PATH. Aborting. >&2 + exit /b 1 +) +if not exist mkspecs ( + md mkspecs + if errorlevel 1 goto exit +) +perl %QTSRC%bin\syncqt.pl -minimal -module QtCore -outdir %QTDIR% %QTSRC% +if errorlevel 1 goto exit + +if not exist tools\configure ( + md tools\configure + if errorlevel 1 goto exit +) +cd tools\configure +if errorlevel 1 goto exit + +echo #### Generated by configure.bat - DO NOT EDIT! ####> Makefile +echo/>> Makefile +for /f "tokens=3 usebackq" %%V in (`findstr QT_VERSION_STR %QTSRC%\src\corelib\global\qglobal.h`) do @echo QTVERSION = %%~V>> Makefile +if not "%cl.exe%" == "" ( + echo CXX = cl>>Makefile + echo EXTRA_CXXFLAGS =>>Makefile + rem This must have a trailing space. + echo QTSRC = %QTSRC% >> Makefile + set tmpl=win32 + set make=nmake +) else if not "%icl.exe%" == "" ( + echo CXX = icl>>Makefile + echo EXTRA_CXXFLAGS = /Zc:forScope>>Makefile + rem This must have a trailing space. + echo QTSRC = %QTSRC% >> Makefile + set tmpl=win32 + set make=nmake +) else if not "%g++.exe%" == "" ( + echo CXX = g++>>Makefile + echo EXTRA_CXXFLAGS =>>Makefile + rem This must NOT have a trailing space. + echo QTSRC = %QTSRC:\=/%>> Makefile + set tmpl=mingw + set make=mingw32-make +) else ( + echo No suitable compiler found in PATH. Aborting. >&2 + cd ..\.. + exit /b 1 +) +echo/>> Makefile +type %QTSRC%tools\configure\Makefile.%tmpl% >> Makefile + +%make% +if errorlevel 1 (cd ..\.. & exit /b 1) + +cd ..\.. + +:conf +configure.exe -srcdir %QTSRC% %* +goto exit + +:sconf +%QTSRC%\configure.exe %* +:exit diff --git a/extdep/compile/qt_osx.patch b/extdep/compile/qt_osx.patch new file mode 100644 index 000000000..7900f6094 --- /dev/null +++ b/extdep/compile/qt_osx.patch @@ -0,0 +1,11 @@ +--- avfmediaplayersession.mm 2014-09-11 12:48:26.000000000 +0200 ++++ avfmediaplayersessionPatch.mm 2014-12-01 12:53:14.000000000 +0100 +@@ -295,7 +295,7 @@ + //AVPlayerItem "status" property value observer. + if (context == AVFMediaPlayerSessionObserverStatusObservationContext) + { +- AVPlayerStatus status = [[change objectForKey:NSKeyValueChangeNewKey] integerValue]; ++ AVPlayerStatus status = (AVPlayerStatus)[[change objectForKey:NSKeyValueChangeNewKey] integerValue]; + switch (status) + { + //Indicates that the status of the player is not yet known because diff --git a/extdep/compile/qt_tools.bat b/extdep/compile/qt_tools.bat new file mode 100644 index 000000000..bd588c480 --- /dev/null +++ b/extdep/compile/qt_tools.bat @@ -0,0 +1,2 @@ +rem : import VC environment vars +call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" x86 \ No newline at end of file diff --git a/extdep/compile/snappy.cmake b/extdep/compile/snappy.cmake new file mode 100644 index 000000000..0f7ba300e --- /dev/null +++ b/extdep/compile/snappy.cmake @@ -0,0 +1,14 @@ +if (APPLE) + ExternalProject_Add(snappy + URL https://snappy.googlecode.com/files/snappy-1.1.1.tar.gz + BINARY_DIR snappy-prefix/src/snappy + CONFIGURE_COMMAND ./configure --disable-dependency-tracking --prefix=${ETH_DEPENDENCY_INSTALL_DIR} + BUILD_COMMAND "" + INSTALL_COMMAND make install + ) +elseif(WIN32) + +else() + +endif() + diff --git a/extdep/eth_download.cmake b/extdep/eth_download.cmake new file mode 100644 index 000000000..96d6c5122 --- /dev/null +++ b/extdep/eth_download.cmake @@ -0,0 +1,74 @@ +# this macro requires the following variables to be specified: +# +# ETH_DEPENDENCY_SERVER - server from which dependencies should be downloaded +# ETH_DEPENDENCY_INSTALL_DIR - install location for all dependencies +# +# usage: +# +# eth_download("json-rpc-cpp") +# eth_download("json-rpc-cpp" VERSION "0.3.2") +# +# params: +# VERSION - exact version we want to use +# OSX_SCRIPT - script which will be executed on apple in install phase +# UNIX_SCRIPT - script which will be executed on unix in install phase +# WIN_SCRIPT - script which will be executed on win in install phase + +# OSX_SCRIPT, WIN_SCRIPT, UNIX_SCRIPT are taking 2 params: +# $1 is package_source, +# $2 is ETH_DEPENDENCY_INSTALL_DIR +# +# parsing arguments +# http://www.cmake.org/cmake/help/v3.0/module/CMakeParseArguments.html +# +# for macos you may need to specify OSX_SCRIPT with install_name_tool to fix dylib +# http://stackoverflow.com/questions/2985315/using-install-name-tool-whats-going-wrong +# +# TODO: +# check if install_command is handling symlinks correctly on linux and windows + +macro(eth_download eth_package_name) + + set (extra_macro_args ${ARGN}) + set (options) + set (one_value_args VERSION OSX_SCRIPT UNIX_SCRIPT WIN_SCRIPT) + set (multi_value_args) + cmake_parse_arguments (ETH_DOWNLOAD "${options}" "${one_value_args}" "${multi_value_args}" ${extra_macro_args}) + + if (ETH_DOWNLOAD_VERSION) + set(eth_tar_name "${eth_package_name}-${ETH_DOWNLOAD_VERSION}.tar.gz") + else() + set(eth_tar_name "${eth_package_name}.tar.gz") + endif() + + message(STATUS "download path for ${eth_package_name} is : ${ETH_DEPENDENCY_SERVER}/${eth_tar_name}") + + # we need that to copy symlinks + # see http://superuser.com/questions/138587/how-to-copy-symbolic-links + if (APPLE) + set (eth_package_copy cp -a . ${ETH_DEPENDENCY_INSTALL_DIR}) + set (eth_package_install ${ETH_DOWNLOAD_OSX_SCRIPT}) + elseif (UNIX) + set (eth_package_copy cp -a . ${ETH_DEPENDENCY_INSTALL_DIR}) + set (eth_package_install ${ETH_DOWNLOAD_UNIX_SCRIPT}) + else () + set (eth_package_copy cmake -E copy_directory . ${ETH_DEPENDENCY_INSTALL_DIR}) + set (eth_package_install ${ETH_DOWNLOAD_WIN_SCRIPT}) + endif() + + if (eth_package_install) + message(STATUS "install script: ${eth_package_install}") + set (eth_package_install ${eth_package_install} . ${ETH_DEPENDENCY_INSTALL_DIR}) + else () + set (eth_package_install echo 0) # cause empty string is not handled properly + endif() + + ExternalProject_Add(${eth_package_name} + URL ${ETH_DEPENDENCY_SERVER}/${eth_tar_name} + BINARY_DIR ${eth_package_name}-prefix/src/${eth_package_name} + CONFIGURE_COMMAND "" + BUILD_COMMAND ${eth_package_copy} + INSTALL_COMMAND ${eth_package_install} + ) +endmacro() + diff --git a/extdep/miniupnpc.cmake b/extdep/miniupnpc.cmake new file mode 100644 index 000000000..4fbed6807 --- /dev/null +++ b/extdep/miniupnpc.cmake @@ -0,0 +1,11 @@ +# TODO this file is not used yet, but will be in future +include(ExternalProject) + +ExternalProject_Add(miniupnpc + URL http://miniupnp.tuxfamily.org/files/download.php?file=miniupnpc-1.9.20141027.tar.gz + BINARY_DIR miniupnpc-prefix/src/miniupnpc + CONFIGURE_COMMAND "" + BUILD_COMMAND make -j 3 + INSTALL_COMMAND make install INSTALLPREFIX=${ETH_DEPENDENCY_INSTALL_DIR} +) + diff --git a/extdep/scripts/json-rpc-cpp_osx.sh b/extdep/scripts/json-rpc-cpp_osx.sh new file mode 100755 index 000000000..8a6b96c7b --- /dev/null +++ b/extdep/scripts/json-rpc-cpp_osx.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +ETH_DEPENDENCY_SOURCE_DIR=$1 +ETH_DEPENDENCY_INSTALL_DIR=$2 + +OLD_COMMON_DYLIB="libjsonrpccpp-common.0.dylib" + +COMMON_DYLIB=${ETH_DEPENDENCY_INSTALL_DIR}/lib/libjsonrpccpp-common.0.dylib +SERVER_DYLIB=${ETH_DEPENDENCY_INSTALL_DIR}/lib/libjsonrpccpp-server.0.dylib +CLIENT_DYLIB=${ETH_DEPENDENCY_INSTALL_DIR}/lib/libjsonrpccpp-client.0.dylib + +# fix bin +STAB_EXEC=${ETH_DEPENDENCY_INSTALL_DIR}/bin/jsonrpcstub +install_name_tool -change ${OLD_COMMON_DYLIB} ${COMMON_DYLIB} ${STAB_EXEC} + +# fix common +install_name_tool -id ${COMMON_DYLIB} ${COMMON_DYLIB} + +# fix server +install_name_tool -id ${SERVER_DYLIB} ${SERVER_DYLIB} +install_name_tool -change ${OLD_COMMON_DYLIB} ${COMMON_DYLIB} ${SERVER_DYLIB} + +# fix client +install_name_tool -id ${CLIENT_DYLIB} ${CLIENT_DYLIB} +install_name_tool -change ${OLD_COMMON_DYLIB} ${COMMON_DYLIB} ${CLIENT_DYLIB} + +# TODO fix argtable and jsoncpp once they are downloaded as dependencies + + diff --git a/extdep/scripts/leveldb_osx.sh b/extdep/scripts/leveldb_osx.sh new file mode 100755 index 000000000..06b4a2dbd --- /dev/null +++ b/extdep/scripts/leveldb_osx.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +ETH_DEPENDENCY_SOURCE_DIR=$1 +ETH_DEPENDENCY_INSTALL_DIR=$2 + +OLD_SNAPPY_DYLIB="/Users/marekkotewicz/ethereum/cpp-ethereum/extdep/install/darwin/lib/libsnappy.1.dylib" +SNAPPY_DYLIB=${ETH_DEPENDENCY_INSTALL_DIR}/lib/libsnappy.dylib +LEVELDB_DYLIB=${ETH_DEPENDENCY_INSTALL_DIR}/lib/libleveldb.dylib + +install_name_tool -id ${LEVELDB_DYLIB} ${LEVELDB_DYLIB} +install_name_tool -change ${OLD_SNAPPY_DYLIB} ${SNAPPY_DYLIB} ${LEVELDB_DYLIB} + diff --git a/extdep/scripts/snappy_osx.sh b/extdep/scripts/snappy_osx.sh new file mode 100755 index 000000000..01304fcf1 --- /dev/null +++ b/extdep/scripts/snappy_osx.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +ETH_DEPENDENCY_SOURCE_DIR=$1 +ETH_DEPENDENCY_INSTALL_DIR=$2 + +SNAPPY_DYLIB=${ETH_DEPENDENCY_INSTALL_DIR}/lib/libsnappy.dylib +install_name_tool -id ${SNAPPY_DYLIB} ${SNAPPY_DYLIB} + diff --git a/iethxi/CMakeLists.txt b/iethxi/CMakeLists.txt deleted file mode 100644 index fc8edf1dc..000000000 --- a/iethxi/CMakeLists.txt +++ /dev/null @@ -1,117 +0,0 @@ -cmake_policy(SET CMP0015 NEW) - -if ("${TARGET_PLATFORM}" STREQUAL "w64") - cmake_policy(SET CMP0020 NEW) -endif () - - -set(CMAKE_INCLUDE_CURRENT_DIR ON) -aux_source_directory(. SRC_LIST) - -include_directories(..) -link_directories(../libethcore) -link_directories(../libethereum) -link_directories(../libqethereum) - -# Find Qt5 for Apple and update src_list for windows -if (APPLE) - # homebrew defaults to qt4 and installs qt5 as 'keg-only' - # which places it into /usr/local/opt insteadof /usr/local. - - set(CMAKE_PREFIX_PATH /usr/local/opt/qt5) - include_directories(/usr/local/opt/qt5/include /usr/local/include) -elseif ("${TARGET_PLATFORM}" STREQUAL "w64") - set(SRC_LIST ${SRC_LIST} ../windows/qt_plugin_import.cpp) -elseif (UNIX) - set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ";$ENV{QTDIR}/lib/cmake") -endif () - - -find_package(Qt5Widgets REQUIRED) -find_package(Qt5Gui REQUIRED) -find_package(Qt5Quick REQUIRED) -find_package(Qt5Qml REQUIRED) -find_package(Qt5Network REQUIRED) -qt5_wrap_ui(ui_Main.h Main.ui) -qt5_add_resources(RESOURCE_ADDED Resources.qrc) - -# Set name of binary and add_executable() -if (APPLE) - set(EXECUTEABLE IEthXi) - set(CMAKE_INSTALL_PREFIX ./) - set(BIN_INSTALL_DIR ".") - set(DOC_INSTALL_DIR ".") - - set(PROJECT_VERSION "${ETH_VERSION}") - set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME} ${PROJECT_VERSION}") - set(MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_NAME} ${PROJECT_VERSION}") - set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME} ${PROJECT_VERSION}") - set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}") - set(MACOSX_BUNDLE_COPYRIGHT "${PROJECT_COPYRIGHT_YEAR} ${PROJECT_VENDOR}") - set(MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_DOMAIN_SECOND}.${PROJECT_DOMAIN_FIRST}") - set(MACOSX_BUNDLE_BUNDLE_NAME ${EXECUTEABLE}) - include(BundleUtilities) - - add_executable(${EXECUTEABLE} MACOSX_BUNDLE Main.ui ${RESOURCE_ADDED} ${SRC_LIST}) -else () - set(EXECUTEABLE iethxi) - add_executable(${EXECUTEABLE} Main.ui ${RESOURCE_ADDED} ${SRC_LIST}) -endif () - -qt5_use_modules(${EXECUTEABLE} Core Gui Widgets Network Quick Qml) -target_link_libraries(${EXECUTEABLE} qethereum ethereum secp256k1 ${CRYPTOPP_LS}) - -if (APPLE) - if (${ADDFRAMEWORKS}) - set_target_properties(${EXECUTEABLE} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/EthereumMacOSXBundleInfo.plist.in") - endif () - - SET_SOURCE_FILES_PROPERTIES(${EXECUTEABLE} PROPERTIES MACOSX_PACKAGE_LOCATION MacOS) - - # This is a workaround for when the build-type defaults to Debug, and when a multi-config generator like xcode is used, where the type - # will not be set but defaults to release. - set(generator_lowercase "${CMAKE_GENERATOR}") - string(TOLOWER "${CMAKE_GENERATOR}" generator_lowercase) - if ("${generator_lowercase}" STREQUAL "xcode") - # TODO: Not sure how to resolve this. Possibly \${TARGET_BUILD_DIR} - set(binary_build_dir "${CMAKE_CURRENT_BINARY_DIR}/Debug") - else () - set(binary_build_dir "${CMAKE_CURRENT_BINARY_DIR}") - endif () - - set(APPS ${binary_build_dir}/${EXECUTEABLE}.app) - - # This tool and the next will automatically looked at the linked libraries in order to determine what dependencies are required. Thus, target_link_libaries only needs to add ethereum and secp256k1 (above) - install(CODE " - include(BundleUtilities) - set(BU_CHMOD_BUNDLE_ITEMS 1) - fixup_bundle(\"${APPS}\" \"${BUNDLELIBS}\" \"../libqethereum ../libethereum ../secp256k1\") - " COMPONENT RUNTIME ) - - if (${ADDFRAMEWORKS}) - add_custom_target(addframeworks ALL - COMMAND /usr/local/opt/qt5/bin/macdeployqt ${binary_build_dir}/${EXECUTEABLE}.app - WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - DEPENDS ${PROJECT_NAME} - ) - endif () - -elseif ("${TARGET_PLATFORM}" STREQUAL "w64") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-keep-inline-dllexport -static-libgcc -static-libstdc++ -static") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-s -Wl,-subsystem,windows -mthreads -L/usr/x86_64-w64-mingw32/plugins/platforms") - target_link_libraries(${EXECUTEABLE} gcc) - target_link_libraries(${EXECUTEABLE} mingw32 qtmain mswsock iphlpapi qwindows shlwapi Qt5PlatformSupport gdi32 comdlg32 oleaut32 imm32 winmm ole32 uuid ws2_32) - target_link_libraries(${EXECUTEABLE} boost_system-mt-s) - target_link_libraries(${EXECUTEABLE} boost_filesystem-mt-s) - target_link_libraries(${EXECUTEABLE} boost_thread_win32-mt-s) - target_link_libraries(${EXECUTEABLE} Qt5PlatformSupport) - set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) -elseif (UNIX) -else () - target_link_libraries(${EXECUTEABLE} boost_system) - target_link_libraries(${EXECUTEABLE} boost_filesystem) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTEABLE} ${CMAKE_THREAD_LIBS_INIT}) - install( TARGETS ${EXECUTEABLE} RUNTIME DESTINATION bin ) -endif () - diff --git a/iethxi/EthereumMacOSXBundleInfo.plist.in b/iethxi/EthereumMacOSXBundleInfo.plist.in deleted file mode 100644 index 684ad7908..000000000 --- a/iethxi/EthereumMacOSXBundleInfo.plist.in +++ /dev/null @@ -1,38 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${MACOSX_BUNDLE_EXECUTABLE_NAME} - CFBundleGetInfoString - ${MACOSX_BUNDLE_INFO_STRING} - CFBundleIconFile - ${MACOSX_BUNDLE_ICON_FILE} - CFBundleIdentifier - ${MACOSX_BUNDLE_GUI_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleLongVersionString - ${MACOSX_BUNDLE_LONG_VERSION_STRING} - CFBundleName - ${MACOSX_BUNDLE_BUNDLE_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - ${MACOSX_BUNDLE_SHORT_VERSION_STRING} - CFBundleSignature - ???? - CFBundleVersion - ${MACOSX_BUNDLE_BUNDLE_VERSION} - CSResourcesFileMapped - - LSRequiresCarbon - - NSHumanReadableCopyright - ${MACOSX_BUNDLE_COPYRIGHT} - NSHighResolutionCapable - - - diff --git a/iethxi/Main.ui b/iethxi/Main.ui deleted file mode 100644 index fe289ba9f..000000000 --- a/iethxi/Main.ui +++ /dev/null @@ -1,168 +0,0 @@ - - - Main - - - - 0 - 0 - 562 - 488 - - - - Walleth - - - true - - - QMainWindow::AllowNestedDocks|QMainWindow::AllowTabbedDocks|QMainWindow::VerticalTabs - - - true - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 0 wei - - - - - - - 0 peers - - - - - - - 1 block - - - - - - - - - - - 0 - 0 - 562 - 25 - - - - - &File - - - - - - &Network - - - - - - - - T&ools - - - - - - - - &Help - - - - - - - - - - - - &Quit - - - - - true - - - true - - - Use &UPnP - - - - - &Connect to Peer... - - - - - true - - - Enable &Network - - - - - true - - - &Mine - - - - - &New Address - - - - - &About... - - - - - true - - - &Preview - - - - - - - diff --git a/iethxi/MainWin.cpp b/iethxi/MainWin.cpp deleted file mode 100644 index 2d5b57094..000000000 --- a/iethxi/MainWin.cpp +++ /dev/null @@ -1,59 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "BuildInfo.h" -#include "MainWin.h" -#include "ui_Main.h" -using namespace std; -using namespace eth; - -Main::Main(QWidget *parent) : - QObject(parent) -{ -/* qRegisterMetaType("eth::u256"); - qRegisterMetaType("eth::KeyPair"); - qRegisterMetaType("eth::Secret"); - qRegisterMetaType("eth::Address"); - qRegisterMetaType("QmlAccount*"); - qRegisterMetaType("QmlEthereum*"); - - qmlRegisterType("org.ethereum", 1, 0, "Ethereum"); - qmlRegisterType("org.ethereum", 1, 0, "Account"); - qmlRegisterSingletonType("org.ethereum", 1, 0, "Balance", QmlEthereum::constructU256Helper); - qmlRegisterSingletonType("org.ethereum", 1, 0, "Key", QmlEthereum::constructKeyHelper); -*/ - /* - ui->librariesView->setModel(m_libraryMan); - ui->graphsView->setModel(m_graphMan); - */ - - - - -// QQmlContext* context = m_view->rootContext(); -// context->setContextProperty("u256", new U256Helper(this)); -} - -Main::~Main() -{ -} - -// extra bits needed to link on VS -#ifdef _MSC_VER - -// include moc file, ofuscated to hide from automoc -#include\ -"moc_MainWin.cpp" - -#endif diff --git a/iethxi/MainWin.h b/iethxi/MainWin.h deleted file mode 100644 index acbea8ca8..000000000 --- a/iethxi/MainWin.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef MAIN_H -#define MAIN_H - -#include - -class Main: public QObject -{ - Q_OBJECT - -public: - explicit Main(QWidget *parent = 0); - ~Main(); - -private: - QQmlApplicationEngine* m_view; -}; - -#endif // MAIN_H diff --git a/iethxi/Resources.qrc b/iethxi/Resources.qrc deleted file mode 100644 index 1789216ed..000000000 --- a/iethxi/Resources.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - Simple.qml - - diff --git a/iethxi/Simple.qml b/iethxi/Simple.qml deleted file mode 100644 index ac9dc5e37..000000000 --- a/iethxi/Simple.qml +++ /dev/null @@ -1,9 +0,0 @@ -import QtQuick.Controls 1.1 - -ApplicationWindow { - title: "My App" - Button { - text: "Push Me" - anchors.centerIn: parent - } -} diff --git a/iethxi/main.cpp b/iethxi/main.cpp deleted file mode 100644 index 569b6d17c..000000000 --- a/iethxi/main.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include -#include - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - QQmlApplicationEngine app(QUrl("qrc:/Simple.qml")); - return a.exec(); -} diff --git a/libdevcore/All.h b/libdevcore/All.h deleted file mode 100644 index eac152d42..000000000 --- a/libdevcore/All.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#include "Common.h" -#include "CommonData.h" -#include "CommonIO.h" -#include "FixedHash.h" -#include "Log.h" -#include "RLP.h" diff --git a/libdevcore/CMakeLists.txt b/libdevcore/CMakeLists.txt index 7c54301c9..001c568b5 100644 --- a/libdevcore/CMakeLists.txt +++ b/libdevcore/CMakeLists.txt @@ -1,49 +1,42 @@ cmake_policy(SET CMP0015 NEW) - -if (CMAKE_MAJOR_VERSION GREATER 1 AND CMAKE_MINOR_VERSION GREATER 7 AND CMAKE_PATCH_VERSION GREATER 11) - cmake_policy(SET CMP0022 NEW) +# this policy was introduced in cmake 3.0 +# remove if, once 3.0 will be used on unix +if (${CMAKE_MAJOR_VERSION} GREATER 2) + # old policy do not use MACOSX_RPATH + cmake_policy(SET CMP0042 OLD) endif() +set(CMAKE_AUTOMOC OFF) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB") aux_source_directory(. SRC_LIST) +include_directories(${Boost_INCLUDE_DIRS}) +include_directories(..) + set(EXECUTABLE devcore) file(GLOB HEADERS "*.h") + if(ETH_STATIC) add_library(${EXECUTABLE} STATIC ${SRC_LIST} ${HEADERS}) else() add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) endif() -include_directories(..) +target_link_libraries(${EXECUTABLE} ${Boost_THREAD_LIBRARY_RELEASE}) +target_link_libraries(${EXECUTABLE} ${Boost_DATE_TIME_LIBRARY_RELEASE}) +target_link_libraries(${EXECUTABLE} ${Boost_SYSTEM_LIBRARY_RELEASE}) +target_link_libraries(${EXECUTABLE} ${Boost_CHRONO_LIBRARY_RELEASE}) -if("${TARGET_PLATFORM}" STREQUAL "w64") - include_directories(/usr/x86_64-w64-mingw32/include/cryptopp) - target_link_libraries(${EXECUTABLE} boost_system-mt-s) - target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) - target_link_libraries(${EXECUTABLE} iphlpapi) - target_link_libraries(${EXECUTABLE} ws2_32) - target_link_libraries(${EXECUTABLE} mswsock) - target_link_libraries(${EXECUTABLE} shlwapi) -elseif (APPLE) - # Latest mavericks boost libraries only come with -mt - target_link_libraries(${EXECUTABLE} boost_system-mt) - target_link_libraries(${EXECUTABLE} boost_filesystem-mt) - target_link_libraries(${EXECUTABLE} boost_thread-mt) +if (APPLE) find_package(Threads REQUIRED) target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) elseif (UNIX) - find_package(Boost 1.53 REQUIRED COMPONENTS thread system) - target_link_libraries(${EXECUTABLE} ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY}) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -else () - target_link_libraries(${EXECUTABLE} boost_thread) find_package(Threads REQUIRED) target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -endif () +endif() install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) diff --git a/libdevcore/CommonData.cpp b/libdevcore/CommonData.cpp index bd7841402..fc3910cfe 100644 --- a/libdevcore/CommonData.cpp +++ b/libdevcore/CommonData.cpp @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file Common.cpp +/** @file CommonData.cpp * @author Gav Wood * @date 2014 */ @@ -23,7 +23,8 @@ #include #include "Exceptions.h" -#include +#include "Log.h" + using namespace std; using namespace dev; @@ -88,13 +89,25 @@ bytes dev::fromHex(std::string const& _s) { ret.push_back(fromHex(_s[s++])); } - catch (...){ ret.push_back(0); cwarn << boost::current_exception_diagnostic_information(); } + catch (...) + { + ret.push_back(0); + // msvc does not support it +#ifndef BOOST_NO_EXCEPTIONS + cwarn << boost::current_exception_diagnostic_information(); +#endif + } for (unsigned i = s; i < _s.size(); i += 2) try { ret.push_back((byte)(fromHex(_s[i]) * 16 + fromHex(_s[i + 1]))); } - catch (...){ ret.push_back(0); cwarn << boost::current_exception_diagnostic_information(); } + catch (...){ + ret.push_back(0); +#ifndef BOOST_NO_EXCEPTIONS + cwarn << boost::current_exception_diagnostic_information(); +#endif + } return ret; } diff --git a/libdevcore/CommonData.h b/libdevcore/CommonData.h index 5f14f38f8..87d2f5e28 100644 --- a/libdevcore/CommonData.h +++ b/libdevcore/CommonData.h @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file Common.h +/** @file CommonData.h * @author Gav Wood * @date 2014 * diff --git a/libdevcore/RLP.h b/libdevcore/RLP.h index 3101f63d6..2eedbaba2 100644 --- a/libdevcore/RLP.h +++ b/libdevcore/RLP.h @@ -28,10 +28,10 @@ #include #include #include -#include -#include -#include -#include +#include "vector_ref.h" +#include "Common.h" +#include "Exceptions.h" +#include "FixedHash.h" namespace dev { diff --git a/libdevcore/RangeMask.h b/libdevcore/RangeMask.h index ac58ec8b1..19262515c 100644 --- a/libdevcore/RangeMask.h +++ b/libdevcore/RangeMask.h @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file EthereumHost.h +/** @file RangeMask.h * @author Gav Wood * @date 2014 */ diff --git a/libdevcore/_libdevcore.cpp b/libdevcore/_libdevcore.cpp deleted file mode 100644 index 0605791de..000000000 --- a/libdevcore/_libdevcore.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#ifdef _MSC_VER -#include "All.h" -#include "Common.cpp" -#include "CommonData.cpp" -#include "CommonIO.cpp" -#include "CommonJS.h" -#include "FixedHash.cpp" -#include "Guards.cpp" -#include "Log.cpp" -#include "RangeMask.cpp" -#include "RLP.cpp" -#include "Worker.cpp" -#endif diff --git a/libdevcore/vector_ref.h b/libdevcore/vector_ref.h index be2fea13c..db46d62f6 100644 --- a/libdevcore/vector_ref.h +++ b/libdevcore/vector_ref.h @@ -40,6 +40,7 @@ public: vector_ref<_T> cropped(size_t _begin, size_t _count = ~size_t(0)) const { if (m_data && _begin + std::max(size_t(0), _count) <= m_count) return vector_ref<_T>(m_data + _begin, _count == ~size_t(0) ? m_count - _begin : _count); else return vector_ref<_T>(); } void retarget(_T const* _d, size_t _s) { m_data = _d; m_count = _s; } void retarget(std::vector<_T> const& _t) { m_data = _t.data(); m_count = _t.size(); } + void copyTo(vector_ref::type> _t) const { memcpy(_t.data(), m_data, std::min(_t.size(), m_count) * sizeof(_T)); } _T* begin() { return m_data; } _T* end() { return m_data + m_count; } diff --git a/libdevcrypto/All.h b/libdevcrypto/All.h deleted file mode 100644 index 9070725e9..000000000 --- a/libdevcrypto/All.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#include "Common.h" -#include "AES.h" -#include "ECDHE.h" -#include "FileSystem.h" -#include "SHA3.h" -#include "TrieDB.h" diff --git a/libdevcrypto/CMakeLists.txt b/libdevcrypto/CMakeLists.txt index cee7d130d..20eab916a 100644 --- a/libdevcrypto/CMakeLists.txt +++ b/libdevcrypto/CMakeLists.txt @@ -1,7 +1,19 @@ cmake_policy(SET CMP0015 NEW) +# this policy was introduced in cmake 3.0 +# remove if, once 3.0 will be used on unix +if (${CMAKE_MAJOR_VERSION} GREATER 2) + # old policy do not use MACOSX_RPATH + cmake_policy(SET CMP0042 OLD) +endif() +set(CMAKE_AUTOMOC OFF) aux_source_directory(. SRC_LIST) +include_directories(${Boost_INCLUDE_DIRS}) +include_directories(${CRYPTOPP_INCLUDE_DIRS}) +include_directories(${LEVELDB_INCLUDE_DIRS}) +include_directories(..) + set(EXECUTABLE devcrypto) file(GLOB HEADERS "*.h") @@ -11,43 +23,10 @@ else() add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) endif() -include_directories(..) - +target_link_libraries(${EXECUTABLE} ${Boost_FILESYSTEM_LIBRARY_RELEASE}) +target_link_libraries(${EXECUTABLE} ${LEVELDB_LIBRARIES}) +target_link_libraries(${EXECUTABLE} ${CRYPTOPP_LIBRARIES}) target_link_libraries(${EXECUTABLE} devcore) -target_link_libraries(${EXECUTABLE} secp256k1) -target_link_libraries(${EXECUTABLE} gmp) -target_link_libraries(${EXECUTABLE} ${LEVELDB_LS}) -target_link_libraries(${EXECUTABLE} ${CRYPTOPP_LS}) - -if("${TARGET_PLATFORM}" STREQUAL "w64") - target_link_libraries(${EXECUTABLE} boost_system-mt-s) - target_link_libraries(${EXECUTABLE} boost_filesystem-mt-s) - target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) - target_link_libraries(${EXECUTABLE} iphlpapi) - target_link_libraries(${EXECUTABLE} ws2_32) - target_link_libraries(${EXECUTABLE} mswsock) - target_link_libraries(${EXECUTABLE} shlwapi) -elseif (APPLE) - # Latest mavericks boost libraries only come with -mt - target_link_libraries(${EXECUTABLE} boost_system-mt) - target_link_libraries(${EXECUTABLE} boost_filesystem-mt) - target_link_libraries(${EXECUTABLE} boost_thread-mt) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -elseif (UNIX) - find_package(Boost 1.53 REQUIRED COMPONENTS filesystem) - target_link_libraries(${EXECUTABLE} ${Boost_SYSTEM_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_FILESYSTEM_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_THREAD_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_DATE_TIME_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -else () - target_link_libraries(${EXECUTABLE} boost_system) - target_link_libraries(${EXECUTABLE} boost_filesystem) - target_link_libraries(${EXECUTABLE} boost_thread) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -endif () install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) diff --git a/libdevcrypto/Common.h b/libdevcrypto/Common.h index 96631fcf9..02d52f495 100644 --- a/libdevcrypto/Common.h +++ b/libdevcrypto/Common.h @@ -45,6 +45,11 @@ using Signature = h520; struct SignatureStruct { + SignatureStruct() {} + SignatureStruct(Signature const& _s) { *(h520*)this = _s; } + SignatureStruct(h256 _r, h256 _s, byte _v): r(_r), s(_s), v(_v) {} + operator Signature() const { return *(h520 const*)this; } + /// @returns true if r,s,v values are valid, otherwise false bool isValid(); diff --git a/libdevcrypto/CryptoPP.h b/libdevcrypto/CryptoPP.h index 69189aaab..7ec95c552 100644 --- a/libdevcrypto/CryptoPP.h +++ b/libdevcrypto/CryptoPP.h @@ -34,19 +34,19 @@ #pragma GCC diagnostic ignored "-Wunused-variable" #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor" #pragma GCC diagnostic ignored "-Wextra" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #pragma warning(pop) #pragma GCC diagnostic pop #include "SHA3.h" diff --git a/libdevcrypto/OverlayDB.cpp b/libdevcrypto/OverlayDB.cpp index 8ccae6606..9e110bb84 100644 --- a/libdevcrypto/OverlayDB.cpp +++ b/libdevcrypto/OverlayDB.cpp @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file TrieDB.cpp +/** @file OverlayDB.cpp * @author Gav Wood * @date 2014 */ diff --git a/libdevcrypto/OverlayDB.h b/libdevcrypto/OverlayDB.h index 777d1e7df..e9bd53343 100644 --- a/libdevcrypto/OverlayDB.h +++ b/libdevcrypto/OverlayDB.h @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file MemoryDB.h +/** @file OverlayDB.h * @author Gav Wood * @date 2014 */ diff --git a/libdevcrypto/SHA3.cpp b/libdevcrypto/SHA3.cpp index 1fc9be950..b7a47b745 100644 --- a/libdevcrypto/SHA3.cpp +++ b/libdevcrypto/SHA3.cpp @@ -30,7 +30,7 @@ namespace dev { h256 EmptySHA3 = sha3(bytesConstRef()); -h256 EmptyListSHA3 = sha3(RLPEmptyList); +h256 EmptyListSHA3 = sha3(rlpList()); std::string sha3(std::string const& _input, bool _hex) { diff --git a/libdevcrypto/SHA3.h b/libdevcrypto/SHA3.h index f27e378ba..66b8efe11 100644 --- a/libdevcrypto/SHA3.h +++ b/libdevcrypto/SHA3.h @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file FixedHash.h +/** @file SHA3.h * @author Gav Wood * @date 2014 * diff --git a/libdevcrypto/TrieDB.cpp b/libdevcrypto/TrieDB.cpp index 674f21aa4..6f476c14b 100644 --- a/libdevcrypto/TrieDB.cpp +++ b/libdevcrypto/TrieDB.cpp @@ -24,9 +24,5 @@ using namespace std; using namespace dev; -#if !ETH_LANGUAGES - h256 const dev::c_shaNull = sha3(rlp("")); h256 const dev::EmptyTrie = c_shaNull; - -#endif diff --git a/libethcore/All.h b/libethcore/All.h deleted file mode 100644 index cb1d3f5a3..000000000 --- a/libethcore/All.h +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -#include "BlockInfo.h" -#include "CommonEth.h" -#include "ProofOfWork.h" -#include "Exceptions.h" - diff --git a/libethcore/BlockInfo.cpp b/libethcore/BlockInfo.cpp index fbf056867..6c08bb346 100644 --- a/libethcore/BlockInfo.cpp +++ b/libethcore/BlockInfo.cpp @@ -19,8 +19,6 @@ * @date 2014 */ -#if !ETH_LANGUAGES - #include #include #include @@ -42,6 +40,25 @@ BlockInfo::BlockInfo(bytesConstRef _block, bool _checkNonce) populate(_block, _checkNonce); } +void BlockInfo::setEmpty() +{ + parentHash = h256(); + sha3Uncles = EmptyListSHA3; + coinbaseAddress = Address(); + stateRoot = EmptyTrie; + transactionsRoot = EmptyTrie; + receiptsRoot = EmptyTrie; + logBloom = LogBloom(); + difficulty = 0; + number = 0; + gasLimit = 0; + gasUsed = 0; + timestamp = 0; + extraData.clear(); + nonce = h256(); + hash = headerHash(WithNonce); +} + BlockInfo BlockInfo::fromHeader(bytesConstRef _block) { BlockInfo ret; @@ -197,5 +214,3 @@ void BlockInfo::verifyParent(BlockInfo const& _parent) const BOOST_THROW_EXCEPTION(InvalidNumber()); } } - -#endif diff --git a/libethcore/BlockInfo.h b/libethcore/BlockInfo.h index fc52880fa..99efc6a17 100644 --- a/libethcore/BlockInfo.h +++ b/libethcore/BlockInfo.h @@ -69,7 +69,7 @@ public: h256 stateRoot; h256 transactionsRoot; h256 receiptsRoot; - h512 logBloom; // TODO LogBloom - get include + LogBloom logBloom; u256 difficulty; u256 number; u256 gasLimit; @@ -108,6 +108,8 @@ public: } bool operator!=(BlockInfo const& _cmp) const { return !operator==(_cmp); } + void setEmpty(); + void populateFromHeader(RLP const& _header, bool _checkNonce = true); void populate(bytesConstRef _block, bool _checkNonce = true); void populate(bytes const& _block, bool _checkNonce = true) { populate(&_block, _checkNonce); } @@ -118,7 +120,7 @@ public: u256 calculateDifficulty(BlockInfo const& _parent) const; u256 calculateGasLimit(BlockInfo const& _parent) const; - /// No-nonce sha3 of the header only. + /// sha3 of the header only. h256 headerHash(IncludeNonce _n) const; void streamRLP(RLPStream& _s, IncludeNonce _n) const; }; diff --git a/libethcore/CMakeLists.txt b/libethcore/CMakeLists.txt index f5cf00b57..984aa3ce5 100644 --- a/libethcore/CMakeLists.txt +++ b/libethcore/CMakeLists.txt @@ -1,54 +1,29 @@ cmake_policy(SET CMP0015 NEW) +# this policy was introduced in cmake 3.0 +# remove if, once 3.0 will be used on unix +if (${CMAKE_MAJOR_VERSION} GREATER 2) + # old policy do not use MACOSX_RPATH + cmake_policy(SET CMP0042 OLD) +endif() +set(CMAKE_AUTOMOC OFF) aux_source_directory(. SRC_LIST) +include_directories(${Boost_INCLUDE_DIRS}) +include_directories(..) + set(EXECUTABLE ethcore) file(GLOB HEADERS "*.h") + if(ETH_STATIC) add_library(${EXECUTABLE} STATIC ${SRC_LIST} ${HEADERS}) else() add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) endif() -include_directories(..) - target_link_libraries(${EXECUTABLE} devcrypto) target_link_libraries(${EXECUTABLE} devcore) -target_link_libraries(${EXECUTABLE} secp256k1) -target_link_libraries(${EXECUTABLE} gmp) -target_link_libraries(${EXECUTABLE} ${LEVELDB_LS}) -target_link_libraries(${EXECUTABLE} ${CRYPTOPP_LS}) - -if("${TARGET_PLATFORM}" STREQUAL "w64") - target_link_libraries(${EXECUTABLE} boost_system-mt-s) - target_link_libraries(${EXECUTABLE} boost_filesystem-mt-s) - target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) - target_link_libraries(${EXECUTABLE} iphlpapi) - target_link_libraries(${EXECUTABLE} ws2_32) - target_link_libraries(${EXECUTABLE} mswsock) - target_link_libraries(${EXECUTABLE} shlwapi) -elseif (APPLE) - # Latest mavericks boost libraries only come with -mt - target_link_libraries(${EXECUTABLE} boost_system-mt) - target_link_libraries(${EXECUTABLE} boost_filesystem-mt) - target_link_libraries(${EXECUTABLE} boost_thread-mt) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -elseif (UNIX) - find_package(Boost 1.53 REQUIRED COMPONENTS filesystem) - target_link_libraries(${EXECUTABLE} ${Boost_SYSTEM_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_FILESYSTEM_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_THREAD_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_DATE_TIME_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -else () - target_link_libraries(${EXECUTABLE} boost_system) - target_link_libraries(${EXECUTABLE} boost_filesystem) - target_link_libraries(${EXECUTABLE} boost_thread) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -endif () install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) diff --git a/libethcore/CommonEth.cpp b/libethcore/CommonEth.cpp index 36726dae4..5e510572e 100644 --- a/libethcore/CommonEth.cpp +++ b/libethcore/CommonEth.cpp @@ -21,7 +21,6 @@ #include "CommonEth.h" #include -#include #include #include "Exceptions.h" using namespace std; diff --git a/libethcore/CommonEth.h b/libethcore/CommonEth.h index 1965a881a..be7db8434 100644 --- a/libethcore/CommonEth.h +++ b/libethcore/CommonEth.h @@ -44,6 +44,9 @@ std::string formatBalance(u256 _b); /// Get information concerning the currency denominations. std::vector> const& units(); +/// The log bloom's size (512 bit). +using LogBloom = h512; + // The various denominations; here for ease of use where needed within code. static const u256 Uether = ((((u256(1000000000) * 1000000000) * 1000000000) * 1000000000) * 1000000000) * 1000000000; static const u256 Vether = ((((u256(1000000000) * 1000000000) * 1000000000) * 1000000000) * 1000000000) * 1000000; diff --git a/libethcore/ProofOfWork.cpp b/libethcore/ProofOfWork.cpp index bfb8942cc..181e379b5 100644 --- a/libethcore/ProofOfWork.cpp +++ b/libethcore/ProofOfWork.cpp @@ -19,8 +19,6 @@ * @date 2014 */ -#if !ETH_LANGUAGES - #include #include #include @@ -107,4 +105,3 @@ h256 DaggerEvaluator::eval(h256 const& _root, h256 const& _nonce) } } -#endif diff --git a/libethcore/_libethcore.cpp b/libethcore/_libethcore.cpp deleted file mode 100644 index 93eaf0d16..000000000 --- a/libethcore/_libethcore.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#ifdef _MSC_VER -#include "All.h" -#include "BlockInfo.cpp" -#include "CommonEth.cpp" -#include "ProofOfWork.cpp" -#include "Exceptions.cpp" -#endif diff --git a/libethereum/BlockDetails.h b/libethereum/BlockDetails.h index 2fd0d3048..bbfd48e56 100644 --- a/libethereum/BlockDetails.h +++ b/libethereum/BlockDetails.h @@ -28,7 +28,6 @@ #include #include -#include "Manifest.h" #include "TransactionReceipt.h" namespace ldb = leveldb; diff --git a/libethereum/CMakeLists.txt b/libethereum/CMakeLists.txt index cb2049886..792ed0cf1 100644 --- a/libethereum/CMakeLists.txt +++ b/libethereum/CMakeLists.txt @@ -1,19 +1,31 @@ cmake_policy(SET CMP0015 NEW) +# this policy was introduced in cmake 3.0 +# remove if, once 3.0 will be used on unix +if (${CMAKE_MAJOR_VERSION} GREATER 2) + # old policy do not use MACOSX_RPATH + cmake_policy(SET CMP0042 OLD) +endif() +set(CMAKE_AUTOMOC OFF) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB") aux_source_directory(. SRC_LIST) +include_directories(${LEVELDB_INCLUDE_DIRS}) +include_directories(..) + set(EXECUTABLE ethereum) file(GLOB HEADERS "*.h") -if(ETH_STATIC) + +if (ETH_STATIC) add_library(${EXECUTABLE} STATIC ${SRC_LIST} ${HEADERS}) else() add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) endif() -include_directories(..) +target_link_libraries(${EXECUTABLE} ${LEVELDB_LIBRARIES}) +target_link_libraries(${EXECUTABLE} ${Boost_REGEX_LIBRARY_RELEASE}) target_link_libraries(${EXECUTABLE} evm) target_link_libraries(${EXECUTABLE} lll) @@ -22,45 +34,6 @@ target_link_libraries(${EXECUTABLE} p2p) target_link_libraries(${EXECUTABLE} devcrypto) target_link_libraries(${EXECUTABLE} ethcore) target_link_libraries(${EXECUTABLE} secp256k1) -if(MINIUPNPC_LS) -target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS}) -endif() -target_link_libraries(${EXECUTABLE} ${LEVELDB_LS}) -target_link_libraries(${EXECUTABLE} ${CRYPTOPP_LS}) -target_link_libraries(${EXECUTABLE} gmp) - -if("${TARGET_PLATFORM}" STREQUAL "w64") - target_link_libraries(${EXECUTABLE} boost_system-mt-s) - target_link_libraries(${EXECUTABLE} boost_regex-mt-s) - target_link_libraries(${EXECUTABLE} boost_filesystem-mt-s) - target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) - target_link_libraries(${EXECUTABLE} iphlpapi) - target_link_libraries(${EXECUTABLE} ws2_32) - target_link_libraries(${EXECUTABLE} mswsock) - target_link_libraries(${EXECUTABLE} shlwapi) -elseif (APPLE) - # Latest mavericks boost libraries only come with -mt - target_link_libraries(${EXECUTABLE} boost_system-mt) - target_link_libraries(${EXECUTABLE} boost_regex-mt) - target_link_libraries(${EXECUTABLE} boost_filesystem-mt) - target_link_libraries(${EXECUTABLE} boost_thread-mt) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -elseif (UNIX) - target_link_libraries(${EXECUTABLE} ${Boost_SYSTEM_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_REGEX_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_FILESYSTEM_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_THREAD_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_DATE_TIME_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -else () - target_link_libraries(${EXECUTABLE} boost_system) - target_link_libraries(${EXECUTABLE} boost_regex) - target_link_libraries(${EXECUTABLE} boost_filesystem) - target_link_libraries(${EXECUTABLE} boost_thread) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -endif () install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) diff --git a/libethereum/CachedAddressState.cpp b/libethereum/CachedAddressState.cpp new file mode 100644 index 000000000..5f9be6944 --- /dev/null +++ b/libethereum/CachedAddressState.cpp @@ -0,0 +1,101 @@ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file CachedAddressState.cpp + * @author Gav Wood + * @date 2014 + */ + +#include "CachedAddressState.h" + +#include +#include +#include "Account.h" +using namespace std; +using namespace dev; +using namespace dev::eth; + +bool CachedAddressState::exists() const +{ + return (m_r && (!m_s || m_s->isAlive())) || (m_s && m_s->isAlive()); +} + +u256 CachedAddressState::balance() const +{ + return m_r ? m_s ? m_s->balance() : m_r[1].toInt() : 0; +} + +u256 CachedAddressState::nonce() const +{ + return m_r ? m_s ? m_s->nonce() : m_r[0].toInt() : 0; +} + +bytes CachedAddressState::code() const +{ + if (m_s && m_s->codeCacheValid()) + return m_s->code(); + h256 h = m_r ? m_s ? m_s->codeHash() : m_r[3].toHash() : EmptySHA3; + return h == EmptySHA3 ? bytes() : asBytes(m_o->lookup(h)); +} + +std::map CachedAddressState::storage() const +{ + std::map ret; + if (m_r) + { + TrieDB memdb(const_cast(m_o), m_r[2].toHash()); // promise we won't alter the overlay! :) + for (auto const& j: memdb) + ret[j.first] = RLP(j.second).toInt(); + } + if (m_s) + for (auto const& j: m_s->storageOverlay()) + if ((!ret.count(j.first) && j.second) || (ret.count(j.first) && ret.at(j.first) != j.second)) + ret[j.first] = j.second; + return ret; +} + +AccountDiff CachedAddressState::diff(CachedAddressState const& _c) +{ + AccountDiff ret; + ret.exist = Diff(exists(), _c.exists()); + ret.balance = Diff(balance(), _c.balance()); + ret.nonce = Diff(nonce(), _c.nonce()); + ret.code = Diff(code(), _c.code()); + auto st = storage(); + auto cst = _c.storage(); + auto it = st.begin(); + auto cit = cst.begin(); + while (it != st.end() || cit != cst.end()) + { + if (it != st.end() && cit != cst.end() && it->first == cit->first && (it->second || cit->second) && (it->second != cit->second)) + ret.storage[it->first] = Diff(it->second, cit->second); + else if (it != st.end() && (cit == cst.end() || it->first < cit->first) && it->second) + ret.storage[it->first] = Diff(it->second, 0); + else if (cit != cst.end() && (it == st.end() || it->first > cit->first) && cit->second) + ret.storage[cit->first] = Diff(0, cit->second); + if (it == st.end()) + ++cit; + else if (cit == cst.end()) + ++it; + else if (it->first < cit->first) + ++it; + else if (it->first > cit->first) + ++cit; + else + ++it, ++cit; + } + return ret; +} diff --git a/libethereum/CachedAddressState.h b/libethereum/CachedAddressState.h new file mode 100644 index 000000000..301f54338 --- /dev/null +++ b/libethereum/CachedAddressState.h @@ -0,0 +1,60 @@ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file CachedAddressState.h + * @author Gav Wood + * @date 2014 + */ + +#pragma once + +#include +#include +#include +#include "AccountDiff.h" + +namespace dev +{ + +class OverlayDB; + +namespace eth +{ + +class Account; + +class CachedAddressState +{ +public: + CachedAddressState(std::string const& _rlp, Account const* _s, OverlayDB const* _o): m_rS(_rlp), m_r(m_rS), m_s(_s), m_o(_o) {} + + bool exists() const; + u256 balance() const; + u256 nonce() const; + bytes code() const; + std::map storage() const; + AccountDiff diff(CachedAddressState const& _c); + +private: + std::string m_rS; + RLP m_r; + Account const* m_s; + OverlayDB const* m_o; +}; + +} + +} diff --git a/libethereum/Client.h b/libethereum/Client.h index 283251e24..e8c460093 100644 --- a/libethereum/Client.h +++ b/libethereum/Client.h @@ -36,8 +36,7 @@ #include "TransactionQueue.h" #include "State.h" #include "CommonNet.h" -#include "PastMessage.h" -#include "MessageFilter.h" +#include "LogFilter.h" #include "Miner.h" #include "Interface.h" @@ -79,8 +78,6 @@ static const int GenesisBlock = INT_MIN; struct InstalledFilter { -// InstalledFilter(MessageFilter const& _f): filter(_f) {} -// MessageFilter filter; InstalledFilter(LogFilter const& _f): filter(_f) {} LogFilter filter; diff --git a/libethereum/CommonNet.cpp b/libethereum/CommonNet.cpp index eb92f0b18..5a9d3d0c9 100644 --- a/libethereum/CommonNet.cpp +++ b/libethereum/CommonNet.cpp @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file PeerNetwork.cpp +/** @file CommonNet.cpp * @author Gav Wood * @date 2014 */ diff --git a/libethereum/CommonNet.h b/libethereum/CommonNet.h index 4192c861e..2ee260650 100644 --- a/libethereum/CommonNet.h +++ b/libethereum/CommonNet.h @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file PeerNetwork.h +/** @file CommonNet.h * @author Gav Wood * @date 2014 * diff --git a/libethereum/Executive.cpp b/libethereum/Executive.cpp index 007896d75..d16cf794c 100644 --- a/libethereum/Executive.cpp +++ b/libethereum/Executive.cpp @@ -19,14 +19,16 @@ * @date 2014 */ +#include "Executive.h" + #include #include #include #include #include "Interface.h" -#include "Executive.h" #include "State.h" #include "ExtVM.h" +#include "Precompiled.h" using namespace std; using namespace dev; using namespace dev::eth; @@ -38,15 +40,19 @@ u256 Executive::gasUsed() const return m_t.gas() - m_endGas; } +void Executive::accrueSubState(SubState& _parentContext) +{ + if (m_ext) + _parentContext += m_ext->sub; +} + bool Executive::setup(bytesConstRef _rlp) { // Entry point for a user-executed transaction. m_t = Transaction(_rlp); - m_sender = m_t.sender(); - // Avoid invalid transactions. - auto nonceReq = m_s.transactionsFrom(m_sender); + auto nonceReq = m_s.transactionsFrom(m_t.sender()); if (m_t.nonce() != nonceReq) { clog(StateDetail) << "Invalid Nonce: Require" << nonceReq << " Got" << m_t.nonce(); @@ -65,10 +71,10 @@ bool Executive::setup(bytesConstRef _rlp) u256 cost = m_t.value() + m_t.gas() * m_t.gasPrice(); // Avoid unaffordable transactions. - if (m_s.balance(m_sender) < cost) + if (m_s.balance(m_t.sender()) < cost) { - clog(StateDetail) << "Not enough cash: Require >" << cost << " Got" << m_s.balance(m_sender); - BOOST_THROW_EXCEPTION(NotEnoughCash() << RequirementError((bigint)cost, (bigint)m_s.balance(m_sender))); + clog(StateDetail) << "Not enough cash: Require >" << cost << " Got" << m_s.balance(m_t.sender()); + BOOST_THROW_EXCEPTION(NotEnoughCash() << RequirementError((bigint)cost, (bigint)m_s.balance(m_t.sender()))); } u256 startGasUsed = m_s.gasUsed(); @@ -79,41 +85,45 @@ bool Executive::setup(bytesConstRef _rlp) } // Increment associated nonce for sender. - m_s.noteSending(m_sender); + m_s.noteSending(m_t.sender()); // Pay... clog(StateDetail) << "Paying" << formatBalance(cost) << "from sender (includes" << m_t.gas() << "gas at" << formatBalance(m_t.gasPrice()) << ")"; - m_s.subBalance(m_sender, cost); + m_s.subBalance(m_t.sender(), cost); if (m_t.isCreation()) - return create(m_sender, m_t.value(), m_t.gasPrice(), m_t.gas() - (u256)gasCost, &m_t.data(), m_sender); + return create(m_t.sender(), m_t.value(), m_t.gasPrice(), m_t.gas() - (u256)gasCost, &m_t.data(), m_t.sender()); else - return call(m_t.receiveAddress(), m_sender, m_t.value(), m_t.gasPrice(), bytesConstRef(&m_t.data()), m_t.gas() - (u256)gasCost, m_sender); + return call(m_t.receiveAddress(), m_t.receiveAddress(), m_t.sender(), m_t.value(), m_t.gasPrice(), bytesConstRef(&m_t.data()), m_t.gas() - (u256)gasCost, m_t.sender()); } -bool Executive::call(Address _receiveAddress, Address _senderAddress, u256 _value, u256 _gasPrice, bytesConstRef _data, u256 _gas, Address _originAddress) +bool Executive::call(Address _receiveAddress, Address _codeAddress, Address _senderAddress, u256 _value, u256 _gasPrice, bytesConstRef _data, u256 _gas, Address _originAddress) { + m_isCreation = false; // cnote << "Transferring" << formatBalance(_value) << "to receiver."; m_s.addBalance(_receiveAddress, _value); - auto it = !(_receiveAddress & ~h160(0xffffffff)) ? State::precompiled().find((unsigned)(u160)_receiveAddress) : State::precompiled().end(); - if (it != State::precompiled().end()) + auto it = !(_codeAddress & ~h160(0xffffffff)) ? precompiled().find((unsigned)(u160)_codeAddress) : precompiled().end(); + if (it != precompiled().end()) { bigint g = it->second.gas(_data); if (_gas < g) { m_endGas = 0; - return false; + m_excepted = true; + } + else + { + m_endGas = (u256)(_gas - g); + m_precompiledOut = it->second.exec(_data); + m_out = &m_precompiledOut; } - m_endGas = (u256)(_gas - g); - it->second.exec(_data, bytesRef()); - return true; } - else if (m_s.addressHasCode(_receiveAddress)) + else if (m_s.addressHasCode(_codeAddress)) { m_vm = VMFactory::create(_gas); - bytes const& c = m_s.code(_receiveAddress); - m_ext.reset(new ExtVM(m_s, _receiveAddress, _senderAddress, _originAddress, _value, _gasPrice, _data, &c)); + bytes const& c = m_s.code(_codeAddress); + m_ext = make_shared(m_s, _receiveAddress, _senderAddress, _originAddress, _value, _gasPrice, _data, &c, m_depth); } else m_endGas = _gas; @@ -122,6 +132,8 @@ bool Executive::call(Address _receiveAddress, Address _senderAddress, u256 _valu bool Executive::create(Address _sender, u256 _endowment, u256 _gasPrice, u256 _gas, bytesConstRef _init, Address _origin) { + m_isCreation = true; + // We can allow for the reverted state (i.e. that with which m_ext is constructed) to contain the m_newAddress, since // we delete it explicitly if we decide we need to revert. m_newAddress = right160(sha3(rlpList(_sender, m_s.transactionsFrom(_sender) - 1))); @@ -131,7 +143,7 @@ bool Executive::create(Address _sender, u256 _endowment, u256 _gasPrice, u256 _g // Execute _init. m_vm = VMFactory::create(_gas); - m_ext.reset(new ExtVM(m_s, m_newAddress, _sender, _origin, _endowment, _gasPrice, bytesConstRef(), _init)); + m_ext = make_shared(m_s, m_newAddress, _sender, _origin, _endowment, _gasPrice, bytesConstRef(), _init, m_depth); return _init.empty(); } @@ -159,18 +171,22 @@ bool Executive::go(OnOpFunc const& _onOp) { if (m_vm) { +#if ETH_TIMED_EXECUTIONS boost::timer t; - auto sgas = m_vm->gas(); +#endif try { m_out = m_vm->go(*m_ext, _onOp); m_endGas = m_vm->gas(); - m_endGas += min((m_t.gas() - m_endGas) / 2, m_ext->sub.refunds); - m_logs = m_ext->sub.logs; - if (m_out.size() * c_createDataGas <= m_endGas) - m_endGas -= m_out.size() * c_createDataGas; - else - m_out.reset(); + + if (m_isCreation) + { + if (m_out.size() * c_createDataGas <= m_endGas) + m_endGas -= m_out.size() * c_createDataGas; + else + m_out.reset(); + m_s.m_cache[m_newAddress].setCode(m_out); + } } catch (StepsDone const&) { @@ -178,18 +194,10 @@ bool Executive::go(OnOpFunc const& _onOp) } catch (VMException const& _e) { - clog(StateChat) << "Safe VM Exception: " << diagnostic_information(_e); - m_endGas = 0;//m_vm->gas(); - - // Write state out only in the case of a non-excepted transaction. + clog(StateSafeExceptions) << "Safe VM Exception. " << diagnostic_information(_e); + m_endGas = 0; + m_excepted = true; m_ext->revert(); - - // Explicitly delete a newly created address - this will still be in the reverted state. -/* if (m_newAddress) - { - m_s.m_cache.erase(m_newAddress); - m_newAddress = Address(); - }*/ } catch (Exception const& _e) { @@ -201,33 +209,32 @@ bool Executive::go(OnOpFunc const& _onOp) // TODO: AUDIT: check that this can never reasonably happen. Consider what to do if it does. cwarn << "Unexpected std::exception in VM. This is probably unrecoverable. " << _e.what(); } +#if ETH_TIMED_EXECUTIONS cnote << "VM took:" << t.elapsed() << "; gas used: " << (sgas - m_endGas); +#endif } return true; } -u256 Executive::gas() const -{ - return m_vm ? m_vm->gas() : m_endGas; -} - void Executive::finalize(OnOpFunc const&) { - if (m_t.isCreation() && !m_ext->sub.suicides.count(m_newAddress)) - { - // creation - put code in place. - m_s.m_cache[m_newAddress].setCode(m_out); - } + // SSTORE refunds... + // must be done before the miner gets the fees. + if (m_ext) + m_endGas += min((m_t.gas() - m_endGas) / 2, m_ext->sub.refunds); -// cnote << "Refunding" << formatBalance(m_endGas * m_ext->gasPrice) << "to origin (=" << m_endGas << "*" << formatBalance(m_ext->gasPrice) << ")"; - m_s.addBalance(m_sender, m_endGas * m_t.gasPrice()); + // cnote << "Refunding" << formatBalance(m_endGas * m_ext->gasPrice) << "to origin (=" << m_endGas << "*" << formatBalance(m_ext->gasPrice) << ")"; + m_s.addBalance(m_t.sender(), m_endGas * m_t.gasPrice()); u256 feesEarned = (m_t.gas() - m_endGas) * m_t.gasPrice(); -// cnote << "Transferring" << formatBalance(gasSpent) << "to miner."; m_s.addBalance(m_s.m_currentBlock.coinbaseAddress, feesEarned); // Suicides... if (m_ext) for (auto a: m_ext->sub.suicides) m_s.m_cache[a].kill(); + + // Logs.. + if (m_ext) + m_logs = m_ext->sub.logs; } diff --git a/libethereum/Executive.h b/libethereum/Executive.h index 9e47bbfbf..729014bef 100644 --- a/libethereum/Executive.h +++ b/libethereum/Executive.h @@ -27,7 +27,6 @@ #include #include #include "Transaction.h" -#include "ExtVM.h" namespace dev { @@ -35,51 +34,87 @@ namespace eth { class State; +class ExtVM; struct Manifest; struct VMTraceChannel: public LogChannel { static const char* name() { return "EVM"; } static const int verbosity = 11; }; +/** + * @brief Message-call/contract-creation executor; useful for executing transactions. + * + * Two ways of using this class - either as a transaction executive or a CALL/CREATE executive. + * In the first use, after construction, begin with setup() and end with finalize(). Call go() + * after setup() only if it returns false. + * In the second use, after construction, begin with call() or create() and end with + * accrueSubState(). Call go() after call()/create() only if it returns false. + */ class Executive { public: - Executive(State& _s): m_s(_s) {} + /// Basic constructor. + Executive(State& _s, unsigned _level): m_s(_s), m_depth(_level) {} + /// Basic destructor. ~Executive() = default; + Executive(Executive const&) = delete; void operator=(Executive) = delete; + /// Set up the executive for evaluating a transaction. You must call finalize() following this. + /// @returns true iff go() must be called (and thus a VM execution in required). bool setup(bytesConstRef _transaction); - bool create(Address _txSender, u256 _endowment, u256 _gasPrice, u256 _gas, bytesConstRef _code, Address _originAddress); - bool call(Address _myAddress, Address _txSender, u256 _txValue, u256 _gasPrice, bytesConstRef _txData, u256 _gas, Address _originAddress); - bool go(OnOpFunc const& _onOp = OnOpFunc()); + /// Finalise a transaction previously set up with setup(). + /// @warning Only valid after setup(), and possibly go(). void finalize(OnOpFunc const& _onOp = OnOpFunc()); + /// @returns the transaction from setup(). + /// @warning Only valid after setup(). + Transaction const& t() const { return m_t; } + /// @returns the log entries created by this operation. + /// @warning Only valid after finalise(). + LogEntries const& logs() const { return m_logs; } + /// @returns total gas used in the transaction/operation. + /// @warning Only valid after finalise(). u256 gasUsed() const; - static OnOpFunc simpleTrace(); - - Transaction const& t() const { return m_t; } + /// Set up the executive for evaluating a bare CREATE (contract-creation) operation. + /// @returns false iff go() must be called (and thus a VM execution in required). + bool create(Address _txSender, u256 _endowment, u256 _gasPrice, u256 _gas, bytesConstRef _code, Address _originAddress); + /// Set up the executive for evaluating a bare CALL (message call) operation. + /// @returns false iff go() must be called (and thus a VM execution in required). + bool call(Address _myAddress, Address _codeAddress, Address _txSender, u256 _txValue, u256 _gasPrice, bytesConstRef _txData, u256 _gas, Address _originAddress); + /// Finalise an operation through accruing the substate into the parent context. + void accrueSubState(SubState& _parentContext); + + /// Executes (or continues execution of) the VM. + /// @returns false iff go() must be called again to finish the transction. + bool go(OnOpFunc const& _onOp = OnOpFunc()); - u256 gas() const; + /// Operation function for providing a simple trace of the VM execution. + static OnOpFunc simpleTrace(); + /// @returns gas remaining after the transaction/operation. + u256 endGas() const { return m_endGas; } + /// @returns output data of the transaction/operation. bytesConstRef out() const { return m_out; } + /// @returns the new address for the created contract in the CREATE operation. h160 newAddress() const { return m_newAddress; } - LogEntries const& logs() const { return m_logs; } - - VMFace const& vm() const { return *m_vm; } - State const& state() const { return m_s; } - ExtVM const& ext() const { return *m_ext; } + /// @returns true iff the operation ended with a VM exception. + bool excepted() const { return m_excepted; } private: - State& m_s; - std::unique_ptr m_ext; - std::unique_ptr m_vm; - bytesConstRef m_out; - Address m_newAddress; - - Transaction m_t; - Address m_sender; - u256 m_endGas; - - LogEntries m_logs; + State& m_s; ///< The state to which this operation/transaction is applied. + std::shared_ptr m_ext; ///< The VM externality object for the VM execution or null if no VM is required. + std::unique_ptr m_vm; ///< The VM object or null if no VM is required. + bytes m_precompiledOut; ///< Used for the output when there is no VM for a contract (i.e. precompiled). + bytesConstRef m_out; ///< The copyable output. + Address m_newAddress; ///< The address of the created contract in the case of create() being called. + + unsigned m_depth = 0; ///< The context's call-depth. + bool m_isCreation = false; ///< True if the transaction creates a contract, or if create() is called. + bool m_excepted = false; ///< True if the VM execution resulted in an exception. + u256 m_endGas; ///< The final amount of gas for the transaction. + + Transaction m_t; ///< The original transaction in the case that setup() was called. + LogEntries m_logs; ///< The log entries created by this transaction. Only valid }; } diff --git a/libethereum/ExtVM.cpp b/libethereum/ExtVM.cpp index 4c343c162..a005a030b 100644 --- a/libethereum/ExtVM.cpp +++ b/libethereum/ExtVM.cpp @@ -21,5 +21,37 @@ #include "ExtVM.h" -#pragma GCC diagnostic ignored "-Wunused-variable" -namespace { char dummy; }; +#include "Executive.h" +using namespace std; +using namespace dev; +using namespace dev::eth; + +bool ExtVM::call(Address _receiveAddress, u256 _txValue, bytesConstRef _txData, u256& io_gas, bytesRef _out, OnOpFunc const& _onOp, Address _myAddressOverride, Address _codeAddressOverride) +{ + Executive e(m_s, depth + 1); + if (!e.call(_receiveAddress, _codeAddressOverride ? _codeAddressOverride : _receiveAddress, _myAddressOverride ? _myAddressOverride : myAddress, _txValue, gasPrice, _txData, io_gas, origin)) + { + e.go(_onOp); + e.accrueSubState(sub); + } + io_gas = e.endGas(); + e.out().copyTo(_out); + + return !e.excepted(); +} + +h160 ExtVM::create(u256 _endowment, u256& io_gas, bytesConstRef _code, OnOpFunc const& _onOp) +{ + // Increment associated nonce for sender. + m_s.noteSending(myAddress); + + Executive e(m_s, depth + 1); + if (!e.create(myAddress, _endowment, gasPrice, io_gas, _code, origin)) + { + e.go(_onOp); + e.accrueSubState(sub); + } + io_gas = e.endGas(); + return e.newAddress(); +} + diff --git a/libethereum/ExtVM.h b/libethereum/ExtVM.h index ad1045d3f..cfe40874f 100644 --- a/libethereum/ExtVM.h +++ b/libethereum/ExtVM.h @@ -55,18 +55,10 @@ public: virtual bytes const& codeAt(Address _a) override final { return m_s.code(_a); } /// Create a new contract. - virtual h160 create(u256 _endowment, u256* _gas, bytesConstRef _code, OnOpFunc const& _onOp = OnOpFunc()) override final - { - // Increment associated nonce for sender. - m_s.noteSending(myAddress); - return m_s.create(myAddress, _endowment, gasPrice, _gas, _code, origin, &sub, _onOp, depth + 1); - } + virtual h160 create(u256 _endowment, u256& io_gas, bytesConstRef _code, OnOpFunc const& _onOp = {}) override final; /// Create a new message call. Leave _myAddressOverride as the default to use the present address as caller. - virtual bool call(Address _receiveAddress, u256 _txValue, bytesConstRef _txData, u256* _gas, bytesRef _out, OnOpFunc const& _onOp = {}, Address _myAddressOverride = {}, Address _codeAddressOverride = {}) override final - { - return m_s.call(_receiveAddress, _codeAddressOverride ? _codeAddressOverride : _receiveAddress, _myAddressOverride ? _myAddressOverride : myAddress, _txValue, gasPrice, _txData, _gas, _out, origin, &sub, _onOp, depth + 1); - } + virtual bool call(Address _receiveAddress, u256 _txValue, bytesConstRef _txData, u256& io_gas, bytesRef _out, OnOpFunc const& _onOp = {}, Address _myAddressOverride = {}, Address _codeAddressOverride = {}) override final; /// Read address's balance. virtual u256 balance(Address _a) override final { return m_s.balance(_a); } @@ -81,12 +73,13 @@ public: virtual void suicide(Address _a) override final { m_s.addBalance(_a, m_s.balance(myAddress)); + m_s.subBalance(myAddress, m_s.balance(myAddress)); ExtVMFace::suicide(_a); } /// Revert any changes made (by any of the other calls). /// @TODO check call site for the parent manifest being discarded. - virtual void revert() override final { m_s.m_cache = m_origCache; } + virtual void revert() override final { m_s.m_cache = m_origCache; sub.clear(); } State& state() const { return m_s; } diff --git a/libethereum/Interface.h b/libethereum/Interface.h index d598e1f9b..28ac26819 100644 --- a/libethereum/Interface.h +++ b/libethereum/Interface.h @@ -26,7 +26,7 @@ #include #include #include -#include "MessageFilter.h" +#include "LogFilter.h" #include "Transaction.h" #include "AccountDiff.h" #include "BlockDetails.h" @@ -84,11 +84,6 @@ public: virtual bytes codeAt(Address _a, int _block) const = 0; virtual std::map storageAt(Address _a, int _block) const = 0; -// // [MESSAGE API] -// -// virtual PastMessages messages(unsigned _watchId) const = 0; -// virtual PastMessages messages(MessageFilter const& _filter) const = 0; - // [LOGS API] virtual LogEntries logs(unsigned _watchId) const = 0; diff --git a/libethereum/MessageFilter.cpp b/libethereum/LogFilter.cpp similarity index 97% rename from libethereum/MessageFilter.cpp rename to libethereum/LogFilter.cpp index f44587620..81cb439ba 100644 --- a/libethereum/MessageFilter.cpp +++ b/libethereum/LogFilter.cpp @@ -14,12 +14,12 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file MessageFilter.cpp +/** @file LogFilter.cpp * @author Gav Wood * @date 2014 */ -#include "MessageFilter.h" +#include "LogFilter.h" #include #include "State.h" diff --git a/libethereum/MessageFilter.h b/libethereum/LogFilter.h similarity index 98% rename from libethereum/MessageFilter.h rename to libethereum/LogFilter.h index e2c26d214..bda8e46a2 100644 --- a/libethereum/MessageFilter.h +++ b/libethereum/LogFilter.h @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file MessageFilter.h +/** @file LogFilter.h * @author Gav Wood * @date 2014 */ diff --git a/libethereum/Manifest.cpp b/libethereum/Manifest.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/libethereum/Manifest.h b/libethereum/Manifest.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/libethereum/PastMessage.cpp b/libethereum/PastMessage.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/libethereum/PastMessage.h b/libethereum/PastMessage.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/libethereum/Precompiled.cpp b/libethereum/Precompiled.cpp new file mode 100644 index 000000000..1861385da --- /dev/null +++ b/libethereum/Precompiled.cpp @@ -0,0 +1,88 @@ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file Precompiled.cpp + * @author Gav Wood + * @date 2014 + */ + +#include "Precompiled.h" + +#include +#include +#include +using namespace std; +using namespace dev; +using namespace dev::eth; + +static bytes ecrecoverCode(bytesConstRef _in) +{ + struct inType + { + h256 hash; + h256 v; + h256 r; + h256 s; + } in; + + memcpy(&in, _in.data(), min(_in.size(), sizeof(in))); + + h256 ret; + + if ((u256)in.v > 28) + return ret.asBytes(); + SignatureStruct sig(in.r, in.s, (byte)((int)(u256)in.v - 27)); + if (!sig.isValid()) + return ret.asBytes(); + + try + { + ret = dev::sha3(recover(sig, in.hash)); + } + catch (...) {} + + memset(ret.data(), 0, 12); + return ret.asBytes(); +} + +static bytes sha256Code(bytesConstRef _in) +{ + bytes ret(32); + sha256(_in, &ret); + return ret; +} + +static bytes ripemd160Code(bytesConstRef _in) +{ + bytes ret(32); + ripemd160(_in, &ret); + // leaves the 20-byte hash left-aligned. we want it right-aligned: + memmove(ret.data() + 12, ret.data(), 20); + memset(ret.data(), 0, 12); + return ret; +} + +static const std::map c_precompiled = +{ + { 1, { [](bytesConstRef) -> bigint { return (bigint)500; }, ecrecoverCode }}, + { 2, { [](bytesConstRef i) -> bigint { return (bigint)50 + (i.size() + 31) / 32 * 50; }, sha256Code }}, + { 3, { [](bytesConstRef i) -> bigint { return (bigint)50 + (i.size() + 31) / 32 * 50; }, ripemd160Code }} +}; + +std::map const& dev::eth::precompiled() +{ + return c_precompiled; +} diff --git a/windows/stdafx.cpp b/libethereum/Precompiled.h similarity index 57% rename from windows/stdafx.cpp rename to libethereum/Precompiled.h index d3c5fc299..c65cd9a63 100644 --- a/windows/stdafx.cpp +++ b/libethereum/Precompiled.h @@ -14,8 +14,31 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file stdafx.cpp - * @author Tim Hughes +/** @file Precompiled.h + * @author Gav Wood * @date 2014 */ +#pragma once + +#include +#include +#include + +namespace dev +{ +namespace eth +{ + +/// Information structure regarding an account that is precompiled (i.e. 1, 2, 3). +struct PrecompiledAddress +{ + std::function gas; + std::function exec; +}; + +/// Info on precompiled contract accounts baked into the protocol. +std::map const& precompiled(); + +} +} diff --git a/libethereum/State.cpp b/libethereum/State.cpp index 1d6ad3480..fd00761e1 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -34,6 +34,7 @@ #include "Defaults.h" #include "ExtVM.h" #include "Executive.h" +#include "CachedAddressState.h" using namespace std; using namespace dev; using namespace dev::eth; @@ -42,59 +43,6 @@ using namespace dev::eth; static const u256 c_blockReward = 1500 * finney; -void ecrecoverCode(bytesConstRef _in, bytesRef _out) -{ - struct inType - { - h256 hash; - h256 v; - h256 r; - h256 s; - } in; - - memcpy(&in, _in.data(), min(_in.size(), sizeof(in))); - - memset(_out.data(), 0, _out.size()); - if ((u256)in.v > 28) - return; - SignatureStruct sig{in.r, in.s, (byte)((int)(u256)in.v - 27)}; - if (!sig.isValid()) - return; - - h256 ret; - byte pubkey[65]; - int pubkeylen = 65; - secp256k1_start(); - if (secp256k1_ecdsa_recover_compact(in.hash.data(), 32, in.r.data(), pubkey, &pubkeylen, 0, (int)(u256)in.v - 27)) - ret = dev::sha3(bytesConstRef(&(pubkey[1]), 64)); - - memset(ret.data(), 0, 12); - memcpy(_out.data(), &ret, min(_out.size(), sizeof(ret))); -} - -void sha256Code(bytesConstRef _in, bytesRef _out) -{ - h256 ret; - sha256(_in, bytesRef(ret.data(), 32)); - memcpy(_out.data(), &ret, min(_out.size(), sizeof(ret))); -} - -void ripemd160Code(bytesConstRef _in, bytesRef _out) -{ - h256 ret; - ripemd160(_in, bytesRef(ret.data(), 32)); - memset(_out.data(), 0, std::min(12, _out.size())); - if (_out.size() > 12) - memcpy(_out.data() + 12, &ret, min(_out.size() - 12, sizeof(ret))); -} - -const std::map State::c_precompiled = -{ - { 1, { [](bytesConstRef) -> bigint { return (bigint)500; }, ecrecoverCode }}, - { 2, { [](bytesConstRef i) -> bigint { return (bigint)50 + (i.size() + 31) / 32 * 50; }, sha256Code }}, - { 3, { [](bytesConstRef i) -> bigint { return (bigint)50 + (i.size() + 31) / 32 * 50; }, ripemd160Code }} -}; - OverlayDB State::openDB(std::string _path, bool _killExisting) { if (_path.empty()) @@ -115,7 +63,7 @@ OverlayDB State::openDB(std::string _path, bool _killExisting) return OverlayDB(db); } -State::State(Address _coinbaseAddress, OverlayDB const& _db): +State::State(Address _coinbaseAddress, OverlayDB const& _db, BaseState _bs): m_db(_db), m_state(&m_db), m_ourAddress(_coinbaseAddress), @@ -126,12 +74,19 @@ State::State(Address _coinbaseAddress, OverlayDB const& _db): paranoia("beginning of normal construction.", true); - dev::eth::commit(genesisState(), m_db, m_state); - m_db.commit(); + if (_bs == BaseState::Genesis) + { + dev::eth::commit(genesisState(), m_db, m_state); + m_db.commit(); - paranoia("after DB commit of normal construction.", true); + paranoia("after DB commit of normal construction.", true); + m_previousBlock = BlockChain::genesis(); + } + else + { + m_previousBlock.setEmpty(); + } - m_previousBlock = BlockChain::genesis(); resetCurrent(); assert(m_state.root() == m_previousBlock.stateRoot); @@ -226,89 +181,6 @@ Address State::nextActiveAddress(Address _a) const return (*it).first; } -// TODO: repot -struct CachedAddressState -{ - CachedAddressState(std::string const& _rlp, Account const* _s, OverlayDB const* _o): rS(_rlp), r(rS), s(_s), o(_o) {} - - bool exists() const - { - return (r && (!s || s->isAlive())) || (s && s->isAlive()); - } - - u256 balance() const - { - return r ? s ? s->balance() : r[1].toInt() : 0; - } - - u256 nonce() const - { - return r ? s ? s->nonce() : r[0].toInt() : 0; - } - - bytes code() const - { - if (s && s->codeCacheValid()) - return s->code(); - h256 h = r ? s ? s->codeHash() : r[3].toHash() : EmptySHA3; - return h == EmptySHA3 ? bytes() : asBytes(o->lookup(h)); - } - - std::map storage() const - { - std::map ret; - if (r) - { - TrieDB memdb(const_cast(o), r[2].toHash()); // promise we won't alter the overlay! :) - for (auto const& j: memdb) - ret[j.first] = RLP(j.second).toInt(); - } - if (s) - for (auto const& j: s->storageOverlay()) - if ((!ret.count(j.first) && j.second) || (ret.count(j.first) && ret.at(j.first) != j.second)) - ret[j.first] = j.second; - return ret; - } - - AccountDiff diff(CachedAddressState const& _c) - { - AccountDiff ret; - ret.exist = Diff(exists(), _c.exists()); - ret.balance = Diff(balance(), _c.balance()); - ret.nonce = Diff(nonce(), _c.nonce()); - ret.code = Diff(code(), _c.code()); - auto st = storage(); - auto cst = _c.storage(); - auto it = st.begin(); - auto cit = cst.begin(); - while (it != st.end() || cit != cst.end()) - { - if (it != st.end() && cit != cst.end() && it->first == cit->first && (it->second || cit->second) && (it->second != cit->second)) - ret.storage[it->first] = Diff(it->second, cit->second); - else if (it != st.end() && (cit == cst.end() || it->first < cit->first) && it->second) - ret.storage[it->first] = Diff(it->second, 0); - else if (cit != cst.end() && (it == st.end() || it->first > cit->first) && cit->second) - ret.storage[cit->first] = Diff(0, cit->second); - if (it == st.end()) - ++cit; - else if (cit == cst.end()) - ++it; - else if (it->first < cit->first) - ++it; - else if (it->first > cit->first) - ++cit; - else - ++it, ++cit; - } - return ret; - } - - std::string rS; - RLP r; - Account const* s; - OverlayDB const* o; -}; - StateDiff State::diff(State const& _c) const { StateDiff ret; @@ -992,6 +864,23 @@ void State::subBalance(Address _id, bigint _amount) it->second.addBalance(-_amount); } +Address State::newContract(u256 _balance, bytes const& _code) +{ + auto h = sha3(_code); + m_db.insert(h, &_code); + while (true) + { + Address ret = Address::random(); + ensureCached(ret, false, false); + auto it = m_cache.find(ret); + if (it == m_cache.end()) + { + m_cache[ret] = Account(0, _balance, EmptyTrie, h); + return ret; + } + } +} + u256 State::transactionsFrom(Address _id) const { ensureCached(_id, false, false); @@ -1119,7 +1008,7 @@ u256 State::execute(bytesConstRef _rlp, bytes* o_output, bool _commit) auto h = rootHash(); #endif - Executive e(*this); + Executive e(*this, 0); e.setup(_rlp); u256 startGasUsed = gasUsed(); @@ -1128,8 +1017,11 @@ u256 State::execute(bytesConstRef _rlp, bytes* o_output, bool _commit) ctrace << "Executing" << e.t() << "on" << h; ctrace << toHex(e.t().rlp()); #endif - +#if ETH_TRACE e.go(e.simpleTrace()); +#else + e.go(); +#endif e.finalize(); #if ETH_PARANOIA @@ -1174,119 +1066,6 @@ u256 State::execute(bytesConstRef _rlp, bytes* o_output, bool _commit) return e.gasUsed(); } -bool State::call(Address _receiveAddress, Address _codeAddress, Address _senderAddress, u256 _value, u256 _gasPrice, bytesConstRef _data, u256* _gas, bytesRef _out, Address _originAddress, SubState* o_sub, OnOpFunc const& _onOp, unsigned _level) -{ - if (!_originAddress) - _originAddress = _senderAddress; - -// cnote << "Transferring" << formatBalance(_value) << "to receiver."; - addBalance(_receiveAddress, _value); - - auto it = !(_codeAddress & ~h160(0xffffffff)) ? c_precompiled.find((unsigned)(u160)_codeAddress) : c_precompiled.end(); - if (it != c_precompiled.end()) - { - bigint g = it->second.gas(_data); - if (*_gas < g) - { - *_gas = 0; - return false; - } - - *_gas -= (u256)g; - it->second.exec(_data, _out); - } - else if (addressHasCode(_codeAddress)) - { - auto vm = VMFactory::create(*_gas); - ExtVM evm(*this, _receiveAddress, _senderAddress, _originAddress, _value, _gasPrice, _data, &code(_codeAddress), _level); - try - { - auto out = vm->go(evm, _onOp); - memcpy(_out.data(), out.data(), std::min(out.size(), _out.size())); - if (o_sub) - *o_sub += evm.sub; - *_gas = vm->gas(); - // Write state out only in the case of a non-excepted transaction. - return true; - } - catch (VMException const& _e) - { - clog(StateChat) << "Safe VM Exception: " << diagnostic_information(_e); - evm.revert(); - *_gas = 0; - return false; - } - catch (Exception const& _e) - { - cwarn << "Unexpected exception in VM: " << diagnostic_information(_e) << ". This is exceptionally bad."; - // TODO: use fallback known-safe VM. - // AUDIT: THIS SHOULD NEVER HAPPEN! PROVE IT! - throw; - } - catch (std::exception const& _e) - { - cwarn << "Unexpected exception in VM: " << _e.what() << ". This is exceptionally bad."; - // TODO: use fallback known-safe VM. - // AUDIT: THIS SHOULD NEVER HAPPEN! PROVE IT! - throw; - } - } - return true; -} - -h160 State::create(Address _sender, u256 _endowment, u256 _gasPrice, u256* _gas, bytesConstRef _code, Address _origin, SubState* o_sub, OnOpFunc const& _onOp, unsigned _level) -{ - if (!_origin) - _origin = _sender; - - Address newAddress = right160(sha3(rlpList(_sender, transactionsFrom(_sender) - 1))); - - // Set up new account... - m_cache[newAddress] = Account(balance(newAddress) + _endowment, Account::ContractConception); - - // Execute init code. - auto vm = VMFactory::create(*_gas); - ExtVM evm(*this, newAddress, _sender, _origin, _endowment, _gasPrice, bytesConstRef(), _code, _level); - bytesConstRef out; - - try - { - out = vm->go(evm, _onOp); - if (o_sub) - *o_sub += evm.sub; - *_gas = vm->gas(); - - if (out.size() * c_createDataGas <= *_gas) - *_gas -= out.size() * c_createDataGas; - else - out.reset(); - - // Set code. - if (!evm.sub.suicides.count(newAddress)) - m_cache[newAddress].setCode(out); - } - catch (VMException const& _e) - { - clog(StateChat) << "Safe VM Exception: " << diagnostic_information(_e); - evm.revert(); - *_gas = 0; - } - catch (Exception const& _e) - { - // TODO: AUDIT: check that this can never reasonably happen. Consider what to do if it does. - cwarn << "Unexpected exception in VM. There may be a bug in this implementation. " << diagnostic_information(_e); - throw; - } - catch (std::exception const& _e) - { - // TODO: AUDIT: check that this can never reasonably happen. Consider what to do if it does. - cwarn << "Unexpected std::exception in VM. This is probably unrecoverable. " << _e.what(); - throw; - } - - return newAddress; -} - State State::fromPending(unsigned _i) const { State ret = *this; diff --git a/libethereum/State.h b/libethereum/State.h index 10d73f671..763a67451 100644 --- a/libethereum/State.h +++ b/libethereum/State.h @@ -51,12 +51,9 @@ class BlockChain; struct StateChat: public LogChannel { static const char* name() { return "-S-"; } static const int verbosity = 4; }; struct StateTrace: public LogChannel { static const char* name() { return "=S="; } static const int verbosity = 7; }; struct StateDetail: public LogChannel { static const char* name() { return "/S/"; } static const int verbosity = 14; }; +struct StateSafeExceptions: public LogChannel { static const char* name() { return "(S)"; } static const int verbosity = 21; }; -struct PrecompiledAddress -{ - std::function gas; - std::function exec; -}; +enum class BaseState { Empty, Genesis }; /** * @brief Model of the current state of the ledger. @@ -71,7 +68,7 @@ class State public: /// Construct state object. - State(Address _coinbaseAddress = Address(), OverlayDB const& _db = OverlayDB()); + State(Address _coinbaseAddress = Address(), OverlayDB const& _db = OverlayDB(), BaseState _bs = BaseState::Genesis); /// Construct state object from arbitrary point in blockchain. State(OverlayDB const& _db, BlockChain const& _bc, h256 _hash); @@ -188,6 +185,9 @@ public: /// Set the value of a storage position of an account. void setStorage(Address _contract, u256 _location, u256 _value) { m_cache[_contract].setStorage(_location, _value); } + /// Create a new contract. + Address newContract(u256 _balance, bytes const& _code); + /// Get the storage of an account. /// @note This is expensive. Don't use it unless you need to. /// @returns std::map if no account exists at that address. @@ -249,8 +249,11 @@ public: /// the block since all state changes are ultimately reversed. void cleanup(bool _fullCommit); - /// Info on precompiled contract accounts baked into the protocol. - static std::map const& precompiled() { return c_precompiled; } + /// Commit all changes waiting in the address cache to the DB. + void commit(); + + /// Sets m_currentBlock to a clean state, (i.e. no change from m_previousBlock). + void resetCurrent(); private: /// Undo the changes to the state for committing to mine. @@ -265,36 +268,19 @@ private: /// Retrieve all information about a given address into a cache. void ensureCached(std::map& _cache, Address _a, bool _requireCode, bool _forceCreate) const; - /// Commit all changes waiting in the address cache to the DB. - void commit(); - /// Execute the given block, assuming it corresponds to m_currentBlock. If _bc is passed, it will be used to check the uncles. /// Throws on failure. u256 enact(bytesConstRef _block, BlockChain const* _bc = nullptr, bool _checkNonce = true); - // Two priviledged entry points for the VM (these don't get added to the Transaction lists): - // We assume all instrinsic fees are paid up before this point. - - /// Execute a contract-creation transaction. - h160 create(Address _txSender, u256 _endowment, u256 _gasPrice, u256* _gas, bytesConstRef _code, Address _originAddress = Address(), SubState* o_sub = nullptr, OnOpFunc const& _onOp = OnOpFunc(), unsigned _level = 0); - - /// Execute a call. - /// @a _gas points to the amount of gas to use for the call, and will lower it accordingly. - /// @returns false if the call ran out of gas before completion. true otherwise. - bool call(Address _myAddress, Address _codeAddress, Address _txSender, u256 _txValue, u256 _gasPrice, bytesConstRef _txData, u256* _gas, bytesRef _out, Address _originAddress = Address(), SubState* o_sub = nullptr, OnOpFunc const& _onOp = OnOpFunc(), unsigned _level = 0); - - /// Sets m_currentBlock to a clean state, (i.e. no change from m_previousBlock). - void resetCurrent(); - /// Finalise the block, applying the earned rewards. void applyRewards(Addresses const& _uncleAddresses); - void refreshManifest(RLPStream* _txs = nullptr); - /// @returns gas used by transactions thus far executed. u256 gasUsed() const { return m_receipts.size() ? m_receipts.back().gasUsed() : 0; } + /// Debugging only. Good for checking the Trie is in shape. bool isTrieGood(bool _enforceRefs, bool _requireNoLeftOvers) const; + /// Debugging only. Good for checking the Trie is in shape. void paranoia(std::string const& _when, bool _enforceRefs = false) const; OverlayDB m_db; ///< Our overlay for the state tree. @@ -321,8 +307,6 @@ private: static std::string c_defaultPath; - static const std::map c_precompiled; - friend std::ostream& operator<<(std::ostream& _out, State const& _s); }; diff --git a/libethereum/TransactionReceipt.cpp b/libethereum/TransactionReceipt.cpp new file mode 100644 index 000000000..0fb104490 --- /dev/null +++ b/libethereum/TransactionReceipt.cpp @@ -0,0 +1,51 @@ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file TransactionReceipt.cpp + * @author Gav Wood + * @date 2014 + */ + +#include "TransactionReceipt.h" + +using namespace std; +using namespace dev; +using namespace dev::eth; + +TransactionReceipt::TransactionReceipt(bytesConstRef _rlp) +{ + RLP r(_rlp); + m_stateRoot = (h256)r[0]; + m_gasUsed = (u256)r[1]; + m_bloom = (LogBloom)r[2]; + for (auto const& i: r[3]) + m_log.emplace_back(i); +} + +TransactionReceipt::TransactionReceipt(h256 _root, u256 _gasUsed, LogEntries const& _log): + m_stateRoot(_root), + m_gasUsed(_gasUsed), + m_bloom(eth::bloom(_log)), + m_log(_log) +{} + +void TransactionReceipt::streamRLP(RLPStream& _s) const +{ + _s.appendList(4) << m_stateRoot << m_gasUsed << m_bloom; + _s.appendList(m_log.size()); + for (LogEntry const& l: m_log) + l.streamRLP(_s); +} diff --git a/libethereum/TransactionReceipt.h b/libethereum/TransactionReceipt.h index b990459d9..23995c75a 100644 --- a/libethereum/TransactionReceipt.h +++ b/libethereum/TransactionReceipt.h @@ -26,7 +26,6 @@ #include #include #include -#include "Manifest.h" namespace dev { @@ -37,21 +36,15 @@ namespace eth class TransactionReceipt { public: - TransactionReceipt(bytesConstRef _rlp) { RLP r(_rlp); m_stateRoot = (h256)r[0]; m_gasUsed = (u256)r[1]; m_bloom = (LogBloom)r[2]; for (auto const& i: r[3]) m_log.emplace_back(i); } - TransactionReceipt(h256 _root, u256 _gasUsed, LogEntries const& _log): m_stateRoot(_root), m_gasUsed(_gasUsed), m_bloom(eth::bloom(_log)), m_log(_log) {} + TransactionReceipt(bytesConstRef _rlp); + TransactionReceipt(h256 _root, u256 _gasUsed, LogEntries const& _log); h256 const& stateRoot() const { return m_stateRoot; } u256 const& gasUsed() const { return m_gasUsed; } LogBloom const& bloom() const { return m_bloom; } LogEntries const& log() const { return m_log; } - void streamRLP(RLPStream& _s) const - { - _s.appendList(4) << m_stateRoot << m_gasUsed << m_bloom; - _s.appendList(m_log.size()); - for (LogEntry const& l: m_log) - l.streamRLP(_s); - } + void streamRLP(RLPStream& _s) const; bytes rlp() const { RLPStream s; streamRLP(s); return s.out(); } diff --git a/libethereumx/CMakeLists.txt b/libethereumx/CMakeLists.txt index 1c74bf2c3..4a3cdcda7 100644 --- a/libethereumx/CMakeLists.txt +++ b/libethereumx/CMakeLists.txt @@ -1,66 +1,33 @@ cmake_policy(SET CMP0015 NEW) +set(CMAKE_AUTOMOC OFF) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB") aux_source_directory(. SRC_LIST) +include_directories(..) set(EXECUTABLE ethereumx) -# set(CMAKE_INSTALL_PREFIX ../lib) -if(ETH_STATIC) - add_library(${EXECUTABLE} STATIC ${SRC_LIST}) +file(GLOB HEADERS "*.h") + +if (ETH_STATIC) + add_library(${EXECUTABLE} STATIC ${SRC_LIST} ${HEADERS}) else() - add_library(${EXECUTABLE} SHARED ${SRC_LIST}) + add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) endif() -file(GLOB HEADERS "*.h") +target_link_libraries(${EXECUTABLE} ${LEVELDB_LS}) +target_link_libraries(${EXECUTABLE} ${CRYPTOPP_LS}) -include_directories(..) +if (MINIUPNPC_LS) + target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS}) +endif() target_link_libraries(${EXECUTABLE} ethereum) target_link_libraries(${EXECUTABLE} evm) target_link_libraries(${EXECUTABLE} lll) target_link_libraries(${EXECUTABLE} ethcore) target_link_libraries(${EXECUTABLE} secp256k1) -if(MINIUPNPC_LS) -target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS}) -endif() -target_link_libraries(${EXECUTABLE} ${LEVELDB_LS}) -target_link_libraries(${EXECUTABLE} ${CRYPTOPP_LS}) -target_link_libraries(${EXECUTABLE} gmp) - -if("${TARGET_PLATFORM}" STREQUAL "w64") - target_link_libraries(${EXECUTABLE} boost_system-mt-s) - target_link_libraries(${EXECUTABLE} boost_regex-mt-s) - target_link_libraries(${EXECUTABLE} boost_filesystem-mt-s) - target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) - target_link_libraries(${EXECUTABLE} iphlpapi) - target_link_libraries(${EXECUTABLE} ws2_32) - target_link_libraries(${EXECUTABLE} mswsock) - target_link_libraries(${EXECUTABLE} shlwapi) -elseif (APPLE) - # Latest mavericks boost libraries only come with -mt - target_link_libraries(${EXECUTABLE} boost_system-mt) - target_link_libraries(${EXECUTABLE} boost_regex-mt) - target_link_libraries(${EXECUTABLE} boost_filesystem-mt) - target_link_libraries(${EXECUTABLE} boost_thread-mt) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -elseif (UNIX) - target_link_libraries(${EXECUTABLE} ${Boost_SYSTEM_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_REGEX_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_FILESYSTEM_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_THREAD_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_DATE_TIME_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -else () - target_link_libraries(${EXECUTABLE} boost_system) - target_link_libraries(${EXECUTABLE} boost_regex) - target_link_libraries(${EXECUTABLE} boost_filesystem) - target_link_libraries(${EXECUTABLE} boost_thread) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -endif () install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) diff --git a/libevm/CMakeLists.txt b/libevm/CMakeLists.txt index b4aa1eef2..96b8f9ade 100644 --- a/libevm/CMakeLists.txt +++ b/libevm/CMakeLists.txt @@ -1,60 +1,35 @@ cmake_policy(SET CMP0015 NEW) +# this policy was introduced in cmake 3.0 +# remove if, once 3.0 will be used on unix +if (${CMAKE_MAJOR_VERSION} GREATER 2) + # old policy do not use MACOSX_RPATH + cmake_policy(SET CMP0042 OLD) +endif() +set(CMAKE_AUTOMOC OFF) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB") aux_source_directory(. SRC_LIST) +# we may not use it in libevm, but one of our dependecies is including boost in header file +# and windows is failing to build without that +include_directories(${Boost_INCLUDE_DIRS}) +include_directories(..) + set(EXECUTABLE evm) file(GLOB HEADERS "*.h") -if(ETH_STATIC) + +if (ETH_STATIC) add_library(${EXECUTABLE} STATIC ${SRC_LIST} ${HEADERS}) else() add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) endif() -include_directories(..) - target_link_libraries(${EXECUTABLE} ethcore) target_link_libraries(${EXECUTABLE} devcrypto) target_link_libraries(${EXECUTABLE} evmcore) target_link_libraries(${EXECUTABLE} devcore) -target_link_libraries(${EXECUTABLE} secp256k1) -target_link_libraries(${EXECUTABLE} gmp) -if(MINIUPNPC_LS) -target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS}) -endif() -target_link_libraries(${EXECUTABLE} ${LEVELDB_LS}) -target_link_libraries(${EXECUTABLE} ${CRYPTOPP_LS}) - -if("${TARGET_PLATFORM}" STREQUAL "w64") - target_link_libraries(${EXECUTABLE} boost_system-mt-s) - target_link_libraries(${EXECUTABLE} boost_filesystem-mt-s) - target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) - target_link_libraries(${EXECUTABLE} iphlpapi) - target_link_libraries(${EXECUTABLE} ws2_32) - target_link_libraries(${EXECUTABLE} mswsock) - target_link_libraries(${EXECUTABLE} shlwapi) -elseif (APPLE) - # Latest mavericks boost libraries only come with -mt - target_link_libraries(${EXECUTABLE} boost_system-mt) - target_link_libraries(${EXECUTABLE} boost_filesystem-mt) - target_link_libraries(${EXECUTABLE} boost_thread-mt) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -elseif (UNIX) - target_link_libraries(${EXECUTABLE} ${Boost_SYSTEM_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_FILESYSTEM_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_THREAD_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_DATE_TIME_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -else () - target_link_libraries(${EXECUTABLE} boost_system) - target_link_libraries(${EXECUTABLE} boost_filesystem) - target_link_libraries(${EXECUTABLE} boost_thread) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -endif () install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) diff --git a/libevm/ExtVMFace.h b/libevm/ExtVMFace.h index 24c7dfcda..84dee4272 100644 --- a/libevm/ExtVMFace.h +++ b/libevm/ExtVMFace.h @@ -36,8 +36,6 @@ namespace dev namespace eth { -using LogBloom = h512; - struct LogEntry { LogEntry() {} @@ -83,6 +81,13 @@ struct SubState logs += _s.logs; return *this; } + + void clear() + { + suicides.clear(); + logs.clear(); + refunds = 0; + } }; class ExtVMFace; @@ -129,10 +134,10 @@ public: virtual void suicide(Address) { sub.suicides.insert(myAddress); } /// Create a new (contract) account. - virtual h160 create(u256, u256*, bytesConstRef, OnOpFunc const&) { return h160(); } + virtual h160 create(u256, u256&, bytesConstRef, OnOpFunc const&) { return h160(); } /// Make a new message call. - virtual bool call(Address, u256, bytesConstRef, u256*, bytesRef, OnOpFunc const&, Address, Address) { return false; } + virtual bool call(Address, u256, bytesConstRef, u256&, bytesRef, OnOpFunc const&, Address, Address) { return false; } /// Revert any changes made (by any of the other calls). virtual void log(h256s&& _topics, bytesConstRef _data) { sub.logs.push_back(LogEntry(myAddress, std::move(_topics), _data.toBytes())); } diff --git a/libevm/VM.h b/libevm/VM.h index 6f3229920..3eb330fcd 100644 --- a/libevm/VM.h +++ b/libevm/VM.h @@ -798,7 +798,7 @@ inline bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _st if (_ext.depth == 1024) BOOST_THROW_EXCEPTION(OutOfGas()); _ext.subBalance(endowment); - m_stack.push_back((u160)_ext.create(endowment, &m_gas, bytesConstRef(m_temp.data() + initOff, initSize), _onOp)); + m_stack.push_back((u160)_ext.create(endowment, m_gas, bytesConstRef(m_temp.data() + initOff, initSize), _onOp)); } else m_stack.push_back(0); @@ -828,7 +828,7 @@ inline bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _st if (_ext.depth == 1024) BOOST_THROW_EXCEPTION(OutOfGas()); _ext.subBalance(value); - m_stack.push_back(_ext.call(inst == Instruction::CALL ? receiveAddress : _ext.myAddress, value, bytesConstRef(m_temp.data() + inOff, inSize), &gas, bytesRef(m_temp.data() + outOff, outSize), _onOp, Address(), receiveAddress)); + m_stack.push_back(_ext.call(inst == Instruction::CALL ? receiveAddress : _ext.myAddress, value, bytesConstRef(m_temp.data() + inOff, inSize), gas, bytesRef(m_temp.data() + outOff, outSize), _onOp, {}, receiveAddress)); } else m_stack.push_back(0); diff --git a/libevm/_libevm.cpp b/libevm/_libevm.cpp deleted file mode 100644 index 27186cbf2..000000000 --- a/libevm/_libevm.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#ifdef _MSC_VER -#include "All.h" -#include "ExtVMFace.cpp" -#include "FeeStructure.cpp" -#include "VM.cpp" -#endif diff --git a/libevmcore/Assembly.h b/libevmcore/Assembly.h index b144dd8d9..5523710d4 100644 --- a/libevmcore/Assembly.h +++ b/libevmcore/Assembly.h @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file CodeFragment.h +/** @file Assembly.h * @author Gav Wood * @date 2014 */ diff --git a/libevmcore/CMakeLists.txt b/libevmcore/CMakeLists.txt index 738303271..9727ee1c9 100644 --- a/libevmcore/CMakeLists.txt +++ b/libevmcore/CMakeLists.txt @@ -1,20 +1,29 @@ cmake_policy(SET CMP0015 NEW) +# this policy was introduced in cmake 3.0 +# remove if, once 3.0 will be used on unix +if (${CMAKE_MAJOR_VERSION} GREATER 2) + # old policy do not use MACOSX_RPATH + cmake_policy(SET CMP0042 OLD) +endif() +set(CMAKE_AUTOMOC OFF) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB") aux_source_directory(. SRC_LIST) +include_directories(${Boost_INCLUDE_DIRS}) +include_directories(..) + set(EXECUTABLE evmcore) file(GLOB HEADERS "*.h") -if(ETH_STATIC) + +if (ETH_STATIC) add_library(${EXECUTABLE} STATIC ${SRC_LIST} ${HEADERS}) else() add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) endif() -include_directories(..) - target_link_libraries(${EXECUTABLE} devcore) install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) diff --git a/libevmcore/Instruction.cpp b/libevmcore/Instruction.cpp index 9062fd8ed..b4a4d9f3b 100644 --- a/libevmcore/Instruction.cpp +++ b/libevmcore/Instruction.cpp @@ -326,7 +326,11 @@ InstructionInfo dev::eth::instructionInfo(Instruction _inst) } catch (...) { +#ifndef BOOST_NO_EXCEPTIONS cwarn << "\n" << boost::current_exception_diagnostic_information(); +#else + cwarn << "\n"; +#endif return InstructionInfo({"", 0, 0, 0, false}); } } diff --git a/libjsqrc/CMakeLists.txt b/libjsqrc/CMakeLists.txt index 9c505df2b..a6dbf023b 100644 --- a/libjsqrc/CMakeLists.txt +++ b/libjsqrc/CMakeLists.txt @@ -1,24 +1,15 @@ cmake_policy(SET CMP0015 NEW) - -# Find Qt5 for Apple and update src_list for windows -if (APPLE) - # homebrew defaults to qt4 and installs qt5 as 'keg-only' - # which places it into /usr/local/opt insteadof /usr/local. - - set(CMAKE_PREFIX_PATH /usr/local/opt/qt5) - include_directories(/usr/local/opt/qt5/include /usr/local/include) -elseif ("${TARGET_PLATFORM}" STREQUAL "w64") - set(SRC_LIST ${SRC_LIST} ../windows/qt_plugin_import.cpp) -elseif (UNIX) - set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ";$ENV{QTDIR}/lib/cmake") -endif () - -find_package(Qt5Core) - +# let cmake autolink dependencies on windows +cmake_policy(SET CMP0020 NEW) +# this policy was introduced in cmake 3.0 +# remove if, once 3.0 will be used on unix +if (${CMAKE_MAJOR_VERSION} GREATER 2) + cmake_policy(SET CMP0043 OLD) +endif() set(CMAKE_AUTOMOC OFF) qt5_add_resources(JSQRC js.qrc) add_library(jsqrc STATIC ${JSQRC}) -qt5_use_modules(jsqrc Core) +target_link_libraries(jsqrc Qt5::Core) install( TARGETS jsqrc ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) diff --git a/liblll/CMakeLists.txt b/liblll/CMakeLists.txt index 8b1581785..fb79d5873 100644 --- a/liblll/CMakeLists.txt +++ b/liblll/CMakeLists.txt @@ -1,48 +1,32 @@ cmake_policy(SET CMP0015 NEW) +# this policy was introduced in cmake 3.0 +# remove if, once 3.0 will be used on unix +if (${CMAKE_MAJOR_VERSION} GREATER 2) + # old policy do not use MACOSX_RPATH + cmake_policy(SET CMP0042 OLD) +endif() +set(CMAKE_AUTOMOC OFF) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB") aux_source_directory(. SRC_LIST) +include_directories(${Boost_INCLUDE_DIRS}) +include_directories(..) + set(EXECUTABLE lll) file(GLOB HEADERS "*.h") + if(ETH_STATIC) add_library(${EXECUTABLE} STATIC ${SRC_LIST} ${HEADERS}) else() add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) endif() -include_directories(..) - target_link_libraries(${EXECUTABLE} evmcore) target_link_libraries(${EXECUTABLE} devcore) - -if("${TARGET_PLATFORM}" STREQUAL "w64") - target_link_libraries(${EXECUTABLE} boost_system-mt-s) - target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) - target_link_libraries(${EXECUTABLE} iphlpapi) - target_link_libraries(${EXECUTABLE} ws2_32) - target_link_libraries(${EXECUTABLE} mswsock) - target_link_libraries(${EXECUTABLE} shlwapi) -elseif (APPLE) - # Latest mavericks boost libraries only come with -mt - target_link_libraries(${EXECUTABLE} boost_system-mt) - target_link_libraries(${EXECUTABLE} boost_thread-mt) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -elseif (UNIX) - target_link_libraries(${EXECUTABLE} ${Boost_SYSTEM_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_THREAD_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -else () - target_link_libraries(${EXECUTABLE} boost_system) - target_link_libraries(${EXECUTABLE} boost_thread) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -endif () - install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) diff --git a/libp2p/CMakeLists.txt b/libp2p/CMakeLists.txt index 9e20fd99f..6f3f6b712 100644 --- a/libp2p/CMakeLists.txt +++ b/libp2p/CMakeLists.txt @@ -1,62 +1,41 @@ cmake_policy(SET CMP0015 NEW) +# this policy was introduced in cmake 3.0 +# remove if, once 3.0 will be used on unix +if (${CMAKE_MAJOR_VERSION} GREATER 2) + # old policy do not use MACOSX_RPATH + cmake_policy(SET CMP0042 OLD) +endif() +set(CMAKE_AUTOMOC OFF) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB") aux_source_directory(. SRC_LIST) +# we may not use it in libp2p, but one of our dependecies is including leveldb in header file +# and windows is failing to build without that +include_directories(${LEVELDB_INCLUDE_DIRS}) + +if (MINIUPNPC_FOUND) + include_directories(${MINIUPNPC_INCLUDE_DIRS}) +endif() +include_directories(..) + set(EXECUTABLE p2p) file(GLOB HEADERS "*.h") + if(ETH_STATIC) add_library(${EXECUTABLE} STATIC ${SRC_LIST} ${HEADERS}) else() add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) endif() -include_directories(..) +if (MINIUPNPC_FOUND) + target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LIBRARIES}) +endif() target_link_libraries(${EXECUTABLE} devcrypto) target_link_libraries(${EXECUTABLE} devcore) -target_link_libraries(${EXECUTABLE} secp256k1) -if(MINIUPNPC_LS) -target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS}) -endif() -target_link_libraries(${EXECUTABLE} ${LEVELDB_LS}) -target_link_libraries(${EXECUTABLE} ${CRYPTOPP_LS}) -target_link_libraries(${EXECUTABLE} gmp) - -if("${TARGET_PLATFORM}" STREQUAL "w64") - target_link_libraries(${EXECUTABLE} boost_system-mt-s) - target_link_libraries(${EXECUTABLE} boost_regex-mt-s) - target_link_libraries(${EXECUTABLE} boost_filesystem-mt-s) - target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) - target_link_libraries(${EXECUTABLE} iphlpapi) - target_link_libraries(${EXECUTABLE} ws2_32) - target_link_libraries(${EXECUTABLE} mswsock) - target_link_libraries(${EXECUTABLE} shlwapi) -elseif (APPLE) - # Latest mavericks boost libraries only come with -mt - target_link_libraries(${EXECUTABLE} boost_system-mt) - target_link_libraries(${EXECUTABLE} boost_regex-mt) - target_link_libraries(${EXECUTABLE} boost_filesystem-mt) - target_link_libraries(${EXECUTABLE} boost_thread-mt) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -elseif (UNIX) - target_link_libraries(${EXECUTABLE} ${Boost_SYSTEM_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_REGEX_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_FILESYSTEM_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_THREAD_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_DATE_TIME_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -else () - target_link_libraries(${EXECUTABLE} boost_system) - target_link_libraries(${EXECUTABLE} boost_regex) - target_link_libraries(${EXECUTABLE} boost_filesystem) - target_link_libraries(${EXECUTABLE} boost_thread) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -endif () install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) diff --git a/libp2p/HostCapability.h b/libp2p/HostCapability.h index da454860a..9666ef65a 100644 --- a/libp2p/HostCapability.h +++ b/libp2p/HostCapability.h @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file Common.h +/** @file HostCapability.h * @author Gav Wood * @date 2014 * diff --git a/libp2p/Session.h b/libp2p/Session.h index e8de1c398..cd2dbf5a7 100644 --- a/libp2p/Session.h +++ b/libp2p/Session.h @@ -110,7 +110,7 @@ private: std::array m_data; ///< Data buffer for the write queue. bytes m_incoming; ///< The incoming read queue of bytes. - PeerInfo m_info; ///< Dyanamic information about this peer. + PeerInfo m_info; ///< Dynamic information about this peer. unsigned m_protocolVersion = 0; ///< The protocol version of the peer. std::shared_ptr m_node; ///< The Node object. Might be null if we constructed using a bare address/port. diff --git a/libp2p/_libp2p.cpp b/libp2p/_libp2p.cpp deleted file mode 100644 index 440ba362b..000000000 --- a/libp2p/_libp2p.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#ifdef _MSC_VER -#include "All.h" -#include "Capability.cpp" -#include "Common.cpp" -#include "Host.cpp" -#include "HostCapability.cpp" -#include "Session.cpp" -#include "UPnP.cpp" -#endif diff --git a/libpyserpent/CMakeLists.txt b/libpyserpent/CMakeLists.txt deleted file mode 100644 index e6f32ec81..000000000 --- a/libpyserpent/CMakeLists.txt +++ /dev/null @@ -1,42 +0,0 @@ -cmake_policy(SET CMP0015 NEW) - -aux_source_directory(. SRC_LIST) - -set(EXECUTABLE pyserpent) - -# set(CMAKE_INSTALL_PREFIX ../lib) -add_library(${EXECUTABLE} SHARED ${SRC_LIST}) - -file(GLOB HEADERS "*.h") - -include_directories(..) - -target_link_libraries(${EXECUTABLE} serpent) -target_link_libraries(${EXECUTABLE} lll) -target_link_libraries(${EXECUTABLE} evmcore) -target_link_libraries(${EXECUTABLE} devcore) -target_link_libraries(${EXECUTABLE} ${PYTHON_LS}) - -if("${TARGET_PLATFORM}" STREQUAL "w64") - target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) - target_link_libraries(${EXECUTABLE} iphlpapi) - target_link_libraries(${EXECUTABLE} ws2_32) - target_link_libraries(${EXECUTABLE} mswsock) - target_link_libraries(${EXECUTABLE} shlwapi) -elseif (APPLE) - # Latest mavericks boost libraries only come with -mt - target_link_libraries(${EXECUTABLE} boost_thread-mt) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -elseif (UNIX) - target_link_libraries(${EXECUTABLE} ${Boost_THREAD_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -else () - target_link_libraries(${EXECUTABLE} boost_thread) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -endif () - -install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) -install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) - diff --git a/libpyserpent/pyserpent.cpp b/libpyserpent/pyserpent.cpp deleted file mode 100644 index ff8813fcf..000000000 --- a/libpyserpent/pyserpent.cpp +++ /dev/null @@ -1,173 +0,0 @@ -#include -#include "structmember.h" - -#include -#include -#include -#include - -#define PYMETHOD(name, FROM, method, TO) \ - static PyObject * name(PyObject *, PyObject *args) { \ - try { \ - FROM(med) \ - return TO(method(med)); \ - } \ - catch (std::string e) { \ - PyErr_SetString(PyExc_Exception, e.c_str()); \ - return NULL; \ - } \ - } - -#define FROMSTR(v) \ - const char *command; \ - int len; \ - if (!PyArg_ParseTuple(args, "s#", &command, &len)) \ - return NULL; \ - std::string v = std::string(command, len); \ - -#define FROMNODE(v) \ - PyObject *node; \ - if (!PyArg_ParseTuple(args, "O", &node)) \ - return NULL; \ - Node v = cppifyNode(node); - -#define FROMLIST(v) \ - PyObject *node; \ - if (!PyArg_ParseTuple(args, "O", &node)) \ - return NULL; \ - std::vector v = cppifyNodeList(node); - -// Convert metadata into python wrapper form [file, ln, ch] -PyObject* pyifyMetadata(Metadata m) { - PyObject* a = PyList_New(0); - PyList_Append(a, Py_BuildValue("s#", m.file.c_str(), m.file.length())); - PyList_Append(a, Py_BuildValue("i", m.ln)); - PyList_Append(a, Py_BuildValue("i", m.ch)); - return a; -} - -// Convert node into python wrapper form -// [token=0/astnode=1, val, metadata, args] -PyObject* pyifyNode(Node n) { - PyObject* a = PyList_New(0); - PyList_Append(a, Py_BuildValue("i", n.type == ASTNODE)); - PyList_Append(a, Py_BuildValue("s#", n.val.c_str(), n.val.length())); - PyList_Append(a, pyifyMetadata(n.metadata)); - for (unsigned i = 0; i < n.args.size(); i++) - PyList_Append(a, pyifyNode(n.args[i])); - return a; -} - -// Convert string into python wrapper form -PyObject* pyifyString(std::string s) { - return Py_BuildValue("s#", s.c_str(), s.length()); -} - -// Convert list of nodes into python wrapper form -PyObject* pyifyNodeList(std::vector n) { - PyObject* a = PyList_New(0); - for (unsigned i = 0; i < n.size(); i++) - PyList_Append(a, pyifyNode(n[i])); - return a; -} - -// Convert pyobject int into normal form -int cppifyInt(PyObject* o) { - int out; - if (!PyArg_Parse(o, "i", &out)) - err("Argument should be integer", Metadata()); - return out; -} - -// Convert pyobject string into normal form -std::string cppifyString(PyObject* o) { - const char *command; - if (!PyArg_Parse(o, "s", &command)) - err("Argument should be string", Metadata()); - return std::string(command); -} - -// Convert metadata from python wrapper form -Metadata cppifyMetadata(PyObject* o) { - std::string file = cppifyString(PyList_GetItem(o, 0)); - int ln = cppifyInt(PyList_GetItem(o, 1)); - int ch = cppifyInt(PyList_GetItem(o, 2)); - return Metadata(file, ln, ch); -} - -// Convert node from python wrapper form -Node cppifyNode(PyObject* o) { - Node n; - int isAstNode = cppifyInt(PyList_GetItem(o, 0)); - n.type = isAstNode ? ASTNODE : TOKEN; - n.val = cppifyString(PyList_GetItem(o, 1)); - n.metadata = cppifyMetadata(PyList_GetItem(o, 2)); - std::vector args; - for (int i = 3; i < PyList_Size(o); i++) { - args.push_back(cppifyNode(PyList_GetItem(o, i))); - } - n.args = args; - return n; -} - -//Convert list of nodes into normal form -std::vector cppifyNodeList(PyObject* o) { - std::vector out; - for (int i = 0; i < PyList_Size(o); i++) { - out.push_back(cppifyNode(PyList_GetItem(o,i))); - } - return out; -} - -PYMETHOD(ps_compile, FROMSTR, compile, pyifyString) -PYMETHOD(ps_compile_chunk, FROMSTR, compileChunk, pyifyString) -PYMETHOD(ps_compile_to_lll, FROMSTR, compileToLLL, pyifyNode) -PYMETHOD(ps_compile_chunk_to_lll, FROMSTR, compileChunkToLLL, pyifyNode) -PYMETHOD(ps_compile_lll, FROMNODE, compileLLL, pyifyString) -PYMETHOD(ps_parse, FROMSTR, parseSerpent, pyifyNode) -PYMETHOD(ps_rewrite, FROMNODE, rewrite, pyifyNode) -PYMETHOD(ps_rewrite_chunk, FROMNODE, rewriteChunk, pyifyNode) -PYMETHOD(ps_pretty_compile, FROMSTR, prettyCompile, pyifyNodeList) -PYMETHOD(ps_pretty_compile_chunk, FROMSTR, prettyCompileChunk, pyifyNodeList) -PYMETHOD(ps_pretty_compile_lll, FROMNODE, prettyCompileLLL, pyifyNodeList) -PYMETHOD(ps_serialize, FROMLIST, serialize, pyifyString) -PYMETHOD(ps_deserialize, FROMSTR, deserialize, pyifyNodeList) -PYMETHOD(ps_parse_lll, FROMSTR, parseLLL, pyifyNode) - - -static PyMethodDef PyextMethods[] = { - {"compile", ps_compile, METH_VARARGS, - "Compile code."}, - {"compile_chunk", ps_compile_chunk, METH_VARARGS, - "Compile code chunk (no wrappers)."}, - {"compile_to_lll", ps_compile_to_lll, METH_VARARGS, - "Compile code to LLL."}, - {"compile_chunk_to_lll", ps_compile_chunk_to_lll, METH_VARARGS, - "Compile code chunk to LLL (no wrappers)."}, - {"compile_lll", ps_compile_lll, METH_VARARGS, - "Compile LLL to EVM."}, - {"parse", ps_parse, METH_VARARGS, - "Parse serpent"}, - {"rewrite", ps_rewrite, METH_VARARGS, - "Rewrite parsed serpent to LLL"}, - {"rewrite_chunk", ps_rewrite_chunk, METH_VARARGS, - "Rewrite parsed serpent to LLL (no wrappers)"}, - {"pretty_compile", ps_pretty_compile, METH_VARARGS, - "Compile to EVM opcodes"}, - {"pretty_compile_chunk", ps_pretty_compile_chunk, METH_VARARGS, - "Compile chunk to EVM opcodes (no wrappers)"}, - {"pretty_compile_lll", ps_pretty_compile_lll, METH_VARARGS, - "Compile LLL to EVM opcodes"}, - {"serialize", ps_serialize, METH_VARARGS, - "Convert EVM opcodes to bin"}, - {"deserialize", ps_deserialize, METH_VARARGS, - "Convert EVM bin to opcodes"}, - {"parse_lll", ps_parse_lll, METH_VARARGS, - "Parse LLL"}, - {NULL, NULL, 0, NULL} /* Sentinel */ -}; - -PyMODINIT_FUNC initserpent_pyext(void) -{ - Py_InitModule( "serpent_pyext", PyextMethods ); -} diff --git a/libqethereum/CMakeLists.txt b/libqethereum/CMakeLists.txt index ba7cd3b67..683bfec56 100644 --- a/libqethereum/CMakeLists.txt +++ b/libqethereum/CMakeLists.txt @@ -1,110 +1,41 @@ cmake_policy(SET CMP0015 NEW) - -if ("${TARGET_PLATFORM}" STREQUAL "w64") - cmake_policy(SET CMP0020 NEW) -endif () - +# let cmake autolink dependencies on windows +cmake_policy(SET CMP0020 NEW) +# this policy was introduced in cmake 3.0 +# remove if, once 3.0 will be used on unix +if (${CMAKE_MAJOR_VERSION} GREATER 2) + # old policy do not use MACOSX_RPATH + cmake_policy(SET CMP0042 OLD) + cmake_policy(SET CMP0043 OLD) +endif() set(CMAKE_INCLUDE_CURRENT_DIR ON) aux_source_directory(. SRC_LIST) +include_directories(${JSON_RPC_CPP_INCLUDE_DIRS}) include_directories(..) -link_directories(../libethereum) - -# Find Qt5 for Apple and update src_list for windows -if (APPLE) - # homebrew defaults to qt4 and installs qt5 as 'keg-only' - # which places it into /usr/local/opt insteadof /usr/local. - - set(CMAKE_PREFIX_PATH /usr/local/opt/qt5) - include_directories(/usr/local/opt/qt5/include /usr/local/include) -elseif ("${TARGET_PLATFORM}" STREQUAL "w64") - set(SRC_LIST ${SRC_LIST} ../windows/qt_plugin_import.cpp) -elseif (UNIX) - set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ";$ENV{QTDIR}/lib/cmake") -endif () - -find_package(Qt5Gui REQUIRED) -find_package(Qt5Quick REQUIRED) -find_package(Qt5Qml REQUIRED) -find_package(Qt5Network REQUIRED) -find_package(Qt5Widgets REQUIRED) -find_package(Qt5WebKit REQUIRED) -find_package(Qt5WebKitWidgets REQUIRED) set(EXECUTABLE qethereum) -# Set name of binary and add_executable() -if (APPLE) - set(CMAKE_INSTALL_PREFIX ./) - set(BIN_INSTALL_DIR ".") - set(DOC_INSTALL_DIR ".") - - set(PROJECT_VERSION "${ETH_VERSION}") - set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME} ${PROJECT_VERSION}") - set(MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_NAME} ${PROJECT_VERSION}") - set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME} ${PROJECT_VERSION}") - set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}") - set(MACOSX_BUNDLE_COPYRIGHT "${PROJECT_COPYRIGHT_YEAR} ${PROJECT_VENDOR}") - set(MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_DOMAIN_SECOND}.${PROJECT_DOMAIN_FIRST}") - set(MACOSX_BUNDLE_BUNDLE_NAME ${EXECUTABLE}) - include(BundleUtilities) -endif () file(GLOB HEADERS "*.h") + if(ETH_STATIC) add_library(${EXECUTABLE} STATIC ${RESOURCE_ADDED} ${SRC_LIST} ${HEADERS}) else() add_library(${EXECUTABLE} SHARED ${RESOURCE_ADDED} ${SRC_LIST} ${HEADERS}) endif() -include_directories(/) -qt5_use_modules(${EXECUTABLE} Core Gui WebKit WebKitWidgets Widgets Network Quick Qml) -target_link_libraries(${EXECUTABLE} ethereum secp256k1 ${CRYPTOPP_LS} ${JSONRPC_LS}) - -if (APPLE) - if (${ADDFRAMEWORKS}) - set_target_properties(${EXECUTABLE} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/EthereumMacOSXBundleInfo.plist.in") - endif () - - SET_SOURCE_FILES_PROPERTIES(${EXECUTABLE} PROPERTIES MACOSX_PACKAGE_LOCATION MacOS) - - # This is a workaround for when the build-type defaults to Debug, and when a multi-config generator like xcode is used, where the type - # will not be set but defaults to release. - set(generator_lowercase "${CMAKE_GENERATOR}") - string(TOLOWER "${CMAKE_GENERATOR}" generator_lowercase) - if ("${generator_lowercase}" STREQUAL "xcode") - # TODO: Not sure how to resolve this. Possibly \${TARGET_BUILD_DIR} - set(binary_build_dir "${CMAKE_CURRENT_BINARY_DIR}/Debug") - else () - set(binary_build_dir "${CMAKE_CURRENT_BINARY_DIR}") - endif () - - set(APPS ${binary_build_dir}/${EXECUTABLE}) - - if (${ADDFRAMEWORKS}) - add_custom_target(addframeworks ALL - COMMAND /usr/local/opt/qt5/bin/macdeployqt ${binary_build_dir}/${EXECUTABLE} - WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - DEPENDS ${PROJECT_NAME} - ) - endif () - -elseif ("${TARGET_PLATFORM}" STREQUAL "w64") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-keep-inline-dllexport -static-libgcc -static-libstdc++ -static") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-s -Wl,-subsystem,windows -mthreads -L/usr/x86_64-w64-mingw32/plugins/platforms") - target_link_libraries(${EXECUTABLE} gcc) - target_link_libraries(${EXECUTABLE} mingw32 qtmain mswsock iphlpapi qwindows shlwapi Qt5PlatformSupport gdi32 comdlg32 oleaut32 imm32 winmm ole32 uuid ws2_32) - target_link_libraries(${EXECUTABLE} boost_system-mt-s) - target_link_libraries(${EXECUTABLE} boost_filesystem-mt-s) - target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) - target_link_libraries(${EXECUTABLE} Qt5PlatformSupport) - set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) -elseif (UNIX) -else () - target_link_libraries(${EXECUTABLE} boost_system) - target_link_libraries(${EXECUTABLE} boost_filesystem) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) - install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) -endif () - +target_link_libraries(${EXECUTABLE} Qt5::Core) +target_link_libraries(${EXECUTABLE} Qt5::Gui) +target_link_libraries(${EXECUTABLE} Qt5::WebKit) +target_link_libraries(${EXECUTABLE} Qt5::WebKitWidgets) +target_link_libraries(${EXECUTABLE} Qt5::Widgets) +target_link_libraries(${EXECUTABLE} Qt5::Network) +target_link_libraries(${EXECUTABLE} Qt5::Quick) +target_link_libraries(${EXECUTABLE} Qt5::Qml) +target_link_libraries(${EXECUTABLE} ${JSON_RPC_CPP_SERVER_LIBRARIES}) +target_link_libraries(${EXECUTABLE} ethereum) +target_link_libraries(${EXECUTABLE} secp256k1) + +install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) +install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) diff --git a/libqethereum/QEthereum.cpp b/libqethereum/QEthereum.cpp index 5e5253829..daf773a22 100644 --- a/libqethereum/QEthereum.cpp +++ b/libqethereum/QEthereum.cpp @@ -227,11 +227,3 @@ void QWebThreeConnector::onProcessData(QString const& _json, QString const& _add OnRequest(_json.toStdString(), (void*)&_addInfo); } -// extra bits needed to link on VS -#ifdef _MSC_VER - -// include moc file, ofuscated to hide from automoc -#include\ -"moc_QEthereum.cpp" - -#endif diff --git a/libqethereum/QEthereum.h b/libqethereum/QEthereum.h index 6a4e640e5..657986b36 100644 --- a/libqethereum/QEthereum.h +++ b/libqethereum/QEthereum.h @@ -25,7 +25,7 @@ #include #include -#include +#include class QWebThree: public QObject { diff --git a/libqethereum/QmlEthereum.cpp b/libqethereum/QmlEthereum.cpp deleted file mode 100644 index b1b926f42..000000000 --- a/libqethereum/QmlEthereum.cpp +++ /dev/null @@ -1,188 +0,0 @@ -#if ETH_QTQML -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include "QmlEthereum.h" -using namespace std; - -// types -using dev::bytes; -using dev::bytesConstRef; -using dev::h160; -using dev::h256; -using dev::u160; -using dev::u256; -using dev::u256s; -using dev::RLP; -using dev::Address; -using dev::eth::BlockInfo; -using dev::eth::Client; -using dev::eth::Instruction; -using dev::KeyPair; -using dev::eth::NodeMode; -using dev::Secret; -using dev::eth::Transaction; -using dev::p2p::PeerInfo; - -// functions -using dev::toHex; -using dev::fromHex; -using dev::right160; -using dev::simpleDebugOut; -using dev::toLog2; -using dev::toString; -using dev::eth::disassemble; -using dev::eth::formatBalance; -using dev::eth::units; - -// vars -using dev::g_logPost; -using dev::g_logVerbosity; - -// Horrible global for the mainwindow. Needed for the QmlEthereums to find the Main window which acts as multiplexer for now. -// Can get rid of this once we've sorted out ITC for signalling & multiplexed querying. -dev::eth::Client* g_qmlClient; -QObject* g_qmlMain; -#if 0 -QmlAccount::QmlAccount(QObject*) -{ -} - -QmlAccount::~QmlAccount() -{ -} - -void QmlAccount::setEthereum(QmlEthereum* _eth) -{ - if (m_eth == _eth) - return; -// if (m_eth) -// disconnect(m_eth, SIGNAL(changed()), this, SIGNAL(changed())); - m_eth = _eth; -// if (m_eth) -// connect(m_eth, SIGNAL(changed()), this, SIGNAL(changed())); - ethChanged(); -// changed(); -} - -dev::u256 QmlAccount::balance() const -{ - if (m_eth) - return m_eth->balanceAt(m_address); - return u256(0); -} - -double QmlAccount::txCount() const -{ - if (m_eth) - return m_eth->txCountAt(m_address); - return 0; -} - -bool QmlAccount::isContract() const -{ - if (m_eth) - return m_eth->isContractAt(m_address); - return 0; -} - -QmlEthereum::QmlEthereum(QObject* _p): QObject(_p) -{ -// connect(g_qmlMain, SIGNAL(changed()), SIGNAL(changed())); -} - -QmlEthereum::~QmlEthereum() -{ -} - -Client* QmlEthereum::client() const -{ - return g_qmlClient; -} - -Address QmlEthereum::coinbase() const -{ - return client()->address(); -} - -void QmlEthereum::setCoinbase(Address _a) -{ - if (client()->address() != _a) - { - client()->setAddress(_a); -// changed(); - } -} - -u256 QmlEthereum::balanceAt(Address _a) const -{ - return client()->postState().balance(_a); -} - -bool QmlEthereum::isContractAt(Address _a) const -{ - return client()->postState().addressHasCode(_a); -} - -bool QmlEthereum::isMining() const -{ - return client()->isMining(); -} - -bool QmlEthereum::isListening() const -{ - return client()->haveNetwork(); -} - -void QmlEthereum::setMining(bool _l) -{ - if (_l) - client()->startMining(); - else - client()->stopMining(); -} - -void QmlEthereum::setListening(bool _l) -{ - if (_l) - client()->startNetwork(); - else - client()->stopNetwork(); -} - -double QmlEthereum::txCountAt(Address _a) const -{ - return (double)client()->postState().transactionsFrom(_a); -} - -unsigned QmlEthereum::peerCount() const -{ - return (unsigned)client()->peerCount(); -} - -void QmlEthereum::transact(Secret _secret, u256 _amount, u256 _gasPrice, u256 _gas, QByteArray _init) -{ - client()->transact(_secret, _amount, bytes(_init.data(), _init.data() + _init.size()), _gas, _gasPrice); -} - -void QmlEthereum::transact(Secret _secret, Address _dest, u256 _amount, u256 _gasPrice, u256 _gas, QByteArray _data) -{ - client()->transact(_secret, _amount, _dest, bytes(_data.data(), _data.data() + _data.size()), _gas, _gasPrice); -} - -#endif - -// extra bits needed to link on VS -#ifdef _MSC_VER - -// include moc file, ofuscated to hide from automoc -#include\ -"moc_QmlEthereum.cpp" - -#endif diff --git a/libqethereum/QmlEthereum.h b/libqethereum/QmlEthereum.h deleted file mode 100644 index d242540a1..000000000 --- a/libqethereum/QmlEthereum.h +++ /dev/null @@ -1,283 +0,0 @@ -#pragma once - -#include -#if ETH_QTQML -#include -#endif -#include -#include - -namespace dev { namespace eth { -class Client; -class State; -}} - -class QQmlEngine; -class QmlAccount; -class QmlEthereum; - -extern dev::eth::Client* g_qmlClient; -extern QObject* g_qmlMain; - -Q_DECLARE_METATYPE(dev::u256) -Q_DECLARE_METATYPE(dev::Address) -Q_DECLARE_METATYPE(dev::Secret) -Q_DECLARE_METATYPE(dev::KeyPair) -//Q_DECLARE_METATYPE(QmlAccount*) -//Q_DECLARE_METATYPE(QmlEthereum*) - -class QmlU256Helper: public QObject -{ - Q_OBJECT - -public: - QmlU256Helper(QObject* _p = nullptr): QObject(_p) {} - - Q_INVOKABLE dev::u256 add(dev::u256 _a, dev::u256 _b) const { return _a + _b; } - Q_INVOKABLE dev::u256 sub(dev::u256 _a, dev::u256 _b) const { return _a - _b; } - Q_INVOKABLE dev::u256 mul(dev::u256 _a, int _b) const { return _a * _b; } - Q_INVOKABLE dev::u256 mul(int _a, dev::u256 _b) const { return _a * _b; } - Q_INVOKABLE dev::u256 div(dev::u256 _a, int _b) const { return _a / _b; } - - Q_INVOKABLE dev::u256 wei(double _s) const { return (dev::u256)_s; } - Q_INVOKABLE dev::u256 szabo(double _s) const { return (dev::u256)(_s * (double)dev::eth::szabo); } - Q_INVOKABLE dev::u256 finney(double _s) const { return (dev::u256)(_s * (double)dev::eth::finney); } - Q_INVOKABLE dev::u256 ether(double _s) const { return (dev::u256)(_s * (double)dev::eth::ether); } - Q_INVOKABLE dev::u256 wei(unsigned _s) const { return (dev::u256)_s; } - Q_INVOKABLE dev::u256 szabo(unsigned _s) const { return (dev::u256)(_s * dev::eth::szabo); } - Q_INVOKABLE dev::u256 finney(unsigned _s) const { return (dev::u256)(_s * dev::eth::finney); } - Q_INVOKABLE dev::u256 ether(unsigned _s) const { return (dev::u256)(_s * dev::eth::ether); } - Q_INVOKABLE double toWei(dev::u256 _t) const { return (double)_t; } - Q_INVOKABLE double toSzabo(dev::u256 _t) const { return toWei(_t) / (double)dev::eth::szabo; } - Q_INVOKABLE double toFinney(dev::u256 _t) const { return toWei(_t) / (double)dev::eth::finney; } - Q_INVOKABLE double toEther(dev::u256 _t) const { return toWei(_t) / (double)dev::eth::ether; } - - Q_INVOKABLE double value(dev::u256 _t) const { return (double)_t; } - - Q_INVOKABLE QString stringOf(dev::u256 _t) const { return QString::fromStdString(dev::eth::formatBalance(_t)); } -}; - -class QmlKeyHelper: public QObject -{ - Q_OBJECT - -public: - QmlKeyHelper(QObject* _p = nullptr): QObject(_p) {} - - Q_INVOKABLE dev::KeyPair create() const { return dev::KeyPair::create(); } - Q_INVOKABLE dev::Address address(dev::KeyPair _p) const { return _p.address(); } - Q_INVOKABLE dev::Secret secret(dev::KeyPair _p) const { return _p.secret(); } - Q_INVOKABLE dev::KeyPair keypair(dev::Secret _k) const { return dev::KeyPair(_k); } - - Q_INVOKABLE bool isNull(dev::Address _a) const { return !_a; } - - Q_INVOKABLE dev::Address addressOf(QString _s) const { return dev::Address(_s.toStdString()); } - Q_INVOKABLE QString stringOf(dev::Address _a) const { return QString::fromStdString(dev::toHex(_a.asArray())); } - Q_INVOKABLE QString toAbridged(dev::Address _a) const { return QString::fromStdString(_a.abridged()); } -}; -#if 0 -class QmlAccount: public QObject -{ - Q_OBJECT - -public: - QmlAccount(QObject* _p = nullptr); - virtual ~QmlAccount(); - - Q_INVOKABLE QmlEthereum* ethereum() const { return m_eth; } - Q_INVOKABLE dev::u256 balance() const; - Q_INVOKABLE double txCount() const; - Q_INVOKABLE bool isContract() const; - Q_INVOKABLE dev::Address address() const { return m_address; } - - // TODO: past transactions models. - -public slots: - void setEthereum(QmlEthereum* _eth); - void setAddress(dev::Address _a) { m_address = _a; } - -signals: - void changed(); - void ethChanged(); - -private: - QmlEthereum* m_eth = nullptr; - dev::Address m_address; - - Q_PROPERTY(dev::u256 balance READ balance NOTIFY changed STORED false) - Q_PROPERTY(double txCount READ txCount NOTIFY changed STORED false) - Q_PROPERTY(bool isContract READ isContract NOTIFY changed STORED false) - Q_PROPERTY(dev::Address address READ address WRITE setAddress NOTIFY changed) - Q_PROPERTY(QmlEthereum* ethereum READ ethereum WRITE setEthereum NOTIFY ethChanged) -}; - -class QmlEthereum: public QObject -{ - Q_OBJECT - -public: - QmlEthereum(QObject* _p = nullptr); - virtual ~QmlEthereum(); - - dev::eth::Client* client() const; - - static QObject* constructU256Helper(QQmlEngine*, QJSEngine*) { return new QmlU256Helper; } - static QObject* constructKeyHelper(QQmlEngine*, QJSEngine*) { return new QmlKeyHelper; } - - Q_INVOKABLE dev::Address coinbase() const; - - Q_INVOKABLE bool isListening() const; - Q_INVOKABLE bool isMining() const; - - Q_INVOKABLE dev::u256 balanceAt(dev::Address _a) const; - Q_INVOKABLE double txCountAt(dev::Address _a) const; - Q_INVOKABLE bool isContractAt(dev::Address _a) const; - - Q_INVOKABLE unsigned peerCount() const; - - Q_INVOKABLE QmlEthereum* self() { return this; } - -public slots: - void transact(dev::Secret _secret, dev::Address _dest, dev::u256 _amount, dev::u256 _gasPrice, dev::u256 _gas, QByteArray _data); - void transact(dev::Secret _secret, dev::u256 _amount, dev::u256 _gasPrice, dev::u256 _gas, QByteArray _init); - void setCoinbase(dev::Address); - void setMining(bool _l); - - void setListening(bool _l); - -signals: - void coinbaseChanged(); -// void netChanged(); -// void miningChanged(); - -private: - Q_PROPERTY(dev::Address coinbase READ coinbase WRITE setCoinbase NOTIFY coinbaseChanged) - Q_PROPERTY(bool listening READ isListening WRITE setListening) - Q_PROPERTY(bool mining READ isMining WRITE setMining) -}; -#endif -#if 0 -template T to(QVariant const& _s) { if (_s.type() != QVariant::String) return T(); auto s = _s.toString().toLatin1(); assert(s.size() == sizeof(T)); return *(T*)s.data(); } -template QVariant toQJS(T const& _s) { QLatin1String ret((char*)&_s, sizeof(T)); assert(QVariant(QString(ret)).toString().toLatin1().size() == sizeof(T)); assert(*(T*)(QVariant(QString(ret)).toString().toLatin1().data()) == _s); return QVariant(QString(ret)); } - -class U256Helper: public QObject -{ - Q_OBJECT - -public: - U256Helper(QObject* _p = nullptr): QObject(_p) {} - - static dev::u256 in(QVariant const& _s) { return to(_s); } - static QVariant out(dev::u256 const& _s) { return toQJS(_s); } - - Q_INVOKABLE QVariant add(QVariant _a, QVariant _b) const { return out(in(_a) + in(_b)); } - Q_INVOKABLE QVariant sub(QVariant _a, QVariant _b) const { return out(in(_a) - in(_b)); } - Q_INVOKABLE QVariant mul(QVariant _a, int _b) const { return out(in(_a) * in(_b)); } - Q_INVOKABLE QVariant mul(int _a, QVariant _b) const { return out(in(_a) * in(_b)); } - Q_INVOKABLE QVariant div(QVariant _a, int _b) const { return out(in(_a) / in(_b)); } - - Q_INVOKABLE QVariant wei(double _s) const { return out(dev::u256(_s)); } - Q_INVOKABLE QVariant szabo(double _s) const { return out(dev::u256(_s * (double)dev::eth::szabo)); } - Q_INVOKABLE QVariant finney(double _s) const { return out(dev::u256(_s * (double)dev::eth::finney)); } - Q_INVOKABLE QVariant ether(double _s) const { return out(dev::u256(_s * (double)dev::eth::ether)); } - Q_INVOKABLE QVariant wei(unsigned _s) const { return value(_s); } - Q_INVOKABLE QVariant szabo(unsigned _s) const { return out(dev::u256(_s) * dev::eth::szabo); } - Q_INVOKABLE QVariant finney(unsigned _s) const { return out(dev::u256(_s) * dev::eth::finney); } - Q_INVOKABLE QVariant ether(unsigned _s) const { return out(dev::u256(_s) * dev::eth::ether); } - Q_INVOKABLE double toWei(QVariant _t) const { return toValue(_t); } - Q_INVOKABLE double toSzabo(QVariant _t) const { return toWei(_t) / (double)dev::eth::szabo; } - Q_INVOKABLE double toFinney(QVariant _t) const { return toWei(_t) / (double)dev::eth::finney; } - Q_INVOKABLE double toEther(QVariant _t) const { return toWei(_t) / (double)dev::eth::ether; } - - Q_INVOKABLE QVariant value(unsigned _s) const { return out(dev::u256(_s)); } - Q_INVOKABLE double toValue(QVariant _t) const { return (double)in(_t); } - - Q_INVOKABLE QString ethOf(QVariant _t) const { return QString::fromStdString(dev::eth::formatBalance(in(_t))); } - Q_INVOKABLE QString stringOf(QVariant _t) const { return QString::fromStdString(dev::eth::toString(in(_t))); } - - Q_INVOKABLE QByteArray bytesOf(QVariant _t) const { dev::h256 b = in(_t); return QByteArray((char const*)&b, sizeof(dev::h256)); } - Q_INVOKABLE QVariant fromHex(QString _s) const { return out((dev::u256)dev::h256(_s.toStdString())); } - - Q_INVOKABLE QVariant fromAddress(QVariant/*dev::Address*/ _a) const { return out((dev::eth::u160)to(_a)); } - Q_INVOKABLE QVariant toAddress(QVariant/*dev::Address*/ _a) const { return toQJS((dev::eth::u160)in(_a)); } - - Q_INVOKABLE bool isNull(QVariant/*dev::Address*/ _a) const { return !in(_a); } -}; - -class KeyHelper: public QObject -{ - Q_OBJECT - -public: - KeyHelper(QObject* _p = nullptr): QObject(_p) {} - - static dev::Address in(QVariant const& _s) { return to(_s); } - static QVariant out(dev::Address const& _s) { return toQJS(_s); } - - Q_INVOKABLE QVariant/*dev::KeyPair*/ create() const { return toQJS(dev::KeyPair::create()); } - Q_INVOKABLE QVariant/*dev::Address*/ address(QVariant/*dev::KeyPair*/ _p) const { return out(to(_p).address()); } - Q_INVOKABLE QVariant/*dev::Secret*/ secret(QVariant/*dev::KeyPair*/ _p) const { return toQJS(to(_p).secret()); } - Q_INVOKABLE QVariant/*dev::KeyPair*/ keypair(QVariant/*dev::Secret*/ _k) const { return toQJS(dev::KeyPair(to(_k))); } - - Q_INVOKABLE bool isNull(QVariant/*dev::Address*/ _a) const { return !in(_a); } - - Q_INVOKABLE QVariant/*dev::Address*/ addressOf(QString _s) const { return out(dev::Address(_s.toStdString())); } - Q_INVOKABLE QString stringOf(QVariant/*dev::Address*/ _a) const { return QString::fromStdString(dev::eth::toHex(in(_a).asArray())); } - Q_INVOKABLE QString toAbridged(QVariant/*dev::Address*/ _a) const { return QString::fromStdString(in(_a).abridged()); } - -}; - -class BytesHelper: public QObject -{ - Q_OBJECT - -public: - BytesHelper(QObject* _p = nullptr): QObject(_p) {} - - Q_INVOKABLE QByteArray concat(QVariant _v, QVariant _w) const - { - QByteArray ba; - if (_v.type() == QVariant::ByteArray) - ba = _v.toByteArray(); - else - ba = _v.toString().toLatin1(); - QByteArray ba2; - if (_w.type() == QVariant::ByteArray) - ba2 = _w.toByteArray(); - else - ba2 = _w.toString().toLatin1(); - ba.append(ba2); - return QByteArray(ba); - } - Q_INVOKABLE QByteArray concat(QByteArray _v, QByteArray _w) const - { - _v.append(_w); - return _v; - } - Q_INVOKABLE QByteArray fromString(QString _s) const - { - return _s.toLatin1(); - } - Q_INVOKABLE QByteArray fromString(QString _s, unsigned _padding) const - { - QByteArray b = _s.toLatin1(); - for (unsigned i = b.size(); i < _padding; ++i) - b.append((char)0); - b.resize(_padding); - return b; - } - Q_INVOKABLE QString toString(QByteArray _b) const - { - while (_b.size() && !_b[_b.size() - 1]) - _b.resize(_b.size() - 1); - return QString::fromLatin1(_b); - } - Q_INVOKABLE QVariant u256of(QByteArray _s) const - { - while (_s.size() < 32) - _s.append((char)0); - dev::h256 ret((uint8_t const*)_s.data(), dev::h256::ConstructFromPointer); - return toQJS(ret); - } -}; -#endif diff --git a/libserpent/CMakeLists.txt b/libserpent/CMakeLists.txt index c2fe89cc0..1c5b8e147 100644 --- a/libserpent/CMakeLists.txt +++ b/libserpent/CMakeLists.txt @@ -1,45 +1,32 @@ cmake_policy(SET CMP0015 NEW) +# this policy was introduced in cmake 3.0 +# remove if, once 3.0 will be used on unix +if (${CMAKE_MAJOR_VERSION} GREATER 2) + # old policy do not use MACOSX_RPATH + cmake_policy(SET CMP0042 OLD) +endif() +set(CMAKE_AUTOMOC OFF) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB") aux_source_directory(. SRC_LIST) +include_directories(..) + set(EXECUTABLE serpent) file(GLOB HEADERS "*.h") + if(ETH_STATIC) add_library(${EXECUTABLE} STATIC ${SRC_LIST} ${HEADERS}) else() add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) endif() -include_directories(..) - target_link_libraries(${EXECUTABLE} lll) target_link_libraries(${EXECUTABLE} evmcore) target_link_libraries(${EXECUTABLE} devcore) -if("${TARGET_PLATFORM}" STREQUAL "w64") - target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) - target_link_libraries(${EXECUTABLE} iphlpapi) - target_link_libraries(${EXECUTABLE} ws2_32) - target_link_libraries(${EXECUTABLE} mswsock) - target_link_libraries(${EXECUTABLE} shlwapi) -elseif (APPLE) - # Latest mavericks boost libraries only come with -mt - target_link_libraries(${EXECUTABLE} boost_thread-mt) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -elseif (UNIX) - target_link_libraries(${EXECUTABLE} ${Boost_THREAD_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -else () - target_link_libraries(${EXECUTABLE} boost_thread) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -endif () - install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) -#install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libserpent.so DESTINATION lib ) diff --git a/libserpent/rewriter.cpp b/libserpent/rewriter.cpp index 3042eeb45..443457acf 100644 --- a/libserpent/rewriter.cpp +++ b/libserpent/rewriter.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "util.h" #include "lllparser.h" #include "bignum.h" diff --git a/libserpent/util.cpp b/libserpent/util.cpp index 39eeb20be..fbce5e8b5 100644 --- a/libserpent/util.cpp +++ b/libserpent/util.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "util.h" #include "bignum.h" #include diff --git a/libsolidity/CMakeLists.txt b/libsolidity/CMakeLists.txt index b5147ced3..0a0b62bdd 100644 --- a/libsolidity/CMakeLists.txt +++ b/libsolidity/CMakeLists.txt @@ -1,25 +1,33 @@ cmake_policy(SET CMP0015 NEW) +# this policy was introduced in cmake 3.0 +# remove if, once 3.0 will be used on unix +if (${CMAKE_MAJOR_VERSION} GREATER 2) + # old policy do not use MACOSX_RPATH + cmake_policy(SET CMP0042 OLD) +endif() +set(CMAKE_AUTOMOC OFF) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB") aux_source_directory(. SRC_LIST) +include_directories(${Boost_INCLUDE_DIRS}) +include_directories(${JSONCPP_INCLUDE_DIRS}) +include_directories(..) + set(EXECUTABLE solidity) file(GLOB HEADERS "*.h") -if(ETH_STATIC) + +if (ETH_STATIC) add_library(${EXECUTABLE} STATIC ${SRC_LIST} ${HEADERS}) else() add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) endif() -include_directories(..) - -target_link_libraries(${EXECUTABLE} evmcore devcore) -# TODO: Temporary until PR 532 https://github.com/ethereum/cpp-ethereum/pull/532 -# gets accepted. Then we can simply add jsoncpp as a dependency and not the -# whole of JSONRPC as we are doing right here -target_link_libraries(${EXECUTABLE} ${JSONRPC_LS}) +target_link_libraries(${EXECUTABLE} ${JSONCPP_LIBRARIES}) +target_link_libraries(${EXECUTABLE} evmcore) +target_link_libraries(${EXECUTABLE} devcore) install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) diff --git a/libsolidity/GlobalContext.cpp b/libsolidity/GlobalContext.cpp index 915d06bf2..f4805b1f7 100644 --- a/libsolidity/GlobalContext.cpp +++ b/libsolidity/GlobalContext.cpp @@ -33,7 +33,7 @@ namespace solidity { GlobalContext::GlobalContext(): - m_magicVariables{make_shared("block", make_shared(MagicType::Kind::BLOCK)), +m_magicVariables(vector>{make_shared("block", make_shared(MagicType::Kind::BLOCK)), make_shared("msg", make_shared(MagicType::Kind::MSG)), make_shared("tx", make_shared(MagicType::Kind::TX)), make_shared("suicide", @@ -59,7 +59,7 @@ GlobalContext::GlobalContext(): make_shared("ripemd160", make_shared(TypePointers({std::make_shared(256, IntegerType::Modifier::HASH)}), TypePointers({std::make_shared(160, IntegerType::Modifier::HASH)}), - FunctionType::Location::RIPEMD160))} + FunctionType::Location::RIPEMD160))}) { } diff --git a/libsolidity/InterfaceHandler.h b/libsolidity/InterfaceHandler.h index d71345b96..b1cd4b562 100644 --- a/libsolidity/InterfaceHandler.h +++ b/libsolidity/InterfaceHandler.h @@ -28,7 +28,7 @@ #include #include -#include +#include namespace dev { diff --git a/libsolidity/Token.h b/libsolidity/Token.h index 51450f1a2..22378ae07 100644 --- a/libsolidity/Token.h +++ b/libsolidity/Token.h @@ -329,6 +329,9 @@ class Token { public: // All token values. + // attention! msvc issue: + // http://stackoverflow.com/questions/9567868/compile-errors-after-adding-v8-to-my-project-c2143-c2059 + // @todo: avoid TOKEN_LIST macro #define T(name, string, precedence) name, enum Value { diff --git a/libweb3jsonrpc/CMakeLists.txt b/libweb3jsonrpc/CMakeLists.txt index 0c6afd2b1..f371024e6 100644 --- a/libweb3jsonrpc/CMakeLists.txt +++ b/libweb3jsonrpc/CMakeLists.txt @@ -1,55 +1,36 @@ cmake_policy(SET CMP0015 NEW) +# this policy was introduced in cmake 3.0 +# remove if, once 3.0 will be used on unix +if (${CMAKE_MAJOR_VERSION} GREATER 2) + # old policy do not use MACOSX_RPATH + cmake_policy(SET CMP0042 OLD) +endif() +set(CMAKE_AUTOMOC OFF) aux_source_directory(. SRC_LIST) +include_directories(${JSON_RPC_CPP_INCLUDE_DIRS}) +include_directories(${LEVELDB_INCLUDE_DIRS}) include_directories(..) -link_directories(../libethcore) -link_directories(../libwebthree) set(EXECUTABLE web3jsonrpc) + file(GLOB HEADERS "*.h") -if(ETH_STATIC) +if (ETH_STATIC) add_library(${EXECUTABLE} STATIC ${SRC_LIST} ${HEADERS}) else() add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) endif() +target_link_libraries(${EXECUTABLE} ${LEVELDB_LIBRARIES}) +target_link_libraries(${EXECUTABLE} ${JSONCPP_LIBRARIES}) +target_link_libraries(${EXECUTABLE} ${JSON_RPC_CPP_SERVER_LIBRARIES}) + target_link_libraries(${EXECUTABLE} webthree) target_link_libraries(${EXECUTABLE} secp256k1) -target_link_libraries(${EXECUTABLE} gmp) target_link_libraries(${EXECUTABLE} solidity) target_link_libraries(${EXECUTABLE} serpent) -if(MINIUPNPC_LS) - target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS}) -endif() -target_link_libraries(${EXECUTABLE} ${LEVELDB_LS}) -target_link_libraries(${EXECUTABLE} ${CRYPTOPP_LS}) -target_link_libraries(${EXECUTABLE} ${JSONRPC_LS}) -target_link_libraries(${EXECUTABLE} ${LEVELDB_LS}) -if(READLINE_LS) -target_link_libraries(${EXECUTABLE} ${READLINE_LS}) -endif() - -if ("${TARGET_PLATFORM}" STREQUAL "w64") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++") - target_link_libraries(${EXECUTABLE} boost_system-mt-s) - target_link_libraries(${EXECUTABLE} boost_filesystem-mt-s) - target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) - target_link_libraries(${EXECUTABLE} gcc) - target_link_libraries(${EXECUTABLE} gdi32) - target_link_libraries(${EXECUTABLE} ws2_32) - target_link_libraries(${EXECUTABLE} mswsock) - target_link_libraries(${EXECUTABLE} shlwapi) - target_link_libraries(${EXECUTABLE} iphlpapi) - set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) -elseif (UNIX) -else () - target_link_libraries(${EXECUTABLE} boost_system) - target_link_libraries(${EXECUTABLE} boost_filesystem) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -endif () install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) diff --git a/libweb3jsonrpc/CorsHttpServer.h b/libweb3jsonrpc/CorsHttpServer.h index d3bd8a6e9..e697ecaa1 100644 --- a/libweb3jsonrpc/CorsHttpServer.h +++ b/libweb3jsonrpc/CorsHttpServer.h @@ -19,7 +19,7 @@ * @date 2014 */ -#include +#include namespace jsonrpc { diff --git a/libweb3jsonrpc/WebThreeStubServer.cpp b/libweb3jsonrpc/WebThreeStubServer.cpp index 84a0ae42a..fc1bd28d1 100644 --- a/libweb3jsonrpc/WebThreeStubServer.cpp +++ b/libweb3jsonrpc/WebThreeStubServer.cpp @@ -21,6 +21,9 @@ * @date 2014 */ +#include +#include +#include #include "WebThreeStubServer.h" #include #include @@ -31,9 +34,6 @@ #include #include #include -#include -#include -#include #include using namespace std; @@ -75,6 +75,7 @@ static Json::Value toJson(dev::eth::Transaction const& _t) static Json::Value toJson(dev::eth::LogEntry const& _e) { Json::Value res; + res["data"] = jsFromBinary(_e.data); res["address"] = toJS(_e.address); for (auto const& t: _e.topics) @@ -207,7 +208,7 @@ static Json::Value toJson(h256 const& _h, shh::Envelope const& _e, shh::Message return res; } -WebThreeStubServer::WebThreeStubServer(jsonrpc::AbstractServerConnector* _conn, WebThreeDirect& _web3, std::vector const& _accounts): +WebThreeStubServer::WebThreeStubServer(jsonrpc::AbstractServerConnector& _conn, WebThreeDirect& _web3, std::vector const& _accounts): AbstractWebThreeStubServer(_conn), m_web3(_web3) { diff --git a/libweb3jsonrpc/WebThreeStubServer.h b/libweb3jsonrpc/WebThreeStubServer.h index cf969186d..474fda9af 100644 --- a/libweb3jsonrpc/WebThreeStubServer.h +++ b/libweb3jsonrpc/WebThreeStubServer.h @@ -29,7 +29,7 @@ #pragma warning(pop) #include -#include +#include #include #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" @@ -62,7 +62,7 @@ class Interface; class WebThreeStubServer: public AbstractWebThreeStubServer { public: - WebThreeStubServer(jsonrpc::AbstractServerConnector* _conn, dev::WebThreeDirect& _web3, std::vector const& _accounts); + WebThreeStubServer(jsonrpc::AbstractServerConnector& _conn, dev::WebThreeDirect& _web3, std::vector const& _accounts); virtual Json::Value eth_accounts(); virtual std::string eth_balanceAt(std::string const& _address); diff --git a/libweb3jsonrpc/abstractwebthreestubserver.h b/libweb3jsonrpc/abstractwebthreestubserver.h index c1208b5c4..a4be6aa45 100644 --- a/libweb3jsonrpc/abstractwebthreestubserver.h +++ b/libweb3jsonrpc/abstractwebthreestubserver.h @@ -1,351 +1,311 @@ /** - * THIS FILE IS GENERATED BY jsonrpcstub, DO NOT CHANGE IT!!!!! + * This file is generated by jsonrpcstub, DO NOT CHANGE IT MANUALLY! */ -#ifndef _ABSTRACTWEBTHREESTUBSERVER_H_ -#define _ABSTRACTWEBTHREESTUBSERVER_H_ +#ifndef JSONRPC_CPP_STUB_ABSTRACTWEBTHREESTUBSERVER_H_ +#define JSONRPC_CPP_STUB_ABSTRACTWEBTHREESTUBSERVER_H_ -#include +#include class AbstractWebThreeStubServer : public jsonrpc::AbstractServer { public: - AbstractWebThreeStubServer(jsonrpc::AbstractServerConnector* conn) : - jsonrpc::AbstractServer(conn) + AbstractWebThreeStubServer(jsonrpc::AbstractServerConnector &conn) : jsonrpc::AbstractServer(conn) { - this->bindAndAddMethod(new jsonrpc::Procedure("db_get", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::db_getI); - this->bindAndAddMethod(new jsonrpc::Procedure("db_getString", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::db_getStringI); - this->bindAndAddMethod(new jsonrpc::Procedure("db_put", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING,"param3",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::db_putI); - this->bindAndAddMethod(new jsonrpc::Procedure("db_putString", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING,"param3",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::db_putStringI); - this->bindAndAddMethod(new jsonrpc::Procedure("eth_accounts", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, NULL), &AbstractWebThreeStubServer::eth_accountsI); - this->bindAndAddMethod(new jsonrpc::Procedure("eth_balanceAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_balanceAtI); - this->bindAndAddMethod(new jsonrpc::Procedure("eth_blockByHash", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_blockByHashI); - this->bindAndAddMethod(new jsonrpc::Procedure("eth_blockByNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_blockByNumberI); - this->bindAndAddMethod(new jsonrpc::Procedure("eth_call", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_callI); - this->bindAndAddMethod(new jsonrpc::Procedure("eth_changed", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_changedI); - this->bindAndAddMethod(new jsonrpc::Procedure("eth_codeAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_codeAtI); this->bindAndAddMethod(new jsonrpc::Procedure("eth_coinbase", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_coinbaseI); - this->bindAndAddMethod(new jsonrpc::Procedure("eth_compilers", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, NULL), &AbstractWebThreeStubServer::eth_compilersI); - this->bindAndAddMethod(new jsonrpc::Procedure("eth_countAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_REAL, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_countAtI); - this->bindAndAddMethod(new jsonrpc::Procedure("eth_defaultBlock", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_defaultBlockI); - this->bindAndAddMethod(new jsonrpc::Procedure("eth_filterLogs", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_filterLogsI); - this->bindAndAddMethod(new jsonrpc::Procedure("eth_gasPrice", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_gasPriceI); + this->bindAndAddMethod(new jsonrpc::Procedure("eth_setCoinbase", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_setCoinbaseI); this->bindAndAddMethod(new jsonrpc::Procedure("eth_listening", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_listeningI); - this->bindAndAddMethod(new jsonrpc::Procedure("eth_lll", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_lllI); - this->bindAndAddMethod(new jsonrpc::Procedure("eth_logs", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_logsI); + this->bindAndAddMethod(new jsonrpc::Procedure("eth_setListening", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_setListeningI); this->bindAndAddMethod(new jsonrpc::Procedure("eth_mining", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_miningI); - this->bindAndAddMethod(new jsonrpc::Procedure("eth_newFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_newFilterI); - this->bindAndAddMethod(new jsonrpc::Procedure("eth_newFilterString", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_newFilterStringI); - this->bindAndAddMethod(new jsonrpc::Procedure("eth_number", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_numberI); + this->bindAndAddMethod(new jsonrpc::Procedure("eth_setMining", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_setMiningI); + this->bindAndAddMethod(new jsonrpc::Procedure("eth_gasPrice", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_gasPriceI); + this->bindAndAddMethod(new jsonrpc::Procedure("eth_accounts", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, NULL), &AbstractWebThreeStubServer::eth_accountsI); this->bindAndAddMethod(new jsonrpc::Procedure("eth_peerCount", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_peerCountI); - this->bindAndAddMethod(new jsonrpc::Procedure("eth_serpent", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_serpentI); - this->bindAndAddMethod(new jsonrpc::Procedure("eth_setCoinbase", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_setCoinbaseI); + this->bindAndAddMethod(new jsonrpc::Procedure("eth_defaultBlock", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_defaultBlockI); this->bindAndAddMethod(new jsonrpc::Procedure("eth_setDefaultBlock", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_setDefaultBlockI); - this->bindAndAddMethod(new jsonrpc::Procedure("eth_setListening", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_setListeningI); - this->bindAndAddMethod(new jsonrpc::Procedure("eth_setMining", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_setMiningI); - this->bindAndAddMethod(new jsonrpc::Procedure("eth_solidity", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_solidityI); + this->bindAndAddMethod(new jsonrpc::Procedure("eth_number", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_numberI); + this->bindAndAddMethod(new jsonrpc::Procedure("eth_balanceAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_balanceAtI); this->bindAndAddMethod(new jsonrpc::Procedure("eth_stateAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_stateAtI); this->bindAndAddMethod(new jsonrpc::Procedure("eth_storageAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_storageAtI); + this->bindAndAddMethod(new jsonrpc::Procedure("eth_countAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_REAL, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_countAtI); + this->bindAndAddMethod(new jsonrpc::Procedure("eth_codeAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_codeAtI); this->bindAndAddMethod(new jsonrpc::Procedure("eth_transact", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_transactI); + this->bindAndAddMethod(new jsonrpc::Procedure("eth_call", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_callI); + this->bindAndAddMethod(new jsonrpc::Procedure("eth_blockByHash", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_blockByHashI); + this->bindAndAddMethod(new jsonrpc::Procedure("eth_blockByNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_blockByNumberI); this->bindAndAddMethod(new jsonrpc::Procedure("eth_transactionByHash", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_transactionByHashI); this->bindAndAddMethod(new jsonrpc::Procedure("eth_transactionByNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_INTEGER,"param2",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_transactionByNumberI); this->bindAndAddMethod(new jsonrpc::Procedure("eth_uncleByHash", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_uncleByHashI); this->bindAndAddMethod(new jsonrpc::Procedure("eth_uncleByNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_INTEGER,"param2",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_uncleByNumberI); + this->bindAndAddMethod(new jsonrpc::Procedure("eth_compilers", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, NULL), &AbstractWebThreeStubServer::eth_compilersI); + this->bindAndAddMethod(new jsonrpc::Procedure("eth_lll", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_lllI); + this->bindAndAddMethod(new jsonrpc::Procedure("eth_solidity", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_solidityI); + this->bindAndAddMethod(new jsonrpc::Procedure("eth_serpent", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_serpentI); + this->bindAndAddMethod(new jsonrpc::Procedure("eth_newFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_newFilterI); + this->bindAndAddMethod(new jsonrpc::Procedure("eth_newFilterString", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_newFilterStringI); this->bindAndAddMethod(new jsonrpc::Procedure("eth_uninstallFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_uninstallFilterI); - this->bindAndAddMethod(new jsonrpc::Procedure("shh_addToGroup", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_addToGroupI); - this->bindAndAddMethod(new jsonrpc::Procedure("shh_changed", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::shh_changedI); + this->bindAndAddMethod(new jsonrpc::Procedure("eth_changed", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_changedI); + this->bindAndAddMethod(new jsonrpc::Procedure("eth_filterLogs", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_filterLogsI); + this->bindAndAddMethod(new jsonrpc::Procedure("eth_logs", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_logsI); + this->bindAndAddMethod(new jsonrpc::Procedure("db_put", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING,"param3",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::db_putI); + this->bindAndAddMethod(new jsonrpc::Procedure("db_get", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::db_getI); + this->bindAndAddMethod(new jsonrpc::Procedure("db_putString", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING,"param3",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::db_putStringI); + this->bindAndAddMethod(new jsonrpc::Procedure("db_getString", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::db_getStringI); + this->bindAndAddMethod(new jsonrpc::Procedure("shh_post", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::shh_postI); + this->bindAndAddMethod(new jsonrpc::Procedure("shh_newIdentity", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_newIdentityI); this->bindAndAddMethod(new jsonrpc::Procedure("shh_haveIdentity", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_haveIdentityI); - this->bindAndAddMethod(new jsonrpc::Procedure("shh_newFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::shh_newFilterI); this->bindAndAddMethod(new jsonrpc::Procedure("shh_newGroup", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_newGroupI); - this->bindAndAddMethod(new jsonrpc::Procedure("shh_newIdentity", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_newIdentityI); - this->bindAndAddMethod(new jsonrpc::Procedure("shh_post", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::shh_postI); + this->bindAndAddMethod(new jsonrpc::Procedure("shh_addToGroup", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_addToGroupI); + this->bindAndAddMethod(new jsonrpc::Procedure("shh_newFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::shh_newFilterI); this->bindAndAddMethod(new jsonrpc::Procedure("shh_uninstallFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::shh_uninstallFilterI); - - } - - inline virtual void db_getI(const Json::Value& request, Json::Value& response) - { - response = this->db_get(request[0u].asString(), request[1u].asString()); + this->bindAndAddMethod(new jsonrpc::Procedure("shh_changed", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::shh_changedI); } - inline virtual void db_getStringI(const Json::Value& request, Json::Value& response) + inline virtual void eth_coinbaseI(const Json::Value &request, Json::Value &response) { - response = this->db_getString(request[0u].asString(), request[1u].asString()); + (void)request; + response = this->eth_coinbase(); } - - inline virtual void db_putI(const Json::Value& request, Json::Value& response) + inline virtual void eth_setCoinbaseI(const Json::Value &request, Json::Value &response) { - response = this->db_put(request[0u].asString(), request[1u].asString(), request[2u].asString()); + response = this->eth_setCoinbase(request[0u].asString()); } - - inline virtual void db_putStringI(const Json::Value& request, Json::Value& response) + inline virtual void eth_listeningI(const Json::Value &request, Json::Value &response) { - response = this->db_putString(request[0u].asString(), request[1u].asString(), request[2u].asString()); + (void)request; + response = this->eth_listening(); } - - inline virtual void eth_accountsI(const Json::Value& request, Json::Value& response) + inline virtual void eth_setListeningI(const Json::Value &request, Json::Value &response) { - response = this->eth_accounts(); + response = this->eth_setListening(request[0u].asBool()); } - - inline virtual void eth_balanceAtI(const Json::Value& request, Json::Value& response) + inline virtual void eth_miningI(const Json::Value &request, Json::Value &response) { - response = this->eth_balanceAt(request[0u].asString()); + (void)request; + response = this->eth_mining(); } - - inline virtual void eth_blockByHashI(const Json::Value& request, Json::Value& response) + inline virtual void eth_setMiningI(const Json::Value &request, Json::Value &response) { - response = this->eth_blockByHash(request[0u].asString()); + response = this->eth_setMining(request[0u].asBool()); } - - inline virtual void eth_blockByNumberI(const Json::Value& request, Json::Value& response) + inline virtual void eth_gasPriceI(const Json::Value &request, Json::Value &response) { - response = this->eth_blockByNumber(request[0u].asInt()); + (void)request; + response = this->eth_gasPrice(); } - - inline virtual void eth_callI(const Json::Value& request, Json::Value& response) + inline virtual void eth_accountsI(const Json::Value &request, Json::Value &response) { - response = this->eth_call(request[0u]); + (void)request; + response = this->eth_accounts(); } - - inline virtual void eth_changedI(const Json::Value& request, Json::Value& response) + inline virtual void eth_peerCountI(const Json::Value &request, Json::Value &response) { - response = this->eth_changed(request[0u].asInt()); + (void)request; + response = this->eth_peerCount(); } - - inline virtual void eth_codeAtI(const Json::Value& request, Json::Value& response) + inline virtual void eth_defaultBlockI(const Json::Value &request, Json::Value &response) { - response = this->eth_codeAt(request[0u].asString()); + (void)request; + response = this->eth_defaultBlock(); } - - inline virtual void eth_coinbaseI(const Json::Value& request, Json::Value& response) + inline virtual void eth_setDefaultBlockI(const Json::Value &request, Json::Value &response) { - response = this->eth_coinbase(); + response = this->eth_setDefaultBlock(request[0u].asInt()); } - - inline virtual void eth_compilersI(const Json::Value& request, Json::Value& response) + inline virtual void eth_numberI(const Json::Value &request, Json::Value &response) { - response = this->eth_compilers(); + (void)request; + response = this->eth_number(); } - - inline virtual void eth_countAtI(const Json::Value& request, Json::Value& response) + inline virtual void eth_balanceAtI(const Json::Value &request, Json::Value &response) { - response = this->eth_countAt(request[0u].asString()); + response = this->eth_balanceAt(request[0u].asString()); } - - inline virtual void eth_defaultBlockI(const Json::Value& request, Json::Value& response) + inline virtual void eth_stateAtI(const Json::Value &request, Json::Value &response) { - response = this->eth_defaultBlock(); + response = this->eth_stateAt(request[0u].asString(), request[1u].asString()); } - - inline virtual void eth_filterLogsI(const Json::Value& request, Json::Value& response) + inline virtual void eth_storageAtI(const Json::Value &request, Json::Value &response) { - response = this->eth_filterLogs(request[0u].asInt()); + response = this->eth_storageAt(request[0u].asString()); } - - inline virtual void eth_gasPriceI(const Json::Value& request, Json::Value& response) + inline virtual void eth_countAtI(const Json::Value &request, Json::Value &response) { - response = this->eth_gasPrice(); + response = this->eth_countAt(request[0u].asString()); } - - inline virtual void eth_listeningI(const Json::Value& request, Json::Value& response) + inline virtual void eth_codeAtI(const Json::Value &request, Json::Value &response) { - response = this->eth_listening(); + response = this->eth_codeAt(request[0u].asString()); } - - inline virtual void eth_lllI(const Json::Value& request, Json::Value& response) + inline virtual void eth_transactI(const Json::Value &request, Json::Value &response) { - response = this->eth_lll(request[0u].asString()); + response = this->eth_transact(request[0u]); } - - inline virtual void eth_logsI(const Json::Value& request, Json::Value& response) + inline virtual void eth_callI(const Json::Value &request, Json::Value &response) { - response = this->eth_logs(request[0u]); + response = this->eth_call(request[0u]); } - - inline virtual void eth_miningI(const Json::Value& request, Json::Value& response) + inline virtual void eth_blockByHashI(const Json::Value &request, Json::Value &response) { - response = this->eth_mining(); + response = this->eth_blockByHash(request[0u].asString()); } - - inline virtual void eth_newFilterI(const Json::Value& request, Json::Value& response) + inline virtual void eth_blockByNumberI(const Json::Value &request, Json::Value &response) { - response = this->eth_newFilter(request[0u]); + response = this->eth_blockByNumber(request[0u].asInt()); } - - inline virtual void eth_newFilterStringI(const Json::Value& request, Json::Value& response) + inline virtual void eth_transactionByHashI(const Json::Value &request, Json::Value &response) { - response = this->eth_newFilterString(request[0u].asString()); + response = this->eth_transactionByHash(request[0u].asString(), request[1u].asInt()); } - - inline virtual void eth_numberI(const Json::Value& request, Json::Value& response) + inline virtual void eth_transactionByNumberI(const Json::Value &request, Json::Value &response) { - response = this->eth_number(); + response = this->eth_transactionByNumber(request[0u].asInt(), request[1u].asInt()); } - - inline virtual void eth_peerCountI(const Json::Value& request, Json::Value& response) + inline virtual void eth_uncleByHashI(const Json::Value &request, Json::Value &response) { - response = this->eth_peerCount(); + response = this->eth_uncleByHash(request[0u].asString(), request[1u].asInt()); } - - inline virtual void eth_serpentI(const Json::Value& request, Json::Value& response) + inline virtual void eth_uncleByNumberI(const Json::Value &request, Json::Value &response) { - response = this->eth_serpent(request[0u].asString()); + response = this->eth_uncleByNumber(request[0u].asInt(), request[1u].asInt()); } - - inline virtual void eth_setCoinbaseI(const Json::Value& request, Json::Value& response) + inline virtual void eth_compilersI(const Json::Value &request, Json::Value &response) { - response = this->eth_setCoinbase(request[0u].asString()); + (void)request; + response = this->eth_compilers(); } - - inline virtual void eth_setDefaultBlockI(const Json::Value& request, Json::Value& response) + inline virtual void eth_lllI(const Json::Value &request, Json::Value &response) { - response = this->eth_setDefaultBlock(request[0u].asInt()); + response = this->eth_lll(request[0u].asString()); } - - inline virtual void eth_setListeningI(const Json::Value& request, Json::Value& response) + inline virtual void eth_solidityI(const Json::Value &request, Json::Value &response) { - response = this->eth_setListening(request[0u].asBool()); + response = this->eth_solidity(request[0u].asString()); } - - inline virtual void eth_setMiningI(const Json::Value& request, Json::Value& response) + inline virtual void eth_serpentI(const Json::Value &request, Json::Value &response) { - response = this->eth_setMining(request[0u].asBool()); + response = this->eth_serpent(request[0u].asString()); } - - inline virtual void eth_solidityI(const Json::Value& request, Json::Value& response) + inline virtual void eth_newFilterI(const Json::Value &request, Json::Value &response) { - response = this->eth_solidity(request[0u].asString()); + response = this->eth_newFilter(request[0u]); } - - inline virtual void eth_stateAtI(const Json::Value& request, Json::Value& response) + inline virtual void eth_newFilterStringI(const Json::Value &request, Json::Value &response) { - response = this->eth_stateAt(request[0u].asString(), request[1u].asString()); + response = this->eth_newFilterString(request[0u].asString()); } - - inline virtual void eth_storageAtI(const Json::Value& request, Json::Value& response) + inline virtual void eth_uninstallFilterI(const Json::Value &request, Json::Value &response) { - response = this->eth_storageAt(request[0u].asString()); + response = this->eth_uninstallFilter(request[0u].asInt()); } - - inline virtual void eth_transactI(const Json::Value& request, Json::Value& response) + inline virtual void eth_changedI(const Json::Value &request, Json::Value &response) { - response = this->eth_transact(request[0u]); + response = this->eth_changed(request[0u].asInt()); } - - inline virtual void eth_transactionByHashI(const Json::Value& request, Json::Value& response) + inline virtual void eth_filterLogsI(const Json::Value &request, Json::Value &response) { - response = this->eth_transactionByHash(request[0u].asString(), request[1u].asInt()); + response = this->eth_filterLogs(request[0u].asInt()); } - - inline virtual void eth_transactionByNumberI(const Json::Value& request, Json::Value& response) + inline virtual void eth_logsI(const Json::Value &request, Json::Value &response) { - response = this->eth_transactionByNumber(request[0u].asInt(), request[1u].asInt()); + response = this->eth_logs(request[0u]); } - - inline virtual void eth_uncleByHashI(const Json::Value& request, Json::Value& response) + inline virtual void db_putI(const Json::Value &request, Json::Value &response) { - response = this->eth_uncleByHash(request[0u].asString(), request[1u].asInt()); + response = this->db_put(request[0u].asString(), request[1u].asString(), request[2u].asString()); } - - inline virtual void eth_uncleByNumberI(const Json::Value& request, Json::Value& response) + inline virtual void db_getI(const Json::Value &request, Json::Value &response) { - response = this->eth_uncleByNumber(request[0u].asInt(), request[1u].asInt()); + response = this->db_get(request[0u].asString(), request[1u].asString()); } - - inline virtual void eth_uninstallFilterI(const Json::Value& request, Json::Value& response) + inline virtual void db_putStringI(const Json::Value &request, Json::Value &response) { - response = this->eth_uninstallFilter(request[0u].asInt()); + response = this->db_putString(request[0u].asString(), request[1u].asString(), request[2u].asString()); } - - inline virtual void shh_addToGroupI(const Json::Value& request, Json::Value& response) + inline virtual void db_getStringI(const Json::Value &request, Json::Value &response) { - response = this->shh_addToGroup(request[0u].asString(), request[1u].asString()); + response = this->db_getString(request[0u].asString(), request[1u].asString()); } - - inline virtual void shh_changedI(const Json::Value& request, Json::Value& response) + inline virtual void shh_postI(const Json::Value &request, Json::Value &response) { - response = this->shh_changed(request[0u].asInt()); + response = this->shh_post(request[0u]); } - - inline virtual void shh_haveIdentityI(const Json::Value& request, Json::Value& response) + inline virtual void shh_newIdentityI(const Json::Value &request, Json::Value &response) { - response = this->shh_haveIdentity(request[0u].asString()); + (void)request; + response = this->shh_newIdentity(); } - - inline virtual void shh_newFilterI(const Json::Value& request, Json::Value& response) + inline virtual void shh_haveIdentityI(const Json::Value &request, Json::Value &response) { - response = this->shh_newFilter(request[0u]); + response = this->shh_haveIdentity(request[0u].asString()); } - - inline virtual void shh_newGroupI(const Json::Value& request, Json::Value& response) + inline virtual void shh_newGroupI(const Json::Value &request, Json::Value &response) { response = this->shh_newGroup(request[0u].asString(), request[1u].asString()); } - - inline virtual void shh_newIdentityI(const Json::Value& request, Json::Value& response) + inline virtual void shh_addToGroupI(const Json::Value &request, Json::Value &response) { - response = this->shh_newIdentity(); + response = this->shh_addToGroup(request[0u].asString(), request[1u].asString()); } - - inline virtual void shh_postI(const Json::Value& request, Json::Value& response) + inline virtual void shh_newFilterI(const Json::Value &request, Json::Value &response) { - response = this->shh_post(request[0u]); + response = this->shh_newFilter(request[0u]); } - - inline virtual void shh_uninstallFilterI(const Json::Value& request, Json::Value& response) + inline virtual void shh_uninstallFilterI(const Json::Value &request, Json::Value &response) { response = this->shh_uninstallFilter(request[0u].asInt()); } - - - virtual std::string db_get(const std::string& param1, const std::string& param2) = 0; - virtual std::string db_getString(const std::string& param1, const std::string& param2) = 0; - virtual bool db_put(const std::string& param1, const std::string& param2, const std::string& param3) = 0; - virtual bool db_putString(const std::string& param1, const std::string& param2, const std::string& param3) = 0; - virtual Json::Value eth_accounts() = 0; - virtual std::string eth_balanceAt(const std::string& param1) = 0; - virtual Json::Value eth_blockByHash(const std::string& param1) = 0; - virtual Json::Value eth_blockByNumber(const int& param1) = 0; - virtual std::string eth_call(const Json::Value& param1) = 0; - virtual bool eth_changed(const int& param1) = 0; - virtual std::string eth_codeAt(const std::string& param1) = 0; + inline virtual void shh_changedI(const Json::Value &request, Json::Value &response) + { + response = this->shh_changed(request[0u].asInt()); + } virtual std::string eth_coinbase() = 0; - virtual Json::Value eth_compilers() = 0; - virtual double eth_countAt(const std::string& param1) = 0; - virtual int eth_defaultBlock() = 0; - virtual Json::Value eth_filterLogs(const int& param1) = 0; - virtual std::string eth_gasPrice() = 0; + virtual bool eth_setCoinbase(const std::string& param1) = 0; virtual bool eth_listening() = 0; - virtual std::string eth_lll(const std::string& param1) = 0; - virtual Json::Value eth_logs(const Json::Value& param1) = 0; + virtual bool eth_setListening(const bool& param1) = 0; virtual bool eth_mining() = 0; - virtual int eth_newFilter(const Json::Value& param1) = 0; - virtual int eth_newFilterString(const std::string& param1) = 0; - virtual int eth_number() = 0; + virtual bool eth_setMining(const bool& param1) = 0; + virtual std::string eth_gasPrice() = 0; + virtual Json::Value eth_accounts() = 0; virtual int eth_peerCount() = 0; - virtual std::string eth_serpent(const std::string& param1) = 0; - virtual bool eth_setCoinbase(const std::string& param1) = 0; + virtual int eth_defaultBlock() = 0; virtual bool eth_setDefaultBlock(const int& param1) = 0; - virtual bool eth_setListening(const bool& param1) = 0; - virtual bool eth_setMining(const bool& param1) = 0; - virtual std::string eth_solidity(const std::string& param1) = 0; + virtual int eth_number() = 0; + virtual std::string eth_balanceAt(const std::string& param1) = 0; virtual std::string eth_stateAt(const std::string& param1, const std::string& param2) = 0; virtual Json::Value eth_storageAt(const std::string& param1) = 0; + virtual double eth_countAt(const std::string& param1) = 0; + virtual std::string eth_codeAt(const std::string& param1) = 0; virtual std::string eth_transact(const Json::Value& param1) = 0; + virtual std::string eth_call(const Json::Value& param1) = 0; + virtual Json::Value eth_blockByHash(const std::string& param1) = 0; + virtual Json::Value eth_blockByNumber(const int& param1) = 0; virtual Json::Value eth_transactionByHash(const std::string& param1, const int& param2) = 0; virtual Json::Value eth_transactionByNumber(const int& param1, const int& param2) = 0; virtual Json::Value eth_uncleByHash(const std::string& param1, const int& param2) = 0; virtual Json::Value eth_uncleByNumber(const int& param1, const int& param2) = 0; + virtual Json::Value eth_compilers() = 0; + virtual std::string eth_lll(const std::string& param1) = 0; + virtual std::string eth_solidity(const std::string& param1) = 0; + virtual std::string eth_serpent(const std::string& param1) = 0; + virtual int eth_newFilter(const Json::Value& param1) = 0; + virtual int eth_newFilterString(const std::string& param1) = 0; virtual bool eth_uninstallFilter(const int& param1) = 0; - virtual std::string shh_addToGroup(const std::string& param1, const std::string& param2) = 0; - virtual Json::Value shh_changed(const int& param1) = 0; + virtual bool eth_changed(const int& param1) = 0; + virtual Json::Value eth_filterLogs(const int& param1) = 0; + virtual Json::Value eth_logs(const Json::Value& param1) = 0; + virtual bool db_put(const std::string& param1, const std::string& param2, const std::string& param3) = 0; + virtual std::string db_get(const std::string& param1, const std::string& param2) = 0; + virtual bool db_putString(const std::string& param1, const std::string& param2, const std::string& param3) = 0; + virtual std::string db_getString(const std::string& param1, const std::string& param2) = 0; + virtual bool shh_post(const Json::Value& param1) = 0; + virtual std::string shh_newIdentity() = 0; virtual bool shh_haveIdentity(const std::string& param1) = 0; - virtual int shh_newFilter(const Json::Value& param1) = 0; virtual std::string shh_newGroup(const std::string& param1, const std::string& param2) = 0; - virtual std::string shh_newIdentity() = 0; - virtual bool shh_post(const Json::Value& param1) = 0; + virtual std::string shh_addToGroup(const std::string& param1, const std::string& param2) = 0; + virtual int shh_newFilter(const Json::Value& param1) = 0; virtual bool shh_uninstallFilter(const int& param1) = 0; - + virtual Json::Value shh_changed(const int& param1) = 0; }; -#endif //_ABSTRACTWEBTHREESTUBSERVER_H_ + +#endif //JSONRPC_CPP_ABSTRACTWEBTHREESTUBSERVER_H_ diff --git a/libweb3jsonrpc/spec.json b/libweb3jsonrpc/spec.json index 4ad736f48..43d8d3f5a 100644 --- a/libweb3jsonrpc/spec.json +++ b/libweb3jsonrpc/spec.json @@ -1,59 +1,59 @@ [ - { "method": "eth_coinbase", "params": [], "order": [], "returns" : "" }, - { "method": "eth_setCoinbase", "params": [""], "order": [], "returns" : true }, - { "method": "eth_listening", "params": [], "order": [], "returns" : false }, - { "method": "eth_setListening", "params": [false], "order" : [], "returns" : true }, - { "method": "eth_mining", "params": [], "order": [], "returns" : false }, - { "method": "eth_setMining", "params": [false], "order" : [], "returns" : true }, - { "method": "eth_gasPrice", "params": [], "order": [], "returns" : "" }, - { "method": "eth_accounts", "params": [], "order": [], "returns" : [] }, - { "method": "eth_peerCount", "params": [], "order": [], "returns" : 0 }, - { "method": "eth_defaultBlock", "params": [], "order": [], "returns" : 0}, - { "method": "eth_setDefaultBlock", "params": [0], "order": [], "returns" : true}, - { "method": "eth_number", "params": [], "order": [], "returns" : 0}, - - { "method": "eth_balanceAt", "params": [""], "order": [], "returns" : ""}, - { "method": "eth_stateAt", "params": ["", ""], "order": [], "returns": ""}, - { "method": "eth_countAt", "params": [""], "order": [], "returns" : 0.0}, - { "method": "eth_codeAt", "params": [""], "order": [], "returns": ""}, - { "method": "eth_storageAt", "params": [""], "order": [], "returns": {}}, - - { "method": "eth_transact", "params": [{}], "order": [], "returns": ""}, - { "method": "eth_call", "params": [{}], "order": [], "returns": ""}, - - { "method": "eth_blockByHash", "params": [""],"order": [], "returns": {}}, - { "method": "eth_blockByNumber", "params": [0],"order": [], "returns": {}}, - { "method": "eth_transactionByHash", "params": ["", 0], "order": [], "returns": {}}, - { "method": "eth_transactionByNumber", "params": [0, 0], "order": [], "returns": {}}, - { "method": "eth_uncleByHash", "params": ["", 0], "order": [], "returns": {}}, - { "method": "eth_uncleByNumber", "params": [0, 0], "order": [], "returns": {}}, - - { "method": "eth_compilers", "params": [], "order": [], "returns": []}, - { "method": "eth_lll", "params": [""], "order": [], "returns": ""}, - { "method": "eth_solidity", "params": [""], "order": [], "returns": ""}, - { "method": "eth_serpent", "params": [""], "order": [], "returns": ""}, - - { "method": "eth_newFilter", "params": [{}], "order": [], "returns": 0}, - { "method": "eth_newFilterString", "params": [""], "order": [], "returns": 0}, - { "method": "eth_uninstallFilter", "params": [0], "order": [], "returns": true}, - { "method": "eth_changed", "params": [0], "order": [], "returns": false}, - { "method": "eth_filterLogs", "params": [0], "order": [], "returns": []}, - { "method": "eth_logs", "params": [{}], "order": [], "returns": []}, - - { "method": "db_put", "params": ["", "", ""], "order": [], "returns": true}, - { "method": "db_get", "params": ["", ""], "order": [], "returns": ""}, - { "method": "db_putString", "params": ["", "", ""], "order": [], "returns": true}, - { "method": "db_getString", "params": ["", ""], "order": [], "returns": ""}, - - { "method": "shh_post", "params": [{}], "order": [], "returns": true}, - { "method": "shh_newIdentity", "params": [], "order": [], "returns": ""}, - { "method": "shh_haveIdentity", "params": [""], "order": [], "returns": false}, - { "method": "shh_newGroup", "params": ["", ""], "order": [], "returns": ""}, - { "method": "shh_addToGroup", "params": ["", ""], "order": [], "returns": ""}, - - { "method": "shh_newFilter", "params": [{}], "order": [], "returns": 0}, - { "method": "shh_uninstallFilter", "params": [0], "order": [], "returns": true}, - { "method": "shh_changed", "params": [0], "order": [], "returns": []} + { "name": "eth_coinbase", "params": [], "order": [], "returns" : "" }, + { "name": "eth_setCoinbase", "params": [""], "order": [], "returns" : true }, + { "name": "eth_listening", "params": [], "order": [], "returns" : false }, + { "name": "eth_setListening", "params": [false], "order" : [], "returns" : true }, + { "name": "eth_mining", "params": [], "order": [], "returns" : false }, + { "name": "eth_setMining", "params": [false], "order" : [], "returns" : true }, + { "name": "eth_gasPrice", "params": [], "order": [], "returns" : "" }, + { "name": "eth_accounts", "params": [], "order": [], "returns" : [] }, + { "name": "eth_peerCount", "params": [], "order": [], "returns" : 0 }, + { "name": "eth_defaultBlock", "params": [], "order": [], "returns" : 0}, + { "name": "eth_setDefaultBlock", "params": [0], "order": [], "returns" : true}, + { "name": "eth_number", "params": [], "order": [], "returns" : 0}, + + { "name": "eth_balanceAt", "params": [""], "order": [], "returns" : ""}, + { "name": "eth_stateAt", "params": ["", ""], "order": [], "returns": ""}, + { "name": "eth_storageAt", "params": [""], "order": [], "returns": {}}, + { "name": "eth_countAt", "params": [""], "order": [], "returns" : 0.0}, + { "name": "eth_codeAt", "params": [""], "order": [], "returns": ""}, + + { "name": "eth_transact", "params": [{}], "order": [], "returns": ""}, + { "name": "eth_call", "params": [{}], "order": [], "returns": ""}, + + { "name": "eth_blockByHash", "params": [""],"order": [], "returns": {}}, + { "name": "eth_blockByNumber", "params": [0],"order": [], "returns": {}}, + { "name": "eth_transactionByHash", "params": ["", 0], "order": [], "returns": {}}, + { "name": "eth_transactionByNumber", "params": [0, 0], "order": [], "returns": {}}, + { "name": "eth_uncleByHash", "params": ["", 0], "order": [], "returns": {}}, + { "name": "eth_uncleByNumber", "params": [0, 0], "order": [], "returns": {}}, + + { "name": "eth_compilers", "params": [], "order": [], "returns": []}, + { "name": "eth_lll", "params": [""], "order": [], "returns": ""}, + { "name": "eth_solidity", "params": [""], "order": [], "returns": ""}, + { "name": "eth_serpent", "params": [""], "order": [], "returns": ""}, + + + { "name": "eth_newFilter", "params": [{}], "order": [], "returns": 0}, + { "name": "eth_newFilterString", "params": [""], "order": [], "returns": 0}, + { "name": "eth_uninstallFilter", "params": [0], "order": [], "returns": true}, + { "name": "eth_changed", "params": [0], "order": [], "returns": false}, + { "name": "eth_filterLogs", "params": [0], "order": [], "returns": []}, + { "name": "eth_logs", "params": [{}], "order": [], "returns": []}, + + { "name": "db_put", "params": ["", "", ""], "order": [], "returns": true}, + { "name": "db_get", "params": ["", ""], "order": [], "returns": ""}, + { "name": "db_putString", "params": ["", "", ""], "order": [], "returns": true}, + { "name": "db_getString", "params": ["", ""], "order": [], "returns": ""}, + + { "name": "shh_post", "params": [{}], "order": [], "returns": true}, + { "name": "shh_newIdentity", "params": [], "order": [], "returns": ""}, + { "name": "shh_haveIdentity", "params": [""], "order": [], "returns": false}, + { "name": "shh_newGroup", "params": ["", ""], "order": [], "returns": ""}, + { "name": "shh_addToGroup", "params": ["", ""], "order": [], "returns": ""}, + { "name": "shh_newFilter", "params": [{}], "order": [], "returns": 0}, + { "name": "shh_uninstallFilter", "params": [0], "order": [], "returns": true}, + { "name": "shh_changed", "params": [0], "order": [], "returns": []} ] diff --git a/libwebthree/CMakeLists.txt b/libwebthree/CMakeLists.txt index cc1b290f5..1d8f23918 100644 --- a/libwebthree/CMakeLists.txt +++ b/libwebthree/CMakeLists.txt @@ -1,19 +1,30 @@ cmake_policy(SET CMP0015 NEW) +# this policy was introduced in cmake 3.0 +# remove if, once 3.0 will be used on unix +if (${CMAKE_MAJOR_VERSION} GREATER 2) + # old policy do not use MACOSX_RPATH + cmake_policy(SET CMP0042 OLD) +endif() +set(CMAKE_AUTOMOC OFF) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB") aux_source_directory(. SRC_LIST) +include_directories(${LEVELDB_INCLUDE_DIRS}) +include_directories(..) + set(EXECUTABLE webthree) file(GLOB HEADERS "*.h") -if(ETH_STATIC) + +if (ETH_STATIC) add_library(${EXECUTABLE} STATIC ${SRC_LIST} ${HEADERS}) else() add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) endif() -include_directories(..) +target_link_libraries(${EXECUTABLE} ${LEVELDB_LIBRARIES}) target_link_libraries(${EXECUTABLE} ethereum) target_link_libraries(${EXECUTABLE} evm) @@ -23,45 +34,6 @@ target_link_libraries(${EXECUTABLE} p2p) target_link_libraries(${EXECUTABLE} ethcore) target_link_libraries(${EXECUTABLE} devcrypto) target_link_libraries(${EXECUTABLE} secp256k1) -if(MINIUPNPC_LS) -target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS}) -endif() -target_link_libraries(${EXECUTABLE} ${LEVELDB_LS}) -target_link_libraries(${EXECUTABLE} ${CRYPTOPP_LS}) -target_link_libraries(${EXECUTABLE} gmp) - -if("${TARGET_PLATFORM}" STREQUAL "w64") - target_link_libraries(${EXECUTABLE} boost_system-mt-s) - target_link_libraries(${EXECUTABLE} boost_regex-mt-s) - target_link_libraries(${EXECUTABLE} boost_filesystem-mt-s) - target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) - target_link_libraries(${EXECUTABLE} iphlpapi) - target_link_libraries(${EXECUTABLE} ws2_32) - target_link_libraries(${EXECUTABLE} mswsock) - target_link_libraries(${EXECUTABLE} shlwapi) -elseif (APPLE) - # Latest mavericks boost libraries only come with -mt - target_link_libraries(${EXECUTABLE} boost_system-mt) - target_link_libraries(${EXECUTABLE} boost_regex-mt) - target_link_libraries(${EXECUTABLE} boost_filesystem-mt) - target_link_libraries(${EXECUTABLE} boost_thread-mt) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -elseif (UNIX) - target_link_libraries(${EXECUTABLE} ${Boost_SYSTEM_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_REGEX_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_FILESYSTEM_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_THREAD_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_DATE_TIME_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -else () - target_link_libraries(${EXECUTABLE} boost_system) - target_link_libraries(${EXECUTABLE} boost_regex) - target_link_libraries(${EXECUTABLE} boost_filesystem) - target_link_libraries(${EXECUTABLE} boost_thread) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -endif () install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) diff --git a/libwhisper/CMakeLists.txt b/libwhisper/CMakeLists.txt index 364d9759a..79879922e 100644 --- a/libwhisper/CMakeLists.txt +++ b/libwhisper/CMakeLists.txt @@ -1,65 +1,36 @@ cmake_policy(SET CMP0015 NEW) +# this policy was introduced in cmake 3.0 +# remove if, once 3.0 will be used on unix +if (${CMAKE_MAJOR_VERSION} GREATER 2) + # old policy do not use MACOSX_RPATH + cmake_policy(SET CMP0042 OLD) +endif() +set(CMAKE_AUTOMOC OFF) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB") aux_source_directory(. SRC_LIST) +include_directories(..) +include_directories(${LEVELDB_INCLUDE_DIRS}) + set(EXECUTABLE whisper) file(GLOB HEADERS "*.h") -if(ETH_STATIC) + +if (ETH_STATIC) add_library(${EXECUTABLE} STATIC ${SRC_LIST} ${HEADERS}) else() add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) endif() -include_directories(..) +target_link_libraries(${EXECUTABLE} ${LEVELDB_LIBRARIES}) target_link_libraries(${EXECUTABLE} ethcore) target_link_libraries(${EXECUTABLE} devcrypto) target_link_libraries(${EXECUTABLE} devcore) target_link_libraries(${EXECUTABLE} p2p) target_link_libraries(${EXECUTABLE} secp256k1) -if(MINIUPNPC_LS) -target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS}) -endif() -target_link_libraries(${EXECUTABLE} ${LEVELDB_LS}) -target_link_libraries(${EXECUTABLE} ${CRYPTOPP_LS}) -target_link_libraries(${EXECUTABLE} gmp) - -if("${TARGET_PLATFORM}" STREQUAL "w64") - target_link_libraries(${EXECUTABLE} boost_system-mt-s) - target_link_libraries(${EXECUTABLE} boost_regex-mt-s) - target_link_libraries(${EXECUTABLE} boost_filesystem-mt-s) - target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) - target_link_libraries(${EXECUTABLE} iphlpapi) - target_link_libraries(${EXECUTABLE} ws2_32) - target_link_libraries(${EXECUTABLE} mswsock) - target_link_libraries(${EXECUTABLE} shlwapi) -elseif (APPLE) - # Latest mavericks boost libraries only come with -mt - target_link_libraries(${EXECUTABLE} boost_system-mt) - target_link_libraries(${EXECUTABLE} boost_regex-mt) - target_link_libraries(${EXECUTABLE} boost_filesystem-mt) - target_link_libraries(${EXECUTABLE} boost_thread-mt) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -elseif (UNIX) - target_link_libraries(${EXECUTABLE} ${Boost_SYSTEM_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_REGEX_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_FILESYSTEM_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_THREAD_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${Boost_DATE_TIME_LIBRARY}) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -else () - target_link_libraries(${EXECUTABLE} boost_system) - target_link_libraries(${EXECUTABLE} boost_regex) - target_link_libraries(${EXECUTABLE} boost_filesystem) - target_link_libraries(${EXECUTABLE} boost_thread) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -endif () install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) - diff --git a/libwhisper/Interface.h b/libwhisper/Interface.h index 1af93f591..0b7b52cf7 100644 --- a/libwhisper/Interface.h +++ b/libwhisper/Interface.h @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file WhisperHost.h +/** @file Interface.h * @author Gav Wood * @date 2014 */ diff --git a/libwhisper/_libwhisper.cpp b/libwhisper/_libwhisper.cpp deleted file mode 100644 index 813c6a657..000000000 --- a/libwhisper/_libwhisper.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#ifdef _MSC_VER -#include "All.h" -#include "Common.cpp" -#include "WhisperPeer.cpp" -#include "WhisperHost.cpp" -#include "Message.cpp" -#include "Interface.cpp" -#endif diff --git a/lllc/CMakeLists.txt b/lllc/CMakeLists.txt index a9b53c74c..2e76aa6ff 100644 --- a/lllc/CMakeLists.txt +++ b/lllc/CMakeLists.txt @@ -1,32 +1,21 @@ cmake_policy(SET CMP0015 NEW) +set(CMAKE_AUTOMOC OFF) aux_source_directory(. SRC_LIST) +include_directories(${Boost_INCLUDE_DIRS}) include_directories(..) set(EXECUTABLE lllc) -add_executable(${EXECUTABLE} ${SRC_LIST}) +file(GLOB HEADERS "*.h") +add_executable(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) + +add_dependencies(${EXECUTABLE} BuildInfo.h) target_link_libraries(${EXECUTABLE} lll) target_link_libraries(${EXECUTABLE} evmcore) target_link_libraries(${EXECUTABLE} devcore) -if ("${TARGET_PLATFORM}" STREQUAL "w64") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++") - target_link_libraries(${EXECUTABLE} gcc) - target_link_libraries(${EXECUTABLE} gdi32) - target_link_libraries(${EXECUTABLE} ws2_32) - target_link_libraries(${EXECUTABLE} mswsock) - target_link_libraries(${EXECUTABLE} shlwapi) - target_link_libraries(${EXECUTABLE} iphlpapi) - target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) - set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) -elseif (UNIX) -else () - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -endif () - install( TARGETS ${EXECUTABLE} DESTINATION bin ) diff --git a/mix/CMakeLists.txt b/mix/CMakeLists.txt index 0252b5226..555f6290f 100644 --- a/mix/CMakeLists.txt +++ b/mix/CMakeLists.txt @@ -1,94 +1,48 @@ +cmake_policy(SET CMP0015 NEW) +# let cmake autolink dependencies on windows +cmake_policy(SET CMP0020 NEW) +# this policy was introduced in cmake 3.0 +# remove if, once 3.0 will be used on unix +if (${CMAKE_MAJOR_VERSION} GREATER 2) + cmake_policy(SET CMP0043 OLD) +endif() + set(CMAKE_INCLUDE_CURRENT_DIR ON) + aux_source_directory(. SRC_LIST) include_directories(..) - -if (APPLE) - # Add homebrew path for qt5 - set(CMAKE_PREFIX_PATH /usr/local/opt/qt5) - include_directories(/usr/local/opt/qt5/include /usr/local/include) -elseif ("${TARGET_PLATFORM}" STREQUAL "w64") - set(SRC_LIST ${SRC_LIST} ../windows/qt_plugin_import.cpp) - include_directories(/usr/x86_64-w64-mingw32/include /usr/x86_64-w64-mingw32/include/QtCore /usr/x86_64-w64-mingw32/include/QtGui /usr/x86_64-w64-mingw32/include/QtQuick /usr/x86_64-w64-mingw32/include/QtQml /usr/x86_64-w64-mingw32/include/QtNetwork /usr/x86_64-w64-mingw32/include/QtWidgets /usr/x86_64-w64-mingw32/include/QtWebKit /usr/x86_64-w64-mingw32/include/QtWebKitWidgets) -elseif (UNIX) - set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ";$ENV{QTDIR}/lib/cmake") -endif () - -find_package(Qt5Core REQUIRED) -find_package(Qt5Gui REQUIRED) -find_package(Qt5Quick REQUIRED) -find_package(Qt5Qml REQUIRED) -find_package(Qt5Network REQUIRED) -find_package(Qt5Widgets REQUIRED) -find_package(Qt5WebKit REQUIRED) -find_package(Qt5WebKitWidgets REQUIRED) - -#qt5_wrap_ui(ui_Main.h Main.ui) - qt5_add_resources(UI_RESOURCES qml.qrc) -# Set name of binary and add_executable() file(GLOB HEADERS "*.h") -if (APPLE) - set(EXECUTEABLE mix) - set(BIN_INSTALL_DIR ".") - set(DOC_INSTALL_DIR ".") - - set(PROJECT_VERSION "${ETH_VERSION}") - set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME} ${PROJECT_VERSION}") - set(MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_NAME} ${PROJECT_VERSION}") - set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME} ${PROJECT_VERSION}") - set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}") - set(MACOSX_BUNDLE_COPYRIGHT "${PROJECT_COPYRIGHT_YEAR} ${PROJECT_VENDOR}") - set(MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_DOMAIN_SECOND}.${PROJECT_DOMAIN_FIRST}") - set(MACOSX_BUNDLE_BUNDLE_NAME ${EXECUTEABLE}) - set(MACOSX_BUNDLE_ICON_FILE mix) - include(BundleUtilities) - - add_executable(${EXECUTEABLE} MACOSX_BUNDLE ${SRC_LIST} ${HEADERS} ${UI_RESOURCES}) - set_target_properties(${EXECUTEABLE} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/EthereumMacOSXBundleInfo.plist.in") - SET_SOURCE_FILES_PROPERTIES(${EXECUTEABLE} PROPERTIES MACOSX_PACKAGE_LOCATION MacOS) - SET_SOURCE_FILES_PROPERTIES(${MACOSX_BUNDLE_ICON_FILE}.icns PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") - -else () - set(EXECUTEABLE mix) - add_executable(${EXECUTEABLE} ${SRC_LIST} ${HEADERS} ${UI_RESOURCES}) -endif () - -qt5_use_modules(${EXECUTEABLE} Core)# Gui Widgets Network WebKit WebKitWidgets) -target_link_libraries(${EXECUTEABLE} webthree qethereum ethereum evm ethcore devcrypto secp256k1 gmp ${CRYPTOPP_LS} serpent lll solidity evmcore devcore web3jsonrpc jsqrc) - -if (APPLE) - # First have qt5 install plugins and frameworks - add_custom_command(TARGET ${EXECUTEABLE} POST_BUILD - COMMAND /usr/local/opt/qt5/bin/macdeployqt -qmldir=${CMAKE_CURRENT_SOURCE_DIR}/qml ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTEABLE}.app - WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) - # This tool and next will inspect linked libraries in order to determine which dependencies are required - if (${CMAKE_CFG_INTDIR} STREQUAL ".") - set(APP_BUNDLE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTEABLE}.app") - else () - set(APP_BUNDLE_PATH "${CMAKE_CURRENT_BINARY_DIR}/\$ENV{CONFIGURATION}/${EXECUTEABLE}.app") - endif () - install(CODE " - include(BundleUtilities) - set(BU_CHMOD_BUNDLE_ITEMS 1) - fixup_bundle(\"${APP_BUNDLE_PATH}\" \"${BUNDLELIBS}\" \"../libqethereum ../libethereum ../secp256k1\") - " COMPONENT RUNTIME ) - # Cleanup duplicate libs from macdeployqt - install(CODE " - file(GLOB LINGER_RM \"${APP_BUNDLE_PATH}/Contents/Frameworks/*.dylib\") - if (LINGER_RM) - file(REMOVE \${LINGER_RM}) - endif () - ") -elseif (UNIX) -else () - target_link_libraries(${EXECUTEABLE} boost_system) - target_link_libraries(${EXECUTEABLE} boost_filesystem) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTEABLE} ${CMAKE_THREAD_LIBS_INIT}) - install( TARGETS ${EXECUTEABLE} RUNTIME DESTINATION bin ) -endif () +set(EXECUTABLE mix) + +# eth_add_executable is defined in cmake/EthExecutableHelper.cmake +eth_add_executable(${EXECUTABLE} + ICON mix + UI_RESOURCES ${UI_RESOURCES} +) + +target_link_libraries(${EXECUTABLE} Qt5::Core) +target_link_libraries(${EXECUTABLE} Qt5::Gui) +target_link_libraries(${EXECUTABLE} webthree) +target_link_libraries(${EXECUTABLE} qethereum) +target_link_libraries(${EXECUTABLE} ethereum) +target_link_libraries(${EXECUTABLE} evm) +target_link_libraries(${EXECUTABLE} ethcore) +target_link_libraries(${EXECUTABLE} devcrypto) +target_link_libraries(${EXECUTABLE} secp256k1) +target_link_libraries(${EXECUTABLE} serpent) +target_link_libraries(${EXECUTABLE} lll) +target_link_libraries(${EXECUTABLE} solidity) +target_link_libraries(${EXECUTABLE} evmcore) +target_link_libraries(${EXECUTABLE} devcore) +target_link_libraries(${EXECUTABLE} web3jsonrpc) +target_link_libraries(${EXECUTABLE} jsqrc) + +# eth_install_executable is defined in cmake/EthExecutableHelper.cmake +eth_install_executable(${EXECUTABLE} + QMLDIR ${CMAKE_CURRENT_SOURCE_DIR}/qml +) -qt5_use_modules(${EXECUTEABLE} Core Gui) diff --git a/mix/CodeEditorExtensionManager.cpp b/mix/CodeEditorExtensionManager.cpp index c778d466f..9d0e8508d 100644 --- a/mix/CodeEditorExtensionManager.cpp +++ b/mix/CodeEditorExtensionManager.cpp @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file CodeEditorExtensionMan.cpp +/** @file CodeEditorExtensionManager.cpp * @author Yann yann@ethdev.com * @date 2014 * Ethereum IDE client. diff --git a/mix/CodeEditorExtensionManager.h b/mix/CodeEditorExtensionManager.h index 2b8402bf2..522429511 100644 --- a/mix/CodeEditorExtensionManager.h +++ b/mix/CodeEditorExtensionManager.h @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file CodeEditorExtensionMan.h +/** @file CodeEditorExtensionManager.h * @author Yann yann@ethdev.com * @date 2014 * Ethereum IDE client. diff --git a/mix/ConstantCompilationCtrl.cpp b/mix/ConstantCompilationCtrl.cpp index 06b9c0284..12eca8a40 100644 --- a/mix/ConstantCompilationCtrl.cpp +++ b/mix/ConstantCompilationCtrl.cpp @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file ConstantCompilation.cpp +/** @file ConstantCompilationCtrl.cpp * @author Yann yann@ethdev.com * @date 2014 * Ethereum IDE client. diff --git a/mix/ConstantCompilationCtrl.h b/mix/ConstantCompilationCtrl.h index e4661c800..8e32b7589 100644 --- a/mix/ConstantCompilationCtrl.h +++ b/mix/ConstantCompilationCtrl.h @@ -11,7 +11,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file ConstantCompilation.h +/** @file ConstantCompilationCtrl.h * @author Yann yann@ethdev.com * @date 2014 * Ethereum IDE client. diff --git a/mix/ConstantCompilationModel.cpp b/mix/ConstantCompilationModel.cpp index ea12a267c..722305763 100644 --- a/mix/ConstantCompilationModel.cpp +++ b/mix/ConstantCompilationModel.cpp @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file ApplicationCtx.h +/** @file ConstantCompilationModel.cpp * @author Yann yann@ethdev.com * @date 2014 * Ethereum IDE client. diff --git a/mix/ConstantCompilationModel.h b/mix/ConstantCompilationModel.h index 4a17853f6..9b8855a3e 100644 --- a/mix/ConstantCompilationModel.h +++ b/mix/ConstantCompilationModel.h @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file ApplicationCtx.h +/** @file ConstantCompilationModel.h * @author Yann yann@ethdev.com * @date 2014 * Ethereum IDE client. diff --git a/mix/EthereumMacOSXBundleInfo.plist.in b/mix/EthereumMacOSXBundleInfo.plist.in deleted file mode 100644 index 684ad7908..000000000 --- a/mix/EthereumMacOSXBundleInfo.plist.in +++ /dev/null @@ -1,38 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${MACOSX_BUNDLE_EXECUTABLE_NAME} - CFBundleGetInfoString - ${MACOSX_BUNDLE_INFO_STRING} - CFBundleIconFile - ${MACOSX_BUNDLE_ICON_FILE} - CFBundleIdentifier - ${MACOSX_BUNDLE_GUI_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleLongVersionString - ${MACOSX_BUNDLE_LONG_VERSION_STRING} - CFBundleName - ${MACOSX_BUNDLE_BUNDLE_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - ${MACOSX_BUNDLE_SHORT_VERSION_STRING} - CFBundleSignature - ???? - CFBundleVersion - ${MACOSX_BUNDLE_BUNDLE_VERSION} - CSResourcesFileMapped - - LSRequiresCarbon - - NSHumanReadableCopyright - ${MACOSX_BUNDLE_COPYRIGHT} - NSHighResolutionCapable - - - diff --git a/mix/Extension.cpp b/mix/Extension.cpp index 5aeb0cc17..cb1394194 100644 --- a/mix/Extension.cpp +++ b/mix/Extension.cpp @@ -11,7 +11,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file Feature.cpp +/** @file Extension.cpp * @author Yann yann@ethdev.com * @date 2014 * Ethereum IDE client. diff --git a/mix/Extension.h b/mix/Extension.h index f8fef0aa6..84fe8e2dc 100644 --- a/mix/Extension.h +++ b/mix/Extension.h @@ -11,7 +11,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file Feature.h +/** @file Extension.h * @author Yann yann@ethdev.com * @date 2014 * Ethereum IDE client. diff --git a/mix/MixApplication.cpp b/mix/MixApplication.cpp index e67ca1b12..d374188b9 100644 --- a/mix/MixApplication.cpp +++ b/mix/MixApplication.cpp @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file main.cpp +/** @file MixApplication.cpp * @author Yann yann@ethdev.com * @date 2014 */ diff --git a/mix/MixApplication.h b/mix/MixApplication.h index fdc506268..b0ea0f216 100644 --- a/mix/MixApplication.h +++ b/mix/MixApplication.h @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file main.cpp +/** @file MixApplication.h * @author Yann yann@ethdev.com * @date 2014 * This class will be use instead of QApplication to launch the application. the method 'notify' allows to catch all exceptions. diff --git a/neth/CMakeLists.txt b/neth/CMakeLists.txt index ac275f663..4db3d2cf4 100644 --- a/neth/CMakeLists.txt +++ b/neth/CMakeLists.txt @@ -2,52 +2,27 @@ cmake_policy(SET CMP0015 NEW) aux_source_directory(. SRC_LIST) +include_directories(${JSON_RPC_CPP_INCLUDE_DIRS}) +include_directories(${LEVELDB_INCLUDE_DIRS}) include_directories(..) -include_directories(${LEVELDB_ID}) set(EXECUTABLE neth) add_executable(${EXECUTABLE} ${SRC_LIST}) +add_dependencies(${EXECUTABLE} BuildInfo.h) + +target_link_libraries(${EXECUTABLE} ${LEVELDB_LIBRARIES}) + +if (JSONRPC) + target_link_libraries(${EXECUTABLE} web3jsonrpc) +endif() + target_link_libraries(${EXECUTABLE} webthree) target_link_libraries(${EXECUTABLE} ethereum) target_link_libraries(${EXECUTABLE} secp256k1) -target_link_libraries(${EXECUTABLE} gmp) -if(MINIUPNPC_LS) -target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS}) -endif() -target_link_libraries(${EXECUTABLE} ${LEVELDB_LS}) -target_link_libraries(${EXECUTABLE} ${CRYPTOPP_LS}) -if(JSONRPC_LS) -target_link_libraries(${EXECUTABLE} web3jsonrpc) -endif() - -if ("${TARGET_PLATFORM}" STREQUAL "w64") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++") - target_link_libraries(${EXECUTABLE} gcc) - target_link_libraries(${EXECUTABLE} gdi32) - target_link_libraries(${EXECUTABLE} ws2_32) - target_link_libraries(${EXECUTABLE} mswsock) - target_link_libraries(${EXECUTABLE} shlwapi) - target_link_libraries(${EXECUTABLE} iphlpapi) - target_link_libraries(${EXECUTABLE} cryptopp) - target_link_libraries(${EXECUTABLE} ncurses) - target_link_libraries(${EXECUTABLE} form) - target_link_libraries(${EXECUTABLE} boost_system-mt-s) - target_link_libraries(${EXECUTABLE} boost_filesystem-mt-s) - target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) - set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) -elseif (UNIX) - target_link_libraries(${EXECUTABLE} ncurses) - target_link_libraries(${EXECUTABLE} form) -else () - target_link_libraries(${EXECUTABLE} boost_system) - target_link_libraries(${EXECUTABLE} boost_filesystem) - target_link_libraries(${EXECUTABLE} ncurses) - target_link_libraries(${EXECUTABLE} form) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -endif () +target_link_libraries(${EXECUTABLE} ncurses) +target_link_libraries(${EXECUTABLE} form) install( TARGETS ${EXECUTABLE} DESTINATION bin ) diff --git a/neth/main.cpp b/neth/main.cpp index 82968bf03..1eac7fb1f 100644 --- a/neth/main.cpp +++ b/neth/main.cpp @@ -26,16 +26,12 @@ #include #include #include -#if ETH_JSONRPC -#include -#endif #include #include #include #if ETH_JSONRPC #include -#include -#include +#include #endif #include #include "BuildInfo.h" @@ -476,9 +472,11 @@ int main(int argc, char** argv) #if ETH_JSONRPC shared_ptr jsonrpcServer; + unique_ptr jsonrpcConnector; if (jsonrpc > -1) { - jsonrpcServer = make_shared(new jsonrpc::HttpServer(jsonrpc), web3, vector({us})); + jsonrpcConnector = unique_ptr(new jsonrpc::HttpServer(jsonrpc)); + jsonrpcServer = shared_ptr(new WebThreeStubServer(*jsonrpcConnector.get(), web3, vector({us}))); jsonrpcServer->setIdentities({us}); jsonrpcServer->StartListening(); } @@ -552,7 +550,8 @@ int main(int argc, char** argv) { if (jsonrpc < 0) jsonrpc = 8080; - jsonrpcServer = make_shared(new jsonrpc::HttpServer(jsonrpc), web3, vector({us})); + jsonrpcConnector = unique_ptr(new jsonrpc::HttpServer(jsonrpc)); + jsonrpcServer = shared_ptr(new WebThreeStubServer(*jsonrpcConnector.get(), web3, vector({us}))); jsonrpcServer->setIdentities({us}); jsonrpcServer->StartListening(); } diff --git a/sc/CMakeLists.txt b/sc/CMakeLists.txt index 9aa23b03b..2adde060e 100644 --- a/sc/CMakeLists.txt +++ b/sc/CMakeLists.txt @@ -13,22 +13,5 @@ target_link_libraries(${EXECUTABLE} lll) target_link_libraries(${EXECUTABLE} evmcore) target_link_libraries(${EXECUTABLE} devcore) -if ("${TARGET_PLATFORM}" STREQUAL "w64") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++") - target_link_libraries(${EXECUTABLE} gcc) - target_link_libraries(${EXECUTABLE} gdi32) - target_link_libraries(${EXECUTABLE} ws2_32) - target_link_libraries(${EXECUTABLE} mswsock) - target_link_libraries(${EXECUTABLE} shlwapi) - target_link_libraries(${EXECUTABLE} iphlpapi) - target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) - set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) -elseif (UNIX) -else () - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) -endif () - install( TARGETS ${EXECUTABLE} DESTINATION bin ) -cmake_policy(SET CMP0015 NEW) diff --git a/secp256k1/CMakeLists.txt b/secp256k1/CMakeLists.txt index 9b017f15f..8dbe175d5 100644 --- a/secp256k1/CMakeLists.txt +++ b/secp256k1/CMakeLists.txt @@ -1,48 +1,40 @@ cmake_policy(SET CMP0015 NEW) +# this policy was introduced in cmake 3.0 +# remove if, once 3.0 will be used on unix +if (${CMAKE_MAJOR_VERSION} GREATER 2) + # old policy do not use MACOSX_RPATH + cmake_policy(SET CMP0042 OLD) +endif() +set(CMAKE_AUTOMOC OFF) set(CMAKE_ASM_COMPILER "yasm") set(EXECUTABLE secp256k1) - file(GLOB HEADERS "*.h") -if ("${TARGET_PLATFORM}" STREQUAL "w64") - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/field_5x52_asm.o - COMMAND yasm -f win64 -o ${CMAKE_CURRENT_BINARY_DIR}/field_5x52_asm.o ${CMAKE_CURRENT_SOURCE_DIR}/field_5x52_asm.asm - ) - add_custom_target( - asmOut ALL - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/field_5x52_asm.o - ) - if(ETH_STATIC) - add_library(${EXECUTABLE} STATIC ${EXECUTABLE}.c ${CMAKE_CURRENT_BINARY_DIR}/field_5x52_asm.o) - else() - add_library(${EXECUTABLE} SHARED ${EXECUTABLE}.c ${CMAKE_CURRENT_BINARY_DIR}/field_5x52_asm.o) - endif() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -DUSE_FIELD_5X52 -DUSE_FIELD_5X52_ASM -DUSE_NUM_GMP -DUSE_FIELD_INV_NUM") -elseif(APPLE) - if(ETH_STATIC) +if (APPLE OR UNIX) + + if (ETH_STATIC) add_library(${EXECUTABLE} STATIC ${EXECUTABLE}.c field_5x52_asm.asm) else() - find_library(GMP_LS gmp /usr/local/lib) add_library(${EXECUTABLE} SHARED ${EXECUTABLE}.c field_5x52_asm.asm) endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -DUSE_FIELD_GMP -DUSE_NUM_GMP -DUSE_FIELD_INV_NUM") + target_link_libraries(${EXECUTABLE} ${GMP_LIBRARIES}) else() - if(ETH_STATIC) - add_library(${EXECUTABLE} STATIC ${EXECUTABLE}.c field_5x52_asm.asm) + + include_directories(${Boost_INCLUDE_DIRS}) + + if (ETH_STATIC) + add_library(${EXECUTABLE} STATIC ${EXECUTABLE}.c) else() - add_library(${EXECUTABLE} SHARED ${EXECUTABLE}.c field_5x52_asm.asm) + add_library(${EXECUTABLE} SHARED ${EXECUTABLE}.c) endif() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -DUSE_FIELD_GMP -DUSE_NUM_GMP -DUSE_FIELD_INV_NUM") + # /TP - compile project as cpp project + set_target_properties(${EXECUTABLE} PROPERTIES COMPILE_FLAGS "/TP") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_NUM_BOOST -DUSE_FIELD_10X26 -DUSE_FIELD_INV_BUILTIN") + endif() -if (NOT GMP_LS) - set(GMP_LS gmp) -endif () - -target_link_libraries(${EXECUTABLE} ${GMP_LS}) - install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) diff --git a/solc/CMakeLists.txt b/solc/CMakeLists.txt index 84f87eb53..cf1e42572 100644 --- a/solc/CMakeLists.txt +++ b/solc/CMakeLists.txt @@ -1,15 +1,18 @@ cmake_policy(SET CMP0015 NEW) +set(CMAKE_AUTOMOC OFF) aux_source_directory(. SRC_LIST) +include_directories(${Boost_INCLUDE_DIRS}) include_directories(..) set(EXECUTABLE solc) -add_executable(${EXECUTABLE} ${SRC_LIST}) +file(GLOB HEADERS "*.h") +add_executable(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) -target_link_libraries(${EXECUTABLE} boost_filesystem) -target_link_libraries(${EXECUTABLE} boost_program_options) +target_link_libraries(${EXECUTABLE} ${Boost_FILESYSTEM_LIBRARY_RELEASE}) +target_link_libraries(${EXECUTABLE} ${Boost_PROGRAM_OPTIONS_LIBRARY_RELEASE}) target_link_libraries(${EXECUTABLE} solidity) install( TARGETS ${EXECUTABLE} DESTINATION bin ) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f292361d5..7e618f7ea 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -3,45 +3,28 @@ cmake_policy(SET CMP0015 NEW) aux_source_directory(. SRC_LIST) list(REMOVE_ITEM SRC_LIST "./createRandomTest.cpp") +include_directories(${CRYPTOPP_INCLUDE_DIRS}) +include_directories(${JSONCPP_INCLUDE_DIRS}) +include_directories(${JSON_RPC_CPP_INCLUDE_DIRS}) include_directories(..) file(GLOB HEADERS "*.h") add_executable(testeth ${SRC_LIST} ${HEADERS}) add_executable(createRandomTest createRandomTest.cpp vm.cpp TestHelper.cpp) +target_link_libraries(testeth ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY_RELEASE}) +target_link_libraries(testeth ${CURL_LIBRARIES}) target_link_libraries(testeth ethereum) target_link_libraries(testeth ethcore) target_link_libraries(testeth secp256k1) -target_link_libraries(testeth gmp) target_link_libraries(testeth solidity) -target_link_libraries(testeth ${CRYPTOPP_LS}) target_link_libraries(testeth webthree) -if(JSONRPC_LS) -target_link_libraries(testeth web3jsonrpc) + +if (JSONRPC) + target_link_libraries(testeth web3jsonrpc) + target_link_libraries(testeth ${JSON_RPC_CPP_CLIENT_LIBRARIES}) endif() +target_link_libraries(createRandomTest ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY_RELEASE}) target_link_libraries(createRandomTest ethereum) target_link_libraries(createRandomTest ethcore) -target_link_libraries(createRandomTest boost_chrono) -target_link_libraries(createRandomTest boost_unit_test_framework) - -if ("${TARGET_PLATFORM}" STREQUAL "w64") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++") - target_link_libraries(testeth boost_system-mt-s) - target_link_libraries(testeth boost_filesystem-mt-s) - target_link_libraries(testeth boost_thread_win32-mt-s) - target_link_libraries(testeth gcc) - target_link_libraries(testeth gdi32) - target_link_libraries(testeth ws2_32) - target_link_libraries(testeth mswsock) - target_link_libraries(testeth shlwapi) - target_link_libraries(testeth iphlpapi) - set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) -elseif (UNIX) - find_package(Boost 1.53 REQUIRED COMPONENTS unit_test_framework) -else () - target_link_libraries(testeth boost_system) - target_link_libraries(testeth boost_filesystem) - find_package(Threads REQUIRED) - target_link_libraries(testeth ${CMAKE_THREAD_LIBS_INIT}) -endif () diff --git a/test/TestHelper.cpp b/test/TestHelper.cpp index ea0bf341c..b700b65a7 100644 --- a/test/TestHelper.cpp +++ b/test/TestHelper.cpp @@ -109,9 +109,6 @@ void ImportTest::importState(json_spirit::mObject& _o, State& _state) Address address = Address(i.first); - for (auto const& j: o["storage"].get_obj()) - _state.setStorage(address, toInt(j.first), toInt(j.second)); - bytes code = importCode(o); if (code.size()) @@ -122,6 +119,9 @@ void ImportTest::importState(json_spirit::mObject& _o, State& _state) else _state.m_cache[address] = Account(toInt(o["balance"]), Account::NormalCreation); + for (auto const& j: o["storage"].get_obj()) + _state.setStorage(address, toInt(j.first), toInt(j.second)); + for(int i=0; i _expectedStore, map _resultStore, BOOST_CHECK_MESSAGE(expectedStoreValue == resultStoreValue, _expectedAddr << ": store[" << expectedStoreKey << "] = " << resultStoreValue << ", expected " << expectedStoreValue); } } + BOOST_CHECK_EQUAL(_resultStore.size(), _expectedStore.size()); + for (auto&& resultStorePair : _resultStore) + { + if (!_expectedStore.count(resultStorePair.first)) + BOOST_ERROR(_expectedAddr << ": unexpected store key " << resultStorePair.first); + } } void checkLog(LogEntries _resultLogs, LogEntries _expectedLogs) diff --git a/test/crypto.cpp b/test/crypto.cpp index 466015ad7..291893f59 100644 --- a/test/crypto.cpp +++ b/test/crypto.cpp @@ -44,6 +44,15 @@ static CryptoPP::OID s_curveOID(CryptoPP::ASN1::secp256k1()); static CryptoPP::DL_GroupParameters_EC s_params(s_curveOID); static CryptoPP::DL_GroupParameters_EC::EllipticCurve s_curve(s_params.GetCurve()); +BOOST_AUTO_TEST_CASE(emptySHA3Types) +{ + h256 emptyListSHA3(fromHex("1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347")); + BOOST_REQUIRE_EQUAL(emptyListSHA3, EmptyListSHA3); + + h256 emptySHA3(fromHex("c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470")); + BOOST_REQUIRE_EQUAL(emptySHA3, EmptySHA3); +} + BOOST_AUTO_TEST_CASE(cryptopp_patch) { KeyPair k = KeyPair::create(); diff --git a/test/genesis.cpp b/test/genesis.cpp index 2cd9221a8..8cdb84024 100644 --- a/test/genesis.cpp +++ b/test/genesis.cpp @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file trie.cpp +/** @file genesis.cpp * @author Gav Wood * @date 2014 * Trie test functions. @@ -36,6 +36,15 @@ namespace js = json_spirit; BOOST_AUTO_TEST_SUITE(BasicTests) +BOOST_AUTO_TEST_CASE(emptySHA3Types) +{ + h256 emptyListSHA3(fromHex("1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347")); + BOOST_REQUIRE_EQUAL(emptyListSHA3, EmptyListSHA3); + + h256 emptySHA3(fromHex("c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470")); + BOOST_REQUIRE_EQUAL(emptySHA3, EmptySHA3); +} + BOOST_AUTO_TEST_CASE(genesis_tests) { string testPath = test::getTestPath(); diff --git a/test/hexPrefix.cpp b/test/hexPrefix.cpp index 1f02bac91..551983db3 100644 --- a/test/hexPrefix.cpp +++ b/test/hexPrefix.cpp @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file main.cpp +/** @file hexPrefix.cpp * @author Gav Wood * @date 2014 * Main test functions. diff --git a/test/jsonrpc.cpp b/test/jsonrpc.cpp index 20ffc6d54..37377407c 100644 --- a/test/jsonrpc.cpp +++ b/test/jsonrpc.cpp @@ -29,8 +29,9 @@ #include #include #include -#include -#include +#include +#include +#include #include #include "JsonSpiritHeaders.h" #include "TestHelper.h" @@ -43,7 +44,7 @@ using namespace dev; using namespace dev::eth; namespace js = json_spirit; -WebThreeDirect *web3; +WebThreeDirect* web3; unique_ptr jsonrpcServer; unique_ptr jsonrpcClient; @@ -61,11 +62,12 @@ struct Setup web3->setIdealPeerCount(5); web3->ethereum()->setForceMining(true); - jsonrpcServer = unique_ptr(new WebThreeStubServer(new jsonrpc::CorsHttpServer(8080), *web3, {})); + auto server = new jsonrpc::HttpServer(8080); + jsonrpcServer = unique_ptr(new WebThreeStubServer(*server, *web3, {})); jsonrpcServer->setIdentities({}); jsonrpcServer->StartListening(); - - jsonrpcClient = unique_ptr(new WebThreeStubClient(new jsonrpc::HttpClient("http://localhost:8080"))); + auto client = new jsonrpc::HttpClient("http://localhost:8080"); + jsonrpcClient = unique_ptr(new WebThreeStubClient(*client)); } }; @@ -300,8 +302,11 @@ BOOST_AUTO_TEST_CASE(contract_storage) Json::Value storage = jsonrpcClient->eth_storageAt(contractAddress); BOOST_CHECK_EQUAL(storage.getMemberNames().size(), 1); + // bracers are required, cause msvc couldnt handle this macro in for statement for (auto name: storage.getMemberNames()) + { BOOST_CHECK_EQUAL(storage[name].asString(), "0x03"); + } } BOOST_AUTO_TEST_SUITE_END() diff --git a/test/solidityEndToEndTest.cpp b/test/solidityEndToEndTest.cpp index af8b58baa..15722abe1 100644 --- a/test/solidityEndToEndTest.cpp +++ b/test/solidityEndToEndTest.cpp @@ -402,7 +402,7 @@ BOOST_AUTO_TEST_CASE(empty_string_on_stack) " }\n" "}\n"; compileAndRun(sourceCode); - BOOST_CHECK(callContractFunction(0, bytes({0x02})) == bytes({0x00, 0x02, 'a', 'b', 'c', 0x00})); + BOOST_CHECK(callContractFunction(0, bytes(1, 0x02)) == bytes({0x00, 0x02, 0x61/*'a'*/, 0x62/*'b'*/, 0x63/*'c'*/, 0x00})); } BOOST_AUTO_TEST_CASE(state_smoke_test) @@ -442,22 +442,23 @@ BOOST_AUTO_TEST_CASE(simple_mapping) " }\n" "}"; compileAndRun(sourceCode); - - BOOST_CHECK(callContractFunction(0, bytes({0x00})) == bytes({0x00})); - BOOST_CHECK(callContractFunction(0, bytes({0x01})) == bytes({0x00})); - BOOST_CHECK(callContractFunction(0, bytes({0xa7})) == bytes({0x00})); + + // msvc seems to have problems with initializer-list, when there is only 1 param in the list + BOOST_CHECK(callContractFunction(0, bytes(1, 0x00)) == bytes(1, 0x00)); + BOOST_CHECK(callContractFunction(0, bytes(1, 0x01)) == bytes(1, 0x00)); + BOOST_CHECK(callContractFunction(0, bytes(1, 0xa7)) == bytes(1, 0x00)); callContractFunction(1, bytes({0x01, 0xa1})); - BOOST_CHECK(callContractFunction(0, bytes({0x00})) == bytes({0x00})); - BOOST_CHECK(callContractFunction(0, bytes({0x01})) == bytes({0xa1})); - BOOST_CHECK(callContractFunction(0, bytes({0xa7})) == bytes({0x00})); + BOOST_CHECK(callContractFunction(0, bytes(1, 0x00)) == bytes(1, 0x00)); + BOOST_CHECK(callContractFunction(0, bytes(1, 0x01)) == bytes(1, 0xa1)); + BOOST_CHECK(callContractFunction(0, bytes(1, 0xa7)) == bytes(1, 0x00)); callContractFunction(1, bytes({0x00, 0xef})); - BOOST_CHECK(callContractFunction(0, bytes({0x00})) == bytes({0xef})); - BOOST_CHECK(callContractFunction(0, bytes({0x01})) == bytes({0xa1})); - BOOST_CHECK(callContractFunction(0, bytes({0xa7})) == bytes({0x00})); + BOOST_CHECK(callContractFunction(0, bytes(1, 0x00)) == bytes(1, 0xef)); + BOOST_CHECK(callContractFunction(0, bytes(1, 0x01)) == bytes(1, 0xa1)); + BOOST_CHECK(callContractFunction(0, bytes(1, 0xa7)) == bytes(1, 0x00)); callContractFunction(1, bytes({0x01, 0x05})); - BOOST_CHECK(callContractFunction(0, bytes({0x00})) == bytes({0xef})); - BOOST_CHECK(callContractFunction(0, bytes({0x01})) == bytes({0x05})); - BOOST_CHECK(callContractFunction(0, bytes({0xa7})) == bytes({0x00})); + BOOST_CHECK(callContractFunction(0, bytes(1, 0x00)) == bytes(1, 0xef)); + BOOST_CHECK(callContractFunction(0, bytes(1, 0x01)) == bytes(1, 0x05)); + BOOST_CHECK(callContractFunction(0, bytes(1, 0xa7)) == bytes(1, 0x00)); } BOOST_AUTO_TEST_CASE(mapping_state) @@ -625,9 +626,9 @@ BOOST_AUTO_TEST_CASE(structs) " }\n" "}\n"; compileAndRun(sourceCode); - BOOST_CHECK(callContractFunction(0) == bytes({0x00})); + BOOST_CHECK(callContractFunction(0) == bytes(1, 0x00)); BOOST_CHECK(callContractFunction(1) == bytes()); - BOOST_CHECK(callContractFunction(0) == bytes({0x01})); + BOOST_CHECK(callContractFunction(0) == bytes(1, 0x01)); } BOOST_AUTO_TEST_CASE(struct_reference) @@ -653,9 +654,9 @@ BOOST_AUTO_TEST_CASE(struct_reference) " }\n" "}\n"; compileAndRun(sourceCode); - BOOST_CHECK(callContractFunction(0) == bytes({0x00})); + BOOST_CHECK(callContractFunction(0) == bytes(1, 0x00)); BOOST_CHECK(callContractFunction(1) == bytes()); - BOOST_CHECK(callContractFunction(0) == bytes({0x01})); + BOOST_CHECK(callContractFunction(0) == bytes(1, 0x01)); } BOOST_AUTO_TEST_CASE(constructor) diff --git a/test/solidityExecutionFramework.h b/test/solidityExecutionFramework.h index 9d40e8a46..91ee7ad6a 100644 --- a/test/solidityExecutionFramework.h +++ b/test/solidityExecutionFramework.h @@ -117,7 +117,7 @@ private: void sendMessage(bytes const& _data, bool _isCreation, u256 const& _value = 0) { m_state.addBalance(m_sender, _value); // just in case - eth::Executive executive(m_state); + eth::Executive executive(m_state, 0); eth::Transaction t = _isCreation ? eth::Transaction(_value, m_gasPrice, m_gas, _data, 0, KeyPair::create().sec()) : eth::Transaction(_value, m_gasPrice, m_gas, m_contractAddress, _data, 0, KeyPair::create().sec()); bytes transactionRLP = t.rlp(); @@ -137,7 +137,7 @@ private: else { BOOST_REQUIRE(m_state.addressHasCode(m_contractAddress)); - BOOST_REQUIRE(!executive.call(m_contractAddress, m_sender, _value, m_gasPrice, &_data, m_gas, m_sender)); + BOOST_REQUIRE(!executive.call(m_contractAddress, m_contractAddress, m_sender, _value, m_gasPrice, &_data, m_gas, m_sender)); } BOOST_REQUIRE(executive.go()); m_state.noteSending(m_sender); diff --git a/test/solidityExpressionCompiler.cpp b/test/solidityExpressionCompiler.cpp index 486b46ebb..c05db25d4 100644 --- a/test/solidityExpressionCompiler.cpp +++ b/test/solidityExpressionCompiler.cpp @@ -76,8 +76,11 @@ Declaration const& resolveDeclaration(vector const& _namespacedName, NameAndTypeResolver const& _resolver) { Declaration const* declaration = nullptr; + // bracers are required, cause msvc couldnt handle this macro in for statement for (string const& namePart: _namespacedName) + { BOOST_REQUIRE(declaration = _resolver.resolveName(namePart, declaration)); + } BOOST_REQUIRE(declaration); return *declaration; } diff --git a/test/solidityJSONInterfaceTest.cpp b/test/solidityJSONInterfaceTest.cpp index 487508bb9..c734009c3 100644 --- a/test/solidityJSONInterfaceTest.cpp +++ b/test/solidityJSONInterfaceTest.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include namespace dev diff --git a/test/solidityNatspecJSON.cpp b/test/solidityNatspecJSON.cpp index 641bb82ab..2c3ded08d 100644 --- a/test/solidityNatspecJSON.cpp +++ b/test/solidityNatspecJSON.cpp @@ -21,9 +21,9 @@ */ #include +#include #include #include -#include #include namespace dev diff --git a/test/recursiveCreateFiller.json b/test/stRecursiveCreateFiller.json similarity index 100% rename from test/recursiveCreateFiller.json rename to test/stRecursiveCreateFiller.json diff --git a/test/state.cpp b/test/state.cpp index 07c8373e2..e1d5def6a 100644 --- a/test/state.cpp +++ b/test/state.cpp @@ -45,7 +45,7 @@ void doStateTests(json_spirit::mValue& v, bool _fillin) { for (auto& i: v.get_obj()) { - cnote << i.first; + cerr << i.first << endl; mObject& o = i.second.get_obj(); BOOST_REQUIRE(o.count("env") > 0); @@ -130,6 +130,11 @@ BOOST_AUTO_TEST_CASE(stLogTests) dev::test::executeTests("stLogTests", "/StateTests", dev::test::doStateTests); } +BOOST_AUTO_TEST_CASE(stRecursiveCreate) +{ + dev::test::executeTests("stRecursiveCreate", "/StateTests", dev::test::doStateTests); +} + BOOST_AUTO_TEST_CASE(stSpecialTest) { dev::test::executeTests("stSpecialTest", "/StateTests", dev::test::doStateTests); diff --git a/test/trie.cpp b/test/trie.cpp index 3f072a6d1..0cf87c212 100644 --- a/test/trie.cpp +++ b/test/trie.cpp @@ -54,7 +54,6 @@ BOOST_AUTO_TEST_CASE(trie_tests) { string testPath = test::getTestPath(); - testPath += "/TrieTests"; cnote << "Testing Trie..."; @@ -245,6 +244,7 @@ BOOST_AUTO_TEST_CASE(moreTrieTests) BOOST_AUTO_TEST_CASE(trieLowerBound) { cnote << "Stress-testing Trie.lower_bound..."; + if (0) { MemoryDB dm; EnforceRefs e(dm, true); @@ -290,6 +290,7 @@ BOOST_AUTO_TEST_CASE(trieLowerBound) BOOST_AUTO_TEST_CASE(trieStess) { cnote << "Stress-testing Trie..."; + if (0) { MemoryDB m; MemoryDB dm; diff --git a/test/vm.cpp b/test/vm.cpp index d8e85383c..49d6ed104 100644 --- a/test/vm.cpp +++ b/test/vm.cpp @@ -34,18 +34,18 @@ using namespace dev::test; FakeExtVM::FakeExtVM(eth::BlockInfo const& _previousBlock, eth::BlockInfo const& _currentBlock, unsigned _depth): /// TODO: XXX: remove the default argument & fix. ExtVMFace(Address(), Address(), Address(), 0, 1, bytesConstRef(), bytes(), _previousBlock, _currentBlock, _depth) {} -h160 FakeExtVM::create(u256 _endowment, u256* _gas, bytesConstRef _init, OnOpFunc const&) +h160 FakeExtVM::create(u256 _endowment, u256& io_gas, bytesConstRef _init, OnOpFunc const&) { Address na = right160(sha3(rlpList(myAddress, get<1>(addresses[myAddress])))); - Transaction t(_endowment, gasPrice, *_gas, _init.toBytes()); + Transaction t(_endowment, gasPrice, io_gas, _init.toBytes()); callcreates.push_back(t); return na; } -bool FakeExtVM::call(Address _receiveAddress, u256 _value, bytesConstRef _data, u256* _gas, bytesRef _out, OnOpFunc const&, Address _myAddressOverride, Address _codeAddressOverride) +bool FakeExtVM::call(Address _receiveAddress, u256 _value, bytesConstRef _data, u256& io_gas, bytesRef _out, OnOpFunc const&, Address _myAddressOverride, Address _codeAddressOverride) { - Transaction t(_value, gasPrice, *_gas, _receiveAddress, _data.toVector()); + Transaction t(_value, gasPrice, io_gas, _receiveAddress, _data.toVector()); callcreates.push_back(t); (void)_out; (void)_myAddressOverride; @@ -311,7 +311,7 @@ void doVMTests(json_spirit::mValue& v, bool _fillin) } catch (VMException const& _e) { - cnote << "VM did throw an exception: " << diagnostic_information(_e); + cnote << "Safe VM Exception"; vmExceptionOccured = true; } catch (Exception const& _e) diff --git a/test/vm.h b/test/vm.h index 3d4b88d54..ff948cbf8 100644 --- a/test/vm.h +++ b/test/vm.h @@ -55,8 +55,8 @@ public: virtual u256 txCount(Address _a) override { return std::get<1>(addresses[_a]); } virtual void suicide(Address _a) override { std::get<0>(addresses[_a]) += std::get<0>(addresses[myAddress]); addresses.erase(myAddress); } virtual bytes const& codeAt(Address _a) override { return std::get<3>(addresses[_a]); } - virtual h160 create(u256 _endowment, u256* _gas, bytesConstRef _init, eth::OnOpFunc const&) override; - virtual bool call(Address _receiveAddress, u256 _value, bytesConstRef _data, u256* _gas, bytesRef _out, eth::OnOpFunc const&, Address, Address) override; + virtual h160 create(u256 _endowment, u256& io_gas, bytesConstRef _init, eth::OnOpFunc const&) override; + virtual bool call(Address _receiveAddress, u256 _value, bytesConstRef _data, u256& io_gas, bytesRef _out, eth::OnOpFunc const&, Address, Address) override; void setTransaction(Address _caller, u256 _value, u256 _gasPrice, bytes const& _data); void setContract(Address _myAddress, u256 _myBalance, u256 _myNonce, std::map const& _storage, bytes const& _code); void set(Address _a, u256 _myBalance, u256 _myNonce, std::map const& _storage, bytes const& _code); diff --git a/test/webthreestubclient.h b/test/webthreestubclient.h index f5fee4c00..9b36c3644 100644 --- a/test/webthreestubclient.h +++ b/test/webthreestubclient.h @@ -1,639 +1,500 @@ /** - * THIS FILE IS GENERATED BY jsonrpcstub, DO NOT CHANGE IT!!!!! + * This file is generated by jsonrpcstub, DO NOT CHANGE IT MANUALLY! */ -#ifndef _WEBTHREESTUBCLIENT_H_ -#define _WEBTHREESTUBCLIENT_H_ +#ifndef JSONRPC_CPP_STUB_WEBTHREESTUBCLIENT_H_ +#define JSONRPC_CPP_STUB_WEBTHREESTUBCLIENT_H_ -#include +#include -class WebThreeStubClient +class WebThreeStubClient : public jsonrpc::Client { public: - WebThreeStubClient(jsonrpc::AbstractClientConnector* conn) - { - this->client = new jsonrpc::Client(conn); - } - ~WebThreeStubClient() - { - delete this->client; - } + WebThreeStubClient(jsonrpc::IClientConnector &conn) : jsonrpc::Client(conn) {} - std::string db_get(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException) + std::string eth_coinbase() throw (jsonrpc::JsonRpcException) { Json::Value p; - p.append(param1); -p.append(param2); - - Json::Value result = this->client->CallMethod("db_get",p); - if (result.isString()) - return result.asString(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + p = Json::nullValue; + Json::Value result = this->CallMethod("eth_coinbase",p); + if (result.isString()) + return result.asString(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - std::string db_getString(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException) + bool eth_setCoinbase(const std::string& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); -p.append(param2); - - Json::Value result = this->client->CallMethod("db_getString",p); - if (result.isString()) - return result.asString(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + Json::Value result = this->CallMethod("eth_setCoinbase",p); + if (result.isBool()) + return result.asBool(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - bool db_put(const std::string& param1, const std::string& param2, const std::string& param3) throw (jsonrpc::JsonRpcException) + bool eth_listening() throw (jsonrpc::JsonRpcException) { Json::Value p; - p.append(param1); -p.append(param2); -p.append(param3); - - Json::Value result = this->client->CallMethod("db_put",p); - if (result.isBool()) - return result.asBool(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + p = Json::nullValue; + Json::Value result = this->CallMethod("eth_listening",p); + if (result.isBool()) + return result.asBool(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - bool db_putString(const std::string& param1, const std::string& param2, const std::string& param3) throw (jsonrpc::JsonRpcException) + bool eth_setListening(const bool& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); -p.append(param2); -p.append(param3); - - Json::Value result = this->client->CallMethod("db_putString",p); - if (result.isBool()) - return result.asBool(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + Json::Value result = this->CallMethod("eth_setListening",p); + if (result.isBool()) + return result.asBool(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - Json::Value eth_accounts() throw (jsonrpc::JsonRpcException) + bool eth_mining() throw (jsonrpc::JsonRpcException) { Json::Value p; p = Json::nullValue; - Json::Value result = this->client->CallMethod("eth_accounts",p); - if (result.isArray()) - return result; - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + Json::Value result = this->CallMethod("eth_mining",p); + if (result.isBool()) + return result.asBool(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - std::string eth_balanceAt(const std::string& param1) throw (jsonrpc::JsonRpcException) + bool eth_setMining(const bool& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); - - Json::Value result = this->client->CallMethod("eth_balanceAt",p); - if (result.isString()) - return result.asString(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + Json::Value result = this->CallMethod("eth_setMining",p); + if (result.isBool()) + return result.asBool(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - Json::Value eth_blockByHash(const std::string& param1) throw (jsonrpc::JsonRpcException) + std::string eth_gasPrice() throw (jsonrpc::JsonRpcException) { Json::Value p; - p.append(param1); - - Json::Value result = this->client->CallMethod("eth_blockByHash",p); - if (result.isObject()) - return result; - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + p = Json::nullValue; + Json::Value result = this->CallMethod("eth_gasPrice",p); + if (result.isString()) + return result.asString(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - Json::Value eth_blockByNumber(const int& param1) throw (jsonrpc::JsonRpcException) + Json::Value eth_accounts() throw (jsonrpc::JsonRpcException) { Json::Value p; - p.append(param1); - - Json::Value result = this->client->CallMethod("eth_blockByNumber",p); - if (result.isObject()) - return result; - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + p = Json::nullValue; + Json::Value result = this->CallMethod("eth_accounts",p); + if (result.isArray()) + return result; + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - std::string eth_call(const Json::Value& param1) throw (jsonrpc::JsonRpcException) + int eth_peerCount() throw (jsonrpc::JsonRpcException) { Json::Value p; - p.append(param1); - - Json::Value result = this->client->CallMethod("eth_call",p); - if (result.isString()) - return result.asString(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + p = Json::nullValue; + Json::Value result = this->CallMethod("eth_peerCount",p); + if (result.isInt()) + return result.asInt(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - bool eth_changed(const int& param1) throw (jsonrpc::JsonRpcException) + int eth_defaultBlock() throw (jsonrpc::JsonRpcException) { Json::Value p; - p.append(param1); - - Json::Value result = this->client->CallMethod("eth_changed",p); - if (result.isBool()) - return result.asBool(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + p = Json::nullValue; + Json::Value result = this->CallMethod("eth_defaultBlock",p); + if (result.isInt()) + return result.asInt(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - std::string eth_codeAt(const std::string& param1) throw (jsonrpc::JsonRpcException) + bool eth_setDefaultBlock(const int& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); - - Json::Value result = this->client->CallMethod("eth_codeAt",p); - if (result.isString()) - return result.asString(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + Json::Value result = this->CallMethod("eth_setDefaultBlock",p); + if (result.isBool()) + return result.asBool(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - std::string eth_coinbase() throw (jsonrpc::JsonRpcException) + int eth_number() throw (jsonrpc::JsonRpcException) { Json::Value p; p = Json::nullValue; - Json::Value result = this->client->CallMethod("eth_coinbase",p); - if (result.isString()) - return result.asString(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + Json::Value result = this->CallMethod("eth_number",p); + if (result.isInt()) + return result.asInt(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - Json::Value eth_compilers() throw (jsonrpc::JsonRpcException) + std::string eth_balanceAt(const std::string& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; - p = Json::nullValue; - Json::Value result = this->client->CallMethod("eth_compilers",p); - if (result.isArray()) - return result; - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + p.append(param1); + Json::Value result = this->CallMethod("eth_balanceAt",p); + if (result.isString()) + return result.asString(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - double eth_countAt(const std::string& param1) throw (jsonrpc::JsonRpcException) + std::string eth_stateAt(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); - - Json::Value result = this->client->CallMethod("eth_countAt",p); - if (result.isDouble()) - return result.asDouble(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + p.append(param2); + Json::Value result = this->CallMethod("eth_stateAt",p); + if (result.isString()) + return result.asString(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - int eth_defaultBlock() throw (jsonrpc::JsonRpcException) + Json::Value eth_storageAt(const std::string& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; - p = Json::nullValue; - Json::Value result = this->client->CallMethod("eth_defaultBlock",p); - if (result.isInt()) - return result.asInt(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + p.append(param1); + Json::Value result = this->CallMethod("eth_storageAt",p); + if (result.isObject()) + return result; + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - Json::Value eth_filterLogs(const int& param1) throw (jsonrpc::JsonRpcException) + double eth_countAt(const std::string& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); - - Json::Value result = this->client->CallMethod("eth_filterLogs",p); - if (result.isArray()) - return result; - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + Json::Value result = this->CallMethod("eth_countAt",p); + if (result.isDouble()) + return result.asDouble(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - std::string eth_gasPrice() throw (jsonrpc::JsonRpcException) + std::string eth_codeAt(const std::string& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; - p = Json::nullValue; - Json::Value result = this->client->CallMethod("eth_gasPrice",p); - if (result.isString()) - return result.asString(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + p.append(param1); + Json::Value result = this->CallMethod("eth_codeAt",p); + if (result.isString()) + return result.asString(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - bool eth_listening() throw (jsonrpc::JsonRpcException) + std::string eth_transact(const Json::Value& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; - p = Json::nullValue; - Json::Value result = this->client->CallMethod("eth_listening",p); - if (result.isBool()) - return result.asBool(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + p.append(param1); + Json::Value result = this->CallMethod("eth_transact",p); + if (result.isString()) + return result.asString(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - std::string eth_lll(const std::string& param1) throw (jsonrpc::JsonRpcException) + std::string eth_call(const Json::Value& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); - - Json::Value result = this->client->CallMethod("eth_lll",p); - if (result.isString()) - return result.asString(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + Json::Value result = this->CallMethod("eth_call",p); + if (result.isString()) + return result.asString(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - Json::Value eth_logs(const Json::Value& param1) throw (jsonrpc::JsonRpcException) + Json::Value eth_blockByHash(const std::string& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); - - Json::Value result = this->client->CallMethod("eth_logs",p); - if (result.isArray()) - return result; - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + Json::Value result = this->CallMethod("eth_blockByHash",p); + if (result.isObject()) + return result; + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - bool eth_mining() throw (jsonrpc::JsonRpcException) + Json::Value eth_blockByNumber(const int& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; - p = Json::nullValue; - Json::Value result = this->client->CallMethod("eth_mining",p); - if (result.isBool()) - return result.asBool(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + p.append(param1); + Json::Value result = this->CallMethod("eth_blockByNumber",p); + if (result.isObject()) + return result; + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - int eth_newFilter(const Json::Value& param1) throw (jsonrpc::JsonRpcException) + Json::Value eth_transactionByHash(const std::string& param1, const int& param2) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); - - Json::Value result = this->client->CallMethod("eth_newFilter",p); - if (result.isInt()) - return result.asInt(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + p.append(param2); + Json::Value result = this->CallMethod("eth_transactionByHash",p); + if (result.isObject()) + return result; + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - int eth_newFilterString(const std::string& param1) throw (jsonrpc::JsonRpcException) + Json::Value eth_transactionByNumber(const int& param1, const int& param2) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); - - Json::Value result = this->client->CallMethod("eth_newFilterString",p); - if (result.isInt()) - return result.asInt(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + p.append(param2); + Json::Value result = this->CallMethod("eth_transactionByNumber",p); + if (result.isObject()) + return result; + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - int eth_number() throw (jsonrpc::JsonRpcException) + Json::Value eth_uncleByHash(const std::string& param1, const int& param2) throw (jsonrpc::JsonRpcException) { Json::Value p; - p = Json::nullValue; - Json::Value result = this->client->CallMethod("eth_number",p); - if (result.isInt()) - return result.asInt(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + p.append(param1); + p.append(param2); + Json::Value result = this->CallMethod("eth_uncleByHash",p); + if (result.isObject()) + return result; + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - int eth_peerCount() throw (jsonrpc::JsonRpcException) + Json::Value eth_uncleByNumber(const int& param1, const int& param2) throw (jsonrpc::JsonRpcException) { Json::Value p; - p = Json::nullValue; - Json::Value result = this->client->CallMethod("eth_peerCount",p); - if (result.isInt()) - return result.asInt(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + p.append(param1); + p.append(param2); + Json::Value result = this->CallMethod("eth_uncleByNumber",p); + if (result.isObject()) + return result; + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - std::string eth_serpent(const std::string& param1) throw (jsonrpc::JsonRpcException) + Json::Value eth_compilers() throw (jsonrpc::JsonRpcException) { Json::Value p; - p.append(param1); - - Json::Value result = this->client->CallMethod("eth_serpent",p); - if (result.isString()) - return result.asString(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + p = Json::nullValue; + Json::Value result = this->CallMethod("eth_compilers",p); + if (result.isArray()) + return result; + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - bool eth_setCoinbase(const std::string& param1) throw (jsonrpc::JsonRpcException) + std::string eth_lll(const std::string& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); - - Json::Value result = this->client->CallMethod("eth_setCoinbase",p); - if (result.isBool()) - return result.asBool(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + Json::Value result = this->CallMethod("eth_lll",p); + if (result.isString()) + return result.asString(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - bool eth_setDefaultBlock(const int& param1) throw (jsonrpc::JsonRpcException) + std::string eth_solidity(const std::string& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); - - Json::Value result = this->client->CallMethod("eth_setDefaultBlock",p); - if (result.isBool()) - return result.asBool(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + Json::Value result = this->CallMethod("eth_solidity",p); + if (result.isString()) + return result.asString(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - bool eth_setListening(const bool& param1) throw (jsonrpc::JsonRpcException) + std::string eth_serpent(const std::string& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); - - Json::Value result = this->client->CallMethod("eth_setListening",p); - if (result.isBool()) - return result.asBool(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + Json::Value result = this->CallMethod("eth_serpent",p); + if (result.isString()) + return result.asString(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - bool eth_setMining(const bool& param1) throw (jsonrpc::JsonRpcException) + int eth_newFilter(const Json::Value& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); - - Json::Value result = this->client->CallMethod("eth_setMining",p); - if (result.isBool()) - return result.asBool(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + Json::Value result = this->CallMethod("eth_newFilter",p); + if (result.isInt()) + return result.asInt(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - std::string eth_solidity(const std::string& param1) throw (jsonrpc::JsonRpcException) + int eth_newFilterString(const std::string& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); - - Json::Value result = this->client->CallMethod("eth_solidity",p); - if (result.isString()) - return result.asString(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + Json::Value result = this->CallMethod("eth_newFilterString",p); + if (result.isInt()) + return result.asInt(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - std::string eth_stateAt(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException) + bool eth_uninstallFilter(const int& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); -p.append(param2); - - Json::Value result = this->client->CallMethod("eth_stateAt",p); - if (result.isString()) - return result.asString(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + Json::Value result = this->CallMethod("eth_uninstallFilter",p); + if (result.isBool()) + return result.asBool(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - Json::Value eth_storageAt(const std::string& param1) throw (jsonrpc::JsonRpcException) + bool eth_changed(const int& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); - - Json::Value result = this->client->CallMethod("eth_storageAt",p); - if (result.isObject()) - return result; - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + Json::Value result = this->CallMethod("eth_changed",p); + if (result.isBool()) + return result.asBool(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - std::string eth_transact(const Json::Value& param1) throw (jsonrpc::JsonRpcException) + Json::Value eth_filterLogs(const int& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); - - Json::Value result = this->client->CallMethod("eth_transact",p); - if (result.isString()) - return result.asString(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + Json::Value result = this->CallMethod("eth_filterLogs",p); + if (result.isArray()) + return result; + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - Json::Value eth_transactionByHash(const std::string& param1, const int& param2) throw (jsonrpc::JsonRpcException) + Json::Value eth_logs(const Json::Value& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); -p.append(param2); - - Json::Value result = this->client->CallMethod("eth_transactionByHash",p); - if (result.isObject()) - return result; - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + Json::Value result = this->CallMethod("eth_logs",p); + if (result.isArray()) + return result; + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - Json::Value eth_transactionByNumber(const int& param1, const int& param2) throw (jsonrpc::JsonRpcException) + bool db_put(const std::string& param1, const std::string& param2, const std::string& param3) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); -p.append(param2); - - Json::Value result = this->client->CallMethod("eth_transactionByNumber",p); - if (result.isObject()) - return result; - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + p.append(param2); + p.append(param3); + Json::Value result = this->CallMethod("db_put",p); + if (result.isBool()) + return result.asBool(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - Json::Value eth_uncleByHash(const std::string& param1, const int& param2) throw (jsonrpc::JsonRpcException) + std::string db_get(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); -p.append(param2); - - Json::Value result = this->client->CallMethod("eth_uncleByHash",p); - if (result.isObject()) - return result; - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + p.append(param2); + Json::Value result = this->CallMethod("db_get",p); + if (result.isString()) + return result.asString(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - Json::Value eth_uncleByNumber(const int& param1, const int& param2) throw (jsonrpc::JsonRpcException) + bool db_putString(const std::string& param1, const std::string& param2, const std::string& param3) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); -p.append(param2); - - Json::Value result = this->client->CallMethod("eth_uncleByNumber",p); - if (result.isObject()) - return result; - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + p.append(param2); + p.append(param3); + Json::Value result = this->CallMethod("db_putString",p); + if (result.isBool()) + return result.asBool(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - bool eth_uninstallFilter(const int& param1) throw (jsonrpc::JsonRpcException) + std::string db_getString(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); - - Json::Value result = this->client->CallMethod("eth_uninstallFilter",p); - if (result.isBool()) - return result.asBool(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + p.append(param2); + Json::Value result = this->CallMethod("db_getString",p); + if (result.isString()) + return result.asString(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - std::string shh_addToGroup(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException) + bool shh_post(const Json::Value& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); -p.append(param2); - - Json::Value result = this->client->CallMethod("shh_addToGroup",p); - if (result.isString()) - return result.asString(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + Json::Value result = this->CallMethod("shh_post",p); + if (result.isBool()) + return result.asBool(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - Json::Value shh_changed(const int& param1) throw (jsonrpc::JsonRpcException) + std::string shh_newIdentity() throw (jsonrpc::JsonRpcException) { Json::Value p; - p.append(param1); - - Json::Value result = this->client->CallMethod("shh_changed",p); - if (result.isArray()) - return result; - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + p = Json::nullValue; + Json::Value result = this->CallMethod("shh_newIdentity",p); + if (result.isString()) + return result.asString(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - bool shh_haveIdentity(const std::string& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); - - Json::Value result = this->client->CallMethod("shh_haveIdentity",p); - if (result.isBool()) - return result.asBool(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + Json::Value result = this->CallMethod("shh_haveIdentity",p); + if (result.isBool()) + return result.asBool(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - int shh_newFilter(const Json::Value& param1) throw (jsonrpc::JsonRpcException) + std::string shh_newGroup(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); - - Json::Value result = this->client->CallMethod("shh_newFilter",p); - if (result.isInt()) - return result.asInt(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + p.append(param2); + Json::Value result = this->CallMethod("shh_newGroup",p); + if (result.isString()) + return result.asString(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - std::string shh_newGroup(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException) + std::string shh_addToGroup(const std::string& param1, const std::string& param2) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); -p.append(param2); - - Json::Value result = this->client->CallMethod("shh_newGroup",p); - if (result.isString()) - return result.asString(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + p.append(param2); + Json::Value result = this->CallMethod("shh_addToGroup",p); + if (result.isString()) + return result.asString(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - std::string shh_newIdentity() throw (jsonrpc::JsonRpcException) + int shh_newFilter(const Json::Value& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; - p = Json::nullValue; - Json::Value result = this->client->CallMethod("shh_newIdentity",p); - if (result.isString()) - return result.asString(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + p.append(param1); + Json::Value result = this->CallMethod("shh_newFilter",p); + if (result.isInt()) + return result.asInt(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - bool shh_post(const Json::Value& param1) throw (jsonrpc::JsonRpcException) + bool shh_uninstallFilter(const int& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); - - Json::Value result = this->client->CallMethod("shh_post",p); - if (result.isBool()) - return result.asBool(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + Json::Value result = this->CallMethod("shh_uninstallFilter",p); + if (result.isBool()) + return result.asBool(); + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - bool shh_uninstallFilter(const int& param1) throw (jsonrpc::JsonRpcException) + Json::Value shh_changed(const int& param1) throw (jsonrpc::JsonRpcException) { Json::Value p; p.append(param1); - - Json::Value result = this->client->CallMethod("shh_uninstallFilter",p); - if (result.isBool()) - return result.asBool(); - else - throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); - + Json::Value result = this->CallMethod("shh_changed",p); + if (result.isArray()) + return result; + else + throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString()); } - - private: - jsonrpc::Client* client; }; -#endif //_WEBTHREESTUBCLIENT_H_ + +#endif //JSONRPC_CPP_WEBTHREESTUBCLIENT_H_ diff --git a/test/whisperTopic.cpp b/test/whisperTopic.cpp index c5e59332d..79adf3d6a 100644 --- a/test/whisperTopic.cpp +++ b/test/whisperTopic.cpp @@ -33,7 +33,8 @@ BOOST_AUTO_TEST_SUITE(whisper) BOOST_AUTO_TEST_CASE(topic) { cnote << "Testing Whisper..."; -// g_logVerbosity = 0; + auto oldLogVerbosity = g_logVerbosity; + g_logVerbosity = 0; bool started = false; unsigned result = 0; @@ -81,7 +82,7 @@ BOOST_AUTO_TEST_CASE(topic) } listener.join(); -// g_logVerbosity = 0; + g_logVerbosity = oldLogVerbosity; BOOST_REQUIRE_EQUAL(result, 1 + 9 + 25 + 49 + 81); } diff --git a/third/CMakeLists.txt b/third/CMakeLists.txt index d5371b666..c9c95cf33 100644 --- a/third/CMakeLists.txt +++ b/third/CMakeLists.txt @@ -1,101 +1,50 @@ +cmake_policy(SET CMP0015 NEW) +# let cmake autolink dependencies on windows +cmake_policy(SET CMP0020 NEW) +# this policy was introduced in cmake 3.0 +# remove if, once 3.0 will be used on unix +if (${CMAKE_MAJOR_VERSION} GREATER 2) + cmake_policy(SET CMP0043 OLD) +endif() + set(CMAKE_INCLUDE_CURRENT_DIR ON) aux_source_directory(. SRC_LIST) -include_directories(..) -if (APPLE) - # Add homebrew path for qt5 - set(CMAKE_PREFIX_PATH /usr/local/opt/qt5) - include_directories(/usr/local/opt/qt5/include /usr/local/include) -elseif ("${TARGET_PLATFORM}" STREQUAL "w64") - set(SRC_LIST ${SRC_LIST} ../windows/qt_plugin_import.cpp) - include_directories(/usr/x86_64-w64-mingw32/include /usr/x86_64-w64-mingw32/include/QtCore /usr/x86_64-w64-mingw32/include/QtGui /usr/x86_64-w64-mingw32/include/QtQuick /usr/x86_64-w64-mingw32/include/QtQml /usr/x86_64-w64-mingw32/include/QtNetwork /usr/x86_64-w64-mingw32/include/QtWidgets /usr/x86_64-w64-mingw32/include/QtWebKit /usr/x86_64-w64-mingw32/include/QtWebKitWidgets) -elseif (UNIX) - set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ";$ENV{QTDIR}/lib/cmake") -endif () - -find_package(Qt5Core REQUIRED) -find_package(Qt5Gui REQUIRED) -find_package(Qt5Quick REQUIRED) -find_package(Qt5Qml REQUIRED) -find_package(Qt5Network REQUIRED) -find_package(Qt5Widgets REQUIRED) -find_package(Qt5WebKit REQUIRED) -find_package(Qt5WebKitWidgets REQUIRED) +include_directories(${JSON_RPC_CPP_INCLUDE_DIRS}) +include_directories(..) qt5_wrap_ui(ui_Main.h Main.ui) -# Set name of binary and add_executable() file(GLOB HEADERS "*.h") -if (APPLE) - set(EXECUTEABLE Third) - set(BIN_INSTALL_DIR ".") - set(DOC_INSTALL_DIR ".") - - set(PROJECT_VERSION "${ETH_VERSION}") - set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME} ${PROJECT_VERSION}") - set(MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_NAME} ${PROJECT_VERSION}") - set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME} ${PROJECT_VERSION}") - set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}") - set(MACOSX_BUNDLE_COPYRIGHT "${PROJECT_COPYRIGHT_YEAR} ${PROJECT_VENDOR}") - set(MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_DOMAIN_SECOND}.${PROJECT_DOMAIN_FIRST}") - set(MACOSX_BUNDLE_BUNDLE_NAME ${EXECUTEABLE}) - set(MACOSX_BUNDLE_ICON_FILE third) - include(BundleUtilities) - - add_executable(${EXECUTEABLE} MACOSX_BUNDLE third.icns Main.ui ${SRC_LIST} ${HEADERS}) - set_target_properties(${EXECUTEABLE} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/EthereumMacOSXBundleInfo.plist.in") - SET_SOURCE_FILES_PROPERTIES(${EXECUTEABLE} PROPERTIES MACOSX_PACKAGE_LOCATION MacOS) - SET_SOURCE_FILES_PROPERTIES(${MACOSX_BUNDLE_ICON_FILE}.icns PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") - -else () - set(EXECUTEABLE third) - add_executable(${EXECUTEABLE} Main.ui ${SRC_LIST} ${HEADERS}) -endif () - -qt5_use_modules(${EXECUTEABLE} Core)# Gui Widgets Network WebKit WebKitWidgets) -target_link_libraries(${EXECUTEABLE} webthree qethereum ethereum evm ethcore secp256k1 gmp ${CRYPTOPP_LS} serpent lll evmcore devcore web3jsonrpc jsqrc) if (APPLE) - # First have qt5 install plugins and frameworks - add_custom_command(TARGET ${EXECUTEABLE} POST_BUILD - COMMAND /usr/local/opt/qt5/bin/macdeployqt ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTEABLE}.app - WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) - - # This tool and next will inspect linked libraries in order to determine which dependencies are required - if (${CMAKE_CFG_INTDIR} STREQUAL ".") - set(APP_BUNDLE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTEABLE}.app") - else () - set(APP_BUNDLE_PATH "${CMAKE_CURRENT_BINARY_DIR}/\$ENV{CONFIGURATION}/${EXECUTEABLE}.app") - endif () - install(CODE " - include(BundleUtilities) - set(BU_CHMOD_BUNDLE_ITEMS 1) - fixup_bundle(\"${APP_BUNDLE_PATH}\" \"${BUNDLELIBS}\" \"../libqethereum ../libethereum ../secp256k1\") - " COMPONENT RUNTIME ) - # Cleanup duplicate libs from macdeployqt - install(CODE " - file(GLOB LINGER_RM \"${APP_BUNDLE_PATH}/Contents/Frameworks/*.dylib\") - if (LINGER_RM) - file(REMOVE \${LINGER_RM}) - endif () - ") -elseif ("${TARGET_PLATFORM}" STREQUAL "w64") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-keep-inline-dllexport -static-libgcc -static-libstdc++ -static") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-s -Wl,-subsystem,windows -mthreads -L/usr/x86_64-w64-mingw32/plugins/platforms") - target_link_libraries(${EXECUTEABLE} gcc) - target_link_libraries(${EXECUTEABLE} mingw32 qtmain mswsock iphlpapi qwindows shlwapi Qt5PlatformSupport opengl32 gdi32 comdlg32 oleaut32 imm32 winmm ole32 uuid ws2_32) - target_link_libraries(${EXECUTEABLE} boost_system-mt-s) - target_link_libraries(${EXECUTEABLE} boost_filesystem-mt-s) - target_link_libraries(${EXECUTEABLE} boost_thread_win32-mt-s) - target_link_libraries(${EXECUTEABLE} crypt32) - target_link_libraries(${EXECUTEABLE} Qt5PlatformSupport) - set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) -elseif (UNIX) + set(EXECUTABLE Third) else () - target_link_libraries(${EXECUTEABLE} boost_system) - target_link_libraries(${EXECUTEABLE} boost_filesystem) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTEABLE} ${CMAKE_THREAD_LIBS_INIT}) - install( TARGETS ${EXECUTEABLE} RUNTIME DESTINATION bin ) + set(EXECUTABLE third) endif () +# eth_add_executable is defined in cmake/EthExecutableHelper.cmake +eth_add_executable(${EXECUTABLE} + ICON third + UI_RESOURCES third.icns Main.ui +) + +add_dependencies(${EXECUTABLE} BuildInfo.h) + +target_link_libraries(${EXECUTABLE} Qt5::Core) +target_link_libraries(${EXECUTABLE} webthree) +target_link_libraries(${EXECUTABLE} qethereum) +target_link_libraries(${EXECUTABLE} ethereum) +target_link_libraries(${EXECUTABLE} evm) +target_link_libraries(${EXECUTABLE} ethcore) +target_link_libraries(${EXECUTABLE} secp256k1) +target_link_libraries(${EXECUTABLE} serpent) +target_link_libraries(${EXECUTABLE} lll) +target_link_libraries(${EXECUTABLE} evmcore) +target_link_libraries(${EXECUTABLE} devcore) +target_link_libraries(${EXECUTABLE} web3jsonrpc) +target_link_libraries(${EXECUTABLE} jsqrc) + +# eth_install_executable is defined in cmake/EthExecutableHelper.cmake +eth_install_executable(${EXECUTABLE}) + diff --git a/third/EthereumMacOSXBundleInfo.plist.in b/third/EthereumMacOSXBundleInfo.plist.in deleted file mode 100644 index 684ad7908..000000000 --- a/third/EthereumMacOSXBundleInfo.plist.in +++ /dev/null @@ -1,38 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${MACOSX_BUNDLE_EXECUTABLE_NAME} - CFBundleGetInfoString - ${MACOSX_BUNDLE_INFO_STRING} - CFBundleIconFile - ${MACOSX_BUNDLE_ICON_FILE} - CFBundleIdentifier - ${MACOSX_BUNDLE_GUI_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleLongVersionString - ${MACOSX_BUNDLE_LONG_VERSION_STRING} - CFBundleName - ${MACOSX_BUNDLE_BUNDLE_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - ${MACOSX_BUNDLE_SHORT_VERSION_STRING} - CFBundleSignature - ???? - CFBundleVersion - ${MACOSX_BUNDLE_BUNDLE_VERSION} - CSResourcesFileMapped - - LSRequiresCarbon - - NSHumanReadableCopyright - ${MACOSX_BUNDLE_COPYRIGHT} - NSHighResolutionCapable - - - diff --git a/third/MainWin.cpp b/third/MainWin.cpp index 299aafaaa..894f1af0f 100644 --- a/third/MainWin.cpp +++ b/third/MainWin.cpp @@ -117,7 +117,7 @@ Main::Main(QWidget *parent) : m_web3.reset(new WebThreeDirect("Third", getDataDir() + "/Third", false, {"eth", "shh"})); m_web3->connect(Host::pocHost()); - m_server = unique_ptr(new WebThreeStubServer(&m_qwebConnector, *web3(), keysAsVector(m_myKeys))); + m_server = unique_ptr(new WebThreeStubServer(m_qwebConnector, *web3(), keysAsVector(m_myKeys))); m_server->setIdentities(keysAsVector(owned())); m_server->StartListening(); @@ -611,15 +611,3 @@ void Main::on_mine_triggered() else ethereum()->stopMining(); } - -// extra bits needed to link on VS -#ifdef _MSC_VER - -// include moc file, ofuscated to hide from automoc -#include\ -"moc_MainWin.cpp" - -#include\ -"moc_MiningView.cpp" - -#endif diff --git a/walleth/CMakeLists.txt b/walleth/CMakeLists.txt deleted file mode 100644 index cac73a726..000000000 --- a/walleth/CMakeLists.txt +++ /dev/null @@ -1,117 +0,0 @@ -cmake_policy(SET CMP0015 NEW) - -if ("${TARGET_PLATFORM}" STREQUAL "w64") - cmake_policy(SET CMP0020 NEW) -endif () - - -set(CMAKE_INCLUDE_CURRENT_DIR ON) -aux_source_directory(. SRC_LIST) - -include_directories(..) -link_directories(../libethcore) -link_directories(../libethereum) -link_directories(../libqethereum) - -# Find Qt5 for Apple and update src_list for windows -if (APPLE) - # homebrew defaults to qt4 and installs qt5 as 'keg-only' - # which places it into /usr/local/opt insteadof /usr/local. - - set(CMAKE_PREFIX_PATH /usr/local/opt/qt5) - include_directories(/usr/local/opt/qt5/include /usr/local/include) -elseif ("${TARGET_PLATFORM}" STREQUAL "w64") - set(SRC_LIST ${SRC_LIST} ../windows/qt_plugin_import.cpp) -elseif (UNIX) - set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ";$ENV{QTDIR}/lib/cmake") -endif () - - -find_package(Qt5Widgets REQUIRED) -find_package(Qt5Gui REQUIRED) -find_package(Qt5Quick REQUIRED) -find_package(Qt5Qml REQUIRED) -find_package(Qt5Network REQUIRED) -qt5_wrap_ui(ui_Main.h Main.ui) -qt5_add_resources(RESOURCE_ADDED Resources.qrc) - -# Set name of binary and add_executable() -if (APPLE) - set(EXECUTEABLE Walleth) - set(CMAKE_INSTALL_PREFIX ./) - set(BIN_INSTALL_DIR ".") - set(DOC_INSTALL_DIR ".") - - set(PROJECT_VERSION "${ETH_VERSION}") - set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME} ${PROJECT_VERSION}") - set(MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_NAME} ${PROJECT_VERSION}") - set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME} ${PROJECT_VERSION}") - set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}") - set(MACOSX_BUNDLE_COPYRIGHT "${PROJECT_COPYRIGHT_YEAR} ${PROJECT_VENDOR}") - set(MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_DOMAIN_SECOND}.${PROJECT_DOMAIN_FIRST}") - set(MACOSX_BUNDLE_BUNDLE_NAME ${EXECUTEABLE}) - include(BundleUtilities) - - add_executable(${EXECUTEABLE} MACOSX_BUNDLE Main.ui ${RESOURCE_ADDED} ${SRC_LIST}) -else () - set(EXECUTEABLE walleth) - add_executable(${EXECUTEABLE} Main.ui ${RESOURCE_ADDED} ${SRC_LIST}) -endif () - -qt5_use_modules(${EXECUTEABLE} Core Gui Widgets Network Quick Qml) -target_link_libraries(${EXECUTEABLE} qethereum ethereum secp256k1 ${CRYPTOPP_LS}) - -if (APPLE) - if (${ADDFRAMEWORKS}) - set_target_properties(${EXECUTEABLE} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/EthereumMacOSXBundleInfo.plist.in") - endif () - - SET_SOURCE_FILES_PROPERTIES(${EXECUTEABLE} PROPERTIES MACOSX_PACKAGE_LOCATION MacOS) - - # This is a workaround for when the build-type defaults to Debug, and when a multi-config generator like xcode is used, where the type - # will not be set but defaults to release. - set(generator_lowercase "${CMAKE_GENERATOR}") - string(TOLOWER "${CMAKE_GENERATOR}" generator_lowercase) - if ("${generator_lowercase}" STREQUAL "xcode") - # TODO: Not sure how to resolve this. Possibly \${TARGET_BUILD_DIR} - set(binary_build_dir "${CMAKE_CURRENT_BINARY_DIR}/Debug") - else () - set(binary_build_dir "${CMAKE_CURRENT_BINARY_DIR}") - endif () - - set(APPS ${binary_build_dir}/${EXECUTEABLE}.app) - - # This tool and the next will automatically looked at the linked libraries in order to determine what dependencies are required. Thus, target_link_libaries only needs to add ethereum and secp256k1 (above) - install(CODE " - include(BundleUtilities) - set(BU_CHMOD_BUNDLE_ITEMS 1) - fixup_bundle(\"${APPS}\" \"${BUNDLELIBS}\" \"../libqethereum ../libethereum ../secp256k1\") - " COMPONENT RUNTIME ) - - if (${ADDFRAMEWORKS}) - add_custom_target(addframeworks ALL - COMMAND /usr/local/opt/qt5/bin/macdeployqt ${binary_build_dir}/${EXECUTEABLE}.app - WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - DEPENDS ${PROJECT_NAME} - ) - endif () - -elseif ("${TARGET_PLATFORM}" STREQUAL "w64") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-keep-inline-dllexport -static-libgcc -static-libstdc++ -static") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-s -Wl,-subsystem,windows -mthreads -L/usr/x86_64-w64-mingw32/plugins/platforms") - target_link_libraries(${EXECUTEABLE} gcc) - target_link_libraries(${EXECUTEABLE} mingw32 qtmain mswsock iphlpapi qwindows shlwapi Qt5PlatformSupport gdi32 comdlg32 oleaut32 imm32 winmm ole32 uuid ws2_32) - target_link_libraries(${EXECUTEABLE} boost_system-mt-s) - target_link_libraries(${EXECUTEABLE} boost_filesystem-mt-s) - target_link_libraries(${EXECUTEABLE} boost_thread_win32-mt-s) - target_link_libraries(${EXECUTEABLE} Qt5PlatformSupport) - set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) -elseif (UNIX) -else () - target_link_libraries(${EXECUTEABLE} boost_system) - target_link_libraries(${EXECUTEABLE} boost_filesystem) - find_package(Threads REQUIRED) - target_link_libraries(${EXECUTEABLE} ${CMAKE_THREAD_LIBS_INIT}) - install( TARGETS ${EXECUTEABLE} RUNTIME DESTINATION bin ) -endif () - diff --git a/walleth/EthereumMacOSXBundleInfo.plist.in b/walleth/EthereumMacOSXBundleInfo.plist.in deleted file mode 100644 index 684ad7908..000000000 --- a/walleth/EthereumMacOSXBundleInfo.plist.in +++ /dev/null @@ -1,38 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${MACOSX_BUNDLE_EXECUTABLE_NAME} - CFBundleGetInfoString - ${MACOSX_BUNDLE_INFO_STRING} - CFBundleIconFile - ${MACOSX_BUNDLE_ICON_FILE} - CFBundleIdentifier - ${MACOSX_BUNDLE_GUI_IDENTIFIER} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleLongVersionString - ${MACOSX_BUNDLE_LONG_VERSION_STRING} - CFBundleName - ${MACOSX_BUNDLE_BUNDLE_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - ${MACOSX_BUNDLE_SHORT_VERSION_STRING} - CFBundleSignature - ???? - CFBundleVersion - ${MACOSX_BUNDLE_BUNDLE_VERSION} - CSResourcesFileMapped - - LSRequiresCarbon - - NSHumanReadableCopyright - ${MACOSX_BUNDLE_COPYRIGHT} - NSHighResolutionCapable - - - diff --git a/walleth/Main.ui b/walleth/Main.ui deleted file mode 100644 index 6904590a8..000000000 --- a/walleth/Main.ui +++ /dev/null @@ -1,168 +0,0 @@ - - - Main - - - - 0 - 0 - 562 - 488 - - - - Walleth - - - true - - - QMainWindow::AllowNestedDocks|QMainWindow::AllowTabbedDocks|QMainWindow::VerticalTabs - - - true - - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - - - 0 wei - - - - - - - 0 peers - - - - - - - 1 block - - - - - - - - - - - 0 - 0 - 562 - 20 - - - - - &File - - - - - - &Network - - - - - - - - T&ools - - - - - - - - &Help - - - - - - - - - - - - &Quit - - - - - true - - - true - - - Use &UPnP - - - - - &Connect to Peer... - - - - - true - - - Enable &Network - - - - - true - - - &Mine - - - - - &New Address - - - - - &About... - - - - - true - - - &Preview - - - - - - - diff --git a/walleth/MainWin.cpp b/walleth/MainWin.cpp deleted file mode 100644 index f56cad65d..000000000 --- a/walleth/MainWin.cpp +++ /dev/null @@ -1,286 +0,0 @@ -#include -#include -//#include -//#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "BuildInfo.h" -#include "MainWin.h" -#include "ui_Main.h" -using namespace std; - -// types -using dev::bytes; -using dev::bytesConstRef; -using dev::h160; -using dev::h256; -using dev::u160; -using dev::u256; -using dev::u256s; -using dev::Address; -using dev::eth::BlockInfo; -using dev::eth::Client; -using dev::eth::Instruction; -using dev::KeyPair; -using dev::eth::NodeMode; -using dev::p2p::PeerInfo; -using dev::RLP; -using dev::Secret; -using dev::eth::Transaction; - -// functions -using dev::toHex; -using dev::fromHex; -using dev::right160; -using dev::simpleDebugOut; -using dev::toLog2; -using dev::toString; -using dev::eth::units; -using dev::eth::disassemble; -using dev::eth::formatBalance; - -// vars -using dev::g_logPost; -using dev::g_logVerbosity; - -Main::Main(QWidget *parent) : - QMainWindow(parent), - ui(new Ui::Main) -{ - setWindowFlags(Qt::Window); - ui->setupUi(this); - setWindowIcon(QIcon(":/Ethereum.png")); - - g_qmlMain = this; - - m_client.reset(new Client("Walleth", Address(), dev::getDataDir() + "/Walleth")); - - g_qmlClient = m_client.get(); - - qRegisterMetaType("dev::u256"); - qRegisterMetaType("dev::KeyPair"); - qRegisterMetaType("dev::Secret"); - qRegisterMetaType("dev::Address"); - qRegisterMetaType("QmlAccount*"); - qRegisterMetaType("QmlEthereum*"); - - qmlRegisterType("org.ethereum", 1, 0, "Ethereum"); - qmlRegisterType("org.ethereum", 1, 0, "Account"); - qmlRegisterSingletonType("org.ethereum", 1, 0, "Balance", QmlEthereum::constructU256Helper); - qmlRegisterSingletonType("org.ethereum", 1, 0, "Key", QmlEthereum::constructKeyHelper); - - /* - ui->librariesView->setModel(m_libraryMan); - ui->graphsView->setModel(m_graphMan); - */ - - m_view = new QQuickView(); - -// QQmlContext* context = m_view->rootContext(); -// context->setContextProperty("u256", new U256Helper(this)); - - m_view->setSource(QUrl("qrc:/Simple.qml")); - - QWidget* w = QWidget::createWindowContainer(m_view); - m_view->setResizeMode(QQuickView::SizeRootObjectToView); - ui->fullDisplay->insertWidget(0, w); - m_view->create(); - -// m_timelinesItem = m_view->rootObject()->findChild("timelines"); - - readSettings(); - refresh(); - - m_refreshNetwork = new QTimer(this); - connect(m_refreshNetwork, SIGNAL(timeout()), SLOT(refreshNetwork())); - m_refreshNetwork->start(1000); - - connect(&m_webCtrl, &QNetworkAccessManager::finished, [&](QNetworkReply* _r) - { - m_servers = QString::fromUtf8(_r->readAll()).split("\n", QString::SkipEmptyParts); - if (m_servers.size()) - { - ui->net->setChecked(true); - on_net_triggered(true); - } - }); - QNetworkRequest r(QUrl("http://www.ethereum.org/servers.poc" + QString(dev::Version).section('.', 1, 1) + ".txt")); - r.setHeader(QNetworkRequest::UserAgentHeader, "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1712.0 Safari/537.36"); - m_webCtrl.get(r); - srand(time(0)); - - startTimer(200); - - statusBar()->addPermanentWidget(ui->balance); - statusBar()->addPermanentWidget(ui->peerCount); - statusBar()->addPermanentWidget(ui->blockCount); -} - -Main::~Main() -{ - writeSettings(); -} - -void Main::timerEvent(QTimerEvent *) -{ - -} - -void Main::on_about_triggered() -{ - QMessageBox::about(this, "About Walleth PoC-" + QString(dev::Version).section('.', 1, 1), QString("Walleth/v") + dev::Version + "/" DEV_QUOTED(ETH_BUILD_TYPE) "/" DEV_QUOTED(ETH_BUILD_PLATFORM) "\n" DEV_QUOTED(ETH_COMMIT_HASH) + (ETH_CLEAN_REPO ? "\nCLEAN" : "\n+ LOCAL CHANGES") + "\n\nBy Gav Wood, 2014.\nBased on a design by Vitalik Buterin.\n\nThanks to the various contributors including: Alex Leverington, Tim Hughes, caktux, Eric Lombrozo, Marko Simovic."); -} - -void Main::writeSettings() -{ - QSettings s("ethereum", "walleth"); - QByteArray b; - b.resize(sizeof(Secret) * m_myKeys.size()); - auto p = b.data(); - for (auto i: m_myKeys) - { - memcpy(p, &(i.secret()), sizeof(Secret)); - p += sizeof(Secret); - } - s.setValue("address", b); - - s.setValue("upnp", ui->upnp->isChecked()); - s.setValue("clientName", m_clientName); - s.setValue("idealPeers", m_idealPeers); - s.setValue("port", m_port); - - bytes d = client()->savePeers(); - if (d.size()) - m_peers = QByteArray((char*)d.data(), (int)d.size()); - s.setValue("peers", m_peers); - - s.setValue("geometry", saveGeometry()); - s.setValue("windowState", saveState()); -} - -void Main::readSettings() -{ - QSettings s("ethereum", "walleth"); - - restoreGeometry(s.value("geometry").toByteArray()); - restoreState(s.value("windowState").toByteArray()); - - QByteArray b = s.value("address").toByteArray(); - if (b.isEmpty()) - m_myKeys.append(KeyPair::create()); - else - { - h256 k; - for (unsigned i = 0; i < b.size() / sizeof(Secret); ++i) - { - memcpy(&k, b.data() + i * sizeof(Secret), sizeof(Secret)); - m_myKeys.append(KeyPair(k)); - } - } - //m_eth->setAddress(m_myKeys.last().address()); - m_peers = s.value("peers").toByteArray(); - ui->upnp->setChecked(s.value("upnp", true).toBool()); - m_clientName = s.value("clientName", "").toString(); - m_idealPeers = s.value("idealPeers", 5).toInt(); - m_port = s.value("port", 30303).toInt(); -} - -void Main::refreshNetwork() -{ - auto ps = client()->peers(); - ui->peerCount->setText(QString::fromStdString(toString(ps.size())) + " peer(s)"); -} - -void Main::refresh() -{ - auto d = client()->blockChain().details(); - auto diff = BlockInfo(client()->blockChain().block()).difficulty; - ui->blockCount->setText(QString("#%1 @%3 T%2").arg(d.number).arg(toLog2(d.totalDifficulty)).arg(toLog2(diff))); - - m_keysChanged = false; - u256 totalBalance = 0; - for (auto i: m_myKeys) - { - u256 b = m_client->balanceAt(i.address()); - totalBalance += b; - } - ui->balance->setText(QString::fromStdString(formatBalance(totalBalance))); -} - -void Main::on_net_triggered(bool _auto) -{ - string n = string("Walleth/v") + dev::Version; - if (m_clientName.size()) - n += "/" + m_clientName.toStdString(); - n += "/" DEV_QUOTED(ETH_BUILD_TYPE) "/" DEV_QUOTED(ETH_BUILD_PLATFORM); - client()->setClientVersion(n); - if (ui->net->isChecked()) - { - if (_auto) - { - QString s = m_servers[rand() % m_servers.size()]; - client()->startNetwork(m_port, s.section(':', 0, 0).toStdString(), s.section(':', 1).toInt(), NodeMode::Full, m_idealPeers, "", ui->upnp->isChecked()); - } - else - client()->startNetwork(m_port, string(), 0, NodeMode::Full, m_idealPeers, "", ui->upnp->isChecked()); - if (m_peers.size()) - client()->restorePeers(bytesConstRef((byte*)m_peers.data(), m_peers.size())); - } - else - client()->stopNetwork(); -} - -void Main::on_connect_triggered() -{ - if (!ui->net->isChecked()) - { - ui->net->setChecked(true); - on_net_triggered(); - } - bool ok = false; - QString s = QInputDialog::getItem(this, "Connect to a Network Peer", "Enter a peer to which a connection may be made:", m_servers, m_servers.count() ? rand() % m_servers.count() : 0, true, &ok); - if (ok && s.contains(":")) - { - string host = s.section(":", 0, 0).toStdString(); - unsigned short port = s.section(":", 1).toInt(); - client()->connect(host, port); - } -} - -void Main::on_mine_triggered() -{ - if (ui->mine->isChecked()) - { - client()->setAddress(m_myKeys.last().address()); - client()->startMining(); - } - else - client()->stopMining(); -} - -void Main::on_create_triggered() -{ - m_myKeys.append(KeyPair::create()); - m_keysChanged = true; -} - -// extra bits needed to link on VS -#ifdef _MSC_VER - -// include moc file, ofuscated to hide from automoc -#include\ -"moc_MainWin.cpp" - -// include qrc content -#include\ -"qrc_Resources.cpp" - -#endif diff --git a/walleth/MainWin.h b/walleth/MainWin.h deleted file mode 100644 index 860db8bc9..000000000 --- a/walleth/MainWin.h +++ /dev/null @@ -1,84 +0,0 @@ -#ifndef MAIN_H -#define MAIN_H - -#include -#include -#include -#include -#include -#include - -namespace Ui { -class Main; -} - -namespace dev { namespace eth { -class Client; -class State; -}} - -class QQuickView; -class QQmlEngine; -class QJSEngine; - -class Main : public QMainWindow -{ - Q_OBJECT - -public: - explicit Main(QWidget *parent = 0); - ~Main(); - - dev::eth::Client* client() const { return m_client.get(); } - -private slots: - void on_connect_triggered(); - void on_mine_triggered(); - void on_create_triggered(); - void on_net_triggered(bool _auto = false); - void on_about_triggered(); - void on_preview_triggered() { refresh(); } - void on_quit_triggered() { close(); } - - void refresh(); - void refreshNetwork(); - -protected: - virtual void timerEvent(QTimerEvent *); - -private: -/* QString pretty(dev::Address _a) const; - QString render(dev::Address _a) const; - dev::Address fromString(QString const& _a) const; -*/ - dev::eth::State const& state() const; - - void updateFee(); - void readSettings(); - void writeSettings(); - - dev::u256 fee() const; - dev::u256 total() const; - dev::u256 value() const; - - std::unique_ptr ui; - - QByteArray m_peers; - QMutex m_guiLock; - QTimer* m_refresh; - QTimer* m_refreshNetwork; - QVector m_myKeys; - bool m_keysChanged = false; - int m_port; - int m_idealPeers; - QString m_clientName; - QStringList m_servers; - - QQuickView* m_view; - - QNetworkAccessManager m_webCtrl; - - std::unique_ptr m_client; -}; - -#endif // MAIN_H diff --git a/walleth/Resources.qrc b/walleth/Resources.qrc deleted file mode 100644 index 1789216ed..000000000 --- a/walleth/Resources.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - Simple.qml - - diff --git a/walleth/Simple.qml b/walleth/Simple.qml deleted file mode 100644 index 53cb7def4..000000000 --- a/walleth/Simple.qml +++ /dev/null @@ -1,38 +0,0 @@ -import QtQml 2.2 -import QtQuick 2.1 -import QtQuick.Controls 1.0 -import QtQuick.Layouts 1.0 -import Qt.labs.settings 1.0 -import org.ethereum 1.0 - -Item { - id: main - anchors.fill: parent - anchors.margins: 9 - -// Qt.application.name: "Walleth" -// Qt.application.organization: "Ethereum" -// Qt.application.domain: "org.ethereum" - - Ethereum { - id: eth - } - - Account { - id: myAccount - address: Key.addressOf("84fc4ba9373c30bfe32d8c5a502854e7f1175878") - ethereum: eth - // TODO: state: eth.latest // could be eth.pending - // will provide balance, txCount, isContract, incomingTransactions (list model), outgoingTransactions (list model). - // transaction lists' items will provide value, from, to, final balance. - } - - // KeyPair provides makeTransaction(recvAddress, value, data (array)) - - Text { - text: "Balance: " + Balance.stringOf(myAccount.balance) + " [" + myAccount.txCount + "]" + "\nAccount: " + Key.stringOf(myAccount.address) - Layout.minimumHeight: 30 - Layout.fillHeight: true - Layout.fillWidth: true - } -} diff --git a/walleth/main.cpp b/walleth/main.cpp deleted file mode 100644 index 42afd5e66..000000000 --- a/walleth/main.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "MainWin.h" -#include - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - Main w; - w.show(); - - return a.exec(); -} diff --git a/windows/.gitattributes b/windows/.gitattributes deleted file mode 100644 index 48910107d..000000000 --- a/windows/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -*.vcxproj eol=crlf -*.props eol=crlf diff --git a/windows/Alethzero.vcxproj b/windows/Alethzero.vcxproj deleted file mode 100644 index 38dbd6265..000000000 --- a/windows/Alethzero.vcxproj +++ /dev/null @@ -1,311 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - Win32Proj - AlethZero - AlethZero - {BFCFFC46-78A3-4350-9938-0EA3A2B1CCCD} - - - - Application - true - v120 - - - Application - true - v120 - - - Application - false - v120 - - - Application - false - v120 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - false - - - false - - - - Use - Disabled - WIN32;_WINSOCK_DEPRECATED_NO_WARNINGS;_DEBUG;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - true - stdafx.h - - - Windows - true - true - - - - - - - - - Use - Disabled - WIN32;_DEBUG;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - true - stdafx.h - - - Windows - true - - - - - - - - - Use - MaxSpeed - true - true - WIN32;_WINSOCK_DEPRECATED_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions) - MultiThreadedDLL - true - AnySuitable - stdafx.h - - - Windows - true - true - true - true - - - - - - - - - Use - MaxSpeed - true - true - WIN32;NDEBUG;%(PreprocessorDefinitions) - MultiThreadedDLL - true - AnySuitable - stdafx.h - - - Windows - true - true - true - - - - - - - - - {df3c5b07-a1a2-4f16-b37f-a27333622cdd} - - - {f174e81a-2a66-4693-b917-11bb42d3658c} - - - - - - - - - - Create - Create - Create - Create - - - - - - $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" - $(IntDir)moc_%(FileName).cpp - - - $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" - - - $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" - - - $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" - - - $(IntDir)moc_%(FileName).cpp - $(IntDir)moc_%(FileName).cpp - $(IntDir)moc_%(FileName).cpp - - - - - $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" - - - $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" - - - $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" - - - $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" - - - $(IntDir)moc_%(FileName).cpp - $(IntDir)moc_%(FileName).cpp - $(IntDir)moc_%(FileName).cpp - $(IntDir)moc_%(FileName).cpp - - - $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" - - - $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" - - - $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" - - - $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" - - - $(IntDir)moc_%(FileName).cpp - $(IntDir)moc_%(FileName).cpp - $(IntDir)moc_%(FileName).cpp - $(IntDir)moc_%(FileName).cpp - - - - - - Document - "$(QtBin)/uic" -o "$(IntDir)ui_%(FileName).h" "%(FullPath)" - "$(QtBin)/uic" -o "$(IntDir)ui_%(FileName).h" "%(FullPath)" - $(IntDir)ui_%(FileName).h - "$(QtBin)/uic" -o "$(IntDir)ui_%(FileName).h" "%(FullPath)" - "$(QtBin)/uic" -o "$(IntDir)ui_%(FileName).h" "%(FullPath)" - $(IntDir)ui_%(FileName).h - "$(QtBin)/uic" -o "$(IntDir)ui_%(FileName).h" "%(FullPath)" - "$(QtBin)/uic" -o "$(IntDir)ui_%(FileName).h" "%(FullPath)" - $(IntDir)ui_%(FileName).h - "$(QtBin)/uic" -o "$(IntDir)ui_%(FileName).h" "%(FullPath)" - "$(QtBin)/uic" -o "$(IntDir)ui_%(FileName).h" "%(FullPath)" - $(IntDir)ui_%(FileName).h - - - - - Document - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(IntDir)%(FileName).h - $(IntDir)%(FileName).h - $(IntDir)%(FileName).h - $(IntDir)%(FileName).h - ../.git/index - ../.git/index - ../.git/index - ../.git/index - - - - - - - - - - - - - $(BuildDependsOn);FinalCopy - - - - - - - - \ No newline at end of file diff --git a/windows/Alethzero.vcxproj.filters b/windows/Alethzero.vcxproj.filters deleted file mode 100644 index ef47bdba0..000000000 --- a/windows/Alethzero.vcxproj.filters +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - Windows - - - Windows - - - - - - - - Windows - - - - - - - {049fb46c-1677-45cb-95ae-3a2d9e3090be} - - - - - - - Windows - - - - - \ No newline at end of file diff --git a/windows/BuildInfo.lua b/windows/BuildInfo.lua deleted file mode 100644 index 47b23a795..000000000 --- a/windows/BuildInfo.lua +++ /dev/null @@ -1,25 +0,0 @@ - -function os.capture(cmd) - local f = io.popen(cmd, 'r') - if (f) then - local s = f:read('*a') - if (f:close()) then - return s - end - end - return nil -end - -hash = (os.capture("git rev-parse HEAD") or "UnknownRevision"):gsub("\n$", "") -clean = ((os.capture("git diff --name-only") or "0"):gsub("\n$", "") == "") and "1" or "0" - -local output = io.open(arg[1], "w") -if (output) then - output:write("// This file was automatically generated by buildinfo.lua\n#pragma once\n\n") - output:write("#define ETH_COMMIT_HASH "..hash.."\n") - output:write("#define ETH_CLEAN_REPO "..clean.."\n") - output:close() -end - - - diff --git a/windows/Eth.vcxproj b/windows/Eth.vcxproj deleted file mode 100644 index 9b2d47727..000000000 --- a/windows/Eth.vcxproj +++ /dev/null @@ -1,195 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - Win32Proj - Ethereum - eth - {C60C065C-2135-4B2B-AFD4-35FD7AC56B40} - - - - Application - true - v120 - - - Application - true - v120 - - - Application - false - v120 - - - Application - false - v120 - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - false - - - false - - - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - true - - - Console - true - true - - - - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - true - - - Console - true - - - - - - - MaxSpeed - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDLL - true - AnySuitable - - - Console - true - true - true - true - - - - - - - MaxSpeed - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDLL - true - AnySuitable - - - Console - true - true - true - - - - - {826e68cb-d3ee-4a8a-b540-59a8c3f38d4f} - - - - - - - - Document - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(IntDir)%(FileName).h - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(IntDir)%(FileName).h - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(IntDir)%(FileName).h - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(IntDir)%(FileName).h - ../.git/index - ../.git/index - ../.git/index - ../.git/index - - - - - - - $(BuildDependsOn);FinalCopy - - - - - - - - \ No newline at end of file diff --git a/windows/Ethereum.sln b/windows/Ethereum.sln deleted file mode 100644 index 26fe794c2..000000000 --- a/windows/Ethereum.sln +++ /dev/null @@ -1,191 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Express 2013 for Windows Desktop -VisualStudioVersion = 12.0.21005.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libs", "Libs", "{988F2383-FA1D-408B-BCF6-C0EE7AB0A560}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{6838FA95-01BF-4FF7-914C-FC209B81406E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibEthereum", "LibEthereum.vcxproj", "{826E68CB-D3EE-4A8A-B540-59A8C3F38D4F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibLevelDB", "LibLevelDB.vcxproj", "{27014763-955D-486B-9BA7-69872192E6F4}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibSecp256k1", "LibSecp256k1.vcxproj", "{1E1175BB-C4A9-41D8-B2D1-9022F71D3CEA}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestSecp256k1", "TestSecp256k1.vcxproj", "{3BF049F8-AF7E-4E1C-9627-3E94C887AF24}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestEthereum", "TestEthereum.vcxproj", "{3F3E389B-88DE-41D5-A73B-4F6036E18B36}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibCryptoPP", "LibCryptoPP.vcxproj", "{1CC213A4-3482-4211-B47B-172E90DAC7DE}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibMiniUPnPc", "LibMiniUPnPc.vcxproj", "{1B1CA20E-39C3-4D9B-AC37-3783048E6672}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AlethZero", "Alethzero.vcxproj", "{BFCFFC46-78A3-4350-9938-0EA3A2B1CCCD}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibQEthereum", "LibQEthereum.vcxproj", "{DF3C5B07-A1A2-4F16-B37F-A27333622CDD}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "eth", "Eth.vcxproj", "{C60C065C-2135-4B2B-AFD4-35FD7AC56B40}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "neth", "Neth.vcxproj", "{90C70663-7181-4E99-9079-54188CEB8954}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LibSerpent", "LibSerpent.vcxproj", "{F174E81A-2A66-4693-B917-11BB42D3658C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "exp", "Exp.vcxproj", "{9AA5CF66-1150-4A02-B40E-3B89740DADB8}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sc", "Sc.vcxproj", "{90068D1B-070E-4C41-88B0-1E243E1E5BFF}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lllc", "Lllc.vcxproj", "{255BDC68-B8DB-465F-8220-981E77684189}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {826E68CB-D3EE-4A8A-B540-59A8C3F38D4F}.Debug|Win32.ActiveCfg = Debug|Win32 - {826E68CB-D3EE-4A8A-B540-59A8C3F38D4F}.Debug|Win32.Build.0 = Debug|Win32 - {826E68CB-D3EE-4A8A-B540-59A8C3F38D4F}.Debug|x64.ActiveCfg = Debug|x64 - {826E68CB-D3EE-4A8A-B540-59A8C3F38D4F}.Debug|x64.Build.0 = Debug|x64 - {826E68CB-D3EE-4A8A-B540-59A8C3F38D4F}.Release|Win32.ActiveCfg = Release|Win32 - {826E68CB-D3EE-4A8A-B540-59A8C3F38D4F}.Release|Win32.Build.0 = Release|Win32 - {826E68CB-D3EE-4A8A-B540-59A8C3F38D4F}.Release|x64.ActiveCfg = Release|x64 - {826E68CB-D3EE-4A8A-B540-59A8C3F38D4F}.Release|x64.Build.0 = Release|x64 - {27014763-955D-486B-9BA7-69872192E6F4}.Debug|Win32.ActiveCfg = Debug|Win32 - {27014763-955D-486B-9BA7-69872192E6F4}.Debug|Win32.Build.0 = Debug|Win32 - {27014763-955D-486B-9BA7-69872192E6F4}.Debug|x64.ActiveCfg = Debug|x64 - {27014763-955D-486B-9BA7-69872192E6F4}.Debug|x64.Build.0 = Debug|x64 - {27014763-955D-486B-9BA7-69872192E6F4}.Release|Win32.ActiveCfg = Release|Win32 - {27014763-955D-486B-9BA7-69872192E6F4}.Release|Win32.Build.0 = Release|Win32 - {27014763-955D-486B-9BA7-69872192E6F4}.Release|x64.ActiveCfg = Release|x64 - {27014763-955D-486B-9BA7-69872192E6F4}.Release|x64.Build.0 = Release|x64 - {1E1175BB-C4A9-41D8-B2D1-9022F71D3CEA}.Debug|Win32.ActiveCfg = Debug|Win32 - {1E1175BB-C4A9-41D8-B2D1-9022F71D3CEA}.Debug|Win32.Build.0 = Debug|Win32 - {1E1175BB-C4A9-41D8-B2D1-9022F71D3CEA}.Debug|x64.ActiveCfg = Debug|x64 - {1E1175BB-C4A9-41D8-B2D1-9022F71D3CEA}.Debug|x64.Build.0 = Debug|x64 - {1E1175BB-C4A9-41D8-B2D1-9022F71D3CEA}.Release|Win32.ActiveCfg = Release|Win32 - {1E1175BB-C4A9-41D8-B2D1-9022F71D3CEA}.Release|Win32.Build.0 = Release|Win32 - {1E1175BB-C4A9-41D8-B2D1-9022F71D3CEA}.Release|x64.ActiveCfg = Release|x64 - {1E1175BB-C4A9-41D8-B2D1-9022F71D3CEA}.Release|x64.Build.0 = Release|x64 - {3BF049F8-AF7E-4E1C-9627-3E94C887AF24}.Debug|Win32.ActiveCfg = Debug|Win32 - {3BF049F8-AF7E-4E1C-9627-3E94C887AF24}.Debug|Win32.Build.0 = Debug|Win32 - {3BF049F8-AF7E-4E1C-9627-3E94C887AF24}.Debug|x64.ActiveCfg = Debug|x64 - {3BF049F8-AF7E-4E1C-9627-3E94C887AF24}.Debug|x64.Build.0 = Debug|x64 - {3BF049F8-AF7E-4E1C-9627-3E94C887AF24}.Release|Win32.ActiveCfg = Release|Win32 - {3BF049F8-AF7E-4E1C-9627-3E94C887AF24}.Release|Win32.Build.0 = Release|Win32 - {3BF049F8-AF7E-4E1C-9627-3E94C887AF24}.Release|x64.ActiveCfg = Release|x64 - {3BF049F8-AF7E-4E1C-9627-3E94C887AF24}.Release|x64.Build.0 = Release|x64 - {3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Debug|Win32.ActiveCfg = Debug|Win32 - {3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Debug|Win32.Build.0 = Debug|Win32 - {3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Debug|x64.ActiveCfg = Debug|x64 - {3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Debug|x64.Build.0 = Debug|x64 - {3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Release|Win32.ActiveCfg = Release|Win32 - {3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Release|Win32.Build.0 = Release|Win32 - {3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Release|x64.ActiveCfg = Release|x64 - {3F3E389B-88DE-41D5-A73B-4F6036E18B36}.Release|x64.Build.0 = Release|x64 - {1CC213A4-3482-4211-B47B-172E90DAC7DE}.Debug|Win32.ActiveCfg = Debug|Win32 - {1CC213A4-3482-4211-B47B-172E90DAC7DE}.Debug|Win32.Build.0 = Debug|Win32 - {1CC213A4-3482-4211-B47B-172E90DAC7DE}.Debug|x64.ActiveCfg = Debug|x64 - {1CC213A4-3482-4211-B47B-172E90DAC7DE}.Debug|x64.Build.0 = Debug|x64 - {1CC213A4-3482-4211-B47B-172E90DAC7DE}.Release|Win32.ActiveCfg = Release|Win32 - {1CC213A4-3482-4211-B47B-172E90DAC7DE}.Release|Win32.Build.0 = Release|Win32 - {1CC213A4-3482-4211-B47B-172E90DAC7DE}.Release|x64.ActiveCfg = Release|x64 - {1CC213A4-3482-4211-B47B-172E90DAC7DE}.Release|x64.Build.0 = Release|x64 - {1B1CA20E-39C3-4D9B-AC37-3783048E6672}.Debug|Win32.ActiveCfg = Debug|Win32 - {1B1CA20E-39C3-4D9B-AC37-3783048E6672}.Debug|Win32.Build.0 = Debug|Win32 - {1B1CA20E-39C3-4D9B-AC37-3783048E6672}.Debug|x64.ActiveCfg = Debug|x64 - {1B1CA20E-39C3-4D9B-AC37-3783048E6672}.Debug|x64.Build.0 = Debug|x64 - {1B1CA20E-39C3-4D9B-AC37-3783048E6672}.Release|Win32.ActiveCfg = Release|Win32 - {1B1CA20E-39C3-4D9B-AC37-3783048E6672}.Release|Win32.Build.0 = Release|Win32 - {1B1CA20E-39C3-4D9B-AC37-3783048E6672}.Release|x64.ActiveCfg = Release|x64 - {1B1CA20E-39C3-4D9B-AC37-3783048E6672}.Release|x64.Build.0 = Release|x64 - {BFCFFC46-78A3-4350-9938-0EA3A2B1CCCD}.Debug|Win32.ActiveCfg = Debug|Win32 - {BFCFFC46-78A3-4350-9938-0EA3A2B1CCCD}.Debug|Win32.Build.0 = Debug|Win32 - {BFCFFC46-78A3-4350-9938-0EA3A2B1CCCD}.Debug|x64.ActiveCfg = Debug|x64 - {BFCFFC46-78A3-4350-9938-0EA3A2B1CCCD}.Debug|x64.Build.0 = Debug|x64 - {BFCFFC46-78A3-4350-9938-0EA3A2B1CCCD}.Release|Win32.ActiveCfg = Release|Win32 - {BFCFFC46-78A3-4350-9938-0EA3A2B1CCCD}.Release|Win32.Build.0 = Release|Win32 - {BFCFFC46-78A3-4350-9938-0EA3A2B1CCCD}.Release|x64.ActiveCfg = Release|x64 - {BFCFFC46-78A3-4350-9938-0EA3A2B1CCCD}.Release|x64.Build.0 = Release|x64 - {326EF470-463F-4751-A22A-48BBAAD8B143}.Debug|Win32.ActiveCfg = Debug|Win32 - {326EF470-463F-4751-A22A-48BBAAD8B143}.Debug|Win32.Build.0 = Debug|Win32 - {326EF470-463F-4751-A22A-48BBAAD8B143}.Debug|x64.ActiveCfg = Debug|x64 - {326EF470-463F-4751-A22A-48BBAAD8B143}.Debug|x64.Build.0 = Debug|x64 - {326EF470-463F-4751-A22A-48BBAAD8B143}.Release|Win32.ActiveCfg = Release|Win32 - {326EF470-463F-4751-A22A-48BBAAD8B143}.Release|Win32.Build.0 = Release|Win32 - {326EF470-463F-4751-A22A-48BBAAD8B143}.Release|x64.ActiveCfg = Release|x64 - {326EF470-463F-4751-A22A-48BBAAD8B143}.Release|x64.Build.0 = Release|x64 - {DF3C5B07-A1A2-4F16-B37F-A27333622CDD}.Debug|Win32.ActiveCfg = Debug|Win32 - {DF3C5B07-A1A2-4F16-B37F-A27333622CDD}.Debug|Win32.Build.0 = Debug|Win32 - {DF3C5B07-A1A2-4F16-B37F-A27333622CDD}.Debug|x64.ActiveCfg = Debug|x64 - {DF3C5B07-A1A2-4F16-B37F-A27333622CDD}.Debug|x64.Build.0 = Debug|x64 - {DF3C5B07-A1A2-4F16-B37F-A27333622CDD}.Release|Win32.ActiveCfg = Release|Win32 - {DF3C5B07-A1A2-4F16-B37F-A27333622CDD}.Release|Win32.Build.0 = Release|Win32 - {DF3C5B07-A1A2-4F16-B37F-A27333622CDD}.Release|x64.ActiveCfg = Release|x64 - {DF3C5B07-A1A2-4F16-B37F-A27333622CDD}.Release|x64.Build.0 = Release|x64 - {C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Debug|Win32.ActiveCfg = Debug|Win32 - {C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Debug|Win32.Build.0 = Debug|Win32 - {C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Debug|x64.ActiveCfg = Debug|x64 - {C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Debug|x64.Build.0 = Debug|x64 - {C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Release|Win32.ActiveCfg = Release|Win32 - {C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Release|Win32.Build.0 = Release|Win32 - {C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Release|x64.ActiveCfg = Release|x64 - {C60C065C-2135-4B2B-AFD4-35FD7AC56B40}.Release|x64.Build.0 = Release|x64 - {90C70663-7181-4E99-9079-54188CEB8954}.Debug|Win32.ActiveCfg = Debug|Win32 - {90C70663-7181-4E99-9079-54188CEB8954}.Debug|Win32.Build.0 = Debug|Win32 - {90C70663-7181-4E99-9079-54188CEB8954}.Debug|x64.ActiveCfg = Debug|x64 - {90C70663-7181-4E99-9079-54188CEB8954}.Debug|x64.Build.0 = Debug|x64 - {90C70663-7181-4E99-9079-54188CEB8954}.Release|Win32.ActiveCfg = Release|Win32 - {90C70663-7181-4E99-9079-54188CEB8954}.Release|Win32.Build.0 = Release|Win32 - {90C70663-7181-4E99-9079-54188CEB8954}.Release|x64.ActiveCfg = Release|x64 - {90C70663-7181-4E99-9079-54188CEB8954}.Release|x64.Build.0 = Release|x64 - {F174E81A-2A66-4693-B917-11BB42D3658C}.Debug|Win32.ActiveCfg = Debug|Win32 - {F174E81A-2A66-4693-B917-11BB42D3658C}.Debug|Win32.Build.0 = Debug|Win32 - {F174E81A-2A66-4693-B917-11BB42D3658C}.Debug|x64.ActiveCfg = Debug|x64 - {F174E81A-2A66-4693-B917-11BB42D3658C}.Debug|x64.Build.0 = Debug|x64 - {F174E81A-2A66-4693-B917-11BB42D3658C}.Release|Win32.ActiveCfg = Release|Win32 - {F174E81A-2A66-4693-B917-11BB42D3658C}.Release|Win32.Build.0 = Release|Win32 - {F174E81A-2A66-4693-B917-11BB42D3658C}.Release|x64.ActiveCfg = Release|x64 - {F174E81A-2A66-4693-B917-11BB42D3658C}.Release|x64.Build.0 = Release|x64 - {9AA5CF66-1150-4A02-B40E-3B89740DADB8}.Debug|Win32.ActiveCfg = Debug|Win32 - {9AA5CF66-1150-4A02-B40E-3B89740DADB8}.Debug|Win32.Build.0 = Debug|Win32 - {9AA5CF66-1150-4A02-B40E-3B89740DADB8}.Debug|x64.ActiveCfg = Debug|x64 - {9AA5CF66-1150-4A02-B40E-3B89740DADB8}.Debug|x64.Build.0 = Debug|x64 - {9AA5CF66-1150-4A02-B40E-3B89740DADB8}.Release|Win32.ActiveCfg = Release|Win32 - {9AA5CF66-1150-4A02-B40E-3B89740DADB8}.Release|Win32.Build.0 = Release|Win32 - {9AA5CF66-1150-4A02-B40E-3B89740DADB8}.Release|x64.ActiveCfg = Release|x64 - {9AA5CF66-1150-4A02-B40E-3B89740DADB8}.Release|x64.Build.0 = Release|x64 - {90068D1B-070E-4C41-88B0-1E243E1E5BFF}.Debug|Win32.ActiveCfg = Debug|Win32 - {90068D1B-070E-4C41-88B0-1E243E1E5BFF}.Debug|Win32.Build.0 = Debug|Win32 - {90068D1B-070E-4C41-88B0-1E243E1E5BFF}.Debug|x64.ActiveCfg = Debug|x64 - {90068D1B-070E-4C41-88B0-1E243E1E5BFF}.Debug|x64.Build.0 = Debug|x64 - {90068D1B-070E-4C41-88B0-1E243E1E5BFF}.Release|Win32.ActiveCfg = Release|Win32 - {90068D1B-070E-4C41-88B0-1E243E1E5BFF}.Release|Win32.Build.0 = Release|Win32 - {90068D1B-070E-4C41-88B0-1E243E1E5BFF}.Release|x64.ActiveCfg = Release|x64 - {90068D1B-070E-4C41-88B0-1E243E1E5BFF}.Release|x64.Build.0 = Release|x64 - {255BDC68-B8DB-465F-8220-981E77684189}.Debug|Win32.ActiveCfg = Debug|Win32 - {255BDC68-B8DB-465F-8220-981E77684189}.Debug|Win32.Build.0 = Debug|Win32 - {255BDC68-B8DB-465F-8220-981E77684189}.Debug|x64.ActiveCfg = Debug|x64 - {255BDC68-B8DB-465F-8220-981E77684189}.Debug|x64.Build.0 = Debug|x64 - {255BDC68-B8DB-465F-8220-981E77684189}.Release|Win32.ActiveCfg = Release|Win32 - {255BDC68-B8DB-465F-8220-981E77684189}.Release|Win32.Build.0 = Release|Win32 - {255BDC68-B8DB-465F-8220-981E77684189}.Release|x64.ActiveCfg = Release|x64 - {255BDC68-B8DB-465F-8220-981E77684189}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {826E68CB-D3EE-4A8A-B540-59A8C3F38D4F} = {988F2383-FA1D-408B-BCF6-C0EE7AB0A560} - {27014763-955D-486B-9BA7-69872192E6F4} = {988F2383-FA1D-408B-BCF6-C0EE7AB0A560} - {1E1175BB-C4A9-41D8-B2D1-9022F71D3CEA} = {988F2383-FA1D-408B-BCF6-C0EE7AB0A560} - {1CC213A4-3482-4211-B47B-172E90DAC7DE} = {988F2383-FA1D-408B-BCF6-C0EE7AB0A560} - {1B1CA20E-39C3-4D9B-AC37-3783048E6672} = {988F2383-FA1D-408B-BCF6-C0EE7AB0A560} - {DF3C5B07-A1A2-4F16-B37F-A27333622CDD} = {988F2383-FA1D-408B-BCF6-C0EE7AB0A560} - {F174E81A-2A66-4693-B917-11BB42D3658C} = {988F2383-FA1D-408B-BCF6-C0EE7AB0A560} - {3BF049F8-AF7E-4E1C-9627-3E94C887AF24} = {6838FA95-01BF-4FF7-914C-FC209B81406E} - {3F3E389B-88DE-41D5-A73B-4F6036E18B36} = {6838FA95-01BF-4FF7-914C-FC209B81406E} - EndGlobalSection -EndGlobal diff --git a/windows/Ethereum.vcxproj.filters b/windows/Ethereum.vcxproj.filters deleted file mode 100644 index 0bee64924..000000000 --- a/windows/Ethereum.vcxproj.filters +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - {ed0eafbf-bbfb-4700-b7c0-9b58049cc681} - - - - - Windows - - - \ No newline at end of file diff --git a/windows/Exp.vcxproj b/windows/Exp.vcxproj deleted file mode 100644 index cf4eb5d2e..000000000 --- a/windows/Exp.vcxproj +++ /dev/null @@ -1,195 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - Win32Proj - Ethereum - exp - {9AA5CF66-1150-4A02-B40E-3B89740DADB8} - - - - Application - true - v120 - - - Application - true - v120 - - - Application - false - v120 - - - Application - false - v120 - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - false - - - false - - - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - true - - - Console - true - true - - - - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - true - - - Console - true - - - - - - - MaxSpeed - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDLL - true - AnySuitable - - - Console - true - true - true - true - - - - - - - MaxSpeed - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDLL - true - AnySuitable - - - Console - true - true - true - - - - - {826e68cb-d3ee-4a8a-b540-59a8c3f38d4f} - - - - - Document - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(IntDir)%(FileName).h - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(IntDir)%(FileName).h - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(IntDir)%(FileName).h - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(IntDir)%(FileName).h - ../.git/index - ../.git/index - ../.git/index - ../.git/index - - - - - - - - - - $(BuildDependsOn);FinalCopy - - - - - - - - \ No newline at end of file diff --git a/windows/LibCryptoPP.vcxproj b/windows/LibCryptoPP.vcxproj deleted file mode 100644 index 032ae5fa6..000000000 --- a/windows/LibCryptoPP.vcxproj +++ /dev/null @@ -1,414 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Document - ml64.exe /c /nologo /Fo"$(IntDir)x64dll.obj" /Zi "%(FullPath)" - ml64.exe /c /nologo /Fo"$(IntDir)x64dll.obj" /Zi "%(FullPath)" - $(IntDir)x64dll.obj - $(IntDir)x64dll.obj - - - - Win32Proj - LibCryptoPP - {1CC213A4-3482-4211-B47B-172E90DAC7DE} - - - - StaticLibrary - true - v120 - - - StaticLibrary - true - v120 - - - StaticLibrary - false - v120 - - - StaticLibrary - false - v120 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Disabled - MultiThreadedDebugDLL - 4100;4189;4244;%(DisableSpecificWarnings) - - - Windows - true - - - - - - - Disabled - MultiThreadedDebugDLL - 4100;4189;4244;%(DisableSpecificWarnings) - - - Windows - true - - - - - - - MaxSpeed - true - true - MultiThreadedDLL - 4100;4189;4244;%(DisableSpecificWarnings) - - - Windows - true - true - true - - - - - - - MaxSpeed - true - true - MultiThreadedDLL - 4100;4189;4244;%(DisableSpecificWarnings) - - - Windows - true - true - true - - - - - - \ No newline at end of file diff --git a/windows/LibEthereum.props b/windows/LibEthereum.props deleted file mode 100644 index 8c0bcac90..000000000 --- a/windows/LibEthereum.props +++ /dev/null @@ -1,35 +0,0 @@ - - - - - ../../boost - "../../lua/lua" - - - ..\..\_build\$(ProjectName)\$(Platform)_$(Configuration)\ - ..\..\_build\$(ProjectName)\$(Platform)_$(Configuration)\ - - - - 4068;4244;4267 - true - false - include/$(ProjectName);$(IntDir);../../cryptopp;..;../libethcore;../libethereum;../libethsupport;$(BoostDir);../../leveldb/include;../secp256k1;../../miniupnp - ETH_BUILD_PLATFORM=Windows/VS2013;ETH_BUILD_TYPE=$(Configuration)-$(Platform);ETH_MINIUPNPC=1;STATICLIB;LEVELDB_PLATFORM_WINDOWS;USE_NUM_BOOST;USE_FIELD_10X26;USE_FIELD_INV_BUILTIN;_WIN32_WINNT=0x0501;WIN32;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - true - true - Level3 - - - $(BoostDir)/stage/$(Platform) - - - - - $(BoostDir) - - - $(Lua) - - - \ No newline at end of file diff --git a/windows/LibEthereum.vcxproj b/windows/LibEthereum.vcxproj deleted file mode 100644 index cbacd51b5..000000000 --- a/windows/LibEthereum.vcxproj +++ /dev/null @@ -1,572 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - - - - - - - - - - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - - - - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - - - true - true - true - true - - - - stdafx.h - Create - Create - Create - Create - - - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - - - - - - - - - - - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - - - - - - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - - - true - true - true - true - - - true - true - true - true - - - - - - {1cc213a4-3482-4211-b47b-172e90dac7de} - - - {27014763-955d-486b-9ba7-69872192e6f4} - - - {1b1ca20e-39c3-4d9b-ac37-3783048e6672} - - - {1e1175bb-c4a9-41d8-b2d1-9022f71d3cea} - - - - {826E68CB-D3EE-4A8A-B540-59A8C3F38D4F} - Win32Proj - LibEthereum - - - - StaticLibrary - true - v120 - - - StaticLibrary - true - v120 - - - StaticLibrary - false - v120 - - - StaticLibrary - false - v120 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - false - MultiThreadedDebugDLL - Use - stdafx.h - - - Windows - true - - - - - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - false - MultiThreadedDebugDLL - stdafx.h - Use - - - Windows - true - - - - - - - MaxSpeed - true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - Use - stdafx.h - - - Windows - true - true - true - - - - - MaxSpeed - true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - Use - stdafx.h - - - Windows - true - true - true - - - - - - \ No newline at end of file diff --git a/windows/LibEthereum.vcxproj.filters b/windows/LibEthereum.vcxproj.filters deleted file mode 100644 index 76201d823..000000000 --- a/windows/LibEthereum.vcxproj.filters +++ /dev/null @@ -1,476 +0,0 @@ - - - - - Windows - - - libethereum - - - libethereum - - - libethereum - - - libethereum - - - libethereum - - - libethereum - - - libethereum - - - libethereum - - - libevm - - - libevm - - - libevm - - - libevmcore - - - liblll - - - liblll - - - liblll - - - liblll - - - libethereum - - - libethereum - - - libethereum - - - libethereum - - - libethereum - - - libethereum - - - libethereum - - - libdevcrypto - - - libdevcrypto - - - libdevcrypto - - - libdevcrypto - - - libdevcrypto - - - libdevcrypto - - - libdevcrypto - - - libethcore - - - libethcore - - - libethcore - - - libdevcore - - - libdevcore - - - libdevcore - - - libdevcore - - - libdevcore - - - libdevcore - - - libdevcore - - - libethcore - - - libevm - - - libethereum - - - libethereum - - - libethereum - - - libethereum - - - libethereum - - - libp2p - - - libp2p - - - libp2p - - - libp2p - - - libp2p - - - libp2p - - - libwhisper - - - libwhisper - - - libethereum - - - libdevcore - - - libdevcore - - - libethereum - - - libwebthree - - - libethcore - - - libdevcrypto - - - libethereum - - - libevmcore - - - - - - - Windows - - - libethereum - - - libethereum - - - libethereum - - - libethereum - - - libethereum - - - libethereum - - - libethereum - - - libethereum - - - libevm - - - libevm - - - libevm - - - libevm - - - libevmcore - - - liblll - - - liblll - - - liblll - - - liblll - - - liblll - - - liblll - - - libethereum - - - libethereum - - - libethereum - - - libethereum - - - libethereum - - - libethereum - - - libethereum - - - libdevcrypto - - - libdevcrypto - - - libdevcrypto - - - libdevcrypto - - - libdevcrypto - - - libdevcrypto - - - libdevcrypto - - - libdevcrypto - - - libdevcrypto - - - libethcore - - - libethcore - - - libethcore - - - libethcore - - - libethcore - - - libethcore - - - libdevcore - - - libdevcore - - - libdevcore - - - libdevcore - - - libdevcore - - - libdevcore - - - libdevcore - - - libdevcore - - - libdevcore - - - libdevcore - - - libethereum - - - libethereum - - - libethereum - - - libethereum - - - libethereum - - - libethereum - - - libp2p - - - libp2p - - - libp2p - - - libp2p - - - libp2p - - - libp2p - - - libp2p - - - libwhisper - - - libwhisper - - - libethereum - - - libdevcore - - - libdevcore - - - libethereum - - - libwebthree - - - libdevcrypto - - - libdevcrypto - - - libdevcrypto - - - libethereum - - - libevmcore - - - libevmcore - - - libevm - - - - - {2d571d8f-bacf-4c49-a0d0-c9036f5c0cc9} - - - {8275e3be-c870-44a2-8185-5a9992af8f8e} - - - {b246b3d7-af02-4125-a254-2b377214c288} - - - {37c37803-1515-47c1-b7e6-3879f4429ab3} - - - {ed9ad1b3-700c-47f9-8548-a90b5ef179ac} - - - {e6332606-e0ca-48aa-8a6b-303971ba7a93} - - - {fae2102b-d574-40fc-9f90-1b9ed0d117ac} - - - {35c32f6c-3f19-4603-8084-1b88ec9ae498} - - - {fc2cb618-ab0c-45b6-8eb9-6d88e0336fa9} - - - {36748e80-c977-4fee-84e6-699c039dff87} - - - {d838fece-fc20-42f6-bff5-97c236159b80} - - - \ No newline at end of file diff --git a/windows/LibEthereum_Debug.props b/windows/LibEthereum_Debug.props deleted file mode 100644 index 6d322078a..000000000 --- a/windows/LibEthereum_Debug.props +++ /dev/null @@ -1,18 +0,0 @@ - - - - - d - d - - - - - - $(DebugSuffix) - - - $(d) - - - \ No newline at end of file diff --git a/windows/LibEthereum_Release.props b/windows/LibEthereum_Release.props deleted file mode 100644 index 8f0436f61..000000000 --- a/windows/LibEthereum_Release.props +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - $(DebugSuffix) - - - \ No newline at end of file diff --git a/windows/LibLevelDB.vcxproj b/windows/LibLevelDB.vcxproj deleted file mode 100644 index 3e2407da6..000000000 --- a/windows/LibLevelDB.vcxproj +++ /dev/null @@ -1,221 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {27014763-955D-486B-9BA7-69872192E6F4} - Win32Proj - LibLevelDB - - - - StaticLibrary - true - v120 - - - StaticLibrary - true - v120 - - - StaticLibrary - false - v120 - - - StaticLibrary - false - v120 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Disabled - MultiThreadedDebugDLL - %(AdditionalIncludeDirectories);../../leveldb - _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - 4018;4100;4244;4267;4389;4702;4722;4800;4996;%(DisableSpecificWarnings) - - - Windows - true - - - - - - - Disabled - MultiThreadedDebugDLL - %(AdditionalIncludeDirectories);../../leveldb - _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - 4018;4100;4244;4267;4389;4702;4722;4800;4996;%(DisableSpecificWarnings) - - - Windows - true - - - - - - - MaxSpeed - true - true - MultiThreadedDLL - %(AdditionalIncludeDirectories);../../leveldb - _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - 4018;4100;4244;4267;4389;4702;4722;4800;4996;%(DisableSpecificWarnings) - - - Windows - true - true - true - - - - - - - MaxSpeed - true - true - MultiThreadedDLL - %(AdditionalIncludeDirectories);../../leveldb - _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) - 4018;4100;4244;4267;4389;4702;4722;4800;4996;%(DisableSpecificWarnings) - - - Windows - true - true - true - - - - - - \ No newline at end of file diff --git a/windows/LibLevelDB.vcxproj.filters b/windows/LibLevelDB.vcxproj.filters deleted file mode 100644 index bc3306f56..000000000 --- a/windows/LibLevelDB.vcxproj.filters +++ /dev/null @@ -1,246 +0,0 @@ - - - - - {d83904b1-b5d1-4c5b-b476-96f08300d103} - - - {72573022-b7fd-4b7a-a92e-a68c06bd6366} - - - {7f821e9e-4ebf-4d18-8fb4-898bd3d81376} - - - {f285a595-6c39-4350-8d30-6f696a3a7c4c} - - - - - db - - - db - - - db - - - db - - - db - - - db - - - db - - - db - - - db - - - db - - - db - - - db - - - db - - - db - - - db - - - table - - - table - - - table - - - table - - - table - - - table - - - util - - - util - - - util - - - util - - - util - - - util - - - util - - - util - - - util - - - util - - - util - - - util - - - port - - - port - - - port - - - - - db - - - db - - - db - - - db - - - db - - - db - - - db - - - db - - - db - - - db - - - db - - - db - - - db - - - db - - - db - - - table - - - table - - - table - - - table - - - table - - - table - - - table - - - table - - - util - - - util - - - util - - - util - - - util - - - util - - - util - - - util - - - util - - - util - - - util - - - util - - - util - - - util - - - util - - - port - - - \ No newline at end of file diff --git a/windows/LibMiniUPnPc.vcxproj b/windows/LibMiniUPnPc.vcxproj deleted file mode 100644 index 07489d0e8..000000000 --- a/windows/LibMiniUPnPc.vcxproj +++ /dev/null @@ -1,182 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Win32Proj - LibMiniUPnPc - {1B1CA20E-39C3-4D9B-AC37-3783048E6672} - LibMiniUPnPc - - - - StaticLibrary - true - v120 - - - StaticLibrary - true - v120 - - - StaticLibrary - false - v120 - - - StaticLibrary - false - v120 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Disabled - MultiThreadedDebugDLL - _CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;MINIUPNP_STATICLIB;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) - 4100;4244;4245;4267;4389;%(DisableSpecificWarnings) - - - Windows - true - - - Iphlpapi.lib - - - - - - - Disabled - MultiThreadedDebugDLL - _CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;MINIUPNP_STATICLIB;%(PreprocessorDefinitions) - 4100;4244;4245;4267;4389;%(DisableSpecificWarnings) - - - Windows - true - - - Iphlpapi.lib - - - - - - - MaxSpeed - true - true - MultiThreadedDLL - _CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;MINIUPNP_STATICLIB;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) - 4100;4244;4245;4267;4389;%(DisableSpecificWarnings) - - - Windows - true - true - true - - - Iphlpapi.lib - - - - - - - MaxSpeed - true - true - MultiThreadedDLL - _CRT_SECURE_NO_WARNINGS;_WINSOCK_DEPRECATED_NO_WARNINGS;MINIUPNP_STATICLIB;%(PreprocessorDefinitions) - 4100;4244;4245;4267;4389;%(DisableSpecificWarnings) - - - Windows - true - true - true - - - Iphlpapi.lib - - - - - - \ No newline at end of file diff --git a/windows/LibQEthereum.props b/windows/LibQEthereum.props deleted file mode 100644 index 08ba05c69..000000000 --- a/windows/LibQEthereum.props +++ /dev/null @@ -1,70 +0,0 @@ - - - - - ../../Qt/$(Platform) - $(QtDir)/qtbase - $(QtBase)/bin - $(QtBase)/include;../../Qt/Src/qtbase/include;../../Qt/Src/qtbase/include/QtCore;../../Qt/Src/qtbase/include/QtWidgets;../../Qt/Src/qtbase/include/QtQml;../../Qt/Src/qtbase/include/QtGui;../../Qt/Src/qtdeclarative/include;../../Qt/Src/qtwebkit/include - $(QtBase)/lib;$(QtBase)/plugins/platforms;../../icu/lib64 - ..\..\icu\bin_$(Platform)\icu*52.dll;$(QtBase)\lib\Qt5Core$(d).dll;$(QtBase)\lib\Qt5Gui$(d).dll;$(QtBase)\lib\Qt5Multimedia$(d).dll;$(QtBase)\lib\Qt5MultimediaWidgets$(d).dll;$(QtBase)\lib\Qt5OpenGL$(d).dll;$(QtBase)\lib\Qt5Positioning$(d).dll;$(QtBase)\lib\Qt5PrintSupport$(d).dll;$(QtBase)\lib\Qt5Network$(d).dll;$(QtBase)\lib\Qt5Qml$(d).dll;$(QtBase)\lib\Qt5Quick$(d).dll;$(QtBase)\lib\Qt5Sensors$(d).dll;$(QtBase)\lib\Qt5Sql$(d).dll;$(QtBase)\lib\Qt5Webkit$(d).dll;$(QtBase)\lib\Qt5WebkitWidgets$(d).dll;$(QtBase)\lib\Qt5Widgets$(d).dll;$(QtBase)\plugins\**\qwindows$(d).dll;$(QtBase)\plugins\**\qgenericbearer$(d).dll;$(QtBase)\plugins\**\qnativewifibearer$(d).dll;$(QtBase)\plugins\**\qgif$(d).dll;$(QtBase)\plugins\**\qico$(d).dll;$(QtBase)\plugins\**\qjpeg$(d).dll;$(QtBase)\plugins\**\qsvg$(d).dll;$(QtBase)\plugins\**\qtsensors_dummy$(d).dll - - - <_PropertySheetDisplayName>LibQEthereum - - - - - ..;$(QtInclude);%(AdditionalIncludeDirectories) - 4718;%(DisableSpecificWarnings) - ETH_QTQML=1;%(PreprocessorDefinitions) - - - - - - - - - $(QtLib);%(AdditionalLibraryDirectories) - Qt5PlatformSupport$(d).lib;Qt5Core$(d).lib;Qt5GUI$(d).lib;Qt5Network$(d).lib;Qt5Quick$(d).lib;Qt5Qml$(d).lib;Qt5Webkit$(d).lib;Qt5WebkitWidgets$(d).lib;Qt5Widgets$(d).lib;%(AdditionalDependencies) - - - - - $(QtDir) - - - $(QtBase) - - - $(QtBin) - - - $(QtInclude) - - - $(QtLib) - - - $(CopyDlls) - - - - - - - - - - \ No newline at end of file diff --git a/windows/LibQEthereum.vcxproj b/windows/LibQEthereum.vcxproj deleted file mode 100644 index 20b29e06e..000000000 --- a/windows/LibQEthereum.vcxproj +++ /dev/null @@ -1,204 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - {826e68cb-d3ee-4a8a-b540-59a8c3f38d4f} - - - - - - - Create - Create - Create - Create - - - - - $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" - $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" - $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" - $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" - - - $(IntDir)moc_%(FileName).cpp - - - $(IntDir)moc_%(FileName).cpp - - - $(IntDir)moc_%(FileName).cpp - - - $(IntDir)moc_%(FileName).cpp - - - - - $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" - - - $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" - - - $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" - - - $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" - - - $(IntDir)moc_%(FileName).cpp - $(IntDir)moc_%(FileName).cpp - $(IntDir)moc_%(FileName).cpp - $(IntDir)moc_%(FileName).cpp - - - - - Win32Proj - LibQEthereum - {DF3C5B07-A1A2-4F16-B37F-A27333622CDD} - - - - StaticLibrary - true - v120 - - - StaticLibrary - true - v120 - - - StaticLibrary - false - v120 - - - StaticLibrary - false - v120 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - false - MultiThreadedDebugDLL - Use - stdafx.h - - - Windows - true - - - - - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - false - MultiThreadedDebugDLL - stdafx.h - Use - - - Windows - true - - - - - - - MaxSpeed - true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - Use - stdafx.h - - - Windows - true - true - true - - - - - MaxSpeed - true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - Use - stdafx.h - - - Windows - true - true - true - - - - - - \ No newline at end of file diff --git a/windows/LibQEthereum.vcxproj.filters b/windows/LibQEthereum.vcxproj.filters deleted file mode 100644 index e38730504..000000000 --- a/windows/LibQEthereum.vcxproj.filters +++ /dev/null @@ -1,24 +0,0 @@ - - - - - {516a3655-70df-49f7-af1f-008cf4acf934} - - - - - Windows - - - - - - - Windows - - - - - - - \ No newline at end of file diff --git a/windows/LibSecp256k1.vcxproj b/windows/LibSecp256k1.vcxproj deleted file mode 100644 index 37df3b3b6..000000000 --- a/windows/LibSecp256k1.vcxproj +++ /dev/null @@ -1,183 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - CompileAsCpp - CompileAsCpp - CompileAsCpp - CompileAsCpp - - - - - - - Win32Proj - LibSecp256k1 - {1E1175BB-C4A9-41D8-B2D1-9022F71D3CEA} - LibSecp256k1 - - - - StaticLibrary - true - v120 - - - StaticLibrary - true - v120 - - - StaticLibrary - false - v120 - - - StaticLibrary - false - v120 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - 4189;4244;4267;%(DisableSpecificWarnings) - - - Windows - true - - - - - - - Level3 - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - 4189;4244;4267;%(DisableSpecificWarnings) - - - Windows - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - MultiThreadedDLL - 4189;4244;4267;%(DisableSpecificWarnings) - - - Windows - true - true - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - MultiThreadedDLL - 4189;4244;4267;%(DisableSpecificWarnings) - - - Windows - true - true - true - - - - - - \ No newline at end of file diff --git a/windows/LibSecp256k1.vcxproj.filters b/windows/LibSecp256k1.vcxproj.filters deleted file mode 100644 index aa4e5b9cb..000000000 --- a/windows/LibSecp256k1.vcxproj.filters +++ /dev/null @@ -1,71 +0,0 @@ - - - - - {7d4db365-bce7-45c1-861c-f5f86beca992} - - - - - impl - - - impl - - - impl - - - impl - - - impl - - - impl - - - impl - - - impl - - - impl - - - impl - - - impl - - - impl - - - impl - - - impl - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/windows/LibSerpent.vcxproj b/windows/LibSerpent.vcxproj deleted file mode 100644 index 925d4915b..000000000 --- a/windows/LibSerpent.vcxproj +++ /dev/null @@ -1,187 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - {1cc213a4-3482-4211-b47b-172e90dac7de} - - - {27014763-955d-486b-9ba7-69872192e6f4} - - - {1b1ca20e-39c3-4d9b-ac37-3783048e6672} - - - {1e1175bb-c4a9-41d8-b2d1-9022f71d3cea} - - - - - - - - - - - - - - - - - - - - - - - - - - Create - Create - Create - Create - - - - Win32Proj - LibSerpent - {F174E81A-2A66-4693-B917-11BB42D3658C} - - - - StaticLibrary - true - v120 - - - StaticLibrary - true - v120 - - - StaticLibrary - false - v120 - - - StaticLibrary - false - v120 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - false - MultiThreadedDebugDLL - Use - stdafx.h - - - Windows - true - - - - - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - false - MultiThreadedDebugDLL - stdafx.h - Use - - - Windows - true - - - - - - - MaxSpeed - true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - Use - stdafx.h - - - Windows - true - true - true - - - - - MaxSpeed - true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - MultiThreadedDLL - Use - stdafx.h - - - Windows - true - true - true - - - - - - \ No newline at end of file diff --git a/windows/LibSerpent.vcxproj.filters b/windows/LibSerpent.vcxproj.filters deleted file mode 100644 index 65df02da3..000000000 --- a/windows/LibSerpent.vcxproj.filters +++ /dev/null @@ -1,18 +0,0 @@ - - - - - {20ea55ad-2a66-41df-a64e-9fed221f544f} - - - - - Windows - - - - - Windows - - - \ No newline at end of file diff --git a/windows/Lllc.vcxproj b/windows/Lllc.vcxproj deleted file mode 100644 index 70306d656..000000000 --- a/windows/Lllc.vcxproj +++ /dev/null @@ -1,195 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - Win32Proj - Ethereum - lllc - {255BDC68-B8DB-465F-8220-981E77684189} - - - - Application - true - v120 - - - Application - true - v120 - - - Application - false - v120 - - - Application - false - v120 - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - false - - - false - - - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - true - - - Console - true - true - - - - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - true - - - Console - true - - - - - - - MaxSpeed - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDLL - true - AnySuitable - - - Console - true - true - true - true - - - - - - - MaxSpeed - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDLL - true - AnySuitable - - - Console - true - true - true - - - - - {826e68cb-d3ee-4a8a-b540-59a8c3f38d4f} - - - - - Document - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(IntDir)%(FileName).h - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(IntDir)%(FileName).h - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(IntDir)%(FileName).h - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(IntDir)%(FileName).h - ../.git/index - ../.git/index - ../.git/index - ../.git/index - - - - - - - - - - $(BuildDependsOn);FinalCopy - - - - - - - - \ No newline at end of file diff --git a/windows/Neth.vcxproj b/windows/Neth.vcxproj deleted file mode 100644 index a778b78d8..000000000 --- a/windows/Neth.vcxproj +++ /dev/null @@ -1,213 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - Win32Proj - Nethereum - neth - {90C70663-7181-4E99-9079-54188CEB8954} - - - - Application - true - v120 - - - Application - true - v120 - - - Application - false - v120 - - - Application - false - v120 - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - false - - - false - - - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - true - ncurses/include;ncurses/include/ncurses;%(AdditionalIncludeDirectories) - - - Console - true - true - $(BoostDir)/stage/$(Platform);ncurses/lib/$(Platform) - wncurses.lib;wform.lib;wmenu.lib;wpanel.lib;%(AdditionalDependencies) - - - - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - true - ncurses/include;ncurses/include/ncurses;ncurses/include/ncurses;%(AdditionalIncludeDirectories) - - - Console - true - $(BoostDir)/stage/$(Platform);ncurses/lib/$(Platform) - wncurses.lib;wform.lib;wmenu.lib;wpanel.lib;%(AdditionalDependencies) - - - - - - - MaxSpeed - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDLL - true - AnySuitable - ncurses/include;ncurses/include/ncurses;%(AdditionalIncludeDirectories) - - - Console - true - true - true - true - $(BoostDir)/stage/$(Platform);ncurses/lib/$(Platform) - wncurses.lib;wform.lib;wmenu.lib;wpanel.lib;%(AdditionalDependencies) - - - - - - - MaxSpeed - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDLL - true - AnySuitable - ncurses/include;ncurses/include/ncurses;%(AdditionalIncludeDirectories) - - - Console - true - true - true - $(BoostDir)/stage/$(Platform);ncurses/lib/$(Platform) - wncurses.lib;wform.lib;wmenu.lib;wpanel.lib;%(AdditionalDependencies) - - - - - {826e68cb-d3ee-4a8a-b540-59a8c3f38d4f} - - - - - Document - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(IntDir)%(FileName).h - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(IntDir)%(FileName).h - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(IntDir)%(FileName).h - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(IntDir)%(FileName).h - ../.git/index - ../.git/index - ../.git/index - ../.git/index - - - - - - - - - - $(BuildDependsOn);FinalCopy - - - - - - - - - - - - - - \ No newline at end of file diff --git a/windows/Sc.vcxproj b/windows/Sc.vcxproj deleted file mode 100644 index 8dc0e1dee..000000000 --- a/windows/Sc.vcxproj +++ /dev/null @@ -1,198 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - Win32Proj - Ethereum - sc - {90068D1B-070E-4C41-88B0-1E243E1E5BFF} - - - - Application - true - v120 - - - Application - true - v120 - - - Application - false - v120 - - - Application - false - v120 - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - false - - - false - - - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - true - - - Console - true - true - - - - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - true - - - Console - true - - - - - - - MaxSpeed - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDLL - true - AnySuitable - - - Console - true - true - true - true - - - - - - - MaxSpeed - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDLL - true - AnySuitable - - - Console - true - true - true - - - - - {826e68cb-d3ee-4a8a-b540-59a8c3f38d4f} - - - {f174e81a-2a66-4693-b917-11bb42d3658c} - - - - - Document - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(IntDir)%(FileName).h - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(IntDir)%(FileName).h - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(IntDir)%(FileName).h - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(IntDir)%(FileName).h - ../.git/index - ../.git/index - ../.git/index - ../.git/index - - - - - - - - - - $(BuildDependsOn);FinalCopy - - - - - - - - \ No newline at end of file diff --git a/windows/TestEthereum.vcxproj b/windows/TestEthereum.vcxproj deleted file mode 100644 index 172e6be86..000000000 --- a/windows/TestEthereum.vcxproj +++ /dev/null @@ -1,194 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - Win32Proj - TestEthereum - TestEthereum - {3F3E389B-88DE-41D5-A73B-4F6036E18B36} - - - - Application - true - v120 - - - Application - true - v120 - - - Application - false - v120 - - - Application - false - v120 - - - - - - - - - - - - - - - - - - - - - - - true - - - true - - - false - - - false - - - - Use - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - true - true - stdafx.h - Async - - - Console - true - true - - - - - Use - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - true - stdafx.h - Async - - - Console - true - - - - - Use - MaxSpeed - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDLL - true - AnySuitable - true - stdafx.h - Async - - - Console - true - true - true - true - - - - - Use - MaxSpeed - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDLL - true - AnySuitable - true - stdafx.h - Async - - - Console - true - true - true - - - - - {826e68cb-d3ee-4a8a-b540-59a8c3f38d4f} - - - - - - - - - - - - - - - - - - - - - Create - Create - Create - Create - - - - - - - - - - - - - \ No newline at end of file diff --git a/windows/TestEthereum.vcxproj.filters b/windows/TestEthereum.vcxproj.filters deleted file mode 100644 index 4be707aec..000000000 --- a/windows/TestEthereum.vcxproj.filters +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Windows - - - - - - - - - - - - - - - - - - - - - {0acd7e2f-2594-4c13-94cb-3247045bdbfd} - - - - - Windows - - - - - - - \ No newline at end of file diff --git a/windows/TestSecp256k1.vcxproj b/windows/TestSecp256k1.vcxproj deleted file mode 100644 index d2c113d4c..000000000 --- a/windows/TestSecp256k1.vcxproj +++ /dev/null @@ -1,171 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - - CompileAsCpp - CompileAsCpp - CompileAsCpp - CompileAsCpp - - - - - {1e1175bb-c4a9-41d8-b2d1-9022f71d3cea} - - - - Win32Proj - TestSecp256k1 - TestSecp256k1 - {3BF049F8-AF7E-4E1C-9627-3E94C887AF24} - - - - Application - true - v120 - - - Application - true - v120 - - - Application - false - v120 - - - Application - false - v120 - - - - - - - - - - - - - - - - - - - - - - - true - - - true - - - false - - - false - - - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - true - true - 4189;4244;4267;%(DisableSpecificWarnings) - - - Console - true - true - - - - - - - Disabled - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - true - 4189;4244;4267;%(DisableSpecificWarnings) - - - Console - true - - - - - - - MaxSpeed - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDLL - true - AnySuitable - true - 4189;4244;4267;%(DisableSpecificWarnings) - - - Console - true - true - true - true - - - - - - - MaxSpeed - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - MultiThreadedDLL - true - AnySuitable - true - 4189;4244;4267;%(DisableSpecificWarnings) - - - Console - true - true - true - - - - - - \ No newline at end of file diff --git a/windows/Walleth.vcxproj b/windows/Walleth.vcxproj deleted file mode 100644 index ad76f0f01..000000000 --- a/windows/Walleth.vcxproj +++ /dev/null @@ -1,315 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - Win32Proj - Walleth - Walleth - {326EF470-463F-4751-A22A-48BBAAD8B143} - - - - Application - true - v120 - - - Application - true - v120 - - - Application - false - v120 - - - Application - false - v120 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - false - - - false - - - - Use - Disabled - WIN32;_DEBUG;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - true - stdafx.h - - - Windows - true - true - - - - - - - - - - - - - - - Use - Disabled - WIN32;_DEBUG;%(PreprocessorDefinitions) - MultiThreadedDebugDLL - true - stdafx.h - - - Windows - true - - - - - - - - - - - - - - - - Use - MaxSpeed - true - true - WIN32;NDEBUG;%(PreprocessorDefinitions) - MultiThreadedDLL - true - AnySuitable - stdafx.h - - - Windows - true - true - true - true - - - - - - - - - - - - - - - Use - MaxSpeed - true - true - WIN32;NDEBUG;%(PreprocessorDefinitions) - MultiThreadedDLL - true - AnySuitable - stdafx.h - - - Windows - true - true - true - - - - - - - - - - - - - - - - - - Create - Create - Create - Create - - - - - - $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" - $(IntDir)moc_%(FileName).cpp - - - $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" - - - $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" - - - $(Lua) moc.lua "$(QtBin)/moc" "$(IntDir)moc_%(FileName).cpp" "@(ClCompile->'%(AdditionalIncludeDirectories)');$(IncludePath)" "@(ClCompile->'%(PreprocessorDefinitions)');_MSC_VER=1800" "%(FullPath)" - - - $(IntDir)moc_%(FileName).cpp - $(IntDir)moc_%(FileName).cpp - $(IntDir)moc_%(FileName).cpp - - - - - - Document - "$(QtBin)/uic" -o "$(IntDir)ui_%(FileName).h" "%(FullPath)" - "$(QtBin)/uic" -o "$(IntDir)ui_%(FileName).h" "%(FullPath)" - $(IntDir)ui_%(FileName).h - "$(QtBin)/uic" -o "$(IntDir)ui_%(FileName).h" "%(FullPath)" - "$(QtBin)/uic" -o "$(IntDir)ui_%(FileName).h" "%(FullPath)" - $(IntDir)ui_%(FileName).h - "$(QtBin)/uic" -o "$(IntDir)ui_%(FileName).h" "%(FullPath)" - "$(QtBin)/uic" -o "$(IntDir)ui_%(FileName).h" "%(FullPath)" - $(IntDir)ui_%(FileName).h - "$(QtBin)/uic" -o "$(IntDir)ui_%(FileName).h" "%(FullPath)" - "$(QtBin)/uic" -o "$(IntDir)ui_%(FileName).h" "%(FullPath)" - $(IntDir)ui_%(FileName).h - - - - - Document - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(Lua) "%(FullPath)" "$(IntDir)%(FileName).h" - - - $(IntDir)%(FileName).h - $(IntDir)%(FileName).h - $(IntDir)%(FileName).h - $(IntDir)%(FileName).h - ../.git/index - ../.git/index - ../.git/index - ../.git/index - - - - - {df3c5b07-a1a2-4f16-b37f-a27333622cdd} - - - - - Document - "$(QtBin)/rcc" -o "$(IntDir)qrc_%(FileName).cpp" "%(FullPath)" - "$(QtBin)/rcc" -o "$(IntDir)qrc_%(FileName).cpp" "%(FullPath)" - "$(QtBin)/rcc" -o "$(IntDir)qrc_%(FileName).cpp" "%(FullPath)" - "$(QtBin)/rcc" -o "$(IntDir)qrc_%(FileName).cpp" "%(FullPath)" - "$(QtBin)/rcc" -o "$(IntDir)qrc_%(FileName).cpp" "%(FullPath)" - "$(QtBin)/rcc" -o "$(IntDir)qrc_%(FileName).cpp" "%(FullPath)" - "$(QtBin)/rcc" -o "$(IntDir)qrc_%(FileName).cpp" "%(FullPath)" - "$(QtBin)/rcc" -o "$(IntDir)qrc_%(FileName).cpp" "%(FullPath)" - $(IntDir)qrc_%(FileName).cpp - $(IntDir)qrc_%(FileName).cpp - $(IntDir)qrc_%(FileName).cpp - $(IntDir)qrc_%(FileName).cpp - ../Walleth/Simple.qml - ../Walleth/Simple.qml - ../Walleth/Simple.qml - ../Walleth/Simple.qml - - - - - - - - - - - - - - $(BuildDependsOn);FinalCopy - - - - - - - - \ No newline at end of file diff --git a/windows/Walleth.vcxproj.filters b/windows/Walleth.vcxproj.filters deleted file mode 100644 index 804248d9f..000000000 --- a/windows/Walleth.vcxproj.filters +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - Windows - - - Windows - - - - - - - Windows - - - - - - {37f5b48c-b602-474b-8683-041898e328b5} - - - - - Windows - - - - - - \ No newline at end of file diff --git a/windows/WinMain.cpp b/windows/WinMain.cpp deleted file mode 100644 index d2fc147ca..000000000 --- a/windows/WinMain.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// http://www.flipcode.com/archives/WinMain_Command_Line_Parser.shtml -// COTD Entry submitted by Max McGuire [amcguire@andrew.cmu.edu] - -#include - -extern int main(int argc, char* argv[]); - -int WINAPI WinMain(HINSTANCE /*instance*/, HINSTANCE /*prev_instance*/, char* command_line, int /*show_command*/) -{ - int argc; - char** argv; - char* arg; - int index; - int result; - - // count the arguments - argc = 1; - arg = command_line; - - while (arg[0] != 0) - { - while (arg[0] != 0 && arg[0] == ' ') - { - arg++; - } - if (arg[0] != 0) - { - argc++; - while (arg[0] != 0 && arg[0] != ' ') - { - arg++; - } - } - } - - // tokenize the arguments - argv = (char**)malloc(argc * sizeof(char*)); - arg = command_line; - index = 1; - - while (arg[0] != 0) - { - while (arg[0] != 0 && arg[0] == ' ') - { - arg++; - } - if (arg[0] != 0) - { - argv[index] = arg; - index++; - while (arg[0] != 0 && arg[0] != ' ') - { - arg++; - } - if (arg[0] != 0) - { - arg[0] = 0; - arg++; - } - } - } - - // put the program name into argv[0] - char filename[_MAX_PATH]; - GetModuleFileName(NULL, filename, _MAX_PATH); - argv[0] = filename; - - // call the user specified main function - result = main(argc, argv); - free(argv); - return result; -} diff --git a/windows/bootstrap.sh b/windows/bootstrap.sh deleted file mode 100644 index 642c3f5c8..000000000 --- a/windows/bootstrap.sh +++ /dev/null @@ -1,233 +0,0 @@ -#!/bin/bash -# @file bootstrap.sh -# @author Tim Hughes -# @date 2014 -# Script to fetch and compile depdencies for building Ethereum using Visual Studio Express 2013. -# Prerequisites: -# - Visual Studio Express 2013 for Desktop -# - On PATH: bash, git, git-svn, curl, 7z, perl, ruby, python - -error_exit() -{ - echo $1 1>&2 - exit 1 -} - -# check for existance of basic tools -for i in gawk sed curl git 7z; do - which $i &>/dev/null || error_exit "Could not find $i on PATH" -done - -# get commands before they are removed from the path -sed=`which sed` -awk=`which gawk` -which=`which which` - -path_remove() -{ - export PATH=`echo -n $PATH | "$awk" -v RS=: -v ORS=: '$0 != "'$1'"' | "$sed" 's/:$//'` -} - -path_remove_bin() -{ - path_remove "/bin" - path_remove "/usr/bin" - path_remove "/usr/local/bin" -} - -# check for native perl, python and ruby installations (needed by Qt) -( - path_remove_bin; - for i in ruby python perl; do - "$which" $i &>/dev/null || error_exit "Could not find $i on PATH" - done -) - -if [ ! -d "$VS120COMNTOOLS" ]; then - error_exit "Couldn't find Visual Studio 2013" -fi - -if [[ ! $@ ]] || [ $1 == "fetch" ]; then - # fetch ethereum (develop branch) - if [ ! -d cpp-ethereum ]; then - (set -x; git clone https://github.com/ethereum/cpp-ethereum.git) - cd cpp-ethereum - (set -x; git checkout -b develop origin/develop) - cd .. - echo - fi - - # fetch CryptoPP-5.6.2 - if [ ! -d cryptopp ]; then - (set -x; git svn clone -r 541:541 http://svn.code.sf.net/p/cryptopp/code/trunk/c5 cryptopp) - echo - fi - - # fetch MiniUPnP-1.8 - if [ ! -d miniupnp ]; then - (set -x; git clone https://github.com/miniupnp/miniupnp.git) - cd miniupnp - (set -x; git checkout tags/miniupnpd_1_8) - cd .. - echo - fi - - # fetch LevelDB (windows branch) - if [ ! -d leveldb ]; then - (set -x; git clone https://code.google.com/p/leveldb/) - cd leveldb - (set -x; git checkout origin/windows) - cd .. - echo - fi - - # fetch and unpack boost-1.55 source - if [ ! -d boost ]; then - if [ ! -f _download/boost_1_55_0.7z ]; then - (set -x; mkdir -p _download) - (set -x; curl -o _download/boost_1_55_0.7z -L http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.7z/download) - fi - (set -x; 7z x _download/boost_1_55_0.7z) - (set -x; mv boost_1_55_0 boost) - echo - fi - - # fetch and unpack icu - if [ ! -d icu ]; then - git svn clone -rHEAD http://source.icu-project.org/repos/icu/icu/tags/release-52-1 icu - cd icu - # patch for VS2013 and Windows Qt build - git am --3way --ignore-space-change -s ../cpp-ethereum/windows/patches/icu/0*.patch - cd .. - fi - - # fetch and unpack Qt 5.1.2 source - if [ ! -d Qt ]; then - if [ ! -f _download/qt-everywhere-opensource-src-5.2.1.zip ]; then - (set -x; mkdir -p _download) - (set -x; curl -o _download/qt-everywhere-opensource-src-5.2.1.zip -L http://download.qt-project.org/official_releases/qt/5.2/5.2.1/single/qt-everywhere-opensource-src-5.2.1.zip) - fi - (set -x; mkdir Qt) - cd Qt - (set -x; 7z x ../_download/qt-everywhere-opensource-src-5.2.1.zip) - (set -x; mv qt-everywhere-opensource-src-5.2.1 Src) - cd .. - echo - fi - - # fetch jom - if [ ! -f "Qt/jom/jom.exe" ]; then - if [ ! -f "_download/jom.zip" ]; then - (set -x; mkdir -p _download) - (set -x; curl -o "_download/jom.zip" -L http://download.qt-project.org/official_releases/jom/jom.zip) - fi - (set -x; mkdir -p Qt/jom) - cd Qt/jom - (set -x; 7z x ../../_download/jom.zip) - cd ../.. - echo - fi - - # fetch and unpack Lua binaries - if [ ! -d lua ]; then - if [ ! -f _download/lua-5.2.1_Win32_bin.zip ]; then - (set -x; mkdir -p _download) - (set -x; curl -o _download/lua-5.2.1_Win32_bin.zip -L http://sourceforge.net/projects/luabinaries/files/5.2.1/Executables/lua-5.2.1_Win32_bin.zip/download) - fi - (set -x; mkdir lua) - cd lua - (set -x; 7z x ../_download/lua-5.2.1_Win32_bin.zip lua52.exe lua52.dll) - (set -x; mv lua52.exe lua.exe) - cd .. - echo - fi -fi - -compile_boost() -{ - if [ $platform == "x64" ]; then - addressModel="address-model=64" - else - addressModel="" - fi - - if [ ! -d "stage/$platform" ]; then - targets="--with-filesystem --with-system --with-thread --with-date_time --with-regex --with-test" - (set -x; ./b2 -j4 --build-type=complete link=static runtime-link=shared variant=debug,release threading=multi $addressModel $targets stage) - (set -x; mv stage/lib stage/$platform) - fi -} - -if [[ ! $@ ]] || [ $1 == "compile-boost" ]; then - # bootstrap if b2 is missing - cd boost - if [ ! -f "b2.exe" ]; then - (set -x; cmd.exe /c bootstrap.bat) - fi - - # compile boost for x86 and x64 - platform="x64"; compile_boost - platform="Win32"; compile_boost - cd .. - echo -fi - -compile_icu() -{ - if [ ! -d lib_$platform ] || [ ! -d bin_$platform ]; then - (set -x; cmd.exe /c "..\\cpp-ethereum\\windows\\compile_icu.bat $platform") - if [ $platform == "x64" ]; then - icu_suff="64" - else - icu_suff="" - fi - rm -rf lib_$platform - rm -rf bin_$platform - mv lib$icu_suff lib_$platform - mv bin$icu_suff bin_$platform - fi -} - -if [[ ! $@ ]] || [ $1 == "compile-icu" ]; then - cd icu - platform="x64"; compile_icu - platform="Win32"; compile_icu - cd .. -fi - -compile_qt() -{ - if [ ! -d $platform ]; then - ( - set -x - - # copy icu dlls to Qt bin folder (this is so the Qt tools work without global adjustment to PATH) - mkdir -p $platform/qtbase/bin - cp -a ../icu/bin_$platform/*.dll $platform/qtbase/bin/ - - ( - # remove bash paths - set +x - path_remove_bin - set -x - - # compile qt - cmd.exe /c "..\\cpp-ethereum\\windows\\compile_qt.bat $platform" - ) - ) - fi -} - -if [[ ! $@ ]] || [ $1 == "compile-qt" ]; then - # compile Qt for x86 and x64 - cd Qt - platform="x64"; compile_qt - platform="Win32"; compile_qt - cd .. - echo -fi - -# finally run MS build -cd cpp-ethereum/windows -cmd.exe /c "compile_ethereum.bat" -cd .. \ No newline at end of file diff --git a/windows/compile_ethereum.bat b/windows/compile_ethereum.bat deleted file mode 100644 index 6aa93b155..000000000 --- a/windows/compile_ethereum.bat +++ /dev/null @@ -1,14 +0,0 @@ -@echo off -rem @file compile_ethereum.bat -rem @author Tim Hughes -rem @date 2014 -echo on - -rem : import VC environment -call "%VS120COMNTOOLS%\VsDevCmd.bat" - -rem : build for x64 -msbuild /maxcpucount /p:Configuration=Release;Platform=x64 Ethereum.sln - -rem : build for Win32 -msbuild /maxcpucount /p:Configuration=Release;Platform=Win32 Ethereum.sln diff --git a/windows/compile_icu.bat b/windows/compile_icu.bat deleted file mode 100644 index 93bd21976..000000000 --- a/windows/compile_icu.bat +++ /dev/null @@ -1,11 +0,0 @@ -@echo off -rem @file compile_icu.bat -rem @author Tim Hughes -rem @date 2014 -echo on - -rem : import VC environment -call "%VS120COMNTOOLS%\VsDevCmd.bat" - -rem : build for platform -msbuild /maxcpucount /p:Configuration=Release;Platform=%1% source/allinone/icu.sln diff --git a/windows/compile_qt.bat b/windows/compile_qt.bat deleted file mode 100644 index b11fd42d5..000000000 --- a/windows/compile_qt.bat +++ /dev/null @@ -1,51 +0,0 @@ -@echo off -rem @file compileqt.bat -rem @author Tim Hughes -rem @date 2014 - -rem : enable use prefix if we want to produce standalone Qt binaries -rem : off by default since this takes longer and duplicates all the headers -set USE_PREFIX=0 - -rem : echo commands so we can see what's going on -echo on - -rem : select platform and toolset from first argument -IF %1%==x64 (set PLATFORM=x64&set TOOLSET=x86_amd64&set) ELSE (set PLATFORM=Win32&set TOOLSET=x86=) - -rem : import VC environment vars -call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" %TOOLSET% - -rem : assume our root Qt dir is the current dir -set QT=%CD% - -set PATH=%QT%\Src\gnuwin32\bin;%PATH% - -rem : create the build folder and add the qtbase/bin folder to the PATH -if not exist %QT%\%PLATFORM%\Makefile ( - set DO_CONFIGURE=1 - mkdir %QT%\%PLATFORM% -) else ( - set DO_CONFIGURE=0 -) -if %USE_PREFIX%==1 ( - if not exist %QT%\%PLATFORM%-Build mkdir %QT%\%PLATFORM%-Build - if not exist %QT%\%PLATFORM%\qtbase mkdir %QT%\%PLATFORM%\qtbase - cd %QT%\%PLATFORM%-Build - set QT_PREFIX=-prefix %Qt%\%PLATFORM%\qtbase - set QT_TARGETS=install -) else ( - cd %QT%\%PLATFORM% - set QT_PREFIX= - set QT_TARGETS= -) -set PATH=%CD%\qtbase\bin;%PATH% - -rem : run Qt configure with desired settings -if %DO_CONFIGURE%==1 ( - call %QT%\Src\configure.bat %QT_PREFIX% -opensource -confirm-license -debug-and-release -opengl desktop -platform win32-msvc2013 -icu -I "%QT%\..\icu\include" -L "%QT%\..\icu\lib_%PLATFORM%" -nomake tests -nomake examples -) - -rem : compile and install module-qtbase -%QT%\jom\jom - diff --git a/windows/include/LibLevelDB/port/port.h b/windows/include/LibLevelDB/port/port.h deleted file mode 100644 index ce7ae19c4..000000000 --- a/windows/include/LibLevelDB/port/port.h +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2011 The LevelDB Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. See the AUTHORS file for names of contributors. - -#ifndef STORAGE_LEVELDB_PORT_PORT_H_ -#define STORAGE_LEVELDB_PORT_PORT_H_ - -#include - -// Include the appropriate platform specific file below. If you are -// porting to a new platform, see "port_example.h" for documentation -// of what the new port_.h file must provide. -#if defined(LEVELDB_PLATFORM_POSIX) -# include "port/port_posix.h" -#elif defined(LEVELDB_PLATFORM_CHROMIUM) -# include "port/port_chromium.h" -#elif defined(LEVELDB_PLATFORM_ANDROID) -# include "port/port_android.h" -#elif defined(LEVELDB_PLATFORM_WINDOWS) -# include "port/port_win.h" -#endif - -#endif // STORAGE_LEVELDB_PORT_PORT_H_ diff --git a/windows/include/LibLevelDB/unistd.h b/windows/include/LibLevelDB/unistd.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/windows/include/LibMiniUPnPc/miniupnpcstrings.h b/windows/include/LibMiniUPnPc/miniupnpcstrings.h deleted file mode 100644 index 364342ecf..000000000 --- a/windows/include/LibMiniUPnPc/miniupnpcstrings.h +++ /dev/null @@ -1,14 +0,0 @@ -/* $Id: miniupnpcstrings.h.in,v 1.4 2011/01/04 11:41:53 nanard Exp $ */ -/* Project: miniupnp - * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ - * Author: Thomas Bernard - * Copyright (c) 2005-2011 Thomas Bernard - * This software is subjects to the conditions detailed - * in the LICENCE file provided within this distribution */ -#ifndef MINIUPNPCSTRINGS_H_INCLUDED -#define MINIUPNPCSTRINGS_H_INCLUDED - -#define OS_STRING "Windows" -#define MINIUPNPC_VERSION_STRING "1.9" - -#endif diff --git a/windows/moc.lua b/windows/moc.lua deleted file mode 100644 index 8a129eeae..000000000 --- a/windows/moc.lua +++ /dev/null @@ -1,38 +0,0 @@ - -local function quote(x) - return '"' .. x .. '"' -end - -local function toForward(x) - return x:gsub('\\', '/') -end - --- arguments are in this order -local cmd = arg[1] -local outFile = arg[2] -local includes = toForward(arg[3]) -local defines = arg[4] -local inFile = arg[5] - --- build list of includes -local includes2 = "" -for i in string.gmatch(includes, "[^;]+") do - includes2 = includes2.." -I "..quote(i) -end -includes = includes2; - --- build list of defines -local defines2 = "" -for i in string.gmatch(defines, "[^;]+") do - defines2 = defines2.." -D"..i -end -defines = defines2 - --- moc doesn't compile boost correctly, so skip those headers -workarounds=' -DBOOST_MP_CPP_INT_HPP -DBOOST_THREAD_WEK01082003_HPP' - --- build command -cmd = quote(cmd).." -o "..quote(outFile)..includes..defines..workarounds..' '..quote(inFile) -print(cmd) -os.execute(quote(cmd)) - diff --git a/windows/ncurses/include/ncurses/curses.h b/windows/ncurses/include/ncurses/curses.h deleted file mode 100644 index ff375d525..000000000 --- a/windows/ncurses/include/ncurses/curses.h +++ /dev/null @@ -1,1675 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ - -/**************************************************************************** - * Author: Zeyd M. Ben-Halim 1992,1995 * - * and: Eric S. Raymond * - * and: Thomas E. Dickey 1996-on * - ****************************************************************************/ - -/* $Id: curses.h.in,v 1.220 2011/01/22 19:47:20 tom Exp $ */ - -#ifndef __NCURSES_H -#define __NCURSES_H - -#define CURSES 1 -#define CURSES_H 1 - -/* These are defined only in curses.h, and are used for conditional compiles */ -#define NCURSES_VERSION_MAJOR 5 -#define NCURSES_VERSION_MINOR 9 -#define NCURSES_VERSION_PATCH 20110404 - -/* This is defined in more than one ncurses header, for identification */ -#undef NCURSES_VERSION -#define NCURSES_VERSION "5.9" - -/* - * Identify the mouse encoding version. - */ -#define NCURSES_MOUSE_VERSION 1 - -/* - * Definitions to facilitate DLL's. - */ -#include - -/* - * User-definable tweak to disable the include of . - */ -#ifndef NCURSES_ENABLE_STDBOOL_H -#define NCURSES_ENABLE_STDBOOL_H 1 -#endif - -/* - * NCURSES_ATTR_T is used to quiet compiler warnings when building ncurses - * configured using --disable-macros. - */ -#ifdef NCURSES_NOMACROS -#ifndef NCURSES_ATTR_T -#define NCURSES_ATTR_T attr_t -#endif -#endif /* NCURSES_NOMACROS */ - -#ifndef NCURSES_ATTR_T -#define NCURSES_ATTR_T int -#endif - -/* - * Expands to 'const' if ncurses is configured using --enable-const. Note that - * doing so makes it incompatible with other implementations of X/Open Curses. - */ -#undef NCURSES_CONST -#define NCURSES_CONST /*nothing*/ - -#undef NCURSES_INLINE -#define NCURSES_INLINE inline - -/* - * The internal type used for color values - */ -#undef NCURSES_COLOR_T -#define NCURSES_COLOR_T short - -/* - * Definition used to make WINDOW and similar structs opaque. - */ -#ifndef NCURSES_OPAQUE -#define NCURSES_OPAQUE 0 -#endif - -/* - * The reentrant code relies on the opaque setting, but adds features. - */ -#ifndef NCURSES_REENTRANT -#define NCURSES_REENTRANT 0 -#endif - -/* - * Control whether bindings for interop support are added. - */ -#undef NCURSES_INTEROP_FUNCS -#define NCURSES_INTEROP_FUNCS 0 - -/* - * The internal type used for window dimensions. - */ -#undef NCURSES_SIZE_T -#define NCURSES_SIZE_T short - -/* - * Control whether tparm() supports varargs or fixed-parameter list. - */ -#undef NCURSES_TPARM_VARARGS -#define NCURSES_TPARM_VARARGS 1 - -/* - * NCURSES_CH_T is used in building the library, but not used otherwise in - * this header file, since that would make the normal/wide-character versions - * of the header incompatible. - */ -#undef NCURSES_CH_T -#define NCURSES_CH_T chtype - -#if 0 && defined(_LP64) -typedef unsigned chtype; -typedef unsigned mmask_t; -#else -typedef unsigned long chtype; -typedef unsigned long mmask_t; -#endif - -/* - * We need FILE, etc. Include this before checking any feature symbols. - */ -#include - -/* - * With XPG4, you must define _XOPEN_SOURCE_EXTENDED, it is redundant (or - * conflicting) when _XOPEN_SOURCE is 500 or greater. - */ -#undef NCURSES_WIDECHAR -#if defined(_XOPEN_SOURCE_EXTENDED) || defined(_XPG5) -#define NCURSES_WIDECHAR -#endif - -#include /* we need va_list */ -#ifdef NCURSES_WIDECHAR -#include /* we want wchar_t */ -#endif - -/* X/Open and SVr4 specify that curses implements 'bool'. However, C++ may also - * implement it. If so, we must use the C++ compiler's type to avoid conflict - * with other interfaces. - * - * A further complication is that may declare 'bool' to be a - * different type, such as an enum which is not necessarily compatible with - * C++. If we have , make 'bool' a macro, so users may #undef it. - * Otherwise, let it remain a typedef to avoid conflicts with other #define's. - * In either case, make a typedef for NCURSES_BOOL which can be used if needed - * from either C or C++. - */ - -#undef TRUE -#define TRUE 1 - -#undef FALSE -#define FALSE 0 - -typedef unsigned char NCURSES_BOOL; - -#if defined(__cplusplus) /* __cplusplus, etc. */ - -/* use the C++ compiler's bool type */ -#define NCURSES_BOOL bool - -#else /* c89, c99, etc. */ - -#if NCURSES_ENABLE_STDBOOL_H -#include -/* use whatever the C compiler decides bool really is */ -#define NCURSES_BOOL bool -#else -/* there is no predefined bool - use our own */ -#undef bool -#define bool NCURSES_BOOL -#endif - -#endif /* !__cplusplus, etc. */ - -#ifdef __cplusplus -extern "C" { -#define NCURSES_CAST(type,value) static_cast(value) -#else -#define NCURSES_CAST(type,value) (type)(value) -#endif - -/* - * X/Open attributes. In the ncurses implementation, they are identical to the - * A_ attributes. - */ -#define WA_ATTRIBUTES A_ATTRIBUTES -#define WA_NORMAL A_NORMAL -#define WA_STANDOUT A_STANDOUT -#define WA_UNDERLINE A_UNDERLINE -#define WA_REVERSE A_REVERSE -#define WA_BLINK A_BLINK -#define WA_DIM A_DIM -#define WA_BOLD A_BOLD -#define WA_ALTCHARSET A_ALTCHARSET -#define WA_INVIS A_INVIS -#define WA_PROTECT A_PROTECT -#define WA_HORIZONTAL A_HORIZONTAL -#define WA_LEFT A_LEFT -#define WA_LOW A_LOW -#define WA_RIGHT A_RIGHT -#define WA_TOP A_TOP -#define WA_VERTICAL A_VERTICAL - -/* colors */ -#define COLOR_BLACK 0 -#define COLOR_RED 1 -#define COLOR_GREEN 2 -#define COLOR_YELLOW 3 -#define COLOR_BLUE 4 -#define COLOR_MAGENTA 5 -#define COLOR_CYAN 6 -#define COLOR_WHITE 7 - -/* line graphics */ - -#if 0 || NCURSES_REENTRANT -NCURSES_WRAPPED_VAR(chtype*, acs_map); -#define acs_map NCURSES_PUBLIC_VAR(acs_map()) -#else -extern NCURSES_EXPORT_VAR(chtype) acs_map[]; -#endif - -#define NCURSES_ACS(c) (acs_map[NCURSES_CAST(unsigned char,c)]) - -/* VT100 symbols begin here */ -#define ACS_ULCORNER NCURSES_ACS('l') /* upper left corner */ -#define ACS_LLCORNER NCURSES_ACS('m') /* lower left corner */ -#define ACS_URCORNER NCURSES_ACS('k') /* upper right corner */ -#define ACS_LRCORNER NCURSES_ACS('j') /* lower right corner */ -#define ACS_LTEE NCURSES_ACS('t') /* tee pointing right */ -#define ACS_RTEE NCURSES_ACS('u') /* tee pointing left */ -#define ACS_BTEE NCURSES_ACS('v') /* tee pointing up */ -#define ACS_TTEE NCURSES_ACS('w') /* tee pointing down */ -#define ACS_HLINE NCURSES_ACS('q') /* horizontal line */ -#define ACS_VLINE NCURSES_ACS('x') /* vertical line */ -#define ACS_PLUS NCURSES_ACS('n') /* large plus or crossover */ -#define ACS_S1 NCURSES_ACS('o') /* scan line 1 */ -#define ACS_S9 NCURSES_ACS('s') /* scan line 9 */ -#define ACS_DIAMOND NCURSES_ACS('`') /* diamond */ -#define ACS_CKBOARD NCURSES_ACS('a') /* checker board (stipple) */ -#define ACS_DEGREE NCURSES_ACS('f') /* degree symbol */ -#define ACS_PLMINUS NCURSES_ACS('g') /* plus/minus */ -#define ACS_BULLET NCURSES_ACS('~') /* bullet */ -/* Teletype 5410v1 symbols begin here */ -#define ACS_LARROW NCURSES_ACS(',') /* arrow pointing left */ -#define ACS_RARROW NCURSES_ACS('+') /* arrow pointing right */ -#define ACS_DARROW NCURSES_ACS('.') /* arrow pointing down */ -#define ACS_UARROW NCURSES_ACS('-') /* arrow pointing up */ -#define ACS_BOARD NCURSES_ACS('h') /* board of squares */ -#define ACS_LANTERN NCURSES_ACS('i') /* lantern symbol */ -#define ACS_BLOCK NCURSES_ACS('0') /* solid square block */ -/* - * These aren't documented, but a lot of System Vs have them anyway - * (you can spot pprryyzz{{||}} in a lot of AT&T terminfo strings). - * The ACS_names may not match AT&T's, our source didn't know them. - */ -#define ACS_S3 NCURSES_ACS('p') /* scan line 3 */ -#define ACS_S7 NCURSES_ACS('r') /* scan line 7 */ -#define ACS_LEQUAL NCURSES_ACS('y') /* less/equal */ -#define ACS_GEQUAL NCURSES_ACS('z') /* greater/equal */ -#define ACS_PI NCURSES_ACS('{') /* Pi */ -#define ACS_NEQUAL NCURSES_ACS('|') /* not equal */ -#define ACS_STERLING NCURSES_ACS('}') /* UK pound sign */ - -/* - * Line drawing ACS names are of the form ACS_trbl, where t is the top, r - * is the right, b is the bottom, and l is the left. t, r, b, and l might - * be B (blank), S (single), D (double), or T (thick). The subset defined - * here only uses B and S. - */ -#define ACS_BSSB ACS_ULCORNER -#define ACS_SSBB ACS_LLCORNER -#define ACS_BBSS ACS_URCORNER -#define ACS_SBBS ACS_LRCORNER -#define ACS_SBSS ACS_RTEE -#define ACS_SSSB ACS_LTEE -#define ACS_SSBS ACS_BTEE -#define ACS_BSSS ACS_TTEE -#define ACS_BSBS ACS_HLINE -#define ACS_SBSB ACS_VLINE -#define ACS_SSSS ACS_PLUS - -#undef ERR -#define ERR (-1) - -#undef OK -#define OK (0) - -/* values for the _flags member */ -#define _SUBWIN 0x01 /* is this a sub-window? */ -#define _ENDLINE 0x02 /* is the window flush right? */ -#define _FULLWIN 0x04 /* is the window full-screen? */ -#define _SCROLLWIN 0x08 /* bottom edge is at screen bottom? */ -#define _ISPAD 0x10 /* is this window a pad? */ -#define _HASMOVED 0x20 /* has cursor moved since last refresh? */ -#define _WRAPPED 0x40 /* cursor was just wrappped */ - -/* - * this value is used in the firstchar and lastchar fields to mark - * unchanged lines - */ -#define _NOCHANGE -1 - -/* - * this value is used in the oldindex field to mark lines created by insertions - * and scrolls. - */ -#define _NEWINDEX -1 - -typedef struct screen SCREEN; -typedef struct _win_st WINDOW; - -typedef chtype attr_t; /* ...must be at least as wide as chtype */ - -#ifdef NCURSES_WIDECHAR - -#if 0 -#ifdef mblen /* libutf8.h defines it w/o undefining first */ -#undef mblen -#endif -#include -#endif - -#if 0 -#include /* ...to get mbstate_t, etc. */ -#endif - -#if 0 -typedef unsigned short wchar_t; -#endif - -#if 0 -typedef unsigned int wint_t; -#endif - -/* - * cchar_t stores an array of CCHARW_MAX wide characters. The first is - * normally a spacing character. The others are non-spacing. If those - * (spacing and nonspacing) do not fill the array, a null L'\0' follows. - * Otherwise, a null is assumed to follow when extracting via getcchar(). - */ -#define CCHARW_MAX 5 -typedef struct -{ - attr_t attr; - wchar_t chars[CCHARW_MAX]; -#if 0 -#undef NCURSES_EXT_COLORS -#define NCURSES_EXT_COLORS 20110404 - int ext_color; /* color pair, must be more than 16-bits */ -#endif -} -cchar_t; - -#endif /* NCURSES_WIDECHAR */ - -#if !NCURSES_OPAQUE -struct ldat; - -struct _win_st -{ - NCURSES_SIZE_T _cury, _curx; /* current cursor position */ - - /* window location and size */ - NCURSES_SIZE_T _maxy, _maxx; /* maximums of x and y, NOT window size */ - NCURSES_SIZE_T _begy, _begx; /* screen coords of upper-left-hand corner */ - - short _flags; /* window state flags */ - - /* attribute tracking */ - attr_t _attrs; /* current attribute for non-space character */ - chtype _bkgd; /* current background char/attribute pair */ - - /* option values set by user */ - bool _notimeout; /* no time out on function-key entry? */ - bool _clear; /* consider all data in the window invalid? */ - bool _leaveok; /* OK to not reset cursor on exit? */ - bool _scroll; /* OK to scroll this window? */ - bool _idlok; /* OK to use insert/delete line? */ - bool _idcok; /* OK to use insert/delete char? */ - bool _immed; /* window in immed mode? (not yet used) */ - bool _sync; /* window in sync mode? */ - bool _use_keypad; /* process function keys into KEY_ symbols? */ - int _delay; /* 0 = nodelay, <0 = blocking, >0 = delay */ - - struct ldat *_line; /* the actual line data */ - - /* global screen state */ - NCURSES_SIZE_T _regtop; /* top line of scrolling region */ - NCURSES_SIZE_T _regbottom; /* bottom line of scrolling region */ - - /* these are used only if this is a sub-window */ - int _parx; /* x coordinate of this window in parent */ - int _pary; /* y coordinate of this window in parent */ - WINDOW *_parent; /* pointer to parent if a sub-window */ - - /* these are used only if this is a pad */ - struct pdat - { - NCURSES_SIZE_T _pad_y, _pad_x; - NCURSES_SIZE_T _pad_top, _pad_left; - NCURSES_SIZE_T _pad_bottom, _pad_right; - } _pad; - - NCURSES_SIZE_T _yoffset; /* real begy is _begy + _yoffset */ - -#ifdef NCURSES_WIDECHAR - cchar_t _bkgrnd; /* current background char/attribute pair */ -#if 0 - int _color; /* current color-pair for non-space character */ -#endif -#endif -}; -#endif /* NCURSES_OPAQUE */ - -/* - * This is an extension to support events... - */ -#if 1 -#ifdef NCURSES_WGETCH_EVENTS -#if !defined(__BEOS__) || defined(__HAIKU__) - /* Fix _nc_timed_wait() on BEOS... */ -# define NCURSES_EVENT_VERSION 1 -#endif /* !defined(__BEOS__) */ - -/* - * Bits to set in _nc_event.data.flags - */ -# define _NC_EVENT_TIMEOUT_MSEC 1 -# define _NC_EVENT_FILE 2 -# define _NC_EVENT_FILE_READABLE 2 -# if 0 /* Not supported yet... */ -# define _NC_EVENT_FILE_WRITABLE 4 -# define _NC_EVENT_FILE_EXCEPTION 8 -# endif - -typedef struct -{ - int type; - union - { - long timeout_msec; /* _NC_EVENT_TIMEOUT_MSEC */ - struct - { - unsigned int flags; - int fd; - unsigned int result; - } fev; /* _NC_EVENT_FILE */ - } data; -} _nc_event; - -typedef struct -{ - int count; - int result_flags; /* _NC_EVENT_TIMEOUT_MSEC or _NC_EVENT_FILE_READABLE */ - _nc_event *events[1]; -} _nc_eventlist; - -extern NCURSES_EXPORT(int) wgetch_events (WINDOW *, _nc_eventlist *); /* experimental */ -extern NCURSES_EXPORT(int) wgetnstr_events (WINDOW *,char *,int,_nc_eventlist *);/* experimental */ - -#endif /* NCURSES_WGETCH_EVENTS */ -#endif /* NCURSES_EXT_FUNCS */ - -/* - * GCC (and some other compilers) define '__attribute__'; we're using this - * macro to alert the compiler to flag inconsistencies in printf/scanf-like - * function calls. Just in case '__attribute__' isn't defined, make a dummy. - * Old versions of G++ do not accept it anyway, at least not consistently with - * GCC. - */ -#if !(defined(__GNUC__) || defined(__GNUG__) || defined(__attribute__)) -#define __attribute__(p) /* nothing */ -#endif - -/* - * We cannot define these in ncurses_cfg.h, since they require parameters to be - * passed (that is non-portable). If you happen to be using gcc with warnings - * enabled, define - * GCC_PRINTF - * GCC_SCANF - * to improve checking of calls to printw(), etc. - */ -#ifndef GCC_PRINTFLIKE -#if defined(GCC_PRINTF) && !defined(printf) -#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var))) -#else -#define GCC_PRINTFLIKE(fmt,var) /*nothing*/ -#endif -#endif - -#ifndef GCC_SCANFLIKE -#if defined(GCC_SCANF) && !defined(scanf) -#define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var))) -#else -#define GCC_SCANFLIKE(fmt,var) /*nothing*/ -#endif -#endif - -#ifndef GCC_NORETURN -#define GCC_NORETURN /* nothing */ -#endif - -#ifndef GCC_UNUSED -#define GCC_UNUSED /* nothing */ -#endif - -/* - * Curses uses a helper function. Define our type for this to simplify - * extending it for the sp-funcs feature. - */ -typedef int (*NCURSES_OUTC)(int); - -/* - * Function prototypes. This is the complete X/Open Curses list of required - * functions. Those marked `generated' will have sources generated from the - * macro definitions later in this file, in order to satisfy XPG4.2 - * requirements. - */ - -extern NCURSES_EXPORT(int) addch (const chtype); /* generated */ -extern NCURSES_EXPORT(int) addchnstr (const chtype *, int); /* generated */ -extern NCURSES_EXPORT(int) addchstr (const chtype *); /* generated */ -extern NCURSES_EXPORT(int) addnstr (const char *, int); /* generated */ -extern NCURSES_EXPORT(int) addstr (const char *); /* generated */ -extern NCURSES_EXPORT(int) attroff (NCURSES_ATTR_T); /* generated */ -extern NCURSES_EXPORT(int) attron (NCURSES_ATTR_T); /* generated */ -extern NCURSES_EXPORT(int) attrset (NCURSES_ATTR_T); /* generated */ -extern NCURSES_EXPORT(int) attr_get (attr_t *, short *, void *); /* generated */ -extern NCURSES_EXPORT(int) attr_off (attr_t, void *); /* generated */ -extern NCURSES_EXPORT(int) attr_on (attr_t, void *); /* generated */ -extern NCURSES_EXPORT(int) attr_set (attr_t, short, void *); /* generated */ -extern NCURSES_EXPORT(int) baudrate (void); /* implemented */ -extern NCURSES_EXPORT(int) beep (void); /* implemented */ -extern NCURSES_EXPORT(int) bkgd (chtype); /* generated */ -extern NCURSES_EXPORT(void) bkgdset (chtype); /* generated */ -extern NCURSES_EXPORT(int) border (chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype); /* generated */ -extern NCURSES_EXPORT(int) box (WINDOW *, chtype, chtype); /* generated */ -extern NCURSES_EXPORT(bool) can_change_color (void); /* implemented */ -extern NCURSES_EXPORT(int) cbreak (void); /* implemented */ -extern NCURSES_EXPORT(int) chgat (int, attr_t, short, const void *); /* generated */ -extern NCURSES_EXPORT(int) clear (void); /* generated */ -extern NCURSES_EXPORT(int) clearok (WINDOW *,bool); /* implemented */ -extern NCURSES_EXPORT(int) clrtobot (void); /* generated */ -extern NCURSES_EXPORT(int) clrtoeol (void); /* generated */ -extern NCURSES_EXPORT(int) color_content (short,short*,short*,short*); /* implemented */ -extern NCURSES_EXPORT(int) color_set (short,void*); /* generated */ -extern NCURSES_EXPORT(int) COLOR_PAIR (int); /* generated */ -extern NCURSES_EXPORT(int) copywin (const WINDOW*,WINDOW*,int,int,int,int,int,int,int); /* implemented */ -extern NCURSES_EXPORT(int) curs_set (int); /* implemented */ -extern NCURSES_EXPORT(int) def_prog_mode (void); /* implemented */ -extern NCURSES_EXPORT(int) def_shell_mode (void); /* implemented */ -extern NCURSES_EXPORT(int) delay_output (int); /* implemented */ -extern NCURSES_EXPORT(int) delch (void); /* generated */ -extern NCURSES_EXPORT(void) delscreen (SCREEN *); /* implemented */ -extern NCURSES_EXPORT(int) delwin (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) deleteln (void); /* generated */ -extern NCURSES_EXPORT(WINDOW *) derwin (WINDOW *,int,int,int,int); /* implemented */ -extern NCURSES_EXPORT(int) doupdate (void); /* implemented */ -extern NCURSES_EXPORT(WINDOW *) dupwin (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) echo (void); /* implemented */ -extern NCURSES_EXPORT(int) echochar (const chtype); /* generated */ -extern NCURSES_EXPORT(int) erase (void); /* generated */ -extern NCURSES_EXPORT(int) endwin (void); /* implemented */ -extern NCURSES_EXPORT(char) erasechar (void); /* implemented */ -extern NCURSES_EXPORT(void) filter (void); /* implemented */ -extern NCURSES_EXPORT(int) flash (void); /* implemented */ -extern NCURSES_EXPORT(int) flushinp (void); /* implemented */ -extern NCURSES_EXPORT(chtype) getbkgd (WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) getch (void); /* generated */ -extern NCURSES_EXPORT(int) getnstr (char *, int); /* generated */ -extern NCURSES_EXPORT(int) getstr (char *); /* generated */ -extern NCURSES_EXPORT(WINDOW *) getwin (FILE *); /* implemented */ -extern NCURSES_EXPORT(int) halfdelay (int); /* implemented */ -extern NCURSES_EXPORT(bool) has_colors (void); /* implemented */ -extern NCURSES_EXPORT(bool) has_ic (void); /* implemented */ -extern NCURSES_EXPORT(bool) has_il (void); /* implemented */ -extern NCURSES_EXPORT(int) hline (chtype, int); /* generated */ -extern NCURSES_EXPORT(void) idcok (WINDOW *, bool); /* implemented */ -extern NCURSES_EXPORT(int) idlok (WINDOW *, bool); /* implemented */ -extern NCURSES_EXPORT(void) immedok (WINDOW *, bool); /* implemented */ -extern NCURSES_EXPORT(chtype) inch (void); /* generated */ -extern NCURSES_EXPORT(int) inchnstr (chtype *, int); /* generated */ -extern NCURSES_EXPORT(int) inchstr (chtype *); /* generated */ -extern NCURSES_EXPORT(WINDOW *) initscr (void); /* implemented */ -extern NCURSES_EXPORT(int) init_color (short,short,short,short); /* implemented */ -extern NCURSES_EXPORT(int) init_pair (short,short,short); /* implemented */ -extern NCURSES_EXPORT(int) innstr (char *, int); /* generated */ -extern NCURSES_EXPORT(int) insch (chtype); /* generated */ -extern NCURSES_EXPORT(int) insdelln (int); /* generated */ -extern NCURSES_EXPORT(int) insertln (void); /* generated */ -extern NCURSES_EXPORT(int) insnstr (const char *, int); /* generated */ -extern NCURSES_EXPORT(int) insstr (const char *); /* generated */ -extern NCURSES_EXPORT(int) instr (char *); /* generated */ -extern NCURSES_EXPORT(int) intrflush (WINDOW *,bool); /* implemented */ -extern NCURSES_EXPORT(bool) isendwin (void); /* implemented */ -extern NCURSES_EXPORT(bool) is_linetouched (WINDOW *,int); /* implemented */ -extern NCURSES_EXPORT(bool) is_wintouched (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(NCURSES_CONST char *) keyname (int); /* implemented */ -extern NCURSES_EXPORT(int) keypad (WINDOW *,bool); /* implemented */ -extern NCURSES_EXPORT(char) killchar (void); /* implemented */ -extern NCURSES_EXPORT(int) leaveok (WINDOW *,bool); /* implemented */ -extern NCURSES_EXPORT(char *) longname (void); /* implemented */ -extern NCURSES_EXPORT(int) meta (WINDOW *,bool); /* implemented */ -extern NCURSES_EXPORT(int) move (int, int); /* generated */ -extern NCURSES_EXPORT(int) mvaddch (int, int, const chtype); /* generated */ -extern NCURSES_EXPORT(int) mvaddchnstr (int, int, const chtype *, int); /* generated */ -extern NCURSES_EXPORT(int) mvaddchstr (int, int, const chtype *); /* generated */ -extern NCURSES_EXPORT(int) mvaddnstr (int, int, const char *, int); /* generated */ -extern NCURSES_EXPORT(int) mvaddstr (int, int, const char *); /* generated */ -extern NCURSES_EXPORT(int) mvchgat (int, int, int, attr_t, short, const void *); /* generated */ -extern NCURSES_EXPORT(int) mvcur (int,int,int,int); /* implemented */ -extern NCURSES_EXPORT(int) mvdelch (int, int); /* generated */ -extern NCURSES_EXPORT(int) mvderwin (WINDOW *, int, int); /* implemented */ -extern NCURSES_EXPORT(int) mvgetch (int, int); /* generated */ -extern NCURSES_EXPORT(int) mvgetnstr (int, int, char *, int); /* generated */ -extern NCURSES_EXPORT(int) mvgetstr (int, int, char *); /* generated */ -extern NCURSES_EXPORT(int) mvhline (int, int, chtype, int); /* generated */ -extern NCURSES_EXPORT(chtype) mvinch (int, int); /* generated */ -extern NCURSES_EXPORT(int) mvinchnstr (int, int, chtype *, int); /* generated */ -extern NCURSES_EXPORT(int) mvinchstr (int, int, chtype *); /* generated */ -extern NCURSES_EXPORT(int) mvinnstr (int, int, char *, int); /* generated */ -extern NCURSES_EXPORT(int) mvinsch (int, int, chtype); /* generated */ -extern NCURSES_EXPORT(int) mvinsnstr (int, int, const char *, int); /* generated */ -extern NCURSES_EXPORT(int) mvinsstr (int, int, const char *); /* generated */ -extern NCURSES_EXPORT(int) mvinstr (int, int, char *); /* generated */ -extern NCURSES_EXPORT(int) mvprintw (int,int, const char *,...) /* implemented */ - GCC_PRINTFLIKE(3,4); -extern NCURSES_EXPORT(int) mvscanw (int,int, NCURSES_CONST char *,...) /* implemented */ - GCC_SCANFLIKE(3,4); -extern NCURSES_EXPORT(int) mvvline (int, int, chtype, int); /* generated */ -extern NCURSES_EXPORT(int) mvwaddch (WINDOW *, int, int, const chtype); /* generated */ -extern NCURSES_EXPORT(int) mvwaddchnstr (WINDOW *, int, int, const chtype *, int);/* generated */ -extern NCURSES_EXPORT(int) mvwaddchstr (WINDOW *, int, int, const chtype *); /* generated */ -extern NCURSES_EXPORT(int) mvwaddnstr (WINDOW *, int, int, const char *, int); /* generated */ -extern NCURSES_EXPORT(int) mvwaddstr (WINDOW *, int, int, const char *); /* generated */ -extern NCURSES_EXPORT(int) mvwchgat (WINDOW *, int, int, int, attr_t, short, const void *);/* generated */ -extern NCURSES_EXPORT(int) mvwdelch (WINDOW *, int, int); /* generated */ -extern NCURSES_EXPORT(int) mvwgetch (WINDOW *, int, int); /* generated */ -extern NCURSES_EXPORT(int) mvwgetnstr (WINDOW *, int, int, char *, int); /* generated */ -extern NCURSES_EXPORT(int) mvwgetstr (WINDOW *, int, int, char *); /* generated */ -extern NCURSES_EXPORT(int) mvwhline (WINDOW *, int, int, chtype, int); /* generated */ -extern NCURSES_EXPORT(int) mvwin (WINDOW *,int,int); /* implemented */ -extern NCURSES_EXPORT(chtype) mvwinch (WINDOW *, int, int); /* generated */ -extern NCURSES_EXPORT(int) mvwinchnstr (WINDOW *, int, int, chtype *, int); /* generated */ -extern NCURSES_EXPORT(int) mvwinchstr (WINDOW *, int, int, chtype *); /* generated */ -extern NCURSES_EXPORT(int) mvwinnstr (WINDOW *, int, int, char *, int); /* generated */ -extern NCURSES_EXPORT(int) mvwinsch (WINDOW *, int, int, chtype); /* generated */ -extern NCURSES_EXPORT(int) mvwinsnstr (WINDOW *, int, int, const char *, int); /* generated */ -extern NCURSES_EXPORT(int) mvwinsstr (WINDOW *, int, int, const char *); /* generated */ -extern NCURSES_EXPORT(int) mvwinstr (WINDOW *, int, int, char *); /* generated */ -extern NCURSES_EXPORT(int) mvwprintw (WINDOW*,int,int, const char *,...) /* implemented */ - GCC_PRINTFLIKE(4,5); -extern NCURSES_EXPORT(int) mvwscanw (WINDOW *,int,int, NCURSES_CONST char *,...) /* implemented */ - GCC_SCANFLIKE(4,5); -extern NCURSES_EXPORT(int) mvwvline (WINDOW *,int, int, chtype, int); /* generated */ -extern NCURSES_EXPORT(int) napms (int); /* implemented */ -extern NCURSES_EXPORT(WINDOW *) newpad (int,int); /* implemented */ -extern NCURSES_EXPORT(SCREEN *) newterm (NCURSES_CONST char *,FILE *,FILE *); /* implemented */ -extern NCURSES_EXPORT(WINDOW *) newwin (int,int,int,int); /* implemented */ -extern NCURSES_EXPORT(int) nl (void); /* implemented */ -extern NCURSES_EXPORT(int) nocbreak (void); /* implemented */ -extern NCURSES_EXPORT(int) nodelay (WINDOW *,bool); /* implemented */ -extern NCURSES_EXPORT(int) noecho (void); /* implemented */ -extern NCURSES_EXPORT(int) nonl (void); /* implemented */ -extern NCURSES_EXPORT(void) noqiflush (void); /* implemented */ -extern NCURSES_EXPORT(int) noraw (void); /* implemented */ -extern NCURSES_EXPORT(int) notimeout (WINDOW *,bool); /* implemented */ -extern NCURSES_EXPORT(int) overlay (const WINDOW*,WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) overwrite (const WINDOW*,WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) pair_content (short,short*,short*); /* implemented */ -extern NCURSES_EXPORT(int) PAIR_NUMBER (int); /* generated */ -extern NCURSES_EXPORT(int) pechochar (WINDOW *, const chtype); /* implemented */ -extern NCURSES_EXPORT(int) pnoutrefresh (WINDOW*,int,int,int,int,int,int);/* implemented */ -extern NCURSES_EXPORT(int) prefresh (WINDOW *,int,int,int,int,int,int); /* implemented */ -extern NCURSES_EXPORT(int) printw (const char *,...) /* implemented */ - GCC_PRINTFLIKE(1,2); -extern NCURSES_EXPORT(int) putwin (WINDOW *, FILE *); /* implemented */ -extern NCURSES_EXPORT(void) qiflush (void); /* implemented */ -extern NCURSES_EXPORT(int) raw (void); /* implemented */ -extern NCURSES_EXPORT(int) redrawwin (WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) refresh (void); /* generated */ -extern NCURSES_EXPORT(int) resetty (void); /* implemented */ -extern NCURSES_EXPORT(int) reset_prog_mode (void); /* implemented */ -extern NCURSES_EXPORT(int) reset_shell_mode (void); /* implemented */ -extern NCURSES_EXPORT(int) ripoffline (int, int (*)(WINDOW *, int)); /* implemented */ -extern NCURSES_EXPORT(int) savetty (void); /* implemented */ -extern NCURSES_EXPORT(int) scanw (NCURSES_CONST char *,...) /* implemented */ - GCC_SCANFLIKE(1,2); -extern NCURSES_EXPORT(int) scr_dump (const char *); /* implemented */ -extern NCURSES_EXPORT(int) scr_init (const char *); /* implemented */ -extern NCURSES_EXPORT(int) scrl (int); /* generated */ -extern NCURSES_EXPORT(int) scroll (WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) scrollok (WINDOW *,bool); /* implemented */ -extern NCURSES_EXPORT(int) scr_restore (const char *); /* implemented */ -extern NCURSES_EXPORT(int) scr_set (const char *); /* implemented */ -extern NCURSES_EXPORT(int) setscrreg (int,int); /* generated */ -extern NCURSES_EXPORT(SCREEN *) set_term (SCREEN *); /* implemented */ -extern NCURSES_EXPORT(int) slk_attroff (const chtype); /* implemented */ -extern NCURSES_EXPORT(int) slk_attr_off (const attr_t, void *); /* generated:WIDEC */ -extern NCURSES_EXPORT(int) slk_attron (const chtype); /* implemented */ -extern NCURSES_EXPORT(int) slk_attr_on (attr_t,void*); /* generated:WIDEC */ -extern NCURSES_EXPORT(int) slk_attrset (const chtype); /* implemented */ -extern NCURSES_EXPORT(attr_t) slk_attr (void); /* implemented */ -extern NCURSES_EXPORT(int) slk_attr_set (const attr_t,short,void*); /* implemented */ -extern NCURSES_EXPORT(int) slk_clear (void); /* implemented */ -extern NCURSES_EXPORT(int) slk_color (short); /* implemented */ -extern NCURSES_EXPORT(int) slk_init (int); /* implemented */ -extern NCURSES_EXPORT(char *) slk_label (int); /* implemented */ -extern NCURSES_EXPORT(int) slk_noutrefresh (void); /* implemented */ -extern NCURSES_EXPORT(int) slk_refresh (void); /* implemented */ -extern NCURSES_EXPORT(int) slk_restore (void); /* implemented */ -extern NCURSES_EXPORT(int) slk_set (int,const char *,int); /* implemented */ -extern NCURSES_EXPORT(int) slk_touch (void); /* implemented */ -extern NCURSES_EXPORT(int) standout (void); /* generated */ -extern NCURSES_EXPORT(int) standend (void); /* generated */ -extern NCURSES_EXPORT(int) start_color (void); /* implemented */ -extern NCURSES_EXPORT(WINDOW *) subpad (WINDOW *, int, int, int, int); /* implemented */ -extern NCURSES_EXPORT(WINDOW *) subwin (WINDOW *, int, int, int, int); /* implemented */ -extern NCURSES_EXPORT(int) syncok (WINDOW *, bool); /* implemented */ -extern NCURSES_EXPORT(chtype) termattrs (void); /* implemented */ -extern NCURSES_EXPORT(char *) termname (void); /* implemented */ -extern NCURSES_EXPORT(void) timeout (int); /* generated */ -extern NCURSES_EXPORT(int) touchline (WINDOW *, int, int); /* generated */ -extern NCURSES_EXPORT(int) touchwin (WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) typeahead (int); /* implemented */ -extern NCURSES_EXPORT(int) ungetch (int); /* implemented */ -extern NCURSES_EXPORT(int) untouchwin (WINDOW *); /* generated */ -extern NCURSES_EXPORT(void) use_env (bool); /* implemented */ -extern NCURSES_EXPORT(int) vidattr (chtype); /* implemented */ -extern NCURSES_EXPORT(int) vidputs (chtype, NCURSES_OUTC); /* implemented */ -extern NCURSES_EXPORT(int) vline (chtype, int); /* generated */ -extern NCURSES_EXPORT(int) vwprintw (WINDOW *, const char *,va_list); /* implemented */ -extern NCURSES_EXPORT(int) vw_printw (WINDOW *, const char *,va_list); /* generated */ -extern NCURSES_EXPORT(int) vwscanw (WINDOW *, NCURSES_CONST char *,va_list); /* implemented */ -extern NCURSES_EXPORT(int) vw_scanw (WINDOW *, NCURSES_CONST char *,va_list); /* generated */ -extern NCURSES_EXPORT(int) waddch (WINDOW *, const chtype); /* implemented */ -extern NCURSES_EXPORT(int) waddchnstr (WINDOW *,const chtype *,int); /* implemented */ -extern NCURSES_EXPORT(int) waddchstr (WINDOW *,const chtype *); /* generated */ -extern NCURSES_EXPORT(int) waddnstr (WINDOW *,const char *,int); /* implemented */ -extern NCURSES_EXPORT(int) waddstr (WINDOW *,const char *); /* generated */ -extern NCURSES_EXPORT(int) wattron (WINDOW *, int); /* generated */ -extern NCURSES_EXPORT(int) wattroff (WINDOW *, int); /* generated */ -extern NCURSES_EXPORT(int) wattrset (WINDOW *, int); /* generated */ -extern NCURSES_EXPORT(int) wattr_get (WINDOW *, attr_t *, short *, void *); /* generated */ -extern NCURSES_EXPORT(int) wattr_on (WINDOW *, attr_t, void *); /* implemented */ -extern NCURSES_EXPORT(int) wattr_off (WINDOW *, attr_t, void *); /* implemented */ -extern NCURSES_EXPORT(int) wattr_set (WINDOW *, attr_t, short, void *); /* generated */ -extern NCURSES_EXPORT(int) wbkgd (WINDOW *, chtype); /* implemented */ -extern NCURSES_EXPORT(void) wbkgdset (WINDOW *,chtype); /* implemented */ -extern NCURSES_EXPORT(int) wborder (WINDOW *,chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype); /* implemented */ -extern NCURSES_EXPORT(int) wchgat (WINDOW *, int, attr_t, short, const void *);/* implemented */ -extern NCURSES_EXPORT(int) wclear (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) wclrtobot (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) wclrtoeol (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) wcolor_set (WINDOW*,short,void*); /* implemented */ -extern NCURSES_EXPORT(void) wcursyncup (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) wdelch (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) wdeleteln (WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) wechochar (WINDOW *, const chtype); /* implemented */ -extern NCURSES_EXPORT(int) werase (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) wgetch (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) wgetnstr (WINDOW *,char *,int); /* implemented */ -extern NCURSES_EXPORT(int) wgetstr (WINDOW *, char *); /* generated */ -extern NCURSES_EXPORT(int) whline (WINDOW *, chtype, int); /* implemented */ -extern NCURSES_EXPORT(chtype) winch (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) winchnstr (WINDOW *, chtype *, int); /* implemented */ -extern NCURSES_EXPORT(int) winchstr (WINDOW *, chtype *); /* generated */ -extern NCURSES_EXPORT(int) winnstr (WINDOW *, char *, int); /* implemented */ -extern NCURSES_EXPORT(int) winsch (WINDOW *, chtype); /* implemented */ -extern NCURSES_EXPORT(int) winsdelln (WINDOW *,int); /* implemented */ -extern NCURSES_EXPORT(int) winsertln (WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) winsnstr (WINDOW *, const char *,int); /* implemented */ -extern NCURSES_EXPORT(int) winsstr (WINDOW *, const char *); /* generated */ -extern NCURSES_EXPORT(int) winstr (WINDOW *, char *); /* generated */ -extern NCURSES_EXPORT(int) wmove (WINDOW *,int,int); /* implemented */ -extern NCURSES_EXPORT(int) wnoutrefresh (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) wprintw (WINDOW *, const char *,...) /* implemented */ - GCC_PRINTFLIKE(2,3); -extern NCURSES_EXPORT(int) wredrawln (WINDOW *,int,int); /* implemented */ -extern NCURSES_EXPORT(int) wrefresh (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) wscanw (WINDOW *, NCURSES_CONST char *,...) /* implemented */ - GCC_SCANFLIKE(2,3); -extern NCURSES_EXPORT(int) wscrl (WINDOW *,int); /* implemented */ -extern NCURSES_EXPORT(int) wsetscrreg (WINDOW *,int,int); /* implemented */ -extern NCURSES_EXPORT(int) wstandout (WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) wstandend (WINDOW *); /* generated */ -extern NCURSES_EXPORT(void) wsyncdown (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(void) wsyncup (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(void) wtimeout (WINDOW *,int); /* implemented */ -extern NCURSES_EXPORT(int) wtouchln (WINDOW *,int,int,int); /* implemented */ -extern NCURSES_EXPORT(int) wvline (WINDOW *,chtype,int); /* implemented */ - -/* - * These are also declared in : - */ -extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *); /* implemented */ -extern NCURSES_EXPORT(int) tigetnum (NCURSES_CONST char *); /* implemented */ -extern NCURSES_EXPORT(char *) tigetstr (NCURSES_CONST char *); /* implemented */ -extern NCURSES_EXPORT(int) putp (const char *); /* implemented */ - -#if NCURSES_TPARM_VARARGS -extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, ...); /* special */ -#else -extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, long,long,long,long,long,long,long,long,long); /* special */ -extern NCURSES_EXPORT(char *) tparm_varargs (NCURSES_CONST char *, ...); /* special */ -#endif - -extern NCURSES_EXPORT(char *) tiparm (const char *, ...); /* special */ - -/* - * These functions are not in X/Open, but we use them in macro definitions: - */ -extern NCURSES_EXPORT(int) getattrs (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) getcurx (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) getcury (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) getbegx (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) getbegy (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) getmaxx (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) getmaxy (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) getparx (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) getpary (const WINDOW *); /* generated */ - -/* - * vid_attr() was implemented originally based on a draft of X/Open curses. - */ -#ifndef NCURSES_WIDECHAR -#define vid_attr(a,pair,opts) vidattr(a) -#endif - -/* - * These functions are extensions - not in X/Open Curses. - */ -#if 1 -#undef NCURSES_EXT_FUNCS -#define NCURSES_EXT_FUNCS 20110404 -typedef int (*NCURSES_WINDOW_CB)(WINDOW *, void *); -typedef int (*NCURSES_SCREEN_CB)(SCREEN *, void *); -extern NCURSES_EXPORT(bool) is_term_resized (int, int); -extern NCURSES_EXPORT(char *) keybound (int, int); -extern NCURSES_EXPORT(const char *) curses_version (void); -extern NCURSES_EXPORT(int) assume_default_colors (int, int); -extern NCURSES_EXPORT(int) define_key (const char *, int); -extern NCURSES_EXPORT(int) get_escdelay (void); -extern NCURSES_EXPORT(int) key_defined (const char *); -extern NCURSES_EXPORT(int) keyok (int, bool); -extern NCURSES_EXPORT(int) resize_term (int, int); -extern NCURSES_EXPORT(int) resizeterm (int, int); -extern NCURSES_EXPORT(int) set_escdelay (int); -extern NCURSES_EXPORT(int) set_tabsize (int); -extern NCURSES_EXPORT(int) use_default_colors (void); -extern NCURSES_EXPORT(int) use_extended_names (bool); -extern NCURSES_EXPORT(int) use_legacy_coding (int); -extern NCURSES_EXPORT(int) use_screen (SCREEN *, NCURSES_SCREEN_CB, void *); -extern NCURSES_EXPORT(int) use_window (WINDOW *, NCURSES_WINDOW_CB, void *); -extern NCURSES_EXPORT(int) wresize (WINDOW *, int, int); -extern NCURSES_EXPORT(void) nofilter(void); - -/* - * These extensions provide access to information stored in the WINDOW even - * when NCURSES_OPAQUE is set: - */ -extern NCURSES_EXPORT(WINDOW *) wgetparent (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_cleared (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_idcok (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_idlok (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_immedok (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_keypad (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_leaveok (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_nodelay (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_notimeout (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_pad (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_scrollok (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_subwin (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_syncok (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) wgetscrreg (const WINDOW *, int *, int *); /* generated */ - -#else -#define curses_version() NCURSES_VERSION -#endif - -/* - * Extra extension-functions, which pass a SCREEN pointer rather than using - * a global variable SP. - */ -#if 1 -#undef NCURSES_SP_FUNCS -#define NCURSES_SP_FUNCS 20110404 -#define NCURSES_SP_NAME(name) name##_sp - -/* Define the sp-funcs helper function */ -#define NCURSES_SP_OUTC NCURSES_SP_NAME(NCURSES_OUTC) -typedef int (*NCURSES_SP_OUTC)(SCREEN*, int); - -extern NCURSES_EXPORT(SCREEN *) new_prescr (void); /* implemented:SP_FUNC */ - -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(baudrate) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(beep) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(can_change_color) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(cbreak) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(curs_set) (SCREEN*, int); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(color_content) (SCREEN*, short, short*, short*, short*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(def_prog_mode) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(def_shell_mode) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(delay_output) (SCREEN*, int); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(doupdate) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(echo) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(endwin) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(char) NCURSES_SP_NAME(erasechar) (SCREEN*);/* implemented:SP_FUNC */ -extern NCURSES_EXPORT(void) NCURSES_SP_NAME(filter) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(flash) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(flushinp) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(getwin) (SCREEN*, FILE *); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(halfdelay) (SCREEN*, int); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_colors) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_ic) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_il) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(init_color) (SCREEN*, short, short, short, short); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(init_pair) (SCREEN*, short, short, short); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(intrflush) (SCREEN*, WINDOW*, bool); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(isendwin) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(NCURSES_CONST char *) NCURSES_SP_NAME(keyname) (SCREEN*, int); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(char) NCURSES_SP_NAME(killchar) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(longname) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(mvcur) (SCREEN*, int, int, int, int); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(napms) (SCREEN*, int); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(newpad) (SCREEN*, int, int); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(SCREEN *) NCURSES_SP_NAME(newterm) (SCREEN*, NCURSES_CONST char *, FILE *, FILE *); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(newwin) (SCREEN*, int, int, int, int); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(nl) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(nocbreak) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(noecho) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(nonl) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(void) NCURSES_SP_NAME(noqiflush) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(noraw) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(pair_content) (SCREEN*, short, short*, short*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(void) NCURSES_SP_NAME(qiflush) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(raw) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(reset_prog_mode) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(reset_shell_mode) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(resetty) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(ripoffline) (SCREEN*, int, int (*)(WINDOW *, int)); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(savetty) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(scr_init) (SCREEN*, const char *); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(scr_restore) (SCREEN*, const char *); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(scr_set) (SCREEN*, const char *); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attroff) (SCREEN*, const chtype); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attron) (SCREEN*, const chtype); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attrset) (SCREEN*, const chtype); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(attr_t) NCURSES_SP_NAME(slk_attr) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attr_set) (SCREEN*, const attr_t, short, void*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_clear) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_color) (SCREEN*, short); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_init) (SCREEN*, int); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(slk_label) (SCREEN*, int); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_noutrefresh) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_refresh) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_restore) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_set) (SCREEN*, int, const char *, int); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_touch) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(start_color) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(chtype) NCURSES_SP_NAME(termattrs) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(termname) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(typeahead) (SCREEN*, int); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(ungetch) (SCREEN*, int); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(void) NCURSES_SP_NAME(use_env) (SCREEN*, bool); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vidattr) (SCREEN*, chtype); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vidputs) (SCREEN*, chtype, NCURSES_SP_OUTC); /* implemented:SP_FUNC */ -#if 1 -extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(keybound) (SCREEN*, int, int); /* implemented:EXT_SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(assume_default_colors) (SCREEN*, int, int); /* implemented:EXT_SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(define_key) (SCREEN*, const char *, int); /* implemented:EXT_SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(get_escdelay) (SCREEN*); /* implemented:EXT_SP_FUNC */ -extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(is_term_resized) (SCREEN*, int, int); /* implemented:EXT_SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(key_defined) (SCREEN*, const char *); /* implemented:EXT_SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(keyok) (SCREEN*, int, bool); /* implemented:EXT_SP_FUNC */ -extern NCURSES_EXPORT(void) NCURSES_SP_NAME(nofilter) (SCREEN*); /* implemented */ /* implemented:EXT_SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(resize_term) (SCREEN*, int, int); /* implemented:EXT_SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(resizeterm) (SCREEN*, int, int); /* implemented:EXT_SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(set_escdelay) (SCREEN*, int); /* implemented:EXT_SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(set_tabsize) (SCREEN*, int); /* implemented:EXT_SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_default_colors) (SCREEN*); /* implemented:EXT_SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /* implemented:EXT_SP_FUNC */ -#endif -#else -#undef NCURSES_SP_FUNCS -#define NCURSES_SP_FUNCS 0 -#define NCURSES_SP_NAME(name) name -#define NCURSES_SP_OUTC NCURSES_OUTC -#endif - -/* attributes */ - -#define NCURSES_ATTR_SHIFT 8 -#define NCURSES_BITS(mask,shift) ((mask) << ((shift) + NCURSES_ATTR_SHIFT)) - -#define A_NORMAL (1UL - 1UL) -#define A_ATTRIBUTES NCURSES_BITS(~(1UL - 1UL),0) -#define A_CHARTEXT (NCURSES_BITS(1UL,0) - 1UL) -#define A_COLOR NCURSES_BITS(((1UL) << 8) - 1UL,0) -#define A_STANDOUT NCURSES_BITS(1UL,8) -#define A_UNDERLINE NCURSES_BITS(1UL,9) -#define A_REVERSE NCURSES_BITS(1UL,10) -#define A_BLINK NCURSES_BITS(1UL,11) -#define A_DIM NCURSES_BITS(1UL,12) -#define A_BOLD NCURSES_BITS(1UL,13) -#define A_ALTCHARSET NCURSES_BITS(1UL,14) -#define A_INVIS NCURSES_BITS(1UL,15) -#define A_PROTECT NCURSES_BITS(1UL,16) -#define A_HORIZONTAL NCURSES_BITS(1UL,17) -#define A_LEFT NCURSES_BITS(1UL,18) -#define A_LOW NCURSES_BITS(1UL,19) -#define A_RIGHT NCURSES_BITS(1UL,20) -#define A_TOP NCURSES_BITS(1UL,21) -#define A_VERTICAL NCURSES_BITS(1UL,22) - -/* - * Most of the pseudo functions are macros that either provide compatibility - * with older versions of curses, or provide inline functionality to improve - * performance. - */ - -/* - * These pseudo functions are always implemented as macros: - */ - -#define getyx(win,y,x) (y = getcury(win), x = getcurx(win)) -#define getbegyx(win,y,x) (y = getbegy(win), x = getbegx(win)) -#define getmaxyx(win,y,x) (y = getmaxy(win), x = getmaxx(win)) -#define getparyx(win,y,x) (y = getpary(win), x = getparx(win)) - -#define getsyx(y,x) do { if (newscr) { \ - if (is_leaveok(newscr)) \ - (y) = (x) = -1; \ - else \ - getyx(newscr,(y), (x)); \ - } \ - } while(0) - -#define setsyx(y,x) do { if (newscr) { \ - if ((y) == -1 && (x) == -1) \ - leaveok(newscr, TRUE); \ - else { \ - leaveok(newscr, FALSE); \ - wmove(newscr, (y), (x)); \ - } \ - } \ - } while(0) - -#ifndef NCURSES_NOMACROS - -/* - * These miscellaneous pseudo functions are provided for compatibility: - */ - -#define wgetstr(w, s) wgetnstr(w, s, -1) -#define getnstr(s, n) wgetnstr(stdscr, s, n) - -#define setterm(term) setupterm(term, 1, (int *)0) - -#define fixterm() reset_prog_mode() -#define resetterm() reset_shell_mode() -#define saveterm() def_prog_mode() -#define crmode() cbreak() -#define nocrmode() nocbreak() -#define gettmode() - -/* It seems older SYSV curses versions define these */ -#if !NCURSES_OPAQUE -#define getattrs(win) NCURSES_CAST(int, (win) ? (win)->_attrs : A_NORMAL) -#define getcurx(win) ((win) ? (win)->_curx : ERR) -#define getcury(win) ((win) ? (win)->_cury : ERR) -#define getbegx(win) ((win) ? (win)->_begx : ERR) -#define getbegy(win) ((win) ? (win)->_begy : ERR) -#define getmaxx(win) ((win) ? ((win)->_maxx + 1) : ERR) -#define getmaxy(win) ((win) ? ((win)->_maxy + 1) : ERR) -#define getparx(win) ((win) ? (win)->_parx : ERR) -#define getpary(win) ((win) ? (win)->_pary : ERR) -#endif /* NCURSES_OPAQUE */ - -#define wstandout(win) (wattrset(win,A_STANDOUT)) -#define wstandend(win) (wattrset(win,A_NORMAL)) - -#define wattron(win,at) wattr_on(win, NCURSES_CAST(attr_t, at), NULL) -#define wattroff(win,at) wattr_off(win, NCURSES_CAST(attr_t, at), NULL) - -#if !NCURSES_OPAQUE -#if defined(NCURSES_WIDECHAR) && 0 -#define wattrset(win,at) ((win) \ - ? ((win)->_color = PAIR_NUMBER(at), \ - (win)->_attrs = NCURSES_CAST(attr_t, at), \ - OK) \ - : ERR) -#else -#define wattrset(win,at) ((win) \ - ? ((win)->_attrs = NCURSES_CAST(attr_t, at), \ - OK) \ - : ERR) -#endif -#endif /* NCURSES_OPAQUE */ - -#define scroll(win) wscrl(win,1) - -#define touchwin(win) wtouchln((win), 0, getmaxy(win), 1) -#define touchline(win, s, c) wtouchln((win), s, c, 1) -#define untouchwin(win) wtouchln((win), 0, getmaxy(win), 0) - -#define box(win, v, h) wborder(win, v, v, h, h, 0, 0, 0, 0) -#define border(ls, rs, ts, bs, tl, tr, bl, br) wborder(stdscr, ls, rs, ts, bs, tl, tr, bl, br) -#define hline(ch, n) whline(stdscr, ch, n) -#define vline(ch, n) wvline(stdscr, ch, n) - -#define winstr(w, s) winnstr(w, s, -1) -#define winchstr(w, s) winchnstr(w, s, -1) -#define winsstr(w, s) winsnstr(w, s, -1) - -#if !NCURSES_OPAQUE -#define redrawwin(win) wredrawln(win, 0, (win)->_maxy+1) -#endif /* NCURSES_OPAQUE */ - -#define waddstr(win,str) waddnstr(win,str,-1) -#define waddchstr(win,str) waddchnstr(win,str,-1) - -/* - * These apply to the first 256 color pairs. - */ -#define COLOR_PAIR(n) NCURSES_BITS(n, 0) -#define PAIR_NUMBER(a) (NCURSES_CAST(int,((NCURSES_CAST(unsigned long,a) & A_COLOR) >> NCURSES_ATTR_SHIFT))) - -/* - * pseudo functions for standard screen - */ - -#define addch(ch) waddch(stdscr,ch) -#define addchnstr(str,n) waddchnstr(stdscr,str,n) -#define addchstr(str) waddchstr(stdscr,str) -#define addnstr(str,n) waddnstr(stdscr,str,n) -#define addstr(str) waddnstr(stdscr,str,-1) -#define attroff(at) wattroff(stdscr,at) -#define attron(at) wattron(stdscr,at) -#define attrset(at) wattrset(stdscr,at) -#define attr_get(ap,cp,o) wattr_get(stdscr,ap,cp,o) -#define attr_off(a,o) wattr_off(stdscr,a,o) -#define attr_on(a,o) wattr_on(stdscr,a,o) -#define attr_set(a,c,o) wattr_set(stdscr,a,c,o) -#define bkgd(ch) wbkgd(stdscr,ch) -#define bkgdset(ch) wbkgdset(stdscr,ch) -#define chgat(n,a,c,o) wchgat(stdscr,n,a,c,o) -#define clear() wclear(stdscr) -#define clrtobot() wclrtobot(stdscr) -#define clrtoeol() wclrtoeol(stdscr) -#define color_set(c,o) wcolor_set(stdscr,c,o) -#define delch() wdelch(stdscr) -#define deleteln() winsdelln(stdscr,-1) -#define echochar(c) wechochar(stdscr,c) -#define erase() werase(stdscr) -#define getch() wgetch(stdscr) -#define getstr(str) wgetstr(stdscr,str) -#define inch() winch(stdscr) -#define inchnstr(s,n) winchnstr(stdscr,s,n) -#define inchstr(s) winchstr(stdscr,s) -#define innstr(s,n) winnstr(stdscr,s,n) -#define insch(c) winsch(stdscr,c) -#define insdelln(n) winsdelln(stdscr,n) -#define insertln() winsdelln(stdscr,1) -#define insnstr(s,n) winsnstr(stdscr,s,n) -#define insstr(s) winsstr(stdscr,s) -#define instr(s) winstr(stdscr,s) -#define move(y,x) wmove(stdscr,y,x) -#define refresh() wrefresh(stdscr) -#define scrl(n) wscrl(stdscr,n) -#define setscrreg(t,b) wsetscrreg(stdscr,t,b) -#define standend() wstandend(stdscr) -#define standout() wstandout(stdscr) -#define timeout(delay) wtimeout(stdscr,delay) -#define wdeleteln(win) winsdelln(win,-1) -#define winsertln(win) winsdelln(win,1) - -/* - * mv functions - */ - -#define mvwaddch(win,y,x,ch) (wmove(win,y,x) == ERR ? ERR : waddch(win,ch)) -#define mvwaddchnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : waddchnstr(win,str,n)) -#define mvwaddchstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : waddchnstr(win,str,-1)) -#define mvwaddnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : waddnstr(win,str,n)) -#define mvwaddstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : waddnstr(win,str,-1)) -#define mvwdelch(win,y,x) (wmove(win,y,x) == ERR ? ERR : wdelch(win)) -#define mvwchgat(win,y,x,n,a,c,o) (wmove(win,y,x) == ERR ? ERR : wchgat(win,n,a,c,o)) -#define mvwgetch(win,y,x) (wmove(win,y,x) == ERR ? ERR : wgetch(win)) -#define mvwgetnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : wgetnstr(win,str,n)) -#define mvwgetstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : wgetstr(win,str)) -#define mvwhline(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : whline(win,c,n)) -#define mvwinch(win,y,x) (wmove(win,y,x) == ERR ? NCURSES_CAST(chtype, ERR) : winch(win)) -#define mvwinchnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : winchnstr(win,s,n)) -#define mvwinchstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : winchstr(win,s)) -#define mvwinnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : winnstr(win,s,n)) -#define mvwinsch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : winsch(win,c)) -#define mvwinsnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : winsnstr(win,s,n)) -#define mvwinsstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : winsstr(win,s)) -#define mvwinstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : winstr(win,s)) -#define mvwvline(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : wvline(win,c,n)) - -#define mvaddch(y,x,ch) mvwaddch(stdscr,y,x,ch) -#define mvaddchnstr(y,x,str,n) mvwaddchnstr(stdscr,y,x,str,n) -#define mvaddchstr(y,x,str) mvwaddchstr(stdscr,y,x,str) -#define mvaddnstr(y,x,str,n) mvwaddnstr(stdscr,y,x,str,n) -#define mvaddstr(y,x,str) mvwaddstr(stdscr,y,x,str) -#define mvchgat(y,x,n,a,c,o) mvwchgat(stdscr,y,x,n,a,c,o) -#define mvdelch(y,x) mvwdelch(stdscr,y,x) -#define mvgetch(y,x) mvwgetch(stdscr,y,x) -#define mvgetnstr(y,x,str,n) mvwgetnstr(stdscr,y,x,str,n) -#define mvgetstr(y,x,str) mvwgetstr(stdscr,y,x,str) -#define mvhline(y,x,c,n) mvwhline(stdscr,y,x,c,n) -#define mvinch(y,x) mvwinch(stdscr,y,x) -#define mvinchnstr(y,x,s,n) mvwinchnstr(stdscr,y,x,s,n) -#define mvinchstr(y,x,s) mvwinchstr(stdscr,y,x,s) -#define mvinnstr(y,x,s,n) mvwinnstr(stdscr,y,x,s,n) -#define mvinsch(y,x,c) mvwinsch(stdscr,y,x,c) -#define mvinsnstr(y,x,s,n) mvwinsnstr(stdscr,y,x,s,n) -#define mvinsstr(y,x,s) mvwinsstr(stdscr,y,x,s) -#define mvinstr(y,x,s) mvwinstr(stdscr,y,x,s) -#define mvvline(y,x,c,n) mvwvline(stdscr,y,x,c,n) - -/* - * Some wide-character functions can be implemented without the extensions. - */ -#if !NCURSES_OPAQUE -#define getbkgd(win) ((win)->_bkgd) -#endif /* NCURSES_OPAQUE */ - -#define slk_attr_off(a,v) ((v) ? ERR : slk_attroff(a)) -#define slk_attr_on(a,v) ((v) ? ERR : slk_attron(a)) - -#if !NCURSES_OPAQUE -#if defined(NCURSES_WIDECHAR) && 0 -#define wattr_set(win,a,p,opts) ((win)->_attrs = ((a) & ~A_COLOR), \ - (win)->_color = (p), \ - OK) -#define wattr_get(win,a,p,opts) ((void)((a) != (void *)0 && (*(a) = (win)->_attrs)), \ - (void)((p) != (void *)0 && (*(p) = (short)(win)->_color)), \ - OK) -#else -#define wattr_set(win,a,p,opts) ((win)->_attrs = (((a) & ~A_COLOR) | (attr_t)COLOR_PAIR(p)), OK) -#define wattr_get(win,a,p,opts) ((void)((a) != (void *)0 && (*(a) = (win)->_attrs)), \ - (void)((p) != (void *)0 && (*(p) = (short)PAIR_NUMBER((win)->_attrs))), \ - OK) -#endif -#endif /* NCURSES_OPAQUE */ - -/* - * X/Open curses deprecates SVr4 vwprintw/vwscanw, which are supposed to use - * varargs.h. It adds new calls vw_printw/vw_scanw, which are supposed to - * use POSIX stdarg.h. The ncurses versions of vwprintw/vwscanw already - * use stdarg.h, so... - */ -#define vw_printw vwprintw -#define vw_scanw vwscanw - -/* - * Export fallback function for use in C++ binding. - */ -#if !1 -#define vsscanf(a,b,c) _nc_vsscanf(a,b,c) -NCURSES_EXPORT(int) vsscanf(const char *, const char *, va_list); -#endif - -/* - * These macros are extensions - not in X/Open Curses. - */ -#if 1 -#if !NCURSES_OPAQUE -#define is_cleared(win) ((win) ? (win)->_clear : FALSE) -#define is_idcok(win) ((win) ? (win)->_idcok : FALSE) -#define is_idlok(win) ((win) ? (win)->_idlok : FALSE) -#define is_immedok(win) ((win) ? (win)->_immed : FALSE) -#define is_keypad(win) ((win) ? (win)->_use_keypad : FALSE) -#define is_leaveok(win) ((win) ? (win)->_leaveok : FALSE) -#define is_nodelay(win) ((win) ? ((win)->_delay == 0) : FALSE) -#define is_notimeout(win) ((win) ? (win)->_notimeout : FALSE) -#define is_pad(win) ((win) ? ((win)->_flags & _ISPAD) != 0 : FALSE) -#define is_scrollok(win) ((win) ? (win)->_scroll : FALSE) -#define is_subwin(win) ((win) ? ((win)->_flags & _SUBWIN) != 0 : FALSE) -#define is_syncok(win) ((win) ? (win)->_sync : FALSE) -#define wgetparent(win) ((win) ? (win)->_parent : 0) -#define wgetscrreg(win,t,b) ((win) ? (*(t) = (win)->_regtop, *(b) = (win)->_regbottom, OK) : ERR) -#endif -#endif - -#endif /* NCURSES_NOMACROS */ - -/* - * Public variables. - * - * Notes: - * a. ESCDELAY was an undocumented feature under AIX curses. - * It gives the ESC expire time in milliseconds. - * b. ttytype is needed for backward compatibility - */ -#if NCURSES_REENTRANT - -NCURSES_WRAPPED_VAR(WINDOW *, curscr); -NCURSES_WRAPPED_VAR(WINDOW *, newscr); -NCURSES_WRAPPED_VAR(WINDOW *, stdscr); -NCURSES_WRAPPED_VAR(char *, ttytype); -NCURSES_WRAPPED_VAR(int, COLORS); -NCURSES_WRAPPED_VAR(int, COLOR_PAIRS); -NCURSES_WRAPPED_VAR(int, COLS); -NCURSES_WRAPPED_VAR(int, ESCDELAY); -NCURSES_WRAPPED_VAR(int, LINES); -NCURSES_WRAPPED_VAR(int, TABSIZE); - -#define curscr NCURSES_PUBLIC_VAR(curscr()) -#define newscr NCURSES_PUBLIC_VAR(newscr()) -#define stdscr NCURSES_PUBLIC_VAR(stdscr()) -#define ttytype NCURSES_PUBLIC_VAR(ttytype()) -#define COLORS NCURSES_PUBLIC_VAR(COLORS()) -#define COLOR_PAIRS NCURSES_PUBLIC_VAR(COLOR_PAIRS()) -#define COLS NCURSES_PUBLIC_VAR(COLS()) -#define ESCDELAY NCURSES_PUBLIC_VAR(ESCDELAY()) -#define LINES NCURSES_PUBLIC_VAR(LINES()) -#define TABSIZE NCURSES_PUBLIC_VAR(TABSIZE()) - -#else - -extern NCURSES_EXPORT_VAR(WINDOW *) curscr; -extern NCURSES_EXPORT_VAR(WINDOW *) newscr; -extern NCURSES_EXPORT_VAR(WINDOW *) stdscr; -extern NCURSES_EXPORT_VAR(char) ttytype[]; -extern NCURSES_EXPORT_VAR(int) COLORS; -extern NCURSES_EXPORT_VAR(int) COLOR_PAIRS; -extern NCURSES_EXPORT_VAR(int) COLS; -extern NCURSES_EXPORT_VAR(int) ESCDELAY; -extern NCURSES_EXPORT_VAR(int) LINES; -extern NCURSES_EXPORT_VAR(int) TABSIZE; - -#endif - -/* - * Pseudo-character tokens outside ASCII range. The curses wgetch() function - * will return any given one of these only if the corresponding k- capability - * is defined in your terminal's terminfo entry. - * - * Some keys (KEY_A1, etc) are arranged like this: - * a1 up a3 - * left b2 right - * c1 down c3 - * - * A few key codes do not depend upon the terminfo entry. - */ -#define KEY_CODE_YES 0400 /* A wchar_t contains a key code */ -#define KEY_MIN 0401 /* Minimum curses key */ -#define KEY_BREAK 0401 /* Break key (unreliable) */ -#define KEY_SRESET 0530 /* Soft (partial) reset (unreliable) */ -#define KEY_RESET 0531 /* Reset or hard reset (unreliable) */ -/* - * These definitions were generated by ./MKkey_defs.sh ./Caps - */ -#define KEY_DOWN 0402 /* down-arrow key */ -#define KEY_UP 0403 /* up-arrow key */ -#define KEY_LEFT 0404 /* left-arrow key */ -#define KEY_RIGHT 0405 /* right-arrow key */ -#define KEY_HOME 0406 /* home key */ -#define KEY_BACKSPACE 0407 /* backspace key */ -#define KEY_F0 0410 /* Function keys. Space for 64 */ -#define KEY_F(n) (KEY_F0+(n)) /* Value of function key n */ -#define KEY_DL 0510 /* delete-line key */ -#define KEY_IL 0511 /* insert-line key */ -#define KEY_DC 0512 /* delete-character key */ -#define KEY_IC 0513 /* insert-character key */ -#define KEY_EIC 0514 /* sent by rmir or smir in insert mode */ -#define KEY_CLEAR 0515 /* clear-screen or erase key */ -#define KEY_EOS 0516 /* clear-to-end-of-screen key */ -#define KEY_EOL 0517 /* clear-to-end-of-line key */ -#define KEY_SF 0520 /* scroll-forward key */ -#define KEY_SR 0521 /* scroll-backward key */ -#define KEY_NPAGE 0522 /* next-page key */ -#define KEY_PPAGE 0523 /* previous-page key */ -#define KEY_STAB 0524 /* set-tab key */ -#define KEY_CTAB 0525 /* clear-tab key */ -#define KEY_CATAB 0526 /* clear-all-tabs key */ -#define KEY_ENTER 0527 /* enter/send key */ -#define KEY_PRINT 0532 /* print key */ -#define KEY_LL 0533 /* lower-left key (home down) */ -#define KEY_A1 0534 /* upper left of keypad */ -#define KEY_A3 0535 /* upper right of keypad */ -#define KEY_B2 0536 /* center of keypad */ -#define KEY_C1 0537 /* lower left of keypad */ -#define KEY_C3 0540 /* lower right of keypad */ -#define KEY_BTAB 0541 /* back-tab key */ -#define KEY_BEG 0542 /* begin key */ -#define KEY_CANCEL 0543 /* cancel key */ -#define KEY_CLOSE 0544 /* close key */ -#define KEY_COMMAND 0545 /* command key */ -#define KEY_COPY 0546 /* copy key */ -#define KEY_CREATE 0547 /* create key */ -#define KEY_END 0550 /* end key */ -#define KEY_EXIT 0551 /* exit key */ -#define KEY_FIND 0552 /* find key */ -#define KEY_HELP 0553 /* help key */ -#define KEY_MARK 0554 /* mark key */ -#define KEY_MESSAGE 0555 /* message key */ -#define KEY_MOVE 0556 /* move key */ -#define KEY_NEXT 0557 /* next key */ -#define KEY_OPEN 0560 /* open key */ -#define KEY_OPTIONS 0561 /* options key */ -#define KEY_PREVIOUS 0562 /* previous key */ -#define KEY_REDO 0563 /* redo key */ -#define KEY_REFERENCE 0564 /* reference key */ -#define KEY_REFRESH 0565 /* refresh key */ -#define KEY_REPLACE 0566 /* replace key */ -#define KEY_RESTART 0567 /* restart key */ -#define KEY_RESUME 0570 /* resume key */ -#define KEY_SAVE 0571 /* save key */ -#define KEY_SBEG 0572 /* shifted begin key */ -#define KEY_SCANCEL 0573 /* shifted cancel key */ -#define KEY_SCOMMAND 0574 /* shifted command key */ -#define KEY_SCOPY 0575 /* shifted copy key */ -#define KEY_SCREATE 0576 /* shifted create key */ -#define KEY_SDC 0577 /* shifted delete-character key */ -#define KEY_SDL 0600 /* shifted delete-line key */ -#define KEY_SELECT 0601 /* select key */ -#define KEY_SEND 0602 /* shifted end key */ -#define KEY_SEOL 0603 /* shifted clear-to-end-of-line key */ -#define KEY_SEXIT 0604 /* shifted exit key */ -#define KEY_SFIND 0605 /* shifted find key */ -#define KEY_SHELP 0606 /* shifted help key */ -#define KEY_SHOME 0607 /* shifted home key */ -#define KEY_SIC 0610 /* shifted insert-character key */ -#define KEY_SLEFT 0611 /* shifted left-arrow key */ -#define KEY_SMESSAGE 0612 /* shifted message key */ -#define KEY_SMOVE 0613 /* shifted move key */ -#define KEY_SNEXT 0614 /* shifted next key */ -#define KEY_SOPTIONS 0615 /* shifted options key */ -#define KEY_SPREVIOUS 0616 /* shifted previous key */ -#define KEY_SPRINT 0617 /* shifted print key */ -#define KEY_SREDO 0620 /* shifted redo key */ -#define KEY_SREPLACE 0621 /* shifted replace key */ -#define KEY_SRIGHT 0622 /* shifted right-arrow key */ -#define KEY_SRSUME 0623 /* shifted resume key */ -#define KEY_SSAVE 0624 /* shifted save key */ -#define KEY_SSUSPEND 0625 /* shifted suspend key */ -#define KEY_SUNDO 0626 /* shifted undo key */ -#define KEY_SUSPEND 0627 /* suspend key */ -#define KEY_UNDO 0630 /* undo key */ -#define KEY_MOUSE 0631 /* Mouse event has occurred */ -#define KEY_RESIZE 0632 /* Terminal resize event */ -#define KEY_EVENT 0633 /* We were interrupted by an event */ - -#define KEY_MAX 0777 /* Maximum key value is 0633 */ -/* $Id: curses.tail,v 1.20 2010/03/28 19:10:55 tom Exp $ */ -/* - * vile:cmode: - * This file is part of ncurses, designed to be appended after curses.h.in - * (see that file for the relevant copyright). - */ - -/* mouse interface */ - -#if NCURSES_MOUSE_VERSION > 1 -#define NCURSES_MOUSE_MASK(b,m) ((m) << (((b) - 1) * 5)) -#else -#define NCURSES_MOUSE_MASK(b,m) ((m) << (((b) - 1) * 6)) -#endif - -#define NCURSES_BUTTON_RELEASED 001L -#define NCURSES_BUTTON_PRESSED 002L -#define NCURSES_BUTTON_CLICKED 004L -#define NCURSES_DOUBLE_CLICKED 010L -#define NCURSES_TRIPLE_CLICKED 020L -#define NCURSES_RESERVED_EVENT 040L - -/* event masks */ -#define BUTTON1_RELEASED NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_RELEASED) -#define BUTTON1_PRESSED NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_PRESSED) -#define BUTTON1_CLICKED NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_CLICKED) -#define BUTTON1_DOUBLE_CLICKED NCURSES_MOUSE_MASK(1, NCURSES_DOUBLE_CLICKED) -#define BUTTON1_TRIPLE_CLICKED NCURSES_MOUSE_MASK(1, NCURSES_TRIPLE_CLICKED) - -#define BUTTON2_RELEASED NCURSES_MOUSE_MASK(2, NCURSES_BUTTON_RELEASED) -#define BUTTON2_PRESSED NCURSES_MOUSE_MASK(2, NCURSES_BUTTON_PRESSED) -#define BUTTON2_CLICKED NCURSES_MOUSE_MASK(2, NCURSES_BUTTON_CLICKED) -#define BUTTON2_DOUBLE_CLICKED NCURSES_MOUSE_MASK(2, NCURSES_DOUBLE_CLICKED) -#define BUTTON2_TRIPLE_CLICKED NCURSES_MOUSE_MASK(2, NCURSES_TRIPLE_CLICKED) - -#define BUTTON3_RELEASED NCURSES_MOUSE_MASK(3, NCURSES_BUTTON_RELEASED) -#define BUTTON3_PRESSED NCURSES_MOUSE_MASK(3, NCURSES_BUTTON_PRESSED) -#define BUTTON3_CLICKED NCURSES_MOUSE_MASK(3, NCURSES_BUTTON_CLICKED) -#define BUTTON3_DOUBLE_CLICKED NCURSES_MOUSE_MASK(3, NCURSES_DOUBLE_CLICKED) -#define BUTTON3_TRIPLE_CLICKED NCURSES_MOUSE_MASK(3, NCURSES_TRIPLE_CLICKED) - -#define BUTTON4_RELEASED NCURSES_MOUSE_MASK(4, NCURSES_BUTTON_RELEASED) -#define BUTTON4_PRESSED NCURSES_MOUSE_MASK(4, NCURSES_BUTTON_PRESSED) -#define BUTTON4_CLICKED NCURSES_MOUSE_MASK(4, NCURSES_BUTTON_CLICKED) -#define BUTTON4_DOUBLE_CLICKED NCURSES_MOUSE_MASK(4, NCURSES_DOUBLE_CLICKED) -#define BUTTON4_TRIPLE_CLICKED NCURSES_MOUSE_MASK(4, NCURSES_TRIPLE_CLICKED) - -/* - * In 32 bits the version-1 scheme does not provide enough space for a 5th - * button, unless we choose to change the ABI by omitting the reserved-events. - */ -#if NCURSES_MOUSE_VERSION > 1 - -#define BUTTON5_RELEASED NCURSES_MOUSE_MASK(5, NCURSES_BUTTON_RELEASED) -#define BUTTON5_PRESSED NCURSES_MOUSE_MASK(5, NCURSES_BUTTON_PRESSED) -#define BUTTON5_CLICKED NCURSES_MOUSE_MASK(5, NCURSES_BUTTON_CLICKED) -#define BUTTON5_DOUBLE_CLICKED NCURSES_MOUSE_MASK(5, NCURSES_DOUBLE_CLICKED) -#define BUTTON5_TRIPLE_CLICKED NCURSES_MOUSE_MASK(5, NCURSES_TRIPLE_CLICKED) - -#define BUTTON_CTRL NCURSES_MOUSE_MASK(6, 0001L) -#define BUTTON_SHIFT NCURSES_MOUSE_MASK(6, 0002L) -#define BUTTON_ALT NCURSES_MOUSE_MASK(6, 0004L) -#define REPORT_MOUSE_POSITION NCURSES_MOUSE_MASK(6, 0010L) - -#else - -#define BUTTON1_RESERVED_EVENT NCURSES_MOUSE_MASK(1, NCURSES_RESERVED_EVENT) -#define BUTTON2_RESERVED_EVENT NCURSES_MOUSE_MASK(2, NCURSES_RESERVED_EVENT) -#define BUTTON3_RESERVED_EVENT NCURSES_MOUSE_MASK(3, NCURSES_RESERVED_EVENT) -#define BUTTON4_RESERVED_EVENT NCURSES_MOUSE_MASK(4, NCURSES_RESERVED_EVENT) - -#define BUTTON_CTRL NCURSES_MOUSE_MASK(5, 0001L) -#define BUTTON_SHIFT NCURSES_MOUSE_MASK(5, 0002L) -#define BUTTON_ALT NCURSES_MOUSE_MASK(5, 0004L) -#define REPORT_MOUSE_POSITION NCURSES_MOUSE_MASK(5, 0010L) - -#endif - -#define ALL_MOUSE_EVENTS (REPORT_MOUSE_POSITION - 1) - -/* macros to extract single event-bits from masks */ -#define BUTTON_RELEASE(e, x) ((e) & NCURSES_MOUSE_MASK(x, 001)) -#define BUTTON_PRESS(e, x) ((e) & NCURSES_MOUSE_MASK(x, 002)) -#define BUTTON_CLICK(e, x) ((e) & NCURSES_MOUSE_MASK(x, 004)) -#define BUTTON_DOUBLE_CLICK(e, x) ((e) & NCURSES_MOUSE_MASK(x, 010)) -#define BUTTON_TRIPLE_CLICK(e, x) ((e) & NCURSES_MOUSE_MASK(x, 020)) -#define BUTTON_RESERVED_EVENT(e, x) ((e) & NCURSES_MOUSE_MASK(x, 040)) - -typedef struct -{ - short id; /* ID to distinguish multiple devices */ - int x, y, z; /* event coordinates (character-cell) */ - mmask_t bstate; /* button state bits */ -} -MEVENT; - -extern NCURSES_EXPORT(bool) has_mouse(void); -extern NCURSES_EXPORT(int) getmouse (MEVENT *); -extern NCURSES_EXPORT(int) ungetmouse (MEVENT *); -extern NCURSES_EXPORT(mmask_t) mousemask (mmask_t, mmask_t *); -extern NCURSES_EXPORT(bool) wenclose (const WINDOW *, int, int); -extern NCURSES_EXPORT(int) mouseinterval (int); -extern NCURSES_EXPORT(bool) wmouse_trafo (const WINDOW*, int*, int*, bool); -extern NCURSES_EXPORT(bool) mouse_trafo (int*, int*, bool); /* generated */ - -#if NCURSES_SP_FUNCS -extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_mouse) (SCREEN*); -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(getmouse) (SCREEN*, MEVENT *); -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(ungetmouse) (SCREEN*,MEVENT *); -extern NCURSES_EXPORT(mmask_t) NCURSES_SP_NAME(mousemask) (SCREEN*, mmask_t, mmask_t *); -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(mouseinterval) (SCREEN*, int); -#endif - -#define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen) - -/* other non-XSI functions */ - -extern NCURSES_EXPORT(int) mcprint (char *, int); /* direct data to printer */ -extern NCURSES_EXPORT(int) has_key (int); /* do we have given key? */ - -#if NCURSES_SP_FUNCS -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(has_key) (SCREEN*, int); /* do we have given key? */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(mcprint) (SCREEN*, char *, int); /* direct data to printer */ -#endif - -/* Debugging : use with libncurses_g.a */ - -extern NCURSES_EXPORT(void) _tracef (const char *, ...) GCC_PRINTFLIKE(1,2); -extern NCURSES_EXPORT(void) _tracedump (const char *, WINDOW *); -extern NCURSES_EXPORT(char *) _traceattr (attr_t); -extern NCURSES_EXPORT(char *) _traceattr2 (int, chtype); -extern NCURSES_EXPORT(char *) _nc_tracebits (void); -extern NCURSES_EXPORT(char *) _tracechar (int); -extern NCURSES_EXPORT(char *) _tracechtype (chtype); -extern NCURSES_EXPORT(char *) _tracechtype2 (int, chtype); -#ifdef NCURSES_WIDECHAR -#define _tracech_t _tracecchar_t -extern NCURSES_EXPORT(char *) _tracecchar_t (const cchar_t *); -#define _tracech_t2 _tracecchar_t2 -extern NCURSES_EXPORT(char *) _tracecchar_t2 (int, const cchar_t *); -#else -#define _tracech_t _tracechtype -#define _tracech_t2 _tracechtype2 -#endif -extern NCURSES_EXPORT(char *) _tracemouse (const MEVENT *); -extern NCURSES_EXPORT(void) trace (const unsigned int); - -/* trace masks */ -#define TRACE_DISABLE 0x0000 /* turn off tracing */ -#define TRACE_TIMES 0x0001 /* trace user and system times of updates */ -#define TRACE_TPUTS 0x0002 /* trace tputs calls */ -#define TRACE_UPDATE 0x0004 /* trace update actions, old & new screens */ -#define TRACE_MOVE 0x0008 /* trace cursor moves and scrolls */ -#define TRACE_CHARPUT 0x0010 /* trace all character outputs */ -#define TRACE_ORDINARY 0x001F /* trace all update actions */ -#define TRACE_CALLS 0x0020 /* trace all curses calls */ -#define TRACE_VIRTPUT 0x0040 /* trace virtual character puts */ -#define TRACE_IEVENT 0x0080 /* trace low-level input processing */ -#define TRACE_BITS 0x0100 /* trace state of TTY control bits */ -#define TRACE_ICALLS 0x0200 /* trace internal/nested calls */ -#define TRACE_CCALLS 0x0400 /* trace per-character calls */ -#define TRACE_DATABASE 0x0800 /* trace read/write of terminfo/termcap data */ -#define TRACE_ATTRS 0x1000 /* trace attribute updates */ - -#define TRACE_SHIFT 13 /* number of bits in the trace masks */ -#define TRACE_MAXIMUM ((1 << TRACE_SHIFT) - 1) /* maximum trace level */ - -#if defined(TRACE) || defined(NCURSES_TEST) -extern NCURSES_EXPORT_VAR(int) _nc_optimize_enable; /* enable optimizations */ -extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *); -#define OPTIMIZE_MVCUR 0x01 /* cursor movement optimization */ -#define OPTIMIZE_HASHMAP 0x02 /* diff hashing to detect scrolls */ -#define OPTIMIZE_SCROLL 0x04 /* scroll optimization */ -#define OPTIMIZE_ALL 0xff /* enable all optimizations (dflt) */ -#endif - -#include - -#ifdef __cplusplus - -#ifndef NCURSES_NOMACROS - -/* these names conflict with STL */ -#undef box -#undef clear -#undef erase -#undef move -#undef refresh - -#endif /* NCURSES_NOMACROS */ - -} -#endif - -#endif /* __NCURSES_H */ diff --git a/windows/ncurses/include/ncurses/cursesapp.h b/windows/ncurses/include/ncurses/cursesapp.h deleted file mode 100644 index f619c1f04..000000000 --- a/windows/ncurses/include/ncurses/cursesapp.h +++ /dev/null @@ -1,176 +0,0 @@ -// * This makes emacs happy -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ - -/**************************************************************************** - * Author: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -// $Id: cursesapp.h,v 1.11 2005/05/28 21:57:44 tom Exp $ - -#ifndef NCURSES_CURSESAPP_H_incl -#define NCURSES_CURSESAPP_H_incl - -#include - -class NCURSES_IMPEXP NCursesApplication { -public: - typedef struct _slk_link { // This structure is used to maintain - struct _slk_link* prev; // a stack of SLKs - Soft_Label_Key_Set* SLKs; - } SLK_Link; -private: - static int rinit(NCursesWindow& w); // Internal Init function for title - static NCursesApplication* theApp; // Global ref. to the application - - static SLK_Link* slk_stack; - -protected: - static NCursesWindow* titleWindow; // The Title Window (if any) - - bool b_Colors; // Is this a color application? - NCursesWindow* Root_Window; // This is the stdscr equiv. - - // Initialization of attributes; - // Rewrite this in your derived class if you prefer other settings - virtual void init(bool bColors); - - // The number of lines for the title window. Default is no title window - // You may rewrite this in your derived class - virtual int titlesize() const { - return 0; - } - - // This method is called to put something into the title window initially - // You may rewrite this in your derived class - virtual void title() { - } - - // The layout used for the Soft Label Keys. Default is to have no SLKs. - // You may rewrite this in your derived class - virtual Soft_Label_Key_Set::Label_Layout useSLKs() const { - return Soft_Label_Key_Set::None; - } - - // This method is called to initialize the SLKs. Default is nothing. - // You may rewrite this in your derived class - virtual void init_labels(Soft_Label_Key_Set& S) const { - } - - // Your derived class must implement this method. The return value must - // be the exit value of your application. - virtual int run() = 0; - - // The constructor is protected, so you may use it in your derived - // class constructor. The argument tells whether or not you want colors. - NCursesApplication(bool wantColors = FALSE); - - NCursesApplication& operator=(const NCursesApplication& rhs) - { - if (this != &rhs) { - *this = rhs; - } - return *this; - } - - NCursesApplication(const NCursesApplication& rhs) - : b_Colors(rhs.b_Colors), - Root_Window(rhs.Root_Window) - { - } - -public: - virtual ~NCursesApplication(); - - // Get a pointer to the current application object - static NCursesApplication* getApplication() { - return theApp; - } - - // This method runs the application and returns its exit value - int operator()(void); - - // Process the commandline arguments. The default implementation simply - // ignores them. Your derived class may rewrite this. - virtual void handleArgs(int argc, char* argv[]) { - } - - // Does this application use colors? - inline bool useColors() const { - return b_Colors; - } - - // Push the Key Set S onto the SLK Stack. S then becomes the current set - // of Soft Labelled Keys. - void push(Soft_Label_Key_Set& S); - - // Throw away the current set of SLKs and make the previous one the - // new current set. - bool pop(); - - // Retrieve the current set of Soft Labelled Keys. - Soft_Label_Key_Set* top() const; - - // Attributes to use for menu and forms foregrounds - virtual chtype foregrounds() const { - return b_Colors ? COLOR_PAIR(1) : A_BOLD; - } - - // Attributes to use for menu and forms backgrounds - virtual chtype backgrounds() const { - return b_Colors ? COLOR_PAIR(2) : A_NORMAL; - } - - // Attributes to use for inactive (menu) elements - virtual chtype inactives() const { - return b_Colors ? (COLOR_PAIR(3)|A_DIM) : A_DIM; - } - - // Attributes to use for (form) labels and SLKs - virtual chtype labels() const { - return b_Colors ? COLOR_PAIR(4) : A_NORMAL; - } - - // Attributes to use for form backgrounds - virtual chtype dialog_backgrounds() const { - return b_Colors ? COLOR_PAIR(4) : A_NORMAL; - } - - // Attributes to use as default for (form) window backgrounds - virtual chtype window_backgrounds() const { - return b_Colors ? COLOR_PAIR(5) : A_NORMAL; - } - - // Attributes to use for the title window - virtual chtype screen_titles() const { - return b_Colors ? COLOR_PAIR(6) : A_BOLD; - } - -}; - -#endif /* NCURSES_CURSESAPP_H_incl */ diff --git a/windows/ncurses/include/ncurses/cursesf.h b/windows/ncurses/include/ncurses/cursesf.h deleted file mode 100644 index 215eb295d..000000000 --- a/windows/ncurses/include/ncurses/cursesf.h +++ /dev/null @@ -1,967 +0,0 @@ -// * This makes emacs happy -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ - -/**************************************************************************** - * Author: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -// $Id: cursesf.h,v 1.28 2005/08/13 18:08:24 tom Exp $ - -#ifndef NCURSES_CURSESF_H_incl -#define NCURSES_CURSESF_H_incl 1 - -#include - -#ifndef __EXT_QNX -#include -#endif - -extern "C" { -# include -} -// -// ------------------------------------------------------------------------- -// The abstract base class for buitin and user defined Fieldtypes. -// ------------------------------------------------------------------------- -// -class NCURSES_IMPEXP NCursesFormField; // forward declaration - -// Class to represent builtin field types as well as C++ written new -// fieldtypes (see classes UserDefineFieldType... -class NCURSES_IMPEXP NCursesFieldType -{ - friend class NCursesFormField; - -protected: - FIELDTYPE* fieldtype; - - inline void OnError(int err) const THROWS(NCursesFormException) { - if (err!=E_OK) - THROW(new NCursesFormException (err)); - } - - NCursesFieldType(FIELDTYPE *f) : fieldtype(f) { - } - - virtual ~NCursesFieldType() {} - - // Set the fields f fieldtype to this one. - virtual void set(NCursesFormField& f) = 0; - -public: - NCursesFieldType() - : fieldtype(STATIC_CAST(FIELDTYPE*)(0)) - { - } - - NCursesFieldType& operator=(const NCursesFieldType& rhs) - { - if (this != &rhs) { - *this = rhs; - } - return *this; - } - - NCursesFieldType(const NCursesFieldType& rhs) - : fieldtype(rhs.fieldtype) - { - } - -}; - -// -// ------------------------------------------------------------------------- -// The class representing a forms field, wrapping the lowlevel FIELD struct -// ------------------------------------------------------------------------- -// -class NCURSES_IMPEXP NCursesFormField -{ - friend class NCursesForm; - -protected: - FIELD *field; // lowlevel structure - NCursesFieldType* ftype; // Associated field type - - // Error handler - inline void OnError (int err) const THROWS(NCursesFormException) { - if (err != E_OK) - THROW(new NCursesFormException (err)); - } - -public: - // Create a 'Null' field. Can be used to delimit a field list - NCursesFormField() - : field(STATIC_CAST(FIELD*)(0)), - ftype(STATIC_CAST(NCursesFieldType*)(0)) - { - } - - // Create a new field - NCursesFormField (int rows, - int ncols, - int first_row = 0, - int first_col = 0, - int offscreen_rows = 0, - int additional_buffers = 0) - : field(0), - ftype(STATIC_CAST(NCursesFieldType*)(0)) - { - field = ::new_field(rows, ncols, first_row, first_col, - offscreen_rows, additional_buffers); - if (!field) - OnError(errno); - } - - NCursesFormField& operator=(const NCursesFormField& rhs) - { - if (this != &rhs) { - *this = rhs; - } - return *this; - } - - NCursesFormField(const NCursesFormField& rhs) - : field(rhs.field), ftype(rhs.ftype) - { - } - - virtual ~NCursesFormField (); - - // Duplicate the field at a new position - inline NCursesFormField* dup(int first_row, int first_col) - { - NCursesFormField* f = new NCursesFormField(); - if (!f) - OnError(E_SYSTEM_ERROR); - else { - f->ftype = ftype; - f->field = ::dup_field(field,first_row,first_col); - if (!f->field) - OnError(errno); - } - return f; - } - - // Link the field to a new location - inline NCursesFormField* link(int first_row, int first_col) { - NCursesFormField* f = new NCursesFormField(); - if (!f) - OnError(E_SYSTEM_ERROR); - else { - f->ftype = ftype; - f->field = ::link_field(field,first_row,first_col); - if (!f->field) - OnError(errno); - } - return f; - } - - // Get the lowlevel field representation - inline FIELD* get_field() const { - return field; - } - - // Retrieve info about the field - inline void info(int& rows, int& ncols, - int& first_row, int& first_col, - int& offscreen_rows, int& additional_buffers) const { - OnError(::field_info(field, &rows, &ncols, - &first_row, &first_col, - &offscreen_rows, &additional_buffers)); - } - - // Retrieve info about the fields dynamic properties. - inline void dynamic_info(int& dynamic_rows, int& dynamic_cols, - int& max_growth) const { - OnError(::dynamic_field_info(field, &dynamic_rows, &dynamic_cols, - &max_growth)); - } - - // For a dynamic field you may set the maximum growth limit. - // A zero means unlimited growth. - inline void set_maximum_growth(int growth = 0) { - OnError(::set_max_field(field,growth)); - } - - // Move the field to a new position - inline void move(int row, int col) { - OnError(::move_field(field,row,col)); - } - - // Mark the field to start a new page - inline void new_page(bool pageFlag = FALSE) { - OnError(::set_new_page(field,pageFlag)); - } - - // Retrieve whether or not the field starts a new page. - inline bool is_new_page() const { - return ::new_page(field); - } - - // Set the justification for the field - inline void set_justification(int just) { - OnError(::set_field_just(field,just)); - } - - // Retrieve the fields justification - inline int justification() const { - return ::field_just(field); - } - // Set the foreground attribute for the field - inline void set_foreground(chtype foreground) { - OnError(::set_field_fore(field,foreground)); - } - - // Retrieve the fields foreground attribute - inline chtype fore() const { - return ::field_fore(field); - } - - // Set the background attribute for the field - inline void set_background(chtype background) { - OnError(::set_field_back(field,background)); - } - - // Retrieve the fields background attribute - inline chtype back() const { - return ::field_back(field); - } - - // Set the padding character for the field - inline void set_pad_character(int padding) { - OnError(::set_field_pad(field, padding)); - } - - // Retrieve the fields padding character - inline int pad() const { - return ::field_pad(field); - } - - // Switch on the fields options - inline void options_on (Field_Options opts) { - OnError (::field_opts_on (field, opts)); - } - - // Switch off the fields options - inline void options_off (Field_Options opts) { - OnError (::field_opts_off (field, opts)); - } - - // Retrieve the fields options - inline Field_Options options () const { - return ::field_opts (field); - } - - // Set the fields options - inline void set_options (Field_Options opts) { - OnError (::set_field_opts (field, opts)); - } - - // Mark the field as changed - inline void set_changed(bool changeFlag = TRUE) { - OnError(::set_field_status(field,changeFlag)); - } - - // Test whether or not the field is marked as changed - inline bool changed() const { - return ::field_status(field); - } - - // Return the index of the field in the field array of a form - // or -1 if the field is not associated to a form - inline int (index)() const { - return ::field_index(field); - } - - // Store a value in a fields buffer. The default buffer is nr. 0 - inline void set_value(const char *val, int buffer = 0) { - OnError(::set_field_buffer(field,buffer,val)); - } - - // Retrieve the value of a fields buffer. The default buffer is nr. 0 - inline char* value(int buffer = 0) const { - return ::field_buffer(field,buffer); - } - - // Set the validation type of the field. - inline void set_fieldtype(NCursesFieldType& f) { - ftype = &f; - f.set(*this); // A good friend may do that... - } - - // Retrieve the validation type of the field. - inline NCursesFieldType* fieldtype() const { - return ftype; - } - -}; - - // This are the built-in hook functions in this C++ binding. In C++ we use - // virtual member functions (see below On_..._Init and On_..._Termination) - // to provide this functionality in an object oriented manner. -extern "C" { - void _nc_xx_frm_init(FORM *); - void _nc_xx_frm_term(FORM *); - void _nc_xx_fld_init(FORM *); - void _nc_xx_fld_term(FORM *); -} - -// -// ------------------------------------------------------------------------- -// The class representing a form, wrapping the lowlevel FORM struct -// ------------------------------------------------------------------------- -// -class NCURSES_IMPEXP NCursesForm : public NCursesPanel -{ -protected: - FORM* form; // the lowlevel structure - -private: - NCursesWindow* sub; // the subwindow object - bool b_sub_owner; // is this our own subwindow? - bool b_framed; // has the form a border? - bool b_autoDelete; // Delete fields when deleting form? - - NCursesFormField** my_fields; // The array of fields for this form - - // This structure is used for the form's user data field to link the - // FORM* to the C++ object and to provide extra space for a user pointer. - typedef struct { - void* m_user; // the pointer for the user's data - const NCursesForm* m_back; // backward pointer to C++ object - const FORM* m_owner; - } UserHook; - - // Get the backward pointer to the C++ object from a FORM - static inline NCursesForm* getHook(const FORM *f) { - UserHook* hook = reinterpret_cast(::form_userptr(f)); - assert(hook != 0 && hook->m_owner==f); - return const_cast(hook->m_back); - } - - friend void _nc_xx_frm_init(FORM *); - friend void _nc_xx_frm_term(FORM *); - friend void _nc_xx_fld_init(FORM *); - friend void _nc_xx_fld_term(FORM *); - - // Calculate FIELD* array for the menu - FIELD** mapFields(NCursesFormField* nfields[]); - -protected: - // internal routines - inline void set_user(void *user) { - UserHook* uptr = reinterpret_cast(::form_userptr (form)); - assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form); - uptr->m_user = user; - } - - inline void *get_user() { - UserHook* uptr = reinterpret_cast(::form_userptr (form)); - assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==form); - return uptr->m_user; - } - - void InitForm (NCursesFormField* Fields[], - bool with_frame, - bool autoDeleteFields); - - inline void OnError (int err) const THROWS(NCursesFormException) { - if (err != E_OK) - THROW(new NCursesFormException (err)); - } - - // this wraps the form_driver call. - virtual int driver (int c) ; - - // 'Internal' constructor, builds an object without association to a - // field array. - NCursesForm( int nlines, - int ncols, - int begin_y = 0, - int begin_x = 0) - : NCursesPanel(nlines, ncols, begin_y, begin_x), - form (STATIC_CAST(FORM*)(0)), - sub(0), - b_sub_owner(0), - b_framed(0), - b_autoDelete(0), - my_fields(0) - { - } - -public: - // Create form for the default panel. - NCursesForm (NCursesFormField* Fields[], - bool with_frame=FALSE, // reserve space for a frame? - bool autoDelete_Fields=FALSE) // do automatic cleanup? - : NCursesPanel(), - form(0), - sub(0), - b_sub_owner(0), - b_framed(0), - b_autoDelete(0), - my_fields(0) - { - InitForm(Fields, with_frame, autoDelete_Fields); - } - - // Create a form in a panel with the given position and size. - NCursesForm (NCursesFormField* Fields[], - int nlines, - int ncols, - int begin_y, - int begin_x, - bool with_frame=FALSE, // reserve space for a frame? - bool autoDelete_Fields=FALSE) // do automatic cleanup? - : NCursesPanel(nlines, ncols, begin_y, begin_x), - form(0), - sub(0), - b_sub_owner(0), - b_framed(0), - b_autoDelete(0), - my_fields(0) - { - InitForm(Fields, with_frame, autoDelete_Fields); - } - - NCursesForm& operator=(const NCursesForm& rhs) - { - if (this != &rhs) { - *this = rhs; - NCursesPanel::operator=(rhs); - } - return *this; - } - - NCursesForm(const NCursesForm& rhs) - : NCursesPanel(rhs), - form(rhs.form), - sub(rhs.sub), - b_sub_owner(rhs.b_sub_owner), - b_framed(rhs.b_framed), - b_autoDelete(rhs.b_autoDelete), - my_fields(rhs.my_fields) - { - } - - virtual ~NCursesForm(); - - // Set the default attributes for the form - virtual void setDefaultAttributes(); - - // Retrieve current field of the form. - inline NCursesFormField* current_field() const { - return my_fields[::field_index(::current_field(form))]; - } - - // Set the forms subwindow - void setSubWindow(NCursesWindow& sub); - - // Set these fields for the form - inline void setFields(NCursesFormField* Fields[]) { - OnError(::set_form_fields(form,mapFields(Fields))); - } - - // Remove the form from the screen - inline void unpost (void) { - OnError (::unpost_form (form)); - } - - // Post the form to the screen if flag is true, unpost it otherwise - inline void post(bool flag = TRUE) { - OnError (flag ? ::post_form(form) : ::unpost_form (form)); - } - - // Decorations - inline void frame(const char *title=NULL, const char* btitle=NULL) { - if (b_framed) - NCursesPanel::frame(title,btitle); - else - OnError(E_SYSTEM_ERROR); - } - - inline void boldframe(const char *title=NULL, const char* btitle=NULL) { - if (b_framed) - NCursesPanel::boldframe(title,btitle); - else - OnError(E_SYSTEM_ERROR); - } - - inline void label(const char *topLabel, const char *bottomLabel) { - if (b_framed) - NCursesPanel::label(topLabel,bottomLabel); - else - OnError(E_SYSTEM_ERROR); - } - - // ----- - // Hooks - // ----- - - // Called after the form gets repositioned in its window. - // This is especially true if the form is posted. - virtual void On_Form_Init(); - - // Called before the form gets repositioned in its window. - // This is especially true if the form is unposted. - virtual void On_Form_Termination(); - - // Called after the field became the current field - virtual void On_Field_Init(NCursesFormField& field); - - // Called before this field is left as current field. - virtual void On_Field_Termination(NCursesFormField& field); - - // Calculate required window size for the form. - void scale(int& rows, int& ncols) const { - OnError(::scale_form(form,&rows,&ncols)); - } - - // Retrieve number of fields in the form. - int count() const { - return ::field_count(form); - } - - // Make the page the current page of the form. - void set_page(int pageNum) { - OnError(::set_form_page(form, pageNum)); - } - - // Retrieve current page number - int page() const { - return ::form_page(form); - } - - // Switch on the forms options - inline void options_on (Form_Options opts) { - OnError (::form_opts_on (form, opts)); - } - - // Switch off the forms options - inline void options_off (Form_Options opts) { - OnError (::form_opts_off (form, opts)); - } - - // Retrieve the forms options - inline Form_Options options () const { - return ::form_opts (form); - } - - // Set the forms options - inline void set_options (Form_Options opts) { - OnError (::set_form_opts (form, opts)); - } - - // Are there more data in the current field after the data shown - inline bool data_ahead() const { - return ::data_ahead(form); - } - - // Are there more data in the current field before the data shown - inline bool data_behind() const { - return ::data_behind(form); - } - - // Position the cursor to the current field - inline void position_cursor () { - OnError (::pos_form_cursor (form)); - } - // Set the current field - inline void set_current(NCursesFormField& F) { - OnError (::set_current_field(form, F.field)); - } - - // Provide a default key virtualization. Translate the keyboard - // code c into a form request code. - // The default implementation provides a hopefully straightforward - // mapping for the most common keystrokes and form requests. - virtual int virtualize(int c); - - // Operators - inline NCursesFormField* operator[](int i) const { - if ( (i < 0) || (i >= ::field_count (form)) ) - OnError (E_BAD_ARGUMENT); - return my_fields[i]; - } - - // Perform the menu's operation - // Return the field where you left the form. - virtual NCursesFormField* operator()(void); - - // Exception handlers. The default is a Beep. - virtual void On_Request_Denied(int c) const; - virtual void On_Invalid_Field(int c) const; - virtual void On_Unknown_Command(int c) const; - -}; - -// -// ------------------------------------------------------------------------- -// This is the typical C++ typesafe way to allow to attach -// user data to a field of a form. Its assumed that the user -// data belongs to some class T. Use T as template argument -// to create a UserField. -// ------------------------------------------------------------------------- -template class NCURSES_IMPEXP NCursesUserField : public NCursesFormField -{ -public: - NCursesUserField (int rows, - int ncols, - int first_row = 0, - int first_col = 0, - const T* p_UserData = STATIC_CAST(T*)(0), - int offscreen_rows = 0, - int additional_buffers = 0) - : NCursesFormField (rows, ncols, - first_row, first_col, - offscreen_rows, additional_buffers) { - if (field) - OnError(::set_field_userptr(field, STATIC_CAST(void *)(p_UserData))); - } - - virtual ~NCursesUserField() {}; - - inline const T* UserData (void) const { - return reinterpret_cast(::field_userptr (field)); - } - - inline virtual void setUserData(const T* p_UserData) { - if (field) - OnError (::set_field_userptr (field, STATIC_CAST(void *)(p_UserData))); - } -}; -// -// ------------------------------------------------------------------------- -// The same mechanism is used to attach user data to a form -// ------------------------------------------------------------------------- -// -template class NCURSES_IMPEXP NCursesUserForm : public NCursesForm -{ -protected: - // 'Internal' constructor, builds an object without association to a - // field array. - NCursesUserForm( int nlines, - int ncols, - int begin_y = 0, - int begin_x = 0, - const T* p_UserData = STATIC_CAST(T*)(0)) - : NCursesForm(nlines,ncols,begin_y,begin_x) { - if (form) - set_user (const_cast(p_UserData)); - } - -public: - NCursesUserForm (NCursesFormField Fields[], - const T* p_UserData = STATIC_CAST(T*)(0), - bool with_frame=FALSE, - bool autoDelete_Fields=FALSE) - : NCursesForm (Fields, with_frame, autoDelete_Fields) { - if (form) - set_user (const_cast(p_UserData)); - }; - - NCursesUserForm (NCursesFormField Fields[], - int nlines, - int ncols, - int begin_y = 0, - int begin_x = 0, - const T* p_UserData = STATIC_CAST(T*)(0), - bool with_frame=FALSE, - bool autoDelete_Fields=FALSE) - : NCursesForm (Fields, nlines, ncols, begin_y, begin_x, - with_frame, autoDelete_Fields) { - if (form) - set_user (const_cast(p_UserData)); - }; - - virtual ~NCursesUserForm() { - }; - - inline T* UserData (void) const { - return reinterpret_cast(get_user ()); - }; - - inline virtual void setUserData (const T* p_UserData) { - if (form) - set_user (const_cast(p_UserData)); - } - -}; -// -// ------------------------------------------------------------------------- -// Builtin Fieldtypes -// ------------------------------------------------------------------------- -// -class NCURSES_IMPEXP Alpha_Field : public NCursesFieldType -{ -private: - int min_field_width; - - void set(NCursesFormField& f) { - OnError(::set_field_type(f.get_field(),fieldtype,min_field_width)); - } - -public: - Alpha_Field(int width) - : NCursesFieldType(TYPE_ALPHA), - min_field_width(width) { - } -}; - -class NCURSES_IMPEXP Alphanumeric_Field : public NCursesFieldType -{ -private: - int min_field_width; - - void set(NCursesFormField& f) { - OnError(::set_field_type(f.get_field(),fieldtype,min_field_width)); - } - -public: - Alphanumeric_Field(int width) - : NCursesFieldType(TYPE_ALNUM), - min_field_width(width) { - } -}; - -class NCURSES_IMPEXP Integer_Field : public NCursesFieldType -{ -private: - int precision; - long lower_limit, upper_limit; - - void set(NCursesFormField& f) { - OnError(::set_field_type(f.get_field(),fieldtype, - precision,lower_limit,upper_limit)); - } - -public: - Integer_Field(int prec, long low=0L, long high=0L) - : NCursesFieldType(TYPE_INTEGER), - precision(prec), lower_limit(low), upper_limit(high) { - } -}; - -class NCURSES_IMPEXP Numeric_Field : public NCursesFieldType -{ -private: - int precision; - double lower_limit, upper_limit; - - void set(NCursesFormField& f) { - OnError(::set_field_type(f.get_field(),fieldtype, - precision,lower_limit,upper_limit)); - } - -public: - Numeric_Field(int prec, double low=0.0, double high=0.0) - : NCursesFieldType(TYPE_NUMERIC), - precision(prec), lower_limit(low), upper_limit(high) { - } -}; - -class NCURSES_IMPEXP Regular_Expression_Field : public NCursesFieldType -{ -private: - char* regex; - - void set(NCursesFormField& f) { - OnError(::set_field_type(f.get_field(),fieldtype,regex)); - } - - void copy_regex(const char *source) - { - regex = new char[1 + ::strlen(source)]; - (::strcpy)(regex, source); - } - -public: - Regular_Expression_Field(const char *expr) - : NCursesFieldType(TYPE_REGEXP), - regex(NULL) - { - copy_regex(expr); - } - - Regular_Expression_Field& operator=(const Regular_Expression_Field& rhs) - { - if (this != &rhs) { - *this = rhs; - copy_regex(rhs.regex); - NCursesFieldType::operator=(rhs); - } - return *this; - } - - Regular_Expression_Field(const Regular_Expression_Field& rhs) - : NCursesFieldType(rhs), - regex(NULL) - { - copy_regex(rhs.regex); - } - - ~Regular_Expression_Field() { - delete[] regex; - } -}; - -class NCURSES_IMPEXP Enumeration_Field : public NCursesFieldType -{ -private: - const char** list; - int case_sensitive; - int non_unique_matches; - - void set(NCursesFormField& f) { - OnError(::set_field_type(f.get_field(),fieldtype, - list,case_sensitive,non_unique_matches)); - } -public: - Enumeration_Field(const char* enums[], - bool case_sens=FALSE, - bool non_unique=FALSE) - : NCursesFieldType(TYPE_ENUM), - list(enums), - case_sensitive(case_sens ? -1 : 0), - non_unique_matches(non_unique ? -1 : 0) { - } - - Enumeration_Field& operator=(const Enumeration_Field& rhs) - { - if (this != &rhs) { - *this = rhs; - NCursesFieldType::operator=(rhs); - } - return *this; - } - - Enumeration_Field(const Enumeration_Field& rhs) - : NCursesFieldType(rhs), - list(rhs.list), - case_sensitive(rhs.case_sensitive), - non_unique_matches(rhs.non_unique_matches) - { - } -}; - -class NCURSES_IMPEXP IPV4_Address_Field : public NCursesFieldType -{ -private: - void set(NCursesFormField& f) { - OnError(::set_field_type(f.get_field(),fieldtype)); - } - -public: - IPV4_Address_Field() : NCursesFieldType(TYPE_IPV4) { - } -}; - -extern "C" { - bool _nc_xx_fld_fcheck(FIELD *, const void*); - bool _nc_xx_fld_ccheck(int c, const void *); - void* _nc_xx_fld_makearg(va_list*); -} - -// -// ------------------------------------------------------------------------- -// Abstract base class for User-Defined Fieldtypes -// ------------------------------------------------------------------------- -// -class NCURSES_IMPEXP UserDefinedFieldType : public NCursesFieldType -{ - friend class UDF_Init; // Internal helper to set up statics -private: - // For all C++ defined fieldtypes we need only one generic lowlevel - // FIELDTYPE* element. - static FIELDTYPE* generic_fieldtype; - -protected: - // This are the functions required by the low level libforms functions - // to construct a fieldtype. - friend bool _nc_xx_fld_fcheck(FIELD *, const void*); - friend bool _nc_xx_fld_ccheck(int c, const void *); - friend void* _nc_xx_fld_makearg(va_list*); - - void set(NCursesFormField& f) { - OnError(::set_field_type(f.get_field(),fieldtype,&f)); - } - -protected: - // Redefine this function to do a field validation. The argument - // is a reference to the field you should validate. - virtual bool field_check(NCursesFormField& f) = 0; - - // Redefine this function to do a character validation. The argument - // is the character to be validated. - virtual bool char_check (int c) = 0; - -public: - UserDefinedFieldType() : NCursesFieldType(generic_fieldtype) { - } -}; - -extern "C" { - bool _nc_xx_next_choice(FIELD*, const void *); - bool _nc_xx_prev_choice(FIELD*, const void *); -} - -// -// ------------------------------------------------------------------------- -// Abstract base class for User-Defined Fieldtypes with Choice functions -// ------------------------------------------------------------------------- -// -class NCURSES_IMPEXP UserDefinedFieldType_With_Choice : public UserDefinedFieldType -{ - friend class UDF_Init; // Internal helper to set up statics -private: - // For all C++ defined fieldtypes with choice functions we need only one - // generic lowlevel FIELDTYPE* element. - static FIELDTYPE* generic_fieldtype_with_choice; - - // This are the functions required by the low level libforms functions - // to construct a fieldtype with choice functions. - friend bool _nc_xx_next_choice(FIELD*, const void *); - friend bool _nc_xx_prev_choice(FIELD*, const void *); - -protected: - // Redefine this function to do the retrieval of the next choice value. - // The argument is a reference to the field tobe examined. - virtual bool next (NCursesFormField& f) = 0; - - // Redefine this function to do the retrieval of the previous choice value. - // The argument is a reference to the field tobe examined. - virtual bool previous(NCursesFormField& f) = 0; - -public: - UserDefinedFieldType_With_Choice() { - fieldtype = generic_fieldtype_with_choice; - } -}; - -#endif /* NCURSES_CURSESF_H_incl */ diff --git a/windows/ncurses/include/ncurses/cursesm.h b/windows/ncurses/include/ncurses/cursesm.h deleted file mode 100644 index 8e0e2c66c..000000000 --- a/windows/ncurses/include/ncurses/cursesm.h +++ /dev/null @@ -1,672 +0,0 @@ -// * This makes emacs happy -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ - -/**************************************************************************** - * Author: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -// $Id: cursesm.h,v 1.25 2005/08/13 18:10:36 tom Exp $ - -#ifndef NCURSES_CURSESM_H_incl -#define NCURSES_CURSESM_H_incl 1 - -#include - -extern "C" { -# include -} -// -// ------------------------------------------------------------------------- -// This wraps the ITEM type of -// ------------------------------------------------------------------------- -// -class NCURSES_IMPEXP NCursesMenuItem -{ - friend class NCursesMenu; - -protected: - ITEM *item; - - inline void OnError (int err) const THROWS(NCursesMenuException) { - if (err != E_OK) - THROW(new NCursesMenuException (err)); - } - -public: - NCursesMenuItem (const char* p_name = NULL, - const char* p_descript = NULL) - : item(0) - { - item = p_name ? ::new_item (p_name, p_descript) : STATIC_CAST(ITEM*)(0); - if (p_name && !item) - OnError (E_SYSTEM_ERROR); - } - // Create an item. If you pass both parameters as NULL, a delimiting - // item is constructed which can be used to terminate a list of - // NCursesMenu objects. - - NCursesMenuItem& operator=(const NCursesMenuItem& rhs) - { - if (this != &rhs) { - *this = rhs; - } - return *this; - } - - NCursesMenuItem(const NCursesMenuItem& rhs) - : item(0) - { - } - - virtual ~NCursesMenuItem (); - // Release the items memory - - inline const char* name () const { - return ::item_name (item); - } - // Name of the item - - inline const char* description () const { - return ::item_description (item); - } - // Description of the item - - inline int (index) (void) const { - return ::item_index (item); - } - // Index of the item in an item array (or -1) - - inline void options_on (Item_Options opts) { - OnError (::item_opts_on (item, opts)); - } - // Switch on the items options - - inline void options_off (Item_Options opts) { - OnError (::item_opts_off (item, opts)); - } - // Switch off the item's option - - inline Item_Options options () const { - return ::item_opts (item); - } - // Retrieve the items options - - inline void set_options (Item_Options opts) { - OnError (::set_item_opts (item, opts)); - } - // Set the items options - - inline void set_value (bool f) { - OnError (::set_item_value (item,f)); - } - // Set/Reset the items selection state - - inline bool value () const { - return ::item_value (item); - } - // Retrieve the items selection state - - inline bool visible () const { - return ::item_visible (item); - } - // Retrieve visibility of the item - - virtual bool action(); - // Perform an action associated with this item; you may use this in an - // user supplied driver for a menu; you may derive from this class and - // overload action() to supply items with different actions. - // If an action returns true, the menu will be exited. The default action - // is to do nothing. -}; - -// Prototype for an items callback function. -typedef bool ITEMCALLBACK(NCursesMenuItem&); - -// If you don't like to create a child class for individual items to -// overload action(), you may use this class and provide a callback -// function pointer for items. -class NCURSES_IMPEXP NCursesMenuCallbackItem : public NCursesMenuItem -{ -private: - ITEMCALLBACK* p_fct; - -public: - NCursesMenuCallbackItem(ITEMCALLBACK* fct = NULL, - const char* p_name = NULL, - const char* p_descript = NULL ) - : NCursesMenuItem (p_name, p_descript), - p_fct (fct) { - } - - NCursesMenuCallbackItem& operator=(const NCursesMenuCallbackItem& rhs) - { - if (this != &rhs) { - *this = rhs; - } - return *this; - } - - NCursesMenuCallbackItem(const NCursesMenuCallbackItem& rhs) - : NCursesMenuItem(rhs), - p_fct(0) - { - } - - virtual ~NCursesMenuCallbackItem(); - - bool action(); -}; - - // This are the built-in hook functions in this C++ binding. In C++ we use - // virtual member functions (see below On_..._Init and On_..._Termination) - // to provide this functionality in an object oriented manner. -extern "C" { - void _nc_xx_mnu_init(MENU *); - void _nc_xx_mnu_term(MENU *); - void _nc_xx_itm_init(MENU *); - void _nc_xx_itm_term(MENU *); -} - -// -// ------------------------------------------------------------------------- -// This wraps the MENU type of -// ------------------------------------------------------------------------- -// -class NCURSES_IMPEXP NCursesMenu : public NCursesPanel -{ -protected: - MENU *menu; - -private: - NCursesWindow* sub; // the subwindow object - bool b_sub_owner; // is this our own subwindow? - bool b_framed; // has the menu a border? - bool b_autoDelete; // Delete items when deleting menu? - - NCursesMenuItem** my_items; // The array of items for this menu - - // This structure is used for the menu's user data field to link the - // MENU* to the C++ object and to provide extra space for a user pointer. - typedef struct { - void* m_user; // the pointer for the user's data - const NCursesMenu* m_back; // backward pointer to C++ object - const MENU* m_owner; - } UserHook; - - // Get the backward pointer to the C++ object from a MENU - static inline NCursesMenu* getHook(const MENU *m) { - UserHook* hook = STATIC_CAST(UserHook*)(::menu_userptr(m)); - assert(hook != 0 && hook->m_owner==m); - return const_cast(hook->m_back); - } - - friend void _nc_xx_mnu_init(MENU *); - friend void _nc_xx_mnu_term(MENU *); - friend void _nc_xx_itm_init(MENU *); - friend void _nc_xx_itm_term(MENU *); - - // Calculate ITEM* array for the menu - ITEM** mapItems(NCursesMenuItem* nitems[]); - -protected: - // internal routines - inline void set_user(void *user) { - UserHook* uptr = STATIC_CAST(UserHook*)(::menu_userptr (menu)); - assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu); - uptr->m_user = user; - } - - inline void *get_user() { - UserHook* uptr = STATIC_CAST(UserHook*)(::menu_userptr (menu)); - assert (uptr != 0 && uptr->m_back==this && uptr->m_owner==menu); - return uptr->m_user; - } - - void InitMenu (NCursesMenuItem* menu[], - bool with_frame, - bool autoDeleteItems); - - inline void OnError (int err) const THROWS(NCursesMenuException) { - if (err != E_OK) - THROW(new NCursesMenuException (this, err)); - } - - // this wraps the menu_driver call. - virtual int driver (int c) ; - - // 'Internal' constructor to create a menu without association to - // an array of items. - NCursesMenu( int nlines, - int ncols, - int begin_y = 0, - int begin_x = 0) - : NCursesPanel(nlines,ncols,begin_y,begin_x), - menu (STATIC_CAST(MENU*)(0)), - sub(0), - b_sub_owner(0), - b_framed(0), - b_autoDelete(0), - my_items(0) - { - } - -public: - // Make a full window size menu - NCursesMenu (NCursesMenuItem* Items[], - bool with_frame=FALSE, // Reserve space for a frame? - bool autoDelete_Items=FALSE) // Autocleanup of Items? - : NCursesPanel(), - menu(0), - sub(0), - b_sub_owner(0), - b_framed(0), - b_autoDelete(0), - my_items(0) - { - InitMenu(Items, with_frame, autoDelete_Items); - } - - // Make a menu with a window of this size. - NCursesMenu (NCursesMenuItem* Items[], - int nlines, - int ncols, - int begin_y = 0, - int begin_x = 0, - bool with_frame=FALSE, // Reserve space for a frame? - bool autoDelete_Items=FALSE) // Autocleanup of Items? - : NCursesPanel(nlines, ncols, begin_y, begin_x), - menu(0), - sub(0), - b_sub_owner(0), - b_framed(0), - b_autoDelete(0), - my_items(0) - { - InitMenu(Items, with_frame, autoDelete_Items); - } - - NCursesMenu& operator=(const NCursesMenu& rhs) - { - if (this != &rhs) { - *this = rhs; - NCursesPanel::operator=(rhs); - } - return *this; - } - - NCursesMenu(const NCursesMenu& rhs) - : NCursesPanel(rhs), - menu(rhs.menu), - sub(rhs.sub), - b_sub_owner(rhs.b_sub_owner), - b_framed(rhs.b_framed), - b_autoDelete(rhs.b_autoDelete), - my_items(rhs.my_items) - { - } - - virtual ~NCursesMenu (); - - // Retrieve the menus subwindow - inline NCursesWindow& subWindow() const { - assert(sub!=NULL); - return *sub; - } - - // Set the menus subwindow - void setSubWindow(NCursesWindow& sub); - - // Set these items for the menu - inline void setItems(NCursesMenuItem* Items[]) { - OnError(::set_menu_items(menu,mapItems(Items))); - } - - // Remove the menu from the screen - inline void unpost (void) { - OnError (::unpost_menu (menu)); - } - - // Post the menu to the screen if flag is true, unpost it otherwise - inline void post(bool flag = TRUE) { - flag ? OnError (::post_menu(menu)) : OnError (::unpost_menu (menu)); - } - - // Get the numer of rows and columns for this menu - inline void scale (int& mrows, int& mcols) const { - OnError (::scale_menu (menu, &mrows, &mcols)); - } - - // Set the format of this menu - inline void set_format(int mrows, int mcols) { - OnError (::set_menu_format(menu, mrows, mcols)); - } - - // Get the format of this menu - inline void menu_format(int& rows,int& ncols) { - ::menu_format(menu,&rows,&ncols); - } - - // Items of the menu - inline NCursesMenuItem* items() const { - return *my_items; - } - - // Get the number of items in this menu - inline int count() const { - return ::item_count(menu); - } - - // Get the current item (i.e. the one the cursor is located) - inline NCursesMenuItem* current_item() const { - return my_items[::item_index(::current_item(menu))]; - } - - // Get the marker string - inline const char* mark() const { - return ::menu_mark(menu); - } - - // Set the marker string - inline void set_mark(const char *marker) { - OnError (::set_menu_mark (menu, marker)); - } - - // Get the name of the request code c - inline static const char* request_name(int c) { - return ::menu_request_name(c); - } - - // Get the current pattern - inline char* pattern() const { - return ::menu_pattern(menu); - } - - // true if there is a pattern match, false otherwise. - bool set_pattern (const char *pat); - - // set the default attributes for the menu - // i.e. set fore, back and grey attribute - virtual void setDefaultAttributes(); - - // Get the menus background attributes - inline chtype back() const { - return ::menu_back(menu); - } - - // Get the menus foreground attributes - inline chtype fore() const { - return ::menu_fore(menu); - } - - // Get the menus grey attributes (used for unselectable items) - inline chtype grey() const { - return ::menu_grey(menu); - } - - // Set the menus background attributes - inline chtype set_background(chtype a) { - return ::set_menu_back(menu,a); - } - - // Set the menus foreground attributes - inline chtype set_foreground(chtype a) { - return ::set_menu_fore(menu,a); - } - - // Set the menus grey attributes (used for unselectable items) - inline chtype set_grey(chtype a) { - return ::set_menu_grey(menu,a); - } - - inline void options_on (Menu_Options opts) { - OnError (::menu_opts_on (menu,opts)); - } - - inline void options_off(Menu_Options opts) { - OnError (::menu_opts_off(menu,opts)); - } - - inline Menu_Options options() const { - return ::menu_opts(menu); - } - - inline void set_options (Menu_Options opts) { - OnError (::set_menu_opts (menu,opts)); - } - - inline int pad() const { - return ::menu_pad(menu); - } - - inline void set_pad (int padch) { - OnError (::set_menu_pad (menu, padch)); - } - - // Position the cursor to the current item - inline void position_cursor () const { - OnError (::pos_menu_cursor (menu)); - } - - // Set the current item - inline void set_current(NCursesMenuItem& I) { - OnError (::set_current_item(menu, I.item)); - } - - // Get the current top row of the menu - inline int top_row (void) const { - return ::top_row (menu); - } - - // Set the current top row of the menu - inline void set_top_row (int row) { - OnError (::set_top_row (menu, row)); - } - - // spacing control - // Set the spacing for the menu - inline void setSpacing(int spc_description, - int spc_rows, - int spc_columns) { - OnError(::set_menu_spacing(menu, - spc_description, - spc_rows, - spc_columns)); - } - - // Get the spacing info for the menu - inline void Spacing(int& spc_description, - int& spc_rows, - int& spc_columns) const { - OnError(::menu_spacing(menu, - &spc_description, - &spc_rows, - &spc_columns)); - } - - // Decorations - inline void frame(const char *title=NULL, const char* btitle=NULL) { - if (b_framed) - NCursesPanel::frame(title,btitle); - else - OnError(E_SYSTEM_ERROR); - } - - inline void boldframe(const char *title=NULL, const char* btitle=NULL) { - if (b_framed) - NCursesPanel::boldframe(title,btitle); - else - OnError(E_SYSTEM_ERROR); - } - - inline void label(const char *topLabel, const char *bottomLabel) { - if (b_framed) - NCursesPanel::label(topLabel,bottomLabel); - else - OnError(E_SYSTEM_ERROR); - } - - // ----- - // Hooks - // ----- - - // Called after the menu gets repositioned in its window. - // This is especially true if the menu is posted. - virtual void On_Menu_Init(); - - // Called before the menu gets repositioned in its window. - // This is especially true if the menu is unposted. - virtual void On_Menu_Termination(); - - // Called after the item became the current item - virtual void On_Item_Init(NCursesMenuItem& item); - - // Called before this item is left as current item. - virtual void On_Item_Termination(NCursesMenuItem& item); - - // Provide a default key virtualization. Translate the keyboard - // code c into a menu request code. - // The default implementation provides a hopefully straightforward - // mapping for the most common keystrokes and menu requests. - virtual int virtualize(int c); - - - // Operators - inline NCursesMenuItem* operator[](int i) const { - if ( (i < 0) || (i >= ::item_count (menu)) ) - OnError (E_BAD_ARGUMENT); - return (my_items[i]); - } - - // Perform the menu's operation - // Return the item where you left the selection mark for a single - // selection menu, or NULL for a multivalued menu. - virtual NCursesMenuItem* operator()(void); - - // -------------------- - // Exception handlers - // Called by operator() - // -------------------- - - // Called if the request is denied - virtual void On_Request_Denied(int c) const; - - // Called if the item is not selectable - virtual void On_Not_Selectable(int c) const; - - // Called if pattern doesn't match - virtual void On_No_Match(int c) const; - - // Called if the command is unknown - virtual void On_Unknown_Command(int c) const; - -}; -// -// ------------------------------------------------------------------------- -// This is the typical C++ typesafe way to allow to attach -// user data to an item of a menu. Its assumed that the user -// data belongs to some class T. Use T as template argument -// to create a UserItem. -// ------------------------------------------------------------------------- -// -template class NCURSES_IMPEXP NCursesUserItem : public NCursesMenuItem -{ -public: - NCursesUserItem (const char* p_name, - const char* p_descript = NULL, - const T* p_UserData = STATIC_CAST(T*)(0)) - : NCursesMenuItem (p_name, p_descript) { - if (item) - OnError (::set_item_userptr (item, const_cast(reinterpret_cast(p_UserData)))); - } - - virtual ~NCursesUserItem() {} - - inline const T* UserData (void) const { - return reinterpret_cast(::item_userptr (item)); - }; - - inline virtual void setUserData(const T* p_UserData) { - if (item) - OnError (::set_item_userptr (item, const_cast(reinterpret_cast(p_UserData)))); - } -}; -// -// ------------------------------------------------------------------------- -// The same mechanism is used to attach user data to a menu -// ------------------------------------------------------------------------- -// -template class NCURSES_IMPEXP NCursesUserMenu : public NCursesMenu -{ -protected: - NCursesUserMenu( int nlines, - int ncols, - int begin_y = 0, - int begin_x = 0, - const T* p_UserData = STATIC_CAST(T*)(0)) - : NCursesMenu(nlines,ncols,begin_y,begin_x) { - if (menu) - set_user (const_cast(p_UserData)); - } - -public: - NCursesUserMenu (NCursesMenuItem Items[], - const T* p_UserData = STATIC_CAST(T*)(0), - bool with_frame=FALSE, - bool autoDelete_Items=FALSE) - : NCursesMenu (Items, with_frame, autoDelete_Items) { - if (menu) - set_user (const_cast(p_UserData)); - }; - - NCursesUserMenu (NCursesMenuItem Items[], - int nlines, - int ncols, - int begin_y = 0, - int begin_x = 0, - const T* p_UserData = STATIC_CAST(T*)(0), - bool with_frame=FALSE) - : NCursesMenu (Items, nlines, ncols, begin_y, begin_x, with_frame) { - if (menu) - set_user (const_cast(p_UserData)); - }; - - virtual ~NCursesUserMenu() { - }; - - inline T* UserData (void) const { - return reinterpret_cast(get_user ()); - }; - - inline virtual void setUserData (const T* p_UserData) { - if (menu) - set_user (const_cast(p_UserData)); - } -}; - -#endif /* NCURSES_CURSESM_H_incl */ diff --git a/windows/ncurses/include/ncurses/cursesp.h b/windows/ncurses/include/ncurses/cursesp.h deleted file mode 100644 index 720f999d0..000000000 --- a/windows/ncurses/include/ncurses/cursesp.h +++ /dev/null @@ -1,268 +0,0 @@ -// * This makes emacs happy -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ - -/**************************************************************************** - * Author: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -#ifndef NCURSES_CURSESP_H_incl -#define NCURSES_CURSESP_H_incl 1 - -// $Id: cursesp.h,v 1.29 2008/08/16 17:20:23 tom Exp $ - -#include - -extern "C" { -# include -} - -class NCURSES_IMPEXP NCursesPanel - : public NCursesWindow -{ -protected: - PANEL *p; - static NCursesPanel *dummy; - -private: - // This structure is used for the panel's user data field to link the - // PANEL* to the C++ object and to provide extra space for a user pointer. - typedef struct { - void* m_user; // the pointer for the user's data - const NCursesPanel* m_back; // backward pointer to C++ object - const PANEL* m_owner; // the panel itself - } UserHook; - - inline UserHook *UserPointer() - { - UserHook* uptr = reinterpret_cast( - const_cast(::panel_userptr (p))); - return uptr; - } - - void init(); // Initialize the panel object - -protected: - void set_user(void *user) - { - UserHook* uptr = UserPointer(); - if (uptr != 0 && uptr->m_back==this && uptr->m_owner==p) { - uptr->m_user = user; - } - } - // Set the user pointer of the panel. - - void *get_user() - { - UserHook* uptr = UserPointer(); - void *result = 0; - if (uptr != 0 && uptr->m_back==this && uptr->m_owner==p) - result = uptr->m_user; - return result; - } - - void OnError (int err) const THROWS(NCursesPanelException) - { - if (err==ERR) - THROW(new NCursesPanelException (this, err)); - } - // If err is equal to the curses error indicator ERR, an error handler - // is called. - - // Get a keystroke. Default implementation calls getch() - virtual int getKey(void); - -public: - NCursesPanel(int nlines, - int ncols, - int begin_y = 0, - int begin_x = 0) - : NCursesWindow(nlines,ncols,begin_y,begin_x), p(0) - { - init(); - } - // Create a panel with this size starting at the requested position. - - NCursesPanel() - : NCursesWindow(::stdscr), p(0) - { - init(); - } - // This constructor creates the default Panel associated with the - // ::stdscr window - - NCursesPanel& operator=(const NCursesPanel& rhs) - { - if (this != &rhs) { - *this = rhs; - NCursesWindow::operator=(rhs); - } - return *this; - } - - NCursesPanel(const NCursesPanel& rhs) - : NCursesWindow(rhs), - p(rhs.p) - { - } - - virtual ~NCursesPanel(); - - // basic manipulation - inline void hide() - { - OnError (::hide_panel(p)); - } - // Hide the panel. It stays in the stack but becomes invisible. - - inline void show() - { - OnError (::show_panel(p)); - } - // Show the panel, i.e. make it visible. - - inline void top() - { - OnError (::top_panel(p)); - } - // Make this panel the top panel in the stack. - - inline void bottom() - { - OnError (::bottom_panel(p)); - } - // Make this panel the bottom panel in the stack. - // N.B.: The panel associated with ::stdscr is always on the bottom. So - // actually bottom() makes the panel the first above ::stdscr. - - virtual int mvwin(int y, int x) - { - OnError(::move_panel(p, y, x)); - return OK; - } - - inline bool hidden() const - { - return (::panel_hidden (p) ? TRUE : FALSE); - } - // Return TRUE if the panel is hidden, FALSE otherwise. - -/* The functions panel_above() and panel_below() are not reflected in - the NCursesPanel class. The reason for this is, that we cannot - assume that a panel retrieved by those operations is one wrapped - by a C++ class. Although this situation might be handled, we also - need a reverse mapping from PANEL to NCursesPanel which needs some - redesign of the low level stuff. At the moment, we define them in the - interface but they will always produce an error. */ - inline NCursesPanel& above() const - { - OnError(ERR); - return *dummy; - } - - inline NCursesPanel& below() const - { - OnError(ERR); - return *dummy; - } - - // Those two are rewrites of the corresponding virtual members of - // NCursesWindow - virtual int refresh(); - // Propagate all panel changes to the virtual screen and update the - // physical screen. - - virtual int noutrefresh(); - // Propagate all panel changes to the virtual screen. - - static void redraw(); - // Redraw all panels. - - // decorations - virtual void frame(const char* title=NULL, - const char* btitle=NULL); - // Put a frame around the panel and put the title centered in the top line - // and btitle in the bottom line. - - virtual void boldframe(const char* title=NULL, - const char* btitle=NULL); - // Same as frame(), but use highlighted attributes. - - virtual void label(const char* topLabel, - const char* bottomLabel); - // Put the title centered in the top line and btitle in the bottom line. - - virtual void centertext(int row,const char* label); - // Put the label text centered in the specified row. -}; - -/* We use templates to provide a typesafe mechanism to associate - * user data with a panel. A NCursesUserPanel is a panel - * associated with some user data of type T. - */ -template class NCursesUserPanel : public NCursesPanel -{ -public: - NCursesUserPanel (int nlines, - int ncols, - int begin_y = 0, - int begin_x = 0, - const T* p_UserData = STATIC_CAST(T*)(0)) - : NCursesPanel (nlines, ncols, begin_y, begin_x) - { - if (p) - set_user (const_cast(p_UserData)); - }; - // This creates an user panel of the requested size with associated - // user data pointed to by p_UserData. - - NCursesUserPanel(const T* p_UserData = STATIC_CAST(T*)(0)) : NCursesPanel() - { - if (p) - set_user(const_cast(p_UserData)); - }; - // This creates an user panel associated with the ::stdscr and user data - // pointed to by p_UserData. - - virtual ~NCursesUserPanel() {}; - - T* UserData (void) const - { - return reinterpret_cast(get_user ()); - }; - // Retrieve the user data associated with the panel. - - virtual void setUserData (const T* p_UserData) - { - if (p) - set_user (const_cast(p_UserData)); - } - // Associate the user panel with the user data pointed to by p_UserData. -}; - -#endif /* NCURSES_CURSESP_H_incl */ diff --git a/windows/ncurses/include/ncurses/cursesw.h b/windows/ncurses/include/ncurses/cursesw.h deleted file mode 100644 index 95659f2fd..000000000 --- a/windows/ncurses/include/ncurses/cursesw.h +++ /dev/null @@ -1,1556 +0,0 @@ -// * This makes emacs happy -*-Mode: C++;-*- -// vile:cppmode -/**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ - -#ifndef NCURSES_CURSESW_H_incl -#define NCURSES_CURSESW_H_incl 1 - -// $Id: cursesw.h,v 1.48 2008/01/19 21:09:10 tom Exp $ - -#include - -extern "C" { -# include -} - -/* SCO 3.2v4 curses.h includes term.h, which defines lines as a macro. - Undefine it here, because NCursesWindow uses lines as a method. */ -#undef lines - -/* "Convert" macros to inlines. We'll define it as another symbol to avoid - * conflict with library symbols. - */ -#undef UNDEF -#define UNDEF(name) CUR_ ##name - -#ifdef addch -inline int UNDEF(addch)(chtype ch) { return addch(ch); } -#undef addch -#define addch UNDEF(addch) -#endif - -#ifdef addchstr -inline int UNDEF(addchstr)(chtype *at) { return addchstr(at); } -#undef addchstr -#define addchstr UNDEF(addchstr) -#endif - -#ifdef addnstr -inline int UNDEF(addnstr)(const char *str, int n) -{ return addnstr(str, n); } -#undef addnstr -#define addnstr UNDEF(addnstr) -#endif - -#ifdef addstr -inline int UNDEF(addstr)(const char * str) { return addstr(str); } -#undef addstr -#define addstr UNDEF(addstr) -#endif - -#ifdef attroff -inline int UNDEF(attroff)(chtype at) { return attroff(at); } -#undef attroff -#define attroff UNDEF(attroff) -#endif - -#ifdef attron -inline int UNDEF(attron)(chtype at) { return attron(at); } -#undef attron -#define attron UNDEF(attron) -#endif - -#ifdef attrset -inline chtype UNDEF(attrset)(chtype at) { return attrset(at); } -#undef attrset -#define attrset UNDEF(attrset) -#endif - -#ifdef bkgd -inline int UNDEF(bkgd)(chtype ch) { return bkgd(ch); } -#undef bkgd -#define bkgd UNDEF(bkgd) -#endif - -#ifdef bkgdset -inline void UNDEF(bkgdset)(chtype ch) { bkgdset(ch); } -#undef bkgdset -#define bkgdset UNDEF(bkgdset) -#endif - -#ifdef border -inline int UNDEF(border)(chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br) -{ return border(ls, rs, ts, bs, tl, tr, bl, br); } -#undef border -#define border UNDEF(border) -#endif - -#ifdef box -inline int UNDEF(box)(WINDOW *win, int v, int h) { return box(win, v, h); } -#undef box -#define box UNDEF(box) -#endif - -#ifdef chgat -inline int UNDEF(chgat)(int n, attr_t attr, short color, const void *opts) { - return chgat(n, attr, color, opts); } -#undef chgat -#define chgat UNDEF(chgat) -#endif - -#ifdef clear -inline int UNDEF(clear)() { return clear(); } -#undef clear -#define clear UNDEF(clear) -#endif - -#ifdef clearok -inline int UNDEF(clearok)(WINDOW* win, bool bf) { return clearok(win, bf); } -#undef clearok -#define clearok UNDEF(clearok) -#else -extern "C" NCURSES_IMPEXP int NCURSES_API clearok(WINDOW*, bool); -#endif - -#ifdef clrtobot -inline int UNDEF(clrtobot)() { return clrtobot(); } -#undef clrtobot -#define clrtobot UNDEF(clrtobot) -#endif - -#ifdef clrtoeol -inline int UNDEF(clrtoeol)() { return clrtoeol(); } -#undef clrtoeol -#define clrtoeol UNDEF(clrtoeol) -#endif - -#ifdef color_set -inline chtype UNDEF(color_set)(short p, void* opts) { return color_set(p, opts); } -#undef color_set -#define color_set UNDEF(color_set) -#endif - -#ifdef crmode -inline int UNDEF(crmode)(void) { return crmode(); } -#undef crmode -#define crmode UNDEF(crmode) -#endif - -#ifdef delch -inline int UNDEF(delch)() { return delch(); } -#undef delch -#define delch UNDEF(delch) -#endif - -#ifdef deleteln -inline int UNDEF(deleteln)() { return deleteln(); } -#undef deleteln -#define deleteln UNDEF(deleteln) -#endif - -#ifdef echochar -inline int UNDEF(echochar)(chtype ch) { return echochar(ch); } -#undef echochar -#define echochar UNDEF(echochar) -#endif - -#ifdef erase -inline int UNDEF(erase)() { return erase(); } -#undef erase -#define erase UNDEF(erase) -#endif - -#ifdef fixterm -inline int UNDEF(fixterm)(void) { return fixterm(); } -#undef fixterm -#define fixterm UNDEF(fixterm) -#endif - -#ifdef flushok -inline int UNDEF(flushok)(WINDOW* _win, bool _bf) { - return flushok(_win, _bf); } -#undef flushok -#define flushok UNDEF(flushok) -#else -#define _no_flushok -#endif - -#ifdef getattrs -inline int UNDEF(getattrs)(WINDOW *win) { return getattrs(win); } -#undef getattrs -#define getattrs UNDEF(getattrs) -#endif - -#ifdef getbegyx -inline void UNDEF(getbegyx)(WINDOW* win, int& y, int& x) { getbegyx(win, y, x); } -#undef getbegyx -#define getbegyx UNDEF(getbegyx) -#endif - -#ifdef getbkgd -inline chtype UNDEF(getbkgd)(const WINDOW *win) { return getbkgd(win); } -#undef getbkgd -#define getbkgd UNDEF(getbkgd) -#endif - -#ifdef getch -inline int UNDEF(getch)() { return getch(); } -#undef getch -#define getch UNDEF(getch) -#endif - -#ifdef getmaxyx -inline void UNDEF(getmaxyx)(WINDOW* win, int& y, int& x) { getmaxyx(win, y, x); } -#undef getmaxyx -#define getmaxyx UNDEF(getmaxyx) -#endif - -#ifdef getnstr -inline int UNDEF(getnstr)(char *_str, int n) { return getnstr(_str, n); } -#undef getnstr -#define getnstr UNDEF(getnstr) -#endif - -#ifdef getparyx -inline void UNDEF(getparyx)(WINDOW* win, int& y, int& x) { getparyx(win, y, x); } -#undef getparyx -#define getparyx UNDEF(getparyx) -#endif - -#ifdef getstr -inline int UNDEF(getstr)(char *_str) { return getstr(_str); } -#undef getstr -#define getstr UNDEF(getstr) -#endif - -#ifdef getyx -inline void UNDEF(getyx)(const WINDOW* win, int& y, int& x) { - getyx(win, y, x); } -#undef getyx -#define getyx UNDEF(getyx) -#endif - -#ifdef hline -inline int UNDEF(hline)(chtype ch, int n) { return hline(ch, n); } -#undef hline -#define hline UNDEF(hline) -#endif - -#ifdef inch -inline chtype UNDEF(inch)() { return inch(); } -#undef inch -#define inch UNDEF(inch) -#endif - -#ifdef inchstr -inline int UNDEF(inchstr)(chtype *str) { return inchstr(str); } -#undef inchstr -#define inchstr UNDEF(inchstr) -#endif - -#ifdef innstr -inline int UNDEF(innstr)(char *_str, int n) { return innstr(_str, n); } -#undef innstr -#define innstr UNDEF(innstr) -#endif - -#ifdef insch -inline int UNDEF(insch)(chtype c) { return insch(c); } -#undef insch -#define insch UNDEF(insch) -#endif - -#ifdef insdelln -inline int UNDEF(insdelln)(int n) { return insdelln(n); } -#undef insdelln -#define insdelln UNDEF(insdelln) -#endif - -#ifdef insertln -inline int UNDEF(insertln)() { return insertln(); } -#undef insertln -#define insertln UNDEF(insertln) -#endif - -#ifdef insnstr -inline int UNDEF(insnstr)(const char *_str, int n) { - return insnstr(_str, n); } -#undef insnstr -#define insnstr UNDEF(insnstr) -#endif - -#ifdef insstr -inline int UNDEF(insstr)(const char *_str) { - return insstr(_str); } -#undef insstr -#define insstr UNDEF(insstr) -#endif - -#ifdef instr -inline int UNDEF(instr)(char *_str) { return instr(_str); } -#undef instr -#define instr UNDEF(instr) -#endif - -#ifdef intrflush -inline void UNDEF(intrflush)(WINDOW *win, bool bf) { intrflush(); } -#undef intrflush -#define intrflush UNDEF(intrflush) -#endif - -#ifdef leaveok -inline int UNDEF(leaveok)(WINDOW* win, bool bf) { return leaveok(win, bf); } -#undef leaveok -#define leaveok UNDEF(leaveok) -#else -extern "C" NCURSES_IMPEXP int NCURSES_API leaveok(WINDOW* win, bool bf); -#endif - -#ifdef move -inline int UNDEF(move)(int x, int y) { return move(x, y); } -#undef move -#define move UNDEF(move) -#endif - -#ifdef mvaddch -inline int UNDEF(mvaddch)(int y, int x, chtype ch) -{ return mvaddch(y, x, ch); } -#undef mvaddch -#define mvaddch UNDEF(mvaddch) -#endif - -#ifdef mvaddnstr -inline int UNDEF(mvaddnstr)(int y, int x, const char *str, int n) -{ return mvaddnstr(y, x, str, n); } -#undef mvaddnstr -#define mvaddnstr UNDEF(mvaddnstr) -#endif - -#ifdef mvaddstr -inline int UNDEF(mvaddstr)(int y, int x, const char * str) -{ return mvaddstr(y, x, str); } -#undef mvaddstr -#define mvaddstr UNDEF(mvaddstr) -#endif - -#ifdef mvchgat -inline int UNDEF(mvchgat)(int y, int x, int n, - attr_t attr, short color, const void *opts) { - return mvchgat(y, x, n, attr, color, opts); } -#undef mvchgat -#define mvchgat UNDEF(mvchgat) -#endif - -#ifdef mvdelch -inline int UNDEF(mvdelch)(int y, int x) { return mvdelch(y, x);} -#undef mvdelch -#define mvdelch UNDEF(mvdelch) -#endif - -#ifdef mvgetch -inline int UNDEF(mvgetch)(int y, int x) { return mvgetch(y, x);} -#undef mvgetch -#define mvgetch UNDEF(mvgetch) -#endif - -#ifdef mvgetnstr -inline int UNDEF(mvgetnstr)(int y, int x, char *str, int n) { - return mvgetnstr(y, x, str, n);} -#undef mvgetnstr -#define mvgetnstr UNDEF(mvgetnstr) -#endif - -#ifdef mvgetstr -inline int UNDEF(mvgetstr)(int y, int x, char *str) {return mvgetstr(y, x, str);} -#undef mvgetstr -#define mvgetstr UNDEF(mvgetstr) -#endif - -#ifdef mvinch -inline chtype UNDEF(mvinch)(int y, int x) { return mvinch(y, x);} -#undef mvinch -#define mvinch UNDEF(mvinch) -#endif - -#ifdef mvinnstr -inline int UNDEF(mvinnstr)(int y, int x, char *_str, int n) { - return mvinnstr(y, x, _str, n); } -#undef mvinnstr -#define mvinnstr UNDEF(mvinnstr) -#endif - -#ifdef mvinsch -inline int UNDEF(mvinsch)(int y, int x, chtype c) -{ return mvinsch(y, x, c); } -#undef mvinsch -#define mvinsch UNDEF(mvinsch) -#endif - -#ifdef mvinsnstr -inline int UNDEF(mvinsnstr)(int y, int x, const char *_str, int n) { - return mvinsnstr(y, x, _str, n); } -#undef mvinsnstr -#define mvinsnstr UNDEF(mvinsnstr) -#endif - -#ifdef mvinsstr -inline int UNDEF(mvinsstr)(int y, int x, const char *_str) { - return mvinsstr(y, x, _str); } -#undef mvinsstr -#define mvinsstr UNDEF(mvinsstr) -#endif - -#ifdef mvwaddch -inline int UNDEF(mvwaddch)(WINDOW *win, int y, int x, const chtype ch) -{ return mvwaddch(win, y, x, ch); } -#undef mvwaddch -#define mvwaddch UNDEF(mvwaddch) -#endif - -#ifdef mvwaddchnstr -inline int UNDEF(mvwaddchnstr)(WINDOW *win, int y, int x, const chtype *str, int n) -{ return mvwaddchnstr(win, y, x, str, n); } -#undef mvwaddchnstr -#define mvwaddchnstr UNDEF(mvwaddchnstr) -#endif - -#ifdef mvwaddchstr -inline int UNDEF(mvwaddchstr)(WINDOW *win, int y, int x, const chtype *str) -{ return mvwaddchstr(win, y, x, str); } -#undef mvwaddchstr -#define mvwaddchstr UNDEF(mvwaddchstr) -#endif - -#ifdef mvwaddnstr -inline int UNDEF(mvwaddnstr)(WINDOW *win, int y, int x, const char *str, int n) -{ return mvwaddnstr(win, y, x, str, n); } -#undef mvwaddnstr -#define mvwaddnstr UNDEF(mvwaddnstr) -#endif - -#ifdef mvwaddstr -inline int UNDEF(mvwaddstr)(WINDOW *win, int y, int x, const char * str) -{ return mvwaddstr(win, y, x, str); } -#undef mvwaddstr -#define mvwaddstr UNDEF(mvwaddstr) -#endif - -#ifdef mvwchgat -inline int UNDEF(mvwchgat)(WINDOW *win, int y, int x, int n, - attr_t attr, short color, const void *opts) { - return mvwchgat(win, y, x, n, attr, color, opts); } -#undef mvwchgat -#define mvwchgat UNDEF(mvwchgat) -#endif - -#ifdef mvwdelch -inline int UNDEF(mvwdelch)(WINDOW *win, int y, int x) -{ return mvwdelch(win, y, x); } -#undef mvwdelch -#define mvwdelch UNDEF(mvwdelch) -#endif - -#ifdef mvwgetch -inline int UNDEF(mvwgetch)(WINDOW *win, int y, int x) { return mvwgetch(win, y, x);} -#undef mvwgetch -#define mvwgetch UNDEF(mvwgetch) -#endif - -#ifdef mvwgetnstr -inline int UNDEF(mvwgetnstr)(WINDOW *win, int y, int x, char *str, int n) -{return mvwgetnstr(win, y, x, str, n);} -#undef mvwgetnstr -#define mvwgetnstr UNDEF(mvwgetnstr) -#endif - -#ifdef mvwgetstr -inline int UNDEF(mvwgetstr)(WINDOW *win, int y, int x, char *str) -{return mvwgetstr(win, y, x, str);} -#undef mvwgetstr -#define mvwgetstr UNDEF(mvwgetstr) -#endif - -#ifdef mvwhline -inline int UNDEF(mvwhline)(WINDOW *win, int y, int x, chtype c, int n) { - return mvwhline(win, y, x, c, n); } -#undef mvwhline -#define mvwhline UNDEF(mvwhline) -#endif - -#ifdef mvwinch -inline chtype UNDEF(mvwinch)(WINDOW *win, int y, int x) { - return mvwinch(win, y, x);} -#undef mvwinch -#define mvwinch UNDEF(mvwinch) -#endif - -#ifdef mvwinchnstr -inline int UNDEF(mvwinchnstr)(WINDOW *win, int y, int x, chtype *str, int n) { return mvwinchnstr(win, y, x, str, n); } -#undef mvwinchnstr -#define mvwinchnstr UNDEF(mvwinchnstr) -#endif - -#ifdef mvwinchstr -inline int UNDEF(mvwinchstr)(WINDOW *win, int y, int x, chtype *str) { return mvwinchstr(win, y, x, str); } -#undef mvwinchstr -#define mvwinchstr UNDEF(mvwinchstr) -#endif - -#ifdef mvwinnstr -inline int UNDEF(mvwinnstr)(WINDOW *win, int y, int x, char *_str, int n) { - return mvwinnstr(win, y, x, _str, n); } -#undef mvwinnstr -#define mvwinnstr UNDEF(mvwinnstr) -#endif - -#ifdef mvwinsch -inline int UNDEF(mvwinsch)(WINDOW *win, int y, int x, chtype c) -{ return mvwinsch(win, y, x, c); } -#undef mvwinsch -#define mvwinsch UNDEF(mvwinsch) -#endif - -#ifdef mvwinsnstr -inline int UNDEF(mvwinsnstr)(WINDOW *w, int y, int x, const char *_str, int n) { - return mvwinsnstr(w, y, x, _str, n); } -#undef mvwinsnstr -#define mvwinsnstr UNDEF(mvwinsnstr) -#endif - -#ifdef mvwinsstr -inline int UNDEF(mvwinsstr)(WINDOW *w, int y, int x, const char *_str) { - return mvwinsstr(w, y, x, _str); } -#undef mvwinsstr -#define mvwinsstr UNDEF(mvwinsstr) -#endif - -#ifdef mvwvline -inline int UNDEF(mvwvline)(WINDOW *win, int y, int x, chtype c, int n) { - return mvwvline(win, y, x, c, n); } -#undef mvwvline -#define mvwvline UNDEF(mvwvline) -#endif - -#ifdef napms -inline void UNDEF(napms)(unsigned long x) { napms(x); } -#undef napms -#define napms UNDEF(napms) -#endif - -#ifdef nocrmode -inline int UNDEF(nocrmode)(void) { return nocrmode(); } -#undef nocrmode -#define nocrmode UNDEF(nocrmode) -#endif - -#ifdef nodelay -inline void UNDEF(nodelay)() { nodelay(); } -#undef nodelay -#define nodelay UNDEF(nodelay) -#endif - -#ifdef redrawwin -inline int UNDEF(redrawwin)(WINDOW *win) { return redrawwin(win); } -#undef redrawwin -#define redrawwin UNDEF(redrawwin) -#endif - -#ifdef refresh -inline int UNDEF(refresh)() { return refresh(); } -#undef refresh -#define refresh UNDEF(refresh) -#endif - -#ifdef resetterm -inline int UNDEF(resetterm)(void) { return resetterm(); } -#undef resetterm -#define resetterm UNDEF(resetterm) -#endif - -#ifdef saveterm -inline int UNDEF(saveterm)(void) { return saveterm(); } -#undef saveterm -#define saveterm UNDEF(saveterm) -#endif - -#ifdef scrl -inline int UNDEF(scrl)(int l) { return scrl(l); } -#undef scrl -#define scrl UNDEF(scrl) -#endif - -#ifdef scroll -inline int UNDEF(scroll)(WINDOW *win) { return scroll(win); } -#undef scroll -#define scroll UNDEF(scroll) -#endif - -#ifdef scrollok -inline int UNDEF(scrollok)(WINDOW* win, bool bf) { return scrollok(win, bf); } -#undef scrollok -#define scrollok UNDEF(scrollok) -#else -#if defined(__NCURSES_H) -extern "C" NCURSES_IMPEXP int NCURSES_API scrollok(WINDOW*, bool); -#else -extern "C" NCURSES_IMPEXP int NCURSES_API scrollok(WINDOW*, char); -#endif -#endif - -#ifdef setscrreg -inline int UNDEF(setscrreg)(int t, int b) { return setscrreg(t, b); } -#undef setscrreg -#define setscrreg UNDEF(setscrreg) -#endif - -#ifdef standend -inline int UNDEF(standend)() { return standend(); } -#undef standend -#define standend UNDEF(standend) -#endif - -#ifdef standout -inline int UNDEF(standout)() { return standout(); } -#undef standout -#define standout UNDEF(standout) -#endif - -#ifdef subpad -inline WINDOW *UNDEF(subpad)(WINDOW *p, int l, int c, int y, int x) -{ return derwin(p, l, c, y, x); } -#undef subpad -#define subpad UNDEF(subpad) -#endif - -#ifdef timeout -inline void UNDEF(timeout)(int delay) { timeout(delay); } -#undef timeout -#define timeout UNDEF(timeout) -#endif - -#ifdef touchline -inline int UNDEF(touchline)(WINDOW *win, int s, int c) -{ return touchline(win, s, c); } -#undef touchline -#define touchline UNDEF(touchline) -#endif - -#ifdef touchwin -inline int UNDEF(touchwin)(WINDOW *win) { return touchwin(win); } -#undef touchwin -#define touchwin UNDEF(touchwin) -#endif - -#ifdef untouchwin -inline int UNDEF(untouchwin)(WINDOW *win) { return untouchwin(win); } -#undef untouchwin -#define untouchwin UNDEF(untouchwin) -#endif - -#ifdef vline -inline int UNDEF(vline)(chtype ch, int n) { return vline(ch, n); } -#undef vline -#define vline UNDEF(vline) -#endif - -#ifdef waddchstr -inline int UNDEF(waddchstr)(WINDOW *win, chtype *at) { return waddchstr(win, at); } -#undef waddchstr -#define waddchstr UNDEF(waddchstr) -#endif - -#ifdef waddstr -inline int UNDEF(waddstr)(WINDOW *win, char *str) { return waddstr(win, str); } -#undef waddstr -#define waddstr UNDEF(waddstr) -#endif - -#ifdef wattroff -inline int UNDEF(wattroff)(WINDOW *win, int att) { return wattroff(win, att); } -#undef wattroff -#define wattroff UNDEF(wattroff) -#endif - -#ifdef wattrset -inline int UNDEF(wattrset)(WINDOW *win, int att) { return wattrset(win, att); } -#undef wattrset -#define wattrset UNDEF(wattrset) -#endif - -#ifdef winch -inline chtype UNDEF(winch)(const WINDOW* win) { return winch(win); } -#undef winch -#define winch UNDEF(winch) -#endif - -#ifdef winchnstr -inline int UNDEF(winchnstr)(WINDOW *win, chtype *str, int n) { return winchnstr(win, str, n); } -#undef winchnstr -#define winchnstr UNDEF(winchnstr) -#endif - -#ifdef winchstr -inline int UNDEF(winchstr)(WINDOW *win, chtype *str) { return winchstr(win, str); } -#undef winchstr -#define winchstr UNDEF(winchstr) -#endif - -#ifdef winsstr -inline int UNDEF(winsstr)(WINDOW *w, const char *_str) { - return winsstr(w, _str); } -#undef winsstr -#define winsstr UNDEF(winsstr) -#endif - -#ifdef wstandend -inline int UNDEF(wstandend)(WINDOW *win) { return wstandend(win); } -#undef wstandend -#define wstandend UNDEF(wstandend) -#endif - -#ifdef wstandout -inline int UNDEF(wstandout)(WINDOW *win) { return wstandout(win); } -#undef wstandout -#define wstandout UNDEF(wstandout) -#endif - -/* - * - * C++ class for windows. - * - */ - -extern "C" int _nc_ripoffline(int, int (*init)(WINDOW*, int)); -extern "C" int _nc_xx_ripoff_init(WINDOW *, int); -extern "C" int _nc_has_mouse(void); - -class NCURSES_IMPEXP NCursesWindow -{ - friend class NCursesMenu; - friend class NCursesForm; - -private: - static bool b_initialized; - static void initialize(); - void constructing(); - friend int _nc_xx_ripoff_init(WINDOW *, int); - - void set_keyboard(); - - short getcolor(int getback) const; - short getPair() const; - - static int setpalette(short fore, short back, short pair); - static int colorInitialized; - - // This private constructor is only used during the initialization - // of windows generated by ripoffline() calls. - NCursesWindow(WINDOW* win, int ncols); - -protected: - virtual void err_handler(const char *) const THROWS(NCursesException); - // Signal an error with the given message text. - - static long count; // count of all active windows: - // We rely on the c++ promise that - // all otherwise uninitialized - // static class vars are set to 0 - - WINDOW* w; // the curses WINDOW - - bool alloced; // TRUE if we own the WINDOW - - NCursesWindow* par; // parent, if subwindow - NCursesWindow* subwins; // head of subwindows list - NCursesWindow* sib; // next subwindow of parent - - void kill_subwindows(); // disable all subwindows - // Destroy all subwindows. - - /* Only for use by derived classes. They are then in charge to - fill the member variables correctly. */ - NCursesWindow(); - -public: - NCursesWindow(WINDOW* window); // useful only for stdscr - - NCursesWindow(int nlines, // number of lines - int ncols, // number of columns - int begin_y, // line origin - int begin_x); // col origin - - NCursesWindow(NCursesWindow& par,// parent window - int nlines, // number of lines - int ncols, // number of columns - int begin_y, // absolute or relative - int begin_x, // origins: - char absrel = 'a');// if `a', begin_y & begin_x are - // absolute screen pos, else if `r', they are relative to par origin - - NCursesWindow(NCursesWindow& par,// parent window - bool do_box = TRUE); - // this is the very common case that we want to create the subwindow that - // is two lines and two columns smaller and begins at (1,1). - // We may automatically request the box around it. - - NCursesWindow& operator=(const NCursesWindow& rhs) - { - if (this != &rhs) - *this = rhs; - return *this; - } - - NCursesWindow(const NCursesWindow& rhs) - : w(rhs.w), alloced(rhs.alloced), par(rhs.par), subwins(rhs.subwins), sib(rhs.sib) - { - } - - virtual ~NCursesWindow(); - - NCursesWindow Clone(); - // Make an exact copy of the window. - - // Initialization. - static void useColors(void); - // Call this routine very early if you want to have colors. - - static int ripoffline(int ripoff_lines, - int (*init)(NCursesWindow& win)); - // This function is used to generate a window of ripped-of lines. - // If the argument is positive, lines are removed from the top, if it - // is negative lines are removed from the bottom. This enhances the - // lowlevel ripoffline() function because it uses the internal - // implementation that allows to remove more than just a single line. - // This function must be called before any other ncurses function. The - // creation of the window is deferred until ncurses gets initialized. - // The initialization function is then called. - - // ------------------------------------------------------------------------- - // terminal status - // ------------------------------------------------------------------------- - int lines() const { initialize(); return LINES; } - // Number of lines on terminal, *not* window - - int cols() const { initialize(); return COLS; } - // Number of cols on terminal, *not* window - - int tabsize() const { initialize(); return TABSIZE; } - // Size of a tab on terminal, *not* window - - static int NumberOfColors(); - // Number of available colors - - int colors() const { return NumberOfColors(); } - // Number of available colors - - // ------------------------------------------------------------------------- - // window status - // ------------------------------------------------------------------------- - int height() const { return maxy() + 1; } - // Number of lines in this window - - int width() const { return maxx() + 1; } - // Number of columns in this window - - int begx() const { return getbegx(w); } - // Column of top left corner relative to stdscr - - int begy() const { return getbegy(w); } - // Line of top left corner relative to stdscr - - int curx() const { return getcurx(w); } - // Column of top left corner relative to stdscr - - int cury() const { return getcury(w); } - // Line of top left corner relative to stdscr - - int maxx() const { return getmaxx(w) == ERR ? ERR : getmaxx(w)-1; } - // Largest x coord in window - - int maxy() const { return getmaxy(w) == ERR ? ERR : getmaxy(w)-1; } - // Largest y coord in window - - short getcolor() const; - // Actual color pair - - short foreground() const { return getcolor(0); } - // Actual foreground color - - short background() const { return getcolor(1); } - // Actual background color - - int setpalette(short fore, short back); - // Set color palette entry - - int setcolor(short pair); - // Set actually used palette entry - - // ------------------------------------------------------------------------- - // window positioning - // ------------------------------------------------------------------------- - virtual int mvwin(int begin_y, int begin_x) { - return ::mvwin(w, begin_y, begin_x); } - // Move window to new position with the new position as top left corner. - // This is virtual because it is redefined in NCursesPanel. - - // ------------------------------------------------------------------------- - // coordinate positioning - // ------------------------------------------------------------------------- - int move(int y, int x) { return ::wmove(w, y, x); } - // Move cursor the this position - - void getyx(int& y, int& x) const { ::getyx(w, y, x); } - // Get current position of the cursor - - void getbegyx(int& y, int& x) const { ::getbegyx(w, y, x); } - // Get beginning of the window - - void getmaxyx(int& y, int& x) const { ::getmaxyx(w, y, x); } - // Get size of the window - - void getparyx(int& y, int& x) const { ::getparyx(w, y, x); } - // Get parent's beginning of the window - - int mvcur(int oldrow, int oldcol, int newrow, int newcol) const { - return ::mvcur(oldrow, oldcol, newrow, newcol); } - // Perform lowlevel cursor motion that takes effect immediately. - - // ------------------------------------------------------------------------- - // input - // ------------------------------------------------------------------------- - int getch() { return ::wgetch(w); } - // Get a keystroke from the window. - - int getch(int y, int x) { return ::mvwgetch(w, y, x); } - // Move cursor to position and get a keystroke from the window - - int getstr(char* str, int n=-1) { - return ::wgetnstr(w, str, n); } - // Read a series of characters into str until a newline or carriage return - // is received. Read at most n characters. If n is negative, the limit is - // ignored. - - int getstr(int y, int x, char* str, int n=-1) { - return ::mvwgetnstr(w, y, x, str, n); } - // Move the cursor to the requested position and then perform the getstr() - // as described above. - - int instr(char *s, int n=-1) { return ::winnstr(w, s, n); } - // Get a string of characters from the window into the buffer s. Retrieve - // at most n characters, if n is negative retrieve all characters up to the - // end of the current line. Attributes are stripped from the characters. - - int instr(int y, int x, char *s, int n=-1) { - return ::mvwinnstr(w, y, x, s, n); } - // Move the cursor to the requested position and then perform the instr() - // as described above. - - int scanw(const char* fmt, ...) - // Perform a scanw function from the window. -#if __GNUG__ >= 2 - __attribute__ ((format (scanf, 2, 3))); -#else - ; -#endif - - int scanw(const char*, va_list); - // Perform a scanw function from the window. - - int scanw(int y, int x, const char* fmt, ...) - // Move the cursor to the requested position and then perform a scanw - // from the window. -#if __GNUG__ >= 2 - __attribute__ ((format (scanf, 4, 5))); -#else - ; -#endif - - int scanw(int y, int x, const char* fmt, va_list); - // Move the cursor to the requested position and then perform a scanw - // from the window. - - // ------------------------------------------------------------------------- - // output - // ------------------------------------------------------------------------- - int addch(const chtype ch) { return ::waddch(w, ch); } - // Put attributed character to the window. - - int addch(int y, int x, const chtype ch) { - return ::mvwaddch(w, y, x, ch); } - // Move cursor to the requested position and then put attributed character - // to the window. - - int echochar(const chtype ch) { return ::wechochar(w, ch); } - // Put attributed character to the window and refresh it immediately. - - int addstr(const char* str, int n=-1) { - return ::waddnstr(w, str, n); } - // Write the string str to the window, stop writing if the terminating - // NUL or the limit n is reached. If n is negative, it is ignored. - - int addstr(int y, int x, const char * str, int n=-1) { - return ::mvwaddnstr(w, y, x, str, n); } - // Move the cursor to the requested position and then perform the addchstr - // as described above. - - int addchstr(const chtype* str, int n=-1) { - return ::waddchnstr(w, str, n); } - // Write the string str to the window, stop writing if the terminating - // NUL or the limit n is reached. If n is negative, it is ignored. - - int addchstr(int y, int x, const chtype * str, int n=-1) { - return ::mvwaddchnstr(w, y, x, str, n); } - // Move the cursor to the requested position and then perform the addchstr - // as described above. - - int printw(const char* fmt, ...) - // Do a formatted print to the window. -#if (__GNUG__ >= 2) && !defined(printf) - __attribute__ ((format (printf, 2, 3))); -#else - ; -#endif - - int printw(int y, int x, const char * fmt, ...) - // Move the cursor and then do a formatted print to the window. -#if (__GNUG__ >= 2) && !defined(printf) - __attribute__ ((format (printf, 4, 5))); -#else - ; -#endif - - int printw(const char* fmt, va_list args); - // Do a formatted print to the window. - - int printw(int y, int x, const char * fmt, va_list args); - // Move the cursor and then do a formatted print to the window. - - chtype inch() const { return ::winch(w); } - // Retrieve attributed character under the current cursor position. - - chtype inch(int y, int x) { return ::mvwinch(w, y, x); } - // Move cursor to requested position and then retrieve attributed character - // at this position. - - int inchstr(chtype* str, int n=-1) { - return ::winchnstr(w, str, n); } - // Read the string str from the window, stop reading if the terminating - // NUL or the limit n is reached. If n is negative, it is ignored. - - int inchstr(int y, int x, chtype * str, int n=-1) { - return ::mvwinchnstr(w, y, x, str, n); } - // Move the cursor to the requested position and then perform the inchstr - // as described above. - - int insch(chtype ch) { return ::winsch(w, ch); } - // Insert attributed character into the window before current cursor - // position. - - int insch(int y, int x, chtype ch) { - return ::mvwinsch(w, y, x, ch); } - // Move cursor to requested position and then insert the attributed - // character before that position. - - int insertln() { return ::winsdelln(w, 1); } - // Insert an empty line above the current line. - - int insdelln(int n=1) { return ::winsdelln(w, n); } - // If n>0 insert that many lines above the current line. If n<0 delete - // that many lines beginning with the current line. - - int insstr(const char *s, int n=-1) { - return ::winsnstr(w, s, n); } - // Insert the string into the window before the current cursor position. - // Insert stops at end of string or when the limit n is reached. If n is - // negative, it is ignored. - - int insstr(int y, int x, const char *s, int n=-1) { - return ::mvwinsnstr(w, y, x, s, n); } - // Move the cursor to the requested position and then perform the insstr() - // as described above. - - int attron (chtype at) { return ::wattron (w, at); } - // Switch on the window attributes; - - int attroff(chtype at) { return ::wattroff(w, static_cast(at)); } - // Switch off the window attributes; - - int attrset(chtype at) { return ::wattrset(w, static_cast(at)); } - // Set the window attributes; - - chtype attrget() { return ::getattrs(w); } - // Get the window attributes; - - int color_set(short color_pair_number, void* opts=NULL) { - return ::wcolor_set(w, color_pair_number, opts); } - // Set the window color attribute; - - int chgat(int n, attr_t attr, short color, const void *opts=NULL) { - return ::wchgat(w, n, attr, color, opts); } - // Change the attributes of the next n characters in the current line. If - // n is negative or greater than the number of remaining characters in the - // line, the attributes will be changed up to the end of the line. - - int chgat(int y, int x, - int n, attr_t attr, short color, const void *opts=NULL) { - return ::mvwchgat(w, y, x, n, attr, color, opts); } - // Move the cursor to the requested position and then perform chgat() as - // described above. - - // ------------------------------------------------------------------------- - // background - // ------------------------------------------------------------------------- - chtype getbkgd() const { return ::getbkgd(w); } - // Get current background setting. - - int bkgd(const chtype ch) { return ::wbkgd(w, ch); } - // Set the background property and apply it to the window. - - void bkgdset(chtype ch) { ::wbkgdset(w, ch); } - // Set the background property. - - // ------------------------------------------------------------------------- - // borders - // ------------------------------------------------------------------------- - int box(chtype vert=0, chtype hor=0) { - return ::wborder(w, vert, vert, hor, hor, 0, 0, 0, 0); } - // Draw a box around the window with the given vertical and horizontal - // drawing characters. If you specify a zero as character, curses will try - // to find a "nice" character. - - int border(chtype left=0, chtype right=0, - chtype top =0, chtype bottom=0, - chtype top_left =0, chtype top_right=0, - chtype bottom_left =0, chtype bottom_right=0) { - return ::wborder(w, left, right, top, bottom, top_left, top_right, - bottom_left, bottom_right); } - // Draw a border around the window with the given characters for the - // various parts of the border. If you pass zero for a character, curses - // will try to find "nice" characters. - - // ------------------------------------------------------------------------- - // lines and boxes - // ------------------------------------------------------------------------- - int hline(int len, chtype ch=0) { return ::whline(w, ch, len); } - // Draw a horizontal line of len characters with the given character. If - // you pass zero for the character, curses will try to find a "nice" one. - - int hline(int y, int x, int len, chtype ch=0) { - return ::mvwhline(w, y, x, ch, len); } - // Move the cursor to the requested position and then draw a horizontal line. - - int vline(int len, chtype ch=0) { return ::wvline(w, ch, len); } - // Draw a vertical line of len characters with the given character. If - // you pass zero for the character, curses will try to find a "nice" one. - - int vline(int y, int x, int len, chtype ch=0) { - return ::mvwvline(w, y, x, ch, len); } - // Move the cursor to the requested position and then draw a vertical line. - - // ------------------------------------------------------------------------- - // erasure - // ------------------------------------------------------------------------- - int erase() { return ::werase(w); } - // Erase the window. - - int clear() { return ::wclear(w); } - // Clear the window. - - int clearok(bool bf) { return ::clearok(w, bf); } - // Set/Reset the clear flag. If set, the next refresh() will clear the - // screen. - - int clrtobot() { return ::wclrtobot(w); } - // Clear to the end of the window. - - int clrtoeol() { return ::wclrtoeol(w); } - // Clear to the end of the line. - - int delch() { return ::wdelch(w); } - // Delete character under the cursor. - - int delch(int y, int x) { return ::mvwdelch(w, y, x); } - // Move cursor to requested position and delete the character under the - // cursor. - - int deleteln() { return ::winsdelln(w, -1); } - // Delete the current line. - - // ------------------------------------------------------------------------- - // screen control - // ------------------------------------------------------------------------- - int scroll(int amount=1) { return ::wscrl(w, amount); } - // Scroll amount lines. If amount is positive, scroll up, otherwise - // scroll down. - - int scrollok(bool bf) { return ::scrollok(w, bf); } - // If bf is TRUE, window scrolls if cursor is moved off the bottom - // edge of the window or a scrolling region, otherwise the cursor is left - // at the bottom line. - - int setscrreg(int from, int to) { - return ::wsetscrreg(w, from, to); } - // Define a soft scrolling region. - - int idlok(bool bf) { return ::idlok(w, bf); } - // If bf is TRUE, use insert/delete line hardware support if possible. - // Otherwise do it in software. - - void idcok(bool bf) { ::idcok(w, bf); } - // If bf is TRUE, use insert/delete character hardware support if possible. - // Otherwise do it in software. - - int touchline(int s, int c) { return ::touchline(w, s, c); } - // Mark the given lines as modified. - - int touchwin() { return ::wtouchln(w, 0, height(), 1); } - // Mark the whole window as modified. - - int untouchwin() { return ::wtouchln(w, 0, height(), 0); } - // Mark the whole window as unmodified. - - int touchln(int s, int cnt, bool changed=TRUE) { - return ::wtouchln(w, s, cnt, static_cast(changed ? 1 : 0)); } - // Mark cnt lines beginning from line s as changed or unchanged, depending - // on the value of the changed flag. - - bool is_linetouched(int line) const { - return (::is_linetouched(w, line) ? TRUE:FALSE); } - // Return TRUE if line is marked as changed, FALSE otherwise - - bool is_wintouched() const { - return (::is_wintouched(w) ? TRUE:FALSE); } - // Return TRUE if window is marked as changed, FALSE otherwise - - int leaveok(bool bf) { return ::leaveok(w, bf); } - // If bf is TRUE, curses will leave the cursor after an update whereever - // it is after the update. - - int redrawln(int from, int n) { return ::wredrawln(w, from, n); } - // Redraw n lines starting from the requested line - - int redrawwin() { return ::wredrawln(w, 0, height()); } - // Redraw the whole window - - int doupdate() { return ::doupdate(); } - // Do all outputs to make the physical screen looking like the virtual one - - void syncdown() { ::wsyncdown(w); } - // Propagate the changes down to all descendant windows - - void syncup() { ::wsyncup(w); } - // Propagate the changes up in the hierarchy - - void cursyncup() { ::wcursyncup(w); } - // Position the cursor in all ancestor windows corresponding to our setting - - int syncok(bool bf) { return ::syncok(w, bf); } - // If called with bf=TRUE, syncup() is called whenever the window is changed - -#ifndef _no_flushok - int flushok(bool bf) { return ::flushok(w, bf); } -#endif - - void immedok(bool bf) { ::immedok(w, bf); } - // If called with bf=TRUE, any change in the window will cause an - // automatic immediate refresh() - - int intrflush(bool bf) { return ::intrflush(w, bf); } - - int keypad(bool bf) { return ::keypad(w, bf); } - // If called with bf=TRUE, the application will interpret function keys. - - int nodelay(bool bf) { return ::nodelay(w, bf); } - - int meta(bool bf) { return ::meta(w, bf); } - // If called with bf=TRUE, keys may generate 8-Bit characters. Otherwise - // 7-Bit characters are generated. - - int standout() { return ::wstandout(w); } - // Enable "standout" attributes - - int standend() { return ::wstandend(w); } - // Disable "standout" attributes - - // ------------------------------------------------------------------------- - // The next two are virtual, because we redefine them in the - // NCursesPanel class. - // ------------------------------------------------------------------------- - virtual int refresh() { return ::wrefresh(w); } - // Propagate the changes in this window to the virtual screen and call - // doupdate(). This is redefined in NCursesPanel. - - virtual int noutrefresh() { return ::wnoutrefresh(w); } - // Propagate the changes in this window to the virtual screen. This is - // redefined in NCursesPanel. - - // ------------------------------------------------------------------------- - // multiple window control - // ------------------------------------------------------------------------- - int overlay(NCursesWindow& win) { - return ::overlay(w, win.w); } - // Overlay this window over win. - - int overwrite(NCursesWindow& win) { - return ::overwrite(w, win.w); } - // Overwrite win with this window. - - int copywin(NCursesWindow& win, - int sminrow, int smincol, - int dminrow, int dmincol, - int dmaxrow, int dmaxcol, bool overlaywin=TRUE) { - return ::copywin(w, win.w, sminrow, smincol, dminrow, dmincol, - dmaxrow, dmaxcol, static_cast(overlaywin ? 1 : 0)); } - // Overlay or overwrite the rectangle in win given by dminrow,dmincol, - // dmaxrow,dmaxcol with the rectangle in this window beginning at - // sminrow,smincol. - - // ------------------------------------------------------------------------- - // Extended functions - // ------------------------------------------------------------------------- -#if defined(NCURSES_EXT_FUNCS) && (NCURSES_EXT_FUNCS != 0) - int wresize(int newLines, int newColumns) { - return ::wresize(w, newLines, newColumns); } -#endif - - // ------------------------------------------------------------------------- - // Mouse related - // ------------------------------------------------------------------------- - bool has_mouse() const; - // Return TRUE if terminal supports a mouse, FALSE otherwise - - // ------------------------------------------------------------------------- - // traversal support - // ------------------------------------------------------------------------- - NCursesWindow* child() { return subwins; } - // Get the first child window. - - NCursesWindow* sibling() { return sib; } - // Get the next child of my parent. - - NCursesWindow* parent() { return par; } - // Get my parent. - - bool isDescendant(NCursesWindow& win); - // Return TRUE if win is a descendant of this. -}; - -// ------------------------------------------------------------------------- -// We leave this here for compatibility reasons. -// ------------------------------------------------------------------------- -class NCURSES_IMPEXP NCursesColorWindow : public NCursesWindow -{ -public: - NCursesColorWindow(WINDOW* &window) // useful only for stdscr - : NCursesWindow(window) { - useColors(); } - - NCursesColorWindow(int nlines, // number of lines - int ncols, // number of columns - int begin_y, // line origin - int begin_x) // col origin - : NCursesWindow(nlines, ncols, begin_y, begin_x) { - useColors(); } - - NCursesColorWindow(NCursesWindow& parentWin,// parent window - int nlines, // number of lines - int ncols, // number of columns - int begin_y, // absolute or relative - int begin_x, // origins: - char absrel = 'a') // if `a', by & bx are - : NCursesWindow(parentWin, - nlines, ncols, // absolute screen pos, - begin_y, begin_x, // else if `r', they are - absrel ) { // relative to par origin - useColors(); } -}; - -// These enum definitions really belong inside the NCursesPad class, but only -// recent compilers support that feature. - - typedef enum { - REQ_PAD_REFRESH = KEY_MAX + 1, - REQ_PAD_UP, - REQ_PAD_DOWN, - REQ_PAD_LEFT, - REQ_PAD_RIGHT, - REQ_PAD_EXIT - } Pad_Request; - - const Pad_Request PAD_LOW = REQ_PAD_REFRESH; // lowest op-code - const Pad_Request PAD_HIGH = REQ_PAD_EXIT; // highest op-code - -// ------------------------------------------------------------------------- -// Pad Support. We allow an association of a pad with a "real" window -// through which the pad may be viewed. -// ------------------------------------------------------------------------- -class NCURSES_IMPEXP NCursesPad : public NCursesWindow -{ -private: - NCursesWindow* viewWin; // the "viewport" window - NCursesWindow* viewSub; // the "viewport" subwindow - - int h_gridsize, v_gridsize; - -protected: - int min_row, min_col; // top left row/col of the pads display area - - NCursesWindow* Win(void) const { - // Get the window into which the pad should be copied (if any) - return (viewSub?viewSub:(viewWin?viewWin:0)); - } - - NCursesWindow* getWindow(void) const { - return viewWin; - } - - NCursesWindow* getSubWindow(void) const { - return viewSub; - } - - virtual int driver (int key); // Virtualize keystroke key - // The driver translates the keystroke c into an Pad_Request - - virtual void OnUnknownOperation(int pad_req) { - ::beep(); - } - // This is called if the driver returns an unknown op-code - - virtual void OnNavigationError(int pad_req) { - ::beep(); - } - // This is called if a navigation request couldn't be satisfied - - virtual void OnOperation(int pad_req) { - }; - // OnOperation is called if a Pad_Operation was executed and just before - // the refresh() operation is done. - -public: - NCursesPad(int nlines, int ncols); - // create a pad with the given size - - NCursesPad& operator=(const NCursesPad& rhs) - { - if (this != &rhs) { - *this = rhs; - NCursesWindow::operator=(rhs); - } - return *this; - } - - NCursesPad(const NCursesPad& rhs) - : NCursesWindow(rhs), - viewWin(rhs.viewWin), - viewSub(rhs.viewSub), - h_gridsize(rhs.h_gridsize), - v_gridsize(rhs.v_gridsize), - min_row(rhs.min_row), - min_col(rhs.min_col) - { - } - - virtual ~NCursesPad() {} - - int echochar(const chtype ch) { return ::pechochar(w, ch); } - // Put the attributed character onto the pad and immediately do a - // prefresh(). - - int refresh(); - // If a viewport is defined the pad is displayed in this window, otherwise - // this is a noop. - - int refresh(int pminrow, int pmincol, - int sminrow, int smincol, - int smaxrow, int smaxcol) { - return ::prefresh(w, pminrow, pmincol, - sminrow, smincol, smaxrow, smaxcol); - } - // The coordinates sminrow,smincol,smaxrow,smaxcol describe a rectangle - // on the screen. refresh copies a rectangle of this size beginning - // with top left corner pminrow,pmincol onto the screen and calls doupdate(). - - int noutrefresh(); - // If a viewport is defined the pad is displayed in this window, otherwise - // this is a noop. - - int noutrefresh(int pminrow, int pmincol, - int sminrow, int smincol, - int smaxrow, int smaxcol) { - return ::pnoutrefresh(w, pminrow, pmincol, - sminrow, smincol, smaxrow, smaxcol); - } - // Does the same as refresh() but without calling doupdate(). - - virtual void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid = 1); - // Add the window "view" as viewing window to the pad. - - virtual void setSubWindow(NCursesWindow& sub); - // Use the subwindow "sub" of the viewport window for the actual viewing. - // The full viewport window is usually used to provide some decorations - // like frames, titles etc. - - virtual void operator() (void); - // Perform Pad's operation -}; - -// A FramedPad is constructed always with a viewport window. This viewport -// will be framed (by a box() command) and the interior of the box is the -// viewport subwindow. On the frame we display scrollbar sliders. -class NCURSES_IMPEXP NCursesFramedPad : public NCursesPad -{ -protected: - virtual void OnOperation(int pad_req); - -public: - NCursesFramedPad(NCursesWindow& win, int nlines, int ncols, - int v_grid = 1, int h_grid = 1) - : NCursesPad(nlines, ncols) { - NCursesPad::setWindow(win, v_grid, h_grid); - NCursesPad::setSubWindow(*(new NCursesWindow(win))); - } - // Construct the FramedPad with the given Window win as viewport. - - virtual ~NCursesFramedPad() { - delete getSubWindow(); - } - - void setWindow(NCursesWindow& view, int v_grid = 1, int h_grid = 1) { - err_handler("Operation not allowed"); - } - // Disable this call; the viewport is already defined - - void setSubWindow(NCursesWindow& sub) { - err_handler("Operation not allowed"); - } - // Disable this call; the viewport subwindow is already defined - -}; - -#endif /* NCURSES_CURSESW_H_incl */ diff --git a/windows/ncurses/include/ncurses/cursslk.h b/windows/ncurses/include/ncurses/cursslk.h deleted file mode 100644 index 4c64f402e..000000000 --- a/windows/ncurses/include/ncurses/cursslk.h +++ /dev/null @@ -1,238 +0,0 @@ -// * this is for making emacs happy: -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ - -/**************************************************************************** - * Author: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -// $Id: cursslk.h,v 1.13 2005/05/28 21:58:18 tom Exp $ - -#ifndef NCURSES_CURSSLK_H_incl -#define NCURSES_CURSSLK_H_incl - -#include - -class NCURSES_IMPEXP Soft_Label_Key_Set { -public: - // This inner class represents the attributes of a Soft Label Key (SLK) - class NCURSES_IMPEXP Soft_Label_Key { - friend class Soft_Label_Key_Set; - public: - typedef enum { Left=0, Center=1, Right=2 } Justification; - - private: - char *label; // The Text of the Label - Justification format; // The Justification - int num; // The number of the Label - - Soft_Label_Key() : label(NULL), format(Left), num(-1) { - } - - virtual ~Soft_Label_Key() { - delete[] label; - }; - - public: - // Set the text of the Label - Soft_Label_Key& operator=(char *text); - - // Set the Justification of the Label - Soft_Label_Key& operator=(Justification just) { - format = just; - return *this; - } - - // Retrieve the text of the label - inline char* operator()(void) const { - return label; - } - - Soft_Label_Key& operator=(const Soft_Label_Key& rhs) - { - if (this != &rhs) { - *this = rhs; - } - return *this; - } - - Soft_Label_Key(const Soft_Label_Key& rhs) - : label(NULL), - format(rhs.format), - num(rhs.num) - { - *this = rhs.label; - } - }; - -public: - typedef enum { - None = -1, - Three_Two_Three = 0, - Four_Four = 1, - PC_Style = 2, - PC_Style_With_Index = 3 - } Label_Layout; - -private: - static long NCURSES_IMPEXP count; // Number of Key Sets - static Label_Layout NCURSES_IMPEXP format; // Layout of the Key Sets - static int NCURSES_IMPEXP num_labels; // Number Of Labels in Key Sets - bool NCURSES_IMPEXP b_attrInit; // Are attributes initialized - - Soft_Label_Key *slk_array; // The array of SLK's - - // Init the Key Set - void init(); - - // Activate or Deactivate Label# i, Label counting starts with 1! - void activate_label(int i, bool bf=TRUE); - - // Activate of Deactivate all Labels - void activate_labels(bool bf); - -protected: - inline void Error (const char* msg) const THROWS(NCursesException) { - THROW(new NCursesException (msg)); - } - - // Remove SLK's from screen - void clear() { - if (ERR==::slk_clear()) - Error("slk_clear"); - } - - // Restore them - void restore() { - if (ERR==::slk_restore()) - Error("slk_restore"); - } - -public: - - // Construct a Key Set, use the most comfortable layout as default. - // You must create a Soft_Label_Key_Set before you create any object of - // the NCursesWindow, NCursesPanel or derived classes. (Actually before - // ::initscr() is called). - Soft_Label_Key_Set(Label_Layout fmt); - - // This constructor assumes, that you already constructed a Key Set - // with a layout by the constructor above. This layout will be reused. - NCURSES_IMPEXP Soft_Label_Key_Set(); - - Soft_Label_Key_Set& operator=(const Soft_Label_Key_Set& rhs) - { - if (this != &rhs) { - *this = rhs; - init(); // allocate a new slk_array[] - } - return *this; - } - - Soft_Label_Key_Set(const Soft_Label_Key_Set& rhs) - : b_attrInit(rhs.b_attrInit), - slk_array(NULL) - { - init(); // allocate a new slk_array[] - } - - virtual ~Soft_Label_Key_Set(); - - // Get Label# i. Label counting starts with 1! - NCURSES_IMPEXP Soft_Label_Key& operator[](int i); - - // Retrieve number of Labels - inline int labels() const { return num_labels; } - - // Refresh the SLK portion of the screen - inline void refresh() { - if (ERR==::slk_refresh()) - Error("slk_refresh"); - } - - // Mark the SLK portion of the screen for refresh, defer actual refresh - // until next update call. - inline void noutrefresh() { - if (ERR==::slk_noutrefresh()) - Error("slk_noutrefresh"); - } - - // Mark the whole SLK portion of the screen as modified - inline void touch() { - if (ERR==::slk_touch()) - Error("slk_touch"); - } - - // Activate Label# i - inline void show(int i) { - activate_label(i,FALSE); - activate_label(i,TRUE); - } - - // Hide Label# i - inline void hide(int i) { - activate_label(i,FALSE); - } - - // Show all Labels - inline void show() { - activate_labels(FALSE); - activate_labels(TRUE); - } - - // Hide all Labels - inline void hide() { - activate_labels(FALSE); - } - - inline void attron(attr_t attrs) { - if (ERR==::slk_attron(attrs)) - Error("slk_attron"); - } - - inline void attroff(attr_t attrs) { - if (ERR==::slk_attroff(attrs)) - Error("slk_attroff"); - } - - inline void attrset(attr_t attrs) { - if (ERR==::slk_attrset(attrs)) - Error("slk_attrset"); - } - - inline void color(short color_pair_number) { - if (ERR==::slk_color(color_pair_number)) - Error("slk_color"); - } - - inline attr_t attr() const { - return ::slk_attr(); - } -}; - -#endif /* NCURSES_CURSSLK_H_incl */ diff --git a/windows/ncurses/include/ncurses/eti.h b/windows/ncurses/include/ncurses/eti.h deleted file mode 100644 index baa6190d8..000000000 --- a/windows/ncurses/include/ncurses/eti.h +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2002,2003 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ - -/**************************************************************************** - * Author: Juergen Pfeifer, 1995,1997 * - ****************************************************************************/ - -/* $Id: eti.h,v 1.8 2003/10/25 15:24:29 tom Exp $ */ - -#ifndef NCURSES_ETI_H_incl -#define NCURSES_ETI_H_incl 1 - -#define E_OK (0) -#define E_SYSTEM_ERROR (-1) -#define E_BAD_ARGUMENT (-2) -#define E_POSTED (-3) -#define E_CONNECTED (-4) -#define E_BAD_STATE (-5) -#define E_NO_ROOM (-6) -#define E_NOT_POSTED (-7) -#define E_UNKNOWN_COMMAND (-8) -#define E_NO_MATCH (-9) -#define E_NOT_SELECTABLE (-10) -#define E_NOT_CONNECTED (-11) -#define E_REQUEST_DENIED (-12) -#define E_INVALID_FIELD (-13) -#define E_CURRENT (-14) - -#endif diff --git a/windows/ncurses/include/ncurses/etip.h b/windows/ncurses/include/ncurses/etip.h deleted file mode 100644 index 82e9409cf..000000000 --- a/windows/ncurses/include/ncurses/etip.h +++ /dev/null @@ -1,378 +0,0 @@ -// * This makes emacs happy -*-Mode: C++;-*- -/**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ - -/**************************************************************************** - * Author: Juergen Pfeifer, 1997 * - ****************************************************************************/ - -// $Id: etip.h.in,v 1.37 2008/08/30 19:27:32 tom Exp $ - -#ifndef NCURSES_ETIP_H_incl -#define NCURSES_ETIP_H_incl 1 - -// These are substituted at configure/build time -#ifndef HAVE_BUILTIN_H -#define HAVE_BUILTIN_H 0 -#endif - -#ifndef HAVE_GXX_BUILTIN_H -#define HAVE_GXX_BUILTIN_H 0 -#endif - -#ifndef HAVE_GPP_BUILTIN_H -#define HAVE_GPP_BUILTIN_H 0 -#endif - -#ifndef HAVE_IOSTREAM -#define HAVE_IOSTREAM 1 -#endif - -#ifndef HAVE_TYPEINFO -#define HAVE_TYPEINFO 1 -#endif - -#ifndef HAVE_VALUES_H -#define HAVE_VALUES_H 0 -#endif - -#ifndef ETIP_NEEDS_MATH_H -#define ETIP_NEEDS_MATH_H 0 -#endif - -#ifndef ETIP_NEEDS_MATH_EXCEPTION -#define ETIP_NEEDS_MATH_EXCEPTION 0 -#endif - -#ifndef CPP_HAS_PARAM_INIT -#define CPP_HAS_PARAM_INIT 0 -#endif - -#ifndef CPP_HAS_STATIC_CAST -#define CPP_HAS_STATIC_CAST 1 -#endif - -#ifndef IOSTREAM_NAMESPACE -#define IOSTREAM_NAMESPACE 1 -#endif - -#ifdef __GNUG__ -# if ((__GNUG__ <= 2) && (__GNUC_MINOR__ < 8)) -# if HAVE_TYPEINFO -# include -# endif -# endif -#endif - -#if defined(__GNUG__) -# if HAVE_BUILTIN_H || HAVE_GXX_BUILTIN_H || HAVE_GPP_BUILTIN_H -# if ETIP_NEEDS_MATH_H -# if ETIP_NEEDS_MATH_EXCEPTION -# undef exception -# define exception math_exception -# endif -# include -# endif -# undef exception -# define exception builtin_exception -# if HAVE_GPP_BUILTIN_H -# include -# elif HAVE_GXX_BUILTIN_H -# include -# else -# include -# endif -# undef exception -# endif -#elif defined (__SUNPRO_CC) -# include -#endif - -#include - -extern "C" { -#if HAVE_VALUES_H -# include -#endif - -#include -#include -#include -} - -// Language features -#if CPP_HAS_PARAM_INIT -#define NCURSES_PARAM_INIT(value) = value -#else -#define NCURSES_PARAM_INIT(value) /*nothing*/ -#endif - -#if CPP_HAS_STATIC_CAST -#define STATIC_CAST(s) static_cast -#else -#define STATIC_CAST(s) (s) -#endif - -// Forward Declarations -class NCURSES_IMPEXP NCursesPanel; -class NCURSES_IMPEXP NCursesMenu; -class NCURSES_IMPEXP NCursesForm; - -class NCURSES_IMPEXP NCursesException -{ -public: - const char *message; - int errorno; - - NCursesException (const char* msg, int err) - : message(msg), errorno (err) - {}; - - NCursesException (const char* msg) - : message(msg), errorno (E_SYSTEM_ERROR) - {}; - - NCursesException& operator=(const NCursesException& rhs) - { - errorno = rhs.errorno; - return *this; - } - - NCursesException(const NCursesException& rhs) - : message(rhs.message), errorno(rhs.errorno) - { - } - - virtual const char *classname() const { - return "NCursesWindow"; - } - - virtual ~NCursesException() - { - } -}; - -class NCURSES_IMPEXP NCursesPanelException : public NCursesException -{ -public: - const NCursesPanel* p; - - NCursesPanelException (const char *msg, int err) : - NCursesException (msg, err), - p (NULL) - {}; - - NCursesPanelException (const NCursesPanel* panel, - const char *msg, - int err) : - NCursesException (msg, err), - p (panel) - {}; - - NCursesPanelException (int err) : - NCursesException ("panel library error", err), - p (NULL) - {}; - - NCursesPanelException (const NCursesPanel* panel, - int err) : - NCursesException ("panel library error", err), - p (panel) - {}; - - NCursesPanelException& operator=(const NCursesPanelException& rhs) - { - if (this != &rhs) { - NCursesException::operator=(rhs); - p = rhs.p; - } - return *this; - } - - NCursesPanelException(const NCursesPanelException& rhs) - : NCursesException(rhs), p(rhs.p) - { - } - - virtual const char *classname() const { - return "NCursesPanel"; - } - - virtual ~NCursesPanelException() - { - } -}; - -class NCURSES_IMPEXP NCursesMenuException : public NCursesException -{ -public: - const NCursesMenu* m; - - NCursesMenuException (const char *msg, int err) : - NCursesException (msg, err), - m (NULL) - {}; - - NCursesMenuException (const NCursesMenu* menu, - const char *msg, - int err) : - NCursesException (msg, err), - m (menu) - {}; - - NCursesMenuException (int err) : - NCursesException ("menu library error", err), - m (NULL) - {}; - - NCursesMenuException (const NCursesMenu* menu, - int err) : - NCursesException ("menu library error", err), - m (menu) - {}; - - NCursesMenuException& operator=(const NCursesMenuException& rhs) - { - if (this != &rhs) { - NCursesException::operator=(rhs); - m = rhs.m; - } - return *this; - } - - NCursesMenuException(const NCursesMenuException& rhs) - : NCursesException(rhs), m(rhs.m) - { - } - - virtual const char *classname() const { - return "NCursesMenu"; - } - - virtual ~NCursesMenuException() - { - } -}; - -class NCURSES_IMPEXP NCursesFormException : public NCursesException -{ -public: - const NCursesForm* f; - - NCursesFormException (const char *msg, int err) : - NCursesException (msg, err), - f (NULL) - {}; - - NCursesFormException (const NCursesForm* form, - const char *msg, - int err) : - NCursesException (msg, err), - f (form) - {}; - - NCursesFormException (int err) : - NCursesException ("form library error", err), - f (NULL) - {}; - - NCursesFormException (const NCursesForm* form, - int err) : - NCursesException ("form library error", err), - f (form) - {}; - - NCursesFormException& operator=(const NCursesFormException& rhs) - { - if (this != &rhs) { - NCursesException::operator=(rhs); - f = rhs.f; - } - return *this; - } - - NCursesFormException(const NCursesFormException& rhs) - : NCursesException(rhs), f(rhs.f) - { - } - - virtual const char *classname() const { - return "NCursesForm"; - } - - virtual ~NCursesFormException() - { - } -}; - -#if !((defined(__GNUG__) && defined(__EXCEPTIONS)) || defined(__SUNPRO_CC)) -# if HAVE_IOSTREAM -# include -# if IOSTREAM_NAMESPACE -using std::cerr; -using std::endl; -# endif -# else -# include -# endif - extern "C" void exit(int); -#endif - -inline void THROW(const NCursesException *e) { -#if defined(__GNUG__) && defined(__EXCEPTIONS) -# if ((__GNUG__ <= 2) && (__GNUC_MINOR__ < 8)) - (*lib_error_handler)(e ? e->classname() : "", e ? e->message : ""); -#else -#define CPP_HAS_TRY_CATCH 1 -#endif -#elif defined(__SUNPRO_CC) -# if !defined(__SUNPRO_CC_COMPAT) || (__SUNPRO_CC_COMPAT < 5) - genericerror(1, ((e != 0) ? (char *)(e->message) : "")); -#else -#define CPP_HAS_TRY_CATCH 1 -#endif -#else - if (e) - cerr << e->message << endl; - exit(0); -#endif - -#ifndef CPP_HAS_TRY_CATCH -#define CPP_HAS_TRY_CATCH 0 -#define NCURSES_CPP_TRY /* nothing */ -#define NCURSES_CPP_CATCH(e) if (false) -#define THROWS(s) /* nothing */ -#elif CPP_HAS_TRY_CATCH - throw *e; -#define NCURSES_CPP_TRY try -#define NCURSES_CPP_CATCH(e) catch(e) -#define THROWS(s) throw(s) -#endif -} - -#endif /* NCURSES_ETIP_H_incl */ diff --git a/windows/ncurses/include/ncurses/form.h b/windows/ncurses/include/ncurses/form.h deleted file mode 100644 index 80886ac3a..000000000 --- a/windows/ncurses/include/ncurses/form.h +++ /dev/null @@ -1,422 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2004,2009 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ - -/**************************************************************************** - * Author: Juergen Pfeifer, 1995,1997 * - ****************************************************************************/ - -/* $Id: form.h,v 0.21 2009/11/07 19:31:11 tom Exp $ */ - -#ifndef FORM_H -#define FORM_H - -#include -#include - -#ifdef __cplusplus - extern "C" { -#endif - -#ifndef FORM_PRIV_H -typedef void *FIELD_CELL; -#endif - -#ifndef NCURSES_FIELD_INTERNALS -#define NCURSES_FIELD_INTERNALS /* nothing */ -#endif - -typedef int Form_Options; -typedef int Field_Options; - - /********** - * _PAGE * - **********/ - -typedef struct { - short pmin; /* index of first field on page */ - short pmax; /* index of last field on page */ - short smin; /* index of top leftmost field on page */ - short smax; /* index of bottom rightmost field on page */ -} _PAGE; - - /********** - * FIELD * - **********/ - -typedef struct fieldnode { - unsigned short status; /* flags */ - short rows; /* size in rows */ - short cols; /* size in cols */ - short frow; /* first row */ - short fcol; /* first col */ - int drows; /* dynamic rows */ - int dcols; /* dynamic cols */ - int maxgrow; /* maximum field growth */ - int nrow; /* off-screen rows */ - short nbuf; /* additional buffers */ - short just; /* justification */ - short page; /* page on form */ - short index; /* into form -> field */ - int pad; /* pad character */ - chtype fore; /* foreground attribute */ - chtype back; /* background attribute */ - Field_Options opts; /* options */ - struct fieldnode * snext; /* sorted order pointer */ - struct fieldnode * sprev; /* sorted order pointer */ - struct fieldnode * link; /* linked field chain */ - struct formnode * form; /* containing form */ - struct typenode * type; /* field type */ - void * arg; /* argument for type */ - FIELD_CELL * buf; /* field buffers */ - void * usrptr; /* user pointer */ - /* - * The wide-character configuration requires extra information. Because - * there are existing applications that manipulate the members of FIELD - * directly, we cannot make the struct opaque. Offsets of members up to - * this point are the same in the narrow- and wide-character configuration. - * But note that the type of buf depends on the configuration, and is made - * opaque for that reason. - */ - NCURSES_FIELD_INTERNALS -} FIELD; - - - /********* - * FORM * - *********/ - -typedef struct formnode { - unsigned short status; /* flags */ - short rows; /* size in rows */ - short cols; /* size in cols */ - int currow; /* current row in field window */ - int curcol; /* current col in field window */ - int toprow; /* in scrollable field window */ - int begincol; /* in horiz. scrollable field */ - short maxfield; /* number of fields */ - short maxpage; /* number of pages */ - short curpage; /* index into page */ - Form_Options opts; /* options */ - WINDOW * win; /* window */ - WINDOW * sub; /* subwindow */ - WINDOW * w; /* window for current field */ - FIELD ** field; /* field [maxfield] */ - FIELD * current; /* current field */ - _PAGE * page; /* page [maxpage] */ - void * usrptr; /* user pointer */ - - void (*forminit)(struct formnode *); - void (*formterm)(struct formnode *); - void (*fieldinit)(struct formnode *); - void (*fieldterm)(struct formnode *); - -} FORM; - - - /************** - * FIELDTYPE * - **************/ - -typedef struct typenode { - unsigned short status; /* flags */ - long ref; /* reference count */ - struct typenode * left; /* ptr to operand for | */ - struct typenode * right; /* ptr to operand for | */ - - void* (*makearg)(va_list *); /* make fieldtype arg */ - void* (*copyarg)(const void *); /* copy fieldtype arg */ - void (*freearg)(void *); /* free fieldtype arg */ - -#if NCURSES_INTEROP_FUNCS - union { - bool (*ofcheck)(FIELD *,const void *); /* field validation */ - bool (*gfcheck)(FORM*,FIELD *,const void*); /* generic field validation */ - } fieldcheck; - union { - bool (*occheck)(int,const void *); /* character validation */ - bool (*gccheck)(int,FORM*, - FIELD*,const void*); /* generic char validation */ - } charcheck; - union { - bool (*onext)(FIELD *,const void *); /* enumerate next value */ - bool (*gnext)(FORM*,FIELD*,const void*); /* generic enumerate next */ - } enum_next; - union { - bool (*oprev)(FIELD *,const void *); /* enumerate prev value */ - bool (*gprev)(FORM*,FIELD*,const void*); /* generic enumerate prev */ - } enum_prev; - void* (*genericarg)(void*); /* Alternate Arg method */ -#else - bool (*fcheck)(FIELD *,const void *); /* field validation */ - bool (*ccheck)(int,const void *); /* character validation */ - - bool (*next)(FIELD *,const void *); /* enumerate next value */ - bool (*prev)(FIELD *,const void *); /* enumerate prev value */ -#endif -} FIELDTYPE; - -typedef void (*Form_Hook)(FORM *); - - /*************************** - * miscellaneous #defines * - ***************************/ - -/* field justification */ -#define NO_JUSTIFICATION (0) -#define JUSTIFY_LEFT (1) -#define JUSTIFY_CENTER (2) -#define JUSTIFY_RIGHT (3) - -/* field options */ -#define O_VISIBLE (0x0001U) -#define O_ACTIVE (0x0002U) -#define O_PUBLIC (0x0004U) -#define O_EDIT (0x0008U) -#define O_WRAP (0x0010U) -#define O_BLANK (0x0020U) -#define O_AUTOSKIP (0x0040U) -#define O_NULLOK (0x0080U) -#define O_PASSOK (0x0100U) -#define O_STATIC (0x0200U) - -/* form options */ -#define O_NL_OVERLOAD (0x0001U) -#define O_BS_OVERLOAD (0x0002U) - -/* form driver commands */ -#define REQ_NEXT_PAGE (KEY_MAX + 1) /* move to next page */ -#define REQ_PREV_PAGE (KEY_MAX + 2) /* move to previous page */ -#define REQ_FIRST_PAGE (KEY_MAX + 3) /* move to first page */ -#define REQ_LAST_PAGE (KEY_MAX + 4) /* move to last page */ - -#define REQ_NEXT_FIELD (KEY_MAX + 5) /* move to next field */ -#define REQ_PREV_FIELD (KEY_MAX + 6) /* move to previous field */ -#define REQ_FIRST_FIELD (KEY_MAX + 7) /* move to first field */ -#define REQ_LAST_FIELD (KEY_MAX + 8) /* move to last field */ -#define REQ_SNEXT_FIELD (KEY_MAX + 9) /* move to sorted next field */ -#define REQ_SPREV_FIELD (KEY_MAX + 10) /* move to sorted prev field */ -#define REQ_SFIRST_FIELD (KEY_MAX + 11) /* move to sorted first field */ -#define REQ_SLAST_FIELD (KEY_MAX + 12) /* move to sorted last field */ -#define REQ_LEFT_FIELD (KEY_MAX + 13) /* move to left to field */ -#define REQ_RIGHT_FIELD (KEY_MAX + 14) /* move to right to field */ -#define REQ_UP_FIELD (KEY_MAX + 15) /* move to up to field */ -#define REQ_DOWN_FIELD (KEY_MAX + 16) /* move to down to field */ - -#define REQ_NEXT_CHAR (KEY_MAX + 17) /* move to next char in field */ -#define REQ_PREV_CHAR (KEY_MAX + 18) /* move to prev char in field */ -#define REQ_NEXT_LINE (KEY_MAX + 19) /* move to next line in field */ -#define REQ_PREV_LINE (KEY_MAX + 20) /* move to prev line in field */ -#define REQ_NEXT_WORD (KEY_MAX + 21) /* move to next word in field */ -#define REQ_PREV_WORD (KEY_MAX + 22) /* move to prev word in field */ -#define REQ_BEG_FIELD (KEY_MAX + 23) /* move to first char in field */ -#define REQ_END_FIELD (KEY_MAX + 24) /* move after last char in fld */ -#define REQ_BEG_LINE (KEY_MAX + 25) /* move to beginning of line */ -#define REQ_END_LINE (KEY_MAX + 26) /* move after last char in line */ -#define REQ_LEFT_CHAR (KEY_MAX + 27) /* move left in field */ -#define REQ_RIGHT_CHAR (KEY_MAX + 28) /* move right in field */ -#define REQ_UP_CHAR (KEY_MAX + 29) /* move up in field */ -#define REQ_DOWN_CHAR (KEY_MAX + 30) /* move down in field */ - -#define REQ_NEW_LINE (KEY_MAX + 31) /* insert/overlay new line */ -#define REQ_INS_CHAR (KEY_MAX + 32) /* insert blank char at cursor */ -#define REQ_INS_LINE (KEY_MAX + 33) /* insert blank line at cursor */ -#define REQ_DEL_CHAR (KEY_MAX + 34) /* delete char at cursor */ -#define REQ_DEL_PREV (KEY_MAX + 35) /* delete char before cursor */ -#define REQ_DEL_LINE (KEY_MAX + 36) /* delete line at cursor */ -#define REQ_DEL_WORD (KEY_MAX + 37) /* delete word at cursor */ -#define REQ_CLR_EOL (KEY_MAX + 38) /* clear to end of line */ -#define REQ_CLR_EOF (KEY_MAX + 39) /* clear to end of field */ -#define REQ_CLR_FIELD (KEY_MAX + 40) /* clear entire field */ -#define REQ_OVL_MODE (KEY_MAX + 41) /* begin overlay mode */ -#define REQ_INS_MODE (KEY_MAX + 42) /* begin insert mode */ -#define REQ_SCR_FLINE (KEY_MAX + 43) /* scroll field forward a line */ -#define REQ_SCR_BLINE (KEY_MAX + 44) /* scroll field backward a line */ -#define REQ_SCR_FPAGE (KEY_MAX + 45) /* scroll field forward a page */ -#define REQ_SCR_BPAGE (KEY_MAX + 46) /* scroll field backward a page */ -#define REQ_SCR_FHPAGE (KEY_MAX + 47) /* scroll field forward half page */ -#define REQ_SCR_BHPAGE (KEY_MAX + 48) /* scroll field backward half page */ -#define REQ_SCR_FCHAR (KEY_MAX + 49) /* horizontal scroll char */ -#define REQ_SCR_BCHAR (KEY_MAX + 50) /* horizontal scroll char */ -#define REQ_SCR_HFLINE (KEY_MAX + 51) /* horizontal scroll line */ -#define REQ_SCR_HBLINE (KEY_MAX + 52) /* horizontal scroll line */ -#define REQ_SCR_HFHALF (KEY_MAX + 53) /* horizontal scroll half line */ -#define REQ_SCR_HBHALF (KEY_MAX + 54) /* horizontal scroll half line */ - -#define REQ_VALIDATION (KEY_MAX + 55) /* validate field */ -#define REQ_NEXT_CHOICE (KEY_MAX + 56) /* display next field choice */ -#define REQ_PREV_CHOICE (KEY_MAX + 57) /* display prev field choice */ - -#define MIN_FORM_COMMAND (KEY_MAX + 1) /* used by form_driver */ -#define MAX_FORM_COMMAND (KEY_MAX + 57) /* used by form_driver */ - -#if defined(MAX_COMMAND) -# if (MAX_FORM_COMMAND > MAX_COMMAND) -# error Something is wrong -- MAX_FORM_COMMAND is greater than MAX_COMMAND -# elif (MAX_COMMAND != (KEY_MAX + 128)) -# error Something is wrong -- MAX_COMMAND is already inconsistently defined. -# endif -#else -# define MAX_COMMAND (KEY_MAX + 128) -#endif - - /************************* - * standard field types * - *************************/ -extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ALPHA; -extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ALNUM; -extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_ENUM; -extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_INTEGER; -extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_NUMERIC; -extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_REGEXP; - - /************************************ - * built-in additional field types * - * They are not defined in SVr4 * - ************************************/ -extern NCURSES_EXPORT_VAR(FIELDTYPE *) TYPE_IPV4; /* Internet IP Version 4 address */ - - /*********************** - * FIELDTYPE routines * - ***********************/ -extern NCURSES_EXPORT(FIELDTYPE *) new_fieldtype ( - bool (* const field_check)(FIELD *,const void *), - bool (* const char_check)(int,const void *)); -extern NCURSES_EXPORT(FIELDTYPE *) link_fieldtype( - FIELDTYPE *, FIELDTYPE *); - -extern NCURSES_EXPORT(int) free_fieldtype (FIELDTYPE *); -extern NCURSES_EXPORT(int) set_fieldtype_arg (FIELDTYPE *, - void * (* const make_arg)(va_list *), - void * (* const copy_arg)(const void *), - void (* const free_arg)(void *)); -extern NCURSES_EXPORT(int) set_fieldtype_choice (FIELDTYPE *, - bool (* const next_choice)(FIELD *,const void *), - bool (* const prev_choice)(FIELD *,const void *)); - - /******************* - * FIELD routines * - *******************/ -extern NCURSES_EXPORT(FIELD *) new_field (int,int,int,int,int,int); -extern NCURSES_EXPORT(FIELD *) dup_field (FIELD *,int,int); -extern NCURSES_EXPORT(FIELD *) link_field (FIELD *,int,int); - -extern NCURSES_EXPORT(int) free_field (FIELD *); -extern NCURSES_EXPORT(int) field_info (const FIELD *,int *,int *,int *,int *,int *,int *); -extern NCURSES_EXPORT(int) dynamic_field_info (const FIELD *,int *,int *,int *); -extern NCURSES_EXPORT(int) set_max_field ( FIELD *,int); -extern NCURSES_EXPORT(int) move_field (FIELD *,int,int); -extern NCURSES_EXPORT(int) set_field_type (FIELD *,FIELDTYPE *,...); -extern NCURSES_EXPORT(int) set_new_page (FIELD *,bool); -extern NCURSES_EXPORT(int) set_field_just (FIELD *,int); -extern NCURSES_EXPORT(int) field_just (const FIELD *); -extern NCURSES_EXPORT(int) set_field_fore (FIELD *,chtype); -extern NCURSES_EXPORT(int) set_field_back (FIELD *,chtype); -extern NCURSES_EXPORT(int) set_field_pad (FIELD *,int); -extern NCURSES_EXPORT(int) field_pad (const FIELD *); -extern NCURSES_EXPORT(int) set_field_buffer (FIELD *,int,const char *); -extern NCURSES_EXPORT(int) set_field_status (FIELD *,bool); -extern NCURSES_EXPORT(int) set_field_userptr (FIELD *, void *); -extern NCURSES_EXPORT(int) set_field_opts (FIELD *,Field_Options); -extern NCURSES_EXPORT(int) field_opts_on (FIELD *,Field_Options); -extern NCURSES_EXPORT(int) field_opts_off (FIELD *,Field_Options); - -extern NCURSES_EXPORT(chtype) field_fore (const FIELD *); -extern NCURSES_EXPORT(chtype) field_back (const FIELD *); - -extern NCURSES_EXPORT(bool) new_page (const FIELD *); -extern NCURSES_EXPORT(bool) field_status (const FIELD *); - -extern NCURSES_EXPORT(void *) field_arg (const FIELD *); - -extern NCURSES_EXPORT(void *) field_userptr (const FIELD *); - -extern NCURSES_EXPORT(FIELDTYPE *) field_type (const FIELD *); - -extern NCURSES_EXPORT(char *) field_buffer (const FIELD *,int); - -extern NCURSES_EXPORT(Field_Options) field_opts (const FIELD *); - - /****************** - * FORM routines * - ******************/ - -extern NCURSES_EXPORT(FORM *) new_form (FIELD **); - -extern NCURSES_EXPORT(FIELD **) form_fields (const FORM *); -extern NCURSES_EXPORT(FIELD *) current_field (const FORM *); - -extern NCURSES_EXPORT(WINDOW *) form_win (const FORM *); -extern NCURSES_EXPORT(WINDOW *) form_sub (const FORM *); - -extern NCURSES_EXPORT(Form_Hook) form_init (const FORM *); -extern NCURSES_EXPORT(Form_Hook) form_term (const FORM *); -extern NCURSES_EXPORT(Form_Hook) field_init (const FORM *); -extern NCURSES_EXPORT(Form_Hook) field_term (const FORM *); - -extern NCURSES_EXPORT(int) free_form (FORM *); -extern NCURSES_EXPORT(int) set_form_fields (FORM *,FIELD **); -extern NCURSES_EXPORT(int) field_count (const FORM *); -extern NCURSES_EXPORT(int) set_form_win (FORM *,WINDOW *); -extern NCURSES_EXPORT(int) set_form_sub (FORM *,WINDOW *); -extern NCURSES_EXPORT(int) set_current_field (FORM *,FIELD *); -extern NCURSES_EXPORT(int) field_index (const FIELD *); -extern NCURSES_EXPORT(int) set_form_page (FORM *,int); -extern NCURSES_EXPORT(int) form_page (const FORM *); -extern NCURSES_EXPORT(int) scale_form (const FORM *,int *,int *); -extern NCURSES_EXPORT(int) set_form_init (FORM *,Form_Hook); -extern NCURSES_EXPORT(int) set_form_term (FORM *,Form_Hook); -extern NCURSES_EXPORT(int) set_field_init (FORM *,Form_Hook); -extern NCURSES_EXPORT(int) set_field_term (FORM *,Form_Hook); -extern NCURSES_EXPORT(int) post_form (FORM *); -extern NCURSES_EXPORT(int) unpost_form (FORM *); -extern NCURSES_EXPORT(int) pos_form_cursor (FORM *); -extern NCURSES_EXPORT(int) form_driver (FORM *,int); -extern NCURSES_EXPORT(int) set_form_userptr (FORM *,void *); -extern NCURSES_EXPORT(int) set_form_opts (FORM *,Form_Options); -extern NCURSES_EXPORT(int) form_opts_on (FORM *,Form_Options); -extern NCURSES_EXPORT(int) form_opts_off (FORM *,Form_Options); -extern NCURSES_EXPORT(int) form_request_by_name (const char *); - -extern NCURSES_EXPORT(const char *) form_request_name (int); - -extern NCURSES_EXPORT(void *) form_userptr (const FORM *); - -extern NCURSES_EXPORT(Form_Options) form_opts (const FORM *); - -extern NCURSES_EXPORT(bool) data_ahead (const FORM *); -extern NCURSES_EXPORT(bool) data_behind (const FORM *); - -#if NCURSES_SP_FUNCS -extern NCURSES_EXPORT(FORM *) NCURSES_SP_NAME(new_form) (SCREEN*, FIELD **); -#endif - -#ifdef __cplusplus - } -#endif - -#endif /* FORM_H */ diff --git a/windows/ncurses/include/ncurses/menu.h b/windows/ncurses/include/ncurses/menu.h deleted file mode 100644 index 48eaa3f1d..000000000 --- a/windows/ncurses/include/ncurses/menu.h +++ /dev/null @@ -1,260 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2007,2009 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ - -/**************************************************************************** - * Author: Juergen Pfeifer, 1995,1997 * - ****************************************************************************/ - -/* $Id: menu.h,v 1.20 2009/04/05 00:28:07 tom Exp $ */ - -#ifndef ETI_MENU -#define ETI_MENU - -#ifdef AMIGA -#define TEXT TEXT_ncurses -#endif - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef int Menu_Options; -typedef int Item_Options; - -/* Menu options: */ -#define O_ONEVALUE (0x01) -#define O_SHOWDESC (0x02) -#define O_ROWMAJOR (0x04) -#define O_IGNORECASE (0x08) -#define O_SHOWMATCH (0x10) -#define O_NONCYCLIC (0x20) - -/* Item options: */ -#define O_SELECTABLE (0x01) - -typedef struct -{ - const char* str; - unsigned short length; -} TEXT; - -typedef struct tagITEM -{ - TEXT name; /* name of menu item */ - TEXT description; /* description of item, optional in display */ - struct tagMENU *imenu; /* Pointer to parent menu */ - void *userptr; /* Pointer to user defined per item data */ - Item_Options opt; /* Item options */ - short index; /* Item number if connected to a menu */ - short y; /* y and x location of item in menu */ - short x; - bool value; /* Selection value */ - - struct tagITEM *left; /* neighbor items */ - struct tagITEM *right; - struct tagITEM *up; - struct tagITEM *down; - -} ITEM; - -typedef void (*Menu_Hook)(struct tagMENU *); - -typedef struct tagMENU -{ - short height; /* Nr. of chars high */ - short width; /* Nr. of chars wide */ - short rows; /* Nr. of items high */ - short cols; /* Nr. of items wide */ - short frows; /* Nr. of formatted items high */ - short fcols; /* Nr. of formatted items wide */ - short arows; /* Nr. of items high (actual) */ - short namelen; /* Max. name length */ - short desclen; /* Max. description length */ - short marklen; /* Length of mark, if any */ - short itemlen; /* Length of one item */ - short spc_desc; /* Spacing for descriptor */ - short spc_cols; /* Spacing for columns */ - short spc_rows; /* Spacing for rows */ - char *pattern; /* Buffer to store match chars */ - short pindex; /* Index into pattern buffer */ - WINDOW *win; /* Window containing menu */ - WINDOW *sub; /* Subwindow for menu display */ - WINDOW *userwin; /* User's window */ - WINDOW *usersub; /* User's subwindow */ - ITEM **items; /* array of items */ - short nitems; /* Nr. of items in menu */ - ITEM *curitem; /* Current item */ - short toprow; /* Top row of menu */ - chtype fore; /* Selection attribute */ - chtype back; /* Nonselection attribute */ - chtype grey; /* Inactive attribute */ - unsigned char pad; /* Pad character */ - - Menu_Hook menuinit; /* User hooks */ - Menu_Hook menuterm; - Menu_Hook iteminit; - Menu_Hook itemterm; - - void *userptr; /* Pointer to menus user data */ - char *mark; /* Pointer to marker string */ - - Menu_Options opt; /* Menu options */ - unsigned short status; /* Internal state of menu */ - -} MENU; - - -/* Define keys */ - -#define REQ_LEFT_ITEM (KEY_MAX + 1) -#define REQ_RIGHT_ITEM (KEY_MAX + 2) -#define REQ_UP_ITEM (KEY_MAX + 3) -#define REQ_DOWN_ITEM (KEY_MAX + 4) -#define REQ_SCR_ULINE (KEY_MAX + 5) -#define REQ_SCR_DLINE (KEY_MAX + 6) -#define REQ_SCR_DPAGE (KEY_MAX + 7) -#define REQ_SCR_UPAGE (KEY_MAX + 8) -#define REQ_FIRST_ITEM (KEY_MAX + 9) -#define REQ_LAST_ITEM (KEY_MAX + 10) -#define REQ_NEXT_ITEM (KEY_MAX + 11) -#define REQ_PREV_ITEM (KEY_MAX + 12) -#define REQ_TOGGLE_ITEM (KEY_MAX + 13) -#define REQ_CLEAR_PATTERN (KEY_MAX + 14) -#define REQ_BACK_PATTERN (KEY_MAX + 15) -#define REQ_NEXT_MATCH (KEY_MAX + 16) -#define REQ_PREV_MATCH (KEY_MAX + 17) - -#define MIN_MENU_COMMAND (KEY_MAX + 1) -#define MAX_MENU_COMMAND (KEY_MAX + 17) - -/* - * Some AT&T code expects MAX_COMMAND to be out-of-band not - * just for menu commands but for forms ones as well. - */ -#if defined(MAX_COMMAND) -# if (MAX_MENU_COMMAND > MAX_COMMAND) -# error Something is wrong -- MAX_MENU_COMMAND is greater than MAX_COMMAND -# elif (MAX_COMMAND != (KEY_MAX + 128)) -# error Something is wrong -- MAX_COMMAND is already inconsistently defined. -# endif -#else -# define MAX_COMMAND (KEY_MAX + 128) -#endif - - -/* --------- prototypes for libmenu functions ----------------------------- */ - -extern NCURSES_EXPORT(ITEM **) menu_items (const MENU *); -extern NCURSES_EXPORT(ITEM *) current_item (const MENU *); -extern NCURSES_EXPORT(ITEM *) new_item (const char *,const char *); - -extern NCURSES_EXPORT(MENU *) new_menu (ITEM **); - -extern NCURSES_EXPORT(Item_Options) item_opts (const ITEM *); -extern NCURSES_EXPORT(Menu_Options) menu_opts (const MENU *); - -extern NCURSES_EXPORT(Menu_Hook) item_init (const MENU *); -extern NCURSES_EXPORT(Menu_Hook) item_term (const MENU *); -extern NCURSES_EXPORT(Menu_Hook) menu_init (const MENU *); -extern NCURSES_EXPORT(Menu_Hook) menu_term (const MENU *); - -extern NCURSES_EXPORT(WINDOW *) menu_sub (const MENU *); -extern NCURSES_EXPORT(WINDOW *) menu_win (const MENU *); - -extern NCURSES_EXPORT(const char *) item_description (const ITEM *); -extern NCURSES_EXPORT(const char *) item_name (const ITEM *); -extern NCURSES_EXPORT(const char *) menu_mark (const MENU *); -extern NCURSES_EXPORT(const char *) menu_request_name (int); - -extern NCURSES_EXPORT(char *) menu_pattern (const MENU *); - -extern NCURSES_EXPORT(void *) menu_userptr (const MENU *); -extern NCURSES_EXPORT(void *) item_userptr (const ITEM *); - -extern NCURSES_EXPORT(chtype) menu_back (const MENU *); -extern NCURSES_EXPORT(chtype) menu_fore (const MENU *); -extern NCURSES_EXPORT(chtype) menu_grey (const MENU *); - -extern NCURSES_EXPORT(int) free_item (ITEM *); -extern NCURSES_EXPORT(int) free_menu (MENU *); -extern NCURSES_EXPORT(int) item_count (const MENU *); -extern NCURSES_EXPORT(int) item_index (const ITEM *); -extern NCURSES_EXPORT(int) item_opts_off (ITEM *,Item_Options); -extern NCURSES_EXPORT(int) item_opts_on (ITEM *,Item_Options); -extern NCURSES_EXPORT(int) menu_driver (MENU *,int); -extern NCURSES_EXPORT(int) menu_opts_off (MENU *,Menu_Options); -extern NCURSES_EXPORT(int) menu_opts_on (MENU *,Menu_Options); -extern NCURSES_EXPORT(int) menu_pad (const MENU *); -extern NCURSES_EXPORT(int) pos_menu_cursor (const MENU *); -extern NCURSES_EXPORT(int) post_menu (MENU *); -extern NCURSES_EXPORT(int) scale_menu (const MENU *,int *,int *); -extern NCURSES_EXPORT(int) set_current_item (MENU *menu,ITEM *item); -extern NCURSES_EXPORT(int) set_item_init (MENU *, Menu_Hook); -extern NCURSES_EXPORT(int) set_item_opts (ITEM *,Item_Options); -extern NCURSES_EXPORT(int) set_item_term (MENU *, Menu_Hook); -extern NCURSES_EXPORT(int) set_item_userptr (ITEM *, void *); -extern NCURSES_EXPORT(int) set_item_value (ITEM *,bool); -extern NCURSES_EXPORT(int) set_menu_back (MENU *,chtype); -extern NCURSES_EXPORT(int) set_menu_fore (MENU *,chtype); -extern NCURSES_EXPORT(int) set_menu_format (MENU *,int,int); -extern NCURSES_EXPORT(int) set_menu_grey (MENU *,chtype); -extern NCURSES_EXPORT(int) set_menu_init (MENU *, Menu_Hook); -extern NCURSES_EXPORT(int) set_menu_items (MENU *,ITEM **); -extern NCURSES_EXPORT(int) set_menu_mark (MENU *, const char *); -extern NCURSES_EXPORT(int) set_menu_opts (MENU *,Menu_Options); -extern NCURSES_EXPORT(int) set_menu_pad (MENU *,int); -extern NCURSES_EXPORT(int) set_menu_pattern (MENU *,const char *); -extern NCURSES_EXPORT(int) set_menu_sub (MENU *,WINDOW *); -extern NCURSES_EXPORT(int) set_menu_term (MENU *, Menu_Hook); -extern NCURSES_EXPORT(int) set_menu_userptr (MENU *,void *); -extern NCURSES_EXPORT(int) set_menu_win (MENU *,WINDOW *); -extern NCURSES_EXPORT(int) set_top_row (MENU *,int); -extern NCURSES_EXPORT(int) top_row (const MENU *); -extern NCURSES_EXPORT(int) unpost_menu (MENU *); -extern NCURSES_EXPORT(int) menu_request_by_name (const char *); -extern NCURSES_EXPORT(int) set_menu_spacing (MENU *,int,int,int); -extern NCURSES_EXPORT(int) menu_spacing (const MENU *,int *,int *,int *); - - -extern NCURSES_EXPORT(bool) item_value (const ITEM *); -extern NCURSES_EXPORT(bool) item_visible (const ITEM *); - -extern NCURSES_EXPORT(void) menu_format (const MENU *,int *,int *); - -#if NCURSES_SP_FUNCS -extern NCURSES_EXPORT(MENU *) NCURSES_SP_NAME(new_menu) (SCREEN*, ITEM **); -#endif - -#ifdef __cplusplus - } -#endif - -#endif /* ETI_MENU */ diff --git a/windows/ncurses/include/ncurses/nc_tparm.h b/windows/ncurses/include/ncurses/nc_tparm.h deleted file mode 100644 index a8dbcacb1..000000000 --- a/windows/ncurses/include/ncurses/nc_tparm.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** - * Copyright (c) 2006,2010 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ - -/**************************************************************************** - * Author: Thomas E. Dickey 2006 * - ****************************************************************************/ - -/* $Id: nc_tparm.h,v 1.5 2010/12/25 20:27:22 tom Exp $ */ - -#ifndef NC_TPARM_included -#define NC_TPARM_included 1 - -/* - * Cast parameters past the formatting-string for tparm() to match the - * assumption of the varargs code. - */ -#ifndef TPARM_ARG -#define TPARM_ARG long -#endif - -#define TPARM_N(n) (TPARM_ARG)(n) - -#define TPARM_9(a,b,c,d,e,f,g,h,i,j) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h),TPARM_N(i),TPARM_N(j)) - -#if NCURSES_TPARM_VARARGS -#define TPARM_8(a,b,c,d,e,f,g,h,i) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h),TPARM_N(i)) -#define TPARM_7(a,b,c,d,e,f,g,h) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h)) -#define TPARM_6(a,b,c,d,e,f,g) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g)) -#define TPARM_5(a,b,c,d,e,f) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f)) -#define TPARM_4(a,b,c,d,e) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e)) -#define TPARM_3(a,b,c,d) tparm(a,TPARM_N(b),TPARM_N(c),TPARM_N(d)) -#define TPARM_2(a,b,c) tparm(a,TPARM_N(b),TPARM_N(c)) -#define TPARM_1(a,b) tparm(a,TPARM_N(b)) -#define TPARM_0(a) tparm(a) -#else -#define TPARM_8(a,b,c,d,e,f,g,h,i) TPARM_9(a,b,c,d,e,f,g,h,i,0) -#define TPARM_7(a,b,c,d,e,f,g,h) TPARM_8(a,b,c,d,e,f,g,h,0) -#define TPARM_6(a,b,c,d,e,f,g) TPARM_7(a,b,c,d,e,f,g,0) -#define TPARM_5(a,b,c,d,e,f) TPARM_6(a,b,c,d,e,f,0) -#define TPARM_4(a,b,c,d,e) TPARM_5(a,b,c,d,e,0) -#define TPARM_3(a,b,c,d) TPARM_4(a,b,c,d,0) -#define TPARM_2(a,b,c) TPARM_3(a,b,c,0) -#define TPARM_1(a,b) TPARM_2(a,b,0) -#define TPARM_1(a,b) TPARM_2(a,b,0) -#define TPARM_0(a) TPARM_1(a,0) -#endif - -#endif /* NC_TPARM_included */ diff --git a/windows/ncurses/include/ncurses/ncurses.h b/windows/ncurses/include/ncurses/ncurses.h deleted file mode 100644 index ff375d525..000000000 --- a/windows/ncurses/include/ncurses/ncurses.h +++ /dev/null @@ -1,1675 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ - -/**************************************************************************** - * Author: Zeyd M. Ben-Halim 1992,1995 * - * and: Eric S. Raymond * - * and: Thomas E. Dickey 1996-on * - ****************************************************************************/ - -/* $Id: curses.h.in,v 1.220 2011/01/22 19:47:20 tom Exp $ */ - -#ifndef __NCURSES_H -#define __NCURSES_H - -#define CURSES 1 -#define CURSES_H 1 - -/* These are defined only in curses.h, and are used for conditional compiles */ -#define NCURSES_VERSION_MAJOR 5 -#define NCURSES_VERSION_MINOR 9 -#define NCURSES_VERSION_PATCH 20110404 - -/* This is defined in more than one ncurses header, for identification */ -#undef NCURSES_VERSION -#define NCURSES_VERSION "5.9" - -/* - * Identify the mouse encoding version. - */ -#define NCURSES_MOUSE_VERSION 1 - -/* - * Definitions to facilitate DLL's. - */ -#include - -/* - * User-definable tweak to disable the include of . - */ -#ifndef NCURSES_ENABLE_STDBOOL_H -#define NCURSES_ENABLE_STDBOOL_H 1 -#endif - -/* - * NCURSES_ATTR_T is used to quiet compiler warnings when building ncurses - * configured using --disable-macros. - */ -#ifdef NCURSES_NOMACROS -#ifndef NCURSES_ATTR_T -#define NCURSES_ATTR_T attr_t -#endif -#endif /* NCURSES_NOMACROS */ - -#ifndef NCURSES_ATTR_T -#define NCURSES_ATTR_T int -#endif - -/* - * Expands to 'const' if ncurses is configured using --enable-const. Note that - * doing so makes it incompatible with other implementations of X/Open Curses. - */ -#undef NCURSES_CONST -#define NCURSES_CONST /*nothing*/ - -#undef NCURSES_INLINE -#define NCURSES_INLINE inline - -/* - * The internal type used for color values - */ -#undef NCURSES_COLOR_T -#define NCURSES_COLOR_T short - -/* - * Definition used to make WINDOW and similar structs opaque. - */ -#ifndef NCURSES_OPAQUE -#define NCURSES_OPAQUE 0 -#endif - -/* - * The reentrant code relies on the opaque setting, but adds features. - */ -#ifndef NCURSES_REENTRANT -#define NCURSES_REENTRANT 0 -#endif - -/* - * Control whether bindings for interop support are added. - */ -#undef NCURSES_INTEROP_FUNCS -#define NCURSES_INTEROP_FUNCS 0 - -/* - * The internal type used for window dimensions. - */ -#undef NCURSES_SIZE_T -#define NCURSES_SIZE_T short - -/* - * Control whether tparm() supports varargs or fixed-parameter list. - */ -#undef NCURSES_TPARM_VARARGS -#define NCURSES_TPARM_VARARGS 1 - -/* - * NCURSES_CH_T is used in building the library, but not used otherwise in - * this header file, since that would make the normal/wide-character versions - * of the header incompatible. - */ -#undef NCURSES_CH_T -#define NCURSES_CH_T chtype - -#if 0 && defined(_LP64) -typedef unsigned chtype; -typedef unsigned mmask_t; -#else -typedef unsigned long chtype; -typedef unsigned long mmask_t; -#endif - -/* - * We need FILE, etc. Include this before checking any feature symbols. - */ -#include - -/* - * With XPG4, you must define _XOPEN_SOURCE_EXTENDED, it is redundant (or - * conflicting) when _XOPEN_SOURCE is 500 or greater. - */ -#undef NCURSES_WIDECHAR -#if defined(_XOPEN_SOURCE_EXTENDED) || defined(_XPG5) -#define NCURSES_WIDECHAR -#endif - -#include /* we need va_list */ -#ifdef NCURSES_WIDECHAR -#include /* we want wchar_t */ -#endif - -/* X/Open and SVr4 specify that curses implements 'bool'. However, C++ may also - * implement it. If so, we must use the C++ compiler's type to avoid conflict - * with other interfaces. - * - * A further complication is that may declare 'bool' to be a - * different type, such as an enum which is not necessarily compatible with - * C++. If we have , make 'bool' a macro, so users may #undef it. - * Otherwise, let it remain a typedef to avoid conflicts with other #define's. - * In either case, make a typedef for NCURSES_BOOL which can be used if needed - * from either C or C++. - */ - -#undef TRUE -#define TRUE 1 - -#undef FALSE -#define FALSE 0 - -typedef unsigned char NCURSES_BOOL; - -#if defined(__cplusplus) /* __cplusplus, etc. */ - -/* use the C++ compiler's bool type */ -#define NCURSES_BOOL bool - -#else /* c89, c99, etc. */ - -#if NCURSES_ENABLE_STDBOOL_H -#include -/* use whatever the C compiler decides bool really is */ -#define NCURSES_BOOL bool -#else -/* there is no predefined bool - use our own */ -#undef bool -#define bool NCURSES_BOOL -#endif - -#endif /* !__cplusplus, etc. */ - -#ifdef __cplusplus -extern "C" { -#define NCURSES_CAST(type,value) static_cast(value) -#else -#define NCURSES_CAST(type,value) (type)(value) -#endif - -/* - * X/Open attributes. In the ncurses implementation, they are identical to the - * A_ attributes. - */ -#define WA_ATTRIBUTES A_ATTRIBUTES -#define WA_NORMAL A_NORMAL -#define WA_STANDOUT A_STANDOUT -#define WA_UNDERLINE A_UNDERLINE -#define WA_REVERSE A_REVERSE -#define WA_BLINK A_BLINK -#define WA_DIM A_DIM -#define WA_BOLD A_BOLD -#define WA_ALTCHARSET A_ALTCHARSET -#define WA_INVIS A_INVIS -#define WA_PROTECT A_PROTECT -#define WA_HORIZONTAL A_HORIZONTAL -#define WA_LEFT A_LEFT -#define WA_LOW A_LOW -#define WA_RIGHT A_RIGHT -#define WA_TOP A_TOP -#define WA_VERTICAL A_VERTICAL - -/* colors */ -#define COLOR_BLACK 0 -#define COLOR_RED 1 -#define COLOR_GREEN 2 -#define COLOR_YELLOW 3 -#define COLOR_BLUE 4 -#define COLOR_MAGENTA 5 -#define COLOR_CYAN 6 -#define COLOR_WHITE 7 - -/* line graphics */ - -#if 0 || NCURSES_REENTRANT -NCURSES_WRAPPED_VAR(chtype*, acs_map); -#define acs_map NCURSES_PUBLIC_VAR(acs_map()) -#else -extern NCURSES_EXPORT_VAR(chtype) acs_map[]; -#endif - -#define NCURSES_ACS(c) (acs_map[NCURSES_CAST(unsigned char,c)]) - -/* VT100 symbols begin here */ -#define ACS_ULCORNER NCURSES_ACS('l') /* upper left corner */ -#define ACS_LLCORNER NCURSES_ACS('m') /* lower left corner */ -#define ACS_URCORNER NCURSES_ACS('k') /* upper right corner */ -#define ACS_LRCORNER NCURSES_ACS('j') /* lower right corner */ -#define ACS_LTEE NCURSES_ACS('t') /* tee pointing right */ -#define ACS_RTEE NCURSES_ACS('u') /* tee pointing left */ -#define ACS_BTEE NCURSES_ACS('v') /* tee pointing up */ -#define ACS_TTEE NCURSES_ACS('w') /* tee pointing down */ -#define ACS_HLINE NCURSES_ACS('q') /* horizontal line */ -#define ACS_VLINE NCURSES_ACS('x') /* vertical line */ -#define ACS_PLUS NCURSES_ACS('n') /* large plus or crossover */ -#define ACS_S1 NCURSES_ACS('o') /* scan line 1 */ -#define ACS_S9 NCURSES_ACS('s') /* scan line 9 */ -#define ACS_DIAMOND NCURSES_ACS('`') /* diamond */ -#define ACS_CKBOARD NCURSES_ACS('a') /* checker board (stipple) */ -#define ACS_DEGREE NCURSES_ACS('f') /* degree symbol */ -#define ACS_PLMINUS NCURSES_ACS('g') /* plus/minus */ -#define ACS_BULLET NCURSES_ACS('~') /* bullet */ -/* Teletype 5410v1 symbols begin here */ -#define ACS_LARROW NCURSES_ACS(',') /* arrow pointing left */ -#define ACS_RARROW NCURSES_ACS('+') /* arrow pointing right */ -#define ACS_DARROW NCURSES_ACS('.') /* arrow pointing down */ -#define ACS_UARROW NCURSES_ACS('-') /* arrow pointing up */ -#define ACS_BOARD NCURSES_ACS('h') /* board of squares */ -#define ACS_LANTERN NCURSES_ACS('i') /* lantern symbol */ -#define ACS_BLOCK NCURSES_ACS('0') /* solid square block */ -/* - * These aren't documented, but a lot of System Vs have them anyway - * (you can spot pprryyzz{{||}} in a lot of AT&T terminfo strings). - * The ACS_names may not match AT&T's, our source didn't know them. - */ -#define ACS_S3 NCURSES_ACS('p') /* scan line 3 */ -#define ACS_S7 NCURSES_ACS('r') /* scan line 7 */ -#define ACS_LEQUAL NCURSES_ACS('y') /* less/equal */ -#define ACS_GEQUAL NCURSES_ACS('z') /* greater/equal */ -#define ACS_PI NCURSES_ACS('{') /* Pi */ -#define ACS_NEQUAL NCURSES_ACS('|') /* not equal */ -#define ACS_STERLING NCURSES_ACS('}') /* UK pound sign */ - -/* - * Line drawing ACS names are of the form ACS_trbl, where t is the top, r - * is the right, b is the bottom, and l is the left. t, r, b, and l might - * be B (blank), S (single), D (double), or T (thick). The subset defined - * here only uses B and S. - */ -#define ACS_BSSB ACS_ULCORNER -#define ACS_SSBB ACS_LLCORNER -#define ACS_BBSS ACS_URCORNER -#define ACS_SBBS ACS_LRCORNER -#define ACS_SBSS ACS_RTEE -#define ACS_SSSB ACS_LTEE -#define ACS_SSBS ACS_BTEE -#define ACS_BSSS ACS_TTEE -#define ACS_BSBS ACS_HLINE -#define ACS_SBSB ACS_VLINE -#define ACS_SSSS ACS_PLUS - -#undef ERR -#define ERR (-1) - -#undef OK -#define OK (0) - -/* values for the _flags member */ -#define _SUBWIN 0x01 /* is this a sub-window? */ -#define _ENDLINE 0x02 /* is the window flush right? */ -#define _FULLWIN 0x04 /* is the window full-screen? */ -#define _SCROLLWIN 0x08 /* bottom edge is at screen bottom? */ -#define _ISPAD 0x10 /* is this window a pad? */ -#define _HASMOVED 0x20 /* has cursor moved since last refresh? */ -#define _WRAPPED 0x40 /* cursor was just wrappped */ - -/* - * this value is used in the firstchar and lastchar fields to mark - * unchanged lines - */ -#define _NOCHANGE -1 - -/* - * this value is used in the oldindex field to mark lines created by insertions - * and scrolls. - */ -#define _NEWINDEX -1 - -typedef struct screen SCREEN; -typedef struct _win_st WINDOW; - -typedef chtype attr_t; /* ...must be at least as wide as chtype */ - -#ifdef NCURSES_WIDECHAR - -#if 0 -#ifdef mblen /* libutf8.h defines it w/o undefining first */ -#undef mblen -#endif -#include -#endif - -#if 0 -#include /* ...to get mbstate_t, etc. */ -#endif - -#if 0 -typedef unsigned short wchar_t; -#endif - -#if 0 -typedef unsigned int wint_t; -#endif - -/* - * cchar_t stores an array of CCHARW_MAX wide characters. The first is - * normally a spacing character. The others are non-spacing. If those - * (spacing and nonspacing) do not fill the array, a null L'\0' follows. - * Otherwise, a null is assumed to follow when extracting via getcchar(). - */ -#define CCHARW_MAX 5 -typedef struct -{ - attr_t attr; - wchar_t chars[CCHARW_MAX]; -#if 0 -#undef NCURSES_EXT_COLORS -#define NCURSES_EXT_COLORS 20110404 - int ext_color; /* color pair, must be more than 16-bits */ -#endif -} -cchar_t; - -#endif /* NCURSES_WIDECHAR */ - -#if !NCURSES_OPAQUE -struct ldat; - -struct _win_st -{ - NCURSES_SIZE_T _cury, _curx; /* current cursor position */ - - /* window location and size */ - NCURSES_SIZE_T _maxy, _maxx; /* maximums of x and y, NOT window size */ - NCURSES_SIZE_T _begy, _begx; /* screen coords of upper-left-hand corner */ - - short _flags; /* window state flags */ - - /* attribute tracking */ - attr_t _attrs; /* current attribute for non-space character */ - chtype _bkgd; /* current background char/attribute pair */ - - /* option values set by user */ - bool _notimeout; /* no time out on function-key entry? */ - bool _clear; /* consider all data in the window invalid? */ - bool _leaveok; /* OK to not reset cursor on exit? */ - bool _scroll; /* OK to scroll this window? */ - bool _idlok; /* OK to use insert/delete line? */ - bool _idcok; /* OK to use insert/delete char? */ - bool _immed; /* window in immed mode? (not yet used) */ - bool _sync; /* window in sync mode? */ - bool _use_keypad; /* process function keys into KEY_ symbols? */ - int _delay; /* 0 = nodelay, <0 = blocking, >0 = delay */ - - struct ldat *_line; /* the actual line data */ - - /* global screen state */ - NCURSES_SIZE_T _regtop; /* top line of scrolling region */ - NCURSES_SIZE_T _regbottom; /* bottom line of scrolling region */ - - /* these are used only if this is a sub-window */ - int _parx; /* x coordinate of this window in parent */ - int _pary; /* y coordinate of this window in parent */ - WINDOW *_parent; /* pointer to parent if a sub-window */ - - /* these are used only if this is a pad */ - struct pdat - { - NCURSES_SIZE_T _pad_y, _pad_x; - NCURSES_SIZE_T _pad_top, _pad_left; - NCURSES_SIZE_T _pad_bottom, _pad_right; - } _pad; - - NCURSES_SIZE_T _yoffset; /* real begy is _begy + _yoffset */ - -#ifdef NCURSES_WIDECHAR - cchar_t _bkgrnd; /* current background char/attribute pair */ -#if 0 - int _color; /* current color-pair for non-space character */ -#endif -#endif -}; -#endif /* NCURSES_OPAQUE */ - -/* - * This is an extension to support events... - */ -#if 1 -#ifdef NCURSES_WGETCH_EVENTS -#if !defined(__BEOS__) || defined(__HAIKU__) - /* Fix _nc_timed_wait() on BEOS... */ -# define NCURSES_EVENT_VERSION 1 -#endif /* !defined(__BEOS__) */ - -/* - * Bits to set in _nc_event.data.flags - */ -# define _NC_EVENT_TIMEOUT_MSEC 1 -# define _NC_EVENT_FILE 2 -# define _NC_EVENT_FILE_READABLE 2 -# if 0 /* Not supported yet... */ -# define _NC_EVENT_FILE_WRITABLE 4 -# define _NC_EVENT_FILE_EXCEPTION 8 -# endif - -typedef struct -{ - int type; - union - { - long timeout_msec; /* _NC_EVENT_TIMEOUT_MSEC */ - struct - { - unsigned int flags; - int fd; - unsigned int result; - } fev; /* _NC_EVENT_FILE */ - } data; -} _nc_event; - -typedef struct -{ - int count; - int result_flags; /* _NC_EVENT_TIMEOUT_MSEC or _NC_EVENT_FILE_READABLE */ - _nc_event *events[1]; -} _nc_eventlist; - -extern NCURSES_EXPORT(int) wgetch_events (WINDOW *, _nc_eventlist *); /* experimental */ -extern NCURSES_EXPORT(int) wgetnstr_events (WINDOW *,char *,int,_nc_eventlist *);/* experimental */ - -#endif /* NCURSES_WGETCH_EVENTS */ -#endif /* NCURSES_EXT_FUNCS */ - -/* - * GCC (and some other compilers) define '__attribute__'; we're using this - * macro to alert the compiler to flag inconsistencies in printf/scanf-like - * function calls. Just in case '__attribute__' isn't defined, make a dummy. - * Old versions of G++ do not accept it anyway, at least not consistently with - * GCC. - */ -#if !(defined(__GNUC__) || defined(__GNUG__) || defined(__attribute__)) -#define __attribute__(p) /* nothing */ -#endif - -/* - * We cannot define these in ncurses_cfg.h, since they require parameters to be - * passed (that is non-portable). If you happen to be using gcc with warnings - * enabled, define - * GCC_PRINTF - * GCC_SCANF - * to improve checking of calls to printw(), etc. - */ -#ifndef GCC_PRINTFLIKE -#if defined(GCC_PRINTF) && !defined(printf) -#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var))) -#else -#define GCC_PRINTFLIKE(fmt,var) /*nothing*/ -#endif -#endif - -#ifndef GCC_SCANFLIKE -#if defined(GCC_SCANF) && !defined(scanf) -#define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var))) -#else -#define GCC_SCANFLIKE(fmt,var) /*nothing*/ -#endif -#endif - -#ifndef GCC_NORETURN -#define GCC_NORETURN /* nothing */ -#endif - -#ifndef GCC_UNUSED -#define GCC_UNUSED /* nothing */ -#endif - -/* - * Curses uses a helper function. Define our type for this to simplify - * extending it for the sp-funcs feature. - */ -typedef int (*NCURSES_OUTC)(int); - -/* - * Function prototypes. This is the complete X/Open Curses list of required - * functions. Those marked `generated' will have sources generated from the - * macro definitions later in this file, in order to satisfy XPG4.2 - * requirements. - */ - -extern NCURSES_EXPORT(int) addch (const chtype); /* generated */ -extern NCURSES_EXPORT(int) addchnstr (const chtype *, int); /* generated */ -extern NCURSES_EXPORT(int) addchstr (const chtype *); /* generated */ -extern NCURSES_EXPORT(int) addnstr (const char *, int); /* generated */ -extern NCURSES_EXPORT(int) addstr (const char *); /* generated */ -extern NCURSES_EXPORT(int) attroff (NCURSES_ATTR_T); /* generated */ -extern NCURSES_EXPORT(int) attron (NCURSES_ATTR_T); /* generated */ -extern NCURSES_EXPORT(int) attrset (NCURSES_ATTR_T); /* generated */ -extern NCURSES_EXPORT(int) attr_get (attr_t *, short *, void *); /* generated */ -extern NCURSES_EXPORT(int) attr_off (attr_t, void *); /* generated */ -extern NCURSES_EXPORT(int) attr_on (attr_t, void *); /* generated */ -extern NCURSES_EXPORT(int) attr_set (attr_t, short, void *); /* generated */ -extern NCURSES_EXPORT(int) baudrate (void); /* implemented */ -extern NCURSES_EXPORT(int) beep (void); /* implemented */ -extern NCURSES_EXPORT(int) bkgd (chtype); /* generated */ -extern NCURSES_EXPORT(void) bkgdset (chtype); /* generated */ -extern NCURSES_EXPORT(int) border (chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype); /* generated */ -extern NCURSES_EXPORT(int) box (WINDOW *, chtype, chtype); /* generated */ -extern NCURSES_EXPORT(bool) can_change_color (void); /* implemented */ -extern NCURSES_EXPORT(int) cbreak (void); /* implemented */ -extern NCURSES_EXPORT(int) chgat (int, attr_t, short, const void *); /* generated */ -extern NCURSES_EXPORT(int) clear (void); /* generated */ -extern NCURSES_EXPORT(int) clearok (WINDOW *,bool); /* implemented */ -extern NCURSES_EXPORT(int) clrtobot (void); /* generated */ -extern NCURSES_EXPORT(int) clrtoeol (void); /* generated */ -extern NCURSES_EXPORT(int) color_content (short,short*,short*,short*); /* implemented */ -extern NCURSES_EXPORT(int) color_set (short,void*); /* generated */ -extern NCURSES_EXPORT(int) COLOR_PAIR (int); /* generated */ -extern NCURSES_EXPORT(int) copywin (const WINDOW*,WINDOW*,int,int,int,int,int,int,int); /* implemented */ -extern NCURSES_EXPORT(int) curs_set (int); /* implemented */ -extern NCURSES_EXPORT(int) def_prog_mode (void); /* implemented */ -extern NCURSES_EXPORT(int) def_shell_mode (void); /* implemented */ -extern NCURSES_EXPORT(int) delay_output (int); /* implemented */ -extern NCURSES_EXPORT(int) delch (void); /* generated */ -extern NCURSES_EXPORT(void) delscreen (SCREEN *); /* implemented */ -extern NCURSES_EXPORT(int) delwin (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) deleteln (void); /* generated */ -extern NCURSES_EXPORT(WINDOW *) derwin (WINDOW *,int,int,int,int); /* implemented */ -extern NCURSES_EXPORT(int) doupdate (void); /* implemented */ -extern NCURSES_EXPORT(WINDOW *) dupwin (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) echo (void); /* implemented */ -extern NCURSES_EXPORT(int) echochar (const chtype); /* generated */ -extern NCURSES_EXPORT(int) erase (void); /* generated */ -extern NCURSES_EXPORT(int) endwin (void); /* implemented */ -extern NCURSES_EXPORT(char) erasechar (void); /* implemented */ -extern NCURSES_EXPORT(void) filter (void); /* implemented */ -extern NCURSES_EXPORT(int) flash (void); /* implemented */ -extern NCURSES_EXPORT(int) flushinp (void); /* implemented */ -extern NCURSES_EXPORT(chtype) getbkgd (WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) getch (void); /* generated */ -extern NCURSES_EXPORT(int) getnstr (char *, int); /* generated */ -extern NCURSES_EXPORT(int) getstr (char *); /* generated */ -extern NCURSES_EXPORT(WINDOW *) getwin (FILE *); /* implemented */ -extern NCURSES_EXPORT(int) halfdelay (int); /* implemented */ -extern NCURSES_EXPORT(bool) has_colors (void); /* implemented */ -extern NCURSES_EXPORT(bool) has_ic (void); /* implemented */ -extern NCURSES_EXPORT(bool) has_il (void); /* implemented */ -extern NCURSES_EXPORT(int) hline (chtype, int); /* generated */ -extern NCURSES_EXPORT(void) idcok (WINDOW *, bool); /* implemented */ -extern NCURSES_EXPORT(int) idlok (WINDOW *, bool); /* implemented */ -extern NCURSES_EXPORT(void) immedok (WINDOW *, bool); /* implemented */ -extern NCURSES_EXPORT(chtype) inch (void); /* generated */ -extern NCURSES_EXPORT(int) inchnstr (chtype *, int); /* generated */ -extern NCURSES_EXPORT(int) inchstr (chtype *); /* generated */ -extern NCURSES_EXPORT(WINDOW *) initscr (void); /* implemented */ -extern NCURSES_EXPORT(int) init_color (short,short,short,short); /* implemented */ -extern NCURSES_EXPORT(int) init_pair (short,short,short); /* implemented */ -extern NCURSES_EXPORT(int) innstr (char *, int); /* generated */ -extern NCURSES_EXPORT(int) insch (chtype); /* generated */ -extern NCURSES_EXPORT(int) insdelln (int); /* generated */ -extern NCURSES_EXPORT(int) insertln (void); /* generated */ -extern NCURSES_EXPORT(int) insnstr (const char *, int); /* generated */ -extern NCURSES_EXPORT(int) insstr (const char *); /* generated */ -extern NCURSES_EXPORT(int) instr (char *); /* generated */ -extern NCURSES_EXPORT(int) intrflush (WINDOW *,bool); /* implemented */ -extern NCURSES_EXPORT(bool) isendwin (void); /* implemented */ -extern NCURSES_EXPORT(bool) is_linetouched (WINDOW *,int); /* implemented */ -extern NCURSES_EXPORT(bool) is_wintouched (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(NCURSES_CONST char *) keyname (int); /* implemented */ -extern NCURSES_EXPORT(int) keypad (WINDOW *,bool); /* implemented */ -extern NCURSES_EXPORT(char) killchar (void); /* implemented */ -extern NCURSES_EXPORT(int) leaveok (WINDOW *,bool); /* implemented */ -extern NCURSES_EXPORT(char *) longname (void); /* implemented */ -extern NCURSES_EXPORT(int) meta (WINDOW *,bool); /* implemented */ -extern NCURSES_EXPORT(int) move (int, int); /* generated */ -extern NCURSES_EXPORT(int) mvaddch (int, int, const chtype); /* generated */ -extern NCURSES_EXPORT(int) mvaddchnstr (int, int, const chtype *, int); /* generated */ -extern NCURSES_EXPORT(int) mvaddchstr (int, int, const chtype *); /* generated */ -extern NCURSES_EXPORT(int) mvaddnstr (int, int, const char *, int); /* generated */ -extern NCURSES_EXPORT(int) mvaddstr (int, int, const char *); /* generated */ -extern NCURSES_EXPORT(int) mvchgat (int, int, int, attr_t, short, const void *); /* generated */ -extern NCURSES_EXPORT(int) mvcur (int,int,int,int); /* implemented */ -extern NCURSES_EXPORT(int) mvdelch (int, int); /* generated */ -extern NCURSES_EXPORT(int) mvderwin (WINDOW *, int, int); /* implemented */ -extern NCURSES_EXPORT(int) mvgetch (int, int); /* generated */ -extern NCURSES_EXPORT(int) mvgetnstr (int, int, char *, int); /* generated */ -extern NCURSES_EXPORT(int) mvgetstr (int, int, char *); /* generated */ -extern NCURSES_EXPORT(int) mvhline (int, int, chtype, int); /* generated */ -extern NCURSES_EXPORT(chtype) mvinch (int, int); /* generated */ -extern NCURSES_EXPORT(int) mvinchnstr (int, int, chtype *, int); /* generated */ -extern NCURSES_EXPORT(int) mvinchstr (int, int, chtype *); /* generated */ -extern NCURSES_EXPORT(int) mvinnstr (int, int, char *, int); /* generated */ -extern NCURSES_EXPORT(int) mvinsch (int, int, chtype); /* generated */ -extern NCURSES_EXPORT(int) mvinsnstr (int, int, const char *, int); /* generated */ -extern NCURSES_EXPORT(int) mvinsstr (int, int, const char *); /* generated */ -extern NCURSES_EXPORT(int) mvinstr (int, int, char *); /* generated */ -extern NCURSES_EXPORT(int) mvprintw (int,int, const char *,...) /* implemented */ - GCC_PRINTFLIKE(3,4); -extern NCURSES_EXPORT(int) mvscanw (int,int, NCURSES_CONST char *,...) /* implemented */ - GCC_SCANFLIKE(3,4); -extern NCURSES_EXPORT(int) mvvline (int, int, chtype, int); /* generated */ -extern NCURSES_EXPORT(int) mvwaddch (WINDOW *, int, int, const chtype); /* generated */ -extern NCURSES_EXPORT(int) mvwaddchnstr (WINDOW *, int, int, const chtype *, int);/* generated */ -extern NCURSES_EXPORT(int) mvwaddchstr (WINDOW *, int, int, const chtype *); /* generated */ -extern NCURSES_EXPORT(int) mvwaddnstr (WINDOW *, int, int, const char *, int); /* generated */ -extern NCURSES_EXPORT(int) mvwaddstr (WINDOW *, int, int, const char *); /* generated */ -extern NCURSES_EXPORT(int) mvwchgat (WINDOW *, int, int, int, attr_t, short, const void *);/* generated */ -extern NCURSES_EXPORT(int) mvwdelch (WINDOW *, int, int); /* generated */ -extern NCURSES_EXPORT(int) mvwgetch (WINDOW *, int, int); /* generated */ -extern NCURSES_EXPORT(int) mvwgetnstr (WINDOW *, int, int, char *, int); /* generated */ -extern NCURSES_EXPORT(int) mvwgetstr (WINDOW *, int, int, char *); /* generated */ -extern NCURSES_EXPORT(int) mvwhline (WINDOW *, int, int, chtype, int); /* generated */ -extern NCURSES_EXPORT(int) mvwin (WINDOW *,int,int); /* implemented */ -extern NCURSES_EXPORT(chtype) mvwinch (WINDOW *, int, int); /* generated */ -extern NCURSES_EXPORT(int) mvwinchnstr (WINDOW *, int, int, chtype *, int); /* generated */ -extern NCURSES_EXPORT(int) mvwinchstr (WINDOW *, int, int, chtype *); /* generated */ -extern NCURSES_EXPORT(int) mvwinnstr (WINDOW *, int, int, char *, int); /* generated */ -extern NCURSES_EXPORT(int) mvwinsch (WINDOW *, int, int, chtype); /* generated */ -extern NCURSES_EXPORT(int) mvwinsnstr (WINDOW *, int, int, const char *, int); /* generated */ -extern NCURSES_EXPORT(int) mvwinsstr (WINDOW *, int, int, const char *); /* generated */ -extern NCURSES_EXPORT(int) mvwinstr (WINDOW *, int, int, char *); /* generated */ -extern NCURSES_EXPORT(int) mvwprintw (WINDOW*,int,int, const char *,...) /* implemented */ - GCC_PRINTFLIKE(4,5); -extern NCURSES_EXPORT(int) mvwscanw (WINDOW *,int,int, NCURSES_CONST char *,...) /* implemented */ - GCC_SCANFLIKE(4,5); -extern NCURSES_EXPORT(int) mvwvline (WINDOW *,int, int, chtype, int); /* generated */ -extern NCURSES_EXPORT(int) napms (int); /* implemented */ -extern NCURSES_EXPORT(WINDOW *) newpad (int,int); /* implemented */ -extern NCURSES_EXPORT(SCREEN *) newterm (NCURSES_CONST char *,FILE *,FILE *); /* implemented */ -extern NCURSES_EXPORT(WINDOW *) newwin (int,int,int,int); /* implemented */ -extern NCURSES_EXPORT(int) nl (void); /* implemented */ -extern NCURSES_EXPORT(int) nocbreak (void); /* implemented */ -extern NCURSES_EXPORT(int) nodelay (WINDOW *,bool); /* implemented */ -extern NCURSES_EXPORT(int) noecho (void); /* implemented */ -extern NCURSES_EXPORT(int) nonl (void); /* implemented */ -extern NCURSES_EXPORT(void) noqiflush (void); /* implemented */ -extern NCURSES_EXPORT(int) noraw (void); /* implemented */ -extern NCURSES_EXPORT(int) notimeout (WINDOW *,bool); /* implemented */ -extern NCURSES_EXPORT(int) overlay (const WINDOW*,WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) overwrite (const WINDOW*,WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) pair_content (short,short*,short*); /* implemented */ -extern NCURSES_EXPORT(int) PAIR_NUMBER (int); /* generated */ -extern NCURSES_EXPORT(int) pechochar (WINDOW *, const chtype); /* implemented */ -extern NCURSES_EXPORT(int) pnoutrefresh (WINDOW*,int,int,int,int,int,int);/* implemented */ -extern NCURSES_EXPORT(int) prefresh (WINDOW *,int,int,int,int,int,int); /* implemented */ -extern NCURSES_EXPORT(int) printw (const char *,...) /* implemented */ - GCC_PRINTFLIKE(1,2); -extern NCURSES_EXPORT(int) putwin (WINDOW *, FILE *); /* implemented */ -extern NCURSES_EXPORT(void) qiflush (void); /* implemented */ -extern NCURSES_EXPORT(int) raw (void); /* implemented */ -extern NCURSES_EXPORT(int) redrawwin (WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) refresh (void); /* generated */ -extern NCURSES_EXPORT(int) resetty (void); /* implemented */ -extern NCURSES_EXPORT(int) reset_prog_mode (void); /* implemented */ -extern NCURSES_EXPORT(int) reset_shell_mode (void); /* implemented */ -extern NCURSES_EXPORT(int) ripoffline (int, int (*)(WINDOW *, int)); /* implemented */ -extern NCURSES_EXPORT(int) savetty (void); /* implemented */ -extern NCURSES_EXPORT(int) scanw (NCURSES_CONST char *,...) /* implemented */ - GCC_SCANFLIKE(1,2); -extern NCURSES_EXPORT(int) scr_dump (const char *); /* implemented */ -extern NCURSES_EXPORT(int) scr_init (const char *); /* implemented */ -extern NCURSES_EXPORT(int) scrl (int); /* generated */ -extern NCURSES_EXPORT(int) scroll (WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) scrollok (WINDOW *,bool); /* implemented */ -extern NCURSES_EXPORT(int) scr_restore (const char *); /* implemented */ -extern NCURSES_EXPORT(int) scr_set (const char *); /* implemented */ -extern NCURSES_EXPORT(int) setscrreg (int,int); /* generated */ -extern NCURSES_EXPORT(SCREEN *) set_term (SCREEN *); /* implemented */ -extern NCURSES_EXPORT(int) slk_attroff (const chtype); /* implemented */ -extern NCURSES_EXPORT(int) slk_attr_off (const attr_t, void *); /* generated:WIDEC */ -extern NCURSES_EXPORT(int) slk_attron (const chtype); /* implemented */ -extern NCURSES_EXPORT(int) slk_attr_on (attr_t,void*); /* generated:WIDEC */ -extern NCURSES_EXPORT(int) slk_attrset (const chtype); /* implemented */ -extern NCURSES_EXPORT(attr_t) slk_attr (void); /* implemented */ -extern NCURSES_EXPORT(int) slk_attr_set (const attr_t,short,void*); /* implemented */ -extern NCURSES_EXPORT(int) slk_clear (void); /* implemented */ -extern NCURSES_EXPORT(int) slk_color (short); /* implemented */ -extern NCURSES_EXPORT(int) slk_init (int); /* implemented */ -extern NCURSES_EXPORT(char *) slk_label (int); /* implemented */ -extern NCURSES_EXPORT(int) slk_noutrefresh (void); /* implemented */ -extern NCURSES_EXPORT(int) slk_refresh (void); /* implemented */ -extern NCURSES_EXPORT(int) slk_restore (void); /* implemented */ -extern NCURSES_EXPORT(int) slk_set (int,const char *,int); /* implemented */ -extern NCURSES_EXPORT(int) slk_touch (void); /* implemented */ -extern NCURSES_EXPORT(int) standout (void); /* generated */ -extern NCURSES_EXPORT(int) standend (void); /* generated */ -extern NCURSES_EXPORT(int) start_color (void); /* implemented */ -extern NCURSES_EXPORT(WINDOW *) subpad (WINDOW *, int, int, int, int); /* implemented */ -extern NCURSES_EXPORT(WINDOW *) subwin (WINDOW *, int, int, int, int); /* implemented */ -extern NCURSES_EXPORT(int) syncok (WINDOW *, bool); /* implemented */ -extern NCURSES_EXPORT(chtype) termattrs (void); /* implemented */ -extern NCURSES_EXPORT(char *) termname (void); /* implemented */ -extern NCURSES_EXPORT(void) timeout (int); /* generated */ -extern NCURSES_EXPORT(int) touchline (WINDOW *, int, int); /* generated */ -extern NCURSES_EXPORT(int) touchwin (WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) typeahead (int); /* implemented */ -extern NCURSES_EXPORT(int) ungetch (int); /* implemented */ -extern NCURSES_EXPORT(int) untouchwin (WINDOW *); /* generated */ -extern NCURSES_EXPORT(void) use_env (bool); /* implemented */ -extern NCURSES_EXPORT(int) vidattr (chtype); /* implemented */ -extern NCURSES_EXPORT(int) vidputs (chtype, NCURSES_OUTC); /* implemented */ -extern NCURSES_EXPORT(int) vline (chtype, int); /* generated */ -extern NCURSES_EXPORT(int) vwprintw (WINDOW *, const char *,va_list); /* implemented */ -extern NCURSES_EXPORT(int) vw_printw (WINDOW *, const char *,va_list); /* generated */ -extern NCURSES_EXPORT(int) vwscanw (WINDOW *, NCURSES_CONST char *,va_list); /* implemented */ -extern NCURSES_EXPORT(int) vw_scanw (WINDOW *, NCURSES_CONST char *,va_list); /* generated */ -extern NCURSES_EXPORT(int) waddch (WINDOW *, const chtype); /* implemented */ -extern NCURSES_EXPORT(int) waddchnstr (WINDOW *,const chtype *,int); /* implemented */ -extern NCURSES_EXPORT(int) waddchstr (WINDOW *,const chtype *); /* generated */ -extern NCURSES_EXPORT(int) waddnstr (WINDOW *,const char *,int); /* implemented */ -extern NCURSES_EXPORT(int) waddstr (WINDOW *,const char *); /* generated */ -extern NCURSES_EXPORT(int) wattron (WINDOW *, int); /* generated */ -extern NCURSES_EXPORT(int) wattroff (WINDOW *, int); /* generated */ -extern NCURSES_EXPORT(int) wattrset (WINDOW *, int); /* generated */ -extern NCURSES_EXPORT(int) wattr_get (WINDOW *, attr_t *, short *, void *); /* generated */ -extern NCURSES_EXPORT(int) wattr_on (WINDOW *, attr_t, void *); /* implemented */ -extern NCURSES_EXPORT(int) wattr_off (WINDOW *, attr_t, void *); /* implemented */ -extern NCURSES_EXPORT(int) wattr_set (WINDOW *, attr_t, short, void *); /* generated */ -extern NCURSES_EXPORT(int) wbkgd (WINDOW *, chtype); /* implemented */ -extern NCURSES_EXPORT(void) wbkgdset (WINDOW *,chtype); /* implemented */ -extern NCURSES_EXPORT(int) wborder (WINDOW *,chtype,chtype,chtype,chtype,chtype,chtype,chtype,chtype); /* implemented */ -extern NCURSES_EXPORT(int) wchgat (WINDOW *, int, attr_t, short, const void *);/* implemented */ -extern NCURSES_EXPORT(int) wclear (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) wclrtobot (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) wclrtoeol (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) wcolor_set (WINDOW*,short,void*); /* implemented */ -extern NCURSES_EXPORT(void) wcursyncup (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) wdelch (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) wdeleteln (WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) wechochar (WINDOW *, const chtype); /* implemented */ -extern NCURSES_EXPORT(int) werase (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) wgetch (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) wgetnstr (WINDOW *,char *,int); /* implemented */ -extern NCURSES_EXPORT(int) wgetstr (WINDOW *, char *); /* generated */ -extern NCURSES_EXPORT(int) whline (WINDOW *, chtype, int); /* implemented */ -extern NCURSES_EXPORT(chtype) winch (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) winchnstr (WINDOW *, chtype *, int); /* implemented */ -extern NCURSES_EXPORT(int) winchstr (WINDOW *, chtype *); /* generated */ -extern NCURSES_EXPORT(int) winnstr (WINDOW *, char *, int); /* implemented */ -extern NCURSES_EXPORT(int) winsch (WINDOW *, chtype); /* implemented */ -extern NCURSES_EXPORT(int) winsdelln (WINDOW *,int); /* implemented */ -extern NCURSES_EXPORT(int) winsertln (WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) winsnstr (WINDOW *, const char *,int); /* implemented */ -extern NCURSES_EXPORT(int) winsstr (WINDOW *, const char *); /* generated */ -extern NCURSES_EXPORT(int) winstr (WINDOW *, char *); /* generated */ -extern NCURSES_EXPORT(int) wmove (WINDOW *,int,int); /* implemented */ -extern NCURSES_EXPORT(int) wnoutrefresh (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) wprintw (WINDOW *, const char *,...) /* implemented */ - GCC_PRINTFLIKE(2,3); -extern NCURSES_EXPORT(int) wredrawln (WINDOW *,int,int); /* implemented */ -extern NCURSES_EXPORT(int) wrefresh (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(int) wscanw (WINDOW *, NCURSES_CONST char *,...) /* implemented */ - GCC_SCANFLIKE(2,3); -extern NCURSES_EXPORT(int) wscrl (WINDOW *,int); /* implemented */ -extern NCURSES_EXPORT(int) wsetscrreg (WINDOW *,int,int); /* implemented */ -extern NCURSES_EXPORT(int) wstandout (WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) wstandend (WINDOW *); /* generated */ -extern NCURSES_EXPORT(void) wsyncdown (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(void) wsyncup (WINDOW *); /* implemented */ -extern NCURSES_EXPORT(void) wtimeout (WINDOW *,int); /* implemented */ -extern NCURSES_EXPORT(int) wtouchln (WINDOW *,int,int,int); /* implemented */ -extern NCURSES_EXPORT(int) wvline (WINDOW *,chtype,int); /* implemented */ - -/* - * These are also declared in : - */ -extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *); /* implemented */ -extern NCURSES_EXPORT(int) tigetnum (NCURSES_CONST char *); /* implemented */ -extern NCURSES_EXPORT(char *) tigetstr (NCURSES_CONST char *); /* implemented */ -extern NCURSES_EXPORT(int) putp (const char *); /* implemented */ - -#if NCURSES_TPARM_VARARGS -extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, ...); /* special */ -#else -extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, long,long,long,long,long,long,long,long,long); /* special */ -extern NCURSES_EXPORT(char *) tparm_varargs (NCURSES_CONST char *, ...); /* special */ -#endif - -extern NCURSES_EXPORT(char *) tiparm (const char *, ...); /* special */ - -/* - * These functions are not in X/Open, but we use them in macro definitions: - */ -extern NCURSES_EXPORT(int) getattrs (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) getcurx (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) getcury (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) getbegx (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) getbegy (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) getmaxx (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) getmaxy (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) getparx (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) getpary (const WINDOW *); /* generated */ - -/* - * vid_attr() was implemented originally based on a draft of X/Open curses. - */ -#ifndef NCURSES_WIDECHAR -#define vid_attr(a,pair,opts) vidattr(a) -#endif - -/* - * These functions are extensions - not in X/Open Curses. - */ -#if 1 -#undef NCURSES_EXT_FUNCS -#define NCURSES_EXT_FUNCS 20110404 -typedef int (*NCURSES_WINDOW_CB)(WINDOW *, void *); -typedef int (*NCURSES_SCREEN_CB)(SCREEN *, void *); -extern NCURSES_EXPORT(bool) is_term_resized (int, int); -extern NCURSES_EXPORT(char *) keybound (int, int); -extern NCURSES_EXPORT(const char *) curses_version (void); -extern NCURSES_EXPORT(int) assume_default_colors (int, int); -extern NCURSES_EXPORT(int) define_key (const char *, int); -extern NCURSES_EXPORT(int) get_escdelay (void); -extern NCURSES_EXPORT(int) key_defined (const char *); -extern NCURSES_EXPORT(int) keyok (int, bool); -extern NCURSES_EXPORT(int) resize_term (int, int); -extern NCURSES_EXPORT(int) resizeterm (int, int); -extern NCURSES_EXPORT(int) set_escdelay (int); -extern NCURSES_EXPORT(int) set_tabsize (int); -extern NCURSES_EXPORT(int) use_default_colors (void); -extern NCURSES_EXPORT(int) use_extended_names (bool); -extern NCURSES_EXPORT(int) use_legacy_coding (int); -extern NCURSES_EXPORT(int) use_screen (SCREEN *, NCURSES_SCREEN_CB, void *); -extern NCURSES_EXPORT(int) use_window (WINDOW *, NCURSES_WINDOW_CB, void *); -extern NCURSES_EXPORT(int) wresize (WINDOW *, int, int); -extern NCURSES_EXPORT(void) nofilter(void); - -/* - * These extensions provide access to information stored in the WINDOW even - * when NCURSES_OPAQUE is set: - */ -extern NCURSES_EXPORT(WINDOW *) wgetparent (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_cleared (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_idcok (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_idlok (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_immedok (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_keypad (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_leaveok (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_nodelay (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_notimeout (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_pad (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_scrollok (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_subwin (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(bool) is_syncok (const WINDOW *); /* generated */ -extern NCURSES_EXPORT(int) wgetscrreg (const WINDOW *, int *, int *); /* generated */ - -#else -#define curses_version() NCURSES_VERSION -#endif - -/* - * Extra extension-functions, which pass a SCREEN pointer rather than using - * a global variable SP. - */ -#if 1 -#undef NCURSES_SP_FUNCS -#define NCURSES_SP_FUNCS 20110404 -#define NCURSES_SP_NAME(name) name##_sp - -/* Define the sp-funcs helper function */ -#define NCURSES_SP_OUTC NCURSES_SP_NAME(NCURSES_OUTC) -typedef int (*NCURSES_SP_OUTC)(SCREEN*, int); - -extern NCURSES_EXPORT(SCREEN *) new_prescr (void); /* implemented:SP_FUNC */ - -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(baudrate) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(beep) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(can_change_color) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(cbreak) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(curs_set) (SCREEN*, int); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(color_content) (SCREEN*, short, short*, short*, short*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(def_prog_mode) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(def_shell_mode) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(delay_output) (SCREEN*, int); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(doupdate) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(echo) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(endwin) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(char) NCURSES_SP_NAME(erasechar) (SCREEN*);/* implemented:SP_FUNC */ -extern NCURSES_EXPORT(void) NCURSES_SP_NAME(filter) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(flash) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(flushinp) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(getwin) (SCREEN*, FILE *); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(halfdelay) (SCREEN*, int); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_colors) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_ic) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_il) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(init_color) (SCREEN*, short, short, short, short); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(init_pair) (SCREEN*, short, short, short); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(intrflush) (SCREEN*, WINDOW*, bool); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(isendwin) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(NCURSES_CONST char *) NCURSES_SP_NAME(keyname) (SCREEN*, int); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(char) NCURSES_SP_NAME(killchar) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(longname) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(mvcur) (SCREEN*, int, int, int, int); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(napms) (SCREEN*, int); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(newpad) (SCREEN*, int, int); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(SCREEN *) NCURSES_SP_NAME(newterm) (SCREEN*, NCURSES_CONST char *, FILE *, FILE *); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(WINDOW *) NCURSES_SP_NAME(newwin) (SCREEN*, int, int, int, int); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(nl) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(nocbreak) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(noecho) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(nonl) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(void) NCURSES_SP_NAME(noqiflush) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(noraw) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(pair_content) (SCREEN*, short, short*, short*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(void) NCURSES_SP_NAME(qiflush) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(raw) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(reset_prog_mode) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(reset_shell_mode) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(resetty) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(ripoffline) (SCREEN*, int, int (*)(WINDOW *, int)); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(savetty) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(scr_init) (SCREEN*, const char *); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(scr_restore) (SCREEN*, const char *); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(scr_set) (SCREEN*, const char *); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attroff) (SCREEN*, const chtype); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attron) (SCREEN*, const chtype); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attrset) (SCREEN*, const chtype); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(attr_t) NCURSES_SP_NAME(slk_attr) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_attr_set) (SCREEN*, const attr_t, short, void*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_clear) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_color) (SCREEN*, short); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_init) (SCREEN*, int); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(slk_label) (SCREEN*, int); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_noutrefresh) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_refresh) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_restore) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_set) (SCREEN*, int, const char *, int); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_touch) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(start_color) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(chtype) NCURSES_SP_NAME(termattrs) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(termname) (SCREEN*); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(typeahead) (SCREEN*, int); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(ungetch) (SCREEN*, int); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(void) NCURSES_SP_NAME(use_env) (SCREEN*, bool); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vidattr) (SCREEN*, chtype); /* implemented:SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(vidputs) (SCREEN*, chtype, NCURSES_SP_OUTC); /* implemented:SP_FUNC */ -#if 1 -extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(keybound) (SCREEN*, int, int); /* implemented:EXT_SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(assume_default_colors) (SCREEN*, int, int); /* implemented:EXT_SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(define_key) (SCREEN*, const char *, int); /* implemented:EXT_SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(get_escdelay) (SCREEN*); /* implemented:EXT_SP_FUNC */ -extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(is_term_resized) (SCREEN*, int, int); /* implemented:EXT_SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(key_defined) (SCREEN*, const char *); /* implemented:EXT_SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(keyok) (SCREEN*, int, bool); /* implemented:EXT_SP_FUNC */ -extern NCURSES_EXPORT(void) NCURSES_SP_NAME(nofilter) (SCREEN*); /* implemented */ /* implemented:EXT_SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(resize_term) (SCREEN*, int, int); /* implemented:EXT_SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(resizeterm) (SCREEN*, int, int); /* implemented:EXT_SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(set_escdelay) (SCREEN*, int); /* implemented:EXT_SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(set_tabsize) (SCREEN*, int); /* implemented:EXT_SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_default_colors) (SCREEN*); /* implemented:EXT_SP_FUNC */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int); /* implemented:EXT_SP_FUNC */ -#endif -#else -#undef NCURSES_SP_FUNCS -#define NCURSES_SP_FUNCS 0 -#define NCURSES_SP_NAME(name) name -#define NCURSES_SP_OUTC NCURSES_OUTC -#endif - -/* attributes */ - -#define NCURSES_ATTR_SHIFT 8 -#define NCURSES_BITS(mask,shift) ((mask) << ((shift) + NCURSES_ATTR_SHIFT)) - -#define A_NORMAL (1UL - 1UL) -#define A_ATTRIBUTES NCURSES_BITS(~(1UL - 1UL),0) -#define A_CHARTEXT (NCURSES_BITS(1UL,0) - 1UL) -#define A_COLOR NCURSES_BITS(((1UL) << 8) - 1UL,0) -#define A_STANDOUT NCURSES_BITS(1UL,8) -#define A_UNDERLINE NCURSES_BITS(1UL,9) -#define A_REVERSE NCURSES_BITS(1UL,10) -#define A_BLINK NCURSES_BITS(1UL,11) -#define A_DIM NCURSES_BITS(1UL,12) -#define A_BOLD NCURSES_BITS(1UL,13) -#define A_ALTCHARSET NCURSES_BITS(1UL,14) -#define A_INVIS NCURSES_BITS(1UL,15) -#define A_PROTECT NCURSES_BITS(1UL,16) -#define A_HORIZONTAL NCURSES_BITS(1UL,17) -#define A_LEFT NCURSES_BITS(1UL,18) -#define A_LOW NCURSES_BITS(1UL,19) -#define A_RIGHT NCURSES_BITS(1UL,20) -#define A_TOP NCURSES_BITS(1UL,21) -#define A_VERTICAL NCURSES_BITS(1UL,22) - -/* - * Most of the pseudo functions are macros that either provide compatibility - * with older versions of curses, or provide inline functionality to improve - * performance. - */ - -/* - * These pseudo functions are always implemented as macros: - */ - -#define getyx(win,y,x) (y = getcury(win), x = getcurx(win)) -#define getbegyx(win,y,x) (y = getbegy(win), x = getbegx(win)) -#define getmaxyx(win,y,x) (y = getmaxy(win), x = getmaxx(win)) -#define getparyx(win,y,x) (y = getpary(win), x = getparx(win)) - -#define getsyx(y,x) do { if (newscr) { \ - if (is_leaveok(newscr)) \ - (y) = (x) = -1; \ - else \ - getyx(newscr,(y), (x)); \ - } \ - } while(0) - -#define setsyx(y,x) do { if (newscr) { \ - if ((y) == -1 && (x) == -1) \ - leaveok(newscr, TRUE); \ - else { \ - leaveok(newscr, FALSE); \ - wmove(newscr, (y), (x)); \ - } \ - } \ - } while(0) - -#ifndef NCURSES_NOMACROS - -/* - * These miscellaneous pseudo functions are provided for compatibility: - */ - -#define wgetstr(w, s) wgetnstr(w, s, -1) -#define getnstr(s, n) wgetnstr(stdscr, s, n) - -#define setterm(term) setupterm(term, 1, (int *)0) - -#define fixterm() reset_prog_mode() -#define resetterm() reset_shell_mode() -#define saveterm() def_prog_mode() -#define crmode() cbreak() -#define nocrmode() nocbreak() -#define gettmode() - -/* It seems older SYSV curses versions define these */ -#if !NCURSES_OPAQUE -#define getattrs(win) NCURSES_CAST(int, (win) ? (win)->_attrs : A_NORMAL) -#define getcurx(win) ((win) ? (win)->_curx : ERR) -#define getcury(win) ((win) ? (win)->_cury : ERR) -#define getbegx(win) ((win) ? (win)->_begx : ERR) -#define getbegy(win) ((win) ? (win)->_begy : ERR) -#define getmaxx(win) ((win) ? ((win)->_maxx + 1) : ERR) -#define getmaxy(win) ((win) ? ((win)->_maxy + 1) : ERR) -#define getparx(win) ((win) ? (win)->_parx : ERR) -#define getpary(win) ((win) ? (win)->_pary : ERR) -#endif /* NCURSES_OPAQUE */ - -#define wstandout(win) (wattrset(win,A_STANDOUT)) -#define wstandend(win) (wattrset(win,A_NORMAL)) - -#define wattron(win,at) wattr_on(win, NCURSES_CAST(attr_t, at), NULL) -#define wattroff(win,at) wattr_off(win, NCURSES_CAST(attr_t, at), NULL) - -#if !NCURSES_OPAQUE -#if defined(NCURSES_WIDECHAR) && 0 -#define wattrset(win,at) ((win) \ - ? ((win)->_color = PAIR_NUMBER(at), \ - (win)->_attrs = NCURSES_CAST(attr_t, at), \ - OK) \ - : ERR) -#else -#define wattrset(win,at) ((win) \ - ? ((win)->_attrs = NCURSES_CAST(attr_t, at), \ - OK) \ - : ERR) -#endif -#endif /* NCURSES_OPAQUE */ - -#define scroll(win) wscrl(win,1) - -#define touchwin(win) wtouchln((win), 0, getmaxy(win), 1) -#define touchline(win, s, c) wtouchln((win), s, c, 1) -#define untouchwin(win) wtouchln((win), 0, getmaxy(win), 0) - -#define box(win, v, h) wborder(win, v, v, h, h, 0, 0, 0, 0) -#define border(ls, rs, ts, bs, tl, tr, bl, br) wborder(stdscr, ls, rs, ts, bs, tl, tr, bl, br) -#define hline(ch, n) whline(stdscr, ch, n) -#define vline(ch, n) wvline(stdscr, ch, n) - -#define winstr(w, s) winnstr(w, s, -1) -#define winchstr(w, s) winchnstr(w, s, -1) -#define winsstr(w, s) winsnstr(w, s, -1) - -#if !NCURSES_OPAQUE -#define redrawwin(win) wredrawln(win, 0, (win)->_maxy+1) -#endif /* NCURSES_OPAQUE */ - -#define waddstr(win,str) waddnstr(win,str,-1) -#define waddchstr(win,str) waddchnstr(win,str,-1) - -/* - * These apply to the first 256 color pairs. - */ -#define COLOR_PAIR(n) NCURSES_BITS(n, 0) -#define PAIR_NUMBER(a) (NCURSES_CAST(int,((NCURSES_CAST(unsigned long,a) & A_COLOR) >> NCURSES_ATTR_SHIFT))) - -/* - * pseudo functions for standard screen - */ - -#define addch(ch) waddch(stdscr,ch) -#define addchnstr(str,n) waddchnstr(stdscr,str,n) -#define addchstr(str) waddchstr(stdscr,str) -#define addnstr(str,n) waddnstr(stdscr,str,n) -#define addstr(str) waddnstr(stdscr,str,-1) -#define attroff(at) wattroff(stdscr,at) -#define attron(at) wattron(stdscr,at) -#define attrset(at) wattrset(stdscr,at) -#define attr_get(ap,cp,o) wattr_get(stdscr,ap,cp,o) -#define attr_off(a,o) wattr_off(stdscr,a,o) -#define attr_on(a,o) wattr_on(stdscr,a,o) -#define attr_set(a,c,o) wattr_set(stdscr,a,c,o) -#define bkgd(ch) wbkgd(stdscr,ch) -#define bkgdset(ch) wbkgdset(stdscr,ch) -#define chgat(n,a,c,o) wchgat(stdscr,n,a,c,o) -#define clear() wclear(stdscr) -#define clrtobot() wclrtobot(stdscr) -#define clrtoeol() wclrtoeol(stdscr) -#define color_set(c,o) wcolor_set(stdscr,c,o) -#define delch() wdelch(stdscr) -#define deleteln() winsdelln(stdscr,-1) -#define echochar(c) wechochar(stdscr,c) -#define erase() werase(stdscr) -#define getch() wgetch(stdscr) -#define getstr(str) wgetstr(stdscr,str) -#define inch() winch(stdscr) -#define inchnstr(s,n) winchnstr(stdscr,s,n) -#define inchstr(s) winchstr(stdscr,s) -#define innstr(s,n) winnstr(stdscr,s,n) -#define insch(c) winsch(stdscr,c) -#define insdelln(n) winsdelln(stdscr,n) -#define insertln() winsdelln(stdscr,1) -#define insnstr(s,n) winsnstr(stdscr,s,n) -#define insstr(s) winsstr(stdscr,s) -#define instr(s) winstr(stdscr,s) -#define move(y,x) wmove(stdscr,y,x) -#define refresh() wrefresh(stdscr) -#define scrl(n) wscrl(stdscr,n) -#define setscrreg(t,b) wsetscrreg(stdscr,t,b) -#define standend() wstandend(stdscr) -#define standout() wstandout(stdscr) -#define timeout(delay) wtimeout(stdscr,delay) -#define wdeleteln(win) winsdelln(win,-1) -#define winsertln(win) winsdelln(win,1) - -/* - * mv functions - */ - -#define mvwaddch(win,y,x,ch) (wmove(win,y,x) == ERR ? ERR : waddch(win,ch)) -#define mvwaddchnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : waddchnstr(win,str,n)) -#define mvwaddchstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : waddchnstr(win,str,-1)) -#define mvwaddnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : waddnstr(win,str,n)) -#define mvwaddstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : waddnstr(win,str,-1)) -#define mvwdelch(win,y,x) (wmove(win,y,x) == ERR ? ERR : wdelch(win)) -#define mvwchgat(win,y,x,n,a,c,o) (wmove(win,y,x) == ERR ? ERR : wchgat(win,n,a,c,o)) -#define mvwgetch(win,y,x) (wmove(win,y,x) == ERR ? ERR : wgetch(win)) -#define mvwgetnstr(win,y,x,str,n) (wmove(win,y,x) == ERR ? ERR : wgetnstr(win,str,n)) -#define mvwgetstr(win,y,x,str) (wmove(win,y,x) == ERR ? ERR : wgetstr(win,str)) -#define mvwhline(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : whline(win,c,n)) -#define mvwinch(win,y,x) (wmove(win,y,x) == ERR ? NCURSES_CAST(chtype, ERR) : winch(win)) -#define mvwinchnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : winchnstr(win,s,n)) -#define mvwinchstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : winchstr(win,s)) -#define mvwinnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : winnstr(win,s,n)) -#define mvwinsch(win,y,x,c) (wmove(win,y,x) == ERR ? ERR : winsch(win,c)) -#define mvwinsnstr(win,y,x,s,n) (wmove(win,y,x) == ERR ? ERR : winsnstr(win,s,n)) -#define mvwinsstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : winsstr(win,s)) -#define mvwinstr(win,y,x,s) (wmove(win,y,x) == ERR ? ERR : winstr(win,s)) -#define mvwvline(win,y,x,c,n) (wmove(win,y,x) == ERR ? ERR : wvline(win,c,n)) - -#define mvaddch(y,x,ch) mvwaddch(stdscr,y,x,ch) -#define mvaddchnstr(y,x,str,n) mvwaddchnstr(stdscr,y,x,str,n) -#define mvaddchstr(y,x,str) mvwaddchstr(stdscr,y,x,str) -#define mvaddnstr(y,x,str,n) mvwaddnstr(stdscr,y,x,str,n) -#define mvaddstr(y,x,str) mvwaddstr(stdscr,y,x,str) -#define mvchgat(y,x,n,a,c,o) mvwchgat(stdscr,y,x,n,a,c,o) -#define mvdelch(y,x) mvwdelch(stdscr,y,x) -#define mvgetch(y,x) mvwgetch(stdscr,y,x) -#define mvgetnstr(y,x,str,n) mvwgetnstr(stdscr,y,x,str,n) -#define mvgetstr(y,x,str) mvwgetstr(stdscr,y,x,str) -#define mvhline(y,x,c,n) mvwhline(stdscr,y,x,c,n) -#define mvinch(y,x) mvwinch(stdscr,y,x) -#define mvinchnstr(y,x,s,n) mvwinchnstr(stdscr,y,x,s,n) -#define mvinchstr(y,x,s) mvwinchstr(stdscr,y,x,s) -#define mvinnstr(y,x,s,n) mvwinnstr(stdscr,y,x,s,n) -#define mvinsch(y,x,c) mvwinsch(stdscr,y,x,c) -#define mvinsnstr(y,x,s,n) mvwinsnstr(stdscr,y,x,s,n) -#define mvinsstr(y,x,s) mvwinsstr(stdscr,y,x,s) -#define mvinstr(y,x,s) mvwinstr(stdscr,y,x,s) -#define mvvline(y,x,c,n) mvwvline(stdscr,y,x,c,n) - -/* - * Some wide-character functions can be implemented without the extensions. - */ -#if !NCURSES_OPAQUE -#define getbkgd(win) ((win)->_bkgd) -#endif /* NCURSES_OPAQUE */ - -#define slk_attr_off(a,v) ((v) ? ERR : slk_attroff(a)) -#define slk_attr_on(a,v) ((v) ? ERR : slk_attron(a)) - -#if !NCURSES_OPAQUE -#if defined(NCURSES_WIDECHAR) && 0 -#define wattr_set(win,a,p,opts) ((win)->_attrs = ((a) & ~A_COLOR), \ - (win)->_color = (p), \ - OK) -#define wattr_get(win,a,p,opts) ((void)((a) != (void *)0 && (*(a) = (win)->_attrs)), \ - (void)((p) != (void *)0 && (*(p) = (short)(win)->_color)), \ - OK) -#else -#define wattr_set(win,a,p,opts) ((win)->_attrs = (((a) & ~A_COLOR) | (attr_t)COLOR_PAIR(p)), OK) -#define wattr_get(win,a,p,opts) ((void)((a) != (void *)0 && (*(a) = (win)->_attrs)), \ - (void)((p) != (void *)0 && (*(p) = (short)PAIR_NUMBER((win)->_attrs))), \ - OK) -#endif -#endif /* NCURSES_OPAQUE */ - -/* - * X/Open curses deprecates SVr4 vwprintw/vwscanw, which are supposed to use - * varargs.h. It adds new calls vw_printw/vw_scanw, which are supposed to - * use POSIX stdarg.h. The ncurses versions of vwprintw/vwscanw already - * use stdarg.h, so... - */ -#define vw_printw vwprintw -#define vw_scanw vwscanw - -/* - * Export fallback function for use in C++ binding. - */ -#if !1 -#define vsscanf(a,b,c) _nc_vsscanf(a,b,c) -NCURSES_EXPORT(int) vsscanf(const char *, const char *, va_list); -#endif - -/* - * These macros are extensions - not in X/Open Curses. - */ -#if 1 -#if !NCURSES_OPAQUE -#define is_cleared(win) ((win) ? (win)->_clear : FALSE) -#define is_idcok(win) ((win) ? (win)->_idcok : FALSE) -#define is_idlok(win) ((win) ? (win)->_idlok : FALSE) -#define is_immedok(win) ((win) ? (win)->_immed : FALSE) -#define is_keypad(win) ((win) ? (win)->_use_keypad : FALSE) -#define is_leaveok(win) ((win) ? (win)->_leaveok : FALSE) -#define is_nodelay(win) ((win) ? ((win)->_delay == 0) : FALSE) -#define is_notimeout(win) ((win) ? (win)->_notimeout : FALSE) -#define is_pad(win) ((win) ? ((win)->_flags & _ISPAD) != 0 : FALSE) -#define is_scrollok(win) ((win) ? (win)->_scroll : FALSE) -#define is_subwin(win) ((win) ? ((win)->_flags & _SUBWIN) != 0 : FALSE) -#define is_syncok(win) ((win) ? (win)->_sync : FALSE) -#define wgetparent(win) ((win) ? (win)->_parent : 0) -#define wgetscrreg(win,t,b) ((win) ? (*(t) = (win)->_regtop, *(b) = (win)->_regbottom, OK) : ERR) -#endif -#endif - -#endif /* NCURSES_NOMACROS */ - -/* - * Public variables. - * - * Notes: - * a. ESCDELAY was an undocumented feature under AIX curses. - * It gives the ESC expire time in milliseconds. - * b. ttytype is needed for backward compatibility - */ -#if NCURSES_REENTRANT - -NCURSES_WRAPPED_VAR(WINDOW *, curscr); -NCURSES_WRAPPED_VAR(WINDOW *, newscr); -NCURSES_WRAPPED_VAR(WINDOW *, stdscr); -NCURSES_WRAPPED_VAR(char *, ttytype); -NCURSES_WRAPPED_VAR(int, COLORS); -NCURSES_WRAPPED_VAR(int, COLOR_PAIRS); -NCURSES_WRAPPED_VAR(int, COLS); -NCURSES_WRAPPED_VAR(int, ESCDELAY); -NCURSES_WRAPPED_VAR(int, LINES); -NCURSES_WRAPPED_VAR(int, TABSIZE); - -#define curscr NCURSES_PUBLIC_VAR(curscr()) -#define newscr NCURSES_PUBLIC_VAR(newscr()) -#define stdscr NCURSES_PUBLIC_VAR(stdscr()) -#define ttytype NCURSES_PUBLIC_VAR(ttytype()) -#define COLORS NCURSES_PUBLIC_VAR(COLORS()) -#define COLOR_PAIRS NCURSES_PUBLIC_VAR(COLOR_PAIRS()) -#define COLS NCURSES_PUBLIC_VAR(COLS()) -#define ESCDELAY NCURSES_PUBLIC_VAR(ESCDELAY()) -#define LINES NCURSES_PUBLIC_VAR(LINES()) -#define TABSIZE NCURSES_PUBLIC_VAR(TABSIZE()) - -#else - -extern NCURSES_EXPORT_VAR(WINDOW *) curscr; -extern NCURSES_EXPORT_VAR(WINDOW *) newscr; -extern NCURSES_EXPORT_VAR(WINDOW *) stdscr; -extern NCURSES_EXPORT_VAR(char) ttytype[]; -extern NCURSES_EXPORT_VAR(int) COLORS; -extern NCURSES_EXPORT_VAR(int) COLOR_PAIRS; -extern NCURSES_EXPORT_VAR(int) COLS; -extern NCURSES_EXPORT_VAR(int) ESCDELAY; -extern NCURSES_EXPORT_VAR(int) LINES; -extern NCURSES_EXPORT_VAR(int) TABSIZE; - -#endif - -/* - * Pseudo-character tokens outside ASCII range. The curses wgetch() function - * will return any given one of these only if the corresponding k- capability - * is defined in your terminal's terminfo entry. - * - * Some keys (KEY_A1, etc) are arranged like this: - * a1 up a3 - * left b2 right - * c1 down c3 - * - * A few key codes do not depend upon the terminfo entry. - */ -#define KEY_CODE_YES 0400 /* A wchar_t contains a key code */ -#define KEY_MIN 0401 /* Minimum curses key */ -#define KEY_BREAK 0401 /* Break key (unreliable) */ -#define KEY_SRESET 0530 /* Soft (partial) reset (unreliable) */ -#define KEY_RESET 0531 /* Reset or hard reset (unreliable) */ -/* - * These definitions were generated by ./MKkey_defs.sh ./Caps - */ -#define KEY_DOWN 0402 /* down-arrow key */ -#define KEY_UP 0403 /* up-arrow key */ -#define KEY_LEFT 0404 /* left-arrow key */ -#define KEY_RIGHT 0405 /* right-arrow key */ -#define KEY_HOME 0406 /* home key */ -#define KEY_BACKSPACE 0407 /* backspace key */ -#define KEY_F0 0410 /* Function keys. Space for 64 */ -#define KEY_F(n) (KEY_F0+(n)) /* Value of function key n */ -#define KEY_DL 0510 /* delete-line key */ -#define KEY_IL 0511 /* insert-line key */ -#define KEY_DC 0512 /* delete-character key */ -#define KEY_IC 0513 /* insert-character key */ -#define KEY_EIC 0514 /* sent by rmir or smir in insert mode */ -#define KEY_CLEAR 0515 /* clear-screen or erase key */ -#define KEY_EOS 0516 /* clear-to-end-of-screen key */ -#define KEY_EOL 0517 /* clear-to-end-of-line key */ -#define KEY_SF 0520 /* scroll-forward key */ -#define KEY_SR 0521 /* scroll-backward key */ -#define KEY_NPAGE 0522 /* next-page key */ -#define KEY_PPAGE 0523 /* previous-page key */ -#define KEY_STAB 0524 /* set-tab key */ -#define KEY_CTAB 0525 /* clear-tab key */ -#define KEY_CATAB 0526 /* clear-all-tabs key */ -#define KEY_ENTER 0527 /* enter/send key */ -#define KEY_PRINT 0532 /* print key */ -#define KEY_LL 0533 /* lower-left key (home down) */ -#define KEY_A1 0534 /* upper left of keypad */ -#define KEY_A3 0535 /* upper right of keypad */ -#define KEY_B2 0536 /* center of keypad */ -#define KEY_C1 0537 /* lower left of keypad */ -#define KEY_C3 0540 /* lower right of keypad */ -#define KEY_BTAB 0541 /* back-tab key */ -#define KEY_BEG 0542 /* begin key */ -#define KEY_CANCEL 0543 /* cancel key */ -#define KEY_CLOSE 0544 /* close key */ -#define KEY_COMMAND 0545 /* command key */ -#define KEY_COPY 0546 /* copy key */ -#define KEY_CREATE 0547 /* create key */ -#define KEY_END 0550 /* end key */ -#define KEY_EXIT 0551 /* exit key */ -#define KEY_FIND 0552 /* find key */ -#define KEY_HELP 0553 /* help key */ -#define KEY_MARK 0554 /* mark key */ -#define KEY_MESSAGE 0555 /* message key */ -#define KEY_MOVE 0556 /* move key */ -#define KEY_NEXT 0557 /* next key */ -#define KEY_OPEN 0560 /* open key */ -#define KEY_OPTIONS 0561 /* options key */ -#define KEY_PREVIOUS 0562 /* previous key */ -#define KEY_REDO 0563 /* redo key */ -#define KEY_REFERENCE 0564 /* reference key */ -#define KEY_REFRESH 0565 /* refresh key */ -#define KEY_REPLACE 0566 /* replace key */ -#define KEY_RESTART 0567 /* restart key */ -#define KEY_RESUME 0570 /* resume key */ -#define KEY_SAVE 0571 /* save key */ -#define KEY_SBEG 0572 /* shifted begin key */ -#define KEY_SCANCEL 0573 /* shifted cancel key */ -#define KEY_SCOMMAND 0574 /* shifted command key */ -#define KEY_SCOPY 0575 /* shifted copy key */ -#define KEY_SCREATE 0576 /* shifted create key */ -#define KEY_SDC 0577 /* shifted delete-character key */ -#define KEY_SDL 0600 /* shifted delete-line key */ -#define KEY_SELECT 0601 /* select key */ -#define KEY_SEND 0602 /* shifted end key */ -#define KEY_SEOL 0603 /* shifted clear-to-end-of-line key */ -#define KEY_SEXIT 0604 /* shifted exit key */ -#define KEY_SFIND 0605 /* shifted find key */ -#define KEY_SHELP 0606 /* shifted help key */ -#define KEY_SHOME 0607 /* shifted home key */ -#define KEY_SIC 0610 /* shifted insert-character key */ -#define KEY_SLEFT 0611 /* shifted left-arrow key */ -#define KEY_SMESSAGE 0612 /* shifted message key */ -#define KEY_SMOVE 0613 /* shifted move key */ -#define KEY_SNEXT 0614 /* shifted next key */ -#define KEY_SOPTIONS 0615 /* shifted options key */ -#define KEY_SPREVIOUS 0616 /* shifted previous key */ -#define KEY_SPRINT 0617 /* shifted print key */ -#define KEY_SREDO 0620 /* shifted redo key */ -#define KEY_SREPLACE 0621 /* shifted replace key */ -#define KEY_SRIGHT 0622 /* shifted right-arrow key */ -#define KEY_SRSUME 0623 /* shifted resume key */ -#define KEY_SSAVE 0624 /* shifted save key */ -#define KEY_SSUSPEND 0625 /* shifted suspend key */ -#define KEY_SUNDO 0626 /* shifted undo key */ -#define KEY_SUSPEND 0627 /* suspend key */ -#define KEY_UNDO 0630 /* undo key */ -#define KEY_MOUSE 0631 /* Mouse event has occurred */ -#define KEY_RESIZE 0632 /* Terminal resize event */ -#define KEY_EVENT 0633 /* We were interrupted by an event */ - -#define KEY_MAX 0777 /* Maximum key value is 0633 */ -/* $Id: curses.tail,v 1.20 2010/03/28 19:10:55 tom Exp $ */ -/* - * vile:cmode: - * This file is part of ncurses, designed to be appended after curses.h.in - * (see that file for the relevant copyright). - */ - -/* mouse interface */ - -#if NCURSES_MOUSE_VERSION > 1 -#define NCURSES_MOUSE_MASK(b,m) ((m) << (((b) - 1) * 5)) -#else -#define NCURSES_MOUSE_MASK(b,m) ((m) << (((b) - 1) * 6)) -#endif - -#define NCURSES_BUTTON_RELEASED 001L -#define NCURSES_BUTTON_PRESSED 002L -#define NCURSES_BUTTON_CLICKED 004L -#define NCURSES_DOUBLE_CLICKED 010L -#define NCURSES_TRIPLE_CLICKED 020L -#define NCURSES_RESERVED_EVENT 040L - -/* event masks */ -#define BUTTON1_RELEASED NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_RELEASED) -#define BUTTON1_PRESSED NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_PRESSED) -#define BUTTON1_CLICKED NCURSES_MOUSE_MASK(1, NCURSES_BUTTON_CLICKED) -#define BUTTON1_DOUBLE_CLICKED NCURSES_MOUSE_MASK(1, NCURSES_DOUBLE_CLICKED) -#define BUTTON1_TRIPLE_CLICKED NCURSES_MOUSE_MASK(1, NCURSES_TRIPLE_CLICKED) - -#define BUTTON2_RELEASED NCURSES_MOUSE_MASK(2, NCURSES_BUTTON_RELEASED) -#define BUTTON2_PRESSED NCURSES_MOUSE_MASK(2, NCURSES_BUTTON_PRESSED) -#define BUTTON2_CLICKED NCURSES_MOUSE_MASK(2, NCURSES_BUTTON_CLICKED) -#define BUTTON2_DOUBLE_CLICKED NCURSES_MOUSE_MASK(2, NCURSES_DOUBLE_CLICKED) -#define BUTTON2_TRIPLE_CLICKED NCURSES_MOUSE_MASK(2, NCURSES_TRIPLE_CLICKED) - -#define BUTTON3_RELEASED NCURSES_MOUSE_MASK(3, NCURSES_BUTTON_RELEASED) -#define BUTTON3_PRESSED NCURSES_MOUSE_MASK(3, NCURSES_BUTTON_PRESSED) -#define BUTTON3_CLICKED NCURSES_MOUSE_MASK(3, NCURSES_BUTTON_CLICKED) -#define BUTTON3_DOUBLE_CLICKED NCURSES_MOUSE_MASK(3, NCURSES_DOUBLE_CLICKED) -#define BUTTON3_TRIPLE_CLICKED NCURSES_MOUSE_MASK(3, NCURSES_TRIPLE_CLICKED) - -#define BUTTON4_RELEASED NCURSES_MOUSE_MASK(4, NCURSES_BUTTON_RELEASED) -#define BUTTON4_PRESSED NCURSES_MOUSE_MASK(4, NCURSES_BUTTON_PRESSED) -#define BUTTON4_CLICKED NCURSES_MOUSE_MASK(4, NCURSES_BUTTON_CLICKED) -#define BUTTON4_DOUBLE_CLICKED NCURSES_MOUSE_MASK(4, NCURSES_DOUBLE_CLICKED) -#define BUTTON4_TRIPLE_CLICKED NCURSES_MOUSE_MASK(4, NCURSES_TRIPLE_CLICKED) - -/* - * In 32 bits the version-1 scheme does not provide enough space for a 5th - * button, unless we choose to change the ABI by omitting the reserved-events. - */ -#if NCURSES_MOUSE_VERSION > 1 - -#define BUTTON5_RELEASED NCURSES_MOUSE_MASK(5, NCURSES_BUTTON_RELEASED) -#define BUTTON5_PRESSED NCURSES_MOUSE_MASK(5, NCURSES_BUTTON_PRESSED) -#define BUTTON5_CLICKED NCURSES_MOUSE_MASK(5, NCURSES_BUTTON_CLICKED) -#define BUTTON5_DOUBLE_CLICKED NCURSES_MOUSE_MASK(5, NCURSES_DOUBLE_CLICKED) -#define BUTTON5_TRIPLE_CLICKED NCURSES_MOUSE_MASK(5, NCURSES_TRIPLE_CLICKED) - -#define BUTTON_CTRL NCURSES_MOUSE_MASK(6, 0001L) -#define BUTTON_SHIFT NCURSES_MOUSE_MASK(6, 0002L) -#define BUTTON_ALT NCURSES_MOUSE_MASK(6, 0004L) -#define REPORT_MOUSE_POSITION NCURSES_MOUSE_MASK(6, 0010L) - -#else - -#define BUTTON1_RESERVED_EVENT NCURSES_MOUSE_MASK(1, NCURSES_RESERVED_EVENT) -#define BUTTON2_RESERVED_EVENT NCURSES_MOUSE_MASK(2, NCURSES_RESERVED_EVENT) -#define BUTTON3_RESERVED_EVENT NCURSES_MOUSE_MASK(3, NCURSES_RESERVED_EVENT) -#define BUTTON4_RESERVED_EVENT NCURSES_MOUSE_MASK(4, NCURSES_RESERVED_EVENT) - -#define BUTTON_CTRL NCURSES_MOUSE_MASK(5, 0001L) -#define BUTTON_SHIFT NCURSES_MOUSE_MASK(5, 0002L) -#define BUTTON_ALT NCURSES_MOUSE_MASK(5, 0004L) -#define REPORT_MOUSE_POSITION NCURSES_MOUSE_MASK(5, 0010L) - -#endif - -#define ALL_MOUSE_EVENTS (REPORT_MOUSE_POSITION - 1) - -/* macros to extract single event-bits from masks */ -#define BUTTON_RELEASE(e, x) ((e) & NCURSES_MOUSE_MASK(x, 001)) -#define BUTTON_PRESS(e, x) ((e) & NCURSES_MOUSE_MASK(x, 002)) -#define BUTTON_CLICK(e, x) ((e) & NCURSES_MOUSE_MASK(x, 004)) -#define BUTTON_DOUBLE_CLICK(e, x) ((e) & NCURSES_MOUSE_MASK(x, 010)) -#define BUTTON_TRIPLE_CLICK(e, x) ((e) & NCURSES_MOUSE_MASK(x, 020)) -#define BUTTON_RESERVED_EVENT(e, x) ((e) & NCURSES_MOUSE_MASK(x, 040)) - -typedef struct -{ - short id; /* ID to distinguish multiple devices */ - int x, y, z; /* event coordinates (character-cell) */ - mmask_t bstate; /* button state bits */ -} -MEVENT; - -extern NCURSES_EXPORT(bool) has_mouse(void); -extern NCURSES_EXPORT(int) getmouse (MEVENT *); -extern NCURSES_EXPORT(int) ungetmouse (MEVENT *); -extern NCURSES_EXPORT(mmask_t) mousemask (mmask_t, mmask_t *); -extern NCURSES_EXPORT(bool) wenclose (const WINDOW *, int, int); -extern NCURSES_EXPORT(int) mouseinterval (int); -extern NCURSES_EXPORT(bool) wmouse_trafo (const WINDOW*, int*, int*, bool); -extern NCURSES_EXPORT(bool) mouse_trafo (int*, int*, bool); /* generated */ - -#if NCURSES_SP_FUNCS -extern NCURSES_EXPORT(bool) NCURSES_SP_NAME(has_mouse) (SCREEN*); -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(getmouse) (SCREEN*, MEVENT *); -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(ungetmouse) (SCREEN*,MEVENT *); -extern NCURSES_EXPORT(mmask_t) NCURSES_SP_NAME(mousemask) (SCREEN*, mmask_t, mmask_t *); -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(mouseinterval) (SCREEN*, int); -#endif - -#define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen) - -/* other non-XSI functions */ - -extern NCURSES_EXPORT(int) mcprint (char *, int); /* direct data to printer */ -extern NCURSES_EXPORT(int) has_key (int); /* do we have given key? */ - -#if NCURSES_SP_FUNCS -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(has_key) (SCREEN*, int); /* do we have given key? */ -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(mcprint) (SCREEN*, char *, int); /* direct data to printer */ -#endif - -/* Debugging : use with libncurses_g.a */ - -extern NCURSES_EXPORT(void) _tracef (const char *, ...) GCC_PRINTFLIKE(1,2); -extern NCURSES_EXPORT(void) _tracedump (const char *, WINDOW *); -extern NCURSES_EXPORT(char *) _traceattr (attr_t); -extern NCURSES_EXPORT(char *) _traceattr2 (int, chtype); -extern NCURSES_EXPORT(char *) _nc_tracebits (void); -extern NCURSES_EXPORT(char *) _tracechar (int); -extern NCURSES_EXPORT(char *) _tracechtype (chtype); -extern NCURSES_EXPORT(char *) _tracechtype2 (int, chtype); -#ifdef NCURSES_WIDECHAR -#define _tracech_t _tracecchar_t -extern NCURSES_EXPORT(char *) _tracecchar_t (const cchar_t *); -#define _tracech_t2 _tracecchar_t2 -extern NCURSES_EXPORT(char *) _tracecchar_t2 (int, const cchar_t *); -#else -#define _tracech_t _tracechtype -#define _tracech_t2 _tracechtype2 -#endif -extern NCURSES_EXPORT(char *) _tracemouse (const MEVENT *); -extern NCURSES_EXPORT(void) trace (const unsigned int); - -/* trace masks */ -#define TRACE_DISABLE 0x0000 /* turn off tracing */ -#define TRACE_TIMES 0x0001 /* trace user and system times of updates */ -#define TRACE_TPUTS 0x0002 /* trace tputs calls */ -#define TRACE_UPDATE 0x0004 /* trace update actions, old & new screens */ -#define TRACE_MOVE 0x0008 /* trace cursor moves and scrolls */ -#define TRACE_CHARPUT 0x0010 /* trace all character outputs */ -#define TRACE_ORDINARY 0x001F /* trace all update actions */ -#define TRACE_CALLS 0x0020 /* trace all curses calls */ -#define TRACE_VIRTPUT 0x0040 /* trace virtual character puts */ -#define TRACE_IEVENT 0x0080 /* trace low-level input processing */ -#define TRACE_BITS 0x0100 /* trace state of TTY control bits */ -#define TRACE_ICALLS 0x0200 /* trace internal/nested calls */ -#define TRACE_CCALLS 0x0400 /* trace per-character calls */ -#define TRACE_DATABASE 0x0800 /* trace read/write of terminfo/termcap data */ -#define TRACE_ATTRS 0x1000 /* trace attribute updates */ - -#define TRACE_SHIFT 13 /* number of bits in the trace masks */ -#define TRACE_MAXIMUM ((1 << TRACE_SHIFT) - 1) /* maximum trace level */ - -#if defined(TRACE) || defined(NCURSES_TEST) -extern NCURSES_EXPORT_VAR(int) _nc_optimize_enable; /* enable optimizations */ -extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *); -#define OPTIMIZE_MVCUR 0x01 /* cursor movement optimization */ -#define OPTIMIZE_HASHMAP 0x02 /* diff hashing to detect scrolls */ -#define OPTIMIZE_SCROLL 0x04 /* scroll optimization */ -#define OPTIMIZE_ALL 0xff /* enable all optimizations (dflt) */ -#endif - -#include - -#ifdef __cplusplus - -#ifndef NCURSES_NOMACROS - -/* these names conflict with STL */ -#undef box -#undef clear -#undef erase -#undef move -#undef refresh - -#endif /* NCURSES_NOMACROS */ - -} -#endif - -#endif /* __NCURSES_H */ diff --git a/windows/ncurses/include/ncurses/ncurses_dll.h b/windows/ncurses/include/ncurses/ncurses_dll.h deleted file mode 100644 index 6974fcba0..000000000 --- a/windows/ncurses/include/ncurses/ncurses_dll.h +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2007,2009 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ -/* $Id: ncurses_dll.h.in,v 1.8 2009/04/04 22:26:27 tom Exp $ */ - -#ifndef NCURSES_DLL_H_incl -#define NCURSES_DLL_H_incl 1 - -/* - * For reentrant code, we map the various global variables into SCREEN by - * using functions to access them. - */ -#define NCURSES_PUBLIC_VAR(name) _nc_##name -#define NCURSES_WRAPPED_VAR(type,name) extern type NCURSES_PUBLIC_VAR(name)(void) - -/* no longer needed on cygwin or mingw, thanks to auto-import */ -/* but this structure may be useful at some point for an MSVC build */ -/* so, for now unconditionally define the important flags */ -/* "the right way" for proper static and dll+auto-import behavior */ -#undef NCURSES_DLL -#define NCURSES_STATIC - -#if defined(__CYGWIN__) || defined(__MINGW32__) -# if defined(NCURSES_DLL) -# if defined(NCURSES_STATIC) -# undef NCURSES_STATIC -# endif -# endif -# undef NCURSES_IMPEXP -# undef NCURSES_API -# undef NCURSES_EXPORT -# undef NCURSES_EXPORT_VAR -# if defined(NCURSES_DLL) -/* building a DLL */ -# define NCURSES_IMPEXP __declspec(dllexport) -# elif defined(NCURSES_STATIC) -/* building or linking to a static library */ -# define NCURSES_IMPEXP /* nothing */ -# else -/* linking to the DLL */ -# define NCURSES_IMPEXP __declspec(dllimport) -# endif -# define NCURSES_API __cdecl -# define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API -# define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type -#endif - -/* Take care of non-cygwin platforms */ -#if !defined(NCURSES_IMPEXP) -# define NCURSES_IMPEXP /* nothing */ -#endif -#if !defined(NCURSES_API) -# define NCURSES_API /* nothing */ -#endif -#if !defined(NCURSES_EXPORT) -# define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API -#endif -#if !defined(NCURSES_EXPORT_VAR) -# define NCURSES_EXPORT_VAR(type) __declspec(dllimport) type -#endif - -#endif /* NCURSES_DLL_H_incl */ diff --git a/windows/ncurses/include/ncurses/panel.h b/windows/ncurses/include/ncurses/panel.h deleted file mode 100644 index 4d5aca279..000000000 --- a/windows/ncurses/include/ncurses/panel.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2006,2009 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ - -/**************************************************************************** - * Author: Zeyd M. Ben-Halim 1995 * - * and: Eric S. Raymond * - * and: Juergen Pfeifer 1996-1999,2008 * - ****************************************************************************/ - -/* $Id: panel.h,v 1.11 2009/04/11 19:50:40 tom Exp $ */ - -/* panel.h -- interface file for panels library */ - -#ifndef NCURSES_PANEL_H_incl -#define NCURSES_PANEL_H_incl 1 - -#include - -typedef struct panel -{ - WINDOW *win; - struct panel *below; - struct panel *above; - NCURSES_CONST void *user; -} PANEL; - -#if defined(__cplusplus) -extern "C" { -#endif - -extern NCURSES_EXPORT(WINDOW*) panel_window (const PANEL *); -extern NCURSES_EXPORT(void) update_panels (void); -extern NCURSES_EXPORT(int) hide_panel (PANEL *); -extern NCURSES_EXPORT(int) show_panel (PANEL *); -extern NCURSES_EXPORT(int) del_panel (PANEL *); -extern NCURSES_EXPORT(int) top_panel (PANEL *); -extern NCURSES_EXPORT(int) bottom_panel (PANEL *); -extern NCURSES_EXPORT(PANEL*) new_panel (WINDOW *); -extern NCURSES_EXPORT(PANEL*) panel_above (const PANEL *); -extern NCURSES_EXPORT(PANEL*) panel_below (const PANEL *); -extern NCURSES_EXPORT(int) set_panel_userptr (PANEL *, NCURSES_CONST void *); -extern NCURSES_EXPORT(NCURSES_CONST void*) panel_userptr (const PANEL *); -extern NCURSES_EXPORT(int) move_panel (PANEL *, int, int); -extern NCURSES_EXPORT(int) replace_panel (PANEL *,WINDOW *); -extern NCURSES_EXPORT(int) panel_hidden (const PANEL *); - -#if NCURSES_SP_FUNCS -extern NCURSES_EXPORT(PANEL *) ground_panel(SCREEN *); -extern NCURSES_EXPORT(PANEL *) ceiling_panel(SCREEN *); - -extern NCURSES_EXPORT(void) NCURSES_SP_NAME(update_panels) (SCREEN*); -#endif - -#if defined(__cplusplus) -} -#endif - -#endif /* NCURSES_PANEL_H_incl */ - -/* end of panel.h */ diff --git a/windows/ncurses/include/ncurses/term.h b/windows/ncurses/include/ncurses/term.h deleted file mode 100644 index 543a18df8..000000000 --- a/windows/ncurses/include/ncurses/term.h +++ /dev/null @@ -1,834 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ - -/****************************************************************************/ -/* Author: Zeyd M. Ben-Halim 1992,1995 */ -/* and: Eric S. Raymond */ -/* and: Thomas E. Dickey 1995-on */ -/****************************************************************************/ - -/* $Id: MKterm.h.awk.in,v 1.58 2010/01/09 19:53:26 tom Exp $ */ - -/* -** term.h -- Definition of struct term -*/ - -#ifndef NCURSES_TERM_H_incl -#define NCURSES_TERM_H_incl 1 - -#undef NCURSES_VERSION -#define NCURSES_VERSION "5.9" - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* Make this file self-contained by providing defaults for the HAVE_TERMIO[S]_H - * definition (based on the system for which this was configured). - */ - -#undef NCURSES_CONST -#define NCURSES_CONST /*nothing*/ - -#undef NCURSES_SBOOL -#define NCURSES_SBOOL char - -#undef NCURSES_XNAMES -#define NCURSES_XNAMES 1 - -/* We will use these symbols to hide differences between - * termios/termio/sgttyb interfaces. - */ -#undef TTY -#undef SET_TTY -#undef GET_TTY - -/* Assume POSIX termio if we have the header and function */ -/* #if HAVE_TERMIOS_H && HAVE_TCGETATTR */ -#if 0 && 0 - -#undef TERMIOS -#define TERMIOS 1 - -#include -#define TTY struct termios - -#else /* !HAVE_TERMIOS_H */ - -/* #if HAVE_TERMIO_H */ -#if 0 - -#undef TERMIOS -#define TERMIOS 1 - -#include -#define TTY struct termio - -/* Add definitions to make termio look like termios. - * But ifdef it, since there are some implementations - * that try to do this for us in a fake . - */ -#ifndef TCSANOW -#define TCSANOW TCSETA -#endif -#ifndef TCSADRAIN -#define TCSADRAIN TCSETAW -#endif -#ifndef TCSAFLUSH -#define TCSAFLUSH TCSETAF -#endif -#ifndef tcsetattr -#define tcsetattr(fd, cmd, arg) ioctl(fd, cmd, arg) -#endif -#ifndef tcgetattr -#define tcgetattr(fd, arg) ioctl(fd, TCGETA, arg) -#endif -#ifndef cfgetospeed -#define cfgetospeed(t) ((t)->c_cflag & CBAUD) -#endif -#ifndef TCIFLUSH -#define TCIFLUSH 0 -#endif -#ifndef TCOFLUSH -#define TCOFLUSH 1 -#endif -#ifndef TCIOFLUSH -#define TCIOFLUSH 2 -#endif -#ifndef tcflush -#define tcflush(fd, arg) ioctl(fd, TCFLSH, arg) -#endif - -#else /* !HAVE_TERMIO_H */ - -#if __MINGW32__ -# include -# define TTY struct termios -#else -#undef TERMIOS -#include -#include -#define TTY struct sgttyb -#endif /* MINGW32 */ -#endif /* HAVE_TERMIO_H */ - -#endif /* HAVE_TERMIOS_H */ - -#ifdef TERMIOS -#define GET_TTY(fd, buf) tcgetattr(fd, buf) -#define SET_TTY(fd, buf) tcsetattr(fd, TCSADRAIN, buf) -#else -#define GET_TTY(fd, buf) gtty(fd, buf) -#define SET_TTY(fd, buf) stty(fd, buf) -#endif - -#define NAMESIZE 256 - -#define CUR cur_term->type. - -#define auto_left_margin CUR Booleans[0] -#define auto_right_margin CUR Booleans[1] -#define no_esc_ctlc CUR Booleans[2] -#define ceol_standout_glitch CUR Booleans[3] -#define eat_newline_glitch CUR Booleans[4] -#define erase_overstrike CUR Booleans[5] -#define generic_type CUR Booleans[6] -#define hard_copy CUR Booleans[7] -#define has_meta_key CUR Booleans[8] -#define has_status_line CUR Booleans[9] -#define insert_null_glitch CUR Booleans[10] -#define memory_above CUR Booleans[11] -#define memory_below CUR Booleans[12] -#define move_insert_mode CUR Booleans[13] -#define move_standout_mode CUR Booleans[14] -#define over_strike CUR Booleans[15] -#define status_line_esc_ok CUR Booleans[16] -#define dest_tabs_magic_smso CUR Booleans[17] -#define tilde_glitch CUR Booleans[18] -#define transparent_underline CUR Booleans[19] -#define xon_xoff CUR Booleans[20] -#define needs_xon_xoff CUR Booleans[21] -#define prtr_silent CUR Booleans[22] -#define hard_cursor CUR Booleans[23] -#define non_rev_rmcup CUR Booleans[24] -#define no_pad_char CUR Booleans[25] -#define non_dest_scroll_region CUR Booleans[26] -#define can_change CUR Booleans[27] -#define back_color_erase CUR Booleans[28] -#define hue_lightness_saturation CUR Booleans[29] -#define col_addr_glitch CUR Booleans[30] -#define cr_cancels_micro_mode CUR Booleans[31] -#define has_print_wheel CUR Booleans[32] -#define row_addr_glitch CUR Booleans[33] -#define semi_auto_right_margin CUR Booleans[34] -#define cpi_changes_res CUR Booleans[35] -#define lpi_changes_res CUR Booleans[36] -#define columns CUR Numbers[0] -#define init_tabs CUR Numbers[1] -#define lines CUR Numbers[2] -#define lines_of_memory CUR Numbers[3] -#define magic_cookie_glitch CUR Numbers[4] -#define padding_baud_rate CUR Numbers[5] -#define virtual_terminal CUR Numbers[6] -#define width_status_line CUR Numbers[7] -#define num_labels CUR Numbers[8] -#define label_height CUR Numbers[9] -#define label_width CUR Numbers[10] -#define max_attributes CUR Numbers[11] -#define maximum_windows CUR Numbers[12] -#define max_colors CUR Numbers[13] -#define max_pairs CUR Numbers[14] -#define no_color_video CUR Numbers[15] -#define buffer_capacity CUR Numbers[16] -#define dot_vert_spacing CUR Numbers[17] -#define dot_horz_spacing CUR Numbers[18] -#define max_micro_address CUR Numbers[19] -#define max_micro_jump CUR Numbers[20] -#define micro_col_size CUR Numbers[21] -#define micro_line_size CUR Numbers[22] -#define number_of_pins CUR Numbers[23] -#define output_res_char CUR Numbers[24] -#define output_res_line CUR Numbers[25] -#define output_res_horz_inch CUR Numbers[26] -#define output_res_vert_inch CUR Numbers[27] -#define print_rate CUR Numbers[28] -#define wide_char_size CUR Numbers[29] -#define buttons CUR Numbers[30] -#define bit_image_entwining CUR Numbers[31] -#define bit_image_type CUR Numbers[32] -#define back_tab CUR Strings[0] -#define bell CUR Strings[1] -#define carriage_return CUR Strings[2] -#define change_scroll_region CUR Strings[3] -#define clear_all_tabs CUR Strings[4] -#define clear_screen CUR Strings[5] -#define clr_eol CUR Strings[6] -#define clr_eos CUR Strings[7] -#define column_address CUR Strings[8] -#define command_character CUR Strings[9] -#define cursor_address CUR Strings[10] -#define cursor_down CUR Strings[11] -#define cursor_home CUR Strings[12] -#define cursor_invisible CUR Strings[13] -#define cursor_left CUR Strings[14] -#define cursor_mem_address CUR Strings[15] -#define cursor_normal CUR Strings[16] -#define cursor_right CUR Strings[17] -#define cursor_to_ll CUR Strings[18] -#define cursor_up CUR Strings[19] -#define cursor_visible CUR Strings[20] -#define delete_character CUR Strings[21] -#define delete_line CUR Strings[22] -#define dis_status_line CUR Strings[23] -#define down_half_line CUR Strings[24] -#define enter_alt_charset_mode CUR Strings[25] -#define enter_blink_mode CUR Strings[26] -#define enter_bold_mode CUR Strings[27] -#define enter_ca_mode CUR Strings[28] -#define enter_delete_mode CUR Strings[29] -#define enter_dim_mode CUR Strings[30] -#define enter_insert_mode CUR Strings[31] -#define enter_secure_mode CUR Strings[32] -#define enter_protected_mode CUR Strings[33] -#define enter_reverse_mode CUR Strings[34] -#define enter_standout_mode CUR Strings[35] -#define enter_underline_mode CUR Strings[36] -#define erase_chars CUR Strings[37] -#define exit_alt_charset_mode CUR Strings[38] -#define exit_attribute_mode CUR Strings[39] -#define exit_ca_mode CUR Strings[40] -#define exit_delete_mode CUR Strings[41] -#define exit_insert_mode CUR Strings[42] -#define exit_standout_mode CUR Strings[43] -#define exit_underline_mode CUR Strings[44] -#define flash_screen CUR Strings[45] -#define form_feed CUR Strings[46] -#define from_status_line CUR Strings[47] -#define init_1string CUR Strings[48] -#define init_2string CUR Strings[49] -#define init_3string CUR Strings[50] -#define init_file CUR Strings[51] -#define insert_character CUR Strings[52] -#define insert_line CUR Strings[53] -#define insert_padding CUR Strings[54] -#define key_backspace CUR Strings[55] -#define key_catab CUR Strings[56] -#define key_clear CUR Strings[57] -#define key_ctab CUR Strings[58] -#define key_dc CUR Strings[59] -#define key_dl CUR Strings[60] -#define key_down CUR Strings[61] -#define key_eic CUR Strings[62] -#define key_eol CUR Strings[63] -#define key_eos CUR Strings[64] -#define key_f0 CUR Strings[65] -#define key_f1 CUR Strings[66] -#define key_f10 CUR Strings[67] -#define key_f2 CUR Strings[68] -#define key_f3 CUR Strings[69] -#define key_f4 CUR Strings[70] -#define key_f5 CUR Strings[71] -#define key_f6 CUR Strings[72] -#define key_f7 CUR Strings[73] -#define key_f8 CUR Strings[74] -#define key_f9 CUR Strings[75] -#define key_home CUR Strings[76] -#define key_ic CUR Strings[77] -#define key_il CUR Strings[78] -#define key_left CUR Strings[79] -#define key_ll CUR Strings[80] -#define key_npage CUR Strings[81] -#define key_ppage CUR Strings[82] -#define key_right CUR Strings[83] -#define key_sf CUR Strings[84] -#define key_sr CUR Strings[85] -#define key_stab CUR Strings[86] -#define key_up CUR Strings[87] -#define keypad_local CUR Strings[88] -#define keypad_xmit CUR Strings[89] -#define lab_f0 CUR Strings[90] -#define lab_f1 CUR Strings[91] -#define lab_f10 CUR Strings[92] -#define lab_f2 CUR Strings[93] -#define lab_f3 CUR Strings[94] -#define lab_f4 CUR Strings[95] -#define lab_f5 CUR Strings[96] -#define lab_f6 CUR Strings[97] -#define lab_f7 CUR Strings[98] -#define lab_f8 CUR Strings[99] -#define lab_f9 CUR Strings[100] -#define meta_off CUR Strings[101] -#define meta_on CUR Strings[102] -#define newline CUR Strings[103] -#define pad_char CUR Strings[104] -#define parm_dch CUR Strings[105] -#define parm_delete_line CUR Strings[106] -#define parm_down_cursor CUR Strings[107] -#define parm_ich CUR Strings[108] -#define parm_index CUR Strings[109] -#define parm_insert_line CUR Strings[110] -#define parm_left_cursor CUR Strings[111] -#define parm_right_cursor CUR Strings[112] -#define parm_rindex CUR Strings[113] -#define parm_up_cursor CUR Strings[114] -#define pkey_key CUR Strings[115] -#define pkey_local CUR Strings[116] -#define pkey_xmit CUR Strings[117] -#define print_screen CUR Strings[118] -#define prtr_off CUR Strings[119] -#define prtr_on CUR Strings[120] -#define repeat_char CUR Strings[121] -#define reset_1string CUR Strings[122] -#define reset_2string CUR Strings[123] -#define reset_3string CUR Strings[124] -#define reset_file CUR Strings[125] -#define restore_cursor CUR Strings[126] -#define row_address CUR Strings[127] -#define save_cursor CUR Strings[128] -#define scroll_forward CUR Strings[129] -#define scroll_reverse CUR Strings[130] -#define set_attributes CUR Strings[131] -#define set_tab CUR Strings[132] -#define set_window CUR Strings[133] -#define tab CUR Strings[134] -#define to_status_line CUR Strings[135] -#define underline_char CUR Strings[136] -#define up_half_line CUR Strings[137] -#define init_prog CUR Strings[138] -#define key_a1 CUR Strings[139] -#define key_a3 CUR Strings[140] -#define key_b2 CUR Strings[141] -#define key_c1 CUR Strings[142] -#define key_c3 CUR Strings[143] -#define prtr_non CUR Strings[144] -#define char_padding CUR Strings[145] -#define acs_chars CUR Strings[146] -#define plab_norm CUR Strings[147] -#define key_btab CUR Strings[148] -#define enter_xon_mode CUR Strings[149] -#define exit_xon_mode CUR Strings[150] -#define enter_am_mode CUR Strings[151] -#define exit_am_mode CUR Strings[152] -#define xon_character CUR Strings[153] -#define xoff_character CUR Strings[154] -#define ena_acs CUR Strings[155] -#define label_on CUR Strings[156] -#define label_off CUR Strings[157] -#define key_beg CUR Strings[158] -#define key_cancel CUR Strings[159] -#define key_close CUR Strings[160] -#define key_command CUR Strings[161] -#define key_copy CUR Strings[162] -#define key_create CUR Strings[163] -#define key_end CUR Strings[164] -#define key_enter CUR Strings[165] -#define key_exit CUR Strings[166] -#define key_find CUR Strings[167] -#define key_help CUR Strings[168] -#define key_mark CUR Strings[169] -#define key_message CUR Strings[170] -#define key_move CUR Strings[171] -#define key_next CUR Strings[172] -#define key_open CUR Strings[173] -#define key_options CUR Strings[174] -#define key_previous CUR Strings[175] -#define key_print CUR Strings[176] -#define key_redo CUR Strings[177] -#define key_reference CUR Strings[178] -#define key_refresh CUR Strings[179] -#define key_replace CUR Strings[180] -#define key_restart CUR Strings[181] -#define key_resume CUR Strings[182] -#define key_save CUR Strings[183] -#define key_suspend CUR Strings[184] -#define key_undo CUR Strings[185] -#define key_sbeg CUR Strings[186] -#define key_scancel CUR Strings[187] -#define key_scommand CUR Strings[188] -#define key_scopy CUR Strings[189] -#define key_screate CUR Strings[190] -#define key_sdc CUR Strings[191] -#define key_sdl CUR Strings[192] -#define key_select CUR Strings[193] -#define key_send CUR Strings[194] -#define key_seol CUR Strings[195] -#define key_sexit CUR Strings[196] -#define key_sfind CUR Strings[197] -#define key_shelp CUR Strings[198] -#define key_shome CUR Strings[199] -#define key_sic CUR Strings[200] -#define key_sleft CUR Strings[201] -#define key_smessage CUR Strings[202] -#define key_smove CUR Strings[203] -#define key_snext CUR Strings[204] -#define key_soptions CUR Strings[205] -#define key_sprevious CUR Strings[206] -#define key_sprint CUR Strings[207] -#define key_sredo CUR Strings[208] -#define key_sreplace CUR Strings[209] -#define key_sright CUR Strings[210] -#define key_srsume CUR Strings[211] -#define key_ssave CUR Strings[212] -#define key_ssuspend CUR Strings[213] -#define key_sundo CUR Strings[214] -#define req_for_input CUR Strings[215] -#define key_f11 CUR Strings[216] -#define key_f12 CUR Strings[217] -#define key_f13 CUR Strings[218] -#define key_f14 CUR Strings[219] -#define key_f15 CUR Strings[220] -#define key_f16 CUR Strings[221] -#define key_f17 CUR Strings[222] -#define key_f18 CUR Strings[223] -#define key_f19 CUR Strings[224] -#define key_f20 CUR Strings[225] -#define key_f21 CUR Strings[226] -#define key_f22 CUR Strings[227] -#define key_f23 CUR Strings[228] -#define key_f24 CUR Strings[229] -#define key_f25 CUR Strings[230] -#define key_f26 CUR Strings[231] -#define key_f27 CUR Strings[232] -#define key_f28 CUR Strings[233] -#define key_f29 CUR Strings[234] -#define key_f30 CUR Strings[235] -#define key_f31 CUR Strings[236] -#define key_f32 CUR Strings[237] -#define key_f33 CUR Strings[238] -#define key_f34 CUR Strings[239] -#define key_f35 CUR Strings[240] -#define key_f36 CUR Strings[241] -#define key_f37 CUR Strings[242] -#define key_f38 CUR Strings[243] -#define key_f39 CUR Strings[244] -#define key_f40 CUR Strings[245] -#define key_f41 CUR Strings[246] -#define key_f42 CUR Strings[247] -#define key_f43 CUR Strings[248] -#define key_f44 CUR Strings[249] -#define key_f45 CUR Strings[250] -#define key_f46 CUR Strings[251] -#define key_f47 CUR Strings[252] -#define key_f48 CUR Strings[253] -#define key_f49 CUR Strings[254] -#define key_f50 CUR Strings[255] -#define key_f51 CUR Strings[256] -#define key_f52 CUR Strings[257] -#define key_f53 CUR Strings[258] -#define key_f54 CUR Strings[259] -#define key_f55 CUR Strings[260] -#define key_f56 CUR Strings[261] -#define key_f57 CUR Strings[262] -#define key_f58 CUR Strings[263] -#define key_f59 CUR Strings[264] -#define key_f60 CUR Strings[265] -#define key_f61 CUR Strings[266] -#define key_f62 CUR Strings[267] -#define key_f63 CUR Strings[268] -#define clr_bol CUR Strings[269] -#define clear_margins CUR Strings[270] -#define set_left_margin CUR Strings[271] -#define set_right_margin CUR Strings[272] -#define label_format CUR Strings[273] -#define set_clock CUR Strings[274] -#define display_clock CUR Strings[275] -#define remove_clock CUR Strings[276] -#define create_window CUR Strings[277] -#define goto_window CUR Strings[278] -#define hangup CUR Strings[279] -#define dial_phone CUR Strings[280] -#define quick_dial CUR Strings[281] -#define tone CUR Strings[282] -#define pulse CUR Strings[283] -#define flash_hook CUR Strings[284] -#define fixed_pause CUR Strings[285] -#define wait_tone CUR Strings[286] -#define user0 CUR Strings[287] -#define user1 CUR Strings[288] -#define user2 CUR Strings[289] -#define user3 CUR Strings[290] -#define user4 CUR Strings[291] -#define user5 CUR Strings[292] -#define user6 CUR Strings[293] -#define user7 CUR Strings[294] -#define user8 CUR Strings[295] -#define user9 CUR Strings[296] -#define orig_pair CUR Strings[297] -#define orig_colors CUR Strings[298] -#define initialize_color CUR Strings[299] -#define initialize_pair CUR Strings[300] -#define set_color_pair CUR Strings[301] -#define set_foreground CUR Strings[302] -#define set_background CUR Strings[303] -#define change_char_pitch CUR Strings[304] -#define change_line_pitch CUR Strings[305] -#define change_res_horz CUR Strings[306] -#define change_res_vert CUR Strings[307] -#define define_char CUR Strings[308] -#define enter_doublewide_mode CUR Strings[309] -#define enter_draft_quality CUR Strings[310] -#define enter_italics_mode CUR Strings[311] -#define enter_leftward_mode CUR Strings[312] -#define enter_micro_mode CUR Strings[313] -#define enter_near_letter_quality CUR Strings[314] -#define enter_normal_quality CUR Strings[315] -#define enter_shadow_mode CUR Strings[316] -#define enter_subscript_mode CUR Strings[317] -#define enter_superscript_mode CUR Strings[318] -#define enter_upward_mode CUR Strings[319] -#define exit_doublewide_mode CUR Strings[320] -#define exit_italics_mode CUR Strings[321] -#define exit_leftward_mode CUR Strings[322] -#define exit_micro_mode CUR Strings[323] -#define exit_shadow_mode CUR Strings[324] -#define exit_subscript_mode CUR Strings[325] -#define exit_superscript_mode CUR Strings[326] -#define exit_upward_mode CUR Strings[327] -#define micro_column_address CUR Strings[328] -#define micro_down CUR Strings[329] -#define micro_left CUR Strings[330] -#define micro_right CUR Strings[331] -#define micro_row_address CUR Strings[332] -#define micro_up CUR Strings[333] -#define order_of_pins CUR Strings[334] -#define parm_down_micro CUR Strings[335] -#define parm_left_micro CUR Strings[336] -#define parm_right_micro CUR Strings[337] -#define parm_up_micro CUR Strings[338] -#define select_char_set CUR Strings[339] -#define set_bottom_margin CUR Strings[340] -#define set_bottom_margin_parm CUR Strings[341] -#define set_left_margin_parm CUR Strings[342] -#define set_right_margin_parm CUR Strings[343] -#define set_top_margin CUR Strings[344] -#define set_top_margin_parm CUR Strings[345] -#define start_bit_image CUR Strings[346] -#define start_char_set_def CUR Strings[347] -#define stop_bit_image CUR Strings[348] -#define stop_char_set_def CUR Strings[349] -#define subscript_characters CUR Strings[350] -#define superscript_characters CUR Strings[351] -#define these_cause_cr CUR Strings[352] -#define zero_motion CUR Strings[353] -#define char_set_names CUR Strings[354] -#define key_mouse CUR Strings[355] -#define mouse_info CUR Strings[356] -#define req_mouse_pos CUR Strings[357] -#define get_mouse CUR Strings[358] -#define set_a_foreground CUR Strings[359] -#define set_a_background CUR Strings[360] -#define pkey_plab CUR Strings[361] -#define device_type CUR Strings[362] -#define code_set_init CUR Strings[363] -#define set0_des_seq CUR Strings[364] -#define set1_des_seq CUR Strings[365] -#define set2_des_seq CUR Strings[366] -#define set3_des_seq CUR Strings[367] -#define set_lr_margin CUR Strings[368] -#define set_tb_margin CUR Strings[369] -#define bit_image_repeat CUR Strings[370] -#define bit_image_newline CUR Strings[371] -#define bit_image_carriage_return CUR Strings[372] -#define color_names CUR Strings[373] -#define define_bit_image_region CUR Strings[374] -#define end_bit_image_region CUR Strings[375] -#define set_color_band CUR Strings[376] -#define set_page_length CUR Strings[377] -#define display_pc_char CUR Strings[378] -#define enter_pc_charset_mode CUR Strings[379] -#define exit_pc_charset_mode CUR Strings[380] -#define enter_scancode_mode CUR Strings[381] -#define exit_scancode_mode CUR Strings[382] -#define pc_term_options CUR Strings[383] -#define scancode_escape CUR Strings[384] -#define alt_scancode_esc CUR Strings[385] -#define enter_horizontal_hl_mode CUR Strings[386] -#define enter_left_hl_mode CUR Strings[387] -#define enter_low_hl_mode CUR Strings[388] -#define enter_right_hl_mode CUR Strings[389] -#define enter_top_hl_mode CUR Strings[390] -#define enter_vertical_hl_mode CUR Strings[391] -#define set_a_attributes CUR Strings[392] -#define set_pglen_inch CUR Strings[393] - -#define BOOLWRITE 37 -#define NUMWRITE 33 -#define STRWRITE 394 - -/* older synonyms for some capabilities */ -#define beehive_glitch no_esc_ctlc -#define teleray_glitch dest_tabs_magic_smso -#define micro_char_size micro_col_size - -#ifdef __INTERNAL_CAPS_VISIBLE -#define termcap_init2 CUR Strings[394] -#define termcap_reset CUR Strings[395] -#define magic_cookie_glitch_ul CUR Numbers[33] -#define backspaces_with_bs CUR Booleans[37] -#define crt_no_scrolling CUR Booleans[38] -#define no_correctly_working_cr CUR Booleans[39] -#define carriage_return_delay CUR Numbers[34] -#define new_line_delay CUR Numbers[35] -#define linefeed_if_not_lf CUR Strings[396] -#define backspace_if_not_bs CUR Strings[397] -#define gnu_has_meta_key CUR Booleans[40] -#define linefeed_is_newline CUR Booleans[41] -#define backspace_delay CUR Numbers[36] -#define horizontal_tab_delay CUR Numbers[37] -#define number_of_function_keys CUR Numbers[38] -#define other_non_function_keys CUR Strings[398] -#define arrow_key_map CUR Strings[399] -#define has_hardware_tabs CUR Booleans[42] -#define return_does_clr_eol CUR Booleans[43] -#define acs_ulcorner CUR Strings[400] -#define acs_llcorner CUR Strings[401] -#define acs_urcorner CUR Strings[402] -#define acs_lrcorner CUR Strings[403] -#define acs_ltee CUR Strings[404] -#define acs_rtee CUR Strings[405] -#define acs_btee CUR Strings[406] -#define acs_ttee CUR Strings[407] -#define acs_hline CUR Strings[408] -#define acs_vline CUR Strings[409] -#define acs_plus CUR Strings[410] -#define memory_lock CUR Strings[411] -#define memory_unlock CUR Strings[412] -#define box_chars_1 CUR Strings[413] -#endif /* __INTERNAL_CAPS_VISIBLE */ - - -/* - * Predefined terminfo array sizes - */ -#define BOOLCOUNT 44 -#define NUMCOUNT 39 -#define STRCOUNT 414 - -/* used by code for comparing entries */ -#define acs_chars_index 146 - -typedef struct termtype { /* in-core form of terminfo data */ - char *term_names; /* str_table offset of term names */ - char *str_table; /* pointer to string table */ - NCURSES_SBOOL *Booleans; /* array of boolean values */ - short *Numbers; /* array of integer values */ - char **Strings; /* array of string offsets */ - -#if NCURSES_XNAMES - char *ext_str_table; /* pointer to extended string table */ - char **ext_Names; /* corresponding names */ - - unsigned short num_Booleans;/* count total Booleans */ - unsigned short num_Numbers; /* count total Numbers */ - unsigned short num_Strings; /* count total Strings */ - - unsigned short ext_Booleans;/* count extensions to Booleans */ - unsigned short ext_Numbers; /* count extensions to Numbers */ - unsigned short ext_Strings; /* count extensions to Strings */ -#endif /* NCURSES_XNAMES */ - -} TERMTYPE; - -typedef struct term { /* describe an actual terminal */ - TERMTYPE type; /* terminal type description */ - short Filedes; /* file description being written to */ - TTY Ottyb, /* original state of the terminal */ - Nttyb; /* current state of the terminal */ - int _baudrate; /* used to compute padding */ - char * _termname; /* used for termname() */ -} TERMINAL; - -#if 0 && !0 -extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term; -#elif 0 -NCURSES_WRAPPED_VAR(TERMINAL *, cur_term); -#define cur_term NCURSES_PUBLIC_VAR(cur_term()) -#else -extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term; -#endif - -#if 0 || 0 -NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolnames); -NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolcodes); -NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolfnames); -NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numnames); -NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numcodes); -NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numfnames); -NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strnames); -NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strcodes); -NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strfnames); - -#define boolnames NCURSES_PUBLIC_VAR(boolnames()) -#define boolcodes NCURSES_PUBLIC_VAR(boolcodes()) -#define boolfnames NCURSES_PUBLIC_VAR(boolfnames()) -#define numnames NCURSES_PUBLIC_VAR(numnames()) -#define numcodes NCURSES_PUBLIC_VAR(numcodes()) -#define numfnames NCURSES_PUBLIC_VAR(numfnames()) -#define strnames NCURSES_PUBLIC_VAR(strnames()) -#define strcodes NCURSES_PUBLIC_VAR(strcodes()) -#define strfnames NCURSES_PUBLIC_VAR(strfnames()) - -#else - -extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolnames[]; -extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolcodes[]; -extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolfnames[]; -extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numnames[]; -extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numcodes[]; -extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numfnames[]; -extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strnames[]; -extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strcodes[]; -extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strfnames[]; - -#endif - -/* internals */ -extern NCURSES_EXPORT(int) _nc_set_tty_mode (TTY *buf); -extern NCURSES_EXPORT(int) _nc_get_tty_mode (TTY *buf); -extern NCURSES_EXPORT(int) _nc_read_entry (const char * const, char * const, TERMTYPE *const); -extern NCURSES_EXPORT(int) _nc_read_file_entry (const char *const, TERMTYPE *); -extern NCURSES_EXPORT(int) _nc_read_termtype (TERMTYPE *, char *, int); -extern NCURSES_EXPORT(char *) _nc_first_name (const char *const); -extern NCURSES_EXPORT(int) _nc_name_match (const char *const, const char *const, const char *const); -extern NCURSES_EXPORT(const TERMTYPE *) _nc_fallback (const char *); - -/* entry points */ -extern NCURSES_EXPORT(TERMINAL *) set_curterm (TERMINAL *); -extern NCURSES_EXPORT(int) del_curterm (TERMINAL *); - -/* miscellaneous entry points */ -extern NCURSES_EXPORT(int) restartterm (NCURSES_CONST char *, int, int *); -extern NCURSES_EXPORT(int) setupterm (NCURSES_CONST char *,int,int *); - -/* terminfo entry points, also declared in curses.h */ -#if !defined(__NCURSES_H) -extern NCURSES_EXPORT(char *) tigetstr (NCURSES_CONST char *); -extern NCURSES_EXPORT_VAR(char) ttytype[]; -extern NCURSES_EXPORT(int) putp (const char *); -extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *); -extern NCURSES_EXPORT(int) tigetnum (NCURSES_CONST char *); - -#if 1 /* NCURSES_TPARM_VARARGS */ -extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, ...); /* special */ -#else -extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, long,long,long,long,long,long,long,long,long); /* special */ -extern NCURSES_EXPORT(char *) tparm_varargs (NCURSES_CONST char *, ...); /* special */ -#endif - -extern NCURSES_EXPORT(char *) tiparm (const char *, ...); /* special */ - -#endif /* __NCURSES_H */ - -/* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */ -#if !defined(NCURSES_TERMCAP_H_incl) -extern NCURSES_EXPORT(char *) tgetstr (NCURSES_CONST char *, char **); -extern NCURSES_EXPORT(char *) tgoto (const char *, int, int); -extern NCURSES_EXPORT(int) tgetent (char *, const char *); -extern NCURSES_EXPORT(int) tgetflag (NCURSES_CONST char *); -extern NCURSES_EXPORT(int) tgetnum (NCURSES_CONST char *); -extern NCURSES_EXPORT(int) tputs (const char *, int, int (*)(int)); -#endif /* NCURSES_TERMCAP_H_incl */ - -/* - * Include curses.h before term.h to enable these extensions. - */ -#if defined(NCURSES_SP_FUNCS) && (NCURSES_SP_FUNCS != 0) - -extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tigetstr) (SCREEN*, NCURSES_CONST char *); -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(putp) (SCREEN*, const char *); -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tigetflag) (SCREEN*, NCURSES_CONST char *); -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tigetnum) (SCREEN*, NCURSES_CONST char *); - -#if 1 /* NCURSES_TPARM_VARARGS */ -extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tparm) (SCREEN*, NCURSES_CONST char *, ...); /* special */ -#else -extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tparm) (SCREEN*, NCURSES_CONST char *, long,long,long,long,long,long,long,long,long); /* special */ -extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tparm_varargs) (SCREEN*, NCURSES_CONST char *, ...); /* special */ -#endif - -/* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */ -extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tgetstr) (SCREEN*, NCURSES_CONST char *, char **); -extern NCURSES_EXPORT(char *) NCURSES_SP_NAME(tgoto) (SCREEN*, const char *, int, int); -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tgetent) (SCREEN*, char *, const char *); -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tgetflag) (SCREEN*, NCURSES_CONST char *); -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tgetnum) (SCREEN*, NCURSES_CONST char *); -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(tputs) (SCREEN*, const char *, int, NCURSES_SP_OUTC); - -extern NCURSES_EXPORT(TERMINAL *) NCURSES_SP_NAME(set_curterm) (SCREEN*, TERMINAL *); -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(del_curterm) (SCREEN*, TERMINAL *); - -extern NCURSES_EXPORT(int) NCURSES_SP_NAME(restartterm) (SCREEN*, NCURSES_CONST char *, int, int *); -#endif /* NCURSES_SP_FUNCS */ - -#ifdef __cplusplus -} -#endif - -#endif /* NCURSES_TERM_H_incl */ diff --git a/windows/ncurses/include/ncurses/term_entry.h b/windows/ncurses/include/ncurses/term_entry.h deleted file mode 100644 index 1610438e3..000000000 --- a/windows/ncurses/include/ncurses/term_entry.h +++ /dev/null @@ -1,174 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ - -/**************************************************************************** - * Author: Zeyd M. Ben-Halim 1992,1995 * - * and: Eric S. Raymond * - * and: Thomas E. Dickey 1998-on * - ****************************************************************************/ - -/* $Id: term_entry.h,v 1.37 2009/07/11 16:52:29 tom Exp $ */ - -/* - * term_entry.h -- interface to entry-manipulation code - */ - -#ifndef NCURSES_TERM_ENTRY_H_incl -#define NCURSES_TERM_ENTRY_H_incl 1 - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#define MAX_USES 32 -#define MAX_CROSSLINKS 16 - -typedef struct entry { - TERMTYPE tterm; - unsigned nuses; - struct - { - char *name; - struct entry *link; - long line; - } - uses[MAX_USES]; - int ncrosslinks; - struct entry *crosslinks[MAX_CROSSLINKS]; - long cstart, cend; - long startline; - struct entry *next; - struct entry *last; -} -ENTRY; - -#if NCURSES_XNAMES -#define NUM_BOOLEANS(tp) (tp)->num_Booleans -#define NUM_NUMBERS(tp) (tp)->num_Numbers -#define NUM_STRINGS(tp) (tp)->num_Strings -#define EXT_NAMES(tp,i,limit,index,table) (i >= limit) ? tp->ext_Names[index] : table[i] -#else -#define NUM_BOOLEANS(tp) BOOLCOUNT -#define NUM_NUMBERS(tp) NUMCOUNT -#define NUM_STRINGS(tp) STRCOUNT -#define EXT_NAMES(tp,i,limit,index,table) table[i] -#endif - -#define NUM_EXT_NAMES(tp) (unsigned) ((tp)->ext_Booleans + (tp)->ext_Numbers + (tp)->ext_Strings) - -#define for_each_boolean(n,tp) for(n = 0; n < NUM_BOOLEANS(tp); n++) -#define for_each_number(n,tp) for(n = 0; n < NUM_NUMBERS(tp); n++) -#define for_each_string(n,tp) for(n = 0; n < NUM_STRINGS(tp); n++) - -#if NCURSES_XNAMES -#define for_each_ext_boolean(n,tp) for(n = BOOLCOUNT; n < NUM_BOOLEANS(tp); n++) -#define for_each_ext_number(n,tp) for(n = NUMCOUNT; n < NUM_NUMBERS(tp); n++) -#define for_each_ext_string(n,tp) for(n = STRCOUNT; n < NUM_STRINGS(tp); n++) -#endif - -#define ExtBoolname(tp,i,names) EXT_NAMES(tp, i, BOOLCOUNT, (i - (tp->num_Booleans - tp->ext_Booleans)), names) -#define ExtNumname(tp,i,names) EXT_NAMES(tp, i, NUMCOUNT, (i - (tp->num_Numbers - tp->ext_Numbers)) + tp->ext_Booleans, names) -#define ExtStrname(tp,i,names) EXT_NAMES(tp, i, STRCOUNT, (i - (tp->num_Strings - tp->ext_Strings)) + (tp->ext_Numbers + tp->ext_Booleans), names) - -extern NCURSES_EXPORT_VAR(ENTRY *) _nc_head; -extern NCURSES_EXPORT_VAR(ENTRY *) _nc_tail; -#define for_entry_list(qp) for (qp = _nc_head; qp; qp = qp->next) - -#define MAX_LINE 132 - -#define NULLHOOK (bool(*)(ENTRY *))0 - -/* - * Note that WANTED and PRESENT are not simple inverses! If a capability - * has been explicitly cancelled, it's not considered WANTED. - */ -#define WANTED(s) ((s) == ABSENT_STRING) -#define PRESENT(s) (((s) != ABSENT_STRING) && ((s) != CANCELLED_STRING)) - -#define ANDMISSING(p,q) \ - {if (PRESENT(p) && !PRESENT(q)) _nc_warning(#p " but no " #q);} - -#define PAIRED(p,q) \ - { \ - if (PRESENT(q) && !PRESENT(p)) \ - _nc_warning(#q " but no " #p); \ - if (PRESENT(p) && !PRESENT(q)) \ - _nc_warning(#p " but no " #q); \ - } - -/* alloc_entry.c: elementary allocation code */ -extern NCURSES_EXPORT(ENTRY *) _nc_copy_entry (ENTRY *oldp); -extern NCURSES_EXPORT(char *) _nc_save_str (const char *const); -extern NCURSES_EXPORT(void) _nc_init_entry (TERMTYPE *const); -extern NCURSES_EXPORT(void) _nc_merge_entry (TERMTYPE *const, TERMTYPE *const); -extern NCURSES_EXPORT(void) _nc_wrap_entry (ENTRY *const, bool); - -/* alloc_ttype.c: elementary allocation code */ -extern NCURSES_EXPORT(void) _nc_align_termtype (TERMTYPE *, TERMTYPE *); -extern NCURSES_EXPORT(void) _nc_copy_termtype (TERMTYPE *, TERMTYPE *); - -/* free_ttype.c: elementary allocation code */ -extern NCURSES_EXPORT(void) _nc_free_termtype (TERMTYPE *); - -/* lib_acs.c */ -extern NCURSES_EXPORT(void) _nc_init_acs (void); /* corresponds to traditional 'init_acs()' */ - -/* lib_termcap.c: trim sgr0 string for termcap users */ -extern NCURSES_EXPORT(char *) _nc_trim_sgr0 (TERMTYPE *); - -/* parse_entry.c: entry-parsing code */ -#if NCURSES_XNAMES -extern NCURSES_EXPORT_VAR(bool) _nc_user_definable; -extern NCURSES_EXPORT_VAR(bool) _nc_disable_period; -#endif -extern NCURSES_EXPORT(int) _nc_parse_entry (ENTRY *, int, bool); -extern NCURSES_EXPORT(int) _nc_capcmp (const char *, const char *); - -/* write_entry.c: writing an entry to the file system */ -extern NCURSES_EXPORT(void) _nc_set_writedir (char *); -extern NCURSES_EXPORT(void) _nc_write_entry (TERMTYPE *const); - -/* comp_parse.c: entry list handling */ -extern NCURSES_EXPORT(void) _nc_read_entry_source (FILE*, char*, int, bool, bool (*)(ENTRY*)); -extern NCURSES_EXPORT(bool) _nc_entry_match (char *, char *); -extern NCURSES_EXPORT(int) _nc_resolve_uses (bool); /* obs 20040705 */ -extern NCURSES_EXPORT(int) _nc_resolve_uses2 (bool, bool); -extern NCURSES_EXPORT(void) _nc_free_entries (ENTRY *); -extern NCURSES_IMPEXP void NCURSES_API (*_nc_check_termtype)(TERMTYPE *); /* obs 20040705 */ -extern NCURSES_IMPEXP void NCURSES_API (*_nc_check_termtype2)(TERMTYPE *, bool); - -/* trace_xnames.c */ -extern NCURSES_EXPORT(void) _nc_trace_xnames (TERMTYPE *); - -#ifdef __cplusplus -} -#endif - -#endif /* NCURSES_TERM_ENTRY_H_incl */ diff --git a/windows/ncurses/include/ncurses/termcap.h b/windows/ncurses/include/ncurses/termcap.h deleted file mode 100644 index a1d81a154..000000000 --- a/windows/ncurses/include/ncurses/termcap.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ - -/**************************************************************************** - * Author: Zeyd M. Ben-Halim 1992,1995 * - * and: Eric S. Raymond * - ****************************************************************************/ - -/* $Id: termcap.h.in,v 1.16 2001/03/24 21:53:27 tom Exp $ */ - -#ifndef NCURSES_TERMCAP_H_incl -#define NCURSES_TERMCAP_H_incl 1 - -#undef NCURSES_VERSION -#define NCURSES_VERSION "5.9" - -#include - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#include - -#undef NCURSES_CONST -#define NCURSES_CONST /*nothing*/ - -#undef NCURSES_OSPEED -#define NCURSES_OSPEED short - -extern NCURSES_EXPORT_VAR(char) PC; -extern NCURSES_EXPORT_VAR(char *) UP; -extern NCURSES_EXPORT_VAR(char *) BC; -extern NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed; - -#if !defined(NCURSES_TERM_H_incl) -extern NCURSES_EXPORT(char *) tgetstr (NCURSES_CONST char *, char **); -extern NCURSES_EXPORT(char *) tgoto (const char *, int, int); -extern NCURSES_EXPORT(int) tgetent (char *, const char *); -extern NCURSES_EXPORT(int) tgetflag (NCURSES_CONST char *); -extern NCURSES_EXPORT(int) tgetnum (NCURSES_CONST char *); -extern NCURSES_EXPORT(int) tputs (const char *, int, int (*)(int)); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* NCURSES_TERMCAP_H_incl */ diff --git a/windows/ncurses/include/ncurses/tic.h b/windows/ncurses/include/ncurses/tic.h deleted file mode 100644 index 28ee3882e..000000000 --- a/windows/ncurses/include/ncurses/tic.h +++ /dev/null @@ -1,346 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2007,2009 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ - -/**************************************************************************** - * Author: Zeyd M. Ben-Halim 1992,1995 * - * and: Eric S. Raymond * - * and: Thomas E. Dickey 1996 on * - ****************************************************************************/ - -/* - * $Id: tic.h,v 1.65 2009/08/08 17:52:46 tom Exp $ - * tic.h - Global variables and structures for the terminfo - * compiler. - */ - -#ifndef __TIC_H -#define __TIC_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include /* for the _tracef() prototype, ERR/OK, bool defs */ - -/* -** The format of compiled terminfo files is as follows: -** -** Header (12 bytes), containing information given below -** Names Section, containing the names of the terminal -** Boolean Section, containing the values of all of the -** boolean capabilities -** A null byte may be inserted here to make -** sure that the Number Section begins on an -** even word boundary. -** Number Section, containing the values of all of the numeric -** capabilities, each as a short integer -** String Section, containing short integer offsets into the -** String Table, one per string capability -** String Table, containing the actual characters of the string -** capabilities. -** -** NOTE that all short integers in the file are stored using VAX/PDP-style -** byte-order, i.e., least-significant byte first. -** -** There is no structure definition here because it would only confuse -** matters. Terminfo format is a raw byte layout, not a structure -** dump. If you happen to be on a little-endian machine with 16-bit -** shorts that requires no padding between short members in a struct, -** then there is a natural C structure that captures the header, but -** not very helpfully. -*/ - -#define MAGIC 0432 /* first two bytes of a compiled entry */ - -#undef BYTE -#define BYTE(p,n) (unsigned char)((p)[n]) - -#define IS_NEG1(p) ((BYTE(p,0) == 0377) && (BYTE(p,1) == 0377)) -#define IS_NEG2(p) ((BYTE(p,0) == 0376) && (BYTE(p,1) == 0377)) -#define LOW_MSB(p) (BYTE(p,0) + 256*BYTE(p,1)) - -#define IS_TIC_MAGIC(p) (LOW_MSB(p) == MAGIC) - -/* - * The "maximum" here is misleading; XSI guarantees minimum values, which a - * given implementation may exceed. - */ -#define MAX_NAME_SIZE 512 /* maximum legal name field size (XSI:127) */ -#define MAX_ENTRY_SIZE 4096 /* maximum legal entry size */ - -/* - * The maximum size of individual name or alias is guaranteed in XSI to be at - * least 14, since that corresponds to the older filename lengths. Newer - * systems allow longer aliases, though not many terminal descriptions are - * written to use them. The MAX_ALIAS symbol is used for warnings. - */ -#if HAVE_LONG_FILE_NAMES -#define MAX_ALIAS 32 /* smaller than POSIX minimum for PATH_MAX */ -#else -#define MAX_ALIAS 14 /* SVr3 filename length */ -#endif - -/* location of user's personal info directory */ -#define PRIVATE_INFO "%s/.terminfo" /* plug getenv("HOME") into %s */ - -/* - * Some traces are designed to be used via tic's verbose option (and similar in - * infocmp and toe) rather than the 'trace()' function. So we use the bits - * above the normal trace() parameter as a debug-level. - */ - -#define MAX_DEBUG_LEVEL 15 -#define DEBUG_LEVEL(n) ((n) << TRACE_SHIFT) - -#define set_trace_level(n) \ - _nc_tracing &= DEBUG_LEVEL(MAX_DEBUG_LEVEL), \ - _nc_tracing |= DEBUG_LEVEL(n) - -#ifdef TRACE -#define DEBUG(n, a) if (_nc_tracing >= DEBUG_LEVEL(n)) _tracef a -#else -#define DEBUG(n, a) /*nothing*/ -#endif - -extern NCURSES_EXPORT_VAR(unsigned) _nc_tracing; -extern NCURSES_EXPORT(void) _nc_tracef (char *, ...) GCC_PRINTFLIKE(1,2); -extern NCURSES_EXPORT(const char *) _nc_visbuf (const char *); -extern NCURSES_EXPORT(const char *) _nc_visbuf2 (int, const char *); - -/* - * These are the types of tokens returned by the scanner. The first - * three are also used in the hash table of capability names. The scanner - * returns one of these values after loading the specifics into the global - * structure curr_token. - */ - -#define BOOLEAN 0 /* Boolean capability */ -#define NUMBER 1 /* Numeric capability */ -#define STRING 2 /* String-valued capability */ -#define CANCEL 3 /* Capability to be cancelled in following tc's */ -#define NAMES 4 /* The names for a terminal type */ -#define UNDEF 5 /* Undefined */ - -#define NO_PUSHBACK -1 /* used in pushtype to indicate no pushback */ - - /* - * The global structure in which the specific parts of a - * scanned token are returned. - * - */ - -struct token -{ - char *tk_name; /* name of capability */ - int tk_valnumber; /* value of capability (if a number) */ - char *tk_valstring; /* value of capability (if a string) */ -}; - -extern NCURSES_EXPORT_VAR(struct token) _nc_curr_token; - - /* - * Offsets to string capabilities, with the corresponding functionkey - * codes. - */ -struct tinfo_fkeys { - unsigned offset; - chtype code; - }; - -#if BROKEN_LINKER - -#define _nc_tinfo_fkeys _nc_tinfo_fkeysf() -extern NCURSES_EXPORT(const struct tinfo_fkeys *) _nc_tinfo_fkeysf (void); - -#else - -extern NCURSES_EXPORT_VAR(const struct tinfo_fkeys) _nc_tinfo_fkeys[]; - -#endif - -typedef short HashValue; - - /* - * The file comp_captab.c contains an array of these structures, one - * per possible capability. These are indexed by a hash table array of - * pointers to the same structures for use by the parser. - */ - -struct name_table_entry -{ - const char *nte_name; /* name to hash on */ - int nte_type; /* BOOLEAN, NUMBER or STRING */ - HashValue nte_index; /* index of associated variable in its array */ - HashValue nte_link; /* index in table of next hash, or -1 */ -}; - - /* - * Use this structure to hide differences between terminfo and termcap - * tables. - */ -typedef struct { - unsigned table_size; - const HashValue *table_data; - HashValue (*hash_of)(const char *); - int (*compare_names)(const char *, const char *); -} HashData; - -struct alias -{ - const char *from; - const char *to; - const char *source; -}; - -extern NCURSES_EXPORT(const struct name_table_entry *) _nc_get_table (bool); -extern NCURSES_EXPORT(const HashData *) _nc_get_hash_info (bool); -extern NCURSES_EXPORT(const HashValue *) _nc_get_hash_table (bool); -extern NCURSES_EXPORT(const struct alias *) _nc_get_alias_table (bool); - -#define NOTFOUND ((struct name_table_entry *) 0) - -/* out-of-band values for representing absent capabilities */ -#define ABSENT_BOOLEAN ((signed char)-1) /* 255 */ -#define ABSENT_NUMERIC (-1) -#define ABSENT_STRING (char *)0 - -/* out-of-band values for representing cancels */ -#define CANCELLED_BOOLEAN ((signed char)-2) /* 254 */ -#define CANCELLED_NUMERIC (-2) -#define CANCELLED_STRING (char *)(-1) - -#define VALID_BOOLEAN(s) ((unsigned char)(s) <= 1) /* reject "-1" */ -#define VALID_NUMERIC(s) ((s) >= 0) -#define VALID_STRING(s) ((s) != CANCELLED_STRING && (s) != ABSENT_STRING) - -/* termcap entries longer than this may break old binaries */ -#define MAX_TERMCAP_LENGTH 1023 - -/* this is a documented limitation of terminfo */ -#define MAX_TERMINFO_LENGTH 4096 - -#ifndef TERMINFO -#define TERMINFO "/usr/share/terminfo" -#endif - -/* access.c */ -extern NCURSES_EXPORT(unsigned) _nc_pathlast (const char *); -extern NCURSES_EXPORT(bool) _nc_is_abs_path (const char *); -extern NCURSES_EXPORT(bool) _nc_is_dir_path (const char *); -extern NCURSES_EXPORT(bool) _nc_is_file_path (const char *); -extern NCURSES_EXPORT(char *) _nc_basename (char *); -extern NCURSES_EXPORT(char *) _nc_rootname (char *); - -/* comp_hash.c: name lookup */ -extern NCURSES_EXPORT(struct name_table_entry const *) _nc_find_entry - (const char *, const HashValue *); -extern NCURSES_EXPORT(struct name_table_entry const *) _nc_find_type_entry - (const char *, int, bool); - -/* comp_scan.c: lexical analysis */ -extern NCURSES_EXPORT(int) _nc_get_token (bool); -extern NCURSES_EXPORT(void) _nc_panic_mode (char); -extern NCURSES_EXPORT(void) _nc_push_token (int); -extern NCURSES_EXPORT(void) _nc_reset_input (FILE *, char *); -extern NCURSES_EXPORT_VAR(int) _nc_curr_col; -extern NCURSES_EXPORT_VAR(int) _nc_curr_line; -extern NCURSES_EXPORT_VAR(int) _nc_syntax; -extern NCURSES_EXPORT_VAR(long) _nc_comment_end; -extern NCURSES_EXPORT_VAR(long) _nc_comment_start; -extern NCURSES_EXPORT_VAR(long) _nc_curr_file_pos; -extern NCURSES_EXPORT_VAR(long) _nc_start_line; -#define SYN_TERMINFO 0 -#define SYN_TERMCAP 1 - -/* comp_error.c: warning & abort messages */ -extern NCURSES_EXPORT(const char *) _nc_get_source (void); -extern NCURSES_EXPORT(void) _nc_err_abort (const char *const,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN; -extern NCURSES_EXPORT(void) _nc_get_type (char *name); -extern NCURSES_EXPORT(void) _nc_set_source (const char *const); -extern NCURSES_EXPORT(void) _nc_set_type (const char *const); -extern NCURSES_EXPORT(void) _nc_syserr_abort (const char *const,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN; -extern NCURSES_EXPORT(void) _nc_warning (const char *const,...) GCC_PRINTFLIKE(1,2); -extern NCURSES_EXPORT_VAR(bool) _nc_suppress_warnings; - -/* comp_expand.c: expand string into readable form */ -extern NCURSES_EXPORT(char *) _nc_tic_expand (const char *, bool, int); - -/* comp_scan.c: decode string from readable form */ -extern NCURSES_EXPORT(int) _nc_trans_string (char *, char *); - -/* captoinfo.c: capability conversion */ -extern NCURSES_EXPORT(char *) _nc_captoinfo (const char *, const char *, int const); -extern NCURSES_EXPORT(char *) _nc_infotocap (const char *, const char *, int const); - -/* home_terminfo.c */ -extern NCURSES_EXPORT(char *) _nc_home_terminfo (void); - -/* lib_tparm.c */ -#define NUM_PARM 9 - -extern NCURSES_EXPORT_VAR(int) _nc_tparm_err; - -extern NCURSES_EXPORT(int) _nc_tparm_analyze(const char *, char **, int *); - -/* lib_tputs.c */ -extern NCURSES_EXPORT_VAR(int) _nc_nulls_sent; /* Add one for every null sent */ - -/* comp_main.c: compiler main */ -extern const char * _nc_progname; - -/* db_iterator.c */ -typedef enum { - dbdTIC = 0, -#if USE_DATABASE - dbdEnvOnce, - dbdHome, - dbdEnvList, - dbdCfgList, - dbdCfgOnce, -#endif -#if USE_TERMCAP - dbdEnvOnce2, - dbdEnvList2, - dbdCfgList2, -#endif - dbdLAST -} DBDIRS; - -extern NCURSES_EXPORT(const char *) _nc_next_db(DBDIRS *, int *); -extern NCURSES_EXPORT(const char *) _nc_tic_dir (const char *); -extern NCURSES_EXPORT(void) _nc_first_db(DBDIRS *, int *); -extern NCURSES_EXPORT(void) _nc_last_db(void); - -/* write_entry.c */ -extern NCURSES_EXPORT(int) _nc_tic_written (void); - -#ifdef __cplusplus -} -#endif - -#endif /* __TIC_H */ diff --git a/windows/ncurses/include/ncurses/unctrl.h b/windows/ncurses/include/ncurses/unctrl.h deleted file mode 100644 index 318de7b57..000000000 --- a/windows/ncurses/include/ncurses/unctrl.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** - * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ - -/**************************************************************************** - * Author: Zeyd M. Ben-Halim 1992,1995 * - * and: Eric S. Raymond * - ****************************************************************************/ - -/* - * unctrl.h - * - * Display a printable version of a control character. - * Control characters are displayed in caret notation (^x), DELETE is displayed - * as ^?. Printable characters are displayed as is. - */ - -/* $Id: unctrl.h.in,v 1.11 2009/04/18 21:00:52 tom Exp $ */ - -#ifndef NCURSES_UNCTRL_H_incl -#define NCURSES_UNCTRL_H_incl 1 - -#undef NCURSES_VERSION -#define NCURSES_VERSION "5.9" - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#undef unctrl -NCURSES_EXPORT(NCURSES_CONST char *) unctrl (chtype); - -#if 1 -NCURSES_EXPORT(NCURSES_CONST char *) NCURSES_SP_NAME(unctrl) (SCREEN*, chtype); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* NCURSES_UNCTRL_H_incl */ diff --git a/windows/ncurses/lib/Win32/libgcc_s_sjlj-1.dll b/windows/ncurses/lib/Win32/libgcc_s_sjlj-1.dll deleted file mode 100644 index 2f0a309f2..000000000 Binary files a/windows/ncurses/lib/Win32/libgcc_s_sjlj-1.dll and /dev/null differ diff --git a/windows/ncurses/lib/Win32/wform.dll b/windows/ncurses/lib/Win32/wform.dll deleted file mode 100644 index a2b5bb0eb..000000000 Binary files a/windows/ncurses/lib/Win32/wform.dll and /dev/null differ diff --git a/windows/ncurses/lib/Win32/wform.lib b/windows/ncurses/lib/Win32/wform.lib deleted file mode 100644 index 8e36351eb..000000000 Binary files a/windows/ncurses/lib/Win32/wform.lib and /dev/null differ diff --git a/windows/ncurses/lib/Win32/wmenu.dll b/windows/ncurses/lib/Win32/wmenu.dll deleted file mode 100644 index 96853d26e..000000000 Binary files a/windows/ncurses/lib/Win32/wmenu.dll and /dev/null differ diff --git a/windows/ncurses/lib/Win32/wmenu.lib b/windows/ncurses/lib/Win32/wmenu.lib deleted file mode 100644 index 1b129ce63..000000000 Binary files a/windows/ncurses/lib/Win32/wmenu.lib and /dev/null differ diff --git a/windows/ncurses/lib/Win32/wncurses.dll b/windows/ncurses/lib/Win32/wncurses.dll deleted file mode 100644 index f252bd228..000000000 Binary files a/windows/ncurses/lib/Win32/wncurses.dll and /dev/null differ diff --git a/windows/ncurses/lib/Win32/wncurses.lib b/windows/ncurses/lib/Win32/wncurses.lib deleted file mode 100644 index b0ce657a3..000000000 Binary files a/windows/ncurses/lib/Win32/wncurses.lib and /dev/null differ diff --git a/windows/ncurses/lib/Win32/wpanel.dll b/windows/ncurses/lib/Win32/wpanel.dll deleted file mode 100644 index d1c5bbdf7..000000000 Binary files a/windows/ncurses/lib/Win32/wpanel.dll and /dev/null differ diff --git a/windows/ncurses/lib/Win32/wpanel.lib b/windows/ncurses/lib/Win32/wpanel.lib deleted file mode 100644 index 5fcdfb607..000000000 Binary files a/windows/ncurses/lib/Win32/wpanel.lib and /dev/null differ diff --git a/windows/ncurses/lib/x64/wform.dll b/windows/ncurses/lib/x64/wform.dll deleted file mode 100644 index c735974f7..000000000 Binary files a/windows/ncurses/lib/x64/wform.dll and /dev/null differ diff --git a/windows/ncurses/lib/x64/wform.lib b/windows/ncurses/lib/x64/wform.lib deleted file mode 100644 index 1c5fc5600..000000000 Binary files a/windows/ncurses/lib/x64/wform.lib and /dev/null differ diff --git a/windows/ncurses/lib/x64/wmenu.dll b/windows/ncurses/lib/x64/wmenu.dll deleted file mode 100644 index bf11c2978..000000000 Binary files a/windows/ncurses/lib/x64/wmenu.dll and /dev/null differ diff --git a/windows/ncurses/lib/x64/wmenu.lib b/windows/ncurses/lib/x64/wmenu.lib deleted file mode 100644 index a0eb2711b..000000000 Binary files a/windows/ncurses/lib/x64/wmenu.lib and /dev/null differ diff --git a/windows/ncurses/lib/x64/wncurses.dll b/windows/ncurses/lib/x64/wncurses.dll deleted file mode 100644 index ae0d66a4c..000000000 Binary files a/windows/ncurses/lib/x64/wncurses.dll and /dev/null differ diff --git a/windows/ncurses/lib/x64/wncurses.lib b/windows/ncurses/lib/x64/wncurses.lib deleted file mode 100644 index 1d6f182ff..000000000 Binary files a/windows/ncurses/lib/x64/wncurses.lib and /dev/null differ diff --git a/windows/ncurses/lib/x64/wpanel.dll b/windows/ncurses/lib/x64/wpanel.dll deleted file mode 100644 index 42c0ff752..000000000 Binary files a/windows/ncurses/lib/x64/wpanel.dll and /dev/null differ diff --git a/windows/ncurses/lib/x64/wpanel.lib b/windows/ncurses/lib/x64/wpanel.lib deleted file mode 100644 index ff689e449..000000000 Binary files a/windows/ncurses/lib/x64/wpanel.lib and /dev/null differ diff --git a/windows/patches/icu/0001-Upgrade-projects-to-VS2013.patch b/windows/patches/icu/0001-Upgrade-projects-to-VS2013.patch deleted file mode 100644 index 53ab005f5..000000000 --- a/windows/patches/icu/0001-Upgrade-projects-to-VS2013.patch +++ /dev/null @@ -1,2279 +0,0 @@ -From f0d00332540713c5d3e3981a5a29dc0ae226d999 Mon Sep 17 00:00:00 2001 -From: Tim Hughes -Date: Mon, 21 Apr 2014 12:54:15 +0100 -Subject: [PATCH 1/3] Upgrade projects to VS2013 . - -Signed-off-by: Tim Hughes ---- - source/common/common.vcxproj | 42 ++- - source/extra/uconv/uconv.vcxproj | 8 +- - source/i18n/i18n.vcxproj | 48 +-- - source/i18n/i18n.vcxproj.filters | 3 +- - source/io/io.vcxproj | 8 +- - source/layout/layout.vcxproj | 8 +- - source/layoutex/layoutex.vcxproj | 8 +- - source/samples/cal/cal.vcxproj | 528 +++++++++++++++++---------------- - source/samples/date/date.vcxproj | 8 +- - source/stubdata/stubdata.vcxproj | 42 ++- - source/test/cintltst/cintltst.vcxproj | 8 +- - source/test/intltest/intltest.vcxproj | 38 +-- - source/test/iotest/iotest.vcxproj | 8 +- - source/test/letest/letest.vcxproj | 8 +- - source/tools/ctestfw/ctestfw.vcxproj | 8 +- - source/tools/genbrk/genbrk.vcxproj | 8 +- - source/tools/genccode/genccode.vcxproj | 8 +- - source/tools/gencfu/gencfu.vcxproj | 8 +- - source/tools/gencmn/gencmn.vcxproj | 8 +- - source/tools/gencnval/gencnval.vcxproj | 8 +- - source/tools/gendict/gendict.vcxproj | 8 +- - source/tools/gennorm2/gennorm2.vcxproj | 8 +- - source/tools/genrb/derb.vcxproj | 8 +- - source/tools/genrb/genrb.vcxproj | 8 +- - source/tools/gensprep/gensprep.vcxproj | 8 +- - source/tools/gentest/gentest.vcxproj | 8 +- - source/tools/icuinfo/icuinfo.vcxproj | 8 +- - source/tools/icuinfo/testplug.vcxproj | 8 +- - source/tools/icupkg/icupkg.vcxproj | 8 +- - source/tools/makeconv/makeconv.vcxproj | 8 +- - source/tools/pkgdata/pkgdata.vcxproj | 8 +- - source/tools/toolutil/toolutil.vcxproj | 10 +- - 32 files changed, 531 insertions(+), 380 deletions(-) - -diff --git a/source/common/common.vcxproj b/source/common/common.vcxproj -index ef0dfc1..0b1eab3 100644 ---- a/source/common/common.vcxproj -+++ b/source/common/common.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -26,21 +26,25 @@ - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - -@@ -65,17 +69,33 @@ - - <_ProjectFileVersion>10.0.30319.1 - .\..\..\lib\ -- .\x86\Release\ -+ x86\$(Configuration) - false - .\..\..\lib\ -- .\x86\Debug\ -- true -+ x86\$(Configuration) -+ false - .\x64\Release\ -- .\x64\Release\ -+ x64\$(Configuration) - false - .\x64\Debug\ -- .\x64\Debug\ -- true -+ x64\$(Configuration) -+ false -+ -+ -+ icuuc52d -+ ..\..\bin -+ -+ -+ icuuc52 -+ ..\..\bin -+ -+ -+ icuuc52d -+ ..\..\bin64 -+ -+ -+ icuuc52 -+ ..\..\bin64 - - - -@@ -104,7 +124,6 @@ - 0x0409 - - -- ..\..\bin\icuuc52.dll - true - .\..\..\lib\icuuc.pdb - true -@@ -135,7 +154,6 @@ - .\x86\Debug/ - .\x86\Debug/ - .\x86\Debug/ -- true - Level3 - true - EditAndContinue -@@ -145,7 +163,6 @@ - 0x0409 - - -- ..\..\bin\icuuc52d.dll - true - true - .\..\..\lib\icuucd.pdb -@@ -183,7 +200,6 @@ - 0x0409 - - -- ..\..\bin64\icuuc52.dll - true - .\..\..\lib64\icuuc.pdb - true -@@ -212,7 +228,6 @@ - .\x64\Debug/ - .\x64\Debug/ - .\x64\Debug/ -- true - Level3 - true - ProgramDatabase -@@ -222,7 +237,6 @@ - 0x0409 - - -- ..\..\bin64\icuuc52d.dll - true - true - .\..\..\lib64\icuucd.pdb -@@ -1751,4 +1765,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/extra/uconv/uconv.vcxproj b/source/extra/uconv/uconv.vcxproj -index 3ff795c..1e9829f 100644 ---- a/source/extra/uconv/uconv.vcxproj -+++ b/source/extra/uconv/uconv.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -26,21 +26,25 @@ - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - -@@ -292,4 +296,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/i18n/i18n.vcxproj b/source/i18n/i18n.vcxproj -index 3c1eebb..3f216cc 100644 ---- a/source/i18n/i18n.vcxproj -+++ b/source/i18n/i18n.vcxproj -@@ -1,5 +1,5 @@ -- -- -+ -+ - - - Debug -@@ -26,21 +26,25 @@ - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - -@@ -64,18 +68,30 @@ - - - <_ProjectFileVersion>10.0.30319.1 -- .\..\..\lib\ -- .\x86\Release\ -+ ..\..\bin -+ x86\$(Configuration) - false -- .\..\..\lib\ -- .\x86\Debug\ -- true -- .\x64\Release\ -- .\x64\Release\ -+ ..\..\bin -+ x86\$(Configuration) -+ false -+ ..\..\bin64 -+ x64\$(Configuration) - false -- .\x64\Debug\ -- .\x64\Debug\ -- true -+ ..\..\bin64 -+ x64\$(Configuration) -+ false -+ -+ -+ icuin52d -+ -+ -+ icuin52 -+ -+ -+ icuin52d -+ -+ -+ icuin52 - - - -@@ -107,7 +123,6 @@ - ../common;%(AdditionalIncludeDirectories) - - -- ..\..\bin\icuin52.dll - true - .\..\..\lib\icuin.pdb - true -@@ -139,7 +154,6 @@ - .\x86\Debug/ - .\x86\Debug/ - .\x86\Debug/ -- true - Level3 - true - EditAndContinue -@@ -151,7 +165,6 @@ - ../common;%(AdditionalIncludeDirectories) - - -- ..\..\bin\icuin52d.dll - true - true - .\..\..\lib\icuind.pdb -@@ -192,7 +205,6 @@ - ../common;%(AdditionalIncludeDirectories) - - -- ..\..\bin64\icuin52.dll - true - .\..\..\lib64\icuin.pdb - true -@@ -222,7 +234,6 @@ - .\x64\Debug/ - .\x64\Debug/ - .\x64\Debug/ -- true - Level3 - true - ProgramDatabase -@@ -234,7 +245,6 @@ - ../common;%(AdditionalIncludeDirectories) - - -- ..\..\bin64\icuin52d.dll - true - true - .\..\..\lib64\icuind.pdb -@@ -1625,4 +1635,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/i18n/i18n.vcxproj.filters b/source/i18n/i18n.vcxproj.filters -index da3b9aa..554a235 100644 ---- a/source/i18n/i18n.vcxproj.filters -+++ b/source/i18n/i18n.vcxproj.filters -@@ -1050,5 +1050,6 @@ - - misc - -+ - -- -+ -\ No newline at end of file -diff --git a/source/io/io.vcxproj b/source/io/io.vcxproj -index 8944e2a..7b5e178 100644 ---- a/source/io/io.vcxproj -+++ b/source/io/io.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -26,21 +26,25 @@ - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - -@@ -319,4 +323,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/layout/layout.vcxproj b/source/layout/layout.vcxproj -index d80eb54..90a5e42 100644 ---- a/source/layout/layout.vcxproj -+++ b/source/layout/layout.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -26,21 +26,25 @@ - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - -@@ -576,4 +580,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/layoutex/layoutex.vcxproj b/source/layoutex/layoutex.vcxproj -index dac4cfe..f2c8dd8 100644 ---- a/source/layoutex/layoutex.vcxproj -+++ b/source/layoutex/layoutex.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -27,21 +27,25 @@ - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - -@@ -327,4 +331,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/samples/cal/cal.vcxproj b/source/samples/cal/cal.vcxproj -index 13dae70..947e173 100644 ---- a/source/samples/cal/cal.vcxproj -+++ b/source/samples/cal/cal.vcxproj -@@ -1,264 +1,268 @@ -- -- -- -- -- Debug -- Win32 -- -- -- Debug -- x64 -- -- -- Release -- Win32 -- -- -- Release -- x64 -- -- -- -- {F7659D77-09CF-4FE9-ACEE-927287AA9509} -- -- -- -- Application -- false -- MultiByte -- -- -- Application -- false -- MultiByte -- -- -- Application -- false -- MultiByte -- -- -- Application -- false -- MultiByte -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- <_ProjectFileVersion>10.0.30319.1 -- .\x86\Release\ -- .\x86\Release\ -- false -- .\x64\Release\ -- .\x64\Release\ -- false -- .\x86\Debug\ -- .\x86\Debug\ -- true -- .\x64\Debug\ -- .\x64\Debug\ -- true -- -- -- -- .\x86\Release/cal.tlb -- -- -- OnlyExplicitInline -- ..\..\..\include;%(AdditionalIncludeDirectories) -- WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) -- true -- MultiThreadedDLL -- true -- true -- -- -- .\x86\Release/cal.pch -- .\x86\Release/ -- .\x86\Release/ -- .\x86\Release/ -- Level3 -- true -- Default -- -- -- NDEBUG;%(PreprocessorDefinitions) -- 0x0409 -- -- -- icuuc.lib;icuin.lib;%(AdditionalDependencies) -- .\x86\Release/cal.exe -- true -- ../../../lib;%(AdditionalLibraryDirectories) -- .\x86\Release/cal.pdb -- Console -- false -- -- -- -- -- -- -- X64 -- .\x64\Release/cal.tlb -- -- -- OnlyExplicitInline -- ..\..\..\include;%(AdditionalIncludeDirectories) -- WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) -- true -- MultiThreadedDLL -- true -- true -- -- -- .\x64\Release/cal.pch -- .\x64\Release/ -- .\x64\Release/ -- .\x64\Release/ -- Level3 -- true -- Default -- -- -- NDEBUG;%(PreprocessorDefinitions) -- 0x0409 -- -- -- icuuc.lib;icuin.lib;%(AdditionalDependencies) -- .\x64\Release/cal.exe -- true -- ../../../lib64;%(AdditionalLibraryDirectories) -- .\x64\Release/cal.pdb -- Console -- false -- -- -- MachineX64 -- -- -- -- -- .\x86\Debug/cal.tlb -- -- -- Disabled -- ..\..\..\include;%(AdditionalIncludeDirectories) -- WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) -- EnableFastChecks -- MultiThreadedDebugDLL -- true -- -- -- .\x86\Debug/cal.pch -- .\x86\Debug/ -- .\x86\Debug/ -- .\x86\Debug/ -- true -- Level3 -- true -- EditAndContinue -- Default -- -- -- _DEBUG;%(PreprocessorDefinitions) -- 0x0409 -- -- -- icuucd.lib;icuind.lib;%(AdditionalDependencies) -- .\x86\Debug/cal.exe -- true -- ../../../lib;%(AdditionalLibraryDirectories) -- true -- .\x86\Debug/cal.pdb -- Console -- false -- -- -- -- -- -- -- X64 -- .\x64\Debug/cal.tlb -- -- -- Disabled -- ..\..\..\include;%(AdditionalIncludeDirectories) -- WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) -- EnableFastChecks -- MultiThreadedDebugDLL -- true -- -- -- .\x64\Debug/cal.pch -- .\x64\Debug/ -- .\x64\Debug/ -- .\x64\Debug/ -- true -- Level3 -- true -- ProgramDatabase -- Default -- -- -- _DEBUG;%(PreprocessorDefinitions) -- 0x0409 -- -- -- icuucd.lib;icuind.lib;%(AdditionalDependencies) -- .\x64\Debug/cal.exe -- true -- ../../../lib64;%(AdditionalLibraryDirectories) -- true -- .\x64\Debug/cal.pdb -- Console -- false -- -- -- MachineX64 -- -- -- -+ -+ -+ -+ -+ Debug -+ Win32 -+ -+ -+ Debug -+ x64 -+ -+ -+ Release -+ Win32 -+ -+ -+ Release -+ x64 -+ -+ -+ -+ {F7659D77-09CF-4FE9-ACEE-927287AA9509} -+ -+ -+ -+ Application -+ false -+ MultiByte -+ v120 -+ -+ -+ Application -+ false -+ MultiByte -+ v120 -+ -+ -+ Application -+ false -+ MultiByte -+ v120 -+ -+ -+ Application -+ false -+ MultiByte -+ v120 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ <_ProjectFileVersion>10.0.30319.1 -+ .\x86\Release\ -+ .\x86\Release\ -+ false -+ .\x64\Release\ -+ .\x64\Release\ -+ false -+ .\x86\Debug\ -+ .\x86\Debug\ -+ true -+ .\x64\Debug\ -+ .\x64\Debug\ -+ true -+ -+ -+ -+ .\x86\Release/cal.tlb -+ -+ -+ OnlyExplicitInline -+ ..\..\..\include;%(AdditionalIncludeDirectories) -+ WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) -+ true -+ MultiThreadedDLL -+ true -+ true -+ -+ -+ .\x86\Release/cal.pch -+ .\x86\Release/ -+ .\x86\Release/ -+ .\x86\Release/ -+ Level3 -+ true -+ Default -+ -+ -+ NDEBUG;%(PreprocessorDefinitions) -+ 0x0409 -+ -+ -+ icuuc.lib;icuin.lib;%(AdditionalDependencies) -+ .\x86\Release/cal.exe -+ true -+ ../../../lib;%(AdditionalLibraryDirectories) -+ .\x86\Release/cal.pdb -+ Console -+ false -+ -+ -+ -+ -+ -+ -+ X64 -+ .\x64\Release/cal.tlb -+ -+ -+ OnlyExplicitInline -+ ..\..\..\include;%(AdditionalIncludeDirectories) -+ WIN64;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) -+ true -+ MultiThreadedDLL -+ true -+ true -+ -+ -+ .\x64\Release/cal.pch -+ .\x64\Release/ -+ .\x64\Release/ -+ .\x64\Release/ -+ Level3 -+ true -+ Default -+ -+ -+ NDEBUG;%(PreprocessorDefinitions) -+ 0x0409 -+ -+ -+ icuuc.lib;icuin.lib;%(AdditionalDependencies) -+ .\x64\Release/cal.exe -+ true -+ ../../../lib64;%(AdditionalLibraryDirectories) -+ .\x64\Release/cal.pdb -+ Console -+ false -+ -+ -+ MachineX64 -+ -+ -+ -+ -+ .\x86\Debug/cal.tlb -+ -+ -+ Disabled -+ ..\..\..\include;%(AdditionalIncludeDirectories) -+ WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) -+ EnableFastChecks -+ MultiThreadedDebugDLL -+ true -+ -+ -+ .\x86\Debug/cal.pch -+ .\x86\Debug/ -+ .\x86\Debug/ -+ .\x86\Debug/ -+ true -+ Level3 -+ true -+ EditAndContinue -+ Default -+ -+ -+ _DEBUG;%(PreprocessorDefinitions) -+ 0x0409 -+ -+ -+ icuucd.lib;icuind.lib;%(AdditionalDependencies) -+ .\x86\Debug/cal.exe -+ true -+ ../../../lib;%(AdditionalLibraryDirectories) -+ true -+ .\x86\Debug/cal.pdb -+ Console -+ false -+ -+ -+ -+ -+ -+ -+ X64 -+ .\x64\Debug/cal.tlb -+ -+ -+ Disabled -+ ..\..\..\include;%(AdditionalIncludeDirectories) -+ WIN64;WIN32;_DEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) -+ EnableFastChecks -+ MultiThreadedDebugDLL -+ true -+ -+ -+ .\x64\Debug/cal.pch -+ .\x64\Debug/ -+ .\x64\Debug/ -+ .\x64\Debug/ -+ true -+ Level3 -+ true -+ ProgramDatabase -+ Default -+ -+ -+ _DEBUG;%(PreprocessorDefinitions) -+ 0x0409 -+ -+ -+ icuucd.lib;icuind.lib;%(AdditionalDependencies) -+ .\x64\Debug/cal.exe -+ true -+ ../../../lib64;%(AdditionalLibraryDirectories) -+ true -+ .\x64\Debug/cal.pdb -+ Console -+ false -+ -+ -+ MachineX64 -+ -+ -+ - -- false -- -+ false -+ - -- false -- -- -- -- -- -- -- -- {73c0a65b-d1f2-4de1-b3a6-15dad2c23f3d} -- false -- -- -- {0178b127-6269-407d-b112-93877bb62776} -- false -- -- -- -- -- -- -+ false -+ -+ -+ -+ -+ -+ -+ -+ {73c0a65b-d1f2-4de1-b3a6-15dad2c23f3d} -+ false -+ -+ -+ {0178b127-6269-407d-b112-93877bb62776} -+ false -+ -+ -+ -+ -+ -+ -\ No newline at end of file -diff --git a/source/samples/date/date.vcxproj b/source/samples/date/date.vcxproj -index 0632b3f..38d70a9 100644 ---- a/source/samples/date/date.vcxproj -+++ b/source/samples/date/date.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -26,21 +26,25 @@ - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - -@@ -255,4 +259,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/stubdata/stubdata.vcxproj b/source/stubdata/stubdata.vcxproj -index ed4ca6b..541f19f 100644 ---- a/source/stubdata/stubdata.vcxproj -+++ b/source/stubdata/stubdata.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -26,21 +26,25 @@ - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - -@@ -64,21 +68,35 @@ - - - <_ProjectFileVersion>10.0.30319.1 -- .\x86\Release\ -- .\x86\Release\ -+ ..\..\bin - false - false -- .\x86\Debug\ -- .\x86\Debug\ -+ ..\..\bin - false -- .\x64\Release\ -- .\x64\Release\ -+ ..\..\bin64 - false - false -- .\x64\Debug\ -- .\x64\Debug\ -+ ..\..\bin64 - false - -+ -+ icudt52d -+ x86\$(Configuration) -+ false -+ -+ -+ icudt52d -+ x64\$(Configuration) -+ false -+ -+ -+ icudt52 -+ x86\$(Configuration) -+ -+ -+ icudt52 -+ x64\$(Configuration) -+ - - - NDEBUG;%(PreprocessorDefinitions) -@@ -113,7 +131,6 @@ - echo "File with stubdata build time, used as a dependency to trigger fresh data build, since stubdata dll will overwrite the real one." > "$(ProjectDir)stubdatabuilt.txt" - - -- ..\..\bin\icudt52.dll - true - true - .\x86\Release\icudt.pdb -@@ -160,7 +177,6 @@ - echo "File with stubdata build time, used as a dependency to trigger fresh data build, since stubdata dll will overwrite the real one." > "$(ProjectDir)stubdatabuilt.txt" - - -- ..\..\bin\icudt52.dll - true - .\x86\Debug/icudt.pdb - true -@@ -207,7 +223,6 @@ - echo "File with stubdata build time, used as a dependency to trigger fresh data build, since stubdata dll will overwrite the real one." > "$(ProjectDir)stubdatabuilt.txt" - - -- ..\..\bin64\icudt52.dll - true - true - .\x64\Release\icudt.pdb -@@ -252,7 +267,6 @@ - echo "File with stubdata build time, used as a dependency to trigger fresh data build, since stubdata dll will overwrite the real one." > "$(ProjectDir)stubdatabuilt.txt" - - -- ..\..\bin64\icudt52.dll - true - .\x64\Debug/icudt.pdb - true -@@ -277,4 +291,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/test/cintltst/cintltst.vcxproj b/source/test/cintltst/cintltst.vcxproj -index 17529b6..f04da0c 100644 ---- a/source/test/cintltst/cintltst.vcxproj -+++ b/source/test/cintltst/cintltst.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -26,21 +26,25 @@ - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - -@@ -373,4 +377,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/test/intltest/intltest.vcxproj b/source/test/intltest/intltest.vcxproj -index 8a6698e..9ee9bc7 100644 ---- a/source/test/intltest/intltest.vcxproj -+++ b/source/test/intltest/intltest.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -27,21 +27,25 @@ - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - -@@ -229,7 +233,7 @@ - - - -- false -+ false - - - -@@ -260,7 +264,7 @@ - - - -- false -+ false - - - false -@@ -276,7 +280,7 @@ - - - -- false -+ false - - - -@@ -284,7 +288,7 @@ - - - -- false -+ false - - - -@@ -326,13 +330,13 @@ - - - -- false -+ false - - - - - -- false -+ false - - - false -@@ -351,7 +355,7 @@ - - - -- false -+ false - - - -@@ -360,35 +364,35 @@ - - - -- false -+ false - - -- false -+ false - - -- false -+ false - - - - - -- false -+ false - - - - -- false -+ false - - -- false -+ false - - -- false -+ false - - - - -- false -+ false - - - -@@ -561,4 +565,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/test/iotest/iotest.vcxproj b/source/test/iotest/iotest.vcxproj -index 0d39d29..5172208 100644 ---- a/source/test/iotest/iotest.vcxproj -+++ b/source/test/iotest/iotest.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -26,21 +26,25 @@ - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - -@@ -259,4 +263,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/test/letest/letest.vcxproj b/source/test/letest/letest.vcxproj -index a71d629..be01399 100644 ---- a/source/test/letest/letest.vcxproj -+++ b/source/test/letest/letest.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -26,21 +26,25 @@ - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - -@@ -274,4 +278,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/tools/ctestfw/ctestfw.vcxproj b/source/tools/ctestfw/ctestfw.vcxproj -index 7dbdc9f..9281a1b 100644 ---- a/source/tools/ctestfw/ctestfw.vcxproj -+++ b/source/tools/ctestfw/ctestfw.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -26,21 +26,25 @@ - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - -@@ -280,4 +284,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/tools/genbrk/genbrk.vcxproj b/source/tools/genbrk/genbrk.vcxproj -index 73e5372..8ae2620 100644 ---- a/source/tools/genbrk/genbrk.vcxproj -+++ b/source/tools/genbrk/genbrk.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -26,21 +26,25 @@ - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - -@@ -255,4 +259,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/tools/genccode/genccode.vcxproj b/source/tools/genccode/genccode.vcxproj -index f6fd59d..e1bb8fb 100644 ---- a/source/tools/genccode/genccode.vcxproj -+++ b/source/tools/genccode/genccode.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -26,21 +26,25 @@ - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - -@@ -251,4 +255,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/tools/gencfu/gencfu.vcxproj b/source/tools/gencfu/gencfu.vcxproj -index 18c63a6..315ca7b 100644 ---- a/source/tools/gencfu/gencfu.vcxproj -+++ b/source/tools/gencfu/gencfu.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -27,20 +27,24 @@ - Application - false - MultiByte -+ v120 - - - Application - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - -@@ -238,4 +242,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/tools/gencmn/gencmn.vcxproj b/source/tools/gencmn/gencmn.vcxproj -index 6c83ef4..91f0a64 100644 ---- a/source/tools/gencmn/gencmn.vcxproj -+++ b/source/tools/gencmn/gencmn.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -26,21 +26,25 @@ - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - -@@ -255,4 +259,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/tools/gencnval/gencnval.vcxproj b/source/tools/gencnval/gencnval.vcxproj -index ca12c12..474f1a2 100644 ---- a/source/tools/gencnval/gencnval.vcxproj -+++ b/source/tools/gencnval/gencnval.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -26,21 +26,25 @@ - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - -@@ -255,4 +259,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/tools/gendict/gendict.vcxproj b/source/tools/gendict/gendict.vcxproj -index 6852b44..968f817 100644 ---- a/source/tools/gendict/gendict.vcxproj -+++ b/source/tools/gendict/gendict.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -26,21 +26,25 @@ - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - -@@ -255,4 +259,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/tools/gennorm2/gennorm2.vcxproj b/source/tools/gennorm2/gennorm2.vcxproj -index 4245a0b..bf60570 100644 ---- a/source/tools/gennorm2/gennorm2.vcxproj -+++ b/source/tools/gennorm2/gennorm2.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -27,20 +27,24 @@ - - Application - Unicode -+ v120 - - - Application - Unicode - true -+ v120 - - - Application - Unicode -+ v120 - - - Application - Unicode - true -+ v120 - - - -@@ -263,4 +267,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/tools/genrb/derb.vcxproj b/source/tools/genrb/derb.vcxproj -index b2e27e6..9c14c94 100644 ---- a/source/tools/genrb/derb.vcxproj -+++ b/source/tools/genrb/derb.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -26,21 +26,25 @@ - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - -@@ -278,4 +282,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/tools/genrb/genrb.vcxproj b/source/tools/genrb/genrb.vcxproj -index b7f48ef..ad02f5b 100644 ---- a/source/tools/genrb/genrb.vcxproj -+++ b/source/tools/genrb/genrb.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -26,21 +26,25 @@ - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - -@@ -278,4 +282,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/tools/gensprep/gensprep.vcxproj b/source/tools/gensprep/gensprep.vcxproj -index 533b546..fad1e63 100644 ---- a/source/tools/gensprep/gensprep.vcxproj -+++ b/source/tools/gensprep/gensprep.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -26,21 +26,25 @@ - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - -@@ -257,4 +261,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/tools/gentest/gentest.vcxproj b/source/tools/gentest/gentest.vcxproj -index f8fb903..96a8b15 100644 ---- a/source/tools/gentest/gentest.vcxproj -+++ b/source/tools/gentest/gentest.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -27,21 +27,25 @@ - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - -@@ -244,4 +248,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/tools/icuinfo/icuinfo.vcxproj b/source/tools/icuinfo/icuinfo.vcxproj -index 6da52ed..864b5e7 100644 ---- a/source/tools/icuinfo/icuinfo.vcxproj -+++ b/source/tools/icuinfo/icuinfo.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -28,21 +28,25 @@ - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - -@@ -256,4 +260,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/tools/icuinfo/testplug.vcxproj b/source/tools/icuinfo/testplug.vcxproj -index edf6858..cc5a0ec 100644 ---- a/source/tools/icuinfo/testplug.vcxproj -+++ b/source/tools/icuinfo/testplug.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -26,21 +26,25 @@ - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - -@@ -255,4 +259,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/tools/icupkg/icupkg.vcxproj b/source/tools/icupkg/icupkg.vcxproj -index b3c762c..606276d 100644 ---- a/source/tools/icupkg/icupkg.vcxproj -+++ b/source/tools/icupkg/icupkg.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -27,21 +27,25 @@ - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - -@@ -244,4 +248,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/tools/makeconv/makeconv.vcxproj b/source/tools/makeconv/makeconv.vcxproj -index 110dee9..3d302d3 100644 ---- a/source/tools/makeconv/makeconv.vcxproj -+++ b/source/tools/makeconv/makeconv.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -26,21 +26,25 @@ - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - -@@ -260,4 +264,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/tools/pkgdata/pkgdata.vcxproj b/source/tools/pkgdata/pkgdata.vcxproj -index 18fa39d..b2d72bd 100644 ---- a/source/tools/pkgdata/pkgdata.vcxproj -+++ b/source/tools/pkgdata/pkgdata.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -26,21 +26,25 @@ - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - Application - false - MultiByte -+ v120 - - - -@@ -271,4 +275,4 @@ - - - -- -+ -\ No newline at end of file -diff --git a/source/tools/toolutil/toolutil.vcxproj b/source/tools/toolutil/toolutil.vcxproj -index 8cb1277..5574582 100644 ---- a/source/tools/toolutil/toolutil.vcxproj -+++ b/source/tools/toolutil/toolutil.vcxproj -@@ -1,5 +1,5 @@ -  -- -+ - - - Debug -@@ -26,21 +26,25 @@ - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - DynamicLibrary - false - MultiByte -+ v120 - - - -@@ -267,7 +271,7 @@ - - - -- false -+ false - - - false -@@ -328,4 +332,4 @@ - - - -- -+ -\ No newline at end of file --- -1.9.0.msysgit.0 - diff --git a/windows/patches/icu/0002-Qt-requires-U_CHARSET_IS_UTF8-1.patch b/windows/patches/icu/0002-Qt-requires-U_CHARSET_IS_UTF8-1.patch deleted file mode 100644 index 5b9f3e959..000000000 --- a/windows/patches/icu/0002-Qt-requires-U_CHARSET_IS_UTF8-1.patch +++ /dev/null @@ -1,26 +0,0 @@ -From fca4313ae7ac54ebb5a6f3b46451306223b53aeb Mon Sep 17 00:00:00 2001 -From: Tim Hughes -Date: Mon, 21 Apr 2014 13:33:29 +0100 -Subject: [PATCH 2/3] Qt requires U_CHARSET_IS_UTF8 1 - -Signed-off-by: Tim Hughes ---- - source/common/unicode/platform.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/source/common/unicode/platform.h b/source/common/unicode/platform.h -index 1b2ab30..cca7039 100644 ---- a/source/common/unicode/platform.h -+++ b/source/common/unicode/platform.h -@@ -543,7 +543,7 @@ - #elif U_PLATFORM == U_PF_ANDROID || U_PLATFORM_IS_DARWIN_BASED - # define U_CHARSET_IS_UTF8 1 - #else --# define U_CHARSET_IS_UTF8 0 -+# define U_CHARSET_IS_UTF8 1 - #endif - - /** @} */ --- -1.9.0.msysgit.0 - diff --git a/windows/patches/icu/0003-Add-minimal-icu.sln.patch b/windows/patches/icu/0003-Add-minimal-icu.sln.patch deleted file mode 100644 index 62ce164d8..000000000 --- a/windows/patches/icu/0003-Add-minimal-icu.sln.patch +++ /dev/null @@ -1,71 +0,0 @@ -From dcb7b9172a3f7ec5d607696a86fefad69c03a400 Mon Sep 17 00:00:00 2001 -From: Tim Hughes -Date: Mon, 21 Apr 2014 13:33:59 +0100 -Subject: [PATCH 3/3] Add minimal icu.sln - -Signed-off-by: Tim Hughes ---- - source/allinone/icu.sln | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 51 insertions(+) - create mode 100644 source/allinone/icu.sln - -diff --git a/source/allinone/icu.sln b/source/allinone/icu.sln -new file mode 100644 -index 0000000..b09697f ---- /dev/null -+++ b/source/allinone/icu.sln -@@ -0,0 +1,51 @@ -+Microsoft Visual Studio Solution File, Format Version 12.00 -+# Visual Studio Express 2013 for Windows Desktop -+VisualStudioVersion = 12.0.21005.1 -+MinimumVisualStudioVersion = 10.0.40219.1 -+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "..\common\common.vcxproj", "{73C0A65B-D1F2-4DE1-B3A6-15DAD2C23F3D}" -+EndProject -+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "i18n", "..\i18n\i18n.vcxproj", "{0178B127-6269-407D-B112-93877BB62776}" -+EndProject -+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stubdata", "..\stubdata\stubdata.vcxproj", "{203EC78A-0531-43F0-A636-285439BDE025}" -+EndProject -+Global -+ GlobalSection(SolutionConfigurationPlatforms) = preSolution -+ Debug|Win32 = Debug|Win32 -+ Debug|x64 = Debug|x64 -+ Release|Win32 = Release|Win32 -+ Release|x64 = Release|x64 -+ EndGlobalSection -+ GlobalSection(ProjectConfigurationPlatforms) = postSolution -+ {73C0A65B-D1F2-4DE1-B3A6-15DAD2C23F3D}.Debug|Win32.ActiveCfg = Debug|Win32 -+ {73C0A65B-D1F2-4DE1-B3A6-15DAD2C23F3D}.Debug|Win32.Build.0 = Debug|Win32 -+ {73C0A65B-D1F2-4DE1-B3A6-15DAD2C23F3D}.Debug|x64.ActiveCfg = Debug|x64 -+ {73C0A65B-D1F2-4DE1-B3A6-15DAD2C23F3D}.Debug|x64.Build.0 = Debug|x64 -+ {73C0A65B-D1F2-4DE1-B3A6-15DAD2C23F3D}.Release|Win32.ActiveCfg = Release|Win32 -+ {73C0A65B-D1F2-4DE1-B3A6-15DAD2C23F3D}.Release|Win32.Build.0 = Release|Win32 -+ {73C0A65B-D1F2-4DE1-B3A6-15DAD2C23F3D}.Release|x64.ActiveCfg = Release|x64 -+ {73C0A65B-D1F2-4DE1-B3A6-15DAD2C23F3D}.Release|x64.Build.0 = Release|x64 -+ {0178B127-6269-407D-B112-93877BB62776}.Debug|Win32.ActiveCfg = Debug|Win32 -+ {0178B127-6269-407D-B112-93877BB62776}.Debug|Win32.Build.0 = Debug|Win32 -+ {0178B127-6269-407D-B112-93877BB62776}.Debug|x64.ActiveCfg = Debug|x64 -+ {0178B127-6269-407D-B112-93877BB62776}.Debug|x64.Build.0 = Debug|x64 -+ {0178B127-6269-407D-B112-93877BB62776}.Release|Win32.ActiveCfg = Release|Win32 -+ {0178B127-6269-407D-B112-93877BB62776}.Release|Win32.Build.0 = Release|Win32 -+ {0178B127-6269-407D-B112-93877BB62776}.Release|x64.ActiveCfg = Release|x64 -+ {0178B127-6269-407D-B112-93877BB62776}.Release|x64.Build.0 = Release|x64 -+ {203EC78A-0531-43F0-A636-285439BDE025}.Debug|Win32.ActiveCfg = Debug|Win32 -+ {203EC78A-0531-43F0-A636-285439BDE025}.Debug|Win32.Build.0 = Debug|Win32 -+ {203EC78A-0531-43F0-A636-285439BDE025}.Debug|x64.ActiveCfg = Debug|x64 -+ {203EC78A-0531-43F0-A636-285439BDE025}.Debug|x64.Build.0 = Debug|x64 -+ {203EC78A-0531-43F0-A636-285439BDE025}.Release|Win32.ActiveCfg = Release|Win32 -+ {203EC78A-0531-43F0-A636-285439BDE025}.Release|Win32.Build.0 = Release|Win32 -+ {203EC78A-0531-43F0-A636-285439BDE025}.Release|x64.ActiveCfg = Release|x64 -+ {203EC78A-0531-43F0-A636-285439BDE025}.Release|x64.Build.0 = Release|x64 -+ EndGlobalSection -+ GlobalSection(SolutionProperties) = preSolution -+ HideSolutionNode = FALSE -+ EndGlobalSection -+ GlobalSection(SubversionScc) = preSolution -+ Svn-Managed = True -+ Manager = AnkhSVN - Subversion Support for Visual Studio -+ EndGlobalSection -+EndGlobal --- -1.9.0.msysgit.0 - diff --git a/windows/qt_plugin_import.cpp b/windows/qt_plugin_import.cpp deleted file mode 100644 index b3afd8a4e..000000000 --- a/windows/qt_plugin_import.cpp +++ /dev/null @@ -1,4 +0,0 @@ -// This file is autogenerated by qmake. It imports static plugin classes for -// static plugins specified using QTPLUGIN and QT_PLUGIN_CLASS. variables. -#include -Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) diff --git a/windows/stdafx.h b/windows/stdafx.h deleted file mode 100644 index 5a4e4d27d..000000000 --- a/windows/stdafx.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - This file is part of cpp-ethereum. - - cpp-ethereum is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - cpp-ethereum is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with cpp-ethereum. If not, see . -*/ -/** @file stdafx.h - * @author Tim Hughes - * @date 2014 - */ - -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include - -#pragma warning(push) -#pragma warning(disable: 4100 4267) -#include -#pragma warning(pop) - -