From cabbee7d8caeafa3959f4559177ae335567aefb4 Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Sat, 18 Nov 2017 08:43:06 -0500 Subject: Call a plugin init function by name Use this macro to arrange init function ordering between friend plugins. Fails in the usual manner if the plugin doesn't exist, or if the init function symbol is AWOL. clib_error_t * thisplug_init (vlib_main_t *vm) { clib_error_t *error = 0; if ((error = vlib_plugin_init_function ("otherplug.so", otherplug_init))) return error; return error; } VLIB_INIT_FUNCTION(thisplug_init); Change-Id: Ideecaf46bc0b1546e85096e54be8ddef87946565 Signed-off-by: Dave Barach --- src/vppinfra/clib.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/vppinfra') diff --git a/src/vppinfra/clib.h b/src/vppinfra/clib.h index 33db3b203f9..0d059a0778b 100644 --- a/src/vppinfra/clib.h +++ b/src/vppinfra/clib.h @@ -78,6 +78,9 @@ #define CLIB_PACKED(x) x __attribute__ ((packed)) #define CLIB_UNUSED(x) x __attribute__ ((unused)) +/* Make a string from the macro's argument */ +#define CLIB_STRING_MACRO(x) #x + #define __clib_unused __attribute__ ((unused)) #define __clib_weak __attribute__ ((weak)) #define __clib_packed __attribute__ ((packed)) -- cgit 1.2.3-korg