Ignore:
Timestamp:
2015-06-22T21:20:23Z (9 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1356f85a
Parents:
e96047c
Message:

UI for creating and deleting partitions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/fdisk/include/types/fdisk.h

    re96047c r8227d63  
    4141#include <stdint.h>
    4242
     43typedef enum {
     44        cu_byte = 0,
     45        cu_kbyte,
     46        cu_mbyte,
     47        cu_gbyte,
     48        cu_tbyte,
     49        cu_pbyte,
     50        cu_ebyte,
     51        cu_zbyte,
     52        cu_ybyte
     53} fdisk_cunit_t;
     54
     55#define CU_LIMIT (cu_ybyte + 1)
     56
     57/** File system type */
     58typedef enum {
     59        fdfs_none = 0,
     60        fdfs_unknown,
     61        fdfs_exfat,
     62        fdfs_fat,
     63        fdfs_minix,
     64        fdfs_ext4
     65} fdisk_fstype_t;
     66
     67/** Highest fstype value + 1 */
     68#define FDFS_LIMIT (fdfs_ext4 + 1)
     69/** Lowest fstype allowed for creation */
     70#define FDFS_CREATE_LO fdfs_exfat
     71/** Highest fstype allowed for creation + 1 */
     72#define FDFS_CREATE_HI (fdfs_ext4 + 1)
     73
     74/** Partition capacity */
     75typedef struct {
     76        uint64_t value;
     77        fdisk_cunit_t cunit;
     78} fdisk_cap_t;
     79
    4380/** List of devices available for managing by fdisk */
    4481typedef struct {
     
    70107} fdisk_label_type_t;
    71108
     109/** Highest label type + 1 */
     110#define FDL_LIMIT (fdl_gpt + 1)
     111/** Lowest label type allowed for creation */
     112#define FDL_CREATE_LO fdl_mbr
     113/** Highest label type allowed for creation + 1 */
     114#define FDL_CREATE_HI (fdl_gpt + 1)
     115
    72116/** Open fdisk device */
    73117typedef struct {
     118        /** Label type */
    74119        fdisk_label_type_t ltype;
     120        /** Partitions */
     121        list_t parts; /* of fdisk_part_t */
     122        /** Service ID */
     123        service_id_t sid;
    75124} fdisk_dev_t;
    76125
     
    82131/** Partition */
    83132typedef struct {
     133        /** Containing device */
     134        fdisk_dev_t *dev;
     135        /** Link to fdisk_dev_t.parts */
     136        link_t ldev;
     137        /** Capacity */
     138        fdisk_cap_t capacity;
     139        /** File system type */
     140        fdisk_fstype_t fstype;
    84141} fdisk_part_t;
    85 
    86 typedef enum {
    87         cu_byte = 0,
    88         cu_kbyte,
    89         cu_mbyte,
    90         cu_gbyte,
    91         cu_tbyte,
    92         cu_pbyte,
    93         cu_ebyte,
    94         cu_zbyte,
    95         cu_ybyte
    96 } fdisk_cunit_t;
    97 
    98 /** Partition capacity */
    99 typedef struct {
    100         uint64_t value;
    101         fdisk_cunit_t cunit;
    102 } fdisk_cap_t;
    103142
    104143/** Specification of new partition */
    105144typedef struct {
    106 } fdisk_partspec_t;
     145        /** Desired capacity */
     146        fdisk_cap_t capacity;
     147        /** File system type */
     148        fdisk_fstype_t fstype;
     149} fdisk_part_spec_t;
     150
     151/** Partition info */
     152typedef struct {
     153        fdisk_cap_t capacity;
     154        /** File system type */
     155        fdisk_fstype_t fstype;
     156} fdisk_part_info_t;
    107157
    108158#endif
Note: See TracChangeset for help on using the changeset viewer.