blob: ea53d0b7d46df7bd5eb80594573fe7130cda800f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
#!/bin/bash
################################################################################
#
# mkapidoc.sh -- generate apidoc.fnc from scanning the Perl source
#
################################################################################
#
# $Revision: 10 $
# $Author: mhx $
# $Date: 2007/08/12 11:50:36 +0200 $
#
################################################################################
#
# Version 3.x, Copyright (C) 2004-2007, Marcus Holland-Moritz.
# Version 2.x, Copyright (C) 2001, Paul Marquess.
# Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
#
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
#
################################################################################
function isperlroot
{
[ -f "$1/embed.fnc" ] && [ -f "$1/perl.h" ]
}
function usage
{
echo "USAGE: $0 [perlroot] [output-file] [embed.fnc]"
exit 0
}
if [ -z "$1" ]; then
if isperlroot "../../.."; then
PERLROOT=../../..
else
PERLROOT=.
fi
else
PERLROOT=$1
fi
if [ -z "$2" ]; then
if [ -f "parts/apidoc.fnc" ]; then
OUTPUT="parts/apidoc.fnc"
else
usage
fi
else
OUTPUT=$2
fi
if [ -z "$3" ]; then
if [ -f "parts/embed.fnc" ]; then
EMBED="parts/embed.fnc"
else
usage
fi
else
EMBED=$3
fi
if isperlroot $PERLROOT; then
cat >$OUTPUT <<EOF
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:
: !!!!! Do NOT edit this file directly! -- Edit PPPort_pm.PL instead. !!!!!
:
: This file was automatically generated from the API documentation scattered
: all over the Perl source code. To learn more about how all this works,
: please read the F<HACKERS> file that came with this distribution.
:
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:
: This file lists all API functions/macros that are documented in the Perl
: source code, but are not contained in F<embed.fnc>.
:
EOF
grep -hr '^=for apidoc' $PERLROOT | sed -e 's/=for apidoc //' | grep '|' | sort | uniq \
| perl -e'$f=pop;open(F,$f)||die"$f:$!";while(<F>){(split/\|/)[2]=~/(\w+)/;$h{$1}++}
while(<>){s/[ \t]+$//;(split/\|/)[2]=~/(\w+)/;$h{$1}||print}' $EMBED >>$OUTPUT
else
usage
fi
|