X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Fstored%2Fvtape.h;h=146083f875cd359818e17504b29a4f8d86ac55be;hb=bbbdbbf8e1346435de97896364cef142f35b3f5c;hp=0bef45fe00371bde84dbf9523781b6345e463ba8;hpb=e9ec2bf1509a97df3f03d90013be6d94da028034;p=bacula%2Fbacula diff --git a/bacula/src/stored/vtape.h b/bacula/src/stored/vtape.h index 0bef45fe00..146083f875 100644 --- a/bacula/src/stored/vtape.h +++ b/bacula/src/stored/vtape.h @@ -20,7 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - Bacula® is a registered trademark of John Walker. + Bacula® is a registered trademark of Kern Sibbald. The licensor of Bacula is the Free Software Foundation Europe (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich, Switzerland, email:ftf@fsfeurope.org. @@ -38,33 +38,35 @@ #include #include "bacula.h" -#define FTAPE_MAX_DRIVE 50 - /* * Theses functions will replace open/read/write */ int vtape_open(const char *pathname, int flags, ...); -int vtape_read(int fd, void *buffer, unsigned int count); -int vtape_write(int fd, const void *buffer, unsigned int count); int vtape_close(int fd); -int vtape_ioctl(int fd, unsigned long int request, ...); +int vtape_ioctl(int fd, ioctl_req_t request, ...); void vtape_debug(int level); +ssize_t vtape_read(int fd, void *buffer, size_t count); +ssize_t vtape_write(int fd, const void *buffer, size_t count); + +#ifdef USE_VTAPE + +#define FTAPE_MAX_DRIVE 50 typedef enum { - VT_READ_EOF, /* Need to read the entire EOF struct */ - VT_SKIP_EOF /* Have already read the EOF byte */ + VT_READ_EOF, /* Need to read the entire EOF struct */ + VT_SKIP_EOF /* Have already read the EOF byte */ } VT_READ_FM_MODE; class vtape { private: int fd; /* Our file descriptor */ - off_t file_block; /* size */ - off_t max_block; + boffset_t file_block; /* size */ + boffset_t max_block; - off_t last_FM; /* last file mark (last file) */ - off_t next_FM; /* next file mark (next file) */ - off_t cur_FM; /* current file mark */ + boffset_t last_FM; /* last file mark (last file) */ + boffset_t next_FM; /* next file mark (next file) */ + boffset_t cur_FM; /* current file mark */ bool atEOF; /* End of file */ bool atEOT; /* End of media */ @@ -97,8 +99,8 @@ public: int get_fd(); void dump(); int open(const char *pathname, int flags); - int read(void *buffer, unsigned int count); - int write(const void *buffer, unsigned int count); + ssize_t read(void *buffer, size_t count); + ssize_t write(const void *buffer, size_t count); int close(); int tape_op(struct mtop *mt_com); @@ -106,4 +108,7 @@ public: int tape_pos(struct mtpos *mt_com); }; + +#endif /*!USE_VTAPE */ + #endif /* !VTAPE_H */