X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fgl_oset.c;h=3e6f094bf66d91235e75d88cb1fe4fbe99678115;hb=03f70203768aa8ec39a0a60636174dc02683c82c;hp=bfe1c6d827d76e2794d6dbb4f1b488d37f0b6fb6;hpb=a7e6fe2b890c07cb428be7ff82d1267847a1efdf;p=gnulib.git diff --git a/lib/gl_oset.c b/lib/gl_oset.c index bfe1c6d82..3e6f094bf 100644 --- a/lib/gl_oset.c +++ b/lib/gl_oset.c @@ -1,5 +1,5 @@ /* Abstract ordered set data type. - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006-2007 Free Software Foundation, Inc. Written by Bruno Haible , 2006. This program is free software; you can redistribute it and/or modify @@ -16,9 +16,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifdef HAVE_CONFIG_H -# include -#endif +#include /* Specification. */ #include "gl_oset.h" @@ -31,9 +29,10 @@ gl_oset_t gl_oset_create_empty (gl_oset_implementation_t implementation, - gl_setelement_compar_fn compar_fn) + gl_setelement_compar_fn compar_fn, + gl_setelement_dispose_fn dispose_fn) { - return implementation->create_empty (implementation, compar_fn); + return implementation->create_empty (implementation, compar_fn, dispose_fn); } size_t @@ -48,7 +47,16 @@ gl_oset_search (gl_oset_t set, const void *elt) return ((const struct gl_oset_impl_base *) set)->vtable->search (set, elt); } -void +bool +gl_oset_search_atleast (gl_oset_t set, + gl_setelement_threshold_fn threshold_fn, + const void *threshold, const void **eltp) +{ + return ((const struct gl_oset_impl_base *) set)->vtable + ->search_atleast (set, threshold_fn, threshold, eltp); +} + +bool gl_oset_add (gl_oset_t set, const void *elt) { return ((const struct gl_oset_impl_base *) set)->vtable->add (set, elt);