HelenOS sources
#ifndef UDF_UDF_TYPES_H_
#define UDF_UDF_TYPES_H_
#include <stdint.h>
#include <stdbool.h>
#include <byteorder.h>
#define GET_LE16(x) x = uint16_t_le2host(x)
#define GET_LE32(x) x = uint32_t_le2host(x)
#define FLE16(x) uint16_t_le2host(x)
#define FLE32(x) uint32_t_le2host(x)
#define FLE64(x) uint64_t_le2host(x)
#define ALL_UP(n, b) ((n) / (b) + ((n) % (b) != 0))
#define EXT_LENGTH(x) (x & 0x3FFFFFFF)
typedef uint8_t udf_dstring;
typedef struct udf_timestamp {
uint16_t type_and_tz;
uint16_t year;
uint8_t month;
uint8_t day;
uint8_t hour;
uint8_t min;
uint8_t sec;
uint8_t centisec;
uint8_t h_of_mcsec;
uint8_t mcsec;
} __attribute__((packed)) udf_timestamp_t;
typedef struct udf_descriptor_tag {
uint16_t id;
uint16_t version;
uint8_t checksum;
uint8_t reserved;
uint16_t serial;
uint16_t descriptor_crc;
uint16_t descriptor_crc_length;
uint32_t location;
} __attribute__((packed)) udf_descriptor_tag_t;
typedef struct udf_regid {
uint8_t flags;
uint8_t id[23];
uint8_t id_suffix[8];
} __attribute__((packed)) udf_regid_t;
typedef struct udf_charspec {
uint8_t type;
uint8_t info[63];
} __attribute__((packed)) udf_charspec_t;
typedef struct udf_lb_addr {
uint32_t lblock_num;
uint16_t partition_num;
} __attribute__((packed)) udf_lb_addr_t;
typedef struct udf_long_ad {
uint32_t length;
udf_lb_addr_t location;
uint8_t implementation_use[6];
} __attribute__((packed)) udf_long_ad_t;
typedef struct udf_short_ad {
uint32_t length;
uint32_t position;
} __attribute__((packed)) udf_short_ad_t;
typedef struct udf_ext_ad {
uint32_t extent_length;
uint32_t recorded_length;
uint32_t info_length;
udf_lb_addr_t extent_location;
uint8_t implementation_use[2];
} __attribute__((packed)) udf_ext_ad_t;
typedef struct udf_extent {
uint32_t length;
uint32_t location;
} __attribute__((packed)) udf_extent_t;
typedef struct udf_terminating_descriptor {
udf_descriptor_tag_t tag;
uint8_t reserved[496];
} __attribute__((packed)) udf_terminating_descriptor_t;
typedef struct udf_unallocated_space_descriptor {
udf_descriptor_tag_t tag;
uint32_t sequence_number;
uint32_t allocation_descriptors_num;
udf_extent_t allocation_descriptors[0];
} __attribute__((packed)) udf_unallocated_space_descriptor_t;
#endif
HelenOS homepage, sources at GitHub