mrdocs::PluginMainFn

The type of the entry point a plugin exports.

Synopsis

Declared in <mrdocs/Plugin.hpp>

using PluginMainFn = bool(*)(PluginContext&, Error*);

Description

The function is extern "C", exported with MRDOCS_PLUGIN_EXPORT, and named mrdocs_plugin_main. MrDocs calls it once, while it starts up, with a context and the address of an error to fill in. A plugin that returns false stops the run, reporting the error it left behind.

A plugin defines the entry point with MRDOCS_PLUGIN_MAIN rather than writing this signature out: the body of the macro returns an Expected<void>, which the macro turns into the two.