]> git.sesse.net Git - vlc/commitdiff
Keep track of plugin text domain
authorRémi Denis-Courmont <remi@remlab.net>
Thu, 28 Jan 2010 17:16:18 +0000 (19:16 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 28 Jan 2010 17:50:12 +0000 (19:50 +0200)
src/modules/cache.c
src/modules/entry.c
src/modules/modules.c
src/modules/modules.h

index d9a3cee897859af1c8d79fd385f2c705a46a3319..5517d3a91abe3f827d1638fd475521941d3c67d1 100644 (file)
@@ -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:
index de6312f07bcb44d5c1d94ac5128ec0e97849b853..7ed2697b26c2c078529642fd782fbdb3d2098472 100644 (file)
@@ -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:
index 0af81ac97baa7a118973125c6dc931d5172a3750..27e5254cc000cc1f27ecb6b36249bec3c8c7c756 100644 (file)
@@ -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 */
index b9d0b3a68b01c81163ef868ff73434123c05d125..62a79ad443b9a0d5aae15946e2d852a923b71330 100644 (file)
@@ -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 */