diff options
author | Brad Hards <bradh@frogmouth.net> | 2005-08-28 09:43:18 +0000 |
---|---|---|
committer | Brad Hards <bradh@frogmouth.net> | 2005-08-28 09:43:18 +0000 |
commit | 244e5c1f8f65da41ba6314028766dfe5973f6132 (patch) | |
tree | 95d6fcce2427b9b30d323ec921f3b906d3a4886d /goo/GooList.cc | |
parent | eb91b274245b4f5f5389bc9ddfde2c2806557665 (diff) |
Merge the Goo* improvements from xpdf 3.0.1. This change is based on
martink's work (7-xpdf-3.01-goo-improvements.patch), with some tweaking
by me.
Diffstat (limited to 'goo/GooList.cc')
-rw-r--r-- | goo/GooList.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/goo/GooList.cc b/goo/GooList.cc index 3719ae2b..dc6e4e21 100644 --- a/goo/GooList.cc +++ b/goo/GooList.cc @@ -12,6 +12,7 @@ #pragma implementation #endif +#include <stdlib.h> #include <string.h> #include "gmem.h" #include "GooList.h" @@ -81,6 +82,10 @@ void *GooList::del(int i) { return p; } +void GooList::sort(int (*cmp)(const void *obj1, const void *obj2)) { + qsort(data, length, sizeof(void *), cmp); +} + void GooList::expand() { size += (inc > 0) ? inc : size; data = (void **)greallocn(data, size, sizeof(void*)); |