nathan@0: /* cdbackup.h. nathan@15: Copyright (c) 2000-2012 Craig Condit, Stefan Huelswitt. nathan@0: nathan@0: Redistribution and use in source and binary forms, with or without nathan@0: modification, are permitted provided that the following conditions are met: nathan@0: nathan@0: 1. Redistributions of source code must retain the above copyright notice, nathan@0: this list of conditions and the following disclaimer. nathan@0: 2. Redistributions in binary form must reproduce the above copyright notice, nathan@0: this list of conditions and the following disclaimer in the documentation nathan@0: and/or other materials provided with the distribution. nathan@0: nathan@0: THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS nathan@0: OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED nathan@0: WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE nathan@0: DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR nathan@0: ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL nathan@0: DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR nathan@0: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER nathan@0: CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT nathan@0: LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY nathan@0: OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF nathan@0: SUCH DAMAGE. nathan@0: */ nathan@0: nathan@0: #ifndef _CDBACKUP_H nathan@0: #define _CDBACKUP_H nathan@0: nathan@0: #include "version.h" nathan@0: nathan@0: #define NO_LABEL "CD-Backup Track" nathan@0: #define SHORT_HDR "cdbackup" nathan@0: #define HDR_STRING SHORT_HDR" "VERSION nathan@0: nathan@0: #define MIN_BLOCKS 2 /* min. required blocks for a session: header block, one data block */ nathan@0: nathan@4: #define F_NONE 0 /* flag values */ nathan@4: #define F_CRC 1 /* backup has CRC checksum */ nathan@4: nathan@0: struct header_block { nathan@0: char id_str[33]; /* recorder id string (32 chars) */ nathan@0: char vol_id[33]; /* volume label (32 characters) */ nathan@0: char t_stamp[13]; /* timestamp */ nathan@0: char disk_set; /* disk number - starts with 1 on multi-disk set */ nathan@4: char flags; /* flags for the backup set */ nathan@0: }; nathan@0: nathan@0: struct data_block { nathan@0: char status; /* status of block (0=continue, 1=done, 2=disk full) */ nathan@4: char flags; /* flags for this data block */ nathan@0: short datasize; /* # of bytes in block (max = CD_FRAMESIZE-this) */ nathan@0: }; nathan@0: nathan@4: extern int padsize; nathan@4: extern long cd_len; nathan@4: extern int verbose; nathan@4: extern char *prg_name; nathan@4: nathan@4: void start_cdrecord(void); nathan@4: nathan@0: #define DBSIZE sizeof(struct data_block) nathan@0: #define DATASIZE (CD_FRAMESIZE-DBSIZE) nathan@0: nathan@0: #endif