1 #ifndef _BU_H 2 #define _BU_H 3 4 #define BU_HARDLINKED 0x0001 5 #define BU_DELETABLE 0x0002 6 #define BU_WORKING 0x0004 7 #define BU_FINISHING 0x0008 8 #define BU_CURRENT 0x0010 9 #define BU_LIVE_COUNTERS 0x0020 // Only set in json_input. 10 #define BU_MANIFEST 0x0040 11 // These are only set on a separate request. 12 // Careful with the bit shifting in ncurses client with the UP/DOWN keys. 13 #define BU_LOG_BACKUP 0x0080 14 #define BU_LOG_RESTORE 0x0100 15 #define BU_LOG_VERIFY 0x0200 16 #define BU_STATS_BACKUP 0x0400 17 #define BU_STATS_RESTORE 0x0800 18 #define BU_STATS_VERIFY 0x1000 19 20 // Representing backup directories on the server for a client. 21 // Needed on the client side too, as the status monitor stuff uses it. 22 23 struct bu 24 { 25 char *path; 26 char *basename; 27 char *data; 28 char *delta; 29 char *timestamp; 30 uint16_t flags; 31 32 // The number of the backup. 33 uint64_t bno; 34 // Transposed backup number - will set the oldest backup to 1. 35 uint64_t trbno; 36 37 // The position of this item in the array. 38 uint64_t index; 39 40 struct bu *next; 41 struct bu *prev; 42 }; 43 44 extern int bu_init(struct bu *bu, char *fullpath, char *basename, 45 char *timestampstr, uint16_t flags); 46 extern void bu_list_free(struct bu **bu_list); 47 extern struct bu *bu_alloc(void); 48 extern void bu_free(struct bu **bu); 49 extern struct bu *bu_find_current(struct bu *bu); 50 extern struct bu *bu_find_working_or_finishing(struct bu *bu); 51 52 #endif 53