method
add_value
v1_9_1_378 -
Show latest stable
-
0 notes -
Class: Config
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378 (0)
- 1_9_2_180 (0)
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (38)
- 2_2_9 (0)
- 2_4_6 (0)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
add_value(p1, p2, p3)
public
Hide source
static VALUE ossl_config_add_value(VALUE self, VALUE section, VALUE name, VALUE value) { #ifdef OSSL_NO_CONF_API rb_notimplement(); #else CONF *conf; CONF_VALUE *sv, *cv; StringValue(section); StringValue(name); StringValue(value); GetConfig(self, conf); if(!(sv = _CONF_get_section(conf, RSTRING_PTR(section)))){ if(!(sv = _CONF_new_section(conf, RSTRING_PTR(section)))){ ossl_raise(eConfigError, NULL); } } if(!(cv = OPENSSL_malloc(sizeof(CONF_VALUE)))){ ossl_raise(eConfigError, NULL); } cv->name = BUF_strdup(RSTRING_PTR(name)); cv->value = BUF_strdup(RSTRING_PTR(value)); if(!cv->name || !cv->value || !_CONF_add_string(conf, sv, cv)){ OPENSSL_free(cv->name); OPENSSL_free(cv->value); OPENSSL_free(cv); ossl_raise(eConfigError, "_CONF_add_string failure"); } return value; #endif }