Ruby 2.0.0p247(2013-06-27revision41674)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Macros | Functions | Variables
compar.c File Reference
`#include "ruby/ruby.h"`
Include dependency graph for compar.c:

Go to the source code of this file.

## Macros
#define | rb_intern(str) rb_intern_const(str)

## Functions
void | rb_cmperr (VALUE x, VALUE y)
static VALUE | invcmp_recursive (VALUE x, VALUE y, int recursive)
VALUE | rb_invcmp (VALUE x, VALUE y)
static VALUE | cmp_eq (VALUE *a)
static VALUE | cmp_failed (void)
static VALUE | cmp_equal (VALUE x, VALUE y)
static VALUE | cmp_gt (VALUE x, VALUE y)
static VALUE | cmp_ge (VALUE x, VALUE y)
static VALUE | cmp_lt (VALUE x, VALUE y)
static VALUE | cmp_le (VALUE x, VALUE y)
static VALUE | cmp_between (VALUE x, VALUE min, VALUE max)
void | Init_Comparable (void)

## Variables
VALUE | rb_mComparable
static ID | cmp

## Macro Definition Documentation

#define rb_intern | ( |  | str) |  | rb_intern_const(str)

## Function Documentation

static VALUE cmp_between | ( | VALUE | x,
|  | VALUE | min,
|  | VALUE | max
| ) |  |
| static

Definition at line 177 of file compar.c.

References cmp_gt(), cmp_lt(), Qfalse, Qtrue, and RTEST.

Referenced by Init_Comparable().

static VALUE cmp_eq | ( | VALUE * | a) |  |
| static

Definition at line 55 of file compar.c.

References c, cmp, NIL_P, Qfalse, Qtrue, rb_cmpint(), and rb_funcall().

Referenced by cmp_equal().

static VALUE cmp_equal | ( | VALUE | x,
|  | VALUE | y
| ) |  |
| static

Definition at line 83 of file compar.c.

References cmp_eq(), cmp_failed(), Qtrue, and rb_rescue().

Referenced by Init_Comparable().

static VALUE cmp_failed | ( | void | ) |  |
| static

Definition at line 65 of file compar.c.

References Qfalse.

Referenced by cmp_equal().

static VALUE cmp_ge | ( | VALUE | x,
|  | VALUE | y
| ) |  |
| static

Definition at line 119 of file compar.c.

References c, cmp, Qfalse, Qtrue, rb_cmpint(), and rb_funcall().

Referenced by Init_Comparable().

static VALUE cmp_gt | ( | VALUE | x,
|  | VALUE | y
| ) |  |
| static

Definition at line 102 of file compar.c.

References c, cmp, Qfalse, Qtrue, rb_cmpint(), and rb_funcall().

Referenced by cmp_between(), and Init_Comparable().

static VALUE cmp_le | ( | VALUE | x,
|  | VALUE | y
| ) |  |
| static

Definition at line 153 of file compar.c.

References c, cmp, Qfalse, Qtrue, rb_cmpint(), and rb_funcall().

Referenced by Init_Comparable().

static VALUE cmp_lt | ( | VALUE | x,
|  | VALUE | y
| ) |  |
| static

Definition at line 136 of file compar.c.

References c, cmp, Qfalse, Qtrue, rb_cmpint(), and rb_funcall().

Referenced by cmp_between(), and Init_Comparable().

void Init_Comparable | ( | void | ) |  |

Definition at line 224 of file compar.c.

References cmp, cmp_between(), cmp_equal(), cmp_ge(), cmp_gt(), cmp_le(), cmp_lt(), rb_define_method(), rb_define_module(), rb_intern, and rb_mComparable.

static VALUE invcmp_recursive | ( | VALUE | x,
|  | VALUE | y,
|  | int | recursive
| ) |  |
| static

Definition at line 35 of file compar.c.

References cmp, Qnil, and rb_check_funcall().

Referenced by rb_invcmp().

void rb_cmperr | ( | VALUE | x,
|  | VALUE | y
| ) |  |

Definition at line 19 of file compar.c.

References classname(), rb_eArgError, rb_inspect(), rb_obj_classname(), rb_raise(), SPECIAL_CONST_P, and StringValuePtr.

Referenced by int_downto(), int_upto(), rb_cmpint(), and rb_num_coerce_relop().

VALUE rb_invcmp | ( | VALUE | x,
|  | VALUE | y
| ) |  |

Definition at line 42 of file compar.c.

References INT2FIX, invcmp_recursive(), NIL_P, Qnil, Qundef, rb_cmpint(), rb_exec_recursive(), and result.

Referenced by rb_str_cmp_m(), and time_cmp().

## Variable Documentation

ID cmp
| static

Definition at line 16 of file compar.c.

Referenced by cmp_eq(), cmp_ge(), cmp_gt(), cmp_le(), cmp_lt(), Init_Comparable(), invcmp_recursive(), max_i(), max_ii(), min_i(), min_ii(), num_interval_step_size(), num_step(), and rb_mod_cmp().

VALUE rb_mComparable

Definition at line 14 of file compar.c.

Referenced by Init_Comparable(), Init_date_core(), Init_File(), Init_Numeric(), Init_ossl_x509name(), Init_String(), and Init_Time().