home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d5xx
/
d536
/
increv.lha
/
IncRev
/
IncRev.doc
< prev
next >
Wrap
Text File
|
1991-08-26
|
17KB
|
343 lines
IncRev V1.03
automatic revision update
(C) 1991 Joerg Fenin / Metalworx
---------------------------------------------------------------------
This program is FREEWARE! Feel free to give it to anyone you like. You
need not pay a shareware fee to the author. Still it is strictly
forbidden to make any profit with it. IncRev and its source files MUST
NOT be distributed commercially. No more than DM 5,- / US $ 5,- may be
charged for one diskette where the IncRev package is on (This
restriction is not valid for Fred Fish, he may charge more than US $
5,-).
This package (or any of its files) MUST NOT be distributed on PD series
of Stefan Ossowski PD-Versand, Rainer Wolf PD-Versand, Markt & Technik
Verlag AG and Karstadt AG.
---------------------------------------------------------------------
1 Purpose
As I am doing a lot of programming on my Amiga I often lose the
overview of all the different projects. I often didn't know any
more when I did the last changes to a program. Was it yesterday or
last month? I also often shared programming on one program with a
friend (though it's not a friend anymore, thanx for not knowing me
anymore, keep your eyes just on her and lose all your friends!)
and we couldn't manage to find out whose version was newer.
I have also published a commercial disk label printout program for
diskette labels. In case of an error it's important to know the
version the customer is working with you have to keep track on the
version numbers.
IncRev automatically updates revision numbers each time the
program is recompiled. This also shows you, the programmer, how
many tests you need to have a running version.
2 Organization
All my program-versions are organized in the following way and
yours will have to be too if you want to use this program:
The name in brackets() is the name of the variable (see below).
2.1 Program ID (ProgId)
Each program has an program-id. It contains the name of the
program.
2.2 Version (Version)
Each program has a version-number. My version numbers are
organized as follows:
X.YZ
where X - is the general version. If you start a new program
you will start with a one (1) for the X. Let's
assume you have written the first running version
in AmigaBASIC and you gave it the version no. 1.00.
Now you re-write the whole program in C. You give
it the version number 2.00. This version has only a
CLI-Interface. Now you write a whole new user
interface using the Workbench and Intuition. You
may now give it the version number 3.00.
Y - is the 'major update number'. Let's take the
version 3.00 from the example above. In this
version filenames are entered via a simple string
gadget. Now your C capabilitis have increased and
you are able to write a file requester. The
filename will now be selected via the new file
requester in version 3.10. Next you add a palette
requester too and the new version is 3.20.
Z - is the 'minor update number'. In version 3.20 (see
above) you notice after a few weeks of using, that
anytime you use the file requester, the last name
in the specified directory is not shown due to a
bug you made in the file requester routine.
Professional as you are you locate the error and
remove it. Now you have a new version 3.21.
2.3 Revision (Revision)
After version 3.00 in the example above you decided to add a file
requester to your program. If you are not a perfect programmer
you'll need several attempts to get exactly what you wanted. As
long as you are not satisfied with the result you will recompile
version 3.00 over and over again. The version remains the same,
because the file requester is not fully implemented yet. Only the
revision number and the date will increase each time you compile.
Another revision-only update will be this. After completing
version 3.21 (see above) you notice that one of the texts in your
gadgets is not centered correctly. Though it is not really a bug,
you want to show that the program was changed. You center the text
correctly and increase only the revision number, so you still have
version 3.21 but the second revision.
IncRev updates only the revision number by default. If you wish to
change the other variables you have to use command line options
(see below).
2.4 User id (UserId)
If you are working in a team you would like to know who in your
team created the current version. Therefore you can use the user
id variable. You can set UserId once in your rev.c file or you can
set an environment variable (USERNAME) with the SETENV command. If
IncRev finds this environment variable set it will use its
contents to update the program's user id (UserId in rev.c) each
time it is invoked. Certainly you can use the -u option to set
UserId explicitly.
2.5 Date (Date)
No need for long explanations. Each time IncRev is invoked the
current date (read from the system date) will be filled into the
Date variable of rev.c. The format will be: DD-MMM-YY. (I intend
to let the user specify the date format in a future version.)
3 Invokation
IncRev needs a file rev.c to read. This rev.c contains all
information as described above. All changes will be done only to
rev.c. After compiling it to rev.o it must be linked to your
program. See the compile section below!
Here is how to call IncRev:
Usage: increv [ [-]? ] [ -d ] [ -i<ID> ] [ -r<No.> ] [ -u<USER> ]
[ -v<No.> ]
Options: -? displays this text
-d date update only (all other options are
ignored)
-i<ID> update ProgId with ID, can be any text
-r<No.> update revision no. with No. No. must be an
integer!
-u<USER> update UserId with USER, can be any text
-v<No.> update version with No. No. can be any text
Parameters in brackets [] are optional, parameters in <>s must be
specified. Note that no space must be located between the option
parameter and the text or number. Otherwise text or numbers will
be interpreted as single options.
3.1 increv without parameters
If you call increv without paramter it will look for the file
rev.c, update Date[] to the current (system) date and increment
the revision number Revision by one.
3.2 help ([-]?)
If you type 'increv ?' or 'increv -?' the template as shown above
will be displayed to you.
3.3 date update only (-d)
If you specify the -d option only the date in the rev.c will be
updated. This might be useful if you didn't recompile (and didn't
use IncRev) for more than 2 days and you know that you will
recompile (and use IncRev) just for one time. In this case (and if
you use IncRev as I recommend), rev.c was updated at least to days
ago and it contains the date of two days ago. The revision number
you use in the program will be the current revision number minus
one, because (as I recommend) IncRev was invoked *AFTER* the
linking process (see below). So the revision number was
incremented but not yet linked into the program. If you recompile
now (today in this example) the revision number of rev.c and it's
last date will be included in your program (sounds quite
complicated, I know, my English is not perfect although I'm trying
to improve it, just try it out yourself). So in order to get the
correct date into your rev.c (and in your program) without
updating the revision number again (because it has been done the
last time) you can use the -d option. Note that all other options
will then be ignored!
3.4 change program id (-i)
If you feel that your program, that was called DeluxePaint so far,
should get a more unique name like PowerPaint you don't have to
call your favorite editor (mine is DME by the way, thanx Matt!)
you can just type 'increv -iPowerPaint' and the ProgId[] will be
changed to "PowerPaint" ('though it is very hard for me not to use
DME). If you want to have spaces in your program id you have to
enclose the whole option in double quotes (") like
'increv "-iPower Paint"'.
3.5 change revision number (-r)
If you would like to give your program a specific revision number
like 0,1 or 999 you can set it to the desired option with the -r
option. Just say 'increv -r0' and the revision number will be set
to zero. Note that the revision number following the -r option
must be an integer!
3.6 change user id (-u)
To change the UserId[] you can use the -u option. The restrictions
are the same as with the program id (see above).
IMPORTANT: If you have set the environment variable USERNAME using
the SETENV command, your UserId will be updated with the contents
of this variable each time you invoke IncRev without the -u
option. This may not be what you wanted. To prevent this just
clear the environment variable.
3.7 change version (-v)
To change the Version[] you can use the -v option. The
restrictions are the same as with the program id (see above).
4 Compiling
All revision information is held in a single file called rev.c. It
must not contain anything else and it must be linked to your
program after compile. The general format for rev.c is:
Line 1 char ProgId[]="...";
Line 2 char Version[]="...";
Line 3 int Revision=x;
Line 4 char UserId[]="...";
Line 5 char Date[]="...";
rev.c may contain more lines after the date line but they will be
ignored and discarded after the first write. It must not contain
anything before the program id line. The lines have to be in this
sequence, you must not mix up the lines or concatenate them. All
character arrays may contain anything you like, it is just
restricted by the line length of 79 characters. Each line must not
contain more than 79 characters. The revision line may just
contain an integer number after the equal (=) sign. Note that
IncRev divides a line at its equal sign. Changes are made only
after the equal sign. Following this statement IncRev will not
notice if you change the names of the variables. You may change
them as you like. Although the meaning remains the same. If you
for example change 'Date' to 'ProgramVersionNumber' it will still
contain the last update date after invoking IncRev. However you
could for example change 'Date' to 'Datum' if you speak german and
want to use german variable names in your program (as I often do).
To make sure that the revision number will be updated every time
you re-compiled your program SUCCESSFULLY (note that word!) I
recommend to call increv from a (lmkfile) makefile. To use lmk
(make) for compiling and linking is the best method anyway, wether
you use IncRev or not. I have included the lmkfile for my
forthcoming program (must be soon on a Fishdisk near your) 'WFile'
as an example. Note that IncRev is called after the (successful)
linking procedure.
------------------------------------------
# make wfile, 12-Jan-91 Metalworx
SYSTEM=AMIGA
CFLAGS=-D$(SYSTEM) -cast -j132 -O -mt -qdh0:
OFILES=wfile.o whelp.o template.o profile.o rev.o strpos.o
wfile: $(OFILES)
blink FROM LIB:cres.o+$(OFILES) TO wfile LIB LIB:lc.lib
increv
------------------------------------------
Note that rev.c would be re-compiled every time, because IncRev
creates a new rev.c every time it is invoked. Due to rev.c's
shortness it will take not much time.
5 Any questions ?
Do you have any questions ? Well, try reading the doc file again.
My English is not perfect, so something may not be clear after the
first read. May be you could guess the meaning if you read the
part over. If you still have some questions write to me. I will
try to answer them if I can. (Especially I'd like to get some mail
from girls (16 - 25), I'm free again (sigh...), don't let this
chance go over!. You may also write without any questions
concerning the program.)
Send questions, suggestions, photos (girls only!), money, programs
to:
Joerg Fenin
Zum Jaegerfeld 19
2100 Hamburg 90
Germany
6 Technical information
IncRev was written in C, using SAS/Lattice C 5.10a for
compilation. It uses the cres.o startup code, so it can be made
resident (don't forget to set the pure-bit if it is not already
set). It has been optimized for time by the global optimzer of the
compiler. The source code should be provided with this release, so
it is easy for C programmers to expand IncRev to their needs.
IncRev has been developed quite a while ago and just small changes
have been made in the last weeks. That is the reason why IncRev
has not been written in ANSI-C yet. I'll change this in the
future.
7 Copyright
IncRev , all its source files, the makefile and this doc file are
copyrighted (C) 1991 Joerg Fenin / Metalworx.
However, it is freely distributable, as long as the following
rules are obeyed:
- The copyright-information remain unchanged
- The copying fee may not be more than DM 5,- rsp. not more
than $ 5 in the current currency in foreign (out of Germany)
countries.
- None of the files may be part of a commercial product without
the (written) permission of the author.
Copying and/or distributing is forbidden on own PD-series of
Stefan Ossowski PD-Versand, Rainer Wolf PD-Versand (OASE), Markt &
Technik Verlag AG, Karstadt AG and all other PD-distributors that
charge more than DM 5,- / $ 5,- for one disk (Fred Fish is
excluded from this demand!). I don't see why they should make the
big money with my work.
-------------------------------------------
last manual update: 08/14 1991