name mode size
.bootstrap 040000
bin 040000
dox 040000
mulle-container.xcodeproj 040000
mulle_allocator_test 040000
src 040000
templates 040000
tests 040000
.first_patch 100644 0 kb
.gitignore 100644 1 kb
.travis.yml 100644 1 kb
CMakeDependencies.txt 100644 1 kb
CMakeLists.txt 100644 1 kb
CMakeSourcesAndHeaders.txt 100644 1 kb
LICENSE 100644 2 kb 100644 6 kb 100644 2 kb
<!-- [comment]: <> (DO NOT EDIT THIS FILE. EDIT THE TEMPLATE "templates/") --> # mulle-container A collection of C (C99) data structures dealing exclusively with void pointers. They utilize callbacks that are compatible to OS X's [`NSHashtable`](// and friends. Data structures can live (temporarily) on the stack, or permanently in the heap. [mulle-allocator](// is used pervasively to simplify memory management. None of them are thread-safe. > This library could benefit from more tests. Do not assume, that it > is completely bug free. Fork | Build Status | Release Version ----------|---------------|----------------------------------- [Mulle kybernetiK](// | [![Build Status](]( | ![Mulle kybernetiK tag]( [![Build Status](]( [Community]( | [![Build Status](]( | ![Community tag]( [![Build Status](]( ## Example The API of the containers is fairly uniform, here is an example using `mulle_bigmap` to associate c-strings with each other. All the necessary memory management (copying of keys and values) is performed by `mulle_bigmap` using callbacks: ``` #include <mulle_container/mulle_container.h> static struct mulle_container_keyvaluecallback callback; static void test( void) { struct mulle_bigmap *map; struct mulle_bigmapenumerator rover; void *key; void *value; map = mulle_bigmap_create( 0, &callback, NULL); mulle_bigmap_set( map, "VfL", "VFL"); mulle_bigmap_set( map, "Bochum", "BOCHUM"); mulle_bigmap_set( map, "1848", "1848"); if( ! mulle_bigmap_get( map, "1849")) { rover = mulle_bigmap_enumerate( map); while( mulle_bigmapenumerator_next( &rover, &key, &value)) printf( "%s : %s\n", key, value); mulle_bigmapenumerator_done( &rover); } mulle_bigmap_remove( map, "1848"); mulle_bigmap_destroy( map); } int main( void) { callback.keycallback = mulle_container_keycallback_copied_cstring; callback.valuecallback = mulle_container_valuecallback_copied_cstring; test(); } ``` ## API The name of the functions is consistent. Each function is a **verb** that is prefixed with the name of the data structure it handles. So for example the `get` function for `mulle_array` is `mulle_array_get`. The first parameter, except for creation functions, is always the container itself. Check out [](dox/ for a list of common verbs used. The various functions `assert` their parameters, but when compiled for release there are no runtime checks. For development it is wise to use a debug version of the library. File | Description ------------------------------------------------------------ | ---------------------------------------- [`mulle_container_callback`](dox/ | Callback structures for sets, arrays and maps. &nbsp; | &nbsp; [`mulle_array`](dox/ | A growing mutable array of void pointers (-> objects) with enumeration. (NSMutableArray) [`mulle_pointerarray`](dox/ | A growing mutable array of void pointers w/o callbacks. [`mulle_pointerpairarray`](dox/ | A growing mutable array of pairs of void pointers w/o callbacks. &nbsp; | &nbsp; [`mulle_hash`](dox/ | The default hash. Currently it's a wrapper for the [CityHash]( The choice of CityHash is pretty close to arbitrary, it might change in the future. [`mulle_prime`](dox/ | A simple scheme to get prime values for bit depths (up to 32 bit) &nbsp; | &nbsp; [`mulle_bigmap`](dox/ | A two level growing hashmap (key indexing value map). Deemed useful for really big hash tables. [`mulle_map`](dox/ | A single level growing hashmap (key indexing value map). Your standard key/value associating hashtable (NSMutableDictionary) &nbsp; | &nbsp; [`mulle_bigset`](dox/ | A two level growing hashmap (key indexing value map). Deemed useful for really big hash tables. [`mulle_set`](dox/ | A single level growing hashed set. (NSMutableSet) [`mulle_pointerset`](dox/ | A binary searching set of void pointers, based on pointer equality. Useful for very small sets. ## Install On OS X and Linux you can use [homebrew](//, respectively [linuxbrew](// to install the library: ``` brew install mulle-objc/software/mulle-container ``` On other platforms you can use **mulle-install** from [mulle-build](// to install the library: ``` mulle-install --prefix /usr/local --branch release ``` Otherwise read: * [How to Build](dox/ ### Platforms and Compilers All platforms and compilers supported by [mulle-c11](// ## Author [Nat!](// for [Mulle kybernetiK](// and [Codeon GmbH](//