iotaledger / access-server

Apache License 2.0
14 stars 3 forks source link

Plugin manager #117

Closed djordjeglbvc closed 4 years ago

djordjeglbvc commented 4 years ago

Adds plugin manager and plugin modules, they are not used, yet.

djordjeglbvc commented 4 years ago

Note: added pep_plugin.h plugin interface to pep module directory instead of plugin directory, as it made more sense. This leaves plugin sdk clean, and when we need to add plugin support to some module (for instance PEP), we include interface in that module's directory. PEP plugin interface "inherits" generic plugin interface, not the other way around.

bernardoaraujor commented 4 years ago

@djordjeglbvc overall looks pretty good

one question: what's the difference between user_data and data on plugin.c?

djordjeglbvc commented 4 years ago

@bernardoaraujor my bad, they have the same meaning. Fixed in new commits.

bernardoaraujor commented 4 years ago

@djordjeglbvc I just realized that plugins/pep/CMakeLists.txt does not account for the new location of pep_plugin.h

In file included from /home/bernardo/dev/access/access/access.c:32:
/home/bernardo/dev/access/plugins/pep/implementation/pep_plugin_can_01.h:46:36: error: unknown type name ‘pep_plugin_t’; did you mean ‘pepplugin_e’?
   46 | void can_01_pep_plugin_initializer(pep_plugin_t* action_set, void* options);
      |                                    ^~~~~~~~~~~~
      |                                    pepplugin_e
/home/bernardo/dev/access/plugins/pep/implementation/pep_plugin_can_01.h:52:40: error: unknown type name ‘pep_plugin_t’; did you mean ‘pepplugin_e’?
   52 | void can_01_pep_plugin_initializer_tcp(pep_plugin_t* action_set, void* options);
      |                                        ^~~~~~~~~~~~
      |                                        pepplugin_e
In file included from /home/bernardo/dev/access/access/access.c:33:
/home/bernardo/dev/access/plugins/pep/implementation/pep_plugin_can_02.h:45:36: error: unknown type name ‘pep_plugin_t’; did you mean ‘pepplugin_e’?
   45 | void can_02_pep_plugin_initializer(pep_plugin_t* action_set, void* options);
      |                                    ^~~~~~~~~~~~
      |                                    pepplugin_e
In file included from /home/bernardo/dev/access/access/access.c:34:
/home/bernardo/dev/access/plugins/pep/implementation/pep_plugin_wallet.h:43:36: error: unknown type name ‘pep_plugin_t’; did you mean ‘pepplugin_e’?
   43 | void wallet_pep_plugin_initializer(pep_plugin_t* action_set, void* options);
      |                                    ^~~~~~~~~~~~
      |                                    pepplugin_e
/home/bernardo/dev/access/access/access.c: In function ‘access_init’:
/home/bernardo/dev/access/access/access.c:82:5: warning: implicit declaration of function ‘pep_plugin_init’ [-Wimplicit-function-declaration]
   82 |     pep_plugin_init(wallet_pep_plugin_initializer, &ctx->ddstate, (void *)device_wallet);
      |     ^~~~~~~~~~~~~~~
/home/bernardo/dev/access/access/access.c:82:21: error: ‘wallet_pep_plugin_initializer’ undeclared (first use in this function); did you mean ‘wallet_pep_plugin_terminator’?
   82 |     pep_plugin_init(wallet_pep_plugin_initializer, &ctx->ddstate, (void *)device_wallet);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                     wallet_pep_plugin_terminator
/home/bernardo/dev/access/access/access.c:82:21: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [access/CMakeFiles/access_actor.dir/build.make:83: access/CMakeFiles/access_actor.dir/access.c.o] Error 1

can you check that? I should have checked that before merging, that's what CI is for after all. My bad.

Basically, there are 2 different versions of the same header:

./access/pep/pep_plugin.h
./plugins/pep/pep_plugin.h
djordjeglbvc commented 4 years ago

Looks like Strahinja and I have created two different pep_plugin.h files in our pull requests. I'll fix failing build by renaming my header file in next pull request. One of them will be removed after that, when pep_plugin is converted to use new plugin system (in another pull request).