sub autodoc ($$) { # parse a file and extract documentation info
my($fh,$file) = @_;
- my($in, $doc);
-
+ my($in, $doc, $line);
FUNC:
while (defined($in = <$fh>)) {
+ $line++;
if ($in =~ /^=for\s+apidoc\s+(.*)\n/) {
my $proto = $1;
$proto = "||$proto" unless $proto =~ /\|/;
my $docs = "";
DOC:
while (defined($doc = <$fh>)) {
+ $line++;
last DOC if $doc =~ /^=\w+/;
+ if ($doc =~ m:^\*/$:) {
+ warn "=cut missing? $file:$line:$doc";;
+ last DOC;
+ }
$docs .= $doc;
}
$docs = "\n$docs" if $docs and $docs !~ /^\n/;
else {
$docfuncs{$name} = [$flags, $docs, $ret, $file, @args];
}
- if ($doc =~ /^=for/) {
- $in = $doc;
- redo FUNC;
+ if (defined $doc) {
+ if ($doc =~ /^=for/) {
+ $in = $doc;
+ redo FUNC;
+ }
+ } else {
+ warn "$file:$line:$in";
}
}
}
} \*DOC;
for (sort keys %docfuncs) {
+ # Have you used a full for apidoc or just a func name?
+ # Have you used Ap instead of Am in the for apidoc?
warn "Unable to place $_!\n";
}
=for hackers
Found in file av.c
+=item bytes_to_utf8
+
+Converts a string C<s> of length C<len> from ASCII into UTF8 encoding.
+Returns a pointer to the newly-created string.
+
+ U8 * bytes_to_utf8(U8 *s, STRLEN len)
+
+=for hackers
+Found in file utf8.c
+
=item call_argv
Performs a callback to the specified Perl sub. See L<perlcall>.
=for hackers
Found in file sv.h
-=item SvTYPE
-
-Returns the type of the SV. See C<svtype>.
+=item svtype
- svtype SvTYPE(SV* sv)
+An enum of flags for Perl types. These are found in the file B<sv.h>
+in the C<svtype> enum. Test these flags with the C<SvTYPE> macro.
=for hackers
Found in file sv.h
-=item svtype
+=item SvTYPE
-An enum of flags for Perl types. These are found in the file B<sv.h>
-in the C<svtype> enum. Test these flags with the C<SvTYPE> macro.
+Returns the type of the SV. See C<svtype>.
+
+ svtype SvTYPE(SV* sv)
=for hackers
Found in file sv.h
=for hackers
Found in file handy.h
+=item utf8_to_bytes
+
+Converts a string C<s> of length C<len> from UTF8 into ASCII encoding.
+Unlike C<bytes_to_utf8>, this over-writes the original string.
+
+ U8 * utf8_to_bytes(U8 *s, STRLEN len)
+
+=for hackers
+Found in file utf8.c
+
=item warn
This is the XSUB-writer's interface to Perl's C<warn> function. Use this
}
/*
-=for apidoc utf8_to_bytes
+=for apidoc Am|U8 *|utf8_to_bytes|U8 *s|STRLEN len
Converts a string C<s> of length C<len> from UTF8 into ASCII encoding.
Unlike C<bytes_to_utf8>, this over-writes the original string.
}
/*
-=for apidoc bytes_to_utf8
+=for apidoc Am|U8 *|bytes_to_utf8|U8 *s|STRLEN len
Converts a string C<s> of length C<len> from ASCII into UTF8 encoding.
Returns a pointer to the newly-created string.
+=cut
*/
U8*