C++ API changes+fixes:

- context is now a pointer to make sure there's only one all the time
- fixed a couple of double free's
- some minor bug fixes
This commit is contained in:
git@daemon.de
2014-08-01 14:46:38 +02:00
parent 1e4e65b811
commit e6a5c51d8a
13 changed files with 168 additions and 114 deletions

View File

@@ -40,14 +40,14 @@ namespace pcp {
public:
pcp_pubkey_t *K;
PcpContext PTX;
PcpContext *PTX;
// constructors
PubKey(PcpContext &P);
PubKey(PcpContext *P);
PubKey();
PubKey(PcpContext &P, pcp_pubkey_t *k);
PubKey(PcpContext &P, pcp_pubkey_t *k, bool store);
PubKey(PcpContext &P, std::string &z85encoded);
PubKey(PcpContext *P, pcp_pubkey_t *k);
PubKey(PcpContext *P, pcp_pubkey_t *k, bool store);
PubKey(PcpContext *P, std::string &z85encoded);
// destructors
~PubKey();
@@ -75,19 +75,19 @@ namespace pcp {
public:
// make access to the underlying struct easier
pcp_key_t *K;
PcpContext PTX;
PcpContext *PTX;
// constructors
Key();
Key(PcpContext &P);
Key(PcpContext &P, bool generate);
Key(PcpContext &P, const std::string& passphrase);
Key(PcpContext &P, const std::string& passphrase,
Key(PcpContext *P);
Key(PcpContext *P, bool generate);
Key(PcpContext *P, const std::string& passphrase);
Key(PcpContext *P, const std::string& passphrase,
const std::string& owner,
const std::string& mail);
Key(PcpContext &P, pcp_key_t *k);
Key(PcpContext &P, pcp_key_t *k, bool store);
Key(PcpContext &P, std::string &z85encoded, std::string& passphrase);
Key(PcpContext *P, pcp_key_t *k);
Key(PcpContext *P, pcp_key_t *k, bool store);
Key(PcpContext *P, std::string &z85encoded, std::string& passphrase);
// destructor
~Key();