No Description

bu.h 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #include <utils/String8.h>
  2. #include <lib/libtar.h>
  3. #include <zlib.h>
  4. extern "C" {
  5. #include <openssl/sha.h>
  6. #include <openssl/md5.h>
  7. #ifndef MD5_DIGEST_STRING_LENGTH
  8. #define MD5_DIGEST_STRING_LENGTH (MD5_DIGEST_LENGTH*2+1)
  9. #endif
  10. #ifndef SHA_DIGEST_STRING_LENGTH
  11. #define SHA_DIGEST_STRING_LENGTH (SHA_DIGEST_LENGTH*2+1)
  12. #endif
  13. }
  14. #define HASH_MAX_LENGTH SHA_DIGEST_LENGTH
  15. #define HASH_MAX_STRING_LENGTH SHA_DIGEST_STRING_LENGTH
  16. #define PROP_LINE_LEN (PROPERTY_KEY_MAX+1+PROPERTY_VALUE_MAX+1+1)
  17. extern int adb_ifd;
  18. extern int adb_ofd;
  19. extern TAR* tar;
  20. extern gzFile gzf;
  21. extern char* hash_name;
  22. extern size_t hash_datalen;
  23. extern SHA_CTX sha_ctx;
  24. extern MD5_CTX md5_ctx;
  25. struct partspec {
  26. char* name;
  27. char* path;
  28. Volume* vol;
  29. uint64_t size;
  30. uint64_t used;
  31. uint64_t off;
  32. };
  33. #define MAX_PART 8
  34. extern void logmsg(const char* fmt, ...);
  35. extern int part_add(const char* name);
  36. extern partspec* part_get(int i);
  37. extern partspec* part_find(const char* name);
  38. extern void part_set(partspec* part);
  39. extern int update_progress(uint64_t off);
  40. extern int create_tar(int fd, const char* compress, const char* mode);
  41. extern int do_backup(int argc, char** argv);
  42. extern int do_restore(int argc, char** argv);