From e27e7ee3ca758e18c0f8ca4f9c1b80ab3aad31fc Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Fri, 10 Aug 2001 16:58:27 +0000 Subject: [PATCH] updates. --- apps/silcd/server.c | 2 +- scripts/silcdoc/gen.sh | 7 +++ scripts/silcdoc/gen_detail.php | 6 +-- scripts/silcdoc/silcdoc | 76 +++++++++++++++++++++++++++++++++ util/robodoc/Source/generator.c | 2 +- 5 files changed, 88 insertions(+), 5 deletions(-) create mode 100755 scripts/silcdoc/gen.sh create mode 100755 scripts/silcdoc/silcdoc diff --git a/apps/silcd/server.c b/apps/silcd/server.c index 88cfc399..7873aff8 100644 --- a/apps/silcd/server.c +++ b/apps/silcd/server.c @@ -3074,7 +3074,7 @@ bool silc_server_create_channel_key(SilcServer server, if (channel->mode & SILC_CHANNEL_MODE_PRIVKEY) { SILC_LOG_DEBUG(("Channel has private keys, will not generate new key")); - return FALSE; + return TRUE; } if (!channel->channel_key) diff --git a/scripts/silcdoc/gen.sh b/scripts/silcdoc/gen.sh new file mode 100755 index 00000000..1b990eeb --- /dev/null +++ b/scripts/silcdoc/gen.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +cat << EOF > tmp.php + +EOF +php -f tmp.php >$3 +rm -f tmp.php \ No newline at end of file diff --git a/scripts/silcdoc/gen_detail.php b/scripts/silcdoc/gen_detail.php index 4cf6e75c..6e2f8faa 100644 --- a/scripts/silcdoc/gen_detail.php +++ b/scripts/silcdoc/gen_detail.php @@ -37,7 +37,7 @@ if (Is_Readable($page.".html")) -
@@ -46,8 +46,8 @@ width="99%" align=center> /* Get the index for this page */ $len = strcspn($page, "_"); $fname = substr($page, 0, $len); -if (Is_Readable($fname."_index.html")) - require $fname."_index.html"; +if (Is_Readable($fname."_index.tmpl")) + require $fname."_index.tmpl"; eit ?> diff --git a/scripts/silcdoc/silcdoc b/scripts/silcdoc/silcdoc new file mode 100755 index 00000000..40d16a54 --- /dev/null +++ b/scripts/silcdoc/silcdoc @@ -0,0 +1,76 @@ +#!/bin/sh +# +# Author: Pekka Riikonen +# +# Copyright (C) GNU GPL 2001 Pekka Riikonen +# +# SILC Toolkit Reference Manual documentation script. This will automatically +# generate documentation from the source tree. This will require the +# robodoc compiled in util/robodoc and php utility installed in your system. +# +# This will tarverse the given directory and all subdirectories for the +# SILC style header files. All header files starting with prefix `silc' +# will be checked. For example, silcpkcs.h. +# +# Usage: ./sildoc +# +# The is the directory where this starts checking for +# the headers and will traverse all subdirectories. The is the directory to where the documentation is generated. +# + +# Arguments checking +if [ $# -lt "4" ]; then + echo "Usage: ./silcdoc " + echo "Supported types: HTML" +# echo "Supported types: HTML, ASCII, LATEX or RTF" + exit 1 +fi + +TYPE=$1 +SRC=$2 +DST=$3 +ROBO=$4 + +# Get all headers in the source directory +headers=`find $SRC -name "silc*.h"` + +# +# HTML documentation +# +if [ "$TYPE" = "HTML" ]; then + mkdir /tmp/silcdoc.html + cp $headers /tmp/silcdoc.html + + # Generate the first pass of the documentation. This will generate + # the HTML from the headers. + path=`pwd` + cd /tmp/silcdoc.html + headers=`find . -name "silc*.h" |cut -d/ -f2 |cut -d. -f1` + cd $path + for i in $headers + do + $ROBO /tmp/silcdoc.html/$i.h $DST/$i.html $TYPE + + # Generate the TOC file + sh gen.sh gen_toc.php $DST/$i.html $DST/$i.html + + # Generate the details + files=`find $DST -name "silc_*.html"` + for k in $files + do + sh gen.sg gen_detail.php $k $k + done + done + + # Make the second pass to create the actual layout for the files + rm -f $DST/*.tmpl + files=`find $DST -name "silc*.html"` + for i in $files + do + sh gen.sh index.php $i $i + done + + rm -rf /tmp/silcdoc.html + rm -f $DST/tmp.php +fi diff --git a/util/robodoc/Source/generator.c b/util/robodoc/Source/generator.c index fcacfd38..34f3db12 100644 --- a/util/robodoc/Source/generator.c +++ b/util/robodoc/Source/generator.c @@ -264,7 +264,7 @@ RB_Generate_Doc_Start ( fprintf (dest_doc, "
    \n"); /* Generate quick index file, for fast referencing */ - sprintf(iname, "%s_index.html", doc_base); + sprintf(iname, "%s_index.tmpl", doc_base); index = fopen(iname, "w"); for (cur_header = first_header; -- 2.24.0