iOS implementation in Objective-C and C, no memory cleanup yet