File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ typedef int (*sblib_getname_fn) (int, char *);
39
39
typedef int (* sblib_count_fn ) (void );
40
40
typedef int (* sblib_init_fn ) (const char * );
41
41
typedef void (* sblib_close_fn ) (void );
42
+ typedef const char * (* sblib_get_module_name_fn ) (void );
42
43
43
44
typedef struct {
44
45
char name [NAME_SIZE ];
@@ -318,6 +319,11 @@ void slib_open(const char *fullname, const char *name) {
318
319
if (!opt_quiet ) {
319
320
log_printf ("... done\n" );
320
321
}
322
+ // override default name
323
+ sblib_get_module_name_fn get_module_name = slib_getoptptr (lib , "sblib_get_module_name" );
324
+ if (get_module_name ) {
325
+ strlcpy (lib -> name , get_module_name (), NAME_SIZE );
326
+ }
321
327
} else {
322
328
sc_raise ("LIB: can't open %s" , fullname );
323
329
}
Original file line number Diff line number Diff line change @@ -33,6 +33,15 @@ typedef struct {
33
33
*/
34
34
int sblib_init (const char * sourceFile );
35
35
36
+ /**
37
+ * @ingroup modlib
38
+ *
39
+ * returns the module name
40
+ *
41
+ * @return module name
42
+ */
43
+ const char * sblib_get_module_name ();
44
+
36
45
/**
37
46
* @ingroup modstd
38
47
*
You can’t perform that action at this time.
0 commit comments