diff --git a/database/db_types.anubis b/database/db_types.anubis index 4043097..e60354e 100644 --- a/database/db_types.anubis +++ b/database/db_types.anubis @@ -48,6 +48,20 @@ public define Maybe(DB_id) } . +public define DB_id + find_DB_id + ( + Message msg, //Message in where we search the DB_id + String name, //name of DB_id in the Message + DB_id default //default value + )= + if find_DB_id(msg, name) is + { + failure then default, + success(db_id) then db_id + } +. + public define String to_String ( @@ -98,9 +112,10 @@ public define Int )= if idx is { - none then (Int)-1, + none then (Int)0, db_id(_idx) then _idx - }. + } +. public define Word32 to_Word32 -- libgit2 0.21.4