card.c 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 - R*-tree
  8. *
  9. * PURPOSE: Multidimensional index
  10. *
  11. * COPYRIGHT: (C) 2009 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. int NODECARD = MAXCARD;
  20. int LEAFCARD = MAXCARD;
  21. static int set_max(int *which, int new_max)
  22. {
  23. if (2 > new_max || new_max > MAXCARD)
  24. return 0;
  25. *which = new_max;
  26. return 1;
  27. }
  28. int RTreeSetNodeMax(int new_max, struct RTree *t)
  29. {
  30. return set_max(&(t->nodecard), new_max);
  31. }
  32. int RTreeSetLeafMax(int new_max, struct RTree *t)
  33. {
  34. return set_max(&(t->leafcard), new_max);
  35. }
  36. int RTreeGetNodeMax(struct RTree *t)
  37. {
  38. return t->nodecard;
  39. }
  40. int RTreeGetLeafMax(struct RTree *t)
  41. {
  42. return t->leafcard;
  43. }