Go to the source code of this file.
Data Structures
Struct that contains the version information of this library.
More...
Defines the iterator type for LuaHashMap.
More...
Macros
This macro fills in a version structure with the version of the library you compiled against.
LuaHashMap_SetValueForKey.
LuaHashMap_SetValueForKeyWithLength.
LuaHashMap_SetValueAtIterator.
#define
LuaHashMap_SetValue(...) LUAHASHMAP_MACRO_DISPATCHER(LUAHASHMAP_SETVALUE_, __VA_ARGS__)(__VA_ARGS__)
LuaHashMap_GetValueStringForKey.
LuaHashMap_GetValueStringForKeyWithLength.
LuaHashMap_GetValueString.
LuaHashMap_GetValuePointerForKey.
LuaHashMap_GetValueNumberForKey.
LuaHashMap_GetValueIntegerForKey.
LuaHashMap_GetValuePointer.
LuaHashMap_GetValueNumber.
LuaHashMap_GetValueInteger.
#define
LuaHashMap_Exists(...) LUAHASHMAP_MACRO_DISPATCHER(LUAHASHMAP_EXISTS_, __VA_ARGS__)(__VA_ARGS__)
#define
LuaHashMap_Remove(...) LUAHASHMAP_MACRO_DISPATCHER(LUAHASHMAP_REMOVE_, __VA_ARGS__)(__VA_ARGS__)
LuaHashMap_GetIteratorForKey.
Defined only if C11 _Generic support has been detected.
Typedefs
Functions
Gets the library version of the dynamically linked library you are using.
Creates a new instance of a hash table.
Creates a new instance of a hash table with a custom allocator.
Creates a new instance of a hash table with a suggested starting size.
Creates a new instance of a hash table with a custom allocator and a suggested starting size.
Special Memory Optimization: Allows you to create new LuaHashMaps from an existing one which will share the same lua_State under the hood.
Just like LuaHashMap_CreateShare, except it allows you to pre-size the hash map.
Special Memory Optimization: Allows you to create new LuaHashMaps from an existing lua_State.
Just like LuaHashMap_CreateShareFromLuaState but lets you specify your own allocator and pre-size hints.
Just like LuaHashMap_CreateShareFromLuaState but lets you specify your own pre-size hints.
Frees a LuaHashMap instance.
Frees a LuaHashMap instance (intended for those created with LuaHashMap_CreateShare or LuaHashMap_CreateShareFromLuaState).
Returns the lua_State being used by the LuaHashMap.
Adds a given key-value pair to the hash table.
Adds a given key-value pair to the hash table.
Adds a given key-value pair to the hash table.
Adds a given key-value pair to the hash table.
Adds a given key-value pair to the hash table.
Adds a given key-value pair to the hash table.
Adds a given key-value pair to the hash table.
Adds a given key-value pair to the hash table.
Adds a given key-value pair to the hash table.
Adds a given key-value pair to the hash table.
Adds a given key-value pair to the hash table.
Adds a given key-value pair to the hash table.
Adds a given key-value pair to the hash table.
Adds a given key-value pair to the hash table.
Adds a given key-value pair to the hash table.
Adds a given key-value pair to the hash table.
Adds a given key-value pair to the hash table.
Adds a given key-value pair to the hash table.
Adds a given key-value pair to the hash table.
Adds a given key-value pair to the hash table.
Adds a given key-value pair to the hash table.
Adds a given key-value pair to the hash table.
Adds a given key-value pair to the hash table.
Returns the value for specified key in the hash table.
Returns the value for specified key in the hash table.
Returns the value for specified key in the hash table.
Returns the value for specified key in the hash table.
Returns the value for specified key in the hash table.
Returns the value for specified key in the hash table.
Returns the value for specified key in the hash table.
Returns the value for specified key in the hash table.
Returns the value for specified key in the hash table.
Returns the value for specified key in the hash table.
Returns the value for specified key in the hash table.
Returns the value for specified key in the hash table.
Returns the value for specified key in the hash table.
Returns the value for specified key in the hash table.
Returns the value for specified key in the hash table.
Returns the value for specified key in the hash table.
Returns the value for specified key in the hash table.
Returns the value for specified key in the hash table.
Returns the value for specified key in the hash table.
Returns the value for specified key in the hash table.
Returns the value for specified key in the hash table.
Returns the value for specified key in the hash table.
Returns the value for specified key in the hash table.
Returns whether a key/value pair exists in the hash table for a specified key.
Returns whether a key/value pair exists in the hash table for a specified key.
Returns whether a key/value pair exists in the hash table for a specified key.
Returns whether a key/value pair exists in the hash table for a specified key.
Returns whether a key/value pair exists in the hash table for a specified key.
Removes a key/value pair in the hash table for a specified key.
Removes a key/value pair in the hash table for a specified key.
Removes a key/value pair in the hash table for a specified key.
Removes a key/value pair in the hash table for a specified key.
Removes a key/value pair in the hash table for a specified key.
Removes all entries from the hash table, but doesn't shrink the hash.
Removes all entries from the hash table and resets the hash size to 0 (reclaims memory) This removes all entries from the hash table and resets the hash size to 0 (reclaims memory).
Returns whether the hash table is empty or or not.
Returns an iterator at the start position of the hash table.
Returns an iterator at the end position of the hash table.
Increments the iterator to the next item in the hash table.
Returns an iterator corresponding to the specified key.
Returns an iterator corresponding to the specified key.
Returns an iterator corresponding to the specified key.
Returns an iterator corresponding to the specified key.
Returns an iterator corresponding to the specified key.
Returns true if the iterator is "NotFound".
Returns true if two iterators are equal.
Updates a value in the hash table pointed to by the iterator.
Updates a value in the hash table pointed to by the iterator.
Updates a value in the hash table pointed to by the iterator.
Updates a value in the hash table pointed to by the iterator.
Updates a value in the hash table pointed to by the iterator.
Returns the value in the hash table pointed to by the iterator.
Returns the value in the hash table pointed to by the iterator.
Returns the value in the hash table pointed to by the iterator.
Returns the value in the hash table pointed to by the iterator.
Returns the value in the hash table pointed to by the iterator.
Returns whether a key/value pair exists in the hash table pointed to by the iterator.
Removes a key/value pair in the hash table pointed to by the iterator.
Returns the type of the value in the hash table pointed to by the iterator.
Returns the type of the key in the iterator.
Returns the key corresponding to the iterator.
Returns the key corresponding to the iterator.
Returns the string length of the key corresponding to the iterator.
Returns the key corresponding to the iterator.
Returns the key corresponding to the iterator.
Returns the key corresponding to the iterator.
Returns the type of the cached value in the iterator.
Returns the cached value saved in the iterator.
Returns the cached value saved in the iterator.
Returns the string length of the cached value saved in the iterator.
Returns the cached value saved in the iterator.
Returns the cached value saved in the iterator.
Returns the cached value saved in the iterator.
(Experimental) Returns the number of items in the hash table.
Macro Definition Documentation
#define LUAHASHMAP_GET_COMPILED_VERSION
(
X )
Value:
This macro fills in a version structure with the version of the library you compiled against.
This is determined by what header the compiler uses. Note that if you dynamically linked the library, you might have a slightly newer or older version at runtime. That version can be determined with LuaHashMap_GetLinkedVersion(), which, unlike LUAHASHMAP_GET_COMPILED_VERSION, is not a macro.
- Parameters
-
- See Also
- LuaHashMapVersion, LuaHashMap_GetLinkedVersion
#define LUAHASHMAP_MAJOR_VERSION 1
#define LUAHASHMAP_MINOR_VERSION 0
#define LUAHASHMAP_PATCHLEVEL 0
#define LUAHASHMAP_SHOULD_USE_C_GENERICS 1
Typedef Documentation
Function Documentation
(Experimental) Returns the number of items in the hash table.
This returns the number of key/value pairs currently in your hash table. This is O(n). Since it is slow, it should be used sparingly.
- Parameters
-
hash_map The LuaHashMap instance to operate on
- Returns
- Returns the number of items in the hash table.
size_t LuaHashMap_GetKeysInteger
(
LuaHashMap *
hash_map,
lua_Integer
keys_array[],
size_t
max_array_size
)
size_t LuaHashMap_GetKeysNumber
(
LuaHashMap *
hash_map,
lua_Number
keys_array[],
size_t
max_array_size
)
size_t LuaHashMap_GetKeysPointer
(
LuaHashMap *
hash_map,
void *
keys_array[],
size_t
max_array_size
)
size_t LuaHashMap_GetKeysString
(
LuaHashMap *
hash_map,
const char *
keys_array[],
size_t
max_array_size
)
Gets the library version of the dynamically linked library you are using.
This gets the version of the library that is linked against your program. If you are using a shared library (DLL) version, then it is possible that it will be different than the version you compiled against.
This is a real function; the macro LUAHASHMAP_GET_COMPILED_VERSION tells you what version of the library you compiled against:
printf("We compiled against version %d.%d.%d ...\n",
printf("But we linked against version %d.%d.%d.\n",
- See Also
- LuaHashMapVersion, LUAHASHMAP_GET_COMPILED_VERSION
lua_State* LuaHashMap_GetLuaState
(
LuaHashMap *
hash_map )
Returns the lua_State being used by the LuaHashMap.
This is only for backdoor access. This is for very advanced use cases that want to directly interact with the Lua State.
- Parameters
-
hash_map The LuaHashMap instance to operate on.
- Returns
- The lua_State used by the hash_map.