1 // Copyright 2009, 2010 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
11 #define charntorune(pv, str, len) __go_get_rune(str, len, pv)
14 runtime_findnull(const byte *s)
18 return __builtin_strlen((const char*) s);
22 runtime_gostringnocopy(const byte *str)
27 s.len = runtime_findnull(str);
36 func stringiter(s String, k int) (retk int) {
40 // retk=0 is end of iteration
52 retk = k + charntorune(&l, s.str+k, s.len-k);
57 func stringiter2(s String, k int) (retk int, retv int32) {
59 // retk=0 is end of iteration
72 retk = k + charntorune(&retv, s.str+k, s.len-k);