home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / rcs567s.zip / diff16 / proto.h < prev    next >
C/C++ Source or Header  |  1992-01-04  |  6KB  |  123 lines

  1. /* ANALYZE.C */
  2. static int diag ( int xoff , int xlim , int yoff , int ylim , int *cost );
  3. static void compareseq ( int xoff , int xlim , int yoff , int ylim );
  4. void discard_confusing_lines ( struct file_data filevec []);
  5. static void shift_boundaries ( struct file_data filevec []);
  6. static struct change *add_change ( int line0 , int line1 , int deleted , int inserted , struct change *old );
  7. static struct change *build_reverse_script ( struct file_data filevec []);
  8. static struct change *build_script ( struct file_data filevec []);
  9. int diff_2_files ( struct file_data filevec [], int depth );
  10.  
  11. /* CONTEXT.C */
  12. static void print_context_label ( const char *mark , struct file_data *inf , const char *label );
  13. void dosname ( char *ptr );
  14. void print_context_header ( struct file_data *inf , int unidiff_flag );
  15. void print_context_script ( struct change *script , int unidiff_flag );
  16. static void print_context_number_range ( struct file_data *file , int a , int b );
  17. static void pr_context_hunk ( struct change *hunk );
  18. static void print_unidiff_number_range ( struct file_data *file , int a , int b );
  19. static void pr_unidiff_hunk ( struct change *hunk );
  20. static struct change *find_hunk ( struct change *start );
  21. static void mark_ignorable ( struct change *script );
  22. static void find_function ( struct file_data *file , int linenum , char **linep , int *lenp );
  23.  
  24. /* DIFF.C */
  25. static char *option_list ( char **optionvec , int count );
  26. int main ( int argc , char *argv []);
  27. int usage ( void );
  28. int usage ( void );
  29. int specify_style ( enum output_style style );
  30. int compare_files ( char *dir0 , char *name0 , char *dir1 , char *name1 , int depth );
  31.  
  32. /* DIR.C */
  33. static struct dirdata dir_sort ( char *dirname , int nonex );
  34. /* if using borlandc, do not define prototype for compare_names used */
  35. /* in qsort call in dir.c, else the compiler will belch */
  36. #ifndef __BORLANDC__
  37. static int compare_names ( char **file1 , char **file2 );
  38. #endif
  39. int diff_dirs ( char *name1 , char *name2 ,
  40.                 int (*handle_file )( char *dir0 , char *name0 ,
  41.                                      char *dir1 , char *name1 , int depth ) ,
  42.                 int depth , int nonex1 , int nonex2 );
  43.  
  44. /* ED.C */
  45. void print_ed_script ( struct change *script );
  46. static void print_ed_hunk ( struct change *hunk );
  47. void pr_forward_ed_script ( struct change *script );
  48. static void pr_forward_ed_hunk ( struct change *hunk );
  49. void print_rcs_script ( struct change *script );
  50. static void print_rcs_hunk ( struct change *hunk );
  51.  
  52. /* GETOPT.C */
  53. static void exchange ( char **argv );
  54. int getopt ( int argc , char **argv , const char *optstring );
  55.  
  56. /* GETOPT1.C */
  57. int getopt_long ( int argc , char **argv , const char *options , const struct option *long_options , int *opt_index );
  58. int getopt_long_only ( int argc , char **argv , const char *options , const struct option *long_options , int *opt_index );
  59.  
  60. /* IFDEF.C */
  61. void print_ifdef_script ( struct change *script );
  62. static void print_ifdef_hunk ( struct change *hunk );
  63.  
  64. /* IO.C */
  65. static int binary_file_p ( char *buf , int size );
  66. static int slurp ( void );
  67. void find_and_hash_each_line ( void );
  68. static void find_identical_ends ( struct file_data filevec []);
  69. static int find_equiv_class ( int n );
  70. int read_files ( struct file_data filevec []);
  71.  
  72. /* MKTEMP.C */
  73. void Mktemp ( char *file );
  74.  
  75. /* NORMAL.C */
  76. void print_normal_script ( struct change *script );
  77. void print_normal_hunk ( struct change *hunk );
  78.  
  79. /* PIPE.C */
  80. static FILE *dos_popen ( char *command , char *mode );
  81. static int dos_pclose ( FILE *current );
  82. FILE *popen ( char *cmd , char *mode );
  83. int pclose ( FILE *ptr );
  84.  
  85. /* REGEX.C */
  86. static void init_syntax_once ( void );
  87. int re_set_syntax ( int syntax );
  88. static void store_jump ( char *from , char opcode , char *to );
  89. static void insert_jump ( char op , char *from , char *to , char *current_end );
  90. char *re_compile_pattern ( char *pattern , int size , struct re_pattern_buffer *bufp );
  91. void re_compile_fastmap ( struct re_pattern_buffer *bufp );
  92. int re_search ( struct re_pattern_buffer *pbufp , char *string , int size , int startpos , int range , struct re_registers *regs );
  93. int re_search_2 ( struct re_pattern_buffer *pbufp , char *string1 , int size1 , char *string2 , int size2 , int startpos , int range , struct re_registers *regs , int mstop );
  94. int re_match ( struct re_pattern_buffer *pbufp , char *string , int size , int pos , struct re_registers *regs );
  95. int re_match_2 ( struct re_pattern_buffer *pbufp , char *string1_arg , int size1 , char *string2_arg , int size2 , int pos , struct re_registers *regs , int mstop );
  96. static int bcmp_translate ( unsigned char *s1 , unsigned char *s2 , int len , unsigned char *translate );
  97. char *re_comp ( char *s );
  98. int re_exec ( char *s );
  99.  
  100. /* UTIL.C */
  101. void perror_with_name ( char *text );
  102. void pfatal_with_name ( char *text );
  103. /* void error ( char *format , ... ); */
  104. void fatal ( char *message );
  105. /* void message ( char *format , ... ); */
  106. void print_message_queue ( void );
  107. void setup_output ( char *name0 , char *name1 , int depth );
  108. void finish_output ( void );
  109. int line_cmp ( struct line_def *s1 , struct line_def *s2 );
  110. struct change *find_change ( struct change *start );
  111. struct change *find_reverse_change ( struct change *start );
  112. void print_script ( struct change *script , struct change *(*hunkfun )(), void (*printfun )());
  113. void print_1_line ( char *line_flag , struct line_def *line );
  114. int change_letter ( int inserts , int deletes );
  115. int translate_line_number ( struct file_data *file , int lnum );
  116. void translate_range ( struct file_data *file , int a , int b , int *aptr , int *bptr );
  117. void print_number_range ( char sepchar , struct file_data *file , int a , int b );
  118. void analyze_hunk ( struct change *hunk , int *first0 , int *last0 , int *first1 , int *last1 , int *deletes , int *inserts );
  119. VOID *xmalloc ( unsigned size );
  120. VOID *xrealloc ( VOID *old , unsigned int size );
  121. char *concat ( char *s1 , char *s2 , char *s3 );
  122. int debug_script ( struct change *sp );
  123.