pike.git/
src/
builtin.cmod
Branch:
Tag:
Non-build tags
All tags
No tags
2014-04-08
2014-04-08 10:11:15 by Martin Nilsson <nilsson@opera.com>
5a3fc03aa66bf13feb6865183b88da452e6c5f59 (
21
lines) (+
21
/-
0
)
[
Show
|
Annotate
]
Branch:
8.0
Added String.range.
1004:
RETURN end_shared_string(s); }
+
/*! @decl array(int) range(string s)
+
*! @appears String.range
+
*!
+
*! Returns the character range of a string in an array of two
+
*! elements. The first element contains the lower bound and the
+
*! second the upper. The precision is only 8 bits, so for wide
+
*! strings only character blocks are known.
+
*/
+
PIKEFUN array(int) string_range(string s)
+
errname String.range;
+
optflags OPT_TRY_OPTIMIZE;
+
{
+
int min, max;
+
check_string_range(s, 0, &min, &max);
+
pop_n_elems(args);
+
push_int(min);
+
push_int(max);
+
f_aggregate(2);
+
}
+
/*! @decl array column(array data, mixed index) *! *! Extract a column from a two-dimensional array.