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.
7 #define charntorune(pv, str, len) __go_get_rune(str, len, pv)
10 runtime_findnull(const byte *s)
14 return __builtin_strlen((const char*) s);
18 runtime_gostringnocopy(const byte *str)
22 s.__data = (const unsigned char *) str;
23 s.__length = runtime_findnull(str);
32 func stringiter(s String, k int32) (retk int32) {
36 // retk=0 is end of iteration
48 n = charntorune(&l, s.__data+k, s.__length-k);
49 retk = k + (n ? n : 1);
54 func stringiter2(s String, k int32) (retk int32, retv int32) {
58 // retk=0 is end of iteration
71 n = charntorune(&retv, s.__data+k, s.__length-k);
72 retk = k + (n ? n : 1);