Allowing dynamically loaded libraries in C to “publish” functions for use
问题 I'm writing a program in C which allows users to implement custom "functions" to be run by an interpreter of sorts. I also want to allow users to write these custom functions in plain C, and then be loaded in dynamically. In order to do this, I created two structs, one for interpreted functions, and one for native ones. Here's a simplified example: struct func_lang { bool is_native; char* identifier; // various other properties } typedef void (*func_native_ptr)(int); struct func_native { bool