summaryrefslogtreecommitdiff
path: root/libc/stdlib/bsearch.c
diff options
context:
space:
mode:
authorManuel Novoa III <mjn3@codepoet.org>2002-06-18 08:54:53 +0000
committerManuel Novoa III <mjn3@codepoet.org>2002-06-18 08:54:53 +0000
commit3bc8ac7796cf6f3ab67316e6df5aa8915a6bb03e (patch)
tree1fc185f8d9c862e3f94c5acfad837f339ee301c6 /libc/stdlib/bsearch.c
parent5b0c2c6d870cc9f9f2eae32f4d71abc6f9348e20 (diff)
Remove obsolete files.
Diffstat (limited to 'libc/stdlib/bsearch.c')
-rw-r--r--libc/stdlib/bsearch.c39
1 files changed, 0 insertions, 39 deletions
diff --git a/libc/stdlib/bsearch.c b/libc/stdlib/bsearch.c
deleted file mode 100644
index 6f3817b60..000000000
--- a/libc/stdlib/bsearch.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * This file originally lifted in toto from 'Dlibs' on the atari ST (RdeBath)
- *
- *
- * Dale Schumacher 399 Beacon Ave.
- * (alias: Dalnefre') St. Paul, MN 55104
- * dal@syntel.UUCP United States of America
- * "It's not reality that's important, but how you perceive things."
- *
- * Reworked by Erik Andersen <andersen@uclibc.org>
- */
-#include <stdio.h>
-
-void * bsearch (const void *key, const void *base, size_t num, size_t size,
- int (*cmp) (const void *, const void *))
-{
- int dir;
- size_t a, b, c;
- const void *p;
-
- a = 0;
- b = num;
- while (a < b)
- {
- c = (a + b) >> 1; /* == ((a + b) / 2) */
- p = (void *)(((const char *) base) + (c * size));
- dir = (*cmp)(key, p);
- if (dir < 0) {
- b = c;
- } else if (dir > 0) {
- a = c + 1;
- } else {
- return (void *)p;
- }
- }
-
- return NULL;
-}
-