Hello,

be welcome to this template file. First thing you will note is that there is
nothing like a comment marker in this file's format. Instead there is a content
marking scheme.

To start let me note one thing. This BinPatch feature is new and not yet complete
and we are working on it to have it more complete day by day, please check back
to http://kayhayen.com for updates of BinPatch often if you interesting about
making your own log file formats.

When GenPatch or Click'n Patch creates a log file it looks for the combinations special content 
markers and parses what it finds inbetween them. You will find a lot of them in this file. Their 
format is "<" followed by "LOG" prefixed indifiers and they are closed by ">". If marking a
region they have closing tags in the format </LOG...> which end a certain region.

With LOGTEMPLATE /LOGTEMPLATE you can start any number of log file templates. This file
should e.g. contain one template for HTML and one for ASCII. Making them into the same
file is supported for it allows to share "insert" regions. 

Think of LOGINSERT as some sort of "include" directive. It will make serve you to modularize
your patch template and save you from repeating. Delimeters are e.g. a good thing. Or you
could have your company information put into a template. The sections are delimteed by
LOGITEM and /LOGITEM. (Performace note: You may assume inserting to be fast as we
preparse the log template file and keep a map of all items so accessing them is really fast.)

This is e.g. the main structure of the standard ASCII log file. 

<LOGTEMPLATE NAME="ASCII">\
BinPatch Log File (ASCII version, use option -log=html for a HTML version)

<FOREACH NAME="Targets" ITERATOR="Target">\
<LOGINSERT NAME="LOG_PATCHEDFILES">
<LOGINSERT NAME="LOG_DELIMETER">
<LOGINSERT NAME="LOG_EMBEDDEDFILES">
<LOGINSERT NAME="LOG_DELIMETER">
<LOGINSERT NAME="LOG_OBSOLETEFILES">
<LOGINSERT NAME="LOG_DELIMETER">
</FOREACH>

Note: This log file format can be customized. See template/logfile.txt for the
template being used. The file is self-documenting.

</LOGTEMPLATE>

<LOGTEMPLATE Name="HTML">
<HEAD></HEAD><BODY>

<h1>BinPatch Log File (HTML, use option -log=ascii for text)</h1>

<FOREACH NAME="Targets" ITERATOR="Target">\
<p><LOGINSERT NAME="LOG_PATCHEDFILES_HTML">
<p><LOGINSERT NAME="LOG_DELIMETER">
<p><LOGINSERT NAME="LOG_EMBEDDEDFILES_HTML">
<p><LOGINSERT NAME="LOG_DELIMETER">
<p><LOGINSERT NAME="LOG_OBSOLETEFILES_HTML">
<p><LOGINSERT NAME="LOG_DELIMETER">
</FOREACH>

Note: This log file format can be 99% customized. See template/logfile.txt for
the template being used. The file is self-explaining.
</BODY>
</LOGTEMPLATE>

The next item demonstrates dome kind of looping. It goes trough all the names of a list
of files of a certain type. We will allow additional marking to select sortings later on,
but for now there isn't.


<LOGITEM NAME="LOG_PATCHEDFILES">\
Patched Files: <LOGVALUE NAME="$Target.Patched.Amount"> (these files are created using existing source files)
<FOREACH NAME="Target.Patched" ITERATOR="PatchInfo">
<LOGVALUE NAME="$PatchInfo.EndState.Path.Relative"> (<LOGVALUE NAME="$PatchInfo.EndState.Size"> Bytes) <=== \
\
<FOREACH NAME="Target.StartStates" ITERATOR="TargetStartState">\
<FOREACH NAME="PatchInfo.StartStates" ITERATOR="FileStartState">\
\
<LOGIF NAME="= $TargetStartState.ID $FileStartState.ID">\
<LOGVALUE NAME="$FileStartState.Path.Relative"> (<LOGVALUE NAME="$FileStartState.Path.Size"> Bytes)\
</LOGIF >\
</FOREACH>\
</FOREACH>\
</FOREACH>\
</LOGITEM>

<LOGITEM NAME="LOG_EMBEDDEDFILES">\
<LOGIF NAME="$Target.Embedded.Amount">\
Embedded Files: <LOGVALUE NAME="$Target.Embedded.Amount"> (included in complete, not requiring any start state)

<FOREACH NAME="Target.Embedded" ITERATOR="EmbeddedFile">\
<LOGVALUE NAME="$EmbeddedFile.Path.Relative"> (<LOGVALUE NAME="$EmbeddedFile.Path.Size"> Bytes)
</FOREACH>\
<LOGELSE>
Embedded Files: No files need to be embedded.</LOGELSE></LOGIF>\
</LOGITEM>

<LOGITEM NAME="LOG_OBSOLETEFILES">\
<LOGIF NAME="$Target.Obsolete.Amount">
List Of Obsolete Files: <LOGVALUE NAME="$Target.Obsolete.Amount"> (nomore present in states, remove for -d=pattern)

<FOREACH NAME="Target.Obsolete" ITERATOR="ObsoleteFile">\
<LOGVALUE NAME="$ObsoleteFile.Path.Relative"> (<LOGVALUE NAME="$ObsoleteFile.Path.Size"> Bytes)
</FOREACH>\
<LOGELSE>
List Of Obsolete Files: No files need to be removed or you did not enabled the autodeletion feature -d=pattern)</LOGELSE></LOGIF>\
</LOGITEM>


<LOGITEM NAME="LOG_PATCHEDFILES_HTML">\
<h3>Patched Files: <LOGVALUE NAME="$Target.Patched.Amount"> (these files are created using existing source files)</h3>
<p>

<table border=1>
  <tr BGCOLOR="#8080FF">
   <th>Filename</th>
   <th>Size</th>
   <FOREACH NAME="Target.StartStates" ITERATOR="StartState"><th>Start State <LOGVALUE NAME="$StartState.ID"> (<LOGVALUE NAME="$StartState.Path.Absolute">)</th></FOREACH>
 </tr>

<FOREACH NAME="Target.Patched" ITERATOR="PatchInfo">
  <tr>
   <td><LOGVALUE NAME="$PatchInfo.EndState.Path.Relative"></td>
   <td align="right"><LOGVALUE NAME="$PatchInfo.EndState.Size"> Bytes</td>

   <FOREACH NAME="Target.StartStates" ITERATOR="TargetStartState">
    <td>
     <FOREACH NAME="PatchInfo.StartStates" ITERATOR="FileStartState">

     <LOGIF NAME="= $TargetStartState.ID $FileStartState.ID">
      <LOGVALUE NAME="$FileStartState.Path.Relative"> (<LOGVALUE NAME="$FileStartState.Path.Size"> Bytes)
     </LOGIF >

     </FOREACH>
    </td>
   </FOREACH>
  </tr>
</FOREACH>

</table>

</LOGITEM>


<LOGITEM NAME="LOG_EMBEDDEDFILES_HTML">\
<LOGIF NAME="$Target.Embedded.Amount">\
<h3>Embedded Files: <LOGVALUE NAME="$Target.Embedded.Amount"> (included in complete, not requiring any start state)</h3><p>

<table border=1>
  <tr BGCOLOR="#8080FF">
   <th>Filename</th>
   <th>Size</th>
 </tr>

<FOREACH NAME="Target.Embedded" ITERATOR="EmbeddedFile">
<tr>
<td><LOGVALUE NAME="$EmbeddedFile.Path.Relative"></td><td align="right"><LOGVALUE NAME="$EmbeddedFile.Path.Size"></td>
</tr>
</FOREACH>
</table>
<LOGELSE>
<h3>Embedded Files: No files need to be embedded.</h3><p></LOGELSE></LOGIF>
</LOGITEM>

<LOGITEM NAME="LOG_OBSOLETEFILES_HTML">
<LOGIF NAME="$Target.Obsolete.Amount">
<h3>List Of Obsolete Files: <LOGVALUE NAME="$Target.Obsolete.Amount"> (present only in states, will be removed for -d=pattern)</h3><p>

<table border=1>
  <tr BGCOLOR="#8080FF">
   <th>Filename</th>
   <th>Size</th>
 </tr>

<FOREACH NAME="Target.Obsolete" ITERATOR="ObsoleteFile">
<tr>
<td><LOGVALUE NAME="$ObsoleteFile.Path.Relative"></td><td align="right"><LOGVALUE NAME="$ObsoleteFile.Path.Size"></td>
</tr>
</FOREACH>

</table>
<LOGELSE>
<h3>List Of Obsolete Files: No files need to be removed or you did not enabled the autodeletion feature -d=pattern)</h3><p></LOGELSE></LOGIF>
</LOGITEM>

<LOGITEM NAME="LOG_DELIMETER">
<LOGIF NAME="$HTML"><HR><LOGELSE>
------------------------------------------------------------------------
</LOGELSE></LOGIF>
</LOGITEM>

If you have any suggestions or enhancements for this file, please feel free to
email them to suggestion@kayhayen.com and we will be glad to see if we can fit
your needs too.

	Greetings, Kay Hayen










