cdbackup.h
author nathan
Sat, 29 Dec 2007 15:22:44 +0100
branchtrunk
changeset 1 6b6864d2c4ce
parent 0 d85c12073dea
child 2 6bcb44b9edb1
permissions -rw-r--r--
Added tag 0.6.2 for changeset d85c12073dea
nathan@0
     1
/* cdbackup.h.
nathan@0
     2
Copyright (c) 2000-2002 Craig Condit, Stefan Hülswitt.
nathan@0
     3
nathan@0
     4
Redistribution and use in source and binary forms, with or without
nathan@0
     5
modification, are permitted provided that the following conditions are met: 
nathan@0
     6
nathan@0
     7
1. Redistributions of source code must retain the above copyright notice,
nathan@0
     8
   this list of conditions and the following disclaimer. 
nathan@0
     9
2. Redistributions in binary form must reproduce the above copyright notice,
nathan@0
    10
   this list of conditions and the following disclaimer in the documentation
nathan@0
    11
   and/or other materials provided with the distribution. 
nathan@0
    12
nathan@0
    13
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
nathan@0
    14
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
nathan@0
    15
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
nathan@0
    16
DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
nathan@0
    17
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
nathan@0
    18
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
nathan@0
    19
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
nathan@0
    20
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
nathan@0
    21
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
nathan@0
    22
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
nathan@0
    23
SUCH DAMAGE.
nathan@0
    24
*/
nathan@0
    25
nathan@0
    26
#ifndef _CDBACKUP_H
nathan@0
    27
#define _CDBACKUP_H
nathan@0
    28
nathan@0
    29
#include "version.h"
nathan@0
    30
nathan@0
    31
#define NO_LABEL	"CD-Backup Track"
nathan@0
    32
#define SHORT_HDR	"cdbackup"
nathan@0
    33
#define HDR_STRING	SHORT_HDR" "VERSION
nathan@0
    34
nathan@0
    35
#define MIN_BLOCKS	2   /* min. required blocks for a session: header block, one data block */
nathan@0
    36
nathan@0
    37
struct toc_entry {
nathan@0
    38
  u_char track_no;	/* track number */
nathan@0
    39
  char is_data;		/* 1 = data track */
nathan@0
    40
  char is_cdbackup;	/* was it created by CD-Backup? */
nathan@0
    41
  int sec_start;	/* start sector */
nathan@0
    42
  char id_str[33];	/* recorder id string (32 chars) */
nathan@0
    43
  char vol_id[33];	/* volume label (32 characters) */
nathan@0
    44
  char t_stamp[13];	/* time stamp: yyyymmddhhmm */
nathan@0
    45
  char disk_set;	/* disk number */
nathan@0
    46
};
nathan@0
    47
nathan@0
    48
struct header_block {
nathan@0
    49
  char id_str[33];	/* recorder id string (32 chars) */
nathan@0
    50
  char vol_id[33];	/* volume label (32 characters) */
nathan@0
    51
  char t_stamp[13];	/* timestamp */
nathan@0
    52
  char disk_set;	/* disk number - starts with 1 on multi-disk set */
nathan@0
    53
};
nathan@0
    54
nathan@0
    55
struct data_block {
nathan@0
    56
  char status;		/* status of block (0=continue, 1=done, 2=disk full) */
nathan@0
    57
  char reserved;	/* reserved byte to make structure 4 bytes long */
nathan@0
    58
  short datasize;	/* # of bytes in block (max = CD_FRAMESIZE-this) */
nathan@0
    59
};
nathan@0
    60
nathan@0
    61
#define DBSIZE   sizeof(struct data_block)
nathan@0
    62
#define DATASIZE (CD_FRAMESIZE-DBSIZE)
nathan@0
    63
nathan@0
    64
#endif