io: move defs to .h