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
a627a703
Commit
a627a703
authored
Dec 15, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
archive/bz2: no CamelCase
parent
440cfc80
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
bz2_plugin.c
src/archive/bz2_plugin.c
+10
-11
No files found.
src/archive/bz2_plugin.c
View file @
a627a703
...
@@ -183,7 +183,7 @@ bz2_is_close(struct input_stream *is)
...
@@ -183,7 +183,7 @@ bz2_is_close(struct input_stream *is)
}
}
static
bool
static
bool
bz2_fillbuffer
(
bz2_context
*
context
,
size_t
numBytes
)
bz2_fillbuffer
(
bz2_context
*
context
,
size_t
length
)
{
{
size_t
count
;
size_t
count
;
bz_stream
*
bzstream
;
bz_stream
*
bzstream
;
...
@@ -197,7 +197,7 @@ bz2_fillbuffer(bz2_context *context, size_t numBytes)
...
@@ -197,7 +197,7 @@ bz2_fillbuffer(bz2_context *context, size_t numBytes)
context
->
buffer
,
BZ_BUFSIZE
);
context
->
buffer
,
BZ_BUFSIZE
);
if
(
count
==
0
)
{
if
(
count
==
0
)
{
if
(
bzstream
->
avail_out
==
numBytes
)
if
(
bzstream
->
avail_out
==
length
)
return
false
;
return
false
;
if
(
!
input_stream_eof
(
&
context
->
istream
))
if
(
!
input_stream_eof
(
&
context
->
istream
))
...
@@ -211,13 +211,12 @@ bz2_fillbuffer(bz2_context *context, size_t numBytes)
...
@@ -211,13 +211,12 @@ bz2_fillbuffer(bz2_context *context, size_t numBytes)
}
}
static
size_t
static
size_t
bz2_is_read
(
struct
input_stream
*
is
,
void
*
ptr
,
size_t
size
)
bz2_is_read
(
struct
input_stream
*
is
,
void
*
ptr
,
size_t
length
)
{
{
bz2_context
*
context
=
(
bz2_context
*
)
is
->
data
;
bz2_context
*
context
=
(
bz2_context
*
)
is
->
data
;
bz_stream
*
bzstream
;
bz_stream
*
bzstream
;
int
bz_result
;
int
bz_result
;
size_t
numBytes
=
size
;
size_t
nbytes
=
0
;
size_t
bytesRead
=
0
;
if
(
context
->
last_bz_result
!=
BZ_OK
)
if
(
context
->
last_bz_result
!=
BZ_OK
)
return
0
;
return
0
;
...
@@ -226,16 +225,16 @@ bz2_is_read(struct input_stream *is, void *ptr, size_t size)
...
@@ -226,16 +225,16 @@ bz2_is_read(struct input_stream *is, void *ptr, size_t size)
bzstream
=
&
context
->
bzstream
;
bzstream
=
&
context
->
bzstream
;
bzstream
->
next_out
=
ptr
;
bzstream
->
next_out
=
ptr
;
bzstream
->
avail_out
=
numBytes
;
bzstream
->
avail_out
=
length
;
while
(
bzstream
->
avail_out
!=
0
)
{
while
(
bzstream
->
avail_out
!=
0
)
{
if
(
!
bz2_fillbuffer
(
context
,
numBytes
))
if
(
!
bz2_fillbuffer
(
context
,
length
))
break
;
break
;
bz_result
=
BZ2_bzDecompress
(
bzstream
);
bz_result
=
BZ2_bzDecompress
(
bzstream
);
if
(
context
->
last_bz_result
!=
BZ_OK
if
(
context
->
last_bz_result
!=
BZ_OK
&&
bzstream
->
avail_out
==
numBytes
)
{
&&
bzstream
->
avail_out
==
length
)
{
context
->
last_bz_result
=
bz_result
;
context
->
last_bz_result
=
bz_result
;
break
;
break
;
}
}
...
@@ -246,10 +245,10 @@ bz2_is_read(struct input_stream *is, void *ptr, size_t size)
...
@@ -246,10 +245,10 @@ bz2_is_read(struct input_stream *is, void *ptr, size_t size)
}
}
}
}
bytesRead
=
numBytes
-
bzstream
->
avail_out
;
nbytes
=
length
-
bzstream
->
avail_out
;
is
->
offset
+=
bytesRead
;
is
->
offset
+=
nbytes
;
return
bytesRead
;
return
nbytes
;
}
}
static
bool
static
bool
...
...
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