rb_cdio 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. data/VERSION +1 -1
  2. data/ext/CdIo.h +0 -9
  3. data/ext/CdIo_Cd.c +1 -1
  4. data/ext/CdIo_Cdda.c +7 -1
  5. data/ext/extconf.rb +6 -6
  6. data/ext/mkmf.log +45 -20
  7. data/test/{testbincue.rb → test_bincue.rb} +0 -0
  8. data/test/{testclose.rb → test_close.rb} +0 -0
  9. data/test/{testmethods.rb → test_methods.rb} +1 -1
  10. data/test/{testtoc.rb → test_toc.rb} +4 -2
  11. data/test/testall.rb +4 -4
  12. metadata +195 -406
  13. data/doc/classes/CdIo.html +0 -511
  14. data/doc/classes/CdIo.src/M000001.html +0 -17
  15. data/doc/classes/CdIo.src/M000002.html +0 -17
  16. data/doc/classes/CdIo.src/M000003.html +0 -17
  17. data/doc/classes/CdIo.src/M000004.html +0 -17
  18. data/doc/classes/CdIo.src/M000005.html +0 -17
  19. data/doc/classes/CdIo.src/M000006.html +0 -17
  20. data/doc/classes/CdIo.src/M000007.html +0 -17
  21. data/doc/classes/CdIo.src/M000008.html +0 -17
  22. data/doc/classes/CdIo/Cd.html +0 -348
  23. data/doc/classes/CdIo/Cd.src/M000020.html +0 -17
  24. data/doc/classes/CdIo/Cd.src/M000021.html +0 -17
  25. data/doc/classes/CdIo/Cd.src/M000022.html +0 -17
  26. data/doc/classes/CdIo/Cd.src/M000023.html +0 -17
  27. data/doc/classes/CdIo/Cd.src/M000024.html +0 -17
  28. data/doc/classes/CdIo/Cd.src/M000025.html +0 -17
  29. data/doc/classes/CdIo/Cd.src/M000026.html +0 -17
  30. data/doc/classes/CdIo/Cd.src/M000027.html +0 -17
  31. data/doc/classes/CdIo/Cd.src/M000028.html +0 -17
  32. data/doc/classes/CdIo/Cd.src/M000029.html +0 -17
  33. data/doc/classes/CdIo/Cd.src/M000030.html +0 -17
  34. data/doc/classes/CdIo/Cd.src/M000031.html +0 -17
  35. data/doc/classes/CdIo/Cd.src/M000032.html +0 -17
  36. data/doc/classes/CdIo/Cd.src/M000033.html +0 -17
  37. data/doc/classes/CdIo/Cd.src/M000034.html +0 -17
  38. data/doc/classes/CdIo/Cd.src/M000035.html +0 -17
  39. data/doc/classes/CdIo/Cdda.html +0 -428
  40. data/doc/classes/CdIo/Cdda.src/M000009.html +0 -17
  41. data/doc/classes/CdIo/Cdda.src/M000010.html +0 -17
  42. data/doc/classes/CdIo/Cdda.src/M000011.html +0 -17
  43. data/doc/classes/CdIo/Cdda.src/M000012.html +0 -17
  44. data/doc/classes/CdIo/Cdda.src/M000013.html +0 -17
  45. data/doc/classes/CdIo/Cdda.src/M000014.html +0 -17
  46. data/doc/classes/CdIo/Cdda.src/M000015.html +0 -17
  47. data/doc/classes/CdIo/Cdda.src/M000016.html +0 -17
  48. data/doc/classes/CdIo/Cdda.src/M000017.html +0 -17
  49. data/doc/classes/CdIo/Cdda.src/M000018.html +0 -17
  50. data/doc/classes/CdIo/Cdda.src/M000019.html +0 -17
  51. data/doc/classes/CdIo/Cdda.src/M000020.html +0 -17
  52. data/doc/classes/CdIo/Cdda.src/M000021.html +0 -17
  53. data/doc/classes/CdIo/Cdda.src/M000022.html +0 -17
  54. data/doc/classes/CdIo/Cdda.src/M000023.html +0 -17
  55. data/doc/classes/CdIo/Cdda.src/M000024.html +0 -17
  56. data/doc/classes/CdIo/Exception.html +0 -118
  57. data/doc/classes/CdIo/Exception/BadParameter.html +0 -111
  58. data/doc/classes/CdIo/Exception/BadPointer.html +0 -111
  59. data/doc/classes/CdIo/Exception/CddbConn.html +0 -111
  60. data/doc/classes/CdIo/Exception/CddbError.html +0 -111
  61. data/doc/classes/CdIo/Exception/Error.html +0 -111
  62. data/doc/classes/CdIo/Exception/NoDriver.html +0 -111
  63. data/doc/classes/CdIo/Exception/NotPermitted.html +0 -111
  64. data/doc/classes/CdIo/Exception/Unsupported.html +0 -111
  65. data/doc/classes/CdIo/Track.html +0 -246
  66. data/doc/classes/CdIo/Track.src/M000017.html +0 -17
  67. data/doc/classes/CdIo/Track.src/M000018.html +0 -17
  68. data/doc/classes/CdIo/Track.src/M000019.html +0 -17
  69. data/doc/classes/CdIo/Track.src/M000025.html +0 -17
  70. data/doc/classes/CdIo/Track.src/M000026.html +0 -17
  71. data/doc/classes/CdIo/Track.src/M000027.html +0 -17
  72. data/doc/classes/CdIo/TrackCdda.html +0 -169
  73. data/doc/classes/CdIo/TrackCdda.src/M000031.html +0 -17
  74. data/doc/classes/CdIo/TrackCdda.src/M000039.html +0 -17
  75. data/doc/classes/CdIo/TrackCdda.src/M000040.html +0 -17
  76. data/doc/classes/CdIo/TrackCdda.src/M000041.html +0 -17
  77. data/doc/classes/CdIo/TrackIso9660.html +0 -159
  78. data/doc/classes/CdIo/Tracks.html +0 -199
  79. data/doc/classes/CdIo/Tracks.src/M000028.html +0 -17
  80. data/doc/classes/CdIo/Tracks.src/M000029.html +0 -17
  81. data/doc/classes/CdIo/Tracks.src/M000030.html +0 -17
  82. data/doc/classes/CdIo/Tracks.src/M000036.html +0 -17
  83. data/doc/classes/CdIo/Tracks.src/M000037.html +0 -17
  84. data/doc/classes/CdIo/Tracks.src/M000038.html +0 -17
  85. data/doc/created.rid +0 -1
  86. data/doc/files/__/rb_cdio_def_rb.html +0 -235
  87. data/doc/files/rb_cdio_def_rb.html +0 -244
  88. data/doc/fr_class_index.html +0 -42
  89. data/doc/fr_file_index.html +0 -27
  90. data/doc/fr_method_index.html +0 -67
  91. data/doc/index.html +0 -24
  92. data/mkmf.log +0 -26
  93. data/svn-commit.tmp +0 -5
  94. data/tags +0 -47
  95. data/test/data/check_common_fn.in +0 -186
  96. data/test/data/check_cue.sh.in +0 -117
  97. data/test/data/check_iso.sh.in +0 -52
  98. data/test/data/check_nrg.sh.in +0 -70
  99. data/test/data/check_paranoia.sh.in +0 -78
  100. data/test/data/check_sizeof +0 -117
  101. data/test/data/check_sizeof.c +0 -77
  102. data/test/data/testassert.c +0 -36
  103. data/test/data/testbincue.c +0 -104
  104. data/test/data/testdefault.c +0 -202
  105. data/test/data/testischar.c +0 -71
  106. data/test/data/testiso9660.c +0 -158
  107. data/test/data/testparanoia.c +0 -185
  108. data/test/data/testtoc.c +0 -114
@@ -1,117 +0,0 @@
1
- #! /bin/sh
2
-
3
- # check_sizeof - temporary wrapper script for .libs/check_sizeof
4
- # Generated by ltmain.sh - GNU libtool 1.5.6 (1.1220.2.95 2004/04/11 05:50:42)
5
- #
6
- # The check_sizeof program cannot be directly executed until all the libtool
7
- # libraries that it depends on are installed.
8
- #
9
- # This wrapper script should never be moved out of the build directory.
10
- # If it is, it will not operate correctly.
11
-
12
- # Sed substitution that helps us do robust quoting. It backslashifies
13
- # metacharacters that are still active within double-quoted strings.
14
- Xsed='/bin/sed -e 1s/^X//'
15
- sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
16
-
17
- # The HP-UX ksh and POSIX shell print the target directory to stdout
18
- # if CDPATH is set.
19
- if test "${CDPATH+set}" = set; then CDPATH=:; export CDPATH; fi
20
-
21
- relink_command="(cd /home/cdx/libcdio-0.70/test; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; PATH=\"/opt/sun-jre-bin-1.5.0.03/bin:/opt/sun-jre-bin-1.5.0.03/javaws:/opt/sun-jre-bin-1.5.0.03/bin:/opt/sun-jre-bin-1.5.0.03/javaws:/bin:/usr/bin:/usr/local/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/3.3.5-20050130:/opt/blackdown-jdk-1.4.2.01/bin:/opt/blackdown-jdk-1.4.2.01/jre/bin:/usr/qt/3/bin:/usr/kde/3.3/bin:/usr/games/bin:~/bin:~/RealPlayer:~/bin:~/RealPlayer\"; export PATH; gcc -g -O2 -Wall -Wchar-subscripts -Wmissing-prototypes -Wmissing-declarations -Wunused -Wpointer-arith -Wwrite-strings -Wnested-externs -Wno-sign-compare -o \$progdir/\$file check_sizeof.o ../lib/.libs/libiso9660.so /home/cdx/libcdio-0.70/lib/.libs/libcdio.so ../lib/.libs/libcdio.so -lm -Wl,--rpath -Wl,/home/cdx/libcdio-0.70/lib/.libs -Wl,--rpath -Wl,/home/cdx/libcdio-0.70/opt/lib)"
22
-
23
- # This environment variable determines our operation mode.
24
- if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
25
- # install mode needs the following variable:
26
- notinst_deplibs=' ../lib/libiso9660.la /home/cdx/libcdio-0.70/lib/libcdio.la ../lib/libcdio.la'
27
- else
28
- # When we are sourced in execute mode, $file and $echo are already set.
29
- if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
30
- echo="echo"
31
- file="$0"
32
- # Make sure echo works.
33
- if test "X$1" = X--no-reexec; then
34
- # Discard the --no-reexec flag, and continue.
35
- shift
36
- elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
37
- # Yippee, $echo works!
38
- :
39
- else
40
- # Restart under the correct shell, and then maybe $echo will work.
41
- exec /bin/sh "$0" --no-reexec ${1+"$@"}
42
- fi
43
- fi
44
-
45
- # Find the directory that this script lives in.
46
- thisdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
47
- test "x$thisdir" = "x$file" && thisdir=.
48
-
49
- # Follow symbolic links until we get to the real thisdir.
50
- file=`ls -ld "$file" | /bin/sed -n 's/.*-> //p'`
51
- while test -n "$file"; do
52
- destdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
53
-
54
- # If there was a directory component, then change thisdir.
55
- if test "x$destdir" != "x$file"; then
56
- case "$destdir" in
57
- [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
58
- *) thisdir="$thisdir/$destdir" ;;
59
- esac
60
- fi
61
-
62
- file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
63
- file=`ls -ld "$thisdir/$file" | /bin/sed -n 's/.*-> //p'`
64
- done
65
-
66
- # Try to get the absolute directory name.
67
- absdir=`cd "$thisdir" && pwd`
68
- test -n "$absdir" && thisdir="$absdir"
69
-
70
- program=lt-'check_sizeof'
71
- progdir="$thisdir/.libs"
72
-
73
- if test ! -f "$progdir/$program" || \
74
- { file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /bin/sed 1q`; \
75
- test "X$file" != "X$progdir/$program"; }; then
76
-
77
- file="$$-$program"
78
-
79
- if test ! -d "$progdir"; then
80
- mkdir "$progdir"
81
- else
82
- rm -f "$progdir/$file"
83
- fi
84
-
85
- # relink executable if necessary
86
- if test -n "$relink_command"; then
87
- if relink_command_output=`eval $relink_command 2>&1`; then :
88
- else
89
- echo "$relink_command_output" >&2
90
- rm -f "$progdir/$file"
91
- exit 1
92
- fi
93
- fi
94
-
95
- mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
96
- { rm -f "$progdir/$program";
97
- mv -f "$progdir/$file" "$progdir/$program"; }
98
- rm -f "$progdir/$file"
99
- fi
100
-
101
- if test -f "$progdir/$program"; then
102
- if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
103
- # Run the actual program with our arguments.
104
-
105
- exec $progdir/$program ${1+"$@"}
106
-
107
- $echo "$0: cannot exec $program ${1+"$@"}"
108
- exit 1
109
- fi
110
- else
111
- # The program doesn't exist.
112
- $echo "$0: error: $progdir/$program does not exist" 1>&2
113
- $echo "This script is just a wrapper for $program." 1>&2
114
- echo "See the libtool documentation for more information." 1>&2
115
- exit 1
116
- fi
117
- fi
@@ -1,77 +0,0 @@
1
- /*
2
- $Id: check_sizeof.c,v 1.4 2005/02/12 10:23:18 rocky Exp $
3
-
4
- Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
5
-
6
- This program is free software; you can redistribute it and/or modify
7
- it under the terms of the GNU General Public License as published by
8
- the Free Software Foundation; either version 2 of the License, or
9
- (at your option) any later version.
10
-
11
- This program is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU General Public License for more details.
15
-
16
- You should have received a copy of the GNU General Public License
17
- along with this program; if not, write to the Free Software
18
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
- */
20
-
21
- #ifdef HAVE_CONFIG_H
22
- # include "config.h"
23
- #endif
24
-
25
- #include <assert.h>
26
- #include <stdlib.h>
27
- #include <string.h>
28
- #include <stdio.h>
29
- #include <math.h>
30
-
31
- #include <cdio/iso9660.h>
32
- #include <cdio/types.h>
33
-
34
- /* Private headers */
35
- #include "iso9660_private.h"
36
-
37
- #define CHECK_SIZEOF(typnam) { \
38
- printf ("checking sizeof (%s) ...", #typnam); \
39
- if (sizeof (typnam) != (typnam##_SIZEOF)) { \
40
- printf ("failed!\n==> sizeof (%s) == %d (but should be %d)\n", \
41
- #typnam, (int)sizeof(typnam), (int)(typnam##_SIZEOF)); \
42
- fail++; \
43
- } else { pass++; printf ("ok!\n"); } \
44
- }
45
-
46
- #define CHECK_SIZEOF_STRUCT(typnam) { \
47
- printf ("checking sizeof (struct %s) ...", #typnam); \
48
- if (sizeof (struct typnam) != (struct_##typnam##_SIZEOF)) { \
49
- printf ("failed!\n==> sizeof (struct %s) == %d (but should be %d)\n", \
50
- #typnam, (int)sizeof(struct typnam), (int)(struct_##typnam##_SIZEOF)); \
51
- fail++; \
52
- } else { pass++; printf ("ok!\n"); } \
53
- }
54
-
55
- int main (int argc, const char *argv[])
56
- {
57
- unsigned fail = 0, pass = 0;
58
-
59
- /* <cdio/types.h> */
60
- CHECK_SIZEOF(msf_t);
61
-
62
- /* "iso9660_private.h" */
63
- CHECK_SIZEOF(iso_volume_descriptor_t);
64
- CHECK_SIZEOF(iso9660_pvd_t);
65
- CHECK_SIZEOF(iso_path_table_t);
66
- CHECK_SIZEOF(iso9660_dir_t);
67
-
68
- #define iso9660_xa_t_SIZEOF 14
69
-
70
- /* xa.h */
71
- CHECK_SIZEOF(iso9660_xa_t);
72
-
73
- if (fail)
74
- return 1;
75
-
76
- return 0;
77
- }
@@ -1,36 +0,0 @@
1
- /*
2
- $Id: testassert.c,v 1.1 2003/08/17 05:31:19 rocky Exp $
3
-
4
- Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
5
-
6
- This program is free software; you can redistribute it and/or modify
7
- it under the terms of the GNU General Public License as published by
8
- the Free Software Foundation; either version 2 of the License, or
9
- (at your option) any later version.
10
-
11
- This program is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU General Public License for more details.
15
-
16
- You should have received a copy of the GNU General Public License
17
- along with this program; if not, write to the Free Software
18
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
- */
20
-
21
- #ifdef HAVE_CONFIG_H
22
- # include "config.h"
23
- #endif
24
-
25
- /* Private headers */
26
- #include "cdio_assert.h"
27
-
28
- int
29
- main (int argc, const char *argv[])
30
- {
31
- cdio_assert (argc < 2);
32
-
33
- cdio_assert_not_reached ();
34
-
35
- return 0;
36
- }
@@ -1,104 +0,0 @@
1
- /*
2
- $Id: testbincue.c,v 1.5 2004/10/26 01:21:05 rocky Exp $
3
-
4
- Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
5
-
6
- This program is free software; you can redistribute it and/or modify
7
- it under the terms of the GNU General Public License as published by
8
- the Free Software Foundation; either version 2 of the License, or
9
- (at your option) any later version.
10
-
11
- This program is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU General Public License for more details.
15
-
16
- You should have received a copy of the GNU General Public License
17
- along with this program; if not, write to the Free Software
18
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
- */
20
-
21
- /*
22
- Regression test for cdio_binfile().
23
- */
24
- #ifdef HAVE_CONFIG_H
25
- # include "config.h"
26
- #endif
27
- #include <cdio/cdio.h>
28
- #include <cdio/logging.h>
29
-
30
- #ifdef HAVE_STDIO_H
31
- #include <stdio.h>
32
- #endif
33
- #ifdef HAVE_SYS_TYPES_H
34
- #include <sys/types.h>
35
- #endif
36
- #ifdef HAVE_STDLIB_H
37
- #include <stdlib.h>
38
- #endif
39
- #include <string.h>
40
-
41
- #ifndef TEST_DIR
42
- #define TEST_DIR "."
43
- #endif
44
-
45
- #define NUM_GOOD_CUES 2
46
- #define NUM_BAD_CUES 7
47
- int
48
- main(int argc, const char *argv[])
49
- {
50
- const char *cue_file[NUM_GOOD_CUES] = {
51
- "cdda.cue",
52
- "isofs-m1.cue",
53
- };
54
-
55
- const char *badcue_file[NUM_BAD_CUES] = {
56
- "bad-cat1.cue",
57
- "bad-cat2.cue",
58
- "bad-cat3.cue",
59
- "bad-mode1.cue",
60
- "bad-msf-1.cue",
61
- "bad-msf-2.cue",
62
- "bad-msf-3.cue",
63
- };
64
- int ret=0;
65
- unsigned int i;
66
- char psz_cuefile[500];
67
-
68
- psz_cuefile[sizeof(psz_cuefile)-1] = '\0';
69
- cdio_loglevel_default = (argc > 1) ? CDIO_LOG_DEBUG : CDIO_LOG_INFO;
70
- for (i=0; i<NUM_GOOD_CUES; i++) {
71
- char *psz_binfile;
72
- snprintf(psz_cuefile, sizeof(psz_cuefile)-1,
73
- "%s/%s", TEST_DIR, cue_file[i]);
74
- psz_binfile = cdio_is_cuefile(psz_cuefile);
75
- if (!psz_binfile) {
76
- printf("Incorrect: %s doesn't parse as a CDRWin CUE file.\n",
77
- cue_file[i]);
78
- ret=i+1;
79
- } else {
80
- printf("Correct: %s parses as a CDRWin CUE file.\n",
81
- cue_file[i]);
82
- free(psz_binfile);
83
- }
84
- }
85
-
86
- for (i=0; i<NUM_BAD_CUES; i++) {
87
- char *psz_binfile;
88
- snprintf(psz_cuefile, sizeof(psz_cuefile)-1,
89
- "%s/%s", TEST_DIR, badcue_file[i]);
90
- psz_binfile=cdio_is_cuefile(psz_cuefile);
91
- if (!psz_binfile) {
92
- printf("Correct: %s doesn't parse as a CDRWin CUE file.\n",
93
- badcue_file[i]);
94
- } else {
95
- printf("Incorrect: %s parses as a CDRWin CUE file.\n",
96
- badcue_file[i]);
97
- free(psz_binfile);
98
- ret+=50*i+1;
99
- break;
100
- }
101
- }
102
-
103
- return ret;
104
- }
@@ -1,202 +0,0 @@
1
- /*
2
- $Id: testdefault.c,v 1.6 2005/01/23 05:51:44 rocky Exp $
3
-
4
- Copyright (C) 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
5
-
6
- This program is free software; you can redistribute it and/or modify
7
- it under the terms of the GNU General Public License as published by
8
- the Free Software Foundation; either version 2 of the License, or
9
- (at your option) any later version.
10
-
11
- This program is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU General Public License for more details.
15
-
16
- You should have received a copy of the GNU General Public License
17
- along with this program; if not, write to the Free Software
18
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
- */
20
-
21
- /*
22
- Regression test for cdio_get_devices, cdio_get_devices_with_cap(),
23
- and cdio_free_device_list()
24
- */
25
- #ifdef HAVE_CONFIG_H
26
- # include "config.h"
27
- #endif
28
- #include <cdio/cdio.h>
29
- #include <cdio/cd_types.h>
30
- #include <cdio/logging.h>
31
-
32
- #ifdef HAVE_STDIO_H
33
- #include <stdio.h>
34
- #endif
35
- #ifdef HAVE_SYS_TYPES_H
36
- #include <sys/types.h>
37
- #endif
38
- #ifdef HAVE_STDLIB_H
39
- #include <stdlib.h>
40
- #endif
41
- #include <string.h>
42
-
43
- static void
44
- log_handler (cdio_log_level_t level, const char message[])
45
- {
46
- switch(level) {
47
- case CDIO_LOG_DEBUG:
48
- case CDIO_LOG_INFO:
49
- return;
50
- default:
51
- printf("cdio %d message: %s\n", level, message);
52
- }
53
- }
54
-
55
- static bool
56
- is_in(char **file_list, const char *file)
57
- {
58
- char **p;
59
- for (p = file_list; p != NULL && *p != NULL; p++) {
60
- if (strcmp(*p, file) == 0) {
61
- printf("File %s found as expected\n", file);
62
- return true;
63
- }
64
- }
65
- printf("Can't find file %s in list\n", file);
66
- return false;
67
- }
68
-
69
- int
70
- main(int argc, const char *argv[])
71
- {
72
- char **nrg_images=NULL;
73
- char **bincue_images=NULL;
74
- char **imgs;
75
- char **c;
76
- unsigned int i;
77
- int ret=0;
78
-
79
- const char *cue_files[2] = {"cdda.cue", "isofs-m1.cue"};
80
- const char *nrg_files[1] = {"videocd.nrg"};
81
-
82
- cdio_log_set_handler (log_handler);
83
-
84
- if (! (cdio_have_driver(DRIVER_NRG) && cdio_have_driver(DRIVER_BINCUE)) ) {
85
- printf("You don't have enough drivers for this test\n");
86
- exit(77);
87
- }
88
-
89
- nrg_images = cdio_get_devices(DRIVER_NRG);
90
-
91
- for (imgs=nrg_images; *imgs != NULL; imgs++) {
92
- printf("NRG image %s\n", *imgs);
93
- }
94
-
95
- if (!is_in(nrg_images, nrg_files[0])) {
96
- cdio_free_device_list(nrg_images);
97
- free(nrg_images);
98
- return 10;
99
- }
100
-
101
- bincue_images = cdio_get_devices(DRIVER_BINCUE);
102
-
103
- for (imgs=bincue_images; *imgs != NULL; imgs++) {
104
- printf("bincue image %s\n", *imgs);
105
- }
106
-
107
- for (i=0; i<2; i++) {
108
- if (is_in(bincue_images, cue_files[i])) {
109
- printf("%s parses as a CDRWIN BIN/CUE csheet.\n", cue_files[i]);
110
- } else {
111
- printf("%s doesn't parse as a CDRWIN BIN/CUE csheet.\n", cue_files[i]);
112
- ret = i+1;
113
- }
114
- }
115
-
116
- if (ret != 0) return ret;
117
-
118
- printf("-----\n");
119
- printf("ISO 9660 images...\n");
120
- imgs = NULL;
121
- /* Print out a list of CDDA-drives. */
122
- imgs = cdio_get_devices_with_cap(bincue_images, CDIO_FS_ISO_9660, false);
123
-
124
- if (NULL == imgs || *imgs == NULL) {
125
- printf("Failed to find an ISO 9660 image\n");
126
- return 11;
127
- }
128
-
129
- for( c = imgs; *c != NULL; c++ ) {
130
- printf("%s\n", *c);
131
- }
132
-
133
- cdio_free_device_list(imgs);
134
- free(imgs);
135
-
136
-
137
- printf("-----\n");
138
- printf("CD-DA images...\n");
139
- imgs = NULL;
140
- /* Print out a list of CDDA-drives. */
141
- imgs = cdio_get_devices_with_cap(bincue_images, CDIO_FS_AUDIO, false);
142
-
143
- if (NULL == imgs || *imgs == NULL) {
144
- printf("Failed to find CDDA image\n");
145
- return 12;
146
- }
147
-
148
- for( c = imgs; *c != NULL; c++ ) {
149
- printf("%s\n", *c);
150
- }
151
-
152
- cdio_free_device_list(imgs);
153
- free(imgs);
154
-
155
-
156
- printf("-----\n");
157
- imgs = NULL;
158
- printf("VCD images...\n");
159
- /* Print out a list of CD-drives with VCD's in them. */
160
- imgs = cdio_get_devices_with_cap(nrg_images,
161
- (CDIO_FS_ANAL_SVCD|CDIO_FS_ANAL_CVD|CDIO_FS_ANAL_VIDEOCD|CDIO_FS_UNKNOWN),
162
- true);
163
- if (NULL == imgs || *imgs == NULL) {
164
- printf("Failed to find VCD image\n");
165
- return 13;
166
- }
167
-
168
- for( c = imgs; *c != NULL; c++ ) {
169
- printf("image: %s\n", *c);
170
- }
171
-
172
- cdio_free_device_list(imgs);
173
- free(imgs);
174
-
175
- imgs = NULL;
176
- /* Print out a list of CDDA-drives. */
177
- imgs = cdio_get_devices_with_cap(bincue_images, CDIO_FS_HIGH_SIERRA, false);
178
-
179
- if (NULL != imgs && *imgs != NULL) {
180
- printf("Found erroneous High Sierra image\n");
181
- return 14;
182
- }
183
-
184
- imgs = NULL;
185
- /* Print out a list of CDDA-drives. */
186
- imgs = cdio_get_devices_with_cap(bincue_images, CDIO_FS_UFS, true);
187
-
188
- if (NULL != imgs && *imgs != NULL) {
189
- printf("Found erroneous UFS image\n");
190
- return 15;
191
- }
192
-
193
- cdio_free_device_list(nrg_images);
194
- free(nrg_images);
195
- cdio_free_device_list(bincue_images);
196
- free(bincue_images);
197
- cdio_free_device_list(imgs);
198
- free(imgs);
199
-
200
- return 0;
201
-
202
- }