VgaGames 3 - Hashmap man-pages

[.. upper level ..]

VG3_hash_list()

Listing entries of a hashmap: return next key.
SYNTAX
const void * VG3_hash_list(struct vg3_hash *hhash, void **vpos, size_t *keysize)

FUNCTION PARAMETERS
hhash Hashmap
vpos For passing and returning actual position pointer
keysize Size of the key in bytes

RETURN VALUE
Returns next key.

DESCRIPTION
Listing entries of a hashmap: return next key. This function allows to iterate a hashmap until the position pointer vpos returns NULL.

EXAMPLE

Listing of a hashmap:
  struct vg3_hash *hashmap = VG3_hash_new();
  void *vpos;
  const char *key;
  size_t keysize;

  [... setting hashmap ...]

  vpos = NULL;
  for (key = VG3_hash_list(hashmap, &vpos, &keysize); vpos != NULL; key = VG3_hash_list(hashmap, &vpos, &keysize)) {
    printf("- %.*s\n", (int)keysize, key);
    vpos = VG3_hash_del(hashmap, key, keysize);  // remove entry
  }

SEE ALSO
VG3_hash_new() VG3_hash_free() VG3_hash_clone() VG3_hash_set() VG3_hash_setint() VG3_hash_del() VG3_hash_clear() VG3_hash_isset() VG3_hash_isnum() VG3_hash_get() VG3_hash_getint()