Skip to content
Snippets Groups Projects
Commit 6104dbf5 authored by ANTA's avatar ANTA
Browse files

1.1-11-Win

parent 0406c6ea
No related branches found
No related tags found
1 merge request!3Master
......@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8)
project (dap_chain_wallet)
set(DAP_CHAIN_WALLET_SRCS
dap_chain_wallet.c
dap_chain_wallet.c
dap_chain_coin.c
dap_chain_wallet_ops.c
......@@ -15,10 +15,22 @@ set(DAP_CHAIN_WALLET_HEADERS
dap_chain_wallet_ops.h
)
add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_WALLET_SRCS} ${DAP_CHAIN_WALLET_HEADERS})
if(WIN32)
include_directories(../libdap/src/win32/)
include_directories(../3rdparty/libmemcached/)
include_directories(../3rdparty/libmemcached/win32/)
include_directories(../3rdparty/wepoll/include/)
include_directories(../3rdparty/uthash/src/)
include_directories(../3rdparty/libjson-c/)
include_directories(../3rdparty/libmagic/src/)
include_directories(../3rdparty/curl/include/)
include_directories(../3rdparty/libsqlite3/)
endif()
add_library(${PROJECT_NAME} STATIC ${DAP_CHAIN_WALLET_SRCS} ${DAP_CHAIN_WALLET_HEADERS})
target_link_libraries(dap_chain_wallet dap_core dap_crypto dap_chain dap_chain_crypto dap_chain_net)
target_include_directories(dap_chain_wallet INTERFACE .)
set(${PROJECT_NAME}_DEFINITIONS CACHE INTERNAL "${PROJECT_NAME}: Definitions" FORCE)
......
......@@ -22,10 +22,28 @@
along with any DAP based project. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <errno.h>
#include <stdint.h>
#include <stdio.h>
#ifdef WIN32
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0600
#include <winsock2.h>
#include <windows.h>
#include <mswsock.h>
#include <ws2tcpip.h>
#include <io.h>
#include <wepoll.h>
#endif
#include <pthread.h>
#include "dap_common.h"
#include "dap_chain_cert_file.h"
#include "dap_chain_wallet.h"
......@@ -72,7 +90,7 @@ dap_chain_wallet_t * dap_chain_wallet_create(const char * a_wallet_name, const c
size_t l_file_name_size = strlen(a_wallet_name)+strlen(a_wallets_path)+13;
l_wallet_internal->file_name = DAP_NEW_Z_SIZE (char, l_file_name_size);
snprintf(l_wallet_internal->file_name,l_file_name_size,"%s/%s.dwallet",a_wallets_path,a_wallet_name);
dap_snprintf(l_wallet_internal->file_name,l_file_name_size,"%s/%s.dwallet",a_wallets_path,a_wallet_name);
l_wallet_internal->certs[0] = dap_chain_cert_generate_mem(a_wallet_name,
dap_chain_sign_type_to_key_type(a_sig_type));
......@@ -305,7 +323,7 @@ dap_chain_wallet_t * dap_chain_wallet_open(const char * a_wallet_name, const cha
return NULL;
size_t l_file_name_size = strlen(a_wallet_name)+strlen(a_wallets_path)+13;
char *l_file_name = DAP_NEW_Z_SIZE (char, l_file_name_size);
snprintf(l_file_name, l_file_name_size, "%s/%s.dwallet", a_wallets_path, a_wallet_name);
dap_snprintf(l_file_name, l_file_name_size, "%s/%s.dwallet", a_wallets_path, a_wallet_name);
dap_chain_wallet_t * l_wallet = dap_chain_wallet_open_file(l_file_name);
DAP_DELETE(l_file_name);
return l_wallet;
......
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <errno.h>
#ifdef WIN32
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0600
#include <winsock2.h>
#include <windows.h>
#include <mswsock.h>
#include <ws2tcpip.h>
#include <io.h>
#include <wepoll.h>
#endif
#include <pthread.h>
#include "dap_chain_common.h"
#include "dap_chain_wallet_ops.h"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment