[vlc-devel] commit: Keep track of plugin text domain ( Rémi Denis-Courmont )

git version control git at videolan.org
Thu Jan 28 19:00:03 CET 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jan 28 19:16:18 2010 +0200| [5b7c5b6672ce195b7a5008517b7baec1eafbd93e] | committer: Rémi Denis-Courmont 

Keep track of plugin text domain

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5b7c5b6672ce195b7a5008517b7baec1eafbd93e
---

 src/modules/cache.c   |    6 +++++-
 src/modules/entry.c   |    5 +++--
 src/modules/modules.c |    2 ++
 src/modules/modules.h |    1 +
 4 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/modules/cache.c b/src/modules/cache.c
index d9a3cee..5517d3a 100644
--- a/src/modules/cache.c
+++ b/src/modules/cache.c
@@ -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:
diff --git a/src/modules/entry.c b/src/modules/entry.c
index de6312f..7ed2697 100644
--- a/src/modules/entry.c
+++ b/src/modules/entry.c
@@ -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:
diff --git a/src/modules/modules.c b/src/modules/modules.c
index 0af81ac..27e5254 100644
--- a/src/modules/modules.c
+++ b/src/modules/modules.c
@@ -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 */
diff --git a/src/modules/modules.h b/src/modules/modules.h
index b9d0b3a..62a79ad 100644
--- a/src/modules/modules.h
+++ b/src/modules/modules.h
@@ -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 */




More information about the vlc-devel mailing list