This is a multi-part message in MIME format.
I commited the result, I guess it should be very close to what you had in your tree, but like you I'm learning git so please double check the code in git is actually what you expected :-) (module the small API change).Thanks again, I'll take a look later today and let you know.
There were few more places where my original patch changed the ABI (int -> enum). Please find attached a patch that fixes these places and also adds a check that "int" is actually "enum" :) Thanks again for your help! Aleksey