Kind of a patch for sgml importer

Michèle Garoche <[email protected]> Fri, 8 Apr 2005 16:57:18 +0200
Newsgroups gmane.editors.conglomerate.devel
Message-ID <[email protected]>
I say kind of because it does not rely on sgml2x which is not ported on 
Fink, but on osx (part of opensp4), which does the same thing, but 
needs two options for it to work properly, I don't know if sgml2x needs 
option too.

Hence there are a few lines which does not apply (changes to the tool 
and number and value of argv):

It is borrowed from bluefish, so I'll guess it should work on 
conglomerate. It works on Mac.

Basically it takes the gnomevfsuri, transforms it to a string hidding 
some parts depending on whether it is local or not, then returns it to 
the function casting it.

--- conglomerate/src/plugin-sgml.c	Thu Apr  7 17:59:14 2005
+++ conglomerate/src/plugin-sgml-patched.c	Fri Apr  8 04:20:11 2005
@@ -79,6 +79,22 @@
  }
  #endif

+gchar *uri_to_system_filename(GnomeVFSURI *uri) {
+	if (gnome_vfs_uri_is_local(uri)) {
+		return gnome_vfs_uri_to_string(uri, 
GNOME_VFS_URI_HIDE_TOPLEVEL_METHOD);
+	} else {
+		return gnome_vfs_uri_to_string(uri, GNOME_VFS_URI_HIDE_PASSWORD);
+	}
+}
+
+gchar *uri_to_system_filename2(gchar *uri) {
+	gchar *ret;
+	GnomeVFSURI *guri = gnome_vfs_uri_new(uri);
+	ret = uri_to_system_filename(guri);
+	gnome_vfs_uri_unref(guri);
+	return ret;
+}
+
  /**
   * sgml_importer_action_callback:
   * @importer:
@@ -99,21 +115,22 @@
  	xmlDocPtr xml_doc;

  #if 1
-	gchar *argv[3];
+	gchar *argv[5];
  	gchar *standard_output;
  	gchar *standard_error;
  	gint exit_status;
  	GError *error = NULL;
  	gboolean result;

-/* 	gchar * posix_name = cong_util_get_local_path_from_uri(GnomeVFSURI 
*uri); */
-
+  gchar * posix_name = uri_to_system_filename2((gchar*)uri);	

  	g_message("sgml_importer_action_callback");

-	argv[0] = "sgml2xml";
-	argv[1] = (gchar*)uri; /* FIXME: this is GnomeVFS uri path string, 
not a POSIX path */
-	argv[2] = NULL;
+	argv[0] = "osx";
+	argv[1] = "-xno-nl-in-tag";
+	argv[2] = "-xlower";
+	argv[3] = (gchar*)posix_name; /* FIXME: this is GnomeVFS uri path 
string, not a POSIX path */
+	argv[4] = NULL;


  	/* Spawn a subprocess that runs sgml2xml on the uri and grabs the 
output: */

Michèle
<http://micmacfr.homeunix.org>

_______________________________________________
Conglomerate-devel mailing list
[email protected]
http://lists.copyleft.no/mailman/listinfo/conglomerate-devel
PGP.sig (application/pgp-signature, 186 B) - not displayed