diff options
| author | Cyrille Bagard <nocbos@gmail.com> | 2021-01-09 17:16:23 (GMT) | 
|---|---|---|
| committer | Cyrille Bagard <nocbos@gmail.com> | 2021-01-09 17:16:23 (GMT) | 
| commit | 1a434fb2a1ebe2634d3ba6a29c7add66c17e3e0b (patch) | |
| tree | 8fa90efa86400ac358aff76f07f120bd66e1ac57 /src/plugins | |
| parent | 55a5d2a08f0b168059571cddf8d6d963318903a1 (diff) | |
Looked for extra plugins from the CHRYSALIDE_PLUGINS_PATH environment variable.
Diffstat (limited to 'src/plugins')
| -rw-r--r-- | src/plugins/pglist.c | 17 | 
1 files changed, 17 insertions, 0 deletions
diff --git a/src/plugins/pglist.c b/src/plugins/pglist.c index c1d96ed..18a2f3f 100644 --- a/src/plugins/pglist.c +++ b/src/plugins/pglist.c @@ -28,6 +28,7 @@  #include <assert.h>  #include <dirent.h>  #include <malloc.h> +#include <stdlib.h>  #include <string.h> @@ -77,6 +78,9 @@ bool init_all_plugins(bool load)  #ifdef DISCARD_LOCAL      char *edir;                             /* Répertoire de base effectif */  #endif +    char *env;                              /* Contenu environnemental     */ +    char *saveptr;                          /* Sauvegarde pour parcours    */ +    char *udir;                             /* Répertoire supplémentaire ? */      g_rw_lock_init(&_pg_lock); @@ -88,6 +92,19 @@ bool init_all_plugins(bool load)      free(edir);  #endif +    env = getenv("CHRYSALIDE_PLUGINS_PATH"); + +    if (env != NULL) +    { +        env = strdup(env); + +        for (udir = strtok_r(env, ":", &saveptr); udir != NULL; udir = strtok_r(NULL, ":", &saveptr)) +            browse_directory_for_plugins(udir); + +        free(env); + +    } +      if (load)          load_remaning_plugins();  | 
