MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / plugin_update

Function plugin_update

db/plugin_handler.c:256–284  ·  view source on GitHub ↗

Parse the "plugin" line in the lrl file and load the specified plugin(s) from given shared object files. Only one shared object file per "plugin" line is allowed. The plugin line can take the following format: plugin shared-object-file-path[:plugin-name,...] In case no plugin-name is specified, all the plugins from the specified shared object files will be loaded. */

Source from the content-addressed store, hash-verified

254 from the specified shared object files will be loaded.
255*/
256static int plugin_update(void *context, void *value)
257{
258 char *ptr, *saveptr = NULL;
259 char path[COMDB2_MAX_PATH_NAME_LEN];
260 int rc = 0;
261 /* Assume only path has been provided. */
262 int path_only = 1;
263
264 ptr = strtok_r((char *)value, ":", &saveptr);
265
266 if (ptr) {
267 strncpy(path, ptr, COMDB2_MAX_PATH_NAME_LEN);
268 }
269
270 while (!rc && (ptr = strtok_r(NULL, ",", &saveptr))) {
271 path_only = 0;
272 rc = install_plugin(path, ptr);
273 }
274
275 if (path_only == 1) {
276 /*
277 No plugin name specified, load all the plugins from the given
278 shared object file.
279 */
280 rc = install_all_plugins(path);
281 }
282
283 return rc;
284}
285
286/* Register all plugin tunables. */
287void register_plugin_tunables(void)

Callers

nothing calls this directly

Calls 2

install_pluginFunction · 0.85
install_all_pluginsFunction · 0.85

Tested by

no test coverage detected