about summary refs log tree commit diff
path: root/misc/search.h
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-06-07 04:36:10 +0000
committerRoland McGrath <roland@gnu.org>1996-06-07 04:36:10 +0000
commit1be6ec30336a318dd50f9d9a45c8066860ec07f2 (patch)
tree8399c167a53cfe3ab9cdf27018730dda3c6a4d1b /misc/search.h
parentc035afc9605510b5437515b71e0603c12463c2e9 (diff)
downloadglibc-1be6ec30336a318dd50f9d9a45c8066860ec07f2.tar.gz
glibc-1be6ec30336a318dd50f9d9a45c8066860ec07f2.tar.xz
glibc-1be6ec30336a318dd50f9d9a45c8066860ec07f2.zip
Fri Jun 7 1996 05:29:32 Ulrich Drepper <drepper@cygnus.com> cvs/libc-960607
	* misc/lsearch.c: New file.  Implementation of lfind and
	lsearch functions.

	* misc/search.h: Add prototype for functions from tsearch
	family with __ prefix.
	Correct prototype for lsearch: BASE parameter must not be
	const.

	* misc/tsearch.c: prepend all global function names with __
	and make normal names weak aliases.

Fri Jun  7 00:15:24 1996  Roland McGrath  <roland@delasyd.gnu.ai.mit.edu>

	* Make-dist (sysdep_dirs): Skip CVS dirs.
Diffstat (limited to 'misc/search.h')
-rw-r--r--misc/search.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/misc/search.h b/misc/search.h
index 31c4f03a1f..5e237a2791 100644
--- a/misc/search.h
+++ b/misc/search.h
@@ -1,5 +1,5 @@
 /* search.h -- declarations for System V style searching functions.
-Copyright (C) 1995 Free Software Foundation, Inc.
+Copyright (C) 1995, 1996 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -106,12 +106,18 @@ VISIT;
 
 extern void *tsearch __P ((__const void * __key, void **__rootp,
 			   __compar_fn_t compar));
+extern void *__tsearch __P ((__const void * __key, void **__rootp,
+			     __compar_fn_t compar));
 
 extern void *tfind __P ((__const void * __key, __const void ** __rootp,
 			 __compar_fn_t compar));
+extern void *__tfind __P ((__const void * __key, __const void ** __rootp,
+			   __compar_fn_t compar));
 
 extern void *tdelete __P ((__const void * __key, void ** __rootp,
 			   __compar_fn_t compar));
+extern void *__tdelete __P ((__const void * __key, void ** __rootp,
+			     __compar_fn_t compar));
 
 #ifndef __ACTION_FN_T
 #define __ACTION_FN_T
@@ -122,14 +128,19 @@ typedef void (*__action_fn_t) __P ((__const void *__nodep,
 
 extern void twalk __P ((__const void * __root, __action_fn_t action));
 
+extern void __twalk __P ((__const void * __root, __action_fn_t action));
+
 
-extern void * lfind __P ((__const void * __key, __const void * __base,
-			  size_t * __nmemb, size_t __size,
+/* Perform linear search for KEY by comparing by COMPAR in an array
+   [BASE,BASE+NMEMB*SIZE).  */
+extern void * lfind __P ((__const void *__key, __const void *__base,
+			  size_t *__nmemb, size_t __size,
 			  __compar_fn_t __compar));
 
-extern void * lsearch __P ((__const void * __key, __const void * __base,
-			    size_t * __nmemb, size_t __size,
-			    __compar_fn_t __compar));
+/* Perform linear search for KEY by comparing by COMPAR function in
+   array [BASE,BASE+NMEMB*SIZE) and insert entry if not found.  */
+extern void * lsearch __P ((__const void *__key, void *__base, size_t *__nmemb,
+			    size_t __size, __compar_fn_t __compar));
 
 __END_DECLS