io abstraction for c