lsmtd.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #ifndef LSMTD_H
  2. #define LSMTD_H
  3. #define PROGRAM_NAME "lsmtd"
  4. #include "common.h"
  5. #include "xalloc.h"
  6. #include <libmtd.h>
  7. #include <libubi.h>
  8. #define COL_DEVNAME 1
  9. #define COL_DEVNUM 2
  10. #define COL_TYPE 3
  11. #define COL_NAME 4
  12. #define COL_SIZE 5
  13. #define COL_EBSIZE 6
  14. #define COL_EBCOUNT 7
  15. #define COL_MINIO 8
  16. #define COL_SUBSIZE 9
  17. #define COL_OOBSIZE 10
  18. #define COL_MAXEC 11
  19. #define COL_FREE 12
  20. #define COL_FREE_LEB 13
  21. #define COL_BAD_COUNT 14
  22. #define COL_BAD_RSVD 15
  23. #define COL_RO 16
  24. #define COL_BB 17
  25. #define COL_REGION 18
  26. #define COL_CORRUPTED 19
  27. #define COL_DT_STRING 1
  28. #define COL_DT_NUMBER 2
  29. #define COL_DT_SIZE 3
  30. #define COL_DT_BOOL 4
  31. struct ubi_node {
  32. struct ubi_dev_info info;
  33. struct ubi_vol_info *vol_info;
  34. };
  35. struct mtd_node {
  36. struct mtd_dev_info info;
  37. struct ubi_node *ubi;
  38. };
  39. struct column {
  40. const char *name;
  41. const char *desc;
  42. int type;
  43. int datatype;
  44. size_t width;
  45. };
  46. extern struct ubi_node *ubi_dev;
  47. extern int num_ubi_devices;
  48. extern struct mtd_node *mtd_dev;
  49. extern int num_mtd_devices;
  50. extern struct column *sort_by;
  51. int scan_mtd(libmtd_t lib_mtd);
  52. int scan_ubi(libubi_t lib_ubi);
  53. void scan_free(void);
  54. #endif /* LSMTD_H */