home *** CD-ROM | disk | FTP | other *** search
/ Hall of Fame / HallofFameCDROM.cdr / misc2 / scctrl.lzh / SAMPLE.V2 < prev    next >
Encoding:
Text File  |  1991-06-23  |  12.4 KB  |  360 lines

  1.            *** Please Read the following information ***
  2.  
  3.    You can make this sample.log file by running the batch file named
  4.  sample.bat (see readme.scc).
  5.                                                     
  6.    This file should be viewed from within the SCC VIEW utility.
  7.  Therefor start SCC by typing in at the prompt "SCC /v,sample.log" or
  8.  use SCC VIEW menu selection. This will bring up the SCC VIEW utility
  9.  with this file displayed. Then continue reading the following.
  10.  
  11.    The comments on the right hand side such as "Ignore numbers",
  12.  "Ignore white space" are only to aid in the
  13.  
  14.                                                     Ignore numbers       
  15.                                                     Ignore white space       
  16.  
  17.  interpretation of how various option settings has on the SCC generated
  18.  log. These comments are put in as part of the original text file and
  19.  are not generated by SCC.             
  20.  
  21.    Some of the "LOG" options set (see above log header) for this
  22.  example should be set as:
  23.  
  24.      Strip  End White = No     strip ending white space from Old/New
  25.      Ignore Case      = Yes
  26.      Ignore White     = Yes
  27.      Ignore Numbers   = Yes
  28.  
  29.   If you have a color monitor, please note:
  30.  
  31.   1) Main "text" screen attributes   (foreground/background):
  32.      
  33.         o CONTROL      = High  White & Blue  Background.
  34.         o Old Document = Light White & Blue  Background.
  35.         o New Document = Yellow      & Blue  Background.
  36.  
  37.   2) Cursor line attributes:
  38.  
  39.         o Cursor       = Black       & Cyan  Background.
  40.  
  41.   For the help menu, press the F1 key.
  42.  
  43.      When the cursor is on a Log line and its left control side has
  44.   either a '-', or '+' then one of the following line operations apply.
  45.   
  46.   Log status   Operation          
  47.   ----------   ---------          
  48.          '-'   " Deleted  Line   "
  49.          '+'   " Inserted Line   "
  50.  
  51.      When the cursor is on a Log line and its left control side equals
  52.   a blank character ' ' then both old/new lines are identical except
  53.   for one or more of the following attributes.
  54.  
  55.   Log status   Operation          
  56.   ----------   ---------         
  57.          ' '   Common Lines      old/new lines are identical
  58.          ' '   Moved  Line       old/new lines are identical
  59.          ' '   Ignore White Sp   
  60.          ' '   Ignore Numbers    
  61.          ' '   Ignore Case       
  62.          ' '   Multi  Match      
  63.  
  64.      The above Log status (along with different SCC Log option 
  65.   settings) can help generate a "filtered" SCC change control report.
  66.   This report will show what is important (delete or insert status)
  67.   and what is not important (blank status) in your file.
  68.      For example you may want to ignore the '-' or '+' (delete or
  69.   insert) status characters for such lines containing differences of
  70.   only "White Space", "Upper/Lower Case" etc.
  71.  
  72.   START OF EXAMPLES.....
  73.  
  74.  
  75.  
  76.  
  77.  
  78.                                                      new line   (added)
  79. /**********************************                  new line   (added)
  80.  *                                                   moved line       
  81.       * put a poxxper terminoting                    close match 
  82.  * 9-MARCH-90 sample.v2                              Ignore numbers       
  83.  * INPUT                                             new line   (added)       
  84.  *   string pointer                                  new line   (added)       
  85.  *   tab size                                        new line   (added)       
  86.  *                                                   new line   (added)       
  87.  * RETURN                                            new line   (added)       
  88. #include <stdio.h>                                   Ignore white space
  89. #include <string.h>                                  Ignore white space       
  90.  
  91. void DE_detab  (char *buffer, int line_size, int tab_size);
  92.  
  93.  
  94. void DE_detab(string, max_lenth, tab_size)
  95. char *string;
  96. int  max_lenth;
  97.  
  98. int  tab_size;                                       Strip end white            
  99. {
  100.    int i;
  101.    int index;
  102.    int lenth;
  103.    int delta;
  104.    int move_from;
  105.    int move_to;
  106.  
  107.   /*-----------------------------------------*
  108.    * make room for a pxoper trailing '\0' string     close match
  109.    *-----------------------------------------*/      moved line
  110.    register unsigned i;                              moved line
  111.       * put a proper terminating                     close match 
  112.    NOW IS THE TIME                                   Ignore case       
  113.    Now is  x                                         close match
  114.    The quick                                         Ignore white space
  115.    goto 670                                          Ignore numbers       
  116.    let string 1 = \"brown\""},                       moved line       
  117.    let string 2 = \"uic\""},                         moved line       
  118.   /*--------------------------------------*
  119.    * This lets us reference elements of array as 1 to n
  120.    *--------------------------------------*/
  121.    (char *)base     -= element_width;
  122.  
  123.   /*--------------------------------------*
  124.    * The following assignments to static variables reduce the
  125.    * overhead of subroutine calls later.
  126.    *--------------------------------------*/
  127.    static_width      = element_width;
  128.    static_compare    = compare;
  129.    static_n_elements = n_elements;
  130.    static_base       = base;
  131.  
  132.   /*--------------------------------------*
  133.    * 
  134.    *--------------------------------------*/
  135.    temp_element      = malloc (element_width);
  136.  
  137.    if (temp_element == NULL){
  138.  
  139.   /*--------------------------------------*
  140.    * 
  141.    *--------------------------------------*/
  142.    for (i = n_elements; i>1; i--){
  143.        swap (1, i);
  144.        heasaaafy (1, i-1);
  145.    }
  146.  
  147.   /*--------------------------------------*
  148.    * 
  149.    *--------------------------------------*/
  150. }
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157. /*--------------------------------------*
  158.  *
  159.  *--------------------------------------*/
  160. static void pascal
  161. swap (i, j)
  162. unsigned i;
  163. unsigned j;
  164. {
  165.     register int temp_int;
  166.     long         temp_long;
  167.  
  168.    The quick brown                                   close match
  169.    The quick brown                                   close match
  170.     switch (static){
  171.  
  172.         case sizeof (int):                  temp_int = ((int *) static_base) [i];
  173.                            ((int *) static_base) [i] = ((int *) static_base) [j];
  174.                            ((int *) static_base) [j] = temp_int;
  175.                            break;
  176.     
  177.         case sizeof(long):                  temp_long = ((long *) static_base) [i];
  178.                            ((long *) static_base) [i] = ((long *) static_base) [j];
  179.                            ((long *) static_base) [j] = temp_long;
  180.                            break;
  181.     
  182.         case sizeof(char):                   temp_int = ((char *) static_base) [i];
  183.                            ((char *) static_base) [i] = ((char *) static_base) [j];
  184.                            ((char *) static_base) [j] = (char) temp_int;
  185.                            break;
  186.     
  187.         default:           memcpy(temp_element,
  188.                                  (char *)static_base + i*static_width,
  189.                                   static_width);
  190.     
  191.                            memcpy((char *) static_base + i*static_width,
  192.                                   (char *) static_base + j*static_width,
  193.                                   static_width);
  194.     
  195.                            memcpy((char *) static_base + j*static_width,
  196.                                   temp_element,
  197.                                   static_width);
  198.     
  199.                            break;
  200.     }
  201. }
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208. /*--------------------------------------*
  209.  *
  210.  *
  211.  *--------------------------------------*/
  212. static void pascal
  213. buildheap()
  214. {
  215.     register unsigned element_number;
  216.   
  217.    /*--------------------------------------*
  218.     * 
  219.     *--------------------------------------*/
  220.     for (element_number = static_n_elements >> 1;
  221.          element_number >= 1;
  222.          element_number -- ){
  223.   
  224.         heasaaafy(element_number, static_n_elements);
  225.     }
  226.  
  227. }
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234. /*--------------------------------------*
  235.  *
  236.  *
  237.  *--------------------------------------*/
  238. static void pascal
  239. heasaaafy (i,j)
  240. unsigned i;
  241. unsigned j;
  242. {
  243.  
  244.    /*--------------------------------------*
  245.     * The following are static to avoid recursive stack overhead
  246.     *--------------------------------------*/
  247.     static unsigned son1i;
  248.     static unsigned son2i;
  249.     static unsigned k;
  250.   
  251.     static void *pson1;
  252.     static void *pson2;
  253.                                                      new line   (added)       
  254.     *---------------------------                     moved line       
  255.     son1i = son1 (i);                                moved line       
  256.     switch (child_count (i, j)){                     close match       
  257.     pson1 = pointer        (son1i);                  Ignore white space       
  258.     saaa    = pointer (i);                           moved line       
  259.                                                      moved line       
  260.       case 0:
  261.   
  262.          /*--------------------------------------*
  263.           * 
  264.           *--------------------------------------*/
  265.           break;
  266.   
  267.       case 2:                                        Strip end white 
  268.          /*--------------------------------------*
  269.           * 
  270.           *--------------------------------------*/
  271.           k = (*static_compare) (pson1, pson2) > 0 ? son1i : son2i;
  272.           if ((*static_compare) (saaa, pointer (k)) < 0){
  273.   
  274.              /*--------------------------------------*
  275.               * 
  276.               *--------------------------------------*/
  277.               swap (i, k);
  278.               heasaaafy (k, j);
  279.           }
  280.           break;
  281.   
  282.       case 1:
  283.   
  284.          /*--------------------------------------*
  285.           * 
  286.           *--------------------------------------*/
  287.           if ((*static_compare) (saaa, pson1) < 0){
  288.   
  289.              /*--------------------------------------*
  290.               * 
  291.               *--------------------------------------*/
  292.               swap (i, son1i);
  293.               heasaaafy (son1i, j);
  294.   
  295.           }
  296.           break;
  297.     }
  298. }
  299.  
  300.   /*---------------------------------------------*
  301.    * scan and replace all TAB char within string
  302.    *---------------------------------------------*/
  303.    for (index=0; string[index] && (index<max_lenth); index++){
  304.  
  305.       if (string[index] == '\t'){
  306.          if (tab_size == 0){
  307.  
  308.            /*---------------------------------------------*
  309.             * remove TAB by closing string
  310.             *---------------------------------------------*/
  311.             lenth = strlen(string);
  312.  
  313.             for (i=index; i<=lenth; i++){
  314.                string[i] = string[i+1];
  315.             }
  316.             index--;
  317.             continue;
  318.          }
  319.  
  320.         /*---------------------------------------------*
  321.          * replace Tab char with a                   Ignore case       
  322.          *---------------------------------------------*/
  323.          string[index] = ' ';
  324.          delta = tab_size-((index+1) % tab_size);
  325.  
  326.          if (delta && (delta < tab_size)){
  327.  
  328.            /*-----------------                       new line   (added)       
  329.             * open up the stri                       new line   (added)       
  330.             *-----------------                       new line   (added)       
  331.             index++;
  332.             move_from = strlen(&string[index]) + index + 1;
  333.             move_to   = move_from + delta;
  334.             for ( ;move_from >= index; move_from--, move_to--){
  335.                if (move_to < max_lenth){
  336.  
  337.                  /*---------------------------------------------*
  338.                   * open only within the max_lenth of string
  339.                   *---------------------------------------------*/
  340.        5           string[move_to 67867840]          Ignore numbers       
  341.                }
  342.             }
  343.  
  344.            /*---------------------------------------------*
  345.             * replace (delta lenth) with ' ' char within max_lenth 
  346.             *---------------------------------------------*/
  347.             for (delta+=index; (index<delta) && (index<max_lenth); index++){
  348.                string[index] = ' ';
  349.             }
  350.             index--;
  351.          }
  352.       }
  353.    }
  354.    if (index >= max_lenth){
  355.  
  356.      /*---------------------------------------------*
  357.       * put a proper terminating '\0' on fully expanded string
  358.       *---------------------------------------------*/
  359.    }
  360.