FreeRDP
|
#include <winpr/config.h>
#include <winpr/assert.h>
#include <winpr/crt.h>
#include <winpr/collections.h>
Functions | |
WINPR_API wObject * | ListDictionary_KeyObject (wListDictionary *_dictionary) |
Get the wObject function pointer struct for the key of the dictionary. More... | |
WINPR_API wObject * | ListDictionary_ValueObject (wListDictionary *_dictionary) |
Get the wObject function pointer struct for the value of the dictionary. More... | |
size_t | ListDictionary_Count (wListDictionary *listDictionary) |
Return the number of entries in the dictionary. More... | |
void | ListDictionary_Lock (wListDictionary *listDictionary) |
mutex-lock a dictionary More... | |
void | ListDictionary_Unlock (wListDictionary *listDictionary) |
mutex-unlock a dictionary More... | |
size_t | ListDictionary_GetKeys (wListDictionary *listDictionary, ULONG_PTR **ppKeys) |
return all keys the dictionary contains More... | |
static void | item_free (wListDictionary *listDictionary, wListDictionaryItem *item) |
static void | item_set (wListDictionary *listDictionary, wListDictionaryItem *item, const void *value) |
static wListDictionaryItem * | new_item (wListDictionary *listDictionary, const void *key, const void *value) |
BOOL | ListDictionary_Add (wListDictionary *listDictionary, const void *key, const void *value) |
mutex-lock a dictionary More... | |
void | ListDictionary_Clear (wListDictionary *listDictionary) |
Remove all items from the dictionary and call fnObjectFree for key and value. More... | |
BOOL | ListDictionary_Contains (wListDictionary *listDictionary, const void *key) |
Check if a dictionary contains key (fnObjectEquals of the key object is called) More... | |
static void * | ListDictionary_RemoveOrTake (wListDictionary *listDictionary, const void *key, BOOL take) |
void | ListDictionary_Remove (wListDictionary *listDictionary, const void *key) |
Remove an item from the dictionary and call fnObjectFree for key and value. More... | |
void * | ListDictionary_Take (wListDictionary *listDictionary, const void *key) |
Remove an item from the dictionary and return the value. Cleanup is up to the caller. More... | |
static void * | ListDictionary_Remove_Or_Take_Head (wListDictionary *listDictionary, BOOL take) |
void | ListDictionary_Remove_Head (wListDictionary *listDictionary) |
Remove the head item from the dictionary and call fnObjectFree for key and value. More... | |
void * | ListDictionary_Take_Head (wListDictionary *listDictionary) |
Remove the head item from the dictionary and return the value. Cleanup is up to the caller. More... | |
void * | ListDictionary_GetItemValue (wListDictionary *listDictionary, const void *key) |
Get the value in the dictionary for a key. The ownership of the data stays with the dictionary. More... | |
BOOL | ListDictionary_SetItemValue (wListDictionary *listDictionary, const void *key, const void *value) |
Set the value in the dictionary for a key. The entry must already exist, value is copied if fnObjectNew is set. More... | |
static BOOL | default_equal_function (const void *obj1, const void *obj2) |
wListDictionary * | ListDictionary_New (BOOL synchronized) |
allocate a new dictionary More... | |
void | ListDictionary_Free (wListDictionary *listDictionary) |
Free memory allocated by a dictionary. Calls ListDictionary_Clear. More... | |
|
static |
|
static |
|
static |
BOOL ListDictionary_Add | ( | wListDictionary * | listDictionary, |
const void * | key, | ||
const void * | value | ||
) |
mutex-lock a dictionary
Adds an entry with the specified key and value into the ListDictionary.
void ListDictionary_Clear | ( | wListDictionary * | listDictionary | ) |
Remove all items from the dictionary and call fnObjectFree for key and value.
Removes all entries from the ListDictionary.
BOOL ListDictionary_Contains | ( | wListDictionary * | listDictionary, |
const void * | key | ||
) |
Check if a dictionary contains key (fnObjectEquals of the key object is called)
Determines whether the ListDictionary contains a specific key.
size_t ListDictionary_Count | ( | wListDictionary * | listDictionary | ) |
Return the number of entries in the dictionary.
Properties Gets the number of key/value pairs contained in the ListDictionary.
void ListDictionary_Free | ( | wListDictionary * | listDictionary | ) |
Free memory allocated by a dictionary. Calls ListDictionary_Clear.
listDictionary | A dictionary to query, may be NULL |
void* ListDictionary_GetItemValue | ( | wListDictionary * | listDictionary, |
const void * | key | ||
) |
Get the value in the dictionary for a key. The ownership of the data stays with the dictionary.
Get an item value using key
size_t ListDictionary_GetKeys | ( | wListDictionary * | listDictionary, |
ULONG_PTR ** | ppKeys | ||
) |
return all keys the dictionary contains
Methods Gets the list of keys as an array
Get the wObject function pointer struct for the key of the dictionary.
C equivalent of the C# ListDictionary Class: http://msdn.microsoft.com/en-us/library/system.collections.specialized.listdictionary.aspx
Internal implementation uses a singly-linked list
void ListDictionary_Lock | ( | wListDictionary * | listDictionary | ) |
mutex-lock a dictionary
Lock access to the ListDictionary
wListDictionary* ListDictionary_New | ( | BOOL | synchronized | ) |
allocate a new dictionary
Construction, Destruction
void ListDictionary_Remove | ( | wListDictionary * | listDictionary, |
const void * | key | ||
) |
Remove an item from the dictionary and call fnObjectFree for key and value.
listDictionary | A dictionary to query, must not be NULL |
key | The key identifying the entry |
void ListDictionary_Remove_Head | ( | wListDictionary * | listDictionary | ) |
Remove the head item from the dictionary and call fnObjectFree for key and value.
listDictionary | A dictionary to query, must not be NULL |
|
static |
Removes the first (head) entry from the list
|
static |
Removes the entry with the specified key from the ListDictionary.
BOOL ListDictionary_SetItemValue | ( | wListDictionary * | listDictionary, |
const void * | key, | ||
const void * | value | ||
) |
Set the value in the dictionary for a key. The entry must already exist, value is copied if fnObjectNew is set.
Set an item value using key
void* ListDictionary_Take | ( | wListDictionary * | listDictionary, |
const void * | key | ||
) |
Remove an item from the dictionary and return the value. Cleanup is up to the caller.
listDictionary | A dictionary to query, must not be NULL |
key | The key identifying the entry |
void* ListDictionary_Take_Head | ( | wListDictionary * | listDictionary | ) |
Remove the head item from the dictionary and return the value. Cleanup is up to the caller.
listDictionary | A dictionary to query, must not be NULL |
void ListDictionary_Unlock | ( | wListDictionary * | listDictionary | ) |
mutex-unlock a dictionary
Unlock access to the ListDictionary
|
static |