+#define strncpy_null(dest, src) __strncpy_null(dest, src, sizeof(dest))
+int get_label_mounted(const char *mount_path, char *labelp);
+int get_label_unmounted(const char *dev, char *label);
+int group_profile_max_safe_loss(u64 flags);
+int csum_tree_block(struct btrfs_fs_info *root, struct extent_buffer *buf,
+ int verify);
+int ask_user(const char *question);
+int lookup_path_rootid(int fd, u64 *rootid);
+int btrfs_scan_devices(void);
+int get_btrfs_mount(const char *dev, char *mp, size_t mp_size);
+int find_mount_root(const char *path, char **mount_root);
+int get_device_info(int fd, u64 devid,
+ struct btrfs_ioctl_dev_info_args *di_args);
+int test_uuid_unique(char *fs_uuid);
+u64 disk_size(const char *path);
+u64 get_partition_size(const char *dev);
+
+int test_issubvolname(const char *name);
+int test_isdir(const char *path);
+
+const char *subvol_strip_mountpoint(const char *mnt, const char *full_path);
+int find_next_key(struct btrfs_path *path, struct btrfs_key *key);
+const char* btrfs_group_type_str(u64 flag);
+const char* btrfs_group_profile_str(u64 flag);
+
+int count_digits(u64 num);
+u64 div_factor(u64 num, int factor);
+
+int btrfs_tree_search2_ioctl_supported(int fd);
+
+unsigned int get_unit_mode_from_arg(int *argc, char *argv[], int df_mode);
+int string_is_numerical(const char *str);
+int prefixcmp(const char *str, const char *prefix);
+
+unsigned long total_memory(void);
+
+void print_device_info(struct btrfs_device *device, char *prefix);
+void print_all_devices(struct list_head *devices);
+
+/*
+ * Global program state, configurable by command line and available to
+ * functions without extra context passing.
+ */
+struct btrfs_config {
+};
+extern struct btrfs_config bconf;
+
+void btrfs_config_init(void);
+
+/* Pseudo random number generator wrappers */
+int rand_int(void);
+u8 rand_u8(void);
+u16 rand_u16(void);
+u32 rand_u32(void);
+u64 rand_u64(void);
+unsigned int rand_range(unsigned int upper);
+void init_rand_seed(u64 seed);