Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
bd97586c
Commit
bd97586c
authored
Dec 16, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
archive/iso: renamed plugin to "iso9660"
Based on libiso9660.
parent
c3e0fbd9
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
41 deletions
+52
-41
Makefile.am
Makefile.am
+2
-2
NEWS
NEWS
+1
-0
configure.ac
configure.ac
+2
-2
iso9660_archive_plugin.c
src/archive/iso9660_archive_plugin.c
+44
-34
archive_list.c
src/archive_list.c
+3
-3
No files found.
Makefile.am
View file @
bd97586c
...
@@ -358,8 +358,8 @@ if HAVE_ZZIP
...
@@ -358,8 +358,8 @@ if HAVE_ZZIP
ARCHIVE_SRC
+=
src/archive/zzip_archive_plugin.c
ARCHIVE_SRC
+=
src/archive/zzip_archive_plugin.c
endif
endif
if
HAVE_ISO
if
HAVE_ISO
9660
ARCHIVE_SRC
+=
src/archive/iso_plugin.c
ARCHIVE_SRC
+=
src/archive/iso
9660_archive
_plugin.c
endif
endif
if
ENABLE_ARCHIVE
if
ENABLE_ARCHIVE
...
...
NEWS
View file @
bd97586c
...
@@ -11,6 +11,7 @@ ver 0.16 (20??/??/??)
...
@@ -11,6 +11,7 @@ ver 0.16 (20??/??/??)
- allow changing replay gain mode on-the-fly
- allow changing replay gain mode on-the-fly
- omitting the range end is possible
- omitting the range end is possible
* archive:
* archive:
- iso: renamed plugin to "iso9660"
- zip: renamed plugin to "zzip"
- zip: renamed plugin to "zzip"
* input:
* input:
- lastfm: obsolete plugin removed
- lastfm: obsolete plugin removed
...
...
configure.ac
View file @
bd97586c
...
@@ -378,9 +378,9 @@ AC_ARG_ENABLE(iso9660,
...
@@ -378,9 +378,9 @@ AC_ARG_ENABLE(iso9660,
MPD_AUTO_PKG(iso9660, ISO9660, [libiso9660],
MPD_AUTO_PKG(iso9660, ISO9660, [libiso9660],
[libiso9660 archive library], [libiso9660 not found])
[libiso9660 archive library], [libiso9660 not found])
AM_CONDITIONAL(HAVE_ISO, test x$enable_iso9660 = xyes)
AM_CONDITIONAL(HAVE_ISO
9660
, test x$enable_iso9660 = xyes)
if test x$enable_iso9660 = xyes; then
if test x$enable_iso9660 = xyes; then
AC_DEFINE(HAVE_ISO
, 1, [Define to have iso
archive support])
AC_DEFINE(HAVE_ISO
9660, 1, [Define to have ISO9660
archive support])
fi
fi
dnl archive API
dnl archive API
...
...
src/archive/iso_plugin.c
→
src/archive/iso
9660_archive
_plugin.c
View file @
bd97586c
...
@@ -33,16 +33,16 @@
...
@@ -33,16 +33,16 @@
#define CEILING(x, y) ((x+(y-1))/y)
#define CEILING(x, y) ((x+(y-1))/y)
typedef
struct
{
struct
iso9660_archive_file
{
iso9660_t
*
iso
;
iso9660_t
*
iso
;
iso9660_stat_t
*
statbuf
;
iso9660_stat_t
*
statbuf
;
size_t
cur_ofs
;
size_t
cur_ofs
;
size_t
max_blocks
;
size_t
max_blocks
;
GSList
*
list
;
GSList
*
list
;
GSList
*
iter
;
GSList
*
iter
;
}
iso_context
;
};
static
const
struct
input_plugin
iso
_input
plugin
;
static
const
struct
input_plugin
iso
9660_input_
plugin
;
static
inline
GQuark
static
inline
GQuark
iso9660_quark
(
void
)
iso9660_quark
(
void
)
...
@@ -53,7 +53,7 @@ iso9660_quark(void)
...
@@ -53,7 +53,7 @@ iso9660_quark(void)
/* archive open && listing routine */
/* archive open && listing routine */
static
void
static
void
listdir_recur
(
const
char
*
psz_path
,
iso_context
*
context
)
listdir_recur
(
const
char
*
psz_path
,
struct
iso9660_archive_file
*
context
)
{
{
iso9660_t
*
iso
=
context
->
iso
;
iso9660_t
*
iso
=
context
->
iso
;
CdioList_t
*
entlist
;
CdioList_t
*
entlist
;
...
@@ -87,9 +87,10 @@ listdir_recur(const char *psz_path, iso_context *context)
...
@@ -87,9 +87,10 @@ listdir_recur(const char *psz_path, iso_context *context)
}
}
static
struct
archive_file
*
static
struct
archive_file
*
iso_open
(
char
*
pathname
)
iso
9660_archive
_open
(
char
*
pathname
)
{
{
iso_context
*
context
=
g_malloc
(
sizeof
(
iso_context
));
struct
iso9660_archive_file
*
context
=
g_new
(
struct
iso9660_archive_file
,
1
);
context
->
list
=
NULL
;
context
->
list
=
NULL
;
...
@@ -106,17 +107,21 @@ iso_open(char * pathname)
...
@@ -106,17 +107,21 @@ iso_open(char * pathname)
}
}
static
void
static
void
iso_scan_reset
(
struct
archive_file
*
file
)
iso
9660_archive
_scan_reset
(
struct
archive_file
*
file
)
{
{
iso_context
*
context
=
(
iso_context
*
)
file
;
struct
iso9660_archive_file
*
context
=
(
struct
iso9660_archive_file
*
)
file
;
//reset iterator
//reset iterator
context
->
iter
=
context
->
list
;
context
->
iter
=
context
->
list
;
}
}
static
char
*
static
char
*
iso_scan_next
(
struct
archive_file
*
file
)
iso
9660_archive
_scan_next
(
struct
archive_file
*
file
)
{
{
iso_context
*
context
=
(
iso_context
*
)
file
;
struct
iso9660_archive_file
*
context
=
(
struct
iso9660_archive_file
*
)
file
;
char
*
data
=
NULL
;
char
*
data
=
NULL
;
if
(
context
->
iter
!=
NULL
)
{
if
(
context
->
iter
!=
NULL
)
{
///fetch data and goto next
///fetch data and goto next
...
@@ -127,9 +132,11 @@ iso_scan_next(struct archive_file *file)
...
@@ -127,9 +132,11 @@ iso_scan_next(struct archive_file *file)
}
}
static
void
static
void
iso_close
(
struct
archive_file
*
file
)
iso
9660_archive
_close
(
struct
archive_file
*
file
)
{
{
iso_context
*
context
=
(
iso_context
*
)
file
;
struct
iso9660_archive_file
*
context
=
(
struct
iso9660_archive_file
*
)
file
;
GSList
*
tmp
;
GSList
*
tmp
;
if
(
context
->
list
)
{
if
(
context
->
list
)
{
//free list
//free list
...
@@ -146,12 +153,14 @@ iso_close(struct archive_file *file)
...
@@ -146,12 +153,14 @@ iso_close(struct archive_file *file)
/* single archive handling */
/* single archive handling */
static
bool
static
bool
iso_open_stream
(
struct
archive_file
*
file
,
struct
input_stream
*
is
,
iso
9660_archive
_open_stream
(
struct
archive_file
*
file
,
struct
input_stream
*
is
,
const
char
*
pathname
,
GError
**
error_r
)
const
char
*
pathname
,
GError
**
error_r
)
{
{
iso_context
*
context
=
(
iso_context
*
)
file
;
struct
iso9660_archive_file
*
context
=
(
struct
iso9660_archive_file
*
)
file
;
//setup file ops
//setup file ops
is
->
plugin
=
&
iso
_input
plugin
;
is
->
plugin
=
&
iso
9660_input_
plugin
;
//insert back reference
//insert back reference
is
->
data
=
context
;
is
->
data
=
context
;
//we are not seekable
//we are not seekable
...
@@ -170,19 +179,19 @@ iso_open_stream(struct archive_file *file, struct input_stream *is,
...
@@ -170,19 +179,19 @@ iso_open_stream(struct archive_file *file, struct input_stream *is,
}
}
static
void
static
void
iso
_is
_close
(
struct
input_stream
*
is
)
iso
9660_input
_close
(
struct
input_stream
*
is
)
{
{
iso_context
*
context
=
(
iso_context
*
)
is
->
data
;
struct
iso9660_archive_file
*
context
=
is
->
data
;
g_free
(
context
->
statbuf
);
g_free
(
context
->
statbuf
);
iso_close
((
struct
archive_file
*
)
context
);
iso
9660_archive
_close
((
struct
archive_file
*
)
context
);
}
}
static
size_t
static
size_t
iso
_is
_read
(
struct
input_stream
*
is
,
void
*
ptr
,
size_t
size
,
GError
**
error_r
)
iso
9660_input
_read
(
struct
input_stream
*
is
,
void
*
ptr
,
size_t
size
,
GError
**
error_r
)
{
{
iso_context
*
context
=
(
iso_context
*
)
is
->
data
;
struct
iso9660_archive_file
*
context
=
(
struct
iso9660_archive_file
*
)
is
->
data
;
int
toread
,
readed
=
0
;
int
toread
,
readed
=
0
;
int
no_blocks
,
cur_block
;
int
no_blocks
,
cur_block
;
size_t
left_bytes
=
context
->
statbuf
->
size
-
context
->
cur_ofs
;
size_t
left_bytes
=
context
->
statbuf
->
size
-
context
->
cur_ofs
;
...
@@ -218,31 +227,32 @@ iso_is_read(struct input_stream *is, void *ptr, size_t size, GError **error_r)
...
@@ -218,31 +227,32 @@ iso_is_read(struct input_stream *is, void *ptr, size_t size, GError **error_r)
}
}
static
bool
static
bool
iso
_is
_eof
(
struct
input_stream
*
is
)
iso
9660_input
_eof
(
struct
input_stream
*
is
)
{
{
iso_context
*
context
=
(
iso_context
*
)
is
->
data
;
struct
iso9660_archive_file
*
context
=
is
->
data
;
return
(
context
->
cur_ofs
==
context
->
statbuf
->
size
);
return
(
context
->
cur_ofs
==
context
->
statbuf
->
size
);
}
}
/* exported structures */
/* exported structures */
static
const
char
*
const
iso_extensions
[]
=
{
static
const
char
*
const
iso
9660_archive
_extensions
[]
=
{
"iso"
,
"iso"
,
NULL
NULL
};
};
static
const
struct
input_plugin
iso
_input
plugin
=
{
static
const
struct
input_plugin
iso
9660_input_
plugin
=
{
.
close
=
iso
_is
_close
,
.
close
=
iso
9660_input
_close
,
.
read
=
iso
_is
_read
,
.
read
=
iso
9660_input
_read
,
.
eof
=
iso
_is
_eof
,
.
eof
=
iso
9660_input
_eof
,
};
};
const
struct
archive_plugin
iso_plugin
=
{
const
struct
archive_plugin
iso
9660_archive
_plugin
=
{
.
name
=
"iso"
,
.
name
=
"iso"
,
.
open
=
iso_open
,
.
open
=
iso
9660_archive
_open
,
.
scan_reset
=
iso_scan_reset
,
.
scan_reset
=
iso
9660_archive
_scan_reset
,
.
scan_next
=
iso_scan_next
,
.
scan_next
=
iso
9660_archive
_scan_next
,
.
open_stream
=
iso_open_stream
,
.
open_stream
=
iso
9660_archive
_open_stream
,
.
close
=
iso_close
,
.
close
=
iso
9660_archive
_close
,
.
suffixes
=
iso_extensions
.
suffixes
=
iso
9660_archive
_extensions
};
};
src/archive_list.c
View file @
bd97586c
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
extern
const
struct
archive_plugin
bz2_plugin
;
extern
const
struct
archive_plugin
bz2_plugin
;
extern
const
struct
archive_plugin
zzip_archive_plugin
;
extern
const
struct
archive_plugin
zzip_archive_plugin
;
extern
const
struct
archive_plugin
iso_plugin
;
extern
const
struct
archive_plugin
iso
9660_archive
_plugin
;
static
const
struct
archive_plugin
*
const
archive_plugins
[]
=
{
static
const
struct
archive_plugin
*
const
archive_plugins
[]
=
{
#ifdef HAVE_BZ2
#ifdef HAVE_BZ2
...
@@ -36,8 +36,8 @@ static const struct archive_plugin *const archive_plugins[] = {
...
@@ -36,8 +36,8 @@ static const struct archive_plugin *const archive_plugins[] = {
#ifdef HAVE_ZZIP
#ifdef HAVE_ZZIP
&
zzip_archive_plugin
,
&
zzip_archive_plugin
,
#endif
#endif
#ifdef HAVE_ISO
#ifdef HAVE_ISO
9660
&
iso_plugin
,
&
iso
9660_archive
_plugin
,
#endif
#endif
NULL
NULL
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment