CMAP_ITER_INIT(3)
β¨ CMAP_ITER_INIT(3) β¨
okay bestie, gather round, because we're cracking open the Corosync Cluster Engine Programmer's Manual and this page is literally the starter pistol for walking through every key in the CMAP database. no cap. π
πΈ NAME πΈ
cmap_iter_init β get your iterator ready for all the keys chillin' in CMAP
π¦ SYNOPSIS π¦
#include <corosync/cmap.h>
cs_error_t cmap_iter_init (cmap_handle_t handle, const char *prefix,
cmap_iter_handle_t *cmap_iter_handle);
like, that's the whole vibe. three args, one dream. β¨
π DESCRIPTION π
so cmap_iter_init is the function you call to initialize iteration of all keys with a given prefix. it's giving "set up the tour, we're about to visit every key in the neighborhood." ποΈ
the handle argument is your connection to the CMAP database β and you get that by calling cmap_initialize(3). so like, don't show up to the function without it, that's not the move. π
prefix is a string, and every returned key must have a name with that given prefix. it's a filter, basically. a little "only the keys with this aesthetic, please." π
and here's the cute part: this variable can also be NULL (or an empty string) β and then all keys are iterated. so if you're feeling greedy, go off. π
cmap_iter_init is used only to initialize the context for future cmap_iter_next(3) calls, and the handle you need for that function gets handed back to you in the cmap_iter_handle variable. that's your ticket. keep it safe. ποΈ
and when you've finished iterating over objects, call cmap_iter_finalize(3) to free up the memory associated with the iteration. do not skip this part. it's the "wash your face before bed" of CMAP. π§Ό
π RETURN VALUE π
this call returns the CS_OK value if it's successful. slay. β¨
but if there are no items with the given prefixes, CS_ERR_NO_SECTIONS is returned. empty house. nobody home. π
π SEE ALSO π
π the error codes, bestie (they live right here, iykyk)
CS_ERR_TRY_AGAINβ Resource temporarily unavailableCS_ERR_INVALID_PARAMβ Invalid argumentCS_ERR_ACCESSβ Permission deniedCS_ERR_LIBRARYβ The connection failedCS_ERR_INTERRUPTβ System call interrupted by a signalCS_ERR_NOT_SUPPORTEDβ The requested protocol/functionality not supportedCS_ERR_MESSAGE_ERRORβ Incorrect auth message receivedCS_ERR_NO_MEMORYβ Not enough memory to complete the requested task
okay that's the whole page, you ate it, go iterate something iconic. π«Ά
this has been the corosync Man Page, dated 03/02/2012 β fr fr, a classic, and yes she's still serving. mwah. π π
π¦ where this page comes from
- debian bookworm: libcmap-dev 3.1.7-1+deb12u2 Β· BSD-3-Clause
- debian trixie: libcmap-dev 3.1.9-2+deb13u1 Β· BSD-3-Clause
- epel 9: corosynclib-devel 3.1.10-0.2.el9.1 Β· BSD-3-Clause
- fedora 43: corosynclib-devel 3.1.10-3.fc43 Β· BSD-3-Clause
- fedora 43: corosynclib-devel 3.1.10-3.fc43 Β· BSD-3-Clause
- fedora 43: corosynclib-devel 3.1.9-5.fc43 Β· BSD-3-Clause
- fedora 43: corosynclib-devel 3.1.9-5.fc43 Β· BSD-3-Clause
- fedora 44: corosynclib-devel 3.1.10-4.fc44 Β· BSD-3-Clause
- fedora 44: corosynclib-devel 3.1.10-4.fc44 Β· BSD-3-Clause
- fedora 44: corosynclib-devel 3.1.10-6.fc44 Β· BSD-3-Clause
- fedora 44: corosynclib-devel 3.1.10-6.fc44 Β· BSD-3-Clause
- nixos 26.05: corosync 3.1.9
- nixpkgs unstable: corosync 3.1.9
- opensuse-leap 16.0: corosync-devel 3.1.9-160000.4.1 Β· BSD-3-Clause
- opensuse-leap 16.0: corosync-devel 3.1.9-160000.4.1 Β· BSD-3-Clause
- opensuse-leap 16.0: corosync-devel 3.1.9-160000.4.1 Β· BSD-3-Clause
- opensuse-leap 16.0: corosync-devel 3.1.9-160000.4.1 Β· BSD-3-Clause
- ubuntu jammy: libcmap-dev 3.1.6-1ubuntu1 Β· BSD-3-Clause
- ubuntu jammy: libcmap-dev 3.1.6-1ubuntu1.2 Β· BSD-3-Clause
- ubuntu noble: libcmap-dev 3.1.7-1ubuntu3 Β· BSD-3-Clause
- ubuntu noble: libcmap-dev 3.1.7-1ubuntu3.2 Β· BSD-3-Clause
- ubuntu questing: libcmap-dev 3.1.9-2ubuntu1
- ubuntu questing: libcmap-dev 3.1.9-2ubuntu1.1
- ubuntu resolute: libcmap-dev 3.1.9-2ubuntu3 Β· BSD-3-Clause
- ubuntu stonking: libcmap-dev 3.1.10-3ubuntu1 Β· BSD-3-Clause
- Copyright (c) 2012 Red Hat, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms