Lines Matching refs:handle

100 	struct finddevhdl *handle;  in finddev_readdir_alt()  local
110 handle = calloc(1, sizeof (struct finddevhdl)); in finddev_readdir_alt()
111 if (handle == NULL) { in finddev_readdir_alt()
116 handle->npaths = 0; in finddev_readdir_alt()
117 handle->curpath = 0; in finddev_readdir_alt()
118 handle->paths = NULL; in finddev_readdir_alt()
129 handle->npaths = n; in finddev_readdir_alt()
130 handle->paths = calloc(n, sizeof (char *)); in finddev_readdir_alt()
131 if (handle->paths == NULL) { in finddev_readdir_alt()
132 free(handle); in finddev_readdir_alt()
143 if (n == handle->npaths) { in finddev_readdir_alt()
148 finddev_close((finddevhdl_t)handle); in finddev_readdir_alt()
151 handle->paths[n] = strdup(dp->d_name); in finddev_readdir_alt()
152 if (handle->paths[n] == NULL) { in finddev_readdir_alt()
154 finddev_close((finddevhdl_t)handle); in finddev_readdir_alt()
160 *handlep = (finddevhdl_t)handle; in finddev_readdir_alt()
178 struct finddevhdl *handle; in finddev_readdir_devfs() local
187 handle = calloc(1, sizeof (struct finddevhdl)); in finddev_readdir_devfs()
188 if (handle == NULL) in finddev_readdir_devfs()
191 handle->npaths = 0; in finddev_readdir_devfs()
192 handle->curpath = 0; in finddev_readdir_devfs()
193 handle->paths = NULL; in finddev_readdir_devfs()
197 free(handle); in finddev_readdir_devfs()
204 free(handle); in finddev_readdir_devfs()
215 handle->npaths = n; in finddev_readdir_devfs()
216 handle->paths = calloc(n, sizeof (char *)); in finddev_readdir_devfs()
217 if (handle->paths == NULL) { in finddev_readdir_devfs()
218 free(handle); in finddev_readdir_devfs()
224 handle->paths[n] = strdup(p); in finddev_readdir_devfs()
225 if (handle->paths[n] == NULL) { in finddev_readdir_devfs()
226 finddev_close((finddevhdl_t)handle); in finddev_readdir_devfs()
231 *handlep = (finddevhdl_t)handle; in finddev_readdir_devfs()
241 free(handle); in finddev_readdir_devfs()
319 struct finddevhdl *handle = (struct finddevhdl *)arg; in finddev_close() local
322 for (i = 0; i < handle->npaths; i++) { in finddev_close()
323 if (handle->paths[i]) in finddev_close()
324 free(handle->paths[i]); in finddev_close()
326 free(handle->paths); in finddev_close()
327 free(handle); in finddev_close()
333 struct finddevhdl *handle = (struct finddevhdl *)arg; in finddev_next() local
336 if (handle->curpath < handle->npaths) { in finddev_next()
337 path = handle->paths[handle->curpath]; in finddev_next()
338 handle->curpath++; in finddev_next()