card.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /****************************************************************************
  2. * MODULE: R-Tree library
  3. *
  4. * AUTHOR(S): Antonin Guttman - original code
  5. * Daniel Green (green@superliminal.com) - major clean-up
  6. * and implementation of bounding spheres
  7. * Markus Metz - file-based and memory-based R*-tree
  8. *
  9. * PURPOSE: Multidimensional index
  10. *
  11. * COPYRIGHT: (C) 2010 by the GRASS Development Team
  12. *
  13. * This program is free software under the GNU General Public
  14. * License (>=v2). Read the file COPYING that comes with GRASS
  15. * for details.
  16. *****************************************************************************/
  17. #include "index.h"
  18. #include "card.h"
  19. static int set_max(int *which, int new_max)
  20. {
  21. if (2 > new_max || new_max > MAXCARD)
  22. return 0;
  23. *which = new_max;
  24. return 1;
  25. }
  26. int RTreeSetNodeMax(int new_max, struct RTree *t)
  27. {
  28. return set_max(&(t->nodecard), new_max);
  29. }
  30. int RTreeSetLeafMax(int new_max, struct RTree *t)
  31. {
  32. return set_max(&(t->leafcard), new_max);
  33. }
  34. int RTreeGetNodeMax(struct RTree *t)
  35. {
  36. return t->nodecard;
  37. }
  38. int RTreeGetLeafMax(struct RTree *t)
  39. {
  40. return t->leafcard;
  41. }