home *** CD-ROM | disk | FTP | other *** search
- -----BEGIN PGP SIGNED MESSAGE-----
-
-
- SourceMerge version 1.0
-
- 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.dsi.unive.it/~szanella/index.htm> or
- <http://members.tripod.com/~szanella/index.htm>.
-
- 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.
-
- 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 Simone Zanella Productions.
-
- E-mail: szanella@dsi.unive.it
- zanella@prometeo.it
-
- Web: http://www.dsi.unive.it/~szanella/index.htm
- http://members.tripod.com/~szanella/index.htm
-
- Last modified: June 16th, 1997
-
- - -----BEGIN PGP PUBLIC KEY BLOCK-----
- Version: 2.6.2i
-
- mQCNAzARNUQAAAEEAMTn+IgTuJ5Ei99lzFa6D6GCDYPUimdSQ2I2keFCVG2sCVfB
- uejwgdPp+u/mlwJDE2wZpAUfgHe8E3N/vmfO6bl0RxOc1Hkl0mc/np5/F4wZoeOB
- GcaEpwJLkKlFoE93p8Bh/UwUNo9UaKjfwx0mqP9G+XgiVowo7NEsAHa/+Bl9AAUR
- tCpTaW1vbmUgWmFuZWxsYSA8c3phbmVsbGFAbW9vLmRzaS51bml2ZS5pdD6JAJUD
- BRAwETVz0SwAdr/4GX0BAXjLA/9IZD5mT/BHdRfDvH6AnFwaxqAuluhCcycchW0A
- /SOUJPsmFnFjGUoCFrur603rEUJpR/JsZpVOXaQHcNSuitB2msDu8YZyrVPgcV86
- vGptHkX31GrfIK8RR4hHRtt0suUBWZBDJRfLNbq7KMKxfNF3h4wRjC1NBzzU0orM
- mj9d2A==
- =HOga
- - -----END PGP PUBLIC KEY BLOCK-----
-
- -----BEGIN PGP SIGNATURE-----
- Version: 2.6.3ia
- Charset: cp850
-
- iQCVAwUBM6bOV9EsAHa/+Bl9AQG3IwP+LwR9FZbavqrGqXp4BgC4WPj4tY4tsRGW
- j9QejO94CFwK+tYsyb/biChP24tMnUxzmDZ0YJXToIEt42jJStHapKepnkyhyx65
- 8PltWNbOEgd/vmGZ1lE89zwFZ39099vy/FAJjSRCOpnAswGVG3IbrTfPyPGvTl6Z
- Uplq/mZ0YsM=
- =hfQj
- -----END PGP SIGNATURE-----
-