virtual.h
branchtrunk
changeset 4 79da91042fcc
child 15 a9348bf5f6e7
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/virtual.h	Sat Dec 29 15:25:21 2007 +0100
     1.3 @@ -0,0 +1,78 @@
     1.4 +/* virtual.h
     1.5 +Copyright (c) 2000-2004 Craig Condit, Stefan Hülswitt.
     1.6 +
     1.7 +Redistribution and use in source and binary forms, with or without
     1.8 +modification, are permitted provided that the following conditions are met: 
     1.9 +
    1.10 +1. Redistributions of source code must retain the above copyright notice,
    1.11 +   this list of conditions and the following disclaimer. 
    1.12 +2. Redistributions in binary form must reproduce the above copyright notice,
    1.13 +   this list of conditions and the following disclaimer in the documentation
    1.14 +   and/or other materials provided with the distribution. 
    1.15 +
    1.16 +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
    1.17 +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
    1.18 +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    1.19 +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
    1.20 +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    1.21 +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    1.22 +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
    1.23 +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    1.24 +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
    1.25 +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    1.26 +SUCH DAMAGE.
    1.27 +*/
    1.28 +
    1.29 +#ifndef _CDBACKUP_VIRTUAL_H
    1.30 +#define _CDBACKUP_VIRTUAL_H
    1.31 +
    1.32 +#define VIRT_VERSION    1
    1.33 +#define VIRT_MAGIC      0x144391C83A78412FLL
    1.34 +#define MAX_VIRT_TRACKS 96
    1.35 +#define VIRT_HEADER_LEN CD_FRAMESIZE
    1.36 +
    1.37 +struct virt_header {
    1.38 +  long long magic;
    1.39 +  int version;
    1.40 +  int tracks;
    1.41 +  int leadout;
    1.42 +  int count, has_cont;
    1.43 +  int reserved[25];
    1.44 +  int start[MAX_VIRT_TRACKS];
    1.45 +  };
    1.46 +
    1.47 +struct toc_entry {
    1.48 +  u_char track_no;	/* track number */
    1.49 +  char is_data;		/* 1 = data track */
    1.50 +  char is_cdbackup;	/* was it created by CD-Backup? */
    1.51 +  int sec_start;	/* start sector */
    1.52 +  int sec_end;		/* last sector */
    1.53 +  char id_str[33];	/* recorder id string (32 chars) */
    1.54 +  char vol_id[33];	/* volume label (32 characters) */
    1.55 +  char t_stamp[13];	/* time stamp: yyyymmddhhmm */
    1.56 +  char disk_set;	/* disk number */
    1.57 +  char flags;           /* backup flags */
    1.58 +  };
    1.59 +
    1.60 +extern struct toc_entry *toc;
    1.61 +extern long long cd_used, cd_avail;
    1.62 +
    1.63 +void Vopen(int ro);
    1.64 +void Vclose(void);
    1.65 +int VisRegular(void);
    1.66 +int VreadToc(int trackInfos);
    1.67 +void VprintSpace(void);
    1.68 +const char *VdevName(void);
    1.69 +long long Vseek(int trackNum);
    1.70 +void Vread(void *buf);
    1.71 +void VnewTrack(void);
    1.72 +void VcloseTrack(int cont);
    1.73 +void Vwrite(const void *buf);
    1.74 +void VgetAhead(void);
    1.75 +void VsetAhead(int restore);
    1.76 +int Vsize(void);
    1.77 +int VhasCont(void);
    1.78 +void VprepareDump(void);
    1.79 +void VvirtRead(void *buf);
    1.80 +
    1.81 +#endif