Changeset 30440ed in mainline for uspace/lib/mbr/libmbr.h


Ignore:
Timestamp:
2013-04-08T23:15:42Z (11 years ago)
Author:
Dominik Taborsky (AT DOT) <brembyseznamcz>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
256cbfe
Parents:
271e24a
Message:

save progress

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/mbr/libmbr.h

    r271e24a r30440ed  
    3939
    4040#define LIBMBR_NAME     "libmbr"
     41
     42#ifdef DEBUG_CONFIG
     43#include <stdio.h>
     44#include <str_error.h>
     45#define DEBUG_PRINT_0(str) \
     46        printf("%s:%d: " str, __FILE__, __LINE__)
     47#define DEBUG_PRINT_1(str, arg1) \
     48        printf("%s:%d: " str, __FILE__, __LINE__, arg1)
     49#define DEBUG_PRINT_2(str, arg1, arg2) \
     50        printf("%s:%d: " str, __FILE__, __LINE__, arg1, arg2)
     51#define DEBUG_PRINT_3(str, arg1, arg2, arg3) \
     52        printf("%s:%d: " str, __FILE__, __LINE__, arg1, arg2, arg3)
     53#else
     54#define DEBUG_PRINT_0(str)
     55#define DEBUG_PRINT_1(str, arg1)
     56#define DEBUG_PRINT_2(str, arg1, arg2)
     57#define DEBUG_PRINT_3(str, arg1, arg2, arg3)
     58#endif
    4159
    4260/** Number of primary partition records */
     
    105123        /** Device where the data are from */
    106124        service_id_t device;
    107         /** Pointer to partition list */
    108         //list of partitions;   //if we keep this in here, we should free() it in mbr_free_mbr()
    109125} mbr_t;
    110126
    111127
    112 //FIXME: make mbr_partitions_t as the linked list for keeping the same interface as with GPT
    113128/** Partition */
    114129typedef struct mbr_part {
     
    127142} mbr_part_t;
    128143
     144/** Partition list structure */
    129145typedef struct mbr_parts {
    130146        /** Number of primary partitions */
     
    138154} mbr_partitions_t;
    139155
     156/** Both header and partition list */
    140157typedef struct mbr_table {
    141158        mbr_t * mbr;
     
    151168extern int mbr_is_mbr(mbr_t * mbr);
    152169
    153 /** Read/Write/Set MBR partitions. */
     170/** Read/Write/Set MBR partitions.
     171 * NOTE: Writing partitions writes the complete header as well. */
    154172extern mbr_partitions_t * mbr_read_partitions(mbr_t * mbr);
    155173extern int                      mbr_write_partitions(mbr_partitions_t * parts, mbr_t * mbr, service_id_t dev_handle);
Note: See TracChangeset for help on using the changeset viewer.