---
name: "confdb_key_iter"
section: "3"
platform: "linux"
package: "corosync-dev"
version: "1.4.6-1.1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/confdb_key_iter"
---

# confdb\_key\_iter(3)

Iterate through key/value pairs in the Configuration Database

## NAME

confdb\_key\_iter - Iterate through key/value pairs in the Configuration Database

## SYNOPSIS

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

**confdb\_error\_t confdb\_key\_iter\_start(confdb\_handle\_t** *handle***, unsigned int** *parent\_object\_handle* **);**

**confdb\_error\_t confdb\_key\_iter(confdb\_handle\_t** *handle***, unsigned int** *parent\_object\_handle***, void** *\*key\_name***, int** *\*key\_name\_len***,  void** *\*value***, int** *\*value\_len* **);**

## DESCRIPTION

The **confdb\_key\_iter** function repeatedly returns all key/value pairs that are subobjects of the specified parent. You must call **confdb\_key\_iter\_start** first. This establishes a context for the parent object so that it knows where you are in the list. Then the next call to **confdb\_key\_iter** will return the first key/value in the list. Subsequent calls will return any remaining keys. The function returns CONFDB\_ERR\_ACCESS when the all of the matching keys have been seen. The library holds a seperate context for each parent object, so you can call confdb\_key\_iter() on several parent objects at the same time and they will not interfere. Nor will they interfere with **confdb\_object\_find** or **confdb\_object\_iter** calls on the same parent object.

## RETURN VALUE

This call returns the CONFDB\_OK value if successful, otherwise an error is returned.

## ERRORS

The errors are undocumented.

## SEE ALSO

[**confdb\_overview**(8)](/confdb_overview/8.md), [**confdb\_initialize**(3)](/confdb_initialize/3.md), [**confdb\_finalize**(3)](/confdb_finalize/3.md), [**confdb\_dispatch**(3)](/confdb_dispatch/3.md), [**confdb\_object\_create**(3)](/confdb_object_create/3.md), [**confdb\_object\_destroy**(3)](/confdb_object_destroy/3.md), [**confdb\_object\_parent\_get**(3)](/confdb_object_parent_get/3.md), [**confdb\_key\_create**(3)](/confdb_key_create/3.md), [**confdb\_key\_delete**(3)](/confdb_key_delete/3.md), [**confdb\_key\_get**(3)](/confdb_key_get/3.md), [**confdb\_key\_replace**(3)](/confdb_key_replace/3.md), [**confdb\_object\_find\_start**(3)](/confdb_object_find_start/3.md), [**confdb\_object\_find**(3)](/confdb_object_find/3.md), [**confdb\_object\_iter\_start**(3)](/confdb_object_iter_start/3.md), [**confdb\_object\_iter**(3)](/confdb_object_iter/3.md), [**confdb\_key\_iter\_start**(3)](/confdb_key_iter_start/3.md), [**confdb\_key\_iter**(3)](/confdb_key_iter/3.md),
