Add bt_plugin_create_from_name()
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 7 Feb 2017 06:22:10 +0000 (01:22 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:37 +0000 (12:57 -0400)
commit1670bffdf312795f277237062cca264967f13fd0
tree9319647109b7812d86f35fb78fc037078bb2fbd1
parent55bb57e083f5e14f157d3438c8ce71ecf2ccb1f1
Add bt_plugin_create_from_name()

This new function creates a new bt_plugin object from a simple plugin
name. It returns the first plugin which has the given name within the
following directories, in this order:

1. The colon-separated directories listed in the BABELTRACE_PLUGIN_PATH
   environment variable.
2. ~/.local/lib/babeltrace/plugins
3. $libdir/babeltrace/plugins, where $libdir is the value of --libdir
   at configure time (/usr/local/lib by default, typically /usr/lib
   when installed through a distribution).
4. The statically built-in plugins.

This makes it easier for any application using libbabeltrace to find a
Babeltrace plugin in a standard way without having to know the exact
location of the plugin file:

    ctf_plugin = bt_plugin_create_from_name("ctf");

Since babeltrace(1) also does this search, but has a --plugin-path
parameter to insert other directories at a specific place within the
search list, the common functions are put in the new
common/libbabeltrace-common.la convenience library. This is where new
(and existing) common functions between libbabeltrace and other parts of
the source tree (converter, plugins, etc.) should be put.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Makefile.am
common/Makefile.am [new file with mode: 0644]
common/common.c [new file with mode: 0644]
configure.ac
converter/Makefile.am
converter/babeltrace-cfg.c
include/Makefile.am
include/babeltrace/common-internal.h [new file with mode: 0644]
include/babeltrace/plugin/plugin.h
lib/Makefile.am
lib/plugin/plugin.c
This page took 0.02472 seconds and 4 git commands to generate.