szaszm commented on code in PR #2105: URL: https://github.com/apache/nifi-minifi-cpp/pull/2105#discussion_r3058190677
########## Extensions.md: ########## @@ -17,8 +17,39 @@ To enable all extensions for your platform, you may use -DENABLE_ALL=TRUE OR select the option to "Enable all Extensions" in the bootstrap script. [ReadMe](https://github.com/apache/nifi-minifi-cpp/#bootstrapping) # Extension internals -Extensions are dynamic libraries loaded at runtime by the agent. An extension makes its -capabilities (classes) available to the system through registrars. Registration must happen in source files, not headers. +Extensions are dynamic libraries loaded at runtime by the agent. + +## C extensions +You can build a shared library depending on the C capabilities of the agent as given in the `minifi-c.h` file. +For the shared library to be considered a valid extension, it has to have a global symbol with the name `MinifiCApiVersion` +with its value as a null terminated string (`const char*`) of the macro `MINIFI_API_VERSION` from `minifi-c.h`. + +Moreover the actual resource registration (processors/controller services) has to happen during the `MinifiInitExtension` call. Review Comment: Is this enforced? Can we document the option that minifi calls this function multiple times, and it has to make the same registration calls in the same order every time? This would leave more room for changing behavior in a backwards-compatible way later, e.g. call once to track data size and allocate a buffer, call second time to actually copy all of the data to minifi buffers. Or unload and reload the extension without closing and reopening the library. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
