- bool reposition(uint32_t rfile, uint32_t rblock); /* in dev.c */
- void clrerror(int func); /* in dev.c */
-
- void set_blocked(int block) { dev_blocked = block; };
- int get_blocked() const { return dev_blocked; };
- const char *print_blocked() const; /* in dev.c */
- bool is_blocked() const { return dev_blocked != BST_NOT_BLOCKED; };
+ bool reposition(DCR *dcr, uint32_t rfile, uint32_t rblock); /* in dev.c */
+ void clrerror(int func); /* in dev.c */
+ boffset_t lseek(DCR *dcr, boffset_t offset, int whence); /* in dev.c */
+ bool update_pos(DCR *dcr); /* in dev.c */
+ void set_slot(int32_t slot); /* in dev.c */
+ void clear_slot(); /* in dev.c */
+
+
+ bool update_freespace(); /* in dvd.c */
+
+ uint32_t get_file() const { return file; };
+ uint32_t get_block_num() const { return block_num; };
+ int fd() const { return m_fd; };
+
+ /* low level operations */
+ void init_backend();
+ int (*d_open)(const char *pathname, int flags, ...);
+ int (*d_read)(int fd, void *buffer, unsigned int count);
+ int (*d_write)(int fd, const void *buffer, unsigned int count);
+ int (*d_close)(int fd);
+ int (*d_ioctl)(int fd, unsigned long int request, ...);
+
+ /*
+ * Locking and blocking calls
+ */
+#ifdef SD_DEBUG_LOCK
+ void _r_dlock(const char *, int); /* in lock.c */
+ void _r_dunlock(const char *, int); /* in lock.c */
+ void _dlock(const char *, int); /* in lock.c */
+ void _dunlock(const char *, int); /* in lock.c */
+#else
+ void r_dlock(); /* in lock.c */
+ void r_dunlock() { dunlock(); }
+ void dlock() { P(m_mutex); }
+ void dunlock() { V(m_mutex); }
+#endif
+ void dblock(int why); /* in lock.c */
+ void dunblock(bool locked=false); /* in lock.c */
+ void set_blocked(int block) { m_blocked = block; };
+ int blocked() const { return m_blocked; };
+ bool is_blocked() const { return m_blocked != BST_NOT_BLOCKED; };
+ const char *print_blocked() const; /* in dev.c */