mirror of
https://github.com/FellippeHeitor/InForm.git
synced 2024-05-12 06:50:12 +00:00
23 lines
889 B
Plaintext
23 lines
889 B
Plaintext
'-----------------------------------------------------------------------------------------------------------------------
|
|
' A simple hash table for integers and QB64-PE handles
|
|
' Copyright (c) 2024 Samuel Gomes
|
|
'-----------------------------------------------------------------------------------------------------------------------
|
|
|
|
$IF HASHTABLE_BI = UNDEFINED THEN
|
|
$LET HASHTABLE_BI = TRUE
|
|
|
|
CONST __HASHTABLE_FALSE%% = 0%%, __HASHTABLE_TRUE%% = NOT __HASHTABLE_FALSE
|
|
CONST __HASHTABLE_KEY_EXISTS& = -1&
|
|
CONST __HASHTABLE_KEY_UNAVAILABLE& = -2&
|
|
|
|
' Hash table entry type
|
|
' To extended supported data types, add other value types after V and then write
|
|
' wrappers around __HashTable_GetInsertIndex() & __HashTable_GetLookupIndex()
|
|
TYPE HashTableType
|
|
U AS _BYTE ' used?
|
|
K AS _UNSIGNED LONG ' key
|
|
V AS LONG ' value
|
|
END TYPE
|
|
|
|
$END IF
|