]> mj.ucw.cz Git - libucw.git/blobdiff - lib/heap.h
Added REV_COMPARE(x,y) which is equivalent to COMPARE(y,x), but it's
[libucw.git] / lib / heap.h
index 7be54cfa54665ee1808c00c0fb8ce9e2b78a661a..8404858e6a516d9f318e340c7b324012d7003545 100644 (file)
@@ -2,6 +2,9 @@
  *     Sherlock Library -- Universal Heap Macros
  *
  *     (c) 2001 Martin Mares <mj@ucw.cz>
+ *
+ *     This software may be freely distributed and used according to the terms
+ *     of the GNU Lesser General Public License.
  */
 
 #define HEAP_BUBBLE_DOWN_J(heap,num,less,swap)                                         \
@@ -79,3 +82,6 @@
     else                                                                               \
       HEAP_BUBBLE_DOWN_J(heap,num,less,swap);                                          \
   } while(0)
+
+/* Default swapping macro */
+#define HEAP_SWAP(heap,a,b,t) (t=heap[a], heap[a]=heap[b], heap[b]=t)