{ return &(PL_##v); }
#define PERLVARA(v,n,t) PL_##v##_t* Perl_##v##_ptr(pTHXo) \
{ return &(PL_##v); }
+#undef PERLVARIC
+#define PERLVARIC(v,t,i) const t* Perl_##v##_ptr(pTHXo) \
+ { return (const t *)&(PL_##v); }
#include "perlvars.h"
#undef PERLVAR
my %gutsdocs;
my %docfuncs;
-sub autodoc ($) { # parse a file and extract documentation info
- my($fh) = @_;
- my($in, $doc);
-
+sub autodoc ($$) { # parse a file and extract documentation info
+ my($fh,$file) = @_;
+ 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/;
if ($flags =~ /m/) {
if ($flags =~ /A/) {
- $apidocs{$name} = [$flags, $docs, $ret, @args];
+ $apidocs{$name} = [$flags, $docs, $ret, $file, @args];
}
else {
- $gutsdocs{$name} = [$flags, $docs, $ret, @args];
+ $gutsdocs{$name} = [$flags, $docs, $ret, $file, @args];
}
}
else {
- $docfuncs{$name} = [$flags, $docs, $ret, @args];
+ $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";
}
}
}
sub docout ($$$) { # output the docs for one function
my($fh, $name, $docref) = @_;
- my($flags, $docs, $ret, @args) = @$docref;
+ my($flags, $docs, $ret, $file, @args) = @$docref;
$docs .= "NOTE: the perl_ form of this function is deprecated.\n\n"
if $flags =~ /p/;
print $fh "(" . join(", ", @args) . ")";
print $fh "\n\n";
}
+ print $fh "=for hackers\nFound in file $file\n\n";
}
my $file;
for $file (glob('*.c'), glob('*.h')) {
open F, "< $file" or die "Cannot open $file for docs: $!\n";
- autodoc(\*F);
+ autodoc(\*F,$file);
close F or die "Error closing $file: $!\n";
}
if ($flags =~ /A/) {
my $docref = delete $docfuncs{$func};
warn "no docs for $func\n" unless $docref and @$docref;
- $apidocs{$func} = [$docref->[0] . 'A', $docref->[1], $retval, @args];
+ $apidocs{$func} = [$docref->[0] . 'A', $docref->[1], $retval,
+ $docref->[3], @args];
} else {
my $docref = delete $docfuncs{$func};
- $gutsdocs{$func} = [$docref->[0], $docref->[1], $retval, @args];
+ $gutsdocs{$func} = [$docref->[0], $docref->[1], $retval,
+ $docref->[3], @args];
}
}
return "";
} \*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";
}
=head1 DESCRIPTION
This file is the autogenerated documentation of functions in the
-Perl intrepreter that are documented using Perl's internal documentation
+Perl interpreter that are documented using Perl's internal documentation
format but are not marked as part of the Perl API. In other words,
B<they are not for use in extensions>!
=head1 AUTHORS
-The autodocumentation system was orignally added to the Perl core by
+The autodocumentation system was originally added to the Perl core by
Benjamin Stuhl. Documentation is by whoever was kind enough to
document their functions.
Ap |void |dounwind |I32 cxix
p |bool |do_aexec |SV* really|SV** mark|SV** sp
p |bool |do_aexec5 |SV* really|SV** mark|SV** sp|int fd|int flag
-Ap |int |do_binmode |PerlIO *fp|int iotype|int flag
+Ap |int |do_binmode |PerlIO *fp|int iotype|int mode
p |void |do_chop |SV* asv|SV* sv
Ap |bool |do_close |GV* gv|bool not_implicit
p |bool |do_eof |GV* gv
p |I32 |do_semop |SV** mark|SV** sp
p |I32 |do_shmio |I32 optype|SV** mark|SV** sp
#endif
-p |void |do_join |SV* sv|SV* del|SV** mark|SV** sp
+Ap |void |do_join |SV* sv|SV* del|SV** mark|SV** sp
p |OP* |do_kv
Ap |bool |do_open |GV* gv|char* name|I32 len|int as_raw \
|int rawmode|int rawperm|PerlIO* supplied_fp
Ap |void |free_tmps
p |OP* |gen_constant_list|OP* o
#if !defined(HAS_GETENV_LEN)
-p |char* |getenv_len |char* key|unsigned long *len
+p |char* |getenv_len |const char* key|unsigned long *len
#endif
Ap |void |gp_free |GV* gv
Ap |GP* |gp_ref |GP* gp
Ap |char* |instr |const char* big|const char* little
p |bool |io_close |IO* io|bool not_implicit
p |OP* |invert |OP* cmd
+dp |bool |is_gv_magical |char *name|STRLEN len|U32 flags
Ap |bool |is_uni_alnum |U32 c
Ap |bool |is_uni_alnumc |U32 c
Ap |bool |is_uni_idfirst |U32 c
Ap |void |repeatcpy |char* to|const char* from|I32 len|I32 count
Ap |char* |rninstr |const char* big|const char* bigend \
|const char* little|const char* lend
-p |Sighandler_t|rsignal |int i|Sighandler_t t
+Ap |Sighandler_t|rsignal |int i|Sighandler_t t
p |int |rsignal_restore|int i|Sigsave_t* t
p |int |rsignal_save |int i|Sighandler_t t1|Sigsave_t* t2
p |Sighandler_t|rsignal_state|int i
p |void |save_freeop |OP* o
Ap |void |save_freepv |char* pv
Ap |void |save_generic_svref|SV** sptr
+Ap |void |save_generic_pvref|char** str
Ap |void |save_gp |GV* gv|I32 empty
Ap |HV* |save_hash |GV* gv
Ap |void |save_helem |HV* hv|SV *key|SV **sptr
Ap |U8* |utf16_to_utf8_reversed|U16* p|U8 *d|I32 bytelen
Ap |I32 |utf8_distance |U8 *a|U8 *b
Ap |U8* |utf8_hop |U8 *s|I32 off
+Ap |U8* |utf8_to_bytes |U8 *s|STRLEN len
+Ap |U8* |bytes_to_utf8 |U8 *s|STRLEN len
Ap |UV |utf8_to_uv |U8 *s|I32* retlen
Ap |U8* |uv_to_utf8 |U8 *d|UV uv
p |void |vivify_defelem |SV* sv
Afp |void |warner |U32 err|const char* pat|...
Ap |void |vwarner |U32 err|const char* pat|va_list* args
p |void |watch |char** addr
-p |I32 |whichsig |char* sig
+Ap |I32 |whichsig |char* sig
p |int |yyerror |char* s
#if defined(USE_PURE_BISON)
p |int |yylex |YYSTYPE *lvalp|int *lcharp
Ap |void |ptr_table_store|PTR_TBL_t *tbl|void *oldsv|void *newsv
Ap |void |ptr_table_split|PTR_TBL_t *tbl
#endif
+#if defined(HAVE_INTERP_INTERN)
+Ap |void |sys_intern_init
+#endif
#if defined(PERL_OBJECT)
protected:
s |I32 |do_trans_UU_simple |SV *sv
s |I32 |do_trans_UU_count |SV *sv
s |I32 |do_trans_UU_complex |SV *sv
-s |I32 |do_trans_UC_simple |SV *sv
-s |I32 |do_trans_CU_simple |SV *sv
s |I32 |do_trans_UC_trivial |SV *sv
s |I32 |do_trans_CU_trivial |SV *sv
#endif
# endif
#endif
+Arp |SV* |lock |SV *sv
+
#if defined(PERL_OBJECT)
};
#endif