@
/* "CodeWorker":	a scripting language for parsing and generating text.

Copyright (C) 1996-1997, 1999-2002 Cédric Lemaire

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

To contact the author: codeworker@free.fr
*/

function writeFunctionDescription(myFunction : node, myHTMLDoc : node) {
	@<UL>
	<LI> @
	if myFunction.return_type {
		@function @
	} else {
		@procedure @
	}
	@<B>@myFunction.name@(</B>@
	foreach i in myFunction.parameterList {
		if !first(i) {
			@<B>,&nbsp;</B>@
		}
		@<EM>@i.name@</EM> <B>:</B> <I>@i.type@</I>@
	}
	if myFunction.return_type {
		@<B>) :</B> <I>@myFunction.return_type@</I><BR/>
@
	} else {
		@<B>)</B><BR/>
@
	}
	if !isEmpty(myFunction.parameterList) {
		@<TABLE border="1" cellpadding="7" cellspacing="0"><TR><TD class="company"><B>Parameter</B></TD><TD class="company"><B>Type</B></TD><TD class="company"><B>Description</B></TD></TR>
@
		foreach i in myFunction.parameterList {
			@	<TR><TD><EM>@i.name@</EM></TD><TD><I>@i.type@</I></TD><TD>@i.documentation@</TD></TR>
@
		}
		@</TABLE>
<P/>
@
	}
	if myFunction.documentation {
		createVirtualFile(".#f1", myFunction.documentation);
		createVirtualFile(".#f2", "");
		try {
			translate("LaTeX2HTML.cwp", myHTMLDoc, ".#f1", ".#f2");
		} catch(sError) {
			traceLine("error in the description of function '" + myFunction.name + "':");
			traceLine(myFunction.documentation);
			error(sError);
		}
		@@loadVirtualFile(".#f2")@
@
		deleteVirtualFile(".#f2");
		deleteVirtualFile(".#f1");
	}
	@	</LI>
</UL>
@
}


function generateVersionChanges(theVersion : node, bLastChanges : value) {
	@							<TABLE border="1" cellpadding="7" cellspacing="0" width="100%">
								<TR>
									<TD class="changes" valign="top" colspan="4">Changes@
	if bLastChanges {
		@ on version @theVersion@@
	} else if theVersion.private {
		@ on private version @theVersion@@
	}
		@</TD>
								</TR>
@
	if existVariable(theVersion.description) {
		@								<TR>
									<TD class="content" valign="top"">@
		local myHTMLDoc;
		insert myHTMLDoc.sParsingMode = "description";
		createVirtualFile(".#f1", theVersion.description);
		createVirtualFile(".#f2", "");
		try {
			translate("LaTeX2HTML.cwp", myHTMLDoc, ".#f1", ".#f2");
		} catch(sError) {
			traceLine("error in the description of the version '" + theVersion + "':");
			traceLine(theVersion.description);
			error(sError);
		}
		@@loadVirtualFile(".#f2")@@
		deleteVirtualFile(".#f2");
		deleteVirtualFile(".#f1");
		@</TD>
								</TR>
@
	}
	@								<TR>
									<TD class="role" valign="top">Date</TD>
									<TD class="role" valign="top">Type</TD>
									<TD class="role" valign="top">Caller</TD>
									<TD class="role" valign="top">Description</TD>
								</TR>
@
	foreach i in theVersion.listOfChanges {
		@								<TR>
									<TD class="content" valign="top">@i.date@</TD>
									<TD class="content" valign="top">@i.type@</TD>
									<TD class="content" valign="top">@
		switch(i.caller) {
			case "":
				@-@
				break;
			case "Gwenael CHAZAL":
				@<A href="http://perso.wanadoo.fr/famille-chazal/gwenaelindexenglish.htm">Gwenael CHAZAL</A>@
				break;
			case "Eric NICOLAS":
				@<A href="http://www.erik-n.net/">Eric NICOLAS</A>@
				break;
			case "Laurent RIESTERER":
				@<A href="http://laurent.riesterer.free.fr">Laurent RIESTERER</A>@
				break;
			case "Patrick BRANNAN":
				@<A href="http://www.cs-express.net/">Patrick BRANNAN</A>@
				break;
			case "David JOBET":
				@<A href="http://www.nosica.net/">David JOBET</A>@
				break;
			case "Thierry WILMOT":
				@<A href="http://www.mktools.com/index.html">Thierry WILMOT</A>@
				break;
			default:
				@@i.caller@@
		}
		@</TD>
									<TD class="content" valign="top">@
		local myHTMLDoc;
		insert myHTMLDoc.sParsingMode = "description";
		if i.type == "function" {
			local myFunction;
			foreach j in i.listOfFunctions {
				if findElement(j, project.procedureList) ref myFunction = project.procedureList[j];
				else if findElement(j, project.functionList) ref myFunction = project.functionList[j];
				else error("'changes.log': unknown function '" + j + "'");
				writeFunctionDescription(myFunction, myHTMLDoc);
			}
		} else if i.type == "option" {
			if $getArraySize(i.listOfOptions) > 1$ {
				@						Add of @i.listOfOptions.size()@ new options on the command line:
						<UL>
@
				foreach j in i.listOfOptions {
				@							<LI><B>-@j@</B></LI>
@
				}
				@						</UL>
@
			} else {
				@						Add of a new option on the command line: <B>-@i.listOfOptions#front@</B>@
			}
		} else {
			createVirtualFile(".#f1", i.description);
			createVirtualFile(".#f2", "");
			try {
				translate("LaTeX2HTML.cwp", myHTMLDoc, ".#f1", ".#f2");
			} catch(sError) {
				traceLine("error in the description of a '" + i.type + ":" + i.date + "' change:");
				traceLine(i.description);
				error(sError);
			}
			@@loadVirtualFile(".#f2")@@
			deleteVirtualFile(".#f2");
			deleteVirtualFile(".#f1");
		}
		@</TD>
								</TR>
@
	}
	@							</TABLE>
@
}


	local sThisVersion;
	if findElement("current", project.listOfVersions) set sThisVersion = "current";
	else set sThisVersion = getVersion();
	local sVersion = replaceString(".", "_", sThisVersion);
	local bLastChanges = !getMarkupKey();
	local bGPGWINSignature = existFile("WebSite/downloads/CodeWorker_WIN" + sVersion + ".zip.asc");
	local bGPGSRCSignature = existFile("WebSite/downloads/CodeWorker_SRC" + sVersion + ".zip.asc");
	local bGPGSignature = bGPGWINSignature || bGPGSRCSignature;

	if bLastChanges {
		@<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML>
<HEAD>
	<TITLE>Last changes of CodeWorker</title>
	<META http-equiv="Content-Type" content="text/html; charset=windows-1252" />
	<META name="Description" content="Last changes of CodeWorker, a universal parsing tool and source code generator that interprets a scripting language to drive the parsing and the generation. It insists on offering powerful functionalities to do intensive code generation.">
	<META http-equiv="pragma" content="no-cache" />
	<META http-equiv="cache-control" content="no-cache" />

<LINK rel="stylesheet" type="text/css" href="CodeWorker.css" />

</HEAD>
<BODY>
	<H1>CodeWorker</H1>
	<BR />
	<BR />
@
	} else {
		@
				<TABLE border="1" cellpadding="7" cellspacing="0" width="100%">
					<TR>
						<TD class="company" valign="top" colspan="@(bGPGSignature ? 5 : 4)@">
							<I class="CodeWorker">CodeWorker</I> @sThisVersion@, @formatDate(getNow(), "%d%b%Y")@
						</TD>
					</TR>
					<TR>
						<TD class="role" valign="top">Platform</TD>
						<TD class="role" valign="top">Type</TD>
						<TD class="role" valign="top">Size</TD>
						<TD class="role" valign="top">Archive</TD>
@
		if bGPGSignature {
@						<TD class="role" valign="top">GnuPG signature</TD>
@
		}
@					</TR>
					<TR>
						<TD class="content" valign="top">WINDOWS 98/2000/NT/XP</TD>
						<TD class="content" valign="top">binaries</TD>
						<TD class="content" valign="top">@fileSize("WebSite/downloads/CodeWorker_WIN" + sVersion + ".zip")@</TD>
						<TD class="content" valign="top"><A href="downloads/CodeWorker_WIN@sVersion@.zip">CodeWorker_WIN@sVersion@.zip</A></TD>
@
		if bGPGWINSignature {
			@						<TD class="content" valign="top"><A href="downloads/CodeWorker_WIN@sVersion@.zip.asc">CodeWorker_WIN@sVersion@.zip.asc</A></TD>
@
		}
@					</TR>
					<TR>
						<TD class="content" valign="top">Any platform (?)</TD>
						<TD class="content" valign="top">sources</TD>
						<TD class="content" valign="top">@fileSize("WebSite/downloads/CodeWorker_SRC" + sVersion + ".zip")@</TD>
						<TD class="content" valign="top"><A href="downloads/CodeWorker_SRC@sVersion@.zip">CodeWorker_SRC@sVersion@.zip</A></TD>
@
		if bGPGSRCSignature {
			@						<TD class="content" valign="top"><A href="downloads/CodeWorker_SRC@sVersion@.zip.asc">CodeWorker_SRC@sVersion@.zip.asc</A></TD>
@
		}
@					</TR>
					<TR>
						<TD class="content" valign="top" colspan="@(bGPGSRCSignature ? 5 : 4)@">
@
	}

	if getProperty("makeChanges") && (getProperty("makeChanges") != true) {
		local bStopAfterPrivates;
		foreach i in project.listOfVersions {
			if bStopAfterPrivates && !i.private break;
			generateVersionChanges(i, bLastChanges);
			if key(i) == getProperty("makeChanges") set bStopAfterPrivates = true;
		}
	} else {
		local bPointer = false;
		foreach i in project.listOfVersions {
			if !bPointer {
				if key(i) != sThisVersion continue;
				generateVersionChanges(i, bLastChanges);
				set bPointer = true;
			} else if i.private {
				generateVersionChanges(i, bLastChanges);
			} else break;
		}
	}

	if bLastChanges {
		@		<a href="http://www.xiti.com/xiti.asp?s=134058" TARGET="_top">
			<script language="JavaScript1.1">
			<!--
				hsh = new Date();
				hsd = document;
				hsr = hsd.referrer.replace(/[<>]/g, '');
				hsi = '<img width="39" height="25" border=0 ';
				hsi += 'src="http://logv24.xiti.com/hit.xiti?s=134058';
				hsi += '&p=';
				hsi += '&hl=' + hsh.getHours() + 'x' + hsh.getMinutes() + 'x' + hsh.getSeconds();
				if(parseFloat(navigator.appVersion)>=4)
				{Xiti_s=screen;hsi += '&r=' + Xiti_s.width + 'x' + Xiti_s.height + 'x' + Xiti_s.pixelDepth + 'x' + Xiti_s.colorDepth;}
				hsd.writeln(hsi + '&ref=' + hsr.replace(/&/g, '$') + '" title="Mesurez votre audience"><\!--');
				//-->
			</script>
			<noscript>
				<img width="39" height="25" border=0 src="http://logv24.xiti.com/hit.xiti?s=134058&p=&" title="Mesurez votre audience">
			</noscript>
			<!--//-->
		</a>
	</BODY>
</HTML>
@
	} else {
		@						</TD>
					</TR>
				</TABLE>
@
	}
