⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 r2read.c

📁 这是一个C程序分析工具
💻 C
字号:
/*====================================================================*/
/*  UNIT   :  @(#)r2read.c	2.3  -  08/04/99 */
/*====================================================================*/
/*  PURPOSE:  Reads r2anl.lst and extracts the type of analysis,      */
/*            the probability threshold, and the annotation symbol.   */
/*            Deterministic is treated as a probabilistic method of   */
/*            1.0 (100%).  The function also builds a link list of    */
/*            the test files (with their functionality status) to     */
/*            annotate.                                               */
/*                                                                    */
/*  SYSTEM :  RECON II                                                */
/*                                                                    */
/*  USED BY:  main()                                                  */
/*                                                                    */
/*  HISTORY:                                                          */
/*  VER   DATE       AUTHOR        DESCRIPTION                        */
/*  1.00  23 Feb 93  L. Richard    Created unit.                      */
/*  1.01  10 Mar 93  L. Richard    Implemented GTALK.                 */
/*  1.02  22 Jun 93  L. Richard    Added defines for Ops System.      */
/*         7 Nov 93  N. Wilde      Computes casesWith and casesTot    */
/*        24 Nov 96  L. Landry     Command Line Switch input          */
/*  2.2   31 Jan 98  W. Hall       Modified to reflect changes in the */
/*                                 way command line parameters are    */
/*                                 obtained. Variable anl_dir deleted */
/*                                 because was no longer needed.      */
/*                                 Unused variable r2dir deleted.     */
/*--------------------------------------------------------------------*/


/*==[ INTERFACE ]=====================================================*/


#include "r2.h" 
#include "r2read.h"
#include <stdio.h>

/*==[ PRIVATE IMPLEMENTATION ]========================================*/


#include <string.h>
#include "r2util.h"


/*==[ PUBLIC IMPLEMENTATION ]=========================================*/


/*--------------------------------------------------------------------*/
/*  FUNCTION        ReadTestData                                      */
/*--------------------------------------------------------------------*/


extern BOOL ReadTestData(
  char          *type,                  /* Method flag                */
  int           *thresh,                /* Probabilistic threshold    */
  STRING        *symb,                  /* Annotation symbol          */
  TESTLIST      *tl,                    /* Test case list             */
  int           *casesWith,             /* Count of test cases that   */
                                        /*  exhibit the feature       */
  int           *casesTot,              /* Count total number of cases*/
  clinput       *CLInput              /* Command line input structure */
  )
{
  BOOL          error;                  /* Error flag                 */
  FILE          *r2FILE;                /* File pointer for r2anl.lst */
  STRING        fname[ MAXPATH ];       /* Input test file name       */
  TESTNODE      node;                   /* Test node                  */
  int           error_count;            /* Loop read Error counter    */
  

  /* Assume success */


  error = FALSE;

if (NULL == (r2FILE  = fopen( CLInput->analfile, "r" )))
    AbortMsg( "Could not open analysis file \n");

if (2 == gTALK)
    printf( "R2Analyz: Input analysis file = %s\n", CLInput->analfile);


  /* Read fixed parameters */


  fscanf( r2FILE, "%c", type);
  fscanf( r2FILE, "%s", symb);
  fscanf( r2FILE, "%d", thresh);
  if ('D' == *type)
    *thresh = 100;


  /* Build Test Record List */
  *casesWith = 0;
  *casesTot = 0;
  error_count = 0;
  while (EOF != fscanf( r2FILE, "%s", fname ))
  {
   if (strlen(fname) > MAXLENGTH)
       {
       error_count += 1;
       break;
       }
    /* Add test filename and functionality to list */
    strcpy( node.Output, fname );
    fscanf( r2FILE, "%s", fname );
    node.Exhibits = ('Y' == fname[0]);
    if (node.Exhibits) (*casesWith)++;
    AddTestNode( tl, &node );
    (*casesTot)++;
  }
  if (error_count > 0)
     {
     printf("Test file destination and file names cannot exceed %d characters. \n",MAXLENGTH);
     printf("\nERROR Reading input analysis file %s:\n",CLInput->analfile);
     printf("Program terminating.\n");
     exit(1);
     }
 
  if (2 == gTALK)
    ShowTestList( tl );


  return( error );


} /* ReadTestData() */


/*====================================================================*/
/*  EOF    :  r2read.c                                                */
/*====================================================================*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -