Modifiying API to be C application compatible