updates.
authorPekka Riikonen <priikone@silcnet.org>
Fri, 10 Aug 2001 16:58:27 +0000 (16:58 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Fri, 10 Aug 2001 16:58:27 +0000 (16:58 +0000)
apps/silcd/server.c
scripts/silcdoc/gen.sh [new file with mode: 0755]
scripts/silcdoc/gen_detail.php
scripts/silcdoc/silcdoc [new file with mode: 0755]
util/robodoc/Source/generator.c

index 88cfc399be87c7641563006c52a1a617ef41b915..7873aff855dc526b5a3b2d83ac86de52796849f3 100644 (file)
@@ -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 (executable)
index 0000000..1b990ee
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+cat << EOF > tmp.php
+  <?php $$page=$2; require "$1"; ?>
+EOF
+php -f tmp.php >$3
+rm -f tmp.php
\ No newline at end of file
index 4cf6e75c53813688437ffb058d51bf2f012556e3..6e2f8faa6ca031da180b751908d4d2419dbcbcd5 100644 (file)
@@ -37,7 +37,7 @@ if (Is_Readable($page.".html"))
 </td>
 
 <td>
-<table bgcolor="#dddddd" cellpadding=2 cellspacing=0 border=0 
+<table bgcolor="#dddddd" cellpadding=4 cellspacing=0 border=0 
 width="99%" align=center>
 <tr><td>
 <font face="Helvetica,Arial,Sans-serif" size="1">
@@ -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 (executable)
index 0000000..40d16a5
--- /dev/null
@@ -0,0 +1,76 @@
+#!/bin/sh
+#
+# Author: Pekka Riikonen <priikone@silcnet.org>
+#
+# 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 <type> <source directory> <destination directory> <robodoc>
+#
+# The <source directory> is the directory where this starts checking for
+# the headers and will traverse all subdirectories.  The <destination
+# directory> is the directory to where the documentation is generated.
+#
+
+# Arguments checking
+if [ $# -lt "4" ]; then
+  echo "Usage: ./silcdoc <type> <source directory> <destination directory> <robodoc>"
+  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
index fcacfd3812e896aadd103ff0137fcd76a2b7316e..34f3db128371e126b21a837fac3789cb35b0cf5b 100644 (file)
@@ -264,7 +264,7 @@ RB_Generate_Doc_Start (
          fprintf (dest_doc, "<OL>\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;