summaryrefslogtreecommitdiffstats
path: root/doc/posix1003.1/summarize
blob: 545d3e47005dc32d7f4933f99baf7ee8cba8c88c (plain) (blame)
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
#! /bin/sh
#
#  Generate the summary chapter
#
#  $Id$
#

echo "@c"
echo "@c DO NOT EDIT -- AUTOMATICALLY GENERATED!!!"
echo "@c"
echo
echo "@chapter Compliance Summary"
echo

summarize_chapter()
{
  grep "^@chapter" $1 | \
    sed -e "s/^.chapter/@section/"  \
        -e "s/$/ Chapter/" 
  echo
  functions_total=`grep "()" $1 | wc -l`
  functions_implemented=`grep "()" $1 | grep Implemented | wc -l`
  functions_unimplemented=`grep "()" $1 | grep Unimplemented | wc -l`
  functions_unmplementable=`grep "()" $1 | grep Unimplementable | wc -l`

  echo "@example"
  echo "Total Number of Functions: ${functions_total} @*"
  echo "Functions Implemented    : ${functions_implemented} @*"
  echo "Functions Unimplemented  : ${functions_unimplemented} @*"
  echo "Functions Unimplementable: ${functions_unmplementable} @*"
  echo "@end example"
  echo
}

chapters="ch01.t ch02.t ch03.t ch04.t ch05.t ch06.t ch07.t ch08.t \
    ch09.t ch10.t ch11.t ch12.t ch13.t ch14.t ch15.t ch16.t ch17.t ch18.t"
for chapter in ${chapters}
do
  summarize_chapter $chapter
done