diff options
author | David Robillard <d@drobilla.net> | 2011-03-10 07:20:34 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-03-10 07:20:34 +0000 |
commit | 4f0ea64bf84fc2532e5104fc1bc5d6ccf76d3fff (patch) | |
tree | 4fc91a5c6fb37f1267587513d216feee2787972c /src/slv2_internal.h | |
parent | 509579ed2b7a99b2056136a3faafa7ef11d3a57d (diff) | |
download | lilv-4f0ea64bf84fc2532e5104fc1bc5d6ccf76d3fff.tar.gz lilv-4f0ea64bf84fc2532e5104fc1bc5d6ccf76d3fff.tar.bz2 lilv-4f0ea64bf84fc2532e5104fc1bc5d6ccf76d3fff.zip |
Hide as many collection details as possible while keeping generic iterator / SLV2_FOREACH API.
git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@3064 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/slv2_internal.h')
-rw-r--r-- | src/slv2_internal.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/slv2_internal.h b/src/slv2_internal.h index f800a68..b1f223f 100644 --- a/src/slv2_internal.h +++ b/src/slv2_internal.h @@ -140,6 +140,39 @@ slv2_plugin_get_unique(SLV2Plugin p, SLV2Plugins slv2_plugins_new(); +/** + Free @a collection. +*/ +SLV2_API +void +slv2_collection_free(SLV2Collection collection); + +/** + Get the number of elements in @a collection. +*/ +SLV2_API +unsigned +slv2_collection_size(SLV2Collection collection); + +/** + Get an element from @a collection by index. + + @a index has no significance other than as an index into @a collection. + + Any @a index not less than the size of the collection will return NULL, + so all elements in a collection can be enumerated by repeated calls + to this function starting with @a index = 0. + + Note this function is a search, and not constant time. + This function is deprecated, use iterators instead. + + @return NULL if @a index is out of range. +*/ +SLV2_DEPRECATED +SLV2_API +void* +slv2_collection_get_at(SLV2Collection collection, + unsigned index); /* ********* Instance ********* */ |