From 1be6ec30336a318dd50f9d9a45c8066860ec07f2 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 7 Jun 1996 04:36:10 +0000 Subject: Fri Jun 7 1996 05:29:32 Ulrich Drepper * 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 * Make-dist (sysdep_dirs): Skip CVS dirs. --- misc/search.h | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'misc/search.h') 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 -- cgit v1.2.3