Hi! > >>> What about creating module_exists() module_load() and module_unload() > >>> library functions? > >> Yeah, it is possible. Could I use tst_resource files for that? Or perhaps, > >> would it be better to create tst_modules files? > > Start a separate source file for that, tst_module(s) is OK. > > > I would like to implement tst_module_load() function with variable > argument list > (use for command line parameters of the insmod command). > There is a macro EXPAND_VAR_ARGS defined in tst_res.c, which might be > used by > that function. Is it possible to move it outside of the tst_res.c file, > where it can be > easily accessed by other c files?
The standard way for this is to create internal header named common.h or similar stored under the lib/ directory for the common macros/internal only API. But looking at the body of the macro, there is assert(strlen(buf) > 0) which would mean that we can't pass empty parameters to the module_load() function (given that the interface is module_load(const char *module_name, const char *params, ...) or similar). So the easiest way would IMHO be just copy part of the macro into the new code or write it from scratch. -- Cyril Hrubis [email protected] ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
