From bd48b5ed7bcd31de3b503ab1710c71ddffbcdbd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Tim=C3=B3n?= Date: Wed, 8 Mar 2017 09:42:52 +0100 Subject: [PATCH] CA: Globals: Introduce global CAssetsDir gAssetsDir --- src/Makefile.am | 2 ++ src/global/common.cpp | 15 +++++++++++++++ src/global/common.h | 17 +++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 src/global/common.cpp create mode 100644 src/global/common.h diff --git a/src/Makefile.am b/src/Makefile.am index 6fec94e96b..c745cab9bc 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -95,6 +95,7 @@ BITCOIN_CORE_H = \ consensus/consensus.h \ core_io.h \ core_memusage.h \ + global/common.h \ httprpc.h \ httpserver.h \ indirectmap.h \ @@ -307,6 +308,7 @@ libbitcoin_common_a_SOURCES = \ compressor.cpp \ core_read.cpp \ core_write.cpp \ + global/common.cpp \ key.cpp \ keystore.cpp \ merkleblock.cpp \ diff --git a/src/global/common.cpp b/src/global/common.cpp new file mode 100644 index 0000000000..0fcb9d3002 --- /dev/null +++ b/src/global/common.cpp @@ -0,0 +1,15 @@ +// Copyright (c) 2017-2017 The Elements Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "global/common.h" + +#include "assetsdir.h" + +CAssetsDir _gAssetsDir; +const CAssetsDir& gAssetsDir = _gAssetsDir; + +void InitGlobalAssetDir(const std::vector& assetsToInit) +{ + _gAssetsDir.InitFromStrings(assetsToInit); +} diff --git a/src/global/common.h b/src/global/common.h new file mode 100644 index 0000000000..b695434058 --- /dev/null +++ b/src/global/common.h @@ -0,0 +1,17 @@ +// Copyright (c) 2017-2017 The Elements Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_GLOBAL_COMMON_H +#define BITCOIN_GLOBAL_COMMON_H + +#include +#include + +class CAssetsDir; + +extern const CAssetsDir& gAssetsDir; + +void InitGlobalAssetDir(const std::vector& assetsToInit); + +#endif // BITCOIN_GLOBAL_COMMON_H