rpms/perl-PDL/devel perl-PDL-2.4.3-plparseopts.patch,NONE,1.1

Orion Poplawski orion at fedoraproject.org
Thu Sep 4 21:28:52 UTC 2008


Author: orion

Update of /cvs/pkgs/rpms/perl-PDL/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv10118

Added Files:
	perl-PDL-2.4.3-plparseopts.patch 
Log Message:
Add the new patch


perl-PDL-2.4.3-plparseopts.patch:

--- NEW FILE perl-PDL-2.4.3-plparseopts.patch ---
--- PDL-2.4.3/Graphics/PLplot/plplot.pd.plparseopts	2005-05-03 08:19:47.000000000 -0600
+++ PDL-2.4.3/Graphics/PLplot/plplot.pd	2008-09-04 14:27:33.000000000 -0600
@@ -1573,7 +1573,7 @@
 # constants in plplot.h available in Perl in the form of functions.  It
 # should be then possible to write code like this:
 #
-#    plParseOpts (\@ARGV, PL_PARSE_SKIP | PL_PARSE_NOPROGRAM);
+#    plparseopts (\@ARGV, PL_PARSE_SKIP | PL_PARSE_NOPROGRAM);
 
 sub create_low_level_constants {
   my $defn = shift;
@@ -1599,7 +1599,7 @@
 
 create_low_level_constants (<<'EODEF');
 
-# Definitions used in plParseOpts
+# Definitions used in plparseopts
 
 PL_PARSE_PARTIAL
 PL_PARSE_FULL
@@ -2100,6 +2100,46 @@
 ## Parse PLplot options given in @ARGV-like arrays
 #
 
+pp_def ('plparseopts',
+        GenericTypes => [D],
+        Pars => 'int [o] retval()',
+        OtherPars => 'SV* argv; int mode',
+        Doc => 'FIXME: documentation here!',
+        Code => '
+                SV* sv = $COMP (argv);
+                AV* arr;
+                int argc, newargc, i, retval;
+                char** args;
+
+                if ( !(SvROK (sv) && SvTYPE (SvRV (sv)) == SVt_PVAV)) {
+                        barf("plparseopts requires an array ref");
+                }
+
+                arr = (AV*) SvRV (sv);
+                newargc = argc = av_len (arr) + 1;
+                args = calloc (argc , sizeof (char*));
+
+                for (i = 0; i < argc; i++) {
+                        STRLEN len;
+                        args[i] = SvPV (* av_fetch (arr, i, 0), len);
+                }
+
+                $retval() = plparseopts (&newargc, args, $COMP (mode));
+
+                for (i = 0; i < newargc; i++)
+                        av_push (arr, newSVpv (args[i], 0));
+
+                for (i = 0; i < argc; i++)
+                        av_shift (arr);
+
+                free (args);
+        ',
+);
+
+#
+## Parse PLplot options given in @ARGV-like arrays (deprecated)
+#
+
 pp_def ('plParseOpts',
         GenericTypes => [D],
         Pars => 'int [o] retval()',




More information about the fedora-extras-commits mailing list