# Generated by cstruct-stubgen
from typing import BinaryIO, TypeAlias, overload

import dissect.cstruct as __cs__

class _c_ewf(__cs__.cstruct):
    class MediaType(__cs__.Enum):
        Removable = ...
        Fixed = ...
        Optical = ...
        Logical = ...
        RAM = ...

    class MediaFlags(__cs__.Enum):
        Image = ...
        Physical = ...
        Fastbloc = ...
        Tablaeu = ...

    class CompressionLevel(__cs__.Enum):
        # None = ...
        Good = ...
        Best = ...

    class EWFHeader(__cs__.Structure):
        signature: __cs__.CharArray
        fields_start: _c_ewf.uint8
        segment_number: _c_ewf.uint16
        fields_end: _c_ewf.uint16
        @overload
        def __init__(
            self,
            signature: __cs__.CharArray | None = ...,
            fields_start: _c_ewf.uint8 | None = ...,
            segment_number: _c_ewf.uint16 | None = ...,
            fields_end: _c_ewf.uint16 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    class EWFSectionDescriptor(__cs__.Structure):
        type: __cs__.CharArray
        next: _c_ewf.uint64
        size: _c_ewf.uint64
        pad: __cs__.Array[_c_ewf.uint8]
        checksum: _c_ewf.uint32
        @overload
        def __init__(
            self,
            type: __cs__.CharArray | None = ...,
            next: _c_ewf.uint64 | None = ...,
            size: _c_ewf.uint64 | None = ...,
            pad: __cs__.Array[_c_ewf.uint8] | None = ...,
            checksum: _c_ewf.uint32 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    class EWFVolumeSectionSpec(__cs__.Structure):
        reserved_1: _c_ewf.uint32
        chunk_count: _c_ewf.uint32
        sector_count: _c_ewf.uint32
        sector_size: _c_ewf.uint32
        total_sector_count: _c_ewf.uint32
        reserved: __cs__.Array[_c_ewf.uint8]
        pad: __cs__.Array[_c_ewf.uint8]
        signature: __cs__.CharArray
        checksum: _c_ewf.uint32
        @overload
        def __init__(
            self,
            reserved_1: _c_ewf.uint32 | None = ...,
            chunk_count: _c_ewf.uint32 | None = ...,
            sector_count: _c_ewf.uint32 | None = ...,
            sector_size: _c_ewf.uint32 | None = ...,
            total_sector_count: _c_ewf.uint32 | None = ...,
            reserved: __cs__.Array[_c_ewf.uint8] | None = ...,
            pad: __cs__.Array[_c_ewf.uint8] | None = ...,
            signature: __cs__.CharArray | None = ...,
            checksum: _c_ewf.uint32 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    class EWFVolumeSection(__cs__.Structure):
        media_type: _c_ewf.MediaType
        reserved_1: __cs__.Array[_c_ewf.uint8]
        chunk_count: _c_ewf.uint32
        sector_count: _c_ewf.uint32
        sector_size: _c_ewf.uint32
        total_sector_count: _c_ewf.uint64
        num_cylinders: _c_ewf.uint32
        num_heads: _c_ewf.uint32
        num_sectors: _c_ewf.uint32
        media_flags: _c_ewf.uint8
        unknown_1: __cs__.Array[_c_ewf.uint8]
        palm_start_sector: _c_ewf.uint32
        unknown_2: _c_ewf.uint32
        smart_start_sector: _c_ewf.uint32
        compression_level: _c_ewf.CompressionLevel
        unknown_3: __cs__.Array[_c_ewf.uint8]
        error_granularity: _c_ewf.uint32
        unknown_4: _c_ewf.uint32
        uuid: __cs__.Array[_c_ewf.uint8]
        pad: __cs__.Array[_c_ewf.uint8]
        signature: __cs__.CharArray
        checksum: _c_ewf.uint32
        @overload
        def __init__(
            self,
            media_type: _c_ewf.MediaType | None = ...,
            reserved_1: __cs__.Array[_c_ewf.uint8] | None = ...,
            chunk_count: _c_ewf.uint32 | None = ...,
            sector_count: _c_ewf.uint32 | None = ...,
            sector_size: _c_ewf.uint32 | None = ...,
            total_sector_count: _c_ewf.uint64 | None = ...,
            num_cylinders: _c_ewf.uint32 | None = ...,
            num_heads: _c_ewf.uint32 | None = ...,
            num_sectors: _c_ewf.uint32 | None = ...,
            media_flags: _c_ewf.uint8 | None = ...,
            unknown_1: __cs__.Array[_c_ewf.uint8] | None = ...,
            palm_start_sector: _c_ewf.uint32 | None = ...,
            unknown_2: _c_ewf.uint32 | None = ...,
            smart_start_sector: _c_ewf.uint32 | None = ...,
            compression_level: _c_ewf.CompressionLevel | None = ...,
            unknown_3: __cs__.Array[_c_ewf.uint8] | None = ...,
            error_granularity: _c_ewf.uint32 | None = ...,
            unknown_4: _c_ewf.uint32 | None = ...,
            uuid: __cs__.Array[_c_ewf.uint8] | None = ...,
            pad: __cs__.Array[_c_ewf.uint8] | None = ...,
            signature: __cs__.CharArray | None = ...,
            checksum: _c_ewf.uint32 | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

    class EWFTableSection(__cs__.Structure):
        num_entries: _c_ewf.uint32
        _: _c_ewf.uint32
        base_offset: _c_ewf.uint64
        checksum: _c_ewf.uint32
        entries: __cs__.Array[_c_ewf.uint32]
        @overload
        def __init__(
            self,
            num_entries: _c_ewf.uint32 | None = ...,
            _: _c_ewf.uint32 | None = ...,
            base_offset: _c_ewf.uint64 | None = ...,
            checksum: _c_ewf.uint32 | None = ...,
            entries: __cs__.Array[_c_ewf.uint32] | None = ...,
        ): ...
        @overload
        def __init__(self, fh: bytes | memoryview | bytearray | BinaryIO, /): ...

# Technically `c_ewf` is an instance of `_c_ewf`, but then we can't use it in type hints
c_ewf: TypeAlias = _c_ewf
