/* From acquire.c */
int acquire_device_for_append(JCR *jcr, DEVICE *dev, DEV_BLOCK *block);
int acquire_device_for_read(JCR *jcr, DEVICE *dev, DEV_BLOCK *block);
-int ready_dev_for_read(JCR *jcr, DEVICE *dev, DEV_BLOCK *block);
-int release_device(JCR *jcr, DEVICE *dev, DEV_BLOCK *block);
+int release_device(JCR *jcr, DEVICE *dev);
/* From askdir.c */
-int dir_get_volume_info(JCR *jcr);
+int dir_get_volume_info(JCR *jcr, int writing);
int dir_find_next_appendable_volume(JCR *jcr);
int dir_update_volume_info(JCR *jcr, VOLUME_CAT_INFO *vol, int relabel);
int dir_ask_sysop_to_mount_next_volume(JCR *jcr, DEVICE *dev);
void empty_block(DEV_BLOCK *block);
void free_block(DEV_BLOCK *block);
int write_block_to_device(JCR *jcr, DEVICE *dev, DEV_BLOCK *block);
-int write_block_to_dev(DEVICE *dev, DEV_BLOCK *block);
+int write_block_to_dev(JCR *jcr, DEVICE *dev, DEV_BLOCK *block);
int read_block_from_device(DEVICE *dev, DEV_BLOCK *block);
int read_block_from_dev(DEVICE *dev, DEV_BLOCK *block);
+/* From butil.c -- utilities for SD tool programs */
+void print_ls_output(char *fname, char *link, int type, struct stat *statp);
+JCR *setup_jcr(char *name, char *device, BSR *bsr);
+DEVICE *setup_to_access_device(JCR *jcr, int read_access);
+void display_error_status(DEVICE *dev);
+DEVRES *find_device_res(char *device_name, int read_access);
+
/* From dev.c */
-DEVICE *init_dev(DEVICE *dev, char *device);
+DEVICE *init_dev(DEVICE *dev, DEVRES *device);
int open_dev(DEVICE *dev, char *VolName, int mode);
void close_dev(DEVICE *dev);
void force_close_dev(DEVICE *dev);
/* From device.c */
int open_device(DEVICE *dev);
-void block_device(DEVICE *dev, int state);
-void unblock_device(DEVICE *dev);
-void lock_device(DEVICE *dev);
-void unlock_device(DEVICE *dev);
-void steal_device_lock(DEVICE *dev, bsteal_lock_t *hold, int state);
-void return_device_lock(DEVICE *dev, bsteal_lock_t *hold);
int fixup_device_block_write_error(JCR *jcr, DEVICE *dev, DEV_BLOCK *block);
void _lock_device(char *file, int line, DEVICE *dev);
-void _lock_device(char *file, int line, DEVICE *dev, int state);
void _unlock_device(char *file, int line, DEVICE *dev);
+void _block_device(char *file, int line, DEVICE *dev, int state);
+void _unblock_device(char *file, int line, DEVICE *dev);
+void _steal_device_lock(char *file, int line, DEVICE *dev, bsteal_lock_t *hold, int state);
+void _return_device_lock(char *file, int line, DEVICE *dev, bsteal_lock_t *hold);
+
+/* don't use */
+void _new_lock_device(char *file, int line, DEVICE *dev);
+void _new_lock_device(char *file, int line, DEVICE *dev, int state);
+void _new_unlock_device(char *file, int line, DEVICE *dev);
void new_steal_device_lock(DEVICE *dev, brwsteal_t *hold, int state);
void new_return_device_lock(DEVICE *dev, brwsteal_t *hold);
/* From mount.c */
int mount_next_write_volume(JCR *jcr, DEVICE *dev, DEV_BLOCK *block, int release);
int mount_next_read_volume(JCR *jcr, DEVICE *dev, DEV_BLOCK *block);
+int autoload_device(JCR *jcr, DEVICE *dev, int writing, BSOCK *dir);
/* From parse_bsr.c */
/* From record.c */
char *FI_to_ascii(int fi);
-char *stream_to_ascii(int stream);
+char *stream_to_ascii(int stream, int fi);
int write_record_to_block(DEV_BLOCK *block, DEV_RECORD *rec);
int can_write_record_to_block(DEV_BLOCK *block, DEV_RECORD *rec);
int read_record_from_block(DEV_BLOCK *block, DEV_RECORD *rec);
DEV_RECORD *new_record();
void free_record(DEV_RECORD *rec);
+
+/* From read_record.c */
+int read_records(JCR *jcr, DEVICE *dev,
+ void record_cb(JCR *jcr, DEVICE *dev, DEV_BLOCK *block, DEV_RECORD *rec),
+ int mount_cb(JCR *jcr, DEVICE *dev, DEV_BLOCK *block));