Changeset 264
- Timestamp:
- 04/15/07 23:37:21 (18 years ago)
- Location:
- libmpc/branches/r2d
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libmpc/branches/r2d/include/mpc/reader.h
r195 r264 40 40 41 41 #include <mpc/mpc_types.h> 42 #include <stdio.h> 42 43 43 44 #ifdef __cplusplus … … 80 81 mpc_status mpc_reader_init_stdio(mpc_reader *p_reader, const char *filename); 81 82 83 /// Initializes reader with default stdio file reader implementation. Use 84 /// this if you prefer to open the file yourself. 85 /// 86 /// \param r p_reader handle to initialize 87 /// \param p_file input file handle (already open) 88 mpc_status mpc_reader_init_stdio_stream(mpc_reader * p_reader, FILE * p_file); 89 82 90 /// Release reader with default stdio file reader implementation. 83 91 /// -
libmpc/branches/r2d/libmpcdec/mpc_reader.c
r196 r264 88 88 89 89 mpc_status 90 mpc_reader_init_stdio (mpc_reader *p_reader, const char *filename)90 mpc_reader_init_stdio_stream(mpc_reader * p_reader, FILE * p_file) 91 91 { 92 92 mpc_reader tmp_reader; mpc_reader_stdio *p_stdio; int err; … … 99 99 100 100 p_stdio->magic = STDIO_MAGIC; 101 p_stdio->p_file = fopen(filename, "rb"); 102 if(!p_stdio->p_file) goto clean; 101 p_stdio->p_file = p_file; 103 102 p_stdio->is_seekable = MPC_TRUE; 104 103 err = fseek(p_stdio->p_file, 0, SEEK_END); … … 126 125 } 127 126 127 mpc_status 128 mpc_reader_init_stdio(mpc_reader *p_reader, const char *filename) 129 { 130 FILE * stream = fopen(filename, "rb"); 131 if (stream == NULL) return MPC_STATUS_FILE; 132 return mpc_reader_init_stdio_stream(p_reader,stream); 133 } 134 128 135 void 129 136 mpc_reader_exit_stdio(mpc_reader *p_reader)
Note: See TracChangeset
for help on using the changeset viewer.