API-Changes0.7

From Elektra Initiative

Contents

API Changes

There were many API changes necessary to face some problems. Elektra 0.7.x is incompatible to 0.6.x in a way that 0.6.x software won't compile or link against the new API. But with 0.7.0 comes the promise to be 100% compatible within 0.7.x and support that for at least a year.

A key in multiple keyset

A major issue in 0.6.x was that a Key could always be in just one keyset. Now its possible that a single key can be in an unlimited number of keysets.

Reference Counting

To make keyDel() not more complicated reference counting was introduced. It is now safe to keyDel() after every ksPop(), regardless if the key is in other keyset or not.

keyDup

keyDup now allocates and returns a key with a much easier syntax: Key * dup = keyDup (old);

keySetDir

Thus keySetDir simply adds the executeflag, the second parameter is omitted.

Renaming

There was a lot of renaming of too long, wrong and circumstantial names: DOMAIN -> OWNER KEY_SWITCH -> KEY KDBHandle -> KDB

keyNew ("user/key1", KEY_SWITCH_VALUE, "value1", KEY_SWITCH_COMMENT, "comment1",KEY_SWITCH_END),

is now much shorter: keyNew ("user/key1", KEY_VALUE, "value1", KEY_COMMENT, "comment1",KEY_END),

There is no more plural by now and everything is much more consistent.

keySet

ksNew (20, list of keys) takes now a hint how large the keyset will be (otherwise it will grow) and a list of keys terminated by KS_END. The legacy call is ksNew (0);

Removing of Functions

Many Functions and Methods were removed because the same could be archieved in an easier or more elegant way. I can't list them all here.

Swapping of Parameters

There were some problems that a keyset was sometimes the second and sometimes third parameter, its now always the second.

KDBHandle

All functions now use KDB* and not KDBHandle or KDBHandle**

kdbOpen() now returns the KDBHandle* rather than taking it as argument. Elektra now free()s everything it allocated.

keyName

The *Steal* functions are now gone, keyName(), keyValue(), keyComment() and keyOwner() are there replacement.


Null pointer saftey

Its now not trivial possible to crash elektra. It is allowed to pass NULL pointer that another method of elektra might have returned.

Views
MediaWiki