btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / headers / private / kernel / disk_device_manager / KPartitioningSystem.h
blobf645e65e496f8c667d826d6d3193e3b9561bb8e6
1 /*
2 * Copyright 2003-2011, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Ingo Weinhold <bonefish@cs.tu-berlin.de>
7 */
8 #ifndef _K_PARTITIONING_DISK_DEVICE_SYSTEM_H
9 #define _K_PARTITIONING_DISK_DEVICE_SYSTEM_H
11 #include "KDiskSystem.h"
14 struct partition_module_info;
17 namespace BPrivate {
18 namespace DiskDevice {
21 /**
22 * \brief Wrapper for the C interface of a partitioning system add-on.
24 * See \ref ddm_modules.h for better description of the interface.
26 class KPartitioningSystem : public KDiskSystem {
27 public:
28 KPartitioningSystem(const char* name);
29 virtual ~KPartitioningSystem();
31 virtual status_t Init();
33 // Scanning
35 virtual float Identify(KPartition* partition, void** cookie);
36 virtual status_t Scan(KPartition* partition, void* cookie);
37 virtual void FreeIdentifyCookie(KPartition* partition,
38 void* cookie);
39 virtual void FreeCookie(KPartition* partition);
40 virtual void FreeContentCookie(KPartition* partition);
42 // Writing
44 virtual status_t Repair(KPartition* partition, bool checkOnly,
45 disk_job_id job);
46 virtual status_t Resize(KPartition* partition, off_t size,
47 disk_job_id job);
48 virtual status_t ResizeChild(KPartition* child, off_t size,
49 disk_job_id job);
50 virtual status_t Move(KPartition* partition, off_t offset,
51 disk_job_id job);
52 virtual status_t MoveChild(KPartition* child, off_t offset,
53 disk_job_id job);
54 virtual status_t SetName(KPartition* partition, const char* name,
55 disk_job_id job);
56 virtual status_t SetContentName(KPartition* partition,
57 const char* name, disk_job_id job);
58 virtual status_t SetType(KPartition* partition, const char* type,
59 disk_job_id job);
60 virtual status_t SetParameters(KPartition* partition,
61 const char* parameters, disk_job_id job);
62 virtual status_t SetContentParameters(KPartition* partition,
63 const char* parameters, disk_job_id job);
64 virtual status_t Initialize(KPartition* partition,
65 const char* name, const char* parameters,
66 disk_job_id job);
67 virtual status_t Uninitialize(KPartition* partition,
68 disk_job_id job);
69 virtual status_t CreateChild(KPartition* partition, off_t offset,
70 off_t size, const char* type,
71 const char* name, const char* parameters,
72 disk_job_id job, KPartition** child = NULL,
73 partition_id childID = -1);
74 virtual status_t DeleteChild(KPartition* child, disk_job_id job);
76 protected:
77 virtual status_t LoadModule();
78 virtual void UnloadModule();
80 private:
81 partition_module_info* fModule;
85 } // namespace DiskDevice
86 } // namespace BPrivate
88 using BPrivate::DiskDevice::KPartitioningSystem;
90 #endif // _K_PARTITIONING_DISK_DEVICE_SYSTEM_H