diff options
Diffstat (limited to 'blocks.ha')
-rw-r--r-- | blocks.ha | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/blocks.ha b/blocks.ha new file mode 100644 index 0000000..d9a3048 --- /dev/null +++ b/blocks.ha @@ -0,0 +1,18 @@ +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); |