Skip to content

Commit 5be23f2

Browse files
committed
Move main to console directory for own product.
1 parent ff85d22 commit 5be23f2

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

console/main.cpp

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Copyright (c) 2011-2015 libbitcoin developers (see AUTHORS)
3+
*
4+
* This file is part of libbitcoin-server.
5+
*
6+
* libbitcoin-server is free software: you can redistribute it and/or
7+
* modify it under the terms of the GNU Affero General Public License with
8+
* additional permissions to the one published by the Free Software
9+
* Foundation, either version 3 of the License, or (at your option)
10+
* any later version. For more information see LICENSE.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU Affero General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Affero General Public License
18+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
#include <iostream>
21+
#include <bitcoin/server.hpp>
22+
23+
BC_USE_LIBBITCOIN_MAIN
24+
25+
/**
26+
* Invoke this program with the raw arguments provided on the command line.
27+
* All console input and output streams for the application originate here.
28+
* @param argc The number of elements in the argv array.
29+
* @param argv The array of arguments, including the process.
30+
* @return The numeric result to return via console exit.
31+
*/
32+
int bc::main(int argc, char* argv[])
33+
{
34+
bc::set_utf8_stdio();
35+
bc::set_thread_priority(bc::thread_priority::high);
36+
return bc::server::dispatch(argc, const_cast<const char**>(argv),
37+
bc::cin, bc::cout, bc::cerr);
38+
}

0 commit comments

Comments
 (0)