cConfig (Class)

In:

Methods

[]   []=   add_value   each   get_value   inspect   new   parse   section   sections   to_s   value  

Included Modules

Enumerable

Public Class methods

new(...)
parse(p1)

Public Instance methods

Get all numbers as strings - use str.to_i to convert long number = CONF_get_number(confp->config, sect, StringValuePtr(item));

[Source]

/*
 * 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;
}
[]=(p1, p2)
add_value(p1, p2, p3)
each()
get_value(p1, p2)
inspect()
section(p1)
sections()
to_s()
value(...)

[Validate]