Lines Matching refs:handles
190 Handle handles[100]; variable
197 for (i = 0; i < sizeof(handles)/sizeof(Handle); i++) in handle_init()
198 handles[i].use = HANDLE_UNUSED; in handle_init()
206 for (i = 0; i < sizeof(handles)/sizeof(Handle); i++) { in handle_new()
207 if (handles[i].use == HANDLE_UNUSED) { in handle_new()
208 handles[i].use = use; in handle_new()
209 handles[i].dirp = dirp; in handle_new()
210 handles[i].fd = fd; in handle_new()
211 handles[i].name = xstrdup(name); in handle_new()
212 handles[i].bytes_read = handles[i].bytes_write = 0; in handle_new()
222 return i >= 0 && (u_int)i < sizeof(handles)/sizeof(Handle) && in handle_is_ok()
223 handles[i].use == type; in handle_is_ok()
256 return handles[handle].name; in handle_to_name()
264 return handles[handle].dirp; in handle_to_dir()
272 return handles[handle].fd; in handle_to_fd()
280 handles[handle].bytes_read += bytes; in handle_update_read()
287 handles[handle].bytes_write += bytes; in handle_update_write()
294 return (handles[handle].bytes_read); in handle_bytes_read()
302 return (handles[handle].bytes_write); in handle_bytes_write()
312 ret = close(handles[handle].fd); in handle_close()
313 handles[handle].use = HANDLE_UNUSED; in handle_close()
314 xfree(handles[handle].name); in handle_close()
316 ret = closedir(handles[handle].dirp); in handle_close()
317 handles[handle].use = HANDLE_UNUSED; in handle_close()
318 xfree(handles[handle].name); in handle_close()
346 for (i = 0; i < sizeof(handles)/sizeof(Handle); i++) in handle_log_exit()
347 if (handles[i].use != HANDLE_UNUSED) in handle_log_exit()