[Pkg-octave-devel] Compiling Octaviz in unstable

Rafael Laboissiere rafael at debian.org
Sat Dec 10 19:23:46 UTC 2005


* Thomas Weber <thomas.weber.mail at gmail.com> [2005-12-09 16:31]:

> Am Donnerstag, den 08.12.2005, 23:17 +0100 schrieb Rafael Laboissiere:
> > This comes probably from a change in g++ which became more stringent as
> > regards escape sequences in strings.  At any rate, the "\code [...]
> > \endcode" blocks that appear in the *.h should be translated into
> > "@example [...] @end example" blocks in the DEFUN_DLD doc strings.
> 
> I updated my system (which brought an update of gcc and friends) and now
> it's down to a warning again, so you can consider this problems fixed. 

I still think that octaviz would benefit from having the description strings
being translated to texinfo.  Please, consider the patch attached below.  I
will eventually send it to the usptream authors.

> Compilation works on my system; I will do a check-in over the week-end.

Great.  Here is my wishlist for the package:

1) Apply the patch mentioned above.

2) Migrate fully to CDBS (for now, it uses only simple-patchsys.mk).  We
   recently built the octplot package using a pure CDBS debian/rules.  It
   really rocks!
   
3) Check whether the build-dependency can be lesstif2-dev instead of
   lesstif-dev.   

-- 
Rafael
-------------- next part --------------
--- octaviz-0.4.0.orig/Wrapping/vtkWrapOctave.c

+++ octaviz-0.4.0/Wrapping/vtkWrapOctave.c

@@ -571,6 +571,7 @@

 void vtkParseOutput(FILE *fp, FileInfo *data)

 {

   int i,j;

+  int in_example;

   

   fprintf(fp,"// Octave wrapper for %s object\n//\n",data->ClassName);

     

@@ -618,19 +619,48 @@

 	/* Make the function that is callable from octave */

   /* Add class description into the function. */

   /* This will displayed as help in octave */

-  fprintf(fp,"\nDEFUN_DLD ( %s, args, nargout, \n  \"%s \\n\\\n  \\n\\\n  ",data->ClassName,data->ClassName);

+  fprintf(fp,"\nDEFUN_DLD ( %s, args, nargout, \n", data->ClassName);

+  fprintf(fp,"  \"-*- texinfo -*-\\n\\\n");

+  fprintf(fp,"@deftypefn {Built-in Function} {} %s\\n\\\n\\n\\\n", data->ClassName);

   i = 0;

+  in_example = 0;

 	if ( data->Description != NULL )

   while ( data->Description[i] != 0 )

     {

     if ( data->Description[i] == '"' ) fprintf(fp,"\\");

-		

+       

+    /* Curly braces are special characters in Texinfo.  Quote them. */

+    if ( data->Description[i] == '{' || data->Description[i] == '}' )

+	 fprintf(fp,"@");       

+

+    /* Replace `\code [...] \endcode' constructs by the texinfo equivalent

+       @example [..] @end example' */   

+    if (strncmp (data->Description + i, "\\code", 5) == 0) {

+      fprintf(fp,"@example");

+      in_example = 1;

+      i += 5;

+    }

+    if (strncmp (data->Description + i, "\\endcode", 8) == 0) {

+      fprintf(fp,"@end example");

+      in_example = 0;

+      i += 8;

+    }

+    /* Skip emphasis markup.  This could be replaced by @emph, 

+       but it is trick because @emph needs a bracketed argument */

+    if (strncmp (data->Description + i, "\\em", 3) == 0) {

+      i += 3;

+    }

+	

     if ( data->Description[i] == '\n' )

 		  {

 			/* Don't want the last newline */

 			if ( i + 2 < strlen(data->Description) )

 			  {

-				fprintf(fp,"\\n\\\n  ");

+				fprintf(fp,"\\n\\\n");

+				/* Eat spaces at beginning of lines */

+				if (in_example != 1) 

+					while (data->Description[i + 1] == ' ')

+						i++;

 			  }

 			i++;

 		  } else

@@ -638,7 +668,7 @@

 			fprintf(fp,"%c",data->Description[i++]);

 		  }

     }

-  fprintf(fp,"\")\n{\n" );

+	fprintf(fp,"\\n\\\n at end deftypefn\")\n{\n" );

 	fprintf(fp,"  octave_value retval;\n" );

 

   /* This associative map holds help for each method (if avaliable) */



More information about the Pkg-octave-devel mailing list