PageRenderTime 31ms CodeModel.GetById 14ms app.highlight 13ms RepoModel.GetById 1ms app.codeStats 0ms

/runtime/assocarray.d

http://github.com/wilkie/djehuty
D | 84 lines | 39 code | 14 blank | 31 comment | 0 complexity | 781e16c792c5c58a976e8d071c835fdf MD5 | raw file
 1/*
 2 * assocarray.d
 3 *
 4 * This module implements the D runtime functions that involve
 5 * associative arrays.
 6 *
 7 */
 8
 9module runtime.assocarray;
10
11import runtime.common;
12
13extern(C):
14
15// Description: This runtime function will determine the number of entries in
16//   an associative array.
17// Returns: The number of entries in the array.
18size_t _aaLen(AA aa) {
19	return 0;
20}
21
22// Description: This runtime function will return a pointer to the value
23//   in an associative array at a particular key and add the entry if
24//   it does not exist.
25// Returns: A pointer to the value associated with the given key.
26void* _aaGetp(AA* aa, TypeInfo keyti, size_t valuesize, void* pkey) {
27	return null;
28}
29
30void* _aaGetRvaluep(AA aa, TypeInfo keyti, size_t valuesize, void* pkey) {
31	return null;
32}
33
34// Description: This runtime function will get a pointer to a value in an
35//   associative array indexed by a key. Invoked via "aa[key]" and "key in aa".
36// Returns: null when the value is not in aa, the pointer to the value
37//   otherwise.
38void* _aaInp(AA aa, TypeInfo keyti, void* pkey) {
39	return null;
40}
41
42// Description: This runtime function will delete a value with the given key.
43//   It will do nothing if the value does not exist.
44void _aaDelp(AA aa, TypeInfo keyti, void* pkey) {
45}
46
47// Description: This runtime function will produce an array of values for
48//   an associative array.
49// Returns: An array of values.
50Array _aaValues(AA aa, size_t keysize, size_t valuesize) {
51	Array r;
52	return r;
53}
54
55// Description: This runtime function will rehash an associative array.
56AA _aaRehash(AA* paa, TypeInfo keyti) {
57	AA r;
58	return r;
59}
60
61// Description: This runtime function will produce an array of keys of an
62//   associative array.
63// Returns: An array of keys.
64Array _aaKeys(AA aa, size_t keysize) {
65	Array r;
66	return r;
67}
68
69// Description: This runtime function will handle a foreach for an associative
70//   array invoked as foreach(foo; aa).
71int _aaApply(AA aa, size_t keysize, aa_dg_t dg) {
72	return 0;
73}
74
75// Description: This runtime function will handle a foreach_reverse for an
76// associative array invoked as foreach_reverse(foo; aa).
77int _aaApply2(AA aa, size_t keysize, aa_dg2_t dg) {
78	return 0;
79}
80
81BB* _d_assocarrayliteralTp(TypeInfo_AssociativeArray ti, size_t length, 
82		void* keys, void* values) {
83	return null;
84}