@@ -42,6 +42,7 @@ typedef int (*sblib_count_fn) (void);
4242typedef int (* sblib_init_fn ) (const char * );
4343typedef int (* sblib_has_window_ui_fn ) (void );
4444typedef int (* sblib_free_fn ) (int , int );
45+ typedef int (* sblib_refresh_id_fn ) (int , int );
4546typedef void (* sblib_close_fn ) (void );
4647
4748typedef struct {
@@ -51,6 +52,7 @@ typedef struct {
5152 sblib_exec_fn _sblib_proc_exec ;
5253 sblib_exec_fn _sblib_func_exec ;
5354 sblib_free_fn _sblib_free ;
55+ sblib_refresh_id_fn _sblib_refresh_id ;
5456 ext_func_node_t * _func_list ;
5557 ext_proc_node_t * _proc_list ;
5658 uint32_t _id ;
@@ -327,6 +329,7 @@ static void slib_import_routines(slib_t *lib, int comp) {
327329 lib -> _sblib_func_exec = slib_getoptptr (lib , "sblib_func_exec" );
328330 lib -> _sblib_proc_exec = slib_getoptptr (lib , "sblib_proc_exec" );
329331 lib -> _sblib_free = slib_getoptptr (lib , "sblib_free" );
332+ lib -> _sblib_refresh_id = slib_getoptptr (lib , "sblib_refresh_id" );
330333 sblib_count_fn fcount = slib_getoptptr (lib , "sblib_proc_count" );
331334 sblib_getname_fn fgetname = slib_getoptptr (lib , "sblib_proc_getname" );
332335
@@ -565,6 +568,17 @@ void plugin_free(int lib_id, int cls_id, int id) {
565568 }
566569}
567570
571+ int plugin_refresh_id (int lib_id , int cls_id , int id ) {
572+ int result = id ;
573+ if (lib_id != -1 && cls_id != -1 && id != -1 ) {
574+ slib_t * lib = get_lib (lib_id );
575+ if (lib && lib -> _sblib_refresh_id ) {
576+ result = lib -> _sblib_refresh_id (cls_id , id );
577+ }
578+ }
579+ return result ;
580+ }
581+
568582void plugin_close () {
569583 for (int i = 0 ; i < MAX_SLIBS ; i ++ ) {
570584 if (plugins [i ]) {
@@ -594,6 +608,7 @@ void *plugin_get_func(const char *name) { return 0; }
594608int plugin_procexec (int lib_id , int index ) { return -1 ; }
595609int plugin_funcexec (int lib_id , int index , var_t * ret ) { return -1 ; }
596610void plugin_free (int lib_id , int cls_id , int id ) {}
611+ int plugin_refresh_id (int lib_id , int cls_id , int id ) {return id ;}
597612void plugin_close () {}
598613#endif
599614
0 commit comments