headers/bsd: Add sys/queue.h.
[haiku.git] / src / system / kernel / disk_device_manager / UserDataWriter.h
blobebb883c1337ab431a046cbaa9a934ec173f34fbc
1 // KDiskDeviceUserDataWriter.h
3 #ifndef _K_DISK_DEVICE_USER_DATA_WRITER_H
4 #define _K_DISK_DEVICE_USER_DATA_WRITER_H
6 #include <SupportDefs.h>
8 struct user_disk_device_data;
9 struct user_partition_data;
11 namespace BPrivate {
12 namespace DiskDevice {
14 class UserDataWriter {
15 public:
16 UserDataWriter();
17 UserDataWriter(user_disk_device_data *buffer, size_t bufferSize);
18 ~UserDataWriter();
20 status_t SetTo(user_disk_device_data *buffer, size_t bufferSize);
21 void Unset();
23 void *AllocateData(size_t size, size_t align = 1);
24 user_partition_data *AllocatePartitionData(size_t childCount);
25 user_disk_device_data *AllocateDeviceData(size_t childCount);
27 char *PlaceString(const char *str);
29 size_t AllocatedSize() const;
31 status_t AddRelocationEntry(void *address);
32 status_t Relocate(void *address);
34 private:
35 struct RelocationEntryList;
37 user_disk_device_data *fBuffer;
38 size_t fBufferSize;
39 size_t fAllocatedSize;
40 RelocationEntryList *fRelocationEntries;
43 } // namespace DiskDevice
44 } // namespace BPrivate
46 using BPrivate::DiskDevice::UserDataWriter;
48 #endif // _K_DISK_DEVICE_USER_DATA_WRITER_H