Make xkb_keymap_num_leds return the index range instead of active count
authorRan Benita <ran234@gmail.com>
Thu, 11 Oct 2012 14:54:17 +0000 (16:54 +0200)
committerRan Benita <ran234@gmail.com>
Thu, 11 Oct 2012 14:54:17 +0000 (16:54 +0200)
commitbbf388ec1f632f648b0e1323fe90c251c0425bf7
treec71d8425c76d7323e6acd9f11ef873cd73130e4a
parentb6ddd105686aaa7accb63d5fe9c228cc4d7b1db0
Make xkb_keymap_num_leds return the index range instead of active count

Currently xkb_keymap_num_leds() returns a count of valid (settable)
leds. Because the indexes might be non-consecutive, and some leds
might not be settable, it is incorrect to use this function for
iterating over the leds in the keymap. But this is the main use case of
this function, so instead of the current behavior we adapt the function
to the use case by making it return the needed range of iteration.
The caller needs to handle invalid intermittent indexes, though.

Signed-off-by: Ran Benita <ran234@gmail.com>
src/keymap.c
test/interactive.c
test/state.c
xkbcommon/xkbcommon.h