---
name: "slv2_collections"
section: "3"
platform: "linux"
package: "slv2-doc"
version: "0.6.6+dfsg1-2"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/slv2_collections"
---

# slv2\_collections(3)

Ordered collections of typed values which are fast for random access by index (i.e.

## NAME

Collections\_of\_values/objects - Ordered collections of typed values which are fast for random access by index (i.e.

### Functions

SLV2PluginClass **slv2\_plugin\_classes\_get\_by\_uri** (SLV2PluginClasses classes, SLV2Value uri)\
 SLV2PluginClass **slv2\_plugin\_classes\_get\_at** (SLV2PluginClasses classes, unsigned index)\
 void **slv2\_plugins\_free** (SLV2World world, SLV2Plugins plugins)\
 SLV2Plugin **slv2\_plugins\_get\_by\_uri** (SLV2Plugins plugins, SLV2Value uri)\
 SLV2Plugin **slv2\_plugins\_get\_at** (SLV2Plugins plugins, unsigned index)\
 void **slv2\_uis\_free** (SLV2UIs list)\
 SLV2UI **slv2\_uis\_get\_by\_uri** (SLV2UIs list, SLV2Value uri)\
 SLV2UI **slv2\_uis\_get\_at** (SLV2UIs list, unsigned index)\
 SLV2Value **slv2\_values\_get\_at** (SLV2Values values, unsigned index)\
 bool **slv2\_values\_contains** (SLV2Values values, SLV2Value value)\

## Detailed Description

a fancy array).

## Function Documentation

### unsigned slv2\_plugin\_classes\_size (SLV2PluginClasses classes)

Get the number of plugins in the collection.

### SLV2PluginClass slv2\_plugin\_classes\_get\_by\_uri (SLV2PluginClasses classes, SLV2Value uri)

Get a plugin class from the collection by URI.

Return value is shared (stored in *classes*) and must not be freed or modified by the caller in any way.

Time = O(log2(n))

**Returns:**

NULL if plugin with *url* not found in *classes*.

### SLV2PluginClass slv2\_plugin\_classes\_get\_at (SLV2PluginClasses classes, unsigned index)

Get a plugin from the collection by index.

*index* has no significance other than as an index into *classes*. Any *index* not less than slv2\_plugin\_classes\_get\_length(classes) will return NULL, so all plugin\_classes in a classes can be enumerated by repeated calls to this function starting with *index* = 0.

Time = O(1)

**Returns:**

NULL if *index* out of range.

### void slv2\_plugins\_free (SLV2World world, SLV2Plugins plugins)

Free a plugin plugins.

Freeing a plugin collection does not destroy the plugins it contains (plugins are owned by the world). *plugins* is invalid after this call.

### unsigned slv2\_plugins\_size (SLV2Plugins plugins)

Get the number of plugins in the collection.

### SLV2Plugin slv2\_plugins\_get\_by\_uri (SLV2Plugins plugins, SLV2Value uri)

Get a plugin from the collection by URI.

Return value is shared (stored in *plugins*) and must not be freed or modified by the caller in any way.

Time = O(log2(n))

**Returns:**

NULL if plugin with *url* not found in *plugins*.

### SLV2Plugin slv2\_plugins\_get\_at (SLV2Plugins plugins, unsigned index)

Get a plugin from the plugins by index.

*index* has no significance other than as an index into this plugins. Any *index* not less than slv2\_plugins\_get\_length(plugins) will return NULL, so all plugins in a plugins can be enumerated by repeated calls to this function starting with *index* = 0.

Time = O(1)

**Returns:**

NULL if *index* out of range.

### void slv2\_uis\_free (SLV2UIs list)

Free a plugin list.

Freeing a plugin list does not destroy the plugins it contains (plugins are owned by the world). *list* is invalid after this call.

### unsigned slv2\_uis\_size (SLV2UIs list)

Get the number of plugins in the list.

### SLV2UI slv2\_uis\_get\_by\_uri (SLV2UIs list, SLV2Value uri)

Get a plugin from the list by URI.

Return value is shared (stored in *list*) and must not be freed or modified by the caller in any way.

Time = O(log2(n))

**Returns:**

NULL if plugin with *url* not found in *list*.

### SLV2UI slv2\_uis\_get\_at (SLV2UIs list, unsigned index)

Get a plugin from the list by index.

*index* has no significance other than as an index into this list. Any *index* not less than slv2\_list\_get\_length(list) will return NULL, so all plugins in a list can be enumerated by repeated calls to this function starting with *index* = 0.

Time = O(1)

**Returns:**

NULL if *index* out of range.

### SLV2Values slv2\_values\_new ()

Allocate a new, empty SLV2Values.

### void slv2\_values\_free (SLV2Values values)

Free an SLV2Values.

### unsigned slv2\_values\_size (SLV2Values values)

Get the number of elements in a value collection.

### SLV2Value slv2\_values\_get\_at (SLV2Values values, unsigned index)

Get the value at a given index in the collection.

**Returns:**

the element at *index*, or NULL if index is out of range.

Time = O(1)

### bool slv2\_values\_contains (SLV2Values values, SLV2Value value)

Return whether *values* contains *value*.

Time = O(n)

## Author

Generated automatically by Doxygen for SLV2 from the source code.
