treetype.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. /* $Id: treetype.h,v 1.1 2003/11/09 00:38:08 djm Exp $ */
  25. /* Select our tree types for various data structures */
  26. #if defined(FLOW_RB)
  27. #define FLOW_HEAD RB_HEAD
  28. #define FLOW_ENTRY RB_ENTRY
  29. #define FLOW_PROTOTYPE RB_PROTOTYPE
  30. #define FLOW_GENERATE RB_GENERATE
  31. #define FLOW_INSERT RB_INSERT
  32. #define FLOW_FIND RB_FIND
  33. #define FLOW_REMOVE RB_REMOVE
  34. #define FLOW_FOREACH RB_FOREACH
  35. #define FLOW_MIN RB_MIN
  36. #define FLOW_NEXT RB_NEXT
  37. #define FLOW_INIT RB_INIT
  38. #elif defined(FLOW_SPLAY)
  39. #define FLOW_HEAD SPLAY_HEAD
  40. #define FLOW_ENTRY SPLAY_ENTRY
  41. #define FLOW_PROTOTYPE SPLAY_PROTOTYPE
  42. #define FLOW_GENERATE SPLAY_GENERATE
  43. #define FLOW_INSERT SPLAY_INSERT
  44. #define FLOW_FIND SPLAY_FIND
  45. #define FLOW_REMOVE SPLAY_REMOVE
  46. #define FLOW_FOREACH SPLAY_FOREACH
  47. #define FLOW_MIN SPLAY_MIN
  48. #define FLOW_NEXT SPLAY_NEXT
  49. #define FLOW_INIT SPLAY_INIT
  50. #else
  51. #error No flow tree type defined
  52. #endif
  53. #if defined(EXPIRY_RB)
  54. #define EXPIRY_HEAD RB_HEAD
  55. #define EXPIRY_ENTRY RB_ENTRY
  56. #define EXPIRY_PROTOTYPE RB_PROTOTYPE
  57. #define EXPIRY_GENERATE RB_GENERATE
  58. #define EXPIRY_INSERT RB_INSERT
  59. #define EXPIRY_FIND RB_FIND
  60. #define EXPIRY_REMOVE RB_REMOVE
  61. #define EXPIRY_FOREACH RB_FOREACH
  62. #define EXPIRY_MIN RB_MIN
  63. #define EXPIRY_NEXT RB_NEXT
  64. #define EXPIRY_INIT RB_INIT
  65. #elif defined(EXPIRY_SPLAY)
  66. #define EXPIRY_HEAD SPLAY_HEAD
  67. #define EXPIRY_ENTRY SPLAY_ENTRY
  68. #define EXPIRY_PROTOTYPE SPLAY_PROTOTYPE
  69. #define EXPIRY_GENERATE SPLAY_GENERATE
  70. #define EXPIRY_INSERT SPLAY_INSERT
  71. #define EXPIRY_FIND SPLAY_FIND
  72. #define EXPIRY_REMOVE SPLAY_REMOVE
  73. #define EXPIRY_FOREACH SPLAY_FOREACH
  74. #define EXPIRY_MIN SPLAY_MIN
  75. #define EXPIRY_NEXT SPLAY_NEXT
  76. #define EXPIRY_INIT SPLAY_INIT
  77. #else
  78. #error No expiry tree type defined
  79. #endif