BCountAVL.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /**
  2. * @file BCountAVL.h
  3. * @author Ambroz Bizjak <ambrop7@gmail.com>
  4. *
  5. * @section LICENSE
  6. *
  7. * Redistribution and use in source and binary forms, with or without
  8. * modification, are permitted provided that the following conditions are met:
  9. * 1. Redistributions of source code must retain the above copyright
  10. * notice, this list of conditions and the following disclaimer.
  11. * 2. Redistributions in binary form must reproduce the above copyright
  12. * notice, this list of conditions and the following disclaimer in the
  13. * documentation and/or other materials provided with the distribution.
  14. * 3. Neither the name of the author nor the
  15. * names of its contributors may be used to endorse or promote products
  16. * derived from this software without specific prior written permission.
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  19. * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  20. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  21. * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  22. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  23. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  24. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  25. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  26. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  27. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28. */
  29. #ifndef BADVPN_BCOUNTAVL_H
  30. #define BADVPN_BCOUNTAVL_H
  31. #ifdef BADVPN_STRUCTURE_BAVL_H
  32. #define BADVPN_STRUCTURE_BAVL_H_SAVED BADVPN_STRUCTURE_BAVL_H
  33. #undef BADVPN_STRUCTURE_BAVL_H
  34. #endif
  35. #define BAVL_COUNT
  36. #define BAVL_comparator BCountAVL_comparator
  37. #define BAVL BCountAVL
  38. #define BAVLNode BCountAVLNode
  39. #define BAVL_Init BCountAVL_Init
  40. #define BAVL_Insert BCountAVL_Insert
  41. #define BAVL_Remove BCountAVL_Remove
  42. #define BAVL_IsEmpty BCountAVL_IsEmpty
  43. #define BAVL_Lookup BCountAVL_Lookup
  44. #define BAVL_LookupExact BCountAVL_LookupExact
  45. #define BAVL_GetFirst BCountAVL_GetFirst
  46. #define BAVL_GetLast BCountAVL_GetLast
  47. #define BAVL_GetNext BCountAVL_GetNext
  48. #define BAVL_GetPrev BCountAVL_GetPrev
  49. #define BAVL_Count BCountAVL_Count
  50. #define BAVL_IndexOf BCountAVL_IndexOf
  51. #define BAVL_GetAt BCountAVL_GetAt
  52. #define _BAVL_node_value _BCountAVL_node_value
  53. #define _BAVL_compare_values _BCountAVL_compare_values
  54. #define _BAVL_compare_nodes _BCountAVL_compare_nodes
  55. #define _BAVL_assert_recurser _BCountAVL_assert_recurser
  56. #define _BAVL_assert _BCountAVL_assert
  57. #define _BAVL_update_count_from_children _BCountAVL_update_count_from_children
  58. #define _BAVL_rotate _BCountAVL_rotate
  59. #define _BAVL_subtree_max _BCountAVL_subtree_max
  60. #define _BAVL_replace_subtree _BCountAVL_replace_subtree
  61. #define _BAVL_swap_nodes _BCountAVL_swap_nodes
  62. #define _BAVL_rebalance _BCountAVL_rebalance
  63. #include "BAVL.h"
  64. #undef BAVL_comparator
  65. #undef BAVL
  66. #undef BAVLNode
  67. #undef BAVL_Init
  68. #undef BAVL_Insert
  69. #undef BAVL_Remove
  70. #undef BAVL_IsEmpty
  71. #undef BAVL_Lookup
  72. #undef BAVL_LookupExact
  73. #undef BAVL_GetFirst
  74. #undef BAVL_GetLast
  75. #undef BAVL_GetNext
  76. #undef BAVL_GetPrev
  77. #undef BAVL_Count
  78. #undef BAVL_IndexOf
  79. #undef BAVL_GetAt
  80. #undef _BAVL_node_value
  81. #undef _BAVL_compare_values
  82. #undef _BAVL_compare_nodes
  83. #undef _BAVL_assert_recurser
  84. #undef _BAVL_assert
  85. #undef _BAVL_update_count_from_children
  86. #undef _BAVL_rotate
  87. #undef _BAVL_subtree_max
  88. #undef _BAVL_replace_subtree
  89. #undef _BAVL_swap_nodes
  90. #undef _BAVL_rebalance
  91. #undef BAVL_COUNT
  92. #undef BADVPN_STRUCTURE_BAVL_H
  93. #ifdef BADVPN_STRUCTURE_BAVL_H_SAVED
  94. #define BADVPN_STRUCTURE_BAVL_H BADVPN_STRUCTURE_BAVL_H_SAVED
  95. #undef BADVPN_STRUCTURE_BAVL_H_SAVED
  96. #endif
  97. #endif