Denis Vlasenko | c4f623e | 2006-12-26 01:30:59 +0000 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
| 2 | /* |
| 3 | * See README for additional information |
| 4 | * |
| 5 | * This file can be redistributed under the terms of the GNU Library General |
| 6 | * Public License |
| 7 | */ |
| 8 | |
| 9 | /* Constants and structures */ |
| 10 | #include "e2fs_defs.h" |
| 11 | |
Denis Vlasenko | 98636eb | 2008-05-09 17:59:34 +0000 | [diff] [blame] | 12 | #if __GNUC_PREREQ(4,1) |
| 13 | # pragma GCC visibility push(hidden) |
| 14 | #endif |
| 15 | |
Denis Vlasenko | c4f623e | 2006-12-26 01:30:59 +0000 | [diff] [blame] | 16 | /* Iterate a function on each entry of a directory */ |
| 17 | int iterate_on_dir(const char *dir_name, |
| 18 | int (*func)(const char *, struct dirent *, void *), |
| 19 | void *private); |
| 20 | |
| 21 | /* Get/set a file version on an ext2 file system */ |
| 22 | int fgetsetversion(const char *name, unsigned long *get_version, unsigned long set_version); |
| 23 | #define fgetversion(name, version) fgetsetversion(name, version, 0) |
| 24 | #define fsetversion(name, version) fgetsetversion(name, NULL, version) |
| 25 | |
| 26 | /* Get/set a file flags on an ext2 file system */ |
| 27 | int fgetsetflags(const char *name, unsigned long *get_flags, unsigned long set_flags); |
| 28 | #define fgetflags(name, flags) fgetsetflags(name, flags, 0) |
| 29 | #define fsetflags(name, flags) fgetsetflags(name, NULL, flags) |
| 30 | |
| 31 | /* Must be 1 for compatibility with `int long_format'. */ |
| 32 | #define PFOPT_LONG 1 |
| 33 | /* Print file attributes on an ext2 file system */ |
Denis Vlasenko | 53354ac | 2008-06-07 15:10:29 +0000 | [diff] [blame] | 34 | void print_e2flags(FILE *f, unsigned long flags, unsigned options); |
Denis Vlasenko | d059ddc | 2007-10-30 19:36:07 +0000 | [diff] [blame] | 35 | |
| 36 | extern const uint32_t e2attr_flags_value[]; |
| 37 | extern const char e2attr_flags_sname[]; |
| 38 | |
| 39 | /* If you plan to ENABLE_COMPRESSION, see e2fs_lib.c and chattr.c - */ |
| 40 | /* make sure that chattr doesn't accept bad options! */ |
| 41 | #ifdef ENABLE_COMPRESSION |
| 42 | #define e2attr_flags_value_chattr (&e2attr_flags_value[5]) |
| 43 | #define e2attr_flags_sname_chattr (&e2attr_flags_sname[5]) |
| 44 | #else |
| 45 | #define e2attr_flags_value_chattr (&e2attr_flags_value[1]) |
| 46 | #define e2attr_flags_sname_chattr (&e2attr_flags_sname[1]) |
| 47 | #endif |
Denis Vlasenko | 98636eb | 2008-05-09 17:59:34 +0000 | [diff] [blame] | 48 | |
| 49 | #if __GNUC_PREREQ(4,1) |
| 50 | # pragma GCC visibility pop |
| 51 | #endif |