OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 | 5 |
6 /* From ppb_file_io.idl modified Thu Jan 12 16:13:13 2012. */ | 6 /* From ppb_file_io.idl modified Fri Jan 20 13:16:36 2012. */ |
7 | 7 |
8 #ifndef PPAPI_C_PPB_FILE_IO_H_ | 8 #ifndef PPAPI_C_PPB_FILE_IO_H_ |
9 #define PPAPI_C_PPB_FILE_IO_H_ | 9 #define PPAPI_C_PPB_FILE_IO_H_ |
10 | 10 |
11 #include "ppapi/c/pp_bool.h" | 11 #include "ppapi/c/pp_bool.h" |
12 #include "ppapi/c/pp_completion_callback.h" | 12 #include "ppapi/c/pp_completion_callback.h" |
13 #include "ppapi/c/pp_file_info.h" | 13 #include "ppapi/c/pp_file_info.h" |
14 #include "ppapi/c/pp_instance.h" | 14 #include "ppapi/c/pp_instance.h" |
15 #include "ppapi/c/pp_macros.h" | 15 #include "ppapi/c/pp_macros.h" |
16 #include "ppapi/c/pp_resource.h" | 16 #include "ppapi/c/pp_resource.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 * | 163 * |
164 * @param[in] file_io A <code>PP_Resource</code> corresponding to a file | 164 * @param[in] file_io A <code>PP_Resource</code> corresponding to a file |
165 * FileIO. | 165 * FileIO. |
166 * @param[in] offset The offset into the file. | 166 * @param[in] offset The offset into the file. |
167 * @param[in] buffer The buffer to hold the specified number of bytes read. | 167 * @param[in] buffer The buffer to hold the specified number of bytes read. |
168 * @param[in] bytes_to_read The number of bytes to read from | 168 * @param[in] bytes_to_read The number of bytes to read from |
169 * <code>offset</code>. | 169 * <code>offset</code>. |
170 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | 170 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon |
171 * completion of Read(). | 171 * completion of Read(). |
172 * | 172 * |
173 * @return An The number of bytes read an error code from | 173 * @return An number of bytes read an error code from |
174 * <code>pp_errors.h</code>. If the return value is 0, then end-of-file was | 174 * <code>pp_errors.h</code>. If the return value is 0, then end-of-file was |
175 * reached. It is valid to call Read() multiple times with a completion | 175 * reached. It is valid to call Read() multiple times with a completion |
176 * callback to queue up parallel reads from the file, but pending reads | 176 * callback to queue up parallel reads from the file, but pending reads |
177 * cannot be interleaved with other operations. | 177 * cannot be interleaved with other operations. |
178 */ | 178 */ |
179 int32_t (*Read)(PP_Resource file_io, | 179 int32_t (*Read)(PP_Resource file_io, |
180 int64_t offset, | 180 int64_t offset, |
181 char* buffer, | 181 char* buffer, |
182 int32_t bytes_to_read, | 182 int32_t bytes_to_read, |
183 struct PP_CompletionCallback callback); | 183 struct PP_CompletionCallback callback); |
184 /** | 184 /** |
185 * Write() writes to an offset in the file. This function might perform a | 185 * Write() writes to an offset in the file. This function might perform a |
186 * partial write. The FileIO object must have been opened with write access. | 186 * partial write. The FileIO object must have been opened with write access. |
187 * | 187 * |
188 * @param[in] file_io A <code>PP_Resource</code> corresponding to a file | 188 * @param[in] file_io A <code>PP_Resource</code> corresponding to a file |
189 * FileIO. | 189 * FileIO. |
190 * @param[in] offset The offset into the file. | 190 * @param[in] offset The offset into the file. |
191 * @param[in] buffer The buffer to hold the specified number of bytes read. | 191 * @param[in] buffer The buffer to hold the specified number of bytes read. |
192 * @param[in] bytes_to_write The number of bytes to write to | 192 * @param[in] bytes_to_write The number of bytes to write to |
193 * <code>offset</code>. | 193 * <code>offset</code>. |
194 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | 194 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon |
195 * completion of Write(). | 195 * completion of Write(). |
196 * | 196 * |
197 * @return An The number of bytes written or an error code from | 197 * @return The number of bytes written or an error code from |
198 * <code>pp_errors.h</code>. If the return value is 0, then end-of-file was | 198 * <code>pp_errors.h</code>. If the return value is 0, then end-of-file was |
199 * reached. It is valid to call Write() multiple times with a completion | 199 * reached. It is valid to call Write() multiple times with a completion |
200 * callback to queue up parallel writes to the file, but pending writes | 200 * callback to queue up parallel writes to the file, but pending writes |
201 * cannot be interleaved with other operations. | 201 * cannot be interleaved with other operations. |
202 */ | 202 */ |
203 int32_t (*Write)(PP_Resource file_io, | 203 int32_t (*Write)(PP_Resource file_io, |
204 int64_t offset, | 204 int64_t offset, |
205 const char* buffer, | 205 const char* buffer, |
206 int32_t bytes_to_write, | 206 int32_t bytes_to_write, |
207 struct PP_CompletionCallback callback); | 207 struct PP_CompletionCallback callback); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 void (*Close)(PP_Resource file_io); | 254 void (*Close)(PP_Resource file_io); |
255 }; | 255 }; |
256 | 256 |
257 typedef struct PPB_FileIO_1_0 PPB_FileIO; | 257 typedef struct PPB_FileIO_1_0 PPB_FileIO; |
258 /** | 258 /** |
259 * @} | 259 * @} |
260 */ | 260 */ |
261 | 261 |
262 #endif /* PPAPI_C_PPB_FILE_IO_H_ */ | 262 #endif /* PPAPI_C_PPB_FILE_IO_H_ */ |
263 | 263 |
OLD | NEW |