1 #ifndef BABELTRACE_PLUGIN_PLUGIN_INTERNAL_H
2 #define BABELTRACE_PLUGIN_PLUGIN_INTERNAL_H
5 * BabelTrace - Plug-in Internal
7 * Copyright 2015 Jérémie Galarneau <jeremie.galarneau@efficios.com>
9 * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
11 * Permission is hereby granted, free of charge, to any person obtaining a copy
12 * of this software and associated documentation files (the "Software"), to deal
13 * in the Software without restriction, including without limitation the rights
14 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 * copies of the Software, and to permit persons to whom the Software is
16 * furnished to do so, subject to the following conditions:
18 * The above copyright notice and this permission notice shall be included in
19 * all copies or substantial portions of the Software.
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 #include <babeltrace/babeltrace-internal.h>
31 #include <babeltrace/plugin/plugin-dev.h>
32 #include <babeltrace/object-internal.h>
37 BT_PLUGIN_TYPE_SO
= 0,
38 BT_PLUGIN_TYPE_PYTHON
= 1,
42 struct bt_object base
;
43 enum bt_plugin_type type
;
46 /* Array of pointers to bt_component_class (owned by this) */
47 GPtrArray
*comp_classes
;
49 /* Info (owned by this) */
70 /* Value depends on the specific plugin type */
75 struct bt_plugin
*bt_plugin_create_empty(enum bt_plugin_type type
);
78 void bt_plugin_set_path(struct bt_plugin
*plugin
, const char *path
)
82 g_string_assign(plugin
->info
.path
, path
);
83 plugin
->info
.path_set
= true;
87 void bt_plugin_set_name(struct bt_plugin
*plugin
, const char *name
)
91 g_string_assign(plugin
->info
.name
, name
);
92 plugin
->info
.name_set
= true;
96 void bt_plugin_set_description(struct bt_plugin
*plugin
,
97 const char *description
)
101 g_string_assign(plugin
->info
.description
, description
);
102 plugin
->info
.description_set
= true;
106 void bt_plugin_set_author(struct bt_plugin
*plugin
, const char *author
)
110 g_string_assign(plugin
->info
.author
, author
);
111 plugin
->info
.author_set
= true;
115 void bt_plugin_set_license(struct bt_plugin
*plugin
, const char *license
)
119 g_string_assign(plugin
->info
.license
, license
);
120 plugin
->info
.license_set
= true;
124 void bt_plugin_set_version(struct bt_plugin
*plugin
, unsigned int major
,
125 unsigned int minor
, unsigned int patch
, const char *extra
)
128 plugin
->info
.version
.major
= major
;
129 plugin
->info
.version
.minor
= minor
;
130 plugin
->info
.version
.patch
= patch
;
133 g_string_assign(plugin
->info
.version
.extra
, extra
);
136 plugin
->info
.version_set
= true;
140 void bt_plugin_freeze(struct bt_plugin
*plugin
)
143 plugin
->frozen
= true;
146 #endif /* BABELTRACE_PLUGIN_PLUGIN_INTERNAL_H */
This page took 0.038094 seconds and 4 git commands to generate.