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
440cfc80
Commit
440cfc80
authored
Dec 15, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
archive/zzip: removed the "zip_context" typedef
Use the raw struct name.
parent
c959148e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
zzip_archive_plugin.c
src/archive/zzip_archive_plugin.c
+11
-11
No files found.
src/archive/zzip_archive_plugin.c
View file @
440cfc80
...
...
@@ -30,13 +30,13 @@
#include <glib.h>
#include <string.h>
typedef
struct
{
struct
zzip_archive
{
ZZIP_DIR
*
dir
;
ZZIP_FILE
*
file
;
size_t
length
;
GSList
*
list
;
GSList
*
iter
;
}
zip_context
;
};
static
const
struct
input_plugin
zzip_input_plugin
;
...
...
@@ -45,7 +45,7 @@ static const struct input_plugin zzip_input_plugin;
static
struct
archive_file
*
zzip_archive_open
(
char
*
pathname
)
{
zip_context
*
context
=
g_malloc
(
sizeof
(
zip_
context
));
struct
zzip_archive
*
context
=
g_malloc
(
sizeof
(
*
context
));
ZZIP_DIRENT
dirent
;
// open archive
...
...
@@ -70,7 +70,7 @@ zzip_archive_open(char *pathname)
static
void
zzip_archive_scan_reset
(
struct
archive_file
*
file
)
{
zip_context
*
context
=
(
zip_context
*
)
file
;
struct
zzip_archive
*
context
=
(
struct
zzip_archive
*
)
file
;
//reset iterator
context
->
iter
=
context
->
list
;
}
...
...
@@ -78,7 +78,7 @@ zzip_archive_scan_reset(struct archive_file *file)
static
char
*
zzip_archive_scan_next
(
struct
archive_file
*
file
)
{
zip_context
*
context
=
(
zip_context
*
)
file
;
struct
zzip_archive
*
context
=
(
struct
zzip_archive
*
)
file
;
char
*
data
=
NULL
;
if
(
context
->
iter
!=
NULL
)
{
///fetch data and goto next
...
...
@@ -91,7 +91,7 @@ zzip_archive_scan_next(struct archive_file *file)
static
void
zzip_archive_close
(
struct
archive_file
*
file
)
{
zip_context
*
context
=
(
zip_context
*
)
file
;
struct
zzip_archive
*
context
=
(
struct
zzip_archive
*
)
file
;
if
(
context
->
list
)
{
//free list
for
(
GSList
*
tmp
=
context
->
list
;
tmp
!=
NULL
;
tmp
=
g_slist_next
(
tmp
))
...
...
@@ -110,7 +110,7 @@ static bool
zzip_archive_open_stream
(
struct
archive_file
*
file
,
struct
input_stream
*
is
,
const
char
*
pathname
)
{
zip_context
*
context
=
(
zip_context
*
)
file
;
struct
zzip_archive
*
context
=
(
struct
zzip_archive
*
)
file
;
ZZIP_STAT
z_stat
;
//setup file ops
...
...
@@ -133,7 +133,7 @@ zzip_archive_open_stream(struct archive_file *file, struct input_stream *is,
static
void
zzip_input_close
(
struct
input_stream
*
is
)
{
zip_context
*
context
=
(
zip_context
*
)
is
->
data
;
struct
zzip_archive
*
context
=
(
struct
zzip_archive
*
)
is
->
data
;
zzip_file_close
(
context
->
file
);
zzip_archive_close
((
struct
archive_file
*
)
context
);
...
...
@@ -142,7 +142,7 @@ zzip_input_close(struct input_stream *is)
static
size_t
zzip_input_read
(
struct
input_stream
*
is
,
void
*
ptr
,
size_t
size
)
{
zip_context
*
context
=
(
zip_context
*
)
is
->
data
;
struct
zzip_archive
*
context
=
(
struct
zzip_archive
*
)
is
->
data
;
int
ret
;
ret
=
zzip_file_read
(
context
->
file
,
ptr
,
size
);
if
(
ret
<
0
)
{
...
...
@@ -155,7 +155,7 @@ zzip_input_read(struct input_stream *is, void *ptr, size_t size)
static
bool
zzip_input_eof
(
struct
input_stream
*
is
)
{
zip_context
*
context
=
(
zip_context
*
)
is
->
data
;
struct
zzip_archive
*
context
=
(
struct
zzip_archive
*
)
is
->
data
;
return
((
size_t
)
zzip_tell
(
context
->
file
)
==
context
->
length
);
}
...
...
@@ -163,7 +163,7 @@ static bool
zzip_input_seek
(
G_GNUC_UNUSED
struct
input_stream
*
is
,
G_GNUC_UNUSED
goffset
offset
,
G_GNUC_UNUSED
int
whence
)
{
zip_context
*
context
=
(
zip_context
*
)
is
->
data
;
struct
zzip_archive
*
context
=
(
struct
zzip_archive
*
)
is
->
data
;
zzip_off_t
ofs
=
zzip_seek
(
context
->
file
,
offset
,
whence
);
if
(
ofs
!=
-
1
)
{
is
->
offset
=
ofs
;
...
...
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