From 9ca4ebb078d4b9b4c2b53775e2c011461d981130 Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" Date: Thu, 29 Jun 2017 22:32:52 +0200 Subject: [PATCH] mod: add accessor function to module list (#66) --- include/re_mod.h | 1 + src/mod/mod.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/include/re_mod.h b/include/re_mod.h index 4c85594..4b132c4 100644 --- a/include/re_mod.h +++ b/include/re_mod.h @@ -71,4 +71,5 @@ int mod_load(struct mod **mp, const char *name); int mod_add(struct mod **mp, const struct mod_export *me); struct mod *mod_find(const char *name); const struct mod_export *mod_export(const struct mod *m); +struct list *mod_list(void); int mod_debug(struct re_printf *pf, void *unused); diff --git a/src/mod/mod.c b/src/mod/mod.c index bf2291c..6fc0aa1 100644 --- a/src/mod/mod.c +++ b/src/mod/mod.c @@ -203,6 +203,17 @@ const struct mod_export *mod_export(const struct mod *m) } +/** + * Get the list of loaded modules + * + * @return Module list + */ +struct list *mod_list(void) +{ + return &modl; +} + + /** * Debug loadable modules *