home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d1xx / d172 / spiff.lha / Spiff / Spiff.man < prev    next >
Text File  |  1988-11-22  |  26KB  |  595 lines

  1.  
  2.  
  3.  
  4.             SSSSPPPPIIIIFFFFFFFF((((1111))))             AAAA////UUUUXXXX ((((FFFFeeeebbbbrrrruuuuaaaarrrryyyy 2222,,,, 1111999988888888))))             SSSSPPPPIIIIFFFFFFFF((((1111))))
  5.  
  6.  
  7.  
  8.             NNNNAAAAMMMMEEEE
  9.                  spiff - make controlled approximate comparisons between
  10.                  files
  11.  
  12.             SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.                  ssssppppiiiiffffffff [ ----ssss script ] [ ----ffff sfile ] [ ----bbbbtttteeeevvvviiiiqqqqccccddddwwwwmmmm ] [ ----aaaa | ----rrrr
  14.                  value ] -value file1 file2
  15.  
  16.             DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.                  _S_p_i_f_f compares the contents of ffffiiiilllleeee1111 and ffffiiiilllleeee2222 and prints a
  18.                  description of the important differences between the files.
  19.                  White space is ignored except to separate other objects.
  20.                  _S_p_i_f_f maintains tolerances below which differences between
  21.                  two floating point numbers are ignored. Differences in
  22.                  floating point notation (such as 3.4 3.40 and 3.4e01) are
  23.                  treated as unimportant.  User specified delimited strings
  24.                  (i.e. comments) can also be ignored.  Inside other user
  25.                  specified delimited strings (i.e. quoted strings) whitespace
  26.                  can be significant.
  27.  
  28.                  _S_p_i_f_f'_s operation can be altered via command line options, a
  29.                  command script, and with commands that are embedded in the
  30.                  input files.
  31.  
  32.                  The following options affect _s_p_i_f_f'_s overall operation.
  33.  
  34.                  ----qqqq   suppresses warning messages.
  35.  
  36.                  ----vvvv   use a visually oriented display.  Works only in MGR
  37.                       windows.
  38.  
  39.                  _S_p_i_f_f has several flags to aid differencing of various
  40.                  programming languages.  See EXAMPLES for a detailed
  41.                  description of the effects of these flags.
  42.  
  43.                  ----CCCC   treat the input files as C program source code.
  44.  
  45.                  ----SSSS   treat the input files as Bourne shell program source
  46.                       code.
  47.  
  48.                  ----FFFF   treat the input files as Fortran program source code.
  49.  
  50.                  ----MMMM   treat the input files as Modula-2 program source code.
  51.  
  52.                  ----LLLL   treat the input files as Lisp program source code.
  53.  
  54.                  By default, the output looks somewhat similar in appearance
  55.                  to the output of diff(1).  Lines with differences are
  56.                  printed with the differences highlighted.  If stdout is a
  57.                  terminal, as determined by isatty(), then highlighting uses
  58.                  standout mode as determined by termcap.  If stdout is not a
  59.                  tty, then the underlining (via underscore/backspace/char) is
  60.  
  61.  
  62.  
  63.             Page 1                                         (printed 11/12/88)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.             SSSSPPPPIIIIFFFFFFFF((((1111))))             AAAA////UUUUXXXX ((((FFFFeeeebbbbrrrruuuuaaaarrrryyyy 2222,,,, 1111999988888888))))             SSSSPPPPIIIIFFFFFFFF((((1111))))
  71.  
  72.  
  73.  
  74.                  used to highlight differences.  The following option can
  75.                  control the format of the ouput.
  76.  
  77.                  ----tttt   produce output in terms of individual tokens.  This
  78.                       option is most useful for debugging as the output
  79.                       produced is verbose to the point of being unreadable.
  80.  
  81.                  The following option controls the differencing algorithm.
  82.  
  83.                  ----eeee   compare each token in the files with the object in the
  84.                       same ordinal position in the other file.  If the files
  85.                       have a different number of objects, a warning message
  86.                       is printed and the objects at the end of the longer
  87.                       file are ignored.  By default, _s_p_i_f_f uses a
  88.                       Miller/Myers algorithm to find a minimal edit sequence
  89.                       that will convert the contents of the first file into
  90.                       the second.
  91.  
  92.                  -<decimal-value>
  93.                       sets a limit on the total number of insertions and
  94.                       deletions that will be considered.  If the files differ
  95.                       by more than the stated amount, the program will give
  96.                       up, print a warning message, and exit.
  97.  
  98.                  The following options control the command script.  More than
  99.                  one of each may appear at at time. The commands accumulate.
  100.  
  101.                  ----ffff ssssffffiiiilllleeee
  102.                       a command script to be taken from file _s_f_i_l_e
  103.  
  104.                  ----ssss ccccoooommmmmmmmaaaannnndddd----ssssccccrrrriiiipppptttt
  105.                       causes the following argument to be taken as a command
  106.                       script.
  107.  
  108.                  The following options control how individual objects are
  109.                  compared.
  110.  
  111.                  ----bbbb   treat all objects (including floating point numbers) as
  112.                       literals.
  113.  
  114.                  ----cccc   ignore differences between upper and lower case.
  115.  
  116.                  The following commands will control how the files are
  117.                  parsed.
  118.  
  119.                  ----wwww   treat white space as objects.  Each white space
  120.                       character will be treated as a separate object when the
  121.                       program is comparing the files.
  122.  
  123.                  ----mmmm   treat leading sign characters ( + and - ) as separate
  124.                       even if they are followed by floating point numbers.
  125.  
  126.  
  127.  
  128.  
  129.             Page 2                                         (printed 11/12/88)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.             SSSSPPPPIIIIFFFFFFFF((((1111))))             AAAA////UUUUXXXX ((((FFFFeeeebbbbrrrruuuuaaaarrrryyyy 2222,,,, 1111999988888888))))             SSSSPPPPIIIIFFFFFFFF((((1111))))
  137.  
  138.  
  139.  
  140.                  ----dddd   treat integer decimal numbers (such as 1987) as real
  141.                       numbers (subject to tolerances) rather than as literal
  142.                       strings.
  143.  
  144.                  The following three flags are used to set the default
  145.                  tolerances.  The floating-point-numbers may be given in the
  146.                  formats accepted by atof(3).
  147.  
  148.                  ----aaaa ffffllllooooaaaattttiiiinnnngggg----ppppooooiiiinnnntttt----nnnnuuuummmmbbbbeeeerrrr
  149.                       specifies an absolute value for the tolerance in
  150.                       floating point numbers.  The flag ----aaaa1111eeee----2222 will cause all
  151.                       differences greater than 0.01 to be reported.
  152.  
  153.                  ----rrrr ffffllllooooaaaattttiiiinnnngggg----ppppooooiiiinnnntttt----nnnnuuuummmmbbbbeeeerrrr
  154.                       specifies a relative tolerance. The value given is
  155.                       interpreted as a fraction of the larger (in absolute
  156.                       terms) of the two floating point numbers being
  157.                       compared.  Thus, the flag ----rrrr0000....1111 will cause the two
  158.                       floating point numbers 1.0 and 0.9 to be deemed within
  159.                       tolerance. The numbers 1.0 and 0.89 will be outside the
  160.                       tolerance.
  161.  
  162.                  ----iiii   causes differences between floating point numbers to be
  163.                       ignored.
  164.  
  165.                  If more than one ----aaaa,,,, ----rrrr,,,, or ----iiii flag appear on the command
  166.                  line, the tolerances will be OR'd together (i.e. any
  167.                  difference that is within any of the tolerances will be
  168.                  ignored).
  169.  
  170.                  If no default tolerances is set on the command line, the
  171.                  program will use a default tolerance of ''''----aaaa 1111eeee----11110000 ----rrrr 1111eeee----11110000''''....
  172.  
  173.             SSSSCCCCRRRRIIIIPPPPTTTT CCCCOOOOMMMMMMMMAAAANNNNDDDDSSSS
  174.                  A script consists of commands, one per line.  Each command
  175.                  consists of a keyword possibly followed by arguments.
  176.                  Arguments are separated by one or more tabs or spaces.  The
  177.                  commands are:
  178.  
  179.                  literal BEGIN-STRING [END-STRING [ESCAPE-STRING]]
  180.                       Specifies the delimiters surrounding text that is to be
  181.                       treated as a single literal object. If only one
  182.                       argument is present, then only that string itself is
  183.                       treated as a literal. If only two arguments are
  184.                       present, they are taking as the starting and ending
  185.                       delimiters respectively.  If three arguments are
  186.                       present, they are treated as the start delimiter, end
  187.                       delimiter, and a string that may be used to escape an
  188.                       instance of the end delimiter.
  189.  
  190.                  beginchar BEGINNING-OF-LINE-CHARACTER
  191.                       Set the the beginning of line character for BEGIN-
  192.  
  193.  
  194.  
  195.             Page 3                                         (printed 11/12/88)
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.             SSSSPPPPIIIIFFFFFFFF((((1111))))             AAAA////UUUUXXXX ((((FFFFeeeebbbbrrrruuuuaaaarrrryyyy 2222,,,, 1111999988888888))))             SSSSPPPPIIIIFFFFFFFF((((1111))))
  203.  
  204.  
  205.  
  206.                       STRING's in comments.  The default is '^'.
  207.  
  208.                  endchar END-OF-LINE-CHARACTER
  209.                       Set the end of line character for END-STRING's in
  210.                       comments.  The default is '$'.
  211.  
  212.                  addalpha NEW-ALPHA-CHARACTER
  213.                       Add NEW-ALPHA-CHARACTER to the set of characters
  214.                       allowed in literal strings.  By default, _s_p_i_f_f parses
  215.                       sequences of characters that begin with a letter and
  216.                       followed by zero or more letters or numbers as a single
  217.                       literal token.  This definition is overly restrictive
  218.                       when dealing with programming languages.  For example,
  219.                       in the C programming language, the underscore character
  220.                       is allowed in identifiers.
  221.  
  222.                  comment BEGIN-STRING [END-STRING [ESCAPE-STRING]]
  223.                       Specifies the delimiters surrounding text that is to be
  224.                       be ignored entirely (i.e. viewed as comments).  The
  225.                       operation of the comment command is very similar to the
  226.                       literal command.  In addition, if the END-STRING
  227.                       consists of only the end of line character, the end of
  228.                       line will delimit the end of the comment.  Also, if the
  229.                       BEGIN-STRING starts with the beginning of line
  230.                       character, only lines that begin with the BEGIN-STRING
  231.                       will be ignored.
  232.  
  233.                  More than one comment specification and more than one
  234.                  literal string specification may be specified at a time.
  235.  
  236.                  nestcom BEGIN-STRING [END-STRING [ESCAPE-STRING]]
  237.                       Similar to the comment command, but allows comments to
  238.                       be nested.  Note, due to the design of the parser
  239.                       nested comments can not have a BEGIN-STRING that starts
  240.                       with the beginning of line character.
  241.  
  242.                  resetcomments
  243.                       Clears the list of comment specifications.
  244.  
  245.                  resetliterals
  246.                       Clears the list of literal specifications.
  247.  
  248.             ]
  249.                  tol [aVALUE|rVALUE|i|d . . . [ ; aVALUE|rVALUE|i|d . . . ] . . .
  250.                       set the tolerance for floating point comparisons. The
  251.                       arguments to the tol command are a set of tolerance
  252.                       specifications separated by semicolons.  If more than
  253.                       one a,r,d, or i appears within a specification, then
  254.                       the tolerances are OR'd together (i.e. any difference
  255.                       that is within any tolerance will be ignored).  The
  256.                       semantics of a,r, and i are identical to the ----aaaa,,,, ----rrrr,,,,
  257.                       and ----iiii flags. The d means that the default tolerance
  258.  
  259.  
  260.  
  261.             Page 4                                         (printed 11/12/88)
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.             SSSSPPPPIIIIFFFFFFFF((((1111))))             AAAA////UUUUXXXX ((((FFFFeeeebbbbrrrruuuuaaaarrrryyyy 2222,,,, 1111999988888888))))             SSSSPPPPIIIIFFFFFFFF((((1111))))
  269.  
  270.  
  271.  
  272.                       (as specified by the invocation options) should be
  273.                       used.  If more than one specification appears on the
  274.                       line, the first specification is applied to the first
  275.                       floating point number on each line, the second
  276.                       specification to the second floating point number one
  277.                       each line of the input files, and so on.  If there are
  278.                       more floating point numbers on a given line of input
  279.                       than tolerance specifications, the last specification
  280.                       is used repeatedly for all remaining floating point
  281.                       numbers on that line.
  282.  
  283.                  command STRING
  284.                       lines in the input file that start with STRING will be
  285.                       interpreted as command lines. If no "command" is given
  286.                       as part of a ----ssss or ----ffff then it will be impossible to
  287.                       embed commands in the input files.
  288.  
  289.                  rem
  290.  
  291.                  #    used to places human readable remarks into a commands
  292.                       script. Note that the use of the '#' character differs
  293.                       from other command languages (for instance the Bourne
  294.                       shell).  _S_p_i_f_f will only recognize the '#' as beginning
  295.                       a comment when it is the first non-blank character on
  296.                       the command line.  A '#' character appearing elsewhere
  297.                       will be treated as part of the command.  Cautious users
  298.                       should use 'rem'.  Those hopelessly addicted to '#' as
  299.                       a comment character can have command scripts with a
  300.                       familiar format.
  301.  
  302.                  Tolerances specified in the command scripts have precedence
  303.                  over the tolerance specified on the invocation command line.
  304.                  The tolerance specified in _f_i_l_e_1 has precedence over the
  305.                  tolerance specified in _f_i_l_e_2.
  306.  
  307.             VVVVIIIISSSSUUUUAAAALLLL MMMMOOOODDDDEEEE
  308.                  If _s_p_i_f_f is invoked with the -v option, it will enter an
  309.                  interactive mode rather than produce an edit sequence.
  310.                  Three windows will be put on the screen.  Two windows will
  311.                  contain corresponding segments of the input files.  Objects
  312.                  that appear in both segments will be examined for
  313.                  differences and if any difference is found, the objects will
  314.                  be highlighted in reverse video on the screen.  Objects that
  315.                  appear in only one window will have a line drawn through
  316.                  them to indicate that they aren't being compared with
  317.                  anything in the other text window. The third window is a
  318.                  command window.  The command window will accept a single
  319.                  tolerance specification (followed by a newline) in a form
  320.                  suitable to the ttttoooollll command.  The tolerance specified will
  321.                  then be used as the default tolerance and the display will
  322.                  be updated to highlight only those objects that exceed the
  323.                  new default tolerance.  Typing mmmm (followed by a newline)
  324.  
  325.  
  326.  
  327.             Page 5                                         (printed 11/12/88)
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.             SSSSPPPPIIIIFFFFFFFF((((1111))))             AAAA////UUUUXXXX ((((FFFFeeeebbbbrrrruuuuaaaarrrryyyy 2222,,,, 1111999988888888))))             SSSSPPPPIIIIFFFFFFFF((((1111))))
  335.  
  336.  
  337.  
  338.                  will display the next screenfull of text. Typing qqqq (followed
  339.                  by a newline)  will cause the program to exit.
  340.  
  341.             LLLLIIIIMMMMIIIITTTTSSSS
  342.                  Each input files can be no longer that 10,000 line long or
  343.                  contain more than 50,000 tokens. Longer files will be
  344.                  truncated.  No line can be longer than 1024 characters.
  345.                  Newlines will be inserted every 1024 character.
  346.  
  347.             EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  348.                  spiff -e -d foo bar
  349.                       this invocation (using exact match algorithm and
  350.                       treating integer numbers as if they were floats) is
  351.                       very useful for examining large tables of numbers.
  352.  
  353.                  spiff -0 foo bar
  354.                       compare the two files, quitting after the first
  355.                       difference is found.  This makes the program operate
  356.                       roughly like cmp(1).
  357.  
  358.                  spiff -0 -q foo bar
  359.                       same as the above, but no output is produced.  The
  360.                       return code is still useful.
  361.  
  362.                  spiff -w -b foo bar
  363.                       will make the program operate much like diff(1).
  364.  
  365.                  spiff -a1e-5 -r0.001 foo bar
  366.                       compare the contents of the files foo and bar and
  367.                       ignore all differences between floating point numbers
  368.                       that are less than or equal to 0.00001 or 0.1% of the
  369.                       number of larger magnitude.
  370.  
  371.                  tol a.01 r.01
  372.                       will cause all differences between floating point
  373.                       numbers that are less than or equal to 0.01 or 1% of
  374.                       the number of larger magnitude to be ignored.
  375.  
  376.                  tol a.01 r.01 ; i
  377.                       will cause the tolerance in the previous example to be
  378.                       applied to the first floating point number on each
  379.                       line.  All differences between the second and
  380.                       subsequent floating point numbers on each line will be
  381.                       ignored.
  382.  
  383.                  tol a.01 r.01 ; i ; a.0001
  384.                       like the above except that only differences between the
  385.                       second floating point number on each line will be
  386.                       ignored. The differences between third and subsequent
  387.                       floating point numbers on each number will be ignored
  388.                       if they are less than or equal to 0.0001.
  389.  
  390.  
  391.  
  392.  
  393.             Page 6                                         (printed 11/12/88)
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.             SSSSPPPPIIIIFFFFFFFF((((1111))))             AAAA////UUUUXXXX ((((FFFFeeeebbbbrrrruuuuaaaarrrryyyy 2222,,,, 1111999988888888))))             SSSSPPPPIIIIFFFFFFFF((((1111))))
  401.  
  402.  
  403.  
  404.                       A useful script for examing C code is:
  405.                       literal  "    "    \
  406.                       comment  /*  */
  407.                       literal  &&
  408.                       literal  ||
  409.                       literal  <=
  410.                       literal  >=
  411.                       literal  !=
  412.                       literal  ==
  413.                       literal  --
  414.                       literal  ++
  415.                       literal  <<
  416.                       literal  >>
  417.                       literal  ->
  418.                       addalpha _
  419.                       tol      a0
  420.  
  421.                       A useful script for shell programs is:
  422.                       literal  '    '    \
  423.                       comment  #    $
  424.                       tol      a0
  425.  
  426.                       A useful script for Fortran programs is:
  427.                       literal ' ' '
  428.                       comment ^C $
  429.                       tol     a0
  430.  
  431.                       A useful script for Modula 2 programs is:
  432.                       literal ' '
  433.                       literal " "
  434.                       nestcom (* *)
  435.                       literal :=
  436.                       literal <>
  437.                       literal <=
  438.                       literal >=
  439.                       tol     a0
  440.  
  441.                       A useful script for Lisp programs is:
  442.                       literal " "
  443.                       comment ; $
  444.                       tol     a0
  445.  
  446.             DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  447.                  _S_p_i_f_f'_s exit status is 0 if no differences are found, 1 if
  448.                  differences are found, and 2 upon error.
  449.  
  450.             BBBBUUUUGGGGSSSS
  451.                  In C code, escaped newlines will appear as differences.
  452.  
  453.                  Comments are treated as token delimiters.
  454.  
  455.                  Comments in Basic don't work right.  The line number is not
  456.  
  457.  
  458.  
  459.             Page 7                                         (printed 11/12/88)
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.             SSSSPPPPIIIIFFFFFFFF((((1111))))             AAAA////UUUUXXXX ((((FFFFeeeebbbbrrrruuuuaaaarrrryyyy 2222,,,, 1111999988888888))))             SSSSPPPPIIIIFFFFFFFF((((1111))))
  467.  
  468.  
  469.  
  470.                  ignored.
  471.  
  472.                  Continuation lines in Fortran comments don't work.
  473.  
  474.                  There is no way to represent strings specified using a
  475.                  Hollerith notation in Fortran.
  476.  
  477.                  In formated English text, hyphenated words, movements in
  478.                  pictures, footnotes, etc.  will be reported as differences.
  479.  
  480.                  STRING's in script commands can not include whitespace.
  481.  
  482.                  Visual mode does not handle tabs properly.  Files containing
  483.                  tabs should be run through expand(1) before trying to
  484.                  display them with visual mode.
  485.  
  486.                  In visual mode, the text windows appear in a fixed size and
  487.                  font.  Lines longer than the window size will not be handled
  488.                  properly.
  489.  
  490.                  Objects (literal strings) that contain newlines cause
  491.                  trouble in several places in visual mode.
  492.  
  493.                  Visual mode should accept more than one tolerance
  494.                  specification.
  495.  
  496.                  When using visual mode or the exact match comparison
  497.                  algorithm, the program should do the parsing on the fly
  498.                  rather than truncating long files.
  499.  
  500.             AAAAUUUUTTTTHHHHOOOORRRR
  501.                  Daniel Nachbar
  502.  
  503.             CCCCOOOOPPPPYYYYRRRRIIIIGGGGHHHHTTTT
  504.                                   Copyright (c) 1988 Bellcore
  505.                                       All Rights Reserved
  506.                  Permission is granted to copy or use this program,
  507.                  EXCEPT that it may not be sold for profit, the copyright
  508.                  notice must be reproduced on copies, and credit should
  509.                  be given to Bellcore where it is due.
  510.                           BELLCORE MAKES NO WARRANTY AND ACCEPTS
  511.                              NO LIABILITY FOR THIS PROGRAM.
  512.  
  513.  
  514.             SSSSEEEEEEEE AAAALLLLSSSSOOOO
  515.                  atof(3) isatty(2) diff(1) cmp(1) expand(1) mgr(1L)
  516.  
  517.                  "Spiff -- A Program for Making Controlled Approximate
  518.                  Comparisons of Files", by Daniel Nachbar.
  519.  
  520.                  "A File Comparison Program" by Webb Miller and Eugene W.
  521.                  Myers in Software - Practice and Experience, Volume 15(11),
  522.  
  523.  
  524.  
  525.             Page 8                                         (printed 11/12/88)
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.             SSSSPPPPIIIIFFFFFFFF((((1111))))             AAAA////UUUUXXXX ((((FFFFeeeebbbbrrrruuuuaaaarrrryyyy 2222,,,, 1111999988888888))))             SSSSPPPPIIIIFFFFFFFF((((1111))))
  533.  
  534.  
  535.  
  536.                  pp.1025-1040, (November 1985).
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.             Page 9                                         (printed 11/12/88)
  592.  
  593.  
  594.  
  595.