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.
10 #define charntorune(pv, str, len) __go_get_rune(str, len, pv)
13 runtime_findnull(const byte *s)
17 return __builtin_strlen((const char*) s);
21 runtime_gostringnocopy(const byte *str)
25 s.__data = (const unsigned char *) str;
26 s.__length = runtime_findnull(str);
35 func stringiter(s String, k int) (retk int) {
39 // retk=0 is end of iteration
51 retk = k + charntorune(&l, s.__data+k, s.__length-k);
56 func stringiter2(s String, k int) (retk int, retv int) {
58 // retk=0 is end of iteration
71 retk = k + charntorune(&retv, s.__data+k, s.__length-k);