use OPENMODE_... macros for internal use in clib