/contrib/cvs/diff/diffrun.h

https://bitbucket.org/freebsd/freebsd-head/ · C++ Header · 69 lines · 21 code · 12 blank · 36 comment · 1 complexity · aec4b38b22094d356f34282402ec8394 MD5 · raw file

  1. /* Interface header file for GNU DIFF library.
  2. Copyright (C) 1998 Free Software Foundation, Inc.
  3. This file is part of GNU DIFF.
  4. GNU DIFF is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.
  8. GNU DIFF is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. */
  13. #ifndef DIFFRUN_H
  14. #define DIFFRUN_H
  15. /* This header file defines the interfaces used by the diff library.
  16. It should be included by programs which use the diff library. */
  17. #include <sys/types.h>
  18. #if defined __STDC__ && __STDC__
  19. #define DIFFPARAMS(args) args
  20. #else
  21. #define DIFFPARAMS(args) ()
  22. #endif
  23. /* The diff_callbacks structure is used to handle callbacks from the
  24. diff library. All output goes through these callbacks. When a
  25. pointer to this structure is passed in, it may be NULL. Also, any
  26. of the individual callbacks may be NULL. This means that the
  27. default action should be taken. */
  28. struct diff_callbacks
  29. {
  30. /* Write output. This function just writes a string of a given
  31. length to the output file. The default is to fwrite to OUTFILE.
  32. If this callback is defined, flush_output must also be defined.
  33. If the length is zero, output zero bytes. */
  34. void (*write_output) DIFFPARAMS((char const *, size_t));
  35. /* Flush output. The default is to fflush OUTFILE. If this
  36. callback is defined, write_output must also be defined. */
  37. void (*flush_output) DIFFPARAMS((void));
  38. /* Write a '\0'-terminated string to stdout.
  39. This is called for version and help messages. */
  40. void (*write_stdout) DIFFPARAMS((char const *));
  41. /* Print an error message. The first argument is a printf format,
  42. and the next two are parameters. The default is to print a
  43. message on stderr. */
  44. void (*error) DIFFPARAMS((char const *, char const *, char const *));
  45. };
  46. /* Run a diff. */
  47. extern int diff_run DIFFPARAMS((int, char **, const char *,
  48. const struct diff_callbacks *));
  49. /* Run a diff3. */
  50. extern int diff3_run DIFFPARAMS((int, char **, char *,
  51. const struct diff_callbacks *));
  52. #undef DIFFPARAMS
  53. #endif /* DIFFRUN_H */