1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext/openssl/ossl_ssl.h
nobu d064e7c857 ossl_ssl_session.c: typed data
* ext/openssl/ossl_ssl_session.c (ossl_ssl_session_type): use
  typed data.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-12 21:58:25 +00:00

41 lines
972 B
C

/*
* $Id$
* 'OpenSSL for Ruby' project
* Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
* All rights reserved.
*/
/*
* This program is licenced under the same licence as Ruby.
* (See the file 'LICENCE'.)
*/
#if !defined(_OSSL_SSL_H_)
#define _OSSL_SSL_H_
#define GetSSL(obj, ssl) do { \
Data_Get_Struct((obj), SSL, (ssl)); \
} while (0)
#define GetSSLSession(obj, sess) do { \
TypedData_Get_Struct((obj), SSL_SESSION, &ossl_ssl_session_type, (sess)); \
if (!(sess)) { \
ossl_raise(rb_eRuntimeError, "SSL Session wasn't initialized."); \
} \
} while (0)
#define SafeGetSSLSession(obj, sess) do { \
OSSL_Check_Kind((obj), cSSLSession); \
GetSSLSession((obj), (sess)); \
} while (0)
extern const rb_data_type_t ossl_ssl_session_type;
extern VALUE mSSL;
extern VALUE eSSLError;
extern VALUE cSSLSocket;
extern VALUE cSSLContext;
extern VALUE cSSLSession;
void Init_ossl_ssl(void);
void Init_ossl_ssl_session(void);
#endif /* _OSSL_SSL_H_ */