Ruby 1.9.2p136(2010-12-25revision30365)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Defines | Functions | Variables

# ext/openssl/ossl_config.c File Reference

`#include "ossl.h"`
Include dependency graph for ossl_config.c:

Go to the source code of this file.

## Defines
#define | WrapConfig(klass, obj, conf)
#define | GetConfig(obj, conf)
#define | SafeGetConfig(obj, conf)
## Functions
static CONF * | parse_config (VALUE, CONF *)
CONF * | GetConfigPtr (VALUE obj)
CONF * | DupConfigPtr (VALUE obj)
static VALUE | ossl_config_s_parse (VALUE klass, VALUE str)
static VALUE | ossl_config_s_alloc (VALUE klass)
static VALUE | ossl_config_copy (VALUE self, VALUE other)
static VALUE | ossl_config_initialize (int argc, VALUE *argv, VALUE self)
static VALUE | ossl_config_add_value (VALUE self, VALUE section, VALUE name, VALUE value)
static void | rb_ossl_config_modify_check (VALUE config)
static VALUE | ossl_config_add_value_m (VALUE self, VALUE section, VALUE name, VALUE value)
static VALUE | ossl_config_get_value (VALUE self, VALUE section, VALUE name)
static VALUE | ossl_config_get_value_old (int argc, VALUE *argv, VALUE self)
static VALUE | set_conf_section_i (VALUE i, VALUE *arg)
static VALUE | ossl_config_set_section (VALUE self, VALUE section, VALUE hash)
static VALUE | ossl_config_get_section (VALUE self, VALUE section)
static VALUE | ossl_config_get_section_old (VALUE self, VALUE section)
static VALUE | ossl_config_get_sections (VALUE self)
static VALUE | ossl_config_to_s (VALUE self)
static VALUE | ossl_config_each (VALUE self)
static VALUE | ossl_config_inspect (VALUE self)
void | Init_ossl_config ()
## Variables
VALUE | cConfig
VALUE | eConfigError

## Define Documentation

#define GetConfig | ( |  | obj,
|  |  | conf
| ) |  |

Value:

    do { \
        Data_Get_Struct(obj, CONF, conf); \
        if (!conf) { \
            ossl_raise(rb_eRuntimeError, "Config wasn't intitialized!"); \
        } \
    } while (0)

Definition at line 19 of file ossl_config.c.

Referenced by ossl_config_add_value(), ossl_config_copy(), ossl_config_get_section(), ossl_config_get_value(), and ossl_config_initialize().

#define SafeGetConfig | ( |  | obj,
|  |  | conf
| ) |  |

Value:

    do { \
        OSSL_Check_Kind(obj, cConfig); \
        GetConfig(obj, conf); \
    } while(0);

Definition at line 25 of file ossl_config.c.

Referenced by GetConfigPtr().

#define WrapConfig | ( |  | klass,
|  |  | obj,
|  |  | conf
| ) |  |

Value:

    do { \
        if (!conf) { \
            ossl_raise(rb_eRuntimeError, "Config wasn't intitialized!"); \
        } \
        obj = Data_Wrap_Struct(klass, 0, NCONF_free, conf); \
    } while (0)

Definition at line 13 of file ossl_config.c.

Referenced by ossl_config_s_alloc(), and ossl_config_s_parse().

## Function Documentation

CONF* DupConfigPtr | ( | VALUE | obj | ) |

Definition at line 53 of file ossl_config.c.

References cConfig, NULL, OSSL_Check_Kind, parse_config(), rb_funcall(), and rb_intern.

CONF* GetConfigPtr | ( | VALUE | obj | ) |

Definition at line 43 of file ossl_config.c.

References SafeGetConfig.

Referenced by ossl_x509extfactory_create_ext().

void Init_ossl_config | ( | void |  | ) |

Definition at line 466 of file ossl_config.c.

References cConfig, CLASS_OF, CONF_get1_default_config_file(), eConfigError, eOSSLError, mOSSL, ossl_config_add_value_m(), ossl_config_copy(), ossl_config_each(), ossl_config_get_section(), ossl_config_get_section_old(), ossl_config_get_sections(), ossl_config_get_value(), ossl_config_get_value_old(), ossl_config_initialize(), ossl_config_inspect(), ossl_config_s_alloc(), ossl_config_s_parse(), ossl_config_set_section(), ossl_config_to_s(), rb_cObject, rb_define_alias(), rb_define_alloc_func(), rb_define_class_under(), rb_define_const(), rb_define_copy_func, rb_define_method(), rb_define_singleton_method(), rb_include_module(), rb_mEnumerable, and rb_str_new2().

Referenced by Init_openssl().

static VALUE ossl_config_add_value | ( | VALUE | self,
|  | VALUE | section,
|  | VALUE | name,
|  | VALUE | value
| ) |  | `[static]`

Definition at line 162 of file ossl_config.c.

References cv, eConfigError, GetConfig, NULL, ossl_raise(), rb_notimplement(), RSTRING_PTR, and StringValue.

Referenced by ossl_config_add_value_m(), and set_conf_section_i().

static VALUE ossl_config_add_value_m | ( | VALUE | self,
|  | VALUE | section,
|  | VALUE | name,
|  | VALUE | value
| ) |  | `[static]`

Definition at line 205 of file ossl_config.c.

References ossl_config_add_value(), and rb_ossl_config_modify_check().

Referenced by Init_ossl_config().

static VALUE ossl_config_copy | ( | VALUE | self,
|  | VALUE | other
| ) |  | `[static]`

Definition at line 117 of file ossl_config.c.

References GetConfig, parse_config(), rb_funcall(), and rb_intern.

Referenced by Init_ossl_config().

static VALUE ossl_config_each | ( | VALUE | self | ) | `[static]`

Definition at line 440 of file ossl_config.c.

References rb_warn().

Referenced by Init_ossl_config().

static VALUE ossl_config_get_section | ( | VALUE | self,
|  | VALUE | section
| ) |  | `[static]`

Definition at line 281 of file ossl_config.c.

References GetConfig, hash(), OSSL_Debug, rb_hash_aset(), rb_hash_new(), rb_str_new2(), STACK_OF(), StringValue, and StringValuePtr.

Referenced by Init_ossl_config(), and ossl_config_get_section_old().

static VALUE ossl_config_get_section_old | ( | VALUE | self,
|  | VALUE | section
| ) |  | `[static]`

Definition at line 309 of file ossl_config.c.

References ossl_config_get_section(), and rb_warn().

Referenced by Init_ossl_config().

static VALUE ossl_config_get_sections | ( | VALUE | self | ) | `[static]`

Definition at line 426 of file ossl_config.c.

References rb_ary_new(), and rb_warn().

Referenced by Init_ossl_config(), and ossl_config_inspect().

static VALUE ossl_config_get_value | ( | VALUE | self,
|  | VALUE | section,
|  | VALUE | name
| ) |  | `[static]`

Definition at line 215 of file ossl_config.c.

References GetConfig, Qnil, rb_str_new2(), RSTRING_PTR, and StringValue.

Referenced by Init_ossl_config(), and ossl_config_get_value_old().

static VALUE ossl_config_get_value_old | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  | `[static]`

Definition at line 233 of file ossl_config.c.

References name, NIL_P, ossl_config_get_value(), rb_scan_args(), rb_str_new2(), and rb_warn().

Referenced by Init_ossl_config().

static VALUE ossl_config_initialize | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  | `[static]`

Definition at line 130 of file ossl_config.c.

References eConfigError, GetConfig, NIL_P, ossl_raise(), rb_eArgError, rb_raise(), rb_scan_args(), SafeStringValue, and StringValuePtr.

Referenced by Init_ossl_config().

static VALUE ossl_config_inspect | ( | VALUE | self | ) | `[static]`

Definition at line 448 of file ossl_config.c.

References ossl_config_get_sections(), rb_class2name(), rb_inspect(), rb_obj_class(), rb_str_append(), rb_str_cat2(), and rb_str_new2().

Referenced by Init_ossl_config().

static VALUE ossl_config_s_alloc | ( | VALUE | klass | ) | `[static]`

Definition at line 104 of file ossl_config.c.

References eConfigError, NULL, ossl_raise(), and WrapConfig.

Referenced by Init_ossl_config().

static VALUE ossl_config_s_parse | ( | VALUE | klass,
|  | VALUE | str
| ) |  | `[static]`

Definition at line 92 of file ossl_config.c.

References NULL, parse_config(), and WrapConfig.

Referenced by Init_ossl_config().

static VALUE ossl_config_set_section | ( | VALUE | self,
|  | VALUE | section,
|  | VALUE | hash
| ) |  | `[static]`

Definition at line 265 of file ossl_config.c.

References hash(), rb_block_call, rb_intern, rb_ossl_config_modify_check(), and set_conf_section_i().

Referenced by Init_ossl_config().

static VALUE ossl_config_to_s | ( | VALUE | self | ) | `[static]`

Definition at line 433 of file ossl_config.c.

References rb_str_new(), and rb_warn().

Referenced by Init_ossl_config().

static CONF * parse_config | ( | VALUE | str,
|  | CONF * | dst
| ) |  | `[static]`

Definition at line 67 of file ossl_config.c.

References eConfigError, NULL, ossl_obj2bio(), and ossl_raise().

Referenced by DupConfigPtr(), ossl_config_copy(), and ossl_config_s_parse().

static void rb_ossl_config_modify_check | ( | VALUE | config | ) | `[static]`

Definition at line 196 of file ossl_config.c.

References OBJ_FROZEN, OBJ_UNTRUSTED, rb_error_frozen(), rb_eSecurityError, rb_raise(), and rb_safe_level.

Referenced by ossl_config_add_value_m(), and ossl_config_set_section().

static VALUE set_conf_section_i | ( | VALUE | i,
|  | VALUE * | arg
| ) |  | `[static]`

Definition at line 252 of file ossl_config.c.

References Check_Type, name, ossl_config_add_value(), Qnil, rb_ary_entry(), and T_ARRAY.

Referenced by ossl_config_set_section().

## Variable Documentation

VALUE cConfig

Definition at line 33 of file ossl_config.c.

Referenced by DupConfigPtr(), and Init_ossl_config().

VALUE eConfigError

Definition at line 34 of file ossl_config.c.

Referenced by Init_ossl_config(), ossl_config_add_value(), ossl_config_initialize(), ossl_config_s_alloc(), and parse_config().