sim.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* This file is part of the software similarity tester SIM.
  2. Written by Dick Grune, Vrije Universiteit, Amsterdam.
  3. $Id: sim.h,v 2.7 2005/02/20 17:03:03 dick Exp $
  4. */
  5. #include <stdio.h>
  6. struct position {
  7. /* position of first and last token of a chunk */
  8. struct position *ps_next;
  9. int ps_type; /* first = 0, last = 1 */
  10. unsigned int ps_tk_cnt; /* in tokens; set by add_run() in Pass 1 */
  11. unsigned int ps_nl_cnt; /* same, in line numbers; set by Pass2(),
  12. used by Pass3() to report line numbers
  13. */
  14. };
  15. struct text {
  16. char *tx_fname; /* the file name */
  17. struct position *tx_pos;/* list of positions in this file that are
  18. part of a chunk; sorted and updated by
  19. Pass 2
  20. */
  21. unsigned int tx_start; /* positions in TokenArray[] for the text */
  22. unsigned int tx_limit;
  23. unsigned int tx_nl_start;/* possibly newline pointer for pass2 */
  24. unsigned int tx_nl_limit;
  25. };
  26. extern unsigned int MinRunSize;
  27. extern int PageWidth;
  28. extern FILE *OutputFile;
  29. extern FILE *DebugFile;
  30. extern struct text *Text; /* Text[], one for each input file */
  31. extern int NumberOfTexts; /* number of text records */
  32. extern int NumberOfNewTexts; /* number of new text records */
  33. extern char *progname; /* for error reporting */