loading functions with dlsym()
authorVolker Birk <vb@pep-project.org>
Wed, 22 Apr 2015 23:14:04 +0200
changeset 221498615df9416
parent 220 9234c753e2cf
child 222 333ae7fc587d
loading functions with dlsym()
src/pEpEngine.c
src/pgp_gpg.c
test/message_api_test.cc
     1.1 --- a/src/pEpEngine.c	Wed Apr 22 12:38:51 2015 +0200
     1.2 +++ b/src/pEpEngine.c	Wed Apr 22 23:14:04 2015 +0200
     1.3 @@ -3,7 +3,7 @@
     1.4  #include "cryptotech.h"
     1.5  #include "transport.h"
     1.6  
     1.7 -int init_count = -1;
     1.8 +static int init_count = -1;
     1.9  
    1.10  DYNAMIC_API PEP_STATUS init(PEP_SESSION *session)
    1.11  {
     2.1 --- a/src/pgp_gpg.c	Wed Apr 22 12:38:51 2015 +0200
     2.2 +++ b/src/pgp_gpg.c	Wed Apr 22 23:14:04 2015 +0200
     2.3 @@ -165,6 +165,11 @@
     2.4              "gpgme_data_new_from_mem");
     2.5          assert(gpg.gpgme_data_new_from_mem);
     2.6  
     2.7 +        gpg.gpgme_data_new_from_cbs
     2.8 +            = (gpgme_data_new_from_cbs_t) (intptr_t) dlsym(gpgme,
     2.9 +            "gpgme_data_new_from_cbs");
    2.10 +        assert(gpg.gpgme_data_new_from_cbs);
    2.11 +
    2.12          gpg.gpgme_data_release
    2.13              = (gpgme_data_release_t) (intptr_t) dlsym(gpgme,
    2.14              "gpgme_data_release");
    2.15 @@ -283,6 +288,10 @@
    2.16              dlsym(gpgme, "gpgme_key_unref");
    2.17          assert(gpg.gpgme_key_unref);
    2.18  
    2.19 +        gpg.gpgme_op_edit = (gpgme_op_edit_t) (intptr_t)
    2.20 +            dlsym(gpgme, "gpgme_op_edit");
    2.21 +        assert(gpg.gpgme_op_edit);
    2.22 +
    2.23          gpg.version = gpg.gpgme_check(NULL);
    2.24          
    2.25          if (strcmp(setlocale(LC_ALL, NULL), "C") == 0)
     3.1 --- a/test/message_api_test.cc	Wed Apr 22 12:38:51 2015 +0200
     3.2 +++ b/test/message_api_test.cc	Wed Apr 22 23:14:04 2015 +0200
     3.3 @@ -2,6 +2,7 @@
     3.4  #include <iostream>
     3.5  #include <fstream>
     3.6  #include <assert.h>
     3.7 +#include "mime.h"
     3.8  #include "message_api.h"
     3.9  
    3.10  using namespace std;