Elektra  0.9.2
Functions
elektra/proposal.c File Reference

Implementation of proposed API enhancements. More...

#include <string.h>
#include <kdbprivate.h>
Include dependency graph for elektra/proposal.c:

Functions

Key * elektraKsPopAtCursor (KeySet *ks, cursor_t pos)
 Pop key at given cursor position. More...
 

Detailed Description

Implementation of proposed API enhancements.

Function Documentation

◆ elektraKsPopAtCursor()

Key* elektraKsPopAtCursor ( KeySet *  ks,
cursor_t  pos 
)

Pop key at given cursor position.

Parameters
ksthe keyset to pop key from
cwhere to pop

The internal cursor will be rewinded using ksRewind(). You can use ksGetCursor() and ksSetCursor() jump back to the previous position. e.g. to pop at current position within ksNext() loop:

cursor_t c = ksGetCursor(ks);
ksSetCursor(ks, c);
ksPrev(ks); // to have correct key after next ksNext()
Warning
do not use, will be superseded by external iterator API
Returns
the popped key
Return values
0if ks is 0
ksSetCursor
int ksSetCursor(KeySet *ks, cursor_t cursor)
Set the KeySet internal cursor.
Definition: keyset.c:1599
keyDel
int keyDel(Key *key)
A destructor for Key objects.
Definition: key.c:568
ksPopAtCursor
Key * ksPopAtCursor(KeySet *ks, cursor_t pos)
Pop key at given cursor position.
Definition: proposal/proposal.c:116
ksGetCursor
cursor_t ksGetCursor(const KeySet *ks)
Get the KeySet internal cursor.
Definition: keyset.c:1538