-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


                           SourceMerge version 1.2

                        by Simone Zanella Productions

Contents

     * Introduction
     * Installation
     * Usage
     * If you want to report a problem...

   This documentation, along with the most recent version of the
   software, is available via the World-Wide Web at
   <http://www.zanella-hifi.com/szp>.

Introduction

   This program can be used to maintain different versions of the same
   source code. It is especially useful for producing programs in different
   languages. Since it is very configurable, it can be adopted for many
   different languages: C, C++, Html, Assembly, Clipper.

   SourceMerge can be used on text files for Dos/Windows, Macintosh and
   Unix, even mixed (i.e. library file in one format, source file in
   another). Text files created have always the same format as the
   corresponding source file.

   Files included:

   SRCMERGE.EXE     SourceMerge program
   SRCMERGE.TXT     this file
   TEST.HTM         test file, to be used with TEST.LIB
   TEST.LIB         library file to be used with TEST.HTM

Installation

   Just copy SRCMERGE.EXE to a directory in your path.

Usage

   As usual, an example is the easiest way to demonstrate SourceMerge's use.
   The command line for it is as follow:

   SRCMERGE spec /Llib /Vver [/Sxy] [/Ddest] [/Brem_begin] [/Erem_end] [/X]

   "spec" is the pathname of the files to process, including wild cards.
   SourceMerge supports long file names under Windows 95; it also supports
   multiple wild cards '*' and '?' both under real Ms-Dos and Windows 95.
   Use parameter /X to avoid long file name matching.

   "lib" is the name of the library file to be used; it can have any
   extension, even though I use ".LIB" in these examples.
   The library file is a text file formatted like an .INI file for Windows.

   Each section starts with:

   [id:ver]

   and ends with the next section or the end of file.
   The characters '[' and ']' enclosing id:ver can be changed by using
   parameter /Sxy - x stands for prefix and y for suffix (each one is 1
   character long): this can be useful if the text to be replaced can
   contain a line similar to a section start.

   For example, suppose that you have this C fragment that defines two
   strings into the file SAMPLE.C:

   #define WELCOME  "Benvenuto"
   #define BYE      "Arrivederci"

   The strings are in Italian; if you want to produce two versions of
   the same program, one in Italian and the other in English, replace
   the text above with:

   /* SRCM:welc_bye. */
   /* /SRCM:welc_bye. */

   and create the library file MYTEST.LIB with this text:

   [welc_bye:italian]
   #define WELCOME  "Benvenuto"
   #define BYE      "Arrivederci"
   [welc_bye:english]
   #define WELCOME  "Welcome"
   #define BYE      "Goodbye"

   Now, to create a version in one language or the other use:

   SRCMERGE sample.c /lmytest.lib /vitalian
   SRCMERGE sample.c /lmytest.lib /venglish

   Of course, in this case it would be easier to put all definitions into
   the source code and select one version or the other with #ifdef;
   but there are languages in which this is impossible to do, and cases more
   sophisticated in which the same thing is not so easy (e.g. when you
   actually must ADD code for specific versions). Moreover, the source code
   is cleaner and more comprehensible to read by using this method.
   Take a look at TEST.HTM and TEST.LIB; to produce different versions,
   you can use:

   SRCMERGE test.htm /ltest.lib /vSimone
   SRCMERGE test.htm /ltest.lib /vPaolo
   SRCMERGE test.htm /ltest.lib /vFranco
   SRCMERGE test.htm /ltest.lib /vMassimo

   As you should have noticed, each section in the source code is a block of
   text starting with:

   b SRCM:id. e

   and ending with:

   b /SRCM:id. e

   Optional text can be inserted between the '.' and 'e'; it is simply ignored.

   The characters 'b' and 'e' are remark strings which can be specified with
   parameters /B and /E; if not specified, they are guessed according to
   source file extension, as in this table:

                     Extension      'b' string     'e' string
                        .C               /*            */
                        .H               /*            */
                       .CPP              //
                       .HPP              //
                       .HTM             <!--           -->
                       .PRG               *
                        .CH               *
                       .INI              rem
                       .SYS              rem
                       .BAT              rem
                       .MNU               ;
                       .ASM               #
                       other              #

   As you can see, 'e' strings can be empty; in this case, the tag ends
   at the end of line:

   printf("this is a test\n");  // SRCM:id. <-- tag ends at the end of line

   There must be EXACTLY one space between the remark string 'b' and "SRCM:".

   The parameters /L and /V must always be specified: the first defines the
   library file to be used, the second the version with which update on
   source files will take place.
   Remember that both version tags and section IDs are case sensitive:
   italian and Italian are two different version tags, just like welc_bye
   and Welc_Bye are two different section IDs.

   On command line, strings for version/remarks and characters to be used
   for prefix/suffix of section (parameter /S) can include C-like constants;
   for example, if you have an HTML file with the extension ".DOS" (which is
   unknown to SourceMerge) and you want to use the string "<!--" for 'b' and
   "-->" for 'e', type:

   SRCMERGE test.dos /Ltest.lib /Vtest /B\x3c!-- /E--\x3e

   This is necessary since the characters "<" and ">" are preprocessed by Dos
   and are used to redirect standard input/output from/to a file; their
   corresponding C-like strings are:

      <     \x3c = \074 = \d60 (Ascii 60)
      >     \x3e = \076 = \d62 (Ascii 62)

   Likewise, if you want to use the characters '|' for section prefix and '^'
   for section suffix, on the command line you could use:

   /S\x7c^   /S\d124^   /S\174^    (character '^' can safely appear as it is)

   The following escape sequences are supported:

   \a \b \f \n \r \t \v \\ \? \' \"

   and octal, hexadecimal and decimal constants thus specified:

   \...  where ... are 1 to 3 octal digits (0-7)
   \x... where ... are 1 to 3 hexadecimal digits (0-9, a-f, A-F)
   \d... where ... are 1 to 3 decimal digits (0-9)

   Characters ':' and '.' must be avoided in version strings, just like
   Ascii characters below ' ' (32) in both remark and version strings.

   By default, SourceMerge modifies source files 'in place', i.e. the
   files are overwritten with the updated version. If you want to create the
   new version in a different directory, use the parameter /D to set
   destination; in this case, source files won't be touched.
   Remember that all files existing in destination directory are overwritten
   without notice.

   Error level is set on exit to:
             0  no errors
             1  missing/wrong command line parameters, empty library
             2  read/write/open error
             3  id not found/syntax error
             4  string too long
             5  insufficient memory

   Source files (when parameter /D is NOT specified) are overwritten ONLY if
   the update is succesfull; if /D is used and SourceMerge exits with error
   level 3 or above, the last file created in the destination directory
   will be truncated at the point in which the error happened.

   If SourceMerge doesn't find any section to update in a certain file, it
   will:
   1) not overwrite the file (if /D is NOT specified);
   2) create a copy of the file with the same date/time as the original
      (if /D is specified).

   Run SRCMERGE without parameters to have a short summary of its usage.

If you want to report a problem...

   If you think you've found a genuine problem with SRCMERGE, I'll most
   effectively be able to help you if you give me the following
   information. The more of this you leave out, the less likely I'll be
   able to do anything useful.
     * Your library and source files. Either include it in your mail or
       include a URL so I can fetch it.
     * The exact command line used to process the files.

   I won't guarantee to fix every problem, but if you give me a complete
   report, I'll often be able to help.

   Send mail if you have comments or suggestions.

   -----

   (C) 1997-2002 Simone Zanella Productions.

   E-mail: szp@zanella-hifi.com

   Web:    http://www.zanella-hifi.com/szp

   Last modified: June 1st, 2002

- -----BEGIN PGP PUBLIC KEY BLOCK-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

mQGiBDxEqMMRBADrP0yk3gGiOn0pen7/U7J4W80oD2yLQCoipOjcJEEATKD5Yqme
P2PjA1Z8S5jcE/Sy4LWa8LG3TXuI/yM/2QuFq/ByEIG3htEvPjc6vWQ6ELr96+G+
0L7bUYYYV8bIKAB4mI7wsqCuPOB1hy5ysK8CTvVBNvDgXxDo+AnwjES/+wCg/6xz
RUiCZ+aO8ts2VB69vZ7Q5/UEANkD7aPmxb0otnivIOsQ5brDpU3UUD6iZJcPnG4n
CJDnLdTmnhIDNCaqbmVO1/XsgEum9wXYpTlsjMMIOk+xe15YTKvQ4XWdeEdXxNje
Sd3Uwm24x1Jv0h55aRuo0Jvm37cm2QDJ0ENIQbsDmohFucAcKWH7xq50lPhB3qgg
CpKTBADl4wDJa2EANogxkt//THGeOHuGW34ZkVrf5+l05YsypoQfe7OegjMZSDMq
zqRGlEcgIY72f0+hHB0gf0C3ryy4RBprDtcaRc/ZKlfMzzveSB9jBkfSjmx61Y7r
gkFvh/FTmNgp0IHnQu4DeJJRY1ANcmdpPSXSoc0Ldq5iXLp/brQoU2ltb25lIFph
bmVsbGEgPHNpbW9uZUB6YW5lbGxhLWhpZmkuY29tPokAWAQQEQIAGAUCPESowwgL
AwkIBwIBCgIZAQUbAwAAAAAKCRBkB6AYIqjnH9r3AJ9wGMtaQptcAXK/QJqcPlVh
RBGIMwCfRDvf/mRWESFCQKIc3IzTb92FZwa5Ag0EPESowxAIAPZCV7cIfwgXcqK6
1qlC8wXo+VMROU+28W65Szgg2gGnVqMU6Y9AVfPQB8bLQ6mUrfdMZIZJ+AyDvWXp
F9Sh01D49Vlf3HZSTz09jdvOmeFXklnN/biudE/F/Ha8g8VHMGHOfMlm/xX5u/2R
XscBqtNbno2gpXI61Brwv0YAWCvl9Ij9WE5J280gtJ3kkQc2azNsOA1FHQ98iLMc
fFstjvbzySPAQ/ClWxiNjrtVjLhdONM0/XwXV0OjHRhs3jMhLLUq/zzhsSlAGBGN
fISnCnLWhsQDGcgHKXrKlQzZlp+r0ApQmwJG0wg9ZqRdQZ+cfL2JSyIZJrqrol7D
VekyCzsAAgIH/05/hQEQ3A46jwq52hlyd4M20izJdrFYQWqaawDoUD3wqShWhKMN
JFFB4N16a46CWrVUXu8gMta51jKtuB4MKN/+N9yAZO9Wg8WEQO4DW+4pHfSdVYTI
FRJ7qNsbcnVrPAy5n0ygCFfx8WAEjo6Tw07adTFXXzQm3lz1TfoI5tG/CluIiVXM
pe8s9hJamiyXDGjExsslUezAWFjN9eyNGFxOoXI1qkZL8ompRFEnmuYx8mpwstt2
8Tj8bqELHpm7C2Hmgevyw1XSPKxRBKSLyw5ort/zZIY+Ff5n2EQB/4H/KPSkeqvG
SDi5zA/dVN1wiqAZCM28nBX8ghk9Q+6HcFuJAEwEGBECAAwFAjxEqMMFGwwAAAAA
CgkQZAegGCKo5x/bhgCdHxt54Zp5GmcD0LaEEG/1mzs5XP4Anj2MZAPvI/Qq1V2T
S80JHXt27y85
=kh0y
- -----END PGP PUBLIC KEY BLOCK-----


-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPPkaZ3u3vUoFvIWZEQLW1QCgyJ97JPXYHHQx8HxFrRYXhMPZPQUAn0r+
9dkDBiPTmRHgxvO/w+weCOK4
=m0dY
-----END PGP SIGNATURE-----
