1 /* This file is part of the Linux Trace Toolkit viewer
2 * Copyright (C) 2003-2004 Michel Dagenais
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License Version 2 as
6 * published by the Free Software Foundation;
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
24 /* lttv modules are shared object files, to be loaded dynamically, which
25 interact with the main module to provide additional capabilities. They
26 typically register hooks to be called at various places, read and add
29 Each lttv module must define a function named "init" with
30 the following signature. The init function may itself require other
31 modules using lttv_module_require.
33 It should also define a function named "destroy" to free the
34 resources reserved during execution.
36 Most modules will not use the command line arguments passed as init
37 arguments. It is easier to simply register command line options
38 to be parsed by the main module. However, some modules
39 may require an "early access" to these arguments, for example an embedded
40 python interpreter module which needs to know the modules written in
43 typedef struct _LttvModule LttvModule
;
45 typedef void (*LttvModuleInit
)(LttvModule
*self
, int argc
, char **argv
);
47 typedef void (*LttvModuleDestroy
)();
50 /* Additional module search paths may be defined. */
52 void lttv_module_path_add(const char *name
);
55 /* Load (or increment its reference count if already loaded) the named module.
56 The init function of the module is executed upon loading. */
58 LttvModule
*lttv_module_load(const char *name
, int argc
, char **argv
);
61 /* Module m depends on the named module. The named module will be loaded,
62 remembered by m as a dependent, and unloaded when m is unloaded. */
64 LttvModule
*lttv_module_require(LttvModule
*m
, const char *name
, int argc
,
68 /* Decrement the reference count of the specified module and unload it if 0.
69 The destroy function of the module is executed before unloading.
70 Dependent modules are unloaded. */
72 void lttv_module_unload(LttvModule
*m
) ;
75 /* List the loaded modules. The returned array contains nb elements and
76 must be freed with g_free. */
78 LttvModule
**lttv_module_list(guint
*nb
);
81 /* Obtain information about a module. The list of dependent module is
82 returned and must be freed with g_free. */
84 LttvModule
**lttv_module_info(LttvModule
*m
, const char **name
,
85 guint
*ref_count
, guint
*load_count
, guint
*nb_dependents
);
87 char * lttv_module_name(LttvModule
*m
);
This page took 0.033232 seconds and 4 git commands to generate.