aboutsummaryrefslogtreecommitdiffstats
path: root/make-faq
diff options
context:
space:
mode:
authorJörg Mayer <jmayer@loplof.de>2003-03-02 17:42:37 +0000
committerJörg Mayer <jmayer@loplof.de>2003-03-02 17:42:37 +0000
commit4f8247dc2bea433ef9f0fe8e5059afbd1110b35f (patch)
tree14713f3ea57230b09ba0b66a9c7b66124512a811 /make-faq
parenta539d5616e72d6144c20a2cdeacd8a64e157343b (diff)
Split FAQ into shorter lines before including it into the gtk help dialog.
Ignore tmp files generated by make-faq. Update FAQ. svn path=/trunk/; revision=7249
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