Ruby  2.5.0dev(2017-10-22revision60238)
ossl_ssl.h
Go to the documentation of this file.
1 /*
2  * 'OpenSSL for Ruby' project
3  * Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz>
4  * All rights reserved.
5  */
6 /*
7  * This program is licensed under the same licence as Ruby.
8  * (See the file 'LICENCE'.)
9  */
10 #if !defined(_OSSL_SSL_H_)
11 #define _OSSL_SSL_H_
12 
13 #define GetSSL(obj, ssl) do { \
14  TypedData_Get_Struct((obj), SSL, &ossl_ssl_type, (ssl)); \
15  if (!(ssl)) { \
16  ossl_raise(rb_eRuntimeError, "SSL is not initialized"); \
17  } \
18 } while (0)
19 
20 #define GetSSLSession(obj, sess) do { \
21  TypedData_Get_Struct((obj), SSL_SESSION, &ossl_ssl_session_type, (sess)); \
22  if (!(sess)) { \
23  ossl_raise(rb_eRuntimeError, "SSL Session wasn't initialized."); \
24  } \
25 } while (0)
26 
27 extern const rb_data_type_t ossl_ssl_type;
29 extern VALUE mSSL;
30 extern VALUE cSSLSocket;
31 extern VALUE cSSLSession;
32 
33 void Init_ossl_ssl(void);
34 void Init_ossl_ssl_session(void);
35 
36 #endif /* _OSSL_SSL_H_ */
VALUE mSSL
Definition: ossl_ssl.c:26
VALUE cSSLSocket
Definition: ossl_ssl.c:30
const rb_data_type_t ossl_ssl_session_type
void Init_ossl_ssl_session(void)
void Init_ossl_ssl(void)
Definition: ossl_ssl.c:2255
unsigned long VALUE
Definition: ruby.h:85
const rb_data_type_t ossl_ssl_type
Definition: ossl_ssl.c:1399
VALUE cSSLSession