dis 115 maint/gnulib/lib/di-set.c struct di_set *dis = malloc (sizeof *dis); dis 116 maint/gnulib/lib/di-set.c if (dis) dis 119 maint/gnulib/lib/di-set.c dis->dev_map = hash_initialize (INITIAL_DEV_MAP_SIZE, NULL, dis 122 maint/gnulib/lib/di-set.c if (! dis->dev_map) dis 124 maint/gnulib/lib/di-set.c free (dis); dis 127 maint/gnulib/lib/di-set.c dis->ino_map = NULL; dis 128 maint/gnulib/lib/di-set.c dis->probe = NULL; dis 131 maint/gnulib/lib/di-set.c return dis; dis 136 maint/gnulib/lib/di-set.c di_set_free (struct di_set *dis) dis 138 maint/gnulib/lib/di-set.c hash_free (dis->dev_map); dis 139 maint/gnulib/lib/di-set.c if (dis->ino_map) dis 140 maint/gnulib/lib/di-set.c ino_map_free (dis->ino_map); dis 141 maint/gnulib/lib/di-set.c free (dis->probe); dis 142 maint/gnulib/lib/di-set.c free (dis); dis 155 maint/gnulib/lib/di-set.c map_device (struct di_set *dis, dev_t dev) dis 159 maint/gnulib/lib/di-set.c struct di_ent *probe = dis->probe; dis 168 maint/gnulib/lib/di-set.c dis->probe = probe = malloc (sizeof *probe); dis 175 maint/gnulib/lib/di-set.c ent = hash_insert (dis->dev_map, probe); dis 189 maint/gnulib/lib/di-set.c dis->probe = NULL; dis 202 maint/gnulib/lib/di-set.c map_inode_number (struct di_set *dis, ino_t ino) dis 207 maint/gnulib/lib/di-set.c if (! dis->ino_map) dis 209 maint/gnulib/lib/di-set.c dis->ino_map = ino_map_alloc (LARGE_INO_MIN); dis 210 maint/gnulib/lib/di-set.c if (! dis->ino_map) dis 214 maint/gnulib/lib/di-set.c return ino_map_insert (dis->ino_map, ino); dis 222 maint/gnulib/lib/di-set.c di_set_insert (struct di_set *dis, dev_t dev, ino_t ino) dis 227 maint/gnulib/lib/di-set.c struct hash_table *ino_set = map_device (dis, dev); dis 232 maint/gnulib/lib/di-set.c i = map_inode_number (dis, ino); dis 244 maint/gnulib/lib/di-set.c di_set_lookup (struct di_set *dis, dev_t dev, ino_t ino) dis 249 maint/gnulib/lib/di-set.c struct hash_table *ino_set = map_device (dis, dev); dis 254 maint/gnulib/lib/di-set.c i = map_inode_number (dis, ino); dis 33 maint/gnulib/lib/di-set.h int di_set_lookup (struct di_set *dis, dev_t dev, ino_t ino) dis 28 maint/gnulib/tests/test-di-set.c struct di_set *dis = di_set_alloc (); dis 29 maint/gnulib/tests/test-di-set.c ASSERT (dis); dis 30 maint/gnulib/tests/test-di-set.c di_set_free (dis); /* free with dis->ino_map still being NULL */ dis 31 maint/gnulib/tests/test-di-set.c dis = di_set_alloc (); dis 32 maint/gnulib/tests/test-di-set.c ASSERT (dis); dis 34 maint/gnulib/tests/test-di-set.c ASSERT (di_set_lookup (dis, 2, 5) == 0); /* initial lookup fails */ dis 35 maint/gnulib/tests/test-di-set.c ASSERT (di_set_insert (dis, 2, 5) == 1); /* first insertion succeeds */ dis 36 maint/gnulib/tests/test-di-set.c ASSERT (di_set_insert (dis, 2, 5) == 0); /* duplicate fails */ dis 37 maint/gnulib/tests/test-di-set.c ASSERT (di_set_insert (dis, 3, 5) == 1); /* diff dev, duplicate inode is ok */ dis 38 maint/gnulib/tests/test-di-set.c ASSERT (di_set_insert (dis, 2, 8) == 1); /* same dev, different inode is ok */ dis 39 maint/gnulib/tests/test-di-set.c ASSERT (di_set_lookup (dis, 2, 5) == 1); /* now, the lookup succeeds */ dis 42 maint/gnulib/tests/test-di-set.c ASSERT (di_set_insert (dis, 5, (ino_t) -1) == 1); dis 43 maint/gnulib/tests/test-di-set.c ASSERT (di_set_insert (dis, 5, (ino_t) -1) == 0); /* dup */ dis 48 maint/gnulib/tests/test-di-set.c ASSERT (di_set_insert (dis, 9, i) == 1); dis 50 maint/gnulib/tests/test-di-set.c ASSERT (di_set_insert (dis, 9, i) == 0); /* duplicate fails */ dis 53 maint/gnulib/tests/test-di-set.c di_set_free (dis);