summaryrefslogtreecommitdiff
path: root/gl/lib/heap.c
diff options
context:
space:
mode:
authorPaul R. Eggert <eggert@cs.ucla.edu>2010-07-25 21:18:14 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2010-07-25 21:18:35 -0700
commit074566823ec313ad350e658c6765349d2ceef881 (patch)
tree687100bd9149c7939ce829c98d9b57a604b0548f /gl/lib/heap.c
parentde949fc12dffef87e381a821c18887e4efdd1b00 (diff)
downloadcoreutils-074566823ec313ad350e658c6765349d2ceef881.tar.xz
sort: make struct heap private
* gl/lib/heap.c (struct heap): Move this here... * gl/lib/heap.h (struct heap): ... from here, as outside code no longer needs to access any of these members.
Diffstat (limited to 'gl/lib/heap.c')
-rw-r--r--gl/lib/heap.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gl/lib/heap.c b/gl/lib/heap.c
index baf9a270c..80ea70e59 100644
--- a/gl/lib/heap.c
+++ b/gl/lib/heap.c
@@ -30,6 +30,13 @@ static size_t heapify_down (void **, size_t, size_t,
static void heapify_up (void **, size_t,
int (*) (void const *, void const *));
+struct heap
+{
+ void **array; /* array[0] is not used */
+ size_t capacity; /* Array size */
+ size_t count; /* Used as index to last element. Also is num of items. */
+ int (*compare) (void const *, void const *);
+};
/* Allocate memory for the heap. */