type BlockId = u32; let BLOCKS = IDREG_EMPTY; fn destroy_blocks() void = { idreg_clear(&BLOCKS); }; fn blocks_register(ident: str) BlockId = { const blk = idreg_register(&BLOCKS, ident); bstates_handle_blocks_onregister(blk); return blk; }; fn blocks_count() u32 = idreg_count(&BLOCKS); fn block_getident(blk: BlockId) str = idreg_getname(&BLOCKS, blk);