Ruby  2.4.2p198(2017-09-14revision59899)
Macros | Functions | Variables
compar.c File Reference
#include "ruby/ruby.h"
#include "id.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

static VALUE rb_cmp (VALUE x, VALUE y)
 
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_equal (VALUE x, VALUE y)
 
static int cmpint (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)
 
static VALUE cmp_clamp (VALUE x, VALUE min, VALUE max)
 
void Init_Comparable (void)
 

Variables

VALUE rb_mComparable
 

Macro Definition Documentation

◆ rb_intern

#define rb_intern (   str)    rb_intern_const(str)

Function Documentation

◆ cmp_between()

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

Definition at line 169 of file compar.c.

References cmpint(), Qfalse, and Qtrue.

Referenced by Init_Comparable().

◆ cmp_clamp()

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

Definition at line 193 of file compar.c.

References cmpint(), max(), rb_eArgError, and rb_raise().

Referenced by Init_Comparable().

◆ cmp_eq_recursive()

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

Definition at line 59 of file compar.c.

References Qnil, and rb_cmp().

Referenced by cmp_equal().

◆ cmp_equal()

static VALUE cmp_equal ( VALUE  x,
VALUE  y 
)
static

Definition at line 75 of file compar.c.

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

Referenced by Init_Comparable().

◆ cmp_ge()

static VALUE cmp_ge ( VALUE  x,
VALUE  y 
)
static

Definition at line 117 of file compar.c.

References cmpint(), Qfalse, and Qtrue.

Referenced by Init_Comparable().

◆ cmp_gt()

static VALUE cmp_gt ( VALUE  x,
VALUE  y 
)
static

Definition at line 102 of file compar.c.

References cmpint(), Qfalse, and Qtrue.

Referenced by Init_Comparable().

◆ cmp_le()

static VALUE cmp_le ( VALUE  x,
VALUE  y 
)
static

Definition at line 147 of file compar.c.

References cmpint(), Qfalse, and Qtrue.

Referenced by Init_Comparable().

◆ cmp_lt()

static VALUE cmp_lt ( VALUE  x,
VALUE  y 
)
static

Definition at line 132 of file compar.c.

References cmpint(), Qfalse, and Qtrue.

Referenced by Init_Comparable().

◆ cmpint()

static int cmpint ( VALUE  x,
VALUE  y 
)
static

Definition at line 88 of file compar.c.

References rb_cmp(), and rb_cmpint().

Referenced by cmp_between(), cmp_clamp(), cmp_ge(), cmp_gt(), cmp_le(), and cmp_lt().

◆ Init_Comparable()

void Init_Comparable ( void  )

◆ invcmp_recursive()

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

Definition at line 39 of file compar.c.

References Qnil, and rb_cmp().

Referenced by rb_invcmp().

◆ rb_cmp()

static VALUE rb_cmp ( VALUE  x,
VALUE  y 
)
static

Definition at line 18 of file compar.c.

References idCmp, and rb_funcallv.

Referenced by cmp_eq_recursive(), cmpint(), and invcmp_recursive().

◆ rb_cmperr()

void rb_cmperr ( VALUE  x,
VALUE  y 
)

◆ rb_invcmp()

VALUE rb_invcmp ( VALUE  x,
VALUE  y 
)

Definition at line 46 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

◆ rb_mComparable

VALUE rb_mComparable