cdrom.h
branchtrunk
changeset 4 79da91042fcc
parent 2 6bcb44b9edb1
child 15 a9348bf5f6e7
equal deleted inserted replaced
3:d09ec85ffdfe 4:79da91042fcc
     1 /* cdrom.h
     1 /* cdrom.h
     2 Copyright (c) 2000-2002 Craig Condit, Stefan Hülswitt.
     2 Copyright (c) 2000-2004 Craig Condit, Stefan Hülswitt.
     3 
     3 
     4 Redistribution and use in source and binary forms, with or without
     4 Redistribution and use in source and binary forms, with or without
     5 modification, are permitted provided that the following conditions are met: 
     5 modification, are permitted provided that the following conditions are met: 
     6 
     6 
     7 1. Redistributions of source code must retain the above copyright notice,
     7 1. Redistributions of source code must retain the above copyright notice,
    24 */
    24 */
    25 
    25 
    26 #ifndef _CDBACKUP_CDROM_H
    26 #ifndef _CDBACKUP_CDROM_H
    27 #define _CDBACKUP_CDROM_H
    27 #define _CDBACKUP_CDROM_H
    28 
    28 
    29 extern struct toc_entry *toc;
    29 #ifdef linux
    30 extern long long cd_used, cd_avail;
    30 #include <linux/cdrom.h>
       
    31 #endif
    31 
    32 
    32 struct toc_entry {
    33 #ifdef sun
    33   u_char track_no;	/* track number */
    34 #include <sys/cdio.h>
    34   char is_data;		/* 1 = data track */
    35 #endif
    35   char is_cdbackup;	/* was it created by CD-Backup? */
       
    36   int sec_start;	/* start sector */
       
    37   int sec_end;		/* last sector */
       
    38   char id_str[33];	/* recorder id string (32 chars) */
       
    39   char vol_id[33];	/* volume label (32 characters) */
       
    40   char t_stamp[13];	/* time stamp: yyyymmddhhmm */
       
    41   char disk_set;	/* disk number */
       
    42 };
       
    43 
    36 
    44 int open_cdr(char *device);
    37 #ifndef CD_FRAMESIZE
    45 void close_cdr(int cd_fd);
    38 #define CD_FRAMESIZE 2048
       
    39 #endif
       
    40 
       
    41 struct cd_header {
       
    42   int start_track, end_track;
       
    43   int used;
       
    44   };
       
    45 
       
    46 struct cd_track {
       
    47   int start_sec;
       
    48   int leadout_size;
       
    49   int is_data;
       
    50   int start_track;
       
    51   };
       
    52 
    46 void get_param(int fd, unsigned long *ahead, unsigned long *fahead);
    53 void get_param(int fd, unsigned long *ahead, unsigned long *fahead);
    47 void set_param(int fd, unsigned long ahead, unsigned long fahead);
    54 void set_param(int fd, unsigned long ahead, unsigned long fahead);
    48 int full_read(int fd, void *buf, int count);
    55 int getCdHeader(struct cd_header *cd);
    49 int read_toc(int cd_fd, int trackinfos);
    56 void getCdTrack(int num, struct cd_track *cd);
    50 void free_toc();
       
    51 void print_space();
       
    52 
    57 
    53 #endif
    58 #endif