On 09/21/2012 11:26 AM, Luiz Capitulino wrote: > On Fri, 21 Sep 2012 13:42:34 -0300 > Luiz Capitulino wrote: > >>>> +{ 'union': 'KeyValue', >>>> + 'data': { >>>> + 'hex': 'int', + 'qcode': 'QKeyCode', >>> >>> Don't you find it a bit odd to name this 'hex', even though it works to >>> do 'hex':32 as a synonym for 'hex':0x20? Should we instead name it >>> 'value', since we don't care in what base the value was represented, >>> only that JSON was able to decode the base into a value? >> >> Yes, that's a good point. I'll respin. > > Actually, this also has drawbacks: > > keylist->value->kind = KEY_VALUE_KIND_VALUE; > keylist->value->value = value; > Any better ideas? Maybe s/hex/number/, as in: JSON: 'number':0x20 C code: keylist->value->number = number; that is, you are passing the value either as a keycode name, or as a number. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org