diff options
author | Andrew Shadura <andrew@shadura.me> | 2014-01-28 15:21:50 +0100 |
---|---|---|
committer | Andrew Shadura <andrew@shadura.me> | 2014-01-28 15:21:50 +0100 |
commit | 51addbcf27d7b06dae80a0e39e5f5f83e94dd8ae (patch) | |
tree | 3d00bef2d26f97257ec6f4835505cd300054a1e3 /src/libmowgli/container/index.h | |
parent | 1ed00f1a2893b43195f3fc747988da0bf6006797 (diff) |
Update to libmowgli 2.0.0
Diffstat (limited to 'src/libmowgli/container/index.h')
-rw-r--r-- | src/libmowgli/container/index.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/libmowgli/container/index.h b/src/libmowgli/container/index.h new file mode 100644 index 0000000..85e9e72 --- /dev/null +++ b/src/libmowgli/container/index.h @@ -0,0 +1,51 @@ +/* + * Copyright 2009-2011 John Lindgren + * + * 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 is present in all copies. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __MOWGLI_INDEX_H__ +#define __MOWGLI_INDEX_H__ + +struct mowgli_index_; + +typedef struct mowgli_index_ mowgli_index_t; + +mowgli_index_t * mowgli_index_create (void); +void mowgli_index_destroy (mowgli_index_t * index); +int mowgli_index_count (mowgli_index_t * index); +void mowgli_index_allocate (mowgli_index_t * index, int size); +void mowgli_index_set (mowgli_index_t * index, int at, void * value); +void * mowgli_index_get (mowgli_index_t * index, int at); +void mowgli_index_insert (mowgli_index_t * index, int at, void * value); +void mowgli_index_append (mowgli_index_t * index, void * value); +void mowgli_index_copy_set (mowgli_index_t * source, int from, mowgli_index_t * target, + int to, int count); +void mowgli_index_copy_insert (mowgli_index_t * source, int from, mowgli_index_t * target, + int to, int count); +void mowgli_index_copy_append (mowgli_index_t * source, int from, mowgli_index_t * target, + int count); +void mowgli_index_merge_insert (mowgli_index_t * first, int at, mowgli_index_t * second); +void mowgli_index_merge_append (mowgli_index_t * first, mowgli_index_t * second); +void mowgli_index_move (mowgli_index_t * index, int from, int to, int count); +void mowgli_index_delete (mowgli_index_t * index, int at, int count); +void mowgli_index_sort (mowgli_index_t * index, int (* compare) (const void * a, + const void * b)); +void mowgli_index_sort_with_data (mowgli_index_t * index, int (* compare) + (const void * a, const void * b, void * data), void * data); + +#endif |