Skip to content

Commit e24c5d1

Browse files
committed
ANDROID: fix module regression
1 parent 2368831 commit e24c5d1

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/common/extlib.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ typedef int (*sblib_getname_fn) (int, char *);
3939
typedef int (*sblib_count_fn) (void);
4040
typedef int (*sblib_init_fn) (const char *);
4141
typedef void (*sblib_close_fn) (void);
42+
typedef const char *(*sblib_get_module_name_fn) (void);
4243

4344
typedef struct {
4445
char name[NAME_SIZE];
@@ -318,6 +319,11 @@ void slib_open(const char *fullname, const char *name) {
318319
if (!opt_quiet) {
319320
log_printf("... done\n");
320321
}
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+
}
321327
} else {
322328
sc_raise("LIB: can't open %s", fullname);
323329
}

src/include/module.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ typedef struct {
3333
*/
3434
int sblib_init(const char *sourceFile);
3535

36+
/**
37+
* @ingroup modlib
38+
*
39+
* returns the module name
40+
*
41+
* @return module name
42+
*/
43+
const char *sblib_get_module_name();
44+
3645
/**
3746
* @ingroup modstd
3847
*

0 commit comments

Comments
 (0)