e2fs_lib.h 1.7 KB

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