nathan@4: /* virtual.h nathan@15: Copyright (c) 2000-2012 Craig Condit, Stefan Huelswitt. nathan@4: nathan@4: Redistribution and use in source and binary forms, with or without nathan@4: modification, are permitted provided that the following conditions are met: nathan@4: nathan@4: 1. Redistributions of source code must retain the above copyright notice, nathan@4: this list of conditions and the following disclaimer. nathan@4: 2. Redistributions in binary form must reproduce the above copyright notice, nathan@4: this list of conditions and the following disclaimer in the documentation nathan@4: and/or other materials provided with the distribution. nathan@4: nathan@4: THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS nathan@4: OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED nathan@4: WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE nathan@4: DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR nathan@4: ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL nathan@4: DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR nathan@4: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER nathan@4: CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT nathan@4: LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY nathan@4: OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF nathan@4: SUCH DAMAGE. nathan@4: */ nathan@4: nathan@4: #ifndef _CDBACKUP_VIRTUAL_H nathan@4: #define _CDBACKUP_VIRTUAL_H nathan@4: nathan@4: #define VIRT_VERSION 1 nathan@4: #define VIRT_MAGIC 0x144391C83A78412FLL nathan@4: #define MAX_VIRT_TRACKS 96 nathan@4: #define VIRT_HEADER_LEN CD_FRAMESIZE nathan@4: nathan@4: struct virt_header { nathan@4: long long magic; nathan@4: int version; nathan@4: int tracks; nathan@4: int leadout; nathan@4: int count, has_cont; nathan@4: int reserved[25]; nathan@4: int start[MAX_VIRT_TRACKS]; nathan@4: }; nathan@4: nathan@4: struct toc_entry { nathan@4: u_char track_no; /* track number */ nathan@4: char is_data; /* 1 = data track */ nathan@4: char is_cdbackup; /* was it created by CD-Backup? */ nathan@4: int sec_start; /* start sector */ nathan@4: int sec_end; /* last sector */ nathan@4: char id_str[33]; /* recorder id string (32 chars) */ nathan@4: char vol_id[33]; /* volume label (32 characters) */ nathan@4: char t_stamp[13]; /* time stamp: yyyymmddhhmm */ nathan@4: char disk_set; /* disk number */ nathan@4: char flags; /* backup flags */ nathan@4: }; nathan@4: nathan@4: extern struct toc_entry *toc; nathan@4: extern long long cd_used, cd_avail; nathan@4: nathan@4: void Vopen(int ro); nathan@4: void Vclose(void); nathan@4: int VisRegular(void); nathan@4: int VreadToc(int trackInfos); nathan@4: void VprintSpace(void); nathan@4: const char *VdevName(void); nathan@4: long long Vseek(int trackNum); nathan@4: void Vread(void *buf); nathan@4: void VnewTrack(void); nathan@4: void VcloseTrack(int cont); nathan@4: void Vwrite(const void *buf); nathan@4: void VgetAhead(void); nathan@4: void VsetAhead(int restore); nathan@4: int Vsize(void); nathan@4: int VhasCont(void); nathan@4: void VprepareDump(void); nathan@4: void VvirtRead(void *buf); nathan@4: nathan@4: #endif