---
name: "cmap_iter_next"
section: "3"
platform: "linux"
package: "libcmap-dev"
version: "3.1.9-2+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/cmap_iter_next"
---

# cmap\_iter\_next(3)

Return next item in iteration in CMAP

## NAME

cmap\_iter\_next - Return next item in iteration in CMAP

## SYNOPSIS

**#include \<corosync/cmap.h\>**

**cs\_error\_t** **cmap\_iter\_next(cmap\_handle\_t** *handle***, cmap\_iter\_handle\_t** *iter\_handle***, char** *key\_name\[\]***,** **size\_t \****value\_len***, cmap\_value\_types\_t \****type***);**

## DESCRIPTION

The **cmap\_iter\_next** function is used to get next value in iteration. The *handle* argument is connection to CMAP database obtained by calling **[cmap\_initialize(3)](/cmap_initialize/3.md)** function. *iter\_handle* argument is iterator handle obtained by **[cmap\_iter\_init(3)](/cmap_iter_init/3.md)** function. Following key name is stored inside *key\_name* argument, which must be preallocated by caller and its guaranteed maximum size is CMAP\_KEYNAME\_MAXLEN (currently 255). *value\_len* is pointer where length of value is stored, but can be NULL. *type* is also optional argument (can be NULL) and here type of value is stored (type is one of types described in **[cmap\_get(3)](/cmap_get/3.md)** function).

## RETURN VALUE

This call returns the CS\_OK value if successful. If there are no more items to iterate, CS\_NO\_SECTION error code is returned.

## SEE ALSO

[**cmap\_iter\_init**(3)](/cmap_iter_init/3.md), [**cmap\_iter\_finalize**(3)](/cmap_iter_finalize/3.md), [**cmap\_initialize**(3)](/cmap_initialize/3.md), [**cmap\_get**(3)](/cmap_get/3.md), [**cmap\_overview**(3)](/cmap_overview/3.md)

**CS\_ERR\_TRY\_AGAIN** Resource temporarily unavailable

**CS\_ERR\_INVALID\_PARAM** Invalid argument

**CS\_ERR\_ACCESS** Permission denied

**CS\_ERR\_LIBRARY** The connection failed

**CS\_ERR\_INTERRUPT** System call interrupted by a signal

**CS\_ERR\_NOT\_SUPPORTED** The requested protocol/functionality not supported

**CS\_ERR\_MESSAGE\_ERROR** Incorrect auth message received

**CS\_ERR\_NO\_MEMORY** Not enough memory to complete the requested task
