[ohm] [RFC] New plugin interface

Richard Hughes hughsient at gmail.com
Wed Aug 1 02:04:24 PDT 2007


On Wed, 2007-08-01 at 01:08 +0100, Rob Taylor wrote:
> So here's my new plugin interface I've been working on. The patch
> comments should explain it all, but it basically makes interested,
> provides, etc static data in the plugin.
> 
> Here's an example of how it looks at the plugin level (from the idle
> plugin):
> 
> 
> OHM_PLUGIN_DESCRIPTION (
> 	­­­­­­­"OHM IdleTime",»»­­­­­­­»­­­­­­­/* description */
> 	­­­­­­­"0.0.1",»­­­­­­­»­­­­­­­»­­­­­­­/* version */
> 	­­­­­­­"richard at hughsie.com",»­»­­­­­­­/* author */
> 	­­­­­­­OHM_LICENSE_LGPL,»­­­­­­»­­­­­­­/* license */
> 	­­­­­­­plugin_initalize,»­­­­­­»­­­­­­­/* initalize */
> 	­­­­­­­plugin_destroy,»»­­­­­­­»­­­­­­­/* destroy */
> 	­­plugin_notify»­­»­­­­­­­/* notify */
> );

I like this a lot. Your macro skills are more l33t than mine.

> +add_interesteds (OhmModule   *module, OhmPlugin   *plugin)
>  {
>         GSList **entry;
>         GSList **l;
> -       OhmModuleNofif *notif;
> -       ohm_debug ("add interested! %s : %i", key, id);
> +       OhmModuleNotify *notif;
> +       const OhmPluginKeyIdMap *interested;
> +       
> +       if (!plugin->interested)
> +               return;

I tend to use if (plugin->interested == FALSE) and (foo != NULL).

Other than that the patch looks really good, thanks. If it passes make
distcheck (:-)) and runs like the old one did (and has no new memory
leaks) then please commit. Cheers dude.

Richard.



More information about the Ohm-devel mailing list