1 /* 2 * Copyright 2009, Haiku Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _IO_REQUESTS_H 6 #define _IO_REQUESTS_H 7 8 9 /*! I/O request interface */ 10 11 12 #include <SupportDefs.h> 13 14 15 typedef struct IORequest io_request; 16 17 18 #ifdef __cplusplus 19 extern "C" { 20 #endif 21 22 bool io_request_is_write(const io_request* request); 23 off_t io_request_offset(const io_request* request); 24 off_t io_request_length(const io_request* request); 25 status_t read_from_io_request(io_request* request, void* buffer, 26 size_t size); 27 status_t write_to_io_request(io_request* request, const void* buffer, 28 size_t size); 29 void notify_io_request(io_request* request, status_t status); 30 31 #ifdef __cplusplus 32 } 33 #endif 34 35 36 #endif /* _IO_REQUESTS_H */ 37