Ignore:
Timestamp:
2015-07-02T16:30:16Z (9 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1626cd4
Parents:
78d50bd
Message:

Liblabel reading GPT and MBR partitions (primary only).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/label/include/types/liblabel.h

    r78d50bd r3faa03d  
    4242#include <vol.h>
    4343
     44typedef struct label label_t;
     45typedef struct label_part label_part_t;
     46typedef struct label_part_info label_part_info_t;
     47typedef struct label_part_spec label_part_spec_t;
     48
     49/** Ops for individual label type */
     50typedef struct {
     51        int (*open)(service_id_t, label_t **);
     52        int (*create)(service_id_t, label_t **);
     53        void (*close)(label_t *);
     54        int (*destroy)(label_t *);
     55        label_part_t *(*part_first)(label_t *);
     56        label_part_t *(*part_next)(label_part_t *);
     57        void (*part_get_info)(label_part_t *, label_part_info_t *);
     58        int (*part_create)(label_t *, label_part_spec_t *, label_part_t **);
     59        int (*part_destroy)(label_part_t *);
     60} label_ops_t;
     61
    4462typedef struct {
    4563        /** Disk contents */
     
    4967} label_info_t;
    5068
    51 typedef struct {
     69struct label_part_info {
    5270        /** Address of first block */
    5371        aoff64_t block0;
    5472        /** Number of blocks */
    5573        aoff64_t nblocks;
    56 } label_part_info_t;
     74};
    5775
    5876/** Partition */
    59 typedef struct {
     77struct label_part {
    6078        /** Containing label */
    6179        struct label *label;
    6280        /** Link to label_t.parts */
    6381        link_t llabel;
    64 } label_part_t;
     82        aoff64_t block0;
     83        aoff64_t nblocks;
     84};
    6585
    6686/** Specification of new partition */
    67 typedef struct {
    68 } label_part_spec_t;
     87struct label_part_spec {
     88};
    6989
    7090/** Label instance */
    71 typedef struct label {
     91struct label {
     92        /** Label type ops */
     93        label_ops_t *ops;
     94        /** Label type */
     95        label_type_t ltype;
    7296        /** Partitions */
    7397        list_t parts; /* of label_part_t */
    74 } label_t;
     98};
    7599
    76100#endif
Note: See TracChangeset for help on using the changeset viewer.