1eb53cd83SFrançois Revol /* 234dc9962SFrançois Revol * Copyright 2008-2010, François Revol, revol@free.fr. All rights reserved. 3eb53cd83SFrançois Revol * Copyright 2003, Axel Dörfler, axeld@pinc-software.de. All rights reserved. 4eb53cd83SFrançois Revol * Distributed under the terms of the MIT License. 5eb53cd83SFrançois Revol */ 6eb53cd83SFrançois Revol #ifndef HANDLE_H 7eb53cd83SFrançois Revol #define HANDLE_H 8eb53cd83SFrançois Revol 9eb53cd83SFrançois Revol 10eb53cd83SFrançois Revol #include <boot/vfs.h> 11eb53cd83SFrançois Revol 12eb53cd83SFrançois Revol 13eb53cd83SFrançois Revol #ifdef __cplusplus 14eb53cd83SFrançois Revol 15*45c84b28SDavid Karoly class Handle : public Node { 16eb53cd83SFrançois Revol public: 176f9e2651SFrançois Revol Handle(int handle); 18eb53cd83SFrançois Revol Handle(); 19eb53cd83SFrançois Revol virtual ~Handle(); 20eb53cd83SFrançois Revol 216f9e2651SFrançois Revol void SetHandle(int handle); 22eb53cd83SFrançois Revol 23eb53cd83SFrançois Revol virtual ssize_t ReadAt(void *cookie, off_t pos, void *buffer, size_t bufferSize); 24eb53cd83SFrançois Revol virtual ssize_t WriteAt(void *cookie, off_t pos, const void *buffer, size_t bufferSize); 25eb53cd83SFrançois Revol 26eb53cd83SFrançois Revol virtual off_t Size() const; 27eb53cd83SFrançois Revol 28eb53cd83SFrançois Revol protected: 29eb53cd83SFrançois Revol int16 fHandle; 30eb53cd83SFrançois Revol }; 31eb53cd83SFrançois Revol 326f9e2651SFrançois Revol /* block devices */ 336f9e2651SFrançois Revol /* cf. devices.cpp */ 346f9e2651SFrançois Revol 35eb53cd83SFrançois Revol #endif /* __cplusplus */ 36eb53cd83SFrançois Revol 37eb53cd83SFrançois Revol #endif /* HANDLE_H */ 38