level.c 962 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*!
  2. \file lib/vector/Vlib/level.c
  3. \brief Vector library - level info
  4. (C) 2001-2009 by the GRASS Development Team
  5. This program is free software under the GNU General Public License
  6. (>=v2). Read the file COPYING that comes with GRASS for details.
  7. \author Original author CERL, probably Dave Gerdes or Mike Higgins.
  8. \author Update to GRASS 5.7 Radim Blazek and David D. Gray.
  9. */
  10. #include <grass/vector.h>
  11. #include <grass/glocale.h>
  12. /*!
  13. \brief Returns level that Map is opened at
  14. - 1: no topology
  15. - 2: topology support
  16. \param Map vector map
  17. \return open level
  18. \return -1 on error
  19. */
  20. int Vect_level(const struct Map_info *Map)
  21. {
  22. if (Map->open != VECT_OPEN_CODE) {
  23. if (Map->open != VECT_CLOSED_CODE)
  24. G_warning("Vect_level(): %s",
  25. _("Map structure was never initialized"));
  26. else
  27. G_warning("Vect_level(): %s", _("Map structure has been closed"));
  28. return (-1);
  29. }
  30. return (Map->level);
  31. }