treetype.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * Copyright 2002 Damien Miller <djm@mindrot.org> All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. * 1. Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * 2. Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. *
  13. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  14. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  15. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  16. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  17. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  18. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  19. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  20. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  21. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  22. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  23. */
  24. /* Select our tree types for various data structures */
  25. #if defined(FLOW_RB)
  26. #define FLOW_HEAD RB_HEAD
  27. #define FLOW_ENTRY RB_ENTRY
  28. #define FLOW_PROTOTYPE RB_PROTOTYPE
  29. #define FLOW_GENERATE RB_GENERATE
  30. #define FLOW_INSERT RB_INSERT
  31. #define FLOW_FIND RB_FIND
  32. #define FLOW_REMOVE RB_REMOVE
  33. #define FLOW_FOREACH RB_FOREACH
  34. #define FLOW_MIN RB_MIN
  35. #define FLOW_NEXT RB_NEXT
  36. #define FLOW_INIT RB_INIT
  37. #elif defined(FLOW_SPLAY)
  38. #define FLOW_HEAD SPLAY_HEAD
  39. #define FLOW_ENTRY SPLAY_ENTRY
  40. #define FLOW_PROTOTYPE SPLAY_PROTOTYPE
  41. #define FLOW_GENERATE SPLAY_GENERATE
  42. #define FLOW_INSERT SPLAY_INSERT
  43. #define FLOW_FIND SPLAY_FIND
  44. #define FLOW_REMOVE SPLAY_REMOVE
  45. #define FLOW_FOREACH SPLAY_FOREACH
  46. #define FLOW_MIN SPLAY_MIN
  47. #define FLOW_NEXT SPLAY_NEXT
  48. #define FLOW_INIT SPLAY_INIT
  49. #else
  50. #error No flow tree type defined
  51. #endif
  52. #if defined(EXPIRY_RB)
  53. #define EXPIRY_HEAD RB_HEAD
  54. #define EXPIRY_ENTRY RB_ENTRY
  55. #define EXPIRY_PROTOTYPE RB_PROTOTYPE
  56. #define EXPIRY_GENERATE RB_GENERATE
  57. #define EXPIRY_INSERT RB_INSERT
  58. #define EXPIRY_FIND RB_FIND
  59. #define EXPIRY_REMOVE RB_REMOVE
  60. #define EXPIRY_FOREACH RB_FOREACH
  61. #define EXPIRY_MIN RB_MIN
  62. #define EXPIRY_NEXT RB_NEXT
  63. #define EXPIRY_INIT RB_INIT
  64. #elif defined(EXPIRY_SPLAY)
  65. #define EXPIRY_HEAD SPLAY_HEAD
  66. #define EXPIRY_ENTRY SPLAY_ENTRY
  67. #define EXPIRY_PROTOTYPE SPLAY_PROTOTYPE
  68. #define EXPIRY_GENERATE SPLAY_GENERATE
  69. #define EXPIRY_INSERT SPLAY_INSERT
  70. #define EXPIRY_FIND SPLAY_FIND
  71. #define EXPIRY_REMOVE SPLAY_REMOVE
  72. #define EXPIRY_FOREACH SPLAY_FOREACH
  73. #define EXPIRY_MIN SPLAY_MIN
  74. #define EXPIRY_NEXT SPLAY_NEXT
  75. #define EXPIRY_INIT SPLAY_INIT
  76. #else
  77. #error No expiry tree type defined
  78. #endif