summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/til.c13
-rw-r--r--src/til.h2
2 files changed, 13 insertions, 2 deletions
diff --git a/src/til.c b/src/til.c
index d006926..66f4870 100644
--- a/src/til.c
+++ b/src/til.c
@@ -167,7 +167,7 @@ void til_get_modules(const til_module_t ***res_modules, size_t *res_n_modules)
}
-char * til_get_module_names(unsigned flags_excluded)
+char * til_get_module_names(unsigned flags_excluded, const char **exclusions)
{
const til_module_t **modules;
size_t n_modules;
@@ -183,10 +183,21 @@ char * til_get_module_names(unsigned flags_excluded)
til_get_modules(&modules, &n_modules);
for (size_t i = 0, j = 0; i < n_modules; i++) {
const til_module_t *mod = modules[i];
+ const char **exclusion = exclusions;
if ((mod->flags & flags_excluded))
continue;
+ while (*exclusion) {
+ if (!strcmp(*exclusion, mod->name))
+ break;
+
+ exclusion++;
+ }
+
+ if (*exclusion)
+ continue;
+
fprintf(fp, "%s%s", j ? "," : "", mod->name);
j++;
}
diff --git a/src/til.h b/src/til.h
index 0a0cd6d..f27bdde 100644
--- a/src/til.h
+++ b/src/til.h
@@ -42,7 +42,7 @@ void til_quiesce(void);
void til_shutdown(void);
const til_module_t * til_lookup_module(const char *name);
void til_get_modules(const til_module_t ***res_modules, size_t *res_n_modules);
-char * til_get_module_names(unsigned flags_excluded);
+char * til_get_module_names(unsigned flags_excluded, const char **exclusions);
void til_module_render(til_module_context_t *context, til_stream_t *stream, unsigned ticks, til_fb_fragment_t **fragment_ptr);
int til_module_create_context(const til_module_t *module, til_stream_t *stream, unsigned seed, unsigned ticks, unsigned n_cpus, til_setup_t *setup, til_module_context_t **res_context);
til_module_context_t * til_module_destroy_context(til_module_context_t *context, til_stream_t *stream);
© All Rights Reserved