xref: /haiku/headers/os/drivers/io_requests.h (revision 8a990d5228b2d1099e3062180532ba709dfeef6d)
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 bool		io_request_is_vip(const io_request* request);
24 off_t		io_request_offset(const io_request* request);
25 off_t		io_request_length(const io_request* request);
26 status_t	read_from_io_request(io_request* request, void* buffer,
27 				size_t size);
28 status_t	write_to_io_request(io_request* request, const void* buffer,
29 				size_t size);
30 void		notify_io_request(io_request* request, status_t status);
31 
32 #ifdef __cplusplus
33 }
34 #endif
35 
36 
37 #endif	/* _IO_REQUESTS_H */
38