op_fileio.h
Go to the documentation of this file.00001
00012 #ifndef OP_FILEIO_H
00013 #define OP_FILEIO_H
00014
00015 #ifdef __cplusplus
00016 extern "C" {
00017 #endif
00018
00019 #include "op_types.h"
00020
00021 #include <stdio.h>
00022
00031 FILE * op_try_open_file(char const * name, char const * mode);
00032
00041 FILE * op_open_file(char const * name, char const * mode);
00042
00051 u32 op_read_int_from_file(char const * filename, int fatal);
00052
00061 void op_close_file(FILE * fp);
00062
00072 void op_write_file(FILE * fp, void const * buf, size_t size);
00073
00084 void op_write_u32(FILE * fp, u32 val);
00085
00096 void op_write_u64(FILE * fp, u64 val);
00097
00106 void op_write_u8(FILE * fp, u8 val);
00107
00123 char * op_get_line(FILE * fp);
00124
00134 unsigned long calc_crc32(unsigned long crc, unsigned char * buf, size_t len);
00135
00136 #ifdef __cplusplus
00137 }
00138 #endif
00139
00140 #endif