boothj5/profanity — pull request #224 by ashinkarov (2013-08-18 03:19:19+00:00)
Title: Supporting C plugins

Hi James

Here is a draft of the patch to allow plugins in C. It seem to work fine for the time being, example is included in the patch. Please have a quick look, if you would do some things differently.

Couple of missing features I've noticed:
1. How the plugins are being freed? There is a list of files, but it seems that deallocation is missing. I would think that each supported language should provide deallocate function and depending on the language we should traverse `plugins` and deallocate them later.
2. I think that it would be generally a good idea to have finalise method for plugins, where a plugin would be allowed to clean some stuff that it was using during its lifetime. Not so important for python plugins. On the other hand one might want to delete some files, etc.
3. How can I fiddle around with a message, if the parameters are constant? I would think that the purpose of the hook would be to substitute a message and return it back to profanity as it was an original message.
4. on_message_send is missing.
5. I would think that we need to compile api functions in a separate library in order to make sure that plugin-writers can link against it.
6. Yeah, it would be nice to have a debug version switch when building profanity. I am not a big expert in automake, so I am not sure what would be the best way to achieve that.

Cheers,
Artem.