Created
December 10, 2014 14:19
-
-
Save weissjeffm/129ecda1f2c5ad679cb1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <opentxs/client/C_API.h> | |
#include <opentxs/client/OTAPI_Exec.hpp> | |
#include "ot_made_easy_ot.hpp" | |
//#include <opentxs/client/ot_otapi_ot.hpp> | |
#include <string> | |
int fill_result_buffer(std::string me_return_str, char* result_buf, unsigned int result_size){ | |
if (me_return_str.size() >= result_size){ | |
return -1; | |
} | |
strcpy(result_buf, me_return_str.c_str()); | |
return 0; | |
} | |
int create_nym(int32_t nKeybits, const char* NYM_ID_SOURCE, | |
const char* ALT_LOCATION, char* result, unsigned int result_size) | |
{ | |
return fill_result_buffer(opentxs::MadeEasy::create_nym(nKeybits, NYM_ID_SOURCE, ALT_LOCATION), result, result_size); | |
} | |
extern "C" { | |
int register_nym(const char* NOTARY_ID, const char* NYM_ID, char* result, | |
unsigned int result_size) | |
{ | |
if (opentxs::MadeEasy::register_nym(NOTARY_ID, NYM_ID).size() >= | |
result_size) { | |
return -1; | |
} | |
strcpy(result, opentxs::MadeEasy::register_nym(NOTARY_ID, NYM_ID).c_str()); | |
return 0; | |
} | |
} | |
// From OTAPI | |
extern "C" { | |
bool app_init(){ | |
return opentxs::OTAPI_Exec::AppInit(); | |
} | |
} | |
extern "C" { | |
bool load_wallet(){ | |
return opentxs::OTAPI_Exec::LoadWallet(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment