Elektra  0.9.2
Functions
API Proposals for Elektra

for kdb.h. More...

Collaboration diagram for API Proposals for Elektra:

Functions

ssize_t keySetStringF (Key *key, const char *format,...)
 Set a formatted string. More...
 
KeySet * elektraKeyGetMetaKeySet (const Key *key)
 Return metadata as keyset. More...
 
Key * ksPopAtCursor (KeySet *ks, cursor_t pos)
 Pop key at given cursor position. More...
 

Detailed Description

for kdb.h.

Warning
Do not use these methods if you do not want to depend on exactly the Elektra version your binary was built for.

These methods are a technical preview of what might be added in future Elektra releases. It is a requirement that methods are first added here, before they are added to the public API.

Usually, names in proposal stage should be prefixed with elektra to clearly mark that the signature is likely to be changed and not yet ABI compatible.

Function Documentation

◆ elektraKeyGetMetaKeySet()

KeySet* elektraKeyGetMetaKeySet ( const Key *  key)

Return metadata as keyset.

Parameters
keythe key object to work with
Returns
a duplication of the keyset representing the metadata

◆ keySetStringF()

ssize_t keySetStringF ( Key *  key,
const char *  format,
  ... 
)

Set a formatted string.

Parameters
keythe key to set the string value
formatNULL-terminated text format string
...more arguments
Returns
the size of the string as set (with including 0)

◆ ksPopAtCursor()

Key* ksPopAtCursor ( 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