// 1 "runtime/stringtable.j" // 1 "" // 1 "" // 31 "" // 1 "/usr/include/stdc-predef.h" 1 3 4 // 32 "" 2 // 1 "runtime/stringtable.j" globals string array JHCR_StringTable_key integer array JHCR_StringTable_value endglobals function JHCR_StringTable_set takes integer JHCR_StringTable_tbl, string JHCR_StringTable_k, integer JHCR_StringTable_v returns nothing local integer JHCR_StringTable_lst = JHCR_Table_get_integer(JHCR_StringTable_tbl, StringHash(JHCR_StringTable_k)) local integer JHCR_StringTable_tmp = JHCR_StringTable_lst loop exitwhen JHCR_StringTable_tmp == 0 if JHCR_StringTable_key[JHCR_StringTable_tmp] == JHCR_StringTable_k then set JHCR_StringTable_value[JHCR_StringTable_tmp] = JHCR_StringTable_v return endif set JHCR_StringTable_tmp = JHCR_List_next[JHCR_StringTable_tmp] endloop set JHCR_StringTable_lst = JHCR_List_cons(JHCR_StringTable_lst) set JHCR_StringTable_key[JHCR_StringTable_lst] = JHCR_StringTable_k set JHCR_StringTable_value[JHCR_StringTable_lst] = JHCR_StringTable_v call JHCR_Table_set_integer(JHCR_StringTable_tbl, StringHash(JHCR_StringTable_k), JHCR_StringTable_lst) endfunction function JHCR_StringTable_get takes integer JHCR_StringTable_tbl, string JHCR_StringTable_k returns integer local integer JHCR_StringTable_lst = JHCR_Table_get_integer(JHCR_StringTable_tbl, StringHash(JHCR_StringTable_k)) loop exitwhen JHCR_StringTable_lst == 0 if JHCR_StringTable_key[JHCR_StringTable_lst] == JHCR_StringTable_k then return JHCR_StringTable_value[JHCR_StringTable_lst] endif set JHCR_StringTable_lst = JHCR_List_next[JHCR_StringTable_lst] endloop return 0 endfunction