3
0

e2p.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* vi: set sw=4 ts=4: */
  2. #include "busybox.h"
  3. #include <sys/types.h> /* Needed by dirent.h on netbsd */
  4. #include <stdio.h>
  5. #include <dirent.h>
  6. #include "../ext2fs/ext2_fs.h"
  7. #define E2P_FEATURE_COMPAT 0
  8. #define E2P_FEATURE_INCOMPAT 1
  9. #define E2P_FEATURE_RO_INCOMPAT 2
  10. #ifndef EXT3_FEATURE_INCOMPAT_EXTENTS
  11. #define EXT3_FEATURE_INCOMPAT_EXTENTS 0x0040
  12. #endif
  13. /* `options' for print_flags() */
  14. #define PFOPT_LONG 1 /* Must be 1 for compatibility with `int long_format'. */
  15. /*int fgetversion (const char * name, unsigned long * version);*/
  16. /*int fsetversion (const char * name, unsigned long version);*/
  17. int fgetsetversion(const char * name, unsigned long * get_version, unsigned long set_version);
  18. #define fgetversion(name, version) fgetsetversion(name, version, 0)
  19. #define fsetversion(name, version) fgetsetversion(name, NULL, version)
  20. /*int fgetflags (const char * name, unsigned long * flags);*/
  21. /*int fsetflags (const char * name, unsigned long flags);*/
  22. int fgetsetflags(const char * name, unsigned long * get_flags, unsigned long set_flags);
  23. #define fgetflags(name, flags) fgetsetflags(name, flags, 0)
  24. #define fsetflags(name, flags) fgetsetflags(name, NULL, flags)
  25. int getflags (int fd, unsigned long * flags);
  26. int getversion (int fd, unsigned long * version);
  27. int iterate_on_dir (const char * dir_name,
  28. int (*func) (const char *, struct dirent *, void *),
  29. void * private);
  30. /*void list_super(struct ext2_super_block * s);*/
  31. void list_super2(struct ext2_super_block * s, FILE *f);
  32. #define list_super(s) list_super2(s, stdout)
  33. void print_fs_errors (FILE * f, unsigned short errors);
  34. void print_flags (FILE * f, unsigned long flags, unsigned options);
  35. void print_fs_state (FILE * f, unsigned short state);
  36. int setflags (int fd, unsigned long flags);
  37. int setversion (int fd, unsigned long version);
  38. const char *e2p_feature2string(int compat, unsigned int mask);
  39. int e2p_string2feature(char *string, int *compat, unsigned int *mask);
  40. int e2p_edit_feature(const char *str, __u32 *compat_array, __u32 *ok_array);
  41. int e2p_is_null_uuid(void *uu);
  42. void e2p_uuid_to_str(void *uu, char *out);
  43. const char *e2p_uuid2str(void *uu);
  44. const char *e2p_hash2string(int num);
  45. int e2p_string2hash(char *string);
  46. const char *e2p_mntopt2string(unsigned int mask);
  47. int e2p_string2mntopt(char *string, unsigned int *mask);
  48. int e2p_edit_mntopts(const char *str, __u32 *mntopts, __u32 ok);
  49. unsigned long parse_num_blocks(const char *arg, int log_block_size);
  50. char *e2p_os2string(int os_type);
  51. int e2p_string2os(char *str);