From: Jarkko Hietaniemi Date: Fri, 27 Apr 2001 13:13:18 +0000 (+0000) Subject: h2xs tweaks: use NV instead of double, "quote" the removed X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9cacc32ed9e1c3bba4025bf18d424d977597ae93;p=p5sagit%2Fp5-mst-13.2.git h2xs tweaks: use NV instead of double, "quote" the removed prefixes for clarity (especially when nothing is removed), slight pod reformats. p4raw-id: //depot/perl@9882 --- diff --git a/utils/h2xs.PL b/utils/h2xs.PL index 9c25357..55356ab 100644 --- a/utils/h2xs.PL +++ b/utils/h2xs.PL @@ -59,12 +59,12 @@ will be used, with the first character capitalized. If the extension might need extra libraries, they should be included here. The extension Makefile.PL will take care of checking whether -the libraries actually exist and how they should be loaded. -The extra libraries should be specified in the form -lm -lposix, etc, -just as on the cc command line. By default, the Makefile.PL will -search through the library path determined by Configure. That path -can be augmented by including arguments of the form B<-L/another/library/path> -in the extra-libraries argument. +the libraries actually exist and how they should be loaded. The extra +libraries should be specified in the form -lm -lposix, etc, just as on +the cc command line. By default, the Makefile.PL will search through +the library path determined by Configure. That path can be augmented +by including arguments of the form B<-L/another/library/path> in the +extra-libraries argument. =head1 OPTIONS @@ -72,8 +72,8 @@ in the extra-libraries argument. =item B<-A> -Omit all autoload facilities. This is the same as B<-c> but also removes the -S> statement from the .pm file. +Omit all autoload facilities. This is the same as B<-c> but also +removes the S> statement from the .pm file. =item B<-C> @@ -157,7 +157,8 @@ from typemaps. Should not be used without B<-x>. This may be useful since, say, types which are C-equivalent to integers may represent OS-related handles, and one may want to work with these handles in OO-way, as in C<$handle-Edo_something()>. -Use C<-o .> if you want to handle all the Ced types as opaque types. +Use C<-o .> if you want to handle all the Ced types as opaque +types. The type-to-match is whitewashed (except for commas, which have no whitespace before them, and multiple C<*> which have no whitespace @@ -165,14 +166,17 @@ between them). =item B<-p> I -Specify a prefix which should be removed from the Perl function names, e.g., S<-p sec_rgy_> -This sets up the XS B keyword and removes the prefix from functions that are -autoloaded via the C mechanism. +Specify a prefix which should be removed from the Perl function names, +e.g., S<-p sec_rgy_> This sets up the XS B keyword and removes +the prefix from functions that are autoloaded via the C +mechanism. =item B<-s> I -Create a perl subroutine for the specified macros rather than autoload with the constant() subroutine. -These macros are assumed to have a return type of B, e.g., S<-s sec_rgy_wildcard_name,sec_rgy_wildcard_sid>. +Create a perl subroutine for the specified macros rather than autoload +with the constant() subroutine. These macros are assumed to have a +return type of B, e.g., +S<-s sec_rgy_wildcard_name,sec_rgy_wildcard_sid>. =item B<-v> I @@ -184,8 +188,9 @@ to the templates. The default is 0.01. Automatically generate XSUBs basing on function declarations in the header file. The package C should be installed. If this option is specified, the name of the header file may look like -C. In this case NAME1 is used instead of the specified string, -but XSUBs are emitted only for the declarations included from file NAME2. +C. In this case NAME1 is used instead of the specified +string, but XSUBs are emitted only for the declarations included from +file NAME2. Note that some types of arguments/return-values for functions may result in XSUB-declarations/typemap-entries which need @@ -1180,7 +1185,7 @@ sub write_const { if (@$list == 0) { # Can happen on the initial iteration only print $fh <<"END"; -static double +static NV constant(char *name, int len, int arg) { errno = EINVAL; @@ -1194,11 +1199,11 @@ END my $protect = protect_convert_to_double("$pref$list->[0]"); print $fh <<"END"; -static double +static NV constant(char *name, int len, int arg) { errno = 0; - if (strEQ(name + $offarg, "$list->[0]")) { /* $pref removed */ + if (strEQ(name + $offarg, "$list->[0]")) { /* \"$pref\" removed */ #ifdef $pref$list->[0] return $protect$pref$list->[0]; #else @@ -1233,7 +1238,7 @@ END $npref = '' if $pref eq ''; print $fh <<"END"; -static double +static NV constant$npref(char *name, int len, int arg) { END @@ -1291,7 +1296,7 @@ EOP = protect_convert_to_double("$pref$leader$letter$leading{$letter}[0]"); print $fh <