Elektra  0.9.4
Functions
proposal.c File Reference

Implementation of proposed API enhancements. More...

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

Functions

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

Detailed Description

Implementation of proposed API enhancements.

Function Documentation

◆ elektraKsPopAtCursor()

Key* elektraKsPopAtCursor ( KeySet *  ks,
elektraCursor  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