Ruby 3.4.5p51 (2025-07-16 revision 20cda200d3ce092571d0b5d342dadca69636cb0f)
|
Public APIs related to rb_cRange. More...
#include "ruby/internal/attr/nonnull.h"
#include "ruby/internal/dllexport.h"
#include "ruby/internal/value.h"
Go to the source code of this file.
Functions | |
VALUE | rb_range_new (VALUE beg, VALUE end, int excl) |
Creates a new Range. | |
VALUE | rb_range_beg_len (VALUE range, long *begp, long *lenp, long len, int err) |
Deconstructs a numerical range. | |
int | rb_range_values (VALUE range, VALUE *begp, VALUE *endp, int *exclp) |
Deconstructs a range into its components. |
Public APIs related to rb_cRange.
Definition in file range.h.
Deconstructs a numerical range.
As the arguments are long based, it expects everything are in the long domain.
[in] | range | A range of numerical endpoints. |
[out] | begp | Return value buffer. |
[out] | lenp | Return value buffer. |
[in] | len | Updated length. |
[in] | err | In case len is out of range...
|
rb_eTypeError | `range` is not a numerical range. |
rb_eRangeError | `range` cannot fit into `long`. |
RUBY_Qfalse | range is not an rb_cRange. |
RUBY_Qnil | len is out of range but err is zero. |
RUBY_Qtrue | Otherwise. |
Definition at line 1892 of file range.c.
Referenced by rb_get_values_at().
Creates a new Range.
[in] | beg | "Left" or "lowest" endpoint of the range. |
[in] | end | "Right" or "highest" endpoint of the range. |
[in] | excl | Whether the range is open-ended. |
rb_eArgError | `beg` and `end` are not comparable. |
Definition at line 68 of file range.c.
Referenced by rb_range_new().
Deconstructs a range into its components.
[in] | range | Range or range-ish object. |
[out] | begp | Return value buffer. |
[out] | endp | Return value buffer. |
[out] | exclp | Return value buffer. |
RUBY_Qfalse | range is not an instance of rb_cRange. |
RUBY_Qtrue | Argument pointers are updated. |
Definition at line 1804 of file range.c.
Referenced by rb_arithmetic_sequence_extract(), and rb_range_beg_len().