Next: , Previous: , Up: Writing Plugins   [Contents]


7.2 Categories and Required Exports

Every plugin module exports the same two symbols. Include the header for the category you implement (transport.h, reader.h, writer.h, or transform.h).

#include <gmodule.h>
#include "plugin.h"
#include "starter/configurable-service/transform.h"

G_MODULE_EXPORT STCSPluginInfo *
stcs_plugin_get_info (void)
{
  return stcs_plugin_info_new ("my-transform",
                               STCS_PLUGIN_CATEGORY_TRANSFORM,
                               "0.1.0");
}

G_MODULE_EXPORT GObject *
stcs_plugin_create (void)
{
  return g_object_new (STCS_TYPE_MY_TRANSFORM, NULL);
}

Categories (STCSPluginCategory):

STCS_PLUGIN_CATEGORY_TRANSPORT

Subclass STCSTransport.

STCS_PLUGIN_CATEGORY_READER

Subclass STCSReader.

STCS_PLUGIN_CATEGORY_WRITER

Subclass STCSWriter.

STCS_PLUGIN_CATEGORY_TRANSFORM

Subclass STCSTransform.

The config plugin="my-transform" string must match the name passed to stcs_plugin_info_new.