util-linux/include
Davidlohr Bueso 5b9df0280a lists: add list sorting routine
We need a list sorting function, just to mention one example user that could
benefit is the lib/tt code to sort columns.

This patch adds list_sort() which uses the Merge Sort algorithm, behaving
nicely in O(nlog(n)), heavily based on the kernel's implementation[1].  The
private data (void *priv) passed to the comparison function as been removed to
adopt a qsort(3)-like syntax, and IMHO we don't really need it anyways.

[1]: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=lib/list_sort.c;h=d7325c6b103f0be078ff3672c35c468ed35738f1;hb=HEAD

[kzak@redhat.com: - use size_t in list_sort()]

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-12-16 12:37:07 +01:00
..
Makefile.am build-sys: add missing headers to dist 2011-12-02 18:21:42 +01:00
at.h lib: [at.c] add readlink_at(), fix semantic for absolute paths 2011-05-18 15:57:16 +02:00
bitops.h include: [bitops.h] make return values consistent 2011-08-02 12:33:10 +02:00
blkdev.h build-sys: check HAVE_ definitions with #ifdef [smatch scan] 2011-12-02 18:21:46 +01:00
c.h lists: add list sorting routine 2011-12-16 12:37:07 +01:00
canonicalize.h mount: and libblkid: covert /dev/dm-N to /dev/mapper/<name> 2009-10-26 13:33:03 +01:00
carefulputc.h Imported from util-linux-2.13-pre1 tarball. 2006-12-07 00:26:54 +01:00
cpuset.h lscpu: use function to search in cpu masks arrays 2011-09-09 23:27:40 +02:00
crc32.h lib: add a generic crc32() 2009-09-16 16:17:41 +02:00
env.h lib: [env] consolidate safe_getenv() usage 2011-01-03 12:28:48 +01:00
exitcodes.h include: move fsck return values to exitcodes.h 2011-07-22 00:34:12 +02:00
fsprobe.h mount: report ambivalent FS detection, improve brute force detection 2010-03-15 13:46:43 +01:00
ismounted.h lib: import whole ismounted.c code from e2fsprogs 2009-10-14 01:13:18 +02:00
linux_reboot.h Imported from util-linux-2.13-pre1 tarball. 2006-12-07 00:26:54 +01:00
linux_version.h lib: add linux_version.{c,h} 2007-11-06 02:40:13 +01:00
list.h lists: add list sorting routine 2011-12-16 12:37:07 +01:00
loopdev.h lib,loopdev: add LOOP_CTL_GET_FREE support 2011-11-07 16:45:11 +01:00
mangle.h libmount: cleanup mangle() usage 2011-01-03 12:28:47 +01:00
match.h lib,match: split match_fstype() from libmount 2011-11-15 15:17:19 +01:00
mbsalign.h cfdisk: support non-ascii characters in input 2010-05-07 14:12:26 +02:00
md5.h build-sys: check HAVE_ definitions with #ifdef [smatch scan] 2011-12-02 18:21:46 +01:00
minix.h minix: add MINIX_ prefix to some global macros 2011-07-21 12:23:01 +02:00
nls.h include: [nls.h] define a macro for handling plurals with ngettext() 2011-08-02 14:13:44 +02:00
optutils.h include,optutils: add option_to_longopt() 2011-11-29 18:21:49 +01:00
pamfail.h chfn, chsh: new file pamfail.h for error printing 2011-11-29 17:57:39 +01:00
path.h chcpu: convert to use lib/path.c 2011-09-27 13:36:54 +02:00
pathnames.h lib,loopdev: add LOOP_CTL_GET_FREE support 2011-11-07 16:45:11 +01:00
procutils.h procutils: include missing header 2011-05-05 14:01:39 +02:00
rpmatch.h include: add fallback for rpmatch() 2011-01-05 16:18:08 +01:00
setproctitle.h lib: cleanup setproctitle.c 2011-10-26 23:17:15 +02:00
strutils.h libmount: ignore tailing slash in netfs source paths 2011-11-08 16:25:01 +01:00
swapheader.h swaplabel: new command 2010-04-02 16:16:59 +02:00
sysfs.h build-sys: fix 'make checkincludes' warnings 2011-07-28 13:21:00 +02:00
tt.h lib,tt: add TT_FL_NOEXTREMES 2011-11-10 12:39:02 +01:00
usleep.h replace usleep() for systems that don't have them 2009-08-21 09:58:17 +02:00
wholedisk.h lib: wholedisk - extend API, add test program 2009-03-12 14:31:50 +01:00
widechar.h build-sys: fix ifdef ENABLE_WIDECHAR usage 2007-01-30 13:49:50 +01:00
writeall.h include: [writeall] add fwrite_all() 2011-08-02 13:53:41 +02:00
xalloc.h include,xalloc: fix whitespace to be consistent 2011-09-30 00:24:16 +02:00