wrong return type
no need to save locale variable
remove useless null check
api update; return -1 on error
code cleanup; api change
remove error check
remove unused enum and function decleration
remove header check