Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
795f744c
Commit
795f744c
authored
Dec 23, 2005
by
brian@zim.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Just a few cleanup points in azio. Should solve Ubuntu compile problem.
parent
a580f985
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
17 deletions
+15
-17
storage/archive/azio.c
storage/archive/azio.c
+14
-17
storage/archive/azlib.h
storage/archive/azlib.h
+1
-0
No files found.
storage/archive/azio.c
View file @
795f744c
...
@@ -13,7 +13,6 @@
...
@@ -13,7 +13,6 @@
#include <stdio.h>
#include <stdio.h>
#include "zutil.h"
#include "azlib.h"
#include "azlib.h"
static
int
const
gz_magic
[
2
]
=
{
0x1f
,
0x8b
};
/* gzip magic header */
static
int
const
gz_magic
[
2
]
=
{
0x1f
,
0x8b
};
/* gzip magic header */
...
@@ -26,13 +25,13 @@ static int const gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */
...
@@ -26,13 +25,13 @@ static int const gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */
#define COMMENT 0x10
/* bit 4 set: file comment present */
#define COMMENT 0x10
/* bit 4 set: file comment present */
#define RESERVED 0xE0
/* bits 5..7: reserved */
#define RESERVED 0xE0
/* bits 5..7: reserved */
local
int
az_open
(
azio_stream
*
s
,
const
char
*
path
,
int
Flags
,
File
fd
);
int
az_open
(
azio_stream
*
s
,
const
char
*
path
,
int
Flags
,
File
fd
);
local
int
do_flush
(
azio_stream
*
file
,
int
flush
);
int
do_flush
(
azio_stream
*
file
,
int
flush
);
local
int
get_byte
(
azio_stream
*
s
);
int
get_byte
(
azio_stream
*
s
);
local
void
check_header
(
azio_stream
*
s
);
void
check_header
(
azio_stream
*
s
);
local
int
destroy
(
azio_stream
*
s
);
int
destroy
(
azio_stream
*
s
);
local
void
putLong
(
File
file
,
uLong
x
);
void
putLong
(
File
file
,
uLong
x
);
local
uLong
getLong
(
azio_stream
*
s
);
uLong
getLong
(
azio_stream
*
s
);
/* ===========================================================================
/* ===========================================================================
Opens a gzip (.gz) file for reading or writing. The mode parameter
Opens a gzip (.gz) file for reading or writing. The mode parameter
...
@@ -43,7 +42,7 @@ local uLong getLong(azio_stream *s);
...
@@ -43,7 +42,7 @@ local uLong getLong(azio_stream *s);
can be checked to distinguish the two cases (if errno is zero, the
can be checked to distinguish the two cases (if errno is zero, the
zlib error is Z_MEM_ERROR).
zlib error is Z_MEM_ERROR).
*/
*/
local
int
az_open
(
azio_stream
*
s
,
const
char
*
path
,
int
Flags
,
File
fd
)
int
az_open
(
azio_stream
*
s
,
const
char
*
path
,
int
Flags
,
File
fd
)
{
{
int
err
;
int
err
;
int
level
=
Z_DEFAULT_COMPRESSION
;
/* compression level */
int
level
=
Z_DEFAULT_COMPRESSION
;
/* compression level */
...
@@ -155,7 +154,7 @@ int azdopen(azio_stream *s, File fd, int Flags)
...
@@ -155,7 +154,7 @@ int azdopen(azio_stream *s, File fd, int Flags)
for end of file.
for end of file.
IN assertion: the stream s has been sucessfully opened for reading.
IN assertion: the stream s has been sucessfully opened for reading.
*/
*/
local
int
get_byte
(
s
)
int
get_byte
(
s
)
azio_stream
*
s
;
azio_stream
*
s
;
{
{
if
(
s
->
z_eof
)
return
EOF
;
if
(
s
->
z_eof
)
return
EOF
;
...
@@ -184,7 +183,7 @@ local int get_byte(s)
...
@@ -184,7 +183,7 @@ local int get_byte(s)
s->stream.avail_in is zero for the first time, but may be non-zero
s->stream.avail_in is zero for the first time, but may be non-zero
for concatenated .gz files.
for concatenated .gz files.
*/
*/
local
void
check_header
(
azio_stream
*
s
)
void
check_header
(
azio_stream
*
s
)
{
{
int
method
;
/* method byte */
int
method
;
/* method byte */
int
flags
;
/* flags byte */
int
flags
;
/* flags byte */
...
@@ -250,7 +249,7 @@ local void check_header(azio_stream *s)
...
@@ -250,7 +249,7 @@ local void check_header(azio_stream *s)
* Cleanup then free the given azio_stream. Return a zlib error code.
* Cleanup then free the given azio_stream. Return a zlib error code.
Try freeing in the reverse order of allocations.
Try freeing in the reverse order of allocations.
*/
*/
local
int
destroy
(
s
)
int
destroy
(
s
)
azio_stream
*
s
;
azio_stream
*
s
;
{
{
int
err
=
Z_OK
;
int
err
=
Z_OK
;
...
@@ -426,7 +425,7 @@ int azwrite (azio_stream *s, voidpc buf, unsigned len)
...
@@ -426,7 +425,7 @@ int azwrite (azio_stream *s, voidpc buf, unsigned len)
Flushes all pending output into the compressed file. The parameter
Flushes all pending output into the compressed file. The parameter
flush is as in the deflate() function.
flush is as in the deflate() function.
*/
*/
local
int
do_flush
(
s
,
flush
)
int
do_flush
(
s
,
flush
)
azio_stream
*
s
;
azio_stream
*
s
;
int
flush
;
int
flush
;
{
{
...
@@ -524,7 +523,6 @@ my_off_t azseek (s, offset, whence)
...
@@ -524,7 +523,6 @@ my_off_t azseek (s, offset, whence)
if
(
whence
==
SEEK_SET
)
{
if
(
whence
==
SEEK_SET
)
{
offset
-=
s
->
in
;
offset
-=
s
->
in
;
}
}
if
(
offset
<
0
)
return
-
1L
;
/* At this point, offset is the number of zero bytes to write. */
/* At this point, offset is the number of zero bytes to write. */
/* There was a zmemzero here if inbuf was null -Brian */
/* There was a zmemzero here if inbuf was null -Brian */
...
@@ -546,7 +544,6 @@ my_off_t azseek (s, offset, whence)
...
@@ -546,7 +544,6 @@ my_off_t azseek (s, offset, whence)
if
(
whence
==
SEEK_CUR
)
{
if
(
whence
==
SEEK_CUR
)
{
offset
+=
s
->
out
;
offset
+=
s
->
out
;
}
}
if
(
offset
<
0
)
return
-
1L
;
if
(
s
->
transparent
)
{
if
(
s
->
transparent
)
{
/* map to my_seek */
/* map to my_seek */
...
@@ -599,7 +596,7 @@ my_off_t ZEXPORT aztell (file)
...
@@ -599,7 +596,7 @@ my_off_t ZEXPORT aztell (file)
/* ===========================================================================
/* ===========================================================================
Outputs a long in LSB order to the given file
Outputs a long in LSB order to the given file
*/
*/
local
void
putLong
(
File
file
,
uLong
x
)
void
putLong
(
File
file
,
uLong
x
)
{
{
int
n
;
int
n
;
byte
buffer
[
1
];
byte
buffer
[
1
];
...
@@ -616,7 +613,7 @@ local void putLong (File file, uLong x)
...
@@ -616,7 +613,7 @@ local void putLong (File file, uLong x)
Reads a long in LSB order from the given azio_stream. Sets z_err in case
Reads a long in LSB order from the given azio_stream. Sets z_err in case
of error.
of error.
*/
*/
local
uLong
getLong
(
azio_stream
*
s
)
uLong
getLong
(
azio_stream
*
s
)
{
{
uLong
x
=
(
uLong
)
get_byte
(
s
);
uLong
x
=
(
uLong
)
get_byte
(
s
);
int
c
;
int
c
;
...
...
storage/archive/azlib.h
View file @
795f744c
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
(zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
(zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
*/
*/
#include <zutil.h>
#include <zlib.h>
#include <zlib.h>
#include "../../mysys/mysys_priv.h"
#include "../../mysys/mysys_priv.h"
...
...
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