Flowdock
add_value(p1, p2, p3) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

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
}
Register or log in to add new notes.