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. */
| 254 | from the specified shared object files will be loaded. |
| 255 | */ |
| 256 | static 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. */ |
| 287 | void register_plugin_tunables(void) |
nothing calls this directly
no test coverage detected