e2p.h 2.4 KB

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