Implement missing xkb_state_ref and add return value
authorRan Benita <ran234@gmail.com>
Thu, 5 Apr 2012 07:13:24 +0000 (10:13 +0300)
committerDaniel Stone <daniel@fooishbar.org>
Mon, 9 Apr 2012 12:57:36 +0000 (13:57 +0100)
commit467d7bb64eb8e77304fc6c91f612ec7b8036e475
tree4916e6385262a350e50a1d835cc3004c6c6e6cd8
parentb08629f92b20a470cfd11ad03fe4d9085a2612d2
Implement missing xkb_state_ref and add return value

xkb_state_ref was missing.

Also modify the _ref functions to return the object instead of being
void. This is a useful idiom:

    struct my_object my_object_new(struct xkb_state *state)
    {
        [...]
        my_object->state = xkb_state_ref(state);
        [...]
    }

Essentially "taking" a reference, such that you don't forget to
increment it and it's one line less (see example in our own code).

A case could also be made for _unref to return the object or NULL, but
this is quite uncommon.

Signed-off-by: Ran Benita <ran234@gmail.com>
[daniels: Updated for xkb_keymap changes.]
include/xkbcommon/xkbcommon.h
src/alloc.c
src/context.c
src/state.c
src/xkbcomp/xkbcomp.c