aboutsummaryrefslogtreecommitdiffstats
path: root/ext/openssl/ossl.h
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2016-12-11 18:43:54 +0900
committerKazuki Yamaguchi <k@rhe.jp>2017-05-22 10:02:03 +0900
commit1596d19f0f3042e2022aec5aeae5afbb7df01386 (patch)
tree65821269a0f75523145e1fbd7d9b7a8dd37d744a /ext/openssl/ossl.h
parent3dd75865b7bf7bd5b89eb760c2e131a27bdd1d43 (diff)
downloadruby-openssl-1596d19f0f3042e2022aec5aeae5afbb7df01386.tar.gz
Add ossl_str_new(), an exception-safe rb_str_new()
Add a new function ossl_str_new() as an exception-safe wrapper of rb_str_new(). This is useful for the openssl library because we can't always raise NoMemoryError immediately due to the independent memory management of OpenSSL.
Diffstat (limited to 'ext/openssl/ossl.h')
-rw-r--r--ext/openssl/ossl.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/openssl/ossl.h b/ext/openssl/ossl.h
index a11d93cd..08bc8b8a 100644
--- a/ext/openssl/ossl.h
+++ b/ext/openssl/ossl.h
@@ -92,6 +92,7 @@ VALUE ossl_x509_sk2ary(const STACK_OF(X509) *certs);
VALUE ossl_x509crl_sk2ary(const STACK_OF(X509_CRL) *crl);
VALUE ossl_x509name_sk2ary(const STACK_OF(X509_NAME) *names);
VALUE ossl_buf2str(char *buf, int len);
+VALUE ossl_str_new(const char *, long, int *);
#define ossl_str_adjust(str, p) \
do{\
long len = RSTRING_LEN(str);\