card.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. *
  8. * PURPOSE: Multidimensional index
  9. *
  10. * COPYRIGHT: (C) 2001 by the GRASS Development Team
  11. *
  12. * This program is free software under the GNU General Public
  13. * License (>=v2). Read the file COPYING that comes with GRASS
  14. * for details.
  15. *****************************************************************************/
  16. #include "index.h"
  17. #include "card.h"
  18. int NODECARD = MAXCARD;
  19. int LEAFCARD = MAXCARD;
  20. static int set_max(int *which, int new_max)
  21. {
  22. if (2 > new_max || new_max > MAXCARD)
  23. return 0;
  24. *which = new_max;
  25. return 1;
  26. }
  27. int RTreeSetNodeMax(int new_max)
  28. {
  29. return set_max(&NODECARD, new_max);
  30. }
  31. int RTreeSetLeafMax(int new_max)
  32. {
  33. return set_max(&LEAFCARD, new_max);
  34. }
  35. int RTreeGetNodeMax(void)
  36. {
  37. return NODECARD;
  38. }
  39. int RTreeGetLeafMax(void)
  40. {
  41. return LEAFCARD;
  42. }