# init

initialize the plugin

          typedef void (*logT) (int, const char*);

            int init
            logT logger

## Arguments

`logger`

  Callback to send log messages from the module plugin to the host application.

## Description

The `init` function initialises the module plugin. It is the first function called after loading the shared library. No other method may be called before calling this. It is only allowed to call this function once. The propose is to initialise resources common to all instances of this module class. For example allocation of a memory pool or querys for i/o devices.

If the return value signals an error the caller is not allowed to call another function. The proper handling of such a situation is unloading the shared library.

`logger` is a pointer to a function that is used to send log messages from the module to the engine. The first parameter of this function is the log level and the second is a const char pointer to the log message as c-string.

## Return Value

The return value is 1 if the module could be initialised and 0 in case of an error.