1 /** 2 * Copyright (C) 2009 3 * - Salvatore Santagati <salvatore.santagati@gmail.com> 4 * - Abdur Rab <c.abdur@yahoo.com> 5 * 6 * All rights reserved. 7 * 8 * This program is free software; under the terms of the 9 * GNU General Public License as published by the Free Software Foundation; 10 * either version 2 of the License, or (at your option) any later version. 11 * 12 * Redistribution and use in source and binary forms, with or without 13 * modification, are permitted provided that the following conditions are 14 * met: 15 * 16 * @ Redistributions of source code must retain the above copyright 17 * notice, this list of conditions and the following disclaimer. 18 * 19 * @ Redistributions in binary form must reproduce the above copyright 20 * notice, this list of conditions and the following disclaimer in 21 * the documentation and/or other materials provided with the 22 * distribution. 23 * 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 25 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 26 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 27 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 * 36 * You should have received a copy of the GNU General Public License 37 * along with this program; if not, write to the 38 * Free Software Foundation, Inc., 39 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 40 */ 41 42 #ifndef MKTOC_H 43 #define MKTOC_H 44 45 #include <stdio.h> 46 #include <stdlib.h> 47 #include <string.h> 48 49 #ifdef __cplusplus 50 extern "C" { 51 #endif /* __cplusplus */ 52 53 #ifndef MKCORE_H 54 #include "mkcore.h" 55 #endif 56 57 58 59 /* 60 #define TOC_AUDIO 0 61 #define TOC_MODE1 1 62 #define TOC_MODE1_RAW 2 63 #define TOC_MODE2 3 64 #define TOC_MODE2_FORM1 4 65 #define TOC_MODE2_FORM2 5 66 #define TOC_MODE2_FORM_MIX 6 67 #define TOC_MODE2_RAW 7 68 69 */ 70 /* --- @print_toc_time@ --- * 71 * 72 * Arguments: @file_ptrs *fptrs@ = input file 73 * @struct_toc *toc@ = pointer struct of toc sheet 74 * 75 * 76 * Returns: --- 77 * 78 * Use: print time of image. 79 */ 80 void print_toc_time ( file_ptrs* fptrs, struct_toc *toc ); 81 82 /* --- @print_toc_mode@ --- * 83 * 84 * Arguments: @file_ptrs *fptrs@ = input file 85 * @struct_toc *toc@ = pointer struct of toc 86 * @image_struct *img_struct@ = pointer struct of type image and pregap of image 87 * 88 * 89 * Returns: --- 90 * 91 * Use: read first block of image and print type of mode. 92 */ 93 void print_toc_mode ( file_ptrs* fptrs, struct_toc* toc, image_struct* img_struct ); 94 95 /* --- @print_toc_datafile@ --- * 96 * 97 * Arguments: @file_ptrs *fptrs@ = input file 98 * @char *file_input@ = name of input file 99 * 100 * 101 * Returns: --- 102 * 103 * Use: print name of datafile. 104 */ 105 void print_toc_datafile ( file_ptrs* fptrs, char* file_input ); 106 107 /* --- @print_toc_track@ --- * 108 * 109 * Arguments: @file_ptrs *fptrs@ = input file 110 * @struct_toc *toc@ = pointer struct of toc 111 * 112 * 113 * Returns: --- 114 * 115 * Use: print track of image. 116 */ 117 void print_toc_track ( file_ptrs* fptrs, struct_toc* toc ); 118 119 /* --- @print_toc_vcd_time@ --- * 120 * 121 * Arguments: @file_ptrs *fptrs@ = input file 122 * @struct_toc *toc@ = pointer struct of toc 123 * @image_struct *img_struct@ = pointer struct of type image and pregap of image 124 * @off_t l_loop@ = length of track; 125 * @off_t loop_last@ = loop end last track; 126 * 127 * 128 * Returns: --- 129 * 130 * Use: print time of track. 131 */ 132 133 void print_toc_vcd_time ( file_ptrs* fptrs, struct_toc* toc, image_struct* img_struct, 134 off_t l_loop, off_t loop_last); 135 136 /* --- @toc_first_track@ --- * 137 * 138 * Arguments: @file_ptrs *fptrs@ = input file 139 * @image_struct *img_struct@ = pointer struct of type image and pregap of image 140 * @char *file_input@ = name of input file 141 * @struct_toc *toc@ = pointer struct of cuesheet 142 * 143 * Returns: --- 144 * 145 * Use: detect track of image. 146 */ 147 void toc_first_track ( file_ptrs* fptrs, image_struct* img_struct, char *file_input, struct_toc* toc ); 148 149 /* --- @create_raw_toc@ --- * 150 * 151 * Arguments: @file_ptrs *fptrs@ = input file 152 * @image_struct *img_struct@ = pointer struct of type image and pregap of image 153 * @char *file_input@ = name of input file 154 * 155 * 156 * 157 * Returns: --- 158 * 159 * Use: generate a toc for raw image. 160 */ 161 void create_raw_toc ( file_ptrs* fptrs, image_struct* img_struct, char *file_input ); 162 163 /* --- @create_iso_toc@ --- * 164 * 165 * Arguments: @file_ptrs *fptrs@ = input file 166 * @image_struct *img_struct@ = pointer struct of type image and pregap of image 167 * @char *file_input@ = name of input file 168 * 169 * 170 * 171 * Returns: --- 172 * 173 * Use: generate a cuesheet for iso/udf image. 174 */ 175 void create_iso_toc ( file_ptrs* fptrs, image_struct* img_struct, char *file_input ); 176 177 /* --- @create_vcd_toc@ --- * 178 * 179 * Arguments: @file_ptrs *fptrs @ = input file 180 * @image_struct *img_struct@ = pointer struct of type image and pregap of image 181 * @char *file_input@ = name of input file 182 * 183 * 184 * Returns: Zeor on success, @-1@ on error. 185 * 186 * Use: generate a TOC file for vcd. 187 */ 188 int create_vcd_toc ( file_ptrs* fptrs, image_struct* img_struct, char *file_input ); 189 190 191 /* --- @create_toc@ --- * 192 * 193 * Arguments: @file_ptrs *fptrs @ = input file 194 * @image_struct *img_struct@ = pointer struct of type image and pregap of image 195 * @char *file_input@ = name of input file 196 * 197 * 198 * Returns: Zeor on success, @-1@ on error. 199 * 200 * Use: Get info from file for generate a TOC file descriptor. 201 */ 202 int create_toc ( file_ptrs* fptrs, image_struct* img_struct, char *file_input ); 203 204 205 #ifdef __cplusplus 206 } /* extern "C" */ 207 #endif /* __cplusplus */ 208 209 #endif /* MKTOC_H */ 210