## EModule

EModule — A module loader

## Functions

EModule * | e_module_new ()
const gchar * | e_module_get_filename ()
GList * | e_module_load_all_in_directory ()
void | (*ETypeFunc) ()
void | e_type_traverse ()

## Types and Values

struct | EModule
struct | EModuleClass

## Includes

    #include <libebackend/libebackend.h>

## Description

## Functions

### e_module_new ()

    EModule *
    e_module_new (const gchar *filename);

Creates a new EModule that will load the specific shared library when in use.

#### Parameters

filename | filename of the shared library module |

#### Returns

a new EModule for `filename`

Since 3.4

### e_module_get_filename ()

    const gchar *
    e_module_get_filename (EModule *module);

Returns the filename of the shared library for `module` . The string is owned by `module` and should not be modified or freed.

#### Parameters

module | an EModule |

#### Returns

the filename for `module`

Since 3.4

### e_module_load_all_in_directory ()

    GList *
    e_module_load_all_in_directory (const gchar *dirname);

Loads all the modules in the specified directory into memory. If you want to unload them (enabling on-demand loading) you must call `g_type_module_unuse()` on all the modules. Free the returned list with `g_list_free()`.

#### Parameters

dirname | pathname for a directory containing modules to load |

#### Returns

a list of EModules loaded from `dirname`

Since 3.4

### ETypeFunc ()

    void
    (*ETypeFunc) (GType type,
                  gpointer user_data);

Specifies the type of functions passed to `e_type_traverse()`.

#### Parameters

type | a GType |
user_data | user data passed to `e_type_traverse()` |

Since 3.4

### e_type_traverse ()

    void
    e_type_traverse (GType parent_type,
                     ETypeFunc func,
                     gpointer user_data);

Calls `func` for all instantiable subtypes of `parent_type` .

This is often useful for extending functionality by way of EModule. A module may register a subtype of `parent_type` in its `e_module_load()` function. Then later on the application will call `e_type_traverse()` to instantiate all registered subtypes of `parent_type` .

#### Parameters

parent_type | the root GType to traverse from |
func | the function to call for each visited GType |
user_data | user data to pass to the function |

Since 3.4

## Types and Values

### struct EModule

    struct EModule {
    	GTypeModule parent;
    	EModulePrivate *priv;
    };

Contains only private data that should be read and manipulated using the functions below.

Since 3.4

### struct EModuleClass

    struct EModuleClass {
    	GTypeModuleClass parent_class;
    };