Commit 5b7c5b66 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Keep track of plugin text domain

parent 46c51df5
......@@ -58,7 +58,7 @@ static int CacheLoadConfig ( module_t *, FILE * );
/* Sub-version number
* (only used to avoid breakage in dev version when cache structure changes) */
#define CACHE_SUBVERSION_NUM 9
#define CACHE_SUBVERSION_NUM 10
/* Format string for the cache filename */
#define CACHENAME_FORMAT \
......@@ -256,6 +256,7 @@ void CacheLoad( vlc_object_t *p_this, module_bank_t *p_bank, bool b_delete )
goto error;
LOAD_STRING( pp_cache[i]->p_module->psz_filename );
LOAD_STRING( pp_cache[i]->p_module->domain );
LOAD_IMMEDIATE( i_submodules );
......@@ -274,6 +275,7 @@ void CacheLoad( vlc_object_t *p_this, module_bank_t *p_bank, bool b_delete )
LOAD_STRING( p_module->psz_capability );
LOAD_IMMEDIATE( p_module->i_score );
LOAD_IMMEDIATE( p_module->b_unloadable );
LOAD_STRING( p_module->domain );
}
}
......@@ -549,6 +551,7 @@ static int CacheSaveBank (FILE *file, module_bank_t *p_bank)
goto error;
SAVE_STRING( pp_cache[i]->p_module->psz_filename );
SAVE_STRING( pp_cache[i]->p_module->domain );
i_submodule = pp_cache[i]->p_module->submodule_count;
SAVE_IMMEDIATE( i_submodule );
......@@ -585,6 +588,7 @@ static int CacheSaveSubmodule( FILE *file, module_t *p_module )
SAVE_STRING( p_module->psz_capability );
SAVE_IMMEDIATE( p_module->i_score );
SAVE_IMMEDIATE( p_module->b_unloadable );
SAVE_STRING( p_module->domain );
return 0;
error:
......
......@@ -73,6 +73,7 @@ module_t *vlc_module_create (vlc_object_t *obj)
module->i_bool_items = 0;
/*module->handle = garbage */
module->psz_filename = NULL;
module->domain = NULL;
module->b_builtin = false;
module->b_loaded = false;
......@@ -114,6 +115,7 @@ module_t *vlc_submodule_create (module_t *module)
submodule->psz_capability = module->psz_capability;
submodule->i_score = module->i_score;
submodule->b_submodule = true;
submodule->domain = module->domain;
return submodule;
}
......@@ -228,8 +230,7 @@ int vlc_plugin_set (module_t *module, module_config_t *item, int propid, ...)
break;
case VLC_MODULE_TEXTDOMAIN:
(void) va_arg (ap, const char *);
/* FIXME: not implemented */
module->domain = va_arg (ap, char *);
break;
case VLC_CONFIG_NAME:
......
......@@ -1063,6 +1063,7 @@ static void DupModule( module_t *p_module )
p_module->psz_longname = strdup( p_module->psz_longname );
p_module->psz_help = p_module->psz_help ? strdup( p_module->psz_help )
: NULL;
p_module->domain = p_module->domain ? strdup( p_module->domain ) : NULL;
for (module_t *subm = p_module->submodule; subm; subm = subm->next)
DupModule (subm);
......@@ -1089,6 +1090,7 @@ static void UndupModule( module_t *p_module )
FREENULL( p_module->psz_shortname );
free( p_module->psz_longname );
FREENULL( p_module->psz_help );
free( p_module->domain );
}
#endif /* HAVE_DYNAMIC_PLUGINS */
......
......@@ -133,6 +133,7 @@ struct module_t
/* Plugin-specific stuff */
module_handle_t handle; /* Unique handle */
char * psz_filename; /* Module filename */
char * domain; /* gettext domain */
bool b_builtin; /* Set to true if the module is built in */
bool b_loaded; /* Set to true if the dll is loaded */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment