2 ################################################################################
4 # mkapidoc.sh -- generate apidoc.fnc from scanning the Perl source
6 # Should be called from the base directory for Devel::PPPort.
7 # If that happens to be in the /dist directory of a perl build structure, and
8 # you're doing the standard thing, no parameters are required. Otherwise
9 # (again with the standard things, it can be called with one parameter:
10 # sh devel/mkapidoc.sh /path/to/the/embed.fnc/you/want
12 ################################################################################
14 # Version 3.x, Copyright (C) 2004-2013, Marcus Holland-Moritz.
15 # Version 2.x, Copyright (C) 2001, Paul Marquess.
16 # Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
18 # This program is free software; you can redistribute it and/or
19 # modify it under the same terms as Perl itself.
21 ################################################################################
25 [ -f "$1/embed.fnc" ] && [ -f "$1/perl.h" ]
30 echo "USAGE: $0 [perlroot] [output-file] [input embed.fnc]"
35 if isperlroot "../../.."; then
43 if [ -f "parts/apidoc.fnc" ]; then
44 OUTPUT="parts/apidoc.fnc"
53 EMBED="$PERLROOT/embed.fnc"
58 if isperlroot $PERLROOT; then
60 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
62 : !!!! Do NOT edit this file directly! -- Edit devel/mkapidoc.sh instead. !!!!
64 : This file was automatically generated from the API documentation scattered
65 : all over the Perl source code. To learn more about how all this works,
66 : please read the F<HACKERS> file that came with this distribution.
68 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
71 : This file lists all API functions/macros that are documented in the Perl
72 : source code, but are not contained in F<embed.fnc>.
75 : This line needs to be in this file for things to work, even though it's been
76 : removed from later embed.fnc versions
77 ApTod |int |my_sprintf |NN char *buffer|NN const char *pat|...
80 grep -hr '^=for apidoc' $PERLROOT | sed -e 's/=for apidoc //' \
85 | perl -e 'use warnings;
90 # Populate %h with the embed.fnc entry names
91 open(F,$f) || die "$f:$!";
92 while (<F>) { # In embed.fnc,
93 next unless /^[A-Za-z]+\t/; # skip lines that arent defns
94 ( split /\s*\|\s*/ ) [2] =~ /(\w+)/;
95 $h{$1}++; # Note in %h that $1 is in $EMBED
98 s/\|/d|/ unless /^[^|]*d/; # Many of the entries omit the "d"
99 # flag to indicate they are
100 # documented, but we wouldnt have
101 # found this unless it was
102 # documented in the source
104 ( split /\s*\|\s*/ ) [2] =~ /(\w+)/;
108 echo "$0: First parameter must be a directory containing embed.fnc and perl.h"