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
3f64ac04
Commit
3f64ac04
authored
Dec 16, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
archive/bz2: removed the bz2_context typedef
Use the raw struct name instead.
parent
b009970a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
bz2_archive_plugin.c
src/archive/bz2_archive_plugin.c
+13
-13
No files found.
src/archive/bz2_archive_plugin.c
View file @
3f64ac04
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
#define BZ_BUFSIZE 5000
#define BZ_BUFSIZE 5000
typedef
struct
{
struct
bz2_archive_file
{
char
*
name
;
char
*
name
;
bool
reset
;
bool
reset
;
struct
input_stream
istream
;
struct
input_stream
istream
;
...
@@ -47,7 +47,7 @@ typedef struct {
...
@@ -47,7 +47,7 @@ typedef struct {
bz_stream
bzstream
;
bz_stream
bzstream
;
char
*
buffer
;
char
*
buffer
;
}
bz2_context
;
};
static
const
struct
input_plugin
bz2_inputplugin
;
static
const
struct
input_plugin
bz2_inputplugin
;
...
@@ -60,7 +60,7 @@ bz2_quark(void)
...
@@ -60,7 +60,7 @@ bz2_quark(void)
/* single archive handling allocation helpers */
/* single archive handling allocation helpers */
static
bool
static
bool
bz2_alloc
(
bz2_context
*
data
,
GError
**
error_r
)
bz2_alloc
(
struct
bz2_archive_file
*
data
,
GError
**
error_r
)
{
{
int
ret
;
int
ret
;
...
@@ -86,7 +86,7 @@ bz2_alloc(bz2_context *data, GError **error_r)
...
@@ -86,7 +86,7 @@ bz2_alloc(bz2_context *data, GError **error_r)
}
}
static
void
static
void
bz2_destroy
(
bz2_context
*
data
)
bz2_destroy
(
struct
bz2_archive_file
*
data
)
{
{
BZ2_bzDecompressEnd
(
&
data
->
bzstream
);
BZ2_bzDecompressEnd
(
&
data
->
bzstream
);
g_free
(
data
->
buffer
);
g_free
(
data
->
buffer
);
...
@@ -97,7 +97,7 @@ bz2_destroy(bz2_context *data)
...
@@ -97,7 +97,7 @@ bz2_destroy(bz2_context *data)
static
struct
archive_file
*
static
struct
archive_file
*
bz2_open
(
char
*
pathname
)
bz2_open
(
char
*
pathname
)
{
{
bz2_context
*
context
;
struct
bz2_archive_file
*
context
;
int
len
;
int
len
;
context
=
g_malloc
(
sizeof
(
*
context
));
context
=
g_malloc
(
sizeof
(
*
context
));
...
@@ -123,14 +123,14 @@ bz2_open(char *pathname)
...
@@ -123,14 +123,14 @@ bz2_open(char *pathname)
static
void
static
void
bz2_scan_reset
(
struct
archive_file
*
file
)
bz2_scan_reset
(
struct
archive_file
*
file
)
{
{
bz2_context
*
context
=
(
bz2_context
*
)
file
;
struct
bz2_archive_file
*
context
=
(
struct
bz2_archive_file
*
)
file
;
context
->
reset
=
true
;
context
->
reset
=
true
;
}
}
static
char
*
static
char
*
bz2_scan_next
(
struct
archive_file
*
file
)
bz2_scan_next
(
struct
archive_file
*
file
)
{
{
bz2_context
*
context
=
(
bz2_context
*
)
file
;
struct
bz2_archive_file
*
context
=
(
struct
bz2_archive_file
*
)
file
;
char
*
name
=
NULL
;
char
*
name
=
NULL
;
if
(
context
->
reset
)
{
if
(
context
->
reset
)
{
...
@@ -144,7 +144,7 @@ bz2_scan_next(struct archive_file *file)
...
@@ -144,7 +144,7 @@ bz2_scan_next(struct archive_file *file)
static
void
static
void
bz2_close
(
struct
archive_file
*
file
)
bz2_close
(
struct
archive_file
*
file
)
{
{
bz2_context
*
context
=
(
bz2_context
*
)
file
;
struct
bz2_archive_file
*
context
=
(
struct
bz2_archive_file
*
)
file
;
g_free
(
context
->
name
);
g_free
(
context
->
name
);
...
@@ -158,7 +158,7 @@ static bool
...
@@ -158,7 +158,7 @@ static bool
bz2_open_stream
(
struct
archive_file
*
file
,
struct
input_stream
*
is
,
bz2_open_stream
(
struct
archive_file
*
file
,
struct
input_stream
*
is
,
G_GNUC_UNUSED
const
char
*
path
,
GError
**
error_r
)
G_GNUC_UNUSED
const
char
*
path
,
GError
**
error_r
)
{
{
bz2_context
*
context
=
(
bz2_context
*
)
file
;
struct
bz2_archive_file
*
context
=
(
struct
bz2_archive_file
*
)
file
;
//setup file ops
//setup file ops
is
->
plugin
=
&
bz2_inputplugin
;
is
->
plugin
=
&
bz2_inputplugin
;
...
@@ -177,7 +177,7 @@ bz2_open_stream(struct archive_file *file, struct input_stream *is,
...
@@ -177,7 +177,7 @@ bz2_open_stream(struct archive_file *file, struct input_stream *is,
static
void
static
void
bz2_is_close
(
struct
input_stream
*
is
)
bz2_is_close
(
struct
input_stream
*
is
)
{
{
bz2_context
*
context
=
(
bz2_context
*
)
is
->
data
;
struct
bz2_archive_file
*
context
=
(
struct
bz2_archive_file
*
)
is
->
data
;
bz2_destroy
(
context
);
bz2_destroy
(
context
);
is
->
data
=
NULL
;
is
->
data
=
NULL
;
...
@@ -185,7 +185,7 @@ bz2_is_close(struct input_stream *is)
...
@@ -185,7 +185,7 @@ bz2_is_close(struct input_stream *is)
}
}
static
bool
static
bool
bz2_fillbuffer
(
bz2_context
*
context
,
GError
**
error_r
)
bz2_fillbuffer
(
struct
bz2_archive_file
*
context
,
GError
**
error_r
)
{
{
size_t
count
;
size_t
count
;
bz_stream
*
bzstream
;
bz_stream
*
bzstream
;
...
@@ -210,7 +210,7 @@ static size_t
...
@@ -210,7 +210,7 @@ static size_t
bz2_is_read
(
struct
input_stream
*
is
,
void
*
ptr
,
size_t
length
,
bz2_is_read
(
struct
input_stream
*
is
,
void
*
ptr
,
size_t
length
,
GError
**
error_r
)
GError
**
error_r
)
{
{
bz2_context
*
context
=
(
bz2_context
*
)
is
->
data
;
struct
bz2_archive_file
*
context
=
(
struct
bz2_archive_file
*
)
is
->
data
;
bz_stream
*
bzstream
;
bz_stream
*
bzstream
;
int
bz_result
;
int
bz_result
;
size_t
nbytes
=
0
;
size_t
nbytes
=
0
;
...
@@ -249,7 +249,7 @@ bz2_is_read(struct input_stream *is, void *ptr, size_t length,
...
@@ -249,7 +249,7 @@ bz2_is_read(struct input_stream *is, void *ptr, size_t length,
static
bool
static
bool
bz2_is_eof
(
struct
input_stream
*
is
)
bz2_is_eof
(
struct
input_stream
*
is
)
{
{
bz2_context
*
context
=
(
bz2_context
*
)
is
->
data
;
struct
bz2_archive_file
*
context
=
(
struct
bz2_archive_file
*
)
is
->
data
;
return
context
->
eof
;
return
context
->
eof
;
}
}
...
...
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