| In: |
Get all numbers as strings - use str.to_i to convert long number = CONF_get_number(confp->config, sect, StringValuePtr(item));
/*
* Get all numbers as strings - use str.to_i to convert
* long number = CONF_get_number(confp->config, sect, StringValuePtr(item));
*/
static VALUE
ossl_config_get_section(VALUE self, VALUE section)
{
CONF *conf;
STACK_OF(CONF_VALUE) *sk;
CONF_VALUE *entry;
int i, entries;
VALUE hash;
hash = rb_hash_new();
GetConfig(self, conf);
if (!(sk = NCONF_get_section(conf, StringValuePtr(section)))) {
ERR_clear_error();
return hash;
}
if ((entries = sk_CONF_VALUE_num(sk)) < 0) {
OSSL_Debug("# of items in section is < 0?!?");
return hash;
}
for (i=0; i<entries; i++) {
entry = sk_CONF_VALUE_value(sk, i);
rb_hash_aset(hash, rb_str_new2(entry->name), rb_str_new2(entry->value));
}
return hash;
}