-Codechange: convert FILE_MODE_READ / FILE_MODE_WRITE macros to enum
-Cleanup: follow pointer coding style