rb_cdio 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. data/ext/CdIo.c +132 -0
  2. data/ext/CdIo.h +108 -0
  3. data/ext/CdIo.o +0 -0
  4. data/ext/CdIo_Cd.c +345 -0
  5. data/ext/CdIo_Cd.o +0 -0
  6. data/ext/CdIo_Common.c +84 -0
  7. data/ext/CdIo_Common.o +0 -0
  8. data/ext/CdIo_Modulo.c +226 -0
  9. data/ext/CdIo_Modulo.o +0 -0
  10. data/ext/CdIo_Track.c +91 -0
  11. data/ext/CdIo_Track.o +0 -0
  12. data/ext/CdIo_TrackIso9660.c +78 -0
  13. data/ext/CdIo_TrackIso9660.o +0 -0
  14. data/ext/Makefile +127 -0
  15. data/ext/extconf.rb +4 -0
  16. data/ext/mkmf.log +26 -0
  17. data/lib/rb_cdio_read.rb +39 -0
  18. data/test/data/Makefile +677 -0
  19. data/test/data/Makefile.am +78 -0
  20. data/test/data/Makefile.in +677 -0
  21. data/test/data/bad-cat1.cue +9 -0
  22. data/test/data/bad-cat1.toc +8 -0
  23. data/test/data/bad-cat2.cue +9 -0
  24. data/test/data/bad-cat2.toc +8 -0
  25. data/test/data/bad-cat3.cue +9 -0
  26. data/test/data/bad-cat3.toc +8 -0
  27. data/test/data/bad-mode1.cue +7 -0
  28. data/test/data/bad-mode1.toc +5 -0
  29. data/test/data/bad-msf-1.cue +7 -0
  30. data/test/data/bad-msf-1.toc +6 -0
  31. data/test/data/bad-msf-2.cue +7 -0
  32. data/test/data/bad-msf-2.toc +6 -0
  33. data/test/data/bad-msf-3.cue +7 -0
  34. data/test/data/bad-msf-3.toc +6 -0
  35. data/test/data/cdda-read.right +148 -0
  36. data/test/data/cdda.bin +0 -0
  37. data/test/data/cdda.cue +6 -0
  38. data/test/data/cdda.right +44 -0
  39. data/test/data/cdda.toc +13 -0
  40. data/test/data/cdtext.toc +48 -0
  41. data/test/data/check_cd_read.sh +53 -0
  42. data/test/data/check_common_fn +186 -0
  43. data/test/data/check_common_fn.in +186 -0
  44. data/test/data/check_cue.sh +102 -0
  45. data/test/data/check_cue.sh.in +102 -0
  46. data/test/data/check_iso.sh +32 -0
  47. data/test/data/check_iso.sh.in +32 -0
  48. data/test/data/check_nrg.sh +68 -0
  49. data/test/data/check_nrg.sh.in +68 -0
  50. data/test/data/check_opts.sh +33 -0
  51. data/test/data/check_opts0.right +40 -0
  52. data/test/data/check_opts1.right +40 -0
  53. data/test/data/check_opts2.right +34 -0
  54. data/test/data/check_opts3.right +34 -0
  55. data/test/data/check_opts4.right +44 -0
  56. data/test/data/check_opts5.right +44 -0
  57. data/test/data/check_opts6.right +44 -0
  58. data/test/data/check_opts7.right +44 -0
  59. data/test/data/check_sizeof +117 -0
  60. data/test/data/check_sizeof.c +77 -0
  61. data/test/data/copying.iso +0 -0
  62. data/test/data/copying.right +10 -0
  63. data/test/data/data1.toc +8 -0
  64. data/test/data/data2.toc +13 -0
  65. data/test/data/data5.toc +13 -0
  66. data/test/data/data6.toc +8 -0
  67. data/test/data/data7.toc +13 -0
  68. data/test/data/isofs-m1-read.right +258 -0
  69. data/test/data/isofs-m1.bin +0 -0
  70. data/test/data/isofs-m1.cue +3 -0
  71. data/test/data/isofs-m1.right +57 -0
  72. data/test/data/isofs-m1.toc +4 -0
  73. data/test/data/t1.toc +5 -0
  74. data/test/data/t2.toc +6 -0
  75. data/test/data/t3.toc +11 -0
  76. data/test/data/t4.toc +8 -0
  77. data/test/data/t5.toc +8 -0
  78. data/test/data/t6.toc +7 -0
  79. data/test/data/t7.toc +12 -0
  80. data/test/data/t8.toc +14 -0
  81. data/test/data/t9.toc +31 -0
  82. data/test/data/testassert +117 -0
  83. data/test/data/testassert.c +36 -0
  84. data/test/data/testbincue +117 -0
  85. data/test/data/testbincue.c +88 -0
  86. data/test/data/testdefault +117 -0
  87. data/test/data/testdefault.c +196 -0
  88. data/test/data/testischar +117 -0
  89. data/test/data/testischar.c +71 -0
  90. data/test/data/testiso9660 +117 -0
  91. data/test/data/testiso9660.c +153 -0
  92. data/test/data/testtoc +117 -0
  93. data/test/data/testtoc.c +101 -0
  94. data/test/data/vcd_demo.right +116 -0
  95. data/test/data/videocd.nrg +0 -0
  96. data/test/data/videocd.right +92 -0
  97. data/test/testall.rb +4 -0
  98. data/test/testbincue.rb +30 -0
  99. data/test/testtoc.rb +45 -0
  100. metadata +141 -0
@@ -0,0 +1,186 @@
1
+ # $Id: check_common_fn.in,v 1.8 2004/05/06 12:05:49 rocky Exp $
2
+ #
3
+ # Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
4
+ #
5
+ # This program is free software; you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation; either version 2 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # This program is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with this program; if not, write to the Free Software
17
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
+ #
19
+ # Common routines and setup for regression testing.
20
+ SKIP_TEST_EXITCODE=77
21
+
22
+ # Some output changes depending on TZ and locale. Set this so we get known
23
+ # results
24
+ TZ=CUT
25
+ LC_TIME='en_US'
26
+ export TZ LC_TIME
27
+
28
+ check_result() {
29
+ RC=$1
30
+ shift
31
+ msg=$1
32
+ shift
33
+ cmdline=$*
34
+ if test $RC -ne 0 ; then
35
+ if test $RC -ne $SKIP_TEST_EXITCODE ; then
36
+ if test -z "$cmdline" ; then
37
+ echo "$0: $msg failed."
38
+ else
39
+ echo "$0: $msg failed running:"
40
+ echo " $cmdline"
41
+ fi
42
+ exit $RC
43
+ else
44
+ echo "$0: $msg skipped."
45
+ fi
46
+ else
47
+ echo "$0: $msg ok."
48
+ fi
49
+ }
50
+
51
+ test_cdinfo() {
52
+
53
+ opts="$1"
54
+ outfile="$2"
55
+ rightfile="$3"
56
+
57
+ CD_INFO="../src/cd-info"
58
+
59
+ if [ ! -x ${CD_INFO} ]; then
60
+ echo "$0: No ${CD_INFO}"
61
+ return 1
62
+ fi
63
+
64
+ if ${CD_INFO} --no-header ${opts} >${outfile} 2>&1 ; then
65
+ if test "/usr/bin/diff" != no; then
66
+ if /usr/bin/diff -w --unified ${outfile} ${rightfile} ; then
67
+ rm -f $outfile
68
+ return 0
69
+ else
70
+ return 3
71
+ fi
72
+ else
73
+ echo "$0: No diff(1) or cmp(1) found - cannot test ${CD_INFO}"
74
+ rm -f $outfile
75
+ return 77
76
+ fi
77
+ else
78
+ echo "$0 failed running: ${CD_INFO} ${opts}"
79
+ return 2
80
+ fi
81
+
82
+ }
83
+
84
+ test_iso_info() {
85
+
86
+ opts="$1"
87
+ outfile="$2"
88
+ rightfile="$3"
89
+
90
+ ISO_INFO="../src/iso-info"
91
+
92
+ if [ ! -x ${ISO_INFO} ]; then
93
+ echo "$0: No ${ISO_INFO}"
94
+ return 1
95
+ fi
96
+
97
+ if ${ISO_INFO} --no-header ${opts} >${outfile} 2>&1 ; then
98
+ if test "/usr/bin/diff" != no; then
99
+ if /usr/bin/diff -w --unified ${outfile} ${rightfile} ; then
100
+ rm -f $outfile
101
+ return 0
102
+ else
103
+ return 3
104
+ fi
105
+ else
106
+ echo "$0: No diff(1) or cmp(1 found - cannot test ${ISO_INFO}"
107
+ rm -f $outfile
108
+ return 77
109
+ fi
110
+ else
111
+ echo "$0 failed running: ${ISO_INFO} ${opts}"
112
+ return 2
113
+ fi
114
+
115
+ }
116
+
117
+ test_iso_read() {
118
+
119
+ opts="$1"
120
+ outfile="$2"
121
+ rightfile="$3"
122
+
123
+ ISO_READ="../src/iso-read"
124
+
125
+ if [ ! -x ${ISO_READ} ]; then
126
+ echo "$0: No ${ISO_READ}"
127
+ return 1
128
+ fi
129
+
130
+ if ${ISO_READ} ${opts} -o ${outfile} 2>&1 ; then
131
+ if test "/usr/bin/diff" != no; then
132
+ if /usr/bin/diff -w --unified ${outfile} ${rightfile} ; then
133
+ rm -f $outfile
134
+ return 0
135
+ else
136
+ return 3
137
+ fi
138
+ else
139
+ echo "$0: No diff(1) or cmp(1 found - cannot test ${ISO_READ}"
140
+ rm -f $outfile
141
+ return 77
142
+ fi
143
+ else
144
+ echo "$0 failed running: ${ISO_READ} ${opts}"
145
+ return 2
146
+ fi
147
+
148
+ }
149
+
150
+ test_cd_read() {
151
+
152
+ opts="$1"
153
+ outfile="$2"
154
+ rightfile="$3"
155
+
156
+ CD_READ="../src/cd-read"
157
+
158
+ if [ ! -x ${CD_READ} ]; then
159
+ echo "$0: No ${CD_READ}"
160
+ return 1
161
+ fi
162
+
163
+ if ${CD_READ} ${opts} >${outfile} 2>&1 ; then
164
+ if test "/usr/bin/diff" != no; then
165
+ if /usr/bin/diff -w --unified ${outfile} ${rightfile} ; then
166
+ rm -f $outfile
167
+ return 0
168
+ else
169
+ return 3
170
+ fi
171
+ else
172
+ echo "$0: No diff(1) or cmp(1 found - cannot test ${CD_READ}"
173
+ rm -f $outfile
174
+ return 77
175
+ fi
176
+ else
177
+ echo "$0 failed running: ${CD_READ} ${opts}"
178
+ return 2
179
+ fi
180
+
181
+ }
182
+
183
+ #;;; Local Variables: ***
184
+ #;;; mode:shell-script ***
185
+ #;;; eval: (sh-set-shell "bash") ***
186
+ #;;; End: ***
@@ -0,0 +1,186 @@
1
+ # $Id: check_common_fn.in,v 1.8 2004/05/06 12:05:49 rocky Exp $
2
+ #
3
+ # Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
4
+ #
5
+ # This program is free software; you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation; either version 2 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # This program is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with this program; if not, write to the Free Software
17
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
+ #
19
+ # Common routines and setup for regression testing.
20
+ SKIP_TEST_EXITCODE=77
21
+
22
+ # Some output changes depending on TZ and locale. Set this so we get known
23
+ # results
24
+ TZ=CUT
25
+ LC_TIME='en_US'
26
+ export TZ LC_TIME
27
+
28
+ check_result() {
29
+ RC=$1
30
+ shift
31
+ msg=$1
32
+ shift
33
+ cmdline=$*
34
+ if test $RC -ne 0 ; then
35
+ if test $RC -ne $SKIP_TEST_EXITCODE ; then
36
+ if test -z "$cmdline" ; then
37
+ echo "$0: $msg failed."
38
+ else
39
+ echo "$0: $msg failed running:"
40
+ echo " $cmdline"
41
+ fi
42
+ exit $RC
43
+ else
44
+ echo "$0: $msg skipped."
45
+ fi
46
+ else
47
+ echo "$0: $msg ok."
48
+ fi
49
+ }
50
+
51
+ test_cdinfo() {
52
+
53
+ opts="$1"
54
+ outfile="$2"
55
+ rightfile="$3"
56
+
57
+ CD_INFO="../src/cd-info"
58
+
59
+ if [ ! -x ${CD_INFO} ]; then
60
+ echo "$0: No ${CD_INFO}"
61
+ return 1
62
+ fi
63
+
64
+ if ${CD_INFO} --no-header ${opts} >${outfile} 2>&1 ; then
65
+ if test "@DIFF@" != no; then
66
+ if @DIFF@ @DIFF_OPTS@ ${outfile} ${rightfile} ; then
67
+ rm -f $outfile
68
+ return 0
69
+ else
70
+ return 3
71
+ fi
72
+ else
73
+ echo "$0: No diff(1) or cmp(1) found - cannot test ${CD_INFO}"
74
+ rm -f $outfile
75
+ return 77
76
+ fi
77
+ else
78
+ echo "$0 failed running: ${CD_INFO} ${opts}"
79
+ return 2
80
+ fi
81
+
82
+ }
83
+
84
+ test_iso_info() {
85
+
86
+ opts="$1"
87
+ outfile="$2"
88
+ rightfile="$3"
89
+
90
+ ISO_INFO="../src/iso-info"
91
+
92
+ if [ ! -x ${ISO_INFO} ]; then
93
+ echo "$0: No ${ISO_INFO}"
94
+ return 1
95
+ fi
96
+
97
+ if ${ISO_INFO} --no-header ${opts} >${outfile} 2>&1 ; then
98
+ if test "/usr/bin/diff" != no; then
99
+ if @DIFF@ @DIFF_OPTS@ ${outfile} ${rightfile} ; then
100
+ rm -f $outfile
101
+ return 0
102
+ else
103
+ return 3
104
+ fi
105
+ else
106
+ echo "$0: No diff(1) or cmp(1 found - cannot test ${ISO_INFO}"
107
+ rm -f $outfile
108
+ return 77
109
+ fi
110
+ else
111
+ echo "$0 failed running: ${ISO_INFO} ${opts}"
112
+ return 2
113
+ fi
114
+
115
+ }
116
+
117
+ test_iso_read() {
118
+
119
+ opts="$1"
120
+ outfile="$2"
121
+ rightfile="$3"
122
+
123
+ ISO_READ="../src/iso-read"
124
+
125
+ if [ ! -x ${ISO_READ} ]; then
126
+ echo "$0: No ${ISO_READ}"
127
+ return 1
128
+ fi
129
+
130
+ if ${ISO_READ} ${opts} -o ${outfile} 2>&1 ; then
131
+ if test "@DIFF@" != no; then
132
+ if @DIFF@ @DIFF_OPTS@ ${outfile} ${rightfile} ; then
133
+ rm -f $outfile
134
+ return 0
135
+ else
136
+ return 3
137
+ fi
138
+ else
139
+ echo "$0: No diff(1) or cmp(1 found - cannot test ${ISO_READ}"
140
+ rm -f $outfile
141
+ return 77
142
+ fi
143
+ else
144
+ echo "$0 failed running: ${ISO_READ} ${opts}"
145
+ return 2
146
+ fi
147
+
148
+ }
149
+
150
+ test_cd_read() {
151
+
152
+ opts="$1"
153
+ outfile="$2"
154
+ rightfile="$3"
155
+
156
+ CD_READ="../src/cd-read"
157
+
158
+ if [ ! -x ${CD_READ} ]; then
159
+ echo "$0: No ${CD_READ}"
160
+ return 1
161
+ fi
162
+
163
+ if ${CD_READ} ${opts} >${outfile} 2>&1 ; then
164
+ if test "@DIFF@" != no; then
165
+ if @DIFF@ @DIFF_OPTS@ ${outfile} ${rightfile} ; then
166
+ rm -f $outfile
167
+ return 0
168
+ else
169
+ return 3
170
+ fi
171
+ else
172
+ echo "$0: No diff(1) or cmp(1 found - cannot test ${CD_READ}"
173
+ rm -f $outfile
174
+ return 77
175
+ fi
176
+ else
177
+ echo "$0 failed running: ${CD_READ} ${opts}"
178
+ return 2
179
+ fi
180
+
181
+ }
182
+
183
+ #;;; Local Variables: ***
184
+ #;;; mode:shell-script ***
185
+ #;;; eval: (sh-set-shell "bash") ***
186
+ #;;; End: ***
@@ -0,0 +1,102 @@
1
+ #!/bin/sh
2
+ #$Id: check_cue.sh.in,v 1.20 2004/07/24 14:23:39 rocky Exp $
3
+ # Tests to see that BIN/CUE and cdrdao TOC file iamge reading is correct
4
+ # (via cd-info).
5
+
6
+ if test -n "-lvcdinfo -lvcd -liso9660 -lcdio -lm " ; then
7
+ vcd_opt='--no-vcd'
8
+ fi
9
+
10
+ if test -z "$srcdir" ; then
11
+ srcdir=`pwd`
12
+ fi
13
+
14
+ . ${srcdir}/check_common_fn
15
+
16
+ if test ! -x ../src/cd-info ; then
17
+ exit 77
18
+ fi
19
+
20
+ BASE=`basename $0 .sh`
21
+
22
+ fname=cdda
23
+ testnum=CD-DA
24
+ opts="--quiet --cue-file ${srcdir}/${fname}.cue --no-cddb"
25
+ test_cdinfo "$opts" ${fname}.dump ${srcdir}/${fname}.right
26
+ RC=$?
27
+ check_result $RC "cd-info CUE test $testnum" "cd-info $opts"
28
+
29
+
30
+ opts="--quiet --bin-file ${srcdir}/${fname}.bin --no-cddb"
31
+ test_cdinfo "$opts" ${fname}.dump ${srcdir}/${fname}.right
32
+ RC=$?
33
+ check_result $RC "cd-info BIN test $testnum" "cd-info $opts"
34
+
35
+ opts="--quiet --toc-file ${srcdir}/${fname}.toc --no-cddb"
36
+ test_cdinfo "$opts" ${fname}.dump ${srcdir}/${fname}.right
37
+ RC=$?
38
+ check_result $RC "cd-info TOC test $testnum" "cd-info $opts"
39
+
40
+ fname=isofs-m1
41
+ testnum='ISO 9660 mode1 CUE'
42
+ if test -f ${srcdir}/${fname}.bin ; then
43
+ opts="-q --no-disc-mode --cue-file ${srcdir}/${fname}.cue --iso9660"
44
+ test_cdinfo "$opts" ${fname}.dump ${srcdir}/${fname}.right
45
+ RC=$?
46
+ check_result $RC "cd-info CUE test $testnum" "$opts"
47
+ else
48
+ echo "Don't see CUE file ${srcdir}/${fname}.bin. Test $testnum skipped."
49
+ fi
50
+
51
+ testnum='ISO 9660 mode1 TOC'
52
+ if test -f ${srcdir}/${fname}.bin ; then
53
+ opts="-q --no-disc-mode --toc-file ${srcdir}/${fname}.toc --iso9660"
54
+ test_cdinfo "$opts" ${fname}.dump ${srcdir}/${fname}.right
55
+ RC=$?
56
+ check_result $RC "cd-info TOC test $testnum" "cd-info $opts"
57
+ else
58
+ echo "Don't see TOC file ${srcdir}/${fname}.bin. Test $testnum skipped."
59
+ fi
60
+
61
+ fname=vcd_demo
62
+ if test -z "-lvcdinfo -lvcd -liso9660 -lcdio -lm " ; then
63
+ right=${srcdir}/${fname}.right
64
+ else
65
+ right=${srcdir}/${fname}_vcdinfo.right
66
+ fi
67
+ testnum='Video CD'
68
+ if test -f ${srcdir}/${fname}.bin ; then
69
+ opts="-q --no-disc-mode -c ${srcdir}/${fname}.cue --iso9660"
70
+ test_cdinfo "$opts" ${fname}.dump $right
71
+ RC=$?
72
+ check_result $RC "cd-info CUE test $testnum" "cd-info $opts"
73
+
74
+ opts="-q --no-disc-mode -t ${srcdir}/${fname}.toc --iso9660"
75
+ if test -f ${srcdir}/${fname}.toc ; then
76
+ test_cdinfo "$opts" ${fname}.dump $right
77
+ RC=$?
78
+ check_result $RC "cd-info TOC test $testnum" "cd-info $opts"
79
+ else
80
+ echo "Don't see TOC file ${srcdir}/${fname}.toc. Test $testnum skipped."
81
+ fi
82
+ else
83
+ echo "Don't see CUE file ${srcdir}/${fname}.cue. Test $testnum skipped."
84
+ fi
85
+
86
+ fname=svcd_ogt_test_ntsc
87
+ testnum='Super Video CD'
88
+ if test -f ${srcdir}/${fname}.bin ; then
89
+ opts="-q --no-disc-mode --cue-file ${srcdir}/${fname}.cue $vcd_opt --iso9660"
90
+ test_cdinfo "$opts" ${fname}.dump ${srcdir}/${fname}.right
91
+ RC=$?
92
+ check_result $RC "cd-info CUE test $testnum" "cd-info $opts"
93
+ else
94
+ echo "Don't see CUE file ${srcdir}/${fname}.bin. Test $testnum skipped."
95
+ fi
96
+
97
+ exit $RC
98
+
99
+ #;;; Local Variables: ***
100
+ #;;; mode:shell-script ***
101
+ #;;; eval: (sh-set-shell "bash") ***
102
+ #;;; End: ***