mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-06-16 09:02:22 -07:00
improved stability w.r.t. cfgs and ctrl entities expansion across changes
This commit is contained in:
+25
-1
@@ -169,10 +169,34 @@ ctrl_handle_list_copy(Arena *arena, CTRL_HandleList *src)
|
||||
internal String8
|
||||
ctrl_string_from_handle(Arena *arena, CTRL_Handle handle)
|
||||
{
|
||||
String8 result = push_str8f(arena, "$%I64x_%I64x", handle.machine_id, handle.dmn_handle.u64[0]);
|
||||
String8 result = push_str8f(arena, "$0x%I64x$0x%I64x", handle.machine_id, handle.dmn_handle.u64[0]);
|
||||
return result;
|
||||
}
|
||||
|
||||
internal CTRL_Handle
|
||||
ctrl_handle_from_string(String8 string)
|
||||
{
|
||||
CTRL_Handle handle = {0};
|
||||
{
|
||||
Temp scratch = scratch_begin(0, 0);
|
||||
U8 split = '$';
|
||||
String8List parts = str8_split(scratch.arena, string, &split, 1, 0);
|
||||
if(parts.first && parts.first->next)
|
||||
{
|
||||
CTRL_MachineID machine_id = 0;
|
||||
DMN_Handle dmn_handle = {0};
|
||||
if(try_u64_from_str8_c_rules(parts.first->string, &machine_id) &&
|
||||
try_u64_from_str8_c_rules(parts.first->next->string, &dmn_handle.u64[0]))
|
||||
{
|
||||
handle.machine_id = machine_id;
|
||||
handle.dmn_handle = dmn_handle;
|
||||
}
|
||||
}
|
||||
scratch_end(scratch);
|
||||
}
|
||||
return handle;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Trap Type Functions
|
||||
|
||||
|
||||
Reference in New Issue
Block a user