TkUtil (Module)

In: tk/tkutil.c

/

Classes and Modules

Class TkUtil::CallbackSubst
  ::Class TkUtil::CallbackSubst::Info

Public Class methods

_get_eval_enc_str(p1)
_get_eval_string(...)
_symbolkey2str(p1)

/

[Source]

/*************************************/

static VALUE
tcl2rb_bool(self, value)
    VALUE self;
    VALUE value;
{
    if (TYPE(value) == T_FIXNUM) {
	if (NUM2INT(value) == 0) {
	    return Qfalse;
	} else {
	    return Qtrue;
	}
    }

    rb_check_type(value, T_STRING);

    if (RSTRING(value)->ptr[0] == '\0'
	|| strcmp(RSTRING(value)->ptr, "0") == 0
	|| strcmp(RSTRING(value)->ptr, "no") == 0
	|| strcmp(RSTRING(value)->ptr, "false") == 0) {
	return Qfalse;
    } else {
	return Qtrue;
    }
}
callback(...)

/

[Source]

/*************************************/

static VALUE
tk_eval_cmd(argc, argv, self)
    int argc;
    VALUE argv[];
    VALUE self;
{
    volatile VALUE cmd, rest, arg;
    volatile VALUE ret;
    int status;

    rb_scan_args(argc, argv, "1*", &cmd, &rest);
    return rb_eval_cmd(cmd, rest, 0);
}
hash_kv(...)
install_cmd(...)
num_or_str(p1)
number(p1)
string(p1)
uninstall_cmd(p1)

Public Instance methods

_conv_args(...)
_fromUTF8(...)
_get_eval_enc_str(p1)
_get_eval_string(...)
_symbolkey2str(p1)
_toUTF8(...)

/

[Source]

/*************************************/

static VALUE
tcl2rb_bool(self, value)
    VALUE self;
    VALUE value;
{
    if (TYPE(value) == T_FIXNUM) {
	if (NUM2INT(value) == 0) {
	    return Qfalse;
	} else {
	    return Qtrue;
	}
    }

    rb_check_type(value, T_STRING);

    if (RSTRING(value)->ptr[0] == '\0'
	|| strcmp(RSTRING(value)->ptr, "0") == 0
	|| strcmp(RSTRING(value)->ptr, "no") == 0
	|| strcmp(RSTRING(value)->ptr, "false") == 0) {
	return Qfalse;
    } else {
	return Qtrue;
    }
}
hash_kv(...)
num_or_str(p1)
number(p1)
string(p1)

[Validate]