2020-04-10 08:11:40 +03:00
|
|
|
#ifndef INTERNAL_RANGE_H /*-*-C-*-vi:se ft=c:*/
|
|
|
|
#define INTERNAL_RANGE_H
|
|
|
|
/**
|
2020-04-08 07:28:13 +03:00
|
|
|
* @author Ruby developers <ruby-core@ruby-lang.org>
|
2019-11-29 09:18:34 +03:00
|
|
|
* @copyright This file is a part of the programming language Ruby.
|
|
|
|
* Permission is hereby granted, to either redistribute and/or
|
|
|
|
* modify this file, provided that the conditions mentioned in the
|
|
|
|
* file COPYING are met. Consult the file for details.
|
2020-04-08 07:28:13 +03:00
|
|
|
* @brief Internal header for Range.
|
2019-11-29 09:18:34 +03:00
|
|
|
*/
|
2019-12-04 07:06:15 +03:00
|
|
|
#include "internal/struct.h" /* for RSTRUCT */
|
2019-11-29 09:18:34 +03:00
|
|
|
|
|
|
|
/* range.c */
|
2019-12-04 07:06:15 +03:00
|
|
|
static inline VALUE RANGE_BEG(VALUE r);
|
|
|
|
static inline VALUE RANGE_END(VALUE r);
|
|
|
|
static inline VALUE RANGE_EXCL(VALUE r);
|
|
|
|
|
|
|
|
static inline VALUE
|
|
|
|
RANGE_BEG(VALUE r)
|
|
|
|
{
|
|
|
|
return RSTRUCT(r)->as.ary[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline VALUE
|
|
|
|
RANGE_END(VALUE r)
|
|
|
|
{
|
2023-05-29 18:38:15 +03:00
|
|
|
return RSTRUCT_GET(r, 1);
|
2019-12-04 07:06:15 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static inline VALUE
|
|
|
|
RANGE_EXCL(VALUE r)
|
|
|
|
{
|
2023-05-29 18:38:15 +03:00
|
|
|
return RSTRUCT_GET(r, 2);
|
2019-12-04 07:06:15 +03:00
|
|
|
}
|
2019-11-29 09:18:34 +03:00
|
|
|
|
2020-10-20 20:40:18 +03:00
|
|
|
VALUE
|
|
|
|
rb_range_component_beg_len(VALUE b, VALUE e, int excl,
|
|
|
|
long *begp, long *lenp, long len, int err);
|
|
|
|
|
2019-11-29 09:18:34 +03:00
|
|
|
#endif /* INTERNAL_RANGE_H */
|