Lines Matching defs:tf

112     struct test_file *tf, int depth)
127 if (tf == NULL) {
128 tf = calloc(1, sizeof(struct test_file));
129 if (tf == NULL)
132 } else if (tf->tf_isdir) {
134 closedir(tf->tf_u.dir);
145 tf->tf_isdir = 1;
146 tf->tf_u.dir = fdopendir(dir_fd);
148 if (fstat(dir_fd, &tf->tf_stat) < 0) {
152 tf->tf_size = tf->tf_stat.st_size;
162 if (!tf->tf_isdir)
174 dir_fd = dirfd(tf->tf_u.dir);
184 if (fstatat(dir_fd, component, &tf->tf_stat,
189 tf->tf_size = tf->tf_stat.st_size;
195 if (!S_ISDIR(tf->tf_stat.st_mode) &&
196 !S_ISREG(tf->tf_stat.st_mode) &&
197 !S_ISLNK(tf->tf_stat.st_mode))
201 if (!S_ISLNK(tf->tf_stat.st_mode)) {
207 if (S_ISDIR(tf->tf_stat.st_mode)) {
211 closedir(tf->tf_u.dir);
214 tf->tf_isdir = 1;
215 tf->tf_u.dir = fdopendir(comp_fd);
216 if (!tf->tf_u.dir)
218 } else if (S_ISREG(tf->tf_stat.st_mode)) {
222 closedir(tf->tf_u.dir);
225 tf->tf_isdir = 0;
226 tf->tf_u.fd = comp_fd;
227 } else if (S_ISLNK(tf->tf_stat.st_mode)) {
240 tf, depth);
248 *h_return = tf;
253 if (tf->tf_isdir)
254 closedir(tf->tf_u.dir);
256 close(tf->tf_u.fd);
257 free(tf);
273 struct test_file *tf = h;
275 if (tf->tf_isdir)
276 closedir(tf->tf_u.dir);
278 close(tf->tf_u.fd);
279 free(tf);
287 struct test_file *tf = h;
289 return (tf->tf_isdir);
295 struct test_file *tf = h;
298 if (tf->tf_isdir)
300 sz = read(tf->tf_u.fd, dst, size);
311 struct test_file *tf = h;
314 if (!tf->tf_isdir)
317 dp = readdir(tf->tf_u.dir);
337 struct test_file *tf = h;
339 if (tf->tf_isdir)
341 if (lseek(tf->tf_u.fd, offset, whence) < 0)
349 struct test_file *tf = h;
354 stp->st_mode = tf->tf_stat.st_mode;
355 stp->st_uid = tf->tf_stat.st_uid;
356 stp->st_gid = tf->tf_stat.st_gid;
357 stp->st_size = tf->tf_stat.st_size;
358 stp->st_ino = tf->tf_stat.st_ino;
359 stp->st_dev = tf->tf_stat.st_dev;
360 stp->st_mtime = tf->tf_stat.st_mtime;