Ruby  2.1.10p492(2016-04-01revision54464)
Macros | Functions | Variables
compar.c File Reference
#include "ruby/ruby.h"

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_recursive (VALUE arg1, VALUE arg2, int recursive)
 
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

◆ rb_intern

#define rb_intern (   str)    rb_intern_const(str)

Referenced by Init_Comparable().

Function Documentation

◆ cmp_between()

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

Definition at line 184 of file compar.c.

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

Referenced by Init_Comparable().

◆ cmp_eq()

static VALUE cmp_eq ( VALUE a)
static

Definition at line 62 of file compar.c.

References cmp_eq_recursive(), NIL_P, Qfalse, Qtrue, rb_cmpint(), and rb_exec_recursive_paired_outer().

Referenced by cmp_equal().

◆ cmp_eq_recursive()

static VALUE cmp_eq_recursive ( VALUE  arg1,
VALUE  arg2,
int  recursive 
)
static

Definition at line 55 of file compar.c.

References cmp, Qfalse, and rb_funcallv().

Referenced by cmp_eq().

◆ cmp_equal()

static VALUE cmp_equal ( VALUE  x,
VALUE  y 
)
static

Definition at line 90 of file compar.c.

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

Referenced by Init_Comparable().

◆ cmp_failed()

static VALUE cmp_failed ( void  )
static

Definition at line 72 of file compar.c.

References Qfalse.

Referenced by cmp_equal().

◆ cmp_ge()

static VALUE cmp_ge ( VALUE  x,
VALUE  y 
)
static

Definition at line 126 of file compar.c.

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

Referenced by Init_Comparable().

◆ cmp_gt()

static VALUE cmp_gt ( VALUE  x,
VALUE  y 
)
static

Definition at line 109 of file compar.c.

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

Referenced by cmp_between(), and Init_Comparable().

◆ cmp_le()

static VALUE cmp_le ( VALUE  x,
VALUE  y 
)
static

Definition at line 160 of file compar.c.

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

Referenced by Init_Comparable().

◆ cmp_lt()

static VALUE cmp_lt ( VALUE  x,
VALUE  y 
)
static

Definition at line 143 of file compar.c.

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

Referenced by cmp_between(), and Init_Comparable().

◆ Init_Comparable()

void Init_Comparable ( void  )

◆ invcmp_recursive()

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().

◆ rb_cmperr()

void rb_cmperr ( VALUE  x,
VALUE  y 
)

◆ rb_invcmp()

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

◆ cmp

ID cmp
static

◆ rb_mComparable

VALUE rb_mComparable