From: Ilya Zakharevich Date: Tue, 3 Oct 2000 21:43:01 +0000 (-0400) Subject: [PATCH 5.7.0] h2xs not working X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b7d5fa84b877120eda5ebc2013a83a96accf6536;p=p5sagit%2Fp5-mst-13.2.git [PATCH 5.7.0] h2xs not working Message-ID: <20001003214301.A22851@monk.mps.ohio-state.edu> Date: Tue, 3 Oct 2000 21:43:01 -0400 Subject: [PATCH 5.7.0] h2xs not documenting the created module From: Ilya Zakharevich Date: Tue, 3 Oct 2000 22:55:19 -0400 Message-ID: <20001003225519.A23360@monk.mps.ohio-state.edu> p4raw-id: //depot/perl@7141 --- diff --git a/utils/h2xs.PL b/utils/h2xs.PL index 2885c6f..a5aa724 100644 --- a/utils/h2xs.PL +++ b/utils/h2xs.PL @@ -905,6 +905,7 @@ my $exp_doc = < should be removed. # -EOD +#EOD $exp_doc .= <[0] =~ /_ANON/) { + if (defined $item->[2]) { + push @items, map [ + @$_[0, 1], "$item->[2]_$_->[2]", "$item->[2].$_->[2]", + ], @{ $structs{$item->[0]} }; + } else { + push @items, @{ $structs{$item->[0]} }; + } + } else { + push @list, $item->[2]; + } + } + my $methods = (join '(...)>, C<', @list), '(...)'; + + return <<"EOF"; + +=head2 Object and class methods for C<$name>/C<$ptrname> + +The principal Perl representation of a C object of type C<$name> is an +object of class C<$ptrname> which is a reference to an integer +representation of a C pointer. To create such an object, one may use +a combination + + my $buffer = $name->new(); + my $obj = $buf->_to_ptr(); + +This exersizes the following two methods, and an additional class +C<$name>, the internal representation of which is a reference to a +packed string with the C structure. Keep in mind that $buffer should +better survive longer than $obj. + +=over + +=item C<\$object_of_type_$name->_to_ptr()> + +Converts an object of type C<$name> to an object of type C<$ptrname>. + +=item C<$name->new()> + +Creates an empty object of type C<$name>. The corresponding packed +string is zeroed out. + +=item C<$methods> + +return the current value of the corresponding element if called +without additional arguments. Set the element to the supplied value +(and return the new value) if called with an additional argument. + +Applicable to objects of type C<$ptrname>. + +=back + +EOF +} + # Should be called before any actual call to normalize_type(). sub get_typemap { # We do not want to read ./typemap by obvios reasons.