updates
authorPekka Riikonen <priikone@silcnet.org>
Fri, 10 Aug 2001 19:24:26 +0000 (19:24 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Fri, 10 Aug 2001 19:24:26 +0000 (19:24 +0000)
scripts/silcdoc/gen.sh
scripts/silcdoc/gen_detail.php
scripts/silcdoc/gen_toc.php
scripts/silcdoc/index.php
scripts/silcdoc/silcdoc
util/robodoc/Source/generator.c

index 1b990eeb01919299891fbbabb83dc941509fb0b0..b11cff5cee62b74e39734bf53dfcfda3c815733b 100755 (executable)
@@ -1,7 +1,8 @@
 #!/bin/sh
 
 cat << EOF > tmp.php
-  <?php $$page=$2; require "$1"; ?>
+<?php \$page="$2"; require "$1"; ?>
 EOF
-php -f tmp.php >$3
-rm -f tmp.php
\ No newline at end of file
+php -f tmp.php >$3.tmp
+mv $3.tmp $3
+rm -f tmp.php
index 6e2f8faa6ca031da180b751908d4d2419dbcbcd5..1ab755bf914af622bf80d887350cd63f7e3012a3 100644 (file)
@@ -29,8 +29,7 @@
 
 <?php
 /* Get the actual data for the page */
-if (Is_Readable($page.".html"))
-  require $page.".html";
+require "$page";
 ?>
 
 </font>
@@ -46,9 +45,7 @@ width="99%" align=center>
 /* Get the index for this page */
 $len = strcspn($page, "_");
 $fname = substr($page, 0, $len);
-if (Is_Readable($fname."_index.tmpl"))
-  require $fname."_index.tmpl";
-eit
+require "$fname"."_index.tmpl";
 ?>
 
 </font>
index d91d0c05d2ad5ce34f0667f8777ef97f50fd5471..48e60e37aedd876cb1ba27d975c57e7ed464eef8 100644 (file)
@@ -28,8 +28,7 @@
 
 <?php
 /* Get the actual data for the page */
-if (Is_Readable($page.".html"))
-  require $page.".html";
+require "$page";
 ?>
 
 </font>
index 8842dd5654580e25c877f289cc435f46432bec7f..efb873c4dcd3e67a0badd12f9079bffe9f9a2420 100644 (file)
@@ -1,14 +1,3 @@
-<?php
-
-// directories where SILC documents are located
-$DocRoot = "/home/www/silcnet.org/d/";
-$HTMLRoot = $DocRoot;
-
-// remove dangerous characters, only alphanumerical characters are passed
-$SecurityFilter = $HTMLRoot.EReg_Replace('([^a-zA-Z0-9_.])*','',$page);
-
-?>
-
 <?xml version="1.0" encoding="iso-8859-1"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
@@ -26,18 +15,6 @@ $SecurityFilter = $HTMLRoot.EReg_Replace('([^a-zA-Z0-9_.])*','',$page);
   a:active { text-decoration: none; color: #2f486f; }
   -->
  </style>
-
- <title> SILC Secure Internet Live Conferencing - 
-<?php
-
-if (Is_Readable($SecurityFilter.".php"))
-  echo $page;
-else
-  echo "news";
-
-?>
- </title>
-
 </head>
 
 <body bgcolor="#aaaaaa" text="#000000" link="#2f486f" alink="#2f486f" vlink="#2f486f">
@@ -59,11 +36,7 @@ else
         <table width="100%" bgcolor="#e2e2e2" cellpadding="10" cellspacing="0" border="0">
         <tr><td><font face="Helvetica,Arial,Sans-serif">
 <?php
-// read document, if it is not valid then read opening page
-if (Is_Readable($SecurityFilter))
-  require $SecurityFilter;
-else
-  require $HTMLRoot."news.php";
+require "$page";
 ?>
            </font>
           </td>
index 40d16a540a69fed90aa8dfd17fd086828d05eb08..382b12321f0674ecc96bbe93b11fc95e9ccb407c 100755 (executable)
@@ -42,8 +42,6 @@ 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`
@@ -54,23 +52,17 @@ if [ "$TYPE" = "HTML" ]; then
 
     # Generate the TOC file
     sh gen.sh gen_toc.php $DST/$i.html $DST/$i.html
+    sh gen.sh index.php $DST/$i.html $DST/$i.html
 
-    # Generate the details
-    files=`find $DST -name "silc_*.html"`
+    # Generate the details and the layour
+    files=`find $DST -name "$i*_*.html"`
     for k in $files
     do
-      sh gen.sg gen_detail.php $k $k
+      sh gen.sh gen_detail.php $k $k
+      sh gen.sh index.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 34f3db128371e126b21a837fac3789cb35b0cf5b..9e3d5825f8bc03283ae844bf3ace0a713e5093cc 100644 (file)
@@ -10,7 +10,7 @@
 #include "links.h"
 #include "generator.h"
 #include "analyser.h"
-
+#include <errno.h>
 
 /****f* ROBODoc/RB_Generate_Documentation [3.0h]
  * NAME
@@ -66,6 +66,11 @@ RB_Generate_Documentation (
         {
           sprintf(fname, "%s_%s.html", doc_base, cur_header->function_name);
           dest_doc = fopen(fname, "w");
+          if (!dest_doc)
+            {
+             fprintf(stderr, "%s\n", strerror(errno));
+             exit(1);
+           }
         }
 
       RB_Generate_Header_Start (dest_doc, cur_header);
@@ -108,6 +113,9 @@ RB_Generate_Documentation (
                whoami, cur_header->name);
 
       RB_Generate_Header_End (dest_doc, cur_header);
+
+      if (output_mode == HTML)
+        fclose(dest_doc);
     }
 
   dest_doc = orig_doc;
@@ -266,6 +274,11 @@ RB_Generate_Doc_Start (
          /* Generate quick index file, for fast referencing */
          sprintf(iname, "%s_index.tmpl", doc_base);
           index = fopen(iname, "w");
+          if (!index)
+           {
+             fprintf(stderr, "%s\n", strerror(errno));
+             exit(1);
+           }
 
          for (cur_header = first_header;
               cur_header;