6 /* lttv modules are shared object files, to be loaded dynamically, which
7 interact with the main module to provide additional capabilities. They
8 typically register hooks to be called at various places, read and add
11 Each lttv module must define a function named "init" with
12 the following signature. The init function may itself require other
13 modules using lttv_module_require.
15 It should also define a function named "destroy" to free the
16 resources reserved during execution.
18 Most modules will not use the command line arguments passed as init
19 arguments. It is easier to simply register command line options
20 to be parsed by the main module. However, some modules
21 may require an "early access" to these arguments, for example an embedded
22 python interpreter module which needs to know the modules written in
25 typedef struct _LttvModule LttvModule
;
27 typedef void (*LttvModuleInit
)(LttvModule
*self
, int argc
, char **argv
);
29 typedef void (*LttvModuleDestroy
)();
32 /* Additional module search paths may be defined. */
34 void lttv_module_path_add(const char *name
);
37 /* Load (or increment its reference count if already loaded) the named module.
38 The init function of the module is executed upon loading. */
40 LttvModule
*lttv_module_load(const char *name
, int argc
, char **argv
);
43 /* Module m depends on the named module. The named module will be loaded,
44 remembered by m as a dependent, and unloaded when m is unloaded. */
46 LttvModule
*lttv_module_require(LttvModule
*m
, const char *name
, int argc
,
50 /* Decrement the reference count of the specified module and unload it if 0.
51 The destroy function of the module is executed before unloading.
52 Dependent modules are unloaded. */
54 void lttv_module_unload(LttvModule
*m
) ;
57 /* List the loaded modules. The returned array contains nb elements and
58 must be freed with g_free. */
60 LttvModule
**lttv_module_list(guint
*nb
);
63 /* Obtain information about a module. The list of dependent module is
64 returned and must be freed with g_free. */
66 LttvModule
**lttv_module_info(LttvModule
*m
, const char **name
,
67 guint
*ref_count
, guint
*load_count
, guint
*nb_dependents
);
This page took 0.030065 seconds and 4 git commands to generate.