/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. module runtime.assocarray;
  9. import runtime.common;
  10. extern(C):
  11. // Description: This runtime function will determine the number of entries in
  12. // an associative array.
  13. // Returns: The number of entries in the array.
  14. size_t _aaLen(AA aa) {
  15. return 0;
  16. }
  17. // Description: This runtime function will return a pointer to the value
  18. // in an associative array at a particular key and add the entry if
  19. // it does not exist.
  20. // Returns: A pointer to the value associated with the given key.
  21. void* _aaGetp(AA* aa, TypeInfo keyti, size_t valuesize, void* pkey) {
  22. return null;
  23. }
  24. void* _aaGetRvaluep(AA aa, TypeInfo keyti, size_t valuesize, void* pkey) {
  25. return null;
  26. }
  27. // Description: This runtime function will get a pointer to a value in an
  28. // associative array indexed by a key. Invoked via "aa[key]" and "key in aa".
  29. // Returns: null when the value is not in aa, the pointer to the value
  30. // otherwise.
  31. void* _aaInp(AA aa, TypeInfo keyti, void* pkey) {
  32. return null;
  33. }
  34. // Description: This runtime function will delete a value with the given key.
  35. // It will do nothing if the value does not exist.
  36. void _aaDelp(AA aa, TypeInfo keyti, void* pkey) {
  37. }
  38. // Description: This runtime function will produce an array of values for
  39. // an associative array.
  40. // Returns: An array of values.
  41. Array _aaValues(AA aa, size_t keysize, size_t valuesize) {
  42. Array r;
  43. return r;
  44. }
  45. // Description: This runtime function will rehash an associative array.
  46. AA _aaRehash(AA* paa, TypeInfo keyti) {
  47. AA r;
  48. return r;
  49. }
  50. // Description: This runtime function will produce an array of keys of an
  51. // associative array.
  52. // Returns: An array of keys.
  53. Array _aaKeys(AA aa, size_t keysize) {
  54. Array r;
  55. return r;
  56. }
  57. // Description: This runtime function will handle a foreach for an associative
  58. // array invoked as foreach(foo; aa).
  59. int _aaApply(AA aa, size_t keysize, aa_dg_t dg) {
  60. return 0;
  61. }
  62. // Description: This runtime function will handle a foreach_reverse for an
  63. // associative array invoked as foreach_reverse(foo; aa).
  64. int _aaApply2(AA aa, size_t keysize, aa_dg2_t dg) {
  65. return 0;
  66. }
  67. BB* _d_assocarrayliteralTp(TypeInfo_AssociativeArray ti, size_t length,
  68. void* keys, void* values) {
  69. return null;
  70. }