From 45b15a27e1f315f3828a95e08d6c3f31797053be Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sat, 21 Dec 2002 19:06:18 +0000 Subject: [PATCH] C level device API (disk_scanner). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2272 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/kernel/fs_device.h | 59 +++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 headers/os/kernel/fs_device.h diff --git a/headers/os/kernel/fs_device.h b/headers/os/kernel/fs_device.h new file mode 100644 index 0000000000..41360d6e93 --- /dev/null +++ b/headers/os/kernel/fs_device.h @@ -0,0 +1,59 @@ +// fs_devices.h + +#ifndef _FS_DEVICE_H +#define _FS_DEVICE_H + +#include +#include +#include + +// session flags +enum { + B_DATA_SESSION = 0x01, /* data session */ + B_VIRTUAL_SESSION = 0x02, /* e.g. hard disk */ +}; + +typedef struct session_info { + off_t offset; /* offset from start of device (in bytes) */ + off_t size; /* size (in bytes) */ + int32 logical_block_size; /* logical block size (in bytes) */ + int32 index; /* session index */ + uint32 flags; /* session flags */ +} session_info; + +// partition flags +enum { + B_HIDDEN_PARTITION = 0x01, /* non-file system partition */ + B_VIRTUAL_PARTITION = 0x02, /* e.g. floppy */ + B_EMPTY_PARTITION = 0x04, /* empty partition, implies + B_HIDDEN_PARTITION */ +}; + +typedef struct extended_partition_info { + partition_info info; + uint32 flags; /* partition flags */ + char partition_name[B_FILE_NAME_LENGTH]; + char partition_type[B_FILE_NAME_LENGTH]; + char file_system_short_name[B_FILE_NAME_LENGTH]; /* "", if hidden */ + char file_system_long_name[B_FILE_NAME_LENGTH]; /* or unknown FS */ + char volume_name[B_FILE_NAME_LENGTH]; /* "", if hidden */ + char mounted_at[B_FILE_NAME_LENGTH]; /* "", if not mounted */ + //< better B_PATH_NAME_LENGTH? + uint8 partition_code; +} extended_partition_info; + +#ifdef __cplusplus +extern "C" { +#endif + +status_t get_nth_session_info(int deviceFD, int32 index, + session_info *sessionInfo); +status_t get_nth_partition_info(int deviceFD, int32 sessionIndex, + int32 partitionIndex, + extended_partition_info *partitionInfo); + +#ifdef __cplusplus +} +#endif + +#endif _FS_DEVICE_H