convert dbuploader to c code