error.c 1.2 KB

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