From 157942782c6dc06b12bb72068a9ad605d0938ad8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 2 Jul 2021 14:08:51 -0400 Subject: Remove ZixSortedArray --- include/zix/sorted_array.h | 122 --------------------------------------------- 1 file changed, 122 deletions(-) delete mode 100644 include/zix/sorted_array.h (limited to 'include/zix') diff --git a/include/zix/sorted_array.h b/include/zix/sorted_array.h deleted file mode 100644 index 580551e..0000000 --- a/include/zix/sorted_array.h +++ /dev/null @@ -1,122 +0,0 @@ -/* - Copyright 2011-2020 David Robillard - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted, provided that the above - copyright notice and this permission notice appear in all copies. - - THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -*/ - -#ifndef ZIX_SORTED_ARRAY_H -#define ZIX_SORTED_ARRAY_H - -#include "zix/common.h" - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - @addtogroup zix - @{ - @name SortedArray - @{ -*/ - -/// A sorted array -typedef struct ZixSortedArrayImpl ZixSortedArray; - -/// An iterator over a ZixSortedArray -typedef void* ZixSortedArrayIter; - -/// Create a new (empty) sorted array -ZIX_API -ZixSortedArray* -zix_sorted_array_new(bool allow_duplicates, - ZixComparator cmp, - void* cmp_data, - size_t elem_size); - -/// Free `a` -ZIX_API -void -zix_sorted_array_free(ZixSortedArray* a); - -/// Return the number of elements in `a` -ZIX_PURE_API -size_t -zix_sorted_array_size(const ZixSortedArray* a); - -/// Insert the element `e` into `a` and point `ai` at the new element -ZIX_API -ZixStatus -zix_sorted_array_insert(ZixSortedArray* a, - const void* e, - ZixSortedArrayIter* ai); - -/// Remove the item pointed at by `ai` from `a` -ZIX_API -ZixStatus -zix_sorted_array_remove(ZixSortedArray* a, ZixSortedArrayIter ai); - -/** - Set `ai` to be the largest element <= `e` in `a`. - - If no such item exists, `ai` is set to NULL. -*/ -ZIX_API -ZixStatus -zix_sorted_array_find(const ZixSortedArray* a, - const void* e, - ZixSortedArrayIter* ai); - -/// Return the element at index `index` -ZIX_PURE_API -void* -zix_sorted_array_index(const ZixSortedArray* a, size_t index); - -/// Return the data associated with the given array item -ZIX_CONST_API -void* -zix_sorted_array_get_data(ZixSortedArrayIter ai); - -/// Return an iterator to the first (smallest) element in `a` -ZIX_PURE_API -ZixSortedArrayIter -zix_sorted_array_begin(ZixSortedArray* a); - -/// Return an iterator the the element one past the last element in `a` -ZIX_PURE_API -ZixSortedArrayIter -zix_sorted_array_end(ZixSortedArray* a); - -/// Return true iff `a` is an iterator to the end of its tree -ZIX_PURE_API -bool -zix_sorted_array_iter_is_end(ZixSortedArray* a, ZixSortedArrayIter i); - -/// Return an iterator that points to the element one past `a` -ZIX_PURE_API -ZixSortedArrayIter -zix_sorted_array_iter_next(ZixSortedArray* a, ZixSortedArrayIter i); - -/** - @} - @} -*/ - -#ifdef __cplusplus -} /* extern "C" */ -#endif - -#endif /* ZIX_SORTED_ARRAY_H */ -- cgit v1.2.1