Browse Source

Half the adapter generated, strike \o/!

REWORK
heck 4 years ago
parent
commit
784653df6f
  1. 39
      src/pEp/_gen/adapter_main.hh
  2. 2
      src/pEp/_gen/gen/Makefile
  3. 68
      src/pEp/_gen/gen/config.json
  4. 16
      src/pEp/_gen/pEpModule.cc

39
src/pEp/_gen/adapter_main.hh

@ -4,24 +4,35 @@
#ifndef ADAPTER_MAIN_HH
#define ADAPTER_MAIN_HH
// Engine
// Use only if cant be avoided
//#include <pEp/stringlist.h>
/// =======
#include <pEp/pEpEngine.h>
//// Engine
////pEp-API
#include <pEp/keymanagement.h>
#include <pEp/identity_list.h>
#include <pEp/key_reset.h>
#include <pEp/sync_api.h>
#include <pEp/mime.h>
#include <pEp/message.h>
#include <pEp/message_api.h>
#include <pEp/sync_codec.h>
#include <pEp/distribution_codec.h>
#include <pEp/timestamp.h>
#include <pEp/stringpair.h>
#include <pEp/sync_api.h>
/// =======
// #include <pEp/identity_list.h>
// #include <pEp/key_reset.h>
// #include <pEp/mime.h>
// #include <pEp/message.h>
// #include <pEp/sync_codec.h>
// #include <pEp/distribution_codec.h>
// #include <pEp/timestamp.h>
// #include <pEp/stringpair.h>
// libpEpAdapter
#include <pEp/Adapter.hh>
#include <pEp/callback_dispatcher.hh>
#include <pEp/status_to_string.hh>
#include <pEp/pEpLog.hh>
/// =======
//#include <pEp/Adapter.hh>
//#include <pEp/callback_dispatcher.hh>
/// =======
// #include <pEp/status_to_string.hh>
// #include <pEp/pEpLog.hh>
#endif // ADAPTER_MAIN_HH

2
src/pEp/_gen/gen/Makefile

@ -18,7 +18,7 @@ all: pybind
yml: $(YML2_FILE)
pybind: $(PYBIND11_FILE)
pybind: $(YML2_FILE) $(PYBIND11_FILE)
$(YML2_FILE): config.json
pEp_acid_gen $^

68
src/pEp/_gen/gen/config.json

@ -1,11 +1,75 @@
{
"module_name": "_gen",
"header_filename": "../../_pEp/adapter_main.hh",
"header_filename": "../adapter_main.hh",
"libclang_path": "/opt/local/libexec/llvm-9.0/lib/libclang.dylib",
"variables": [
],
"functions": [
"log_event"
"KEYMANAGEMENT",
"update_identity",
"initialise_own_identities",
"myself",
"//register_examine_function",
"//do_keymanagement",
"key_mistrusted",
"trust_personal_key",
"trust_own_key",
"key_reset_trust",
"//own_key_is_listed",
"_own_identities_retrieve",
"own_identities_retrieve",
"_own_keys_retrieve",
"own_keys_retrieve",
"set_own_key",
"//clean_own_key_defaults",
"//PEPENGINE",
"update_identity",
"myself",
"//register_examine_function",
"//do_keymanagement",
"key_mistrusted",
"trust_personal_key",
"trust_own_key",
"key_reset_trust",
"//own_key_is_listed",
"own_identities_retrieve",
"//own_keys_retrieve",
"set_own_key",
"//clean_own_key_defaults",
"new_identity",
"//MESSAGE_API",
"encrypt_message",
"encrypt_message_and_add_priv_key",
"encrypt_message_for_self",
"color_from_rating",
"decrypt_message",
"own_message_private_key_details",
"outgoing_message_rating",
"outgoing_message_rating_preview",
"identity_rating",
"get_binary_path",
"get_trustwords",
"get_message_trustwords",
"get_trustwords_for_fprs",
"re_evaluate_message_rating",
"get_key_rating_for_user",
"rating_from_comm_type",
"probe_encrypt",
"//SYNC_API",
"deliverHandshakeResult",
"//register_sync_callbacks",
"//unregister_sync_callbacks",
"//do_sync_protocol",
"//do_sync_protocol_step",
"//is_sync_thread",
"//new_sync_timeout_event",
"enter_device_group",
"//leave_device_group",
"enable_identity_for_sync",
"disable_identity_for_sync"
],
"debug_ast" : "True",
"debug_acid" : "True",

16
src/pEp/_gen/pEpModule.cc

@ -3,26 +3,20 @@
#include <pybind11/pybind11.h>
#include <pybind11/detail/common.h>
#include "adapter_main.hh"
#include <pEp/Adapter.hh>
#include <pEp/callback_dispatcher.hh>
using namespace std;
namespace alib = pEp::Adapter;
string testfunc() {
return "fsdfg";
}
void *getSessionHandle() {
void *handle = static_cast<void *>(alib::session());
return handle;
PEP_SESSION pep_session() {
return alib::session();
}
PYBIND11_MODULE(_gen, m) {
m.doc() = "pybind11 example plugin"; // optional module docstring
m.def("add", &testfunc, "A function which adds two numbers");
// PEP_SESSION
m.def("get_handle", &getSessionHandle);
// m.def("pep_session",(PEP_SESSION(*)()) &pep_session);
#include "gen/py_module.pybind11"
}

Loading…
Cancel
Save