Lines Matching refs:handle
102 struct finddevhdl *handle; in finddev_readdir_alt() local
112 handle = calloc(1, sizeof (struct finddevhdl)); in finddev_readdir_alt()
113 if (handle == NULL) { in finddev_readdir_alt()
118 handle->npaths = 0; in finddev_readdir_alt()
119 handle->curpath = 0; in finddev_readdir_alt()
120 handle->paths = NULL; in finddev_readdir_alt()
131 handle->npaths = n; in finddev_readdir_alt()
132 handle->paths = calloc(n, sizeof (char *)); in finddev_readdir_alt()
133 if (handle->paths == NULL) { in finddev_readdir_alt()
134 free(handle); in finddev_readdir_alt()
145 if (n == handle->npaths) { in finddev_readdir_alt()
150 finddev_close((finddevhdl_t)handle); in finddev_readdir_alt()
153 handle->paths[n] = strdup(dp->d_name); in finddev_readdir_alt()
154 if (handle->paths[n] == NULL) { in finddev_readdir_alt()
156 finddev_close((finddevhdl_t)handle); in finddev_readdir_alt()
162 *handlep = (finddevhdl_t)handle; in finddev_readdir_alt()
180 struct finddevhdl *handle; in finddev_readdir_devfs() local
189 handle = calloc(1, sizeof (struct finddevhdl)); in finddev_readdir_devfs()
190 if (handle == NULL) in finddev_readdir_devfs()
193 handle->npaths = 0; in finddev_readdir_devfs()
194 handle->curpath = 0; in finddev_readdir_devfs()
195 handle->paths = NULL; in finddev_readdir_devfs()
199 free(handle); in finddev_readdir_devfs()
206 free(handle); in finddev_readdir_devfs()
217 handle->npaths = n; in finddev_readdir_devfs()
218 handle->paths = calloc(n, sizeof (char *)); in finddev_readdir_devfs()
219 if (handle->paths == NULL) { in finddev_readdir_devfs()
220 free(handle); in finddev_readdir_devfs()
226 handle->paths[n] = strdup(p); in finddev_readdir_devfs()
227 if (handle->paths[n] == NULL) { in finddev_readdir_devfs()
228 finddev_close((finddevhdl_t)handle); in finddev_readdir_devfs()
233 *handlep = (finddevhdl_t)handle; in finddev_readdir_devfs()
243 free(handle); in finddev_readdir_devfs()
321 struct finddevhdl *handle = (struct finddevhdl *)arg; in finddev_close() local
324 for (i = 0; i < handle->npaths; i++) { in finddev_close()
325 if (handle->paths[i]) in finddev_close()
326 free(handle->paths[i]); in finddev_close()
328 free(handle->paths); in finddev_close()
329 free(handle); in finddev_close()
335 struct finddevhdl *handle = (struct finddevhdl *)arg; in finddev_next() local
338 if (handle->curpath < handle->npaths) { in finddev_next()
339 path = handle->paths[handle->curpath]; in finddev_next()
340 handle->curpath++; in finddev_next()