//! Storage engine modules
//!
//! Provides memory-mapped file storage with MVCC support and sectioned file storage.

pub mod data_structures;
pub mod dual_octree;
pub mod edge_store;
pub mod graph4d_storage;
pub mod graph_storage_manager;
pub mod manager;
pub mod manifest;
pub mod node_store;
pub mod paths;
pub mod prop_store;
pub mod sectioned;
pub mod sectioned_cfg;
pub mod sectioned_graph;
pub mod sectioned_symbol;
pub mod spatial_page;
pub mod symbol_metadata;
pub mod wal;

// Re-export key graph storage types
pub use graph4d_storage::{load_graph4d, save_graph4d};
pub use graph_storage_manager::GraphStorageManager;
pub use manifest::{Manifest, MANIFEST_MAGIC, MANIFEST_VERSION};
pub use wal::Wal;

pub use data_structures::{EdgeRec, MetadataRec, NodePoint, NodeRec};
pub use manager::StorageManager;

// Re-export key sectioned storage types
pub use sectioned::{
    compute_checksum, decode_header, decode_section_entry, encode_header, encode_section_entry,
    GeoFileHeader, Section, SectionEntry, SectionedStorage, FILE_MAGIC, FORMAT_VERSION,
    HEADER_SIZE, HEADER_SIZE_USIZE, MAX_SECTION_NAME_LEN, SECTION_ENTRY_SIZE,
    SECTION_ENTRY_SIZE_USIZE,
};

// Re-export path helpers
pub use paths::{all_sidecar_paths, geo_cfg_path, geo_complexity_path, geo_idx_path};

// Re-export graph section adapter
pub use sectioned_graph::{GraphData, GraphSectionAdapter};

// Re-export CFG section adapter
pub use sectioned_cfg::{CfgData, CfgEdge, CfgSectionAdapter, SerializableCfgBlock};

// Re-export symbol metadata types
pub use sectioned_symbol::SymbolMetadataSectionAdapter;
pub use symbol_metadata::{
    FileTable, StringTable, SymbolMetadata, SymbolMetadataRec, SymbolMetadataStore,
};

// Re-export WAL types
// (Wal already re-exported above at line 22 — removed duplicate)

// Re-export WAL constants from data_structures
pub use data_structures::{
    WalEntry, WAL_ENTRY_ABORT_TX, WAL_ENTRY_BEGIN_TX, WAL_ENTRY_COMMIT_TX, WAL_ENTRY_EDGE_CREATE,
    WAL_ENTRY_EDGE_DELETE, WAL_ENTRY_NODE_CREATE, WAL_ENTRY_NODE_DELETE, WAL_ENTRY_PROPERTY_UPDATE,
};

// Re-export dual-octree spatial page storage
pub use dual_octree::{
    build_octree, point_query, range_query, DualEdgeType, DualGraph, DualVertex, OctreeNode,
    OctreePageStore,
};
pub use spatial_page::{
    build_spatial_pages, BoundingBox, PageLocalEdge, SpatialPage, SpatialPageHeader,
    DEFAULT_MAX_NODES_PER_PAGE, SPATIAL_PAGE_MAGIC, SPATIAL_PAGE_VERSION,
};
