Put "WTP" into the Info column for segmented invoke/result PDUs on which
[obnox/wireshark/wip.git] / make-faq
1 #!/bin/sh
2 #
3 # $Id: make-faq,v 1.4 2003/03/02 17:42:28 jmayer Exp $
4 #
5 # Make-faq - Creates a plain text version of the Ethereal FAQ
6 #       from http://www.ethereal.com/faq
7
8 # Split the FAQ every LINECOUNT lines so the strings don't become too long
9 # for # some compilers.
10 LINECOUNT=400
11
12 rm -f FAQ
13 cat >FAQ <<EOF
14
15    The Ethereal FAQ
16
17    Note: This is just an ASCII snapshot of the faq and may not be up to
18          date. Please go to http://www.ethereal.com/faq for the up to
19          date version. The version of this snapshot can be found at the
20          end of this document.
21
22    INDEX
23
24 EOF
25
26 lynx -dump -nolist "http://www.ethereal.com/faq" | sed -e '1,/INDEX/d' >>FAQ
27
28 # Create an #include'able version for gtk/help_dlg.c
29 rm -f FAQ.include FAQTMP*
30 split -l $LINECOUNT FAQ FAQTMP
31 NUM=0
32 echo "const char *faq_part[] = {" >>FAQ.include
33 for i in FAQTMP*; do
34    if [ $NUM -ne 0 ]; then
35       echo "," >>FAQ.include
36       echo >>FAQ.include
37    fi
38    sed -e 's/\\/\\\\/g' -e 's/"/\\"/g' -e 's/^/"/' -e 's/$/\\n"/' <$i >>FAQ.include
39    NUM=`expr $NUM + 1`
40 done
41 echo "};" >>FAQ.include
42 echo "#define FAQ_PARTS $NUM" >>FAQ.include
43 SIZE=`wc -c FAQ | tr -d ' A-Za-z'`
44 echo "#define FAQ_SIZE $SIZE" >>FAQ.include
45 rm -f FAQTMP*
46
47 exit 0