Subversion Repositories Tewi

Rev

Rev 17 | Rev 25 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17 Rev 18
Line 1... Line 1...
1
/* $Id: module.c 17 2024-09-13 17:41:07Z nishi $ */
1
/* $Id: module.c 18 2024-09-14 00:42:40Z nishi $ */
-
 
2
 
-
 
3
#define SOURCE
2
 
4
 
3
#include "tw_module.h"
5
#include "tw_module.h"
4
 
6
 
5
#include "tw_config.h"
7
#include "tw_config.h"
6
 
8
 
Line 41... Line 43...
41
#else
43
#else
42
	return dlsym(mod, sym);
44
	return dlsym(mod, sym);
43
#endif
45
#endif
44
}
46
}
45
 
47
 
-
 
48
void tw_add_version(const char* string) {
-
 
49
	if(config.extension == NULL) {
-
 
50
		config.extension = cm_strcat(" ", string);
-
 
51
	} else {
-
 
52
		char* tmp = config.extension;
-
 
53
		config.extension = cm_strcat3(tmp, " ", string);
-
 
54
		free(tmp);
-
 
55
	}
-
 
56
}
-
 
57
 
46
void tw_init_tools(struct tw_tool* tools) { tools->log = cm_log; }
58
void tw_init_tools(struct tw_tool* tools) {
-
 
59
	tools->log = cm_log;
-
 
60
	tools->add_version = tw_add_version;
-
 
61
}
47
 
62
 
48
int tw_module_init(void* mod) {
63
int tw_module_init(void* mod) {
49
	tw_mod_init_t mod_init = (tw_mod_init_t)tw_module_symbol(mod, "mod_init");
64
	tw_mod_init_t mod_init = (tw_mod_init_t)tw_module_symbol(mod, "mod_init");
50
	if(mod_init == NULL) {
65
	if(mod_init == NULL) {
51
		cm_log("Module", "Could not init a module");
66
		cm_log("Module", "Could not init a module");