diff --git a/.gitignore b/.gitignore
index b38a3f1e3..6fde7ca22 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,18 +18,23 @@ ipch
*.sdf
*.opensdf
*.suo
+*.vcxproj
+*.vcxproj.filters
+*.sln
# VIM stuff
*.swp
-#Xcode stuff
+# Xcode stuff
build_xc
*.user
*.user.*
*~
+# build system
build.*/
+extdep/install
*.pyc
@@ -59,3 +64,5 @@ profile
DerivedData
project.pbxproj
+
+evmjit
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 000000000..26c29d38d
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,4 @@
+[submodule "evmjit"]
+ path = evmjit
+ url = https://github.com/ethereum/evmjit
+ branch = develop
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e3a7d9b83..db5ddb864 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,15 @@ 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")
+ set(EVMJIT OFF CACHE BOOL "Build a just-in-time compiler for EVM code (requires LLVM)")
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)
@@ -39,9 +39,14 @@ function(configureProject)
message(FATAL_ERROR "VM tracing requires debug.")
endif ()
endif ()
+
+ if (EVMJIT)
+ add_definitions(-DETH_EVMJIT)
+ endif()
endfunction()
+
function(createBuildInfo)
# Set build platform; to be written to BuildInfo.h
if (CMAKE_COMPILER_IS_MINGW)
@@ -50,7 +55,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 +63,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 +89,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}; EVMJIT: ${EVMJIT}")
# Default TARGET_PLATFORM to "linux".
@@ -88,88 +102,98 @@ 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()
+if (EVMJIT)
+ # Workaround for Ubuntu broken LLVM package
+ link_directories(/usr/lib/llvm-3.5/lib)
+
+ add_subdirectory(evmjit)
+endif()
+
add_subdirectory(libdevcore)
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)
#unset(TARGET_PLATFORM CACHE)
-
+if (WIN32)
+ # packaging stuff
+ include(InstallRequiredSystemLibraries)
+ set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "ethereum")
+ set(CPACK_PACKAGE_VENDOR "ethereum.org")
+ set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
+ set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
+ set(CPACK_PACKAGE_VERSION "0.7")
+ set(CPACK_GENERATOR "NSIS")
+ # seems to be not working
+ # set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/alethzero/alethzero.bmp")
+
+ # our stuff
+ set(CPACK_COMPONENT_ALETHZERO_GROUP "Applications")
+ set(CPACK_COMPONENT_THIRD_GROUP "Applications")
+ set(CPACK_COMPONENT_MIX_GROUP "Applications")
+ set(CPACK_COMPONENTS_ALL alethzero third mix)
+
+ # nsis specific stuff
+ set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} ethereum")
+ set(CPACK_NSIS_HELP_LINK "https://github.com/ethereum/cpp-ethereum")
+ set(CPACK_NSIS_URL_INFO_ABOUT "https://github.com/ethereum/cpp-ethereum")
+ set(CPACK_NSIS_CONTACT "ethereum.org")
+ set(CPACK_NSIS_MODIFY_PATH ON)
+ set(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}/alethzero/alethzero.ico")
+ set(CPACK_NSIS_MUI_UNIICON "${CMAKE_CURRENT_SOURCE_DIR}/alethzero/alethzero.ico")
+
+ include(CPack)
+endif (WIN32)
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..cfa223a56 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,9 @@
## Ethereum C++ Client.
+[![Build
+Status](http://build.ethdev.com/buildstatusimage?builder=Linux%20C%2B%2B%20master%20branch)](http://build.ethdev.com/builders/Linux%20C%2B%2B%20master%20branch/builds/-1) master [![Build
+Status](http://build.ethdev.com/buildstatusimage?builder=Linux%20C%2B%2B%20develop%20branch)](http://build.ethdev.com/builders/Linux%20C%2B%2B%20develop%20branch/builds/-1) develop
+
By Gav Wood, 2014.
[![Build
@@ -36,5 +40,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..8c8a37a42 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
+ WIN_RESOURCES alethzero.rc
+)
+
+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} 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 fa489ffeb..dbcd0f493 100644
--- a/alethzero/MainWin.cpp
+++ b/alethzero/MainWin.cpp
@@ -65,7 +65,7 @@ static void initUnits(QComboBox* _b)
_b->addItem(QString::fromStdString(units()[n].second), n);
}
-static QString fromRaw(dev::h256 _n, unsigned* _inc = nullptr)
+QString Main::fromRaw(dev::h256 _n, unsigned* _inc)
{
if (_n)
{
@@ -106,6 +106,8 @@ static QString contentsOfQResource(std::string const& res)
}
Address c_config = Address("661005d2720d855f1d9976f88bb10c1a3398c77f");
+Address c_newConfig = Address("d5f9d8d94886e70b06e474c3fb14fd43e2f23970");
+Address c_nameReg = Address("ddd1cea741d548f90d86fb87a3ae6492e18c03a1");
Main::Main(QWidget *parent) :
QMainWindow(parent),
@@ -149,14 +151,13 @@ Main::Main(QWidget *parent) :
statusBar()->addPermanentWidget(ui->peerCount);
statusBar()->addPermanentWidget(ui->mineStatus);
statusBar()->addPermanentWidget(ui->blockCount);
-
+
connect(ui->ourAccounts->model(), SIGNAL(rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int)), SLOT(ourAccountsRowsMoved()));
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();
@@ -174,17 +175,17 @@ Main::Main(QWidget *parent) :
connect(f, &QWebFrame::javaScriptWindowObjectCleared, QETH_INSTALL_JS_NAMESPACE(f, this, qweb));
connect(m_qweb, SIGNAL(onNewId(QString)), this, SLOT(addNewId(QString)));
});
-
+
connect(ui->webView, &QWebView::loadFinished, [=]()
{
m_qweb->poll();
});
-
+
connect(ui->webView, &QWebView::titleChanged, [=]()
{
ui->tabWidget->setTabText(0, ui->webView->title());
});
-
+
readSettings();
installWatches();
startTimer(100);
@@ -449,8 +450,29 @@ static Public stringToPublic(QString const& _a)
return Public();
}
+static Address g_newNameReg;
+
QString Main::pretty(dev::Address _a) const
{
+ static std::map
s_memos;
+
+ if (!s_memos.count(_a))
+ {
+ if (!g_newNameReg)
+ g_newNameReg = abiOut(ethereum()->call(c_newConfig, abiIn(1, (u256)1)));
+
+ if (g_newNameReg)
+ {
+ QString s = QString::fromStdString(toString(abiOut(ethereum()->call(g_newNameReg, abiIn(2, _a)))));
+ s_memos[_a] = s;
+ if (s.size())
+ return s;
+ }
+ }
+ else
+ if (s_memos[_a].size())
+ return s_memos[_a];
+
h256 n;
if (h160 nameReg = (u160)ethereum()->stateAt(c_config, 0))
@@ -470,19 +492,47 @@ QString Main::render(dev::Address _a) const
return QString::fromStdString(_a.abridged());
}
-Address Main::fromString(QString const& _a) const
+string32 fromString(std::string const& _s)
{
- if (_a == "(Create Contract)")
+ string32 ret;
+ for (unsigned i = 0; i < 32 && i <= _s.size(); ++i)
+ ret[i] = i < _s.size() ? _s[i] : 0;
+ return ret;
+}
+
+Address Main::fromString(QString const& _n) const
+{
+ if (_n == "(Create Contract)")
return Address();
- string sn = _a.toStdString();
+ static std::map s_memos;
+
+ if (!s_memos.count(_n))
+ {
+ if (!g_newNameReg)
+ g_newNameReg = abiOut(ethereum()->call(c_newConfig, abiIn(1, (u256)1)));
+
+ if (g_newNameReg)
+ {
+ Address a = abiOut(ethereum()->call(g_newNameReg, abiIn(0, ::fromString(_n.toStdString()))));
+ s_memos[_n] = a;
+ if (a)
+ return a;
+ }
+ }
+ else
+ if (s_memos[_n])
+ return s_memos[_n];
+
+ string sn = _n.toStdString();
if (sn.size() > 32)
sn.resize(32);
h256 n;
memcpy(n.data(), sn.data(), sn.size());
memset(n.data() + sn.size(), 0, 32 - sn.size());
- if (_a.size())
+ if (_n.size())
{
+
if (h160 nameReg = (u160)ethereum()->stateAt(c_config, 0))
if (h256 a = ethereum()->stateAt(nameReg, n))
return right160(a);
@@ -490,8 +540,9 @@ Address Main::fromString(QString const& _a) const
if (h256 a = ethereum()->stateAt(m_nameReg, n))
return right160(a);
}
- if (_a.size() == 40)
- return Address(fromHex(_a.toStdString()));
+
+ if (_n.size() == 40)
+ return Address(fromHex(_n.toStdString()));
else
return Address();
}
@@ -1068,7 +1119,7 @@ void Main::timerEvent(QTimerEvent*)
// 7/18, Alex: aggregating timers, prelude to better threading?
// Runs much faster on slower dual-core processors
static int interval = 100;
-
+
// refresh mining every 200ms
if (interval / 100 % 2 == 0)
refreshMining();
@@ -1094,7 +1145,7 @@ void Main::timerEvent(QTimerEvent*)
}
else
interval += 100;
-
+
if (m_qweb)
m_qweb->poll();
@@ -1113,7 +1164,7 @@ string Main::renderDiff(dev::eth::StateDiff const& _d) const
s << "
";
dev::eth::AccountDiff const& ad = i.second;
- s << "" << ad.lead() << "
" << " " << render(i.first).toStdString() << "";
+ s << "" << lead(ad.changeType()) << "
" << " " << render(i.first).toStdString() << "";
if (!ad.exist.to())
continue;
@@ -1134,7 +1185,7 @@ string Main::renderDiff(dev::eth::StateDiff const& _d) const
s << " (" << ad.code.from().size() << " bytes)";
}
- for (pair> const& i: ad.storage)
+ for (pair> const& i: ad.storage)
{
s << "
";
if (!i.second.from())
@@ -1351,7 +1402,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, 0));
+ m_currentExecution = unique_ptr(new Executive(m_executiveState, ethereum()->blockChain(), 0));
Transaction t = m_executiveState.pending()[txi];
m_executiveState = m_executiveState.fromPending(txi);
auto r = t.rlp();
@@ -1712,7 +1763,7 @@ void Main::on_net_triggered()
{
ui->port->setEnabled(!ui->net->isChecked());
ui->clientName->setEnabled(!ui->net->isChecked());
- string n = string("AlethZero/v") + dev::Version;
+ string n = string("AlethZero/v") + dev::Version;
if (ui->clientName->text().size())
n += "/" + ui->clientName->text().toStdString();
n += "/" DEV_QUOTED(ETH_BUILD_TYPE) "/" DEV_QUOTED(ETH_BUILD_PLATFORM);
@@ -1804,7 +1855,7 @@ void Main::on_debug_clicked()
{
Secret s = i.secret();
m_executiveState = ethereum()->postState();
- m_currentExecution = unique_ptr(new Executive(m_executiveState, 0));
+ m_currentExecution = unique_ptr(new Executive(m_executiveState, ethereum()->blockChain(), 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);
@@ -2192,18 +2243,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 f2d632cd4..5c196792d 100644
--- a/alethzero/MainWin.h
+++ b/alethzero/MainWin.h
@@ -69,7 +69,7 @@ struct WorldState
class Main : public QMainWindow
{
Q_OBJECT
-
+
public:
explicit Main(QWidget *parent = 0);
~Main();
@@ -79,7 +79,7 @@ public:
std::shared_ptr whisper() const { return m_webThree->whisper(); }
QList owned() const { return m_myIdentities + m_myKeys; }
-
+
public slots:
void load(QString _file);
void note(QString _entry);
@@ -146,7 +146,7 @@ private slots:
void on_debugDumpState_triggered(int _add = 1);
void on_debugDumpStatePre_triggered();
void on_refresh_triggered();
- void on_usePrivate_triggered();
+ void on_usePrivate_triggered();
void on_enableOptimizer_triggered();
void on_turboMining_triggered();
void on_go_triggered();
@@ -256,7 +256,9 @@ 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;
+
+ static QString fromRaw(dev::h256 _n, unsigned* _inc = 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/alethzero/alethzero.ico b/alethzero/alethzero.ico
new file mode 100644
index 000000000..acee27751
Binary files /dev/null and b/alethzero/alethzero.ico differ
diff --git a/alethzero/alethzero.rc b/alethzero/alethzero.rc
new file mode 100644
index 000000000..29c778bd4
--- /dev/null
+++ b/alethzero/alethzero.rc
@@ -0,0 +1 @@
+APP_ICON ICON DISCARDABLE "alethzero.ico"
\ No newline at end of file
diff --git a/boost/process.hpp b/boost/process.hpp
deleted file mode 100644
index 60511ef57..000000000
--- a/boost/process.hpp
+++ /dev/null
@@ -1,50 +0,0 @@
-//
-// Boost.Process
-// ~~~~~~~~~~~~~
-//
-// Copyright (c) 2006, 2007 Julio M. Merino Vidal
-// Copyright (c) 2008, 2009 Boris Schaeling
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-
-/**
- * \file boost/process.hpp
- *
- * Convenience header that includes all other Boost.Process public header
- * files. It is important to note that those headers that are specific to
- * a given platform are only included if the library is being used in that
- * same platform.
- */
-
-#ifndef BOOST_PROCESS_HPP
-#define BOOST_PROCESS_HPP
-
-#include
-
-#if defined(BOOST_POSIX_API)
-# include
-# include
-# include
-# include
-#elif defined(BOOST_WINDOWS_API)
-# include
-# include
-# include
-#else
-# error "Unsupported platform."
-#endif
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#endif
diff --git a/boost/process/child.hpp b/boost/process/child.hpp
deleted file mode 100644
index 1419b7ea7..000000000
--- a/boost/process/child.hpp
+++ /dev/null
@@ -1,200 +0,0 @@
-//
-// Boost.Process
-// ~~~~~~~~~~~~~
-//
-// Copyright (c) 2006, 2007 Julio M. Merino Vidal
-// Copyright (c) 2008, 2009 Boris Schaeling
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-
-/**
- * \file boost/process/child.hpp
- *
- * Includes the declaration of the child class.
- */
-
-#ifndef BOOST_PROCESS_CHILD_HPP
-#define BOOST_PROCESS_CHILD_HPP
-
-#include
-
-#if defined(BOOST_POSIX_API)
-# include
-# include
-# include
-#elif defined(BOOST_WINDOWS_API)
-# include
-#else
-# error "Unsupported platform."
-#endif
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-namespace boost {
-namespace process {
-
-/**
- * Generic implementation of the Child concept.
- *
- * The child class implements the Child concept in an operating system
- * agnostic way.
- */
-class child : public process
-{
-public:
- /**
- * Gets a reference to the child's standard input stream.
- *
- * Returns a reference to a postream object that represents the
- * standard input communication channel with the child process.
- */
- postream &get_stdin() const
- {
- BOOST_ASSERT(stdin_);
-
- return *stdin_;
- }
-
- /**
- * Gets a reference to the child's standard output stream.
- *
- * Returns a reference to a pistream object that represents the
- * standard output communication channel with the child process.
- */
- pistream &get_stdout() const
- {
- BOOST_ASSERT(stdout_);
-
- return *stdout_;
- }
-
- /**
- * Gets a reference to the child's standard error stream.
- *
- * Returns a reference to a pistream object that represents the
- * standard error communication channel with the child process.
- */
- pistream &get_stderr() const
- {
- BOOST_ASSERT(stderr_);
-
- return *stderr_;
- }
-
- /**
- * Blocks and waits for the child process to terminate.
- *
- * Returns a status object that represents the child process'
- * finalization condition. The child process object ceases to be
- * valid after this call.
- *
- * \remark Blocking remarks: This call blocks if the child
- * process has not finalized execution and waits until
- * it terminates.
- */
- status wait()
- {
-#if defined(BOOST_POSIX_API)
- int s;
- if (::waitpid(get_id(), &s, 0) == -1)
- boost::throw_exception(boost::system::system_error(boost::system::error_code(errno, boost::system::get_system_category()), "boost::process::child::wait: waitpid(2) failed"));
- return status(s);
-#elif defined(BOOST_WINDOWS_API)
- ::WaitForSingleObject(process_handle_.get(), INFINITE);
- DWORD code;
- if (!::GetExitCodeProcess(process_handle_.get(), &code))
- boost::throw_exception(boost::system::system_error(boost::system::error_code(::GetLastError(), boost::system::get_system_category()), "boost::process::child::wait: GetExitCodeProcess failed"));
- return status(code);
-#endif
- }
-
- /**
- * Creates a new child object that represents the just spawned child
- * process \a id.
- *
- * The \a fhstdin, \a fhstdout and \a fhstderr file handles represent
- * the parent's handles used to communicate with the corresponding
- * data streams. They needn't be valid but their availability must
- * match the redirections configured by the launcher that spawned this
- * process.
- *
- * The \a fhprocess handle represents a handle to the child process.
- * It is only used on Windows as the implementation of wait() needs a
- * process handle.
- */
- child(id_type id, detail::file_handle fhstdin, detail::file_handle fhstdout, detail::file_handle fhstderr, detail::file_handle fhprocess = detail::file_handle())
- : process(id)
-#if defined(BOOST_WINDOWS_API)
- , process_handle_(fhprocess.release(), ::CloseHandle)
-#endif
- {
- if (fhstdin.valid())
- stdin_.reset(new postream(fhstdin));
- if (fhstdout.valid())
- stdout_.reset(new pistream(fhstdout));
- if (fhstderr.valid())
- stderr_.reset(new pistream(fhstderr));
- }
-
-private:
- /**
- * The standard input stream attached to the child process.
- *
- * This postream object holds the communication channel with the
- * child's process standard input. It is stored in a pointer because
- * this field is only valid when the user requested to redirect this
- * data stream.
- */
- boost::shared_ptr stdin_;
-
- /**
- * The standard output stream attached to the child process.
- *
- * This postream object holds the communication channel with the
- * child's process standard output. It is stored in a pointer because
- * this field is only valid when the user requested to redirect this
- * data stream.
- */
- boost::shared_ptr stdout_;
-
- /**
- * The standard error stream attached to the child process.
- *
- * This postream object holds the communication channel with the
- * child's process standard error. It is stored in a pointer because
- * this field is only valid when the user requested to redirect this
- * data stream.
- */
- boost::shared_ptr stderr_;
-
-#if defined(BOOST_WINDOWS_API)
- /**
- * Process handle owned by RAII object.
- */
- boost::shared_ptr process_handle_;
-#endif
-};
-
-/**
- * Collection of child objects.
- *
- * This convenience type represents a collection of child objects backed
- * by a vector.
- */
-typedef std::vector children;
-
-}
-}
-
-#endif
diff --git a/boost/process/config.hpp b/boost/process/config.hpp
deleted file mode 100644
index f240f86b5..000000000
--- a/boost/process/config.hpp
+++ /dev/null
@@ -1,41 +0,0 @@
-//
-// Boost.Process
-// ~~~~~~~~~~~~~
-//
-// Copyright (c) 2006, 2007 Julio M. Merino Vidal
-// Copyright (c) 2008, 2009 Boris Schaeling
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-
-/**
- * \file boost/process/config.hpp
- *
- * Defines macros that are used by the library's code to determine the
- * operating system it is running under and the features it supports.
- */
-
-#ifndef BOOST_PROCESS_CONFIG_HPP
-#define BOOST_PROCESS_CONFIG_HPP
-
-#include
-#include
-
-#if defined(BOOST_POSIX_API) || defined(BOOST_PROCESS_DOXYGEN)
-# if !defined(BOOST_PROCESS_POSIX_PATH_MAX)
-/**
- * The macro BOOST_PROCESS_POSIX_PATH_MAX is set to a positive integer
- * value which specifies the system's maximal supported path length.
- * By default it is set to 259. You should set the macro to PATH_MAX
- * which should be defined in limits.h provided by your operating system
- * if you experience problems when instantiating a context. The
- * constructor of basic_work_directory_context tries to find out
- * dynamically the maximal supported path length but uses
- * BOOST_PROCESS_POSIX_PATH_MAX if it fails.
- */
-# define BOOST_PROCESS_POSIX_PATH_MAX 259
-# endif
-#endif
-
-#endif
diff --git a/boost/process/context.hpp b/boost/process/context.hpp
deleted file mode 100644
index 51acd35bc..000000000
--- a/boost/process/context.hpp
+++ /dev/null
@@ -1,209 +0,0 @@
-//
-// Boost.Process
-// ~~~~~~~~~~~~~
-//
-// Copyright (c) 2006, 2007 Julio M. Merino Vidal
-// Copyright (c) 2008, 2009 Boris Schaeling
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-
-/**
- * \file boost/process/context.hpp
- *
- * Includes the declaration of the context class and several accessory
- * base classes.
- */
-
-#ifndef BOOST_PROCESS_CONTEXT_HPP
-#define BOOST_PROCESS_CONTEXT_HPP
-
-#include
-
-#if defined(BOOST_POSIX_API)
-# include
-# include
-# include
-#elif defined(BOOST_WINDOWS_API)
-# include
-#else
-# error "Unsupported platform."
-#endif
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-namespace boost {
-namespace process {
-
-/**
- * Base context class that defines the child's work directory.
- *
- * Base context class that defines the necessary fields to configure a
- * child's work directory. This class is useless on its own because no
- * function in the library will accept it as a valid Context
- * implementation.
- */
-template
-class basic_work_directory_context
-{
-public:
- /**
- * Constructs a new work directory context.
- *
- * Constructs a new work directory context making the work directory
- * described by the new object point to the caller's current working
- * directory.
- */
- basic_work_directory_context()
- {
-#if defined(BOOST_POSIX_API)
- errno = 0;
- long size = ::pathconf(".", _PC_PATH_MAX);
- if (size == -1 && errno)
- boost::throw_exception(boost::system::system_error(boost::system::error_code(errno, boost::system::get_system_category()), "boost::process::basic_work_directory_context::basic_work_directory_context: pathconf(2) failed"));
- else if (size == -1)
- size = BOOST_PROCESS_POSIX_PATH_MAX;
- boost::scoped_array cwd(new char[size]);
- if (!::getcwd(cwd.get(), size))
- boost::throw_exception(boost::system::system_error(boost::system::error_code(errno, boost::system::get_system_category()), "boost::process::basic_work_directory_context::basic_work_directory_context: getcwd(2) failed"));
- work_directory = cwd.get();
-#elif defined(BOOST_WINDOWS_API)
- char cwd[MAX_PATH];
- if (!::GetCurrentDirectoryA(sizeof(cwd), cwd))
- boost::throw_exception(boost::system::system_error(boost::system::error_code(::GetLastError(), boost::system::get_system_category()), "boost::process::basic_work_directory_context::basic_work_directory_context: GetCurrentDirectory failed"));
- work_directory = cwd;
-#endif
- BOOST_ASSERT(!work_directory.empty());
- }
-
- /**
- * The process' initial work directory.
- *
- * The work directory is the directory in which the process starts
- * execution.
- */
- Path work_directory;
-};
-
-/**
- * Base context class that defines the child's environment.
- *
- * Base context class that defines the necessary fields to configure a
- * child's environment variables. This class is useless on its own
- * because no function in the library will accept it as a valid Context
- * implementation.
- */
-class environment_context
-{
-public:
- /**
- * The process' environment.
- *
- * Contains the list of environment variables, alongside with their
- * values, that will be passed to the spawned child process.
- */
- boost::process::environment environment;
-};
-
-/**
- * Process startup execution context.
- *
- * The context class groups all the parameters needed to configure a
- * process' environment during its creation.
- */
-template
-class basic_context : public basic_work_directory_context, public environment_context
-{
-public:
- /**
- * Child's stdin behavior.
- */
- stream_behavior stdin_behavior;
-
- /**
- * Child's stdout behavior.
- */
- stream_behavior stdout_behavior;
-
- /**
- * Child's stderr behavior.
- */
- stream_behavior stderr_behavior;
-};
-
-typedef basic_context context;
-
-/**
- * Represents a child process in a pipeline.
- *
- * This convenience class is a triplet that holds all the data required
- * to spawn a new child process in a pipeline.
- */
-template
-class basic_pipeline_entry
-{
-public:
- /**
- * The executable to launch.
- */
- Executable executable;
-
- /**
- * The set of arguments to pass to the executable.
- */
- Arguments arguments;
-
- /**
- * The child's execution context.
- */
- Context context;
-
- /**
- * The type of the Executable concept used in this template
- * instantiation.
- */
- typedef Executable executable_type;
-
- /**
- * The type of the Arguments concept used in this template
- * instantiation.
- */
- typedef Arguments arguments_type;
-
- /**
- * The type of the Context concept used in this template
- * instantiation.
- */
- typedef Context context_type;
-
- /**
- * Constructs a new pipeline_entry object.
- *
- * Given the executable, set of arguments and execution triplet,
- * constructs a new pipeline_entry object that holds the three
- * values.
- */
- basic_pipeline_entry(const Executable &exe, const Arguments &args, const Context &ctx)
- : executable(exe),
- arguments(args),
- context(ctx)
- {
- }
-};
-
-/**
- * Default instantiation of basic_pipeline_entry.
- */
-typedef basic_pipeline_entry, context> pipeline_entry;
-
-}
-}
-
-#endif
diff --git a/boost/process/detail/file_handle.hpp b/boost/process/detail/file_handle.hpp
deleted file mode 100644
index 33f21d9b6..000000000
--- a/boost/process/detail/file_handle.hpp
+++ /dev/null
@@ -1,406 +0,0 @@
-//
-// Boost.Process
-// ~~~~~~~~~~~~~
-//
-// Copyright (c) 2006, 2007 Julio M. Merino Vidal
-// Copyright (c) 2008, 2009 Boris Schaeling
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-
-/**
- * \file boost/process/detail/file_handle.hpp
- *
- * Includes the declaration of the file_handle class. This file is for
- * internal usage only and must not be included by the library user.
- */
-
-#ifndef BOOST_PROCESS_DETAIL_FILE_HANDLE_HPP
-#define BOOST_PROCESS_DETAIL_FILE_HANDLE_HPP
-
-#include
-
-#if defined(BOOST_POSIX_API)
-# include
-# include
-#elif defined(BOOST_WINDOWS_API)
-# include
-#else
-# error "Unsupported platform."
-#endif
-
-#include
-#include
-#include
-
-namespace boost {
-namespace process {
-namespace detail {
-
-/**
- * Simple RAII model for system file handles.
- *
- * The \a file_handle class is a simple RAII model for native system file
- * handles. This class wraps one of such handles grabbing its ownership,
- * and automaticaly closes it upon destruction. It is basically used
- * inside the library to avoid leaking open file handles, shall an
- * unexpected execution trace occur.
- *
- * A \a file_handle object can be copied but doing so invalidates the
- * source object. There can only be a single valid \a file_handle object
- * for a given system file handle. This is similar to std::auto_ptr's
- * semantics.
- *
- * This class also provides some convenience methods to issue special file
- * operations under their respective platforms.
- */
-class file_handle
-{
-public:
-#if defined(BOOST_PROCESS_DOXYGEN)
- /**
- * Opaque name for the native handle type.
- *
- * Each operating system identifies file handles using a specific type.
- * The \a handle_type type is used to transparently refer to file
- * handles regarless of the operating system in which this class is
- * used.
- *
- * If this class is used on a POSIX system, \a NativeSystemHandle is
- * an integer type while it is a \a HANDLE on a Windows system.
- */
- typedef NativeSystemHandle handle_type;
-#elif defined(BOOST_POSIX_API)
- typedef int handle_type;
-#elif defined(BOOST_WINDOWS_API)
- typedef HANDLE handle_type;
-#endif
-
- /**
- * Constructs an invalid file handle.
- *
- * This constructor creates a new \a file_handle object that represents
- * an invalid file handle. An invalid file handle can be copied but
- * cannot be manipulated in any way (except checking for its validity).
- *
- * \see valid()
- */
- file_handle()
- : handle_(invalid_value())
- {
- }
-
- /**
- * Constructs a new file handle from a native file handle.
- *
- * This constructor creates a new \a file_handle object that takes
- * ownership of the given \a h native file handle. The user must not
- * close \a h on his own during the lifetime of the new object.
- * Ownership can be reclaimed using release().
- *
- * \pre The native file handle must be valid; a close operation must
- * succeed on it.
- * \see release()
- */
- file_handle(handle_type h)
- : handle_(h)
- {
- BOOST_ASSERT(handle_ != invalid_value());
- }
-
- /**
- * Copy constructor; invalidates the source handle.
- *
- * This copy constructor creates a new file handle from a given one.
- * Ownership of the native file handle is transferred to the new
- * object, effectively invalidating the source file handle. This
- * avoids having two live \a file_handle objects referring to the
- * same native file handle. The source file handle needs not be
- * valid in the name of simplicity.
- *
- * \post The source file handle is invalid.
- * \post The new file handle owns the source's native file handle.
- */
- file_handle(const file_handle &fh)
- : handle_(fh.handle_)
- {
- fh.handle_ = invalid_value();
- }
-
- /**
- * Releases resources if the handle is valid.
- *
- * If the file handle is valid, the destructor closes it.
- *
- * \see valid()
- */
- ~file_handle()
- {
- if (valid())
- close();
- }
-
- /**
- * Assignment operator; invalidates the source handle.
- *
- * This assignment operator transfers ownership of the RHS file
- * handle to the LHS one, effectively invalidating the source file
- * handle. This avoids having two live \a file_handle objects
- * referring to the same native file handle. The source file
- * handle needs not be valid in the name of simplicity.
- *
- * \post The RHS file handle is invalid.
- * \post The LHS file handle owns RHS' native file handle.
- * \return A reference to the LHS file handle.
- */
- file_handle &operator=(const file_handle &fh)
- {
- handle_ = fh.handle_;
- fh.handle_ = invalid_value();
- return *this;
- }
-
- /**
- * Checks whether the file handle is valid or not.
- *
- * Returns a boolean indicating whether the file handle is valid or
- * not. If the file handle is invalid, no other methods can be
- * executed other than the destructor.
- *
- * \return true if the file handle is valid; false otherwise.
- */
- bool valid() const
- {
- return handle_ != invalid_value();
- }
-
- /**
- * Closes the file handle.
- *
- * Explicitly closes the file handle, which must be valid. Upon
- * exit, the handle is not valid any more.
- *
- * \pre The file handle is valid.
- * \post The file handle is invalid.
- * \post The native file handle is closed.
- */
- void close()
- {
- BOOST_ASSERT(valid());
-
-#if defined(BOOST_POSIX_API)
- ::close(handle_);
-#elif defined(BOOST_WINDOWS_API)
- ::CloseHandle(handle_);
-#endif
-
- handle_ = invalid_value();
- }
-
- /**
- * Reclaims ownership of the native file handle.
- *
- * Explicitly reclaims ownership of the native file handle contained
- * in the \a file_handle object, returning the native file handle.
- * The caller is responsible of closing it later on.
- *
- * \pre The file handle is valid.
- * \post The file handle is invalid.
- * \return The native file handle.
- */
- handle_type release()
- {
- BOOST_ASSERT(valid());
-
- handle_type h = handle_;
- handle_ = invalid_value();
- return h;
- }
-
- /**
- * Gets the native file handle.
- *
- * Returns the native file handle for the \a file_handle object.
- * The caller can issue any operation on it except closing it.
- * If closing is required, release() shall be used.
- *
- * \pre The file handle is valid.
- * \post The file handle is valid.
- * \return The native file handle.
- */
- handle_type get() const
- {
- BOOST_ASSERT(valid());
-
- return handle_;
- }
-
-#if defined(BOOST_POSIX_API) || defined(BOOST_PROCESS_DOXYGEN)
- /**
- * Changes the native file handle to the given one.
- *
- * Given a new native file handle \a h, this operation assigns this
- * handle to the current object, closing its old native file handle.
- * In other words, it first calls dup2() to remap the old handle to
- * the new one and then closes the old handle.
- *
- * If \a h is open, it is automatically closed by dup2().
- *
- * This operation is only available in POSIX systems.
- *
- * \pre The file handle is valid.
- * \pre The native file handle \a h is valid; i.e., it must be
- * closeable.
- * \post The file handle's native file handle is \a h.
- * \throw boost::system::system_error If the internal remapping
- * operation fails.
- */
- void posix_remap(handle_type h)
- {
- BOOST_ASSERT(valid());
-
- if (::dup2(handle_, h) == -1)
- boost::throw_exception(boost::system::system_error(boost::system::error_code(errno, boost::system::get_system_category()), "boost::process::detail::file_handle::posix_remap: dup2(2) failed"));
-
- if (::close(handle_) == -1)
- {
- ::close(h);
- boost::throw_exception(boost::system::system_error(boost::system::error_code(errno, boost::system::get_system_category()), "boost::process::detail::file_handle::posix_remap: close(2) failed"));
- }
-
- handle_ = h;
- }
-
- /**
- * Duplicates an open native file handle.
- *
- * Given a native file handle \a h1, this routine duplicates it so
- * that it ends up being identified by the native file handle \a h2
- * and returns a new \a file_handle owning \a h2.
- *
- * This operation is only available in POSIX systems.
- *
- * \pre The native file handle \a h1 is open.
- * \pre The native file handle \a h2 is valid (non-negative).
- * \post The native file handle \a h1 is closed.
- * \post The native file handle \a h2 is the same as the old \a h1
- * from the operating system's point of view.
- * \return A new \a file_handle object that owns \a h2.
- * \throw boost::system::system_error If dup2() fails.
- */
- static file_handle posix_dup(int h1, int h2)
- {
- if (::dup2(h1, h2) == -1)
- boost::throw_exception(boost::system::system_error(boost::system::error_code(errno, boost::system::get_system_category()), "boost::process::detail::file_handle::posix_dup: dup2(2) failed"));
-
- return file_handle(h2);
- }
-#endif
-
-#if defined(BOOST_WINDOWS_API) || defined(BOOST_PROCESS_DOXYGEN)
- /**
- * Duplicates the \a h native file handle.
- *
- * Given a native file handle \a h, this routine constructs a new
- * \a file_handle object that owns a new duplicate of \a h. The
- * duplicate's inheritable flag is set to the value of \a inheritable.
- *
- * This operation is only available in Windows systems.
- *
- * \pre The native file handle \a h is valid.
- * \return A file handle owning a duplicate of \a h.
- * \throw boost::system::system_error If DuplicateHandle() fails.
- */
- static file_handle win32_dup(HANDLE h, bool inheritable)
- {
- HANDLE h2;
- if (!::DuplicateHandle(::GetCurrentProcess(), h, ::GetCurrentProcess(), &h2, 0, inheritable ? TRUE : FALSE, DUPLICATE_SAME_ACCESS))
- boost::throw_exception(boost::system::system_error(boost::system::error_code(::GetLastError(), boost::system::get_system_category()), "boost::process::detail::file_handle::win32_dup: DuplicateHandle failed"));
-
- return file_handle(h2);
- }
-
- /**
- * Creates a new duplicate of a standard file handle.
- *
- * Constructs a new \a file_handle object that owns a duplicate of a
- * standard file handle. The \a d parameter specifies which standard
- * file handle to duplicate and can be one of \a STD_INPUT_HANDLE,
- * \a STD_OUTPUT_HANDLE or \a STD_ERROR_HANDLE. The duplicate's
- * inheritable flag is set to the value of \a inheritable.
- *
- * This operation is only available in Windows systems.
- *
- * \pre \a d refers to one of the standard handles as described above.
- * \return A file handle owning a duplicate of the standard handle
- * referred to by \a d.
- * \throw boost::system::system_error If GetStdHandle() or
- * DuplicateHandle() fails.
- */
- static file_handle win32_std(DWORD d, bool inheritable)
- {
- BOOST_ASSERT(d == STD_INPUT_HANDLE || d == STD_OUTPUT_HANDLE || d == STD_ERROR_HANDLE);
-
- HANDLE h = ::GetStdHandle(d);
- if (h == INVALID_HANDLE_VALUE)
- boost::throw_exception(boost::system::system_error(boost::system::error_code(::GetLastError(), boost::system::get_system_category()), "boost::process::detail::file_handle::win32_std: GetStdHandle failed"));
-
- return win32_dup(h, inheritable);
- }
-
- /**
- * Changes the file handle's inheritable flag.
- *
- * Changes the file handle's inheritable flag to \a i. It is not
- * necessary for the file handle's flag to be different than \a i.
- *
- * This operation is only available in Windows systems.
- *
- * \pre The file handle is valid.
- * \post The native file handle's inheritable flag is set to \a i.
- * \throw boost::system::system_error If the property change fails.
- */
- void win32_set_inheritable(bool i)
- {
- BOOST_ASSERT(valid());
-
- if (!::SetHandleInformation(handle_, HANDLE_FLAG_INHERIT, i ? HANDLE_FLAG_INHERIT : 0))
- boost::throw_exception(boost::system::system_error(boost::system::error_code(::GetLastError(), boost::system::get_system_category()), "boost::process::detail::file_handle::win32_set_inheritable: SetHandleInformation failed"));
- }
-#endif
-
-private:
- /**
- * Internal handle value.
- *
- * This variable holds the native handle value for the file handle
- * hold by this object. It is interesting to note that this needs
- * to be mutable because the copy constructor and the assignment
- * operator invalidate the source object.
- */
- mutable handle_type handle_;
-
- /**
- * Constant function representing an invalid handle value.
- *
- * Returns the platform-specific handle value that represents an
- * invalid handle. This is a constant function rather than a regular
- * constant because, in the latter case, we cannot define it under
- * Windows due to the value being of a complex type.
- */
- static handle_type invalid_value()
- {
-#if defined(BOOST_POSIX_API)
- return -1;
-#elif defined(BOOST_WINDOWS_API)
- return INVALID_HANDLE_VALUE;
-#endif
- }
-};
-
-}
-}
-}
-
-#endif
diff --git a/boost/process/detail/pipe.hpp b/boost/process/detail/pipe.hpp
deleted file mode 100644
index 3c839c228..000000000
--- a/boost/process/detail/pipe.hpp
+++ /dev/null
@@ -1,187 +0,0 @@
-//
-// Boost.Process
-// ~~~~~~~~~~~~~
-//
-// Copyright (c) 2006, 2007 Julio M. Merino Vidal
-// Copyright (c) 2008, 2009 Boris Schaeling
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-
-/**
- * \file boost/process/detail/pipe.hpp
- *
- * Includes the declaration of the pipe class. This file is for
- * internal usage only and must not be included by the library user.
- */
-
-#ifndef BOOST_PROCESS_DETAIL_PIPE_HPP
-#define BOOST_PROCESS_DETAIL_PIPE_HPP
-
-#include
-
-#if defined(BOOST_POSIX_API)
-# include
-# include
-#elif defined(BOOST_WINDOWS_API)
-# if defined(BOOST_PROCESS_WINDOWS_USE_NAMED_PIPE)
-# include
-# include
-# endif
-# include
-#else
-# error "Unsupported platform."
-#endif
-
-#include
-#include
-#include
-
-namespace boost {
-namespace process {
-namespace detail {
-
-/**
- * Simple RAII model for anonymous pipes.
- *
- * The pipe class is a simple RAII model for anonymous pipes. It
- * provides a portable constructor that allocates a new %pipe and creates
- * a pipe object that owns the two file handles associated to it: the
- * read end and the write end.
- *
- * These handles can be retrieved for modification according to
- * file_handle semantics. Optionally, their ownership can be transferred
- * to external \a file_handle objects which comes handy when the two
- * ends need to be used in different places (i.e. after a POSIX fork()
- * system call).
- *
- * Pipes can be copied following the same semantics as file handles.
- * In other words, copying a %pipe object invalidates the source one.
- *
- * \see file_handle
- */
-class pipe
-{
-public:
- /**
- * Creates a new %pipe.
- *
- * The default pipe constructor allocates a new anonymous %pipe
- * and assigns its ownership to the created pipe object. On Windows
- * when the macro BOOST_PROCESS_WINDOWS_USE_NAMED_PIPE is defined
- * a named pipe is created. This is required if asynchronous I/O
- * should be used as asynchronous I/O is only supported by named
- * pipes on Windows.
- *
- * \throw boost::system::system_error If the anonymous %pipe
- * creation fails.
- */
- pipe()
- {
- file_handle::handle_type hs[2];
-
-#if defined(BOOST_POSIX_API)
- if (::pipe(hs) == -1)
- boost::throw_exception(boost::system::system_error(boost::system::error_code(errno, boost::system::get_system_category()), "boost::process::detail::pipe::pipe: pipe(2) failed"));
-#elif defined(BOOST_WINDOWS_API)
- SECURITY_ATTRIBUTES sa;
- ZeroMemory(&sa, sizeof(sa));
- sa.nLength = sizeof(sa);
- sa.lpSecurityDescriptor = NULL;
- sa.bInheritHandle = FALSE;
-
-# if defined(BOOST_PROCESS_WINDOWS_USE_NAMED_PIPE)
- static unsigned int nextid = 0;
- std::string pipe = "\\\\.\\pipe\\boost_process_" + boost::lexical_cast(::GetCurrentProcessId()) + "_" + boost::lexical_cast(nextid++);
- hs[0] = ::CreateNamedPipeA(pipe.c_str(), PIPE_ACCESS_INBOUND | FILE_FLAG_OVERLAPPED, 0, 1, 8192, 8192, 0, &sa);
- if (hs[0] == INVALID_HANDLE_VALUE)
- boost::throw_exception(boost::system::system_error(::GetLastError(), boost::system::system_category(), "boost::process::detail::pipe::pipe: CreateNamedPipe failed"));
- hs[1] = ::CreateFileA(pipe.c_str(), GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL);
- if (hs[1] == INVALID_HANDLE_VALUE)
- boost::throw_exception(boost::system::system_error(::GetLastError(), boost::system::system_category(), "boost::process::detail::pipe::pipe: CreateFile failed"));
-
- OVERLAPPED overlapped;
- ZeroMemory(&overlapped, sizeof(overlapped));
- overlapped.hEvent = ::CreateEvent(NULL, TRUE, FALSE, NULL);
- if (!overlapped.hEvent)
- boost::throw_exception(boost::system::system_error(::GetLastError(), boost::system::system_category(), "boost::process::detail::pipe::pipe: CreateEvent failed"));
- BOOL b = ::ConnectNamedPipe(hs[0], &overlapped);
- if (!b)
- {
- if (::GetLastError() == ERROR_IO_PENDING)
- {
- if (::WaitForSingleObject(overlapped.hEvent, INFINITE) == WAIT_FAILED)
- {
- ::CloseHandle(overlapped.hEvent);
- boost::throw_exception(boost::system::system_error(::GetLastError(), boost::system::system_category(), "boost::process::detail::pipe::pipe: WaitForSingleObject failed"));
- }
- }
- else if (::GetLastError() != ERROR_PIPE_CONNECTED)
- {
- ::CloseHandle(overlapped.hEvent);
- boost::throw_exception(boost::system::system_error(::GetLastError(), boost::system::system_category(), "boost::process::detail::pipe::pipe: ConnectNamedPipe failed"));
- }
- }
- ::CloseHandle(overlapped.hEvent);
-# else
- if (!::CreatePipe(&hs[0], &hs[1], &sa, 0))
- boost::throw_exception(boost::system::system_error(::GetLastError(), boost::system::system_category(), "boost::process::detail::pipe::pipe: CreatePipe failed"));
-# endif
-#endif
-
- read_end_ = file_handle(hs[0]);
- write_end_ = file_handle(hs[1]);
- }
-
- /**
- * Returns the %pipe's read end file handle.
- *
- * Obtains a reference to the %pipe's read end file handle. Care
- * should be taken to not duplicate the returned object if ownership
- * shall remain to the %pipe.
- *
- * Duplicating the returned object invalidates its corresponding file
- * handle in the %pipe.
- *
- * \return A reference to the %pipe's read end file handle.
- */
- file_handle &rend()
- {
- return read_end_;
- }
-
- /**
- * Returns the %pipe's write end file handle.
- *
- * Obtains a reference to the %pipe's write end file handle. Care
- * should be taken to not duplicate the returned object if ownership
- * shall remain to the %pipe.
- *
- * Duplicating the returned object invalidates its corresponding file
- * handle in the %pipe.
- *
- * \return A reference to the %pipe's write end file handle.
- */
- file_handle &wend()
- {
- return write_end_;
- }
-
-private:
- /**
- * The %pipe's read end file handle.
- */
- file_handle read_end_;
-
- /**
- * The %pipe's write end file handle.
- */
- file_handle write_end_;
-};
-
-}
-}
-}
-
-#endif
diff --git a/boost/process/detail/posix_ops.hpp b/boost/process/detail/posix_ops.hpp
deleted file mode 100644
index 8c39e0ebf..000000000
--- a/boost/process/detail/posix_ops.hpp
+++ /dev/null
@@ -1,495 +0,0 @@
-//
-// Boost.Process
-// ~~~~~~~~~~~~~
-//
-// Copyright (c) 2006, 2007 Julio M. Merino Vidal
-// Copyright (c) 2008, 2009 Boris Schaeling
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-
-/**
- * \file boost/process/detail/posix_ops.hpp
- *
- * Provides some convenience functions to start processes under POSIX
- * operating systems.
- */
-
-#ifndef BOOST_PROCESS_DETAIL_POSIX_OPS_HPP
-#define BOOST_PROCESS_DETAIL_POSIX_OPS_HPP
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include