This commit is contained in:
Gavin Andresen 2010-07-14 15:54:31 +00:00
parent f32339e700
commit 8bd66202c3
62 changed files with 32876 additions and 32876 deletions

402
base58.h
View File

@ -1,201 +1,201 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
//
// Why base-58 instead of standard base-64 encoding?
// - Don't want 0OIl characters that look the same in some fonts and
// could be used to create visually identical looking account numbers.
// - A string with non-alphanumeric characters is not as easily accepted as an account number.
// - E-mail usually won't line-break if there's no punctuation to break at.
// - Doubleclicking selects the whole number as one word if it's all alphanumeric.
//
static const char* pszBase58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
inline string EncodeBase58(const unsigned char* pbegin, const unsigned char* pend)
{
CAutoBN_CTX pctx;
CBigNum bn58 = 58;
CBigNum bn0 = 0;
// Convert big endian data to little endian
// Extra zero at the end make sure bignum will interpret as a positive number
vector<unsigned char> vchTmp(pend-pbegin+1, 0);
reverse_copy(pbegin, pend, vchTmp.begin());
// Convert little endian data to bignum
CBigNum bn;
bn.setvch(vchTmp);
// Convert bignum to string
string str;
str.reserve((pend - pbegin) * 138 / 100 + 1);
CBigNum dv;
CBigNum rem;
while (bn > bn0)
{
if (!BN_div(&dv, &rem, &bn, &bn58, pctx))
throw bignum_error("EncodeBase58 : BN_div failed");
bn = dv;
unsigned int c = rem.getulong();
str += pszBase58[c];
}
// Leading zeroes encoded as base58 zeros
for (const unsigned char* p = pbegin; p < pend && *p == 0; p++)
str += pszBase58[0];
// Convert little endian string to big endian
reverse(str.begin(), str.end());
return str;
}
inline string EncodeBase58(const vector<unsigned char>& vch)
{
return EncodeBase58(&vch[0], &vch[0] + vch.size());
}
inline bool DecodeBase58(const char* psz, vector<unsigned char>& vchRet)
{
CAutoBN_CTX pctx;
vchRet.clear();
CBigNum bn58 = 58;
CBigNum bn = 0;
CBigNum bnChar;
while (isspace(*psz))
psz++;
// Convert big endian string to bignum
for (const char* p = psz; *p; p++)
{
const char* p1 = strchr(pszBase58, *p);
if (p1 == NULL)
{
while (isspace(*p))
p++;
if (*p != '\0')
return false;
break;
}
bnChar.setulong(p1 - pszBase58);
if (!BN_mul(&bn, &bn, &bn58, pctx))
throw bignum_error("DecodeBase58 : BN_mul failed");
bn += bnChar;
}
// Get bignum as little endian data
vector<unsigned char> vchTmp = bn.getvch();
// Trim off sign byte if present
if (vchTmp.size() >= 2 && vchTmp.end()[-1] == 0 && vchTmp.end()[-2] >= 0x80)
vchTmp.erase(vchTmp.end()-1);
// Restore leading zeros
int nLeadingZeros = 0;
for (const char* p = psz; *p == pszBase58[0]; p++)
nLeadingZeros++;
vchRet.assign(nLeadingZeros + vchTmp.size(), 0);
// Convert little endian data to big endian
reverse_copy(vchTmp.begin(), vchTmp.end(), vchRet.end() - vchTmp.size());
return true;
}
inline bool DecodeBase58(const string& str, vector<unsigned char>& vchRet)
{
return DecodeBase58(str.c_str(), vchRet);
}
inline string EncodeBase58Check(const vector<unsigned char>& vchIn)
{
// add 4-byte hash check to the end
vector<unsigned char> vch(vchIn);
uint256 hash = Hash(vch.begin(), vch.end());
vch.insert(vch.end(), (unsigned char*)&hash, (unsigned char*)&hash + 4);
return EncodeBase58(vch);
}
inline bool DecodeBase58Check(const char* psz, vector<unsigned char>& vchRet)
{
if (!DecodeBase58(psz, vchRet))
return false;
if (vchRet.size() < 4)
{
vchRet.clear();
return false;
}
uint256 hash = Hash(vchRet.begin(), vchRet.end()-4);
if (memcmp(&hash, &vchRet.end()[-4], 4) != 0)
{
vchRet.clear();
return false;
}
vchRet.resize(vchRet.size()-4);
return true;
}
inline bool DecodeBase58Check(const string& str, vector<unsigned char>& vchRet)
{
return DecodeBase58Check(str.c_str(), vchRet);
}
static const unsigned char ADDRESSVERSION = 0;
inline string Hash160ToAddress(uint160 hash160)
{
// add 1-byte version number to the front
vector<unsigned char> vch(1, ADDRESSVERSION);
vch.insert(vch.end(), UBEGIN(hash160), UEND(hash160));
return EncodeBase58Check(vch);
}
inline bool AddressToHash160(const char* psz, uint160& hash160Ret)
{
vector<unsigned char> vch;
if (!DecodeBase58Check(psz, vch))
return false;
if (vch.empty())
return false;
unsigned char nVersion = vch[0];
if (vch.size() != sizeof(hash160Ret) + 1)
return false;
memcpy(&hash160Ret, &vch[1], sizeof(hash160Ret));
return (nVersion <= ADDRESSVERSION);
}
inline bool AddressToHash160(const string& str, uint160& hash160Ret)
{
return AddressToHash160(str.c_str(), hash160Ret);
}
inline bool IsValidBitcoinAddress(const char* psz)
{
uint160 hash160;
return AddressToHash160(psz, hash160);
}
inline bool IsValidBitcoinAddress(const string& str)
{
return IsValidBitcoinAddress(str.c_str());
}
inline string PubKeyToAddress(const vector<unsigned char>& vchPubKey)
{
return Hash160ToAddress(Hash160(vchPubKey));
}
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
//
// Why base-58 instead of standard base-64 encoding?
// - Don't want 0OIl characters that look the same in some fonts and
// could be used to create visually identical looking account numbers.
// - A string with non-alphanumeric characters is not as easily accepted as an account number.
// - E-mail usually won't line-break if there's no punctuation to break at.
// - Doubleclicking selects the whole number as one word if it's all alphanumeric.
//
static const char* pszBase58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
inline string EncodeBase58(const unsigned char* pbegin, const unsigned char* pend)
{
CAutoBN_CTX pctx;
CBigNum bn58 = 58;
CBigNum bn0 = 0;
// Convert big endian data to little endian
// Extra zero at the end make sure bignum will interpret as a positive number
vector<unsigned char> vchTmp(pend-pbegin+1, 0);
reverse_copy(pbegin, pend, vchTmp.begin());
// Convert little endian data to bignum
CBigNum bn;
bn.setvch(vchTmp);
// Convert bignum to string
string str;
str.reserve((pend - pbegin) * 138 / 100 + 1);
CBigNum dv;
CBigNum rem;
while (bn > bn0)
{
if (!BN_div(&dv, &rem, &bn, &bn58, pctx))
throw bignum_error("EncodeBase58 : BN_div failed");
bn = dv;
unsigned int c = rem.getulong();
str += pszBase58[c];
}
// Leading zeroes encoded as base58 zeros
for (const unsigned char* p = pbegin; p < pend && *p == 0; p++)
str += pszBase58[0];
// Convert little endian string to big endian
reverse(str.begin(), str.end());
return str;
}
inline string EncodeBase58(const vector<unsigned char>& vch)
{
return EncodeBase58(&vch[0], &vch[0] + vch.size());
}
inline bool DecodeBase58(const char* psz, vector<unsigned char>& vchRet)
{
CAutoBN_CTX pctx;
vchRet.clear();
CBigNum bn58 = 58;
CBigNum bn = 0;
CBigNum bnChar;
while (isspace(*psz))
psz++;
// Convert big endian string to bignum
for (const char* p = psz; *p; p++)
{
const char* p1 = strchr(pszBase58, *p);
if (p1 == NULL)
{
while (isspace(*p))
p++;
if (*p != '\0')
return false;
break;
}
bnChar.setulong(p1 - pszBase58);
if (!BN_mul(&bn, &bn, &bn58, pctx))
throw bignum_error("DecodeBase58 : BN_mul failed");
bn += bnChar;
}
// Get bignum as little endian data
vector<unsigned char> vchTmp = bn.getvch();
// Trim off sign byte if present
if (vchTmp.size() >= 2 && vchTmp.end()[-1] == 0 && vchTmp.end()[-2] >= 0x80)
vchTmp.erase(vchTmp.end()-1);
// Restore leading zeros
int nLeadingZeros = 0;
for (const char* p = psz; *p == pszBase58[0]; p++)
nLeadingZeros++;
vchRet.assign(nLeadingZeros + vchTmp.size(), 0);
// Convert little endian data to big endian
reverse_copy(vchTmp.begin(), vchTmp.end(), vchRet.end() - vchTmp.size());
return true;
}
inline bool DecodeBase58(const string& str, vector<unsigned char>& vchRet)
{
return DecodeBase58(str.c_str(), vchRet);
}
inline string EncodeBase58Check(const vector<unsigned char>& vchIn)
{
// add 4-byte hash check to the end
vector<unsigned char> vch(vchIn);
uint256 hash = Hash(vch.begin(), vch.end());
vch.insert(vch.end(), (unsigned char*)&hash, (unsigned char*)&hash + 4);
return EncodeBase58(vch);
}
inline bool DecodeBase58Check(const char* psz, vector<unsigned char>& vchRet)
{
if (!DecodeBase58(psz, vchRet))
return false;
if (vchRet.size() < 4)
{
vchRet.clear();
return false;
}
uint256 hash = Hash(vchRet.begin(), vchRet.end()-4);
if (memcmp(&hash, &vchRet.end()[-4], 4) != 0)
{
vchRet.clear();
return false;
}
vchRet.resize(vchRet.size()-4);
return true;
}
inline bool DecodeBase58Check(const string& str, vector<unsigned char>& vchRet)
{
return DecodeBase58Check(str.c_str(), vchRet);
}
static const unsigned char ADDRESSVERSION = 0;
inline string Hash160ToAddress(uint160 hash160)
{
// add 1-byte version number to the front
vector<unsigned char> vch(1, ADDRESSVERSION);
vch.insert(vch.end(), UBEGIN(hash160), UEND(hash160));
return EncodeBase58Check(vch);
}
inline bool AddressToHash160(const char* psz, uint160& hash160Ret)
{
vector<unsigned char> vch;
if (!DecodeBase58Check(psz, vch))
return false;
if (vch.empty())
return false;
unsigned char nVersion = vch[0];
if (vch.size() != sizeof(hash160Ret) + 1)
return false;
memcpy(&hash160Ret, &vch[1], sizeof(hash160Ret));
return (nVersion <= ADDRESSVERSION);
}
inline bool AddressToHash160(const string& str, uint160& hash160Ret)
{
return AddressToHash160(str.c_str(), hash160Ret);
}
inline bool IsValidBitcoinAddress(const char* psz)
{
uint160 hash160;
return AddressToHash160(psz, hash160);
}
inline bool IsValidBitcoinAddress(const string& str)
{
return IsValidBitcoinAddress(str.c_str());
}
inline string PubKeyToAddress(const vector<unsigned char>& vchPubKey)
{
return Hash160ToAddress(Hash160(vchPubKey));
}

1050
bignum.h

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +1,2 @@
Known bugs:
Known bugs:
- Window flickers when blocks are added (problem with repainting?)

View File

@ -1,114 +1,114 @@
Copyright (c) 2009-2010 Satoshi Nakamoto
Distributed under the MIT/X11 software license, see the accompanying
file license.txt or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in
the OpenSSL Toolkit (http://www.openssl.org/). This product includes
cryptographic software written by Eric Young (eay@cryptsoft.com).
WINDOWS BUILD NOTES
===================
Compilers Supported
-------------------
MinGW GCC (recommended)
MSVC 6.0 SP6: You'll need Boost version 1.34 because they dropped support
for MSVC 6.0 after that. However, they didn't add Asio until 1.35.
You should still be able to build with MSVC 6.0 by adding Asio to 1.34 by
unpacking boost_asio_*.zip into the boost directory:
http://sourceforge.net/projects/asio/files/asio
MSVC 8.0 (2005) SP1 has been tested. Note: MSVC 7.0 and up have a habit of
linking to runtime DLLs that are not installed on XP by default.
Dependencies
------------
Libraries you need to download separately and build:
default path download
wxWidgets-2.9 \wxwidgets http://www.wxwidgets.org/downloads/
OpenSSL \openssl http://www.openssl.org/source/
Berkeley DB \db http://www.oracle.com/technology/software/products/berkeley-db/index.html
Boost \boost http://www.boost.org/users/download/
Their licenses:
wxWidgets LGPL 2.1 with very liberal exceptions
OpenSSL Old BSD license with the problematic advertising requirement
Berkeley DB New BSD license with additional requirement that linked software must be free open source
Boost MIT-like license
Versions used in this release:
MinGW GCC 3.4.5
wxWidgets 2.9.0
OpenSSL 0.9.8k
Berkeley DB 4.7.25.NC
Boost 1.42.1
Notes
-----
The UI layout is edited with wxFormBuilder. The project file is
uiproject.fbp. It generates uibase.cpp and uibase.h, which define base
classes that do the rote work of constructing all the UI elements.
The release is built with GCC and then "strip bitcoin.exe" to strip the debug
symbols, which reduces the executable size by about 90%.
wxWidgets
---------
cd \wxwidgets\build\msw
make -f makefile.gcc
or
nmake -f makefile.vc
OpenSSL
-------
Bitcoin does not use any encryption. If you want to do a no-everything
build of OpenSSL to exclude encryption routines, a few patches are required.
(instructions for OpenSSL v0.9.8k)
Edit engines\e_gmp.c and engines\e_capi.c and add this #ifndef around
the openssl/rsa.h include:
#ifndef OPENSSL_NO_RSA
#include <openssl/rsa.h>
#endif
Edit ms\mingw32.bat and replace the Configure line's parameters with this
no-everything list. You have to put this in the batch file because batch
files can't take more than nine command line parameters.
perl Configure mingw threads no-rc2 no-rc4 no-rc5 no-idea no-des no-bf no-cast no-aes no-camellia no-seed no-rsa no-dh
Also REM out the following line in ms\mingw32.bat after the mingw32-make
line. The build fails after it's already finished building libeay32, which
is all we care about, but the failure aborts the script before it runs
dllwrap to generate libeay32.dll.
REM if errorlevel 1 goto end
Build
cd \openssl
ms\mingw32.bat
If you want to use it with MSVC, generate the .lib file
lib /machine:i386 /def:ms\libeay32.def /out:out\libeay32.lib
Berkeley DB
-----------
Using MinGW and MSYS:
cd \db\build_unix
sh ../dist/configure --enable-mingw --enable-cxx
make
Boost
-----
download bjam.exe from
http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=72941
cd \boost
bjam toolset=gcc --build-type=complete stage
or
bjam toolset=msvc --build-type=complete stage
Copyright (c) 2009-2010 Satoshi Nakamoto
Distributed under the MIT/X11 software license, see the accompanying
file license.txt or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in
the OpenSSL Toolkit (http://www.openssl.org/). This product includes
cryptographic software written by Eric Young (eay@cryptsoft.com).
WINDOWS BUILD NOTES
===================
Compilers Supported
-------------------
MinGW GCC (recommended)
MSVC 6.0 SP6: You'll need Boost version 1.34 because they dropped support
for MSVC 6.0 after that. However, they didn't add Asio until 1.35.
You should still be able to build with MSVC 6.0 by adding Asio to 1.34 by
unpacking boost_asio_*.zip into the boost directory:
http://sourceforge.net/projects/asio/files/asio
MSVC 8.0 (2005) SP1 has been tested. Note: MSVC 7.0 and up have a habit of
linking to runtime DLLs that are not installed on XP by default.
Dependencies
------------
Libraries you need to download separately and build:
default path download
wxWidgets-2.9 \wxwidgets http://www.wxwidgets.org/downloads/
OpenSSL \openssl http://www.openssl.org/source/
Berkeley DB \db http://www.oracle.com/technology/software/products/berkeley-db/index.html
Boost \boost http://www.boost.org/users/download/
Their licenses:
wxWidgets LGPL 2.1 with very liberal exceptions
OpenSSL Old BSD license with the problematic advertising requirement
Berkeley DB New BSD license with additional requirement that linked software must be free open source
Boost MIT-like license
Versions used in this release:
MinGW GCC 3.4.5
wxWidgets 2.9.0
OpenSSL 0.9.8k
Berkeley DB 4.7.25.NC
Boost 1.42.1
Notes
-----
The UI layout is edited with wxFormBuilder. The project file is
uiproject.fbp. It generates uibase.cpp and uibase.h, which define base
classes that do the rote work of constructing all the UI elements.
The release is built with GCC and then "strip bitcoin.exe" to strip the debug
symbols, which reduces the executable size by about 90%.
wxWidgets
---------
cd \wxwidgets\build\msw
make -f makefile.gcc
or
nmake -f makefile.vc
OpenSSL
-------
Bitcoin does not use any encryption. If you want to do a no-everything
build of OpenSSL to exclude encryption routines, a few patches are required.
(instructions for OpenSSL v0.9.8k)
Edit engines\e_gmp.c and engines\e_capi.c and add this #ifndef around
the openssl/rsa.h include:
#ifndef OPENSSL_NO_RSA
#include <openssl/rsa.h>
#endif
Edit ms\mingw32.bat and replace the Configure line's parameters with this
no-everything list. You have to put this in the batch file because batch
files can't take more than nine command line parameters.
perl Configure mingw threads no-rc2 no-rc4 no-rc5 no-idea no-des no-bf no-cast no-aes no-camellia no-seed no-rsa no-dh
Also REM out the following line in ms\mingw32.bat after the mingw32-make
line. The build fails after it's already finished building libeay32, which
is all we care about, but the failure aborts the script before it runs
dllwrap to generate libeay32.dll.
REM if errorlevel 1 goto end
Build
cd \openssl
ms\mingw32.bat
If you want to use it with MSVC, generate the .lib file
lib /machine:i386 /def:ms\libeay32.def /out:out\libeay32.lib
Berkeley DB
-----------
Using MinGW and MSYS:
cd \db\build_unix
sh ../dist/configure --enable-mingw --enable-cxx
make
Boost
-----
download bjam.exe from
http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=72941
cd \boost
bjam toolset=gcc --build-type=complete stage
or
bjam toolset=msvc --build-type=complete stage

View File

@ -1,217 +1,217 @@
Copyright (c) 2009-2010 Satoshi Nakamoto
Distributed under the MIT/X11 software license, see the accompanying
file license.txt or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in
the OpenSSL Toolkit (http://www.openssl.org/). This product includes
cryptographic software written by Eric Young (eay@cryptsoft.com).
Mac OS X build instructions
Laszlo Hanyecz (solar@heliacal.net)
Tested on 10.5 and 10.6 intel. PPC is not supported because it's big-endian.
All of the commands should be executed in Terminal.app.. it's in
/Applications/Utilities
You need to install XCode with all the options checked so that the compiler
and everything is available in /usr not just /Developer
I think it comes on the DVD but you can get the current version from
http://developer.apple.com
1. Pick a directory to work inside.. something like ~/bitcoin works. The
structure I use looks like this:
(~ is your home directory)
~/bitcoin
~/bitcoin/trunk # source code
~/bitcoin/deps # dependencies.. like libraries and headers needed to compile
~/bitcoin/Bitcoin.app # the application bundle where you can run the app
Just execute: mkdir ~/bitcoin
This will create the top dir for you..
WARNING: do not use the ~ notation with the configure scripts.. use the full
name of the directory, for example /Users/james/bitcoin/deps for a user named
'james'. In my examples I am using 'macosuser' so make sure you change that.
2. Check out the trunk version of the bitcoin code from subversion:
cd ~/bitcoin
svn checkout https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk
This will make ~/bitcoin/trunk for you with all the files from subversion.
3. Get and build the dependencies
Boost
-----
Download from http://www.boost.org/users/download/
I'm assuming it ended up in ~/Downloads..
mkdir ~/bitcoin/deps
cd ~/bitcoin/deps
tar xvjf ~/Downloads/boost_1_42_0.tar.bz2
cd boost_1_42_0
./bootstrap.sh
./bjam architecture=combined address-model=32_64 macosx-version=10.6 macosx-version-min=10.5 link=static runtime-link=static --toolset=darwin --prefix=/Users/macosuser/bitcoin/deps install
This part takes a while.. use your judgement and fix it if something doesn't
build for some reason.
Change the prefix to whatever your directory is (my username in this example
is macosuser). I'm also running on 10.6 so i have macosx-version=10.6 change
to 10.5 if you're using leopard.
This is what my output looked like at the end:
...failed updating 2 targets...
...skipped 144 targets...
...updated 8074 targets...
OpenSSL
-------
Download from http://www.openssl.org/source/
We would like to build this as a 32 bit/64 bit library so we actually build it
2 times and join it together here.. If you downloaded with safari it already
uncompressed it so it will just be a tar not a tar.gz
cd ~/bitcoin/deps
tar xvf ~/Downloads/openssl-1.0.0.tar
mv openssl-1.0.0 openssl-1.0.0-i386
tar xvf ~/Downloads/openssl-1.0.0.tar
mv openssl-1.0.0 openssl-1.0.0-x86_64
# build i386 (32 bit intel) binary
cd openssl-1.0.0-i386
./Configure --prefix=/Users/macosuser/bitcoin/deps --openssldir=/Users/macosuser/deps/openssl darwin-i386-cc && make
make install # only do this on one of the architectures, to install the headers
cd ..
# build x86_64 (64 bit intel) binary
cd openssl-1.0.0-x86_64
./Configure --prefix=/Users/macosuser/bitcoin/deps --openssldir=/Users/macosuser/deps/openssl darwin64-x86_64-cc && make
cd ..
# combine the libs
cd ~/bitcoin/deps
lipo -arch i386 openssl-1.0.0-i386/libcrypto.a -arch x86_64 openssl-1.0.0-x86_64/libcrypto.a -o lib/libcrypto.a -create
lipo -arch i386 openssl-1.0.0-i386/libssl.a -arch x86_64 openssl-1.0.0-x86_64/libssl.a -o lib/libssl.a -create
Verify your binaries
file lib/libcrypto.a
output should look like this:
ib/libcrypto.a: Mach-O universal binary with 2 architectures
lib/libcrypto.a (for architecture i386): current ar archive random library
lib/libcrypto.a (for architecture x86_64): current ar archive random library
Berkeley DB
-----------
Download from http://freshmeat.net/projects/berkeleydb/
cd ~/bitcoin/deps
tar xvf ~/Downloads/db-4.8.26.tar
cd db-4.8.26/build_unix
../dist/configure --prefix=/Users/macosuser/bitcoin/deps --enable-cxx && make && make install
wxWidgets
---------
This is the big one..
Check it out from svn
cd ~/bitcoin/deps
svn checkout http://svn.wxwidgets.org/svn/wx/wxWidgets/trunk wxWidgets-trunk
This will make a wxWidgets-trunk directory in deps.
Use this script snippet, change your prefix to whatever your dir is:
PREFIX=~/bitcoin/deps
SRCDIR="$PREFIX/wxWidgets-trunk"
BUILDDIR="$SRCDIR/macbuild"
cd "$PREFIX" &&
#svn checkout http://svn.wxwidgets.org/svn/wx/wxWidgets/trunk wxWidgets-trunk &&
cd "$SRCDIR" &&
[ -f include/wx/hashmap.h.orig ] || cp include/wx/hashmap.h include/wx/hashmap.h.orig &&
sed 's/if wxUSE_STL/if 0 \&\& wxUSE_STL/g' < include/wx/hashmap.h.orig > include/wx/hashmap.h &&
[ -f include/wx/hashset.h.orig ] || cp include/wx/hashset.h include/wx/hashset.h.orig &&
sed 's/if wxUSE_STL/if 0 \&\& wxUSE_STL/g' < include/wx/hashset.h.orig > include/wx/hashset.h &&
rm -vrf "$BUILDDIR" &&
mkdir "$BUILDDIR" &&
cd "$BUILDDIR" &&
../configure --prefix="$PREFIX" \
--with-osx_cocoa \
--disable-shared \
--disable-debug_flag \
--with-macosx-version-min=10.5 \
--enable-stl \
--enable-utf8 \
--enable-universal_binary \
--with-libjpeg=builtin \
--with-libpng=builtin \
--with-regex=builtin \
--with-libtiff=builtin \
--with-zlib=builtin \
--with-expat=builtin \
--with-macosx-sdk=/Developer/SDKs/MacOSX10.5.sdk &&
find . -name Makefile |
while read i; do
echo $i;
sed 's/-arch i386/-arch i386 -arch x86_64/g' < "$i" > "$i".new &&
mv "$i" "$i".old &&
mv "$i".new "$i";
done
make &&
make install
Now you should be able to build bitcoin
cd ~/bitcoin/trunk
make -f makefile.osx bitcoin
Before you can run it, you need to create an application bundle for Mac OS.
Create the directories in terminal using mkdir and copy the files into place.
They are available at http://heliacal.net/~solar/bitcoin/mac-build/
You need the Info.plist and the .ins file. The Contents/MacOS/bitcoin file is
the output of the build.
Your directory structure should look like this:
Bitcoin.app
Bitcoin.app/Contents
Bitcoin.app/Contents/Info.plist
Bitcoin.app/Contents/MacOS
Bitcoin.app/Contents/MacOS/bitcoin
Bitcoin.app/Contents/Resources
Bitcoin.app/Contents/Resources/BitcoinAppIcon.icns
To run it you can just click the Bitcoin.app in Finder, or just do open
~/bitcoin/Bitcoin.app
If you want to run it with arguments you can just run it without backgrounding
by specifying the full name in terminal:
~/bitcoin/Bitcoin.app/Contents/MacOS/bitcoin -addnode=192.75.207.66
Copyright (c) 2009-2010 Satoshi Nakamoto
Distributed under the MIT/X11 software license, see the accompanying
file license.txt or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in
the OpenSSL Toolkit (http://www.openssl.org/). This product includes
cryptographic software written by Eric Young (eay@cryptsoft.com).
Mac OS X build instructions
Laszlo Hanyecz (solar@heliacal.net)
Tested on 10.5 and 10.6 intel. PPC is not supported because it's big-endian.
All of the commands should be executed in Terminal.app.. it's in
/Applications/Utilities
You need to install XCode with all the options checked so that the compiler
and everything is available in /usr not just /Developer
I think it comes on the DVD but you can get the current version from
http://developer.apple.com
1. Pick a directory to work inside.. something like ~/bitcoin works. The
structure I use looks like this:
(~ is your home directory)
~/bitcoin
~/bitcoin/trunk # source code
~/bitcoin/deps # dependencies.. like libraries and headers needed to compile
~/bitcoin/Bitcoin.app # the application bundle where you can run the app
Just execute: mkdir ~/bitcoin
This will create the top dir for you..
WARNING: do not use the ~ notation with the configure scripts.. use the full
name of the directory, for example /Users/james/bitcoin/deps for a user named
'james'. In my examples I am using 'macosuser' so make sure you change that.
2. Check out the trunk version of the bitcoin code from subversion:
cd ~/bitcoin
svn checkout https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk
This will make ~/bitcoin/trunk for you with all the files from subversion.
3. Get and build the dependencies
Boost
-----
Download from http://www.boost.org/users/download/
I'm assuming it ended up in ~/Downloads..
mkdir ~/bitcoin/deps
cd ~/bitcoin/deps
tar xvjf ~/Downloads/boost_1_42_0.tar.bz2
cd boost_1_42_0
./bootstrap.sh
./bjam architecture=combined address-model=32_64 macosx-version=10.6 macosx-version-min=10.5 link=static runtime-link=static --toolset=darwin --prefix=/Users/macosuser/bitcoin/deps install
This part takes a while.. use your judgement and fix it if something doesn't
build for some reason.
Change the prefix to whatever your directory is (my username in this example
is macosuser). I'm also running on 10.6 so i have macosx-version=10.6 change
to 10.5 if you're using leopard.
This is what my output looked like at the end:
...failed updating 2 targets...
...skipped 144 targets...
...updated 8074 targets...
OpenSSL
-------
Download from http://www.openssl.org/source/
We would like to build this as a 32 bit/64 bit library so we actually build it
2 times and join it together here.. If you downloaded with safari it already
uncompressed it so it will just be a tar not a tar.gz
cd ~/bitcoin/deps
tar xvf ~/Downloads/openssl-1.0.0.tar
mv openssl-1.0.0 openssl-1.0.0-i386
tar xvf ~/Downloads/openssl-1.0.0.tar
mv openssl-1.0.0 openssl-1.0.0-x86_64
# build i386 (32 bit intel) binary
cd openssl-1.0.0-i386
./Configure --prefix=/Users/macosuser/bitcoin/deps --openssldir=/Users/macosuser/deps/openssl darwin-i386-cc && make
make install # only do this on one of the architectures, to install the headers
cd ..
# build x86_64 (64 bit intel) binary
cd openssl-1.0.0-x86_64
./Configure --prefix=/Users/macosuser/bitcoin/deps --openssldir=/Users/macosuser/deps/openssl darwin64-x86_64-cc && make
cd ..
# combine the libs
cd ~/bitcoin/deps
lipo -arch i386 openssl-1.0.0-i386/libcrypto.a -arch x86_64 openssl-1.0.0-x86_64/libcrypto.a -o lib/libcrypto.a -create
lipo -arch i386 openssl-1.0.0-i386/libssl.a -arch x86_64 openssl-1.0.0-x86_64/libssl.a -o lib/libssl.a -create
Verify your binaries
file lib/libcrypto.a
output should look like this:
ib/libcrypto.a: Mach-O universal binary with 2 architectures
lib/libcrypto.a (for architecture i386): current ar archive random library
lib/libcrypto.a (for architecture x86_64): current ar archive random library
Berkeley DB
-----------
Download from http://freshmeat.net/projects/berkeleydb/
cd ~/bitcoin/deps
tar xvf ~/Downloads/db-4.8.26.tar
cd db-4.8.26/build_unix
../dist/configure --prefix=/Users/macosuser/bitcoin/deps --enable-cxx && make && make install
wxWidgets
---------
This is the big one..
Check it out from svn
cd ~/bitcoin/deps
svn checkout http://svn.wxwidgets.org/svn/wx/wxWidgets/trunk wxWidgets-trunk
This will make a wxWidgets-trunk directory in deps.
Use this script snippet, change your prefix to whatever your dir is:
PREFIX=~/bitcoin/deps
SRCDIR="$PREFIX/wxWidgets-trunk"
BUILDDIR="$SRCDIR/macbuild"
cd "$PREFIX" &&
#svn checkout http://svn.wxwidgets.org/svn/wx/wxWidgets/trunk wxWidgets-trunk &&
cd "$SRCDIR" &&
[ -f include/wx/hashmap.h.orig ] || cp include/wx/hashmap.h include/wx/hashmap.h.orig &&
sed 's/if wxUSE_STL/if 0 \&\& wxUSE_STL/g' < include/wx/hashmap.h.orig > include/wx/hashmap.h &&
[ -f include/wx/hashset.h.orig ] || cp include/wx/hashset.h include/wx/hashset.h.orig &&
sed 's/if wxUSE_STL/if 0 \&\& wxUSE_STL/g' < include/wx/hashset.h.orig > include/wx/hashset.h &&
rm -vrf "$BUILDDIR" &&
mkdir "$BUILDDIR" &&
cd "$BUILDDIR" &&
../configure --prefix="$PREFIX" \
--with-osx_cocoa \
--disable-shared \
--disable-debug_flag \
--with-macosx-version-min=10.5 \
--enable-stl \
--enable-utf8 \
--enable-universal_binary \
--with-libjpeg=builtin \
--with-libpng=builtin \
--with-regex=builtin \
--with-libtiff=builtin \
--with-zlib=builtin \
--with-expat=builtin \
--with-macosx-sdk=/Developer/SDKs/MacOSX10.5.sdk &&
find . -name Makefile |
while read i; do
echo $i;
sed 's/-arch i386/-arch i386 -arch x86_64/g' < "$i" > "$i".new &&
mv "$i" "$i".old &&
mv "$i".new "$i";
done
make &&
make install
Now you should be able to build bitcoin
cd ~/bitcoin/trunk
make -f makefile.osx bitcoin
Before you can run it, you need to create an application bundle for Mac OS.
Create the directories in terminal using mkdir and copy the files into place.
They are available at http://heliacal.net/~solar/bitcoin/mac-build/
You need the Info.plist and the .ins file. The Contents/MacOS/bitcoin file is
the output of the build.
Your directory structure should look like this:
Bitcoin.app
Bitcoin.app/Contents
Bitcoin.app/Contents/Info.plist
Bitcoin.app/Contents/MacOS
Bitcoin.app/Contents/MacOS/bitcoin
Bitcoin.app/Contents/Resources
Bitcoin.app/Contents/Resources/BitcoinAppIcon.icns
To run it you can just click the Bitcoin.app in Finder, or just do open
~/bitcoin/Bitcoin.app
If you want to run it with arguments you can just run it without backgrounding
by specifying the full name in terminal:
~/bitcoin/Bitcoin.app/Contents/MacOS/bitcoin -addnode=192.75.207.66

View File

@ -1,83 +1,83 @@
Copyright (c) 2009-2010 Satoshi Nakamoto
Distributed under the MIT/X11 software license, see the accompanying
file license.txt or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in
the OpenSSL Toolkit (http://www.openssl.org/). This product includes
cryptographic software written by Eric Young (eay@cryptsoft.com).
UNIX BUILD NOTES
================
Dependencies
------------
sudo apt-get install build-essential
sudo apt-get install libgtk2.0-dev
sudo apt-get install libssl-dev
sudo apt-get install libdb4.7-dev
sudo apt-get install libdb4.7++-dev
sudo apt-get install libboost-all-dev
We're now using wxWidgets 2.9, which uses UTF-8.
There isn't currently a debian package of wxWidgets we can use. The 2.8
packages for Karmic are UTF-16 unicode and won't work for us, and we've had
trouble building 2.8 on 64-bit.
You need to download wxWidgets from http://www.wxwidgets.org/downloads/
and build it yourself. See the build instructions and configure parameters
below.
Licenses of statically linked libraries:
wxWidgets LGPL 2.1 with very liberal exceptions
Berkeley DB New BSD license with additional requirement that linked software must be free open source
Boost MIT-like license
Versions used in this release:
GCC 4.4.3
OpenSSL 0.9.8k
wxWidgets 2.9.0
Berkeley DB 4.7.25.NC
Boost 1.40.0
Notes
-----
The UI layout is edited with wxFormBuilder. The project file is
uiproject.fbp. It generates uibase.cpp and uibase.h, which define base
classes that do the rote work of constructing all the UI elements.
The release is built with GCC and then "strip bitcoin" to strip the debug
symbols, which reduces the executable size by about 90%.
wxWidgets
---------
cd /usr/local
tar -xzvf wxWidgets-2.9.0.tar.gz
cd /usr/local/wxWidgets-2.9.0
mkdir buildgtk
cd buildgtk
../configure --with-gtk --enable-debug --disable-shared --enable-monolithic
make
sudo su
make install
ldconfig
su <username>
cd ..
mkdir buildbase
cd buildbase
../configure --disable-gui --enable-debug --disable-shared --enable-monolithic
make
sudo su
make install
ldconfig
Boost
-----
If you want to build Boost yourself,
cd /usr/local/boost_1_40_0
su
./bootstrap.sh
./bjam install
Copyright (c) 2009-2010 Satoshi Nakamoto
Distributed under the MIT/X11 software license, see the accompanying
file license.txt or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in
the OpenSSL Toolkit (http://www.openssl.org/). This product includes
cryptographic software written by Eric Young (eay@cryptsoft.com).
UNIX BUILD NOTES
================
Dependencies
------------
sudo apt-get install build-essential
sudo apt-get install libgtk2.0-dev
sudo apt-get install libssl-dev
sudo apt-get install libdb4.7-dev
sudo apt-get install libdb4.7++-dev
sudo apt-get install libboost-all-dev
We're now using wxWidgets 2.9, which uses UTF-8.
There isn't currently a debian package of wxWidgets we can use. The 2.8
packages for Karmic are UTF-16 unicode and won't work for us, and we've had
trouble building 2.8 on 64-bit.
You need to download wxWidgets from http://www.wxwidgets.org/downloads/
and build it yourself. See the build instructions and configure parameters
below.
Licenses of statically linked libraries:
wxWidgets LGPL 2.1 with very liberal exceptions
Berkeley DB New BSD license with additional requirement that linked software must be free open source
Boost MIT-like license
Versions used in this release:
GCC 4.4.3
OpenSSL 0.9.8k
wxWidgets 2.9.0
Berkeley DB 4.7.25.NC
Boost 1.40.0
Notes
-----
The UI layout is edited with wxFormBuilder. The project file is
uiproject.fbp. It generates uibase.cpp and uibase.h, which define base
classes that do the rote work of constructing all the UI elements.
The release is built with GCC and then "strip bitcoin" to strip the debug
symbols, which reduces the executable size by about 90%.
wxWidgets
---------
cd /usr/local
tar -xzvf wxWidgets-2.9.0.tar.gz
cd /usr/local/wxWidgets-2.9.0
mkdir buildgtk
cd buildgtk
../configure --with-gtk --enable-debug --disable-shared --enable-monolithic
make
sudo su
make install
ldconfig
su <username>
cd ..
mkdir buildbase
cd buildbase
../configure --disable-gui --enable-debug --disable-shared --enable-monolithic
make
sudo su
make install
ldconfig
Boost
-----
If you want to build Boost yourself,
cd /usr/local/boost_1_40_0
su
./bootstrap.sh
./bjam install

1474
db.cpp

File diff suppressed because it is too large Load Diff

808
db.h
View File

@ -1,404 +1,404 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
class CTransaction;
class CTxIndex;
class CDiskBlockIndex;
class CDiskTxPos;
class COutPoint;
class CUser;
class CReview;
class CAddress;
class CWalletTx;
extern map<string, string> mapAddressBook;
extern CCriticalSection cs_mapAddressBook;
extern vector<unsigned char> vchDefaultKey;
extern bool fClient;
extern unsigned int nWalletDBUpdated;
extern DbEnv dbenv;
extern void DBFlush(bool fShutdown);
class CDB
{
protected:
Db* pdb;
string strFile;
vector<DbTxn*> vTxn;
bool fReadOnly;
explicit CDB(const char* pszFile, const char* pszMode="r+");
~CDB() { Close(); }
public:
void Close();
private:
CDB(const CDB&);
void operator=(const CDB&);
protected:
template<typename K, typename T>
bool Read(const K& key, T& value)
{
if (!pdb)
return false;
// Key
CDataStream ssKey(SER_DISK);
ssKey.reserve(1000);
ssKey << key;
Dbt datKey(&ssKey[0], ssKey.size());
// Read
Dbt datValue;
datValue.set_flags(DB_DBT_MALLOC);
int ret = pdb->get(GetTxn(), &datKey, &datValue, 0);
memset(datKey.get_data(), 0, datKey.get_size());
if (datValue.get_data() == NULL)
return false;
// Unserialize value
CDataStream ssValue((char*)datValue.get_data(), (char*)datValue.get_data() + datValue.get_size(), SER_DISK);
ssValue >> value;
// Clear and free memory
memset(datValue.get_data(), 0, datValue.get_size());
free(datValue.get_data());
return (ret == 0);
}
template<typename K, typename T>
bool Write(const K& key, const T& value, bool fOverwrite=true)
{
if (!pdb)
return false;
if (fReadOnly)
assert(("Write called on database in read-only mode", false));
// Key
CDataStream ssKey(SER_DISK);
ssKey.reserve(1000);
ssKey << key;
Dbt datKey(&ssKey[0], ssKey.size());
// Value
CDataStream ssValue(SER_DISK);
ssValue.reserve(10000);
ssValue << value;
Dbt datValue(&ssValue[0], ssValue.size());
// Write
int ret = pdb->put(GetTxn(), &datKey, &datValue, (fOverwrite ? 0 : DB_NOOVERWRITE));
// Clear memory in case it was a private key
memset(datKey.get_data(), 0, datKey.get_size());
memset(datValue.get_data(), 0, datValue.get_size());
return (ret == 0);
}
template<typename K>
bool Erase(const K& key)
{
if (!pdb)
return false;
if (fReadOnly)
assert(("Erase called on database in read-only mode", false));
// Key
CDataStream ssKey(SER_DISK);
ssKey.reserve(1000);
ssKey << key;
Dbt datKey(&ssKey[0], ssKey.size());
// Erase
int ret = pdb->del(GetTxn(), &datKey, 0);
// Clear memory
memset(datKey.get_data(), 0, datKey.get_size());
return (ret == 0 || ret == DB_NOTFOUND);
}
template<typename K>
bool Exists(const K& key)
{
if (!pdb)
return false;
// Key
CDataStream ssKey(SER_DISK);
ssKey.reserve(1000);
ssKey << key;
Dbt datKey(&ssKey[0], ssKey.size());
// Exists
int ret = pdb->exists(GetTxn(), &datKey, 0);
// Clear memory
memset(datKey.get_data(), 0, datKey.get_size());
return (ret == 0);
}
Dbc* GetCursor()
{
if (!pdb)
return NULL;
Dbc* pcursor = NULL;
int ret = pdb->cursor(NULL, &pcursor, 0);
if (ret != 0)
return NULL;
return pcursor;
}
int ReadAtCursor(Dbc* pcursor, CDataStream& ssKey, CDataStream& ssValue, unsigned int fFlags=DB_NEXT)
{
// Read at cursor
Dbt datKey;
if (fFlags == DB_SET || fFlags == DB_SET_RANGE || fFlags == DB_GET_BOTH || fFlags == DB_GET_BOTH_RANGE)
{
datKey.set_data(&ssKey[0]);
datKey.set_size(ssKey.size());
}
Dbt datValue;
if (fFlags == DB_GET_BOTH || fFlags == DB_GET_BOTH_RANGE)
{
datValue.set_data(&ssValue[0]);
datValue.set_size(ssValue.size());
}
datKey.set_flags(DB_DBT_MALLOC);
datValue.set_flags(DB_DBT_MALLOC);
int ret = pcursor->get(&datKey, &datValue, fFlags);
if (ret != 0)
return ret;
else if (datKey.get_data() == NULL || datValue.get_data() == NULL)
return 99999;
// Convert to streams
ssKey.SetType(SER_DISK);
ssKey.clear();
ssKey.write((char*)datKey.get_data(), datKey.get_size());
ssValue.SetType(SER_DISK);
ssValue.clear();
ssValue.write((char*)datValue.get_data(), datValue.get_size());
// Clear and free memory
memset(datKey.get_data(), 0, datKey.get_size());
memset(datValue.get_data(), 0, datValue.get_size());
free(datKey.get_data());
free(datValue.get_data());
return 0;
}
DbTxn* GetTxn()
{
if (!vTxn.empty())
return vTxn.back();
else
return NULL;
}
public:
bool TxnBegin()
{
if (!pdb)
return false;
DbTxn* ptxn = NULL;
int ret = dbenv.txn_begin(GetTxn(), &ptxn, 0);
if (!ptxn || ret != 0)
return false;
vTxn.push_back(ptxn);
return true;
}
bool TxnCommit()
{
if (!pdb)
return false;
if (vTxn.empty())
return false;
int ret = vTxn.back()->commit(0);
vTxn.pop_back();
return (ret == 0);
}
bool TxnAbort()
{
if (!pdb)
return false;
if (vTxn.empty())
return false;
int ret = vTxn.back()->abort();
vTxn.pop_back();
return (ret == 0);
}
bool ReadVersion(int& nVersion)
{
nVersion = 0;
return Read(string("version"), nVersion);
}
bool WriteVersion(int nVersion)
{
return Write(string("version"), nVersion);
}
};
class CTxDB : public CDB
{
public:
CTxDB(const char* pszMode="r+") : CDB(!fClient ? "blkindex.dat" : NULL, pszMode) { }
private:
CTxDB(const CTxDB&);
void operator=(const CTxDB&);
public:
bool ReadTxIndex(uint256 hash, CTxIndex& txindex);
bool UpdateTxIndex(uint256 hash, const CTxIndex& txindex);
bool AddTxIndex(const CTransaction& tx, const CDiskTxPos& pos, int nHeight);
bool EraseTxIndex(const CTransaction& tx);
bool ContainsTx(uint256 hash);
bool ReadOwnerTxes(uint160 hash160, int nHeight, vector<CTransaction>& vtx);
bool ReadDiskTx(uint256 hash, CTransaction& tx, CTxIndex& txindex);
bool ReadDiskTx(uint256 hash, CTransaction& tx);
bool ReadDiskTx(COutPoint outpoint, CTransaction& tx, CTxIndex& txindex);
bool ReadDiskTx(COutPoint outpoint, CTransaction& tx);
bool WriteBlockIndex(const CDiskBlockIndex& blockindex);
bool EraseBlockIndex(uint256 hash);
bool ReadHashBestChain(uint256& hashBestChain);
bool WriteHashBestChain(uint256 hashBestChain);
bool LoadBlockIndex();
};
class CAddrDB : public CDB
{
public:
CAddrDB(const char* pszMode="r+") : CDB("addr.dat", pszMode) { }
private:
CAddrDB(const CAddrDB&);
void operator=(const CAddrDB&);
public:
bool WriteAddress(const CAddress& addr);
bool LoadAddresses();
};
bool LoadAddresses();
class CWalletDB : public CDB
{
public:
CWalletDB(const char* pszMode="r+") : CDB("wallet.dat", pszMode) { }
private:
CWalletDB(const CWalletDB&);
void operator=(const CWalletDB&);
public:
bool ReadName(const string& strAddress, string& strName)
{
strName = "";
return Read(make_pair(string("name"), strAddress), strName);
}
bool WriteName(const string& strAddress, const string& strName)
{
CRITICAL_BLOCK(cs_mapAddressBook)
mapAddressBook[strAddress] = strName;
nWalletDBUpdated++;
return Write(make_pair(string("name"), strAddress), strName);
}
bool EraseName(const string& strAddress)
{
// This should only be used for sending addresses, never for receiving addresses,
// receiving addresses must always have an address book entry if they're not change return.
CRITICAL_BLOCK(cs_mapAddressBook)
mapAddressBook.erase(strAddress);
nWalletDBUpdated++;
return Erase(make_pair(string("name"), strAddress));
}
bool ReadTx(uint256 hash, CWalletTx& wtx)
{
return Read(make_pair(string("tx"), hash), wtx);
}
bool WriteTx(uint256 hash, const CWalletTx& wtx)
{
nWalletDBUpdated++;
return Write(make_pair(string("tx"), hash), wtx);
}
bool EraseTx(uint256 hash)
{
nWalletDBUpdated++;
return Erase(make_pair(string("tx"), hash));
}
bool ReadKey(const vector<unsigned char>& vchPubKey, CPrivKey& vchPrivKey)
{
vchPrivKey.clear();
return Read(make_pair(string("key"), vchPubKey), vchPrivKey);
}
bool WriteKey(const vector<unsigned char>& vchPubKey, const CPrivKey& vchPrivKey)
{
nWalletDBUpdated++;
return Write(make_pair(string("key"), vchPubKey), vchPrivKey, false);
}
bool ReadDefaultKey(vector<unsigned char>& vchPubKey)
{
vchPubKey.clear();
return Read(string("defaultkey"), vchPubKey);
}
bool WriteDefaultKey(const vector<unsigned char>& vchPubKey)
{
vchDefaultKey = vchPubKey;
nWalletDBUpdated++;
return Write(string("defaultkey"), vchPubKey);
}
template<typename T>
bool ReadSetting(const string& strKey, T& value)
{
return Read(make_pair(string("setting"), strKey), value);
}
template<typename T>
bool WriteSetting(const string& strKey, const T& value)
{
nWalletDBUpdated++;
return Write(make_pair(string("setting"), strKey), value);
}
bool LoadWallet();
};
bool LoadWallet(bool& fFirstRunRet);
inline bool SetAddressBookName(const string& strAddress, const string& strName)
{
return CWalletDB().WriteName(strAddress, strName);
}
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
class CTransaction;
class CTxIndex;
class CDiskBlockIndex;
class CDiskTxPos;
class COutPoint;
class CUser;
class CReview;
class CAddress;
class CWalletTx;
extern map<string, string> mapAddressBook;
extern CCriticalSection cs_mapAddressBook;
extern vector<unsigned char> vchDefaultKey;
extern bool fClient;
extern unsigned int nWalletDBUpdated;
extern DbEnv dbenv;
extern void DBFlush(bool fShutdown);
class CDB
{
protected:
Db* pdb;
string strFile;
vector<DbTxn*> vTxn;
bool fReadOnly;
explicit CDB(const char* pszFile, const char* pszMode="r+");
~CDB() { Close(); }
public:
void Close();
private:
CDB(const CDB&);
void operator=(const CDB&);
protected:
template<typename K, typename T>
bool Read(const K& key, T& value)
{
if (!pdb)
return false;
// Key
CDataStream ssKey(SER_DISK);
ssKey.reserve(1000);
ssKey << key;
Dbt datKey(&ssKey[0], ssKey.size());
// Read
Dbt datValue;
datValue.set_flags(DB_DBT_MALLOC);
int ret = pdb->get(GetTxn(), &datKey, &datValue, 0);
memset(datKey.get_data(), 0, datKey.get_size());
if (datValue.get_data() == NULL)
return false;
// Unserialize value
CDataStream ssValue((char*)datValue.get_data(), (char*)datValue.get_data() + datValue.get_size(), SER_DISK);
ssValue >> value;
// Clear and free memory
memset(datValue.get_data(), 0, datValue.get_size());
free(datValue.get_data());
return (ret == 0);
}
template<typename K, typename T>
bool Write(const K& key, const T& value, bool fOverwrite=true)
{
if (!pdb)
return false;
if (fReadOnly)
assert(("Write called on database in read-only mode", false));
// Key
CDataStream ssKey(SER_DISK);
ssKey.reserve(1000);
ssKey << key;
Dbt datKey(&ssKey[0], ssKey.size());
// Value
CDataStream ssValue(SER_DISK);
ssValue.reserve(10000);
ssValue << value;
Dbt datValue(&ssValue[0], ssValue.size());
// Write
int ret = pdb->put(GetTxn(), &datKey, &datValue, (fOverwrite ? 0 : DB_NOOVERWRITE));
// Clear memory in case it was a private key
memset(datKey.get_data(), 0, datKey.get_size());
memset(datValue.get_data(), 0, datValue.get_size());
return (ret == 0);
}
template<typename K>
bool Erase(const K& key)
{
if (!pdb)
return false;
if (fReadOnly)
assert(("Erase called on database in read-only mode", false));
// Key
CDataStream ssKey(SER_DISK);
ssKey.reserve(1000);
ssKey << key;
Dbt datKey(&ssKey[0], ssKey.size());
// Erase
int ret = pdb->del(GetTxn(), &datKey, 0);
// Clear memory
memset(datKey.get_data(), 0, datKey.get_size());
return (ret == 0 || ret == DB_NOTFOUND);
}
template<typename K>
bool Exists(const K& key)
{
if (!pdb)
return false;
// Key
CDataStream ssKey(SER_DISK);
ssKey.reserve(1000);
ssKey << key;
Dbt datKey(&ssKey[0], ssKey.size());
// Exists
int ret = pdb->exists(GetTxn(), &datKey, 0);
// Clear memory
memset(datKey.get_data(), 0, datKey.get_size());
return (ret == 0);
}
Dbc* GetCursor()
{
if (!pdb)
return NULL;
Dbc* pcursor = NULL;
int ret = pdb->cursor(NULL, &pcursor, 0);
if (ret != 0)
return NULL;
return pcursor;
}
int ReadAtCursor(Dbc* pcursor, CDataStream& ssKey, CDataStream& ssValue, unsigned int fFlags=DB_NEXT)
{
// Read at cursor
Dbt datKey;
if (fFlags == DB_SET || fFlags == DB_SET_RANGE || fFlags == DB_GET_BOTH || fFlags == DB_GET_BOTH_RANGE)
{
datKey.set_data(&ssKey[0]);
datKey.set_size(ssKey.size());
}
Dbt datValue;
if (fFlags == DB_GET_BOTH || fFlags == DB_GET_BOTH_RANGE)
{
datValue.set_data(&ssValue[0]);
datValue.set_size(ssValue.size());
}
datKey.set_flags(DB_DBT_MALLOC);
datValue.set_flags(DB_DBT_MALLOC);
int ret = pcursor->get(&datKey, &datValue, fFlags);
if (ret != 0)
return ret;
else if (datKey.get_data() == NULL || datValue.get_data() == NULL)
return 99999;
// Convert to streams
ssKey.SetType(SER_DISK);
ssKey.clear();
ssKey.write((char*)datKey.get_data(), datKey.get_size());
ssValue.SetType(SER_DISK);
ssValue.clear();
ssValue.write((char*)datValue.get_data(), datValue.get_size());
// Clear and free memory
memset(datKey.get_data(), 0, datKey.get_size());
memset(datValue.get_data(), 0, datValue.get_size());
free(datKey.get_data());
free(datValue.get_data());
return 0;
}
DbTxn* GetTxn()
{
if (!vTxn.empty())
return vTxn.back();
else
return NULL;
}
public:
bool TxnBegin()
{
if (!pdb)
return false;
DbTxn* ptxn = NULL;
int ret = dbenv.txn_begin(GetTxn(), &ptxn, 0);
if (!ptxn || ret != 0)
return false;
vTxn.push_back(ptxn);
return true;
}
bool TxnCommit()
{
if (!pdb)
return false;
if (vTxn.empty())
return false;
int ret = vTxn.back()->commit(0);
vTxn.pop_back();
return (ret == 0);
}
bool TxnAbort()
{
if (!pdb)
return false;
if (vTxn.empty())
return false;
int ret = vTxn.back()->abort();
vTxn.pop_back();
return (ret == 0);
}
bool ReadVersion(int& nVersion)
{
nVersion = 0;
return Read(string("version"), nVersion);
}
bool WriteVersion(int nVersion)
{
return Write(string("version"), nVersion);
}
};
class CTxDB : public CDB
{
public:
CTxDB(const char* pszMode="r+") : CDB(!fClient ? "blkindex.dat" : NULL, pszMode) { }
private:
CTxDB(const CTxDB&);
void operator=(const CTxDB&);
public:
bool ReadTxIndex(uint256 hash, CTxIndex& txindex);
bool UpdateTxIndex(uint256 hash, const CTxIndex& txindex);
bool AddTxIndex(const CTransaction& tx, const CDiskTxPos& pos, int nHeight);
bool EraseTxIndex(const CTransaction& tx);
bool ContainsTx(uint256 hash);
bool ReadOwnerTxes(uint160 hash160, int nHeight, vector<CTransaction>& vtx);
bool ReadDiskTx(uint256 hash, CTransaction& tx, CTxIndex& txindex);
bool ReadDiskTx(uint256 hash, CTransaction& tx);
bool ReadDiskTx(COutPoint outpoint, CTransaction& tx, CTxIndex& txindex);
bool ReadDiskTx(COutPoint outpoint, CTransaction& tx);
bool WriteBlockIndex(const CDiskBlockIndex& blockindex);
bool EraseBlockIndex(uint256 hash);
bool ReadHashBestChain(uint256& hashBestChain);
bool WriteHashBestChain(uint256 hashBestChain);
bool LoadBlockIndex();
};
class CAddrDB : public CDB
{
public:
CAddrDB(const char* pszMode="r+") : CDB("addr.dat", pszMode) { }
private:
CAddrDB(const CAddrDB&);
void operator=(const CAddrDB&);
public:
bool WriteAddress(const CAddress& addr);
bool LoadAddresses();
};
bool LoadAddresses();
class CWalletDB : public CDB
{
public:
CWalletDB(const char* pszMode="r+") : CDB("wallet.dat", pszMode) { }
private:
CWalletDB(const CWalletDB&);
void operator=(const CWalletDB&);
public:
bool ReadName(const string& strAddress, string& strName)
{
strName = "";
return Read(make_pair(string("name"), strAddress), strName);
}
bool WriteName(const string& strAddress, const string& strName)
{
CRITICAL_BLOCK(cs_mapAddressBook)
mapAddressBook[strAddress] = strName;
nWalletDBUpdated++;
return Write(make_pair(string("name"), strAddress), strName);
}
bool EraseName(const string& strAddress)
{
// This should only be used for sending addresses, never for receiving addresses,
// receiving addresses must always have an address book entry if they're not change return.
CRITICAL_BLOCK(cs_mapAddressBook)
mapAddressBook.erase(strAddress);
nWalletDBUpdated++;
return Erase(make_pair(string("name"), strAddress));
}
bool ReadTx(uint256 hash, CWalletTx& wtx)
{
return Read(make_pair(string("tx"), hash), wtx);
}
bool WriteTx(uint256 hash, const CWalletTx& wtx)
{
nWalletDBUpdated++;
return Write(make_pair(string("tx"), hash), wtx);
}
bool EraseTx(uint256 hash)
{
nWalletDBUpdated++;
return Erase(make_pair(string("tx"), hash));
}
bool ReadKey(const vector<unsigned char>& vchPubKey, CPrivKey& vchPrivKey)
{
vchPrivKey.clear();
return Read(make_pair(string("key"), vchPubKey), vchPrivKey);
}
bool WriteKey(const vector<unsigned char>& vchPubKey, const CPrivKey& vchPrivKey)
{
nWalletDBUpdated++;
return Write(make_pair(string("key"), vchPubKey), vchPrivKey, false);
}
bool ReadDefaultKey(vector<unsigned char>& vchPubKey)
{
vchPubKey.clear();
return Read(string("defaultkey"), vchPubKey);
}
bool WriteDefaultKey(const vector<unsigned char>& vchPubKey)
{
vchDefaultKey = vchPubKey;
nWalletDBUpdated++;
return Write(string("defaultkey"), vchPubKey);
}
template<typename T>
bool ReadSetting(const string& strKey, T& value)
{
return Read(make_pair(string("setting"), strKey), value);
}
template<typename T>
bool WriteSetting(const string& strKey, const T& value)
{
nWalletDBUpdated++;
return Write(make_pair(string("setting"), strKey), value);
}
bool LoadWallet();
};
bool LoadWallet(bool& fFirstRunRet);
inline bool SetAddressBookName(const string& strAddress, const string& strName)
{
return CWalletDB().WriteName(strAddress, strName);
}

254
headers.h
View File

@ -1,127 +1,127 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#ifdef _MSC_VER
#pragma warning(disable:4786)
#pragma warning(disable:4804)
#pragma warning(disable:4805)
#pragma warning(disable:4717)
#endif
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT 0x0400
#ifdef _WIN32_IE
#undef _WIN32_IE
#endif
#define _WIN32_IE 0x0400
#define WIN32_LEAN_AND_MEAN 1
#define __STDC_LIMIT_MACROS // to enable UINT64_MAX from stdint.h
#include <wx/wx.h>
#include <wx/stdpaths.h>
#include <wx/snglinst.h>
#if wxUSE_GUI
#include <wx/utils.h>
#include <wx/clipbrd.h>
#include <wx/taskbar.h>
#endif
#include <openssl/ecdsa.h>
#include <openssl/evp.h>
#include <openssl/rand.h>
#include <openssl/sha.h>
#include <openssl/ripemd.h>
#include <db_cxx.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#include <float.h>
#include <assert.h>
#include <memory>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/tuple/tuple_comparison.hpp>
#include <boost/tuple/tuple_io.hpp>
#include <boost/array.hpp>
#include <boost/bind.hpp>
#include <boost/function.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/interprocess/sync/interprocess_mutex.hpp>
#include <boost/interprocess/sync/interprocess_recursive_mutex.hpp>
#include <boost/date_time/gregorian/gregorian_types.hpp>
#include <boost/date_time/posix_time/posix_time_types.hpp>
#ifdef __WXMSW__
#include <windows.h>
#include <winsock2.h>
#include <mswsock.h>
#include <shlobj.h>
#include <shlwapi.h>
#include <io.h>
#include <process.h>
#include <malloc.h>
#else
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
#include <errno.h>
#include <net/if.h>
#include <ifaddrs.h>
#endif
#ifdef __BSD__
#include <netinet/in.h>
#endif
#pragma hdrstop
using namespace std;
using namespace boost;
#include "strlcpy.h"
#include "serialize.h"
#include "uint256.h"
#include "util.h"
#include "key.h"
#include "bignum.h"
#include "base58.h"
#include "script.h"
#include "db.h"
#include "net.h"
#include "irc.h"
#include "main.h"
#include "rpc.h"
#if wxUSE_GUI
#include "uibase.h"
#endif
#include "ui.h"
#include "init.h"
#include "xpm/addressbook16.xpm"
#include "xpm/addressbook20.xpm"
#include "xpm/bitcoin16.xpm"
#include "xpm/bitcoin20.xpm"
#include "xpm/bitcoin32.xpm"
#include "xpm/bitcoin48.xpm"
#include "xpm/bitcoin80.xpm"
#include "xpm/check.xpm"
#include "xpm/send16.xpm"
#include "xpm/send16noshadow.xpm"
#include "xpm/send20.xpm"
#include "xpm/about.xpm"
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#ifdef _MSC_VER
#pragma warning(disable:4786)
#pragma warning(disable:4804)
#pragma warning(disable:4805)
#pragma warning(disable:4717)
#endif
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT 0x0400
#ifdef _WIN32_IE
#undef _WIN32_IE
#endif
#define _WIN32_IE 0x0400
#define WIN32_LEAN_AND_MEAN 1
#define __STDC_LIMIT_MACROS // to enable UINT64_MAX from stdint.h
#include <wx/wx.h>
#include <wx/stdpaths.h>
#include <wx/snglinst.h>
#if wxUSE_GUI
#include <wx/utils.h>
#include <wx/clipbrd.h>
#include <wx/taskbar.h>
#endif
#include <openssl/ecdsa.h>
#include <openssl/evp.h>
#include <openssl/rand.h>
#include <openssl/sha.h>
#include <openssl/ripemd.h>
#include <db_cxx.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#include <float.h>
#include <assert.h>
#include <memory>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/tuple/tuple_comparison.hpp>
#include <boost/tuple/tuple_io.hpp>
#include <boost/array.hpp>
#include <boost/bind.hpp>
#include <boost/function.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/interprocess/sync/interprocess_mutex.hpp>
#include <boost/interprocess/sync/interprocess_recursive_mutex.hpp>
#include <boost/date_time/gregorian/gregorian_types.hpp>
#include <boost/date_time/posix_time/posix_time_types.hpp>
#ifdef __WXMSW__
#include <windows.h>
#include <winsock2.h>
#include <mswsock.h>
#include <shlobj.h>
#include <shlwapi.h>
#include <io.h>
#include <process.h>
#include <malloc.h>
#else
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
#include <errno.h>
#include <net/if.h>
#include <ifaddrs.h>
#endif
#ifdef __BSD__
#include <netinet/in.h>
#endif
#pragma hdrstop
using namespace std;
using namespace boost;
#include "strlcpy.h"
#include "serialize.h"
#include "uint256.h"
#include "util.h"
#include "key.h"
#include "bignum.h"
#include "base58.h"
#include "script.h"
#include "db.h"
#include "net.h"
#include "irc.h"
#include "main.h"
#include "rpc.h"
#if wxUSE_GUI
#include "uibase.h"
#endif
#include "ui.h"
#include "init.h"
#include "xpm/addressbook16.xpm"
#include "xpm/addressbook20.xpm"
#include "xpm/bitcoin16.xpm"
#include "xpm/bitcoin20.xpm"
#include "xpm/bitcoin32.xpm"
#include "xpm/bitcoin48.xpm"
#include "xpm/bitcoin80.xpm"
#include "xpm/check.xpm"
#include "xpm/send16.xpm"
#include "xpm/send16noshadow.xpm"
#include "xpm/send20.xpm"
#include "xpm/about.xpm"

1356
init.cpp

File diff suppressed because it is too large Load Diff

14
init.h
View File

@ -1,7 +1,7 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
void Shutdown(void* parg);
bool GetStartOnSystemStartup();
void SetStartOnSystemStartup(bool fAutoStart);
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
void Shutdown(void* parg);
bool GetStartOnSystemStartup();
void SetStartOnSystemStartup(bool fAutoStart);

648
irc.cpp
View File

@ -1,324 +1,324 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#include "headers.h"
int nGotIRCAddresses = 0;
#pragma pack(push, 1)
struct ircaddr
{
int ip;
short port;
};
#pragma pack(pop)
string EncodeAddress(const CAddress& addr)
{
struct ircaddr tmp;
tmp.ip = addr.ip;
tmp.port = addr.port;
vector<unsigned char> vch(UBEGIN(tmp), UEND(tmp));
return string("u") + EncodeBase58Check(vch);
}
bool DecodeAddress(string str, CAddress& addr)
{
vector<unsigned char> vch;
if (!DecodeBase58Check(str.substr(1), vch))
return false;
struct ircaddr tmp;
if (vch.size() != sizeof(tmp))
return false;
memcpy(&tmp, &vch[0], sizeof(tmp));
addr = CAddress(tmp.ip, tmp.port, NODE_NETWORK);
return true;
}
static bool Send(SOCKET hSocket, const char* pszSend)
{
if (strstr(pszSend, "PONG") != pszSend)
printf("IRC SENDING: %s\n", pszSend);
const char* psz = pszSend;
const char* pszEnd = psz + strlen(psz);
while (psz < pszEnd)
{
int ret = send(hSocket, psz, pszEnd - psz, MSG_NOSIGNAL);
if (ret < 0)
return false;
psz += ret;
}
return true;
}
bool RecvLine(SOCKET hSocket, string& strLine)
{
strLine = "";
loop
{
char c;
int nBytes = recv(hSocket, &c, 1, 0);
if (nBytes > 0)
{
if (c == '\n')
continue;
if (c == '\r')
return true;
strLine += c;
if (strLine.size() >= 9000)
return true;
}
else if (nBytes <= 0)
{
if (!strLine.empty())
return true;
// socket closed
printf("IRC socket closed\n");
return false;
}
else
{
// socket error
int nErr = WSAGetLastError();
if (nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS)
{
printf("IRC recv failed: %d\n", nErr);
return false;
}
}
}
}
bool RecvLineIRC(SOCKET hSocket, string& strLine)
{
loop
{
bool fRet = RecvLine(hSocket, strLine);
if (fRet)
{
if (fShutdown)
return false;
vector<string> vWords;
ParseString(strLine, ' ', vWords);
if (vWords.size() >= 1 && vWords[0] == "PING")
{
strLine[1] = 'O';
strLine += '\r';
Send(hSocket, strLine.c_str());
continue;
}
}
return fRet;
}
}
int RecvUntil(SOCKET hSocket, const char* psz1, const char* psz2=NULL, const char* psz3=NULL)
{
loop
{
string strLine;
if (!RecvLineIRC(hSocket, strLine))
return 0;
printf("IRC %s\n", strLine.c_str());
if (psz1 && strLine.find(psz1) != -1)
return 1;
if (psz2 && strLine.find(psz2) != -1)
return 2;
if (psz3 && strLine.find(psz3) != -1)
return 3;
}
}
bool Wait(int nSeconds)
{
if (fShutdown)
return false;
printf("IRC waiting %d seconds to reconnect\n", nSeconds);
for (int i = 0; i < nSeconds; i++)
{
if (fShutdown)
return false;
Sleep(1000);
}
return true;
}
void ThreadIRCSeed(void* parg)
{
printf("ThreadIRCSeed started\n");
int nErrorWait = 10;
int nRetryWait = 10;
bool fNameInUse = false;
bool fTOR = (fUseProxy && addrProxy.port == htons(9050));
while (!fShutdown)
{
//CAddress addrConnect("216.155.130.130:6667"); // chat.freenode.net
CAddress addrConnect("92.243.23.21:6667"); // irc.lfnet.org
if (!fTOR)
{
//struct hostent* phostent = gethostbyname("chat.freenode.net");
struct hostent* phostent = gethostbyname("irc.lfnet.org");
if (phostent && phostent->h_addr_list && phostent->h_addr_list[0])
addrConnect = CAddress(*(u_long*)phostent->h_addr_list[0], htons(6667));
}
SOCKET hSocket;
if (!ConnectSocket(addrConnect, hSocket))
{
printf("IRC connect failed\n");
nErrorWait = nErrorWait * 11 / 10;
if (Wait(nErrorWait += 60))
continue;
else
return;
}
if (!RecvUntil(hSocket, "Found your hostname", "using your IP address instead", "Couldn't look up your hostname"))
{
closesocket(hSocket);
hSocket = INVALID_SOCKET;
nErrorWait = nErrorWait * 11 / 10;
if (Wait(nErrorWait += 60))
continue;
else
return;
}
string strMyName;
if (addrLocalHost.IsRoutable() && !fUseProxy && !fNameInUse)
strMyName = EncodeAddress(addrLocalHost);
else
strMyName = strprintf("x%u", GetRand(1000000000));
Send(hSocket, strprintf("NICK %s\r", strMyName.c_str()).c_str());
Send(hSocket, strprintf("USER %s 8 * : %s\r", strMyName.c_str(), strMyName.c_str()).c_str());
int nRet = RecvUntil(hSocket, " 004 ", " 433 ");
if (nRet != 1)
{
closesocket(hSocket);
hSocket = INVALID_SOCKET;
if (nRet == 2)
{
printf("IRC name already in use\n");
fNameInUse = true;
Wait(10);
continue;
}
nErrorWait = nErrorWait * 11 / 10;
if (Wait(nErrorWait += 60))
continue;
else
return;
}
Sleep(500);
Send(hSocket, "JOIN #bitcoin\r");
Send(hSocket, "WHO #bitcoin\r");
int64 nStart = GetTime();
string strLine;
while (!fShutdown && RecvLineIRC(hSocket, strLine))
{
if (strLine.empty() || strLine.size() > 900 || strLine[0] != ':')
continue;
vector<string> vWords;
ParseString(strLine, ' ', vWords);
if (vWords.size() < 2)
continue;
char pszName[10000];
pszName[0] = '\0';
if (vWords[1] == "352" && vWords.size() >= 8)
{
// index 7 is limited to 16 characters
// could get full length name at index 10, but would be different from join messages
strlcpy(pszName, vWords[7].c_str(), sizeof(pszName));
printf("IRC got who\n");
}
if (vWords[1] == "JOIN" && vWords[0].size() > 1)
{
// :username!username@50000007.F000000B.90000002.IP JOIN :#channelname
strlcpy(pszName, vWords[0].c_str() + 1, sizeof(pszName));
if (strchr(pszName, '!'))
*strchr(pszName, '!') = '\0';
printf("IRC got join\n");
}
if (pszName[0] == 'u')
{
CAddress addr;
if (DecodeAddress(pszName, addr))
{
addr.nTime = GetAdjustedTime() - 51 * 60;
if (AddAddress(addr))
printf("IRC got new address\n");
nGotIRCAddresses++;
}
else
{
printf("IRC decode failed\n");
}
}
}
closesocket(hSocket);
hSocket = INVALID_SOCKET;
// IRC usually blocks TOR, so only try once
if (fTOR)
return;
if (GetTime() - nStart > 20 * 60)
{
nErrorWait /= 3;
nRetryWait /= 3;
}
nRetryWait = nRetryWait * 11 / 10;
if (!Wait(nRetryWait += 60))
return;
}
}
#ifdef TEST
int main(int argc, char *argv[])
{
WSADATA wsadata;
if (WSAStartup(MAKEWORD(2,2), &wsadata) != NO_ERROR)
{
printf("Error at WSAStartup()\n");
return false;
}
ThreadIRCSeed(NULL);
WSACleanup();
return 0;
}
#endif
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#include "headers.h"
int nGotIRCAddresses = 0;
#pragma pack(push, 1)
struct ircaddr
{
int ip;
short port;
};
#pragma pack(pop)
string EncodeAddress(const CAddress& addr)
{
struct ircaddr tmp;
tmp.ip = addr.ip;
tmp.port = addr.port;
vector<unsigned char> vch(UBEGIN(tmp), UEND(tmp));
return string("u") + EncodeBase58Check(vch);
}
bool DecodeAddress(string str, CAddress& addr)
{
vector<unsigned char> vch;
if (!DecodeBase58Check(str.substr(1), vch))
return false;
struct ircaddr tmp;
if (vch.size() != sizeof(tmp))
return false;
memcpy(&tmp, &vch[0], sizeof(tmp));
addr = CAddress(tmp.ip, tmp.port, NODE_NETWORK);
return true;
}
static bool Send(SOCKET hSocket, const char* pszSend)
{
if (strstr(pszSend, "PONG") != pszSend)
printf("IRC SENDING: %s\n", pszSend);
const char* psz = pszSend;
const char* pszEnd = psz + strlen(psz);
while (psz < pszEnd)
{
int ret = send(hSocket, psz, pszEnd - psz, MSG_NOSIGNAL);
if (ret < 0)
return false;
psz += ret;
}
return true;
}
bool RecvLine(SOCKET hSocket, string& strLine)
{
strLine = "";
loop
{
char c;
int nBytes = recv(hSocket, &c, 1, 0);
if (nBytes > 0)
{
if (c == '\n')
continue;
if (c == '\r')
return true;
strLine += c;
if (strLine.size() >= 9000)
return true;
}
else if (nBytes <= 0)
{
if (!strLine.empty())
return true;
// socket closed
printf("IRC socket closed\n");
return false;
}
else
{
// socket error
int nErr = WSAGetLastError();
if (nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS)
{
printf("IRC recv failed: %d\n", nErr);
return false;
}
}
}
}
bool RecvLineIRC(SOCKET hSocket, string& strLine)
{
loop
{
bool fRet = RecvLine(hSocket, strLine);
if (fRet)
{
if (fShutdown)
return false;
vector<string> vWords;
ParseString(strLine, ' ', vWords);
if (vWords.size() >= 1 && vWords[0] == "PING")
{
strLine[1] = 'O';
strLine += '\r';
Send(hSocket, strLine.c_str());
continue;
}
}
return fRet;
}
}
int RecvUntil(SOCKET hSocket, const char* psz1, const char* psz2=NULL, const char* psz3=NULL)
{
loop
{
string strLine;
if (!RecvLineIRC(hSocket, strLine))
return 0;
printf("IRC %s\n", strLine.c_str());
if (psz1 && strLine.find(psz1) != -1)
return 1;
if (psz2 && strLine.find(psz2) != -1)
return 2;
if (psz3 && strLine.find(psz3) != -1)
return 3;
}
}
bool Wait(int nSeconds)
{
if (fShutdown)
return false;
printf("IRC waiting %d seconds to reconnect\n", nSeconds);
for (int i = 0; i < nSeconds; i++)
{
if (fShutdown)
return false;
Sleep(1000);
}
return true;
}
void ThreadIRCSeed(void* parg)
{
printf("ThreadIRCSeed started\n");
int nErrorWait = 10;
int nRetryWait = 10;
bool fNameInUse = false;
bool fTOR = (fUseProxy && addrProxy.port == htons(9050));
while (!fShutdown)
{
//CAddress addrConnect("216.155.130.130:6667"); // chat.freenode.net
CAddress addrConnect("92.243.23.21:6667"); // irc.lfnet.org
if (!fTOR)
{
//struct hostent* phostent = gethostbyname("chat.freenode.net");
struct hostent* phostent = gethostbyname("irc.lfnet.org");
if (phostent && phostent->h_addr_list && phostent->h_addr_list[0])
addrConnect = CAddress(*(u_long*)phostent->h_addr_list[0], htons(6667));
}
SOCKET hSocket;
if (!ConnectSocket(addrConnect, hSocket))
{
printf("IRC connect failed\n");
nErrorWait = nErrorWait * 11 / 10;
if (Wait(nErrorWait += 60))
continue;
else
return;
}
if (!RecvUntil(hSocket, "Found your hostname", "using your IP address instead", "Couldn't look up your hostname"))
{
closesocket(hSocket);
hSocket = INVALID_SOCKET;
nErrorWait = nErrorWait * 11 / 10;
if (Wait(nErrorWait += 60))
continue;
else
return;
}
string strMyName;
if (addrLocalHost.IsRoutable() && !fUseProxy && !fNameInUse)
strMyName = EncodeAddress(addrLocalHost);
else
strMyName = strprintf("x%u", GetRand(1000000000));
Send(hSocket, strprintf("NICK %s\r", strMyName.c_str()).c_str());
Send(hSocket, strprintf("USER %s 8 * : %s\r", strMyName.c_str(), strMyName.c_str()).c_str());
int nRet = RecvUntil(hSocket, " 004 ", " 433 ");
if (nRet != 1)
{
closesocket(hSocket);
hSocket = INVALID_SOCKET;
if (nRet == 2)
{
printf("IRC name already in use\n");
fNameInUse = true;
Wait(10);
continue;
}
nErrorWait = nErrorWait * 11 / 10;
if (Wait(nErrorWait += 60))
continue;
else
return;
}
Sleep(500);
Send(hSocket, "JOIN #bitcoin\r");
Send(hSocket, "WHO #bitcoin\r");
int64 nStart = GetTime();
string strLine;
while (!fShutdown && RecvLineIRC(hSocket, strLine))
{
if (strLine.empty() || strLine.size() > 900 || strLine[0] != ':')
continue;
vector<string> vWords;
ParseString(strLine, ' ', vWords);
if (vWords.size() < 2)
continue;
char pszName[10000];
pszName[0] = '\0';
if (vWords[1] == "352" && vWords.size() >= 8)
{
// index 7 is limited to 16 characters
// could get full length name at index 10, but would be different from join messages
strlcpy(pszName, vWords[7].c_str(), sizeof(pszName));
printf("IRC got who\n");
}
if (vWords[1] == "JOIN" && vWords[0].size() > 1)
{
// :username!username@50000007.F000000B.90000002.IP JOIN :#channelname
strlcpy(pszName, vWords[0].c_str() + 1, sizeof(pszName));
if (strchr(pszName, '!'))
*strchr(pszName, '!') = '\0';
printf("IRC got join\n");
}
if (pszName[0] == 'u')
{
CAddress addr;
if (DecodeAddress(pszName, addr))
{
addr.nTime = GetAdjustedTime() - 51 * 60;
if (AddAddress(addr))
printf("IRC got new address\n");
nGotIRCAddresses++;
}
else
{
printf("IRC decode failed\n");
}
}
}
closesocket(hSocket);
hSocket = INVALID_SOCKET;
// IRC usually blocks TOR, so only try once
if (fTOR)
return;
if (GetTime() - nStart > 20 * 60)
{
nErrorWait /= 3;
nRetryWait /= 3;
}
nRetryWait = nRetryWait * 11 / 10;
if (!Wait(nRetryWait += 60))
return;
}
}
#ifdef TEST
int main(int argc, char *argv[])
{
WSADATA wsadata;
if (WSAStartup(MAKEWORD(2,2), &wsadata) != NO_ERROR)
{
printf("Error at WSAStartup()\n");
return false;
}
ThreadIRCSeed(NULL);
WSACleanup();
return 0;
}
#endif

16
irc.h
View File

@ -1,8 +1,8 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
bool RecvLine(SOCKET hSocket, string& strLine);
void ThreadIRCSeed(void* parg);
extern int nGotIRCAddresses;
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
bool RecvLine(SOCKET hSocket, string& strLine);
void ThreadIRCSeed(void* parg);
extern int nGotIRCAddresses;

View File

@ -1,24 +1,24 @@
The MIT License
Copyright (c) 2007 - 2009 John W. Wilkinson
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.
The MIT License
Copyright (c) 2007 - 2009 John W. Wilkinson
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.

View File

@ -1,18 +1,18 @@
#ifndef JSON_SPIRIT
#define JSON_SPIRIT
// Copyright John W. Wilkinson 2007 - 2009.
// Distributed under the MIT License, see accompanying file LICENSE.txt
// json spirit version 4.03
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include "json_spirit_value.h"
#include "json_spirit_reader.h"
#include "json_spirit_writer.h"
#include "json_spirit_utils.h"
#endif
#ifndef JSON_SPIRIT
#define JSON_SPIRIT
// Copyright John W. Wilkinson 2007 - 2009.
// Distributed under the MIT License, see accompanying file LICENSE.txt
// json spirit version 4.03
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include "json_spirit_value.h"
#include "json_spirit_reader.h"
#include "json_spirit_writer.h"
#include "json_spirit_utils.h"
#endif

View File

@ -1,54 +1,54 @@
#ifndef JSON_SPIRIT_ERROR_POSITION
#define JSON_SPIRIT_ERROR_POSITION
// Copyright John W. Wilkinson 2007 - 2009.
// Distributed under the MIT License, see accompanying file LICENSE.txt
// json spirit version 4.03
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include <string>
namespace json_spirit
{
// An Error_position exception is thrown by the "read_or_throw" functions below on finding an error.
// Note the "read_or_throw" functions are around 3 times slower than the standard functions "read"
// functions that return a bool.
//
struct Error_position
{
Error_position();
Error_position( unsigned int line, unsigned int column, const std::string& reason );
bool operator==( const Error_position& lhs ) const;
unsigned int line_;
unsigned int column_;
std::string reason_;
};
inline Error_position::Error_position()
: line_( 0 )
, column_( 0 )
{
}
inline Error_position::Error_position( unsigned int line, unsigned int column, const std::string& reason )
: line_( line )
, column_( column )
, reason_( reason )
{
}
inline bool Error_position::operator==( const Error_position& lhs ) const
{
if( this == &lhs ) return true;
return ( reason_ == lhs.reason_ ) &&
( line_ == lhs.line_ ) &&
( column_ == lhs.column_ );
}
}
#endif
#ifndef JSON_SPIRIT_ERROR_POSITION
#define JSON_SPIRIT_ERROR_POSITION
// Copyright John W. Wilkinson 2007 - 2009.
// Distributed under the MIT License, see accompanying file LICENSE.txt
// json spirit version 4.03
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include <string>
namespace json_spirit
{
// An Error_position exception is thrown by the "read_or_throw" functions below on finding an error.
// Note the "read_or_throw" functions are around 3 times slower than the standard functions "read"
// functions that return a bool.
//
struct Error_position
{
Error_position();
Error_position( unsigned int line, unsigned int column, const std::string& reason );
bool operator==( const Error_position& lhs ) const;
unsigned int line_;
unsigned int column_;
std::string reason_;
};
inline Error_position::Error_position()
: line_( 0 )
, column_( 0 )
{
}
inline Error_position::Error_position( unsigned int line, unsigned int column, const std::string& reason )
: line_( line )
, column_( column )
, reason_( reason )
{
}
inline bool Error_position::operator==( const Error_position& lhs ) const
{
if( this == &lhs ) return true;
return ( reason_ == lhs.reason_ ) &&
( line_ == lhs.line_ ) &&
( column_ == lhs.column_ );
}
}
#endif

View File

@ -1,137 +1,137 @@
// Copyright John W. Wilkinson 2007 - 2009.
// Distributed under the MIT License, see accompanying file LICENSE.txt
// json spirit version 4.03
#include "json_spirit_reader.h"
#include "json_spirit_reader_template.h"
using namespace json_spirit;
bool json_spirit::read( const std::string& s, Value& value )
{
return read_string( s, value );
}
void json_spirit::read_or_throw( const std::string& s, Value& value )
{
read_string_or_throw( s, value );
}
bool json_spirit::read( std::istream& is, Value& value )
{
return read_stream( is, value );
}
void json_spirit::read_or_throw( std::istream& is, Value& value )
{
read_stream_or_throw( is, value );
}
bool json_spirit::read( std::string::const_iterator& begin, std::string::const_iterator end, Value& value )
{
return read_range( begin, end, value );
}
void json_spirit::read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, Value& value )
{
begin = read_range_or_throw( begin, end, value );
}
#ifndef BOOST_NO_STD_WSTRING
bool json_spirit::read( const std::wstring& s, wValue& value )
{
return read_string( s, value );
}
void json_spirit::read_or_throw( const std::wstring& s, wValue& value )
{
read_string_or_throw( s, value );
}
bool json_spirit::read( std::wistream& is, wValue& value )
{
return read_stream( is, value );
}
void json_spirit::read_or_throw( std::wistream& is, wValue& value )
{
read_stream_or_throw( is, value );
}
bool json_spirit::read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value )
{
return read_range( begin, end, value );
}
void json_spirit::read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value )
{
begin = read_range_or_throw( begin, end, value );
}
#endif
bool json_spirit::read( const std::string& s, mValue& value )
{
return read_string( s, value );
}
void json_spirit::read_or_throw( const std::string& s, mValue& value )
{
read_string_or_throw( s, value );
}
bool json_spirit::read( std::istream& is, mValue& value )
{
return read_stream( is, value );
}
void json_spirit::read_or_throw( std::istream& is, mValue& value )
{
read_stream_or_throw( is, value );
}
bool json_spirit::read( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value )
{
return read_range( begin, end, value );
}
void json_spirit::read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value )
{
begin = read_range_or_throw( begin, end, value );
}
#ifndef BOOST_NO_STD_WSTRING
bool json_spirit::read( const std::wstring& s, wmValue& value )
{
return read_string( s, value );
}
void json_spirit::read_or_throw( const std::wstring& s, wmValue& value )
{
read_string_or_throw( s, value );
}
bool json_spirit::read( std::wistream& is, wmValue& value )
{
return read_stream( is, value );
}
void json_spirit::read_or_throw( std::wistream& is, wmValue& value )
{
read_stream_or_throw( is, value );
}
bool json_spirit::read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value )
{
return read_range( begin, end, value );
}
void json_spirit::read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value )
{
begin = read_range_or_throw( begin, end, value );
}
#endif
// Copyright John W. Wilkinson 2007 - 2009.
// Distributed under the MIT License, see accompanying file LICENSE.txt
// json spirit version 4.03
#include "json_spirit_reader.h"
#include "json_spirit_reader_template.h"
using namespace json_spirit;
bool json_spirit::read( const std::string& s, Value& value )
{
return read_string( s, value );
}
void json_spirit::read_or_throw( const std::string& s, Value& value )
{
read_string_or_throw( s, value );
}
bool json_spirit::read( std::istream& is, Value& value )
{
return read_stream( is, value );
}
void json_spirit::read_or_throw( std::istream& is, Value& value )
{
read_stream_or_throw( is, value );
}
bool json_spirit::read( std::string::const_iterator& begin, std::string::const_iterator end, Value& value )
{
return read_range( begin, end, value );
}
void json_spirit::read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, Value& value )
{
begin = read_range_or_throw( begin, end, value );
}
#ifndef BOOST_NO_STD_WSTRING
bool json_spirit::read( const std::wstring& s, wValue& value )
{
return read_string( s, value );
}
void json_spirit::read_or_throw( const std::wstring& s, wValue& value )
{
read_string_or_throw( s, value );
}
bool json_spirit::read( std::wistream& is, wValue& value )
{
return read_stream( is, value );
}
void json_spirit::read_or_throw( std::wistream& is, wValue& value )
{
read_stream_or_throw( is, value );
}
bool json_spirit::read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value )
{
return read_range( begin, end, value );
}
void json_spirit::read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value )
{
begin = read_range_or_throw( begin, end, value );
}
#endif
bool json_spirit::read( const std::string& s, mValue& value )
{
return read_string( s, value );
}
void json_spirit::read_or_throw( const std::string& s, mValue& value )
{
read_string_or_throw( s, value );
}
bool json_spirit::read( std::istream& is, mValue& value )
{
return read_stream( is, value );
}
void json_spirit::read_or_throw( std::istream& is, mValue& value )
{
read_stream_or_throw( is, value );
}
bool json_spirit::read( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value )
{
return read_range( begin, end, value );
}
void json_spirit::read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value )
{
begin = read_range_or_throw( begin, end, value );
}
#ifndef BOOST_NO_STD_WSTRING
bool json_spirit::read( const std::wstring& s, wmValue& value )
{
return read_string( s, value );
}
void json_spirit::read_or_throw( const std::wstring& s, wmValue& value )
{
read_string_or_throw( s, value );
}
bool json_spirit::read( std::wistream& is, wmValue& value )
{
return read_stream( is, value );
}
void json_spirit::read_or_throw( std::wistream& is, wmValue& value )
{
read_stream_or_throw( is, value );
}
bool json_spirit::read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value )
{
return read_range( begin, end, value );
}
void json_spirit::read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value )
{
begin = read_range_or_throw( begin, end, value );
}
#endif

View File

@ -1,62 +1,62 @@
#ifndef JSON_SPIRIT_READER
#define JSON_SPIRIT_READER
// Copyright John W. Wilkinson 2007 - 2009.
// Distributed under the MIT License, see accompanying file LICENSE.txt
// json spirit version 4.03
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include "json_spirit_value.h"
#include "json_spirit_error_position.h"
#include <iostream>
namespace json_spirit
{
// functions to reads a JSON values
bool read( const std::string& s, Value& value );
bool read( std::istream& is, Value& value );
bool read( std::string::const_iterator& begin, std::string::const_iterator end, Value& value );
void read_or_throw( const std::string& s, Value& value );
void read_or_throw( std::istream& is, Value& value );
void read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, Value& value );
#ifndef BOOST_NO_STD_WSTRING
bool read( const std::wstring& s, wValue& value );
bool read( std::wistream& is, wValue& value );
bool read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value );
void read_or_throw( const std::wstring& s, wValue& value );
void read_or_throw( std::wistream& is, wValue& value );
void read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value );
#endif
bool read( const std::string& s, mValue& value );
bool read( std::istream& is, mValue& value );
bool read( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value );
void read_or_throw( const std::string& s, mValue& value );
void read_or_throw( std::istream& is, mValue& value );
void read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value );
#ifndef BOOST_NO_STD_WSTRING
bool read( const std::wstring& s, wmValue& value );
bool read( std::wistream& is, wmValue& value );
bool read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value );
void read_or_throw( const std::wstring& s, wmValue& value );
void read_or_throw( std::wistream& is, wmValue& value );
void read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value );
#endif
}
#endif
#ifndef JSON_SPIRIT_READER
#define JSON_SPIRIT_READER
// Copyright John W. Wilkinson 2007 - 2009.
// Distributed under the MIT License, see accompanying file LICENSE.txt
// json spirit version 4.03
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include "json_spirit_value.h"
#include "json_spirit_error_position.h"
#include <iostream>
namespace json_spirit
{
// functions to reads a JSON values
bool read( const std::string& s, Value& value );
bool read( std::istream& is, Value& value );
bool read( std::string::const_iterator& begin, std::string::const_iterator end, Value& value );
void read_or_throw( const std::string& s, Value& value );
void read_or_throw( std::istream& is, Value& value );
void read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, Value& value );
#ifndef BOOST_NO_STD_WSTRING
bool read( const std::wstring& s, wValue& value );
bool read( std::wistream& is, wValue& value );
bool read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value );
void read_or_throw( const std::wstring& s, wValue& value );
void read_or_throw( std::wistream& is, wValue& value );
void read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value );
#endif
bool read( const std::string& s, mValue& value );
bool read( std::istream& is, mValue& value );
bool read( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value );
void read_or_throw( const std::string& s, mValue& value );
void read_or_throw( std::istream& is, mValue& value );
void read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value );
#ifndef BOOST_NO_STD_WSTRING
bool read( const std::wstring& s, wmValue& value );
bool read( std::wistream& is, wmValue& value );
bool read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value );
void read_or_throw( const std::wstring& s, wmValue& value );
void read_or_throw( std::wistream& is, wmValue& value );
void read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value );
#endif
}
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,70 +1,70 @@
#ifndef JSON_SPIRIT_READ_STREAM
#define JSON_SPIRIT_READ_STREAM
// Copyright John W. Wilkinson 2007 - 2009.
// Distributed under the MIT License, see accompanying file LICENSE.txt
// json spirit version 4.03
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include "json_spirit_reader_template.h"
namespace json_spirit
{
// these classes allows you to read multiple top level contiguous values from a stream,
// the normal stream read functions have a bug that prevent multiple top level values
// from being read unless they are separated by spaces
template< class Istream_type, class Value_type >
class Stream_reader
{
public:
Stream_reader( Istream_type& is )
: iters_( is )
{
}
bool read_next( Value_type& value )
{
return read_range( iters_.begin_, iters_.end_, value );
}
private:
typedef Multi_pass_iters< Istream_type > Mp_iters;
Mp_iters iters_;
};
template< class Istream_type, class Value_type >
class Stream_reader_thrower
{
public:
Stream_reader_thrower( Istream_type& is )
: iters_( is )
, posn_begin_( iters_.begin_, iters_.end_ )
, posn_end_( iters_.end_, iters_.end_ )
{
}
void read_next( Value_type& value )
{
posn_begin_ = read_range_or_throw( posn_begin_, posn_end_, value );
}
private:
typedef Multi_pass_iters< Istream_type > Mp_iters;
typedef spirit_namespace::position_iterator< typename Mp_iters::Mp_iter > Posn_iter_t;
Mp_iters iters_;
Posn_iter_t posn_begin_, posn_end_;
};
}
#endif
#ifndef JSON_SPIRIT_READ_STREAM
#define JSON_SPIRIT_READ_STREAM
// Copyright John W. Wilkinson 2007 - 2009.
// Distributed under the MIT License, see accompanying file LICENSE.txt
// json spirit version 4.03
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include "json_spirit_reader_template.h"
namespace json_spirit
{
// these classes allows you to read multiple top level contiguous values from a stream,
// the normal stream read functions have a bug that prevent multiple top level values
// from being read unless they are separated by spaces
template< class Istream_type, class Value_type >
class Stream_reader
{
public:
Stream_reader( Istream_type& is )
: iters_( is )
{
}
bool read_next( Value_type& value )
{
return read_range( iters_.begin_, iters_.end_, value );
}
private:
typedef Multi_pass_iters< Istream_type > Mp_iters;
Mp_iters iters_;
};
template< class Istream_type, class Value_type >
class Stream_reader_thrower
{
public:
Stream_reader_thrower( Istream_type& is )
: iters_( is )
, posn_begin_( iters_.begin_, iters_.end_ )
, posn_end_( iters_.end_, iters_.end_ )
{
}
void read_next( Value_type& value )
{
posn_begin_ = read_range_or_throw( posn_begin_, posn_end_, value );
}
private:
typedef Multi_pass_iters< Istream_type > Mp_iters;
typedef spirit_namespace::position_iterator< typename Mp_iters::Mp_iter > Posn_iter_t;
Mp_iters iters_;
Posn_iter_t posn_begin_, posn_end_;
};
}
#endif

View File

@ -1,61 +1,61 @@
#ifndef JSON_SPIRIT_UTILS
#define JSON_SPIRIT_UTILS
// Copyright John W. Wilkinson 2007 - 2009.
// Distributed under the MIT License, see accompanying file LICENSE.txt
// json spirit version 4.03
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include "json_spirit_value.h"
#include <map>
namespace json_spirit
{
template< class Obj_t, class Map_t >
void obj_to_map( const Obj_t& obj, Map_t& mp_obj )
{
mp_obj.clear();
for( typename Obj_t::const_iterator i = obj.begin(); i != obj.end(); ++i )
{
mp_obj[ i->name_ ] = i->value_;
}
}
template< class Obj_t, class Map_t >
void map_to_obj( const Map_t& mp_obj, Obj_t& obj )
{
obj.clear();
for( typename Map_t::const_iterator i = mp_obj.begin(); i != mp_obj.end(); ++i )
{
obj.push_back( typename Obj_t::value_type( i->first, i->second ) );
}
}
typedef std::map< std::string, Value > Mapped_obj;
#ifndef BOOST_NO_STD_WSTRING
typedef std::map< std::wstring, wValue > wMapped_obj;
#endif
template< class Object_type, class String_type >
const typename Object_type::value_type::Value_type& find_value( const Object_type& obj, const String_type& name )
{
for( typename Object_type::const_iterator i = obj.begin(); i != obj.end(); ++i )
{
if( i->name_ == name )
{
return i->value_;
}
}
return Object_type::value_type::Value_type::null;
}
}
#endif
#ifndef JSON_SPIRIT_UTILS
#define JSON_SPIRIT_UTILS
// Copyright John W. Wilkinson 2007 - 2009.
// Distributed under the MIT License, see accompanying file LICENSE.txt
// json spirit version 4.03
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include "json_spirit_value.h"
#include <map>
namespace json_spirit
{
template< class Obj_t, class Map_t >
void obj_to_map( const Obj_t& obj, Map_t& mp_obj )
{
mp_obj.clear();
for( typename Obj_t::const_iterator i = obj.begin(); i != obj.end(); ++i )
{
mp_obj[ i->name_ ] = i->value_;
}
}
template< class Obj_t, class Map_t >
void map_to_obj( const Map_t& mp_obj, Obj_t& obj )
{
obj.clear();
for( typename Map_t::const_iterator i = mp_obj.begin(); i != mp_obj.end(); ++i )
{
obj.push_back( typename Obj_t::value_type( i->first, i->second ) );
}
}
typedef std::map< std::string, Value > Mapped_obj;
#ifndef BOOST_NO_STD_WSTRING
typedef std::map< std::wstring, wValue > wMapped_obj;
#endif
template< class Object_type, class String_type >
const typename Object_type::value_type::Value_type& find_value( const Object_type& obj, const String_type& name )
{
for( typename Object_type::const_iterator i = obj.begin(); i != obj.end(); ++i )
{
if( i->name_ == name )
{
return i->value_;
}
}
return Object_type::value_type::Value_type::null;
}
}
#endif

View File

@ -1,8 +1,8 @@
/* Copyright (c) 2007 John W Wilkinson
This source code can be used for any purpose as long as
this comment is retained. */
// json spirit version 2.00
#include "json_spirit_value.h"
/* Copyright (c) 2007 John W Wilkinson
This source code can be used for any purpose as long as
this comment is retained. */
// json spirit version 2.00
#include "json_spirit_value.h"

File diff suppressed because it is too large Load Diff

View File

@ -1,95 +1,95 @@
// Copyright John W. Wilkinson 2007 - 2009.
// Distributed under the MIT License, see accompanying file LICENSE.txt
// json spirit version 4.03
#include "json_spirit_writer.h"
#include "json_spirit_writer_template.h"
void json_spirit::write( const Value& value, std::ostream& os )
{
write_stream( value, os, false );
}
void json_spirit::write_formatted( const Value& value, std::ostream& os )
{
write_stream( value, os, true );
}
std::string json_spirit::write( const Value& value )
{
return write_string( value, false );
}
std::string json_spirit::write_formatted( const Value& value )
{
return write_string( value, true );
}
#ifndef BOOST_NO_STD_WSTRING
void json_spirit::write( const wValue& value, std::wostream& os )
{
write_stream( value, os, false );
}
void json_spirit::write_formatted( const wValue& value, std::wostream& os )
{
write_stream( value, os, true );
}
std::wstring json_spirit::write( const wValue& value )
{
return write_string( value, false );
}
std::wstring json_spirit::write_formatted( const wValue& value )
{
return write_string( value, true );
}
#endif
void json_spirit::write( const mValue& value, std::ostream& os )
{
write_stream( value, os, false );
}
void json_spirit::write_formatted( const mValue& value, std::ostream& os )
{
write_stream( value, os, true );
}
std::string json_spirit::write( const mValue& value )
{
return write_string( value, false );
}
std::string json_spirit::write_formatted( const mValue& value )
{
return write_string( value, true );
}
#ifndef BOOST_NO_STD_WSTRING
void json_spirit::write( const wmValue& value, std::wostream& os )
{
write_stream( value, os, false );
}
void json_spirit::write_formatted( const wmValue& value, std::wostream& os )
{
write_stream( value, os, true );
}
std::wstring json_spirit::write( const wmValue& value )
{
return write_string( value, false );
}
std::wstring json_spirit::write_formatted( const wmValue& value )
{
return write_string( value, true );
}
#endif
// Copyright John W. Wilkinson 2007 - 2009.
// Distributed under the MIT License, see accompanying file LICENSE.txt
// json spirit version 4.03
#include "json_spirit_writer.h"
#include "json_spirit_writer_template.h"
void json_spirit::write( const Value& value, std::ostream& os )
{
write_stream( value, os, false );
}
void json_spirit::write_formatted( const Value& value, std::ostream& os )
{
write_stream( value, os, true );
}
std::string json_spirit::write( const Value& value )
{
return write_string( value, false );
}
std::string json_spirit::write_formatted( const Value& value )
{
return write_string( value, true );
}
#ifndef BOOST_NO_STD_WSTRING
void json_spirit::write( const wValue& value, std::wostream& os )
{
write_stream( value, os, false );
}
void json_spirit::write_formatted( const wValue& value, std::wostream& os )
{
write_stream( value, os, true );
}
std::wstring json_spirit::write( const wValue& value )
{
return write_string( value, false );
}
std::wstring json_spirit::write_formatted( const wValue& value )
{
return write_string( value, true );
}
#endif
void json_spirit::write( const mValue& value, std::ostream& os )
{
write_stream( value, os, false );
}
void json_spirit::write_formatted( const mValue& value, std::ostream& os )
{
write_stream( value, os, true );
}
std::string json_spirit::write( const mValue& value )
{
return write_string( value, false );
}
std::string json_spirit::write_formatted( const mValue& value )
{
return write_string( value, true );
}
#ifndef BOOST_NO_STD_WSTRING
void json_spirit::write( const wmValue& value, std::wostream& os )
{
write_stream( value, os, false );
}
void json_spirit::write_formatted( const wmValue& value, std::wostream& os )
{
write_stream( value, os, true );
}
std::wstring json_spirit::write( const wmValue& value )
{
return write_string( value, false );
}
std::wstring json_spirit::write_formatted( const wmValue& value )
{
return write_string( value, true );
}
#endif

View File

@ -1,50 +1,50 @@
#ifndef JSON_SPIRIT_WRITER
#define JSON_SPIRIT_WRITER
// Copyright John W. Wilkinson 2007 - 2009.
// Distributed under the MIT License, see accompanying file LICENSE.txt
// json spirit version 4.03
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include "json_spirit_value.h"
#include <iostream>
namespace json_spirit
{
// functions to convert JSON Values to text,
// the "formatted" versions add whitespace to format the output nicely
void write ( const Value& value, std::ostream& os );
void write_formatted( const Value& value, std::ostream& os );
std::string write ( const Value& value );
std::string write_formatted( const Value& value );
#ifndef BOOST_NO_STD_WSTRING
void write ( const wValue& value, std::wostream& os );
void write_formatted( const wValue& value, std::wostream& os );
std::wstring write ( const wValue& value );
std::wstring write_formatted( const wValue& value );
#endif
void write ( const mValue& value, std::ostream& os );
void write_formatted( const mValue& value, std::ostream& os );
std::string write ( const mValue& value );
std::string write_formatted( const mValue& value );
#ifndef BOOST_NO_STD_WSTRING
void write ( const wmValue& value, std::wostream& os );
void write_formatted( const wmValue& value, std::wostream& os );
std::wstring write ( const wmValue& value );
std::wstring write_formatted( const wmValue& value );
#endif
}
#endif
#ifndef JSON_SPIRIT_WRITER
#define JSON_SPIRIT_WRITER
// Copyright John W. Wilkinson 2007 - 2009.
// Distributed under the MIT License, see accompanying file LICENSE.txt
// json spirit version 4.03
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
#include "json_spirit_value.h"
#include <iostream>
namespace json_spirit
{
// functions to convert JSON Values to text,
// the "formatted" versions add whitespace to format the output nicely
void write ( const Value& value, std::ostream& os );
void write_formatted( const Value& value, std::ostream& os );
std::string write ( const Value& value );
std::string write_formatted( const Value& value );
#ifndef BOOST_NO_STD_WSTRING
void write ( const wValue& value, std::wostream& os );
void write_formatted( const wValue& value, std::wostream& os );
std::wstring write ( const wValue& value );
std::wstring write_formatted( const wValue& value );
#endif
void write ( const mValue& value, std::ostream& os );
void write_formatted( const mValue& value, std::ostream& os );
std::string write ( const mValue& value );
std::string write_formatted( const mValue& value );
#ifndef BOOST_NO_STD_WSTRING
void write ( const wmValue& value, std::wostream& os );
void write_formatted( const wmValue& value, std::wostream& os );
std::wstring write ( const wmValue& value );
std::wstring write_formatted( const wmValue& value );
#endif
}
#endif

View File

@ -1,245 +1,245 @@
#ifndef JSON_SPIRIT_WRITER_TEMPLATE
#define JSON_SPIRIT_WRITER_TEMPLATE
// Copyright John W. Wilkinson 2007 - 2009.
// Distributed under the MIT License, see accompanying file LICENSE.txt
// json spirit version 4.03
#include "json_spirit_value.h"
#include <cassert>
#include <sstream>
#include <iomanip>
namespace json_spirit
{
inline char to_hex_char( unsigned int c )
{
assert( c <= 0xF );
const char ch = static_cast< char >( c );
if( ch < 10 ) return '0' + ch;
return 'A' - 10 + ch;
}
template< class String_type >
String_type non_printable_to_string( unsigned int c )
{
typedef typename String_type::value_type Char_type;
String_type result( 6, '\\' );
result[1] = 'u';
result[ 5 ] = to_hex_char( c & 0x000F ); c >>= 4;
result[ 4 ] = to_hex_char( c & 0x000F ); c >>= 4;
result[ 3 ] = to_hex_char( c & 0x000F ); c >>= 4;
result[ 2 ] = to_hex_char( c & 0x000F );
return result;
}
template< typename Char_type, class String_type >
bool add_esc_char( Char_type c, String_type& s )
{
switch( c )
{
case '"': s += to_str< String_type >( "\\\"" ); return true;
case '\\': s += to_str< String_type >( "\\\\" ); return true;
case '\b': s += to_str< String_type >( "\\b" ); return true;
case '\f': s += to_str< String_type >( "\\f" ); return true;
case '\n': s += to_str< String_type >( "\\n" ); return true;
case '\r': s += to_str< String_type >( "\\r" ); return true;
case '\t': s += to_str< String_type >( "\\t" ); return true;
}
return false;
}
template< class String_type >
String_type add_esc_chars( const String_type& s )
{
typedef typename String_type::const_iterator Iter_type;
typedef typename String_type::value_type Char_type;
String_type result;
const Iter_type end( s.end() );
for( Iter_type i = s.begin(); i != end; ++i )
{
const Char_type c( *i );
if( add_esc_char( c, result ) ) continue;
const wint_t unsigned_c( ( c >= 0 ) ? c : 256 + c );
if( iswprint( unsigned_c ) )
{
result += c;
}
else
{
result += non_printable_to_string< String_type >( unsigned_c );
}
}
return result;
}
// this class generates the JSON text,
// it keeps track of the indentation level etc.
//
template< class Value_type, class Ostream_type >
class Generator
{
typedef typename Value_type::Config_type Config_type;
typedef typename Config_type::String_type String_type;
typedef typename Config_type::Object_type Object_type;
typedef typename Config_type::Array_type Array_type;
typedef typename String_type::value_type Char_type;
typedef typename Object_type::value_type Obj_member_type;
public:
Generator( const Value_type& value, Ostream_type& os, bool pretty )
: os_( os )
, indentation_level_( 0 )
, pretty_( pretty )
{
output( value );
}
private:
void output( const Value_type& value )
{
switch( value.type() )
{
case obj_type: output( value.get_obj() ); break;
case array_type: output( value.get_array() ); break;
case str_type: output( value.get_str() ); break;
case bool_type: output( value.get_bool() ); break;
case int_type: output_int( value ); break;
case real_type: os_ << std::showpoint << std::setprecision( 16 )
<< value.get_real(); break;
case null_type: os_ << "null"; break;
default: assert( false );
}
}
void output( const Object_type& obj )
{
output_array_or_obj( obj, '{', '}' );
}
void output( const Array_type& arr )
{
output_array_or_obj( arr, '[', ']' );
}
void output( const Obj_member_type& member )
{
output( Config_type::get_name( member ) ); space();
os_ << ':'; space();
output( Config_type::get_value( member ) );
}
void output_int( const Value_type& value )
{
if( value.is_uint64() )
{
os_ << value.get_uint64();
}
else
{
os_ << value.get_int64();
}
}
void output( const String_type& s )
{
os_ << '"' << add_esc_chars( s ) << '"';
}
void output( bool b )
{
os_ << to_str< String_type >( b ? "true" : "false" );
}
template< class T >
void output_array_or_obj( const T& t, Char_type start_char, Char_type end_char )
{
os_ << start_char; new_line();
++indentation_level_;
for( typename T::const_iterator i = t.begin(); i != t.end(); ++i )
{
indent(); output( *i );
typename T::const_iterator next = i;
if( ++next != t.end())
{
os_ << ',';
}
new_line();
}
--indentation_level_;
indent(); os_ << end_char;
}
void indent()
{
if( !pretty_ ) return;
for( int i = 0; i < indentation_level_; ++i )
{
os_ << " ";
}
}
void space()
{
if( pretty_ ) os_ << ' ';
}
void new_line()
{
if( pretty_ ) os_ << '\n';
}
Generator& operator=( const Generator& ); // to prevent "assignment operator could not be generated" warning
Ostream_type& os_;
int indentation_level_;
bool pretty_;
};
template< class Value_type, class Ostream_type >
void write_stream( const Value_type& value, Ostream_type& os, bool pretty )
{
Generator< Value_type, Ostream_type >( value, os, pretty );
}
template< class Value_type >
typename Value_type::String_type write_string( const Value_type& value, bool pretty )
{
typedef typename Value_type::String_type::value_type Char_type;
std::basic_ostringstream< Char_type > os;
write_stream( value, os, pretty );
return os.str();
}
}
#endif
#ifndef JSON_SPIRIT_WRITER_TEMPLATE
#define JSON_SPIRIT_WRITER_TEMPLATE
// Copyright John W. Wilkinson 2007 - 2009.
// Distributed under the MIT License, see accompanying file LICENSE.txt
// json spirit version 4.03
#include "json_spirit_value.h"
#include <cassert>
#include <sstream>
#include <iomanip>
namespace json_spirit
{
inline char to_hex_char( unsigned int c )
{
assert( c <= 0xF );
const char ch = static_cast< char >( c );
if( ch < 10 ) return '0' + ch;
return 'A' - 10 + ch;
}
template< class String_type >
String_type non_printable_to_string( unsigned int c )
{
typedef typename String_type::value_type Char_type;
String_type result( 6, '\\' );
result[1] = 'u';
result[ 5 ] = to_hex_char( c & 0x000F ); c >>= 4;
result[ 4 ] = to_hex_char( c & 0x000F ); c >>= 4;
result[ 3 ] = to_hex_char( c & 0x000F ); c >>= 4;
result[ 2 ] = to_hex_char( c & 0x000F );
return result;
}
template< typename Char_type, class String_type >
bool add_esc_char( Char_type c, String_type& s )
{
switch( c )
{
case '"': s += to_str< String_type >( "\\\"" ); return true;
case '\\': s += to_str< String_type >( "\\\\" ); return true;
case '\b': s += to_str< String_type >( "\\b" ); return true;
case '\f': s += to_str< String_type >( "\\f" ); return true;
case '\n': s += to_str< String_type >( "\\n" ); return true;
case '\r': s += to_str< String_type >( "\\r" ); return true;
case '\t': s += to_str< String_type >( "\\t" ); return true;
}
return false;
}
template< class String_type >
String_type add_esc_chars( const String_type& s )
{
typedef typename String_type::const_iterator Iter_type;
typedef typename String_type::value_type Char_type;
String_type result;
const Iter_type end( s.end() );
for( Iter_type i = s.begin(); i != end; ++i )
{
const Char_type c( *i );
if( add_esc_char( c, result ) ) continue;
const wint_t unsigned_c( ( c >= 0 ) ? c : 256 + c );
if( iswprint( unsigned_c ) )
{
result += c;
}
else
{
result += non_printable_to_string< String_type >( unsigned_c );
}
}
return result;
}
// this class generates the JSON text,
// it keeps track of the indentation level etc.
//
template< class Value_type, class Ostream_type >
class Generator
{
typedef typename Value_type::Config_type Config_type;
typedef typename Config_type::String_type String_type;
typedef typename Config_type::Object_type Object_type;
typedef typename Config_type::Array_type Array_type;
typedef typename String_type::value_type Char_type;
typedef typename Object_type::value_type Obj_member_type;
public:
Generator( const Value_type& value, Ostream_type& os, bool pretty )
: os_( os )
, indentation_level_( 0 )
, pretty_( pretty )
{
output( value );
}
private:
void output( const Value_type& value )
{
switch( value.type() )
{
case obj_type: output( value.get_obj() ); break;
case array_type: output( value.get_array() ); break;
case str_type: output( value.get_str() ); break;
case bool_type: output( value.get_bool() ); break;
case int_type: output_int( value ); break;
case real_type: os_ << std::showpoint << std::setprecision( 16 )
<< value.get_real(); break;
case null_type: os_ << "null"; break;
default: assert( false );
}
}
void output( const Object_type& obj )
{
output_array_or_obj( obj, '{', '}' );
}
void output( const Array_type& arr )
{
output_array_or_obj( arr, '[', ']' );
}
void output( const Obj_member_type& member )
{
output( Config_type::get_name( member ) ); space();
os_ << ':'; space();
output( Config_type::get_value( member ) );
}
void output_int( const Value_type& value )
{
if( value.is_uint64() )
{
os_ << value.get_uint64();
}
else
{
os_ << value.get_int64();
}
}
void output( const String_type& s )
{
os_ << '"' << add_esc_chars( s ) << '"';
}
void output( bool b )
{
os_ << to_str< String_type >( b ? "true" : "false" );
}
template< class T >
void output_array_or_obj( const T& t, Char_type start_char, Char_type end_char )
{
os_ << start_char; new_line();
++indentation_level_;
for( typename T::const_iterator i = t.begin(); i != t.end(); ++i )
{
indent(); output( *i );
typename T::const_iterator next = i;
if( ++next != t.end())
{
os_ << ',';
}
new_line();
}
--indentation_level_;
indent(); os_ << end_char;
}
void indent()
{
if( !pretty_ ) return;
for( int i = 0; i < indentation_level_; ++i )
{
os_ << " ";
}
}
void space()
{
if( pretty_ ) os_ << ' ';
}
void new_line()
{
if( pretty_ ) os_ << '\n';
}
Generator& operator=( const Generator& ); // to prevent "assignment operator could not be generated" warning
Ostream_type& os_;
int indentation_level_;
bool pretty_;
};
template< class Value_type, class Ostream_type >
void write_stream( const Value_type& value, Ostream_type& os, bool pretty )
{
Generator< Value_type, Ostream_type >( value, os, pretty );
}
template< class Value_type >
typename Value_type::String_type write_string( const Value_type& value, bool pretty )
{
typedef typename Value_type::String_type::value_type Char_type;
std::basic_ostringstream< Char_type > os;
write_stream( value, os, pretty );
return os.str();
}
}
#endif

336
key.h
View File

@ -1,168 +1,168 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
// secp160k1
// const unsigned int PRIVATE_KEY_SIZE = 192;
// const unsigned int PUBLIC_KEY_SIZE = 41;
// const unsigned int SIGNATURE_SIZE = 48;
//
// secp192k1
// const unsigned int PRIVATE_KEY_SIZE = 222;
// const unsigned int PUBLIC_KEY_SIZE = 49;
// const unsigned int SIGNATURE_SIZE = 57;
//
// secp224k1
// const unsigned int PRIVATE_KEY_SIZE = 250;
// const unsigned int PUBLIC_KEY_SIZE = 57;
// const unsigned int SIGNATURE_SIZE = 66;
//
// secp256k1:
// const unsigned int PRIVATE_KEY_SIZE = 279;
// const unsigned int PUBLIC_KEY_SIZE = 65;
// const unsigned int SIGNATURE_SIZE = 72;
//
// see www.keylength.com
// script supports up to 75 for single byte push
class key_error : public std::runtime_error
{
public:
explicit key_error(const std::string& str) : std::runtime_error(str) {}
};
// secure_allocator is defined in serialize.h
typedef vector<unsigned char, secure_allocator<unsigned char> > CPrivKey;
class CKey
{
protected:
EC_KEY* pkey;
bool fSet;
public:
CKey()
{
pkey = EC_KEY_new_by_curve_name(NID_secp256k1);
if (pkey == NULL)
throw key_error("CKey::CKey() : EC_KEY_new_by_curve_name failed");
fSet = false;
}
CKey(const CKey& b)
{
pkey = EC_KEY_dup(b.pkey);
if (pkey == NULL)
throw key_error("CKey::CKey(const CKey&) : EC_KEY_dup failed");
fSet = b.fSet;
}
CKey& operator=(const CKey& b)
{
if (!EC_KEY_copy(pkey, b.pkey))
throw key_error("CKey::operator=(const CKey&) : EC_KEY_copy failed");
fSet = b.fSet;
return (*this);
}
~CKey()
{
EC_KEY_free(pkey);
}
bool IsNull() const
{
return !fSet;
}
void MakeNewKey()
{
if (!EC_KEY_generate_key(pkey))
throw key_error("CKey::MakeNewKey() : EC_KEY_generate_key failed");
fSet = true;
}
bool SetPrivKey(const CPrivKey& vchPrivKey)
{
const unsigned char* pbegin = &vchPrivKey[0];
if (!d2i_ECPrivateKey(&pkey, &pbegin, vchPrivKey.size()))
return false;
fSet = true;
return true;
}
CPrivKey GetPrivKey() const
{
unsigned int nSize = i2d_ECPrivateKey(pkey, NULL);
if (!nSize)
throw key_error("CKey::GetPrivKey() : i2d_ECPrivateKey failed");
CPrivKey vchPrivKey(nSize, 0);
unsigned char* pbegin = &vchPrivKey[0];
if (i2d_ECPrivateKey(pkey, &pbegin) != nSize)
throw key_error("CKey::GetPrivKey() : i2d_ECPrivateKey returned unexpected size");
return vchPrivKey;
}
bool SetPubKey(const vector<unsigned char>& vchPubKey)
{
const unsigned char* pbegin = &vchPubKey[0];
if (!o2i_ECPublicKey(&pkey, &pbegin, vchPubKey.size()))
return false;
fSet = true;
return true;
}
vector<unsigned char> GetPubKey() const
{
unsigned int nSize = i2o_ECPublicKey(pkey, NULL);
if (!nSize)
throw key_error("CKey::GetPubKey() : i2o_ECPublicKey failed");
vector<unsigned char> vchPubKey(nSize, 0);
unsigned char* pbegin = &vchPubKey[0];
if (i2o_ECPublicKey(pkey, &pbegin) != nSize)
throw key_error("CKey::GetPubKey() : i2o_ECPublicKey returned unexpected size");
return vchPubKey;
}
bool Sign(uint256 hash, vector<unsigned char>& vchSig)
{
vchSig.clear();
unsigned char pchSig[10000];
unsigned int nSize = 0;
if (!ECDSA_sign(0, (unsigned char*)&hash, sizeof(hash), pchSig, &nSize, pkey))
return false;
vchSig.resize(nSize);
memcpy(&vchSig[0], pchSig, nSize);
return true;
}
bool Verify(uint256 hash, const vector<unsigned char>& vchSig)
{
// -1 = error, 0 = bad sig, 1 = good
if (ECDSA_verify(0, (unsigned char*)&hash, sizeof(hash), &vchSig[0], vchSig.size(), pkey) != 1)
return false;
return true;
}
static bool Sign(const CPrivKey& vchPrivKey, uint256 hash, vector<unsigned char>& vchSig)
{
CKey key;
if (!key.SetPrivKey(vchPrivKey))
return false;
return key.Sign(hash, vchSig);
}
static bool Verify(const vector<unsigned char>& vchPubKey, uint256 hash, const vector<unsigned char>& vchSig)
{
CKey key;
if (!key.SetPubKey(vchPubKey))
return false;
return key.Verify(hash, vchSig);
}
};
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
// secp160k1
// const unsigned int PRIVATE_KEY_SIZE = 192;
// const unsigned int PUBLIC_KEY_SIZE = 41;
// const unsigned int SIGNATURE_SIZE = 48;
//
// secp192k1
// const unsigned int PRIVATE_KEY_SIZE = 222;
// const unsigned int PUBLIC_KEY_SIZE = 49;
// const unsigned int SIGNATURE_SIZE = 57;
//
// secp224k1
// const unsigned int PRIVATE_KEY_SIZE = 250;
// const unsigned int PUBLIC_KEY_SIZE = 57;
// const unsigned int SIGNATURE_SIZE = 66;
//
// secp256k1:
// const unsigned int PRIVATE_KEY_SIZE = 279;
// const unsigned int PUBLIC_KEY_SIZE = 65;
// const unsigned int SIGNATURE_SIZE = 72;
//
// see www.keylength.com
// script supports up to 75 for single byte push
class key_error : public std::runtime_error
{
public:
explicit key_error(const std::string& str) : std::runtime_error(str) {}
};
// secure_allocator is defined in serialize.h
typedef vector<unsigned char, secure_allocator<unsigned char> > CPrivKey;
class CKey
{
protected:
EC_KEY* pkey;
bool fSet;
public:
CKey()
{
pkey = EC_KEY_new_by_curve_name(NID_secp256k1);
if (pkey == NULL)
throw key_error("CKey::CKey() : EC_KEY_new_by_curve_name failed");
fSet = false;
}
CKey(const CKey& b)
{
pkey = EC_KEY_dup(b.pkey);
if (pkey == NULL)
throw key_error("CKey::CKey(const CKey&) : EC_KEY_dup failed");
fSet = b.fSet;
}
CKey& operator=(const CKey& b)
{
if (!EC_KEY_copy(pkey, b.pkey))
throw key_error("CKey::operator=(const CKey&) : EC_KEY_copy failed");
fSet = b.fSet;
return (*this);
}
~CKey()
{
EC_KEY_free(pkey);
}
bool IsNull() const
{
return !fSet;
}
void MakeNewKey()
{
if (!EC_KEY_generate_key(pkey))
throw key_error("CKey::MakeNewKey() : EC_KEY_generate_key failed");
fSet = true;
}
bool SetPrivKey(const CPrivKey& vchPrivKey)
{
const unsigned char* pbegin = &vchPrivKey[0];
if (!d2i_ECPrivateKey(&pkey, &pbegin, vchPrivKey.size()))
return false;
fSet = true;
return true;
}
CPrivKey GetPrivKey() const
{
unsigned int nSize = i2d_ECPrivateKey(pkey, NULL);
if (!nSize)
throw key_error("CKey::GetPrivKey() : i2d_ECPrivateKey failed");
CPrivKey vchPrivKey(nSize, 0);
unsigned char* pbegin = &vchPrivKey[0];
if (i2d_ECPrivateKey(pkey, &pbegin) != nSize)
throw key_error("CKey::GetPrivKey() : i2d_ECPrivateKey returned unexpected size");
return vchPrivKey;
}
bool SetPubKey(const vector<unsigned char>& vchPubKey)
{
const unsigned char* pbegin = &vchPubKey[0];
if (!o2i_ECPublicKey(&pkey, &pbegin, vchPubKey.size()))
return false;
fSet = true;
return true;
}
vector<unsigned char> GetPubKey() const
{
unsigned int nSize = i2o_ECPublicKey(pkey, NULL);
if (!nSize)
throw key_error("CKey::GetPubKey() : i2o_ECPublicKey failed");
vector<unsigned char> vchPubKey(nSize, 0);
unsigned char* pbegin = &vchPubKey[0];
if (i2o_ECPublicKey(pkey, &pbegin) != nSize)
throw key_error("CKey::GetPubKey() : i2o_ECPublicKey returned unexpected size");
return vchPubKey;
}
bool Sign(uint256 hash, vector<unsigned char>& vchSig)
{
vchSig.clear();
unsigned char pchSig[10000];
unsigned int nSize = 0;
if (!ECDSA_sign(0, (unsigned char*)&hash, sizeof(hash), pchSig, &nSize, pkey))
return false;
vchSig.resize(nSize);
memcpy(&vchSig[0], pchSig, nSize);
return true;
}
bool Verify(uint256 hash, const vector<unsigned char>& vchSig)
{
// -1 = error, 0 = bad sig, 1 = good
if (ECDSA_verify(0, (unsigned char*)&hash, sizeof(hash), &vchSig[0], vchSig.size(), pkey) != 1)
return false;
return true;
}
static bool Sign(const CPrivKey& vchPrivKey, uint256 hash, vector<unsigned char>& vchSig)
{
CKey key;
if (!key.SetPrivKey(vchPrivKey))
return false;
return key.Sign(hash, vchSig);
}
static bool Verify(const vector<unsigned char>& vchPubKey, uint256 hash, const vector<unsigned char>& vchSig)
{
CKey key;
if (!key.SetPubKey(vchPubKey))
return false;
return key.Verify(hash, vchSig);
}
};

View File

@ -1,19 +1,19 @@
Copyright (c) 2009-2010 Satoshi Nakamoto
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.
Copyright (c) 2009-2010 Satoshi Nakamoto
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.

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
put bitcoin.po and bitcoin.mo files at:
locale/<langcode>/LC_MESSAGES/bitcoin.mo and .po
.po is the sourcefile
.mo is the compiled translation
put bitcoin.po and bitcoin.mo files at:
locale/<langcode>/LC_MESSAGES/bitcoin.mo and .po
.po is the sourcefile
.mo is the compiled translation

6248
main.cpp

File diff suppressed because it is too large Load Diff

2846
main.h

File diff suppressed because it is too large Load Diff

View File

@ -1,76 +1,76 @@
# Copyright (c) 2009-2010 Satoshi Nakamoto
# Distributed under the MIT/X11 software license, see the accompanying
# file license.txt or http://www.opensource.org/licenses/mit-license.php.
# for wxWidgets-2.8.x, search and replace "mswud"->"mswd" and "29u"->"28"
INCLUDEPATHS= \
-I"/boost" \
-I"/db/build_unix" \
-I"/openssl/include" \
-I"/wxwidgets/lib/gcc_lib/mswud" \
-I"/wxwidgets/include"
LIBPATHS= \
-L"/boost/stage/lib" \
-L"/db/build_unix" \
-L"/openssl/out" \
-L"/wxwidgets/lib/gcc_lib"
WXLIBS= \
-l wxmsw29ud_html -l wxmsw29ud_core -l wxmsw29ud_adv -l wxbase29ud -l wxtiffd -l wxjpegd -l wxpngd -l wxzlibd
LIBS= \
-l libboost_system-mgw34-mt-d -l libboost_filesystem-mgw34-mt-d \
-l db_cxx \
-l eay32 \
-l kernel32 -l user32 -l gdi32 -l comdlg32 -l winspool -l winmm -l shell32 -l comctl32 -l ole32 -l oleaut32 -l uuid -l rpcrt4 -l advapi32 -l ws2_32 -l shlwapi
WXDEFS=-DWIN32 -D__WXMSW__ -D_WINDOWS -DNOPCH
DEBUGFLAGS=-g -D__WXDEBUG__
CFLAGS=-mthreads -O2 -w -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(WXDEFS) $(INCLUDEPATHS)
HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h init.h sha.h
all: bitcoin.exe
headers.h.gch: headers.h $(HEADERS)
g++ -c $(CFLAGS) -o $@ $<
obj/%.o: %.cpp $(HEADERS) headers.h.gch
g++ -c $(CFLAGS) -o $@ $<
obj/sha.o: sha.cpp sha.h
g++ -c $(CFLAGS) -O3 -o $@ $<
obj/ui_res.o: ui.rc rc/bitcoin.ico rc/check.ico rc/send16.bmp rc/send16mask.bmp rc/send16masknoshadow.bmp rc/send20.bmp rc/send20mask.bmp rc/addressbook16.bmp rc/addressbook16mask.bmp rc/addressbook20.bmp rc/addressbook20mask.bmp
windres $(WXDEFS) $(INCLUDEPATHS) -o $@ -i $<
OBJS= \
obj/util.o \
obj/script.o \
obj/db.o \
obj/net.o \
obj/irc.o \
obj/main.o \
obj/rpc.o \
obj/init.o
bitcoin.exe: $(OBJS) obj/ui.o obj/uibase.o obj/sha.o obj/ui_res.o
g++ $(CFLAGS) -mwindows -Wl,--subsystem,windows -o $@ $(LIBPATHS) $^ $(WXLIBS) $(LIBS)
obj/nogui/%.o: %.cpp $(HEADERS)
g++ -c $(CFLAGS) -DwxUSE_GUI=0 -o $@ $<
bitcoind.exe: $(OBJS:obj/%=obj/nogui/%) obj/sha.o obj/ui_res.o
g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ -l wxbase29ud $(LIBS)
clean:
-del /Q obj\*
-del /Q obj\nogui\*
-del /Q headers.h.gch
# Copyright (c) 2009-2010 Satoshi Nakamoto
# Distributed under the MIT/X11 software license, see the accompanying
# file license.txt or http://www.opensource.org/licenses/mit-license.php.
# for wxWidgets-2.8.x, search and replace "mswud"->"mswd" and "29u"->"28"
INCLUDEPATHS= \
-I"/boost" \
-I"/db/build_unix" \
-I"/openssl/include" \
-I"/wxwidgets/lib/gcc_lib/mswud" \
-I"/wxwidgets/include"
LIBPATHS= \
-L"/boost/stage/lib" \
-L"/db/build_unix" \
-L"/openssl/out" \
-L"/wxwidgets/lib/gcc_lib"
WXLIBS= \
-l wxmsw29ud_html -l wxmsw29ud_core -l wxmsw29ud_adv -l wxbase29ud -l wxtiffd -l wxjpegd -l wxpngd -l wxzlibd
LIBS= \
-l libboost_system-mgw34-mt-d -l libboost_filesystem-mgw34-mt-d \
-l db_cxx \
-l eay32 \
-l kernel32 -l user32 -l gdi32 -l comdlg32 -l winspool -l winmm -l shell32 -l comctl32 -l ole32 -l oleaut32 -l uuid -l rpcrt4 -l advapi32 -l ws2_32 -l shlwapi
WXDEFS=-DWIN32 -D__WXMSW__ -D_WINDOWS -DNOPCH
DEBUGFLAGS=-g -D__WXDEBUG__
CFLAGS=-mthreads -O2 -w -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(WXDEFS) $(INCLUDEPATHS)
HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h init.h sha.h
all: bitcoin.exe
headers.h.gch: headers.h $(HEADERS)
g++ -c $(CFLAGS) -o $@ $<
obj/%.o: %.cpp $(HEADERS) headers.h.gch
g++ -c $(CFLAGS) -o $@ $<
obj/sha.o: sha.cpp sha.h
g++ -c $(CFLAGS) -O3 -o $@ $<
obj/ui_res.o: ui.rc rc/bitcoin.ico rc/check.ico rc/send16.bmp rc/send16mask.bmp rc/send16masknoshadow.bmp rc/send20.bmp rc/send20mask.bmp rc/addressbook16.bmp rc/addressbook16mask.bmp rc/addressbook20.bmp rc/addressbook20mask.bmp
windres $(WXDEFS) $(INCLUDEPATHS) -o $@ -i $<
OBJS= \
obj/util.o \
obj/script.o \
obj/db.o \
obj/net.o \
obj/irc.o \
obj/main.o \
obj/rpc.o \
obj/init.o
bitcoin.exe: $(OBJS) obj/ui.o obj/uibase.o obj/sha.o obj/ui_res.o
g++ $(CFLAGS) -mwindows -Wl,--subsystem,windows -o $@ $(LIBPATHS) $^ $(WXLIBS) $(LIBS)
obj/nogui/%.o: %.cpp $(HEADERS)
g++ -c $(CFLAGS) -DwxUSE_GUI=0 -o $@ $<
bitcoind.exe: $(OBJS:obj/%=obj/nogui/%) obj/sha.o obj/ui_res.o
g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ -l wxbase29ud $(LIBS)
clean:
-del /Q obj\*
-del /Q obj\nogui\*
-del /Q headers.h.gch

View File

@ -1,65 +1,65 @@
# Copyright (c) 2009-2010 Satoshi Nakamoto
# Distributed under the MIT/X11 software license, see the accompanying
# file license.txt or http://www.opensource.org/licenses/mit-license.php.
# Mac OS X makefile for bitcoin
# Laszlo Hanyecz (solar@heliacal.net)
DEPSDIR=/Users/macosuser/bitcoin/deps
INCLUDEPATHS= \
-I"$(DEPSDIR)/include"
LIBPATHS= \
-L"$(DEPSDIR)/lib"
WXLIBS=$(shell $(DEPSDIR)/bin/wx-config --libs --static)
LIBS= -dead_strip \
$(DEPSDIR)/lib/libdb_cxx-4.8.a \
$(DEPSDIR)/lib/libboost_system.a \
$(DEPSDIR)/lib/libboost_filesystem.a \
$(DEPSDIR)/lib/libcrypto.a
WXDEFS=$(shell $(DEPSDIR)/bin/wx-config --cxxflags) -DNOPCH -DMSG_NOSIGNAL=0
DEBUGFLAGS=-g -DwxDEBUG_LEVEL=0
# ppc doesn't work because we don't support big-endian
CFLAGS=-mmacosx-version-min=10.5 -arch i386 -arch x86_64 -O2 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(WXDEFS) $(INCLUDEPATHS)
HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h init.h sha.h
all: bitcoin
obj/%.o: %.cpp $(HEADERS)
g++ -c $(CFLAGS) -o $@ $<
obj/sha.o: sha.cpp sha.h
g++ -c $(CFLAGS) -O3 -o $@ $<
OBJS= \
obj/util.o \
obj/script.o \
obj/db.o \
obj/net.o \
obj/irc.o \
obj/main.o \
obj/rpc.o \
obj/init.o
bitcoin: $(OBJS) obj/ui.o obj/uibase.o obj/sha.o
g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(WXLIBS) $(LIBS)
obj/nogui/%.o: %.cpp $(HEADERS)
g++ -c $(CFLAGS) -DwxUSE_GUI=0 -o $@ $<
bitcoind: $(OBJS:obj/%=obj/nogui/%) obj/sha.o
g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(WXLIBS) $(LIBS)
clean:
-rm -f obj/*.o
-rm -f obj/nogui/*.o
# Copyright (c) 2009-2010 Satoshi Nakamoto
# Distributed under the MIT/X11 software license, see the accompanying
# file license.txt or http://www.opensource.org/licenses/mit-license.php.
# Mac OS X makefile for bitcoin
# Laszlo Hanyecz (solar@heliacal.net)
DEPSDIR=/Users/macosuser/bitcoin/deps
INCLUDEPATHS= \
-I"$(DEPSDIR)/include"
LIBPATHS= \
-L"$(DEPSDIR)/lib"
WXLIBS=$(shell $(DEPSDIR)/bin/wx-config --libs --static)
LIBS= -dead_strip \
$(DEPSDIR)/lib/libdb_cxx-4.8.a \
$(DEPSDIR)/lib/libboost_system.a \
$(DEPSDIR)/lib/libboost_filesystem.a \
$(DEPSDIR)/lib/libcrypto.a
WXDEFS=$(shell $(DEPSDIR)/bin/wx-config --cxxflags) -DNOPCH -DMSG_NOSIGNAL=0
DEBUGFLAGS=-g -DwxDEBUG_LEVEL=0
# ppc doesn't work because we don't support big-endian
CFLAGS=-mmacosx-version-min=10.5 -arch i386 -arch x86_64 -O2 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(WXDEFS) $(INCLUDEPATHS)
HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h init.h sha.h
all: bitcoin
obj/%.o: %.cpp $(HEADERS)
g++ -c $(CFLAGS) -o $@ $<
obj/sha.o: sha.cpp sha.h
g++ -c $(CFLAGS) -O3 -o $@ $<
OBJS= \
obj/util.o \
obj/script.o \
obj/db.o \
obj/net.o \
obj/irc.o \
obj/main.o \
obj/rpc.o \
obj/init.o
bitcoin: $(OBJS) obj/ui.o obj/uibase.o obj/sha.o
g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(WXLIBS) $(LIBS)
obj/nogui/%.o: %.cpp $(HEADERS)
g++ -c $(CFLAGS) -DwxUSE_GUI=0 -o $@ $<
bitcoind: $(OBJS:obj/%=obj/nogui/%) obj/sha.o
g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(WXLIBS) $(LIBS)
clean:
-rm -f obj/*.o
-rm -f obj/nogui/*.o

View File

@ -1,73 +1,73 @@
# Copyright (c) 2009-2010 Satoshi Nakamoto
# Distributed under the MIT/X11 software license, see the accompanying
# file license.txt or http://www.opensource.org/licenses/mit-license.php.
INCLUDEPATHS= \
-I"/usr/include" \
-I"/usr/local/include/wx-2.9" \
-I"/usr/local/lib/wx/include/gtk2-unicode-debug-static-2.9"
LIBPATHS= \
-L"/usr/lib" \
-L"/usr/local/lib"
WXLIBS= \
-Wl,-Bstatic \
-l wx_gtk2ud-2.9 \
-Wl,-Bdynamic \
-l gtk-x11-2.0 -l SM
LIBS= \
-Wl,-Bstatic \
-l boost_system -l boost_filesystem \
-l db_cxx \
-Wl,-Bdynamic \
-l crypto \
-l gthread-2.0
WXDEFS=-D__WXGTK__ -DNOPCH
DEBUGFLAGS=-g -D__WXDEBUG__
CFLAGS=-O2 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(WXDEFS) $(INCLUDEPATHS)
HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h init.h sha.h
all: bitcoin
headers.h.gch: headers.h $(HEADERS)
g++ -c $(CFLAGS) -o $@ $<
obj/%.o: %.cpp $(HEADERS) headers.h.gch
g++ -c $(CFLAGS) -o $@ $<
obj/sha.o: sha.cpp sha.h
g++ -c $(CFLAGS) -O3 -o $@ $<
OBJS= \
obj/util.o \
obj/script.o \
obj/db.o \
obj/net.o \
obj/irc.o \
obj/main.o \
obj/rpc.o \
obj/init.o
bitcoin: $(OBJS) obj/ui.o obj/uibase.o obj/sha.o
g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(WXLIBS) $(LIBS)
obj/nogui/%.o: %.cpp $(HEADERS)
g++ -c $(CFLAGS) -DwxUSE_GUI=0 -o $@ $<
bitcoind: $(OBJS:obj/%=obj/nogui/%) obj/sha.o
g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ -l wx_baseud-2.9 $(LIBS)
clean:
-rm -f obj/*.o
-rm -f obj/nogui/*.o
-rm -f headers.h.gch
# Copyright (c) 2009-2010 Satoshi Nakamoto
# Distributed under the MIT/X11 software license, see the accompanying
# file license.txt or http://www.opensource.org/licenses/mit-license.php.
INCLUDEPATHS= \
-I"/usr/include" \
-I"/usr/local/include/wx-2.9" \
-I"/usr/local/lib/wx/include/gtk2-unicode-debug-static-2.9"
LIBPATHS= \
-L"/usr/lib" \
-L"/usr/local/lib"
WXLIBS= \
-Wl,-Bstatic \
-l wx_gtk2ud-2.9 \
-Wl,-Bdynamic \
-l gtk-x11-2.0 -l SM
LIBS= \
-Wl,-Bstatic \
-l boost_system -l boost_filesystem \
-l db_cxx \
-Wl,-Bdynamic \
-l crypto \
-l gthread-2.0
WXDEFS=-D__WXGTK__ -DNOPCH
DEBUGFLAGS=-g -D__WXDEBUG__
CFLAGS=-O2 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(WXDEFS) $(INCLUDEPATHS)
HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h init.h sha.h
all: bitcoin
headers.h.gch: headers.h $(HEADERS)
g++ -c $(CFLAGS) -o $@ $<
obj/%.o: %.cpp $(HEADERS) headers.h.gch
g++ -c $(CFLAGS) -o $@ $<
obj/sha.o: sha.cpp sha.h
g++ -c $(CFLAGS) -O3 -o $@ $<
OBJS= \
obj/util.o \
obj/script.o \
obj/db.o \
obj/net.o \
obj/irc.o \
obj/main.o \
obj/rpc.o \
obj/init.o
bitcoin: $(OBJS) obj/ui.o obj/uibase.o obj/sha.o
g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(WXLIBS) $(LIBS)
obj/nogui/%.o: %.cpp $(HEADERS)
g++ -c $(CFLAGS) -DwxUSE_GUI=0 -o $@ $<
bitcoind: $(OBJS:obj/%=obj/nogui/%) obj/sha.o
g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ -l wx_baseud-2.9 $(LIBS)
clean:
-rm -f obj/*.o
-rm -f obj/nogui/*.o
-rm -f headers.h.gch

View File

@ -1,107 +1,107 @@
# Copyright (c) 2009-2010 Satoshi Nakamoto
# Distributed under the MIT/X11 software license, see the accompanying
# file license.txt or http://www.opensource.org/licenses/mit-license.php.
# for wxWidgets-2.8.x, search and replace "mswud"->"mswd" and "29u"->"28"
INCLUDEPATHS= \
/I"/boost" \
/I"/db/build_windows" \
/I"/openssl/include" \
/I"/wxwidgets/lib/vc_lib/mswud" \
/I"/wxwidgets/include"
LIBPATHS= \
/LIBPATH:"/boost/stage/lib" \
/LIBPATH:"/db/build_windows/debug" \
/LIBPATH:"/openssl/out" \
/LIBPATH:"/wxwidgets/lib/vc_lib"
LIBS= \
libboost_system-vc80-mt-gd.lib libboost_filesystem-vc80-mt-gd.lib \
libdb47sd.lib \
libeay32.lib \
wxmsw29ud_html.lib wxmsw29ud_core.lib wxmsw29ud_adv.lib wxbase29ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib \
kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib ws2_32.lib shlwapi.lib
WXDEFS=/DWIN32 /D__WXMSW__ /D_WINDOWS /DNOPCH
DEBUGFLAGS=/Zi /Od /D__WXDEBUG__
CFLAGS=/c /nologo /Ob0 /MDd /EHsc /GR /Zm300 $(DEBUGFLAGS) $(WXDEFS) $(INCLUDEPATHS)
HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h init.h sha.h
all: bitcoin.exe
.cpp{obj}.obj:
cl $(CFLAGS) /Fo$@ %s
obj\util.obj: $(HEADERS)
obj\script.obj: $(HEADERS)
obj\db.obj: $(HEADERS)
obj\net.obj: $(HEADERS)
obj\irc.obj: $(HEADERS)
obj\main.obj: $(HEADERS)
obj\rpc.obj: $(HEADERS)
obj\init.obj: $(HEADERS)
obj\ui.obj: $(HEADERS)
obj\uibase.obj: $(HEADERS)
obj\sha.obj: sha.cpp sha.h
cl $(CFLAGS) /O2 /Fo$@ %s
obj\ui.res: ui.rc rc/bitcoin.ico rc/check.ico rc/send16.bmp rc/send16mask.bmp rc/send16masknoshadow.bmp rc/send20.bmp rc/send20mask.bmp rc/addressbook16.bmp rc/addressbook16mask.bmp rc/addressbook20.bmp rc/addressbook20mask.bmp
rc $(INCLUDEPATHS) $(WXDEFS) /Fo$@ %s
OBJS= \
obj\util.obj \
obj\script.obj \
obj\db.obj \
obj\net.obj \
obj\irc.obj \
obj\main.obj \
obj\rpc.obj \
obj\init.obj
bitcoin.exe: $(OBJS) obj\ui.obj obj\uibase.obj obj\sha.obj obj\ui.res
link /nologo /DEBUG /SUBSYSTEM:WINDOWS /OUT:$@ $(LIBPATHS) $** $(LIBS)
.cpp{obj\nogui}.obj:
cl $(CFLAGS) /DwxUSE_GUI=0 /Fo$@ %s
obj\nogui\util.obj: $(HEADERS)
obj\nogui\script.obj: $(HEADERS)
obj\nogui\db.obj: $(HEADERS)
obj\nogui\net.obj: $(HEADERS)
obj\nogui\irc.obj: $(HEADERS)
obj\nogui\main.obj: $(HEADERS)
obj\nogui\rpc.obj: $(HEADERS)
obj\nogui\init.obj: $(HEADERS)
bitcoind.exe: $(OBJS:obj\=obj\nogui\) obj\sha.obj obj\ui.res
link /nologo /DEBUG /OUT:$@ $(LIBPATHS) $** $(LIBS)
clean:
-del /Q obj\*
-del *.ilk
-del *.pdb
# Copyright (c) 2009-2010 Satoshi Nakamoto
# Distributed under the MIT/X11 software license, see the accompanying
# file license.txt or http://www.opensource.org/licenses/mit-license.php.
# for wxWidgets-2.8.x, search and replace "mswud"->"mswd" and "29u"->"28"
INCLUDEPATHS= \
/I"/boost" \
/I"/db/build_windows" \
/I"/openssl/include" \
/I"/wxwidgets/lib/vc_lib/mswud" \
/I"/wxwidgets/include"
LIBPATHS= \
/LIBPATH:"/boost/stage/lib" \
/LIBPATH:"/db/build_windows/debug" \
/LIBPATH:"/openssl/out" \
/LIBPATH:"/wxwidgets/lib/vc_lib"
LIBS= \
libboost_system-vc80-mt-gd.lib libboost_filesystem-vc80-mt-gd.lib \
libdb47sd.lib \
libeay32.lib \
wxmsw29ud_html.lib wxmsw29ud_core.lib wxmsw29ud_adv.lib wxbase29ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib \
kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib ws2_32.lib shlwapi.lib
WXDEFS=/DWIN32 /D__WXMSW__ /D_WINDOWS /DNOPCH
DEBUGFLAGS=/Zi /Od /D__WXDEBUG__
CFLAGS=/c /nologo /Ob0 /MDd /EHsc /GR /Zm300 $(DEBUGFLAGS) $(WXDEFS) $(INCLUDEPATHS)
HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h init.h sha.h
all: bitcoin.exe
.cpp{obj}.obj:
cl $(CFLAGS) /Fo$@ %s
obj\util.obj: $(HEADERS)
obj\script.obj: $(HEADERS)
obj\db.obj: $(HEADERS)
obj\net.obj: $(HEADERS)
obj\irc.obj: $(HEADERS)
obj\main.obj: $(HEADERS)
obj\rpc.obj: $(HEADERS)
obj\init.obj: $(HEADERS)
obj\ui.obj: $(HEADERS)
obj\uibase.obj: $(HEADERS)
obj\sha.obj: sha.cpp sha.h
cl $(CFLAGS) /O2 /Fo$@ %s
obj\ui.res: ui.rc rc/bitcoin.ico rc/check.ico rc/send16.bmp rc/send16mask.bmp rc/send16masknoshadow.bmp rc/send20.bmp rc/send20mask.bmp rc/addressbook16.bmp rc/addressbook16mask.bmp rc/addressbook20.bmp rc/addressbook20mask.bmp
rc $(INCLUDEPATHS) $(WXDEFS) /Fo$@ %s
OBJS= \
obj\util.obj \
obj\script.obj \
obj\db.obj \
obj\net.obj \
obj\irc.obj \
obj\main.obj \
obj\rpc.obj \
obj\init.obj
bitcoin.exe: $(OBJS) obj\ui.obj obj\uibase.obj obj\sha.obj obj\ui.res
link /nologo /DEBUG /SUBSYSTEM:WINDOWS /OUT:$@ $(LIBPATHS) $** $(LIBS)
.cpp{obj\nogui}.obj:
cl $(CFLAGS) /DwxUSE_GUI=0 /Fo$@ %s
obj\nogui\util.obj: $(HEADERS)
obj\nogui\script.obj: $(HEADERS)
obj\nogui\db.obj: $(HEADERS)
obj\nogui\net.obj: $(HEADERS)
obj\nogui\irc.obj: $(HEADERS)
obj\nogui\main.obj: $(HEADERS)
obj\nogui\rpc.obj: $(HEADERS)
obj\nogui\init.obj: $(HEADERS)
bitcoind.exe: $(OBJS:obj\=obj\nogui\) obj\sha.obj obj\ui.res
link /nologo /DEBUG /OUT:$@ $(LIBPATHS) $** $(LIBS)
clean:
-del /Q obj\*
-del *.ilk
-del *.pdb

2848
net.cpp

File diff suppressed because it is too large Load Diff

2104
net.h

File diff suppressed because it is too large Load Diff

1972
rpc.cpp

File diff suppressed because it is too large Load Diff

12
rpc.h
View File

@ -1,6 +1,6 @@
// Copyright (c) 2010 Satoshi Nakamoto
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
void ThreadRPCServer(void* parg);
int CommandLineRPC(int argc, char *argv[]);
// Copyright (c) 2010 Satoshi Nakamoto
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
void ThreadRPCServer(void* parg);
int CommandLineRPC(int argc, char *argv[]);

2268
script.cpp

File diff suppressed because it is too large Load Diff

1284
script.h

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

312
setup.nsi
View File

@ -1,156 +1,156 @@
# Auto-generated by EclipseNSIS Script Wizard
# 3.10.2009 19:00:28
Name Bitcoin
RequestExecutionLevel highest
# General Symbol Definitions
!define REGKEY "SOFTWARE\$(^Name)"
!define VERSION 0.3.0
!define COMPANY "Bitcoin project"
!define URL http://www.bitcoin.org/
# MUI Symbol Definitions
!define MUI_ICON "src\rc\bitcoin.ico"
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
!define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup
!define MUI_STARTMENUPAGE_DEFAULTFOLDER Bitcoin
!define MUI_FINISHPAGE_RUN $INSTDIR\bitcoin.exe
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
# Included files
!include Sections.nsh
!include MUI2.nsh
# Variables
Var StartMenuGroup
# Installer pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
# Installer languages
!insertmacro MUI_LANGUAGE English
# Installer attributes
OutFile bitcoin-0.3.0-win32-setup.exe
InstallDir $PROGRAMFILES\Bitcoin
CRCCheck on
XPStyle on
ShowInstDetails show
VIProductVersion 0.3.0.0
VIAddVersionKey ProductName Bitcoin
VIAddVersionKey ProductVersion "${VERSION}"
VIAddVersionKey CompanyName "${COMPANY}"
VIAddVersionKey CompanyWebsite "${URL}"
VIAddVersionKey FileVersion "${VERSION}"
VIAddVersionKey FileDescription ""
VIAddVersionKey LegalCopyright ""
InstallDirRegKey HKCU "${REGKEY}" Path
ShowUninstDetails show
# Installer sections
Section -Main SEC0000
SetOutPath $INSTDIR
SetOverwrite on
File bitcoin.exe
File libeay32.dll
File mingwm10.dll
File license.txt
File readme.txt
SetOutPath $INSTDIR\daemon
File /r daemon\*.*
SetOutPath $INSTDIR\locale
File /r locale\*.*
SetOutPath $INSTDIR\src
File /r src\*.*
SetOutPath $INSTDIR
WriteRegStr HKCU "${REGKEY}\Components" Main 1
SectionEnd
Section -post SEC0001
WriteRegStr HKCU "${REGKEY}" Path $INSTDIR
SetOutPath $INSTDIR
WriteUninstaller $INSTDIR\uninstall.exe
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateDirectory $SMPROGRAMS\$StartMenuGroup
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Bitcoin.lnk" $INSTDIR\bitcoin.exe
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall Bitcoin.lnk" $INSTDIR\uninstall.exe
!insertmacro MUI_STARTMENU_WRITE_END
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)"
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "${VERSION}"
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Publisher "${COMPANY}"
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}"
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\uninstall.exe
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe
WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1
WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1
SectionEnd
# Macro for selecting uninstaller sections
!macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID
Push $R0
ReadRegStr $R0 HKCU "${REGKEY}\Components" "${SECTION_NAME}"
StrCmp $R0 1 0 next${UNSECTION_ID}
!insertmacro SelectSection "${UNSECTION_ID}"
GoTo done${UNSECTION_ID}
next${UNSECTION_ID}:
!insertmacro UnselectSection "${UNSECTION_ID}"
done${UNSECTION_ID}:
Pop $R0
!macroend
# Uninstaller sections
Section /o -un.Main UNSEC0000
Delete /REBOOTOK $INSTDIR\bitcoin.exe
Delete /REBOOTOK $INSTDIR\libeay32.dll
Delete /REBOOTOK $INSTDIR\mingwm10.dll
Delete /REBOOTOK $INSTDIR\license.txt
Delete /REBOOTOK $INSTDIR\readme.txt
RMDir /r /REBOOTOK $INSTDIR\daemon
RMDir /r /REBOOTOK $INSTDIR\locale
RMDir /r /REBOOTOK $INSTDIR\src
DeleteRegValue HKCU "${REGKEY}\Components" Main
SectionEnd
Section -un.post UNSEC0001
DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall Bitcoin.lnk"
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Bitcoin.lnk"
Delete /REBOOTOK "$SMSTARTUP\Bitcoin.lnk"
Delete /REBOOTOK $INSTDIR\uninstall.exe
Delete /REBOOTOK $INSTDIR\debug.log
Delete /REBOOTOK $INSTDIR\db.log
DeleteRegValue HKCU "${REGKEY}" StartMenuGroup
DeleteRegValue HKCU "${REGKEY}" Path
DeleteRegKey /IfEmpty HKCU "${REGKEY}\Components"
DeleteRegKey /IfEmpty HKCU "${REGKEY}"
RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup
RmDir /REBOOTOK $INSTDIR
Push $R0
StrCpy $R0 $StartMenuGroup 1
StrCmp $R0 ">" no_smgroup
no_smgroup:
Pop $R0
SectionEnd
# Installer functions
Function .onInit
InitPluginsDir
FunctionEnd
# Uninstaller functions
Function un.onInit
ReadRegStr $INSTDIR HKCU "${REGKEY}" Path
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup
!insertmacro SELECT_UNSECTION Main ${UNSEC0000}
FunctionEnd
# Auto-generated by EclipseNSIS Script Wizard
# 3.10.2009 19:00:28
Name Bitcoin
RequestExecutionLevel highest
# General Symbol Definitions
!define REGKEY "SOFTWARE\$(^Name)"
!define VERSION 0.3.0
!define COMPANY "Bitcoin project"
!define URL http://www.bitcoin.org/
# MUI Symbol Definitions
!define MUI_ICON "src\rc\bitcoin.ico"
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
!define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup
!define MUI_STARTMENUPAGE_DEFAULTFOLDER Bitcoin
!define MUI_FINISHPAGE_RUN $INSTDIR\bitcoin.exe
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
# Included files
!include Sections.nsh
!include MUI2.nsh
# Variables
Var StartMenuGroup
# Installer pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
# Installer languages
!insertmacro MUI_LANGUAGE English
# Installer attributes
OutFile bitcoin-0.3.0-win32-setup.exe
InstallDir $PROGRAMFILES\Bitcoin
CRCCheck on
XPStyle on
ShowInstDetails show
VIProductVersion 0.3.0.0
VIAddVersionKey ProductName Bitcoin
VIAddVersionKey ProductVersion "${VERSION}"
VIAddVersionKey CompanyName "${COMPANY}"
VIAddVersionKey CompanyWebsite "${URL}"
VIAddVersionKey FileVersion "${VERSION}"
VIAddVersionKey FileDescription ""
VIAddVersionKey LegalCopyright ""
InstallDirRegKey HKCU "${REGKEY}" Path
ShowUninstDetails show
# Installer sections
Section -Main SEC0000
SetOutPath $INSTDIR
SetOverwrite on
File bitcoin.exe
File libeay32.dll
File mingwm10.dll
File license.txt
File readme.txt
SetOutPath $INSTDIR\daemon
File /r daemon\*.*
SetOutPath $INSTDIR\locale
File /r locale\*.*
SetOutPath $INSTDIR\src
File /r src\*.*
SetOutPath $INSTDIR
WriteRegStr HKCU "${REGKEY}\Components" Main 1
SectionEnd
Section -post SEC0001
WriteRegStr HKCU "${REGKEY}" Path $INSTDIR
SetOutPath $INSTDIR
WriteUninstaller $INSTDIR\uninstall.exe
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateDirectory $SMPROGRAMS\$StartMenuGroup
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Bitcoin.lnk" $INSTDIR\bitcoin.exe
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall Bitcoin.lnk" $INSTDIR\uninstall.exe
!insertmacro MUI_STARTMENU_WRITE_END
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)"
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "${VERSION}"
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Publisher "${COMPANY}"
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}"
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\uninstall.exe
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe
WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1
WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1
SectionEnd
# Macro for selecting uninstaller sections
!macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID
Push $R0
ReadRegStr $R0 HKCU "${REGKEY}\Components" "${SECTION_NAME}"
StrCmp $R0 1 0 next${UNSECTION_ID}
!insertmacro SelectSection "${UNSECTION_ID}"
GoTo done${UNSECTION_ID}
next${UNSECTION_ID}:
!insertmacro UnselectSection "${UNSECTION_ID}"
done${UNSECTION_ID}:
Pop $R0
!macroend
# Uninstaller sections
Section /o -un.Main UNSEC0000
Delete /REBOOTOK $INSTDIR\bitcoin.exe
Delete /REBOOTOK $INSTDIR\libeay32.dll
Delete /REBOOTOK $INSTDIR\mingwm10.dll
Delete /REBOOTOK $INSTDIR\license.txt
Delete /REBOOTOK $INSTDIR\readme.txt
RMDir /r /REBOOTOK $INSTDIR\daemon
RMDir /r /REBOOTOK $INSTDIR\locale
RMDir /r /REBOOTOK $INSTDIR\src
DeleteRegValue HKCU "${REGKEY}\Components" Main
SectionEnd
Section -un.post UNSEC0001
DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall Bitcoin.lnk"
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Bitcoin.lnk"
Delete /REBOOTOK "$SMSTARTUP\Bitcoin.lnk"
Delete /REBOOTOK $INSTDIR\uninstall.exe
Delete /REBOOTOK $INSTDIR\debug.log
Delete /REBOOTOK $INSTDIR\db.log
DeleteRegValue HKCU "${REGKEY}" StartMenuGroup
DeleteRegValue HKCU "${REGKEY}" Path
DeleteRegKey /IfEmpty HKCU "${REGKEY}\Components"
DeleteRegKey /IfEmpty HKCU "${REGKEY}"
RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup
RmDir /REBOOTOK $INSTDIR
Push $R0
StrCpy $R0 $StartMenuGroup 1
StrCmp $R0 ">" no_smgroup
no_smgroup:
Pop $R0
SectionEnd
# Installer functions
Function .onInit
InitPluginsDir
FunctionEnd
# Uninstaller functions
Function un.onInit
ReadRegStr $INSTDIR HKCU "${REGKEY}" Path
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup
!insertmacro SELECT_UNSECTION Main ${UNSEC0000}
FunctionEnd

1108
sha.cpp

File diff suppressed because it is too large Load Diff

354
sha.h
View File

@ -1,177 +1,177 @@
// This file is public domain
// SHA routines extracted as a standalone file from:
// Crypto++: a C++ Class Library of Cryptographic Schemes
// Version 5.5.2 (9/24/2007)
// http://www.cryptopp.com
#ifndef CRYPTOPP_SHA_H
#define CRYPTOPP_SHA_H
#include <stdlib.h>
namespace CryptoPP
{
//
// Dependencies
//
typedef unsigned char byte;
typedef unsigned short word16;
typedef unsigned int word32;
#if defined(_MSC_VER) || defined(__BORLANDC__)
typedef unsigned __int64 word64;
#else
typedef unsigned long long word64;
#endif
template <class T> inline T rotlFixed(T x, unsigned int y)
{
assert(y < sizeof(T)*8);
return T((x<<y) | (x>>(sizeof(T)*8-y)));
}
template <class T> inline T rotrFixed(T x, unsigned int y)
{
assert(y < sizeof(T)*8);
return T((x>>y) | (x<<(sizeof(T)*8-y)));
}
// ************** endian reversal ***************
#ifdef _MSC_VER
#if _MSC_VER >= 1400
#define CRYPTOPP_FAST_ROTATE(x) 1
#elif _MSC_VER >= 1300
#define CRYPTOPP_FAST_ROTATE(x) ((x) == 32 | (x) == 64)
#else
#define CRYPTOPP_FAST_ROTATE(x) ((x) == 32)
#endif
#elif (defined(__MWERKS__) && TARGET_CPU_PPC) || \
(defined(__GNUC__) && (defined(_ARCH_PWR2) || defined(_ARCH_PWR) || defined(_ARCH_PPC) || defined(_ARCH_PPC64) || defined(_ARCH_COM)))
#define CRYPTOPP_FAST_ROTATE(x) ((x) == 32)
#elif defined(__GNUC__) && (CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X86) // depend on GCC's peephole optimization to generate rotate instructions
#define CRYPTOPP_FAST_ROTATE(x) 1
#else
#define CRYPTOPP_FAST_ROTATE(x) 0
#endif
inline byte ByteReverse(byte value)
{
return value;
}
inline word16 ByteReverse(word16 value)
{
#ifdef CRYPTOPP_BYTESWAP_AVAILABLE
return bswap_16(value);
#elif defined(_MSC_VER) && _MSC_VER >= 1300
return _byteswap_ushort(value);
#else
return rotlFixed(value, 8U);
#endif
}
inline word32 ByteReverse(word32 value)
{
#if defined(__GNUC__)
__asm__ ("bswap %0" : "=r" (value) : "0" (value));
return value;
#elif defined(CRYPTOPP_BYTESWAP_AVAILABLE)
return bswap_32(value);
#elif defined(__MWERKS__) && TARGET_CPU_PPC
return (word32)__lwbrx(&value,0);
#elif _MSC_VER >= 1400 || (_MSC_VER >= 1300 && !defined(_DLL))
return _byteswap_ulong(value);
#elif CRYPTOPP_FAST_ROTATE(32)
// 5 instructions with rotate instruction, 9 without
return (rotrFixed(value, 8U) & 0xff00ff00) | (rotlFixed(value, 8U) & 0x00ff00ff);
#else
// 6 instructions with rotate instruction, 8 without
value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8);
return rotlFixed(value, 16U);
#endif
}
#ifdef WORD64_AVAILABLE
inline word64 ByteReverse(word64 value)
{
#if defined(__GNUC__) && defined(__x86_64__)
__asm__ ("bswap %0" : "=r" (value) : "0" (value));
return value;
#elif defined(CRYPTOPP_BYTESWAP_AVAILABLE)
return bswap_64(value);
#elif defined(_MSC_VER) && _MSC_VER >= 1300
return _byteswap_uint64(value);
#elif defined(CRYPTOPP_SLOW_WORD64)
return (word64(ByteReverse(word32(value))) << 32) | ByteReverse(word32(value>>32));
#else
value = ((value & W64LIT(0xFF00FF00FF00FF00)) >> 8) | ((value & W64LIT(0x00FF00FF00FF00FF)) << 8);
value = ((value & W64LIT(0xFFFF0000FFFF0000)) >> 16) | ((value & W64LIT(0x0000FFFF0000FFFF)) << 16);
return rotlFixed(value, 32U);
#endif
}
#endif
//
// SHA
//
// http://www.weidai.com/scan-mirror/md.html#SHA-1
class SHA1
{
public:
typedef word32 HashWordType;
static void InitState(word32 *state);
static void Transform(word32 *digest, const word32 *data);
static const char * StaticAlgorithmName() {return "SHA-1";}
};
typedef SHA1 SHA; // for backwards compatibility
// implements the SHA-256 standard
class SHA256
{
public:
typedef word32 HashWordType;
static void InitState(word32 *state);
static void Transform(word32 *digest, const word32 *data);
static const char * StaticAlgorithmName() {return "SHA-256";}
};
// implements the SHA-224 standard
class SHA224
{
public:
typedef word32 HashWordType;
static void InitState(word32 *state);
static void Transform(word32 *digest, const word32 *data) {SHA256::Transform(digest, data);}
static const char * StaticAlgorithmName() {return "SHA-224";}
};
#ifdef WORD64_AVAILABLE
// implements the SHA-512 standard
class SHA512
{
public:
typedef word64 HashWordType;
static void InitState(word64 *state);
static void Transform(word64 *digest, const word64 *data);
static const char * StaticAlgorithmName() {return "SHA-512";}
};
// implements the SHA-384 standard
class SHA384
{
public:
typedef word64 HashWordType;
static void InitState(word64 *state);
static void Transform(word64 *digest, const word64 *data) {SHA512::Transform(digest, data);}
static const char * StaticAlgorithmName() {return "SHA-384";}
};
#endif
}
#endif
// This file is public domain
// SHA routines extracted as a standalone file from:
// Crypto++: a C++ Class Library of Cryptographic Schemes
// Version 5.5.2 (9/24/2007)
// http://www.cryptopp.com
#ifndef CRYPTOPP_SHA_H
#define CRYPTOPP_SHA_H
#include <stdlib.h>
namespace CryptoPP
{
//
// Dependencies
//
typedef unsigned char byte;
typedef unsigned short word16;
typedef unsigned int word32;
#if defined(_MSC_VER) || defined(__BORLANDC__)
typedef unsigned __int64 word64;
#else
typedef unsigned long long word64;
#endif
template <class T> inline T rotlFixed(T x, unsigned int y)
{
assert(y < sizeof(T)*8);
return T((x<<y) | (x>>(sizeof(T)*8-y)));
}
template <class T> inline T rotrFixed(T x, unsigned int y)
{
assert(y < sizeof(T)*8);
return T((x>>y) | (x<<(sizeof(T)*8-y)));
}
// ************** endian reversal ***************
#ifdef _MSC_VER
#if _MSC_VER >= 1400
#define CRYPTOPP_FAST_ROTATE(x) 1
#elif _MSC_VER >= 1300
#define CRYPTOPP_FAST_ROTATE(x) ((x) == 32 | (x) == 64)
#else
#define CRYPTOPP_FAST_ROTATE(x) ((x) == 32)
#endif
#elif (defined(__MWERKS__) && TARGET_CPU_PPC) || \
(defined(__GNUC__) && (defined(_ARCH_PWR2) || defined(_ARCH_PWR) || defined(_ARCH_PPC) || defined(_ARCH_PPC64) || defined(_ARCH_COM)))
#define CRYPTOPP_FAST_ROTATE(x) ((x) == 32)
#elif defined(__GNUC__) && (CRYPTOPP_BOOL_X64 || CRYPTOPP_BOOL_X86) // depend on GCC's peephole optimization to generate rotate instructions
#define CRYPTOPP_FAST_ROTATE(x) 1
#else
#define CRYPTOPP_FAST_ROTATE(x) 0
#endif
inline byte ByteReverse(byte value)
{
return value;
}
inline word16 ByteReverse(word16 value)
{
#ifdef CRYPTOPP_BYTESWAP_AVAILABLE
return bswap_16(value);
#elif defined(_MSC_VER) && _MSC_VER >= 1300
return _byteswap_ushort(value);
#else
return rotlFixed(value, 8U);
#endif
}
inline word32 ByteReverse(word32 value)
{
#if defined(__GNUC__)
__asm__ ("bswap %0" : "=r" (value) : "0" (value));
return value;
#elif defined(CRYPTOPP_BYTESWAP_AVAILABLE)
return bswap_32(value);
#elif defined(__MWERKS__) && TARGET_CPU_PPC
return (word32)__lwbrx(&value,0);
#elif _MSC_VER >= 1400 || (_MSC_VER >= 1300 && !defined(_DLL))
return _byteswap_ulong(value);
#elif CRYPTOPP_FAST_ROTATE(32)
// 5 instructions with rotate instruction, 9 without
return (rotrFixed(value, 8U) & 0xff00ff00) | (rotlFixed(value, 8U) & 0x00ff00ff);
#else
// 6 instructions with rotate instruction, 8 without
value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8);
return rotlFixed(value, 16U);
#endif
}
#ifdef WORD64_AVAILABLE
inline word64 ByteReverse(word64 value)
{
#if defined(__GNUC__) && defined(__x86_64__)
__asm__ ("bswap %0" : "=r" (value) : "0" (value));
return value;
#elif defined(CRYPTOPP_BYTESWAP_AVAILABLE)
return bswap_64(value);
#elif defined(_MSC_VER) && _MSC_VER >= 1300
return _byteswap_uint64(value);
#elif defined(CRYPTOPP_SLOW_WORD64)
return (word64(ByteReverse(word32(value))) << 32) | ByteReverse(word32(value>>32));
#else
value = ((value & W64LIT(0xFF00FF00FF00FF00)) >> 8) | ((value & W64LIT(0x00FF00FF00FF00FF)) << 8);
value = ((value & W64LIT(0xFFFF0000FFFF0000)) >> 16) | ((value & W64LIT(0x0000FFFF0000FFFF)) << 16);
return rotlFixed(value, 32U);
#endif
}
#endif
//
// SHA
//
// http://www.weidai.com/scan-mirror/md.html#SHA-1
class SHA1
{
public:
typedef word32 HashWordType;
static void InitState(word32 *state);
static void Transform(word32 *digest, const word32 *data);
static const char * StaticAlgorithmName() {return "SHA-1";}
};
typedef SHA1 SHA; // for backwards compatibility
// implements the SHA-256 standard
class SHA256
{
public:
typedef word32 HashWordType;
static void InitState(word32 *state);
static void Transform(word32 *digest, const word32 *data);
static const char * StaticAlgorithmName() {return "SHA-256";}
};
// implements the SHA-224 standard
class SHA224
{
public:
typedef word32 HashWordType;
static void InitState(word32 *state);
static void Transform(word32 *digest, const word32 *data) {SHA256::Transform(digest, data);}
static const char * StaticAlgorithmName() {return "SHA-224";}
};
#ifdef WORD64_AVAILABLE
// implements the SHA-512 standard
class SHA512
{
public:
typedef word64 HashWordType;
static void InitState(word64 *state);
static void Transform(word64 *digest, const word64 *data);
static const char * StaticAlgorithmName() {return "SHA-512";}
};
// implements the SHA-384 standard
class SHA384
{
public:
typedef word64 HashWordType;
static void InitState(word64 *state);
static void Transform(word64 *digest, const word64 *data) {SHA512::Transform(digest, data);}
static const char * StaticAlgorithmName() {return "SHA-384";}
};
#endif
}
#endif

168
strlcpy.h
View File

@ -1,84 +1,84 @@
/*
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/*
* Copy src to string dst of size siz. At most siz-1 characters
* will be copied. Always NUL terminates (unless siz == 0).
* Returns strlen(src); if retval >= siz, truncation occurred.
*/
inline size_t strlcpy(char *dst, const char *src, size_t siz)
{
char *d = dst;
const char *s = src;
size_t n = siz;
/* Copy as many bytes as will fit */
if (n != 0)
{
while (--n != 0)
{
if ((*d++ = *s++) == '\0')
break;
}
}
/* Not enough room in dst, add NUL and traverse rest of src */
if (n == 0)
{
if (siz != 0)
*d = '\0'; /* NUL-terminate dst */
while (*s++)
;
}
return(s - src - 1); /* count does not include NUL */
}
/*
* Appends src to string dst of size siz (unlike strncat, siz is the
* full size of dst, not space left). At most siz-1 characters
* will be copied. Always NUL terminates (unless siz <= strlen(dst)).
* Returns strlen(src) + MIN(siz, strlen(initial dst)).
* If retval >= siz, truncation occurred.
*/
inline size_t strlcat(char *dst, const char *src, size_t siz)
{
char *d = dst;
const char *s = src;
size_t n = siz;
size_t dlen;
/* Find the end of dst and adjust bytes left but don't go past end */
while (n-- != 0 && *d != '\0')
d++;
dlen = d - dst;
n = siz - dlen;
if (n == 0)
return(dlen + strlen(s));
while (*s != '\0')
{
if (n != 1)
{
*d++ = *s;
n--;
}
s++;
}
*d = '\0';
return(dlen + (s - src)); /* count does not include NUL */
}
/*
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/*
* Copy src to string dst of size siz. At most siz-1 characters
* will be copied. Always NUL terminates (unless siz == 0).
* Returns strlen(src); if retval >= siz, truncation occurred.
*/
inline size_t strlcpy(char *dst, const char *src, size_t siz)
{
char *d = dst;
const char *s = src;
size_t n = siz;
/* Copy as many bytes as will fit */
if (n != 0)
{
while (--n != 0)
{
if ((*d++ = *s++) == '\0')
break;
}
}
/* Not enough room in dst, add NUL and traverse rest of src */
if (n == 0)
{
if (siz != 0)
*d = '\0'; /* NUL-terminate dst */
while (*s++)
;
}
return(s - src - 1); /* count does not include NUL */
}
/*
* Appends src to string dst of size siz (unlike strncat, siz is the
* full size of dst, not space left). At most siz-1 characters
* will be copied. Always NUL terminates (unless siz <= strlen(dst)).
* Returns strlen(src) + MIN(siz, strlen(initial dst)).
* If retval >= siz, truncation occurred.
*/
inline size_t strlcat(char *dst, const char *src, size_t siz)
{
char *d = dst;
const char *s = src;
size_t n = siz;
size_t dlen;
/* Find the end of dst and adjust bytes left but don't go past end */
while (n-- != 0 && *d != '\0')
d++;
dlen = d - dst;
n = siz - dlen;
if (n == 0)
return(dlen + strlen(s));
while (*s != '\0')
{
if (n != 1)
{
*d++ = *s;
n--;
}
s++;
}
*d = '\0';
return(dlen + (s - src)); /* count does not include NUL */
}

5090
ui.cpp

File diff suppressed because it is too large Load Diff

758
ui.h
View File

@ -1,379 +1,379 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
DECLARE_EVENT_TYPE(wxEVT_UITHREADCALL, -1)
#if wxUSE_GUI
static const bool fGUI=true;
#else
static const bool fGUI=false;
#endif
inline int MyMessageBox(const wxString& message, const wxString& caption="Message", int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1)
{
#if wxUSE_GUI
if (!fDaemon)
return wxMessageBox(message, caption, style, parent, x, y);
#endif
printf("wxMessageBox %s: %s\n", string(caption).c_str(), string(message).c_str());
fprintf(stderr, "%s: %s\n", string(caption).c_str(), string(message).c_str());
return wxOK;
}
#define wxMessageBox MyMessageBox
void HandleCtrlA(wxKeyEvent& event);
string FormatTxStatus(const CWalletTx& wtx);
void UIThreadCall(boost::function0<void>);
int ThreadSafeMessageBox(const string& message, const string& caption="Message", int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1);
bool ThreadSafeAskFee(int64 nFeeRequired, const string& strCaption, wxWindow* parent);
void CalledSetStatusBar(const string& strText, int nField);
void MainFrameRepaint();
void CreateMainWindow();
#if !wxUSE_GUI
inline int ThreadSafeMessageBox(const string& message, const string& caption, int style, wxWindow* parent, int x, int y)
{
return MyMessageBox(message, caption, style, parent, x, y);
}
inline bool ThreadSafeAskFee(int64 nFeeRequired, const string& strCaption, wxWindow* parent)
{
return true;
}
inline void CalledSetStatusBar(const string& strText, int nField)
{
}
inline void UIThreadCall(boost::function0<void> fn)
{
}
inline void MainFrameRepaint()
{
}
inline void CreateMainWindow()
{
}
#else // wxUSE_GUI
class CMainFrame : public CMainFrameBase
{
protected:
// Event handlers
void OnNotebookPageChanged(wxNotebookEvent& event);
void OnClose(wxCloseEvent& event);
void OnIconize(wxIconizeEvent& event);
void OnMouseEvents(wxMouseEvent& event);
void OnKeyDown(wxKeyEvent& event) { HandleCtrlA(event); }
void OnIdle(wxIdleEvent& event);
void OnPaint(wxPaintEvent& event);
void OnPaintListCtrl(wxPaintEvent& event);
void OnMenuFileExit(wxCommandEvent& event);
void OnMenuOptionsGenerate(wxCommandEvent& event);
void OnUpdateUIOptionsGenerate(wxUpdateUIEvent& event);
void OnMenuOptionsChangeYourAddress(wxCommandEvent& event);
void OnMenuOptionsOptions(wxCommandEvent& event);
void OnMenuHelpAbout(wxCommandEvent& event);
void OnButtonSend(wxCommandEvent& event);
void OnButtonAddressBook(wxCommandEvent& event);
void OnSetFocusAddress(wxFocusEvent& event);
void OnMouseEventsAddress(wxMouseEvent& event);
void OnButtonNew(wxCommandEvent& event);
void OnButtonCopy(wxCommandEvent& event);
void OnListColBeginDrag(wxListEvent& event);
void OnListItemActivated(wxListEvent& event);
void OnListItemActivatedProductsSent(wxListEvent& event);
void OnListItemActivatedOrdersSent(wxListEvent& event);
void OnListItemActivatedOrdersReceived(wxListEvent& event);
public:
/** Constructor */
CMainFrame(wxWindow* parent);
~CMainFrame();
// Custom
enum
{
ALL = 0,
SENTRECEIVED = 1,
SENT = 2,
RECEIVED = 3,
};
int nPage;
wxListCtrl* m_listCtrl;
bool fShowGenerated;
bool fShowSent;
bool fShowReceived;
bool fRefreshListCtrl;
bool fRefreshListCtrlRunning;
bool fOnSetFocusAddress;
unsigned int nListViewUpdated;
bool fRefresh;
void OnUIThreadCall(wxCommandEvent& event);
int GetSortIndex(const string& strSort);
void InsertLine(bool fNew, int nIndex, uint256 hashKey, string strSort, const wxString& str1, const wxString& str2, const wxString& str3, const wxString& str4, const wxString& str5);
bool DeleteLine(uint256 hashKey);
bool InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex=-1);
void RefreshListCtrl();
void RefreshStatusColumn();
};
class CTxDetailsDialog : public CTxDetailsDialogBase
{
protected:
// Event handlers
void OnButtonOK(wxCommandEvent& event);
public:
/** Constructor */
CTxDetailsDialog(wxWindow* parent, CWalletTx wtx);
// State
CWalletTx wtx;
};
class COptionsDialog : public COptionsDialogBase
{
protected:
// Event handlers
void OnListBox(wxCommandEvent& event);
void OnKillFocusTransactionFee(wxFocusEvent& event);
void OnCheckBoxLimitProcessors(wxCommandEvent& event);
void OnCheckBoxUseProxy(wxCommandEvent& event);
void OnKillFocusProxy(wxFocusEvent& event);
void OnButtonOK(wxCommandEvent& event);
void OnButtonCancel(wxCommandEvent& event);
void OnButtonApply(wxCommandEvent& event);
public:
/** Constructor */
COptionsDialog(wxWindow* parent);
// Custom
bool fTmpStartOnSystemStartup;
bool fTmpMinimizeOnClose;
void SelectPage(int nPage);
CAddress GetProxyAddr();
};
class CAboutDialog : public CAboutDialogBase
{
protected:
// Event handlers
void OnButtonOK(wxCommandEvent& event);
public:
/** Constructor */
CAboutDialog(wxWindow* parent);
};
class CSendDialog : public CSendDialogBase
{
protected:
// Event handlers
void OnKeyDown(wxKeyEvent& event) { HandleCtrlA(event); }
void OnTextAddress(wxCommandEvent& event);
void OnKillFocusAmount(wxFocusEvent& event);
void OnButtonAddressBook(wxCommandEvent& event);
void OnButtonPaste(wxCommandEvent& event);
void OnButtonSend(wxCommandEvent& event);
void OnButtonCancel(wxCommandEvent& event);
public:
/** Constructor */
CSendDialog(wxWindow* parent, const wxString& strAddress="");
// Custom
bool fEnabledPrev;
string strFromSave;
string strMessageSave;
};
class CSendingDialog : public CSendingDialogBase
{
public:
// Event handlers
void OnClose(wxCloseEvent& event);
void OnButtonOK(wxCommandEvent& event);
void OnButtonCancel(wxCommandEvent& event);
void OnPaint(wxPaintEvent& event);
public:
/** Constructor */
CSendingDialog(wxWindow* parent, const CAddress& addrIn, int64 nPriceIn, const CWalletTx& wtxIn);
~CSendingDialog();
// State
CAddress addr;
int64 nPrice;
CWalletTx wtx;
wxDateTime start;
char pszStatus[10000];
bool fCanCancel;
bool fAbort;
bool fSuccess;
bool fUIDone;
bool fWorkDone;
void Close();
void Repaint();
bool Status();
bool Status(const string& str);
bool Error(const string& str);
void StartTransfer();
void OnReply2(CDataStream& vRecv);
void OnReply3(CDataStream& vRecv);
};
void SendingDialogStartTransfer(void* parg);
void SendingDialogOnReply2(void* parg, CDataStream& vRecv);
void SendingDialogOnReply3(void* parg, CDataStream& vRecv);
class CAddressBookDialog : public CAddressBookDialogBase
{
protected:
// Event handlers
void OnNotebookPageChanged(wxNotebookEvent& event);
void OnListEndLabelEdit(wxListEvent& event);
void OnListItemSelected(wxListEvent& event);
void OnListItemActivated(wxListEvent& event);
void OnButtonDelete(wxCommandEvent& event);
void OnButtonCopy(wxCommandEvent& event);
void OnButtonEdit(wxCommandEvent& event);
void OnButtonNew(wxCommandEvent& event);
void OnButtonOK(wxCommandEvent& event);
void OnButtonCancel(wxCommandEvent& event);
void OnClose(wxCloseEvent& event);
public:
/** Constructor */
CAddressBookDialog(wxWindow* parent, const wxString& strInitSelected, int nPageIn, bool fDuringSendIn);
// Custom
enum
{
SENDING = 0,
RECEIVING = 1,
};
int nPage;
wxListCtrl* m_listCtrl;
bool fDuringSend;
wxString GetAddress();
wxString GetSelectedAddress();
wxString GetSelectedSendingAddress();
wxString GetSelectedReceivingAddress();
bool CheckIfMine(const string& strAddress, const string& strTitle);
};
class CGetTextFromUserDialog : public CGetTextFromUserDialogBase
{
protected:
// Event handlers
void OnButtonOK(wxCommandEvent& event) { EndModal(true); }
void OnButtonCancel(wxCommandEvent& event) { EndModal(false); }
void OnClose(wxCloseEvent& event) { EndModal(false); }
void OnKeyDown(wxKeyEvent& event)
{
if (event.GetKeyCode() == '\r' || event.GetKeyCode() == WXK_NUMPAD_ENTER)
EndModal(true);
else
HandleCtrlA(event);
}
public:
/** Constructor */
CGetTextFromUserDialog(wxWindow* parent,
const string& strCaption,
const string& strMessage1,
const string& strValue1="",
const string& strMessage2="",
const string& strValue2="") : CGetTextFromUserDialogBase(parent, wxID_ANY, strCaption)
{
int x = GetSize().GetWidth();
int y = GetSize().GetHeight();
m_staticTextMessage1->SetLabel(strMessage1);
m_textCtrl1->SetValue(strValue1);
y += wxString(strMessage1).Freq('\n') * 14;
if (!strMessage2.empty())
{
m_staticTextMessage2->Show(true);
m_staticTextMessage2->SetLabel(strMessage2);
m_textCtrl2->Show(true);
m_textCtrl2->SetValue(strValue2);
y += 46 + wxString(strMessage2).Freq('\n') * 14;
}
if (!fWindows)
{
x *= 1.14;
y *= 1.14;
}
SetSize(x, y);
}
// Custom
string GetValue() { return (string)m_textCtrl1->GetValue(); }
string GetValue1() { return (string)m_textCtrl1->GetValue(); }
string GetValue2() { return (string)m_textCtrl2->GetValue(); }
};
class CMyTaskBarIcon : public wxTaskBarIcon
{
protected:
// Event handlers
void OnLeftButtonDClick(wxTaskBarIconEvent& event);
void OnMenuRestore(wxCommandEvent& event);
void OnMenuOptions(wxCommandEvent& event);
void OnUpdateUIGenerate(wxUpdateUIEvent& event);
void OnMenuGenerate(wxCommandEvent& event);
void OnMenuExit(wxCommandEvent& event);
public:
CMyTaskBarIcon() : wxTaskBarIcon()
{
Show(true);
}
void Show(bool fShow=true);
void Hide();
void Restore();
void UpdateTooltip();
virtual wxMenu* CreatePopupMenu();
DECLARE_EVENT_TABLE()
};
#endif // wxUSE_GUI
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
DECLARE_EVENT_TYPE(wxEVT_UITHREADCALL, -1)
#if wxUSE_GUI
static const bool fGUI=true;
#else
static const bool fGUI=false;
#endif
inline int MyMessageBox(const wxString& message, const wxString& caption="Message", int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1)
{
#if wxUSE_GUI
if (!fDaemon)
return wxMessageBox(message, caption, style, parent, x, y);
#endif
printf("wxMessageBox %s: %s\n", string(caption).c_str(), string(message).c_str());
fprintf(stderr, "%s: %s\n", string(caption).c_str(), string(message).c_str());
return wxOK;
}
#define wxMessageBox MyMessageBox
void HandleCtrlA(wxKeyEvent& event);
string FormatTxStatus(const CWalletTx& wtx);
void UIThreadCall(boost::function0<void>);
int ThreadSafeMessageBox(const string& message, const string& caption="Message", int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1);
bool ThreadSafeAskFee(int64 nFeeRequired, const string& strCaption, wxWindow* parent);
void CalledSetStatusBar(const string& strText, int nField);
void MainFrameRepaint();
void CreateMainWindow();
#if !wxUSE_GUI
inline int ThreadSafeMessageBox(const string& message, const string& caption, int style, wxWindow* parent, int x, int y)
{
return MyMessageBox(message, caption, style, parent, x, y);
}
inline bool ThreadSafeAskFee(int64 nFeeRequired, const string& strCaption, wxWindow* parent)
{
return true;
}
inline void CalledSetStatusBar(const string& strText, int nField)
{
}
inline void UIThreadCall(boost::function0<void> fn)
{
}
inline void MainFrameRepaint()
{
}
inline void CreateMainWindow()
{
}
#else // wxUSE_GUI
class CMainFrame : public CMainFrameBase
{
protected:
// Event handlers
void OnNotebookPageChanged(wxNotebookEvent& event);
void OnClose(wxCloseEvent& event);
void OnIconize(wxIconizeEvent& event);
void OnMouseEvents(wxMouseEvent& event);
void OnKeyDown(wxKeyEvent& event) { HandleCtrlA(event); }
void OnIdle(wxIdleEvent& event);
void OnPaint(wxPaintEvent& event);
void OnPaintListCtrl(wxPaintEvent& event);
void OnMenuFileExit(wxCommandEvent& event);
void OnMenuOptionsGenerate(wxCommandEvent& event);
void OnUpdateUIOptionsGenerate(wxUpdateUIEvent& event);
void OnMenuOptionsChangeYourAddress(wxCommandEvent& event);
void OnMenuOptionsOptions(wxCommandEvent& event);
void OnMenuHelpAbout(wxCommandEvent& event);
void OnButtonSend(wxCommandEvent& event);
void OnButtonAddressBook(wxCommandEvent& event);
void OnSetFocusAddress(wxFocusEvent& event);
void OnMouseEventsAddress(wxMouseEvent& event);
void OnButtonNew(wxCommandEvent& event);
void OnButtonCopy(wxCommandEvent& event);
void OnListColBeginDrag(wxListEvent& event);
void OnListItemActivated(wxListEvent& event);
void OnListItemActivatedProductsSent(wxListEvent& event);
void OnListItemActivatedOrdersSent(wxListEvent& event);
void OnListItemActivatedOrdersReceived(wxListEvent& event);
public:
/** Constructor */
CMainFrame(wxWindow* parent);
~CMainFrame();
// Custom
enum
{
ALL = 0,
SENTRECEIVED = 1,
SENT = 2,
RECEIVED = 3,
};
int nPage;
wxListCtrl* m_listCtrl;
bool fShowGenerated;
bool fShowSent;
bool fShowReceived;
bool fRefreshListCtrl;
bool fRefreshListCtrlRunning;
bool fOnSetFocusAddress;
unsigned int nListViewUpdated;
bool fRefresh;
void OnUIThreadCall(wxCommandEvent& event);
int GetSortIndex(const string& strSort);
void InsertLine(bool fNew, int nIndex, uint256 hashKey, string strSort, const wxString& str1, const wxString& str2, const wxString& str3, const wxString& str4, const wxString& str5);
bool DeleteLine(uint256 hashKey);
bool InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex=-1);
void RefreshListCtrl();
void RefreshStatusColumn();
};
class CTxDetailsDialog : public CTxDetailsDialogBase
{
protected:
// Event handlers
void OnButtonOK(wxCommandEvent& event);
public:
/** Constructor */
CTxDetailsDialog(wxWindow* parent, CWalletTx wtx);
// State
CWalletTx wtx;
};
class COptionsDialog : public COptionsDialogBase
{
protected:
// Event handlers
void OnListBox(wxCommandEvent& event);
void OnKillFocusTransactionFee(wxFocusEvent& event);
void OnCheckBoxLimitProcessors(wxCommandEvent& event);
void OnCheckBoxUseProxy(wxCommandEvent& event);
void OnKillFocusProxy(wxFocusEvent& event);
void OnButtonOK(wxCommandEvent& event);
void OnButtonCancel(wxCommandEvent& event);
void OnButtonApply(wxCommandEvent& event);
public:
/** Constructor */
COptionsDialog(wxWindow* parent);
// Custom
bool fTmpStartOnSystemStartup;
bool fTmpMinimizeOnClose;
void SelectPage(int nPage);
CAddress GetProxyAddr();
};
class CAboutDialog : public CAboutDialogBase
{
protected:
// Event handlers
void OnButtonOK(wxCommandEvent& event);
public:
/** Constructor */
CAboutDialog(wxWindow* parent);
};
class CSendDialog : public CSendDialogBase
{
protected:
// Event handlers
void OnKeyDown(wxKeyEvent& event) { HandleCtrlA(event); }
void OnTextAddress(wxCommandEvent& event);
void OnKillFocusAmount(wxFocusEvent& event);
void OnButtonAddressBook(wxCommandEvent& event);
void OnButtonPaste(wxCommandEvent& event);
void OnButtonSend(wxCommandEvent& event);
void OnButtonCancel(wxCommandEvent& event);
public:
/** Constructor */
CSendDialog(wxWindow* parent, const wxString& strAddress="");
// Custom
bool fEnabledPrev;
string strFromSave;
string strMessageSave;
};
class CSendingDialog : public CSendingDialogBase
{
public:
// Event handlers
void OnClose(wxCloseEvent& event);
void OnButtonOK(wxCommandEvent& event);
void OnButtonCancel(wxCommandEvent& event);
void OnPaint(wxPaintEvent& event);
public:
/** Constructor */
CSendingDialog(wxWindow* parent, const CAddress& addrIn, int64 nPriceIn, const CWalletTx& wtxIn);
~CSendingDialog();
// State
CAddress addr;
int64 nPrice;
CWalletTx wtx;
wxDateTime start;
char pszStatus[10000];
bool fCanCancel;
bool fAbort;
bool fSuccess;
bool fUIDone;
bool fWorkDone;
void Close();
void Repaint();
bool Status();
bool Status(const string& str);
bool Error(const string& str);
void StartTransfer();
void OnReply2(CDataStream& vRecv);
void OnReply3(CDataStream& vRecv);
};
void SendingDialogStartTransfer(void* parg);
void SendingDialogOnReply2(void* parg, CDataStream& vRecv);
void SendingDialogOnReply3(void* parg, CDataStream& vRecv);
class CAddressBookDialog : public CAddressBookDialogBase
{
protected:
// Event handlers
void OnNotebookPageChanged(wxNotebookEvent& event);
void OnListEndLabelEdit(wxListEvent& event);
void OnListItemSelected(wxListEvent& event);
void OnListItemActivated(wxListEvent& event);
void OnButtonDelete(wxCommandEvent& event);
void OnButtonCopy(wxCommandEvent& event);
void OnButtonEdit(wxCommandEvent& event);
void OnButtonNew(wxCommandEvent& event);
void OnButtonOK(wxCommandEvent& event);
void OnButtonCancel(wxCommandEvent& event);
void OnClose(wxCloseEvent& event);
public:
/** Constructor */
CAddressBookDialog(wxWindow* parent, const wxString& strInitSelected, int nPageIn, bool fDuringSendIn);
// Custom
enum
{
SENDING = 0,
RECEIVING = 1,
};
int nPage;
wxListCtrl* m_listCtrl;
bool fDuringSend;
wxString GetAddress();
wxString GetSelectedAddress();
wxString GetSelectedSendingAddress();
wxString GetSelectedReceivingAddress();
bool CheckIfMine(const string& strAddress, const string& strTitle);
};
class CGetTextFromUserDialog : public CGetTextFromUserDialogBase
{
protected:
// Event handlers
void OnButtonOK(wxCommandEvent& event) { EndModal(true); }
void OnButtonCancel(wxCommandEvent& event) { EndModal(false); }
void OnClose(wxCloseEvent& event) { EndModal(false); }
void OnKeyDown(wxKeyEvent& event)
{
if (event.GetKeyCode() == '\r' || event.GetKeyCode() == WXK_NUMPAD_ENTER)
EndModal(true);
else
HandleCtrlA(event);
}
public:
/** Constructor */
CGetTextFromUserDialog(wxWindow* parent,
const string& strCaption,
const string& strMessage1,
const string& strValue1="",
const string& strMessage2="",
const string& strValue2="") : CGetTextFromUserDialogBase(parent, wxID_ANY, strCaption)
{
int x = GetSize().GetWidth();
int y = GetSize().GetHeight();
m_staticTextMessage1->SetLabel(strMessage1);
m_textCtrl1->SetValue(strValue1);
y += wxString(strMessage1).Freq('\n') * 14;
if (!strMessage2.empty())
{
m_staticTextMessage2->Show(true);
m_staticTextMessage2->SetLabel(strMessage2);
m_textCtrl2->Show(true);
m_textCtrl2->SetValue(strValue2);
y += 46 + wxString(strMessage2).Freq('\n') * 14;
}
if (!fWindows)
{
x *= 1.14;
y *= 1.14;
}
SetSize(x, y);
}
// Custom
string GetValue() { return (string)m_textCtrl1->GetValue(); }
string GetValue1() { return (string)m_textCtrl1->GetValue(); }
string GetValue2() { return (string)m_textCtrl2->GetValue(); }
};
class CMyTaskBarIcon : public wxTaskBarIcon
{
protected:
// Event handlers
void OnLeftButtonDClick(wxTaskBarIconEvent& event);
void OnMenuRestore(wxCommandEvent& event);
void OnMenuOptions(wxCommandEvent& event);
void OnUpdateUIGenerate(wxUpdateUIEvent& event);
void OnMenuGenerate(wxCommandEvent& event);
void OnMenuExit(wxCommandEvent& event);
public:
CMyTaskBarIcon() : wxTaskBarIcon()
{
Show(true);
}
void Show(bool fShow=true);
void Hide();
void Restore();
void UpdateTooltip();
virtual wxMenu* CreatePopupMenu();
DECLARE_EVENT_TABLE()
};
#endif // wxUSE_GUI

30
ui.rc
View File

@ -1,15 +1,15 @@
bitcoin ICON "rc/bitcoin.ico"
#include "wx/msw/wx.rc"
check ICON "rc/check.ico"
send16 BITMAP "rc/send16.bmp"
send16mask BITMAP "rc/send16mask.bmp"
send16masknoshadow BITMAP "rc/send16masknoshadow.bmp"
send20 BITMAP "rc/send20.bmp"
send20mask BITMAP "rc/send20mask.bmp"
addressbook16 BITMAP "rc/addressbook16.bmp"
addressbook16mask BITMAP "rc/addressbook16mask.bmp"
addressbook20 BITMAP "rc/addressbook20.bmp"
addressbook20mask BITMAP "rc/addressbook20mask.bmp"
favicon ICON "rc/favicon.ico"
bitcoin ICON "rc/bitcoin.ico"
#include "wx/msw/wx.rc"
check ICON "rc/check.ico"
send16 BITMAP "rc/send16.bmp"
send16mask BITMAP "rc/send16mask.bmp"
send16masknoshadow BITMAP "rc/send16masknoshadow.bmp"
send20 BITMAP "rc/send20.bmp"
send20mask BITMAP "rc/send20mask.bmp"
addressbook16 BITMAP "rc/addressbook16.bmp"
addressbook16mask BITMAP "rc/addressbook16mask.bmp"
addressbook20 BITMAP "rc/addressbook20.bmp"
addressbook20mask BITMAP "rc/addressbook20mask.bmp"
favicon ICON "rc/favicon.ico"

2146
uibase.cpp

File diff suppressed because it is too large Load Diff

844
uibase.h
View File

@ -1,422 +1,422 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __uibase__
#define __uibase__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/menu.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/toolbar.h>
#include <wx/statusbr.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/button.h>
#include <wx/sizer.h>
#include <wx/choice.h>
#include <wx/listctrl.h>
#include <wx/panel.h>
#include <wx/notebook.h>
#include <wx/frame.h>
#include <wx/html/htmlwin.h>
#include <wx/dialog.h>
#include <wx/listbox.h>
#include <wx/checkbox.h>
#include <wx/spinctrl.h>
#include <wx/scrolwin.h>
#include <wx/statbmp.h>
///////////////////////////////////////////////////////////////////////////
#define wxID_MAINFRAME 1000
#define wxID_OPTIONSGENERATEBITCOINS 1001
#define wxID_BUTTONSEND 1002
#define wxID_BUTTONRECEIVE 1003
#define wxID_TEXTCTRLADDRESS 1004
#define wxID_BUTTONNEW 1005
#define wxID_BUTTONCOPY 1006
#define wxID_TRANSACTIONFEE 1007
#define wxID_PROXYIP 1008
#define wxID_PROXYPORT 1009
#define wxID_TEXTCTRLPAYTO 1010
#define wxID_BUTTONPASTE 1011
#define wxID_BUTTONADDRESSBOOK 1012
#define wxID_TEXTCTRLAMOUNT 1013
#define wxID_CHOICETRANSFERTYPE 1014
#define wxID_LISTCTRL 1015
#define wxID_BUTTONRENAME 1016
#define wxID_PANELSENDING 1017
#define wxID_LISTCTRLSENDING 1018
#define wxID_PANELRECEIVING 1019
#define wxID_LISTCTRLRECEIVING 1020
#define wxID_BUTTONDELETE 1021
#define wxID_BUTTONEDIT 1022
#define wxID_TEXTCTRL 1023
///////////////////////////////////////////////////////////////////////////////
/// Class CMainFrameBase
///////////////////////////////////////////////////////////////////////////////
class CMainFrameBase : public wxFrame
{
private:
protected:
wxMenuBar* m_menubar;
wxMenu* m_menuFile;
wxMenu* m_menuHelp;
wxToolBar* m_toolBar;
wxStaticText* m_staticText32;
wxButton* m_buttonNew;
wxButton* m_buttonCopy;
wxStaticText* m_staticText41;
wxStaticText* m_staticTextBalance;
wxChoice* m_choiceFilter;
wxNotebook* m_notebook;
wxPanel* m_panel9;
wxPanel* m_panel91;
wxPanel* m_panel92;
wxPanel* m_panel93;
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ){ event.Skip(); }
virtual void OnIconize( wxIconizeEvent& event ){ event.Skip(); }
virtual void OnIdle( wxIdleEvent& event ){ event.Skip(); }
virtual void OnMouseEvents( wxMouseEvent& event ){ event.Skip(); }
virtual void OnPaint( wxPaintEvent& event ){ event.Skip(); }
virtual void OnMenuFileExit( wxCommandEvent& event ){ event.Skip(); }
virtual void OnMenuOptionsGenerate( wxCommandEvent& event ){ event.Skip(); }
virtual void OnUpdateUIOptionsGenerate( wxUpdateUIEvent& event ){ event.Skip(); }
virtual void OnMenuOptionsChangeYourAddress( wxCommandEvent& event ){ event.Skip(); }
virtual void OnMenuOptionsOptions( wxCommandEvent& event ){ event.Skip(); }
virtual void OnMenuHelpAbout( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonSend( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonAddressBook( wxCommandEvent& event ){ event.Skip(); }
virtual void OnKeyDown( wxKeyEvent& event ){ event.Skip(); }
virtual void OnMouseEventsAddress( wxMouseEvent& event ){ event.Skip(); }
virtual void OnSetFocusAddress( wxFocusEvent& event ){ event.Skip(); }
virtual void OnButtonNew( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonCopy( wxCommandEvent& event ){ event.Skip(); }
virtual void OnNotebookPageChanged( wxNotebookEvent& event ){ event.Skip(); }
virtual void OnListColBeginDrag( wxListEvent& event ){ event.Skip(); }
virtual void OnListItemActivated( wxListEvent& event ){ event.Skip(); }
virtual void OnPaintListCtrl( wxPaintEvent& event ){ event.Skip(); }
public:
wxMenu* m_menuOptions;
wxStatusBar* m_statusBar;
wxTextCtrl* m_textCtrlAddress;
wxListCtrl* m_listCtrlAll;
wxListCtrl* m_listCtrlSentReceived;
wxListCtrl* m_listCtrlSent;
wxListCtrl* m_listCtrlReceived;
CMainFrameBase( wxWindow* parent, wxWindowID id = wxID_MAINFRAME, const wxString& title = _("Bitcoin"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 723,484 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL );
~CMainFrameBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class CTxDetailsDialogBase
///////////////////////////////////////////////////////////////////////////////
class CTxDetailsDialogBase : public wxDialog
{
private:
protected:
wxHtmlWindow* m_htmlWin;
wxButton* m_buttonOK;
// Virtual event handlers, overide them in your derived class
virtual void OnButtonOK( wxCommandEvent& event ){ event.Skip(); }
public:
CTxDetailsDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Transaction Details"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 620,450 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~CTxDetailsDialogBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class COptionsDialogBase
///////////////////////////////////////////////////////////////////////////////
class COptionsDialogBase : public wxDialog
{
private:
protected:
wxListBox* m_listBox;
wxScrolledWindow* m_scrolledWindow;
wxPanel* m_panelMain;
wxStaticText* m_staticText32;
wxStaticText* m_staticText31;
wxTextCtrl* m_textCtrlTransactionFee;
wxCheckBox* m_checkBoxLimitProcessors;
wxSpinCtrl* m_spinCtrlLimitProcessors;
wxStaticText* m_staticText35;
wxCheckBox* m_checkBoxStartOnSystemStartup;
wxCheckBox* m_checkBoxMinimizeToTray;
wxCheckBox* m_checkBoxMinimizeOnClose;
wxCheckBox* m_checkBoxUseProxy;
wxStaticText* m_staticTextProxyIP;
wxTextCtrl* m_textCtrlProxyIP;
wxStaticText* m_staticTextProxyPort;
wxTextCtrl* m_textCtrlProxyPort;
wxPanel* m_panelTest2;
wxStaticText* m_staticText321;
wxStaticText* m_staticText69;
wxButton* m_buttonOK;
wxButton* m_buttonCancel;
wxButton* m_buttonApply;
// Virtual event handlers, overide them in your derived class
virtual void OnListBox( wxCommandEvent& event ){ event.Skip(); }
virtual void OnKillFocusTransactionFee( wxFocusEvent& event ){ event.Skip(); }
virtual void OnCheckBoxLimitProcessors( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCheckBoxMinimizeToTray( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCheckBoxUseProxy( wxCommandEvent& event ){ event.Skip(); }
virtual void OnKillFocusProxy( wxFocusEvent& event ){ event.Skip(); }
virtual void OnButtonOK( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonCancel( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonApply( wxCommandEvent& event ){ event.Skip(); }
public:
COptionsDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 540,360 ), long style = wxDEFAULT_DIALOG_STYLE );
~COptionsDialogBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class CAboutDialogBase
///////////////////////////////////////////////////////////////////////////////
class CAboutDialogBase : public wxDialog
{
private:
protected:
wxStaticBitmap* m_bitmap;
wxStaticText* m_staticText40;
wxStaticText* m_staticTextMain;
wxButton* m_buttonOK;
// Virtual event handlers, overide them in your derived class
virtual void OnButtonOK( wxCommandEvent& event ){ event.Skip(); }
public:
wxStaticText* m_staticTextVersion;
CAboutDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About Bitcoin"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 532,329 ), long style = wxDEFAULT_DIALOG_STYLE );
~CAboutDialogBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class CSendDialogBase
///////////////////////////////////////////////////////////////////////////////
class CSendDialogBase : public wxDialog
{
private:
protected:
wxStaticText* m_staticTextInstructions;
wxStaticBitmap* m_bitmapCheckMark;
wxStaticText* m_staticText36;
wxTextCtrl* m_textCtrlAddress;
wxButton* m_buttonPaste;
wxButton* m_buttonAddress;
wxStaticText* m_staticText19;
wxTextCtrl* m_textCtrlAmount;
wxStaticText* m_staticText20;
wxChoice* m_choiceTransferType;
wxStaticText* m_staticTextFrom;
wxTextCtrl* m_textCtrlFrom;
wxStaticText* m_staticTextMessage;
wxTextCtrl* m_textCtrlMessage;
wxButton* m_buttonSend;
wxButton* m_buttonCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnKeyDown( wxKeyEvent& event ){ event.Skip(); }
virtual void OnTextAddress( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonPaste( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonAddressBook( wxCommandEvent& event ){ event.Skip(); }
virtual void OnKillFocusAmount( wxFocusEvent& event ){ event.Skip(); }
virtual void OnButtonSend( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonCancel( wxCommandEvent& event ){ event.Skip(); }
public:
CSendDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Send Coins"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 675,298 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~CSendDialogBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class CSendingDialogBase
///////////////////////////////////////////////////////////////////////////////
class CSendingDialogBase : public wxDialog
{
private:
protected:
wxStaticText* m_staticTextSending;
wxTextCtrl* m_textCtrlStatus;
wxButton* m_buttonOK;
wxButton* m_buttonCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ){ event.Skip(); }
virtual void OnPaint( wxPaintEvent& event ){ event.Skip(); }
virtual void OnButtonOK( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonCancel( wxCommandEvent& event ){ event.Skip(); }
public:
CSendingDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Sending..."), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 442,151 ), long style = wxDEFAULT_DIALOG_STYLE );
~CSendingDialogBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class CYourAddressDialogBase
///////////////////////////////////////////////////////////////////////////////
class CYourAddressDialogBase : public wxDialog
{
private:
protected:
wxStaticText* m_staticText45;
wxListCtrl* m_listCtrl;
wxButton* m_buttonRename;
wxButton* m_buttonNew;
wxButton* m_buttonCopy;
wxButton* m_buttonOK;
wxButton* m_buttonCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ){ event.Skip(); }
virtual void OnListEndLabelEdit( wxListEvent& event ){ event.Skip(); }
virtual void OnListItemActivated( wxListEvent& event ){ event.Skip(); }
virtual void OnListItemSelected( wxListEvent& event ){ event.Skip(); }
virtual void OnButtonRename( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonNew( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonCopy( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonOK( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonCancel( wxCommandEvent& event ){ event.Skip(); }
public:
CYourAddressDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Your Bitcoin Addresses"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 610,390 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~CYourAddressDialogBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class CAddressBookDialogBase
///////////////////////////////////////////////////////////////////////////////
class CAddressBookDialogBase : public wxDialog
{
private:
protected:
wxNotebook* m_notebook;
wxPanel* m_panelSending;
wxStaticText* m_staticText55;
wxListCtrl* m_listCtrlSending;
wxPanel* m_panelReceiving;
wxStaticText* m_staticText45;
wxListCtrl* m_listCtrlReceiving;
wxButton* m_buttonDelete;
wxButton* m_buttonCopy;
wxButton* m_buttonEdit;
wxButton* m_buttonNew;
wxButton* m_buttonOK;
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ){ event.Skip(); }
virtual void OnNotebookPageChanged( wxNotebookEvent& event ){ event.Skip(); }
virtual void OnListEndLabelEdit( wxListEvent& event ){ event.Skip(); }
virtual void OnListItemActivated( wxListEvent& event ){ event.Skip(); }
virtual void OnListItemSelected( wxListEvent& event ){ event.Skip(); }
virtual void OnButtonDelete( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonCopy( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonEdit( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonNew( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonOK( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonCancel( wxCommandEvent& event ){ event.Skip(); }
public:
wxButton* m_buttonCancel;
CAddressBookDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Address Book"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 610,390 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~CAddressBookDialogBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class CGetTextFromUserDialogBase
///////////////////////////////////////////////////////////////////////////////
class CGetTextFromUserDialogBase : public wxDialog
{
private:
protected:
wxStaticText* m_staticTextMessage1;
wxTextCtrl* m_textCtrl1;
wxStaticText* m_staticTextMessage2;
wxTextCtrl* m_textCtrl2;
wxButton* m_buttonOK;
wxButton* m_buttonCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ){ event.Skip(); }
virtual void OnKeyDown( wxKeyEvent& event ){ event.Skip(); }
virtual void OnButtonOK( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonCancel( wxCommandEvent& event ){ event.Skip(); }
public:
CGetTextFromUserDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 440,138 ), long style = wxDEFAULT_DIALOG_STYLE );
~CGetTextFromUserDialogBase();
};
#endif //__uibase__
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __uibase__
#define __uibase__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/menu.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/toolbar.h>
#include <wx/statusbr.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/button.h>
#include <wx/sizer.h>
#include <wx/choice.h>
#include <wx/listctrl.h>
#include <wx/panel.h>
#include <wx/notebook.h>
#include <wx/frame.h>
#include <wx/html/htmlwin.h>
#include <wx/dialog.h>
#include <wx/listbox.h>
#include <wx/checkbox.h>
#include <wx/spinctrl.h>
#include <wx/scrolwin.h>
#include <wx/statbmp.h>
///////////////////////////////////////////////////////////////////////////
#define wxID_MAINFRAME 1000
#define wxID_OPTIONSGENERATEBITCOINS 1001
#define wxID_BUTTONSEND 1002
#define wxID_BUTTONRECEIVE 1003
#define wxID_TEXTCTRLADDRESS 1004
#define wxID_BUTTONNEW 1005
#define wxID_BUTTONCOPY 1006
#define wxID_TRANSACTIONFEE 1007
#define wxID_PROXYIP 1008
#define wxID_PROXYPORT 1009
#define wxID_TEXTCTRLPAYTO 1010
#define wxID_BUTTONPASTE 1011
#define wxID_BUTTONADDRESSBOOK 1012
#define wxID_TEXTCTRLAMOUNT 1013
#define wxID_CHOICETRANSFERTYPE 1014
#define wxID_LISTCTRL 1015
#define wxID_BUTTONRENAME 1016
#define wxID_PANELSENDING 1017
#define wxID_LISTCTRLSENDING 1018
#define wxID_PANELRECEIVING 1019
#define wxID_LISTCTRLRECEIVING 1020
#define wxID_BUTTONDELETE 1021
#define wxID_BUTTONEDIT 1022
#define wxID_TEXTCTRL 1023
///////////////////////////////////////////////////////////////////////////////
/// Class CMainFrameBase
///////////////////////////////////////////////////////////////////////////////
class CMainFrameBase : public wxFrame
{
private:
protected:
wxMenuBar* m_menubar;
wxMenu* m_menuFile;
wxMenu* m_menuHelp;
wxToolBar* m_toolBar;
wxStaticText* m_staticText32;
wxButton* m_buttonNew;
wxButton* m_buttonCopy;
wxStaticText* m_staticText41;
wxStaticText* m_staticTextBalance;
wxChoice* m_choiceFilter;
wxNotebook* m_notebook;
wxPanel* m_panel9;
wxPanel* m_panel91;
wxPanel* m_panel92;
wxPanel* m_panel93;
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ){ event.Skip(); }
virtual void OnIconize( wxIconizeEvent& event ){ event.Skip(); }
virtual void OnIdle( wxIdleEvent& event ){ event.Skip(); }
virtual void OnMouseEvents( wxMouseEvent& event ){ event.Skip(); }
virtual void OnPaint( wxPaintEvent& event ){ event.Skip(); }
virtual void OnMenuFileExit( wxCommandEvent& event ){ event.Skip(); }
virtual void OnMenuOptionsGenerate( wxCommandEvent& event ){ event.Skip(); }
virtual void OnUpdateUIOptionsGenerate( wxUpdateUIEvent& event ){ event.Skip(); }
virtual void OnMenuOptionsChangeYourAddress( wxCommandEvent& event ){ event.Skip(); }
virtual void OnMenuOptionsOptions( wxCommandEvent& event ){ event.Skip(); }
virtual void OnMenuHelpAbout( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonSend( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonAddressBook( wxCommandEvent& event ){ event.Skip(); }
virtual void OnKeyDown( wxKeyEvent& event ){ event.Skip(); }
virtual void OnMouseEventsAddress( wxMouseEvent& event ){ event.Skip(); }
virtual void OnSetFocusAddress( wxFocusEvent& event ){ event.Skip(); }
virtual void OnButtonNew( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonCopy( wxCommandEvent& event ){ event.Skip(); }
virtual void OnNotebookPageChanged( wxNotebookEvent& event ){ event.Skip(); }
virtual void OnListColBeginDrag( wxListEvent& event ){ event.Skip(); }
virtual void OnListItemActivated( wxListEvent& event ){ event.Skip(); }
virtual void OnPaintListCtrl( wxPaintEvent& event ){ event.Skip(); }
public:
wxMenu* m_menuOptions;
wxStatusBar* m_statusBar;
wxTextCtrl* m_textCtrlAddress;
wxListCtrl* m_listCtrlAll;
wxListCtrl* m_listCtrlSentReceived;
wxListCtrl* m_listCtrlSent;
wxListCtrl* m_listCtrlReceived;
CMainFrameBase( wxWindow* parent, wxWindowID id = wxID_MAINFRAME, const wxString& title = _("Bitcoin"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 723,484 ), long style = wxDEFAULT_FRAME_STYLE|wxRESIZE_BORDER|wxTAB_TRAVERSAL );
~CMainFrameBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class CTxDetailsDialogBase
///////////////////////////////////////////////////////////////////////////////
class CTxDetailsDialogBase : public wxDialog
{
private:
protected:
wxHtmlWindow* m_htmlWin;
wxButton* m_buttonOK;
// Virtual event handlers, overide them in your derived class
virtual void OnButtonOK( wxCommandEvent& event ){ event.Skip(); }
public:
CTxDetailsDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Transaction Details"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 620,450 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~CTxDetailsDialogBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class COptionsDialogBase
///////////////////////////////////////////////////////////////////////////////
class COptionsDialogBase : public wxDialog
{
private:
protected:
wxListBox* m_listBox;
wxScrolledWindow* m_scrolledWindow;
wxPanel* m_panelMain;
wxStaticText* m_staticText32;
wxStaticText* m_staticText31;
wxTextCtrl* m_textCtrlTransactionFee;
wxCheckBox* m_checkBoxLimitProcessors;
wxSpinCtrl* m_spinCtrlLimitProcessors;
wxStaticText* m_staticText35;
wxCheckBox* m_checkBoxStartOnSystemStartup;
wxCheckBox* m_checkBoxMinimizeToTray;
wxCheckBox* m_checkBoxMinimizeOnClose;
wxCheckBox* m_checkBoxUseProxy;
wxStaticText* m_staticTextProxyIP;
wxTextCtrl* m_textCtrlProxyIP;
wxStaticText* m_staticTextProxyPort;
wxTextCtrl* m_textCtrlProxyPort;
wxPanel* m_panelTest2;
wxStaticText* m_staticText321;
wxStaticText* m_staticText69;
wxButton* m_buttonOK;
wxButton* m_buttonCancel;
wxButton* m_buttonApply;
// Virtual event handlers, overide them in your derived class
virtual void OnListBox( wxCommandEvent& event ){ event.Skip(); }
virtual void OnKillFocusTransactionFee( wxFocusEvent& event ){ event.Skip(); }
virtual void OnCheckBoxLimitProcessors( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCheckBoxMinimizeToTray( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCheckBoxUseProxy( wxCommandEvent& event ){ event.Skip(); }
virtual void OnKillFocusProxy( wxFocusEvent& event ){ event.Skip(); }
virtual void OnButtonOK( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonCancel( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonApply( wxCommandEvent& event ){ event.Skip(); }
public:
COptionsDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 540,360 ), long style = wxDEFAULT_DIALOG_STYLE );
~COptionsDialogBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class CAboutDialogBase
///////////////////////////////////////////////////////////////////////////////
class CAboutDialogBase : public wxDialog
{
private:
protected:
wxStaticBitmap* m_bitmap;
wxStaticText* m_staticText40;
wxStaticText* m_staticTextMain;
wxButton* m_buttonOK;
// Virtual event handlers, overide them in your derived class
virtual void OnButtonOK( wxCommandEvent& event ){ event.Skip(); }
public:
wxStaticText* m_staticTextVersion;
CAboutDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About Bitcoin"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 532,329 ), long style = wxDEFAULT_DIALOG_STYLE );
~CAboutDialogBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class CSendDialogBase
///////////////////////////////////////////////////////////////////////////////
class CSendDialogBase : public wxDialog
{
private:
protected:
wxStaticText* m_staticTextInstructions;
wxStaticBitmap* m_bitmapCheckMark;
wxStaticText* m_staticText36;
wxTextCtrl* m_textCtrlAddress;
wxButton* m_buttonPaste;
wxButton* m_buttonAddress;
wxStaticText* m_staticText19;
wxTextCtrl* m_textCtrlAmount;
wxStaticText* m_staticText20;
wxChoice* m_choiceTransferType;
wxStaticText* m_staticTextFrom;
wxTextCtrl* m_textCtrlFrom;
wxStaticText* m_staticTextMessage;
wxTextCtrl* m_textCtrlMessage;
wxButton* m_buttonSend;
wxButton* m_buttonCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnKeyDown( wxKeyEvent& event ){ event.Skip(); }
virtual void OnTextAddress( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonPaste( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonAddressBook( wxCommandEvent& event ){ event.Skip(); }
virtual void OnKillFocusAmount( wxFocusEvent& event ){ event.Skip(); }
virtual void OnButtonSend( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonCancel( wxCommandEvent& event ){ event.Skip(); }
public:
CSendDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Send Coins"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 675,298 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~CSendDialogBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class CSendingDialogBase
///////////////////////////////////////////////////////////////////////////////
class CSendingDialogBase : public wxDialog
{
private:
protected:
wxStaticText* m_staticTextSending;
wxTextCtrl* m_textCtrlStatus;
wxButton* m_buttonOK;
wxButton* m_buttonCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ){ event.Skip(); }
virtual void OnPaint( wxPaintEvent& event ){ event.Skip(); }
virtual void OnButtonOK( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonCancel( wxCommandEvent& event ){ event.Skip(); }
public:
CSendingDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Sending..."), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 442,151 ), long style = wxDEFAULT_DIALOG_STYLE );
~CSendingDialogBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class CYourAddressDialogBase
///////////////////////////////////////////////////////////////////////////////
class CYourAddressDialogBase : public wxDialog
{
private:
protected:
wxStaticText* m_staticText45;
wxListCtrl* m_listCtrl;
wxButton* m_buttonRename;
wxButton* m_buttonNew;
wxButton* m_buttonCopy;
wxButton* m_buttonOK;
wxButton* m_buttonCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ){ event.Skip(); }
virtual void OnListEndLabelEdit( wxListEvent& event ){ event.Skip(); }
virtual void OnListItemActivated( wxListEvent& event ){ event.Skip(); }
virtual void OnListItemSelected( wxListEvent& event ){ event.Skip(); }
virtual void OnButtonRename( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonNew( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonCopy( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonOK( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonCancel( wxCommandEvent& event ){ event.Skip(); }
public:
CYourAddressDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Your Bitcoin Addresses"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 610,390 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~CYourAddressDialogBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class CAddressBookDialogBase
///////////////////////////////////////////////////////////////////////////////
class CAddressBookDialogBase : public wxDialog
{
private:
protected:
wxNotebook* m_notebook;
wxPanel* m_panelSending;
wxStaticText* m_staticText55;
wxListCtrl* m_listCtrlSending;
wxPanel* m_panelReceiving;
wxStaticText* m_staticText45;
wxListCtrl* m_listCtrlReceiving;
wxButton* m_buttonDelete;
wxButton* m_buttonCopy;
wxButton* m_buttonEdit;
wxButton* m_buttonNew;
wxButton* m_buttonOK;
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ){ event.Skip(); }
virtual void OnNotebookPageChanged( wxNotebookEvent& event ){ event.Skip(); }
virtual void OnListEndLabelEdit( wxListEvent& event ){ event.Skip(); }
virtual void OnListItemActivated( wxListEvent& event ){ event.Skip(); }
virtual void OnListItemSelected( wxListEvent& event ){ event.Skip(); }
virtual void OnButtonDelete( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonCopy( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonEdit( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonNew( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonOK( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonCancel( wxCommandEvent& event ){ event.Skip(); }
public:
wxButton* m_buttonCancel;
CAddressBookDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Address Book"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 610,390 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~CAddressBookDialogBase();
};
///////////////////////////////////////////////////////////////////////////////
/// Class CGetTextFromUserDialogBase
///////////////////////////////////////////////////////////////////////////////
class CGetTextFromUserDialogBase : public wxDialog
{
private:
protected:
wxStaticText* m_staticTextMessage1;
wxTextCtrl* m_textCtrl1;
wxStaticText* m_staticTextMessage2;
wxTextCtrl* m_textCtrl2;
wxButton* m_buttonOK;
wxButton* m_buttonCancel;
// Virtual event handlers, overide them in your derived class
virtual void OnClose( wxCloseEvent& event ){ event.Skip(); }
virtual void OnKeyDown( wxKeyEvent& event ){ event.Skip(); }
virtual void OnButtonOK( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonCancel( wxCommandEvent& event ){ event.Skip(); }
public:
CGetTextFromUserDialogBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 440,138 ), long style = wxDEFAULT_DIALOG_STYLE );
~CGetTextFromUserDialogBase();
};
#endif //__uibase__

1514
uint256.h

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1430
util.cpp

File diff suppressed because it is too large Load Diff

1092
util.h

File diff suppressed because it is too large Load Diff

View File

@ -1,278 +1,278 @@
/* XPM */
static const char * addressbook16_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 16 256 2",
" c #FFFFFF",
". c #F7FFFF",
"X c #F7F7FF",
"o c #EFF7FF",
"O c #E6EFF7",
"+ c #E6E6F7",
"@ c #CEE6F7",
"# c #DEDEEF",
"$ c #D6DEEF",
"% c #D6DEE6",
"& c #CEDEF7",
"* c #CEDEEF",
"= c #EFF708",
"- c #C5DEF7",
"; c #CED6EF",
": c None",
"> c #C5D6E6",
", c #BDD6F7",
"< c #BDD6EF",
"1 c #D6CECE",
"2 c #BDCEE6",
"3 c #BDC5E6",
"4 c #B5C5DE",
"5 c #BDD631",
"6 c #ADBDDE",
"7 c #B5B5BD",
"8 c #A5B5D6",
"9 c #00FFFF",
"0 c #9CB5CE",
"q c #9CADD6",
"w c #94A5D6",
"e c #8CA5D6",
"r c #8CA5CE",
"t c #8CA5C5",
"y c #849CC5",
"u c #7B9CD6",
"i c #7B9CCE",
"p c #31BDCE",
"a c #6B9CD6",
"s c #00F708",
"d c #8494AD",
"f c #7B94B5",
"g c #6B94D6",
"h c #6B9C84",
"j c #7B8CAD",
"k c #738CAD",
"l c #638CC5",
"z c #10CE42",
"x c #638CBD",
"c c #7B849C",
"v c #73849C",
"b c #6B84A5",
"n c #7B7BA5",
"m c #6B849C",
"M c #7B8C42",
"N c #5A84C5",
"B c #29AD6B",
"V c #F74A4A",
"C c #6384A5",
"Z c #5284C5",
"A c #637BA5",
"S c #637B9C",
"D c #9C637B",
"F c #6B7B5A",
"G c #637394",
"H c #52739C",
"J c #5A7384",
"K c #526B94",
"L c #426B94",
"P c #52638C",
"I c #426B7B",
"U c #5A5A8C",
"Y c #524A7B",
"T c #425273",
"R c #21636B",
"E c #106394",
"W c #106B52",
"Q c #3A4273",
"! c #31426B",
"~ c #523163",
"^ c #29426B",
"/ c #293A63",
"( c #213A63",
") c #193A63",
"_ c #193163",
"` c #19315A",
"' c #212963",
"] c #10315A",
"[ c #082952",
"{ c #FFCC33",
"} c #33FF33",
"| c #66FF33",
" . c #99FF33",
".. c #CCFF33",
"X. c #FFFF33",
"o. c #000066",
"O. c #330066",
"+. c #660066",
"@. c #990066",
"#. c #CC0066",
"$. c #FF0066",
"%. c #003366",
"&. c #333366",
"*. c #663366",
"=. c #993366",
"-. c #CC3366",
";. c #FF3366",
":. c #006666",
">. c #336666",
",. c #666666",
"<. c #996666",
"1. c #CC6666",
"2. c #009966",
"3. c #339966",
"4. c #669966",
"5. c #999966",
"6. c #CC9966",
"7. c #FF9966",
"8. c #00CC66",
"9. c #33CC66",
"0. c #99CC66",
"q. c #CCCC66",
"w. c #FFCC66",
"e. c #00FF66",
"r. c #33FF66",
"t. c #99FF66",
"y. c #CCFF66",
"u. c #FF00CC",
"i. c #CC00FF",
"p. c #009999",
"a. c #993399",
"s. c #990099",
"d. c #CC0099",
"f. c #000099",
"g. c #333399",
"h. c #660099",
"j. c #CC3399",
"k. c #FF0099",
"l. c #006699",
"z. c #336699",
"x. c #663399",
"c. c #996699",
"v. c #CC6699",
"b. c #FF3399",
"n. c #339999",
"m. c #669999",
"M. c #999999",
"N. c #CC9999",
"B. c #FF9999",
"V. c #00CC99",
"C. c #33CC99",
"Z. c #66CC66",
"A. c #99CC99",
"S. c #CCCC99",
"D. c #FFCC99",
"F. c #00FF99",
"G. c #33FF99",
"H. c #66CC99",
"J. c #99FF99",
"K. c #CCFF99",
"L. c #FFFF99",
"P. c #0000CC",
"I. c #330099",
"U. c #6600CC",
"Y. c #9900CC",
"T. c #CC00CC",
"R. c #003399",
"E. c #3333CC",
"W. c #6633CC",
"Q. c #9933CC",
"!. c #CC33CC",
"~. c #FF33CC",
"^. c #0066CC",
"/. c #3366CC",
"(. c #666699",
"). c #9966CC",
"_. c #CC66CC",
"`. c #FF6699",
"'. c #0099CC",
"]. c #3399CC",
"[. c #6699CC",
"{. c #9999CC",
"}. c #CC99CC",
"|. c #FF99CC",
" X c #00CCCC",
".X c #33CCCC",
"XX c #66CCCC",
"oX c #99CCCC",
"OX c #CCCCCC",
"+X c #FFCCCC",
"@X c #00FFCC",
"#X c #33FFCC",
"$X c #66FF99",
"%X c #99FFCC",
"&X c #CCFFCC",
"*X c #FFFFCC",
"=X c #3300CC",
"-X c #6600FF",
";X c #9900FF",
":X c #0033CC",
">X c #3333FF",
",X c #6633FF",
"<X c #9933FF",
"1X c #CC33FF",
"2X c #FF33FF",
"3X c #0066FF",
"4X c #3366FF",
"5X c #6666CC",
"6X c #9966FF",
"7X c #CC66FF",
"8X c #FF66CC",
"9X c #0099FF",
"0X c #3399FF",
"qX c #6699FF",
"wX c #9999FF",
"eX c #CC99FF",
"rX c #FF99FF",
"tX c #00CCFF",
"yX c #33CCFF",
"uX c #66CCFF",
"iX c #99CCFF",
"pX c #CCCCFF",
"aX c #FFCCFF",
"sX c #33FFFF",
"dX c #66FFCC",
"fX c #99FFFF",
"gX c #CCFFFF",
"hX c #FF6666",
"jX c #66FF66",
"kX c #FFFF66",
"lX c #6666FF",
"zX c #FF66FF",
"xX c #66FFFF",
"cX c #A50021",
"vX c #5F5F5F",
"bX c #777777",
"nX c #868686",
"mX c #969696",
"MX c #CBCBCB",
"NX c #B2B2B2",
"BX c #D7D7D7",
"VX c #DDDDDD",
"CX c #E3E3E3",
"ZX c #EAEAEA",
"AX c #F1F1F1",
"SX c #F8F8F8",
"DX c #FFFBF0",
"FX c #A0A0A4",
"GX c #808080",
"HX c #FF0000",
"JX c #00FF00",
"KX c #FFFF00",
"LX c #0000FF",
"PX c #FF00FF",
"IX c #00FFFF",
"UX c #FFFFFF",
/* pixels */
": : : : : : : : : : : : : : : : ",
": : H H H A d : 7 G K H H : : : ",
"n n c X 4 k j X b n n : ",
"n 2 c $ 8 6 4 x < + 4 4 C V ~ : ",
"n * c X o $ y N u 6 $ + b D Y : ",
"n * c X > g , S z R : ",
"n * c * r r y g , 6 r q S s W : ",
"n * c X 4 N u + m B I : ",
"n * c X ; a - S 5 F : ",
"n * c * r r r g - S = M : ",
"n * c X 4 N - m h J : ",
"n * c X ; a - A 9 E : ",
"n * ( ] ` ^ P l y T / / ( p L : ",
"n O > 0 f ) ! t 8 % n : ",
"U U U U U U U ' Q U U U U U U : ",
": : : : : : : : : : : : : : : : "
};
/* XPM */
static const char * addressbook16_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 16 256 2",
" c #FFFFFF",
". c #F7FFFF",
"X c #F7F7FF",
"o c #EFF7FF",
"O c #E6EFF7",
"+ c #E6E6F7",
"@ c #CEE6F7",
"# c #DEDEEF",
"$ c #D6DEEF",
"% c #D6DEE6",
"& c #CEDEF7",
"* c #CEDEEF",
"= c #EFF708",
"- c #C5DEF7",
"; c #CED6EF",
": c None",
"> c #C5D6E6",
", c #BDD6F7",
"< c #BDD6EF",
"1 c #D6CECE",
"2 c #BDCEE6",
"3 c #BDC5E6",
"4 c #B5C5DE",
"5 c #BDD631",
"6 c #ADBDDE",
"7 c #B5B5BD",
"8 c #A5B5D6",
"9 c #00FFFF",
"0 c #9CB5CE",
"q c #9CADD6",
"w c #94A5D6",
"e c #8CA5D6",
"r c #8CA5CE",
"t c #8CA5C5",
"y c #849CC5",
"u c #7B9CD6",
"i c #7B9CCE",
"p c #31BDCE",
"a c #6B9CD6",
"s c #00F708",
"d c #8494AD",
"f c #7B94B5",
"g c #6B94D6",
"h c #6B9C84",
"j c #7B8CAD",
"k c #738CAD",
"l c #638CC5",
"z c #10CE42",
"x c #638CBD",
"c c #7B849C",
"v c #73849C",
"b c #6B84A5",
"n c #7B7BA5",
"m c #6B849C",
"M c #7B8C42",
"N c #5A84C5",
"B c #29AD6B",
"V c #F74A4A",
"C c #6384A5",
"Z c #5284C5",
"A c #637BA5",
"S c #637B9C",
"D c #9C637B",
"F c #6B7B5A",
"G c #637394",
"H c #52739C",
"J c #5A7384",
"K c #526B94",
"L c #426B94",
"P c #52638C",
"I c #426B7B",
"U c #5A5A8C",
"Y c #524A7B",
"T c #425273",
"R c #21636B",
"E c #106394",
"W c #106B52",
"Q c #3A4273",
"! c #31426B",
"~ c #523163",
"^ c #29426B",
"/ c #293A63",
"( c #213A63",
") c #193A63",
"_ c #193163",
"` c #19315A",
"' c #212963",
"] c #10315A",
"[ c #082952",
"{ c #FFCC33",
"} c #33FF33",
"| c #66FF33",
" . c #99FF33",
".. c #CCFF33",
"X. c #FFFF33",
"o. c #000066",
"O. c #330066",
"+. c #660066",
"@. c #990066",
"#. c #CC0066",
"$. c #FF0066",
"%. c #003366",
"&. c #333366",
"*. c #663366",
"=. c #993366",
"-. c #CC3366",
";. c #FF3366",
":. c #006666",
">. c #336666",
",. c #666666",
"<. c #996666",
"1. c #CC6666",
"2. c #009966",
"3. c #339966",
"4. c #669966",
"5. c #999966",
"6. c #CC9966",
"7. c #FF9966",
"8. c #00CC66",
"9. c #33CC66",
"0. c #99CC66",
"q. c #CCCC66",
"w. c #FFCC66",
"e. c #00FF66",
"r. c #33FF66",
"t. c #99FF66",
"y. c #CCFF66",
"u. c #FF00CC",
"i. c #CC00FF",
"p. c #009999",
"a. c #993399",
"s. c #990099",
"d. c #CC0099",
"f. c #000099",
"g. c #333399",
"h. c #660099",
"j. c #CC3399",
"k. c #FF0099",
"l. c #006699",
"z. c #336699",
"x. c #663399",
"c. c #996699",
"v. c #CC6699",
"b. c #FF3399",
"n. c #339999",
"m. c #669999",
"M. c #999999",
"N. c #CC9999",
"B. c #FF9999",
"V. c #00CC99",
"C. c #33CC99",
"Z. c #66CC66",
"A. c #99CC99",
"S. c #CCCC99",
"D. c #FFCC99",
"F. c #00FF99",
"G. c #33FF99",
"H. c #66CC99",
"J. c #99FF99",
"K. c #CCFF99",
"L. c #FFFF99",
"P. c #0000CC",
"I. c #330099",
"U. c #6600CC",
"Y. c #9900CC",
"T. c #CC00CC",
"R. c #003399",
"E. c #3333CC",
"W. c #6633CC",
"Q. c #9933CC",
"!. c #CC33CC",
"~. c #FF33CC",
"^. c #0066CC",
"/. c #3366CC",
"(. c #666699",
"). c #9966CC",
"_. c #CC66CC",
"`. c #FF6699",
"'. c #0099CC",
"]. c #3399CC",
"[. c #6699CC",
"{. c #9999CC",
"}. c #CC99CC",
"|. c #FF99CC",
" X c #00CCCC",
".X c #33CCCC",
"XX c #66CCCC",
"oX c #99CCCC",
"OX c #CCCCCC",
"+X c #FFCCCC",
"@X c #00FFCC",
"#X c #33FFCC",
"$X c #66FF99",
"%X c #99FFCC",
"&X c #CCFFCC",
"*X c #FFFFCC",
"=X c #3300CC",
"-X c #6600FF",
";X c #9900FF",
":X c #0033CC",
">X c #3333FF",
",X c #6633FF",
"<X c #9933FF",
"1X c #CC33FF",
"2X c #FF33FF",
"3X c #0066FF",
"4X c #3366FF",
"5X c #6666CC",
"6X c #9966FF",
"7X c #CC66FF",
"8X c #FF66CC",
"9X c #0099FF",
"0X c #3399FF",
"qX c #6699FF",
"wX c #9999FF",
"eX c #CC99FF",
"rX c #FF99FF",
"tX c #00CCFF",
"yX c #33CCFF",
"uX c #66CCFF",
"iX c #99CCFF",
"pX c #CCCCFF",
"aX c #FFCCFF",
"sX c #33FFFF",
"dX c #66FFCC",
"fX c #99FFFF",
"gX c #CCFFFF",
"hX c #FF6666",
"jX c #66FF66",
"kX c #FFFF66",
"lX c #6666FF",
"zX c #FF66FF",
"xX c #66FFFF",
"cX c #A50021",
"vX c #5F5F5F",
"bX c #777777",
"nX c #868686",
"mX c #969696",
"MX c #CBCBCB",
"NX c #B2B2B2",
"BX c #D7D7D7",
"VX c #DDDDDD",
"CX c #E3E3E3",
"ZX c #EAEAEA",
"AX c #F1F1F1",
"SX c #F8F8F8",
"DX c #FFFBF0",
"FX c #A0A0A4",
"GX c #808080",
"HX c #FF0000",
"JX c #00FF00",
"KX c #FFFF00",
"LX c #0000FF",
"PX c #FF00FF",
"IX c #00FFFF",
"UX c #FFFFFF",
/* pixels */
": : : : : : : : : : : : : : : : ",
": : H H H A d : 7 G K H H : : : ",
"n n c X 4 k j X b n n : ",
"n 2 c $ 8 6 4 x < + 4 4 C V ~ : ",
"n * c X o $ y N u 6 $ + b D Y : ",
"n * c X > g , S z R : ",
"n * c * r r y g , 6 r q S s W : ",
"n * c X 4 N u + m B I : ",
"n * c X ; a - S 5 F : ",
"n * c * r r r g - S = M : ",
"n * c X 4 N - m h J : ",
"n * c X ; a - A 9 E : ",
"n * ( ] ` ^ P l y T / / ( p L : ",
"n O > 0 f ) ! t 8 % n : ",
"U U U U U U U ' Q U U U U U U : ",
": : : : : : : : : : : : : : : : "
};

View File

@ -1,282 +1,282 @@
/* XPM */
static const char * addressbook20_xpm[] = {
/* columns rows colors chars-per-pixel */
"20 20 256 2",
" c #FFFFFF",
". c #F7FFFF",
"X c #F7F7FF",
"o c #EFF7FF",
"O c #EFF7F7",
"+ c #E6EFFF",
"@ c #E6EFF7",
"# c #DEEFFF",
"$ c #DEE6F7",
"% c #DEE6EF",
"& c #D6E6F7",
"* c #FFFF00",
"= c #DEDEE6",
"- c #D6DEE6",
"; c #D6D6DE",
": c #CED6E6",
"> c None",
", c #C5D6E6",
"< c #C5CEE6",
"1 c #B5CEEF",
"2 c #C5C5C5",
"3 c #C5DE31",
"4 c #B5C5DE",
"5 c #BDC5C5",
"6 c #ADC5EF",
"7 c #B5C5CE",
"8 c #BDBDBD",
"9 c #B5BDCE",
"0 c #ADBDDE",
"q c #ADBDD6",
"w c #B5CE52",
"e c #ADB5C5",
"r c #00FFFF",
"t c #A5B5C5",
"y c #9CB5CE",
"u c #94B5DE",
"i c #9CADD6",
"p c #A5ADB5",
"a c #94ADDE",
"s c #94ADD6",
"d c #9CADBD",
"f c #8CADDE",
"g c #BD9CA5",
"h c #9CA5BD",
"j c #9CA5B5",
"k c #29D6E6",
"l c #8CA5CE",
"z c #849CCE",
"x c #6BA5C5",
"c c #739CDE",
"v c #00FF00",
"b c #739CD6",
"n c #7B94CE",
"m c #8494AD",
"M c #7394CE",
"N c #7B94B5",
"B c #4AB584",
"V c #848CB5",
"C c #6B94CE",
"Z c #6394D6",
"A c #6394CE",
"S c #7B8CAD",
"D c #6B8CC5",
"F c #738CAD",
"G c #5294B5",
"H c #6B84C5",
"J c #7384A5",
"K c #73849C",
"L c #738494",
"P c #FF4A4A",
"I c #FF4A42",
"U c #737B8C",
"Y c #637BAD",
"T c #527BBD",
"R c #637394",
"E c #637352",
"W c #5A6B8C",
"Q c #526B9C",
"! c #63638C",
"~ c #5A734A",
"^ c #4A6B9C",
"/ c #526B63",
"( c #0884A5",
") c #526384",
"_ c #52637B",
"` c #4A6B5A",
"' c #52636B",
"] c #525A8C",
"[ c #525A7B",
"{ c #426363",
"} c #4A5A7B",
"| c #425A8C",
" . c #196B94",
".. c #3A5A8C",
"X. c #3A5A84",
"o. c #087B4A",
"O. c #21636B",
"+. c #634263",
"@. c #3A527B",
"#. c #424A84",
"$. c #315284",
"%. c #295284",
"&. c #3A4A6B",
"*. c #42427B",
"=. c #424273",
"-. c #294A84",
";. c #3A3A73",
":. c #194284",
">. c #104A63",
",. c #213A6B",
"<. c #31316B",
"1. c #21315A",
"2. c #212163",
"3. c #08295A",
"4. c #082152",
"5. c #101952",
"6. c #CC9966",
"7. c #FF9966",
"8. c #00CC66",
"9. c #33CC66",
"0. c #99CC66",
"q. c #CCCC66",
"w. c #FFCC66",
"e. c #00FF66",
"r. c #33FF66",
"t. c #99FF66",
"y. c #CCFF66",
"u. c #FF00CC",
"i. c #CC00FF",
"p. c #009999",
"a. c #993399",
"s. c #990099",
"d. c #CC0099",
"f. c #000099",
"g. c #333399",
"h. c #660099",
"j. c #CC3399",
"k. c #FF0099",
"l. c #006699",
"z. c #336699",
"x. c #663399",
"c. c #996699",
"v. c #CC6699",
"b. c #FF3399",
"n. c #339999",
"m. c #669999",
"M. c #999999",
"N. c #CC9999",
"B. c #FF9999",
"V. c #00CC99",
"C. c #33CC99",
"Z. c #66CC66",
"A. c #99CC99",
"S. c #CCCC99",
"D. c #FFCC99",
"F. c #00FF99",
"G. c #33FF99",
"H. c #66CC99",
"J. c #99FF99",
"K. c #CCFF99",
"L. c #FFFF99",
"P. c #0000CC",
"I. c #330099",
"U. c #6600CC",
"Y. c #9900CC",
"T. c #CC00CC",
"R. c #003399",
"E. c #3333CC",
"W. c #6633CC",
"Q. c #9933CC",
"!. c #CC33CC",
"~. c #FF33CC",
"^. c #0066CC",
"/. c #3366CC",
"(. c #666699",
"). c #9966CC",
"_. c #CC66CC",
"`. c #FF6699",
"'. c #0099CC",
"]. c #3399CC",
"[. c #6699CC",
"{. c #9999CC",
"}. c #CC99CC",
"|. c #FF99CC",
" X c #00CCCC",
".X c #33CCCC",
"XX c #66CCCC",
"oX c #99CCCC",
"OX c #CCCCCC",
"+X c #FFCCCC",
"@X c #00FFCC",
"#X c #33FFCC",
"$X c #66FF99",
"%X c #99FFCC",
"&X c #CCFFCC",
"*X c #FFFFCC",
"=X c #3300CC",
"-X c #6600FF",
";X c #9900FF",
":X c #0033CC",
">X c #3333FF",
",X c #6633FF",
"<X c #9933FF",
"1X c #CC33FF",
"2X c #FF33FF",
"3X c #0066FF",
"4X c #3366FF",
"5X c #6666CC",
"6X c #9966FF",
"7X c #CC66FF",
"8X c #FF66CC",
"9X c #0099FF",
"0X c #3399FF",
"qX c #6699FF",
"wX c #9999FF",
"eX c #CC99FF",
"rX c #FF99FF",
"tX c #00CCFF",
"yX c #33CCFF",
"uX c #66CCFF",
"iX c #99CCFF",
"pX c #CCCCFF",
"aX c #FFCCFF",
"sX c #33FFFF",
"dX c #66FFCC",
"fX c #99FFFF",
"gX c #CCFFFF",
"hX c #FF6666",
"jX c #66FF66",
"kX c #FFFF66",
"lX c #6666FF",
"zX c #FF66FF",
"xX c #66FFFF",
"cX c #A50021",
"vX c #5F5F5F",
"bX c #777777",
"nX c #868686",
"mX c #969696",
"MX c #CBCBCB",
"NX c #B2B2B2",
"BX c #D7D7D7",
"VX c #DDDDDD",
"CX c #E3E3E3",
"ZX c #EAEAEA",
"AX c #F1F1F1",
"SX c #F8F8F8",
"DX c #FFFBF0",
"FX c #A0A0A4",
"GX c #808080",
"HX c #FF0000",
"JX c #00FF00",
"KX c #FFFF00",
"LX c #0000FF",
"PX c #FF00FF",
"IX c #00FFFF",
"UX c #FFFFFF",
/* pixels */
"> > > > > > > > > > > > > > > > > > > > ",
"> > > > > > > > > > > > > > > > > > > > ",
"> > U $.| | ^ S 2 > p W | | @.L > > > > ",
"8 5 R - < Y j S O - ) g e > > ",
"! V K - % a Q # - +.P <.> > ",
"! & K - 0 z n D C b f n n z q +.P <.> > ",
"! & K - % M A 1 - %.G #.> > ",
"! & K - % u b # - o.v >.> > ",
"! & K - 0 z n H M b 6 z n z q o.v >.> > ",
"! & K - X - M A a - O.B @.> > ",
"! & K - X % u b # - ` 3 / > > ",
"! & K - 0 l i 4 u b # - ~ * E > > ",
"! & K - X o $ s T b # - { w ' > > ",
"! & K - % f b # - .k -.> > ",
"! & K m d t 7 , u b # ; 9 9 h ( r :.> > ",
"! & h _ _ [ &.4.$.A ,.1.} _ _ F x ] > > ",
"! @ , y N _ 3._ N y , @ ! > > ",
"*.*.*.*.*.*.*.*.;.5.*.*.*.*.*.*.*.2.> > ",
"> > > > > > > > > > > > > > > > > > > > ",
"> > > > > > > > > > > > > > > > > > > > "
};
/* XPM */
static const char * addressbook20_xpm[] = {
/* columns rows colors chars-per-pixel */
"20 20 256 2",
" c #FFFFFF",
". c #F7FFFF",
"X c #F7F7FF",
"o c #EFF7FF",
"O c #EFF7F7",
"+ c #E6EFFF",
"@ c #E6EFF7",
"# c #DEEFFF",
"$ c #DEE6F7",
"% c #DEE6EF",
"& c #D6E6F7",
"* c #FFFF00",
"= c #DEDEE6",
"- c #D6DEE6",
"; c #D6D6DE",
": c #CED6E6",
"> c None",
", c #C5D6E6",
"< c #C5CEE6",
"1 c #B5CEEF",
"2 c #C5C5C5",
"3 c #C5DE31",
"4 c #B5C5DE",
"5 c #BDC5C5",
"6 c #ADC5EF",
"7 c #B5C5CE",
"8 c #BDBDBD",
"9 c #B5BDCE",
"0 c #ADBDDE",
"q c #ADBDD6",
"w c #B5CE52",
"e c #ADB5C5",
"r c #00FFFF",
"t c #A5B5C5",
"y c #9CB5CE",
"u c #94B5DE",
"i c #9CADD6",
"p c #A5ADB5",
"a c #94ADDE",
"s c #94ADD6",
"d c #9CADBD",
"f c #8CADDE",
"g c #BD9CA5",
"h c #9CA5BD",
"j c #9CA5B5",
"k c #29D6E6",
"l c #8CA5CE",
"z c #849CCE",
"x c #6BA5C5",
"c c #739CDE",
"v c #00FF00",
"b c #739CD6",
"n c #7B94CE",
"m c #8494AD",
"M c #7394CE",
"N c #7B94B5",
"B c #4AB584",
"V c #848CB5",
"C c #6B94CE",
"Z c #6394D6",
"A c #6394CE",
"S c #7B8CAD",
"D c #6B8CC5",
"F c #738CAD",
"G c #5294B5",
"H c #6B84C5",
"J c #7384A5",
"K c #73849C",
"L c #738494",
"P c #FF4A4A",
"I c #FF4A42",
"U c #737B8C",
"Y c #637BAD",
"T c #527BBD",
"R c #637394",
"E c #637352",
"W c #5A6B8C",
"Q c #526B9C",
"! c #63638C",
"~ c #5A734A",
"^ c #4A6B9C",
"/ c #526B63",
"( c #0884A5",
") c #526384",
"_ c #52637B",
"` c #4A6B5A",
"' c #52636B",
"] c #525A8C",
"[ c #525A7B",
"{ c #426363",
"} c #4A5A7B",
"| c #425A8C",
" . c #196B94",
".. c #3A5A8C",
"X. c #3A5A84",
"o. c #087B4A",
"O. c #21636B",
"+. c #634263",
"@. c #3A527B",
"#. c #424A84",
"$. c #315284",
"%. c #295284",
"&. c #3A4A6B",
"*. c #42427B",
"=. c #424273",
"-. c #294A84",
";. c #3A3A73",
":. c #194284",
">. c #104A63",
",. c #213A6B",
"<. c #31316B",
"1. c #21315A",
"2. c #212163",
"3. c #08295A",
"4. c #082152",
"5. c #101952",
"6. c #CC9966",
"7. c #FF9966",
"8. c #00CC66",
"9. c #33CC66",
"0. c #99CC66",
"q. c #CCCC66",
"w. c #FFCC66",
"e. c #00FF66",
"r. c #33FF66",
"t. c #99FF66",
"y. c #CCFF66",
"u. c #FF00CC",
"i. c #CC00FF",
"p. c #009999",
"a. c #993399",
"s. c #990099",
"d. c #CC0099",
"f. c #000099",
"g. c #333399",
"h. c #660099",
"j. c #CC3399",
"k. c #FF0099",
"l. c #006699",
"z. c #336699",
"x. c #663399",
"c. c #996699",
"v. c #CC6699",
"b. c #FF3399",
"n. c #339999",
"m. c #669999",
"M. c #999999",
"N. c #CC9999",
"B. c #FF9999",
"V. c #00CC99",
"C. c #33CC99",
"Z. c #66CC66",
"A. c #99CC99",
"S. c #CCCC99",
"D. c #FFCC99",
"F. c #00FF99",
"G. c #33FF99",
"H. c #66CC99",
"J. c #99FF99",
"K. c #CCFF99",
"L. c #FFFF99",
"P. c #0000CC",
"I. c #330099",
"U. c #6600CC",
"Y. c #9900CC",
"T. c #CC00CC",
"R. c #003399",
"E. c #3333CC",
"W. c #6633CC",
"Q. c #9933CC",
"!. c #CC33CC",
"~. c #FF33CC",
"^. c #0066CC",
"/. c #3366CC",
"(. c #666699",
"). c #9966CC",
"_. c #CC66CC",
"`. c #FF6699",
"'. c #0099CC",
"]. c #3399CC",
"[. c #6699CC",
"{. c #9999CC",
"}. c #CC99CC",
"|. c #FF99CC",
" X c #00CCCC",
".X c #33CCCC",
"XX c #66CCCC",
"oX c #99CCCC",
"OX c #CCCCCC",
"+X c #FFCCCC",
"@X c #00FFCC",
"#X c #33FFCC",
"$X c #66FF99",
"%X c #99FFCC",
"&X c #CCFFCC",
"*X c #FFFFCC",
"=X c #3300CC",
"-X c #6600FF",
";X c #9900FF",
":X c #0033CC",
">X c #3333FF",
",X c #6633FF",
"<X c #9933FF",
"1X c #CC33FF",
"2X c #FF33FF",
"3X c #0066FF",
"4X c #3366FF",
"5X c #6666CC",
"6X c #9966FF",
"7X c #CC66FF",
"8X c #FF66CC",
"9X c #0099FF",
"0X c #3399FF",
"qX c #6699FF",
"wX c #9999FF",
"eX c #CC99FF",
"rX c #FF99FF",
"tX c #00CCFF",
"yX c #33CCFF",
"uX c #66CCFF",
"iX c #99CCFF",
"pX c #CCCCFF",
"aX c #FFCCFF",
"sX c #33FFFF",
"dX c #66FFCC",
"fX c #99FFFF",
"gX c #CCFFFF",
"hX c #FF6666",
"jX c #66FF66",
"kX c #FFFF66",
"lX c #6666FF",
"zX c #FF66FF",
"xX c #66FFFF",
"cX c #A50021",
"vX c #5F5F5F",
"bX c #777777",
"nX c #868686",
"mX c #969696",
"MX c #CBCBCB",
"NX c #B2B2B2",
"BX c #D7D7D7",
"VX c #DDDDDD",
"CX c #E3E3E3",
"ZX c #EAEAEA",
"AX c #F1F1F1",
"SX c #F8F8F8",
"DX c #FFFBF0",
"FX c #A0A0A4",
"GX c #808080",
"HX c #FF0000",
"JX c #00FF00",
"KX c #FFFF00",
"LX c #0000FF",
"PX c #FF00FF",
"IX c #00FFFF",
"UX c #FFFFFF",
/* pixels */
"> > > > > > > > > > > > > > > > > > > > ",
"> > > > > > > > > > > > > > > > > > > > ",
"> > U $.| | ^ S 2 > p W | | @.L > > > > ",
"8 5 R - < Y j S O - ) g e > > ",
"! V K - % a Q # - +.P <.> > ",
"! & K - 0 z n D C b f n n z q +.P <.> > ",
"! & K - % M A 1 - %.G #.> > ",
"! & K - % u b # - o.v >.> > ",
"! & K - 0 z n H M b 6 z n z q o.v >.> > ",
"! & K - X - M A a - O.B @.> > ",
"! & K - X % u b # - ` 3 / > > ",
"! & K - 0 l i 4 u b # - ~ * E > > ",
"! & K - X o $ s T b # - { w ' > > ",
"! & K - % f b # - .k -.> > ",
"! & K m d t 7 , u b # ; 9 9 h ( r :.> > ",
"! & h _ _ [ &.4.$.A ,.1.} _ _ F x ] > > ",
"! @ , y N _ 3._ N y , @ ! > > ",
"*.*.*.*.*.*.*.*.;.5.*.*.*.*.*.*.*.2.> > ",
"> > > > > > > > > > > > > > > > > > > > ",
"> > > > > > > > > > > > > > > > > > > > "
};

View File

@ -1,41 +1,41 @@
/* XPM */
static const char * check_xpm[] = {
/* columns rows colors chars-per-pixel */
"32 32 3 1",
" c #008000",
". c #00FF00",
"X c None",
/* pixels */
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXX XXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXX . XXXXXXXXXXX",
"XXXXXXXXXXXXXXXX .. XXXXXXXXXXXX",
"XXXXXXXXXXXXXXXX . XXXXXXXXXXXX",
"XXXXXXXXXXXXXXX .. XXXXXXXXXXXXX",
"XXXXXXXXXXX XX . XXXXXXXXXXXXX",
"XXXXXXXXXXX . .. XXXXXXXXXXXXXX",
"XXXXXXXXXXX .. . XXXXXXXXXXXXXX",
"XXXXXXXXXXXX ... XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXX . XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXX XXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
};
/* XPM */
static const char * check_xpm[] = {
/* columns rows colors chars-per-pixel */
"32 32 3 1",
" c #008000",
". c #00FF00",
"X c None",
/* pixels */
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXX XXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXX . XXXXXXXXXXX",
"XXXXXXXXXXXXXXXX .. XXXXXXXXXXXX",
"XXXXXXXXXXXXXXXX . XXXXXXXXXXXX",
"XXXXXXXXXXXXXXX .. XXXXXXXXXXXXX",
"XXXXXXXXXXX XX . XXXXXXXXXXXXX",
"XXXXXXXXXXX . .. XXXXXXXXXXXXXX",
"XXXXXXXXXXX .. . XXXXXXXXXXXXXX",
"XXXXXXXXXXXX ... XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXX . XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXX XXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
};

View File

@ -1,278 +1,278 @@
/* XPM */
static const char * send16_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 16 256 2",
" c #ADF7AD",
". c #9CFF9C",
"X c None",
"o c #ADEFAD",
"O c #94FF94",
"+ c #D6CECE",
"@ c #8CFF8C",
"# c #CECECE",
"$ c #CECEC5",
"% c #84FF84",
"& c #CEC5C5",
"* c #73FF73",
"= c #C5C5C5",
"- c #6BFF6B",
"; c #73F773",
": c #C5BDBD",
"> c #6BF76B",
", c #BDBDBD",
"< c #63F763",
"1 c #B5B5B5",
"2 c #52F752",
"3 c #42FF42",
"4 c #3AFF3A",
"5 c #ADADAD",
"6 c #ADADA5",
"7 c #4AEF4A",
"8 c #29FF29",
"9 c #A5A5A5",
"0 c #42E642",
"q c #9CA59C",
"w c #3AE63A",
"e c #10FF10",
"r c #08FF08",
"t c #949C94",
"y c #00FF00",
"u c #00F700",
"i c #8C948C",
"p c #00EF00",
"a c #08E608",
"s c #10DE10",
"d c #00E600",
"f c #00DE00",
"g c #19C519",
"h c #00CE00",
"j c #00C500",
"k c #008C00",
"l c #008400",
"z c #669900",
"x c #999900",
"c c #CC9900",
"v c #FF9900",
"b c #00CC00",
"n c #33CC00",
"m c #66CC00",
"M c #99CC00",
"N c #CCCC00",
"B c #FFCC00",
"V c #66FF00",
"C c #99FF00",
"Z c #CCFF00",
"A c #000033",
"S c #330033",
"D c #660033",
"F c #990033",
"G c #CC0033",
"H c #FF0033",
"J c #003333",
"K c #333333",
"L c #663333",
"P c #993333",
"I c #CC3333",
"U c #FF3333",
"Y c #006633",
"T c #336633",
"R c #666633",
"E c #996633",
"W c #CC6633",
"Q c #FF6633",
"! c #009933",
"~ c #339933",
"^ c #669933",
"/ c #999933",
"( c #CC9933",
") c #FF9933",
"_ c #00CC33",
"` c #33CC33",
"' c #66CC33",
"] c #99CC33",
"[ c #CCCC33",
"{ c #FFCC33",
"} c #33FF33",
"| c #66FF33",
" . c #99FF33",
".. c #CCFF33",
"X. c #FFFF33",
"o. c #000066",
"O. c #330066",
"+. c #660066",
"@. c #990066",
"#. c #CC0066",
"$. c #FF0066",
"%. c #003366",
"&. c #333366",
"*. c #663366",
"=. c #993366",
"-. c #CC3366",
";. c #FF3366",
":. c #006666",
">. c #336666",
",. c #666666",
"<. c #996666",
"1. c #CC6666",
"2. c #009966",
"3. c #339966",
"4. c #669966",
"5. c #999966",
"6. c #CC9966",
"7. c #FF9966",
"8. c #00CC66",
"9. c #33CC66",
"0. c #99CC66",
"q. c #CCCC66",
"w. c #FFCC66",
"e. c #00FF66",
"r. c #33FF66",
"t. c #99FF66",
"y. c #CCFF66",
"u. c #FF00CC",
"i. c #CC00FF",
"p. c #009999",
"a. c #993399",
"s. c #990099",
"d. c #CC0099",
"f. c #000099",
"g. c #333399",
"h. c #660099",
"j. c #CC3399",
"k. c #FF0099",
"l. c #006699",
"z. c #336699",
"x. c #663399",
"c. c #996699",
"v. c #CC6699",
"b. c #FF3399",
"n. c #339999",
"m. c #669999",
"M. c #999999",
"N. c #CC9999",
"B. c #FF9999",
"V. c #00CC99",
"C. c #33CC99",
"Z. c #66CC66",
"A. c #99CC99",
"S. c #CCCC99",
"D. c #FFCC99",
"F. c #00FF99",
"G. c #33FF99",
"H. c #66CC99",
"J. c #99FF99",
"K. c #CCFF99",
"L. c #FFFF99",
"P. c #0000CC",
"I. c #330099",
"U. c #6600CC",
"Y. c #9900CC",
"T. c #CC00CC",
"R. c #003399",
"E. c #3333CC",
"W. c #6633CC",
"Q. c #9933CC",
"!. c #CC33CC",
"~. c #FF33CC",
"^. c #0066CC",
"/. c #3366CC",
"(. c #666699",
"). c #9966CC",
"_. c #CC66CC",
"`. c #FF6699",
"'. c #0099CC",
"]. c #3399CC",
"[. c #6699CC",
"{. c #9999CC",
"}. c #CC99CC",
"|. c #FF99CC",
" X c #00CCCC",
".X c #33CCCC",
"XX c #66CCCC",
"oX c #99CCCC",
"OX c #CCCCCC",
"+X c #FFCCCC",
"@X c #00FFCC",
"#X c #33FFCC",
"$X c #66FF99",
"%X c #99FFCC",
"&X c #CCFFCC",
"*X c #FFFFCC",
"=X c #3300CC",
"-X c #6600FF",
";X c #9900FF",
":X c #0033CC",
">X c #3333FF",
",X c #6633FF",
"<X c #9933FF",
"1X c #CC33FF",
"2X c #FF33FF",
"3X c #0066FF",
"4X c #3366FF",
"5X c #6666CC",
"6X c #9966FF",
"7X c #CC66FF",
"8X c #FF66CC",
"9X c #0099FF",
"0X c #3399FF",
"qX c #6699FF",
"wX c #9999FF",
"eX c #CC99FF",
"rX c #FF99FF",
"tX c #00CCFF",
"yX c #33CCFF",
"uX c #66CCFF",
"iX c #99CCFF",
"pX c #CCCCFF",
"aX c #FFCCFF",
"sX c #33FFFF",
"dX c #66FFCC",
"fX c #99FFFF",
"gX c #CCFFFF",
"hX c #FF6666",
"jX c #66FF66",
"kX c #FFFF66",
"lX c #6666FF",
"zX c #FF66FF",
"xX c #66FFFF",
"cX c #A50021",
"vX c #5F5F5F",
"bX c #777777",
"nX c #868686",
"mX c #969696",
"MX c #CBCBCB",
"NX c #B2B2B2",
"BX c #D7D7D7",
"VX c #DDDDDD",
"CX c #E3E3E3",
"ZX c #EAEAEA",
"AX c #F1F1F1",
"SX c #F8F8F8",
"DX c #FFFBF0",
"FX c #A0A0A4",
"GX c #808080",
"HX c #FF0000",
"JX c #00FF00",
"KX c #FFFF00",
"LX c #0000FF",
"PX c #FF00FF",
"IX c #00FFFF",
"UX c #FFFFFF",
/* pixels */
"X X X X X X X k k X X X X X X X ",
"X X X X X X X k j k X X X X X X ",
"X X X X X X X k o j k X X X X X ",
"X X X X X X X k * o j k X X X X ",
"l k k k k k k k * * . j k X X X ",
"l @ @ @ @ @ @ @ 4 e e % j k X X ",
"l O 3 8 e r r r r r r e ; j k X ",
"l @ e e r r r r r u p a f < j k ",
"l @ r u p a a a a a f f w j k i ",
"l O ; ; ; ; ; < a f b 0 j k t : ",
"l k k k k k k k s j 7 j k q = X ",
"X $ = = = = = k g 7 j k 9 & X X ",
"X X X X X X X k 2 j k 6 $ X X X ",
"X X X X X X X k j k 5 + X X X X ",
"X X X X X X X k k 1 + X X X X X ",
"X X X X X X X = , X X X X X X X "
};
/* XPM */
static const char * send16_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 16 256 2",
" c #ADF7AD",
". c #9CFF9C",
"X c None",
"o c #ADEFAD",
"O c #94FF94",
"+ c #D6CECE",
"@ c #8CFF8C",
"# c #CECECE",
"$ c #CECEC5",
"% c #84FF84",
"& c #CEC5C5",
"* c #73FF73",
"= c #C5C5C5",
"- c #6BFF6B",
"; c #73F773",
": c #C5BDBD",
"> c #6BF76B",
", c #BDBDBD",
"< c #63F763",
"1 c #B5B5B5",
"2 c #52F752",
"3 c #42FF42",
"4 c #3AFF3A",
"5 c #ADADAD",
"6 c #ADADA5",
"7 c #4AEF4A",
"8 c #29FF29",
"9 c #A5A5A5",
"0 c #42E642",
"q c #9CA59C",
"w c #3AE63A",
"e c #10FF10",
"r c #08FF08",
"t c #949C94",
"y c #00FF00",
"u c #00F700",
"i c #8C948C",
"p c #00EF00",
"a c #08E608",
"s c #10DE10",
"d c #00E600",
"f c #00DE00",
"g c #19C519",
"h c #00CE00",
"j c #00C500",
"k c #008C00",
"l c #008400",
"z c #669900",
"x c #999900",
"c c #CC9900",
"v c #FF9900",
"b c #00CC00",
"n c #33CC00",
"m c #66CC00",
"M c #99CC00",
"N c #CCCC00",
"B c #FFCC00",
"V c #66FF00",
"C c #99FF00",
"Z c #CCFF00",
"A c #000033",
"S c #330033",
"D c #660033",
"F c #990033",
"G c #CC0033",
"H c #FF0033",
"J c #003333",
"K c #333333",
"L c #663333",
"P c #993333",
"I c #CC3333",
"U c #FF3333",
"Y c #006633",
"T c #336633",
"R c #666633",
"E c #996633",
"W c #CC6633",
"Q c #FF6633",
"! c #009933",
"~ c #339933",
"^ c #669933",
"/ c #999933",
"( c #CC9933",
") c #FF9933",
"_ c #00CC33",
"` c #33CC33",
"' c #66CC33",
"] c #99CC33",
"[ c #CCCC33",
"{ c #FFCC33",
"} c #33FF33",
"| c #66FF33",
" . c #99FF33",
".. c #CCFF33",
"X. c #FFFF33",
"o. c #000066",
"O. c #330066",
"+. c #660066",
"@. c #990066",
"#. c #CC0066",
"$. c #FF0066",
"%. c #003366",
"&. c #333366",
"*. c #663366",
"=. c #993366",
"-. c #CC3366",
";. c #FF3366",
":. c #006666",
">. c #336666",
",. c #666666",
"<. c #996666",
"1. c #CC6666",
"2. c #009966",
"3. c #339966",
"4. c #669966",
"5. c #999966",
"6. c #CC9966",
"7. c #FF9966",
"8. c #00CC66",
"9. c #33CC66",
"0. c #99CC66",
"q. c #CCCC66",
"w. c #FFCC66",
"e. c #00FF66",
"r. c #33FF66",
"t. c #99FF66",
"y. c #CCFF66",
"u. c #FF00CC",
"i. c #CC00FF",
"p. c #009999",
"a. c #993399",
"s. c #990099",
"d. c #CC0099",
"f. c #000099",
"g. c #333399",
"h. c #660099",
"j. c #CC3399",
"k. c #FF0099",
"l. c #006699",
"z. c #336699",
"x. c #663399",
"c. c #996699",
"v. c #CC6699",
"b. c #FF3399",
"n. c #339999",
"m. c #669999",
"M. c #999999",
"N. c #CC9999",
"B. c #FF9999",
"V. c #00CC99",
"C. c #33CC99",
"Z. c #66CC66",
"A. c #99CC99",
"S. c #CCCC99",
"D. c #FFCC99",
"F. c #00FF99",
"G. c #33FF99",
"H. c #66CC99",
"J. c #99FF99",
"K. c #CCFF99",
"L. c #FFFF99",
"P. c #0000CC",
"I. c #330099",
"U. c #6600CC",
"Y. c #9900CC",
"T. c #CC00CC",
"R. c #003399",
"E. c #3333CC",
"W. c #6633CC",
"Q. c #9933CC",
"!. c #CC33CC",
"~. c #FF33CC",
"^. c #0066CC",
"/. c #3366CC",
"(. c #666699",
"). c #9966CC",
"_. c #CC66CC",
"`. c #FF6699",
"'. c #0099CC",
"]. c #3399CC",
"[. c #6699CC",
"{. c #9999CC",
"}. c #CC99CC",
"|. c #FF99CC",
" X c #00CCCC",
".X c #33CCCC",
"XX c #66CCCC",
"oX c #99CCCC",
"OX c #CCCCCC",
"+X c #FFCCCC",
"@X c #00FFCC",
"#X c #33FFCC",
"$X c #66FF99",
"%X c #99FFCC",
"&X c #CCFFCC",
"*X c #FFFFCC",
"=X c #3300CC",
"-X c #6600FF",
";X c #9900FF",
":X c #0033CC",
">X c #3333FF",
",X c #6633FF",
"<X c #9933FF",
"1X c #CC33FF",
"2X c #FF33FF",
"3X c #0066FF",
"4X c #3366FF",
"5X c #6666CC",
"6X c #9966FF",
"7X c #CC66FF",
"8X c #FF66CC",
"9X c #0099FF",
"0X c #3399FF",
"qX c #6699FF",
"wX c #9999FF",
"eX c #CC99FF",
"rX c #FF99FF",
"tX c #00CCFF",
"yX c #33CCFF",
"uX c #66CCFF",
"iX c #99CCFF",
"pX c #CCCCFF",
"aX c #FFCCFF",
"sX c #33FFFF",
"dX c #66FFCC",
"fX c #99FFFF",
"gX c #CCFFFF",
"hX c #FF6666",
"jX c #66FF66",
"kX c #FFFF66",
"lX c #6666FF",
"zX c #FF66FF",
"xX c #66FFFF",
"cX c #A50021",
"vX c #5F5F5F",
"bX c #777777",
"nX c #868686",
"mX c #969696",
"MX c #CBCBCB",
"NX c #B2B2B2",
"BX c #D7D7D7",
"VX c #DDDDDD",
"CX c #E3E3E3",
"ZX c #EAEAEA",
"AX c #F1F1F1",
"SX c #F8F8F8",
"DX c #FFFBF0",
"FX c #A0A0A4",
"GX c #808080",
"HX c #FF0000",
"JX c #00FF00",
"KX c #FFFF00",
"LX c #0000FF",
"PX c #FF00FF",
"IX c #00FFFF",
"UX c #FFFFFF",
/* pixels */
"X X X X X X X k k X X X X X X X ",
"X X X X X X X k j k X X X X X X ",
"X X X X X X X k o j k X X X X X ",
"X X X X X X X k * o j k X X X X ",
"l k k k k k k k * * . j k X X X ",
"l @ @ @ @ @ @ @ 4 e e % j k X X ",
"l O 3 8 e r r r r r r e ; j k X ",
"l @ e e r r r r r u p a f < j k ",
"l @ r u p a a a a a f f w j k i ",
"l O ; ; ; ; ; < a f b 0 j k t : ",
"l k k k k k k k s j 7 j k q = X ",
"X $ = = = = = k g 7 j k 9 & X X ",
"X X X X X X X k 2 j k 6 $ X X X ",
"X X X X X X X k j k 5 + X X X X ",
"X X X X X X X k k 1 + X X X X X ",
"X X X X X X X = , X X X X X X X "
};

View File

@ -1,278 +1,278 @@
/* XPM */
static const char * send16noshadow_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 16 256 2",
" c #ADF7AD",
". c #9CFF9C",
"X c None",
"o c #ADEFAD",
"O c #94FF94",
"+ c #D6CECE",
"@ c #8CFF8C",
"# c #CECECE",
"$ c #CECEC5",
"% c #84FF84",
"& c #CEC5C5",
"* c #73FF73",
"= c #C5C5C5",
"- c #6BFF6B",
"; c #73F773",
": c #C5BDBD",
"> c #6BF76B",
", c #BDBDBD",
"< c #63F763",
"1 c #B5B5B5",
"2 c #52F752",
"3 c #42FF42",
"4 c #3AFF3A",
"5 c #ADADAD",
"6 c #ADADA5",
"7 c #4AEF4A",
"8 c #29FF29",
"9 c #A5A5A5",
"0 c #42E642",
"q c #9CA59C",
"w c #3AE63A",
"e c #10FF10",
"r c #08FF08",
"t c #949C94",
"y c #00FF00",
"u c #00F700",
"i c #8C948C",
"p c #00EF00",
"a c #08E608",
"s c #10DE10",
"d c #00E600",
"f c #00DE00",
"g c #19C519",
"h c #00CE00",
"j c #00C500",
"k c #008C00",
"l c #008400",
"z c #669900",
"x c #999900",
"c c #CC9900",
"v c #FF9900",
"b c #00CC00",
"n c #33CC00",
"m c #66CC00",
"M c #99CC00",
"N c #CCCC00",
"B c #FFCC00",
"V c #66FF00",
"C c #99FF00",
"Z c #CCFF00",
"A c #000033",
"S c #330033",
"D c #660033",
"F c #990033",
"G c #CC0033",
"H c #FF0033",
"J c #003333",
"K c #333333",
"L c #663333",
"P c #993333",
"I c #CC3333",
"U c #FF3333",
"Y c #006633",
"T c #336633",
"R c #666633",
"E c #996633",
"W c #CC6633",
"Q c #FF6633",
"! c #009933",
"~ c #339933",
"^ c #669933",
"/ c #999933",
"( c #CC9933",
") c #FF9933",
"_ c #00CC33",
"` c #33CC33",
"' c #66CC33",
"] c #99CC33",
"[ c #CCCC33",
"{ c #FFCC33",
"} c #33FF33",
"| c #66FF33",
" . c #99FF33",
".. c #CCFF33",
"X. c #FFFF33",
"o. c #000066",
"O. c #330066",
"+. c #660066",
"@. c #990066",
"#. c #CC0066",
"$. c #FF0066",
"%. c #003366",
"&. c #333366",
"*. c #663366",
"=. c #993366",
"-. c #CC3366",
";. c #FF3366",
":. c #006666",
">. c #336666",
",. c #666666",
"<. c #996666",
"1. c #CC6666",
"2. c #009966",
"3. c #339966",
"4. c #669966",
"5. c #999966",
"6. c #CC9966",
"7. c #FF9966",
"8. c #00CC66",
"9. c #33CC66",
"0. c #99CC66",
"q. c #CCCC66",
"w. c #FFCC66",
"e. c #00FF66",
"r. c #33FF66",
"t. c #99FF66",
"y. c #CCFF66",
"u. c #FF00CC",
"i. c #CC00FF",
"p. c #009999",
"a. c #993399",
"s. c #990099",
"d. c #CC0099",
"f. c #000099",
"g. c #333399",
"h. c #660099",
"j. c #CC3399",
"k. c #FF0099",
"l. c #006699",
"z. c #336699",
"x. c #663399",
"c. c #996699",
"v. c #CC6699",
"b. c #FF3399",
"n. c #339999",
"m. c #669999",
"M. c #999999",
"N. c #CC9999",
"B. c #FF9999",
"V. c #00CC99",
"C. c #33CC99",
"Z. c #66CC66",
"A. c #99CC99",
"S. c #CCCC99",
"D. c #FFCC99",
"F. c #00FF99",
"G. c #33FF99",
"H. c #66CC99",
"J. c #99FF99",
"K. c #CCFF99",
"L. c #FFFF99",
"P. c #0000CC",
"I. c #330099",
"U. c #6600CC",
"Y. c #9900CC",
"T. c #CC00CC",
"R. c #003399",
"E. c #3333CC",
"W. c #6633CC",
"Q. c #9933CC",
"!. c #CC33CC",
"~. c #FF33CC",
"^. c #0066CC",
"/. c #3366CC",
"(. c #666699",
"). c #9966CC",
"_. c #CC66CC",
"`. c #FF6699",
"'. c #0099CC",
"]. c #3399CC",
"[. c #6699CC",
"{. c #9999CC",
"}. c #CC99CC",
"|. c #FF99CC",
" X c #00CCCC",
".X c #33CCCC",
"XX c #66CCCC",
"oX c #99CCCC",
"OX c #CCCCCC",
"+X c #FFCCCC",
"@X c #00FFCC",
"#X c #33FFCC",
"$X c #66FF99",
"%X c #99FFCC",
"&X c #CCFFCC",
"*X c #FFFFCC",
"=X c #3300CC",
"-X c #6600FF",
";X c #9900FF",
":X c #0033CC",
">X c #3333FF",
",X c #6633FF",
"<X c #9933FF",
"1X c #CC33FF",
"2X c #FF33FF",
"3X c #0066FF",
"4X c #3366FF",
"5X c #6666CC",
"6X c #9966FF",
"7X c #CC66FF",
"8X c #FF66CC",
"9X c #0099FF",
"0X c #3399FF",
"qX c #6699FF",
"wX c #9999FF",
"eX c #CC99FF",
"rX c #FF99FF",
"tX c #00CCFF",
"yX c #33CCFF",
"uX c #66CCFF",
"iX c #99CCFF",
"pX c #CCCCFF",
"aX c #FFCCFF",
"sX c #33FFFF",
"dX c #66FFCC",
"fX c #99FFFF",
"gX c #CCFFFF",
"hX c #FF6666",
"jX c #66FF66",
"kX c #FFFF66",
"lX c #6666FF",
"zX c #FF66FF",
"xX c #66FFFF",
"cX c #A50021",
"vX c #5F5F5F",
"bX c #777777",
"nX c #868686",
"mX c #969696",
"MX c #CBCBCB",
"NX c #B2B2B2",
"BX c #D7D7D7",
"VX c #DDDDDD",
"CX c #E3E3E3",
"ZX c #EAEAEA",
"AX c #F1F1F1",
"SX c #F8F8F8",
"DX c #FFFBF0",
"FX c #A0A0A4",
"GX c #808080",
"HX c #FF0000",
"JX c #00FF00",
"KX c #FFFF00",
"LX c #0000FF",
"PX c #FF00FF",
"IX c #00FFFF",
"UX c #FFFFFF",
/* pixels */
"X X X X X X X k k X X X X X X X ",
"X X X X X X X k j k X X X X X X ",
"X X X X X X X k o j k X X X X X ",
"X X X X X X X k * o j k X X X X ",
"l k k k k k k k * * . j k X X X ",
"l @ @ @ @ @ @ @ 4 e e % j k X X ",
"l O 3 8 e r r r r r r e ; j k X ",
"l @ e e r r r r r u p a f < j k ",
"l @ r u p a a a a a f f w j k X ",
"l O ; ; ; ; ; < a f b 0 j k X X ",
"l k k k k k k k s j 7 j k X X X ",
"X X X X X X X k g 7 j k X X X X ",
"X X X X X X X k 2 j k X X X X X ",
"X X X X X X X k j k X X X X X X ",
"X X X X X X X k k X X X X X X X ",
"X X X X X X X X X X X X X X X X "
};
/* XPM */
static const char * send16noshadow_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 16 256 2",
" c #ADF7AD",
". c #9CFF9C",
"X c None",
"o c #ADEFAD",
"O c #94FF94",
"+ c #D6CECE",
"@ c #8CFF8C",
"# c #CECECE",
"$ c #CECEC5",
"% c #84FF84",
"& c #CEC5C5",
"* c #73FF73",
"= c #C5C5C5",
"- c #6BFF6B",
"; c #73F773",
": c #C5BDBD",
"> c #6BF76B",
", c #BDBDBD",
"< c #63F763",
"1 c #B5B5B5",
"2 c #52F752",
"3 c #42FF42",
"4 c #3AFF3A",
"5 c #ADADAD",
"6 c #ADADA5",
"7 c #4AEF4A",
"8 c #29FF29",
"9 c #A5A5A5",
"0 c #42E642",
"q c #9CA59C",
"w c #3AE63A",
"e c #10FF10",
"r c #08FF08",
"t c #949C94",
"y c #00FF00",
"u c #00F700",
"i c #8C948C",
"p c #00EF00",
"a c #08E608",
"s c #10DE10",
"d c #00E600",
"f c #00DE00",
"g c #19C519",
"h c #00CE00",
"j c #00C500",
"k c #008C00",
"l c #008400",
"z c #669900",
"x c #999900",
"c c #CC9900",
"v c #FF9900",
"b c #00CC00",
"n c #33CC00",
"m c #66CC00",
"M c #99CC00",
"N c #CCCC00",
"B c #FFCC00",
"V c #66FF00",
"C c #99FF00",
"Z c #CCFF00",
"A c #000033",
"S c #330033",
"D c #660033",
"F c #990033",
"G c #CC0033",
"H c #FF0033",
"J c #003333",
"K c #333333",
"L c #663333",
"P c #993333",
"I c #CC3333",
"U c #FF3333",
"Y c #006633",
"T c #336633",
"R c #666633",
"E c #996633",
"W c #CC6633",
"Q c #FF6633",
"! c #009933",
"~ c #339933",
"^ c #669933",
"/ c #999933",
"( c #CC9933",
") c #FF9933",
"_ c #00CC33",
"` c #33CC33",
"' c #66CC33",
"] c #99CC33",
"[ c #CCCC33",
"{ c #FFCC33",
"} c #33FF33",
"| c #66FF33",
" . c #99FF33",
".. c #CCFF33",
"X. c #FFFF33",
"o. c #000066",
"O. c #330066",
"+. c #660066",
"@. c #990066",
"#. c #CC0066",
"$. c #FF0066",
"%. c #003366",
"&. c #333366",
"*. c #663366",
"=. c #993366",
"-. c #CC3366",
";. c #FF3366",
":. c #006666",
">. c #336666",
",. c #666666",
"<. c #996666",
"1. c #CC6666",
"2. c #009966",
"3. c #339966",
"4. c #669966",
"5. c #999966",
"6. c #CC9966",
"7. c #FF9966",
"8. c #00CC66",
"9. c #33CC66",
"0. c #99CC66",
"q. c #CCCC66",
"w. c #FFCC66",
"e. c #00FF66",
"r. c #33FF66",
"t. c #99FF66",
"y. c #CCFF66",
"u. c #FF00CC",
"i. c #CC00FF",
"p. c #009999",
"a. c #993399",
"s. c #990099",
"d. c #CC0099",
"f. c #000099",
"g. c #333399",
"h. c #660099",
"j. c #CC3399",
"k. c #FF0099",
"l. c #006699",
"z. c #336699",
"x. c #663399",
"c. c #996699",
"v. c #CC6699",
"b. c #FF3399",
"n. c #339999",
"m. c #669999",
"M. c #999999",
"N. c #CC9999",
"B. c #FF9999",
"V. c #00CC99",
"C. c #33CC99",
"Z. c #66CC66",
"A. c #99CC99",
"S. c #CCCC99",
"D. c #FFCC99",
"F. c #00FF99",
"G. c #33FF99",
"H. c #66CC99",
"J. c #99FF99",
"K. c #CCFF99",
"L. c #FFFF99",
"P. c #0000CC",
"I. c #330099",
"U. c #6600CC",
"Y. c #9900CC",
"T. c #CC00CC",
"R. c #003399",
"E. c #3333CC",
"W. c #6633CC",
"Q. c #9933CC",
"!. c #CC33CC",
"~. c #FF33CC",
"^. c #0066CC",
"/. c #3366CC",
"(. c #666699",
"). c #9966CC",
"_. c #CC66CC",
"`. c #FF6699",
"'. c #0099CC",
"]. c #3399CC",
"[. c #6699CC",
"{. c #9999CC",
"}. c #CC99CC",
"|. c #FF99CC",
" X c #00CCCC",
".X c #33CCCC",
"XX c #66CCCC",
"oX c #99CCCC",
"OX c #CCCCCC",
"+X c #FFCCCC",
"@X c #00FFCC",
"#X c #33FFCC",
"$X c #66FF99",
"%X c #99FFCC",
"&X c #CCFFCC",
"*X c #FFFFCC",
"=X c #3300CC",
"-X c #6600FF",
";X c #9900FF",
":X c #0033CC",
">X c #3333FF",
",X c #6633FF",
"<X c #9933FF",
"1X c #CC33FF",
"2X c #FF33FF",
"3X c #0066FF",
"4X c #3366FF",
"5X c #6666CC",
"6X c #9966FF",
"7X c #CC66FF",
"8X c #FF66CC",
"9X c #0099FF",
"0X c #3399FF",
"qX c #6699FF",
"wX c #9999FF",
"eX c #CC99FF",
"rX c #FF99FF",
"tX c #00CCFF",
"yX c #33CCFF",
"uX c #66CCFF",
"iX c #99CCFF",
"pX c #CCCCFF",
"aX c #FFCCFF",
"sX c #33FFFF",
"dX c #66FFCC",
"fX c #99FFFF",
"gX c #CCFFFF",
"hX c #FF6666",
"jX c #66FF66",
"kX c #FFFF66",
"lX c #6666FF",
"zX c #FF66FF",
"xX c #66FFFF",
"cX c #A50021",
"vX c #5F5F5F",
"bX c #777777",
"nX c #868686",
"mX c #969696",
"MX c #CBCBCB",
"NX c #B2B2B2",
"BX c #D7D7D7",
"VX c #DDDDDD",
"CX c #E3E3E3",
"ZX c #EAEAEA",
"AX c #F1F1F1",
"SX c #F8F8F8",
"DX c #FFFBF0",
"FX c #A0A0A4",
"GX c #808080",
"HX c #FF0000",
"JX c #00FF00",
"KX c #FFFF00",
"LX c #0000FF",
"PX c #FF00FF",
"IX c #00FFFF",
"UX c #FFFFFF",
/* pixels */
"X X X X X X X k k X X X X X X X ",
"X X X X X X X k j k X X X X X X ",
"X X X X X X X k o j k X X X X X ",
"X X X X X X X k * o j k X X X X ",
"l k k k k k k k * * . j k X X X ",
"l @ @ @ @ @ @ @ 4 e e % j k X X ",
"l O 3 8 e r r r r r r e ; j k X ",
"l @ e e r r r r r u p a f < j k ",
"l @ r u p a a a a a f f w j k X ",
"l O ; ; ; ; ; < a f b 0 j k X X ",
"l k k k k k k k s j 7 j k X X X ",
"X X X X X X X k g 7 j k X X X X ",
"X X X X X X X k 2 j k X X X X X ",
"X X X X X X X k j k X X X X X X ",
"X X X X X X X k k X X X X X X X ",
"X X X X X X X X X X X X X X X X "
};

View File

@ -1,282 +1,282 @@
/* XPM */
static const char * send20_xpm[] = {
/* columns rows colors chars-per-pixel */
"20 20 256 2",
" c #CEFFCE",
". c #BDFFBD",
"X c #C5F7C5",
"o c #B5FFB5",
"O c #ADFFAD",
"+ c #A5FFA5",
"@ c #9CFF9C",
"# c None",
"$ c #94FF94",
"% c #D6CECE",
"& c #8CFF8C",
"* c #CECEC5",
"= c #84FF84",
"- c #94EF94",
"; c #7BFF7B",
": c #CEC5C5",
"> c #73FF73",
", c #C5C5C5",
"< c #C5C5BD",
"1 c #6BFF6B",
"2 c #BDC5B5",
"3 c #63FF63",
"4 c #6BF76B",
"5 c #BDBDBD",
"6 c #BDBDB5",
"7 c #5AFF5A",
"8 c #63F763",
"9 c #B5BDB5",
"0 c #B5BDAD",
"q c #52FF52",
"w c #BDB5B5",
"e c #5AF75A",
"r c #B5B5B5",
"t c #B5B5AD",
"y c #52F752",
"u c #42FF42",
"i c #52EF52",
"p c #ADADAD",
"a c #ADADA5",
"s c #4AEF4A",
"d c #31FF31",
"f c #29FF29",
"g c #A5A5A5",
"h c #21FF21",
"j c #5AD65A",
"k c #42E642",
"l c #94AD94",
"z c #4ADE4A",
"x c #3AE63A",
"c c #5ACE5A",
"v c #10FF10",
"b c #9C9C9C",
"n c #31E631",
"m c #08FF08",
"M c #949C94",
"N c #84A584",
"B c #00FF00",
"V c #3AD63A",
"C c #52C552",
"Z c #00F700",
"A c #8C948C",
"S c #849484",
"D c #00EF00",
"F c #739C73",
"G c #08E608",
"H c #4AB54A",
"J c #31C531",
"K c #00E600",
"L c #739473",
"P c #00DE00",
"I c #63945A",
"U c #6B8C6B",
"Y c #00D600",
"T c #42A542",
"R c #638C63",
"E c #00CE00",
"W c #21B521",
"Q c #5A8C5A",
"! c #00C500",
"~ c #528C52",
"^ c #3A9C3A",
"/ c #4A8C4A",
"( c #00BD00",
") c #319431",
"_ c #219C21",
"` c #318C31",
"' c #3A843A",
"] c #219421",
"[ c #298C29",
"{ c #318431",
"} c #218C21",
"| c #218C19",
" . c #198C19",
".. c #218421",
"X. c #297B29",
"o. c #198419",
"O. c #217B21",
"+. c #108410",
"@. c #197B19",
"#. c #CC0066",
"$. c #FF0066",
"%. c #003366",
"&. c #333366",
"*. c #663366",
"=. c #993366",
"-. c #CC3366",
";. c #FF3366",
":. c #006666",
">. c #336666",
",. c #666666",
"<. c #996666",
"1. c #CC6666",
"2. c #009966",
"3. c #339966",
"4. c #669966",
"5. c #999966",
"6. c #CC9966",
"7. c #FF9966",
"8. c #00CC66",
"9. c #33CC66",
"0. c #99CC66",
"q. c #CCCC66",
"w. c #FFCC66",
"e. c #00FF66",
"r. c #33FF66",
"t. c #99FF66",
"y. c #CCFF66",
"u. c #FF00CC",
"i. c #CC00FF",
"p. c #009999",
"a. c #993399",
"s. c #990099",
"d. c #CC0099",
"f. c #000099",
"g. c #333399",
"h. c #660099",
"j. c #CC3399",
"k. c #FF0099",
"l. c #006699",
"z. c #336699",
"x. c #663399",
"c. c #996699",
"v. c #CC6699",
"b. c #FF3399",
"n. c #339999",
"m. c #669999",
"M. c #999999",
"N. c #CC9999",
"B. c #FF9999",
"V. c #00CC99",
"C. c #33CC99",
"Z. c #66CC66",
"A. c #99CC99",
"S. c #CCCC99",
"D. c #FFCC99",
"F. c #00FF99",
"G. c #33FF99",
"H. c #66CC99",
"J. c #99FF99",
"K. c #CCFF99",
"L. c #FFFF99",
"P. c #0000CC",
"I. c #330099",
"U. c #6600CC",
"Y. c #9900CC",
"T. c #CC00CC",
"R. c #003399",
"E. c #3333CC",
"W. c #6633CC",
"Q. c #9933CC",
"!. c #CC33CC",
"~. c #FF33CC",
"^. c #0066CC",
"/. c #3366CC",
"(. c #666699",
"). c #9966CC",
"_. c #CC66CC",
"`. c #FF6699",
"'. c #0099CC",
"]. c #3399CC",
"[. c #6699CC",
"{. c #9999CC",
"}. c #CC99CC",
"|. c #FF99CC",
" X c #00CCCC",
".X c #33CCCC",
"XX c #66CCCC",
"oX c #99CCCC",
"OX c #CCCCCC",
"+X c #FFCCCC",
"@X c #00FFCC",
"#X c #33FFCC",
"$X c #66FF99",
"%X c #99FFCC",
"&X c #CCFFCC",
"*X c #FFFFCC",
"=X c #3300CC",
"-X c #6600FF",
";X c #9900FF",
":X c #0033CC",
">X c #3333FF",
",X c #6633FF",
"<X c #9933FF",
"1X c #CC33FF",
"2X c #FF33FF",
"3X c #0066FF",
"4X c #3366FF",
"5X c #6666CC",
"6X c #9966FF",
"7X c #CC66FF",
"8X c #FF66CC",
"9X c #0099FF",
"0X c #3399FF",
"qX c #6699FF",
"wX c #9999FF",
"eX c #CC99FF",
"rX c #FF99FF",
"tX c #00CCFF",
"yX c #33CCFF",
"uX c #66CCFF",
"iX c #99CCFF",
"pX c #CCCCFF",
"aX c #FFCCFF",
"sX c #33FFFF",
"dX c #66FFCC",
"fX c #99FFFF",
"gX c #CCFFFF",
"hX c #FF6666",
"jX c #66FF66",
"kX c #FFFF66",
"lX c #6666FF",
"zX c #FF66FF",
"xX c #66FFFF",
"cX c #A50021",
"vX c #5F5F5F",
"bX c #777777",
"nX c #868686",
"mX c #969696",
"MX c #CBCBCB",
"NX c #B2B2B2",
"BX c #D7D7D7",
"VX c #DDDDDD",
"CX c #E3E3E3",
"ZX c #EAEAEA",
"AX c #F1F1F1",
"SX c #F8F8F8",
"DX c #FFFBF0",
"FX c #A0A0A4",
"GX c #808080",
"HX c #FF0000",
"JX c #00FF00",
"KX c #FFFF00",
"LX c #0000FF",
"PX c #FF00FF",
"IX c #00FFFF",
"UX c #FFFFFF",
/* pixels */
"# # # # # # # # # # # # # # # # # # # # ",
"# # # # # # # ` 0 # # # # # # # # # # # ",
"# # # # # # # ..` l # # # # # # # # # # ",
"# # # # # # # [ X ) N # # # # # # # # # ",
"# # # # # # # [ &X. ^ F # # # # # # # # ",
"# # # # # # # } o & o T I : # # # # # # ",
"` ` ` ` ` ` ` ` + 7 ; + H ~ < # # # # # ",
"` = = = = = = - @ d v h $ C ' 5 # # # # ",
"` = = 3 u h v v v m m m v ; c { 6 # # # ",
"` = f v v m m m m m m Z G G 4 j ..t # # ",
"` = v m m m Z Z D D G G G P n ; _ R 5 # ",
"` = m Z G G G G G G G P Y x 4 _ Q g # # ",
"` = $ $ $ $ $ & e P P E k 8 .U g # # # ",
"..[ ......[ [ ] e Y ! s i o.L p # # # # ",
"# # 5 6 6 6 9 ..i ( i z o.S t # # # # # ",
"# # # # # # # } i i V O.A r # # # # # # ",
"# # # # # # # } 7 J X.M 6 # # # # # # # ",
"# # # # # # # | W ' b < # # # # # # # # ",
"# # # # # # # @.~ g , # # # # # # # # # ",
"# # # # # # # 6 < , # # # # # # # # # # "
};
/* XPM */
static const char * send20_xpm[] = {
/* columns rows colors chars-per-pixel */
"20 20 256 2",
" c #CEFFCE",
". c #BDFFBD",
"X c #C5F7C5",
"o c #B5FFB5",
"O c #ADFFAD",
"+ c #A5FFA5",
"@ c #9CFF9C",
"# c None",
"$ c #94FF94",
"% c #D6CECE",
"& c #8CFF8C",
"* c #CECEC5",
"= c #84FF84",
"- c #94EF94",
"; c #7BFF7B",
": c #CEC5C5",
"> c #73FF73",
", c #C5C5C5",
"< c #C5C5BD",
"1 c #6BFF6B",
"2 c #BDC5B5",
"3 c #63FF63",
"4 c #6BF76B",
"5 c #BDBDBD",
"6 c #BDBDB5",
"7 c #5AFF5A",
"8 c #63F763",
"9 c #B5BDB5",
"0 c #B5BDAD",
"q c #52FF52",
"w c #BDB5B5",
"e c #5AF75A",
"r c #B5B5B5",
"t c #B5B5AD",
"y c #52F752",
"u c #42FF42",
"i c #52EF52",
"p c #ADADAD",
"a c #ADADA5",
"s c #4AEF4A",
"d c #31FF31",
"f c #29FF29",
"g c #A5A5A5",
"h c #21FF21",
"j c #5AD65A",
"k c #42E642",
"l c #94AD94",
"z c #4ADE4A",
"x c #3AE63A",
"c c #5ACE5A",
"v c #10FF10",
"b c #9C9C9C",
"n c #31E631",
"m c #08FF08",
"M c #949C94",
"N c #84A584",
"B c #00FF00",
"V c #3AD63A",
"C c #52C552",
"Z c #00F700",
"A c #8C948C",
"S c #849484",
"D c #00EF00",
"F c #739C73",
"G c #08E608",
"H c #4AB54A",
"J c #31C531",
"K c #00E600",
"L c #739473",
"P c #00DE00",
"I c #63945A",
"U c #6B8C6B",
"Y c #00D600",
"T c #42A542",
"R c #638C63",
"E c #00CE00",
"W c #21B521",
"Q c #5A8C5A",
"! c #00C500",
"~ c #528C52",
"^ c #3A9C3A",
"/ c #4A8C4A",
"( c #00BD00",
") c #319431",
"_ c #219C21",
"` c #318C31",
"' c #3A843A",
"] c #219421",
"[ c #298C29",
"{ c #318431",
"} c #218C21",
"| c #218C19",
" . c #198C19",
".. c #218421",
"X. c #297B29",
"o. c #198419",
"O. c #217B21",
"+. c #108410",
"@. c #197B19",
"#. c #CC0066",
"$. c #FF0066",
"%. c #003366",
"&. c #333366",
"*. c #663366",
"=. c #993366",
"-. c #CC3366",
";. c #FF3366",
":. c #006666",
">. c #336666",
",. c #666666",
"<. c #996666",
"1. c #CC6666",
"2. c #009966",
"3. c #339966",
"4. c #669966",
"5. c #999966",
"6. c #CC9966",
"7. c #FF9966",
"8. c #00CC66",
"9. c #33CC66",
"0. c #99CC66",
"q. c #CCCC66",
"w. c #FFCC66",
"e. c #00FF66",
"r. c #33FF66",
"t. c #99FF66",
"y. c #CCFF66",
"u. c #FF00CC",
"i. c #CC00FF",
"p. c #009999",
"a. c #993399",
"s. c #990099",
"d. c #CC0099",
"f. c #000099",
"g. c #333399",
"h. c #660099",
"j. c #CC3399",
"k. c #FF0099",
"l. c #006699",
"z. c #336699",
"x. c #663399",
"c. c #996699",
"v. c #CC6699",
"b. c #FF3399",
"n. c #339999",
"m. c #669999",
"M. c #999999",
"N. c #CC9999",
"B. c #FF9999",
"V. c #00CC99",
"C. c #33CC99",
"Z. c #66CC66",
"A. c #99CC99",
"S. c #CCCC99",
"D. c #FFCC99",
"F. c #00FF99",
"G. c #33FF99",
"H. c #66CC99",
"J. c #99FF99",
"K. c #CCFF99",
"L. c #FFFF99",
"P. c #0000CC",
"I. c #330099",
"U. c #6600CC",
"Y. c #9900CC",
"T. c #CC00CC",
"R. c #003399",
"E. c #3333CC",
"W. c #6633CC",
"Q. c #9933CC",
"!. c #CC33CC",
"~. c #FF33CC",
"^. c #0066CC",
"/. c #3366CC",
"(. c #666699",
"). c #9966CC",
"_. c #CC66CC",
"`. c #FF6699",
"'. c #0099CC",
"]. c #3399CC",
"[. c #6699CC",
"{. c #9999CC",
"}. c #CC99CC",
"|. c #FF99CC",
" X c #00CCCC",
".X c #33CCCC",
"XX c #66CCCC",
"oX c #99CCCC",
"OX c #CCCCCC",
"+X c #FFCCCC",
"@X c #00FFCC",
"#X c #33FFCC",
"$X c #66FF99",
"%X c #99FFCC",
"&X c #CCFFCC",
"*X c #FFFFCC",
"=X c #3300CC",
"-X c #6600FF",
";X c #9900FF",
":X c #0033CC",
">X c #3333FF",
",X c #6633FF",
"<X c #9933FF",
"1X c #CC33FF",
"2X c #FF33FF",
"3X c #0066FF",
"4X c #3366FF",
"5X c #6666CC",
"6X c #9966FF",
"7X c #CC66FF",
"8X c #FF66CC",
"9X c #0099FF",
"0X c #3399FF",
"qX c #6699FF",
"wX c #9999FF",
"eX c #CC99FF",
"rX c #FF99FF",
"tX c #00CCFF",
"yX c #33CCFF",
"uX c #66CCFF",
"iX c #99CCFF",
"pX c #CCCCFF",
"aX c #FFCCFF",
"sX c #33FFFF",
"dX c #66FFCC",
"fX c #99FFFF",
"gX c #CCFFFF",
"hX c #FF6666",
"jX c #66FF66",
"kX c #FFFF66",
"lX c #6666FF",
"zX c #FF66FF",
"xX c #66FFFF",
"cX c #A50021",
"vX c #5F5F5F",
"bX c #777777",
"nX c #868686",
"mX c #969696",
"MX c #CBCBCB",
"NX c #B2B2B2",
"BX c #D7D7D7",
"VX c #DDDDDD",
"CX c #E3E3E3",
"ZX c #EAEAEA",
"AX c #F1F1F1",
"SX c #F8F8F8",
"DX c #FFFBF0",
"FX c #A0A0A4",
"GX c #808080",
"HX c #FF0000",
"JX c #00FF00",
"KX c #FFFF00",
"LX c #0000FF",
"PX c #FF00FF",
"IX c #00FFFF",
"UX c #FFFFFF",
/* pixels */
"# # # # # # # # # # # # # # # # # # # # ",
"# # # # # # # ` 0 # # # # # # # # # # # ",
"# # # # # # # ..` l # # # # # # # # # # ",
"# # # # # # # [ X ) N # # # # # # # # # ",
"# # # # # # # [ &X. ^ F # # # # # # # # ",
"# # # # # # # } o & o T I : # # # # # # ",
"` ` ` ` ` ` ` ` + 7 ; + H ~ < # # # # # ",
"` = = = = = = - @ d v h $ C ' 5 # # # # ",
"` = = 3 u h v v v m m m v ; c { 6 # # # ",
"` = f v v m m m m m m Z G G 4 j ..t # # ",
"` = v m m m Z Z D D G G G P n ; _ R 5 # ",
"` = m Z G G G G G G G P Y x 4 _ Q g # # ",
"` = $ $ $ $ $ & e P P E k 8 .U g # # # ",
"..[ ......[ [ ] e Y ! s i o.L p # # # # ",
"# # 5 6 6 6 9 ..i ( i z o.S t # # # # # ",
"# # # # # # # } i i V O.A r # # # # # # ",
"# # # # # # # } 7 J X.M 6 # # # # # # # ",
"# # # # # # # | W ' b < # # # # # # # # ",
"# # # # # # # @.~ g , # # # # # # # # # ",
"# # # # # # # 6 < , # # # # # # # # # # "
};