Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Openssl
提交
c4438dc0
T
Third Party Openssl
项目概览
OpenHarmony
/
Third Party Openssl
大约 1 年 前同步成功
通知
9
Star
18
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Openssl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c4438dc0
编写于
11月 30, 2000
作者:
R
Richard Levitte
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change c_zlib further to allow loading a shared zlib on all operating
systems where such an operation is supported.
上级
04ca1689
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
51 addition
and
34 deletion
+51
-34
crypto/comp/c_zlib.c
crypto/comp/c_zlib.c
+51
-34
未找到文件。
crypto/comp/c_zlib.c
浏览文件 @
c4438dc0
...
...
@@ -16,7 +16,9 @@ static COMP_METHOD zlib_method_nozlib={
NULL
,
};
#ifdef ZLIB
#ifndef ZLIB
#undef ZLIB_SHARED
#else
#include <zlib.h>
...
...
@@ -45,34 +47,45 @@ static COMP_METHOD zlib_method={
* and we do not link to a .LIB file.
*/
#if defined(WINDOWS) || defined(WIN32)
#include <windows.h>
# include <windows.h>
# define Z_CALLCONV _stcall
# define ZLIB_SHARED
#else
# define Z_CALLCONV
#endif
/* !(WINDOWS || WIN32) */
#ifdef ZLIB_SHARED
#include <openssl/dso.h>
/* Prototypes for built in stubs */
int
stub_compress
(
Bytef
*
dest
,
uLongf
*
destLen
,
static
int
stub_compress
(
Bytef
*
dest
,
uLongf
*
destLen
,
const
Bytef
*
source
,
uLong
sourceLen
);
int
stub_inflateEnd
(
z_streamp
strm
);
int
stub_inflate
(
z_streamp
strm
,
int
flush
);
int
stub_inflateInit_
(
z_streamp
strm
,
const
char
*
version
,
int
stream_size
);
static
int
stub_inflateEnd
(
z_streamp
strm
);
static
int
stub_inflate
(
z_streamp
strm
,
int
flush
);
static
int
stub_inflateInit_
(
z_streamp
strm
,
const
char
*
version
,
int
stream_size
);
/* Function pointers */
typedef
int
(
_stdcall
*
compress_ft
)(
Bytef
*
dest
,
uLongf
*
destLen
,
typedef
int
Z_CALLCONV
(
*
compress_ft
)(
Bytef
*
dest
,
uLongf
*
destLen
,
const
Bytef
*
source
,
uLong
sourceLen
);
typedef
int
(
_stdcall
*
inflateEnd_ft
)(
z_streamp
strm
);
typedef
int
(
_stdcall
*
inflate_ft
)(
z_streamp
strm
,
int
flush
);
typedef
int
(
_stdcall
*
inflateInit__ft
)(
z_streamp
strm
,
const
char
*
version
,
int
stream_size
);
static
compress_ft
p_compress
=
NULL
;
static
inflateEnd_ft
p_inflateEnd
=
NULL
;
static
inflate_ft
p_inflate
=
NULL
;
static
inflate
_Init__ft
p_inflateInit_
=
NULL
;
typedef
int
Z_CALLCONV
(
*
inflateEnd_ft
)(
z_streamp
strm
);
typedef
int
Z_CALLCONV
(
*
inflate_ft
)(
z_streamp
strm
,
int
flush
);
typedef
int
Z_CALLCONV
(
*
inflateInit__ft
)(
z_streamp
strm
,
const
char
*
version
,
int
stream_size
);
static
compress_ft
p_compress
=
NULL
;
static
inflateEnd_ft
p_inflateEnd
=
NULL
;
static
inflate_ft
p_inflate
=
NULL
;
static
inflate
Init__ft
p_inflateInit_
=
NULL
;
static
int
zlib_loaded
=
0
;
/* only attempt to init func pts once */
static
DSO
*
zlib_dso
=
NULL
;
#define compress stub_compress
#define inflateEnd stub_inflateEnd
#define inflate stub_inflate
#define inflateInit_ stub_inflateInit_
#endif
/*
WINDOWS || WIN32
*/
#endif
/*
ZLIB_SHARED
*/
static
int
zlib_compress_block
(
COMP_CTX
*
ctx
,
unsigned
char
*
out
,
unsigned
int
olen
,
unsigned
char
*
in
,
unsigned
int
ilen
)
...
...
@@ -170,36 +183,41 @@ COMP_METHOD *COMP_zlib(void)
{
COMP_METHOD
*
meth
=
&
zlib_method_nozlib
;
#ifdef ZLIB
#if defined(WINDOWS) || defined(WIN32)
if
(
!
zlib_method
)
#ifdef ZLIB_SHARED
if
(
!
zlib_loaded
)
{
#if defined(WINDOWS) || defined(WIN32)
zlib_dso
=
DSO_load
(
NULL
,
"ZLIB"
,
NULL
,
0
);
if
(
dso
!=
NULL
)
#else
zlib_dso
=
DSO_load
(
NULL
,
"z"
,
NULL
,
0
);
#endif
if
(
zlib_dso
!=
NULL
)
{
(
FARPROC
)
p_compress
=
(
compress_ft
)
DSO_bind_func
(
dso
,
"compress"
);
(
FARPROC
)
p_inflateEnd
=
(
inflateEnd_ft
)
DSO_bind_func
(
dso
,
"inflateEnd"
);
(
FARPROC
)
p_inflate
=
(
inflate_ft
)
DSO_bind_func
(
dso
,
"inflate"
);
(
FARPROC
)
p_inflateInit_
=
(
inflateInit__ft
)
DSO_bind_func
(
dso
,
"inflateInit_"
);
p_compress
=
(
compress_ft
)
DSO_bind_func
(
zlib_dso
,
"compress"
);
p_inflateEnd
=
(
inflateEnd_ft
)
DSO_bind_func
(
zlib_dso
,
"inflateEnd"
);
p_inflate
=
(
inflate_ft
)
DSO_bind_func
(
zlib_dso
,
"inflate"
);
p_inflateInit_
=
(
inflateInit__ft
)
DSO_bind_func
(
zlib_dso
,
"inflateInit_"
);
zlib_loaded
++
;
meth
=
&
zlib_method
;
}
}
#el
se
#el
if defined(ZLIB)
meth
=
&
zlib_method
;
#endif
#endif
return
(
meth
);
}
#ifdef ZLIB
#if defined(WINDOWS) || defined(WIN32)
#ifdef ZLIB_SHARED
/* Stubs for each function to be dynamicly loaded */
static
int
stub_compress
(
Bytef
*
dest
,
uLongf
*
destLen
,
const
Bytef
*
source
,
uLong
sourceLen
)
...
...
@@ -237,5 +255,4 @@ stub_inflateInit_(z_streamp strm, const char * version, int stream_size)
return
(
Z_MEM_ERROR
);
}
#endif
/* WINDOWS || WIN32 */
#endif
/* ZLIB */
#endif
/* ZLIB_SHARED */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录