aboutsummaryrefslogtreecommitdiffstats
path: root/make-faq
diff options
context:
space:
mode:
authorjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>2003-03-02 17:42:37 +0000
committerjmayer <jmayer@f5534014-38df-0310-8fa8-9805f1628bb7>2003-03-02 17:42:37 +0000
commitcda0c5f87889060fb5de16ca0f02f49a021c4fd6 (patch)
tree14713f3ea57230b09ba0b66a9c7b66124512a811 /make-faq
parent07684110e60ed7313d07fe377b88c3ddf99a3d35 (diff)
Split FAQ into shorter lines before including it into the gtk help dialog.
Ignore tmp files generated by make-faq. Update FAQ. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7249 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'make-faq')
-rwxr-xr-xmake-faq28
1 files changed, 23 insertions, 5 deletions
diff --git a/make-faq b/make-faq
index da8e21fe92..0b16f88f84 100755
--- a/make-faq
+++ b/make-faq
@@ -1,14 +1,16 @@
#!/bin/sh
#
-# $Id: make-faq,v 1.3 2003/02/18 11:24:19 jmayer Exp $
+# $Id: make-faq,v 1.4 2003/03/02 17:42:28 jmayer Exp $
#
# Make-faq - Creates a plain text version of the Ethereal FAQ
# from http://www.ethereal.com/faq
-FAQ=FAQ
+# Split the FAQ every LINECOUNT lines so the strings don't become too long
+# for # some compilers.
+LINECOUNT=400
-rm -f $FAQ
-cat >$FAQ <<EOF
+rm -f FAQ
+cat >FAQ <<EOF
The Ethereal FAQ
@@ -24,6 +26,22 @@ EOF
lynx -dump -nolist "http://www.ethereal.com/faq" | sed -e '1,/INDEX/d' >>FAQ
# Create an #include'able version for gtk/help_dlg.c
-sed -e 's/\\/\\\\/g' -e 's/"/\\"/g' -e 's/^/"/' -e 's/$/\\n"/' <FAQ >FAQ.include
+rm -f FAQ.include FAQTMP*
+split -l $LINECOUNT FAQ FAQTMP
+NUM=0
+echo "const char *faq_part[] = {" >>FAQ.include
+for i in FAQTMP*; do
+ if [ $NUM -ne 0 ]; then
+ echo "," >>FAQ.include
+ echo >>FAQ.include
+ fi
+ sed -e 's/\\/\\\\/g' -e 's/"/\\"/g' -e 's/^/"/' -e 's/$/\\n"/' <$i >>FAQ.include
+ NUM=`expr $NUM + 1`
+done
+echo "};" >>FAQ.include
+echo "#define FAQ_PARTS $NUM" >>FAQ.include
+SIZE=`wc -c FAQ | tr -d ' A-Za-z'`
+echo "#define FAQ_SIZE $SIZE" >>FAQ.include
+rm -f FAQTMP*
exit 0