[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sf.net
Fri May 15 02:55:21 UTC 2009
The following commit has been merged in the upstream branch:
commit 09fc3fcbc63a298d96c08b377f768196dfb99ee6
Author: Stephane Popinet <popinet at users.sf.net>
Date: Tue May 13 11:12:38 2008 +1000
Fix for hard-coded module names in parameter files
darcs-hash:20080513011238-d4795-9063120bd2d0e6c6cb46fb6fb6bba22df94345dd.gz
diff --git a/modules/map.mod b/modules/map.mod
index b646ad5..0abd12b 100644
--- a/modules/map.mod
+++ b/modules/map.mod
@@ -179,6 +179,9 @@ GfsMapClass * gfs_map_projection_class (void)
/* Initialize module */
+/* only define gfs_module_name for "official" modules (i.e. those installed in
+ GFS_MODULES_DIR) */
+const gchar gfs_module_name[] = "map";
const gchar * g_module_check_init (void);
const gchar * g_module_check_init (void)
diff --git a/modules/terrain.mod b/modules/terrain.mod
index 8c7d375..e9f5a0d 100644
--- a/modules/terrain.mod
+++ b/modules/terrain.mod
@@ -1144,9 +1144,10 @@ GfsEventClass * gfs_terrain_class (void)
/* Initialize module */
+/* only define gfs_module_name for "official" modules (i.e. those installed in
+ GFS_MODULES_DIR) */
+const gchar gfs_module_name[] = "terrain";
const gchar * g_module_check_init (void);
-void gfs_module_read (GtsFile * fp);
-void gfs_module_write (FILE * fp);
const gchar * g_module_check_init (void)
{
@@ -1157,13 +1158,3 @@ const gchar * g_module_check_init (void)
gfs_terrain_class ();
return NULL;
}
-
-void gfs_module_read (GtsFile * fp)
-{
- g_return_if_fail (fp != NULL);
-}
-
-void gfs_module_write (FILE * fp)
-{
- g_return_if_fail (fp != NULL);
-}
diff --git a/modules/tide.mod b/modules/tide.mod
index bcfba77..f7aec29 100644
--- a/modules/tide.mod
+++ b/modules/tide.mod
@@ -332,6 +332,9 @@ GfsBcClass * gfs_bc_tide_class (void)
/* Initialize module */
+/* only define gfs_module_name for "official" modules (i.e. those installed in
+ GFS_MODULES_DIR) */
+const gchar gfs_module_name[] = "tide";
const gchar * g_module_check_init (void);
void gfs_module_read (GtsFile * fp);
void gfs_module_write (FILE * fp);
diff --git a/src/simulation.c b/src/simulation.c
index d326661..c31884a 100644
--- a/src/simulation.c
+++ b/src/simulation.c
@@ -79,7 +79,10 @@ static void simulation_write (GtsObject * object, FILE * fp)
i = sim->modules;
while (i) {
void (* module_write) (FILE *);
- fprintf (fp, " GModule %s", g_module_name (i->data));
+ const gchar * name = NULL;
+ fprintf (fp, " GModule %s",
+ g_module_symbol (i->data, "gfs_module_name", (gpointer) &name) ? name :
+ g_module_name (i->data));
if (g_module_symbol (i->data, "gfs_module_write", (gpointer) &module_write))
(* module_write) (fp);
fputc ('\n', fp);
@@ -204,7 +207,7 @@ static void simulation_read (GtsObject ** object, GtsFile * fp)
else if (!strcmp (fp->token->str, "GModule")) {
gts_file_next_token (fp);
if (fp->type != GTS_STRING) {
- gts_file_error (fp, "expecting a string (filename)");
+ gts_file_error (fp, "expecting a string (module name)");
return;
}
if (!g_module_supported ()) {
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list