2020-04-10 01:11:40 -04:00
|
|
|
#ifndef INTERNAL_RANGE_H /*-*-C-*-vi:se ft=c:*/
|
|
|
|
#define INTERNAL_RANGE_H
|
|
|
|
/**
|
2020-04-08 00:28:13 -04:00
|
|
|
* @author Ruby developers <ruby-core@ruby-lang.org>
|
2019-11-29 01:18:34 -05: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 00:28:13 -04:00
|
|
|
* @brief Internal header for Range.
|
2019-11-29 01:18:34 -05:00
|
|
|
*/
|
2019-12-03 23:06:15 -05:00
|
|
|
#include "internal/struct.h" /* for RSTRUCT */
|
2019-11-29 01:18:34 -05:00
|
|
|
|
|
|
|
/* range.c */
|
2019-12-03 23:06:15 -05: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)
|
|
|
|
{
|
|
|
|
return RSTRUCT(r)->as.ary[1];
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline VALUE
|
|
|
|
RANGE_EXCL(VALUE r)
|
|
|
|
{
|
|
|
|
return RSTRUCT(r)->as.ary[2];
|
|
|
|
}
|
2019-11-29 01:18:34 -05:00
|
|
|
|
2020-10-20 13:40:18 -04:00
|
|
|
VALUE
|
|
|
|
rb_range_component_beg_len(VALUE b, VALUE e, int excl,
|
|
|
|
long *begp, long *lenp, long len, int err);
|
|
|
|
|
2019-11-29 01:18:34 -05:00
|
|
|
#endif /* INTERNAL_RANGE_H */
|