Only define RVALUE_OVERHEAD if undefined
[ruby.git] / internal / range.h
blob2394937bf874611b6f0a2bb25e77dbd48491e5be
1 #ifndef INTERNAL_RANGE_H /*-*-C-*-vi:se ft=c:*/
2 #define INTERNAL_RANGE_H
3 /**
4 * @author Ruby developers <ruby-core@ruby-lang.org>
5 * @copyright This file is a part of the programming language Ruby.
6 * Permission is hereby granted, to either redistribute and/or
7 * modify this file, provided that the conditions mentioned in the
8 * file COPYING are met. Consult the file for details.
9 * @brief Internal header for Range.
11 #include "internal/struct.h" /* for RSTRUCT */
13 /* range.c */
14 static inline VALUE RANGE_BEG(VALUE r);
15 static inline VALUE RANGE_END(VALUE r);
16 static inline VALUE RANGE_EXCL(VALUE r);
18 static inline VALUE
19 RANGE_BEG(VALUE r)
21 return RSTRUCT(r)->as.ary[0];
24 static inline VALUE
25 RANGE_END(VALUE r)
27 return RSTRUCT_GET(r, 1);
30 static inline VALUE
31 RANGE_EXCL(VALUE r)
33 return RSTRUCT_GET(r, 2);
36 VALUE
37 rb_range_component_beg_len(VALUE b, VALUE e, int excl,
38 long *begp, long *lenp, long len, int err);
40 #endif /* INTERNAL_RANGE_H */