Ruby  2.7.1p83(2020-03-31revisiona0c7c23c9cec0d0ffcba012279cd652d28ad5bf3)
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_ */
Init_ossl_ssl
void Init_ossl_ssl(void)
Definition: ossl_ssl.c:2389
ossl_ssl_type
const rb_data_type_t ossl_ssl_type
Definition: ossl_ssl.c:1524
VALUE
unsigned long VALUE
Definition: ruby.h:102
ossl_ssl_session_type
const rb_data_type_t ossl_ssl_session_type
Definition: ossl_ssl_session.c:16
cSSLSession
VALUE cSSLSession
Definition: ossl_ssl_session.c:7
Init_ossl_ssl_session
void Init_ossl_ssl_session(void)
Definition: ossl_ssl_session.c:308
cSSLSocket
VALUE cSSLSocket
Definition: ossl_ssl.c:30
rb_data_type_struct
Definition: ruby.h:1148
mSSL
VALUE mSSL
Definition: ossl_ssl.c:26