summaryrefslogtreecommitdiff
path: root/dmagick/c/hashmap.d
blob: a0bcfb225e302ca2833876a8c998289152560b42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
module dmagick.c.hashmap;

import dmagick.c.magickType;

extern(C)
{
	struct HashmapInfo {}

	struct LinkedListInfo {}

	HashmapInfo* DestroyHashmap(HashmapInfo*);
	HashmapInfo* NewHashmap(const size_t, size_t function(const void*),
			MagickBooleanType function(const void*, const void*), void* function(void*), void* function(void*));

	LinkedListInfo* DestroyLinkedList(LinkedListInfo*, void* function(void*));
	LinkedListInfo* NewLinkedList(const size_t);

	MagickBooleanType AppendValueToLinkedList(LinkedListInfo*, const void*);
	MagickBooleanType CompareHashmapString(const void*, const void*);
	MagickBooleanType CompareHashmapStringInfo(const void*, const void*);
	MagickBooleanType InsertValueInLinkedList(LinkedListInfo*, const size_t, const void*);
	MagickBooleanType InsertValueInSortedLinkedList(LinkedListInfo*, int function(const void*, const void*), void**, const void*);
	MagickBooleanType IsHashmapEmpty(const HashmapInfo*);
	MagickBooleanType IsLinkedListEmpty(const LinkedListInfo*);
	MagickBooleanType LinkedListToArray(LinkedListInfo*, void**);
	MagickBooleanType PutEntryInHashmap(HashmapInfo*, const void*, const void*);

	size_t GetNumberOfElementsInLinkedList(const LinkedListInfo*);
	size_t GetNumberOfEntriesInHashmap(const HashmapInfo*);
	size_t HashPointerType(const void*);
	size_t HashStringType(const void*);
	size_t HashStringInfoType(const void*);

	void  ClearLinkedList(LinkedListInfo*, void* function(void*));
	void* GetLastValueInLinkedList(LinkedListInfo*);
	void* GetNextKeyInHashmap(HashmapInfo*);
	void* GetNextValueInHashmap(HashmapInfo*);
	void* GetNextValueInLinkedList(LinkedListInfo*);
	void* GetValueFromHashmap(HashmapInfo*, const void*);
	void* GetValueFromLinkedList(LinkedListInfo*, const size_t);
	void* RemoveElementByValueFromLinkedList(LinkedListInfo*, const void*);
	void* RemoveElementFromLinkedList(LinkedListInfo*, const size_t);
	void* RemoveEntryFromHashmap(HashmapInfo*, const void*);
	void* RemoveLastElementFromLinkedList(LinkedListInfo*);
	void  ResetHashmapIterator(HashmapInfo*);
	void  ResetLinkedListIterator(LinkedListInfo*);
}