e2fs_lib.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. /* Constants and structures */
  9. #include "e2fs_defs.h"
  10. /* Iterate a function on each entry of a directory */
  11. int iterate_on_dir(const char *dir_name,
  12. int (*func)(const char *, struct dirent *, void *),
  13. void *private);
  14. /* Get/set a file version on an ext2 file system */
  15. int fgetsetversion(const char *name, unsigned long *get_version, unsigned long set_version);
  16. #define fgetversion(name, version) fgetsetversion(name, version, 0)
  17. #define fsetversion(name, version) fgetsetversion(name, NULL, version)
  18. /* Get/set a file flags on an ext2 file system */
  19. int fgetsetflags(const char *name, unsigned long *get_flags, unsigned long set_flags);
  20. #define fgetflags(name, flags) fgetsetflags(name, flags, 0)
  21. #define fsetflags(name, flags) fgetsetflags(name, NULL, flags)
  22. /* Must be 1 for compatibility with `int long_format'. */
  23. #define PFOPT_LONG 1
  24. /* Print file attributes on an ext2 file system */
  25. void print_flags(FILE *f, unsigned long flags, unsigned options);
  26. extern const uint32_t e2attr_flags_value[];
  27. extern const char e2attr_flags_sname[];
  28. /* If you plan to ENABLE_COMPRESSION, see e2fs_lib.c and chattr.c - */
  29. /* make sure that chattr doesn't accept bad options! */
  30. #ifdef ENABLE_COMPRESSION
  31. #define e2attr_flags_value_chattr (&e2attr_flags_value[5])
  32. #define e2attr_flags_sname_chattr (&e2attr_flags_sname[5])
  33. #else
  34. #define e2attr_flags_value_chattr (&e2attr_flags_value[1])
  35. #define e2attr_flags_sname_chattr (&e2attr_flags_sname[1])
  36. #endif