error.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*!
  2. \file error.c
  3. \brief Vector library - error management
  4. Higher level functions for reading/writing/manipulating vectors.
  5. (C) 2001-2008 by the GRASS Development Team
  6. This program is free software under the
  7. GNU General Public License (>=v2).
  8. Read the file COPYING that comes with GRASS
  9. for details.
  10. \author Original author CERL, probably Dave Gerdes or Mike Higgins.
  11. Update to GRASS 5.7 Radim Blazek and David D. Gray.
  12. \date 2001-2008
  13. */
  14. #include <string.h>
  15. #include <grass/gis.h>
  16. #include <grass/Vect.h>
  17. static int fatal_err = GV_FATAL_EXIT;
  18. /*!
  19. \brief Set behaviour if fatal error occurs in some functions
  20. - GV_FATAL_EXIT(default): print error message and exit,
  21. - GV_FATAL_PRINT: print error message and return error,
  22. - GV_FATAL_RETURN: return error
  23. \param err error type
  24. \return 0 on success
  25. */
  26. int Vect_set_fatal_error(int err)
  27. {
  28. fatal_err = err;
  29. return 0;
  30. }
  31. /*!
  32. \brief Get behaviour for fatal error
  33. \param
  34. \return GV_FATAL_EXIT(default): print error message and exit,
  35. \return GV_FATAL_PRINT: print error message and return error,
  36. \return GV_FATAL_RETURN: return error
  37. */
  38. int Vect_get_fatal_error(void)
  39. {
  40. return (fatal_err);
  41. }