#!/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
<?php
/* Get the actual data for the page */
-if (Is_Readable($page.".html"))
- require $page.".html";
+require "$page";
?>
</font>
/* 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>
<?php
/* Get the actual data for the page */
-if (Is_Readable($page.".html"))
- require $page.".html";
+require "$page";
?>
</font>
-<?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">
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">
<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>
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`
# 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
#include "links.h"
#include "generator.h"
#include "analyser.h"
-
+#include <errno.h>
/****f* ROBODoc/RB_Generate_Documentation [3.0h]
* NAME
{
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);
whoami, cur_header->name);
RB_Generate_Header_End (dest_doc, cur_header);
+
+ if (output_mode == HTML)
+ fclose(dest_doc);
}
dest_doc = orig_doc;
/* 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;