зеркало из https://github.com/github/ruby.git
ossl_ocsp.c: typed data
* ext/openssl/ossl_ocsp.c (ossl_ocsp_basicresp_type): use typed data. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48797 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
c3202f63b1
Коммит
e97e41e34a
|
@ -41,10 +41,10 @@
|
||||||
|
|
||||||
#define WrapOCSPBasicRes(klass, obj, res) do { \
|
#define WrapOCSPBasicRes(klass, obj, res) do { \
|
||||||
if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
|
if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
|
||||||
(obj) = Data_Wrap_Struct((klass), 0, OCSP_BASICRESP_free, (res)); \
|
(obj) = TypedData_Wrap_Struct((klass), &ossl_ocsp_basicresp_type, (res)); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define GetOCSPBasicRes(obj, res) do { \
|
#define GetOCSPBasicRes(obj, res) do { \
|
||||||
Data_Get_Struct((obj), OCSP_BASICRESP, (res)); \
|
TypedData_Get_Struct((obj), OCSP_BASICRESP, &ossl_ocsp_basicresp_type, (res)); \
|
||||||
if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
|
if(!(res)) ossl_raise(rb_eRuntimeError, "Response wasn't initialized!"); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define SafeGetOCSPBasicRes(obj, res) do { \
|
#define SafeGetOCSPBasicRes(obj, res) do { \
|
||||||
|
@ -100,6 +100,20 @@ static const rb_data_type_t ossl_ocsp_response_type = {
|
||||||
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
|
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void
|
||||||
|
ossl_ocsp_basicresp_free(void *ptr)
|
||||||
|
{
|
||||||
|
OCSP_BASICRESP_free(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
static const rb_data_type_t ossl_ocsp_basicresp_type = {
|
||||||
|
"OpenSSL/OCSP/BASICRESP",
|
||||||
|
{
|
||||||
|
0, ossl_ocsp_basicresp_free,
|
||||||
|
},
|
||||||
|
0, 0, RUBY_TYPED_FREE_IMMEDIATELY,
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Public
|
* Public
|
||||||
*/
|
*/
|
||||||
|
|
Загрузка…
Ссылка в новой задаче