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 >
Text File  |  1991-08-26  |  17KB  |  343 lines

  1.                                   IncRev V1.03
  2.  
  3.                             automatic revision update
  4.  
  5.                         (C) 1991 Joerg Fenin / Metalworx
  6.  
  7.      ---------------------------------------------------------------------
  8.      This program  is FREEWARE! Feel free to give it to anyone you like. You
  9.      need not pay a shareware  fee  to  the  author.  Still  it  is strictly
  10.      forbidden to  make any profit with it. IncRev and its source files MUST
  11.      NOT be distributed commercially. No more than DM 5,- / US $  5,- may be
  12.      charged  for  one  diskette  where  the  IncRev  package  is  on  (This
  13.      restriction is not valid for Fred Fish, he  may charge  more than  US $
  14.      5,-).
  15.  
  16.      This package (or any of its files) MUST NOT be distributed on PD series
  17.      of Stefan Ossowski PD-Versand, Rainer Wolf PD-Versand, Markt  & Technik
  18.      Verlag AG and Karstadt AG. 
  19.      ---------------------------------------------------------------------
  20.  
  21.      1    Purpose
  22.  
  23.           As I  am doing  a lot  of programming on my Amiga I often lose the
  24.           overview of all the  different projects.  I often  didn't know any
  25.           more when I did the last changes to a program. Was it yesterday or
  26.           last month? I also often shared programming on one program  with a
  27.           friend (though it's not a friend anymore, thanx for not knowing me
  28.           anymore, keep your eyes just on  her and  lose all  your friends!)
  29.           and we couldn't manage to find out whose version was newer.
  30.  
  31.           I have also published a commercial disk label printout program for
  32.           diskette labels. In case of an  error it's  important to  know the
  33.           version the customer is working with you have to keep track on the
  34.           version numbers.
  35.  
  36.           IncRev  automatically  updates  revision  numbers  each  time  the
  37.           program is  recompiled. This  also shows  you, the programmer, how
  38.           many tests you need to have a running version.
  39.  
  40.  
  41.      2    Organization
  42.  
  43.           All my program-versions are organized  in  the  following  way and
  44.           yours will have to be too if you want to use this program:
  45.  
  46.           The name in brackets() is the name of the variable (see below).
  47.  
  48.  
  49.      2.1  Program ID (ProgId)
  50.  
  51.           Each  program  has  an  program-id.  It  contains  the name of the
  52.           program.
  53.  
  54.  
  55.      2.2  Version (Version)
  56.  
  57.           Each  program  has  a  version-number.  My   version  numbers  are
  58.           organized as follows:
  59.  
  60.           X.YZ
  61.  
  62.           where     X -  is the  general version. If you start a new program
  63.                          you will start with a  one  (1)  for  the  X. Let's
  64.                          assume you  have written  the first running version
  65.                          in AmigaBASIC and you gave it the version no. 1.00.
  66.                          Now you  re-write the  whole program in C. You give
  67.                          it the version number 2.00. This version has only a
  68.                          CLI-Interface.  Now  you  write  a  whole  new user
  69.                          interface using the  Workbench  and  Intuition. You
  70.                          may now give it the version number 3.00.
  71.  
  72.                     Y -  is  the  'major  update  number'.  Let's  take  the
  73.                          version  3.00  from  the  example  above.  In  this
  74.                          version filenames  are entered  via a simple string
  75.                          gadget. Now your C  capabilitis have  increased and
  76.                          you  are  able  to  write  a  file  requester.  The
  77.                          filename will now  be  selected  via  the  new file
  78.                          requester in  version 3.10.  Next you add a palette
  79.                          requester too and the new version is 3.20.
  80.                     Z -  is the 'minor update number'. In  version 3.20 (see
  81.                          above) you  notice after a few weeks of using, that
  82.                          anytime you use the  file requester,  the last name
  83.                          in the  specified directory  is not  shown due to a
  84.                          bug  you  made  in  the  file   requester  routine.
  85.                          Professional as  you are  you locate  the error and
  86.                          remove it. Now you have a new version 3.21.
  87.  
  88.  
  89.      2.3  Revision (Revision)
  90.  
  91.           After version 3.00 in the example above you decided to  add a file
  92.           requester to  your program.  If you  are not  a perfect programmer
  93.           you'll need several attempts  to get  exactly what  you wanted. As
  94.           long as  you are  not satisfied with the result you will recompile
  95.           version 3.00 over and  over again.  The version  remains the same,
  96.           because the  file requester is not fully implemented yet. Only the
  97.           revision number and the date will increase each time you compile.
  98.  
  99.           Another  revision-only  update  will  be  this.  After  completing
  100.           version 3.21  (see above) you notice that one of the texts in your
  101.           gadgets is not centered correctly. Though it is not really  a bug,
  102.           you want to show that the program was changed. You center the text
  103.           correctly and increase only the revision number, so you still have
  104.           version 3.21 but the second revision.
  105.  
  106.           IncRev updates only the revision number by default. If you wish to
  107.           change the other variables  you have  to use  command line options
  108.           (see below).
  109.  
  110.  
  111.      2.4  User id (UserId)
  112.  
  113.           If you  are working  in a  team you would like to know who in your
  114.           team created the current version. Therefore  you can  use the user
  115.           id variable. You can set UserId once in your rev.c file or you can
  116.           set an environment variable (USERNAME) with the SETENV command. If
  117.           IncRev  finds  this  environment  variable  set  it  will  use its
  118.           contents to update the  program's user  id (UserId  in rev.c) each
  119.           time it  is invoked.  Certainly you  can use  the -u option to set
  120.           UserId explicitly.
  121.  
  122.  
  123.      2.5  Date (Date)
  124.  
  125.           No need  for long  explanations. Each  time IncRev  is invoked the
  126.           current date  (read from  the system date) will be filled into the
  127.           Date variable of rev.c. The format  will be:  DD-MMM-YY. (I intend
  128.           to let the user specify the date format in a future version.)
  129.  
  130.  
  131.      3    Invokation
  132.  
  133.           IncRev  needs  a  file  rev.c  to  read.  This  rev.c contains all
  134.           information as described above. All changes  will be  done only to
  135.           rev.c.  After  compiling  it  to  rev.o  it must be linked to your
  136.           program. See the compile section below!
  137.  
  138.           Here is how to call IncRev:
  139.  
  140.           Usage: increv  [ [-]? ] [ -d ] [ -i<ID> ] [ -r<No.> ] [ -u<USER> ]
  141.                          [ -v<No.> ]
  142.           Options:  -?        displays this text
  143.                     -d        date  update   only  (all  other  options  are
  144.                               ignored)
  145.                     -i<ID>    update ProgId with ID, can be any text
  146.                     -r<No.>   update revision  no. with  No. No.  must be an
  147.                               integer!
  148.                     -u<USER>  update UserId with USER, can be any text
  149.                     -v<No.>   update version with No. No. can be any text
  150.  
  151.           Parameters in  brackets [] are optional, parameters in <>s must be
  152.           specified. Note that no space must  be located  between the option
  153.           parameter and  the text  or number. Otherwise text or numbers will
  154.           be interpreted as single options.
  155.  
  156.  
  157.      3.1  increv without parameters
  158.  
  159.           If you call increv without paramter  it  will  look  for  the file
  160.           rev.c, update  Date[] to  the current  (system) date and increment
  161.           the revision number Revision by one.
  162.  
  163.  
  164.      3.2  help ([-]?)
  165.  
  166.           If you type 'increv ?' or 'increv -?' the template  as shown above
  167.           will be displayed to you.
  168.  
  169.  
  170.      3.3  date update only (-d)
  171.  
  172.           If you  specify the  -d option  only the date in the rev.c will be
  173.           updated. This might be useful if you didn't  recompile (and didn't
  174.           use  IncRev)  for  more  than  2  days  and you know that you will
  175.           recompile (and use IncRev) just for one time. In this case (and if
  176.           you use IncRev as I recommend), rev.c was updated at least to days
  177.           ago and it contains the date of two days ago.  The revision number
  178.           you use  in the  program will be the current revision number minus
  179.           one, because (as  I  recommend)  IncRev  was  invoked  *AFTER* the
  180.           linking  process   (see  below).   So  the   revision  number  was
  181.           incremented but not yet linked into the program.  If you recompile
  182.           now (today  in this example) the revision number of rev.c and it's
  183.           last  date  will  be  included  in  your  program   (sounds  quite
  184.           complicated, I know, my English is not perfect although I'm trying
  185.           to improve it, just try it out yourself). So in  order to  get the
  186.           correct  date  into  your  rev.c  (and  in  your  program) without
  187.           updating the revision number again (because  it has  been done the
  188.           last time)  you can use the -d option. Note that all other options
  189.           will then be ignored!
  190.  
  191.  
  192.      3.4  change program id (-i)
  193.  
  194.           If you feel that your program, that was called DeluxePaint so far,
  195.           should get  a more  unique name  like PowerPaint you don't have to
  196.           call your favorite editor (mine is  DME by  the way,  thanx Matt!)
  197.           you can  just type  'increv -iPowerPaint' and the ProgId[] will be
  198.           changed to "PowerPaint" ('though it is very hard for me not to use
  199.           DME). If  you want  to have  spaces in your program id you have to
  200.           enclose the whole option in double quotes (") like 
  201.           'increv "-iPower Paint"'.
  202.  
  203.  
  204.      3.5  change revision number (-r)
  205.  
  206.           If you would like to give your program a specific  revision number
  207.           like 0,1  or 999  you can set it to the desired option with the -r
  208.           option. Just say 'increv -r0' and the revision number will  be set
  209.           to zero.  Note that  the revision  number following  the -r option
  210.           must be an integer!
  211.  
  212.  
  213.      3.6  change user id (-u)
  214.  
  215.           To change the UserId[] you can use the -u option. The restrictions
  216.           are the same as with the program id (see above).
  217.           IMPORTANT: If you have set the environment variable USERNAME using
  218.           the SETENV command, your UserId will be updated  with the contents
  219.           of  this  variable  each  time  you  invoke  IncRev without the -u
  220.           option. This may not be what  you  wanted.  To  prevent  this just
  221.           clear the environment variable.
  222.  
  223.  
  224.      3.7  change version (-v)
  225.  
  226.           To  change   the  Version[]   you  can  use  the  -v  option.  The
  227.           restrictions are the same as with the program id (see above).
  228.  
  229.  
  230.      4    Compiling
  231.  
  232.           All revision information is held in a single file called rev.c. It
  233.           must  not  contain  anything  else  and  it must be linked to your
  234.           program after compile. The general format for rev.c is:
  235.  
  236.           Line 1    char ProgId[]="...";
  237.           Line 2    char Version[]="...";
  238.           Line 3    int Revision=x;
  239.           Line 4    char UserId[]="...";
  240.           Line 5    char Date[]="...";
  241.  
  242.           rev.c may contain more lines after the date line but  they will be
  243.           ignored and  discarded after  the first write. It must not contain
  244.           anything before the program id line. The lines have to  be in this
  245.           sequence, you  must not  mix up the lines or concatenate them. All
  246.           character  arrays  may  contain  anything  you  like,  it  is just
  247.           restricted by the line length of 79 characters. Each line must not
  248.           contain more  than  79  characters.  The  revision  line  may just
  249.           contain  an  integer  number  after  the equal (=) sign. Note that
  250.           IncRev divides a line  at its  equal sign.  Changes are  made only
  251.           after  the  equal  sign.  Following this statement IncRev will not
  252.           notice if you change the names  of the  variables. You  may change
  253.           them as  you like.  Although the  meaning remains the same. If you
  254.           for example change 'Date' to 'ProgramVersionNumber'  it will still
  255.           contain the  last update  date after  invoking IncRev. However you
  256.           could for example change 'Date' to 'Datum' if you speak german and
  257.           want to use german variable names in your program (as I often do).
  258.  
  259.           To make  sure that  the revision number will be updated every time
  260.           you re-compiled your  program  SUCCESSFULLY  (note  that  word!) I
  261.           recommend to  call increv  from a   (lmkfile) makefile. To use lmk
  262.           (make) for compiling and linking is the best method anyway, wether
  263.           you  use  IncRev  or  not.  I  have  included  the  lmkfile for my
  264.           forthcoming program (must be soon on a Fishdisk near your) 'WFile'
  265.           as an  example. Note  that IncRev is called after the (successful)
  266.           linking procedure. 
  267.  
  268.           ------------------------------------------
  269.                # make wfile, 12-Jan-91 Metalworx
  270.  
  271.                SYSTEM=AMIGA
  272.                CFLAGS=-D$(SYSTEM) -cast -j132 -O -mt -qdh0:
  273.                OFILES=wfile.o whelp.o template.o profile.o rev.o strpos.o
  274.  
  275.                wfile: $(OFILES)
  276.                     blink FROM LIB:cres.o+$(OFILES) TO wfile LIB LIB:lc.lib
  277.                     increv
  278.           ------------------------------------------
  279.  
  280.           Note that rev.c would  be re-compiled  every time,  because IncRev
  281.           creates  a  new  rev.c  every  time  it is invoked. Due to rev.c's
  282.           shortness it will take not much time.
  283.  
  284.  
  285.      5    Any questions ?
  286.           Do you have any questions ? Well, try reading the  doc file again.
  287.           My English is not perfect, so something may not be clear after the
  288.           first read. May be  you could  guess the  meaning if  you read the
  289.           part over.  If you  still have  some questions write to me. I will
  290.           try to answer them if I can. (Especially I'd like to get some mail
  291.           from girls  (16 -  25), I'm  free again  (sigh...), don't let this
  292.           chance  go  over!.  You  may  also  write  without  any  questions
  293.           concerning the program.)
  294.  
  295.           Send questions, suggestions, photos (girls only!), money, programs
  296.           to:
  297.  
  298.                                    Joerg Fenin
  299.                                 Zum Jaegerfeld 19
  300.                                  2100 Hamburg 90
  301.                                      Germany
  302.  
  303.  
  304.      6    Technical information
  305.  
  306.           IncRev  was  written  in   C,  using   SAS/Lattice  C   5.10a  for
  307.           compilation. It  uses the  cres.o startup  code, so it can be made
  308.           resident (don't forget to set the  pure-bit if  it is  not already
  309.           set). It has been optimized for time by the global optimzer of the
  310.           compiler. The source code should be provided with this release, so
  311.           it is easy for C programmers to expand IncRev to their needs. 
  312.  
  313.           IncRev has been developed quite a while ago and just small changes
  314.           have been made in the last  weeks. That  is the  reason why IncRev
  315.           has  not  been  written  in  ANSI-C  yet.  I'll change this in the
  316.           future.
  317.  
  318.  
  319.      7    Copyright
  320.  
  321.           IncRev , all its source files, the makefile and this  doc file are
  322.           copyrighted (C) 1991 Joerg Fenin / Metalworx.
  323.  
  324.           However,  it  is  freely  distributable,  as long as the following
  325.           rules are obeyed:
  326.  
  327.            -   The copyright-information remain unchanged
  328.            -   The copying fee may  not be  more than  DM 5,-  rsp. not more
  329.                than $  5 in the current currency in foreign (out of Germany)
  330.                countries.
  331.            -   None of the files may be part of a commercial product without
  332.                the (written) permission of the author.
  333.  
  334.           Copying  and/or  distributing  is  forbidden  on  own PD-series of
  335.           Stefan Ossowski PD-Versand, Rainer Wolf PD-Versand (OASE), Markt &
  336.           Technik Verlag  AG, Karstadt AG and all other PD-distributors that
  337.           charge more than DM 5,-  /  $  5,-  for  one  disk  (Fred  Fish is
  338.           excluded from  this demand!). I don't see why they should make the
  339.           big money with my work.
  340.  
  341.      -------------------------------------------
  342.      last manual update: 08/14 1991
  343.