File: ftw.h

package info (click to toggle)
libkarma 0.1.2-11
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 668 kB
  • sloc: ansic: 6,224; sh: 328; makefile: 220; cs: 170
file content (41 lines) | stat: -rw-r--r-- 1,110 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
 * Written by Felix von Leitner [see dietlibc]
 * The license for the diet libc is the GNU General Public License, version  2
 * (as included in the file LICENSE).
 */
#ifndef _FTW_H
#define _FTW_H

#include <sys/cdefs.h>
#include <sys/stat.h>

struct FTW {
    int base;
    int level;
};

int ftw (const char *dir, int (*fn)(const char *file,
         const struct stat *sb, int flag), int depth);

enum
{
    FTW_F,        /* Regular file.  */
#define FTW_F    FTW_F
    FTW_D,        /* Directory.  */
#define FTW_D    FTW_D
    FTW_DNR,      /* Unreadable directory.  */
#define FTW_DNR  FTW_DNR
    FTW_NS,       /* Unstatable file.  */
#define FTW_NS   FTW_NS
    FTW_SL,       /* Symbolic link.  */
# define FTW_SL  FTW_SL
/* These flags are only passed from the `nftw' function.  */
    FTW_DP,       /* Directory, all subdirs have been visited. */
# define FTW_DP  FTW_DP
    FTW_SLN       /* Symbolic link naming non-existing file.  */
# define FTW_SLN FTW_SLN
};

typedef int (*__ftw_func_t) (const char *__filename,
                             const struct stat *__status, int __flag);
#endif